Subscribe: by Email | in Reader

Telnet Song -- Guy L Steele, Jr

       
(Poem #1419) Telnet Song
 There is a program called TELNET to get to another CPU.
 Control up-arrow is the escape; it's doubled to send it through,
 and "quit" is control up-arrow Q.

 A hacker once used TELNET to get to another CPU.
 He knew he could quit whenever he wanted to: all he had to do was type
 control up-arrow Q.

 Instead the hacker used TEL-NET to get to another CPU.
 He knew he could quit whenever he wanted to: all he had to do was type
 control up-arrow [at i-th time, repeat 2^i times]
 Q.
 [repeat verse n times; the choice of n is free]

 The hacker soon got bored with this, and wanted to get back.
 He sighed, and started the exponential popping of the stack:

 The hacked flushed the TEL-NET to the most distant CPU:
 He couldn't log out until he had killed them all,
 counting up powers of two: he typed
 control up-arrow [at i-th time, repeat 2^(n-i+1) times]
 Q. [repeat n times]

 Whew!

 The hacker's eyes were bloodshot; his fingers, black and blue;
 He wanted to log out and and go home to bed, and sleep for a day or two.
 He typed L O G O U T ... carriage return ...

 The hacker was on a network with only twenty CPU's.
 But if he had telnetted to them all,
 he would not yet be through with typing
 control up-arrow [repeat 7 times]
 Q!
-- Guy L Steele, Jr
Note: This was written after an article by Donald E. Knuth, titled "The
Complexity of Songs":
    D.E. Knuth, 'The Complexity of Songs', Communications of the ACM 27 (4)
    pp. 345--348, April, 1984 (repetitions indicated; the song is only sung
    correctly if the appropriate number of repetitions is used)
    Some comments: Strictly speaking, the song is not part of the article;
    it was appended afterwards. The composer and lyricist is Guy L. Steele,
    Jr. The melody has a certain haunting quality that is quite hard to
    convey in ASCII text. I don't know whether it has ever been played. The
    composer has email, so it shouldn't be too hard to find out.
        -- http://www.poppyfields.net/filks/00222.html

  (Sitaram points out that that last bit is a dig at Knuth's refusal to use
  email. :))

  2^i is 2*2..*2 [i times], e.g. 2^5 = 2*2*2*2*2 = 32

  I've explained the maths behind the song in a postscript (it gets long)

Two of the more delightful aspects of hacker culture [see links] are an
abundant and enthusiastic creativity, and a strong sense of play.
Unsurprisingly, these have combined to produce a large body of verse,
ranging from esoteric in-jokes to catchy and accessible song parodies, and
even some genuine "poetry". There is a marked, qualitative difference from
poems like yesterday's, though - this is not a case of poets embracing the
brave new world, but rather the denizens of that world embracing verse, a
look from the inside rather than from the outside. (There is a significant
overlap with science fiction fandom's filk music, not least because so many
fans are hackers and vice versa, but the two are nonetheless different
genres).

Today's song is definitely one of the classics of the genre, and not just
for its distinguished (if you'll forgive the understatement) authors -
Kunth's notion of song complexity has an irresistible combination of
quirkiness and serious academic value, and Steele's song highlights the
fun factor while providing a good intuitive grasp of Knuth's point. And
while the verse itself isn't as clever as some of the others out there, it
has a nicely hypnotic rhythm that fits the "trapped in an exponential loop"
nature of the song.

martin

[Links]

"Hacker" is used throughout in the original sense of the word - see
http://www.catb.org/~esr/jargon/html/H/hacker.html

[broken link] http://www.cs.sunysb.edu/~algorith/lectures-good/node2.html for some idea of
what is meant by "the complexity of songs".

[broken link] http://groups.google.com/groups?selm=ANDERS.90Jun7131354%40mago.uio.no lists
chords for the song

Biography of Steele:
  [broken link] http://www.sls.csail.mit.edu/~hurley/guysteele.html
and of Knuth:
  http://www-gap.dcs.st-and.ac.uk/~history/Mathematicians/Knuth.html

The Jargon Files:
  http://www.catb.org/~esr/jargon/

And a great collection of computer-related songs:
  http://www.poppyfields.net/filks/fullindex.html

[PostScript]

A little digression into mathematics:

  There is a program called TELNET to get to another CPU.
  Control up-arrow is the escape; it's doubled to send it through,

An 'escape' is a character that sends the *next* character not to the
current session but to the one below it in the stack. So, say our intrepid
hacker logged in to machine A, telnetted to B, and from B telnetted to C

His stack now looks like this: [hacker -> C -> B -> A]. Anything he types
gets executed by machine C. Now supposing he wants to send a keystroke to
machine B instead? What he needs to do is to escape the keystroke. Escape,
here, is control-up arrow, so to type 'HELLO' on machine B, he needs to
type:
control-uparrow H control-uparrow E control-uparrow L control-uparrow
L control-uparrow O

or, using ^| as a shorthand for the control-up arrow key sequence,

^| H ^| E ^| L ^| L ^| O

for a total of 15 keystrokes (or 10 if you count ctrl-up arrow as one
keystroke even though it involves two physical keys).

Now supposing he wanted to send something to machine A? If he types ^|, the
keystrokes get sent to B - what he wants to do is type ^| on machine B, so
that the next character goes to machine A. But how does he type a ^| on B?
The song tells us that:
 Control up-arrow is the escape; __it's doubled to send it through,__

so we type ^|^| to send a ^| to machine B. So to send, say, an "X" to
machine A, we need to type ^|^|X, right? Nope - because the ^|^| sends a ^|
to machine B, and then the X goes to *machine C*, the machine at the top of
the stack. To send the X to machine A, we need to send a ^|X to machine B.
And to do that, we need to send a ^|^| to C (which sends a ^| to B), and
then a ^|X to C (which sends an X to B), at which point we'll have sent a
^|X to B, which duly sends the X to A.

By this point, it should be clear how fast the number of keystrokes can blow
up as we add even one more machine to the stack. So let's go ahead and
complete the demonstration by logging out of A.

        Press  C   B   A
          ^|  ^|               C has a ^|, will pass the next key to B
          ^|      ^|           B has a ^|, will pass its next key to A
          ^|  ^|  ^|           C has a ^|, will pass the next key to B
          ^|Q         ^|Q      the ^|Q gets passed to C which passes it to B
                               which passes it to A which logs out

Two telnet sessions (A->B and B->A), and a total of 4 (2^2) control-up arrows
before the Q, as Steele said. Logging out of four machines is left as an
exercise :)

