Tom Hayward

This blog covers some of my thoughts and interests, including software development, system administration, and amateur (ham) radio.

Check me out:

Facebook
Flickr
Last.fm
Del.icio.us
Twitter @thayward

Comments:

I just added LineBuzz for comments. Just highlight the phrase you want to comment on, and click "Post an inline comment". You will need be registered with LineBuzz, but luckily this is simple and quick.

Local Links:

Friend's Blogs:

Tue Feb 3

I made you a 1234567890 countdown timer

Unix time will reach 1234567890 on 2009-02-13 15:31:30. I made a countdown timer in bash.

#!/bin/sh
printf "\tUNIX TIME\t TO GO:\tDAYS\tHOURS\tMINUTES\tSECONDS\n"
while true;
	DATE=`date +%s`
	SECONDS=$[1234567890-$DATE]
	MINUTES=$[$SECONDS/60]
	HOURS=$[$MINUTES/60]
	DAYS=$[$HOURS/24]
	printf "\t%s\t\t%4s\t%5s\t%7s\t%7s\r" "$DATE"	"$DAYS" "$[$HOURS%$DAYS]" "$[$MINUTES%$HOURS]" "$[$SECONDS%$MINUTES]"
	sleep 1
done