Skip to content

Instantly share code, notes, and snippets.

@hrosenbauer
Created February 9, 2014 12:14
Show Gist options
  • Select an option

  • Save hrosenbauer/8898254 to your computer and use it in GitHub Desktop.

Select an option

Save hrosenbauer/8898254 to your computer and use it in GitHub Desktop.
ZSH aliases
# commands
alias apt='sudo apt-get'
# stash
function stash() {
filename=$(basename "$2")
filename="${filename%.*}"
case "$1" in
compress) # compress & encrypt
tar --lzma -c "$2" | gpg -o "$filename.gpg" --cipher-algo AES256 --symmetric
;;
decompress) # decrypt & decompress
gpg -d "$2" | tar --lzma -x
;;
*) # info
echo -e "stash compress input.txt"
echo -e "stash decompress input.gpg"
return 1
;;
esac
}
# set cpu governor
function cpu-gov() {
if [ -n "$1" ]
then
echo "$1" | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
else
echo -e "cpu-gov performance|ondemand|conservative|powersave"
fi
}
# python
alias serve='python2 -m SimpleHTTPServer 8000'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment