-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_aliases
248 lines (228 loc) · 6.97 KB
/
.bash_aliases
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# shellcheck shell=bash
#
#-=>•</\>•<=-------------------------------------------------------------------
#
# .bash_aliases :: jcopp.cfxd.net
#
# - 'Single quotes' will be evaluated dynamically each time the alias is used
# - "Double quotes" will be evaluated once when the alias is created
#
#=-----------------------------------------------------------------------------
#`
# ls
#
eval "$(gdircolors)" # get `ls` to colorize orphaned links on macos
alias ls="gls --color=auto" # alias ls="ls --color"
alias ll="ls -lh"
alias la="ll -a"
alias lsh="ll -S"
alias lshr="ll -Sr"
alias ltr="ll -tr"
alias latr="ll -atr"
alias lld="ll --group-directories-first"
# cd / navigation
#
alias dl="cd ~/downloads"
alias tor="cd ~/downloads/torrents"
alias bin="cd ~/bin"
alias logs="cd ~/logs"
alias wgets="cd ~/wgets"
alias curls="cd ~/curls"
alias lbin="cd /usr/local/bin"
alias dtop="cd ~/Desktop"
alias dbox="cd ~/Dropbox"
alias dbin="cd ~/Dropbox/jhome/bin"
alias gitdot='cd ~/git/github/jobicoppola/dotfiles && git st'
alias venvs='cd ~/venvs/'
#
alias cdghjc='cd ~/git/github/jobicoppola'
alias cdgh='cd ~/git/github'
alias cdgl='cd ~/git/gitlab'
alias cdbb='cd ~/git/bitbucket'
alias cdprojects='cd ~/projects'
alias cdansible='cd ~/projects/ansible'
alias cdsync='cd ~/Dropbox/sync'
alias cdsyncsh='cd ~/Dropbox/sync/shell'
alias cdnotes='cd ~/Dropbox/files/notes'
alias cdwords='cd ~/Dropbox/files/notes/words'
alias cdu='cd ../'
alias cdu2='cd ../../'
alias cdu3='cd ../../../'
alias cdu4='cd ../../../../'
# vi
#
alias vi='vim'
alias sbash=". ~/.bashrc"
alias vbash="vi ~/git/github/jobicoppola/dotfiles/.bashrc"
alias jcc="vi ~/Dropbox/sync/shell/legacy/jc3"
alias svim="cp -p ~/git/github/jobicoppola/dotfiles/.vimrc ~/"
alias valias="vi ~/git/github/jobicoppola/dotfiles/.bash_aliases"
alias vvim="vi ~/git/github/jobicoppola/dotfiles/.vimrc"
alias vioneliners='vi ~/Dropbox/sync/shell/one-liners'
alias viquotes='vi ~/Dropbox/files/notes/misc/quotes.md'
alias vlans='~/venvs/vlans/bin/python ~/venvs/vlans/vlans.py'
# cmd various
#
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias Grep='grep'
alias getip='wget -qO - https://icanhazip.com'
alias gi='gem install --no-rdoc --no-ri'
alias gu='gem update --no-rdoc --no-ri'
alias tail='grc tail'
alias diff='colordiff'
alias less='less -iRFX'
alias pipup='pip install --upgrade'
alias fib='echo 0,1,1,2,3,5,8,13,21,34,55,89,144'
alias mtr='mtr --curses'
alias mtail='multitail'
alias mvi='mv -i'
alias emo='emojify'
alias emol='emo --list'
alias emog='emol |grep'
alias nodig='dig +nocmd +nostats +nocomments'
alias dnsflush='dscacheutil -flushcache'
# git
#
alias cdgit='cd ~/git/'
alias gp='git push'
alias gpl='git pull'
alias gpr='git pull --rebase'
alias gst='git status -sb'
alias gb='git branch'
alias gba='git branch -a'
alias gbd='git branch -d'
alias gc='git commit -v'
alias gcm='git commit -m'
alias gcma='git commit -am'
alias gd='git diff'
alias gds='git diff --stat'
alias gdno='git diff --name-only'
alias gdns='git diff --name-status'
alias gdc='git diff --color-words'
alias gra='git remote add'
alias grr='git remote rm'
alias gl='git log'
alias glc='git show --name-only $(git rev-parse HEAD)'
alias glf='git log --name-status --oneline'
alias ga='git add'
alias gctb='git checkout --track -b'
alias gph='git push heroku master'
alias gpuo='git push -u origin'
alias grwm='git fetch && git rebase origin/master'
alias grwmm='git fetch && git rebase origin/main'
alias gpf='git push --force-with-lease'
alias tagsort='git tag |sort -V'
# github
#
alias gistit='gist --shorten --copy'
alias prgist='gistit --private'
alias pgist='gistit --paste'
alias hpr='hub pull-request'
alias hpro='hub pull-request --labels ops'
alias gitshort='curl -i https://git.io -F'
# virtualenv
# courtesy @doughellman
#
alias v='workon'
alias v.deactivate='deactivate'
alias v.mk='mkvirtualenv --no-site-packages'
alias v.mk_withsitepackages='mkvirtualenv'
alias v.rm='rmvirtualenv'
alias v.switch='workon'
alias v.add2virtualenv='add2virtualenv'
alias v.cdsitepackages='cdsitepackages'
alias v.cd='cdvirtualenv'
alias v.lssitepackages='lssitepackages'
# django
#
alias mpy='python manage.py'
alias mpys='python manage.py shell'
alias mpydbs='python manage.py dbshell'
alias mpyrs='python manage.py runserver'
alias mpysm='python manage.py schemamigration'
alias mpysma='python manage.py schemamigration --auto'
# ansible
#
alias anv='ansible-vault'
alias anvv="python2 \$HOME/bin/ansible-inline-vault-view"
alias anve="ansible_vault_encrypt_oneline_string"
alias anvec="ansible_vault_encrypt_oneline_string | pbcopy"
alias anvd="sed -E 's/^[ \t]+//g' | ansible-vault decrypt 2>/dev/null"
alias anves="ansible-vault encrypt_string"
alias ansibleupdate='git pull --rebase && git submodule update --init --recursive'
# rg aka ripgrep
#
alias rga='rg --no-ignore --hidden --ignore-case' # prioritize over rga aka ripgrep-all below
alias rgi="rg --no-ignore --hidden --smart-case -g='!.git' -g='!site-packages/'"
alias rgblanks="rga -g='!.git' -g='!venv/' '[[:blank:]]$' ."
alias rgaf='rga-fzf' # rga aka ripgrep-all tool to search pdf zip gz etc
alias rgafo='rga-fzf-open'
# fd fast find
#
alias fdh='fd --hidden'
alias fde='fd --extension'
alias fda='fd --no-ignore --hidden'
alias fdi='fd --no-ignore'
# t task manager
#
alias t='python ~/git/github/t/t.py --task-dir ~/tasks --list tasks'
alias g='python ~/git/github/t/t.py --task-dir ~/tasks --list groceries'
alias m='python ~/git/github/t/t.py --task-dir ~/tasks --list music'
# http status codes reference
#
alias http-status='httpsc'
alias hsc='httpsc'
# k8s
#
alias k='kubectl'
alias kx='kubectx'
alias kn='kubens'
alias ybat='bat -p --theme="gruvbox-dark" -l yaml'
# jira
#
alias jb='jira browse'
alias jms='jira mine --size small'
#
eval "$(jira --completion-script-bash)" # jira cli completions
# use bundler to manage ruby applications
#
alias b="bundle"
alias bi="b install --path vendor"
alias bil="bi --local"
alias bu="b update"
alias be="b exec"
alias binit="bi && b package && echo 'vendor/ruby' >> .gitignore"
# curl
#
ak_headers=(
akamai-x-cache-on
akamai-x-cache-remote-on
akamai-x-check-cacheable
akamai-x-get-cache-key
akamai-x-get-extracted-values
akamai-x-get-nonces
akamai-x-get-ssl-client-session-id
akamai-x-get-true-cache-key
akamai-x-serial-no
)
# shellcheck disable=SC2139
alias acurl="curl -H 'Pragma: ${ak_headers[*]}' -sSiLD - -o /dev/null"
alias scurl="curl -sSiLD - -o /dev/null"
# weather
#
alias wttr='WTTR_PARAMS=0 bash wttr'
alias wttr1='WTTR_PARAMS=1Fq bash wttr'
# sound generation
#
# requires `sox`, which installs the `play` command; see HN link:
# https://news.ycombinator.com/item?id=32998960
#
alias brownnoise='play -n synth brownnoise synth pinknoise mix synth sine amod 0.3 10'
alias whitenoise='play -q -c 2 -n synth brownnoise band -n 1600 1500 tremolo .1 30'
alias pinknoise='play -t sl -r48000 -c2 -n synth -1 pinknoise .1 80'
# source other custom alias files from dotfiles config dir
#
config=~/.config/$(whoami)/dotfiles
#
[ -f "$config/.bash_sensible" ] && . "$config/.bash_sensible"