notes/aliases
2022-06-29 02:55:30 -07:00

323 lines
14 KiB
Text

#Custom Aliases
alias .="cd"
alias more="less"
alias grep='grep --colour=auto'
alias egrep='egrep --colour=auto'
alias fgrep='fgrep --colour=auto'
alias cp="cp -i"
alias df='df -h'
alias free='free -m'
alias dmesg="doas dmesg -H"
alias blkid="doas blkid"
alias kernel="uname -r"
alias docs="cd ~/Documents"
alias down="cd ~/Downloads"
alias pics="cd ~/Pictures"
alias music="cd ~/Music"
alias vids="cd ~/Videos"
alias games="cd ~/.local/share/Steam/steamapps/common"
alias notes="cd ~/Documents/notes"
alias scripts="cd ~/scripts"
alias books="cd ~/Documents/books"
alias config="cd ~/.config"
alias cache="cd ~/.cache"
alias svs="cd /etc/runit/sv"
alias Code="cd ~/Documents/Code"
alias cplus="cd ~/Documents/Code/cpp"
alias js="cd ~/Documents/Code/javascript"
alias py="cd ~/Documents/Code/python"
alias wtuts="cd ~/Documents/Code/web_tutorials"
alias btuts="cd ~/Documents/Code/book_tutorials"
alias fonts="fc-list"
alias locate="locate -i"
alias bat="bat --theme Nord"
alias batman="man bat"
alias ls="exa --icons"
alias li="exa -1 --icons"
alias ll="exa -lih --icons"
alias {lsdir,lsd}="ls -t -1" # list only the directories
alias lshw="doas lshw -short | less" # list hardware
alias {hw,hwinfo}="hwinfo | less" # extensive info on hardware devices
alias dmid="doas dmidecode | less"
alias of="onefetch -o yaml | yq -C"
alias mkdir='mkdir -pv'
alias {ex,esc}="exit"
alias {his,hist}="history"
alias mnt="doas mount /dev/sda1 /mnt/media/usb-drive"
alias umnt="doas umount /mnt/media/usb-drive"
alias imnt="ifuse /home/brian/iphone"
alias iumnt="doas umount /home/brian/iphone"
alias kmnt="doas mount /dev/sda /mnt/media/kobo"
alias kumnt="doas umount /dev/sda /mnt/media/kobo"
alias rm="newrm -vi"
alias cal="newcal"
alias mv="mv -v"
alias ln="ln -i"
alias {doasedit,sudoedit}="doas rnano"
alias clean_cache="doas paccache -r && doas rm -r /home/brian/.cache/*"
alias shred="doas shred -uzv" # shreds the file and overwrites it with 1s and 0s, shows progress
alias indelible="doas chattr +i" # makes a file impossible to delete (except with sudo)
alias cdiff="colordiff"
alias kfonts="kitty +list-fonts"
alias {kdiff,kitten,kd}="kitty +kitten diff"
alias rg="rg -i --colors 'match:fg:blue' --colors 'line:fg:blue'"
alias fzfi="rg --files --hidden --follow --no-ignore-vcs -g '!{node_modules,.git}' | fzf"
alias bluepill="neo-matrix --bold=2 -D --color=cyan --density=0.75 --charset=katakana --speed=12 --fullwidth --screensaver"
# alias btop="kitty -o font_size=12 -o background_opacity=0.50 -e btop; fullscreen enable"
alias tshift='doas timeshift --delete && notify-send "Previous Backup Deleted!" && doas timeshift --create && notify-send "New Backup Created!"'
alias btop="bst -e btop"
alias {librewolf,firefox}="librewolf"
alias tor-browser="tor-browser &"
alias chromium="chromium --incognito --disable-search-engine-collection --fingerprinting-canvas-image-data-noise --fingerpriting-canvas-measuretext-noise --fingerprinting-client-rects-noise --popups-to-tabs &"
alias gimp="gimp --no-splash"
alias krita="krita --nosplash"
alias toonz="opentoonz"
alias {sq,sql,sqlite}="sqlcipher"
# alias view="kitty +kitten icat"
alias view="sxiv"
alias viewer="feh -F -Z -x"
alias mupdf='mupdf -r 204'
alias dkpdf='mupdf -I -r 204'
alias {json,jscrl,jsoncurl,jcrl}="jscurl"
alias amd="article_md"
alias kevents="xev -event keyboard"
alias sk="screenkey"
alias word="wordgrinder"
alias spreadsheet="sc"
alias pvctrl="pavucontrol"
alias open="xdg-open"
alias nc="nc -v"
alias dump="doas tcpdump"
alias {mydump,medump,mdump,bdump}="doas tcpdump -v -i wlan0"
alias route="traceroute"
alias listen="ss -a -t -p"
alias {pdf2,pdf2txt}="pdftotext"
alias tree="tree -ad -L 3 --prune -C"
alias {nv,nvi}="nvim"
alias {cproj,mproj,myproj}="cd '$cproj'"
alias mon="nodemon"
alias localhost="librewolf localhost:3000 &"
alias {mi,mic}="micro"
alias {mysql,maria,mdb}="mariadb"
alias rsm="doas rsm"
alias updatedb="doas updatedb"
alias iftop-w="doas iftop -i wlan0 -P"
alias wmon="wavemon"
alias {speedtest,spdtst}="speed-test --verbose --json | jq"
# usage p0f -i wlan0
alias p0f="doas p0f"
alias vnstat-w="vnstat -i wlan0 --json | jq"
alias {wi,ssid}="doas iw wlan0 scan | grep SSID"
alias wifi-list="connmanctl services"
alias wifi-scan="connmanctl scan wifi"
alias wifi-connect="connmanctl connect wifi_34cff6c9b922_44495a5a_managed_psk"
alias wifi-disconnect="connmanctl disconnect wifi_34cff6c9b922_44495a5a_managed_psk"
alias wifi-up="doas ifconfig wlan0 up"
alias wifi-down="doas ifconfig wlan0 down"
alias letitsnow="doas docker start snowflake-proxy"
alias snowfall="doas docker stop snowflake-proxy"
alias snowlogs="doas docker logs -f snowflake-proxy"
alias git-a="git add"
alias git-c="git commit -m"
alias git-p="git push"
alias git-s="git status"
alias git-ss="git status short"
# for use with notes directory only
alias git-pn="git push origin-ssh && git push codeberg"
alias git-l="git log"
alias gitmojis="bat $HOME/Documents/notes/gitmoji.txt"
alias {lsc,lscommits}="tig"
alias lxapp="lxappearance"
alias hd="ncdu"
alias {xsel,catx}="xclip -sel clip" # useful with < or | redirection operators
alias catp="xclip -out -selection clipboard; echo"
alias mouse="mousepad"
alias xclear="echo '' | xclip && xclip -selection clipboard /dev/null"
alias diff="diff -wy"
alias exifread="exiftool"
alias exifrm="exiftool -all="
alias {html,html_pp}="hxnormalize -e"
# stock tickers
alias ticker="ticker -w SPY,QQQ,DIA,IWM,VIX"
alias {mop,market,stonks,stocks}="cd ~/aur_packages/mop && go run ./cmd/mop/main.go && cd"
alias {reddit,rd}="torsocks tuir"
alias {sub,subreddit,subrd}="torsocks tuir -s"
alias qwiki="torsocks wik -i"
alias tldr="torsocks tldr"
alias cheatsheet="cheat"
alias stallman="vrms"
alias {trans,translate}="gtktranslate"
alias mpva='mpv "${1}" --no-video'
alias mmpv='mpv --fs --panscan=1.0'
alias {muse,musik,cmu}="cmus"
alias {hp,headphones}="pactl set-default-sink alsa_output.usb-FIIO_FiiO_USB_DAC-E10-01.analog-stereo"
alias {sp,speakers}="pactl set-default-sink alsa_output.pci-0000_0a_00.4.analog-stereo"
alias dspeakers="pactl set-default-sink alsa_output.pci-0000_08_00.1.hdmi-stereo-extra1"
alias pulse="pamixer --set-volume"
alias {mu,mt,mute}="pamixer -t"
# laptop only currently, records video/audio, simply name filename .mp4 after command:
alias r_vid="ffmpeg -f v4l2 -framerate 24 -video_size 640x480 -i /dev/video0 -itsoffset 00:00:01.0 -f alsa -i default -c:v libx264 -preset ultrafast -c:a aac"
alias ytube="ytfzf -l --features=subtitles"
alias {yti,ytinfo}="ytfzf -I L"
alias {ytd,ytdownload}="ytfzf -d"
alias {odysee,lbry}="ytfzf -c O --features=subtitles"
alias {ptube,peertube}="ytfzf -c P --features=subtitles"
alias yt-listen='mpv "${1}" --no-video'
alias ytdl="yt-dlp -f mp4"
alias ytdl-a="yt-dlp -x --audio-format mp3"
alias thinkorswim="cd /home/brian/thinkorswim && java -jar launcher.jar && cd"
alias {cl,cls}="clear"
alias shutdown="shutdown.sh"
alias reboot="reboot.sh"
alias curltime="curl -w \"@$HOME/Documents/notes/curl-format.txt\" -o /dev/null -s"
alias inxi-w="inxi --weather-location 90004"
alias forecast="curl -s 'http://wttr.in/losangeles'"
alias pf="pfetch"
alias ipaddr="curl ifconfig.me ; echo ''"
alias hwclock="doas hwclock"
alias killport="fuser -k"
alias npm_upgrade="doas npm install --location=global npm@latest"
alias npm_list="npm list -g --depth=0"
alias pip_upgrade="python -m pip install --upgrade pip"
alias nb="newsboat"
alias slink="streamlink"
alias scrot="scrot --count --delay"
alias sudoku="sku"
# pip list and pip freeze command list pip packages
#Particularly useful commands more to remember than to use as alias:
alias optimalbufsize= 'stat -c "%o"' # followed by filename will give you the optimal read/write BUFSIZE for a file
alias {rcrm,rrm}="doas xargs -d\\n rm -r -v" # when piped after locate or find command, recursively removes outputted files
alias athena="athena-jot"
alias view-in-tty="fim"
alias snarfsnarf="snarf"
alias shchk="shellcheck"
# get top process eating memory
alias psmem="ps auxf | sort -nr -k 4 | head -5"
# get top process eating cpu
alias pscpu="ps auxf | sort -nr -k 3 | head -5"
# tmux session aliases
alias {bmux,mymux,memux,mmux}="tmux new-session \; send-keys 'nvim' C-m\; split-window -v -p 3\; split-window -h -p 50\; select-pane -t 0\;"
alias tls="tmux ls"
alias ta="tmux a -t"
alias tkill="tmux kill-ses -t"
# programming specific aliases
alias cc="cc -Wall -Werror -Wextra"
alias cprogrammingtags="ctags"
alias vgrind="valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes -s"
# game shortcuts
alias {cbpunk,cyberpunk}="steam steam://rungameid/1091500 &"
alias {twd,thewalkingdead}="steam steam://rungameid/1449690 &"
alias {cbmods,cybermods}="cd ~/.local/share/Steam/steamapps/common/Cyberpunk\ 2077/archive/pc/mod"
# docker specific Aliases
alias docker="doas docker"
alias docker-ls="doas docker container ls -a"
# bookmarks
alias codeberg="librewolf https://codeberg.org/ &"
alias sqlsc="links https://sqlservercentral.com"
alias {gp,gopherpedia}="lynx gopher://gopherpedia.com:70"
alias gopher="lynx https://gopher.floodgap.com/gopher/gw.lite"
alias {ddg,duckduckgo}="links https://duckduckgo.com/lite"
alias bangs="links https://duckduckgo.com/bang_lite.html"
alias {cdread,cafedread}="links https://cafedread.com"
alias wikipedia="links https://wikipedia.org"
alias hackernews="links https://news.ycombinator.com/"
alias apnews="links https://apnews.com"
alias sheldonbrown="links https://sheldonbrown.com"
# Onion Sites
alias torch="links xmh57jrknzkhv6y3ls3ubitzfqnkrwxhopf5aygthi7d6rplyvk3noyd.onion/cgi-bin/omega/omega"
alias {ddgt,duckducktor}="links https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/"
alias searx="links http://3afisqjw2rxm6z7mmstyt5rx75qfqrgxnkzftknbp2vhipr2nrmrjdyd.onion/"
alias {hwiki,hiddenwiki}="links http://zqktlwiuavvvqqt4ybvgvi7tyo4hjl5xgfuvpdf6otjiycgwqbym2qad.onion/wiki/"
alias {darknet,darknetlive}="links http://darkzzx4avcsuofgfez5zq75cqc4mprjvfqywo45dfcaxrwqg6qrlfid.onion/"
alias ttaxi="links http://tortaxi7axhn2fv4j475a6blv7vwjtpieokolfnojwvkhsnj7sgctkqd.onion/"
alias library="links http://libraryfyuybp7oyidyya3ah5xvwgyx6weauoini7zyz555litmmumad.onion/"
alias ahmia="links http://juhanurmihxlp77nkq76byazcldy2hlmovfu2epvl5ankdibsot4csyd.onion/"
alias darkside="links http://darksid3f3ggicny772rvdmrcgfbtixsyjpdgm6unh5qci6r24ukg4qd.onion/"
alias breakbad="links http://bbzzzsvqcrqtki6umym6itiixfhni37ybtt7mkbjyxn2pgllzxf2qgyd.onion/"
alias comix="links http://nv3x2jozywh63fkohn5mwp2d73vasusjixn3im3ueof52fmbjsigw6ad.onion"
# Programming Resources
# Algorithms and Data Structures
alias leetcode="librewolf leetcode.com &"
alias techiedelight="librewolf https://www.techiedelight.com/ &"
alias algoexpert="librewolf https://www.algoexpert.io/ &"
#college courses (UNIX nad SysAdmin) from stevens university:
alias netmeister="librewolf https://stevens.netmeister.org &"
alias buildyourown="librewolf https://github.com/codecrafters-io/build-your-own-x &"
alias {tomprestonwerner,tpw}="links https://tom.preston-werner.com"
alias unixsheikh="links https://unixsheikh.com"
# C Programming
alias calgos="librewolf https://www.edureka.co/blog/sorting-algorithms-in-c/ &"
alias cprogram="librewolf https://www.cprogramming.com/ &"
alias learnc="librewolf https://learn-c.org &"
alias cdemos="librewolf https://www.demo2s.com/c/c.html &"
alias ctuts="librewolf https://www.tutorialspoint.com/c_standard_library/ &"
alias csimplified="librewolf https://www.programmingsimplified.com/c/ &"
alias cfaq="librewolf http://c-faq.com/ &"
alias cboards="librewolf https://cboard.cprogramming.com &"
alias crationale="librewolf https://www.lysator.liu.se/c/rat/title.html &"
# X11 Resources
alias xlibman="librewolf https://tronche.com/gui/x/xlib/ &"
alias xorg="librewolf https://www.x.org/wiki/ &"
alias xlibxcb="librewolf https://www.x.org/releases/X11R7.5/doc/libxcb/tutorial/ &"
# Bash Scripting
alias unixforums="librewolf https://www.unix.com &"
alias bashforbeginners="librewolf https://tldp.org/LDP/Bash-Beginners-Guide/html &"
alias advancedbash="librewolf https://tldp.org/LDP/abs/html/ &"
# Linux Related News/Resources (includes artix and runit resources)
alias kernelintro="links https://tldp.org/LDP/tlk/tlk.html"
alias kernelorg="links http://vger.kernel.org/lkml/"
alias archives="links https://archive.artixlinux.org/"
alias forums="librewolf https://forum.artixlinux.org/ &"
# alias mirrors="links https://mirrors.dotsrc.org/artix-linux/"
alias mirrors="links https://mirror1.artixlinux.org/"
alias isos="links https://ftp.crifo.org/artix"
alias smarden="links http://smarden.org/runit/"
alias opengroup="librewolf https://publications.opengroup.org/ &"
# Web Development Resources
# for static site generation
alias hugo="librewolf https://gohugo.io/ &"
# for downloading web fonts
alias gfontshelper="librewolf https://google-webfonts-helper.herokuapp.com/fonts &"
# for icons(use svg codes as they are faster)
alias iconify="librewolf https://iconify.design/ &"
# ddgr shebang bookmarks
alias ddgr="ddgr -x -n 25 --unsafe --proxy 127.0.0.1:8118"
alias ducky="ddgr -jx -n 25 --unsafe --proxy 127.0.0.1:8118"
alias aur='ddgr \!aur "${1}"'
alias archwiki='ddgr \!archwiki "${1}"'
alias wiki='ddgr \!w "${1}"'
alias gh='ddgr --gb \!gh "${1}"'
# must have account to use gitlab bang
alias glab='ddgr --gb \!glab "${1}"'
alias red='ddgr \!r "${1}"'
alias yt='ddgr --gb \!yt "${1}"'
# run the following two aliases every time you update the kernels and nvidiadkms
alias {grub_update,update_grub}="doas grub-mkconfig -o /boot/grub/grub.cfg"
alias regen_initramfs="doas mkinitcpio -P"
# DEPRECATED aliases (noted here for posterity):
# pjson is now easily replaced by package jq
# alias pjson="json_pp | pygmentize -l json" # pipe expected json output through pjson to prettify it
# alias mpl="mplayer -fs"
# alias {mloop,mploop}="mplayer -fs -loop 0"
#
# source scripts that need to utilize shell builtins
alias {sd,sdir}="source $HOME/scripts/sdir"
alias {rd,rdir}="source $HOME/scripts/rdir"