What's New?

(updated 8/5/05)

Board Again

8/5/05
I am trying to get a working board up again here, and may even end up moving my site to another host to do so. If I do not have a board working by next Wednesday, I will move deadbase.com; and should have everything working within a week of that. Sorry for the inconvenience, and thanks for your patience.

Attention DeadBase Shoppers...

12/12/03
A copy of DeadBase XI is for sale on ebay; the auction ends in one week. That is all.
For those of you to whom the tooth-and-nail world of online auctions does not appeal, or who care more for the additional Dead-related info that appears in DeadBase X (as opposed to GarciaBase, and other spinoff-band material which took its place in DeadBase XI), DeadBase X is still available right here (at a much more reasonable price).

Robert Hunter's Coming To Town

3/11/03
Life in New Hampshire and Vermont is quiet, some would even say sleepy. And mostly, we like it like that. But we are just tickled pink that Robert Hunter is gracing our local (some would say quaint) opera house with his presence this Saturday (Phil's birthday!).
Apparently there are still good seats left, so we encourage you to come hear the legendary wordsmith weave his magic. You will probably be able to buy tickets at the door, but it is always best to reserve good seats asap: 603.448.0400. The venue is easy to get to, especially by New England standards, just a few miles from I-89.
Saturday, March 15 at the Lebanon Opera House,
51 N. Park Street, Lebanon, NH
Doors open at 7:00 PM. Show time is 8:00 PM.

An Auspicious Anniversary

8/27/02
Thirty years ago today, the Grateful Dead played one of their most memorable concerts ever. Reknown not only for the fantastic music, but the idyllic setting, oppresive heat, and colorful commentary, this is a must-listen show today. Fortunately it exists readily in excellent quality, and there are also copies of the Dead's performance on video tape, and of NRPS' performance on audio. Do yourself a favor, and honor this moment in Grateful history.

Terrapin Station

8/3/02
You can hear The Other One's music on August 3 and 4 in a webcast by going to the Terrapin Station Planet on the home page of dead.net and clicking on the Webcast button. DeadBase advises visiting early to make sure you have the correct player installed.
OR you can hear The Other One's music on August 3 by tuning into WXRT, Chicago

Terrapin Station Show Schedule

Saturday 8/3
Main Stage
Second Stage
1:00 - 2:30 Phil Lesh and Friends
3:30 - 5:00 Mickey Hart and Bembe Orisha
6:00 - 7:00 Robert Hunter
8:00 - 9:30 and 10 - Midnight:  The Other Ones
2:30 - 3:30 Donna the Buffalo
5:00 - 6:00 Warren Haynes
7:00 - 8:00 The Disco Biscuits

Sunday 8/4
Main Stage
Second Stage
1:00 - 2:30 The TriChromes
3:30 - 5:00 RatDog
6:00 - 7:00 Robert Hunter
8:00 - 9:30 and 10 -Midnight: The Other Ones
2:30 -3:30 Robert Randolf And The Family Band
5:00 - 6:00 Jorma Kaukonen & Blue Country
7:00 - 8:00 Karl Denson's Tiny Universe

DeadBase, Jr. Supplement

6/24/02
We have finally posted the supplement page which completes DeadBase, Jr. through the last show in 1995. (The book went to press in mid 1995, and we only had half the year in the book.) The supplement page is in PDF format, laid out butterfly ballot style. Print it out on a laser printer, and then print it again on the back of the same page, and you will have two copies, suitable for clipping and inserting into your copy.

Da Boards Be Back!

4/10/02
Well, we are back again. Unfortunately, the message view counts got lost in the shuffle, but things coulda been worse. Sorry for the inconveninece in the mean time; y'all come back now, y'hear?!

DeadBase BBS Down, But Not Out

4/10/02
Thanks to the machinations of an intrepid hacker, our boards are down. We are having problems getting them back online on the new server (the software just refuses to behave itself), but we do have complete backups, and hope, even expect to have them up in the not too distant future. If you have experience with WebBBS, and think you might be able to help, please contact john@deadbase.com. It is gratifying to know how many of you use, and miss, these boards; thank you for your support and patience. - John

DeadBase XI Out of Print

1/27/01
We have now officially sold out of both bindings of DeadBase XI. There may be a few copies yet to be returned from wholesale customers; if so, notice will be posted here of their availability. Until that time, DeadBase X is once again our most recent full edition currently available for purchase.

The Golden Road

11/05//01
I just got my copy of The Golden Road (1965-1973) boxed set, and although I have only delved a few discs into this daunting 12 CD collection, I just had to say that I am overwhelmed. The folks at GDP and Rhino records have really outdone themselves. So far all the discs sound phenomenal, the bonus material is very well chosen, and the set is exquisitely presented. GDP is selling it at "an introductory price" of $135, including shipping (800-CAL-DEAD, or www.mars.dead.net). I don't know if the retail price will be higher when it hits the stores, but while GDP's price is not cheap in absolute terms (keep in mind that three concert tickets tend to run $120 these days), The Golden Road is well worth it if you have the scratch to spare. - John

Phil Phall Tour Going On Sale

09/05/01
The Paradise Waits Fall Tour has been announced, and the first set of shows goes on sale tomorrow at GDTS TOO. Pertinent information can be found on the GDTS Too Paradise Waits page, and the Phil Lesh Net 2001 Tour Calendar.

Problem Solved?

Return To Relative Normalcy at DeadBase
08/23/01
As many of you have noticed, our host suffered a major hardware failure over the weekend. I apologize for any inconvenience. It appears that the remaining kinks have been ironed out and that all our scripts are running happily. If you find otherwise, please let us know!

Going, Going...

DeadBase XI Sold Out in Hardcover
08/22/01
Unfortunately, we have sold out of the hardcover edition of DeadBase XI. Do not despair though: there are still a few copies left in paperback, and we have plenty of the previous edition available in both bindings (DeadBase X also covers the complete history of Grateful Dead performances). We do not expect to reprint DeadBase XI (it is possible that we will publish a DeadBase XII in a year or two), so if you had your heart set on this particular volume, you probably want to grab a copy of the paperback edition while they are still around.

DeadBase Sale

(updated 7/21/01)

Prices Fall for Annual Editions

Our six annual editions are now just $8 each, $20 for three, or a set of six for $30.
These yearbooks for 1988 - 1993 explore each year at a level of detail not possible in the roman-numeraled editions including complete timings and reviews for every show, and extensive photographs, surveys, ticket stubs, statistics, newspaper bibliographies, and much more.
Better still, you can add a six-book annual set to your DeadBase X order for just $10!
Details on this offer and two other DeadBase X bundles on our Sale Page.

Search Engine Debut

04/11/01
Our sister store, Dharma Rose, is being kind enough to provide the search engine and space to finally make the dream of an online searchable version of DeadBase a reality.
The search engine is another work in progress: more features are planned down the road. We welcome comments and suggestions in the DeadBase Forum.
DeadBase On-line Search

Boards Restored

02/09/01
We have finally fixed all our boards, including the Grateful Den, which was particularly obstinate. There are some residual problems, such as the view counts for all the articles have been reset. On the plus side, we have updated to a new version of the bulletin board software. We apologize for the inconvenience. Y'all come back now, y'hear?

Board Problems (sorry!)

01/30/01
Out of the blue (and after eight months of smooth sailing), our server is experiencing problems running our bulletin board scipts. Their experts are looking into it, and hope to have it solved soon. We apologize for any inconvenience. If this runs more than 24 hours of down time, we will move them over to Dharma Rose, where I have similar boards working at this time. Thank you for your patience.

Free Bears

01/10/01
Our sister store, Dharma Rose is holding bi-weekly drawings, two of them in fact, one for Grateful Dead Bean Bears, and another for T-shirts. If you like free stuff, check them out.

He's Gone

12/14/00
We were greatly saddened to day to learn of the passing of Rich Petlock. Rich was a good friend, and frequent contributor to DeadBase. In our early years, his assistance and advice was invaluable. We mourn the passing of an exceptional connoiseur of Grateful Dead and other music, and one of the kindest people we know.

Dick's Picks 19

(11/6/00)
My copy of Dick's Picks 19 arrived over the weekend, and it is fabulous. It is an excellent show (10/19/73 Oaklahoma City) though I should aknowledge my bias as 1973 is my favorite year. The mix and sound are also superb. You can read more opinion on the show (or contribute yours) in our Dick'sPicks Forum, or just order it from Grateful Dead Merchandising.
Edition 6 Bean Bears Are Back!
November 2, 2000
Our first order of these cute collectibles flew out the door almost as soon as we received them. Check out our favorite edition to date before they are gone again.
Bean Bears

One Click, Please

(10/24/00)
"If you go to http://health.yahoo.com/ and click on the pink ribbon, Yahoo will donate $1.00 to the Susan G. Komen Breast Cancer Foundation.One click. No forms, etc. Just a click. Spread the word" This apparently runs through the end of October, Breast Cancer Awareness Month.

Mail Order Today!

(7/10/00)
Mail Order for The Other Ones' (with Kreutzmann!) at Hartford, E. Rutherford, Syracuse, and Boston is today,
Ticket Info

View From The Vault

New Video Release!

(6/28/00)
Hoooooray!!!! The powers that be have just released a video, hopefully the first in a series of releases. Given their comment below, this could be the start of the most important movement in Deadhead circles since the advent of Dick's Picks. Even more promisng, the show is being released in three formats: VHS and PAL and DVD!

7/8/90 Three Rivers Stadium, Pittsburgh, PA

"Welcome to the first of what we hope will be a continuing series of releases from the Grateful Dead's video archive. It's been our pleasure to bring you the sonic treasures of the Vault for the past ten years. Now, we hope you'll enjoy the sights as well as the sounds.
"When the Grateful Dead's enormous popularity took the band from theaters to larger arenas, amphitheaters and stadiums in the 1980s and 90s, one fortuitous byproduct of the move was the introduction of large video screens, which allowed folks in the nether regions of the gigantic venues to see the band as something more than tiny specks in the distance. A top-notch video crew made it possible to get a close-up view from any seat in the house. And to our good fortune, someone had the foresight to preserve the performances on video tape. View From the Vault documents the aural and visual wonders of one hot night (musically and meteorologically speaking) at Pittsburgh's Three Rivers Stadium during the Summer tour of 1990. The video was produced using the master tapes from the original in-house video screen feed, utilizing the 2-track stereo soundboard audio mix. What you hear and see is what the audience experienced in real time-without the humidity, of course. "

And... if that isn't enough...

Dick's Picks Eighteen

2/3/78 Dane County Coliseum
2/5/78 Uni-Dome, Cedar Falls, Ia.

Dick's Picks Volume 18 - This CD set is a compilation of the two shows. The first disc is an aproxiamtion of an ideal first set combining material from both shows. The other two discs contain the meat of the respective second sets. The compilation of first set material is a bold idea which may not sit well with purists. But we can always collect and listen to the full shows, and frankly I would be more likely to listen to a best-of of the two first sets , than either first set. I am curious to hear how it came out.
(updated 6/22/00)
There have been lots of improvements over in our sister store, Dharma Rose. We are working hard to make this a truly exceptional online shopping experience. Drop on by and see for yourself. Comments, critiques, and suggestions are welcome at john@dharmarose.com.
Liquid Blue has released a cool new line of shirts for Deadheads: Dead Tour Distressed. This series has a wonderful nostalgic college athletic feel... they exude comfort. John is having a hard time making up his mind as to which he should buy and wear first; he is leaning towards Track & Field, Tour Alumni, Winged Foot, and European Road Crew.
Frisbees - We have three Grateful Dead design WHAM-O frisbees to our inventory. These are the real deal: 141 gram, with edge to edge graphics. Supplies of these beauties are limited.
For the dedicated collector, we have managed to find small numbers of most of the retired Bean Bears.

Dharma Rose offers:

Secure Shopping Cart - Our professional cart is easy to use, and protects your credit card number and personal information from prying eyes.
Competitive Prices.
Discounts - 5% off orders over $50 and 10% off orders over $100.
Search Engine - In addition to our easy-to-navigate store, we provide a search engine to help you locate specific styles, themes, or even teams which interest you.
Exceptional Customer Service - At Dharma Rose, our service is always friendly, prompt, and accommodating. In-stock items go out within twenty-four hours, and we will personally respond to e-mailed questions and concerns even sooner than that.
Privacy - We will never sell or trade your personal information to anyone.
Variety - In addition to over 60 Grateful Dead shirt designs, we also feature Nature and Animals, Star Wars, Sports (NFL, NHL, NCAA football and basketball), Fantasy, Native American, Allman Brothers, and Santana designs.
Visit Dharma Rose today!
(Thanks!)

Other Ones Tour Officially Announced

(6/12/00)
The e-mail from Grateful Dead Records arrived late last night, solemnizing what had long been known, The Other Ones were coming back, albeit without Phil. While Phil will undoubtedly be missed, I feel that this is a classic case where two tours will be better than one; it would be foolish to miss either Phil n Dylan or Furthur. We have taken the liberty of posting the full text of the announcement. Any changes in the schedule will likely be reported in the Tours Forum (along with reviews, ticket swaps, and the usual discourse).

Looking For A Few Good Shows...

(Tape of the Day Suggestions)

In order to keep the Tape du Jour feature fresh, I update it several months at a time. Occasionally, I receive ideas visitors after the fact, so I am soliciting suggestions for selections from 6/17/00 through 9/30/00 up front this time.
Generally, special attention is paid to shows which are significant anniversaries (multiples of 5); I also try keep some variety from day to day in the years represented. Finally, we want good/interesting shows, and ones that are available on tape. Obviously these considerations often conflict with one another.
Suggestions may be posted to the DeadBase Forum. I will upload the new database for the on Friday evening.

The Gorey Details of Lost e-Mail

(6/10/00)
Despite the best efforts of expert drive technicians, three and a half months of our e-mail has been irretrievably lost. Our main drive was pronounced DOA in a California clean room at 4:15 EST, the apparent victim of a fatal head crash.
While most of the contents of the drive will be mourned, it is the loss of our e-mail archive that will prove particularly devastating. Since February 22 (our last e-mail backup), we have received numerous corrections and reviews, about 6 unprocessed orders, and many addresses of old and new friends.
So, please contact us if:
  • you submitted any corrections, reviews, suggestions, etc. over the past few months
  • you placed an order in the last week of May or first week of June, and have not received it
  • you are Mike Rogers
  • you are writing from the offices of a government official, and want details on how to lose only 3.5 months of e-mail

A Hart-Felt Apology

(6/9/00)
The following message from Mickey Hart was released by Grateful Dead Productions the day after the Yahoo new story ran. We felt that it was important to publish the entire text here, rather than just providing a link.
I said some things in an interview a few days ago that I really regret. There is definitely a difference of opinion between Phil and the rest of us.
I myself remember Phil as my first friend in the Grateful Dead, the guy who would get down on the floor with me and write out the music in a hundred different ways. He was my compatriot in the low end of the machine. We lived together and laughed together for many years.
But the business stuff has overtaken our reason and made things very gray. The music between us has stopped and that is not good. The music has always mediated our differences, which were never insurmountable.
In my frustration with that, I succumbed to negativity, and in mock jest created this atmosphere of Phil-bashing. We should never attack each other. My humor perhaps doesn't look good in print but as the reporter who took my account agrees, it was a tongue in cheek- ha-ha kind of thing.
It especially bums me that it came across as having anything at all to do with the young man, God bless him, who was thoughtful enough to anticipate his death and make the greatest gift anyone can make -- life. My apologies to his family and his memory. And, for that matter, to Phil and our greater Dead family.
I've always known that the negative is no way to go -- I forgot myself and my tongue took me over the line. It is not over yet. The music will see us through. I have to believe that.

Hard Drive Crash => Lost e-Mail

(6/8/00)
We recently suffered an ugly drive crash, and while almost all our data was on another drive (and backed up), all our archived e-Mail since 2/22 was lost. The drive is now at a repair specialist; we should know in the next few days whether the data will be recovered. In the mean time, if you placed an order with us over the past ten days or so, you may want to place it again.

Remodeling at the Grateful Den

While one of our bulletin boards (Tech Corner) has been sent on sabbatical due to lack of interest, traffic on the main board has picked up sharply of late. Come on by the Grateful Den and check out the new furniture. Decorating tips are welcome.

Yahoo Reports on Dead Matters

Yahoo posted a rather provocative article on the immanent on-line release of the Dead's vault, and the rift within the band that the plan has caused. You can see the article in their archives: Dead Parts Ways Over Concert Archive
Be forewarned that it contains some rather harsh language... so harsh that it will likely be fodder for some lively discussion over at the Grateful Den.

Mickey Hart Cybercast on Friday

(5/10/00)
Rally has just posted a heads up in the Tours Forum that Mickey's show at the Hampton Beach Casino this coming friday will be webcast by DiscJockey.Com. The show is Friday, May 12th and starts around 7 with interviews before the show.

Tape of the Day Alert!

Harpur State 30th Anniversary

(5/2/00)
For those of you who do not pay close attention to the Tape du Jour feature, today is a red-letter day in Grateful History. Thirty years ago tonight, the Dead played one of their finest concerts. So, break out your favorite recording of Harpur State, be it Dick's Picks v. 8, or a choice tape, and bliss out to Viola Lee for a while.

New Look For deadbase.com

(5/1/00)
Upon the advice of our high-priced consultants, we have changed the structure of this site. You are encouraged to bookmark this page instead of the welcome index page. Thanks for your support.

Fifteen Minutes of Fame

(5/1/00)
New Hampshire's largest and most influential newspaper has published an article by Gil Bliss on DeadBase's John Scott. A long time deadhead, Gil has recently written pieces on Bob Weir, Mickey Hart, and David Grisman for the famously conservative paper. Esteemed company indeed!
For the time being, you can view the text of the article here.

Heads Up for NH Deadheads

(4/30/00)
Tomorrow (Monday the 1st) there will be an article in the Business Section of the NH Union Leader on DeadBase's own John Scott. We are, indeed, everywhere!

Phil 'n' Dylan & Mickey Hart Summer Tours

(4/27/00)
The dates for these two hot summer events have been posted over in the Tours Forum.

Phil & Friends

(updated 4/11/00)
Lucky John gets to go to all four Orpheum shows. Three down, and one to go. If you still have a chance to see some Phil shows this Spring, don't let them pass you by.
4/10/00 Orpheum, Morning Dew - John Scott
In the mean time, we implore those of you who are going, or who have gone to any shows on this tour, to contribute to the Tours Forum. We would like this to become a place for interactive discussion on these wonderful live events. John has put up some skeletal comments on the first two shows, each with a photograph (more photos to come after the stand is done), but there is lots of room for corrections, comments, color, questions. Please!
Reviews can also be submitted to the Phil & Friends Essay section.
Thanks for your input!

What Was New

(old news)

You are the #!/usr/contrib/bin/perl5 # cgi-bin access counter program # Version 4.0.7 # # Copyright (C) 1995 George Burgyan # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or (at # your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # A full copy of the GNU General Public License can be retrieved from # http://www.webtools.org/counter/copying.html # # gburgyan@webtools.org # # George Burgyan # 1380 Dill Road # South Euclid, OH 44121 # # For more information look at http://www.webtools.org/counter/ ######################################################################## # # CHANGE THESE TO SUIT YOUR SITE # # The default language option (english, french, swedish) $default_lang = "english"; # The name of the file to use. You should probably give this an absolute path $FileName = "/var/www/virthost/deadbase/private-cgi/access_count"; # Replace with a list of regular expression IP addresses that we # are supposed to ignore. If you don't know what this means, just use # "\." instead of periods. Comment out entirely to ignore nothing. #@IgnoreIP = ("199\.18\.203\..*", # "199\.18\.159\.1", # ); @IgnoreIP = ("204\.97\.234\.2","204\.97\.234\.5", "204\.97\.234\.12","204\.97\.234\.3", "204\.97\.234\.9","204\.97\.234\.10"); # Aliases: Set this up so that diffent pages will all yield the same # count. For instance, if you have a link like "index.html -> home.html" # set it up like ("/index.html", "/home.html"). Make sure you give a full # path to it. This will treat "/index.html" as if it were "/home.html". #%Aliases = ("/fakename.html", "/realname.html", # "/index.html", "/home.html", # ); # AUTOMATICALLY SET BY INSTALL!! Modify only if necessary!!! # # BaseName: set to whatever you have counter installed as. This is # used to derive the arguments. No not touch the next comment. ### AUTOMAGIC ### $BaseName = "counter"; # counter or counterbanner or counterfiglet # # Outputs the number of times a specific page has been accessed. # The output depends on which page 'called' it, and what the program # is named: # # The counter can "take arguments" via its name. That is, if you tack # -arg to the end of the program name, -arg is taken to be an argument. # For example, if you call the counter 'counter-ord', '-ord' is considered # an argument, and an ordinal count (1st, 2nd, 3rd, ...) will be printed # instead of (1, 2, 3, ...). Note that counterord does the same thing as # counter-ord for backward compatibility. # # Currently recognized arguments: # # -f=font sets "font" to be the font for figlet # -lang=lang sets the language used to ordinalize to "lang" # -nc no count; don't to write the incremented count back to the file # -nl no link; don't automatically generate a link # -nd no display; don't display anything, just count # -ord make an ordinal count instead of regular # -doc=document override the DOCUMENT_URI environment variable # # Example: counterfiglet-ord-f=bigfont-nc # # This will cause the counter to call figlet as the output routine, printing # in a big font an ordinal count, without updating the access count file. # Note that the order of arguments is irrelevant so long as you spell the # file name correctly. It is generally assumed that the ability to take # different arguments/use different output routines is done with symlinks: # i.e. ln -s counter counterfiglet-ord-f=bigfont-nc # # More complete documentation can be found at # http://www.webtools.org/counter/ # ######################################################################## # # Thing that shouldn't really need changing, but are configurable anyway. # # Maximum number of times to try to lock the file. # Each try is .1 second. Try for 1 second. $MaxTries = 10; # Set this to point to something, or comment it out, and it # won't be a link at all. #$Link = "http://www.webtools.org/counter/"; # Whether or not to use locking. If perl complains that flock is not # defined, change this to 0. Not *really* necessary because we check # to make sure it works properly. $UseLocking = 1; # What version of the counter file format are we using? $FileVersion = "02.000"; # Common names of the counter to install... @CommonExtensions = ("-ord", # Ordinam "figlet", # Figlet'ed "figlet-ord",# Ordinal figlet "banner", # Bannered "banner-ord",# Ordinal banner ); # ######################################################################### # # Misc documents to refer people to in case of errors. # $CreateFile = "[Error Creating Counter File -- Click for more info]"; $AccessRights = "[Error Opening Counter File -- Click for more info]"; $TimeoutLock = "[Timeout locking counter file]"; $BadVersion = "[Version access_count newer than this program. Please upgrade.]"; ######################################################################### # # The actual program! ### Stage 1 ### ### Parse the arguments... (just ignore this part) # Get arguments from program name. Argh...what a horrible way to do it! $prog = $0; $prog =~ s/(\.cgi|\.pl)//; #strip .cgi|.pl name extension $prog =~ s!^(.*/)!!; # separate program name $prog =~ s/\\(.)/sprintf("%%%02x", ord($1))/ge; # quote \c to %xx ($printer, @args) = split(/-/, $prog); # args are separated by dashes $printer =~ s/%(..)/pack("c", hex($1))/ge; # unquote printer function name $printer =~ s/$BaseName/counter/; # Make it cannonical. # This gets path info, which is only applicable if you are using our # ssis script (see above). This makes counter/ord the same as counter-ord push(@args, split("/", $ENV{"PATH_INFO"})) if $ENV{"PATH_INFO"}; # put them in assoc array %arg foreach (@args) # means do this for each element in the array { s/%(..)/pack("c", hex($1))/ge; # unquote %xx /^([^=]*)=?(.*)$/; # extract "=" part, if any $arg{$1} = $2 ? $2 : 1; } if ($ARGV[0] eq '-install') { &CheckPerl; &SetBaseName; &MakeCommon(0); exit(0); } if ($ARGV[0] eq '-installforce') { &CheckPerl; &SetBaseName; &MakeCommon(1); exit(0); } if ($ARGV[0] eq '-unlock') { open(FILE,"$FileName"); &UnlockFile(FILE); exit(0); } undef $Link if $arg{'nl'}; # make link? ### Stage 2 ### ### Print out the header # Print out the header print "Content-type: text/html\n\n"; ### Stage 3 ### ### Open the access_count file for read-write taking all the precautions # Make sure the file exists: if (!(-f $FileName)) { if (!open (COUNT,">$FileName")) { # Can't create the file print $CreateFile; exit 1; } else { # We got the file, print out the version number print COUNT "$FileVersion\n"; $version = 2; } } else { if (!((-r $FileName) && (-w $FileName))) { # Make sure that we can in fact read and write to the file in # question. If not, direct them to the FAQ. print $AccessRights; exit 1; } if (!open (COUNT,"+<$FileName")) { # Now make sure it *really* opens print $AccessRights; # ...just in case... exit 1; } # Try to read in a version number $version = ; if (!($version =~ /^\d+.\d+$/)) { # No version number, assume version 1 and reset the file. $version = 1; seek(COUNT,0,0); } } # This is for the future: the access_count file will have a version number. if ($version > 2) { print $BadVersion; exit 1; } ### Stage 4 ### ### Attempt to lock the file $lockerror = &LockFile(COUNT); # You would figure that $MaxTries would equal 0 if it didn't work. The # post-decrement takes it to -1 when the loop finally exits. if ($lockerror) { print $TimeoutLock; exit(0); } ### Stage 5 ### ### Check if we need to update the file to a newer version if ($version < 2) { &UpdateVersion1; } ### Stage 6 ### ### Convert the information the server gave us into the document ### identifier. # Make sure perl doesn't spit out warnings... if (defined $ENV{'DOCUMENT_URI'}) { $doc_uri = $ENV{'DOCUMENT_URI'}; } else { $doc_uri = ""; } # Campatibility: Version 2 files have the server name in front if and # only if it doesn't have a "~" in it. $old_uri = $doc_uri; # Add the server name in front to support multi-homed hosts if and only if # it doesn't have a "~" in it. (usernames are global in most multi-homed # settings if (defined $ENV{'SERVER_NAME'} && !($doc_uri =~ /~/)) { $doc_uri = $ENV{'SERVER_NAME'} . "/" . $doc_uri; } if (defined $arg{'doc'}) { $doc_uri = $arg{'doc'}; } $doc_uri = $Aliases{$doc_uri} if defined $Aliases{$doc_uri}; ### Stage 7 ### ### Find the relevant place in the file $location = tell COUNT; while ($line = ) { # Read the file line-by-line. if (($uri,$accesses) = ($line =~ /^'(\S*)' (\d\d\d\d\d\d\d\d\d\d)$/)) { # An old line if ($uri eq $old_uri) { &ConvertDocV1($doc_uri,$old_uri,$accesses,$location); last; } } elsif (($uri,$accesses,$flags) = ($line =~ /^'(\S*)' (\d\d\d\d\d\d\d\d\d\d) (\w\w\w\w)$/)) { # A new line if ($uri eq $doc_uri) { $flags = hex($flags); last; } } last if ($uri eq $doc_uri); $location = tell COUNT; #reset the fields $accesses = 0; $flags = 0; } ### Stage 8 ### ### Update the access count of the file $accesses += 1; # *NOT* '++' because we don't want '++'s magic ### Stage 9 ### ### Figure out what to print out # If we have to ordinalize, do it now. if (defined $arg{'ord'}) { if (defined $arg{'lang'}) { $ord = eval("&ordinalize_$arg{lang}($accesses)"); } else { $ord = &ordinalize($accesses); } } else { $ord = ""; } $to_print = $accesses . $ord; # Give it to the printer function to actually produce the output from the # ascii text that we have (to_print) ($count, $nLink) = eval("&output_$printer('$to_print')"); # If the above line gave us an error, default to just the text. if ($@) { ($count, $nLink) = &output_counter($to_print); } ### Stage 10 ### ### Now we actually tell the browser what the count is. if (! $arg{"nd"} ) { # If we print anything # Print out a link to something informative (if we were requested to) print "" if $nLink; print $count; print "" if $nLink; } ### Stage 11 ### ### Check if we are supposed to update the count in the file. (ie. we're ### not ignoring the host that just accessed us) # Make sure we are not ignoring the host: $ignore = 0; $ignore = grep($ENV{"REMOTE_ADDR"} =~ /$_/, @IgnoreIP) if defined ($ENV{"REMOTE_ADDR"}); $ignore = $ignore || $arg{"nc"}; ### Stage 12 ### ### Actually write the updated information back to the file if (!$ignore) # If we aren't ignoring this access { # Now update the counter file seek(COUNT, $location, 0); $longaccesses = sprintf("%010.10d", $accesses); $hexflags = sprintf("%04.4x", $flags); print COUNT "'$doc_uri' $longaccesses $hexflags\n"; } &UnlockFile(COUNT); close COUNT; ####################################################################### # # Support functions # # translate_output # # Quote any special characters with HTML quoting. sub translate_output { local($string) = @_; $_ = $string; s/è/è/g; return $_; } sub LockFile { local(*FILE) = @_; local($TrysLeft) = $MaxTries; if ($UseLocking) { # Try to get a lock on the file while ($TrysLeft--) { # Try to use locking, if it doesn't use locking, the eval would # die. Catch that, and don't use locking. # Try to grab the lock with a non-blocking (4) exclusive (2) lock. # (4 | 2 = 6) $lockresult = eval("flock(COUNT,6)"); if ($@) { $UseLocking = 0; last; } if (!$lockresult) { select(undef,undef,undef,0.1); # Wait for 1/10 sec. } else { last; # We have gotten the lock. } } } if ($TrysLeft >= 0) { # Success! return 0; } else { return -1; } } sub UnlockFile { local(*FILE) = @_; if ($UseLocking) { flock(FILE,8); # Unlock the file. } } #################################################################### # # Installation helpers # # SetBaseName # # Change the counter program itself to set the basename sub SetBaseName { local($name) = $0; $name =~ s/^.*\/([^\/]+)$/$1/; # Strip off any of the path if ($name eq $BaseName) { # The way we're set up now!!! return; # Don't need to change a thing. } if (!open(COUNTERFILE, "+<$0")) { print "Can't modify program. Set \$BaseName manually.\n"; return; } print "Configuring \$BaseName variable...\n"; local($oldsep) = $/; undef($/); local($program) = ; # The next line does all the magic. $program =~ s/\#\#\# AUTOMAGIC \#\#\#\n\$BaseName = \"[^\"]+\";\n/\#\#\# AUTOMAGIC \#\#\#\n\$BaseName = \"$name\";\n/; seek(COUNTERFILE,0,0) || return; truncate(COUNTERFILE,0); print COUNTERFILE $program; close COUNTERFILE; } # CheckPerl # # Make sure that the "#! /[path]/perl" points to something real... sub CheckPerl { if (!open(COUNTERFILE, "<$0")) { print "Can't check to make sure Perl is in the right place.\n"; return; } print "Checking to make sure Perl is found properly...\n"; $firstline = ; ($command) = ($firstline =~ /^\#! *([^\s]+) *$/); close(COUNTERFILE); if (! -x $command) { print "The location of Perl is misconfigured. Please edit the\n"; print "first line of this program to point to the locally installed\n"; print "copy of perl.\n\n"; print "Currently, it is configured to be \"$command\", however,\n"; print "that file either does not exist or is not a program.\n\n"; print "Some common locations for Perl are:\n"; print " /usr/bin/perl\n"; print " /usr/local/bin/perl\n"; print " /bin/perl\n"; print " /opt/gnu/bin/perl\n\n"; exit; } } # MakeCommon # # Make some common links to the counter sub MakeCommon { local($force) = @_; local($ext); print "Installing the counter...\n"; print " ...making counter executable\n"; chmod(0755,$0); local($path, $name, $cgi); $name = $0; if ($name =~ /^(.*\/)([^\/]+)$/) { $path = $1; $name = $2; } if ($name =~ /^(.*)(\.cgi)$/) { $name = $1, $cgi = $2; } foreach $ext (@CommonExtensions) { print " ...making link from $path$name$cgi to $path$name$ext$cgi\n"; if (!&MakeLink("$path$name$cgi","$path$name$ext$cgi",$force)) { # An error occured while making the link. :-( print " *** An error occured while making the link.\n"; } } if ($symlink_exists == 0 && $link_exists == 0) { print "* NOTE * Your system does not support symbolic or hard links,\n"; print " copies made instead. If you modify the counter, you must\n"; print " run counter -install again to recopy it to the other files.\n"; } print "...done!\n"; } # MakeLink # # Actually create the link. sub MakeLink { local($oldname,$newname,$force) = @_; # Check to see if we can make symbolic links instead of hard links if (!defined $symlink_exists) { $symlink_exists = (eval 'symlink("","");', $@ eq ''); } # Check to see if we can make a link if we can't make a symlink if (!symlink_exists) { $link_exists = (eval 'link("","");', $2 eq ''); } if ($force) { # Check to see if the file exists if (-e $newname) { if (!unlink ($newname)) { return 0; } } } if ($symlink_exists) { return symlink($oldname, $newname); } elsif ($link_exists) { return link($oldname, $newname); } else { # Copy it the old-fashioned way... *sigh* open(OLDFILE, $oldname) || die "Can't open $oldname for copy"; open(NEWFILE, ">$newname") || die "Can't open $newname for write"; while() { print NEWFILE $_; } close(NEWFILE); close(OLDFILE); } } #################################################################### # # Ordinalizing functions # # ordinalize # # Call the appropriate ordinalize function for the default language sub ordinalize { local($count) = @_; if (defined $arg{'lang'}) { return eval("&ordinalize_$arg{lang}($count)"); } else { return eval("&ordinalize_$default_lang($count)"); } } # ordinalize_english # # Figure out what suffix (st, nd, rd, th) a number would have in ordinal # form and return that extension. sub ordinalize_english { local($count) = @_; local($last, $last2); $last2 = $count % 100; $last = $count % 10; if ($last2 < 10 || $last2 > 13) { return "st" if $last == 1; return "nd" if $last == 2; return "rd" if $last == 3; } return "th"; # Catch "eleventh, twelveth, thirteenth" etc. } # ordinalize_french # # Trivial... Return the extension for french. The only exception is 1. # Thank you Chris Polewczuk sub ordinalize_french { local ($count) = @_; if ($count == 1) { return "'ière"; } else { return "ième"; } } # ordinalize_swedish # # A function to ordinalize in Swedish. Thanks go to Johan Linde # for the code! sub ordinalize_swedish { local($count) = @_; local($last, $last2); $last2 = $count % 100; $last = $count % 10; if ($last2 < 10 || $last2 > 12) { return ":a" if ($last == 1 || $last == 2); } return ":e"; } ######################################################################## # # Output functions # # The following are the routines that actually convert the number # of accesses into something that we print out. # # The name of each function is "output_" followed by the program's name. # For instance, is the program is called "counter" then "output_counter" # will be called; a program called "counterbanner" will call # "output_counterbanner" to get the output. # # If the function is not defined, then "output_counter" will be called. # # output_counter # # The simplest function: just returns the number of accesses and the link. sub output_counter { local($count) = @_; return &translate_output($count), $Link; # we return the count and the link } # output_counterord # # Return the number of accesses as an ordinal number. (ie. 1st, 2nd, 3rd, 4th) sub output_counterord { local($count) = @_; return &translate_output($count . &ordinalize($count)), $Link; } # output_counterbanner # # A somewhat silly one that uses the "banner" command to print out the # count. :) You might need to change the path to make it work. sub output_counterbanner { local($count) = @_; $banner = `banner $count`; return "

$banner
"; # return no link here (it would be annoying) } # output_counterfiglet # # An even sillier one than counterbanner. :) sub output_counterfiglet { local($count) = @_; $fig = "echo $count | /usr/games/figlet"; # setup command line $fig .= " -f $arg{'f'}" if $arg{"f"}; # use a different font? $fig = `$fig`; $fig =~ s!&!&!g; $fig =~ s!
" . $fig . "
"; # note no link here, either } ######################################################################### # # Conversion functions # # UpdateVersion # # Convert a version 1file into a version 2 file. sub UpdateVersion1 { local ($contents,$dummy); local ($oldsep) = $/; $/ = ""; seek(COUNT,0,0); # Go to the beginning of the file $contents = ; seek(COUNT,0,0); print COUNT "$FileVersion\n"; print COUNT $contents; seek(COUNT,0,0); $/ = $oldsep; $dummy = ; # Skip the new line } # ConvertDocV1 # # Convert the a version 1 line into a version 2 line sub ConvertDocV1 { local ($doc_uri,$old_uri,$accesses,$location) = @_; local ($contents,$dummy,$oldsep); $oldsep = $/; seek (COUNT,$location,0); # Skip the line in question $dummy = ; $/ = ""; # Read in the whole file $contents = ; seek (COUNT,$location,0); local ($longaccesses,$hexflags); $longaccesses = sprintf("%010.10d", $accesses); $hexflags = sprintf("%04.4x", $flags); # Print out the new stuff print COUNT "'$doc_uri' $longaccesses $h" } entity to access this site.