-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_aliases
136 lines (110 loc) · 3.42 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
#!/usr/bin/env bash
### .aliases - public typing shortcuts
# shellcheck source=/dev/null
##################
# system aliases #
##################
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias clr="clear"
alias cls="clear"
alias copy="cp"
alias grep='grep --color=always'
alias home='cd $HOME'
alias reapache="sudo systemctl restart apache2"
alias rebash='source $HOME/.bashrc'
alias redns="sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder"
alias renginx="sudo systemctl restart nginx"
alias repostfix="sudo launchctl stop org.postfix.master; sudo launchctl start org.postfix.master"
alias untar="tar -xvf"
# unix system
alias groups-all="cut -d: -f1 /etc/group"
alias screens-all="ls -laR /var/run/screen"
alias users-all="getent passwd | cut -d: -f1"
##########################
# custom command aliases #
##########################
# composer
alias compi="composer install"
alias compu="composer update"
# docker
alias colima-start="colima start --cpu 4 --memory 6 --disk 60 --mount-type=sshfs --dns=1.1.1.1"
alias dc="docker-compose"
alias de='docker exec -it -e COLUMNS=$COLUMNS -e LINES=$LINES -e TERM=$TERM'
alias dm="docker-machine"
alias docker-ps="docker ps --format \"table {{.ID}}\t{{.Image}}\t{{.Status}}\""
# git
alias gitlog='git log --graph --pretty=format:'"'"'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'"'"' --abbrev-commit'
alias gitpom="git pull origin master"
alias gitpum="git pull upstream master"
# hugo static site generator
alias hugos="hugo serve --disableFastRender"
# nodejs
## requires 'npm i -g npm-audit-html' first to work
alias npm-audit-html="npm audit --json | npm-audit-html; open npm-audit.html"
alias npm-global-audit="npx npm-global-audit --auditor npm"
# npkill
alias npkillall="npx npkill -D -x -y -nu"
# python (make python3 default)
# alias python=/usr/local/bin/python3
# ruby
alias be="bundle exec"
alias gemup="gem update --system && gem update && gem cleanup"
alias gemups="gem update --system"
# sass - dart > ruby
# alias sass="/usr/local/bin/sass"
# sqlite
alias sqlite="sqlite3"
# symfony
alias sf="symfony"
alias sfstart="php bin/console server:start"
alias sfstop="php bin/console server:stop"
alias sfup="symfony self-update"
# wtfutil cli dashboard
alias wtf='wtfutil --config=$HOME/.wtf-config'
# youtube-dl
#alias ytdl="youtube-dl"
#alias ytdla="youtube-dl --extract-audio --audio-format mp3"
alias ytdl="yt-dlp -f 'bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b'"
alias ytdla="yt-dlp --extract-audio --audio-format mp3"
#####################
# improved commands #
#####################
# bat: better cat
if hash bat 2>/dev/null; then
# prettybat: better bat
if hash prettybat 2>/dev/null; then
alias cat="prettybat"
else
alias cat="bat"
fi
fi
# duf: better du
if hash duf 2>/dev/null; then
# ncdu: better duf
if hash ncdu 2>/dev/null; then
alias du="ncdu --color dark -rr -x --exclude .git --exclude node_modules"
else
alias du="duf"
fi
fi
# fd: better find
if hash fd 2>/dev/null; then
alias find="fd"
fi
# gawk: GNU awk
if hash gawk 2>/dev/null; then
alias awk="gawk"
fi
# gsed: GNU sed
if hash gsed 2>/dev/null; then
alias sed="gsed"
fi
# prettyping: prettier ping
if hash prettyping 2>/dev/null; then
alias ping="prettyping --nolegend"
fi
##########################################################
# load private, non-tracked, aliases
if [ -f "$HOME"/.aliases_priv ]; then source "$HOME"/.aliases_priv; fi