From: edp328j@monu6.cc.monash.edu.au (Ultrix Systems Support)
Subject: Re: Torek a hack? [Re: What must I learn...]
Summary: The full story of coke on the internet
Organization: Monash University, Caulfield Campus
Date: Thu, 13 Aug 1992 16:21:07 GMT

> [] Regarding Re: Torek a hack? [Re: What must I learn...];
> [] avalon@coombs.anu.edu.au (Darren Reed) writes:
> 
>     dr> Dunno about coffee/cappucino, but coke definately :-) I
>     dr> remeber a post ages ago about a finger daemon hooked upto a
>     dr> coke machine so they knew how cold the coke was likely to be -
>     dr> not something for a unix rookie :)

After much searching I finally found the following:

-----------------------------------------------------------------------

The Only Coke Machine on the Internet

Since time immemorial (well, maybe 1970) the Carnegie-Mellon CS
department has maintained a departmental Coke machine which sells
bottles of Coke for a dime or so less than other vending machines
around campus. As no Real Programmer can function without caffeine, the
machine is very popular. (I recall hearing that it had the highest
sales volume of any Coke machine in the Pittsburgh area.) The machine
is loaded on a rather erratic schedule by grad student volunteers.

In the mid-seventies expansion of the department caused people's
offices to be located ever further away from the main terminal room
where the Coke machine stood. It got rather annoying to traipse down to
the third floor only to find the machine empty - or worse, to shell out
hard-earned cash to receive a recently loaded, still-warm Coke. One day
a couple of people got together to devise a solution.

They installed micro-switches in the Coke machine to sense how many
bottles were present in each of its six columns of bottles. The
switches were hooked up to CMUA, the PDP-10 that was then the main
departmental computer. A server program was written to keep tabs on the
Coke machine's state, including how long each bottle had been in the
machine. When you ran the companion status inquiry program, you'd get a
display that might look like this:

		EMPTY	EMPTY	1h 3m
		COLD	COLD	1h 4m

This let you know that cold Coke could be had by pressing the
lower-left or lower-center button, while the bottom bottles in the two
right-hand columns had been loaded an hour or so beforehand, so were
still warm. (I think the display changed to just "COLD" after the
bottle had been there 3 hours.)

The final piece of the puzzle was needed to let people check Coke
status when they were logged in on some other machine than CMUA. CMUA's
Finger server was modified to run the Coke status program whenever
someone fingered the nonexistent user "coke". (For the uninitiated,
Finger normally reports whether a specified user is logged in, and if
so where.) Since Finger requests are part of standard ARPANET (now
Internet) protocols, people could check the Coke machine from any CMU
computer by saying "finger coke@cmua". In fact, you could discover the
Coke machine's status from any machine anywhere on the Internet!  Not
that it would do you much good if you were a few thousand miles away
...

As far as I know nothing similar has been done elsewhere, so CMU can
legitimately boast of having the only Coke machine on the Internet.

The Coke machine programs were used for over a decade and were even
rewritten for Unix Vaxen when CMUA was retired in the early eighties.

The end came just a couple years ago when the local Coke bottler
discontinued the returnable, coke-bottle-shaped bottles. The old
machine couldn't handle the non-returnable, totally-uninspired-shape
bottles, so it was replaced by a new vending machine. This was not long
after the New Coke fiasco (undoubtedly the century's greatest example
of fixing what wasn't broken). The combination of these events left CMU
Coke lovers sufficiently disgruntled that no one has bothered to wire
up the new machine.

I'm a little fuzzy about the dates, but I believe all the other details
are accurate. The man page for the second-generation (Unix) Coke
programs credits the hardware work to John Zsarnay, the software to
David Nichols and Ivor Durham. I don't recall who did the original
PDP-10 programs.

Tom Lane

-----------------------------------------------------------------------