This file contains 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
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
usage() { | |
cat <<EOF | |
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
This file contains 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
# original post: http://blog.hostonnet.com/uninstall-gui-from-ubuntu-14-04-lts | |
sudo apt-get purge -y lightdm | |
sudo shutdown -r now | |
sudo apt-get clean | |
sudo apt-get autoclean | |
apt-get purge -y unity* | |
sudo apt-get purge -y unity* | |
sudo apt-get purge -y gnome-* |
This file contains 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
numbers= [] | |
def loopy(i): | |
while i<6: | |
print "at the top of i is %d" %i | |
numbers.append(i) | |
i = i+1 | |
print "Numbers now", numbers | |
print "at the bottom of i is %d" %i |
This file contains 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
# long-running command growler | |
# hooks for zsh, built on bash version at http://hints.macworld.com/article.php?story=20071009124425468 | |
preexec_functions+='save_preexec_time' | |
save_preexec_time() { | |
export PREEXEC_CMD="$(history $HISTCMD | tail -n 1| sed 's/ *[0-9]* *//')" | |
export PREEXEC_TIME=$(date +'%s') | |
} | |
precmd_functions+='growl_about_long_running_commands' |