Qqueue!

So I’m a huge fan of Ask Metafilter. The basic premise is simple: you ask a question and lots of people answer. But Ask MeFi rocks because they maintain high standards. So you actually get really good answers. It costs $5 to join, which is done to pay for the servers but, frankly, seems like a good way for keeping crap out, too.  You’re allowed one question a week, so I try to make it good. But oftentimes, I put it off for several weeks for want of something worthy of using up my question.

So I started a list. And I figured I’d allowed voting and comments. And before I knew it, I had this monstrosity. It was actually extraordinarily simple to code, too. I hope to add better questions over time: these are the ones that were on my mind at the time. You can vote (the + and – buttons), and leave comments. Feel free to do so. (I’m not taking question ideas: get your own account if that’s what you want!)

Spam

My e-mail setup right now for n1zyy.com and ttwagner.com consists of just forwarding all e-mail to GMail. It works fine, and the spam filters there have been pretty much 100% effective. However, it bothers me that I’m forwarding dozens, if not hundreds, of e-mails just to have them ignored. Some basic spam filtering should really take place on my server.

I made a few basic configuration changes to Postfix, the MTA I run. In a nutshell, I tell it to require stricter compliance with e-mail RFCs: e-mails with HELO addresses that don’t exist (or just don’t make sense), and people sending multiple commands before the server replies to acknowledge them, for example, now results in mail delivery failing. The default configuration errs very much on the side of ‘safety’ in accepting mail, but the trick is to tighten it down enough that you’ll reject mail that’s egregious spam, but not reject anything that could be from a mailserver. And that’s where I’m at.

I also installed SpamAssassin. I’m currently using it in conjunction with procmail, and therefore wasn’t quite sure if it works. I set it up to make some changes to the headers, so that I can verify whether it’s working. But I ran into a problem I never thought I’d have: I’m not getting enough spam. I’m sitting here eagerly awaiting some to see what happens. And it’s just not coming.

The Definition of a Game

I’ve been playing Team Fortress 2 a bit lately. Not so much now that finals are here, but it’s a fun way to pass the time. When the mood strikes, I’ll sign on and play one of a few different classes of people… I’m usually either Pyro or Engineer. As Pyro, I go around with a flamethrower. It’s a good weapon, as it sets enemy forces on fire. It’s also the only sure-fire (no pun intended) way to see if someone who looks like a teammate is actually a spy disguised as a teammate: if they burn, they’re a spy. So I’ll run through my own team with the flamethrower periodically, since it’ll only damage enemies. As Engineer, I set up teleporters, so people that die and respawn can get to the front lines faster to keep up the attack. I also set up Dispensers, which dispense health points and ammunition. And, my favorite, the sentry guns, automated guns (which I usually upgrade to include rocket launchers), letting us cover areas without having to be there. They’re a good way to protect our assets.

The process of going through and doing all of this, to defend against enemies, is really fun. And, even though it’s just a game, there’s a certain sense of accomplishment when we capture the enemy bases.

Last night, I installed a new piece of software on my server, a web-based file manager. They have a wiki (powered by MediaWiki, the Wikipedia software), but it was overrun with spam. So I signed up and started reverting back to spam-free versions. It’s a skill I picked up on Wikipedia, and it’s super-easy. In about 20 minutes time, I wiped out weeks, sometimes months, of spam. As time went on, I took out more and more. This morning they made me an admin, and I’m now deleting spam accounts, blocking persistent spam IPs, and deleting pages that are nothing but spam.

Is this a game? Volunteer work? Work? I’m not sure, but I’m getting at least as much enjoyment out of it as I get from setting enemies ablaze in Team Fortress 2. And I’m actually accomplishing something.

The Time…

I’m pretty OCD and thus run an NTP server on this server. (It should respond to any hostname on this box.) Despite the server being in Texas, I keep the timezone set to EST.

So here’s a page displaying the time. Granted, having a clock that’s accurate down to a fraction of a second (synced to the atomic clock) is no longer that impressive. But tell me you’ve never wished for an easy way to find the correct time… Now you know.

