showcal.cgi: A simple awk cgi script to produce an annotated html calendar file (uuencoded because blogger chokes on some of the tags), runs with busybox awk as found in Oleg's firmware for ASUS WL500G. i know there are plenty of calendars out there but it seemed like overkill to run PHP and MYSQL for a calendar with less than a hundred entries. there are a couple of other maintenance scripts for adding and deleting (to be posted) or use a text editor
calendar file format :
R = repeat O = once
H = holiday T = travel P = pay bill B = birthday
the year is not significant for H and B
eg.
21-Jun-2007 R H Winter Solstice
22-Dec-2007 R H Summer Solstice
21-Mar-2007 R H Autumn Equinox
23-Sep-2007 R H Spring Equinox
25-Apr-2007 R H Anzac Day
... etc
begin-base64 644 -
IyEvdXNyL2Jpbi9hd2sgLWYKIyBBIHNpbXBsZSBhd2sgY2dpIHNjcmlwdCB0
byBwcm9kdWNlIGFuIGFubm90YXRlZCBodG1sIGNhbGVuZGFyIGZpbGUgCiMK
IyBOVSAyMDA3IAojIAoKQkVHSU4geyAKIERBWVNbMF0gPSAiU3VuIjsKIERB
WVNbMV0gPSAiTW9uIjsKIERBWVNbMl0gPSAiVHVlIjsKIERBWVNbM10gPSAi
V2VkIjsKIERBWVNbNF0gPSAiVGh1IjsKIERBWVNbNV0gPSAiRnJpIjsKIERB
WVNbNl0gPSAiU2F0IiA7CiAKWUVBUiA9IHN0cmZ0aW1lKCIlWSIpOwoKc3Bs
aXQoRU5WSVJPTlsiUVVFUllfU1RSSU5HIl0sZGF0YSwiPSIpOwpNT05USD1k
YXRhWzJdOwppZihNT05USCA9PSAiIikgewogTU9OVEggPSBzdHJmdGltZSgi
JW0iKTsKfQpEQVk9MQpORVdEQVkgPSBta3RpbWUoIFlFQVIgIiAiIE1PTlRI
ICIgIiBEQVkgIiAwIDAgMCIgKTsKCiMgcmVhZCBkYXRhIGZpbGUgLCBncmVw
IHRoZSBjdXJyZW50IG1vbnRoIG9ubHkgCiBuPTA7CndoaWxlICggImdyZXAg
IiBzdHJmdGltZSgiJWIiLE5FV0RBWSkgIiAuLi9jYWwuZGF0IiB8IGdldGxp
bmUg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