-
Notifications
You must be signed in to change notification settings - Fork 0
/
Linux_bashrc
187 lines (157 loc) · 4.49 KB
/
Linux_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
u=rwx,g=rwx,o=rx
umask 0002
# setup a better command line
export PS1="\[\e]1;\h:\W\a\e]2;\h:\w\a\e[31;1m\]\W\$\[\e[0m\] "
export CLICOLOR=1
shopt -s histappend
shopt -s checkwinsize
export PROMPT_COMMAND='history -a'
export HISTSIZE=2000
export EDITOR="emacs -nw"
export PATH=.:$HOME/bin:$HOME/software/bin:$PATH
export LD_LIBRARY_PATH=/usr/lib64:$HOME/lib:$HOME/lib64:$HOME/software/lib64:$HOME/software/lib
export CUDA_DIR=/usr/local/cuda
# for bilder
#export MAIL_ADDRESS=mgalloy@txcorp.com
REDHAT_RELEASE=/etc/redhat-release
if [ -f "$REDHAT_RELEASE" ]; then
export REDHAT_MAJOR_VERSION=$(cat /etc/redhat-release | cut -d" " -f3 | cut -d"." -f1)
else
export REDHAT_MAJOR_VERSION=
fi
# use new hsi client
export PATH=/opt/local/hpss/bin:$PATH
# setup IDL
#export LM_LICENSE_FILE=1700@zrv.txcorp.com
flexdirs=(/tmp/flexera /tmp/flexera-sv)
for d in ${flexdirs[@]}; do
if [ ! $d ]; then
mkdir $d
fi
done
# setup iTerm2
function iterm_notify {
printf '\e]9;%s\a' "$@"
}
function iterm_bounce {
printf '\e]1337;RequestAttention=yes\a'
}
function iterm_badge {
printf "\e]1337;SetBadgeFormat=%s\a" $(echo "$@" | base64)
}
# contrib software
if [ -d /opt/local/bin ]; then
export PATH=/opt/local/bin:$PATH
fi
# Globus
if [ -d $HOME/.local/bin ]; then
export PATH=$HOME/.local/bin:$PATH
fi
# local software
if [ -d $HOME/software/bin ]; then
export PATH=$HOME/software/bin:$PATH
fi
# setup CUDA
if [ -d $CUDA_DIR ]; then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA_DIR/lib64
export PATH=$CUDA_DIR/bin:$PATH
else
if [ "x$SSH_TTY" != "x" ]; then
echo "CUDA not present in $CUDA_DIR"
fi
fi
# setup mglib
export MGLIB_DIR=$HOME/software/mglib
if [ -d $MGLIB_DIR ]; then
export PATH=$MGLIB_DIR/bin:$PATH
else
if [ "x$SSH_TTY" != "x" ]; then
echo "mglib is not present in $MGLIB_DIR"
fi
fi
# setup mgunit
export MGUNIT_DIR=$HOME/software/mgunit
if [ -d $MGUNIT_DIR ]; then
export PATH=$MGUNIT_DIR/bin:$PATH
else
if [ "x$SSH_TTY" != "x" ]; then
echo "mgunit is not present in $MGUNIT_DIR"
fi
fi
# setup TaskDL
export TASKDL2_DIR=$HOME/projects/taskdl-2.4/install
if [ -d $TASKDL2_DIR ]; then
export PATH=$TASKDL2_DIR/bin:$PATH
else
if [ "x$SSH_TTY" != "x" ]; then
echo "TaskDL not present in $TASKDL2_DIR"
fi
fi
# setup mpiDL
export MPIDL_DIR=$HOME/software/mpidl-par
if [ -d $MPIDL_DIR ]; then
export PATH=$PATH:$MPIDL_DIR/bin
else
if [ "x$SSH_TTY" != "x" ]; then
echo "mpiDL not present in $MPIDL_DIR"
fi
fi
# setup rIDL
if [ -d $HOME/projects/ridl/install ]; then
export MANPATH=$HOME/projects/ridl/install/share/man:$MANPATH
else
if [ "x$SSH_TTY" != "x" ]; then
echo "rIDL not present in $HOME/projects/ridl/install"
fi
fi
# setup ucomp
if [ -a $HOME/software/ucomp-pipeline/bin/ucomp-completion.bash ]; then
source $HOME/software/ucomp-pipeline/bin/ucomp-completion.bash ]
fi
# setup SolarSoft
export SSW=/hao/contrib/ssw
export SSWDB=/hao/solar1/sswdb
export SSW_INSTR="eit lasco cds sumer mdi uvcs eis sot xrt sxig12 sxig13 trace hessi spartan soon nso mees lapalma vso ontology secchi ssc plastic impact sxt ontology aia hmi eve bcs hxt wbs binaries chianti pfss hydro ana ztools cmes cactus cp poa"
if [ -a $HOME/.aliases ]; then
source $HOME/.aliases
else
if [ "x$SSH_TTY" != "x" ]; then
echo "Aliases not present in $HOME/.aliases"
fi
fi
if [ -a $HOME/.git-completion.bash ]; then
source $HOME/.git-completion.bash
else
if [ "x$SSH_TTY" != "x" ]; then
echo "git completion not present"
fi
fi
# setup Python
export PYTHONSTARTUP=$HOME/.pythonrc
ANACONDA_DIR=$HOME/anaconda3
if [ -d $ANACONDA_DIR/bin ]; then
export PATH=$ANACONDA_DIR/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ANACONDA_DIR/lib
if [ -a $ANACONDA_DIR/bin/virtualenvwrapper.sh ]; then
export VIRTUALENVWRAPPER_PYTHON=$ANACONDA_DIR/bin/python
source $ANACONDA_DIR/bin/virtualenvwrapper.sh
fi
fi
# setup heasoft (ftools, etc.)
HEASOFT_DIR=$HOME/software/heasoft-install/x86_64-unknown-linux-gnu-libc2.12
if [ -d $HEASOFT ]; then
export PATH=$HEASOFT_DIR/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HEASOFT_DIR/lib
fi
# setup pyenv
if [ -d $HOME/.pyenv/bin ]; then
export PATH=$HOME/.pyenv/bin:$PATH
fi
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
[ -f ~/.cargo/env ] && source $HOME/.cargo/env
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion