-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbashrc
More file actions
106 lines (82 loc) · 3.17 KB
/
bashrc
File metadata and controls
106 lines (82 loc) · 3.17 KB
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
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
parse_git_branch() {
git branch 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
DEFAULT='\[\033[0m\]'
# User specific aliases and functions
PS1="$RED[\u@\h \W$YELLOW\$(parse_git_branch)$RED]\$ $DEFAULT"
export EDITOR="nvim"
#colourfull command line
export CLICOLOR=1
alias vim="nvim"
#add texlive 2012 to the path if it's installed
TEXLIVEDIR="/usr/local/texlive/2013/bin/$(uname -m)-linux"
if [ -d "$TEXLIVEDIR" ]; then
PATH=$TEXLIVEDIR:$PATH
fi
#jhbuild
PATH=$PATH:~/.local/bin
#Synthace
export GOPATH=~/go
export GOPRIVATE=github.com/Synthace
PATH=$PATH:/usr/local/go/bin:~/go/bin
PATH=$PATH:~/src/arcanist/bin/
# Kubernetes
KUBEPS1=""
if [ -x $(which kubectl) ]; then
KUBEPS1=' \[\033[01;38;5;214m\](k8s:$(kubectl config current-context))'
if [ -x $(which whiptail) ]; then
# Handy function to quickly switch kubernetes context, they can be a pain otherwise...
function kc() {
values=$(kubectl config get-contexts -o name | sort)
selection=$(echo $values | xargs -n 1 | awk '{print v++,$1}')
arr=($values)
tmpfile=$(mktemp)
whiptail --menu "Please select a kubernetes context:" 25 75 12 $selection 2>$tmpfile
choice=$(cat $tmpfile)
rm -rf $tmpfile
if [ "XXX$choice" != "XXX" ]; then
kubectl config use-context ${arr[choice]}
fi
}
fi
alias ks='kubectl config current-context'
fi
#don't fail element tests due to open files
ulimit -S -n 2048
PATH=~/.pyenv/bin:$PATH
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/usr/local/Caskroom/miniconda/base/bin/conda' 'shell.bash' 'hook' 2>/dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/usr/local/Caskroom/miniconda/base/etc/profile.d/conda.sh" ]; then
. "/usr/local/Caskroom/miniconda/base/etc/profile.d/conda.sh"
else
export PATH="/usr/local/Caskroom/miniconda/base/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
export PATH="$PATH:/opt/nvim-linux64/bin"
PATH=/opt/minizinc/bin:$PATH
export MINIZINC_PATH=/opt/minizinc/binminizinc
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
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/home/haydn/src/google-cloud-sdk/path.bash.inc' ]; then . '/home/haydn/src/google-cloud-sdk/path.bash.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/home/haydn/src/google-cloud-sdk/completion.bash.inc' ]; then . '/home/haydn/src/google-cloud-sdk/completion.bash.inc'; fi
# delete squash-merged branches
alias rmsquashed='git checkout -q master && git for-each-ref refs/heads/ "--format=%(refname:short)" | while read branch; do mergeBase=$(git merge-base master $branch) && [[ $(git cherry master $(git commit-tree $(git rev-parse "$branch^{tree}") -p $mergeBase -m _)) == "-"* ]] && git branch -D $branch; done'