#tools-and-devops
1 messages ยท Page 48 of 1
oh really, might be your OS uses a lot alongside then
stuff like VM, K8s and Spark requires atleast 4GB of RAM each
and I have total 4
also DevOps would not make much sense if u only have 1 node, u should have at least 3 nodes?
devops is a lot of things, not just running kubernetes
oh okay, but what is the final solution then , use AWS free tier without VM?
I mean, you might as well sign up for all the free stuff you can, and if you don't have a credit card ,and AWS is the only one that'll let you have access to resources without a credit card, then it sounds like that's your only option
but I do recommend studying all the non-kubernetes stuff as well. you mentioned Ansible, but there's a whole bunch of other stuff too that you can do locally
don't forget stuff like Terraform and whatever, that should work well with AWS's free tier
also Ci/CD tools. Github Actions for example has a free tier, that works quite nicely for simple things
I think a good start is to learn about Docker compose, similar to Kuberntes but a bit lower level
as I mentioned before, despite being a java app, Jenkins is also an option, but I have mixed feelings about Jenkins
I don't particularly like setting it up
I have Jenkins installed in ubuntu already, but I don't know how to find a project to use it
and another important part of devops is log handling - so I suggest getting to grips with centralised logging. you already deal with Prometheus, but also check out logstash or stackdriver
that's the thing about devops, you can't really study it in isolation
you need something to actually deploy and instrument
...
you can deploy open-source tools though
here'- a good one: deploy your own sentry server
since that's also ostensibly dev-ops related
oh nice, I'll try
the open source edition of sentry is dockerized, and they have some nice guides to doing it. If you're going to mess around with Terraform, you could also consider doing the whole dns/mail thing - so register a domain, point the domain to AWS route 53, and have Terrafrom manage that. Set up Email authentication - DKIM, DMARC, etc., and then either use SES or Sendgrid and set up outgoing email alerts for your sentry box
hell, you could even play around with incoming mail if you wanted to
that's the idea, u r amazing
here's an interesting thing you can do as well: do you know DDNS services?
you can run your own using Route 53 and some scripting
yep, I once saw a video where you can take a fee domain name and run the site with route 53
oh, another dev-ops related thing, though this is more on the network admin side: VPNs. OpenVPN is actually quite easy to set up, you can run that in the cloud
I've set up three of those, and they're always handy, not just for accessing resources, but also if you need to bounce your internet connection around a little
if that stuff is relevant to you, then there's a couple more things: SSH and CA management, using something like Vault (hashicorp)
Vault stuff is related to terrraform right?
generating SSH keys is annoying, you can have Vault handle your CA and key provisioning. You can set up proper host-checking on SSH keys with your own CA
same company - Hashicorp. different tools
I like Hashicorp, and I use Vault, Terraform, and Packer
I need to look into Consul, but might go with Istio instead
(service mesh)
Vault is for secrets management. These days instead of storing the database password anywhere, what happens instead is my deployed apps will fetch a JWT from the VM's infrastructure (something Google provides, allowing scripts to prove trust), and then use that to go to Vault and request the database password
Now my database password doesn't need to be stored anywhere in production. The only thing is needed is the fact that the script is able to prove to Vault that it is running from inside the infrastructure and should therefore be trusted to receive the database password
But Vault will also do key signing, as well as a couple other duties. it's a nice system to run
u sure know what u r talking about, u r good!
the only other thing that I use that I haven't talked about is Apache Airflow, but that's mostly because I have some ETL workloads that I have to run
so do u know Kafka and ETL pipelines too?
I don't recommend that as a thing to learn for studying devops unless you also have ETL tasks. But I like Airflow over alternatives like Spring Dataflow is its DAGs are in Python
and Python is clearly good because we're here on a Python server
Yes, I know good Python, Golang and C++
are you familiar with serverless functions? AWS Lambda and GCP Functions etc.
I've heard about AWS lambda, never used it. I know the theory of many tools
Serverless computing
ok, I think it's a pretty important technology this decade. I highly recommend being familiar with lambda. However, the reason I bring it up is because there's a very nice project called Kubeless which lets you run your own serverless functions on top of kubernetes
your mention of Go reminded me because Kubeless comes with a lot of runtimes, Go included. And honestly, I feel we're going to be seeing a lot more of serverless and service meshes this decade
nice
I use Kubeless because I want to use serverless for some things, but I need some quite large libraries to be installed that I can't easily do in Lambda or GCP Functions, so I roll my own python runtimes with the libraries installed (it's easier than it sounds since the runtimes themselves are really just docker images)
anyway, that's what I know
well u know a lot ๐
hello, I am struggling with writing some python code using boto3 on an AWS EC2 instance. The issue is that I have an instance that has specific permissions to access a resource in AWS and have created a sts:AssumeRole policy. But when I try to use boto3 I do not understand how to assume the role in the client to whatever work I need. I can run the commands use the awscli just fine, but I cannot figure out how to do the equivalent in boto3. In other words, I do not have an explicit credentials key/secret, I am trying to use the instance assume role itself. Hopefully, I am making sense here, but can someone tell me how one goes about this?
@gilded quiver If the instance has the appropriate rights, you just use the boto3 resource like you do with awscli
hmm....
@clear girder i don't understand what I am doing wrong.... does the user have to be root or something for this to work?
it basically is claiming permission denied everytime I try
but the awscli works fine
Are you managing instances in the same region?
well, i am running the python code from the actual instance
so when i specify the command i do use the same region
So what's the command you can do in awscli?
INSTANCE_UUID=$(aws ec2 describe-tags --region ${AZ::-1} --filters "Name=resource-id,Values=${INSTANCE_ID}" --query 'Tags[?Key==`instance_uuid`].Value' --output text)
for some reason the describe tags does not work in python
i kept getting permission denied
import boto3
ec2 = boto3.client('ec2')
response = ec2.describe_instances()
print(response)
try running that real quick
And send a screenshot of the error
You might need to explicitly add the region
So it would be
import boto3
ec2 = boto3.client('ec2', 'us-east-1')
response = ec2.describe_instances()
print(response)
does anyone know how to remove a file from a specific branch
i accidentally published to the master branch, but meant to publish on my own branch
you can use git revert
git checkout branch, git revert <commit hash>, git push
i got it thank you
when you push a repo to a specific branch is it supposed to show up on the master branch as well or just the specific branch
only specific branch, unless someone merges it to master branch
omg yes i got it! thank you
if you are using hosting service, you might consider setting it up to prohibit master branch pushes
in most Linux shells and I think also in cmd is this ESC + . functionality. What it does is, when you for example type:
mkdir ./path/to/file
and then:
cd ESC+. will translate to cd ./path/to/file.
Does this exist in Powershell too?
@lyric bobcat no because Powershell returns result of mkdir so if you wanted to move to directory you created, you just pipe output of new-childitem to set-location
Or new-item for directories, Iโm so bad with file manipulation in Pwsh that Iโm always having to read documentation when I do it.
anyone got a handy program that lets you list and browse an s3 bucket?
anything for linux perhaps via cli
Not much experience with aws tooling or the like in general, thanks
Any recommendations for a macOS app to view the contents of hdf5 files?
meseta, TIL about that in Powershell and also ugh, pipeline stuff
is there a way to see if a certain process is running by name on linux
I tried PSutils however when I try to install it with pip I get "can't find python.h" errors
Straightup, git is literally not ignoring my files correctly.
I haven't added the files to the repo, this .gitignore template I'm using has worked before properly
Here's a link to the .gitignore being used: https://gist.github.com/37fd8bb374428e88add278b1ee09773a
Directory: F:\Programming\Unity\Climb
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 7/7/2020 3:33 AM Climb
-a---- 7/7/2020 8:44 PM 2836 .gitignore
Directory: F:\Programming\Unity\Climb\Climb
Mode LastWriteTime Length Name
d----- 7/7/2020 3:33 AM Temp
d----- 7/7/2020 3:33 AM Assets
d----- 7/7/2020 3:33 AM Packages
d----- 7/7/2020 3:33 AM ProjectSettings
d----- 7/7/2020 3:33 AM Logs
d----- 7/7/2020 3:33 AM Library
d----- 7/7/2020 3:34 AM .idea
d----- 7/7/2020 3:38 AM obj
-a---- 7/7/2020 3:38 AM 917 Climb.sln
-a---- 7/7/2020 5:18 PM 46495 Assembly-CSharp.csproj
PS F:\Programming\Unity\Climb> git status
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
Climb/
```I just can't get my head around why this could be.
On what line is Climb supposed to be ignored?
What do you mean by line?
On what line number should "Climb/" be ignored?
...None? I don't know what you're talking about. Very confused.
Why do you think Climb/ would be ignored? Because it's filled with files that should be ignored?
It shouldn't be? This is a Unity template .gitignore made to ignore unneeded automatically generated project files. Only the Assets, ProjectSettings and Packages folders should be kept, I believe.
sigh Exactly WHAT should git be ignoring but isn't?
Library, Temp, Packages etc. Check the .gitignore above it describes everything that should be ignored but simply... isn't
it's as if the .gitignore doesn't even exist
...what? Do you not see my Gist above? I am extremely confused what you're talking about.
Yes I do
you have /, you have /Climb, inside climb you have /Climb/Temp, /Climb/Assets and so on
you are complaining /Climb is showing up as wanting to be committed yet you can't explain why it shouldn't be
Not waiting to be committed, waiting to be tracked/added to the repo.
It shouldn't, it wouldn't.
Items within Climb would be.
For example, the ./Climb/Temp, ./Climb/Library, ./Climb/Logs folders should be ignored.
so git is operating normally
No. They should be ignored and not be available for tracking, but I can track them, as if the .gitignore doesn't exist at all.
you haven't shown that
https://discordapp.com/channels/267624335836053506/463035462760792066/730239132777054268
Yeah, I have. This git status shows the entire ./Climb/ folder can be tracked.
When I cd in it shows ./ can be tracked (relative).
try git add --dry-run
Climb needs to be tracked, unless it's completely filled with files that won't be tracked
#
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
#```
Root
you haven't shoved into root
since /Climb is root of your project
Actually this is a modified version of that template. Trust me, this .gitignore works for another project perfectly fine.
Plus, if you look at the rules, they shouldn't actually have any problems.
[Ll]ibrary/ should ignore any Library or library folders across the board.
I looked it up and others had different problems with the placement of their .gitignore. Removing the preceding forward slash makes the placement of the .gitignore irrelevant. My template file is organized to be placed at the repository root (not the Unity project root) so that the repository can be organized better overall.
Really, my git stays different
Climb\ is going to get tracked unless it's 100% empty of anything it should follow
is it
The Asset folder has all the stuff in it that should be tracked (scripts, shaders, mats etc).
so git status is going to report Climb\
git add --dry-run is better tracking anyways
But as that dry run reports, it added literally everything
github seems to have different git ignore from you
try that and see if you get results you want
does a .gitignore have to be tracked to be active?
it should be tracked
Rider likely uses git binaries
and once I commit with all of these files the commandline git magically fixes itself
fantastic
actually: not sure if it was the commit or the push that did it, since I pushed before I checked. sounds like commit, though.
I have been trying to get the Python LSP (really any LSP) to work with Neovim, but all the resource I have tried seemed to fail. I tried to follow tutorials implementing ALE and coc.vim and coc-python to no avail. I currently use a solution that uses jedi, but I want to mimic my Vscode setup. Any thoughts?
I made an install.sh file, but the bash command to install gradle out of the other commands didn't work?
Does anybody know what could have gone wrong?
Is this a dependency issue?
How do you get around the difference between pip install and python setup.py install when it comes to data_files?
When running pip from pypi, the data_files get installed directly under /usr and when running locally with setup.py they end up under the package folder at /usr/lib/python3.8/site-packages/<package>/.
setup.py contains:
data_files=[('examples', glob.glob('examples/*.py'))]
It is advised to always use pip install to install packages, also where packages are installed depends upon what rights you have as a user in your pc.
shit that's insanely inconsistent ๐ I'd expect them to end up by default in a place where the installing user always have permission, meaning the package directory by defaullt. pip install --user to get it under the user and pip install to install it to /lib/.... Not completely different cwd..
I use setup.py for local testing as it's way faster. But this.. so how do you define it to the <package lib root> in data_files=? As it's unknown where that will be depending if the user does pip install or pip install --user?
I don't know much either, you should ask it in #โ๏ฝhow-to-get-help
Kinda new to Discord and the meta layers of this "server" or guild is a tad bit confusing. I'll try my luck on stackoverflow ๐ thanks to @heavy knot ๐
shit! , I was just trying to help
I know, it's just there's so many servers and the "how-to-get-help" channel seams to be a bot thing and I'll be moved around and I need to keep track of that heh.
Also, appears I'm not the only one with this issue: https://stackoverflow.com/questions/31787983/data-files-differences-between-pip-and-setuptools (dating back to pre-historic times heh)
I have a Python application that comes with a setup.py script and can be installed via Pip or setuptools. However, I'm finding some annoying differences between the two methods and I want to know the
@heavy knot For reference, using package_data seams to be the only way to do it, as data_files is to unpredictable. The shortcoming of package_data tho is that it is limited to the root folder of your project's source. meaning it can only include things in and from git_repo/src if src is where the library is. The only (dirty) workaround I can see, is to - in the setup.py hotswap in the files you want to include, use package_data to include them, and at the end of your setup.py remove the temporary copies. Essentially doing a build-script for your project that wraps around setup.py. Which would look something like this: https://stackoverflow.com/a/62792591/929999
I have a Python application that comes with a setup.py script and can be installed via Pip or setuptools. However, I'm finding some annoying differences between the two methods and I want to know the
i just use MANIFEST.in and include_package_data=True
it never broke for me
until i switched to poetry and ditched setuptools entirely
is there a way to to run and see the output while using vsc
mhm
is there a way to to run and see the output while using vsc
@chilly wharf yep
download the python extension
i used to ask that too lol
yep
but it doesnt show for some reason
send a pic
ah
ah
hey @gleaming forge can i improve my output console so it looks nicer
i feel like idiot lmao
@chilly wharf don't be lol
you can customise pretty much anything in vsc
do you know any resources to improve the console?
dunno i still have explored a lot of the extensions and stuff
i just changed all my colours
so i can remove this " C:/Users/Qwertzy/AppData/Local/Programs/Python/Python38-32/python.exe"
?
oh
sorry if it wasn't clear before lol
when i pressed run
it shows uup
but when i select run the code in this terminal
python shows up
idk what's the difference
what's yours?
mine just goes to python
with the output
and then python pops up when i run
and outputs there
it shows directly to python?
owww
no idea
does it matter though
oh btw is there a way to add indentations quicker
yea
in vsc
hey @gleaming forge do you ever use pycharm?
nope
hemmm
i wonder should i use pycharm or vscode for bigger projects
vscode is so light i like it
fast boy
i've never had a reason to step out of vsc
i see
i wanna know how to customize my output console
what do you call it?
the console?
what do you mean by customize?
in what way
all the colours and stuff you can change in the settings.json
i spent a while messing around with colours a lil while ago
.json is just a dictionary basically
very useful for storing data
oooww
if it is a dictionary why don't use python?
python also has dictionary?
why must use the .py format
for storing stuff
o ya btw
what's the output called
when we run
and the code shows on the terminal
what is it called?
this part
uh one sec
lemme see
ah
its just terminal
head to settings
and then just scroll until you find something that says edit in settings.json
it'll auto put some stuff in so just undo
and then you can edit whatever you like
which one?
launch.json and settings.json
yeah
and then you just add stuff to them
hey is there any way i can transfer vscode settings and plugins to another vscode in another pc?
and then you just add stuff to them
@gleaming forge oooo
omg
copy the settings.json
that is so neat
and paste it into the other
plugins you would probably have to redownload
damn
how about the libraries i installed through pip?
there is like a sign in thing
that i've never used
so maybe you can actually save a profile
or something
libraries you will need to reinstall
vsc can't save those
they are saved to your computer
ooo
cool
libraries you will need to reinstall
@gleaming forge i see
thank you very much!1
all good
Hey! Are there any differences between, git checkout head filename and just simply git checkout filename?
@sly flare the former explicitly specifies which commit to check out from
the latter implies HEAD
note that git checkout head filename is better spelled git checkout head -- filename
in fact the ability to write git checkout filename is IMO a horrible design decision and one of the biggest mistakes in the git CLI
And, I can use the SHA to, specify the commit right?
yes
git checkout <tree-ish> -- <pathspec>
where "tree-ish" is a commit or even a specific tree object
"version control"
imagine you were working on a project, and your teammate was also working on the project, and you both change the same file
what would you do to combine the changes?
usually the answer is: grab both copies of the project, look at the changes side by side, find all the changes that were made, and then copy/paste the changed parts together to make a single project that contains all the changes
now repeat for every single file that was changed
sounds fun right?
now imagine you had a tool that could look at all the changes you and your teammate made, and automatically combine those changes and warn you when there were conflicts where it can't automatically combine the changes for you to resolve manually
that tool is git
or at least the most basic task that git does. git is a lot more than this - it solves many similar problems
basically yes
how to use git tho
oww
the cli is worth learning, but day to day, using a gui tool or the one integrated into text editors for basic workflow is fine also
the cli is worth learning, but day to day, using a gui tool or the one integrated into text editors for basic workflow is fine also
@blissful sluice i see
I use Atom. but I freely admit VSCode is probably better, I'm just too lazy to set it up
i use the git CLI
i think its still the best way to learn
if you learn the data model first
the CLI isn't that bad
the real problem with git is when you try to "learn by tutorial"
then you make real problems for yourself
I've not used VS Studio for python, I use it very occasionally if I have to touch C++, so I don't know how good it is for python projects
i use the git CLI
@tawdry needle okk noted
I've not used VS Studio for python, I use it very occasionally if I have to touch C++, so I don't know how good it is for python projects
@blissful sluice vscode or vs studio?
I don't use VSCode at all, but I do know it's fairly similar to Atom, but faster and better integration with linters and stuff. VS Studio is a full IDE, I only use it for C++ projects, but don't know what it's like with python
oooo
btw i want to ask if the pip i installed in my computer can be used in vs studio?
like the libraries?
in most cases yes
which cases don't?
as long as you've got your PATHs set up properly
if VS can't find your python installation
ooo that sucks
Is there a way to SSH into a computer that doesn't have OpenSSH Server installed?
as for git, I use git CLI or Atom's git integration depending on whether I already have the project open in Atom or not. It's just already there in the sidebar, so might as well use it
i dont think its possible @final furnace
Atom starts up real slow, so I don't like opening it, and use git bash/WSL to quickly do git stuff
am i an animal if i just use conemu + cmd
conemu is good, I used to use it
powershell is too verbose, git bash / msys is too "not windows"
Windows terminal is nice now
use new win term
im on win 7 at work still
ah ok
stuck here due to covid
use tears
conemu is great
im on win 7 at work still
@tawdry needle wat win 7
conemu settings menu is a mess tho lol
that's so sad
if not new win term, then you can use extraterm
hey you can upgrade it?
i just upgraded my windows 8 to 10 and it's free from youtube!
owww
which i use exclusively for gaming lol
linux mint is the daily driver at home right now
yes
I'm on Win 10 right now, and I've moved most of my python dev to WSL/WSL2 and it's been great except for the editor integration
why not ubuntu
because mint isnt made by canonical
i like ubuntu
and also cinnamon is great
well preferences..
and also cinnamon is great
@tawdry needle yeaaa
i only used it in virtual machines tho
cough virtual box cough
i don't want to dual boot
i had no trouble dual booting
i got refind + win 10 home + mint
no problems here
but i havent tried to full version upgrade mint yet
we will see what breaks
no i mean i have no trouble as well but virtual machine is really neat
every time i try to test drive a distro in a VM i give up after 10 minutes
every time i try to test drive a distro in a VM i give up after 10 minutes
@tawdry needle lol
i need to really spend time with it to feel like i've learned it
yea
more time than im willing to commit to distro hopping
i have a tendency to want to support the "outliers" and "underdogs" but thats tempered by my limited patience for bullshit
e.g. i want to try suse but how much do i really care at the end of the day
i tried guix once but the setup experience was bad
spent like 30 minutes downloading and compiling software updates, i didnt sign up for that
lol
i might revisit for a server deployment one day
hey i spent 2 hours installing kali linux
and i don't even use it because i haven't learned any penetration testing
damn
so i deleted it
and i installed lmde, only to find that cinammon is way better
sucks
installing kali linux is basically a meme lol
lol
try WSL by the way!
nice try
- read some forums
- decide you're going to be a l33t pen tester
- try to install kali linux
- everything breaks
- give up and install ubuntu
lmao yes
- read some forums
- decide you're going to be a l33t pen tester
- try to install kali linux
- everything breaks
- give up and install ubuntu
@tawdry needle lol
sudo apt is godly tho
lololol
@blissful sluice i actually have WSL opensuse installed but i didnt bother to learn how to use it lol
lol, there's a saying:
every linux user has two distros that they use:
- one that's objectively better than the others
- ubuntu when they want to get stuff done
hah
i used sudo apt get install atom to use an atom inside a linux distro inside a virtual machine
geezuz the memory
wsl just booted to a terminal and i realized i could do anything i wanted on that machine from windows cmd or powershell
and if i wanted actual linux i was just a restart away
yeah, WSL is nice, it makes Windows a viable dev machine for backend tasks. It's not perfect, but it's come a long way and now I don't bother switching to my ubuntu box. but I agree, nothing beats actual linux, buuut I'm lazy and don't like switching so often
true if i had to do C/C++ dev on windows i'd be more interested. for python there's basically no difference
i really hate switching or transferring between distros
and WSL linux on Windows is better than trying to run wine
(unless you're developing a linux-based application in python using sockets and gunicorn or something)
yea
yeah, I am
o yea what advantages does linux have over windows tho?
some people loved linux and hated windows
ngl i tend to go full cowboy when i set up a new server and just sudo su - then keep a /root/setup.md file listing whatever i did lol
well for me mostly because I'm developing for linux servers, so getting closer to the intended host just reduces weirdness
ngl i tend to go full cowboy when i set up a new server and just
sudo su -then keep a/root/setup.mdfile listing whatever i did lol
@tawdry needle OMGGG
SUDO SU
LET'S GO
"do as i say, not as i do"
well for me mostly because I'm developing for linux servers, so getting closer to the intended host just reduces weirdness
@blissful sluice i see
"do as i say, not as i do"
@tawdry needle lol
and it crashes
sudo su let's go
lol, I do that, but I took the time to start maintaining ansible scripts for setups
there was some other ansible alternative i found
but I'll admit.... the reason I started doing that was... oh boy, this is some story
but I'll admit.... the reason I started doing that was... oh boy, this is some story
@blissful sluice lol
oh no did you kill a server
@tawdry needle gawd
hell yea
at some point I managed to create a folder called ~ I don't remember how, but I had a folder called that in some directory
ive been tempted to use GNU Stow for this kind of thing
it was only writable by root
it was only writable by root
@blissful sluice oooo
so I did sudo rm -f ~ without thinking
hey all!
wait i forgot that command
@quick nova no need to use the r-word, please.
i'm sorry but what is the r word
oh no @blissful sluice lmao
i actually would pay money for a linux kernel module or compile-time option that forbade creation of stupid filenames like that
and I've definitely nuked my install under similar circumstances before, maybe a dd gone wrong or other what you would definitely call "noob mistakes"
: ' ~ et alia
and so since then, I've maintained some ansible playbooks to set up my dev machines, and it's been nice since then
@quick nova no need to use the r-word, please.
@deep estuary oo i see sorry!
imma delete it
call it an insurance against my stupidity/laziness
and that makes this story channel-relevant, because ansible is an excellent tool for automation and devops
in what program/context?
in vscode
it's probably bits of code that you can quickly insert
an example might be:
class className():
def __init__(self, abc):
self.abc = abc
owwww
if you find it annoying to type stuff like this out all the time, you should be able to make a snippets for it, and automatically drop it in from a snippets menu of some sort. vscode might also be smart enough to let you automatically select className or abc for editing? not sure, haven't used it a lot
AMA on r/Python with PyCharm team from JetBrains in a little under an hour! https://www.reddit.com/r/Python/comments/hmd2ez/ama_with_pycharm_team_from_jetbrains_on_9th_july/
can someone explain the difference between an api vs database
i know databases are used for querying data but idk what the api is and its relation to database
Iโd like to run a python script on a 3 hours schedule, inside a Docker container.
Whatโs the best practice for that? Using a shell script inside the Docker container?
If so, whatโs the shell used for python:latest on Docker? Traditional bash syntax doesnโt work for some reason.
It uses Alpine Linux, whose default shell is ash
If you prefer, you can instead use the Debian container, which comes with bash
Anyone with any experience with Kite, the code completion plugin? There doesn't appear to be a setting that stops the initial dialogue box from popping up every time I start it - any ideas on how to stop it from cluttering my screen when I start it up?
I've tried Google and looked through the documentation ๐ค
Hello. I am currently using pyenv(https://github.com/pyenv/pyenv) and pyenv-virtualenv(https://github.com/pyenv/pyenv-virtualenv) for managing Python installations and Python virtualenvs. I am developing on a Mac and using 'zsh' as my shell (with the Prezto framework). I have a good number of python projects I have worked on, from Flask RESTful APIs to low level scripts. Having the different python versions and virtual environments for each project is incredibly helpful.
I am now starting to do some Data Science work, and I need to install Anaconda/Miniconda. I do not want to break my existing Python Installs and Python Virtual Environments.
What is the best way of installing Anaconda/Miniconda alongside pyenv and pyenv-virtualenv? If it can integrate with pyenv, great! I am also open to having a separate, more isolated install and environment for Anaconda/Miniconda.
Thanks a lot!!!
I don't think conda integrates with pyenv, but it can essentially do the same thing in an arguably less convenient manner.
Conda has its own environments. So you could create a 3.8 environment and a 3.7 one. Python is merely another package in conda, just like numpy and so on.
So you could activate a 3.8 environment and then install virtualenv on it and proceed to create venvs as normal.
I have been thinking keeping it separate might avoid some nasty complications. I do want to avoid breaking my existing pyenv setup, as it is being used for a handful of still active projects
Conda usually wants you to add some stuff to your zshrc so that a conda env is activated by default, or something along those lines.
You can simply not do that and also not add any of conda's environments to your PATH.
So you would need to always explicitly use a conda command to activate a conda environment
I'm not sure if you'd always need to do this or only when you want to set up virtual environments based on conda. The venvs may continue to work without activating the conda env, but this isn't something I remember anymore.
Thanks... I might need to tweak the prezto zsh python module too (https://github.com/sorin-ionescu/prezto/tree/master/modules/python)...
I think the challenging part may be dealing with PATH and the shell config
I don't think you have to do anything
I imagine it will work if you just install conda CLI and leave everything else alone
I will give that a try
conda activate just temporarily prepends your PATH with the environment directories, which is basically the same way a venv works
Probably install the Miniconda distribution instead of Anaconda too
You may find that using virtualenv with conda is redundant, since conda can already manage environments
Yeah, I prefer miniconda
^
I have to say, after all my years of programming, I have finally come around to Vim and figuring it out. I really like Neovim.
did you figure out finally how to exit vim? we need to know
No. I am curious though.
might be worth it, you can drag your panes around and select stuff. importantly it makes scrolling into the history a lot easier. changed my life, it did
unless you're a hardcore keyboard-only tmux user, which is also fair
Anyone as good ressources to learn kubernetes (and kubeflow) ?
I'm looking for an e-book or something like that
hi i just installed spyder via anaconda on my linux pc, how can i make it a desktop entry?
Hey when i try to use wireshark on my linux mint does anyone know how i can fix the permissions error?
Guys , do you know any alternatives to tmux? I use NeoVim and I didn't like tmux and neovim's terminal
screen
byobu
qtile
those last two are written in python, which is highly appropriate for this server
Hey when i try to use wireshark on my linux mint does anyone know how i can fix the permissions error?
@heavy knot maybe try to run this withsudofrom the cli?
Anyone know how to best use pipenv with pypy? Just specifying python_version = "pypy3" does make pipenv run python start with pypy, but it has some issues.
- It doesn't seem to be able to install pypy in pyenv (if just using
python_version = "3.8"thenpipenv installwill intstall a python 3.8 viapyenv). - Everytime I run something it gives a warning saying my python version is set to pypy3 but actual version is 3.6.9, and that
pipenv checkwill surely fail.
I find this kind of practice a little dodgy. any VPN service is able to snoop on your data
yeah a free vpn is extremely sus
as a personal opinion i like proton vpn
you can get it free and it is reliable and trustworthy
you can pay to upgrade if you want tho
Whats a good way to screen shot PyCharm Code? Or even record session?
Guys , do you know any alternatives to tmux? I use NeoVim and I didn't like tmux and neovim's terminal
@valid thicket screen is ok
those last two are written in python, which is highly appropriate for this server
@blissful sluice thx, i didnt know about these
I'm having some trouble with VSC. I'm importing an enum from python-docx:
from docx.enum.text import WD_PARAGRAPH_ALIGNMENT
# ...
heading_para.alignment = WD_PARAGRAPH_ALIGNMENT.CENTER # This is where the warning comes
and pylint says Class 'WD_PARAGRAPH_ALIGNMENT' has no 'CENTER' member pylint(no-member).
So I checked if this is the case but doing the following in the command shell suggests it certainly exists:
>>> from docx.enum.text import WD_PARAGRAPH_ALIGNMENT as alignment
>>> alignment.CENTER
1
My two questions are why this happens, and what I can do to fix it
The library if it matters at all: https://python-docx.readthedocs.io/en/latest/index.html
Hey when i try to use wireshark on my linux mint does anyone know how i can fix the permissions error?
@heavy knot try to re-install wireshark
and if it says it is set to manual install then remove the files of the wireshark force fully using the terminal and then re-install it
I think it'll work cause I had same sort of problem and it worked for me
hope it works for you too
@heavy knot maybe try to run this with
sudofrom the cli?
@heavy knot yeh in the root directory maybe and try to find this directory dumpcap in your system
it maybe corrupted or damaged
@heavy knot please write in English and don't offer paid goods, also we don't allow recruitment, especially in this channel
see #680716760134975491 if your project is open source
@fleet wraith why do you have the options line under set-up commented out? Also, you have a space in front of the list of packages you're including. Is there a reason for that?
Also, for the options, have your tried doing the following:
'includes': ["package_1", "package_2"]
I think requests and possibly discord is a module, not a package. So you want to use the keyword includes, and not packages.
That's my fault
It doesn't work neither xd
@viral marlin these spaces are a bug or smth on stackoverflow, didn't allow me to post without spaces
I tried 'includes': ["requests", "discord"] and didn't work
Did it give you a specific error or just a "can't find the following" type of thing?
Yeap
Bcs on the main script I wrote import requests
And there is a import error couldn't find
Can't find module requests
what version of setuptools are you running?
Can you do the equivalent of pip list in terminal and see what version you have installed?
41.2.0 @viral marlin
Did you use an venv to create/run the program? And where are you trying to build the app from?
When you run python setup.py py2app do you also run that from your venv?
Oh, nope
Try that and see what happens
How do I do that?
Oh yes
I run it on venv
ModuleNotFound error
No module named requests
So it does build it, it's just not finding the module even though it works when it's in the python script?
When I run the python script from terminal is everything okay
But I can't just run it on the app
Hmmm, well that's all I got. I would potentially check out PyInstaller if you keep hitting a roadblock here.
Oh boooy
I solved it
@viral marlin ๐ฅณ๐ฅณ
I had to did it on terminal
Python3.7 setup.py py2app --packages=requests
I'm a bit confused about Docker. Should I just copy the code into the container, use bind mounts or do both?
I'd say use the docker volumes
it's essentially a bind mount, if I understood it correctly, but you can just use the docker CLI
Hi!
If I use, git reset commit_sha
will it change my working directory to this specific commit?
Gonna try to use volumes then
Apparently there are no easy ways to automatically migrate database changes with Django, Postgres and docker-compose?
I avoid docker, it often is just extra complexity with little gained
Orchestration tools are available without putting everything into a container.
You really only need them if you're using PaaS or you run lots of different os versions for some reason.
If you don't need containers, do not use them.
@heavy knot copy your DJango site into Docker Container and run it there
as for Postgres, not a fan of databases inside Docker but if you want to do, you should use volumes or mounts or whenever you run a new version of Postgres, you will lose everything
Katrin, Docker enables two things, A) your code should be able to run anywhere docker can B) you don't need to configure machine for your app
if machine is running Python 3.6 and you want Python 3.8, just pull Python 3.8 docker image down and away you go
I do it mostly for learning purposes, but I'll search about mounting the db
Postgres tutorials should have guidance about it
Since it's my bot which is used 24/7
question about where the files go depends on answer to this question "Does this docker container contain data that is unique?"
if no, everything inside docker container
if yes, unique data in mount/volume
So I'd copy the whole django api part, copy the discord bot and mount its token, and mount the database
@viral marlin bro finally solved, all working :))
but how can i send the app to another user? and let he run it on his pc
does anybody know how i can stop vscode from stacking folders like this bc its really bugging me
nvm ignore me
VSC is telling me there is a invalid syntax at a spot which I just want to print something to indicate it has loaded.
bureaucracy anybody eh eh?
oh
I see
is there any reason to use a python virtual environment when programming django
Same as any other case I'd guess. Separated environment for your own dependencies and other projects don't interfere with anything
@visual vortex it's complaining because you put code before your import statements
nope
it works fine otherwise
but my apologies, i found out VSC was confused because i forgot a ( far down in the commands
why though
Separated environment for your own dependencies and other projects don't interfere with anything
imagine you have 2 projects on your computer
that use 2 different versions of django
if you're not using venvs, have fun with that mess
given the sheer number of users on this server asking for help with their screwed up python environments
i would say that it's much better to pre-emptively just use a venv all the time
what if im not using two different versions of django
current you might not be, but future you might end up wanting to. It's also not just Django, it's every single one of Django's and your project's dependencies - things very probably will go awry if you keep on doing it
django may use dependencies, which have other dependinces, which have other ... etc. and all that can conflict with other packages. By only making an environment for one project you minimize the potential conflicts
I also had problems with tools in the past on some larger environments, which would be unavoidable without venvs
ok thanks make sense now
can anyone help me with a weird pycharm issue?
rip
Anyone in here aware of a tool that can easily keep single shared files "up to date"/synced in all repos they are used in? Example styleguide.md pylint.rc etc.?
Submodules if you're using git, but they're not particularly convenient to use.
Yeah I would use submodules if it was a dir
But it's just a single file
@tawny temple
Here's a dumb idea: you could create a symlink to the submodule dir
I heard git's symlink support can be kinda broken sometimes though
You could write a bot that keeps them in sync, like opens a PR for every repo when it detects a change upstream.
I think ultimately it's best to keep it within the git repo somehow
Otherwise people have to use a separate tool and then you can't guarantee they have the files they need really
Hi can someone help write a script that does the following?
Open the text file that contains some data.
somedate.txt
name1 - id1
name1 - id2
name1 - id3
name2 - id1
name2 - id2
name2 - id3
name3 - id1
name3 - id2
name3 - id3
After executing the script, we get a zip file that includes a text file with mixed data from the file that we opened.
mixdate.zip
mixdate.txt
name1 - id1
name2 - id1
name3 - id1
name1 - id2
name2 - id2
name3 - id2
name1 - id3
name2 - id3
name2 - id3
sure, open the data, read each line and split by the " - " into a list of lists, sort the list using the id# part (sort with lambda), write out the list as a string again, add that to a textio object, add that textio object to a zip file using the zipfile library
@blissful sluice I provided the data a bit incorrectly id looks like some key:
name1 - adrt7-rft52-ty76x
name1 - 3ew95-ott34-ch51z
and ect.
Yep, I want to get the output:
name1 - key1
name2 - key1
name3 - key1
all keys are different
right, but in your example above, each of "key1" are the same value yes?
so you want to group lines by their key
@blissful sluice Sorry, this is was a bad example.
Input data:
name1 - xfr56-tres9-y21yu
name1 - ixr47-op3s9-j54yp
name1 - ix4f5-hs44q-op321
name2 - xww96-2wes5-yuizu
name2 - 67ef7-93hjs-hsebd
name2 - poehg-adswd-gdtgs
name3 - mgets-tydgf-vsooe
name3 - bgyds-777ds-ghdye
name3 - zxc12-bfd55-yfes8
Output:
name1 - xfr56-tres9-y21yu
name2 - xww96-2wes5-yuizu
name3 - mgets-tydgf-vsooe
name1 - ix4f5-hs44q-op321
name3 - bgyds-777ds-ghdye
name2 - 67ef7-93hjs-hsebd
name1 - ixr47-op3s9-j54yp
name2 - poehg-adswd-gdtgs
name3 - zxc12-bfd55-yfes8
I want to mix the input data evenly
oh, you want to mix up the names... re-shaping as it were
yep
is it always groups of 3?
@blissful sluice nope it can be 6, 10, 15 and ect
ok I suppose you'd better slice it
@blissful sluice could you show me how to do this?
so, lets say you read your input data as a list of lines (readlines() will do this)
if you did lines[0:10] will give you the lines from 0 to 10
but...
if you did lines[0:10:2] it'll give you every other line from 0 to 10
if you did lines[0:10:3] it'll skip by 3
now if you did lines[0::3] by leaving out the "stop" part of the slice notation, you're saying "all the way to the end of the list"
so in your example above, then lines[0::3] would give you:
name1 - xfr56-tres9-y21yu <- this line
name1 - ixr47-op3s9-j54yp
name1 - ix4f5-hs44q-op321
name2 - xww96-2wes5-yuizu <- this line
name2 - 67ef7-93hjs-hsebd
name2 - poehg-adswd-gdtgs
name3 - mgets-tydgf-vsooe <- this line
name3 - bgyds-777ds-ghdye
name3 - zxc12-bfd55-yfes8
lines[1::3] would give you the same but starting at index 1:
name1 - xfr56-tres9-y21yu
name1 - ixr47-op3s9-j54yp <- this line
name1 - ix4f5-hs44q-op321
name2 - xww96-2wes5-yuizu
name2 - 67ef7-93hjs-hsebd <- this line
name2 - poehg-adswd-gdtgs
name3 - mgets-tydgf-vsooe
name3 - bgyds-777ds-ghdye <- this line
name3 - zxc12-bfd55-yfes8
and lines[2::3] you can imagine
so if you did:
lines[0::3] + lines[1::3] + lines[2::3]
``` you will get the list ordered as you needed to in the output
(if you add a list to a list, it'll catenate the two lists together)
now, we can use a loop instead of having to write it explicitly:
skip = 3
data = []
for i in range(skip):
data += lines[i::skip]
everytime i run with f5 in visual studio this thing comes up
and i want to skip having to click python file each time
You have to define a launch configuration
In your original, uncropped screenshot, the left sidebar even told you this
For example, this is the default config I have in my settings.json
"launch": {
"configurations": [
{
"console": "internalConsole",
"name": "Python: Current File",
"program": "${file}",
"request": "launch",
"type": "python"
}
],
"version": "0.2.0"
}
alright thanks, i just started learning python in vscode after being a java eclipse boyo so this is very helpful
Anyone know how to tell PyCharm the path to the conda executable?
Is it in your PATH? If not just give it the full path to the executable
Is there a keyboard shortcut in VS Code that imitates the same type of selection as a double click?
I found ctrl+shift+left/right arrow, but those need to be at the end of a word for it to be able to select the whole word.
I think by default ctrl+w does that ? Or maybe that's jetbrains I don't remember
But search for a "expand selection" shortcut
That's jbr. In vscode that closes the tab
Anyone familiar with how to automate github releases? I have files on my linux machine that I want to generate a github releases on a daily basis and wondering if anyone can give some suggestions on easiest way to do that.
Possibly GH actions or some other CI. I'm unsure specifically about being able to do it on a daily basis
In any case, it could be done with GitHub's API
Create a Python script using their API and then create a cron job
A chemist is asking me for python help. I think they just want to use Python for data visualization. Should I suggest Spyder to them?
never heard of spyder, but I used jupyter notebooks + plotly and found it easy and pretty
Spyder or Jupyter notebooks are fine for that. Seaborn is a nice simple lib for the visualisation itself if they're looking for help with that
@analog kettle VSCode is pretty good for data viz now also.
that sounds cool, what do I have to do to set up VS code with data viz?
Hey Question, How would I go about importing a class from another file so that I can call it's functions with ease?
You just import the filename
So if you have a python script with functions you created that you want to import you just import that script by using its name
for a project that I'm working on, I'd like some convenient way of marking specific points in development (basically versions), and I'm playing with git tags
currently it looks like lightweight tags would be all I need, and so my workflow at the moment is to e.g.:
git commit -m "Some important commit"
git tag 1.2.3
git push --follow-tags
on the host machine, to show the current revision, I then run a subprocess git describe --tags and capture the output
is this an acceptable workflow, or am I misusing the tagging system?
I'm wondering because I don't really see git tags being used that much, people will often keep track of the version in a version-controlled text file of sorts that can be read at runtime
with lightweight tags, we can tag a specific commit with a version, so it looks very convenient
but the fact that the tags don't get pushed to the remote unless --tags or --follow-tags is included sort of hints at tags being aimed at local development and not necessarily to be shared with other machines
yes this works
we use tags often for CI/CD builds
GitHub hooks are set up to send tags to CI/CD which pulls and builds the tags, and the tags name becomes the release name
it's a viable solution, we used tags in one project, in some SCM tools you can even use UI to create or delete tags
so if you tag it 1.3, then CI/CD builds version 1.3
of you tag it 1.3a-testing it builds version 1.3a-testing
often this is also the docker image tag as well
thanks, this is useful knowledge
guthub's releases are also based on tags
once I get more used to it I may propose that we start tagging at work too
out of interest, do you use annotated or lightweight tags?
I think it's a good idea. it doesn't fully replace version.py as often you need the version number in code. but it does introduce some maintenance issues. one option is to generate version.py from the tag automatically, or generate the tag from the version automatically
lightweight tags
mm, my approach was to read the tag at startup with the subprocess & allow it to be imported
but actually you're right it could also be written to a version.py in CD
the one slight wrinkle with tags is you'd want to avoid deleting tags if possible
because git doesn't pull or track changes in tags. so if someone checked out your repo, and someone deletes a bunch of tags, the next time that person pushes tags, their client is going to try to push all the tags again, recreating them
best-case this is an annoyance, worst-case this triggers a CI build for every tag re-added
yeah, there are some nuances with the tagging system that I'm still trying to understand before I try to introduce it to a more serious project
if you're using GitHub, it's worth noting that GitHub releases are attached to tags, but you can't make a GitHub release from git as releases aren't a git feature
when you make a release on GitHub, it'll create a tag and attach a release to the tag. or you can make a release that points to an existing tag
we use Azure DevOps, although I assume it'll be very similar if not the same
ah ok, perhaps then
@iron basalt i use git tags for versions yes
many projects do use them for this purpose
in fact when i see a big git-based project not using tags im surprised
personally i think of lightweight tags as "local" and verbose/-a tags as "public"
maybe lightweight tags for patch releases? but even then
the best method i've found for working either by myself or in small experienced teams is effectively trunk based development
reasonably-stable commits are pushed to master, versioned releases are tagged
short-lived feature branches for everything else
i think the release tagging process should be at least somewhat cumbersome, because it forces you to think about what you're relasing
i also still haven't found a tool i like that synchronizes version strings everywhere
release checklist is something like:
- install into a clean env & run the full test suite (eg. with tox)
- bump versions: 1)
__version__in__init__.py, 2)setup.pyorpyproject.toml, 3) documentation source - rebuild the docs
- update changelog
- git commit
- git tag
- git push & push tags
for the changelog i use this standard https://keepachangelog.com/en/1.0.0/
and for versioning ive either used semver or calver depending on the development cadence & who is using the project
thanks for the answer
it's really useful and interesting learning about others workflows
id love to know what other workflows people have
i also still haven't found a tool i like that synchronizes version strings everywhere
this is still a big annoyance, ive stopped short of writing my own scripts for it though
e.g. a python script that reads the contents of ./VERSION and modifies pyproject.toml src/python/myapp/__version__.py, and src/docs/conf.py accordingly, as well as spits out a new templated section in the changelog
i dont like tools that read from the git tag because i want to do a bunch of things before committing
I use the git short hash for any build IDs that aren't a release
so our dev/feature builds don't use the tagged version, and look like this in Jenkins:
^ that makes a lot of sense
having trouble getting git hooks to work
installed pre-commit in my pycharm project
#!/usr/bin/env python.exe
# File generated by pre-commit: https://pre-commit.com
# ID: 138fd403232d2ddd5efb44317e38bf03
import os
import sys
# we try our best, but the shebang of this script is difficult to determine:
# - macos doesn't ship with python3
# - windows executables are almost always `python.exe`
# therefore we continue to support python2 for this small script
if sys.version_info < (3, 3):
from distutils.spawn import find_executable as which
else:
from shutil import which
# work around https://github.com/Homebrew/homebrew-core/issues/30445
os.environ.pop('__PYVENV_LAUNCHER__', None)
# start templated
INSTALL_PYTHON = 'd:\\repos\\kaede\\venv\\scripts\\python.exe'
ARGS = ['hook-impl', '--config=.pre-commit-config.yaml', '--hook-type=pre-commit']
# end templated
ARGS.extend(('--hook-dir', os.path.realpath(os.path.dirname(__file__))))
ARGS.append('--')
ARGS.extend(sys.argv[1:])
DNE = '`pre-commit` not found. Did you forget to activate your virtualenv?'
if os.access(INSTALL_PYTHON, os.X_OK):
CMD = [INSTALL_PYTHON, '-mpre_commit']
elif which('pre-commit'):
CMD = ['pre-commit']
else:
raise SystemExit(DNE)
CMD.extend(ARGS)
if sys.platform == 'win32': # https://bugs.python.org/issue19124
import subprocess
if sys.version_info < (3, 7): # https://bugs.python.org/issue25942
raise SystemExit(subprocess.Popen(CMD).wait())
else:
raise SystemExit(subprocess.call(CMD))
else:
os.execvp(CMD[0], CMD)
thats the hook it generated if it helps
i also can run pre-commit run --all-files in pycharm's terminal too
(@ me if you respond)
/usr/bin/envdoesn't work on windows
Idk how to do this correctly though
@heavy knot ^
heck alr
Try putting the absolute path to the python exe in the shebang
does windows have anything equivalent to a shebang
wouldnt you have to write a batch script
Don't think it does, so probably
I think git executes the hooks with git bash by default
Or, more generally, it does respect the shebang even if Windows doesn't support it normally
You could also leave it as a shell script and just write python my_actual_hook.py
I think git executes the hooks with git bash by default
interesting
Yeah, I didn't mean that. I was trying to say that is respects the shebang
I don't know if it uses anything by default
i'm using pipenv and trying to disable this msg Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
with Set-Variable -Name PIPENV_VERBOSITY -Value -1 in Windows-Powershell
doesn't seem to work that way
any idea why?
@dusty maple sorry for the ping, but since you mentioned you used pipenv: have you tried disabling this?
I have once but through CMD
I think you coulso use a .env file since Pipenv autoloads that but I'm not quite sure
can someone explain to me how to install sublim text
yes, .env is autoloaded by pipenv
your message suggests that you're already inside a venv. perhaps you're in Conda, which sets up venvs?
Hello, can anyone from here help me with setting up flask app on heroku?
@untold escarp you're gonna have to be specific about what you've tried and what your problem is
you can do that in a help channel #โ๏ฝhow-to-get-help
hey peeps
so ive been trying for some time now
but no matter how much i do and search
it wont replace the string
Hey guys! When deploying a python app in a docker container, where should the app log stuff?
Docker seem to log stuff from the container stdout. Should all logging just be print statements?
that'll work
then you can do docker logs <container id> and it'll show you the logs
Exactly! The docker daemon handles that stuff pretty well. I guess logger or something could help by formatting the log output a bit, but the way I understand it, there is no need to log to an external file.
IIRC the way the default logger works for Docker, it actually does log to a file.
By the way, the -f option is handy for that command to make your terminal follow the logs live as they come in.
wht in ur opinion is the best ide to use cept pycharm
how can i download a theme for pycharm
i was keen on material ui
and atom icons
but none of em seem to work
could anyone help pls
nvm i figured it out
help ๐ญ
{
"python.jediEnabled": false,
"editor.fontSize": 16,
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"git.enableSmartCommit": true,
"workbench.startupEditor": "newUntitledFile",
"python.linting.pylintArgs": [
"--extension-pkg-whitelist=extensionname",
"--extension-pkg-whitelist=pygame" // comma separated
],
"python.languageServer": "Microsoft",
"python.linting.enabled": true,
"python.lintong.pylintPath": "C:/Users/Turtle/AppData/Local/Packages/PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0",
"python.linting.pylintEnabled": true,
"workbench.colorTheme": "Noctis Obscuro",
"git.autofetch": true,
"files.autoSave": "afterDelay",
"window.zoomLevel": 0,
"[json]": {
"editor.quickSuggestions": {
"strings": true
},
"editor.suggest.insertMode": "replace"
}
}
``` Relevant JSON
is poetry better than pipenv?
IMO yes
I think avast blocked my use of pipenv
when i go into a certain directory
and run pipenv
it says that pipenv is not recognized
when i run pip install pipenv it says that the requirements are already satisfied
Probably means pipenv isn't in your PATH for some reason
What are the contents of your PATH variable
How do i know my path variable @simple trellis
Type $Env:Path
is poetry better than pipenv?
@heavy knot Still waiting forpoetryto support building external extensions but overall it's a really nice tool
https://medium.com/@danieltanfh95/pragmatic-k8s-understanding-2cd45a291cf5
might be useful for developers hearing about k8s and wondering what the fuss is about
your message suggests that you're already inside a venv. perhaps you're in Conda, which sets up venvs?
@blissful sluice I'm inside a regular venv
Created using python -m venv
pipenv helps manage venvs, so you don't need to create a regular venv
Alright then
anyone know a package for atom that lets u run input() in atom itself
Hi guys, I have a postgres docker container, i've made a backup of the db in that container, i don't know how to get that backup on my local drive now... Im not great with the volumes, still struggling to get a grip with it.
nginx:
build: ./nginx
ports:
- 80:80
depends_on:
- django
redis:
image: redis:alpine
celery:
image: web_django
command: wait-for-it postgres:5432 -t 0 -- celery -A project worker -l info
environment:
- POSTGRES_HOST=postgres
- POSTGRES_USER=user
volumes:
- ./src/:/opt/workspace/
depends_on:
- postgres
- redis
postgres:
image: postgres:11.5-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
PGDATA: '/var/lib/postgresql/data/pgdata'
POSTGRES_USER: user
POSTGRES_PASSWORD: user
ports:
- 5432:5432
volumes:
postgres_data:
The backup of the DB is in the containers ./tmp folder so /tmp latest.dump
please ping me on reply
Hey guys! How does one copy the source code from an application into docker image in a docker file?
The dockerfile I am working on sits in a directory next to the directory that contains all my code. So I tried:
COPY directory /directory/in/image
However, only a single, empty directory from the host is copied to the directory/in/image
Does anyone know how to change themes in vim?
I have a custom one but am not sure how to install it
@drowsy lava you have to unzip it in a specific location. Look up :packadd for details
Then you chance color scheme with :colorscheme
@cunning pendant I think that's what I use, maybe check the docs for any weird cases
I just gotta place it some where right?
@drowsy lava it's specified in the docs
would you mind telling me tho
It varies across machines
i'm on windows
And it's different between vim and neovim
So it's better to read the docs than to ask strangers on the internet
@tawdry needle the problem seemed to be with mounting. I'm trying to bind-mount a volume for generated data. The problem is that I'm trying to copy stuff into the volume dir, which of course is then "over-mounted" when using bind. Have to find a work-around
I assume that's vim-plug?
yeah
Typically you'd put that at the start
Which one are you editing?
wdym
iirc _vimrc on Windows should reside on your user folder
I thought there was only one vim rc
yeah
I'm using that
but I can't edit it through bim
vim
I had to use notepad
Right
Assuming you already have it installed, you have to put this at the start of your _vimrc
call plug#begin()
call plug#end()
Yes
Right, but that's for Neovim, not Vim
The top one is what you'd want
Also seems like you're editing the incorrect _vimrc
how many vimrcs are there
huh