2017-04-22 23:43:18 +00:00
|
|
|
##General QOL
|
2017-12-15 20:22:45 +00:00
|
|
|
alias la='ls -lAh'
|
|
|
|
alias ll='ls -lh'
|
2017-04-22 23:43:18 +00:00
|
|
|
|
2017-12-15 20:22:45 +00:00
|
|
|
alias -g ...=../..
|
|
|
|
alias -g ....=../../..
|
|
|
|
alias -g .....=../../../..
|
|
|
|
alias -g ......=../../../../..
|
|
|
|
|
|
|
|
# Setup Fuck
|
2017-04-22 23:43:18 +00:00
|
|
|
eval "$(thefuck --alias)"
|
2017-12-15 20:22:45 +00:00
|
|
|
|
|
|
|
# Docker Aliases
|
2017-04-22 23:43:18 +00:00
|
|
|
dme (){ eval $(docker-machine env "$@");}
|
|
|
|
alias dmssh='docker-machine ssh'
|
|
|
|
alias dm='docker-machine'
|
2017-12-15 20:22:45 +00:00
|
|
|
alias dc='docker-compose'
|
|
|
|
|
2017-04-22 23:43:18 +00:00
|
|
|
alias dps='docker ps'
|
|
|
|
alias dpsa='docker ps -a'
|
|
|
|
alias drm='docker rm'
|
|
|
|
alias drmi='docker rmi'
|
|
|
|
alias dim='docker images'
|
|
|
|
alias dbl='docker build'
|
|
|
|
alias dbl.='docker build .'
|
|
|
|
alias drun='docker run -ti'
|
|
|
|
alias dkl='docker kill'
|
2018-08-10 20:20:11 +00:00
|
|
|
alias dalpine='docker run -ti --rm spritsail/alpine /bin/sh'
|
2017-04-22 23:43:18 +00:00
|
|
|
alias drm-stopped='docker rm -v $(docker ps -a -q -f status=exited)'
|
|
|
|
alias drmi-untag='docker rmi $(docker images -f "dangling=true" -q)'
|
|
|
|
dsh() {
|
|
|
|
docker exec -ti $1 /bin/sh
|
|
|
|
}
|
|
|
|
|
2017-12-15 20:22:45 +00:00
|
|
|
# Package management
|
2017-04-22 23:43:18 +00:00
|
|
|
alias pacup='pacaur -Syu'
|
|
|
|
alias pacrm='pacaur -Rs'
|
|
|
|
alias pacadd='pacaur -S'
|
|
|
|
|
2017-12-15 20:22:45 +00:00
|
|
|
# Command Overrides
|
2017-04-22 23:43:18 +00:00
|
|
|
alias shred='shred -uzn 5'
|
2017-12-15 20:22:45 +00:00
|
|
|
alias cp='cp -r'
|
|
|
|
alias dd='dd status=progress'
|
|
|
|
alias ls='ls -F --color=always'
|
|
|
|
alias pacman='pacman --color=always'
|
|
|
|
alias pacaur='pacaur --color=always'
|
2018-08-10 20:20:11 +00:00
|
|
|
#which gopass &>/dev/null && alias pass='gopass' && source <(gopass completion zsh) #Only override pass if gopass exists
|
|
|
|
|
|
|
|
# Function for converting from eac3 to ac3
|
|
|
|
function eac3-away() {
|
|
|
|
# Dont analyze rar files, causes false positives
|
|
|
|
if $(file -binN $1 | grep -q "x-rar"); then
|
|
|
|
echo "File is in rar format, refusing to analyze"
|
|
|
|
return 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! $(ffprobe -hide_banner -v 24 -show_streams -select_streams a "$1" | grep -q eac3); then
|
|
|
|
echo "File is not in eac3 format"
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
mv "$1" "old.$1"
|
|
|
|
ffmpeg -i "old.$1" -map 0 -vcodec copy -scodec copy -acodec ac3 -b:a 640k "$1"
|
|
|
|
rm "old.$1"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# Function to fix mangled mp3 headers in some files
|
|
|
|
function fix-headers() {
|
|
|
|
# Dont analyze rar files, causes false positives
|
|
|
|
if $(file -binN $1 | grep -q "x-rar"); then
|
|
|
|
echo "File is in rar format, refusing to analyze"
|
|
|
|
return 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
mv "$1" "old.$1"
|
|
|
|
ffmpeg -i "old.$1" "$1"
|
|
|
|
rm "old.$1"
|
|
|
|
}
|
2017-04-22 23:43:18 +00:00
|
|
|
|
2017-07-13 00:29:48 +00:00
|
|
|
# Beets remote music management
|
|
|
|
alias beet="eval $(docker-machine env DockerOther | sed -n 's/export\s*//gp' | xargs ) docker exec -ti beets beet"
|
|
|
|
alias beet-restart="eval $(docker-machine env DockerOther | sed -n 's/export\s*//gp' | xargs ) docker restart beets"
|
|
|
|
|
2017-12-15 20:22:45 +00:00
|
|
|
# Put the SSH Ident bin in if its deps are installed.
|
|
|
|
which python &>/dev/null && export PATH="$HOME/.dotfiles/ssh-ident:$PATH" && alias rsync='BINARY_SSH=rsync ~/.dotfiles/ssh-ident/ssh-ident'
|
2017-12-15 19:00:55 +00:00
|
|
|
|
2017-04-22 23:43:18 +00:00
|
|
|
#VirtualEnv
|
|
|
|
export WORKON_HOME=$HOME/.virtualenvs # optional
|
|
|
|
export PROJECT_HOME=$HOME/Sync/Programming/Python # optional
|
|
|
|
source /usr/bin/virtualenvwrapper.sh
|
2017-10-05 14:48:24 +00:00
|
|
|
|
|
|
|
#Ruby. Yay...
|
2018-08-10 20:20:11 +00:00
|
|
|
#export PATH="$PATH:$(ruby -rubygems -e 'puts Gem.user_dir')/bin"
|
2017-12-15 18:48:26 +00:00
|
|
|
|
|
|
|
# Go
|
|
|
|
export GOPATH="/home/adam/Sync/Go"
|