(Note that I assume control-uparrow-Q is a single keystroke, rather than a
control-uparrow followed by a Q, otherwise the song doesn't work)

martin

45 comments: ( or Leave a comment )

Frank O'Shea said...

What are you doing? One of the reasons I like poetry is that it gets me
away from the mindlessness of the computer.

Seriously, this is the kind of thing that gives poetry a bad name.

Shame on you.

Frank

Ian Baillieu said...

Boring ... boring ... boring ... !
This is not poetry. Nor is it mathematics. And I wonder
how many computer literati really find it amusing or clever.
I mean, why couldn't this gormless hacker solve his 'escape'
problem simply by shutting down his PC?
If this is one of the classics of hacker verse genre, please
spare us the rest of it.

John.Cowan said...

Control-uparrow Q is indeed a control-uparrow (Ctrl+Shift+6 on the
keyboard) followed by a Q. The idea is that the remotest system
at any one time has to receive a control-uparrow (which is done
by sending 2^i control-uparrows to the home system) followed by a
Q in order to disconnect from it.

As for "shutting down his PC", this song way predates PCs. In
those days hackers had dumb terminals hard-wired to a local timeshared
system. You could turn them off, but if you turned them on again,
you'd be right back where you were before.

And yes, I think it's amusing and clever.

Anonymous said...

Hey Guy!

Q wonnnerfull wonnerfull wonnerfull wonnerfull wonnerfull wonnerfull wonnerfull Q

A.M.T.K. Class of '73
Say hello to Louis Cohen for me.
arnold.kunian@kunian.com

Ideas de negocios said...

Thanks for taking the time to discuss this, but I am firmly convinced of this and love to learn more about the subject. If possible, acquire knowledge, would you update your blog with more information? It is very helpful to me

gandhi bittu said...

Respected Sir
Guy Lewis Steele Jr.
(Great Inventor, Creative Thinker, Computer Scientist, Thinker)


SUB:-"A New Search Engine Invention Project"


Howdy Sir :)


Hello I am from India. Presently I have designed a search engine which does not exist in the whole world. I make any thing in I.T. field whenever it does not exist in the whole world. (With Some Coding In Php Language) It's not possible to make a search engine by a single person. Your valuable co-operation is needed for this. I wish to start this Search Engine project as a co-founder. This project has a very big potential.


Just for your info I have had and idea about "Cloud" long bade in 2003, but due to local circumstances in India. I could not complete that project. Co-incidentally "Google Waves" concept also had strilen in my mind already before it existed. :)

Also Sir My stories are selected in some books as a co-author. My stories are going to be considered in these 8 next books.

1) "The Purpose Driven Life" - Rick Warren
2) "Little Read Success Book" - Terrie Anderson

3) "Sedona Training Administration Book" - Ben Bridgestone
4) "50 Success Classics Book" - Butler Bowdon
5) "Energy Psychology" Dr. Fred Gallo
6) "Life Balance" Jeff Davidson's
7) " The Eldon Taylor Book "
8) "Life Just Not That Complicated Book" Jim Dineen


Awaiting reply

Have a great day

Yours Faithfully
Bittu Gandhi
(Researcher, Web Developer, Author, International Record Holder)
______________________________ ______________________________ ____________
https://plus.google.com/107568688413984703159

Anonymous said...

http://www.youtube.com/watch?v=2DLp-vE3AKg
Cheers

