#!/usr/bin/perl
#count

$data = '/var/log/httpd/counter.si.data';
$lockfile = '/var/log/httpd/counter.si.LOCK';

# main routine
&increment;

print << "END"
Content-Type: text/html
\n
\n
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Matt Mairs">
<meta name="GENERATOR" content="vi/Mozilla/4.5 [en] (X11; I; SunOS 5.7 i86pc/LinuxPPC) [Netscape]">
<title>Matt Mairs's Songs</title>
</head>
<body bgcolor="#FFFFFF">
<SCRIPT LANGUAGE="JavaScript1.2">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- some mods 4/99 mmairs -->
<!-- Begin
function initArray() {
this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++) {
this[i] = initArray.arguments[i];
   }
}
var ctext = "<font size=+3>Warning protective moms, dads, and the children of such!!!<br>These contain profanity and adult subject matter!</font>";
var speed = 1000;
var x = 0;
var color = new initArray(
"red", 
"marroon",
"black",
"purple",
"salmon",
"pink",
"teal",
"charcoal",
"gray"
);
if(navigator.appName == "Netscape") {
document.write('<h3><layer id="c"><center>'+ctext+'</center></layer></h3><br>');
}
if (navigator.appVersion.indexOf("MSIE") != -1) {
document.write('<h3><div id="c"><center>'+ctext+'</center></div></h3>')
}
function chcolor(){ 
if(navigator.appName == "Netscape") {
document.c.document.write('<h3><center><font color="'+color[x]);
document.c.document.write('">'+ctext+'</font></center></h3>');
document.c.document.close();
}
else if (navigator.appVersion.indexOf("MSIE") != -1){
document.all.c.style.color = color[x];
}
(x < color.length-1) ? x++ : x = 0;
}
setInterval("chcolor()",1000);
// End -->

</SCRIPT>
<br><br><br><font size=+1>Wonder why songs are still appearing on pages for 
long dead bands?  It has to do with Matt's faulty memory and his insistence on 
documenting every little thing that flashes back across it.  It is therefore 
necessary to institute "last updated" labels for each damned lyrics page; never 
mind that new material appears on "Other" from time to time.  So here ya go:
</font>
<br><br><font size=+1><a href="downersongs.html">Downer</a> (last updated 1/26/00)</font>
 <a href="downerbio.html">(Downer personnel and bio)</a>
<br><font size=+1><a href="haywiresongs.html">HayWire</a> (last updated 1/26/00)</font>
 <a href="haywirebio.html">(HayWire personnel and bio)</a>
<br><font size=+1><a href="mannwitchsongs.html">Mannwitch </a>(last updated 10/11/99)</font> 
<a href="mannwitchbio.html">(Mannwitch personnel and bio)</a>
<br><font size=+1><a href="hubrissongs.html">hubris</a> (last updated 8/25/99)
</font>&nbsp;<a href="hubrisbio.html"> (hubris personnel and bio)</a>
<br><font size=+1><a href="hcsongs.html">Head Cheese</a>(last updated 04/11/99)</font> <a href=http://www.mockbrawn.com>(mockbrawn</a> lives on!)&nbsp;
<br><font size=+1><a href="bsesongs.html">Black
Sun Ensemble</a> (last updated 01/30/99)</font>
<br><font size=+1><a href="slothsongs.html">Sloth</a> (last updated 01/26/01)</font>
&nbsp;<a href="slothbio.html"> (Sloth personnel and bio)</a>
<br><font size=+1><a href="ninesongs.html">Nine</a> (last updated 02/27/99)</font>
&nbsp;<a href="ninebio.html"> (Nine personnel and bio)</a>
<br><font size=+1><a href="wwwsongs.html">What
Went Wrong</a> (last updated 04/14/99)</font>
&nbsp;<a href="wwwbio.html"> (What Went Wrong personnel and bio)</a>
<br><font size=+1><a href="songs0.html">Other</a> (last update 11/19/01)</font>
<br><br>Ever hear of Morass?  Wondering at all why they're not represented here?
It's 'cuz that stuff's so hot you can bloody well pay for it ya cheapskates!
<br><font size=+1>Or just check out the <a href="mp3s.html">MP3s</a>
<br>
<br></font>
<center>
<a href="http://www.ineedhits.com"> <img width="88" height="31" 
src="http://www.ineedhits.com/images/banners/link-button3.gif" 
alt="SubmitFree: Submit to 25+ Search Engines for free !!!!" 
border="0" ></a> 
</center>
<br>
<center>
<!-- START OF ADDME LINK -->
<a href="http://www.addme.com"><img width="88" height="31" 
src="http://www.addme.com/link8.gif" alt="Add Me!" border="0"></a> 
<!-- END OF ADDME LINK -->
</center>
<p><!-- IndieRing Script -->
<center><a href="http://www.indiering.com/"><img SRC="indiering.jpg" ALT="IndieRing" BORDER=0  align=CENTER></a>
<br>This <a href="http://www.indiering.com">IndieRing</a> site owned by
<a href="mailto:mmairs\@mairs.net">Matt Mairs</a>.
<br>[ <a href="http://www.webring.org/cgi-bin/webring?ring=indiering;id=1827;prev5">
Previous 5 Sites</a> | <a href="http://www.webring.org/cgi-bin/webring?ring=indiering;id=1827;prev">Pr
evious</a> | <a href="http://www.webring.org/cgi-bin/webring?ring=indiering;id=1827;next">Ne
xt</a> | <a href="http://www.webring.org/cgi-bin/webring?ring=indiering;id=1827;next5">N
ext 5 Sites</a> | <a href="http://www.webring.org/cgi-bin/webring?ring=indiering;random">Random
S ite</a> | <a href="http://www.webring.org/cgi-bin/webring?ring=indiering;list">List
Sites
</a>| <a href="http://www.indiering.com/wwwboard/wwwboard.html">Indie
Q+A Forum</a> ]
<br>[ <a href="http://www.indiering.com/artists/">Artists</a> | <a href="http://www.indiering.com/bands/">Bands
and Musicians</a> | <a href="http://www.indiering.com/ezines/">E-zines</a>
| <a href="http://www.indiering.com/labels/">Independent Labels</a> | <a href="http://www.indiering.com/indiecraftmall/">Indiering
Craft Mall</a> | <a href="http://www.indiering.com/indiemusicmall/">Indiering
Music Mall</a> | <a href="http://www.indiering.com/journalism/">Journalistic
Arts</a> | <a href="http://www.indiering.com/musicbiz/">Music Biz</a> |
<a href="http://www.allindependentmusic.com/#comment_form">Comments</a>
]</center><br><br>

<br>To <a href="writings.new.html">writings</a>...<br>
<br>Or go <a href="http://www.disorged.org">home</a><br><br><br>

$accesses
 accesses
<p>
</body>
</html>\n
END
;

sub increment {
  # read the data
  open(DATA,$data) || die "Can't open data file.\n";
  $accesses = <DATA>;
  $accesses++;
  close(DATA);
  # check for lock file
  while (-e $lockfile) {
    sleep 2;   # wait 2 seconds
  }
  # create lockfile
  open(LOCK,">$lockfile") || die "Can't create lockfile.\n";
  close(LOCK);
  # write new value
  open(DATA,">$data") || die "Can't create lockfile.\n";
  print DATA "$accesses";
  close(DATA);
  # delete lockfile
  unlink($lockfile);
}
