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.

983 lines
23 KiB

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