STASH: Filesystem as text adventure

I’ve been jonesing to put together a little text based adventure program recently, but time constaints have kept me from even playing one. Somehow my mind wandered off to a recollection of the old Doom fielsystem navigation program I ran across years ago… an amusing concept, if not particularly feasible for day-to-day use. Fusing the two ideas, I decided a text-based adventure type interface to the filesystem would be neat, something like the lovechild of bash (or pksh for me) and some nameless MUD tramp. Thus was born STASH, the Super Text Adventure SHell!

It’s not actually a shell, but a script and an aliases file. The aliases file defines actions, like ‘look’ and ‘eat’. If for some reason you come across a conflict on your system, just rename the alias. These aliases all call the perl script, passing whatever arguments (usually keywords and env variables) are appropriate for that action. The script then does its bit, which could be any thing from printing a simple message in response to saving your state to a database file. When you want to play you just source the aliases file (I’d put the commands to open a subshell, source the file, and display a small banner into a script).

The neat thing about this is that you can continue to get work done- it doesn’t change the fact that you are sitting directly in a shell, and it doesn’t even take up extra screen/desktop realestate! When you get bored and need to blow off some steam, just start playing, hopping back when appropriate.

So you’ve got the tools: now what? Well, if we’re using the filesystem and environment for the setting… create a map of the filesystem and start writing descriptions and interactions. If using a perl script, these should go into a module, so that a single script can be used to play, or even combine, modules. If each new directory is given as a package then additions become very easy to plug together using a startup script that pulls together the desired packages via ‘use’ statements. To randomize room contents and encounters, use the directory listing, the environment variables, and the process running at the time.

I’m considering a persistant command filter as well, such that the way you perform your work itself affects the game. What if using sudo spuriously cost MP, cd progressed game time, and ls might cause a random encounter? You might heal according to the value of the commands issued while the filter was in affect, or take damage according to the return value of commands…

$ cd ..

“The door is locked”

$ cd /root

“It’s awfully dark in here…”

I often am charmed into remaining in bed after I read the final bedtime book by requests to make up a story or poem. I take pleasure in dressing forms that please me in the trappings of childhood story, as is the custom of fables. Absurdity also comes readily to hand. Tonights’ spin like this:

1) Once there was a turtle, who was freinds with a fish. The fish’s name was kitty, and the turtle’s name was doggie. One day they swam all the way to the other side of the pond, where they met a cat and a dog. Then the dog ate the turtle and the cat ate then fish. The dog’s name was turtle. Guess what the cat’s name was?

Horace!

2) Once, there was a little girl who said, “Dadoo, that story was short, tell me a long story.” So he did, and here’s how it went: ” Once, there was a little girl who said, “Dadoo, that story was short, tell me a long story.” So he did, and here’s how it went: …. (This one seems to have developed an endearing quality, as it results in snuggles, thus reinforcing my retelling.)

Dark words and pictures

I stole some time in the last day to dip into two series I’ve meant to pick up for a while.

Animal Man : “Deus Ex Machine” The run of revived Animal Man written by Grant Morrison. I’ve enjoyed a lot of art whose artists decided to cast it as a “comic”; this is a comic in the most obvious, underwear pervert sense of the word, and it excels as a piece of art worthy of critical acclaim. Thankfully, sitting in bed and reading the first several pages out loud as my daughter fell asleep, I was not asked what a peyote ritual was.

Elf Quest: “The Grand Quest”

Somehow I haven’t gotten my hands on this until just now. It’s… Elf Quest.?! I grabbed a manga sized copy because it said “#1″ and I was in the same physical location, something that hadn’t yet occured. Now I’ll probably end up trolling through the Online Archive they’re releasing, trying to catch up with 32 years of comics. At least I won’t need to wait for the next one :)

Oh, and I also just started reading “Dresden Codak”, and it is wonderful. Very well illustrated and exactly on the mark to tickle my fancy… philosophy, psychology, physics, undead, robots, adventure, humor… it reminds me of good conversations I’ve had that turned into shared mini-stories. I think I may now recover from my sense of loss at the end of the “Perry Bible Fellowship”.

Don’t go in the basement!

<object width=”425″ height=”355″><param name=”movie” value=”http://www.youtube.com/v/dOptGLEOsJ8&hl=en”></param><param name=”wmode” value=”transparent”></param><embed src=”http://www.youtube.com/v/dOptGLEOsJ8&hl=en” type=”application/x-shockwave-flash” wmode=”transparent” width=”425″ height=”355″></embed></object>

Can you guess who did the score?

SSH woes: where do I go from here?

I recently rented a server, and in setting it up I moved sshd off port 22 and onto something script kiddies and worms will need to be more persistant to find. No problem… until I try to connect from my machine running XP, using PuTTY.

“Network error: connection refused” OK, normally this means I got something wrong… double check everything, try again… still no go. I’ll spare you the play by play and outline the situation as it stands:

I can connect to this host via ssh on the non-22 port from any other machine I try, using openssh clients or even the same version of PuTTY I tried and failed with from my XP machine.

I can connect to this host IF I set the sshd to listen on port 22. I tried several other ports and none worked for this particular situation.

I can connect to virtual hosts running on this host (at different IP addresses) on this alternate port just fine, even using PuTTY from my XP machine.

I can connect to it using WinSCP, and the WinSCP terminal. I cannot connect using SSHWinClient.

I’ve stripped my normal tcpwrapper and ipf rules for testing and stopped my Windows Firewall (all that should be running as a firewall on this machine.) Still no dice.

All behaviour on the XP box is the same on multiple user accounts.

My server’s auth.log doesn’t even show the connection attempts… so I’m pretty sure it isn’t a configuration on the server, or protocol conflict, but something on the XP box itself… nothing user specific, something OS in scope. I haven’t tried booting knoppix or ubuntu to see how they would fare yet, so I’m not sure it isn’t something beyond the OS, although what that could be is beyond me anyway.

Anyway, I’ve decided to get some real work done instead of trying to debug this right now, since I can get around it. But I’m all ears on suggestions on what to investigate next…

A minor satori (is all it took)

Like every bug, I did it to myself.

I was having difficulty figuring out why, after visiting a certain page on my development subdomain’s site, my session logged out. There wasn’t any code to do this… it’s cookie based… the cookie is there, but seems to change value, as if the session is being deleted. Finally, I notice that there’s a cookie for my production subdomain that uses the same name… and they both apply to the same domain. This means that if I were to try going back and forth between domains and hit a page that sets this cookie, my session is unrecognized by the other subdomain. But I haven’t been going back and forth… ahh, but I DO include an object on that page, and upon examination, the code that provides it is hard-coded to my production site. So I was surreptitiously loading content from my production site, which set the cookie, which conflicts with my dev session cookie because they’re both whole-domain cookies.

Changing the object code to apply only the current call’s subdomain cleared up the problem.