-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
223 lines (188 loc) · 7.24 KB
/
.bashrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# /etc/skel/.bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export TERM=xterm
# start-up things
umask 0022
#if [ `cat ~/hostname` == "condo" ]
#then
alias vim='/usr/bin/vim'
#alias modbase1='export MODBASE="/shared/software/GIF"; echo "/shared/software/GIF"'
#alias modbase2='export MODBASE="/data021/GIF/";echo "/data021/GIF/"'
#module use /data021/GIF/software/modules
#module use /work/GIF/genome/modules
#module use /work/GIF/user/modules
#module use /work/GIF/project/modules
#module use /shared/software/GIF/modules/
#module purge
#module load LAS/parallel/20150922
#module use /data005/GIF2/resultfiles/
#module load severin
#export PATH="~/isugif/utilities/utilities/:$PATH"
#export GSEQ="/data021/GIF/genomes/sequences"
#export GMOD="/data021/GIF/genomes/modules"
#elif [ $HOSTNAME = "br005.pvt.bridges.psc.edu" ]
#then
#module use /pylon2/mc48o5p/severin/software/modules
#modue use /pylon2/mc48o5p/severin/genome/modules
#module use /pylon2/mc48o5p/severin/user/modules
#module use /pylon2/mc48o5p/severin/project/modules
#ssh-add ~/.ssh/id_rsa
#fi
alias moduleavail='cat ~/.modules;module avail > ~/.modules &'
export PATH="~/isugif/utilities/utilities/:$PATH"
#git configuration
#git config --global pack.windowMemory "10m"
#git config --global pack.SizeLimit "10m"
#git config --global pack.threads "1"
# Alias definitions.
alias jrc='JRC.sh'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias ls='ls --color=auto -v'
alias du='du -kh' # Makes a more readable output.
alias df='df -kTh'
alias dd='du -sch *'
alias lh='ls -lh' # sort in readable way
alias la='ls -AlL' # show hidden files and show size of files that are softlinked
alias lx='ls -lXB' # sort by extension
alias lk='ls -lSr' # sort by size, biggest last
alias lc='ls -ltcr' # sort by and show change time, most recent last
alias lu='ls -ltur' # sort by and show access time, most recent last
alias lt='ls -ltr' # sort by date, most recent last
alias lm='ls -al |more' # pipe through 'more'
alias lr='ls -lR' # recursive ls
alias ld='ls -d */' # list directories only
alias ll='ls -l'
alias lsr='tree -Csu' # nice alternative to 'recursive ls'
#alias scp-resume="rsync --partial -h --progress --rsh=ssh"
alias git-commit-count="git log --pretty=format:'' | wc -l"
#alias pep8="pep8 --ignore=E501 -r"
#alias qs="qstat -a -u severin"
#alias qall="qstat -a"
#alias qjobs="qstat -r"
alias dirtree="ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'"
#alias qs512="qsub -I -l mem=512Gb,nodes=1:ppn=32:ib32,walltime=48:00:00 -N test"
#alias qI16="qsub -I -N test -l nodes=1:ppn=16 -l walltime=4:00:00"
alias dG='du -hs * | awk '$1~"G"''
alias dT='du -hs * | awk '$1~"T"''
#severin
alias wcp="parallel --block 1G --pipe wc -l | awk '{s+=$1} END {print s}'"
alias qf="qn | grep free | wc -l"
alias awkt='awk -F "\t"'
alias pwd='pwd -P'
#git
alias gc='git commit -m'
alias gpom='git push origin master'
alias ga='git add'
alias gpr='find . -type d -name .git -exec sh -c "cd \"{}\"/../ && pwd && git pull" \;'
alias gclone='git clone git clone [email protected]:ISUgenomics/$1'
#############
# Prompt Configuration
#############
# Custom prompts (choose 1)
# PS1 (keep only one active)
PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[01;31m\]\[\033[01;34m\]\$\[\033[00m\] ' # git friendly
# Making never ending history!
export HISTFILESIZE=
export HISTSIZE=
export HISTTIMEFORMAT="[%F %T] "
export HISTFILE=~/.bash_eternal_history
PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
export PATH="~/bin:$PATH"
export PATH="$PATH:/home/severin/.local/bin:~/isugif/utilities/utililities/:~/isugif/ProjectModules/:~/isugif/common_scripts/:~/isugif/common_analyses/:~/isugif/ascii_plots:~/isugif/oneliners/"
################
# SHORTCUTS
################
export MDIR=/data021/GIF/software/modules
export PDIR=/data021/GIF/software/packages
export EDITOR="nano"
export TMOUT=0
#export LD_PRELOAD=/shared/openmpi/gcc/lib/libmpi.so
#export ZOE=/data004/software/GIF/packages/snap/2013-02-16/Zoe
###############
# PROGRAMS
###############
#ulimit -t 43200
###############
# For Arun
##############
#module load java/1.7.0_76
#module load gatk
TMPDIR="/scratch/severin/${PBS_JOBID}"
#module purge
#module load maker
#module load maker/2.31.8_mpi
#module load java/1.7.0_76
#module load gatk
#module load vcftools/0.1.12b
PATH="/home/severin/perl5/bin${PATH+:}${PATH}"; export PATH;
PERL5LIB="/home/severin/perl5/lib/perl5${PERL5LIB+:}${PERL5LIB}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/home/severin/perl5${PERL_LOCAL_LIB_ROOT+:}${PERL_LOCAL_LIB_ROOT}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/home/severin/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/home/severin/perl5"; export PERL_MM_OPT;
alias si="sinfo -o \"%20P %5D %14F %8z %10m %10d %11l %16f %N\""
alias sq="squeue -o \"%8i %12j %4t %10u %20q %20a %10g %20P %10Q %5D %11l %11L %R\""
#alias canu='/work/GIF/severin/Purcell/WhiteAbalone2018/canu/Linux-amd64/bin/canu'
# Avoid duplicates
export HISTCONTROL=ignoredups:erasedups
# When the shell exits, append to the history file instead of overwriting it
shopt -s histappend
# After each command, append to the history file and reread it
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
alias ceres="ssh -X [email protected]"
alias gittree="git log --all --decorate --oneline --graph"
# Miniconda
module load miniconda3
#source activate my_root
# Group storage usage
if shopt -q login_shell; then
cat /work/GIF/group_storage_usage
cat /work/gif/group_storage_usage
fi
alias gpu="salloc --gres=gpu -N 1-1 -n 36 -t 4:00:00 -p novagpu"
## swift alias
#alias swift="singularity exec --bind /work/gif/software/swift/bin /work/gif/software/swift/swift_latest.sif swift"
export PATH="$PATH:/work/gif/software/swift/bin/"
###############################
## FUNCTIONS
###############################
calc(){ awk "BEGIN { print "$*" }"; }
pathadd(){ export PATH=$PATH:$1; }
function extract() # Handy Extract Program.
{
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
*.tbz2) tar xvjf $1 ;;
*.tgz) tar xvzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*.tar.xz) tar xJvf $1 ;;
*) echo "'$1' cannot be extracted via >extract<" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
# Find a file with a pattern in name:
function ff() { find $(pwd -P) -type f -iname '*'$*'*' -ls ; }
function fd() { find $(pwd -P) -type d -iname '*'$*'*' -ls ; }
#it puts line number for grep matches, but only when it is at the end of the pipe
function grep() {
if [[ -t 1 ]]; then
command grep -n "$@"
else
command grep "$@"
fi
module use /work/gif/modules//software/
module load gcc/7.3.0-xegsmw4 nextflow