Skip to content

Instantly share code, notes, and snippets.

@oblique63
Created May 27, 2015 02:04
Show Gist options
  • Save oblique63/b759f3a3183e5378accb to your computer and use it in GitHub Desktop.
Save oblique63/b759f3a3183e5378accb to your computer and use it in GitHub Desktop.
# Meta
alias edit-aliases="nano ~/.alias && source ~/.alias"
alias aliases="less ~/.alias"
alias update-aliases="source ~/.alias"
# Utility
alias lss="ls -ABgoh" # ls with human-readible file sizes
alias rm="rm -i"
alias mkex="chmod +x"
alias untar="tar xvzf"
alias again="!!"
alias clr="clear"
alias bless="less -FXeq" # 'better' less
alias ssh-key="cat ~/.ssh/id_rsa.pub"
alias copy-ssh-key="copy-from ~/.ssh/id_rsa.pub"
alias caps2ctl="/usr/bin/setxkbmap -option 'ctrl:nocaps'"
# Clipboard
alias copyfrom="xclip -in -selection c"
alias pasteto="xclip -out -selection c"
# Info
alias space="df -h"
alias memory="free -m"
alias mem="memory"
alias app="apropos"
alias which-app="app"
alias where="which"
alias pss="ps auxfck -pcpu,size | bless"
# Nonsense
alias fuck="killall"
alias bitch="sudo"
alias moar="more"
alias wtf="pss"
# Installation
function install-font() {
sudo cp $1 /usr/share/fonts/truetype/
sudo fc-cache -f -v
sudo fonts-config
}
function install-icons() {
sudo cp -r $1 /usr/share/icons/
}
function install-wallpapers() {
sudo cp -r $1 /usr/share/wallpapers/
}
function install-theme() {
sudo cp -r $1 /usr/share/themes/
}
# Navigation
cdpath=(. ~ ~/Code)
alias up="cd .."
alias up2="cd ../.."
alias up3="cd ../../.."
alias up4="cd ../../../.."
alias desk="cd ~/Desktop"
alias back="cd -"
backto() {
current_path=`pwd`
match_length=`expr $current_path : .*$1`
if [ $match_length -eq 0 ]; then
echo "No such directory in your current path:" $1
else
destination=${current_path:0:match_length}
if [ $2 ]; then
destination=$destination"/"$2
fi
echo $destination
cd $destination
fi
}
# Paths
alias user-paths="more ~/.paths"
addpath() {
echo "$1" >> ~/.paths
export PATH="$PATH:$1"
}
loadPaths() {
if [ -f ~/.paths -a ! $PATHS_LOADED ]; then
for line in `cat ~/.paths` ; do
PATH="$PATH:$line"
done
export PATH
export PATHS_LOADED=true
fi
}
loadPaths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment