-
Notifications
You must be signed in to change notification settings - Fork 0
/
.shell_aliases
194 lines (164 loc) · 5.11 KB
/
.shell_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
# prints dotfile versions neatly - see .shell_functions
alias ver='cat "$DOTLOC"/.versions'
### Dotfile management
# cd into dotfile dir
alias cdot='cd $DOT_LOC'
# pull latest files from github
alias dopl='git -C "$DOT_LOC" pull'
# modify dotfiles
alias bashrc='$EDITOR ~/.bashrc'
alias zshrc='$EDITOR ~/.zshrc'
alias zconf='$EDITOR ~/.zshrc'
alias alconf='$EDITOR $DOT_LOC/.shell_aliases'
alias fuconf='$EDITOR $DOT_LOC/.shell_functions'
alias shell_setup='$EDITOR $DOT_LOC/shell_setup.sh'
alias tmconf='$EDITOR ~/.tmux.conf'
alias vimrc='$EDITOR ~/.vimrc'
alias vimconf='$EDITOR ~/.vimrc'
# modify ssh config
alias sshconf='$EDITOR ~/.ssh/config'
# reload / source the config files
alias rlv='source_vim'
alias rlvim='source_vim'
alias rltm='source_tmux'
alias rltmux='source_tmux'
alias rlal='source_bashrc'
alias rlb='source_bashrc'
alias rlbash='source_bashrc'
alias rlz='source_zshrc'
alias rlzsh='source_zshrc'
alias sc='shellcheck'
## apt
alias upd='sudo apt update'
alias upg='sudo apt dist-upgrade -y'
alias install='sudo apt install'
alias reinstall='sudo apt --reinstall install'
alias uninstall='sudo apt remove'
alias madison='sudo apt-cache madison'
alias search='sudo apt-cache search'
alias acs='apt-cache search'
alias aa='sudo apt autoremove'
alias af='sudo apt install -f'
alias ac='sudo apt clean'
alias aac='sudo apt autoclean'
## Tmux
alias ta='tmux attach -t'
alias ts='tmux new -s'
alias tl='tmux list-sessions'
alias tk='tmux kill-session -t'
## Utility
alias cdd='cd -' # jump between two dirs
alias c='clear'
alias s='sudo'
alias h='history'
alias v='vim'
alias e='echo'
alias ytdl='python3 /usr/local/bin/youtube-dl'
alias rwx='stat -c %a' # shows you the RWX rights on a file (rwx .bash_aliases should return 664)
alias please='$(history -p !!)' # rerun last command
alias ffs='$(history -p !!)' # rerun last command
alias phug='tree -phug' # Print filetype - Human readable size - Username - Groupname
alias shost='printf "\nssh to these servers\n\n" && grep -e "Host" /home/$(whoami)/.ssh/config | grep -v "Hostname" | grep -v "\*"'
# 'look up' aliases
alias vols='lvs -o +devices' # lists volumes and where they're mounted
alias pubip='curl ipconfig.io' # gets your public ip
alias opo='netstat -tulpn | grep LISTEN' # *OP*en *P*orts
# ls
alias la='ls -lAh --block-size=M'
alias ll='ls -laH'
alias lac='ls -laC --color'
alias sl='ls'
## Docker
alias dver='docker --version'
alias wd='watch -n 0.5 docker ps' # live view of running docker containers
alias dps='docker ps' # list of running docker containers
alias dcs='docker container stop' # stop container
alias dcrm='docker container rm' # remove container
alias dnp='docker network prune' # purges all unused networks
alias dip='docker image prune -a' # purges all unused images
alias dpl='docker pull' # pulls an image
alias dspa='docker system prune -a' # purges all unused resources
alias dspaf='docker system prune -af' # force-purges all unused resources
alias dils='docker image ls' # list of images stored locally
alias dirm='docker image rm' # docker image remove
## Docker-compose
alias dcver='docker-compose --version'
alias dc='docker-compose' # shortcut for docker-compose
alias dcd='dc down' # brings down the environment gracefully
alias dcu='dc up -d' # brings up the environment
alias dcp='dc pull' # pulls all images listed in the docker-compose file
## Kubernetes
alias kc='kubectl'
alias kcv='kc --version'
alias kca='kc apply'
alias kcaf='kc apply -f'
alias kcd='kc delete'
alias kcgn='kc get nodes'
alias kns='kc get namespace'
alias knsd='kc delete namespace'
## Helm (Kubernetes)
alias h='helm'
alias hra='h repo add'
alias hru='h repo update'
alias hsrv='helm_repo_version'
## Vagrant
alias vver='vagrant --version'
alias vup='vagrant up'
alias vs='vagrant ssh'
alias vde='vagrant destroy'
## Ansible
alias aver='ansible --version'
alias ap='ansible-playbook'
alias avc='ansible-vault encrypt'
alias avd='ansible-vault decrypt'
alias ave='ansible-vault edit'
alias ams='ansible -m setup'
alias agi='ansible-galaxy install'
alias ad='ansible-doc'
# Molecule
alias mc='molecule converge'
alias mt='molecule test'
alias ml='molecule lint'
alias ms='molecule syntax'
alias mdes='molecule destroy'
alias minit='molecule init scenario -r $(pwd | xargs basename)'
## Terraform
alias tf='terraform'
alias tfver='tf version'
alias tfp='tf plan'
alias tfa='tf apply'
alias tfd='tf destroy'
alias tft='tf taint'
alias tfut='tf untaint'
alias tfi='tf init'
alias tfv='tf validate'
## Git
alias g='git'
alias ga='g add'
alias gaa='g add --all'
alias gau='g add -u'
alias gb='g branch'
alias gba='g branch --all'
alias gc='g commit'
alias gca='g commit --add'
alias gcam='g commit --add --message'
alias gcm='g commit --message'
alias gch='g checkout'
alias gchb='g checkout -b'
alias gchm='g checkout master'
alias gck='g checkout'
alias gd='g diff'
alias gds='g diff --staged'
alias gdt='g difftool'
alias gp='g push'
alias gpa='g remote | xargs -L1 g push -all'
alias gpl='g pull'
alias gpo='g push origin'
alias gpom='g push origin master'
alias grm='g rm'
alias grmr='g rm -r'
alias gs='g status'
alias gst='g stash'
alias gsta='g stash apply'
alias gstd='g stash drop'
alias gstp='g stash pop'