Created
February 9, 2014 12:14
-
-
Save hrosenbauer/8898254 to your computer and use it in GitHub Desktop.
ZSH aliases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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