#!/usr/bin/perl

$TIME_LOG="/home/xanth/doksner/www/log/time";
$HOSTS_LOG="/home/xanth/doksner/www/log/hosts";
$USERS_LOG="/home/xanth/doksner/www/log/users";
#$TIME_LOG="/dev/null";
#$HOSTS_LOG="/dev/null";
#$USERS_LOG="/dev/null";

$USER=$ENV{REMOTE_USER};
$USER=$ENV{REMOTE_IDENT};
$USER=$ENV{HTTP_FROM};
#$USER=$ENV{HTTP_USER_AGENT};
$HOST=$ENV{REMOTE_HOST};
$ADDR=$ENV{REMOTE_ADDR};
$DATE=`/bin/date`;
chop($DATE);
$HOSTNAME=`/bin/hostname`;
chop($HOSTNAME);
$tmp=`/bin/uname -a`;
($junk, $junk, $LINUX_VERSION)=split(' ',$tmp);

print "Content-type: text/html\n\n";

print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>Dave's Home Page</TITLE>\n";
print "</HEAD>\n";

print "<BODY BGCOLOR=\"#000000\" TEXT=\"#ffffff\"";
print "LINK=\"0099ff\" VLINK=\"#00ff99\"\n";
#print "BACKGROUND=\"images/linux_emboss.gif\"";
print ">\n";

print "Welcome to $HOSTNAME, one of the computers here at \"oksner.org!\"\n<P>\n";
print "<HR>\n";

if ($HOSTNAME eq "xanth.oksner.org") {
	print "xanth is my computer--a Pentium 133, with 64MB of ram, running\n";
	print "Linux, version $LINUX_VERSION\n";
	#print "<A HREF=\"/cgi-bin/finger?\@linux.cs.helsinki.fi\">";
	#print "(Click here to see the latest verion of Linux)</A>\n";
	print "<HR>\n";
}

if ($HOSTNAME eq "krynn.oksner.org") {
	print "krynn is our \"server,\" providing internet access, name service,\n";
	print "web service, and mail service to the local network\n";
	print "in our apartment.  krynn is a dual P-II 266 with 64MB of\n";
	print "ram, running Linux, version $LINUX_VERSION\n";
	print "<HR>\n";
}

open (time_log, ">> $TIME_LOG");
printf (time_log "$DATE\n");
close (time_log);

if ($USER ne "") {
	print "Your name is $USER.\n";
	open (users_log, ">> $USERS_LOG");
	printf (users_log "$DATE\t$USER\n");
	close (users_log);
	print "<P>\n";
}
if ($HOST ne "") {
	print "You are visiting from $HOST.\n";
	open (hosts_log, ">> $HOSTS_LOG");
	printf (hosts_log "$DATE\t$HOST\n");
	close (hosts_log);
	print "<P>\n";
}

print "If you want something to look at, you can check out my \n";
print "<a href=\"gasprices/\">Gas Prices</a> web page\n";
print "<hr>\n";

print "Well, I think it's relatively permanent, now.  My\n";
print "<a href=\"http://map.findu.com/ke6oms-1\">position</a>\n";
print "is available on the web most of the time.\n";
print "<hr>\n";

print "Cool weather website.  Even has weather banners, and stuff.<br>\n";
print "<table border=0 style=\"background-color: white\"><tr><td>\n";
print "<a href=\"http://www.wunderground.com/US/CA/San_Luis_Obispo.html\">\n";
print "<img src=\"http://banners.wunderground.com/banner/bigwx_cond/language/www/US/CA/San_Luis_Obispo.gif\"\n";
print "alt=\"Click for San Luis Obispo, California Forecast\" border=0 height=60 width=468></a>\n";
print "</td></tr></table>\n";
print "<hr>\n";

print "Well, I hope this wasn't too boring for you, but I just don't\n";
print "have much time to work on my home page.  (That, and I don't like\n";
print "cluttering the internet with frivolous images.)\n";

print "<P>\n";

#print "In fact, I think I'm going to make a little commentary on this\n";
#print "subject.\n";

#print "<HR>\n";

#print "<I><B>Disclaimer: </B>The opinions of this author are not\n";
#print "necessarily those of the owner of the machine (though currently,\n";
#print "they're the same)\n";
#print "or those of Bernie Horrowitz (identified by Gary Larsen as being\n";
#print "the infamous \"they,\" as in \"you know what _they_ say\").</I>\n";

#print "<P>\n";
#print "I know that nifty, flashy pictures and animated gifs dress up an\n";
#print "otherwise dull page, or are simply able to help people navigate\n";
#print "the site, but I have a real problem with frivolous and/or gratuitous\n";
#print "use of large amounts of fluff.  It might not seem like much...a small\n";
#print "picture here...a nice looking background there...  Pretty soon, one\n";
#print "page takes ten minutes to load, there are http connections being\n";
#print "made all over the place, and the bandwidth from point A to point B\n";
#print "becomes intolerably low for everyone.\n";
#print "<P>\n";
#print "I guess all I'm saying is that one's pictures, sounds, and animations\n";
#print "really ought to lend something to the content of the page, rather\n";
#print "just say \"look what I can do!\"\n";
#print "<P>";
#print "I'm sorry if this has offended anyone.\n";

print "<P>\n";
print "<I>We now return you to our regularly scheduled insanity.</I>\n";

print "<P>\n";
print "<A HREF=\"mailto:dave\@oksner.org\">dave\@oksner.org</A>\n";

print "</BODY>\n";

print "</HTML>\n";