(:

William Smith said...

Thanks for the sharing, this blog is very intersting. Hotel Cleaning Services | WOMEN'S FASHION PRODUCTS | It's very informarmative and very knowladgeable blog.

Anonymous said...

We can help you to overcome them. The higher rates of interest.
Debt consolidation can help you often with a mouse button click
eliminate your debts, you must apply for a secured debt consolidation loan, used right, can help you with
your cash issues. Sometimes all you need to check if
there are debts and debt solutions must be found and
found as soon as possible and incur less interest.


my page - like it - ,

Anonymous said...

good
Obat Wasir Tradisional untuk Ibu Hamil
Obat Ambeien Tradisional untuk Ibu Hamil
Obat Wasir yg Tradisional untuk Ibu Hamil
Pengobatan Wasir Tradisional untuk Ibu Hamil
Pengobatan Wasir yg Tradisional untuk Ibu Hamil
Obat Wasir Tradisional Mujarab
Obat Wasir Tradisional Ampuh
Obat Wasir Tradisional Mujarab dan Alami
Obat Wasir Tradisional Mujarab dan Ampuh
Pengobatan Wasir Tradisional Mujarab
Obat Wasir Tradisional Terbaik
Pengobatan Wasir Tradisional Terbaik
Obat Wasir Tradisional Terbaik dan Aman
Obat Wasir yg Tradisional Terbaik
Obat Wasir Tradisional Terbaik dan Ampuh
cara menghilangkan kutil di vagina
cara menghilangkan kutil pada vagina
obat untuk menghilangkan kutil di vagina
pengobatan untuk menghilangkan kutil di vagina
cara menghilangkan kutil kelamin di vagina
pengobatan kutil kemaluan
pengobatan kutil kemaluan alami
pengobatan kutil kemaluan ampuh
pengobatan kutil kemaluan yg ampuh
pengobatan kutil kemaluan yang mujarab
cara menghilangkan kutil kelamin
obat menghilangkan kutil kelamin
pengobatan menghilangkan kutil kelamin
cara ampuh menghilangkan kutil kelamin
cara alami menghilangkan kutil kelamin
obat gonore yang manjur
obat gonore yang ampuh
obat gonore yang alami
obat gonore yang manjur dan ampuh
obat gonore yang manjur dan alami
obat ambeien atau wasir keluar darah
obat ambeien keluar darah
obat alami ambeien atau wasir keluar darah
obat wasir keluar darah
obat ampuh ambeien atau wasir keluar darah
obat kutil kelamin de nature
obat kutil kelamin de nature yg alami
obat alami kutil kelamin de nature
obat ampuh kutil kelamin de nature
obat tradisional kutil kelamin de nature

zarena cantik said...

perfect perfect fried rice, good post for the beginners as well..Super Prema, loved the presentation very much
Selaput Dara Buatan
Vimax asli Canada
Obat Perangsang
viagra usa
Bio Slim Herbal
Boneka Full Body
vimax canada

Obat Herbal said...

Seberat apapun beban masalah yang kamu hadapi saat ini, percayalah bahwa semua itu tidak pernah melebihi batas kemampuan kamu.

blogku said...

Pengobatan Kanker Ampuh ABC 132 http://greatbritishbeef.net/pengobatan-kanker-ampuh.html , Pengobatan Penyakit Kanker Stadium 1 ABCA 263 http://pengobatanherbal-manjur.blogspot.com/2015/12/pengobatan-penyakit-kanker-stadium-1.html
Pengobatan Kanker Ampuh Herbal ABC 133 http://herbal789.tumblr.com/post/137597887600/pengobatan-kanker-ampuh-herbal , Tips Pengobatan Penyakit Kanker Stadium 1 ABCA 264 http://herbal234.sosblogs.com/The-first-blog-b1/Tips-Pengobatan-Penyakit-Kanker-Stadium-1-b1-p360.htm
Pengobatan Kanker Ampuh Alami ABC 134 http://herbal789.pbworks.com/w/page/104295059/Pengobatan%20Kanker%20Ampuh%20Alami , Pengobatan Herbal Penyakit Kanker Stadium 1 ABCA 265 http://herbal234.pbworks.com/w/page/104017071/Pengobatan%20Herbal%20Penyakit%20Kanker%20Stadium%201
Pengobatan Kanker Yang Ampuh ABC 135 http://obatherbal789.blog.fc2.com/blog-entry-699.html , Pengobatan Alami Penyakit Kanker Stadium 1 ABCA 266 http://denatureobatherbal.blogspot.com/2016/01/pengobatan-alami-penyakit-kanker.html
Pengobatan Kanker Herbal Ampuh ABC 136 http://pengobatapenyakitdenganherbal.blogspot.com/2016/01/pengobatan-kanker-herbal-ampuh.html , Pengobatan Alternatif Penyakit Kanker Stadium 1 ABCA 267 http://kembalisehat123.blogspot.com/2016/01/pengobatan-alternatif-penyakit-kanker.html
Pengobatan Kanker Manjur ABC 137 http://denature222.blog.planetbiru.com/?id=8482 , Jual Obat Kanker Usus Besar ABCA 268 http://sehatselalu003.edublogs.org/2015/12/23/jual-obat-kanker-usus-besar/

Post a Comment