Initial chezmoi commit
This commit is contained in:
@@ -1,460 +0,0 @@
|
||||
# system {{{ #
|
||||
# vim: fdm=marker
|
||||
|
||||
# clear screen
|
||||
c "printf '\033c'"
|
||||
hst "history"
|
||||
nf "printf '\033c' && neofetch | lolcat"
|
||||
fi "fish"
|
||||
# reload urxvt
|
||||
ru "xrdb ~/.Xresources"
|
||||
# list file sizes in megabytes with depth 1
|
||||
duh "sudo du -d 1 -h --apparent-size | sort -hr"
|
||||
dum "sudo du -d 1 -m --apparent-size | sort -hr"
|
||||
m "man"
|
||||
tl "tldr"
|
||||
|
||||
nvt "nvidia-settings --assign CurrentMetaMode='DVI-I-1: nvidia-auto-select +0+0 {ForceCompositionPipeline=On}, HDMI-0: nvidia-auto-select +3840+0 {ForceCompositionPipeline=On}'"
|
||||
|
||||
vgb "sudo nvim /etc/default/grub"
|
||||
mkgb "sudo grub-mkconfig -o /boot/grub/grub.cfg"
|
||||
|
||||
b "bat"
|
||||
ba "bat *"
|
||||
grep "grep --color=auto -n"
|
||||
grr "grep -r"
|
||||
# pk "pkill -f"
|
||||
cld "colordiff -wy --suppress-common-lines"
|
||||
|
||||
mkpk "makepkg -sri"
|
||||
ex "chmod 777"
|
||||
ex "chmod 777"
|
||||
|
||||
# systemctl {{{ #
|
||||
|
||||
ctl "sudo systemctl"
|
||||
ctle "sudo systemctl enable"
|
||||
ctld "sudo systemctl disable"
|
||||
ctla "sudo systemctl start"
|
||||
ctls "sudo systemctl stop"
|
||||
ctlt "sudo systemctl status"
|
||||
ctltd "sudo systemctl status dhcpcd"
|
||||
ctlr "sudo systemctl restart"
|
||||
|
||||
# }}} systemctl #
|
||||
|
||||
wm "sudo wifi-menu"
|
||||
|
||||
# mounting
|
||||
udm "udisksctl mount -b"
|
||||
udmb "udisksctl mount -b /dev/sdc2"
|
||||
udu "udisksctl unmount -b"
|
||||
udub "udisksctl unmount -b /dev/sdc2"
|
||||
|
||||
tc "touch"
|
||||
vdr "vidir"
|
||||
|
||||
# directory-related {{{ #
|
||||
ls "lsd"
|
||||
l "lsd -a"
|
||||
ll "lsd -al"
|
||||
smv "sudo mv"
|
||||
f "cd"
|
||||
fz "fzf"
|
||||
fnd "find . -type f -name"
|
||||
|
||||
rmr "rm -rf"
|
||||
rmd "rm ~/Downloads/*"
|
||||
rmw "rm ~/.local/share/nvim/swap/"
|
||||
md "mkdir -p"
|
||||
rsy "rsync -Pr"
|
||||
|
||||
# list all (un)mounted drives
|
||||
lhd "sudo fdisk -l"
|
||||
# get disc space for mounted drives
|
||||
# ds "df -h | tee >(head -n 1) >(grep sd) >/dev/null"
|
||||
ds "df -h | head -n 1 && df -h | grep sd"
|
||||
chownw "sudo chown -R kevin:wheel"
|
||||
chwnm "sudo chown -R kevin:wheel /run/media/kevin"
|
||||
# cd into backup folder and show backup sizes
|
||||
nbu "cd /run/media/kevin/backup-hd/nzxt/tar && lsd -l"
|
||||
|
||||
# }}} directory-related #
|
||||
|
||||
# power options {{{ #
|
||||
|
||||
s "systemctl suspend"
|
||||
so "xset dpms force off"
|
||||
sd "systemctl poweroff"
|
||||
rb "systemctl reboot"
|
||||
lo "i3-msg exit"
|
||||
x "xmodmap ~/.Xmodmap && xset r rate $XSET_DELAY $XSET_RATE"
|
||||
X "xmodmap ~/.Xmodmap && xset r rate $XSET_DELAY $XSET_RATE"
|
||||
|
||||
# }}} power options #
|
||||
|
||||
# sound
|
||||
vlm "alsamixer -c 0"
|
||||
vlh "alsamixer -c 2"
|
||||
|
||||
# apt
|
||||
# apti "sudo apt install"
|
||||
# aptr "sudo apt remove"
|
||||
# aptu "sudo apt upgrade"
|
||||
|
||||
# pacman {{{ #
|
||||
|
||||
# pc "sudo pacman -S"
|
||||
# pcq "sudo pacman -Qi"
|
||||
# pcr "sudo pacman -Rns"
|
||||
# pcud "sudo pacman -Sy"
|
||||
# pcug "sudo pacman -Syu"
|
||||
# xpc "pacman -Qqne > ~/linux-config/txt/nzxt-pkgs.txt && pacman -Qqme > ~/linux-config/txt/nzxt-aur.txt "
|
||||
|
||||
# tri "trizen -S --noconfirm"
|
||||
tri "trizen -S --noedit"
|
||||
|
||||
# install
|
||||
ya "yay -S --answerdiff=N --answeredit=N"
|
||||
# info
|
||||
yaq "yay -Qi"
|
||||
# remove
|
||||
yar "yay -Rns"
|
||||
# sync
|
||||
yaud "yay -Sy"
|
||||
# sync and update
|
||||
yaug "yay -Syu"
|
||||
# export packages
|
||||
xya "yay -Qqne > ~/linux-config/txt/nzxt-pkgs.txt && yay -Qqme > ~/linux-config/txt/nzxt-aur.txt "
|
||||
|
||||
# }}} pacman #
|
||||
|
||||
py "python"
|
||||
pipi "sudo pip install"
|
||||
|
||||
# internet
|
||||
pg "ping -c 3 -W 1 8.8.8.8"
|
||||
dh "sudo dhcpcd"
|
||||
kdh "sudo killall dhcpcd"
|
||||
rdh "sudo killall dhcpcd && sudo dhcpcd"
|
||||
|
||||
id "identify"
|
||||
|
||||
# rz "source ~/linux-config/aliases/zsh_aliases"
|
||||
|
||||
# }}} system #
|
||||
|
||||
# applications {{{ #
|
||||
|
||||
# silent="> /dev/null 2>&1& "
|
||||
|
||||
chr "google-chrome"
|
||||
clc "cloc ."
|
||||
cv "cava"
|
||||
fh "feh"
|
||||
gpd "gpg --decrypt"
|
||||
gpe "gpg --encrypt --recipient"
|
||||
htc "htop -s PERCENT_CPU"
|
||||
htm "htop -s PERCENT_MEM"
|
||||
kd "killall Discord && killall Discord"
|
||||
kt "killall thunderbird"
|
||||
mp "mpv --volume=50"
|
||||
mra "man ranger"
|
||||
n "nvim"
|
||||
p3 "python3"
|
||||
pdft "pdftotext"
|
||||
pipes "pipes.sh -t 3"
|
||||
py "python"
|
||||
r "ranger"
|
||||
rx "redshift -x"
|
||||
sn "sudo nvim"
|
||||
sx "sxiv"
|
||||
sxa "sxiv -a"
|
||||
sxt "sxiv -t *"
|
||||
vmd "vimdiff"
|
||||
wg "wego"
|
||||
wp "grep wallpaper ~/.cache/wal/colors.sh"
|
||||
z "zathura --fork"
|
||||
|
||||
lz "unzip -l"
|
||||
|
||||
# rsl "java -jar ~/Downloads/RuneLite.jar"
|
||||
# swex "sudo nohup ~/Downloads/swex.appimage $silent"
|
||||
|
||||
# pass {{{ #
|
||||
|
||||
ps "pass"
|
||||
psc "pass -c"
|
||||
pse "pass edit"
|
||||
psi "pass insert -m"
|
||||
psg "pass generate -c"
|
||||
pss "pass show"
|
||||
|
||||
xc "xclip -selection clipboard"
|
||||
yh "echo 'kevin.mok@live.ca' | xclip -selection clipboard"
|
||||
yg "xclip -selection clipboard ~/.password-store/social/gmail"
|
||||
yt "xclip -selection clipboard ~/.password-store/social/trapbot"
|
||||
yu "echo 'kevin.mok@mail.utoronto.ca' | xclip -selection clipboard"
|
||||
|
||||
# }}} pass #
|
||||
|
||||
# watson {{{ #
|
||||
|
||||
w "watson"
|
||||
wa "watson start"
|
||||
wae "watson start && watson edit"
|
||||
we "watson edit"
|
||||
wl "watson log --day"
|
||||
wla "watson log --all --tag="
|
||||
ww "watson log"
|
||||
# wlm "watson log --project coding --tag mfs"
|
||||
wr "watson report --day"
|
||||
wrw "watson report"
|
||||
wre "watson restart"
|
||||
wree "watson restart && watson edit"
|
||||
ws "watson status && watson stop"
|
||||
wse "watson stop && watson edit"
|
||||
wsc "watson cancel"
|
||||
wsl "watson stop && watson log --day"
|
||||
wt "watson status"
|
||||
|
||||
# }}} watson #
|
||||
|
||||
# }}} applications #
|
||||
|
||||
# git {{{ #
|
||||
gstr "git config credential.helper store"
|
||||
g "git"
|
||||
|
||||
# branch {{{ #
|
||||
|
||||
gb "git branch"
|
||||
gbd "git branch -D"
|
||||
gba "git branch --no-merged && echo '' && git branch --merged"
|
||||
gbu "git branch --no-merged"
|
||||
gbm "git branch --merged"
|
||||
|
||||
gmg "git merge"
|
||||
gmgt "git mergetool"
|
||||
|
||||
# }}} branch #
|
||||
|
||||
gr "git remote -v"
|
||||
gro "git remote show origin"
|
||||
|
||||
# add/remove {{{ #
|
||||
|
||||
ga "git add -A && git status -u"
|
||||
gac "git add -A && git commit -S"
|
||||
gaf "git add -f"
|
||||
# unsigned commt
|
||||
gacu "git add -A && git commit"
|
||||
|
||||
grm "git rm"
|
||||
grmf "git rm -f"
|
||||
grmc "git rm --cached"
|
||||
grmfc "git rm -f --cached"
|
||||
grmor "rm (fd -e orig --no-ignore -H)"
|
||||
|
||||
# }}} add #
|
||||
|
||||
# diff/log {{{ #
|
||||
gd "git difftool -w --tool=vimdiff"
|
||||
gdc "git difftool -w --cached --tool=vimdiff"
|
||||
gdl "git diff -w"
|
||||
gdlc "git diff --cached -w"
|
||||
gdh "git diff --cached -w HEAD~1"
|
||||
gds "git diff --stat"
|
||||
gl "git log"
|
||||
gsl "git shortlog"
|
||||
# }}} diff/log #
|
||||
|
||||
# update {{{ #
|
||||
|
||||
gs "git status -u"
|
||||
gchom "git checkout master"
|
||||
gchnw "git checkout -b wip"
|
||||
gchw "git checkout wip"
|
||||
gheadm1 "git reset --hard HEAD~1"
|
||||
# show files in git repo
|
||||
# gls "git ls-tree -r HEAD --name-only"
|
||||
gls "git ls-tree HEAD --name-only"
|
||||
|
||||
# push {{{ #
|
||||
gst "git stash"
|
||||
gstl "git stash list"
|
||||
gstp "git stash pop"
|
||||
|
||||
gc "git commit -S"
|
||||
gcu "git commit"
|
||||
gca "git add -A && git commit --amend --no-edit -S"
|
||||
gcam "git add -A && git commit --amend -S"
|
||||
# gcamp "git add -A && git commit --amend --no-edit -S && gpsf"
|
||||
|
||||
psgi "git add -A && git commit -m 'Update' -S && git push"
|
||||
gps "git push"
|
||||
gpsi "git config credential.helper store && git push"
|
||||
# gpsn "git push --set-upstream origin master"
|
||||
gpsn "eval (git push 2>&1 | tail -n 2)"
|
||||
gpsf "git push --force"
|
||||
gclear "git stash clear"
|
||||
|
||||
gpl "git pull --rebase"
|
||||
grba "git rebase --abort"
|
||||
grbc "git rebase --continue"
|
||||
|
||||
# }}} push #
|
||||
|
||||
# }}} update #
|
||||
|
||||
crm "mrk README.md"
|
||||
|
||||
gcho "git checkout"
|
||||
gchon "git checkout -b"
|
||||
gf "git fetch origin"
|
||||
|
||||
gcln "git clone"
|
||||
gchp "git cherry-pick"
|
||||
gchpc "git cherry-pick --continue"
|
||||
|
||||
# assume file unchanged
|
||||
gunc "git update-index --assume-unchanged"
|
||||
|
||||
# }}} git #
|
||||
|
||||
# coding projs {{{ #
|
||||
# coding_dir="~/coding"
|
||||
|
||||
rgt "rg TODO"
|
||||
|
||||
# trapbot {{{ #
|
||||
# tb "$cd_coding_dir/trapbot"
|
||||
# vtb "$cd_coding_dir/trapbot && ni scan_reddit.py"
|
||||
# ptb "python scan_reddit.py"
|
||||
# rtb "$cd_coding_dir/trapbot && python scan_reddit.py"
|
||||
# }}} trapbot #
|
||||
|
||||
# spotify-lib-vis {{{ #
|
||||
|
||||
# spv_dir="$coding_dir""/spotify-lib-vis"
|
||||
# svl "f $spv_dir/src/login"
|
||||
# sva "f $spv_dir/src/api"
|
||||
# svg "f $spv_dir/src/graphs"
|
||||
# svscs "f $spv_dir/src/static/scss"
|
||||
# svcss "f $spv_dir/src/spotifyvis/static/scss"
|
||||
# start spv server from dir
|
||||
# pg "sudo systemctl start postgresql.service && systemctl status postgresql.service"
|
||||
ssv "bash ../bin/activate && python manage.py runserver"
|
||||
# start spv server outside dir
|
||||
# open spv db in psql
|
||||
spvdb "psql -d spotifyvis -U django"
|
||||
mig "python manage.py makemigrations && python manage.py migrate --run-syncdb && ssv"
|
||||
cldb "python manage.py flush --no-input && ssv"
|
||||
# django shell
|
||||
djs "python manage.py shell"
|
||||
# update pip
|
||||
upip "pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U"
|
||||
# update pip req's.
|
||||
ureq "pip freeze > requirements.txt"
|
||||
|
||||
# show last history scan
|
||||
hlg "cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
|
||||
# scan history
|
||||
# hs "$spv_dir/src/update-history.sh && cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
|
||||
# scan cron log for hs cmd
|
||||
crnl "grep \"(kevin) CMD\" /var/log/syslog | tail -n 1 && hlg"
|
||||
# removes all but newest file
|
||||
# rmol "ls -t | tail -n +2 | xargs rm -- && l"
|
||||
|
||||
snw "spotify-now -i '%artist - %title'"
|
||||
|
||||
# }}} spotify-lib-vis #
|
||||
|
||||
shc "shellcheck"
|
||||
pdl "pdflatex"
|
||||
tcl "tex-clean"
|
||||
|
||||
# mfs
|
||||
mfs "nvim /home/kevin/coding/best-mf-site-personal/index.html"
|
||||
ht "python3 -m http.server"
|
||||
# j "jekyll"
|
||||
# js "jekyll serve"
|
||||
h "hugo"
|
||||
he "hugo serve -D --disableFastRender"
|
||||
|
||||
ss "ssh kevin@192.168.0.100"
|
||||
ssb "ssh-bandit"
|
||||
|
||||
rt "python ~/coding/rt-scraper/rt-scraper.py"
|
||||
|
||||
# }}} coding projs #
|
||||
|
||||
# school {{{ #
|
||||
|
||||
wlf "watson log --all --tag=final"
|
||||
wrf "watson report --all --tag=final"
|
||||
|
||||
# 369 {{{ #
|
||||
|
||||
ssc "ssh mokkar@teach.cs.utoronto.ca"
|
||||
|
||||
ma "printf '\033c' && bear make"
|
||||
mc "bear make clean"
|
||||
mca "bear make clean && printf '\033c' && bear make"
|
||||
|
||||
rmc "rm compile_commands.json"
|
||||
rms "rm swapfile.*"
|
||||
wl6 "watson log --all --project=369 --tag=a4"
|
||||
wr6 "watson report --all --project=369 --tag=a4"
|
||||
|
||||
um6 "sudo umount /mnt/369-a4"
|
||||
|
||||
# a2 {{{ #
|
||||
|
||||
mcr "bear make clean && printf '\033c' && bear make && ./carsim light 1 20"
|
||||
# mr "printf '\033c' && make && ./carsim stop 10 20"
|
||||
# mr "printf '\033c' && bear make && ./carsim light 1 20"
|
||||
# "valgrind --tool=helgrind ./carsim stop 10 50 > helgrind.txt 2>&1 && valgrind --tool=helgrind ./carsim light 10 50 >> helgrind.txt 2>&1"
|
||||
# lk "valgrind --leak-check=yes ./carsim stop 10 20"
|
||||
lk "valgrind --leak-check=yes ./carsim light 1 1"
|
||||
# hl "valgrind --tool=helgrind ./carsim stop 10 20"
|
||||
hl "valgrind --tool=helgrind ./carsim light 10 20"
|
||||
|
||||
# }}} a2 #
|
||||
|
||||
# a1
|
||||
# sa "ssh k@192.168.0.17"
|
||||
# cpi "scp interceptor.c kevin@192.168.0.17:/home/kevin/a1"
|
||||
# cpti "gcc -m32 -o test_intercept test_intercept.c && scp test_intercept k@192.168.0.17:/home/k/a1"
|
||||
|
||||
# }}} 369 #
|
||||
|
||||
# 309{{{
|
||||
|
||||
wl0 "watson log --all --project=309 --tag=phase2"
|
||||
wr0 "watson report --all --project=309 --tag=phase2"
|
||||
|
||||
# apps
|
||||
nd "node"
|
||||
ndm "nodemon"
|
||||
knd "killall node"
|
||||
mg "mongo"
|
||||
|
||||
# server
|
||||
0ht "cd ~/school/309-proj && python3 -m http.server"
|
||||
mgd "mongod --dbpath mongo-data"
|
||||
# nds "killall node && nodemon server.js"
|
||||
nds "nodemon server.js"
|
||||
|
||||
# heroku
|
||||
hr "heroku"
|
||||
hrs "heroku local web"
|
||||
hrt "heroku ps"
|
||||
hrl "heroku logs --dyno web -n 1500 | rg up | awk '{ system(\"date -d \" \$1); \$1 = \"\"; print \$0 }' | paste -s -d' \n'"
|
||||
gpsh "git push heroku"
|
||||
|
||||
0c "node collections.js"
|
||||
|
||||
# }}}
|
||||
|
||||
# }}} school #
|
||||
@@ -1,424 +0,0 @@
|
||||
# system {{{ #
|
||||
|
||||
# # vim mode {{{ #
|
||||
# bindkey -v
|
||||
# function zle-line-init zle-keymap-select {
|
||||
# VIM_PROMPT="%{$fg_bold[yellow]%} [% NORMAL]% %{$reset_color%}"
|
||||
# RPS1="${${KEYMAP/vicmd/$VIM_PROMPT}/(main|viins)/} $EPS1"
|
||||
# zle reset-prompt
|
||||
# }
|
||||
# zle -N zle-line-init
|
||||
# zle -N zle-keymap-select
|
||||
# export KEYTIMEOUT=1
|
||||
# # }}} vim mode #
|
||||
|
||||
# command line related {{{ #
|
||||
# search history
|
||||
bindkey '\e[A' history-beginning-search-backward
|
||||
bindkey '\e[B' history-beginning-search-forward
|
||||
|
||||
alias cs='printf "\033c"'
|
||||
alias hst="history"
|
||||
alias nf="cs && neofetch | lolcat"
|
||||
# nf
|
||||
alias ru="xrdb ~/.Xresources"
|
||||
# list file sizes in megabytes with depth 1
|
||||
alias dum="sudo du -d 1 -B M"
|
||||
|
||||
alias vgb="sni /etc/default/grub"
|
||||
alias mkgb="sudo grub-mkconfig -o /boot/grub/grub.cfg"
|
||||
|
||||
function cld() { colordiff -y --suppress-common-lines $1 $2 ; }
|
||||
alias grep='grep --color=auto'
|
||||
function gpdf() {
|
||||
pdfgrep -n -e $1 $2
|
||||
}
|
||||
# for finding files by name
|
||||
export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -g ""'
|
||||
# find text inside files
|
||||
function rg() { grep -nr $1 ; }
|
||||
function cpd() { cp -avr $1 $2 ; }
|
||||
alias pk="pkill -f"
|
||||
|
||||
# extract tar archive
|
||||
function utar() { tar -xzvf $1 && rm $1; }
|
||||
function rzip() { unzip $1 && rm $1; }
|
||||
function lzip() { unzip -l $1 | less; }
|
||||
|
||||
alias mkpk="makepkg -sri"
|
||||
alias mkex="chmod 777"
|
||||
alias ctl="systemctl"
|
||||
alias ctle="systemctl enable"
|
||||
alias ctld="systemctl disable"
|
||||
alias ctls="systemctl start"
|
||||
|
||||
alias wm="sudo wifi-menu"
|
||||
|
||||
# mounting {{{ #
|
||||
|
||||
alias udm="udisksctl mount -b"
|
||||
alias udmb="udisksctl mount -b /dev/sdc2"
|
||||
alias udu="udisksctl unmount -b"
|
||||
alias udub="udisksctl unmount -b /dev/sdc2"
|
||||
|
||||
# }}} mounting #
|
||||
|
||||
alias tc="touch"
|
||||
shrm() {
|
||||
for file in "$@"; do
|
||||
shred "$file" && rm "$file"
|
||||
done
|
||||
}
|
||||
|
||||
# }}} command line related #
|
||||
|
||||
# directory-related {{{ #
|
||||
alias l='ls -a'
|
||||
alias ll='ls -alFh'
|
||||
alias smv="sudo mv"
|
||||
alias f="cd"
|
||||
alias fz="fzf"
|
||||
alias fnd="find . -type f -name"
|
||||
f `cat /home/kevin/.oh-my-zsh/cache/last-working-dir`
|
||||
# alias w="cd $(cat /home/kevin/.oh-my-zsh/cache/last-working-dir)"
|
||||
|
||||
alias rmr="rm -rf"
|
||||
alias mdp="mkdir -p"
|
||||
alias rsy="rsync -Pr"
|
||||
|
||||
alias "f."="f .."
|
||||
alias "f.."="f ..."
|
||||
|
||||
function mvd() { mv $1 ~/Downloads ; }
|
||||
alias lhd="sudo fdisk -l"
|
||||
alias ds="df -h | tee >(head -n 1) >(grep sd) >/dev/null"
|
||||
alias chownw="sudo chown -R kevin:wheel"
|
||||
alias chwnm="sudo chown -R kevin:wheel /run/media/kevin"
|
||||
alias nbu="f /run/media/kevin/pc-backup/backups/nzxt && ll | grep gz"
|
||||
|
||||
# }}} directory-related #
|
||||
|
||||
# power options {{{ #
|
||||
|
||||
alias s="systemctl suspend"
|
||||
alias sd="sudo shutdown 0"
|
||||
alias reb="sudo shutdown -r 0"
|
||||
alias lo="i3-msg exit"
|
||||
alias x="xmodmap ~/.Xmodmap && xset r rate 200 60"
|
||||
|
||||
# }}} power options #
|
||||
|
||||
# rotate monitor {{{ #
|
||||
function rt() {
|
||||
output="HDMI-0"
|
||||
if [ "$1" = "s" ]
|
||||
# if [ "${1:0:1}" = "s" ]
|
||||
then
|
||||
output="DVI-I-1"
|
||||
fi
|
||||
|
||||
dir="normal"
|
||||
if [ "$2" = "r" ]
|
||||
# if [ "${1:1:2}" = "r" ]
|
||||
then
|
||||
dir="right"
|
||||
fi
|
||||
if [ "$2" = "l" ]
|
||||
then
|
||||
dir="left"
|
||||
fi
|
||||
|
||||
# echo "xrandr --output \"$output\" --rotate \"$dir\""
|
||||
xrandr --output "$output" --rotate "$dir"
|
||||
}
|
||||
# }}} rotate monitor #
|
||||
|
||||
# sound
|
||||
alias vlm="alsamixer -c 0"
|
||||
alias vlh="alsamixer -c 2"
|
||||
|
||||
# apt
|
||||
# function apti() { sudo apt install $1 ; }
|
||||
# function aptr() { sudo apt remove $1 ; }
|
||||
# alias aptu="sudo apt upgrade"
|
||||
alias pc="sudo pacman -S"
|
||||
alias pcr="sudo pacman -Rs"
|
||||
alias pcu="sudo pacman -Sy"
|
||||
alias xpc="pacman -Qqe > ~/linux-config/txt/nzxt-pkgs.txt"
|
||||
# alias tri="trizen -S --noconfirm"
|
||||
alias tri="trizen -S"
|
||||
|
||||
# internet
|
||||
alias pg="ping -c 3 8.8.8.8"
|
||||
alias dh="sudo dhcpcd"
|
||||
alias rdh="sudo killall dhcpcd && sudo dhcpcd"
|
||||
|
||||
alias id="identify"
|
||||
|
||||
# }}} system #
|
||||
|
||||
# config files {{{ #
|
||||
function gz() { grep $1 ~/linux-config/aliases/zsh_aliases ; }
|
||||
alias rz="source ~/linux-config/aliases/zsh_aliases"
|
||||
alias lca="f ~/linux-config/aliases"
|
||||
|
||||
# i3
|
||||
alias i3b="f ~/i3blocks"
|
||||
alias pipes="pipes.sh -t 3"
|
||||
|
||||
# UltiSnips {{{ #
|
||||
urnp_dir="~/.vim/plugged/vim-snippets/UltiSnips"
|
||||
function vsnp() { nvim ~/.vim/plugged/vim-snippets/UltiSnips/"$1".snippets ; }
|
||||
# }}} #
|
||||
|
||||
# }}} config files #
|
||||
|
||||
# applications {{{ #
|
||||
silent="> /dev/null 2>&1& "
|
||||
|
||||
alias h="htop -s PERCENT_MEM"
|
||||
alias hc="htop -s PERCENT_CPU"
|
||||
alias r="ranger"
|
||||
alias mr="man ranger"
|
||||
alias clc="cloc ."
|
||||
function z() { nohup zathura $1 > /dev/null 2>&1& ; }
|
||||
function ev() { nohup evince $1 > /dev/null 2>&1& ; }
|
||||
function chr() { google-chrome $1 ; }
|
||||
alias n="nvim"
|
||||
alias sni="sudo nvim"
|
||||
alias fh="feh"
|
||||
alias sx="sxiv"
|
||||
function mrk() { pandoc -o ${1%.*}.html $1 ; }
|
||||
alias wp="grep wallpaper ~/.cache/wal/colors.sh"
|
||||
|
||||
# auto-clicker {{{ #
|
||||
|
||||
function auc() { xdotool click --repeat 1000000 --delay $1 1 ; }
|
||||
# alias auc1="xdotool click --repeat 1000000 --delay 1 1"
|
||||
# alias auc3="xdotool click --repeat 1000000 --delay 300 1"
|
||||
# alias auc5="xdotool click --repeat 1000000 --delay 500 1"
|
||||
# alias kauc="pkill -f xdotool"
|
||||
|
||||
# }}} auto-clicker #
|
||||
|
||||
# alias rsl="java -jar ~/Downloads/RuneLite.jar"
|
||||
alias swex="sudo nohup ~/Downloads/swex.appimage $silent"
|
||||
|
||||
alias vbn="cvlc --loop --alsa-gain 1 ~/Music/brown-noise.mp3"
|
||||
alias cv="cava"
|
||||
alias rmsw="rm .sw*"
|
||||
|
||||
function rs(){ redshift -P -O $(echo "scale=2;$1*1000" | bc) ; }
|
||||
alias rx="redshift -x"
|
||||
|
||||
alias gpe="gpg --encrypt --recipient"
|
||||
alias gpd="gpg --decrypt"
|
||||
|
||||
# pass {{{ #
|
||||
|
||||
alias ps="pass"
|
||||
alias psc="pass -c"
|
||||
alias pse="pass edit"
|
||||
alias psi="pass insert -m"
|
||||
alias psg="pass generate -c"
|
||||
|
||||
alias xclip="xclip -selection clipboard"
|
||||
alias yh="echo 'kevin.mok@live.ca' | xclip -selection clipboard"
|
||||
alias yg="xclip -selection clipboard ~/.password-store/social/gmail"
|
||||
alias yt="xclip -selection clipboard ~/.password-store/social/trapbot"
|
||||
alias yu="echo 'kevin.mok@mail.utoronto.ca' | xclip -selection clipboard"
|
||||
|
||||
# }}} pass #
|
||||
|
||||
function grpy() { grep $1 *.py ; }
|
||||
alias p3="python3"
|
||||
alias py="python"
|
||||
|
||||
# watson
|
||||
alias wt="watson"
|
||||
alias wta="watson start"
|
||||
alias wte="watson edit"
|
||||
alias wtl="watson log"
|
||||
alias wts="watson stop"
|
||||
alias wtt="watson status"
|
||||
|
||||
# }}} applications #
|
||||
|
||||
# git {{{ #
|
||||
# aliases {{{
|
||||
alias gstr="git config credential.helper store"
|
||||
alias g="git"
|
||||
|
||||
# add {{{ #
|
||||
alias ga="git add -A . && gs"
|
||||
alias gac="git add -A . && git commit -S"
|
||||
alias gacu="git add -A . && git commit"
|
||||
# }}} add #
|
||||
|
||||
# diff/log {{{ #
|
||||
alias gd="git diff -w"
|
||||
function gde() { git diff --cached -- ':(exclude)'$1 ; }
|
||||
alias gdc="git diff --cached"
|
||||
alias gds="git diff --stat"
|
||||
alias gdt="git difftool --tool=vimdiff"
|
||||
alias gl="git log"
|
||||
alias gsl="git shortlog"
|
||||
# }}} diff/log #
|
||||
|
||||
# update {{{ #
|
||||
|
||||
alias gs="git status -u"
|
||||
alias gchom="git checkout master"
|
||||
alias gchnw="git checkout -b wip"
|
||||
alias gchw="git checkout wip"
|
||||
alias gheadm1="git reset --hard HEAD~1"
|
||||
alias gls="git ls-tree -r HEAD --name-only"
|
||||
|
||||
# push {{{ #
|
||||
alias gst="git stash"
|
||||
alias gstp="git stash pop"
|
||||
|
||||
alias gc="git commit -S"
|
||||
alias gcu="git commit"
|
||||
alias gcam="ga && git commit --amend --no-edit -S"
|
||||
alias gcamp="ga && git commit --amend --no-edit -S && gpsf"
|
||||
# todo: fix
|
||||
function gcm(){ echo git commit -m \""$1"\" ; }
|
||||
|
||||
function psgi() {
|
||||
git add .
|
||||
git commit -m '.' -S
|
||||
git push
|
||||
}
|
||||
alias gps="git push"
|
||||
alias gpsi="git push --set-upstream origin master"
|
||||
alias gpsf="git push --force"
|
||||
alias gclear="git stash clear"
|
||||
# }}} push #
|
||||
|
||||
# pull {{{ #
|
||||
alias gpl="git pull --rebase"
|
||||
alias grbc="git rebase --continue"
|
||||
# }}} pull #
|
||||
|
||||
# }}} update #
|
||||
|
||||
# edit {{{ #
|
||||
alias vre="ni README.md"
|
||||
alias crm="mrk README.md"
|
||||
# }}} edit #
|
||||
|
||||
# aliases }}}
|
||||
|
||||
# functions {{{
|
||||
alias gcho="git checkout"
|
||||
alias gchon="git checkout -b"
|
||||
function gchof() { git checkout $1 $2 ; }
|
||||
|
||||
alias gcln="git clone"
|
||||
alias gchp="git cherry-pick"
|
||||
alias gchpc="git cherry-pick --continue"
|
||||
|
||||
# add multiple push repos
|
||||
function gremotes() {
|
||||
git remote set-url --add --push origin $1
|
||||
git remote set-url --add --push origin $2
|
||||
git remote -v
|
||||
}
|
||||
|
||||
# gmrgr: merge repos {{{ #
|
||||
function gmrgr() {
|
||||
# 1 = remote name, 2 = remote path
|
||||
git remote add $1 $2
|
||||
git fetch $1
|
||||
# whichever branch you want to merge
|
||||
git merge --allow-unrelated-histories $1/master
|
||||
git remote remove $1
|
||||
}
|
||||
# }}} merge repos #
|
||||
|
||||
# assume file unchanged
|
||||
alias gunc="git update-index --assume-unchanged"
|
||||
# delete branch locally and on server
|
||||
function grmb() { git push origin --delete $1 && git branch -D $1 ; }
|
||||
|
||||
# functions }}}
|
||||
|
||||
# }}} git #
|
||||
|
||||
# coding projs {{{ #
|
||||
coding_dir="~/coding"
|
||||
alias cdn="$cd_coding_dir"
|
||||
|
||||
alias gx="ni ~/Documents/csgo-config/autoexec.cfg"
|
||||
|
||||
# trapbot {{{ #
|
||||
alias tb="$cd_coding_dir/trapbot"
|
||||
alias vtb="$cd_coding_dir/trapbot && ni scan_reddit.py"
|
||||
alias ptb="python scan_reddit.py"
|
||||
alias rtb="$cd_coding_dir/trapbot && python scan_reddit.py"
|
||||
# }}} trapbot #
|
||||
|
||||
# spotify-lib-vis {{{ #
|
||||
|
||||
spv_dir="$coding_dir""/spotify-lib-vis"
|
||||
alias svl="f $spv_dir/src/login"
|
||||
alias sva="f $spv_dir/src/api"
|
||||
alias svg="f $spv_dir/src/graphs"
|
||||
alias svscs="f $spv_dir/src/static/scss"
|
||||
alias svcss="f $spv_dir/src/spotifyvis/static/scss"
|
||||
source /home/kevin/coding/spotify-lib-vis/src/api-keys.sh
|
||||
function ssv() {
|
||||
source ../bin/activate
|
||||
python manage.py runserver
|
||||
}
|
||||
alias sssv="sv && ssv"
|
||||
alias spvdb="psql -d spotifyvis -U django"
|
||||
function mig() {
|
||||
python manage.py makemigrations
|
||||
python manage.py migrate --run-syncdb
|
||||
ssv
|
||||
}
|
||||
alias cldb="python manage.py flush --no-input && ssv"
|
||||
alias djs="python manage.py shell"
|
||||
alias upip="pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U"
|
||||
alias ureq="pip freeze > requirements.txt"
|
||||
|
||||
# scan history
|
||||
alias hlg="cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
|
||||
alias crnl="grep \"(kevin) CMD\" /var/log/syslog | tail -n 1 && hlg"
|
||||
alias hs="$spv_dir/src/update-history.sh && hlg"
|
||||
# removes all but newest file
|
||||
# alias rmol="ls -t | tail -n +2 | xargs rm -- && l"
|
||||
|
||||
# }}} spotify-lib-vis #
|
||||
|
||||
# # Stardew Valley {{{
|
||||
# sdv_save_dir=~/Documents/sdv-save
|
||||
# alias sdv="f $sdv_save_dir"
|
||||
# alias smp="~/Downloads/sdv/smapi/install\ on\ Linux.sh"
|
||||
# # alias imc="sdv && source import-save.sh coop"
|
||||
# function ucf() { f ~/Documents/StardewMods/UncaughtFish ; }
|
||||
# function svmd() { f ~/.local/share/Steam/steamapps/common/Stardew\ Valley/Mods ; }
|
||||
# function svm() { mv $1 ~/.local/share/Steam/steamapps/common/Stardew\ Valley/Mods ; }
|
||||
# # }}}
|
||||
|
||||
alias sc="shellcheck"
|
||||
alias pdl="pdflatex"
|
||||
alias tcl="tex-clean"
|
||||
|
||||
alias mfs="nvim /home/kevin/coding/best-mf-site-personal/index.html"
|
||||
|
||||
# }}} coding projs #
|
||||
|
||||
# school {{{ #
|
||||
|
||||
# 369
|
||||
alias vm6="VBoxHeadless --startvm 369-a1"
|
||||
alias sa="ssh k@192.168.0.17"
|
||||
alias cpi="scp interceptor.c kevin@192.168.0.17:/home/kevin/a1"
|
||||
alias cpti="gcc -m32 -o test_intercept test_intercept.c && scp test_intercept k@192.168.0.17:/home/k/a1"
|
||||
alias ma="make"
|
||||
alias mc="make clean"
|
||||
|
||||
# }}} school #
|
||||
@@ -1,108 +0,0 @@
|
||||
alias "f."="f .."
|
||||
alias "f.."="f ..."
|
||||
|
||||
function cld() { colordiff -y --suppress-common-lines $1 $2 ; }
|
||||
function gpdf() {
|
||||
pdfgrep -n -e $1 $2
|
||||
}
|
||||
|
||||
function cpd() { cp -avr $1 $2 ; }
|
||||
|
||||
# extract tar archive
|
||||
function utar() { tar -xzvf $1 && rm $1; }
|
||||
function rzip() { unzip $1 && rm $1; }
|
||||
function lzip() { unzip -l $1 | less; }
|
||||
export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -g ""'
|
||||
shrm() {
|
||||
for file in "$@"; do
|
||||
shred "$file" && rm "$file"
|
||||
done
|
||||
}
|
||||
f `cat /home/kevin/.oh-my-zsh/cache/last-working-dir`
|
||||
function mvd() { mv $1 ~/Downloads ; }
|
||||
|
||||
# rewrite in dmenu if really need
|
||||
# rotate monitor {{{ #
|
||||
function rt() {
|
||||
output="HDMI-0"
|
||||
if [ "$1" = "s" ]
|
||||
# if [ "${1:0:1}" = "s" ]
|
||||
then
|
||||
output="DVI-I-1"
|
||||
fi
|
||||
|
||||
dir="normal"
|
||||
if [ "$2" = "r" ]
|
||||
# if [ "${1:1:2}" = "r" ]
|
||||
then
|
||||
dir="right"
|
||||
fi
|
||||
if [ "$2" = "l" ]
|
||||
then
|
||||
dir="left"
|
||||
fi
|
||||
|
||||
# echo "xrandr --output \"$output\" --rotate \"$dir\""
|
||||
xrandr --output "$output" --rotate "$dir"
|
||||
}
|
||||
# }}} rotate monitor #
|
||||
|
||||
function gz() { grep $1 ~/linux-config/aliases/zsh_aliases ; }
|
||||
function vsnp() { nvim ~/.vim/plugged/vim-snippets/UltiSnips/"$1".snippets ; }
|
||||
silent="> /dev/null 2>&1& "
|
||||
function z() { nohup zathura $1 > /dev/null 2>&1& ; }
|
||||
function ev() { nohup evince $1 > /dev/null 2>&1& ; }
|
||||
function mrk() { pandoc -o ${1%.*}.html $1 ; }
|
||||
|
||||
# auto-clicker {{{ #
|
||||
|
||||
function auc() { xdotool click --repeat 1000000 --delay $1 1 ; }
|
||||
# auc1 "xdotool click --repeat 1000000 --delay 1 1"
|
||||
# auc3 "xdotool click --repeat 1000000 --delay 300 1"
|
||||
# auc5 "xdotool click --repeat 1000000 --delay 500 1"
|
||||
# kauc "pkill -f xdotool"
|
||||
|
||||
# }}} auto-clicker #
|
||||
|
||||
function rs(){ redshift -P -O $(echo "scale=2;$1*1000" | bc) ; }
|
||||
function grpy() { grep $1 *.py ; }
|
||||
|
||||
# git {{{ #
|
||||
|
||||
function gde() { git diff --cached -- ':(exclude)'$1 ; }
|
||||
# todo: fix
|
||||
function gcm(){ echo git commit -m \""$1"\" ; }
|
||||
function gchof() { git checkout $1 $2 ; }
|
||||
|
||||
# add multiple push repos
|
||||
function gremotes() {
|
||||
git remote set-url --add --push origin $1
|
||||
git remote set-url --add --push origin $2
|
||||
git remote -v
|
||||
}
|
||||
|
||||
# merge repos
|
||||
function gmrgr() {
|
||||
# 1 = remote name, 2 = remote path
|
||||
git remote add $1 $2
|
||||
git fetch $1
|
||||
# whichever branch you want to merge
|
||||
git merge --allow-unrelated-histories $1/master
|
||||
git remote remove $1
|
||||
}
|
||||
# delete branch locally and on server
|
||||
function grmb() { git push origin --delete $1 && git branch -D $1 ; }
|
||||
|
||||
# }}} git #
|
||||
|
||||
# # Stardew Valley {{{
|
||||
# sdv_save_dir=~/Documents/sdv-save
|
||||
# sdv "f $sdv_save_dir"
|
||||
# smp "~/Downloads/sdv/smapi/install\ on\ Linux.sh"
|
||||
# # imc "sdv && source import-save.sh coop"
|
||||
# function ucf() { f ~/Documents/StardewMods/UncaughtFish ; }
|
||||
# function svmd() { f ~/.local/share/Steam/steamapps/common/Stardew\ Valley/Mods ; }
|
||||
# function svm() { mv $1 ~/.local/share/Steam/steamapps/common/Stardew\ Valley/Mods ; }
|
||||
# # }}}
|
||||
|
||||
source /home/kevin/coding/spotify-lib-vis/src/api-keys.sh
|
||||
Reference in New Issue
Block a user