# colors if [ -x "$(command -v dircolors)" ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias grep='grep --color=auto' alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' alias ls='ls -v --color=auto' fi alias l.='ls -AFv --ignore="*"' alias ll='ls -lhFv' alias la='ls -AFv' alias lla='ls -lhFAv' alias ll.='ls -lhFAv --ignore="*"' alias _='sudo' alias root='sudo -i TMOUT=450' alias rm='rm -ir' alias mkdir='mkdir -pv' alias cd..='cd ..' alias ..='cd ..' alias ...='cd ../..' alias .3='cd ../../..' alias path='echo -e ${PATH//:/\\n}' alias history='history 0' # shorts alias c='clear' alias q='exit 0' alias h='history | less' alias j='jobs -l' alias hg='history|grep' # utils alias sha='(shasum -a 256 | head -c 64)' alias genpass="openssl rand -base64 12" alias gensalt="dd if=/dev/urandom count=16 2>/dev/null | sha256sum | head -c 64" alias diff='colordiff' alias tar-it='tar -czf "../${PWD##*/}.tar.gz" .' # time alias now='date +"%T"' alias nowdate='date +"%d-%m-%Y"' # vim alias svi="sudo -E nvim" alias edit=nvim # net alias ports='ss -tlnp' alias wget='wget -c' alias ping='ping -c 5' alias myip='curl ipinfo.io/ip' alias sprunge='curl -F "sprunge=<-" http://sprunge.us 2>/dev/null' # CLI pastebin alias weather='curl -4 wttr.in/$(cat) 2>/dev/null | head -n -1' # weather by city, gets city from stdin # starts web server alias www='python3 -m http.server 8000' # hard alias reboot='sudo /sbin/reboot' alias poweroff='sudo /sbin/poweroff' alias suspend='sudo systemctl suspend' alias halt='sudo /sbin/halt' alias shutdown='sudo /sbin/shutdown now' alias meminfo='free -mlth' alias psmem='ps auxf | sort -nr -k 4 | less -R' alias music='mplayer -shuffle ~/Music/*.mp3' if [[ "$OSTYPE" == "linux-gnu"* ]]; then alias wake='((speaker-test -t sine -f 400 &>/dev/null)& local pid=$! ;sleep 0.2s; kill -9 $pid) &>/dev/null' elif [[ "$OSTYPE" == "linux-android"* ]]; then alias wake='termux-notification --sound --vibrate 500,1000,200' fi # python alias pipir='python3 -m pip install -r requirements.txt' alias pipar='python3 -m pip freeze > requirements.txt' # initializes first ./*/*/activate # alias va='source "$(find -P . -maxdepth 3 -type f -name activate | sort | head -n 1)" &>/dev/null || echo "error: virtual env not found, use python3 -m virtualenv venv" >&2' alias ve='python3 -m virtualenv venv && . venv/bin/activate' alias vd='deactivate' # git alias watch-diff='watch --color "git diff --color=always"' # docker alias dcu='docker-compose up -d' alias dcd='docker-compose down' alias drmc='docker container prune' alias drmi='docker image prune' # clipboard if [[ "$OSTYPE" == "linux-gnu"* ]]; then if [[ -n "$DISPLAY" ]]; then alias copy='xclip -selection clipboard -i' alias paste='xclip -selection clipboard -o' else alias copy='read -rd "EOF" TTYCLIPBOARD' alias paste='echo "$TTYCLIPBOARD"' fi elif [[ "$OSTYPE" == "linux-android"* ]]; then alias copy='termux-clipboard-set' alias paste='termux-clipboard-get' elif [[ "$OSTYPE" == "darwin" ]]; then alias copy='pbcopy' alias paste='pbpaste' fi