I Buy Liquor For Minors

It's not much of a creation, but I recently made a T-shirt that says, "I BUY LIQUOR FOR MINORS" in nice white on black lettering. I've worn it out a few times including to the Minnesota State Fair, mostly just to gauge responses to the sentiment. It seems the average parent furrows their brow, the average teenager looks intrigued, and the average bartender will still sell me two beers. I didn't actually have a single youth ask me to buy liquor for them, and all the people who actually told me they liked the shirt were in their 20s or 30s. Completely not the responses I expected.


People in their 20s and 30s aren't as likely to have rebelious, teenage kids. Any plans for an "I Slip Babies the Whiskey Teet" derivative? That might make people in their 20s and 30s a more interesting control group. -- Gabe Turner

Poker Table

As mentioned previously I'm a tool of the media machine and am thus now playing poker. I don't like online play so I host local events here at the house. We're getting more and more people and I wanted something nicer on which to play than folding card tables. Louis Duhon, a friend, and I drew up some plans, bought a lot of materials, moved the cars out of his garage, and spent four days working on a "one day project".

The result was some very nice tables with high end vinyl, velveteen, and birch. For the $250 we spent on materials we could have bought some low end tables but nothing approaching what we ended up with quality wise. Below is a photo and the plans in AutoCAD's DXF format and as a .png. Louis has a lot more photos at http://www.theshadowzone.org/media/poker-tables/poker-tables.html .




Silly Defensive Prompt Coloring

I don't like color in my command line windows. Colorization in ls's directory listings drives me bonkers; it's the first thing I turn off on a new system. I have, however, relented and added a little bit of conditional color to save me from an all too frequent error.

I have access to a lot of UNIX and UNIX-like systems. Some are machines I run, some are my employer's, and some belong to customers. Most all of them I've never physically seen but instead access through remote ssh, secure shell, connections. My normal command line prompt on these machines looks like:

[user@host ~]$

That says I'm on machine 'host' and logged in as 'user'. You'd think that would be enough to alert me when 'host' isn't my normal desktop machine or when I'm logged in as someone other than 'ry4an', but you'd be wrong. After issuing disastrous rm * commands when I didn't notice I was root and after one too many 'shutdown -h' when I didn't realize I was issuing commands to a server in a remote data-center instead of the computer in my closet, I finally wised up and did something about it.

Now when I'm logged into a remote machine the at-sign in my prompt is black-on-white instead of its normal white-on-back. The 'host' portion of each of my prompts is color coded to reflect which machine I'm logged in to, and when the 'user' portion says 'root' it's got a bright red background to let me know that commands are at their most dangerous.

None of this was hard to do, it was all just stuff I finally decided to do. I've attached the shell snippet I put in my /etc/bashrc to do the colorization of the three different parts. The local/remote detection probably only work with the gnu tool chain, but one never knows.


Roomba on the Pronto Remote

