You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To init different anaconda environments for different clusters
Install anaconda into a different folder for each cluster and modify the below script accordingly.
# Huckleberryif [[ $HOSTNAME== hu* ]];then# >>> conda initialize >>># !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/bgavin/hu_anaconda2/bin/conda''shell.bash''hook'2> /dev/null)"if [ $?-eq 0 ];theneval"$__conda_setup"elseif [ -f"/home/bgavin/hu_anaconda2/etc/profile.d/conda.sh" ];then."/home/bgavin/hu_anaconda2/etc/profile.d/initialize >>> # !! Contents within this block are managed by 'conda init' !! __conda_setup="$('/home/bgavin/hu_anaconda2/bin/conda''shell.bash''hook'2> /dev/null)" if [ $? -eq 0 ]; then eval "$__conda_setup" else if [ -f "/home/bgavin/hu_anaconda2/etc/profile.d/conda.sh" ]; then . "/home/bgavin/hu_anaconda2/etc/profile.d/conda.sh" else export PATH="/home/bgavin/hu_anaconda2/bin:$PATH" fi fi unset __conda_setup # <<< conda initialize <<< conda.sh"elseexport PATH="/home/bgavin/hu_anaconda2/bin:$PATH"fifiunset __conda_setup
# <<< conda initialize <<<# Use local tmux built for Power8 archalias tmuxl='$HOME/local/bin/tmux_hu'# NewRiverelif [[ $HOSTNAME== nr* ]];then# >>> conda initialize >>># !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/bgavin/nr_anaconda2/bin/conda''shell.bash''hook'2> /dev/null)"if [ $?-eq 0 ];theneval"$__conda_setup"elseif [ -f"/home/bgavin/nr_anaconda2/etc/profile.d/conda.sh" ];then."/home/bgavin/nr_anaconda2/etc/profile.d/initialize >>> # !! Contents within this block are managed by 'conda init' !! __conda_setup="$('/home/bgavin/nr_anaconda2/bin/conda''shell.bash''hook'2> /dev/null)" if [ $? -eq 0 ]; then eval "$__conda_setup" else if [ -f "/home/bgavin/nr_anaconda2/etc/profile.d/conda.sh" ]; then . "/home/bgavin/nr_anaconda2/etc/profile.d/conda.sh" else export PATH="/home/bgavin/nr_anaconda2/bin:$PATH" fi fi unset __conda_setup # <<< conda initialize <<< conda.sh"elseexport PATH="/home/bgavin/nr_anaconda2/bin:$PATH"fifiunset __conda_setup
# <<< conda initialize <<<# Use local tmux built for x86 archalias tmuxl='$HOME/local/bin/tmux_nr'# Cascadeselif [[ $HOSTNAME== ca* ]];then# >>> conda initialize >>># !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/bgavin/ca_anaconda2/bin/conda''shell.bash''hook'2> /dev/null)"if [ $?-eq 0 ];theneval"$__conda_setup"elseif [ -f"/home/bgavin/ca_anaconda2/etc/profile.d/conda.sh" ];then."/home/bgavin/ca_anaconda2/etc/profile.d/initialize >>> # !! Contents within this block are managed by 'conda init' !! __conda_setup="$('/home/bgavin/ca_anaconda2/bin/conda''shell.bash''hook'2> /dev/null)" if [ $? -eq 0 ]; then eval "$__conda_setup" else if [ -f "/home/bgavin/ca_anaconda2/etc/profile.d/conda.sh" ]; then . "/home/bgavin/ca_anaconda2/etc/profile.d/conda.sh" else export PATH="/home/bgavin/ca_anaconda2/bin:$PATH" fi fi unset __conda_setup # <<< conda initialize <<< conda.sh"elseexport PATH="/home/bgavin/ca_anaconda2/bin:$PATH"fifiunset __conda_setup
# <<< conda initialize <<<# Use local tmux built for x86 archalias tmuxl='$HOME/local/bin/tmux_nr'fi
Keyboard aliases
# Get key status -- Caps Lock, Num Lock, Scroll Lockalias keystatus="xset q | grep 'Caps' | tr -s ' ' | cut -d ' ' -f 3,5,7,9,11,13"# Disable Caps lock. Map it to Left Shift insteadalias nocaps='xmodmap -e "keycode 66 = Shift_L NoSymbol Shift_L"'alias pbcopy='xclip -selection clipboard'alias pbpaste='xclip -selection clipboard -o'alias sbrc="source ~/.bashrc"alias c='clear'alias cd..='cd ..'alias ..='cd ..'# Current weather on the terminal :)alias wthr="curl wttr.in/?0u"
List files / Upload to a Google Drive folder using gDrive
$DIRECTORY_URI=<DIRECTORY_URI_GOES_HERE>alias list_dir="gdrive list --query \"'$DIRECTORY_URI' in parents\""upload_to_dir() {
gdrive upload -p $DIRECTORY_URI$1
}
Local tmux
Run this file to install tmux locally into $HOME/local/bin/tmux
I had to run this twice, once on Huckleberry (Power8) and once on NewRiver or Cascades. I just renamed them and created aliases (see ~/.bashrc above)
#!/bin/bash# Script for installing tmux on systems where you don't have root access.# tmux will be installed in $HOME/local/bin.# It's assumed that wget and a C/C++ compiler are installed.# exit on errorset -e
TMUX_VERSION=2.7
# create our directories
mkdir -p $HOME/local $HOME/tmux_tmp
cd$HOME/tmux_tmp
# download source files for tmux, libevent, and ncurses
wget -O tmux-${TMUX_VERSION}.tar.gz https://github.com/tmux/tmux/releases/download/${TMUX_VERSION}/tmux-${TMUX_VERSION}.tar.gz
wget -O libevent-2.1.8-stable.tar.gz https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
wget -O ncurses.tar.gz http://invisible-island.net/datafiles/release/ncurses.tar.gz
# extract files, configure, and compile############# libevent #############
tar xvzf libevent-2.1.8-stable.tar.gz
cd libevent-2.1.8-stable
./configure --prefix=$HOME/local --disable-shared
make
make install
cd ..
############# ncurses #############
tar xvzf ncurses.tar.gz
cd ncurses-6.1
./configure --prefix=$HOME/local
make
make install
cd ..
############# tmux #############
tar xvzf tmux-${TMUX_VERSION}.tar.gz
cd tmux-${TMUX_VERSION}
./configure CFLAGS="-I$HOME/local/include -I$HOME/local/include/ncurses" LDFLAGS="-L$HOME/local/lib -L$HOME/local/include/ncurses -L$HOME/local/include"
CPPFLAGS="-I$HOME/local/include -I$HOME/local/include/ncurses" LDFLAGS="-static -L$HOME/local/include -L$HOME/local/include/ncurses -L$HOME/local/lib" make
cp tmux $HOME/local/bin
cd ..
# cleanup
rm -rf $HOME/tmux_tmp
echo"$HOME/local/bin/tmux is now available. You can optionally add $HOME/local/bin to your PATH."
~/.tmux.conf
set -g default-terminal "screen-256color"# Command history
set-option -g history-limit 90000
#Add C-a prefixset -g prefix C-a
set -g prefix2 `# Open new pane or window on the current directorybind'"' split-window -c "#{pane_current_path}"bind % split-window -h -c "#{pane_current_path}"bind c new-window -c "#{pane_current_path}"# Lets me use use ctrl+arrow to skip wordsset-window-option -g xterm-keys on# Enable mouse mode (tmux version > 2.1)# set -g mouse on# switch panes using Alt-arrow without prefixbind -n M-h select-pane -Lbind -n M-l select-pane -Rbind -n M-k select-pane -Ubind -n M-j select-pane -D# Resize the current pane using Alt + directionbind -n C-M-k resize-pane -U 2bind -n C-M-j resize-pane -D 2bind -n C-M-h resize-pane -L 2bind -n C-M-l resize-pane -R 2# Shift arrow to switch windowsbind -n S-Left previous-windowbind -n S-Right next-window# reload configbind M-r source-file ~/.tmux.conf
~/.jupyter/jupyter_notebook_config.py
## The IP address the notebook server will listen on.
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.token = '<set-a-password-here>'