-
Notifications
You must be signed in to change notification settings - Fork 0
/
dotbashrc
141 lines (117 loc) · 3.97 KB
/
dotbashrc
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
#!/bin/bash
# don't break scp with echo in .bashrc
if [ -z "$PS1" ]; then
return
fi
# the buffer string
export bufferstring="============================================================"
# function to get into MPI environment
# (for compiling/running Rayleigh)
alias loadmpi="module purge; module load mpi-hpe; module load comp-intel"
loadmpirome () {
module purge
module load gcc/13.2 mpi-hpe/mpt
fftwlib=/home4/nfeather/software/fftw-3.3.10-Rome/
blaslib=/home4/nfeather/software/OpenBLAS-0.3.27-Rome/
export LD_LIBRARY_PATH=$blaslib\lib:$fftwlib\lib:$LD_LIBRARY_PATH
export OMP_NUM_THREADS=1
}
# load firefox
alias loadff="module load firefox"
alias resetff="rm -f ~/.mozilla/firefox/*/.parentlock"
# state what's going on
echo $bufferstring
echo "Executing $HOME/environment/dotbashrc"
# Note (04/20/22):
# This file sets the default environment on the PFEs / LFEs
# Very little of the environment is changed in this file per se
# loading all the "standard" settings is accomplished by running
# sbpfe (source the bashrc_pfe file in the ~/environment repo)
# ---or, analogously, sblfe
# this ensures the environments on compute nodes / pbspl1 remain
# "uncorrupted" by default
# depending on the hostname, more defaults will be loaded via
# sbpfe, sblfe, sblcd, sbmac
# the following are environmental aliases
# in any environment, I have the option of getting into
# my bigger environments)
# specific HOME directory(s) (what $HOME defaults to on a given system)
export HOME_LFE=/lou/la2/lmatilsk
export HOME_PFE=/home1/lmatilsk
export HOME_LCD=/home5/loma3853
export HOME_MAC=/home/loren
# the environment git repo
export envdir=$HOME/environment
# the $HOME variable should be good no matter the system
# short "dot bashrc" file (i.e., this file)
export dotbrc=$envdir/dotbashrc
# long bashrc files (the big environments)
export brcpfe=$envdir/bashrc_pfe
export brcconda=$envdir/bashrc_loadconda
export brclfe=$envdir/bashrc_lfe
export brclcd=$envdir/bashrc_lcd
export brcmac=$envdir/bashrc_mac
# supporting "common" files for the big environments
export brccommon=$envdir/bashrc_common
export brcra=$envdir/bashrc_ra_routines
# commands to source each env file
alias sbpfe="source $brcpfe"
alias sbconda="source $brcconda"
alias sblfe="source $brclfe"
alias sblcd="source $brclcd"
alias sbmac="source $brcmac"
alias sbcommon="source $brccommon"
alias sbra="source $brcra"
alias sbdot="source $dotbrc"
# commands to edit each env file
alias vbpfe="vim $brcpfe"
alias vbconda="vim $brcconda"
alias vblfe="vim $brclfe"
alias vblcd="vim $brclcd"
alias vbmac="vim $brcmac"
alias vbcommon="vim $brccommon"
alias vbcommon="vim $brccommon"
alias vbra="vim $brcra"
alias vbdot="vim $dotbrc"
# command to source bashrc_pfe and then launch jupyter notebook server
jserve() {
sbpfe
sbconda
jupyter lab --sock /tmp/user.sock --no-browser --certfile=~/.jupyter/jupyter.pem --keyfile ~/.jupyter/jupyter.key
#jupyter notebook --sock /tmp/user.sock --no-browser
}
# only do anything (automatically) on specific hosts
# LFE hosts
host=`hostname`
if [[ "$host" == "lfe"* ]] || [[ "$host" == "ldan"* ]]; then
# Enable auto-completion in git
#source /etc/bash_completion.d/git.sh
source /usr/share/bash-completion/completions/git
sblfe
sbconda
fi
# PFE or AFE hosts (almost the same except for conda)
if [[ "$host" == "pfe"* ]] || [[ "$host" == "afe"* ]]; then
# Enable auto-completion in git
source /usr/share/bash-completion/completions/git
sbpfe
if [[ "$host" == "pfe"* ]]; then
# also get into conda environment
sbconda
fi
fi
# LCD hosts
if [[ "$host" == *"colorado.edu" ]]; then
# Enable auto-completion in bash
source ~/git-bash-completion
sblcd
fi
# MAC hosts
if [[ "$host" == "lorensMac"* ]] || [[ "$host" == "cu-genvpn"* ]] || [[ "$host" == *"eduroam"* ]]; then
source ~/.git-completion.bash
sbmac
fi
echo $bufferstring
# define current path and then way to reset path
export PATH0=$PATH
alias resetpath="export PATH=$PATH0"