A few weeks back I got a Roomba Robotic Vacuum (http://www.irobot.com/consumer/product_detail.cfm?prodid=9) as a wonderful gift. Shipped with it was the optional remote control. The Roomba is fully automatic, but it's programmed to pick up dirt not to chase the cat -- you need the remote for that.

However, long time readers (you poor bastards) will remember that I try to maintain a strictly one remote coffee table (https://ry4an.org/unblog/msg00022.html). That meant the Roomba had to go onto the Phillips Pronto TSU-2000 Universal Remote. I thought for sure I'd find a CCF file for it, but it looks like only the people with newer remotes are getting the Roomba. Fortunately someone in the RemoteCentral forms helped out with instructions on how to back-convert the remote configuration and after a few wasted hours I can now steer the vacuum from the couch. Apparently I became a yuppie when I wasn't looking.

Anyway, attached are the CCF file and a screen-shot.



The Oldenburg

I've been rolling this one around in my head for a few years now, and I think it's finally coming closer to fruition: I'd like to start an old style social club.

In his book The Great Good Place Ray Oldenburg, Professor Emeritus at the Department of Sociology at the University of West Florida, says:

"Most needed are those 'third places' which lend a public balance to the increased privatization of home life. Third places are nothing more than informal public gathering places. The phrase 'third places' derives from considering our homes to be the 'first' places in our lives, and our work places the 'second.'"

Working from home I distinctly feel the need for at least a second place. Each day I head to the local coffee shop and drink more coffee than I should around semi-familiar faces. It's a pleasant time, but it's not community. Similarly in the evenings I frequently find myself wanting to get out of the house and amongst friends, without incurring the organizational and monetary expenses of an organized restaurant or bar outing.

I've got the notion that a semi-traditional social club might be just the thing for which I'm looking.

Before the 20th century gentlemen would belong to one or more social clubs where they would take meals, meet colleagues, enjoy a familiar and relaxed setting, and just generally escape the home. These clubs were typically men-only, though women-only clubs existed as well, and both generally discriminated against Jews and racial minorities.

In the 21st century these clubs still exist, albeit in a changed form. Membership policies are no longer (openly) discriminatory. The twin cities has two of the clubs of note: The Minneapolis Club (http://www.mplsclub.org/) and the University Club (http://www.universityclubofstpaul.com/). Both are large, opulent, and not quite what I'm looking for (not that they'd have me anyway).

Rather than a luxurious complex, I'd like to set the club up in just a room or two. Add some comfortable chairs, a liquor cabinet, a fridge, a bookshelf, a newspaper subscription, and twenty or so members and I think one could have the makings for a very pleasant place to while away evenings. A friend pointed out that this is almost exactly the sort of thing that the ACM, a student club, used to provide for us back in college but no longer can.

Funding would have to come in the form of monthly dues with a possible up-front initiation fee. Membership, governance, and policy could largely be cribbed from the charters of 19th century clubs with few modifications. Emily post even has a chapter on the subject: http://www.bartleby.com/95/30.html . Still there's a great deal of stuff that would have to be worked out amongst the charter members.

At this point I'm looking into general feasibility, possible locations, and interest level. I've set up a mailing list for anyone remotely interested to track progress and help shape the idea. It can be joined at: defunct. I've also got a survey which is open to anyone for whom the notion of a non-commercial third place resonates. It can be taken anonymously and can be found at: https://ry4an.org/oldenburg/survey/ .

None of this is exactly in line which what Ray Oldenburg is talking about. He's advocating free, public leisure spaces within walking distance whereas we're looking at a non-free, private leisure space to which some members will need to drive. Regardless, friend, neighbor, and interested party, Jamie, suggested we steal Ray Oldenburg's name for that of the club, and so far it's the best anyone's come up with, though nothing's final until the charter is signed.

If any part of this idea caught your interest please consider taking the survey. Even if you choose not to participate, your actions will help us to determine how The Oldenburg should be organized.

Filtering Mail Using Time of Day

I get a lot of email, and a good percentage of it is spam. To help filter the spam from the ham I use software called SpamAssassin (http://useast.spamassassin.org/). SpamAssassin applies hundreds of tests to each incoming email and increases or decreases the mail's spam score depending on the result. If the total spam score for a message is above a pre-set threshold (4.0 for me) it gets put aside.

No one rule is enough to get a message marked spam or ham; rather, each contributes a little to the overall determination. For example, here's the report for a piece of spam I recently received:

 pts rule name              description
---- ---------------------- --------------------------------------------------
 1.5 SPAM_SUB_ADDRS         Sent to a high spam sub address of mine
 1.5 MY_SUB_ADDRS           Sent to a sub address of mine
 0.0 BAYES_50               BODY: Bayesian spam probability is 50 to 56%
                            [score: 0.5002]
 0.6 HTML_FONT_INVISIBLE    BODY: HTML font color is same as background
 0.3 MIME_HTML_ONLY         BODY: Message only has text/html MIME parts
 0.1 HTML_MESSAGE           BODY: HTML included in message
 0.1 HTML_FONTCOLOR_UNSAFE  BODY: HTML font color not in safe 6x6x6 palette
 0.1 BIZ_TLD                URI: Contains a URL in the BIZ top-level domain
 1.1 MIME_HTML_ONLY_MULTI   Multipart message only has text/html MIME parts

Various mis-uses of HTML formatting and sending to some email addresses I reserve for spam only earned that message a score of 4.3.

SpamAssassin is in common use, and its set of rules works very well. Looking at a summary of my email in the last 52 days one sees these numbers:

  • Spam : 1377 (missed: 53) (0.37%)
  • Virus: 207 (0.06%)
  • Ham : 2162 (0.58%)
  • Total: 3746

So of 1377 spam messages that came in during the 52 day span only 53 were missed by SpamAssassin -- just 3.85%. Not bad, but there's always room for improvement.

It seemd to me that the majority of the missed spam would come in overnight. In the morning I'd have plenty of ham messages and a piece or two of spam that SpamAssassin had missed sitting in my mail. I decided to track when spam came in to see if I could add a rule giving a higher spam score to messages arriving overnight.

A little googling showed that others have done the same sort of tests and found that spam arrives evenly throughout the day. On The Origin of Spam has some great stats available at http://db.org/spam/. Still I gathered my own to see if they'd show the same pattern (see attached graph).

I found that spam does, indeed, favor no particular hour. However, the non-spam ham messages show pretty much the pattern you'd expect. They largely arrive while other people in my timezone are awake. So if I slip in a rule that gives some score bonus to emails arriving during off-peak hours I should see a decrease in that 3.85% error rate. I'll try it out and post the results.


Dumbing Down scp

The tool scp, UNIX for secure copy, is a wrapper around ssh, secure shell. It lets you move files from one machine to another through an encrypted connection with a command line syntax similar to that of the standard cp, local copy, command. I use it 100 times a day.

The command line syntax for scp is at its most basic:

scp <source> <destination>

Either the source, destination, or both can be on a remote computer. To denote that one just prefixes the file name with "username@machinename:". So this command:

scp myfile ry4an@elsewhere:/home/ry4an/myfile

would copy the contents of the local file named 'myfile' to a remote system named 'elsewhere' and place it in the directory /home/ry4an with the name myfile.

As a shortcut one can omit the destination directory and filename, in which case they default to the home directory of the specified user and the same filename as the original. Nice, simple, handy, straightforward.

However, when you're an idiot in a rush like me in addition to skipping the destination directory and filename you also skip the colon, yielding a command like:

scp myfile ry4an@elsewhere

When you make that mistake scp decides that what you wanted to do was take the local file named 'myfile' and copy it to another local file named 'ry4an@elsewhere'. That's certainly consistent with their syntax -- no colon, no remote system, but it is never what I want.

Instead I go to the 'elsewhere' machine and start looking for 'myfile' and it's not there, and I'm very puzzled because scp didn't give me any error messages. I don't know of anyone who has ever wanted scp to do a local copy, but for some reason the scp developers took extra time to add that feature. I want to remove it.

The best way would be to edit the scp source and neuter the part that does local copies. The problem with that is I'd have to modify the scp program on lots of machines, many of which I have no control over.

So, as a cheesy work around I spent a few seconds writing a bash shell function that refuses to invoke scp if there is no colon in the command line. It's a crappy band-aid on what's definitely a user-error problem, but it's already saved me from making the same frustrating mistake 10 times since I wrote it last week. Here it is in case anyone else has the same un-problem I do:

function scp () { if echo $* | grep -v -q -s : ; then
  echo scp: missing colon /usr/bin/scp
  /usr/bin/scp $@

Just put that in your .bashrc and forever be saved from having a drive full of user@elsewhere files. Or don't; I don't care about you.

Diplomacy at Sea and a Templated Evolver

I've got a policy here on the unblog where I only do entries about things I've created. When I wanted to hype the Diplomacy at Sea V/Dip Con event coming up March 2005 I had to find something to do with it first, so I volunteered to set up their website.

Whenever I need to set up a quick site I head over to the Open Source Web Design site (http://oswd.org/) and pick from their vast array of great designs. This time I went with one called Evolver. It has a clean look and clean code. Rialto did a great job of synthesis and design on this one.

In order to avoid having to edit every page in a site when I want to update a footer or navigation bar I often use Apache's Server Side Includes (SSI) to pull in elements that are on the same on every page. This time I decided to go a step further and see if I could use a single .shtml page for every page on the site. It ended up working out in a fashion sufficiently general to be worth re-distributing.

The outcome can be seen on the https://ry4an.org/dipatsea/ site, though it looks just like Rialto's original design. Attached is a zip-file containing the templatized page and a few paragraphs detailing the necessary symlinks. You'll have to enable .shtml SSIs in your Apache install, of course.


RSS Feed for Security Camera List

I added a RSS feed to the Minneapolis Security Camera Project site. Subscribers to it will see any new cameras as soon as they're posted. If you're not yet using an RSS aggregator let me know and I'll chisel the list on a stone tablet and mail it to you whenever it's updated.

The feed is at http://mpls-watched.org/map/rss.xml

History of the World - Attack Probabilities

History of the World is a fine game from Avalon Hill. It's distributed by Hasbro now, and it's one of the rare Avalon Hill games that Hasbro managed to improve when they "cleaned it up".

History of the World uses dice to simulate combat, and they do so in a way so as to intentionally skew the likelihood of success toward the attacker. There are, however, various terrains (mountainous, ocean straight, forest), types of attack (amphibious), bonuses (strong leader, elite troops, forts, weaponry, etc.) which can affect the success rate of an attacker.

While playing last night we tried to estimate the relative merits of the different troop-efficacy modifiers and found that as if often the case with probability it was difficult to agree even on estimates.

As a result I sat down and wrote some quick Perl simulations to find the numbers for all the various scenarios. This wasn't done in the most efficient way possible, but it's accurate. The terms 'win', 'tie', and 'loss' are from the attacker's point of view.

Attk Dice Attk Bonus Def. Dice Def. Bonus Win Tie Loss
2 0 1 0 57.87% 16.67% 25.46%
2 0 1 1 41.67% 16.20% 42.13%
2 0 2 0 38.97% 22.07% 38.97%
2 0 2 1 22.38% 16.59% 61.03%
2 0 3 0 28.07% 24.77% 47.16%
2 0 3 1 12.96% 15.11% 71.93%
2 1 1 0 74.54% 11.57% 13.89%
2 1 1 1 57.87% 16.67% 25.46%
2 1 2 0 61.03% 16.59% 22.38%
2 1 2 1 38.97% 22.07% 38.97%
2 1 3 0 52.84% 19.23% 27.93%
2 1 3 1 28.07% 24.77% 47.16%
3 0 1 0 65.97% 16.67% 17.36%
3 0 1 1 49.38% 16.59% 34.03%
3 0 2 0 47.16% 24.77% 28.07%
3 0 2 1 27.93% 19.23% 52.84%
3 0 3 0 35.23% 29.54% 35.23%
3 0 3 1 16.69% 18.54% 64.77%
3 1 1 0 82.64% 9.65% 7.72%
3 1 1 1 65.97% 16.67% 17.36%
3 1 2 0 71.93% 15.11% 12.96%
3 1 2 1 47.16% 24.77% 28.07%
3 1 3 0 64.77% 18.54% 16.69%
3 1 3 1 35.23% 29.54% 35.23%

Attached is the script and the same output in various formats.