memcached

On my continuing series of me poking around at ways to improve performance…

I accidentally stumbled across something on memcached. The classic example is LiveJournal (which, incidentally, created memcached for their needs). It’s extraordinarily database-intensive, and spread across dozens of servers. For what they were doing, generating HTML pages didn’t make sense that often. So it does something creative: it creates a cache (in the form of a hash table) that works across a network. You might have 2GB of RAM to spare on your database server (actually, you shouldn’t?) and 1GB RAM you could use on each of 6 nodes. Viola, 8 GB of cache. You modify your code to ask the cache for results, and, if you don’t get a result, then you go get it from the database (or whatever) as usual.

But what about situations like mine? I have one server. And I use MySQL query caching. But it turns out it’s useful. (One argument for using it is that you can just run multiple clients on a single server to render moot any problems with using more than 4GB on a 32-bit system… But I’m not lucky enough to have problems with not being able to address my memory.)

MySQL’s query cache has one really irritating “gotcha”–it doesn’t catch TEXT and BLOB records, since they’re of variable length. Remembering that this is a blog, consisting of lots and lots of text, you’ll quickly see my problem: nearly every request is a cache miss. (This is actually an oversimplification: there are lots of less obvious queries benefiting, but I digress.) (WordPress complicates things by insisting on using the exact timestamp in each query, which also renders a query cache useless.) I just use SuperCache on most pages, to generate HTML caches, which brings a tremendous speedup.

But on the main page, I’m just hitting the database directly on each load. It holds up fine given the low traffic we have, but “no one uses it” isn’t a reason to have terrible performance. I’ve wanted to do some major revising anyway, so I think a rewrite in my spare time is going to experiment with using memcached to improve performance.

Simple English

I had someone on a forum I frequent ask me a question. It’s in broken English and he explained that he’s not a native speaker. In my reply, I tried to be sensitive to that by speaking somewhat simply. Not in a demeaning way, but in my attempts to learn Spanish, I learned very quickly that short sentences expressing one simple idea are much simpler than elaborate sentences conveying a complex range of thoughts, such as this one.

And that reminded me of the Simple English Wikipedia project, which I think should get more attention. They treat it like another language: there’s English, Spanish, Simple English, etc. A really awesome idea in my opinion. (Although the sexual intercourse page–warning, has an illustration of the process–is still pretty sketchy… Maybe because it’s not a topic that lends itself to being explained in simple, direct terms?)

I think “Simple English” is something everyone should practice, though. As some of the pages on the simple.wikipedia.org site show, writing in a simple manner does not necessarily require coming across like a dimwit.

The Problem with Wikipedia

No, not that one.

I consider myself a talented writer. And I’m obsessive-compulsive about things being well-written. So giving me access to edit things is a recipe for awesome.

So I was doing some research for class. My research into Lynch v. Donnelly made me realize that the page was pitiful. So I cleaned it up to get it to its current state. (Which still needs a lot of work.) The Nautilus, Inc. page also got some updates after another class project on the subject.

You should get extra credit in class when you become the top contributor to the Wikipedia page on the subject.

Performance++

I guess I’ve become somewhat of a performance nut. Truthfully a lot of the time is spent doing things for nominal improvements: changing MySQL’s tmp directory to be in RAM has had no noticeable impact on performance, for example. Defragging log files doesn’t speed much up either.

I was reading a bit about LiteSpeed, though. It’s got a web GUI to control it, and is supposedly much faster than Apache. I’ve got it installed, but I’m having some permission issues right now. (The problem is that changing them will break Apache, so I’m going to have to try it with some insignificant pages first.) It’ll automatically build APC or eAccelerator in. It apparently has some improved security features, too, which is spiffy. And it’s compatible with Apache, so I don’t have to start from scratch.

The base version is free, too. (But not GPL.) The “Enterprise” edition is $349/year or $499 outright purchase. To me, it’s not worth it. But if I were a hosting company with many clients, I might be viewing it differently, especially if the performance is as good as they say.