Skip to content

Instantly share code, notes, and snippets.

@Almenon
Last active November 30, 2023 09:21
Show Gist options
  • Save Almenon/bf97001223830dac961b738e07fb1388 to your computer and use it in GitHub Desktop.
Save Almenon/bf97001223830dac961b738e07fb1388 to your computer and use it in GitHub Desktop.
My aliases
alias logout="exit"
alias rm="rm -I"
alias cp="cp -i"
alias mv="mv -i"
alias users="cut -d : -f 1 /etc/passwd"
alias packages="dpkg --list"
alias programs="dpkg --list"
alias cwd=pwd
alias demons="ps -eo 'tty,pid,comm' | grep ^?"
alias daemons="ps -eo 'tty,pid,comm' | grep ^?"
alias services="service --status-all"
alias nodejs=node
alias python=python3
alias pip=pip3
alias zombies="ps aux | grep 'Z' # pstree -p -s PID to find parent"
alias c="xclip -selection clipboard"
# alias c="pbcopy" # if you're on mac
alias gs="git status"
alias night="xrandr --output $(xrandr | grep " connected" | cut -f1 -d " ") --brightness .75"
alias day="xrandr --output $(xrandr | grep " connected" | cut -f1 -d " ") --brightness 1"
alias ds="dig +short "
alias activate="source venv/bin/activate"
######################### Functions
# FOR THE LOVE OF GOD BE CAREFUL WITH THIS
# ITS LITERALLY IMPOSSIBLE TO RECOVER YOUR DATA
permaNuke() { find . -type f -exec shred -vzu {} \; }
cl() { cd "$@" && ls; }
cla() { cd "$@" && ls -la; }
# changing colors:
# dircolors --print-database > ~/.dircolors
# then just modify ~/.dircolors (bashrc will automatically load it)
##############
# WSL-specific
##############
# to use windows npm
# see https://github.com/Microsoft/WSL/issues/2370
npmW() { cmd.exe /C "npm $* 2>&1 < NUL | cat"; }
cmd() { cmd.exe /C "$*"; }
# if you want to use windows node see https://github.com/Microsoft/WSL/issues/2370
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment