Dotfiles for my tiling window manager + terminal workflow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1189 lines
27 KiB

5 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
5 years ago
6 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
5 years ago
6 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
4 years ago
3 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
6 years ago
4 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
5 years ago
6 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
5 years ago
6 years ago
6 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
  1. # vim: fdm=marker ft=go-template.sh syntax=sh
  2. # system [[[
  3. # basic [[[ #
  4. # clear screen
  5. c "printf '\033c'"
  6. d "cd ~/Downloads && printf '\033c'"
  7. e "echo \$"
  8. hst "history"
  9. # nft "printf '\033c' && neofetch | lolcat"
  10. nfth "printf '\033c' && neofetch"
  11. fi "fish"
  12. # reload urxvt
  13. ru "xrdb ~/.Xresources && grep wallpaper ~/.cache/wal/colors.sh | cut -d\' -f2 | xargs wal -i > /dev/null"
  14. dua "du -ah --apparent-size | sort -h"
  15. # list file sizes in megabytes with depth 1
  16. # duh "sudo du -d 1 -h --apparent-size | sort -h"
  17. # dum "sudo du -d 1 -m --apparent-size | sort -h"
  18. duh "du -d 1 -h --apparent-size | sort -h"
  19. dum "du -d 1 -m --apparent-size | sort -h"
  20. # m "man"
  21. td "tldr"
  22. whi "whereis"
  23. # ]]] basic #
  24. # display [[[ #
  25. # nvt "nvidia-settings --assign CurrentMetaMode='DVI-I-1: nvidia-auto-select +0+0 {ForceCompositionPipeline=On}, HDMI-0: nvidia-auto-select +3840+0 {ForceCompositionPipeline=On}'"
  26. {{ if eq .chezmoi.hostname "nzxt" }}
  27. xra "xrandr --auto"
  28. xrs "xrandr --auto && xrandr --output HDMI-0 --right-of DVI-I-1"
  29. xrn "xrandr --output HDMI-0 --rotate normal && grep wallpaper ~/.cache/wal/colors.sh | cut -d\' -f2 | xargs wal -i > /dev/null"
  30. xrr "xrandr --output HDMI-0 --rotate right && grep wallpaper ~/.cache/wal/colors.sh | cut -d\' -f2 | xargs wal -i > /dev/null"
  31. {{ end }}
  32. {{ if eq .chezmoi.hostname "x1-carbon" }}
  33. xro "xrandr --output HDMI2 --off"
  34. xrl "xrandr --output HDMI2 --auto --left-of eDP1 --scale 1.33x1.33 && xrandr --output eDP1 --panning 2560x1440+2554+0"
  35. xrr "xrandr --output HDMI2 --auto --right-of eDP1 --scale 1.33x1.33"
  36. xrm "xrandr --output HDMI2 --auto --same-as eDP1 --scale 1.33x1.33"
  37. xrs "xrandr -s 0"
  38. {{ end }}
  39. # ]]] display #
  40. ngb "sudo nvim /etc/default/grub"
  41. mgb "sudo grub-mkconfig -o /boot/grub/grub.cfg"
  42. # a "bat"
  43. b "bat"
  44. # ba "bat *"
  45. awkp "awk -F',' '{print \$0}'"
  46. cpr "cp -r"
  47. fde "fd -e"
  48. grep "grep --color=auto -n"
  49. grpr "grep -r"
  50. rgc "rg -i"
  51. rge "rg -t"
  52. xa "xargs"
  53. # pk "pkill -f"
  54. cld "colordiff -wy --suppress-common-lines"
  55. mkpk "makepkg -sri"
  56. ex "chmod +x"
  57. lns "ln -s"
  58. src "source"
  59. # systemctl [[[ #
  60. ct "sudo systemctl"
  61. cte "sudo systemctl enable"
  62. ctd "sudo systemctl daemon-reload"
  63. ctdi "sudo systemctl disable"
  64. cta "sudo systemctl start"
  65. cts "sudo systemctl stop"
  66. ctt "sudo systemctl status"
  67. # ctr "sudo systemctl restart"
  68. ctltd "sudo systemctl status dhcpcd"
  69. ctlas "sudo systemctl start sshd"
  70. nc "sudo netctl"
  71. ncd "sudo ip link set dev wlp3s0 down"
  72. ncu "sudo ip link set dev wlp3s0 up"
  73. ncr "sudo systemctl restart netctl-auto@wlp3s0.service"
  74. ncs "sudo systemctl stop netctl-auto@wlp3s0.service"
  75. # ]]] systemctl #
  76. # ssh [[[ #
  77. # ss "ssh"
  78. cpssh "ssh-copy-id -i ~/.ssh/id_rsa.pub"
  79. xcssh "bat ~/.ssh/id_rsa.pub | xclip -selection clipboard"
  80. # digital ocean
  81. ssd "mosh --ssh='ssh -p 399' kevin@165.22.239.234 tmux a"
  82. sdh "mosh --ssh='ssh -p 399' kevin@165.22.239.234 htop"
  83. scd "scp -P 399 kevin@165.22.239.234"
  84. sfd "sftp -rP 399 kevin@165.22.239.234"
  85. # phone [[[ #
  86. ssp "mosh --ssh='ssh -p 8022' $PHONE_IP"
  87. scpp "scp -P 8022 $PHONE_IP:"
  88. sfp "sftp -rP 8022 $PHONE_IP"
  89. rsp "rsync --ignore-existing -Ptre 'ssh -p 8022' $PHONE_IP:"
  90. # ]]] phone #
  91. # pixel [[[ #
  92. sspx "mosh --ssh='ssh -p 8022' $PIXEL_IP"
  93. scpx "scp -P 8022 $PIXEL_IP:"
  94. sfpx "sftp -rP 8022 $PIXEL_IP"
  95. rspx "rsync --ignore-existing -Ptre 'ssh -p 8022' $PIXEL_IP:"
  96. # ]]] pixel #
  97. # vultr
  98. ssa "mosh atxadmin@45.32.87.10"
  99. ssv "mosh kevin@45.32.87.10"
  100. # test server sites
  101. # svp "firefox git.ataraxy.tk khkm.tk cal.khkm.tk pste.gq smol.gq twem.tk"
  102. # postgres ssh tunnel
  103. sdt "ssh kevin@165.22.239.234 -L 5433:localhost:5432"
  104. # ]]] ssh #
  105. wh "watch"
  106. w60 "watch -n60 '"
  107. ct "crontab"
  108. cte "crontab -e"
  109. wm "sudo wifi-menu"
  110. # mounting [[[ #
  111. udm "udisksctl mount -b"
  112. udmi "ifuse /mnt/ipad"
  113. udmb "udisksctl mount -b /dev/sdc2"
  114. udu "udisksctl unmount -b"
  115. udub "udisksctl unmount -b /dev/sdc2"
  116. udui "umount /mnt/ipad"
  117. # ]]] mounting #
  118. tc "touch"
  119. vd "vidir --verbose"
  120. # directory-related [[[ #
  121. {{ if not (eq .linux_os "termux") }}
  122. l "lsd -F --group-dirs first"
  123. la "lsd -AF --group-dirs first"
  124. ld "lsd -F --group-dirs first -d */"
  125. ll "lsd -lF --group-dirs first --size short"
  126. lld "lsd -lF --group-dirs first --size short -d */"
  127. llr "lsd -lF --group-dirs first --size short -tr"
  128. lla "lsd -AlF --group-dirs first --size short"
  129. {{ else }}
  130. l "ls"
  131. la "ls -a"
  132. ll "ls -l"
  133. lla "ls -al"
  134. {{ end }}
  135. cwd "echo (pwd) | xclip -selection clipboard"
  136. smv "sudo mv"
  137. f "cd"
  138. fz "fzf -e"
  139. fbg "cd ~/Pictures/Backgrounds && ranger --selectfile (fzf -e --delimiter '/' --with-nth -1)"
  140. fnd "find . -type f -name"
  141. # p "pwd"
  142. rmr "rm -rf"
  143. # rmd "rm ~/Downloads/*"
  144. rmw "rm ~/.local/share/nvim/swap/"
  145. md "mkdir -p"
  146. rsy "rsync --ignore-existing -Ptr"
  147. # list all (un)mounted drives
  148. lhd "sudo fdisk -l"
  149. # get disc space for mounted drives
  150. # ds "df -h | tee >(head -n 1) >(grep sd) >/dev/null"
  151. ds "df -h | head -n 1 && df -h | grep sd"
  152. chownw "sudo chown -R kevin:wheel"
  153. chwnm "sudo chown -R kevin:wheel /run/media/{{ .chezmoi.username }}"
  154. # cd into backup folder and show backup sizes
  155. lbu "cd /run/media/kevin/backup-hd/{{ .chezmoi.hostname }}/tar && lsd -l"
  156. uzl "unzip -l"
  157. # ]]] directory-related #
  158. # power options [[[ #
  159. s "systemctl suspend"
  160. sl "i3lock-fancy && systemctl suspend"
  161. so "xset dpms force off"
  162. xx "exit"
  163. sof "xset dpms force off"
  164. son "xset s off -dpms"
  165. sd "tmux kill-server; systemctl poweroff"
  166. rb "tmux kill-server; systemctl reboot"
  167. lgo "i3-msg exit"
  168. x "xmodmap ~/.Xmodmap && xset r rate $XSET_DELAY $XSET_RATE"
  169. X "xmodmap ~/.Xmodmap && xset r rate $XSET_DELAY $XSET_RATE"
  170. {{ if eq .chezmoi.hostname "x1-carbon" }}
  171. xl "xmodmap ~/.Xmodmap-laptop && xset r rate $XSET_DELAY $XSET_RATE"
  172. XL "xmodmap ~/.Xmodmap-laptop && xset r rate $XSET_DELAY $XSET_RATE"
  173. bt "~/linux-config/dot_config/i3blocks/scripts/executable_battery"
  174. {{ end }}
  175. # ]]] power options #
  176. # sound [[[ #
  177. {{ if eq .chezmoi.hostname "nzxt" }}
  178. vlm "alsamixer -c 0"
  179. vlh "alsamixer -c 2"
  180. {{ else }}
  181. vlm "alsamixer -c 1"
  182. {{ end }}
  183. # ]]] sound #
  184. # pkg management [[[ #
  185. {{ if eq .linux_os "arch" }}#[[[
  186. # pacman [[[ #
  187. # pc "sudo pacman -S"
  188. # pcq "sudo pacman -Qi"
  189. # pcr "sudo pacman -Rns"
  190. # pcud "sudo pacman -Sy"
  191. # pcug "sudo pacman -Syu"
  192. # xpc "pacman -Qqne > ~/{{ .chezmoi.os }}-config/txt/{{ .chezmoi.hostname }}-pkgs.txt && pacman -Qqme > ~/{{ .chezmoi.os }}-config/txt/{{ .chezmoi.hostname }}-aur.txt "
  193. # ]]] pacman #
  194. # tri "trizen -S --noconfirm"
  195. tri "trizen -S --noedit"
  196. # yay [[[ #
  197. # install
  198. ya "yay -S --answerclean=None --answerdiff=None --answeredit=None"
  199. # info
  200. yaq "yay -Qi"
  201. # list files
  202. yal "yay -Ql"
  203. # remove
  204. yar "yay -Rns"
  205. # search
  206. yas "yay -Qs"
  207. # sync
  208. yau "yay -Sy"
  209. # sync and download
  210. yadl "yay -Syuw --answerclean=None --answerdiff=None --answeredit=None"
  211. # sync and update
  212. yaug "yay -Syu --answerclean=None --answerdiff=None --answeredit=None"
  213. # ]]] yay #
  214. #]]]
  215. {{ else if eq .linux_os "termux" }}#[[[
  216. pki "pkg install"
  217. pkli "pkg list-installed"
  218. pku "pkg uninstall"
  219. pks "pkg search"
  220. xpk "pkg list-installed | awk -F/ '{print \$1}' > ~/{{ .chezmoi.os }}-config/txt/termux-pkgs.txt"
  221. {{ end }}#]]]
  222. # apt [[[ #
  223. {{ if and (eq .chezmoi.username "root") (eq .linux_os "debian") }}
  224. ap "apt install"
  225. apr "apt remove"
  226. apu "apt upgrade"
  227. {{ end }}
  228. # ]]] apt #
  229. # ]]] pkg management #
  230. # python [[[ #
  231. p "python"
  232. # py "python"
  233. py2 "python2"
  234. # pyt "printf '\033c' && pytest -vvs"
  235. # pyt "clear && tmux clear-history && pytest -vvs"
  236. pyt "clear && tmux clear-history && pytest --cov"
  237. pyts "clear && tmux clear-history && pytest -vv"
  238. pyu "python -m unittest"
  239. pipi "pip install"
  240. spipi "sudo pip install"
  241. # ]]] python #
  242. # internet [[[ #
  243. pg "ping -c 2 -W 1 8.8.8.8"
  244. wpg "watch ping -c 2 -W 1 8.8.8.8"
  245. pgc "ping 8.8.8.8"
  246. dh "sudo dhcpcd"
  247. kdh "sudo killall dhcpcd"
  248. rdh "sudo killall dhcpcd && sudo dhcpcd"
  249. wgt "wget"
  250. {{ if and (eq .chezmoi.username "root") (eq .linux_os "debian") }}
  251. nt "nginx -t"
  252. {{ end }}
  253. # ]]] internet #
  254. whc "which"
  255. fl "file"
  256. id "identify"
  257. # rz "source ~/{{ .chezmoi.os }}-config/aliases/zsh_aliases"
  258. mst "sudo rm ~/st/config.h && sudo bear make -C ~/st install"
  259. # mst "sudo ~/st/make-st.sh"
  260. # system ]]]
  261. # applications [[[ #
  262. # silent="> /dev/null 2>&1& "
  263. 13 "rot13"
  264. am "antimicro"
  265. # task [[[ #
  266. a "task"
  267. aa "task add"
  268. aal "task add proj:lnx"
  269. aap "task add proj:"
  270. aas "task add proj:sch"
  271. # aam "task add proj:ms"
  272. aam "task add proj:mny"
  273. aap "task add proj:"
  274. # aacm "task add proj:codm"
  275. aacr "task add proj:crim"
  276. aaj "task add proj:pey +jira []"
  277. aapp "task add proj:pogo"
  278. aas "task add proj:sch"
  279. aay "task add proj:pey"
  280. ac "task context"
  281. acn "task context none && task"
  282. ach "task context home && task"
  283. acm "task context mny && task"
  284. aco "task context out && task"
  285. acp "task context pey && task"
  286. acnp "task context not-pey && task"
  287. acs "task context sch && task"
  288. af "task proj:"
  289. afcm "task proj:codm"
  290. afcr "task proj:crim"
  291. afs "task proj:sch"
  292. afy "task proj:pey"
  293. aj "task +jira"
  294. apl "task completed"
  295. al "task limit:15"
  296. alg "task log"
  297. algy "task log proj:pey"
  298. ans "task +next"
  299. ao "taskopen -A"
  300. asm "task summary"
  301. awt "task waiting"
  302. ay "task sync"
  303. # ]]] task #
  304. # buku [[[ #
  305. # b "buku"
  306. bd "buku -a '"
  307. bdb "sqlitebrowser ~/.local/share/buku/bookmarks.db &"
  308. bh "buku -h | bat"
  309. bi "buku --immutable 1 -zu"
  310. bo "buku -o"
  311. bp "buku -p"
  312. br "buku -zd"
  313. brp "buku --replace"
  314. bs "buku --deep -n5 -s"
  315. bsq "sqlitebrowser ~/.local/share/buku/bookmarks.db &"
  316. bsv "bukuserver run --host 127.0.0.1 --port 5001"
  317. bt "buku --deep -n5 -t"
  318. bu "buku -zu"
  319. but "buku -zu --tag"
  320. bw "buku --immutable 1 -w -1"
  321. # ]]] buku #
  322. cc "calcurse"
  323. ccc "calcurse -D ~/.calcurse/alt-cals/class"
  324. cci "calcurse -i"
  325. ccs "calcurse-caldav"
  326. chr "google-chrome"
  327. cht "chatterino"
  328. # clc "cloc ."
  329. clc "cloc . --vcs=git"
  330. cv "cava"
  331. dg "dragon-drag-and-drop -x"
  332. fx "firefox -P"
  333. fxd "firefox -P default"
  334. fxw "firefox -P work"
  335. fh "feh"
  336. fi "fish"
  337. gpd "gpg --decrypt"
  338. gpe "gpg --encrypt --recipient"
  339. gtm "gotop -m"
  340. hb "habitctl log"
  341. # hbe "habitctl edit"
  342. # hbeh "habitctl edith"
  343. htc "htop -s PERCENT_CPU"
  344. htm "htop -s PERCENT_MEM"
  345. # i "sxiv"
  346. ia "sxiv -a"
  347. it "sxiv -t *"
  348. kill "kill -9"
  349. ka "killall"
  350. kd "killall Discord && killall Discord"
  351. ke "killall electron"
  352. kf "killall firefox"
  353. kag "killall gopls"
  354. kai "killall imwheel && imwheel"
  355. kt "killall thunderbird"
  356. m "mpv"
  357. mp "mpv --volume=50"
  358. # lo "libreoffice"
  359. m "mpv"
  360. mpvv "mpv --volume=50"
  361. mpl "mpv --loop"
  362. msf "mpv --sub-file="
  363. mra "man ranger"
  364. # mt "minetest"
  365. n "nvim"
  366. nl "nload devices wlp4s0 -u M"
  367. nm "nomacs ."
  368. np "nvim --"
  369. ndu "ncdu"
  370. p3 "python3"
  371. pdft "pdftotext"
  372. pdu "pdfunite"
  373. pipes "pipes.sh -t 3"
  374. pcp "pycp"
  375. pmv "pymv"
  376. py "python"
  377. q "qalc '"
  378. qe "qalc -e '1USD to CAD'"
  379. qg "qalculate-gtk"
  380. r "ranger"
  381. rbg "ranger --selectfile (grep wallpaper ~/.cache/wal/colors.sh | cut -d\' -f2)"
  382. # rgc "printf '\033c' && rg"
  383. # rgc "printf '\033c' && rg"
  384. rgc "clear && tmux clear-history && rg -S"
  385. rx "redshift -x"
  386. scm "sc-im"
  387. sn "sudo nvim"
  388. sqlb "sqlitebrowser"
  389. # ss "mosh"
  390. stp "termdown"
  391. h "termdown"
  392. # sw "swex"
  393. # t "tmux"#[[[
  394. # ta "tmux a -t"
  395. tabu "tmux a -t backup || tmux new -s backup"
  396. tacf "tmux a -t config || tmux new -s config"
  397. tacm "tmux a -t codm || tmux new -s codm"
  398. tacr "tmux a -t crimson || tmux new -s crimson"
  399. taj "tmux a -t journal || tmux new -s journal"
  400. tarh "tmux a -t red-hat || tmux new -s red-hat"
  401. tar2 "tmux a -t red-hat-2 || tmux new -s red-hat-2"
  402. tas "tmux a -t school || tmux new -s school"
  403. tas2 "tmux a -t school-2 || tmux new -s school-2"
  404. tal "tmux a"
  405. tc "clear && tmux clear-history"
  406. tk "tmux kill-server"
  407. tk "tmux kill-session -t"
  408. tks "tmux kill-server"
  409. tl "tmux ls"
  410. tn "tmux new -s"
  411. tnb "tmux new -s backup"
  412. #]]]
  413. usn "usernames --num 20"
  414. vmd "vimdiff"
  415. wg "wego"
  416. ytd "youtube-dl"
  417. wcl "wc -l"
  418. wcw "wc -w"
  419. wch "weechat"
  420. # wg "wego"
  421. wg "curl wttr.in"
  422. # wg "curl -L wthr.ml"
  423. wgm "curl -L wthr.ml/m"
  424. wgt "curl -L wthr.ml/t"
  425. yt "youtube-dl"
  426. z "zathura --fork"
  427. lz "unzip -l"
  428. trl "tar tvzf"
  429. trx "tar xvzf"
  430. # pass [[[ #
  431. # p "pass"
  432. pc "pass -c"
  433. pe "pass edit"
  434. pi "pass insert -m"
  435. pg "pass generate -c"
  436. ps "pass show"
  437. xc "xclip -selection clipboard"
  438. xo "xclip -o >"
  439. yh "echo 'kevin.mok@live.ca' | xclip -selection clipboard"
  440. yg "xclip -selection clipboard ~/.password-store/social/gmail"
  441. ytb "xclip -selection clipboard ~/.password-store/social/trapbot"
  442. yu "echo 'kevin.mok@mail.utoronto.ca' | xclip -selection clipboard"
  443. # ]]] pass #
  444. # watson [[[ #
  445. w "watson"
  446. # start [[[ #
  447. wa "watson start"
  448. wacm "watson start fun +cod-mobile"
  449. wae "watson start && watson edit"
  450. wad "watson add"
  451. we "watson edit"
  452. wre "watson restart"
  453. wree "watson restart && watson edit"
  454. # ]]] start #
  455. # stop [[[ #
  456. ws "watson status && watson stop"
  457. wse "watson stop && watson edit"
  458. wsc "watson cancel"
  459. wsl "watson stop && watson log --day"
  460. wt "watson status"
  461. # ]]] stop #
  462. # log/report [[[ #
  463. wl "watson log -Gcd"
  464. wla "watson log -Gcap"
  465. wlat "watson log -GcaT"
  466. ww "watson log -Gc"
  467. wwa "watson log -Gc | bat"
  468. wr "watson report -Gcd"
  469. wra "watson report -Gcap"
  470. wram "watson report -Gca | rg -S '^\w.*-\s\d*h' | sort -t' ' -hk3 | sed 's/ - /,/' | xsv table"
  471. wrat "watson report -GcaT"
  472. wrf "watson report -Gc --from ''"
  473. wrm "watson report -GcmT"
  474. wrw "watson report -Gc"
  475. # ]]] log/report #
  476. # ]]] watson #
  477. # timetrace [[[ #
  478. tt "timetrace"
  479. tta "timetrace start"
  480. ttaa "timetrace start a3@300"
  481. tte "timetrace edit record latest"
  482. ttc "timetrace create"
  483. ttp "timetrace create project"
  484. ttlp "timetrace list projects"
  485. ttlr "timetrace list records today"
  486. ttr "timetrace report"
  487. tts "timetrace stop"
  488. ttt "timetrace status"
  489. # ]]] timetrace #
  490. # ]]] applications #
  491. # git [[[ #
  492. g "git"
  493. gi "git init"
  494. gib "git init --bare"
  495. gstr "git config credential.helper store"
  496. gstrp "git config credential.helper store && git push"
  497. # branch [[[ #
  498. gb "git branch"
  499. gbd "git branch -D"
  500. gba "git branch --no-merged && echo '' && git branch --merged"
  501. gbu "git branch --no-merged"
  502. gbm "git branch --merged"
  503. gbr "git branch -m"
  504. gbu "git branch --set-upstream-to="
  505. gbv "git branch -vv"
  506. gsm "git submodule"
  507. gsma "git submodule add"
  508. gsmi "git submodule init"
  509. gsmp "git submodule foreach git pull"
  510. gsmu "git submodule update --recursive --remote"
  511. gmg "git merge"
  512. gmga "git merge --abort"
  513. gmgs "git merge --squash"
  514. gmgts "git merge -X theirs"
  515. gmgt "git mergetool"
  516. gr "git remote -v"
  517. gra "git remote add origin"
  518. grao "git remote add orig"
  519. grag "git remote add gitea ssh://git@git.kevin-mok.com:399/Kevin-Mok/"
  520. grr "git remote remove origin"
  521. gru "git branch --set-upstream-to=origin/main main"
  522. # ]]] branch #
  523. gt "git tag"
  524. gta "git tag -as"
  525. gtd "git tag -d"
  526. # add/remove [[[ #
  527. ga "git add -A && git status -u"
  528. gac "git add -A && git commit -S"
  529. gaf "git add -f"
  530. gal "git lfs track"
  531. # unsigned commt
  532. gacu "git add -A && git commit"
  533. glf "git lfs"
  534. # glfi "git lfs install"
  535. # glfp "git lfs pull"
  536. glfp "git lfs install && git lfs pull"
  537. glft "git lfs track *"
  538. gm "git mv"
  539. grm "git rm"
  540. grmf "git rm -f"
  541. grmc "git rm --cached"
  542. grmfc "git rm -f --cached"
  543. grmor "rm (fd -e orig --no-ignore -H)"
  544. # ]]] add/remove #
  545. # diff/log [[[ #
  546. gd "git diff -w"
  547. gdc "git diff --cached -w"
  548. gdh "git diff --cached -w HEAD~1"
  549. gds "git diff --stat"
  550. gdsc "git diff --stat --cached -w"
  551. gdt "git difftool -w --tool=vimdiff"
  552. gdtc "git difftool -w --cached --tool=vimdiff"
  553. gl "git log -5"
  554. gl1 "git log --oneline"
  555. gl1x "git log --oneline -1 | xclip -selection clipboard"
  556. gla "git log"
  557. glm "git log main"
  558. glr "git log --reverse"
  559. gqs "git-quick-stats -T"
  560. # gsl "git shortlog"
  561. gsh "git show"
  562. gshh "git show HEAD"
  563. gshs "git show --stat"
  564. # ]]] diff/log #
  565. # pull [[[ #
  566. gcl "git clone"
  567. gs "git status -u"
  568. gf "git fetch"
  569. gfa "git fetch --all"
  570. gfo "git fetch orig"
  571. gch "git checkout"
  572. gchn "git checkout -b"
  573. gchm "git checkout main"
  574. gchms "git checkout master"
  575. gchnw "git checkout -b wip"
  576. gchw "git checkout wip"
  577. gchh "git checkout HEAD --"
  578. # grss "git reset --soft HEAD~1"
  579. # grs "git reset --hard"
  580. # grso "git reset --hard origin/main"
  581. # grsh "git reset --hard HEAD"
  582. # grsh1 "git reset --hard HEAD~1"
  583. grs "git reset --soft"
  584. grs1 "git reset --soft HEAD~1"
  585. grs1c "git reset --soft HEAD~1 && git commit --amend --no-edit -S"
  586. grso "git reset --soft orig/main"
  587. grsh "git reset --hard"
  588. grsho "git reset --hard origin/main"
  589. grshh "git reset --hard HEAD"
  590. grshh1 "git reset --hard HEAD~1"
  591. # show files in git repo
  592. # gls "git ls-tree -r HEAD --name-only"
  593. gls "git ls-tree HEAD --name-only"
  594. gchp "git cherry-pick"
  595. gchpt "git cherry-pick --strategy=recursive -X theirs"
  596. gchpc "git cherry-pick --continue"
  597. gst "git stash push -m ''"
  598. gstl "git stash list"
  599. gstp "git stash pop"
  600. gsts "git stash show stash@\{0\} -p"
  601. gstcl "git stash clear"
  602. gpl "git pull --rebase"
  603. gplo "git fetch origin && git pull --rebase . origin/main"
  604. grb "git rebase -i"
  605. grba "git rebase --abort"
  606. grbc "git rebase --continue"
  607. grl "git reflog"
  608. grlc "git checkout HEAD@{1}"
  609. # ]]] pull #
  610. # push [[[ #
  611. gc "git commit -S"
  612. gcu "git commit"
  613. gca "git add -A && git commit --amend --no-edit -S"
  614. gcam "git add -A && git commit --amend -S"
  615. gcap "git add -A && git commit --amend --no-edit -S && git push --force"
  616. psgi "git add -A && git commit -m 'Update' -S && git push"
  617. gps "git push"
  618. gpso "git push origin"
  619. gpsoh "git push -f origin HEAD:"
  620. gpsg "git push gitea"
  621. gpsk "git push kevin"
  622. gpsdl "git push origin --delete"
  623. # gpsi "git config credential.helper store && git push"
  624. # gpsn "git push --set-upstream origin main"
  625. gpsn "eval (git push 2>&1 | tail -n 2)"
  626. gpsf "git push --force"
  627. gpsu "git push --set-upstream origin"
  628. # assume file unchanged
  629. gunc "git update-index --assume-unchanged"
  630. # ]]] push #
  631. # ]]] git #
  632. # coding projs [[[ #
  633. # pm "python main.py"
  634. pmn "python main.py"
  635. tld "tldr"
  636. # fsl "zathura --fork ~/coding/fastest-languages.pdf"
  637. fsl "bat ~/Documents/fastest-languages/fastest-languages.md"
  638. rgt "rg TODO"
  639. # django [[[ #
  640. # pmn "python manage.py"
  641. pm "python manage.py"
  642. pmk "python manage.py makemigrations"
  643. pmg "python manage.py migrate"
  644. # ]]] django #
  645. # make [[[ #
  646. # ma "printf '\033c' && bear make"
  647. # mc "bear make clean"
  648. # mca "bear make clean && printf '\033c' && bear make"
  649. # rmc "rm compile_commands.json"
  650. # ]]] make #
  651. # chezmoi [[[ #
  652. zm "chezmoi"
  653. za "chezmoi add"
  654. zar "chezmoi add -r"
  655. zd "chezmoi data"
  656. zdf "chezmoi diff"
  657. zp "chezmoi -v apply"
  658. # ]]] chezmoi #
  659. # spotify-lib-vis [[[ #
  660. # start spv server outside dir
  661. psv "source ../bin/activate.fish && python manage.py runserver"
  662. # open spv db in psql
  663. spvdb "psql -d spotifyvis -U django"
  664. mig "python manage.py makemigrations && python manage.py migrate --run-syncdb && ssv"
  665. cldb "python manage.py flush --no-input && ssv"
  666. # django shell
  667. djs "python manage.py shell"
  668. # update pip
  669. upip "pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U"
  670. # update pip req's.
  671. ureq "pip freeze > requirements.txt"
  672. # show last history scan
  673. hlg "psql -U postgres -d spotifyvis -a -f /home/kevin/coding/spotify-lib-vis/src/scripts/queries/history.sql | rg 2021 | tac"
  674. slg "tail -n 5 $spv_dir/src/api/management/commands/update-history.log"
  675. # scan history
  676. # hs "$spv_dir/src/update-history.sh && cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
  677. # removes all but newest file
  678. # rmol "ls -t | tail -n +2 | xargs rm -- && l"
  679. # snw "spotify-now -i '%artist - %title'"
  680. svd "pg_dump spotifyvis > spotifyvis.bak"
  681. # ]]] spotify-lib-vis #
  682. shc "shellcheck"
  683. tll "tllocalmgr"
  684. tli "tllocalmgr install"
  685. # tlh "tllocalmgr texhash"
  686. pdl "pdflatex"
  687. tcl "tex-clean"
  688. # grocery-finder [[[ #
  689. wl0 "watson log --all --project=309 --tag=phase2"
  690. wr0 "watson report --all --project=309 --tag=phase2"
  691. # server [[[ #
  692. no "node"
  693. noe "node --experimental-json-modules"
  694. ndm "nodemon"
  695. knd "killall node"
  696. mg "mongo"
  697. 0ht "cd ~/school/309-proj && python3 -m http.server"
  698. mgd "mongod --dbpath mongo-data"
  699. # nds "killall node && nodemon server.js"
  700. # nds "nodemon server.js"
  701. # ]]] server #
  702. # heroku [[[ #
  703. hr "heroku"
  704. hrs "heroku local web"
  705. hrt "heroku ps"
  706. hrl "heroku logs --dyno web -n 1500 | rg up | awk '{ system(\"date -d \" \$1); \$1 = \"\"; print \$0 }' | paste -s -d' \n'"
  707. gpsh "git push heroku"
  708. 0c "node collections.js"
  709. # ]]] heroku #
  710. # ]]] 309 #
  711. # mfs [[[ #
  712. pyh "python -m http.server"
  713. # j "jekyll"
  714. # js "jekyll serve"
  715. hg "hugo"
  716. hgs "hugo serve --disableFastRender"
  717. hgp "hugo server -D --disableFastRender --bind 192.168.0.10 --baseURL 'http://192.168.0.10:1313'"
  718. # ]]] mfs #
  719. ssb "ssh-bandit"
  720. rt "python ~/coding/rt-scraper/!rt-scraper.py"
  721. # ada-mario [[[ #
  722. mm "printf '\033c' && bear make clean move_mouse_with_head && ./move_mouse_with_head"
  723. med "printf '\033c' && bear make clean eye_detector && ./eye_detector"
  724. mft "printf '\033c' && bear make clean face_detector && ./face_detector"
  725. rft "~/coding/face-tracker/face_detector > /tmp/move_mouse_with_head.out"
  726. # gpsb "git push bitbucket"
  727. gpsb "git push bot"
  728. # ]]] ada-mario #
  729. sac "source ../../bin/activate.fish"
  730. dea "deactivate"
  731. whe "watch echo"
  732. nst "cp ~/Documents/workout-logs/stretching.md /tmp && nvim /tmp/stretching.md"
  733. # Red Discord bot
  734. rde "pyenv shell red-discord-bot-test"
  735. rbd "redbot --dev --debug"
  736. lo7 "libreoffice ~/Documents/expenses/2021.ods &"
  737. nps "npm start"
  738. # rarity surf [[[ #
  739. # po "python ~/coding/rarity-sniper/opensea.py | tail -n30"
  740. # po "python ~/coding/rarity-sniper/opensea.py"
  741. # poa "python ~/coding/rarity-sniper/opensea.py"
  742. # pp "python scrape.py"
  743. # pr "python rarity.py"
  744. # pu "python ~/coding/rarity-sniper/opensea.py update"
  745. po "python manage.py opensea"
  746. pr "python manage.py rarity"
  747. bz "python manage.py rarity -t Bitz -n"
  748. pmp "python manage.py makemigrations project"
  749. srs "source ~/.venv/rarity-sniper/bin/activate.fish"
  750. yra "yarn add"
  751. yrb "yarn build"
  752. yrbs "yarn build && serve -s build"
  753. yrr "yarn remove"
  754. yrs "yarn start"
  755. sv "serve -s build"
  756. ssrr "mosh root@161.35.107.30"
  757. ssr "mosh 161.35.107.30"
  758. # ]]] rarity surf #
  759. # ]]] coding projs #
  760. # games [[[ #
  761. {{ if eq .chezmoi.hostname "nzxt" }}
  762. wlm "watson log --all --project=minetest"
  763. # wrm "watson report --all --project=minetest"
  764. wamv "watson start minetest +video"
  765. # minetest [[[ #
  766. mtg "minetest"
  767. mts "minetestserver"
  768. mtsc "minetestserver --gameid minetest --worldname Creative --terminal"
  769. # mtsh "minetestserver --gameid minetest --worldname Hevin --config ~/.minetest/hevin.conf --terminal"
  770. mtsh "minetestserver --gameid mineclone2 --worldname Hevin-MC --config ~/.minetest/hevin-mc.conf --terminal"
  771. mtsv "minetestserver --gameid minimal --worldname Test --terminal"
  772. # mtrsy "rsync -vr .minetest/ /mnt/linux-files/.minetest/"
  773. tet "pandoc -f markdown -t html twitch-emote-conversion.md | xclip -selection clipboard"
  774. {{ end }}
  775. # ]]] minetest #
  776. # tet "pandoc -f markdown -t html twitch-emote-conversion.md | xclip -selection clipboard"
  777. shrg "printf '¯\\\\\\\\\\_(ツ)_/¯' | xclip -selection clipboard"
  778. dcec "mono DiscordChatExporter.Cli.exe"
  779. dcec "mono DiscordChatExporter.Cli.exe export -t $DISCORD_TOKEN -c"
  780. ifm "sxiv ~/Documents/fortnite/maps/boat-campfire-slurp.png"
  781. # twitchy [[[ #
  782. tw "twitchy"
  783. twa "twitchy -a"
  784. twd "twitchy -d"
  785. tws "twitchy -s"
  786. twf "watch -n300 'twitchy-game Fortnite'"
  787. # mp "mpv --video-zoom=1.5"
  788. # ufn "source trn-api-key.fish && curl --request GET --url https://api.fortnitetracker.com/v1/profile/pc/Vole%20on%20Mobile --header 'trn-api-key: 584d8eca-30d9-4119-92d8-5067dd301118' --cookie __cfduid=d4f0daac7eee3687b481bd55dcf00f3581581900091 > stats.json"
  789. # ]]] twitchy #
  790. lob "lsd -F --group-dirs first 2020*.mkv"
  791. wob "watch -n60 'lsd -lF --group-dirs first --size short 2020*.mkv'"
  792. fnp "t timeline FNProgress | sed -n '2p'"
  793. fnu "sxiv ~/Documents/fortnite/pics/maps/upgrade.png &"
  794. # ]]] games #
  795. # school [[[ #
  796. # basic
  797. # wlf "watson log --all --tag=final"
  798. # wrf "watson report --all --tag=final"
  799. gpa "column -ts',' ~/Documents/gpa.md"
  800. ssc "mosh mokkar@teach.cs.utoronto.ca"
  801. # alg course
  802. jc "javac -d out *.java"
  803. jr "java -cp \"$CLASSPATH:out\""
  804. # 263
  805. wl6 "watson log --all --project=263 --tag=a5"
  806. wr6 "watson report --all --project=263 --tag=a5"
  807. z6 "zathura --fork ~/school/263/Introduction-to-Algorithms-CLRs/Introduction\ to\ Algorithms\ -\ 3rd\ Edition.pdf"
  808. pd6 "pdflatex a5"
  809. spc "source ~/.venv/price-calc/bin/activate.fish"
  810. scv "source ~/.venv/covid-monitor/bin/activate.fish"
  811. fr "flask run"
  812. pmd "python manage.py db"
  813. pmdm "python manage.py db migrate"
  814. pmdu "python manage.py db upgrade"
  815. # pt "pytest --cov"
  816. # ]]] school #
  817. # red-hat [[[ #
  818. vpu "nmcli con up id '1 - Red Hat Global VPN' --ask"
  819. vpd "nmcli con down id '1 - Red Hat Global VPN'"
  820. loe "libreoffice ~/Documents/expenses/2021.ods &"
  821. loi "libreoffice ~/Documents/expenses/investments.ods &"
  822. # laptop
  823. # gcfr "git config user.email 'kmok@redhat.com' && git config user.signingkey 10B001347552F396"
  824. gchk "git checkout KOGITO-"
  825. gchnk "git checkout -b KOGITO-"
  826. gch3 "git checkout KOGITO-1031-diff-3"
  827. # ssh [[[ #
  828. ssw "mosh $WORK_LAPTOP_IP tmux a"
  829. ssw2 "mosh $WORK_LAPTOP_IP -- tmux a -t nzxt-2"
  830. ssi "mosh $WORK_LAPTOP_IP -- tmux a -t weechat"
  831. scw "scp $WORK_LAPTOP_IP:"
  832. sfw "sftp $WORK_LAPTOP_IP"
  833. # ]]] ssh #
  834. fp "fpaste"
  835. ghr "github-release"
  836. # oc [[[ #
  837. o "kubectl"
  838. oa "kubectl apply -f"
  839. ocr "kubectl create"
  840. ocf "kubectl create ns kogito; kubectl config set-context --current --namespace=kogito"
  841. oct "kubectx"
  842. od "kubectl describe"
  843. odd "kubectl describe deployment"
  844. odp "kubectl describe pod"
  845. odi "kubectl describe kogitoinfra"
  846. odr "kubectl describe kogitoruntime"
  847. odl "kubectl delete"
  848. odlf "kubectl delete -f"
  849. odlb "kubectl delete kogitobuild"
  850. odlc "kubectl delete configmap"
  851. odlp "kubectl delete pod"
  852. odlpj "kubectl delete project"
  853. odlr "kubectl delete kogitoruntime"
  854. oex "kubectl exec"
  855. oed "kubectl edit"
  856. og "kubectl get"
  857. oga "kubectl get all"
  858. ogd "kubectl get deployment"
  859. ogp "kubectl get pods"
  860. ogw "watch kubectl get pods"
  861. ogb "kubectl get kogitobuild"
  862. ogc "kubectl get configmap"
  863. ogi "kubectl get imagestream"
  864. ogn "kubectl get"
  865. ogr "kubectl get kogitoruntime"
  866. ogs "kubectl get service"
  867. ogsm "kubectl get servicemonitor"
  868. ol "kubectl logs -f"
  869. oli "kubectl login -u kubeadmin -p"
  870. on "kubectl new-project"
  871. op "kubectl project"
  872. opa "kubectl projects | rg kogito"
  873. opd "kubectl project default"
  874. ot "kubectl status"
  875. # ]]] oc #
  876. # jenkins [[[ #
  877. jk "java -jar ~/java/jenkins-cli.jar -s http://localhost:8090 -auth kevin:$JENKINS_TOKEN"
  878. jkb "java -jar ~/java/jenkins-cli.jar -s http://localhost:8090 -auth kevin:$JENKINS_TOKEN build -s -v"
  879. jkc "java -jar ~/java/jenkins-cli.jar -s http://localhost:8090 -auth kevin:$JENKINS_TOKEN console -f"
  880. # ]]] jenkins #
  881. # maven [[[ #
  882. mvc "mvn clean"
  883. mvci "mvn clean install -Dfull"
  884. mvi "mvn install -Dfull"
  885. # mvps "mvn package -DskipTests"
  886. mvp "mvn clean package -DskipTests"
  887. mvpr "mvn clean package -DskipTests && ./server-control.sh start"
  888. # mvt "mvn test"
  889. # mvct "mvn clean test"
  890. # ]]] maven #
  891. # make [[[ #
  892. mk "make"
  893. mb4 "make before-pr"
  894. mbc "make build-cli && scp build/_output/bin/kogito $WORK_LAPTOP_IP:/home/kmok/go/bin"
  895. mc "make clean"
  896. mct "make clean test"
  897. mi "make install"
  898. ml "make lint"
  899. mr "make run"
  900. mt "make test"
  901. # mvet "make vet"
  902. # mvett "make vet test"
  903. mvt "make vet"
  904. mvtt "make vet test"
  905. # ]]] make #
  906. # kg "kogito"
  907. # minikube [[[ #
  908. # mb "minikube"
  909. mba "minikube start"
  910. mbd "minikube delete"
  911. mbs "minikube stop"
  912. mbt "minikube status"
  913. # ]]] minikube #
  914. # go [[[ #
  915. gor "go run"
  916. gom "DEBUG=true go run main.go"
  917. got "go test"
  918. gota "go test *"
  919. gotd "go mod tidy"
  920. # ]]] go #
  921. # docker [[[ #
  922. dk "docker"
  923. dkb "docker build"
  924. dki "docker image"
  925. dkp "docker push"
  926. dks "docker images"
  927. # ]]] docker #
  928. sb "ansible"
  929. sbp "ansible-playbook"
  930. # helm [[[ #
  931. # h "helm"
  932. hd "helm delete"
  933. hi "helm install"
  934. him "helm install --set openshift=false"
  935. ht "helm template"
  936. hu "helm upgrade"
  937. # ]]] helm #
  938. # ]]] red-hat #
  939. # tet "ticker (cat ~/Documents/expenses/etf.md) | xclip -selection clipboard"
  940. tet "ticker (xclip -o) | xclip -selection clipboard"
  941. # vpn [[[ #
  942. eip "curl ifconfig.me"
  943. fdb "firefox -P discord-"
  944. sip "curl ifconfig.me"
  945. vpc "nordvpn connect && curl ifconfig.me"
  946. vpd "nordvpn disconnect"
  947. # ]]] vpn #