Skip to content

Instantly share code, notes, and snippets.

@lcolladotor
Last active December 30, 2015 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lcolladotor/7897221 to your computer and use it in GitHub Desktop.
Save lcolladotor/7897221 to your computer and use it in GitHub Desktop.
Local and cluster .bashrc files for "Login to the cluster, request a node and change to your project directory in a single command" as described in http://bit.ly/FellBit
## change dir automatically when using qrsh
## Details: https://github.com/rkostadi/BiocHopkins/wiki/Useless-Tips-&-Code-Snippets
if [ -f ~/.bash_pwd ]; then
source ~/.bash_pwd
rm ~/.bash_pwd
fi
alias qr='echo "cd $PWD" > ~/.bash_pwd; history -w; qrsh'
# Servers
alias enigma="ssh enigma"
# qrsh
alias qr="ssh -t enigma 'cd /very/complicated/path/to/projectDir/; source /etc/profile; echo \"cd \$PWD\" > ~/.bash_pwd; history -w; qrsh'"
#qrsh-basename
alias qs='LEODIR=`basename $PWD`; ssh -t enigma "cd /very/complicated/path/to/projectDir/$LEODIR/; source /etc/profile; echo \"cd \$PWD\" > ~/.bash_pwd; history -w; qrsh"'
# basename, but no qrsh
alias qq='LEODIR=`basename $PWD`; ssh -t enigma "cd /very/complicated/path/to/projectDir/$LEODIR/; source /etc/profile; echo \"cd \$PWD\" > ~/.bash_pwd; history -w; bash"'
## .ssh/config local file
Host enigma
User username
Hostname enigma2.etc.edu
ForwardX11 yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment