Browse code

bash_profile (heron) - v1.2 - Improve qrsh login

Fred authored on09/07/2014 13:39:03
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,115 @@
1
+# Title: .bash_profile
2
+# Author: Frédéric CHEVALIER <f15.chevalier@gmail.com>
3
+# Version: 1.2
4
+# Created in: 2012-05-25
5
+# Modified in: 2014-07-09
6
+
7
+
8
+#==========#
9
+# Versions #
10
+#==========#
11
+
12
+# v1.2 - 2014-07-09: behaviour modified when login to a node using qrsh (qrsh alias modified / if loop correction for message)
13
+# v1.1 - 2014-07-01: specific aliases needed for GridEngine added
14
+# v1.0 - 2014-06-28: rewriting for better interplay with .bashrc
15
+# v0.0 - 2012-05-25: creation
16
+
17
+
18
+
19
+#===============================#
20
+# Get the aliases and functions #
21
+#===============================#
22
+
23
+if [[ -f ~/.bashrc ]]
24
+then
25
+	source ~/.bashrc
26
+fi
27
+
28
+
29
+
30
+#==================#
31
+# Specific aliases #
32
+#==================#
33
+
34
+alias pqsub='qsub -V -cwd -o $HOME/status -j y -r y -S /bin/bash'
35
+alias pqsubR='qsub -V -cwd -o $HOME/status -j y -r y -S $(which Rscript)'
36
+alias qrsh='qrsh -V -cwd -pty y bash -li'
37
+alias locate='locate -d "$HOME/.mlocate.db"'
38
+alias xterm='xterm -bg black -fg white -rightbar -geometry 200x35'
39
+
40
+alias medusa='ssh -Y medusa'
41
+alias medusa2='ssh -Y medusa2'
42
+alias mendel='ssh -Y mendel'
43
+
44
+alias model_script_sh='cp $HOME/Templates/script.sh $1'
45
+
46
+
47
+
48
+
49
+#================================================#
50
+# User specific environment and startup programs #
51
+#================================================#
52
+
53
+# Fix timestamp to english format (french connection problem)
54
+export LC_TIME=en_US.UTF-8
55
+
56
+# Specific locale variables (get with locale command)
57
+export LC_NUMERIC=en_US.UTF-8  # to always have . as decimal separator
58
+
59
+# Color definition
60
+export LS_COLORS='di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:'
61
+
62
+# Path variable
63
+export PATH=$HOME/local/bin:$HOME/local/share:$HOME/local/usr/local/bin     # Personal path
64
+export PATH=$PATH:/opt/openmpi/bin:/usr/bin:/usr/java/latest/bin:/usr/local/bin:/bin:/usr/bin:/opt/bio/ncbi/bin:/opt/bio/mpiblast/bin/:/opt/bio/hmmer/bin:/opt/bio/EMBOSS/bin:/opt/bio/clustalw/bin:/opt/bio/tcoffee/bin:/opt/bio/phylip/exe:/opt/bio/mrbayes:/opt/bio/fasta:/opt/bio/glimmer/bin://opt/bio/glimmer/scripts:/opt/bio/gromacs/bin:/opt/bio/gmap/bin:/opt/bio/tigr/bin:/opt/bio/autodocksuite/bin:/opt/bio/wgs/bin:/opt/eclipse:/opt/ganglia/bin:/opt/ganglia/sbin:/opt/rocks/bin:/opt/rocks/sbin:/opt/condor/bin:/opt/condor/sbin:/opt/gridengine/bin/lx26-amd64 # System path
65
+export PATH=$PATH:/opt/gridengine/bin/linux-x64 # System path needed for the new medusa
66
+
67
+# Location of bamtools lib (source: http://www.vcru.wisc.edu/simonlab/bioinformatics/programs/install/bamtools.htm)
68
+export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/local/lib" # :$HOME/local/lib64" #:$LD_LIBRARY_PATH"
69
+
70
+# Perl variables
71
+export PERL5LIB=~/local/lib/perl5/site_perl/5.18.2/x86_64-linux/auto/:~/local/lib/perl5/5.18.2/:~/local/lib/perl5/site_perl/:~/local/lib/perl5/site_perl/5.18.2/:~/local/lib/perl5/site_perl/5.18.2/x86_64-linux/:~/local/lib/perl5/5.18.2/x86_64-linux/:/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi:/usr/lib/perl5/site_perl/5.8.8:/usr/lib/perl5/site_perl:/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi:/usr/lib/perl5/vendor_perl/5.8.8:/usr/lib/perl5/vendor_perl:/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi:/usr/lib/perl5/5.8.8
72
+
73
+# Python
74
+export PYTHONPATH=$HOME/local/lib/python2.6/site-packages/
75
+
76
+# Vim
77
+export VIMHOME=$HOME/.vim
78
+
79
+# R
80
+R_version=$(R --version | head -1 | cut -d " " -f 3)
81
+export R_LIBS_HOME="$HOME/.R-libs"
82
+
83
+if [[ ! -d "${R_LIBS_HOME}/${R_version}" ]]
84
+then
85
+    mkdir "${R_LIBS_HOME}/${R_version}"
86
+fi
87
+
88
+export R_LIBS="${R_LIBS_HOME}/${R_version}"
89
+
90
+
91
+
92
+#=================#
93
+# Welcome message #
94
+#=================#
95
+
96
+name=${HOSTNAME%%.*}
97
+nb=$(printf "%${#name}s\n" "" | sed "s/ /=/g")
98
+
99
+if [[ ! $HOSTNAME =~ compute.* ]]
100
+then
101
+    nb=$nb=======
102
+    echo -e "\n\n"
103
+    cat .welcome.msg | sed "s/HOSTNAME/$(echo $name Server | sed "s/^[m,h]/\U&/")/" | sed "s/=\*/$nb/g"
104
+    echo -e "\n\n"
105
+
106
+
107
+    if [[ $(echo $name) == "medusa" || $(echo $name) == "medusa2" ]]
108
+    then
109
+        echo -e "\033[33mSpace available on /master [%/Total/free]:\033[00m $(df -h | grep "/master " | awk '{print $5" / "$2" / "$4}')\n"
110
+        echo -e "\033[33mCores available:\033[00m\n"
111
+        qstat -g c
112
+        echo -e "\n"
113
+    fi
114
+fi
115
+