-
Notifications
You must be signed in to change notification settings - Fork 0
/
aliases
137 lines (113 loc) · 3.49 KB
/
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
#
# Aliases
#
alias ls='ls --color'
alias ll='ls -l'
alias la='ls -a'
# text editor aliases (mostly for Mac)
if [[ $(uname) = 'Darwin' ]]; then
alias e='code'
alias e.='code -n .'
alias elp='code -n ~/Projects'
alias ebp='code -n ~/Dropbox/Projects'
alias ewa='code -n ~/workspace/lpx-ansible'
alias ewapp='code -n ~/workspace/lpx-app'
alias ewr='code -n ~/workspace/relight'
alias ewt='code -n ~/workspace/lp_terraform'
else
alias e='vim'
alias e.='vim .'
fi
alias dm="python manage.py"
alias digg="dig +multiline +nocomments +nocmd +noquestion +nostats +search"
alias hgrep="history | grep "
# Make mkdir recursive
alias mkdir='mkdir -p'
# tmux
alias tm='tmux -u2'
function ssht(){
ssh $1 -t -- /bin/sh -c 'tmux has-session && exec tmux attach || exec tmux -u2'
}
# pour some sugar on me
alias df='df -kH'
alias ncdu="ncdu --color dark -rr"
alias help='tldr'
# convert newlines to LF
alias convert_newlines="perl -pi -e 's/\r\n/\n/g'"
# LP-specific aliases
if [ -n "$ZSH_VERSION" ]; then
alias -g wapp='~/workspace/lpx-app'
alias -g wa='~/workspace/lpx-ansible'
alias -g wr='~/workspace/relight'
alias -g wt='~/workspace/lp_terraform'
else
alias wapp='~/workspace/lpx-app'
alias wa='~/workspace/lpx-ansible'
alias wr='~/workspace/relight'
alias wt='~/workspace/lp_terraform'
fi
alias lpa='lp-assume-role admin'
alias lpo='lp-assume-role ops'
alias lpd='lp-assume-role dev'
alias dtf='docker compose run --rm terraform'
# mercurial
alias hgsl='hg shelve --list'
alias hgsp='hg shelve --patch'
alias hgsd='hg shelve --delete'
# SVN
alias sco='svn co'
alias sup='svn up'
alias sci='svn ci -m'
alias saa='svn status | grep "^\?" | awk "{print \$2}" | xargs svn add'
alias scleann="svn status --no-ignore | grep '^\?' | sed 's/^\? //' | xargs rm -rf"
alias slog="python ~/.files/bin/svnlog.py"
alias smm='svn merge "^/www/branches/maint" -c'
alias smf='svn merge "^/www/branches/factory" -c'
alias sdif='svn diff'
# horse ebooks
alias horse="while true; do curl -s http://horseebooksipsum.com/api/v1/ | say; done;"
# yolo
alias git-yolo='git commit -am "`curl -s http://whatthecommit.com/index.txt`"'
if [ -n "$ZSH_VERSION" ]; then
# be quiet
alias -g quietly='> /dev/null 2>&1'
fi
# serveit
alias serveit='python3 -m http.server'
# sl
alias sl='~/.files/bin/sl.sh'
# sudo switch user with zsh shell
alias sudosuz='sudo -E su --shell /usr/bin/zsh'
# docker
alias d='docker'
alias dc='docker-compose'
alias dcp='docker-compose -f docker-compose.yml -f docker-compose.production.yml'
alias dcompost='docker system prune --all --volumes'
# kubernetes
export KUBE_EDITOR=vim
alias k='kubectl'
alias kc='kubectx'
alias kn='kubens'
alias kap='kubectl get pods --all-namespaces -o wide | awk {'"'"'print $1" "$2" "$3" "$4" "$5" "$6" "$8'"'"'} | column -t'
alias kaps='kubectl get pods --all-namespaces -o wide --sort-by=.spec.nodeName| awk {'"'"'print $1" "$2" "$3" "$4" "$5" "$6" "$8'"'"'} | column -t'
# colima
alias c='colima'
# vagrant
alias vup='vagrant up'
alias vupno='vagrant up --no-provision'
alias vre='vagrant halt && vagrant up --no-provision'
alias vh='vagrant halt'
alias vp='vagrant provision'
alias vsh='vagrant ssh'
alias vst='vagrant status'
alias vgst='vagrant global-status'
# TODO: customize bat with solarized theme
# https://github.com/sharkdp/bat#adding-new-themes
# replace cat with bat, if it exists
if [ -x "$(command -v bat)" ]; then
alias cat='bat'
fi
# replace ping with prettyping, if it exists
if [ -x "$(command -v prettyping)" ]; then
alias ping='prettyping --nolegend'
fi