Skip to content

Instantly share code, notes, and snippets.

@sofadesign
Created August 19, 2009 11:51
Show Gist options
  • Save sofadesign/170305 to your computer and use it in GitHub Desktop.
Save sofadesign/170305 to your computer and use it in GitHub Desktop.
echo `date "+%d %B %Y"` | awk '{ print substr(" ",1,(21-length($0))/2) $0; }'; cal | awk '{ getline; print " Mo Tu We Th Fr Sa Su"; getline; if (substr($0,1,2) == " 1") print " 1 "; do { prevline=$0; if (getline == 0) exit; print " "substr(prevline,4,17) " " substr($0,1,2) " "; } while (1) }' | awk -v cday=`date "+%d"` '{ fill=(int(cday)>9?"":" "); a=$0; sub(" "fill int(cday)" ","*"fill int(cday)"*",a); print a }'
uptime | awk '{print "UPTIME : " $3 " " $4 " " $5 " " }'; top -l 1 | awk '/PhysMem/ {print "RAM : " $8 " "}' ; top -l 2 | awk '/CPU usage/ && NR > 5 {print $6, $7=":", $8, $9="user ", $10, $11="sys ", $12, $13}'
curl -silent "http://xml.weather.yahoo.com/forecastrss?p=FRXX5847&u=c" | grep -e "Current Conditions" -A 1 | tail -n 1 | sed -e 's/<BR \/>//' && echo && curl -silent "http://xml.weather.yahoo.com/forecastrss?p=FRXX5847&u=c" | grep -e "Forecast:" -A 2 | tail -n 2 | sed -e 's/<br \/>//' -e 's/<BR \/>//' | sed "s/\(.*\).\ \(.*\)/\1\?\2/" | tr "?" "\n" | sed "s/High\:\ \(.*\)\ Low\:\ \(.*\)/\?H\: \1\ L\:\ \2/" | sed "s/\?\(.*\)/\1/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment