Useful .bash_profile and .bashrc tips & tricks - mackeylab/home GitHub Wiki
Things you can add to your ~/.bash_profile
(locally or ~/.bashrc
on the CUBIC cluster) to make your life easier 😄
Log in to the CfN cluster with one word
alias chead="ssh -Y username@chead"
Log in to CUBIC with one word
alias cbica="ssh cbica" #if you set up SSH keys, or
alias cbica="ssh -Y [email protected]"
(If you set up SSH keys, this is easier than using an alias).
Mount the CUBIC cluster locally by aliasing the command
alias local_mount="sshfs -o defer_permissions,noappledouble,auto_cache,reconnect,negative_vncache,volname=username [email protected]:/data/ ~/Desktop/cluster"
Log in to Rico computer (at the scanner) with one word
rico="ssh -Y [email protected]"
On CUBIC, make output of ls
display in color
#add to .bashrc
alias ls="ls -CF --color=auto"
Open Matlab from the Terminal
matlab(){
open /Applications//MATLAB_R2018a.app
}
Use Git newer version on the cluster
#Git newer version
module load git/2.9.5
See a graph of git history with gitgraph
#use the fancy git log graph
alias gitgraph="git log --graph --oneline --decorate --all"
Add some useful paths so you can navigate to them with cd $MY_PROJ
BASSETT_HOME=/data/jag/bassett_lab/
MY_PROJ=/data/jag/bassett_lab/my_dir/projects/in_progress
Add your specific Miniconda path if it's not working straight out the box
PATH=$PATH:/data/jag/bassett_lab/me/miniconda3
PATH=/data/jag/bassett_lab/me/miniconda3/bin:$PATH
Using Singularity on the cluster
## Singularity build environment
SINGULARITY_CACHEDIR=${SBIA_TMPDIR} #keep Singularity from creating singularity .tar dirs in home dir
SINGULARITY_TMPDIR=${SBIA_TMPDIR} #see if this works to use a local compute node tmp dir instead of home dir
export SINGULARITY_CACHEDIR
export SINGULARITY_TMPDIR