I have changed some files' user permissions through Linux terminal using chmod. I just realized that I was working in a virtual environment throughout. Does this mean that the changes have been reflected only within the environment or outside as well?
Do I have to do it again outside the environment?
Please suggest.
Python virtual environments are not virtual machines or containers, they do not protect the host OS outside of the environments. Activation of an environment just prepends its bin/ to $PATH in the current terminal, nothing fancy.
You can do anything (including chmod) with any file outside of any environment even if an environment is activated.
Related
Are there any special-purpose variables that I can pre-define for Node?
I've noticed that the in Windows, system environment variables are available to Node, like %PATH%, %OS%, and others. You can define your own too, and they are all available via process.env.your_var_name.
In a lot of the documentation I've been reading, there are references to things like PORT, ENV, NODE_PATH, DEBUG, etc.
Are these "special" to Node itself, or are these just variables I can name & define on my own in the OS?
%PATH%, %OS% are system environment variables and not specific to node. You can access them from the command line also.
Other environment variables like PORT, ENV are defined in a .env file to store credentials related to hosting and database.
You can create a .env file in the base directory of your project and store your own environment variables and access it using dotenv package.
More about environment variables:
https://www.freecodecamp.org/news/heres-how-you-can-actually-use-node-environment-variables-8fdf98f53a0a/
So I'm trying to do something probably pretty simple but can't figure it out of course. I have a VM on my network running CentOS and I installed Git using the guide. Now I'm on my Windows PC using Pycharm trying to setup Git but the setup asks for where the git.exe file is and can't seem to navigate to my CentOS VM within pycharm to point it anywhere. I tried \IP Address but that didn't work. Is there somewhere on the Linux vm I need to do to allow the windows Pycharm to reach it? I'm new to this on both sides lol.
If I understand your question correctly, you want to access a Git-Repository in your local Linux network. In that case you need to be able to access these files with your Windows machine in order to push/fetch your changes from/to it. A simple way to do it, could be set up file sharing as explained here link and then clone and handle it as any local Git-Repository (see e.g. link - with local Repos the file path is used instead of the URL).
An even simpler way could be to create a hosted online Git-Repository (e.g. on Github) even if you are a sole contributor, maybe make it a private one, if you don't want to make the contents public.
Is there a way to set up a project in Eclipse so that if my code has a reference to the system root directory then it will point to my workspace instead? (I am not seeing anything in the Run Configurations that would help me with this.) Something like the equivalent of making a sym link / that points to my workspace directory.
I'm working on a perl project that has absolute references to the hosting Linux file system in what would be the production environment. Those directories don't exist in my development Eclipse environment. My workspace is located in an NFS space mounted on a cluster of servers that run Eclipse I access in my laptop via client software.
So root can be any server's local space within the cluster and I don't have any access to anything above the workspace, and so I can't create the directory structures I need. I would rather not hard-code alternate directory paths to accommodate differences between the sandbox and production environments and having to comment them out when deploying to the prod environment.
I'm not finding a straightforward answer online. Maybe I'm not articulating the question correctly and help with that would also be appreciated if that is the case.
No. Good practice is to have paths like that configurable at runtime, usually via an environment variable or command line argument, specifically to accommodate changes between development, sandbox, and production environments.
I have made a virtual environment using python3.
virtualenv -p python3 py36
In a folder named environments within a project folder.
When activated, and I run which python3 the output is:
(py36) ur#comp:~/Desktop/project$ which python3
/home/ur/Desktop/project/environments/py36/bin/python3
My question is, how can another developer use the same virtual environment if they were to pull from a cloud repository?
What we found is that when they active the environment, it would use the path above; which isn't correct for his machine, thus he is not able to use the env.
We temporarily fixed the problem by changing the path above, to the their machine's path, wherever it appeared in the files within the env. However, I will have the same problem if I pull the project after he modifies.
We would like to know if there is a way to share the virtual env, in a way that we don't have to change each path.
Thank you for your time.
Virtual environments aren't relocatable. Developers has to create their own environments.
I have a web app in my local environment that needs to upload some files to a path like /images/app/customer. That path does exist on the production server but obviously doesn't on my machine.
Is there a way to "simulate" the existence of that directory on my environment?
I'll answer my own question after one year of experiments. It turned out that the best and clean way is to create the directory in a sandboxed environment like Docker or any other virtual machine out there.