-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc
175 lines (137 loc) · 4.8 KB
/
zshrc
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
if [ -d $HOME/.rbenv ]; then
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
fi
export TERM="xterm-256color"
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
#ZSH_THEME="powerlevel9k/powerlevel9k"
source /usr/local/opt/powerlevel9k/powerlevel9k.zsh-theme
POWERLEVEL9K_BATTERY_CHARGING='yellow'
POWERLEVEL9K_BATTERY_CHARGED='green'
POWERLEVEL9K_BATTERY_DISCONNECTED='$DEFAULT_COLOR'
POWERLEVEL9K_BATTERY_LOW_THRESHOLD='10'
POWERLEVEL9K_BATTERY_LOW_COLOR='red'
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=''
# POWERLEVEL9K_MULTILINE_SECOND_PROMPT_PREFIX='\uf0da'
POWERLEVEL9K_VCS_GIT_ICON='\ue60a'
POWERLEVEL9K_VCS_MODIFIED_BACKGROUND='yellow'
POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND='yellow'
POWERLEVEL9K_VCS_UNTRACKED_ICON='?'
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(status context dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(rbenv rvm time background_jobs virtualenv battery)
POWERLEVEL9K_STATUS_VERBOSE=false
POWERLEVEL9K_SHORTEN_STRATEGY="truncate_middle"
POWERLEVEL9K_SHORTEN_DIR_LENGTH=3
DEFAULT_USER="antony.gelson"
source $ZSH/oh-my-zsh.sh
# Uncomment following line if you want red dots to be displayed while waiting for completion
COMPLETION_WAITING_DOTS="true"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git github autojump command-not-found)
# User configuration
alias ezsh='vim ~/.zshrc'
alias szsh='source ~/.zshrc'
# alias for Git
alias g='git'
alias ga='git add'
alias gaa='git add .'
alias gs='git status --short'
alias gc='git commit'
alias gp='git push'
alias gl='git log --graph --oneline --decorate --all'
alias go='git checkout'
alias gob='git checkout -b'
alias gb='git branch'
alias gd='git diff'
alias gm='git merge'
alias gcm='git commit -m '
alias gpod='git pull origin develop'
alias gprod='git pull --rebase origin develop'
alias gpom='git pull origin master'
alias gsl='git stash list'
alias gsd='git stash drop'
alias gst='git stash'
alias gss='git stash show'
alias gsa='git stash apply'
alias gsp='git stash pop'
alias gpo='git push origin'
alias gpof='git push origin -f'
alias gca='git commit --amend'
alias gcane='git commit --amend --no-edit'
alias d='docker'
alias dc='docker-compose'
alias dcu='docker-compose up -d'
alias dcd='docker-compose down'
alias dl='docker logs'
alias de='docker exec -ti'
alias dp='docker ps'
alias dpa='docker ps -a'
alias dm='docker-machine'
alias di='docker images'
alias dri='docker rmi'
alias dv='docker volume'
alias dn='docker network'
export VISUAL=vim
export EDITOR="$VISUAL"
export GIT_EDITOR=vim
setopt autocd
export PATH="/usr/local/opt/openssl/bin:$PATH"
# export HOMEBREW_GITHUB_API_TOKEN=42fbff72db50fc094b053d3cc02c1c1557fd674a
alias explico='bundle exec explico'
export EXPLICO_PATH="/usr/local/explico_gem"
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH
autoload -Uz compinit
compinit
fi
. $(brew --prefix asdf)/asdf.sh
export KERL_CONFIGURE_OPTIONS="--enable-sctp"
function ms_traffic_dump() {
server="ms" && user="centos" &&
dir="/var/log/traffic_dump" &&
file=$(ssh ms "ls -t ${dir}/ | head -1") &&
scp $user@$server:$dir/${file} ~/Downloads/traces/$server/${file}.pcap &&
wireshark ~/Downloads/traces/$server/${file}.pcap
}
function dev1_traffic_dump() {
server="10.169.102.71" && user="f.parmanchukov" &&
dir="/var/log/traffic_dump" &&
file=$(ssh [email protected] "ls -t ${dir}/ | head -1") &&
scp $user@$server:$dir/${file} ~/Downloads/traces/$server/${file}.pcap &&
wireshark ~/Downloads/traces/$server/${file}.pcap
}
function dev3_traffic_dump() {
server="10.169.102.73" && user="f.parmanchukov" &&
dir="/var/log/traffic_dump" &&
file=$(ssh [email protected] "ls -t ${dir}/ | head -1") &&
scp $user@$server:$dir/${file} ~/Downloads/traces/$server/${file}.pcap &&
wireshark ~/Downloads/traces/$server/${file}.pcap
}
function startVPN() {
local _host _account_name _service_name _username _pwd
_host="${1:-webvpn.funbox.io}"
_account_name="${_host}"
_service_name="${_host}"
_username="${2-f.parmanchukov}"
_pwd=$(security find-generic-password -a "${_account_name}" -s "${_service_name}" -w 2>/dev/null)
echo "${_pwd}\n" | sudo openconnect "${_host}" --mtu=1200 --background --quiet --user="${_username}" --passwd-on-stdin &> /dev/null
}
function stopVPN() {
sudo pkill -SIGTERM -f openconnect >/dev/null
}
function restartVPN() {
stopVPN
startVPN
}
function vpn() {
restartVPN
}
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix [email protected])"
export PATH="/usr/local/sbin:$PATH"