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.

432 lines
9.7 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. # system {{{ #
  2. # vim: fdm=marker
  3. # clear screen
  4. c "printf '\033c'"
  5. hst "history"
  6. nf "printf '\033c' && neofetch | lolcat"
  7. fi "fish"
  8. # reload urxvt
  9. ru "xrdb ~/.Xresources"
  10. # list file sizes in megabytes with depth 1
  11. duh "sudo du -d 1 -h --apparent-size | sort -hr"
  12. dum "sudo du -d 1 -m --apparent-size | sort -hr"
  13. m "man"
  14. tl "tldr"
  15. nvt "nvidia-settings --assign CurrentMetaMode='DVI-I-1: nvidia-auto-select +0+0 {ForceCompositionPipeline=On}, HDMI-0: nvidia-auto-select +3840+0 {ForceCompositionPipeline=On}'"
  16. vgb "sudo nvim /etc/default/grub"
  17. mkgb "sudo grub-mkconfig -o /boot/grub/grub.cfg"
  18. b "bat"
  19. ba "bat *"
  20. grep "grep --color=auto -n"
  21. grr "grep -r"
  22. # pk "pkill -f"
  23. cld "colordiff -wy --suppress-common-lines"
  24. mkpk "makepkg -sri"
  25. ex "chmod 777"
  26. ex "chmod 777"
  27. # systemctl {{{ #
  28. ctl "sudo systemctl"
  29. ctle "sudo systemctl enable"
  30. ctld "sudo systemctl disable"
  31. ctla "sudo systemctl start"
  32. ctls "sudo systemctl stop"
  33. ctlt "sudo systemctl status"
  34. ctltd "sudo systemctl status dhcpcd"
  35. ctlr "sudo systemctl restart"
  36. # }}} systemctl #
  37. wm "sudo wifi-menu"
  38. # mounting
  39. udm "udisksctl mount -b"
  40. udmb "udisksctl mount -b /dev/sdc2"
  41. udu "udisksctl unmount -b"
  42. udub "udisksctl unmount -b /dev/sdc2"
  43. tc "touch"
  44. vdr "vidir"
  45. # directory-related {{{ #
  46. ls "lsd"
  47. l "lsd -a"
  48. ll "lsd -al"
  49. smv "sudo mv"
  50. f "cd"
  51. fz "fzf"
  52. fnd "find . -type f -name"
  53. rmr "rm -rf"
  54. rmd "rm ~/Downloads/*"
  55. md "mkdir -p"
  56. rsy "rsync -Pr"
  57. # list all (un)mounted drives
  58. lhd "sudo fdisk -l"
  59. # get disc space for mounted drives
  60. # ds "df -h | tee >(head -n 1) >(grep sd) >/dev/null"
  61. ds "df -h | head -n 1 && df -h | grep sd"
  62. chownw "sudo chown -R kevin:wheel"
  63. chwnm "sudo chown -R kevin:wheel /run/media/kevin"
  64. # cd into backup folder and show backup sizes
  65. nbu "cd /run/media/kevin/backup-hd/nzxt/tar && lsd -l"
  66. # }}} directory-related #
  67. # power options {{{ #
  68. s "systemctl suspend"
  69. so "xset dpms force off"
  70. sd "systemctl poweroff"
  71. rb "systemctl reboot"
  72. lo "i3-msg exit"
  73. x "xmodmap ~/.Xmodmap && xset r rate $XSET_DELAY $XSET_RATE"
  74. X "xmodmap ~/.Xmodmap && xset r rate $XSET_DELAY $XSET_RATE"
  75. # }}} power options #
  76. # sound
  77. vlm "alsamixer -c 0"
  78. vlh "alsamixer -c 2"
  79. # apt
  80. # apti "sudo apt install"
  81. # aptr "sudo apt remove"
  82. # aptu "sudo apt upgrade"
  83. # pacman {{{ #
  84. # pc "sudo pacman -S"
  85. # pcq "sudo pacman -Qi"
  86. # pcr "sudo pacman -Rns"
  87. # pcud "sudo pacman -Sy"
  88. # pcug "sudo pacman -Syu"
  89. # xpc "pacman -Qqne > ~/linux-config/txt/nzxt-pkgs.txt && pacman -Qqme > ~/linux-config/txt/nzxt-aur.txt "
  90. # tri "trizen -S --noconfirm"
  91. tri "trizen -S --noedit"
  92. # install
  93. ya "yay -S --answerdiff=N --answeredit=N"
  94. # info
  95. yaq "yay -Qi"
  96. # remove
  97. yar "yay -Rns"
  98. # sync
  99. yaud "yay -Sy"
  100. # sync and update
  101. yaug "yay -Syu"
  102. # export packages
  103. xya "yay -Qqne > ~/linux-config/txt/nzxt-pkgs.txt && yay -Qqme > ~/linux-config/txt/nzxt-aur.txt "
  104. # }}} pacman #
  105. py "python"
  106. pipi "sudo pip install"
  107. # internet
  108. pg "ping -c 3 -W 1 8.8.8.8"
  109. dh "sudo dhcpcd"
  110. kdh "sudo killall dhcpcd"
  111. rdh "sudo killall dhcpcd && sudo dhcpcd"
  112. id "identify"
  113. # rz "source ~/linux-config/aliases/zsh_aliases"
  114. # }}} system #
  115. # applications {{{ #
  116. # silent="> /dev/null 2>&1& "
  117. chr "google-chrome"
  118. clc "cloc ."
  119. cv "cava"
  120. fh "feh"
  121. gpd "gpg --decrypt"
  122. gpe "gpg --encrypt --recipient"
  123. htc "htop -s PERCENT_CPU"
  124. htm "htop -s PERCENT_MEM"
  125. kd "killall Discord && killall Discord"
  126. kt "killall thunderbird"
  127. mp "mpv --volume=50"
  128. mra "man ranger"
  129. n "nvim"
  130. p3 "python3"
  131. pipes "pipes.sh -t 3"
  132. py "python"
  133. r "ranger"
  134. rx "redshift -x"
  135. sn "sudo nvim"
  136. sx "sxiv"
  137. sxa "sxiv -a"
  138. wg "wego"
  139. wp "grep wallpaper ~/.cache/wal/colors.sh"
  140. z "zathura --fork"
  141. lz "unzip -l"
  142. # rsl "java -jar ~/Downloads/RuneLite.jar"
  143. # swex "sudo nohup ~/Downloads/swex.appimage $silent"
  144. # pass {{{ #
  145. ps "pass"
  146. psc "pass -c"
  147. pse "pass edit"
  148. psi "pass insert -m"
  149. psg "pass generate -c"
  150. xc "xclip -selection clipboard"
  151. yh "echo 'kevin.mok@live.ca' | xclip -selection clipboard"
  152. yg "xclip -selection clipboard ~/.password-store/social/gmail"
  153. yt "xclip -selection clipboard ~/.password-store/social/trapbot"
  154. yu "echo 'kevin.mok@mail.utoronto.ca' | xclip -selection clipboard"
  155. # }}} pass #
  156. # watson {{{ #
  157. w "watson"
  158. wa "watson start"
  159. wae "watson start && watson edit"
  160. we "watson edit"
  161. wl "watson log --day"
  162. ww "watson log"
  163. # wlm "watson log --project coding --tag mfs"
  164. wr "watson report --day"
  165. wrw "watson report"
  166. wre "watson restart"
  167. ws "watson status && watson stop"
  168. wse "watson stop && watson edit"
  169. wsc "watson cancel"
  170. wsl "watson stop && watson log --day"
  171. wt "watson status"
  172. # }}} watson #
  173. # }}} applications #
  174. # git {{{ #
  175. gstr "git config credential.helper store"
  176. g "git"
  177. # branch {{{ #
  178. gb "git branch"
  179. gbd "git branch -D"
  180. gba "git branch --no-merged && echo '' && git branch --merged"
  181. gbu "git branch --no-merged"
  182. gbm "git branch --merged"
  183. # }}} branch #
  184. gr "git remote -v"
  185. gro "git remote show origin"
  186. # add/remove {{{ #
  187. ga "git add -A && git status -u"
  188. gac "git add -A && git commit -S"
  189. gaf "git add -f"
  190. # unsigned commt
  191. gacu "git add -A && git commit"
  192. grm "git rm"
  193. grmf "git rm -f"
  194. grmc "git rm --cached"
  195. grmfc "git rm -f --cached"
  196. # }}} add #
  197. # diff/log {{{ #
  198. gd "git difftool -w --tool=vimdiff"
  199. gdc "git difftool -w --cached --tool=vimdiff"
  200. gdl "git diff -w"
  201. gdlc "git diff --cached -w"
  202. gdh "git diff --cached -w HEAD~1"
  203. gds "git diff --stat"
  204. gl "git log"
  205. gsl "git shortlog"
  206. # }}} diff/log #
  207. # update {{{ #
  208. gs "git status -u"
  209. gchom "git checkout master"
  210. gchnw "git checkout -b wip"
  211. gchw "git checkout wip"
  212. gheadm1 "git reset --hard HEAD~1"
  213. # show files in git repo
  214. # gls "git ls-tree -r HEAD --name-only"
  215. gls "git ls-tree HEAD --name-only"
  216. # push {{{ #
  217. gst "git stash"
  218. gstl "git stash list"
  219. gstp "git stash pop"
  220. gc "git commit -S"
  221. gcu "git commit"
  222. gca "git add -A && git commit --amend --no-edit -S"
  223. gcam "git add -A && git commit --amend -S"
  224. # gcamp "git add -A && git commit --amend --no-edit -S && gpsf"
  225. psgi "git add -A && git commit -m 'Update' -S && git push"
  226. gps "git push"
  227. gpsi "git config credential.helper store && git push"
  228. # gpsn "git push --set-upstream origin master"
  229. gpsn "eval (git push 2>&1 | tail -n 2)"
  230. gpsf "git push --force"
  231. gclear "git stash clear"
  232. gpl "git pull --rebase"
  233. grba "git rebase --abort"
  234. grbc "git rebase --continue"
  235. # }}} push #
  236. # }}} update #
  237. crm "mrk README.md"
  238. gcho "git checkout"
  239. gchon "git checkout -b"
  240. gf "git fetch origin"
  241. gcln "git clone"
  242. gchp "git cherry-pick"
  243. gchpc "git cherry-pick --continue"
  244. # assume file unchanged
  245. gunc "git update-index --assume-unchanged"
  246. # }}} git #
  247. # coding projs {{{ #
  248. # coding_dir="~/coding"
  249. rgt "rg TODO"
  250. # trapbot {{{ #
  251. # tb "$cd_coding_dir/trapbot"
  252. # vtb "$cd_coding_dir/trapbot && ni scan_reddit.py"
  253. # ptb "python scan_reddit.py"
  254. # rtb "$cd_coding_dir/trapbot && python scan_reddit.py"
  255. # }}} trapbot #
  256. # spotify-lib-vis {{{ #
  257. # spv_dir="$coding_dir""/spotify-lib-vis"
  258. # svl "f $spv_dir/src/login"
  259. # sva "f $spv_dir/src/api"
  260. # svg "f $spv_dir/src/graphs"
  261. # svscs "f $spv_dir/src/static/scss"
  262. # svcss "f $spv_dir/src/spotifyvis/static/scss"
  263. # start spv server from dir
  264. # pg "sudo systemctl start postgresql.service && systemctl status postgresql.service"
  265. ssv "bash ../bin/activate && python manage.py runserver"
  266. # start spv server outside dir
  267. # open spv db in psql
  268. spvdb "psql -d spotifyvis -U django"
  269. mig "python manage.py makemigrations && python manage.py migrate --run-syncdb && ssv"
  270. cldb "python manage.py flush --no-input && ssv"
  271. # django shell
  272. djs "python manage.py shell"
  273. # update pip
  274. upip "pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U"
  275. # update pip req's.
  276. ureq "pip freeze > requirements.txt"
  277. # show last history scan
  278. hlg "cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
  279. # scan history
  280. # hs "$spv_dir/src/update-history.sh && cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
  281. # scan cron log for hs cmd
  282. crnl "grep \"(kevin) CMD\" /var/log/syslog | tail -n 1 && hlg"
  283. # removes all but newest file
  284. # rmol "ls -t | tail -n +2 | xargs rm -- && l"
  285. snw "spotify-now -i '%artist - %title'"
  286. # }}} spotify-lib-vis #
  287. shc "shellcheck"
  288. pdl "pdflatex"
  289. tcl "tex-clean"
  290. # mfs
  291. mfs "nvim /home/kevin/coding/best-mf-site-personal/index.html"
  292. ht "python3 -m http.server"
  293. # j "jekyll"
  294. # js "jekyll serve"
  295. h "hugo"
  296. he "hugo serve -D --disableFastRender"
  297. ss "ssh kevin@192.168.0.100"
  298. ssb "ssh-bandit"
  299. rt "python ~/coding/rt-scraper/rt-scraper.py"
  300. # }}} coding projs #
  301. # school {{{ #
  302. # 369 {{{ #
  303. ssc "ssh mokkar@teach.cs.utoronto.ca"
  304. ma "printf '\033c' && bear make"
  305. mc "bear make clean"
  306. mca "bear make clean && printf '\033c' && bear make"
  307. rmc "rm compile_commands.json"
  308. rms "rm swapfile.*"
  309. wl6 "watson log --all --project=369 --tag=a4"
  310. wr6 "watson report --all --project=369 --tag=a4"
  311. um6 "sudo umount /mnt/369-a4"
  312. # a2 {{{ #
  313. mcr "bear make clean && printf '\033c' && bear make && ./carsim light 1 20"
  314. # mr "printf '\033c' && make && ./carsim stop 10 20"
  315. # mr "printf '\033c' && bear make && ./carsim light 1 20"
  316. # "valgrind --tool=helgrind ./carsim stop 10 50 > helgrind.txt 2>&1 && valgrind --tool=helgrind ./carsim light 10 50 >> helgrind.txt 2>&1"
  317. # lk "valgrind --leak-check=yes ./carsim stop 10 20"
  318. lk "valgrind --leak-check=yes ./carsim light 1 1"
  319. # hl "valgrind --tool=helgrind ./carsim stop 10 20"
  320. hl "valgrind --tool=helgrind ./carsim light 10 20"
  321. # }}} a2 #
  322. # a1
  323. # sa "ssh k@192.168.0.17"
  324. # cpi "scp interceptor.c kevin@192.168.0.17:/home/kevin/a1"
  325. # cpti "gcc -m32 -o test_intercept test_intercept.c && scp test_intercept k@192.168.0.17:/home/k/a1"
  326. # }}} 369 #
  327. # 309
  328. wl0 "watson log --all --project=309 --tag=e3"
  329. wr0 "watson report --all --project=309 --tag=e3"
  330. nd "node"
  331. ndm "nodemon"
  332. mg "mongo"
  333. mgd "mongod --dbpath mongo-data"
  334. 0ht "cd ~/school/309-proj && python3 -m http.server"
  335. hr "heroku"
  336. hrt "heroku ps"
  337. hrl "heroku logs --dyno web -n 1500 | rg up | awk '{ system(\"date -d \" \$1); \$1 = \"\"; print \$0 }' | paste -s -d' \n'"
  338. # }}} school #