profile/aliases.sh

121 lines
3.0 KiB
Bash
Raw Normal View History

2019-05-26 19:45:22 +00:00
# enable aliases for commands inside sudo
# TOOD check this is safe
alias sudo='sudo '
2020-09-03 14:44:50 +00:00
alias e='nvim'
2019-06-02 11:03:05 +00:00
alias lsoff='sudo lsof +f -- '
2019-02-20 14:19:32 +00:00
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'
2019-02-22 19:25:31 +00:00
alias ls='ls --color=auto -h'
2019-02-20 14:19:32 +00:00
2020-06-30 15:58:34 +00:00
alias bulk-rename='vimv'
2019-02-20 14:19:32 +00:00
alias cp='cp -i'
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'
2020-03-25 13:05:19 +00:00
alias bc='bc -q -l'
2020-02-27 15:02:01 +00:00
alias thumbs='feh -t -y128 -E128'
2019-03-07 23:24:29 +00:00
alias git-port='/home/ray/Scripts/git-change-remote-port.sh'
2021-02-13 12:19:13 +00:00
alias mpv480="mpv --ytdl-raw-options=format='best[height<='480']'"
alias mpv720="mpv --ytdl-raw-options=format='best[height<='720']'"
alias mpv1080="mpv --ytdl-raw-options=format='best[height<='1080']'"
2019-02-20 14:19:32 +00:00
alias ytdl='youtube-dl --write-info-json --write-description --no-playlist'
alias ytdlb='youtube-dl --write-info-json --write-description --no-playlist -a'
2019-03-04 22:35:04 +00:00
alias ytdl-mp3='youtube-dl -f bestaudio --extract-audio --audio-format mp3 --embed-thumbnail --add-metadata'
2019-02-20 14:19:32 +00:00
2019-06-08 10:03:01 +00:00
alias wttr='curl wttr.in'
2019-06-08 10:00:45 +00:00
2020-02-27 15:00:07 +00:00
alias pve='ssh pve.home'
2020-11-21 13:29:25 +00:00
alias b1='ssh b1.isnet.uk'
alias kvm='ssh kvm.isnet.uk'
alias dokku='ssh -t dokku@dokku.isnet.uk'
2020-11-21 13:07:34 +00:00
alias calcurse='ssh -t calcurse@calcurse.home "calcurse-caldav && calcurse"'
2020-11-21 13:25:58 +00:00
alias newsboat='ssh -t g.x newsboat'
alias ncmpcpp='ssh -t g.x ncmpcpp'
2019-04-10 18:22:55 +00:00
2019-05-26 19:45:22 +00:00
alias pacman='~/.src/archnews/archnews_wrap'
2020-02-23 18:02:03 +00:00
# lf gets confused by TERMINFO env var when running in tmux
# https://github.com/gokcehan/lf/issues/138#issuecomment-464477665
if [ -n "$TERMINFO" ] ; then
2020-06-30 15:57:45 +00:00
alias lf="TERMINFO= lf -last-dir-path=$HOME/.cache/lf-last-dir"
else
alias lf="lf -last-dir-path=$HOME/.cache/lf-last-dir"
2020-02-23 18:02:03 +00:00
fi
2020-06-30 15:57:45 +00:00
cdlf() {
cd "$(cat $HOME/.cache/lf-last-dir)"
}
lfcd() {
lf -last-dir-path="$HOME"/.cache/lf-last-dir
cdlf
}
2019-04-10 18:22:55 +00:00
# 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"
}
2020-03-19 18:12:50 +00:00
2020-05-18 18:35:01 +00:00
re() {
git clone ssh://git@git.rayelliott.dev:3222/rayelliott/"$1".git $2
}
2020-03-19 18:12:50 +00:00
mc() {
mkdir "$1" && cd "$1"
}
2020-03-30 12:05:59 +00:00
# TODO testing
ytdl-ct() {
ssh "youtube-dl@192.168.0.118 'screen -m -d ./download.sh $1'"
}
# TODO testing
ytdl-ct-audio() {
ssh "youtube-dl@192.168.0.118 'screen -m -d ./download.sh --config-location ~/.config/youtube-dl/config-audio-only $1'"
}
2020-06-19 09:50:54 +00:00
git-re() {
repo="$1"
dir="$2"
if [ -z "$dir" ] ; then
dir="$repo"
fi
git clone ssh://git@git.rayelliott.dev:3222/rayelliott/"$repo".git "$dir"
}
2020-09-26 11:31:58 +00:00
ch() {
curl "cheat.sh/$@"
}
2020-11-21 13:35:16 +00:00
newsh() {
set -e
if [ -f "$1" ] ; then
echo "Error: file exists: $1"
exit 1
fi
echo "#!/bin/sh" > "$1"
echo "" >> "$1"
echo "$2" >> "$1"
chmod +x "$1"
nvim "$1" +3
}