Repository navigation
Expand file tree
/
Copy path_aliases
More file actions
155 lines (126 loc) · 4.21 KB
/
Copy path_aliases
File metadata and controls
155 lines (126 loc) · 4.21 KB
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
#!/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 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"
# restartables
alias reapache="sudo systemctl restart apache2"
alias rebash='source $HOME/.bashrc'
alias redns="sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder"
alias remasto="sudo systemctl restart mastodon-sidekiq.service; sudo systemctl restart mastodon-streaming.service; sudo systemctl restart mastodon-web.service"
alias renginx="sudo systemctl restart nginx"
alias repnpm="npx npkill -D -x -y -nu; rm pnpm-lock.yaml; pnpm install"
alias repostfix="sudo launchctl stop org.postfix.master; sudo launchctl start org.postfix.master"
##########################
# 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 gitpoma="git pull origin main"
alias gitpum="git pull upstream master"
alias gitpuma="git pull upstream main"
# hugo static site generator
alias hugos="hugo serve --disableFastRender"
# mise
alias miseup="mise self-update"
# 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"
alias pnpkillall="pnpx 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' --extractor-args 'youtube:player-client=default,web_safari;player-js_version=actual'"
alias ytdla="yt-dlp --extract-audio --audio-format mp3 --extractor-args 'youtube:player-client=default,web_safari;player-js_version=actual'"
#####################
# improved commands #
#####################
# bat: better cat
# https://github.com/sharkdp/bat
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 df
# https://github.com/muesli/duf
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
# https://github.com/sharkdp/fd
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
# https://github.com/denilsonsa/prettyping
if hash prettyping 2>/dev/null; then
alias ping="prettyping --nolegend"
fi
# ripgrep: better grep
if hash ripgrep 2>/dev/null; then
alias rg="ripgrep"
fi
##########################################################
# load private, non-tracked, aliases
if [[ -f "${HOME}"/.aliases_priv ]]; then source "${HOME}"/.aliases_priv; fi