-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc
More file actions
94 lines (80 loc) · 2.84 KB
/
.bashrc
File metadata and controls
94 lines (80 loc) · 2.84 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
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/usr/local/sbin
export GOPATH=$HOME/Library/go
export PATH="$PATH:$GOPATH/bin"
export PATH="$PATH:$HOME/.config/yarn/global/node_modules/.bin:$HOME/.yarn/bin"
# Homebrew settings
export HOMEBREW_NO_AUTO_UPDATE=1
eval "$(/opt/homebrew/bin/brew shellenv)"
export GOPRIVATE="github.com/mailgun"
export ETCD3_ENDPOINT=localhost:2379
export EVENTBUS_ENDPOINT=localhost:19091
export MG_ENV=dev
export BASH_SILENCE_DEPRECATION_WARNING=1
# Alias for golang profiles to analyze with pprof
profile() {
INSTANCE=$1
if [ -z "$INSTANCE" ]; then
echo "USAGE: $0 INSTANCE"
exit 1
fi
OUT=$2
if [ -z "$OUT" ]; then
OUT=./tmp-profiling
fi
ORIG_DIR=$(pwd)
mkdir -p $OUT
cd $OUT
curl -o heap.profile $INSTANCE/_debug/pprof/heap
curl -o allocs.profile $INSTANCE/_debug/pprof/allocs
curl -o trace.profile $INSTANCE/_debug/pprof/trace
curl -o cpu.profile "$INSTANCE/_debug/pprof/profile?seconds=10"
cd $ORIG_DIR
echo "Profiles in $OUT"
}
export NVM_DIR="$HOME/.nvm"
function setup_nvm {
. $NVM_DIR/nvm.sh
}
# This loads nvm bash_completion
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
# Checks if the file .ssh-agent-environment exists in home dir and sources it to set the appropriate environment variables.
# See related alias below.
[[ -s ~/.ssh-agent-environment ]] && . ~/.ssh-agent-environment &>/dev/null
# https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh
. ~/.git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWUNTRACKEDFILES=1
export GIT_PS1_SHOWCOLORHINTS=1
# cf. https://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html
PROMPT_COMMAND='__git_ps1 "[\[\e[34m\]\d \t\[\e[m\] : \[\e[35m\]\w\[\e[m\]]" "\n$ "'
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
# format 'history' command output
export HISTTIMEFORMAT="%m/%d/%y %T "
# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
else
export EDITOR='nvim'
fi
# Vi mode
# - vim prompt not available till Bash 4.3 or later versions
# of GNU Readline
# - no visual mode
# - nice emacs keybindings are lost, requires bindkey changes
# set -o vi
alias ls='ls -GFh'
alias ll='ls -l'
alias la='ls -a'
alias lla='ls -la'
# python3 local dir venv
alias vnv='. .env/bin/activate'
alias venv='. .venv/bin/activate'
alias dvnv='deactivate'
alias python='python3'
alias gomg='cd $GOPATH/src/github.com/mailgun/'
alias prj='cd ~/projects/'
alias swapdir='cd ~/.local/share/nvim/swap/'
alias rm-pyc='find . -name "*.pyc" -exec rm -rf {} \;'
# https://vlaams-supercomputing-centrum-vscdocumentation.readthedocs-hosted.com/en/latest/access/using_ssh_agent.html
alias start-ssh-agent='/usr/bin/ssh-agent -s > ~/.ssh-agent-environment; . ~/.ssh-agent-environment'