profile/aliases.sh

76 lines
2.5 KiB
Bash

# enable aliases for commands inside sudo
# TOOD check this is safe
alias sudo='sudo '
alias lsoff='sudo lsof +f -- '
alias aur-update='trizen -Su --aur'
alias la='ls -lha --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
alias ll='ls -lh --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
alias ls='ls --color=auto -h'
alias cp='cp -i'
alias df='df -h'
alias egrep='egrep --colour=auto'
alias fgrep='fgrep --colour=auto'
alias hgrep='history | grep --color=auto'
alias grep='grep --colour=auto'
alias grepef='grep --exclude-from .ignorefiles'
alias pipr='pip freeze > requirements.txt'
alias rcp='rsync --progress --size-only --verbose -rh'
alias cdr='ranger --choosedir=/tmp/rangerdir; LASTDIR=`cat /tmp/rangerdir`; cd "$LASTDIR"'
alias git-port='/home/ray/Scripts/git-change-remote-port.sh'
alias telegram='telegram-cli -NAW -s ~/.telegram-cli/notify.lua'
alias ytdl='youtube-dl --write-info-json --write-description --no-playlist'
alias ytdlb='youtube-dl --write-info-json --write-description --no-playlist -a'
alias ytdl-mp3='youtube-dl -f bestaudio --extract-audio --audio-format mp3 --embed-thumbnail --add-metadata'
alias sherlock='/home/ray/Projects/Python/sherlock/venv/bin/python /home/ray/Projects/Python/sherlock/sherlock.py'
alias sftpsb='sftp psb18896@psb18896.seedbox.io'
alias wttr='curl wttr.in'
alias isnet='ssh -p666 isnet.uk -t tmux'
alias b1.isnet='ssh -p666 b1.isnet.uk -t tmux'
alias s1.isnet='ssh -p666 s1.isnet.uk -t tmux'
alias hmb.isnet='ssh -p666 hmb.isnet.uk -t tmux'
alias kvm.isnet='ssh -p666 kvm.isnet.uk -t tmux'
alias ubuntu666='ssh ubuntu666 -t tmux'
alias debian666='ssh 192.168.0.101 -t tmux'
alias alarmpi='ssh 192.168.0.11 -t tmux'
alias hosting='ssh -p2222 xuk@hosting.isnet.uk'
alias hetzner='ssh ray@dokku.isnet.uk'
alias mac='ssh ray@mac -t tmux'
alias dokku='ssh -t dokku@dokku.isnet.uk'
alias pacman='~/.src/archnews/archnews_wrap'
alias aur-updates='trizen -Su --aur'
# lf gets confused by TERMINFO env var when running in tmux
# https://github.com/gokcehan/lf/issues/138#issuecomment-464477665
if [ -n "$TERMINFO" ] ; then
alias lf="TERMINFO= lf"
fi
# functions
# $1 - output directory
# $2 - size
# $3 - filename
smartresize() {
mogrify -path "$3" -filter Triangle -define filter:support=2 -thumbnail "$2" -unsharp 0.25x0.08+8.3+0.045 -dither None -posterize 136 -quality 82 -define jpeg:fancy-upsampling=off -define png:compression-filter=5 -define png:compression-level=9 -define png:compression-strategy=1 -define png:exclude-chunk=all -interlace none -colorspace sRGB "$1"
}