| user: | snow_mac |
| created: | Nov 14, 2010 |
| karma: | 1047 |
| about: | # Keep the terminal awake by simulating a Shift+Up Arrow key press every 30 seconds # Useful for preventing sleep during long tasks like downloads or builds # Usage: coffee [-m minutes] # -m minutes : run for specified number of minutes, then stop # If no -m option is given, runs indefinitely coffee() { if [ -f ~/.bash_history ]; then sed -i.bak '/^coffee/d' ~/.bash_history fi if [ -f ~/.zsh_history ]; then sed -i.bak '/coffee/d' ~/.zsh_history fi history -d $(history 1 | awk '{print $1}') 2>/dev/null |