-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaliases
383 lines (273 loc) · 7.78 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
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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
# System
###
alias ls='ls --color=auto'
alias lsl='ls -lh'
funtion tar() {
tar xvzf $1
}
# Audio
alias audio=pavucontrol
alias mixer=alsamixer -c 0
alias bt="bluetoothctl"
alias audio_fix="alsactl restore"
# i3wm window manager
alias 21="i3-msg workspace 21:2-1:Chrome"
alias 22="i3-msg workspace 22:2-2:Chrome(i)"
alias 23="i3-msg workspace 23:2-3:Firefox"
alias 31="i3-msg workspace 31:3-1:Code A && code"
alias 32="i3-msg workspace 32:3-2:Code B && code"
alias 33="i3-msg workspace 33:3-3:Code C && code"
alias 34="i3-msg workspace 34:3-4:Code D && code"
alias 35="i3-msg workspace 35:3-5:Code E && code"
alias 4="i3-msg workspace 41:4:Notes"
alias 5="i3-msg workspace 51:5:Slack"
alias 9="i3-msg workspace 91:9:Zoom"
alias 01="i3-msg workspace 101:0-1:Bitwarden"
alias 02="i3-msg workspace 102:0-2:Files"
# vscode
# Redis
alias redis_stop="systemctl stop redis"
alias redis_start="systemctl start redis"
alias redis_status="systemctl status redis"
##
# Creates a cloned imaged of the hard drive
# - pass in the path to the image (ex: /path/to/backup.img.gz)
function dd_image() {
sudo dd if=/dev/sda conv=sync,noerror bs=64K status=progress | gzip -c > $1
}
##
# Restores & the harddrive with the image.
# - pass in the path to the image (ex: /path/to/backup.img.gz)
function image_restore() {
gunzip -c $1 | dd of=/dev/sda status=progress
}
# FIND PROCESS
function p(){
ps aux | grep -i $1 | grep -v grep
}
# KILL ALL BY KEYWORD
# ex: ka puma # kills all processes with "puma" in the name
function ka(){
ps aux | grep -i $1 | awk '{print $2}' | xargs sudo kill -9
}
function check_port() {
sudo lsof -i TCP:$1 | grep LISTEN
}
# Linux Specific
alias clean_trash="rm -rf ~/.local/share/Trash/*"
alias refresh_screen='xrandr --output eDP1 --off; xrandr --output eDP1 --auto;'
alias power="xfce4-power-manager-settings" # manages power settings
alias rmrf="rm -rf -i"
alias rmi="rm -i"
# disk usage & size
alias disku="du -hs * | sort -h"
# top 5 / top 10
alias du5='du -a | sort -n -r | head -n 5'
alias du10='du -a | sort -n -r | head -n 10'
# pass in the name of the drive (ex: /dev/sdb1)
function mount_usb() {
sudo mount -t ntfs "$1" /media/usb
}
function unmount_usb() {
sudo umount "$1"
}
# Zsh
alias .r=". ~/.zshrc"
alias i3c="code ~/.config/i3/config"
alias zshrc="code ~/.zshrc"
alias audioc="sudo -H gedit /etc/pulse/default.pa"
alias alic="code ~/.aliases"
alias sources="sudo code /etc/apt"
function pyenv_create() {
pyenv virtualenv $1 $1
pyenv global $1
}
# Apt
alias agu="sudo apt-get update"
alias agug="sudo apt-get upgrade"
function agi() {
sudo apt-get install $1
}
# Git
alias gs="git status"
alias ga="git add -p"
alias ga.="git add ."
alias gm="git merge"
alias gplo="git pull origin"
# alias gpom="git push origin master"
alias gppm="git push production master"
alias gclean="git clean -f -d"
function gpo() {
current_branch="$(git rev-parse --abbrev-ref HEAD)"
echo "Pushing to:" $current_branch
git push origin $current_branch
}
alias gc="git commit -m"
alias gch="git checkout"
# Alembic
alias alup="alembic upgrade head"
alias alup1="alembic upgrade +1"
alias aldown="alembic downgrade base"
alias aldown1="alembic downgrade -1"
function alr() {
alembic revision -m "$1"
}
# Anaconda / Jupyter
function condac() {
conda create --name "$1"
}
alias condai="conda info --envs"
alias jup="jupyter lab"
# Networking
alias wifi='nmcli dev wifi'
alias wifi_connect='nmcli device wifi connect'
alias wifi_disconnect='nmcli dev disconnect wlp1s0'
alias dns_servers='sudo nano /etc/dhcp/dhclient.conf'
alias wifi_list='nmcli dev'
alias wifi_passwords='sudo grep psk= /etc/NetworkManager/system-connections/*'
function wifi_reset() {
nmcli radio wifi off
nmcli radio wifi on
}
# Mac address
function mac_random() {
sudo ifconfig wlp1s0 down
sudo ifconfig wlp1s0 hw ether 02:01:02:03:04:08
sudo ifconfig wlp1s0 up
}
function mac_restore() {
sudo ifconfig wlp1s0 down
sudo ifconfig wlp1s0 hw ether 18:cf:5e:f3:fc:48
sudo ifconfig wlp1s0 up
}
function mac_set() {
sudo ifconfig wlp1s0 down
sudo ifconfig wlp1s0 hw ether $1
sudo ifconfig wlp1s0 up
}
# Python
# alias python="python3.6"
alias pip="pip3"
alias venv="source venv/bin/activate"
alias new_venv="python -m virtualenv venv"
alias pythonmail="python -m smtpd -n -c DebuggingServer localhost:8025"
# Elasticsearch
alias elasticsearch="/home/angel/elasticsearch-6.4.0/bin/elasticsearch"
alias elasticsearchtest="ES_PATH_CONF=/home/angel/elasticsearch-6.4.0/config.test /home/angel/elasticsearch-6.4.0/bin/elasticsearch"
# Servers
alias server_dot="ssh jade@142.93.11.207"
alias server_myirlog="ssh myirlog_admin@138.197.38.174"
# Keybase
alias kbc="keybase chat"
alias kbcr="keybase chat read"
function kbcs() {
keybase chat send --private "$1" "$2"
}
# Dropbox
alias dropbox="/opt/dropbox/dropboxd"
# Docker
function dkc() {
docker create $1
}
function dkbash() {
docker exec -it $1 /bin/bash
}
# -- Docker Compose
alias dkcp="docker-compose"
alias dkcpup="docker-compose build && docker-compose up --remove-orphans --force-recreate"
alias dkcpclean="docker-compose stop && docker-compose rm"
# -- Docker Images
alias dkimg="docker image"
function dkbimg() {
docker build . -t "$1"
}
# -- Docker Containers
# alias dkconstop="docker stop $(docker ps -a -q)"
# alias dkconrm="docker rm $(docker ps -a -q)"
alias dkcon="docker container"
# -- Docker Volumes
alias dkvol="docker volume"
# Flask
alias flaskr="flask run"
alias flaskdbi="flask db init"
function flaskdbm() {
flask db migrate -m "$1"
}
alias flaskdbu="flask db upgrade"
alias flaskdbd="flask db downgrade"
# Rachota
alias rachota="java -jar /opt/rachota"
# Signal Desktop
alias signal="sudo signal-desktop --no-sandbox"
# Skype
alias skype="skypeforlinux"
# USBs / external disks
alias usb="sudo fdisk -l"
function usb_mount() {
sudo mount -o uid=$(id -u),gid=$(id -g) $1 /media/usb
}
# mounting an ISO to a dir in /mnt
# sudo mount -t auto -o loop /path/to/.iso /mnt/iso/
function usb_unmount() {
sudo fuser -km /media/usb
sudo umount /media/usb
}
function usb_format_exfat() {
sudo mkfs.exfat $1
}
# Jekyll
alias jeks="bundle exec jekyll serve"
alias jekb="bundle exec jekyll build"
# Bundler
alias be="bundle exec"
# Rails
alias rails_clear_cache="bundle exec rake tmp:cache:clear"
alias rspec="bundle exec rspec"
alias rake="bundle exec rake"
alias rails_webpack="./bin/webpack-dev-server"
alias rails_keys="EDITOR=\"code --wait\" bin/rails credentials:edit"
alias sidekiq="bundle exec sidekiq"
# Postgres
alias postgres="sudo -u postgres -i"
alias pgadmin="python3 lib/python3.5/site-packages/pgadmin4/pgAdmin4.py"
# Heroku
alias heroku_rails_console="heroku run rails console"
# Django
alias django="django-admin"
function django_new() {
django-admin startproject $1
}
alias django_start="python manage.py runserver"
alias django_shell="python manage.py shell"
alias django_static="python manage.py collectstatic"
alias django_test="python manage.py test"
alias django_migrate="python manage.py migrate"
function django_loaddata() {
python manage.py loaddata $1
}
function django_make_migrations() {
python manage.py makemigrations $1
}
function django_startapp() {
python manage.py startapp $1
}
alias pym="python manage.py"
alias celery_start="celery -A app worker -l info"
alias celery_beat="celery -A app beat -l info"
# Contentful CLI
function contentful_extension() {
npx @contentful/create-contentful-extension $1
}
function c++() {
filename=$1
out=".out"
g++ -o ${filename/.cpp/$out} $filename
}
# Mainframing
alias tk4="cd ~/tk4 && ./mvs"
alias hercules="cd /opt/hercules-3.13 && hercules"
alias 3270="x3270 127.0.0.1:3270"
# Wordpress
# if you have bitnami, go to the directory of your wordpress and run ./manager-linux-x64.run
# Unity
alias unity=/home/angel/Unity/Hub/Editor/2019.4.15f1/Editor/Unity