-
Notifications
You must be signed in to change notification settings - Fork 0
/
a
354 lines (309 loc) · 9.95 KB
/
a
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
#! /hint/sh
alias \
\
startwayland=startplasma-wayland \
\
b64d='base64 -d' \
b64='base64' \
\
ssh_config.edit='edit "${XDG_CONFIG_HOME-${HOME:-/~/.config}}"/ssh/config' \
ssh_config.edit-global='edit "${PREFIX-}"/etc/ssh/ssh_config' \
\
suspend-1m='notify-send "sleeping in 1 minute"; printf \\a; sleep 1m; systemctl suspend' \
\
gpgcat='gpg2 -d --quiet --yes --compress-algo=none --no-encrypt-to --batch --use-agent' \
gpg='DISPLAY= \gpg' \
\
thepkg=thepkg-pacapt \
\
g=git-butbetter~ \
ge='git config --edit' \
geg='git config --edit --global' \
gl='git log-short' \
gll='git log-long' \
gs='_git__ _g stat' \
gS='_git__ _g stat-all' \
gd='_git__ _g diff' \
gdd='_git__ _g diff --cached' \
ga='git add' \
ga.='git add .' \
guna='git unstage' \
gm='git merge' \
gc='git commit --allow-empty-message --message' \
grec='git recommit' \
gunc='git undo-1commit' \
gsw='git switch' \
gsw-o='git switch --orphan' \
gch='git checkout' \
gw='git worktree' \
gwa='git worktree add' \
gwr='git worktree remove' gwd=gwr \
gp='git push' \
\
html2pug='( cat | \html2pug -f -t)' \
\
ls-test='puts * | test-' \
e-mv=edit-mv \
e-ln=edit-symlink \
\
btr=btrfs-butbetter~2023-02-28~ \
lc='wc -l' \
stat-c='stat -c' \
cut-f='cut -d " " -f' \
\
fulldiff='diff -U 2147483647' \
fdisk='\fdisk -n -L' \
\
patch='\patch --forward' \
c#='\c# #' \
\
speak='time \speak -s 330' \
speak-fast='time \speak -s 470' \
git-lazy-commit-message-filechanges='(i="#➔$(git status -s | sed -nEe "s/^([A-Z])./\\1/p" | tr "\\n" \;; echo)"; printf %s "$i") | GIT_EDITOR="$EDITOR" git commit -F - -e' \
dotfiles-lazy-commit-message-filechanges='(alias git=dotfiles; eval git-lazy-commit-message-filechanges)' \
shred='shred -uz -n 3' \
losetup='\losetup --find --show --verbose --partscan' \
\
@op5-sms-list-l1='@op5 termux-sms-list -l1' \
@op5-cin='ssh op5 "~/.bin-personal/termux/cin"' \
@op5-cout='ssh op5 "~/.bin-personal/termux/cout"' \
@op5-find-play3='@op5 $ find-play3\!' \
@op5-vibrate='ssh op5 termux-vibrate' \
@op5-qn='ssh op5 -t "micro /sdcard/Documents/markor/QuickNote.md; exec bash -il"' \
\
%%%='%% & exit' \
\
d='date -I' \
d.file='( date -Im | sed "y/:/-/;s/+.*//" )' \
d--='puts "---- $(d) ----"' \
\
todo='edit ~/.local/d/todo.md' \
todo-shuf='todo-ls | test- -f | shuf -n 1' \
todo-ls='puts ~/.local/d/*[Tt][Oo][Dd][Oo]*' \
todo-archived='edit ~/.local/0/archive/todo.md' \
TODO='cd ~/.local/d/TODO.d' \
\
PP='P --noconfirm' \
PP-reboot='PP && reboot' \
CX='sudo loadkeys carpalx; setxkbmap "us(carpalx)"' \
\
7z-mx9='7z a -r -t7z -m0=lzma2 -mx=9 -myx=9 -mqs=on -ms=on' \
\
bat='\bat --style header,numbers,rule,snip' \
BAT='bat -A' \
bat-f='bat --decorations=always' \
\
IFS='set -f; IFS="${NEW_LINE:-${new_line:?}}"' \
argv='arg "$@"' \
fd.swap='3>&2 2>&1 1>&3 ' \
\
llw='ll.which' \
cdw='cd.which' \
cdt='cd "$(mktemp -d -t tmp.shpid$$.XXXX)"' cd.mktemp='cdt' \
cd-='cd -' \
\
B='cd "$B"' \
v='cd /^' \
bin='cd ~/.loca/bin' \
_0='cd ~/.local/0/gh/_0' \
0='cd ~/.local/0' \
0-gh='cd ~/.local/0/gh' \
0-ghdd='cd ~/.local/0/ghdd-masters' \
\
path='( IFS=${PATHseparator:-":"}; set -f; puts $PATH )' \
\
ew\*='ew ' \
exec\*='\exec ' \
echo\*='echo ' \
\
'R!=history -r' \
'S!=sudo \$ "$(history -p \!\!)"' \
'D!=doas \$ "$(history -p \!\!)"' \
'C!=printf %s "$(history -p \!\!)" | cin' \
'CC!=printf %s "$(history -p \!:q)" | cin' \
\
grep='\grep --color=auto' \
egrep='\egrep --color=auto' \
${os_gnu+ \
diff='\diff -u --no-dereference --color=auto -s' \
micro-diff='\micro-diff -u -s --color=auto' \
} \
edit-genpath='edit-genpath -u' \
diff-arch='diff --unified --recursive --text' \
pacman-diffs='(find /etc 2>/dev/null -name "*.pacnew" -mtime -360 -type f | sed "s/.pacnew\$//")' \
\
mv='_mv_or_editorrename_ -vi' cp='\cp -vi' ln='\ln -vi' chmod='\chmod -v' chown='\chown -v' readlink='\readlink -v' \
mvT='mv -T' cpT='cp -T' ln-fTv='\ln -fTv' \
mount='\mount -v' \
rm='\rm -v' rmdir='\rmdir -v' micro-diff-rm='\micro-diff-rm -v' rmt='rmtrash -v -r' \
umount='\umount -v' umount-fzf='\umount-fzf -v' mv-ln='\mv-ln -vi'${os_gnu+" -r"} \
\
Imount-defaults='mount -o "defaults,rw,relatime,user,umask=0077,uid=${UID:-"$(id -n)"},gid=${GROUPS?:-"$(id -g)"}"' \
Iown='chown "${UID:-"$(id -u)"}:${GROUPS-"$(id -g)"}"' \
Iown.u='chown "${UID:-"$(id -u)"}"' \
Iown.g='chown "${UID:-"$(id -u)"}:${GROUPS-"$(id -g)"}"' \
Iinstall='install -o "${USER:-"$(id -un)"}" -g "$(id -gn)" `: todo: fix installed from /dev/null is executable, sis this how it should work and why does not take the umask num :` ' \
777='chmod 777' 755='chmod 755' \
192='ip route get 1 | rg -o "src [^ ]*" | cut-f 2' \
myip='(curl -s ipinfo.io/ip;echo)' \
1.1='ping 1.1' \
ping='\ping -c 128' \
\
rsync='time \rsync -azvhP' \
fuserumount='fusermount -u' \
termbin="nc termbin.com 9999" \
sync='time \sync' \
pv='time \pv' \
\
tt='time tt-split -showwpm -noskip -oneshot' \
\
sshd='"$(which \sshd)" -p 8022 -d -f ~/.ssh/sshd/sshd_config -h ~/.ssh/sshd/ssh_host_ed25519_key' \
minicom='\minicom -m -c on -D unix#/tmp/ttyS0' \
\
df='\df -hT' \
du='\du -h' \
dust='\dust --reverse --limit-filesystem' \
free='\free -hwt' \
lsport='( \netstat -tulpn || echo exit code $?, todo: "https://linuxhint.com/how_to_list_open_ports_on_linux/" )' \
\
update-grub="sudo grub-mkconfig -o /boot/grub/grub.cfg" \
pactree='\pactree --color' \
\
adb-kill-server='adb kill-server' \
\
reboot-efi='systemctl reboot --firmware-setup' \
\
startplasma-wayland='SHLVL= \startplasma-wayland' \
byobu='SHLVL= \byobu' \
startx='SHLVL= startx ~/.config/xorg-xinit/xinitrc' \
\
wget='\wget -c -t 5' \
zsh='\zsh --no-rcs' \
gparted='fakeroot /usr/lib/gparted/gpartedbin' \
${os_gnu+"dd=\\dd status=progress"} \
${sh_is_bash+l.did='ll -d /did/!(.|..|*-part*)'} \
${sh_is_bash-l.did='find /did/ -maxdepth 1 -mindepth 1 -not -path "*-part*" | x ll -d --'} \
\
${os_gnu+xargs='\xargs -d \\n -r'} \
${os_bb+xargs='tr \\n \\0 | \xargs -0 -r'} \
x='xargs ' \
x%='x -I% ' \
xo='(x% open %)' \
\
\
__=_before_command_not_found_handle \
t.='__ t.' \
open.='__ open.' \
thunar.='__ thunar.' \
gparted.='__ gparted.' \
qdirstat.='__ qdirstat.' \
konsole.='__ konsole.' \
\
;
alias ll='${LSLONG_COMMAND:-ls -al}'
if command. exa; then
export LSLONG_COMMAND="exa -alF --git --time-style iso --group-directories-first -g"
alias \
ls='exa -aF1 --group-directories-first' \
l='exa -alF --git --time-style iso --group-directories-first -a' \
llT='exa -alF --time-style iso --group-directories-first -Th' \
llT0='llT --level 0' llT1='llT --level 1' llT2='llT --level 2' llT3='llT --level 3' llT4='llT --level 4' llT5='llT --level 5' \
;
else
export LSLONG_COMMAND='ls -alF --group-directories-first'
alias \
ls='\ls -F --color=auto -1 --group-directories-first' \
l='ll' \
;
fi
if { command. apk || command. apt; } && command. pacapt; then
alias p='pacapt'
elif command. pacman; then
alias rm.pacmanlock='rm /var/lib/pacman/db.lck'
if command. trizen; then
alias p='trizen'
else
alias p='pacman'
fi
fi
# ${os_gnu-return} # return if not gnu os
case $(command -v edit-rename) in */*) # _fallbackfn_edit_rename does not support arguments
alias edit-rename='edit-rename --args="-vi"'
esac
#export GIT_DIR # moved to _env
# detect if we are home
case ${USER-}:${HOSTNAME-} in arcowo:kpc)
# minecraft-1.12.2='/~arcowo/0/game/MC/1.12.2/start' minecraft-1.16.5='/~arcowo/0/game/MC/1.16.5/start' \
alias \
HOME-disallowed='\HOME-disallowed --homepath ~arcowo' \
dotfiles-env='GIT_DIR=/^/\ https://github.com/denisde4ev/dotfiles.git ' dotfiles='dotfiles-env git' \
;;
root:Denis-pc57) # root is just WSL
alias \
dotfiles-env='GIT_DIR=/^/\ https://github.com/denisde4ev/dotfiles.git ' dotfiles='dotfiles-env git' \
dotfiles-pc57-win-env='GIT_DIR=/^/\ https://github.com/denisde4ev/dotfiles-pc57-win.git' dotfiles-pc57-win='dotfiles-pc57-win-env git' \
;
# alias '$=dollar' ash accepts it, but bash does not
;;
pc57:Denis|pc57:Denis-pc57)
# for now this is not use, but its planned to merge shrc with bin-win (also its bad name)
echo 'dotfiles aliases for user:pc57 never tested' >&2
alias \
dotfiles-env='@ env GIT_DIR=/^/\ https://github.com/denisde4ev/dotfiles.git ' dotfiles='dotfiles-env git' \
dotfiles-pc57-win-env='@ env GIT_DIR=/^/\ https://github.com/denisde4ev/dotfiles-pc57-win.git' dotfiles-pc57-win='dotfiles-pc57-win-env git' \
;;
# todo:
#:dumpling)
# alias dotfiles='git --git-dir=/^/_/git-branch:master/\ https://github.com/denisde4ev/dotfiles.git'
# ;;
#/root:artix)
# alias dotfiles='git --git-dir=/^/_/git-branch:master/\ https://github.com/denisde4ev/dotfiles.git'
# ;;
esac
return
return
return
exit
# moved to LOADABLE
git='GIT_FIX_PWD="$PWD" _git__ 'git='GIT_FIX_PWD="$PWD" \git'
sudo='\sudo ' is from ./_env ,
alias xargs is from ./Z
mount-grep='mount | grep'
mount-grep-pwd='(mount | grep -o "$PWD[^ ]*")'
fd.err='>&2 ' fd.to2='>&2 ' fd.out='>&1 ' fd.to1='>&1 '
0wn='chown 0:0' \
# '/did' is (Disk ID) a symlink to '/dev/block/by-id'
path='pts "$PATH" | tr : \\n'
nbsp='printf \\uA0\\n' \
# never used:
btr.mksubvol='sudo btrfs subvolume create' \
mksubvol.btr='btr.mksubvol' \
Bcompression-false='btr set compression=false' \
#DIFF=fulldiff \
whileReadI-do='while IFS= read -r i; do ' \
printf.quote-this='printf %s\\n \!#:q' \
printf.quote='printf "%q\\n"' \
nbsp='printf \\xC2\\xA0\\n' \
# ....
nyx='sudo -u tor nyx' \
xmrig='( case $TERM in screen-*) xmrig ;; *) byobu new doas xmrig; esac )' \
speak-rmhash='sed -uEe "s/(^| )#( |$)//g" | speak' \
mongod='\mongod --logpath /dev/stdout' \
pgrep='\pgrep --color=auto' \
Bdu='btrfs filesystem du' \
Bdf='btrfs filesystem df' \
Bsync='btrfs filesystem sync' \
\
fori_in_shs='for i in posh yash dash bash mksh ash `: toysh` zsh' \
fori_in_shs:='fori_in_shs ; {{ $i -c ":" ; }}' \
foo='echo bar' \
bash-debugger-start='debugger=1 bash-debugger' \
git-lazy-commit-message-date='git commit -m "#$(date -I)" -e' \
dotfiles-lazy-commit-message-date='(alias git=dotfiles; eval git-lazy-commit-message-date)' \
http-server='python3 -m http.server' \
'-=echo ' \
'?-=quote ' \
'?-1l=puts ' \
git.customssh='GIT_SSH_COMMAND="ssh -i ~/.local/0/g/deni2020/.ssh/id_ed25519" git push' \
userlist='cut -d: -f1 /etc/passwd' \
gsg='_git__ stat-grep' \