Putty shortcut to a path - putty

How do i create a shortcut command in Putty to go to a path? e.g. i am lazy to type in a long path to acccess into the Error folder. I want to just type in "Error" in the putty and it will link me to the folder.
I have seen someone do that. Please advice

You can just alias "Error" to "cd /path/to/your/Error" in your ~/.bashrc
Something like this:
alias Error='cd /path/to/your/Error'
And after a re-login or source ~/.bashrc you will be able to use it.

Related

Its possible to change the "webstorm" shell command to open a file in WebStorm?

I open files in WebStorm from the terminal with the command webstorm . when I'm working in a directory.
Is there a way to change the command webstorm to anything more, like wstorm or something shorter to open files fluently?
I'm using macOS.
I Know one way but it's temporary, works untill you close the terminal.
-in your terminal
W=webstorm
then you can use $W in your command instead of webstorm.
Looks like the hint above is very good.
So assuming the shell script "webstorm" is working and your question is how to modify the command AND you want to do it fluently.
Make an alias (your shell may vary, mine is bash)
in the appropriate 'dot' file for your shell
add an alias for webstorm -e like this
alias we='webstorm -e'
now when I want to open a file quickly I type
we filename
And this opens Webstorm in LightEdit mode which opens faster and has a link to access full IDE.
Works like a charm. Also, you could make more than one alias so say ws for the full ide. Enjoy

How to run VSCode from the command prompt

I for security reasons cannot run VSCode plainly. I have opened it in the past, but now due to specific reasons, I may only run VSCode from the command prompt. I've tried
start "path/to/file" code and start code "path/to/file"
but none work I'm on Microsoft Windows [Version 10.0.17134.407]
how may I run this by going to Windows+R then 'cmd' then start/ run?
Also it would be great if I could use this for a separate user.
I'm looking for something like:
Runas /user:user\admin /savecred "C:\Program Files (x86)\vs-code.exe"
The use of start is useless if VSCode is in the environment variables.
You can use code C:\Users\%username%\Desktop\File.c for exemple.If it doesn't work, I advise you to use a vbs script instead
You also don't need to run VSCode as an administrator unless you need to edit a file in a protected folder.
Maybe not the exact answer to the question, but...
To start Visual-Studio-Code from CMD into the current folder write:
code %cd%
The environment variable cd tell VS-Code to open it with the current folder
just open a cmd terminal and type code followed by
just open a cmd terminal and type code followed by return keyborad key.
Well shoot, as it turns out that after doing some experimentation I found out that there's a way. Do this:
Simply stick this:
runas /user:Techtiger255\admin /savecred "C:\Users\Admin\AppData\Local\Programs\Microsoft VS Code\Code.exe"
inside of a shortcut (.lnk file)
Open your command line of choice (Powershell or Cmd) and enter the exact file path of your shortcut ex:
"C:\Users\Standard\Desktop/VSCODE.lnk" and hit go, stupidly simple really, just had to find the code.exe file path.

How to set the $EDITOR to Brackets

I am trying to set my default editor to Brackets in the Terminal. I tried with
export EDITOR="/Applications/Brackets.app"
and when I try to edit a function from the MongoDB Shell it complains that the editor is a directory. I tried giving different paths, but I cannot find the right combination. Please help, I don't want to edit in the Terminal :) :) :)
I'm not on a mac, but I was able to download and examine the contents of the Brackets installer and Brackets.app is indeed a directory. Have you tried
export EDITOR=/Applications/Brackets.app/Contents/MacOS/Brackets
or something similar?

Associate a file type with emacs/cygwin

I want to use Emacs as and editor and shell.
On Windows 7 I installed cygwin , X11 and emacs.
In terminal I added to /etc/profile file these lines:
XWin -multiwindow 2> /dev/null&
export DISPLAY=:0.0
sleep 1
emacs 2> /dev/null&
I created a shortcut that execute this command: C:\rhcygwin64\bin\mintty.exe -
Now every time I start that shortcut it starts emacs. No problem.
My goal is: associate some file types like .txt , .csv and etc with emacs in order when I start foo.txt it'll open in emacs.
When I tried to do it 'Set Associtation' control it accepts only file name and it does not take '-'. Hence when I try to open foo.txt it does not work. I tried to create a shortcut to mintty.exe but it didn't work either.
Could someone help me to create association in order to start to mintty.exe but rather mintty.exe - ?
Thanks in advance
I am taking my question off .
I realized that my problem is related to subshell issue ... when I try to invoke first cygwin, then emacs under it and etc.
I decided that I will not use much Windows Explorer but rather go directly to the file and open it. This way I don't need file association.
Please close my ticket.
Thanks

How to run mysqldump under XAMPP on Mac OS

I want to run the mysqldump command in Mac OS, I am able to find the location of the file as "/Application/XAMPP/xamppfiles/bin".
But don't know how to exec the same from command prompt, as it says command not find, by simply typing it and executing it from the prompt/
The trick on *NIX systems when executing things is that you have to tell the shell exactly where the file is, or it must be in your $PATH.
This should work:
/Application/XAMPP/xamppfiles/bin/mysqldump
This would also work:
cd /Application/XAMPP/xamppfiles/bin/
./mysqldump
If you want to make it so you can just type the command without giving the location, add it to your PATH variable:
export PATH=$PATH:/Application/XAMPP/xamppfiles/bin
And then just run it!
mysqldump
Also on Mac you can simply drag and drop the file from finder right into the terminal. This will automatically type the path for you.

Resources