I need to edit a xml file in a server. How can I navigate to the path where the file is present in the server and edit it using putty commands. I am new to unix so if anyone could help me out.
To move around in linux you need to use the change directory command which is: cd /location/of/directory/. If you then need to edit a file there are a number of editors which you can use. My preference is VIM which can be used by doing the following vi file.xml. Although VIM is not recommended if you are new to unix. Try using nano filename.xml instead if this makes it easier for you.
If you wish to edit a file directly without having to move to it's directory you can just do: nano /path/to/file.xml
I'm writing a shell script I can run on a new machine to install my apps, set preferences, arrange dock, and add homebrew packages, and I'd like to be able to configure atom packages within the script instead of manually. Is this possible?
Edit: Also I'd like to change the theme from command line, is that possible?
cd ~/.atom
touch init.coffee
echo "atom.config.set('core.themes', ['THEME_HERE', 'SYNTAX_THEME_HERE'])" >> init.coffee
Atom configuration settings are stored as CSON text in config.cson in the .atom directory. So, for example, if you ran
atom.config.set('core.themes', ['THEME_HERE', 'SYNTAX_THEME_HERE'])
from inside Atom, in the config.cson file, you would see:
"*":
core:
themes: [
"THEME_HERE"
"SYNTAX_THEME_HERE"
]
So, you can write directly to this file from your shell script to configure Atom. You can also change config.cson to config.json and use JSON (instead of CSON) to configure the editor, which can make it easier to use things like jq to work with the file.
I am trying to create a bridge network. My problem is I can not find /etc/xend/xend-config.sxp file on my xenserver.
Can someone give me a hand? Someone knows where can I find xend-config.sxp file?
Note: I'm using Xenserver 6.5.
Firstly I assume you have connected to your server through a terminal, likely using ssh.
Use the command cd /etc/xend/ This will change the directory into this folder.
To see the contents of the folder type ls. If there is anything in the folder, such as the xend-config.sxp file it will show up.
If the file does not show up you can create it. It often seems to be the case that configuration files need to be created by one self the first time.
You can do this by running the command touch xend-config.sxp
Running the command ls should now show you the file. Running pwd will show you that it has been created at /etc/xend/
To edit the file you can use an editor such as nano or vim or whatever is your personal choice, e.g. sudo nano xend-config.sxp will open the file xend-config.sxp in a nano text editor.
I hope this helps
To begin working on a project, my usual actions look like:
to open iTerm, cd to my local repo,
initialize grunt
Open Sublim
Navigate to recent projects
Click relevant project file
I'd like to cut 3-5 steps if I can and program grunt to open the Sublime app and specifically the project in that file. Is that possible?
I've seen tools like this: https://github.com/tvooo/sublime-grunt but they're about Sublime working Grunt not so much Grunt working Sublime.
Any help?
There's a grunt plugin to run shell commands, so it should work once you set up subl
I am working with PyCharm 4.04. Since I installed it, every time I open it, as default directory I get this:
C:\Users\Laura\AppData\Local\Temp\main.py1.tmp>cd
Which gives me an error when trying to use the console:
Error:Cannot start process, the path specified for working directory
is not a directory
But even if I change the directory, the message does not disappear.
The terminal, though, it does work and I can run projects, but I would like to use the console.
Another solution is to close the project, run rm -rf .idea and re-open it. Apparently Pycharm gets confused by some direct folder manipulation and doesn't reflect it properly in his .idea/*.xml files
I also got this error, and it got resolved by setting the default working directory. Follow the below path, and set the Working Directory to the folder where your code resides.
File > Settings > Build, Execution, Deployment > Console > Python Console > Working Directory ...
I finally solved the problem.
I think it all started because the first project that I opened with pycharm was in my "download" folder, so the working directory was automatically set to a temporal folder by default and allthough I moved the project to another folder and I manually changed the working directory from the terminal, it was not working.
The solution was creating a new project and giving a correct path to the new project. It seems very easy but it was not that obvious.
In the upper right corner click on small ▼ next to your main to run (look to the left from green right-pointing triangle)
Select Edit configurations.
In ▼ Python select the proper configuration name.
Look at the Configuration panel.
Fix items Script and Working directory.
pycharm
I had this same problem and just had to reinstall pycharm. It's a quickfix and I can't ensure it won't happen again.
I solved this by replacing all instances of the old filename and old directory with the new one in .idea/workspace.xml
It can be done with PyCharm running.
#user1068430 has the answer in the comments to the question:
When you open a project open the directory not a specific python file.
Instead of ~/Documents/myProject/main.py open ~/Documents/myProject
If you "open" the .py file then you'll have to set the working directory (File > Settings > Build, Execution, Deployment > Console > Python Console > Working Directory) every time. If you "open" the directory containing the .py file, then PyCharm will open and all of your .py files will be available in the left window. Select one of them and you're good to go.
i had the same issue, the error comes up when i want to upgrade my packages and when i run my project "this FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\youruser\AppData\Local\Temp\gen_py\3.7\__init__.py'" i found that the Temp file in C:\Users\youruser\AppData\Local was corrupt and it was fixed by deleting the "Temp" file, once deleted it will automatically create a new one with "gen_py" in it
To anyone with similar issues: Python interpreter virtual environment is where your python.exe sits. The working directory is where your script sits. To make everything easier, open a new project, scroll to location where you script is stored, and select. Click the interpreter option, click existing (if old one worked) or choose the python.exe. When asked, open the project in a new window, close old one to avoid confusion.
source = banging my head against the console for past few hours.
if the above mentioned solutions are not working, you can restart a new project.
file > New project...
then,
create a new project.