Coding Stuff from University Days
I’m hoping that this blog will be a place where I can share some of the weird, niche coding stuff that I do. This blog post will focus more on the weird side.
A recent members-only special of ATP talked about computer science education. The part that really stuck with me was when John Siracusa talked about having a shared multiuser system that everyone logged into.
I really miss those days. We eagerly kept track of who else was
logged in (I wrote an over-engineered program to do this, which I
need to blog about). We also crawled around each other’s home
directories, looking in their bin directories for what fun things
they were coding. This was years before there was a web.
Random Silly Stuff
Here are a few silly things that I remember writing. Some of them required being setuid to root. I was a “student programmer”, and security was more lax in those days, so we could get away with stuff like this. I don’t remember, but I bet several of these had an allow-list to only let certain other people run these programs.
Our compute environment was an Encore Multimax with a few dozen serial terminals (Zenith z29a if memory serves), and a few modems. Keep this in mind as you read along.
y2: When I found out that you can make a program, give it a
name, and run it, I thought it would be fun to make a hello-world
type app called y2 that would just say “a hollow voice says
‘plugh’”. This might have been the first C program that I wrote.
Of course I would go on to expand it so that it looked at argv[0]
and said other silly things. hello would figure out your first
name, and say, “oh, hi $NAME”.
soultrain: Somehow I figured out how to make text print out slowly on our serial terminals. I might have messed with the baud rate, but more likely I put out a bunch of non-displaying characters in between each character. Anyway, this would slowly print “ssssoooooooooouuuuuuuuuulllll”, delay for a half second or so, then quickly say " TRAIN!".
inviso (setuid): When I was off duty, students would still come
to me for help, maybe to add paper to the printer in the middle of
the night, or maybe for programming help. When I wanted to avoid
this, I could run inviso (after
Stargate). It
would write a \0 in the ut_user field in your /etc/utmp entry
(where it was back then), rendering you invisible.
A later modification was to let you put an arbitrary name in your
utmp entry, e.g. inviso billy and you’d be “billy”.
ak (setuid): Short for “attack”, ak would use TIOCSTI to
let you inject keystrokes into someone else’s terminal. You could
say ak <username> and it would find their terminal. If they were
on multiple terminals, it would list them and their idle time on
each, and let you choose. It must have had an escape sequence to
stop the session.
This was extremely horrifying to the victim.
ak yourpal
ls (what the heck?)
(slowly type "rm ..." until they scream, then backspace over it)
zbeep (setuid): (really a bunch of z<something> commands): Like y2,
but it would write something to the terminal of each user listed
in the command line. zbeep would send a ^G to ring a terminal
bell. We had a local command called u that would list out all
logged-in users; so, zbeep $(u) would beep every terminal in the
lab. Fun.
We had a command called staff that would list logged-in staff,
so you could say zbeep $(staff). But the message written could
be a fixed set of other things, e.g. zboties. There was a convenience
store called J Boties right near our office where we went in the
afternoons, and zboties $(staff) would write “BOTIES!” on all
staff terminals, and that would get us all moving for our daily
break.
dot: a curses program that would draw a graphic “dot” symbol in the center of your screen. Then, it would randomly wander the screen, stopping for several seconds at a time. If you typed any key, it would exit.
A fun alternative to logging out was exec dot. This wasn’t very
nice, since someone would have to touch the terminal to get a login
prompt. But, I wasn’t very nice back then.
tl: short for “terminal lock”, this was my take on a terminal
lock program. It was just dot (above), but typing any key would
give you a password prompt.
For some reason, I made it support dumb terminals (no curses support): it would just prompt for password without the fancy “dot” moving around. After I left university, I added X support. This version would just show you the root window, with no other windows visible, and move around the cursor shaped like an “X”.
whodo: This was the program that I mentioned above, that kept
track of who was logged in. When I wrote it, I didn’t know that
there was a command called whodo in other versions of Unix (there
wasn’t such a command in mine).
I will probably write a whole blog entry about whodo someday. For
now, it was a completely over-the-top program that had its own
config file format (using lex and yacc, of course). It would
watch for your friends, and put them in your “status line”, which
was the 25th line on a
z29a
terminal.