Ah, spammers, spammers…

I’m a bit torn. I’ve been looking at the pathetic attempts at automated spam in this blog, and my “I like an intellectual / technical challenge” side just wants to write a post detailing what they’re doing wrong and how they could easily make their tools much more effective.

On the other hand… we’re talking about spammers. The scum of the earth. The only creatures in the world that make lawyers and politicians look like decent, lovable human beings. Now, some may argue that what I could suggest in a couple of minutes wouldn’t be exactly rocket science, that they’d surely have thought of it already… but my point is that they haven’t. Both their methods and the comments themselves that they try to post are terrible and ridiculously easy to detect; anyone with half a brain could do a lot better.

In fact, if they’d just… ah, crap. I just can’t. It’d be like handing a loaded gun to a kid. The biggest asshole-ish jerk of a kid, and a brain-damaged, glue-eating one as well, but still, in some ways, a kid. Who could do a lot of damage with it. But, to get some idea, my “brilliant” suggestion for making comment spam tools much more effective — which would not only hugely improve the odds of beating Akismet, but would also be accepted by many less attentive blog owners — would take… a line and a half of text. This is not because I’m some sort of genius… it’s because they’re morons.

Interesting, email spams, while still typically primitive, are actually much more advanced than comment spam tools. There’s actually a bit of thought put into them. Comment spam tools, on the other hand, are the equivalent of a burglar wearing a Beagle Boys-like mask and a stereotypical black and white striped prison suit, and going in broad daylight from house to house, knocking on each door. πŸ™‚

Medieval: Total War (PC, 2002)

Note: this post is unchanged from one from 2005 in my old blog, The Games of My Life. But please see the new section at the end.

This game has a big problem. The load times. For some reason, in my Athlon XP 2000 with 1 GB of RAM and a fast hard drive, they’re huge – not “read a book”-like, but, still, 30-60 seconds to load a battle and 30-60 seconds to come back to the main map are, IMO, too much. Especially since Rome: Total War, their more recent and even more detailed game, actually has shorter load times.

That’s the problem. In almost every other respect, Medieval: Total War is virtually perfect.

Medieval: Total War - campaign map
M:TW - campaign map

M:TW, like its predecessor Shogun: Total War and its successor Rome: Total War, is a historical turn-based strategy game with fantastic real-time battles. These are really wonderful – no other game, except perhaps Close Combat, simulates a battle so well – and that one was squad-based. This one, though, can have armies of 10.000 men. On each side. And they all move, shout, fight and, possibly, die.

Continue reading Medieval: Total War (PC, 2002)

What’s so funny about ‘The Human Top’?

Some of you may recall how, in my recent post about the Wasp’s useful and insightful contribution to a discussion in a room otherwise full of men, as I mentioned that they were trying to capture the Human Top, I included this aside:

a villain whom nobody could take seriously until he later changed his name to Whirlwind, and got himself a new costume that didn’t look like he had a giant onion for a head…

Some, however, may not immediately see what’s funny — and dumb — about a supposedly “serious” villain (i.e. not one simply played for laughs) calling himself “The Human Top”. Especially in the case of non-English native speakers (not that I’m one myself, but…). Mainly because “top“, in this context, is a term whose meaning many people won’t know, mostly because 1) it’s already a common word, as the opposite of “bottom“, and 2) its meaning here refers to something that, while centuries old (if not millennia — I’ve just investigated, and it isn’t known), is relatively unseen these days — most people probably grow up without ever seeing one or even hearing it mentioned except perhaps when their parents or grandparents reminisce about the “good old days” and what they played with when they were kids, instead of these new-fangled Nintendos and Playstations.

This, then, is a top, also known as a spinning top:

Top

And, since the guy’s power was to spin around very fast, that’s naturally what Stan Lee named him after. πŸ™‚ Lee was a great creator, but from time to time he came up with very dubious names for characters or teams: did you know that his original name for the X-Men, overruled by his publisher, was “the Merry Mutants“? The prosecution rests. πŸ™‚

And, naturally, if a character was called “the Human Top”, it made sense that he looked like a top, right? So, here’s the guy:

The Human Top
Source: Tales to Astonish #50, 1964

Yup. He wore a helmet in the shape of a spinning top. Though, to me, it looks more like an onion. πŸ™‚

What’s interesting is that, as I said, this character was supposed to be serious — indeed, he was Giant-Man’s first foe after he added the “Gi” part to his name (before that, he was simply Ant-Man). And his ability — spinning around at an incredible speed — was actually very powerful and effective: he could move extremely fast, was virtually impossible to grab or hit, could “fly” up simply by spinning very fast in one place, and in one later story, he actually managed to beat Quicksilver, Marvel’s equivalent of the Flash. Not only that, he was one of the most intelligent villains at the time, being both a good planner capable of subtlety, and a quick thinker. But who could ever take seriously a guy named after an old children’s toy and who looked like an onion bulb? πŸ™‚ So, nobody can blame him for later changing his name to Whirlwind, and donning a new costume.

Now, I could tell you about the Trapster, formerly known as Paste-Pot Pete… πŸ™‚

Graphing search engine referrals with AWStats and MRTG

From my previous post, AWStats tip: creating static pages (and why it’s a good idea):

for instance, I’m currently using MRTG to plot a graph of Google and Bing referrals, using the AWstats-generated static pages as input

So… anyone curious? πŸ™‚

Note: again, beware of word wrapping below. I’ve added an empty line between any “true” line of text; if you see two or more lines together, it’s supposed to be just one.

cat /root/bin/winterdrake-se.sh

 

#!/usr/local/bin/bash

GOOGLE=`grep \>Google\</a\>\</td\>\<td\>
/var/www/htdocs/AWstats/awstats.winterdrake.com.html | awk -F"<td>" '{print $2}' | cut -d "<" -f 1`

if [ -z $GOOGLE ]; then

GOOGLE=0

fi

echo $GOOGLE

BING=`grep \>Microsoft\ Bing\</a\>\</td\>\<td\>
/var/www/htdocs/AWstats/awstats.winterdrake.com.html | awk -F"<td>" '{print $2}' | cut -d "<" -f 1`

if [ -z $BING ]; then

BING=0

fi

YAHOO=`grep \>Yahoo\!\</a\>\</td\>\<td\>
/var/www/htdocs/AWstats/awstats.winterdrake.com.html | awk -F"<td>" '{print $2}' | cut -d "<" -f 1`

if [ -z $YAHOO ]; then

YAHOO=0

fi

echo $(($BING + $YAHOO))

uptime | awk -F"up " '{print $2}'

uname -n

EDIT in April 1, 2011: fixed the script so that it deals with non-existing entries (typically on the first day of the month).

By the way, this is a FreeBSD box; that’s the reason why bash is in /usr/local/bin. In Linux, it’s probably in /bin.

The mrtg.cfg file is mostly standard: it invokes the script shown above, and labels “I” as hits from Google, and “O” as hits from Bing and Yahoo! put together.

If you want to see what the result looks like, look here.

If you’ve been paying attention, yes, both values will reset to zero the first day of every month. That’s exactly how I want it: I want to see if every month it “rises” faster than the month before, or slower, or whatever. πŸ™‚

AWStats tip: creating static pages (and why it’s a good idea)

AWStats is probably the most popular free statistics package for self-hosted sites (if we don’t count “external” ones such as Google Analytics), and, as any decent Unix sysadmin probably knows, there are several ways of configuring it.

One of them is by having the CGI accessible on the web and having it analyze the logs and generate the statistics on demand. I don’t think many people use it that way, though — not only is it the slowest method, but it could theoretically be used for DOS attacks. Yes, you could put it somewhere private (and it’s probably still a good idea to do so, no matter what method you use), either by using a non-world accessible web server, or by adding authentication. But, still, there are no real advantages to this method, other than being sure you have the absolutely most recent stats. But having the stats of, say, 5 minutes or less ago is, in most cases, more than good enough.

In my experience, most people use an intermediate method: the CGI is still accessible, but is isn’t capable of analyzing logs; it just generates the stats page. The logs themselves are analyzed by the same CGI file, but through a local crontab.

And this is what I had been using until today. Yes, much like in the case of the “cd back” trick, I had been using AWStats for years… and only today did I switch to using fully static pages. A few more of these and someday I may have to turn in my geek card. πŸ™‚

It’s pretty easy to configure AWStats this way: Here’s my old crontab line:

*/5 * * * * /usr/local/cgi-bin/awstats.pl -config=winterdrake.com -update >/dev/null 2>&1

And here’s my new one (if it word wraps, it’s supposed to be a single line):

*/5 * * * * /usr/local/bin/awstats_buildstaticpages.pl -config=winterdrake.com -update -awstatsprog=/usr/local/cgi-bin/awstats.pl -dir=/var/www/htdocs/awstats

Before that, I had to put awstats_buildstaticpages.pl (included in the AWStats /tools directory) in the /usr/local/bin directory (you may prefer it somewhere else, of course), and create the /var/www/htdocs/awstats directory so that the static files could be put there. And now, they’re accessible on https://myserver/awstats/awstats.winterdrake.com.html . They look exactly the same as if I accessed the CGI directly (which I can still do, in order to see yearly reports, for instance — but I do that very rarely), but let’s do a little benchmarking, shall we?

CGI version:
Requests per second: 2.33 [#/sec] (mean)

Static version:
Requests per second: 4557.69 [#/sec] (mean)

Now, you may be thinking: “yes, the speed is in a completely different order of magnitude, but I don’t look at my stats all the time, and they’re private, so nobody else does… isn’t taking half a second good enough?” Yes, that’s true… but getting rid of limits is always a good thing, because you can then do so much more. Suppose you don’t have half a dozen sites on that server, but a thousand, with statistics for all of them? Suppose you want to use the AWStats stats to generate other stats (for instance, I’m currently using MRTG to plot a graph of Google and Bing referrals, using the AWstats-generated static pages as input) ((here, another advantage becomes obvious: I can now do this through a trivial combination of grep and awk on a static HTML file.))? In both these examples (and I’m sure there are many more), having stats accessible almost instantly and taking up virtually no processing power at all is obviously a Very Good Thingβ„’.

Other advantages: you can move your stats to a (virtual) server that only serves static files, since that what they’ll be. Alternatively, if you had CGI processing enabled just for AWStats, you now can simply turn it off on your web server, improving its security.

Bad Comic Panels #2: “If there’s one thing I like, it’s being in a room full of men!”

Wasp: "If there's one thing I like, it's being in a room full of MEN!"
Source: Tales to Astonish #51, 1964

Sometimes, things that were common and acceptable at one time become unintentionally funny decades later. A great example is the panel above, in which Giant-Man (Hank Pym) and several government types are discussing how they’ll frustrate the Human Top ((a villain whom nobody could take seriously until he later changed his name to Whirlwind, and got himself a new costume that didn’t look like he had a giant onion for a head…))’s plans, what does the Wasp, a.k.a. Janet Van Dyne, Giant-Man’s girlfriend and sidekick, co-founder of the Avengers, who in the future would get to be one of the most successful leaders of that group ((in Roger Stern’s excellent run)), think of the entire situation, and what insight will she add to the discussion?

"Mmmm, if there's one thing I like, it's being in a room full of MEN!"

Yup. πŸ™‚

And this was in a comic by the top creative team at the time, Stan Lee and Jack Kirby.

Now, stuff like this was actually common at the time, and nobody blinked an eye at it, or even saw any possible implications in a young woman claiming to… ahem… love being in a room full of men. πŸ™‚ Those were indeed sexist times, and that included comics; a woman’s goal was, basically, to get married and settle down, and a “proper” woman looked up to men, depended on them, and remained silent while the males discussed the “important stuff”. Even some earlier, innovative female characters weren’t much better: remember than, when Wonder Woman joined the Justice League, she was the secretary of the group (though, of course, that’s been retconned since then). There wouldn’t be real independent women in mainstream comics until the 70s, with Ms. Marvel (Carol Danvers) being an early example; she was actually billed at the time as Marvel’s first feminist heroine.

Deathstalker II: Duel of the Titans

Deathstalker II: Duel of the TitansIn my teen ears (read “the Eighties”), I remember watching a movie, rented on a VHS tape (remember those?) from a video club (remember those?). What I remembered from it was that it was a fantasy movie, made with a low budget, with some female nudity, and which didn’t take itself too seriously. Its name was Deathstalker II: Duel of the Titans.

After more than 20 years, I found it again (not that I kept looking for it for all this time; I remember looking for it on DVD in Amazon.com some years ago, but I think at the time it wasn’t available, and that was it), re-watched it, and, yes, it’s better than I remembered. πŸ™‚ From what I learned by reading Wikipedia and TV Tropes, this is the only movie from this low-budget series (there are 4 in total) where they didn’t take it too seriously, but instead made fun of the fantasy / “Sandals & Sorcery / Conan-like” genre, and in general had a good time. And it shows — the actors are clearly having fun. πŸ™‚

It’s not a “deep” or brilliant movie, of course, but it’s funny, entertaining, and it’s a perfect “beer with friends” film, in my opinion. Try to find it; if you liked the description so far, you won’t regret it.

And it includes this scene, which makes me laugh every time I see it, and which, incidentally, is just my second upload to YouTube ever:

 

Bad Comic Panels #1: “…a diseased version of Hell!”

A diseased version of Hell

The above image is from Superman: At Earth’s End, an Elseworlds comic from 1995. The comic itself is terrible: sometimes approaching “so bad it’s good” territory, but not often; most of the time it’s just boring, senseless, and the supposed “moral” is not only self-contradictory (“guns are bad”, therefore Superman saves the day by shooting every bad guy with a huge freaking gun… but guns are still bad, mmkay?”) but doesn’t even make sense in the context of the comic. But then there’s this panel, where Superman says the brilliant line that is the topic of this post:

“Someone has turned the Gotham City bunker into a diseased version of Hell!”

Now, yes, the quote is obviously stupid and makes no sense. Linkara said it best: “because a regular version of Hell is just so pleasant!” But I challenge you, dear readers, to consider the following: what could be going through the writer’s mind as he thought of that line and put it to paper? What kind of diseased version of a strange, warped mind could consider that comparing something not simply to “Hell”, but to “a diseased version of Hell”, a good idea? Was he doing it for fun ((I hope!)), just like the authors of the Doom Comic ((totally deserving of a post here, in the future))? Or did he actually think that this comic was enjoyable to read and had a thoughtful, worthy message?

Oh well. It was the Nineties. πŸ™‚

P.S. – he also thought it was a good idea to have one robot talk in binary — but saying the zeroes and ones out loud, which certainly makes sense in terms of data efficiency — and another robot talk in R2D2ish. Need I say more? πŸ™‚

Blagtron: The Resurrection!

Sometimes, pretty odd things happen. Yesterday evening, after I wrote the Quest for the Rings post, I kept thinking about old games for a time, and after a while I recalled a game I wrote very, very long ago (think early 90s), that I used to play with two separate groups of friends, and that we enjoyed a lot at the time. I then wondered: could I find it somewhere? No, finding it here would be a lost cause: the game was written on a 486, and later on a Pentium, and those machines of mine are long gone. At the time, there was no Internet to speak of, much less the concept of online backups, so there wasn’t any hope there. But I did remember uploading it to ftp.cdrom.com in the late 90s…

Its name was “Blagtron“. Yup, I was young, back then. πŸ™‚

Well, some quick googling, and I found it. πŸ™‚ The version that still exists, and that I include (with some tweaks) later in this post, is the latest one, in English (I seem to have missed a couple of phrases when translating it from my native Portuguese, but those are minor — and, anyway, there’s very little text in the game). The question then was whether it would work in DOSBox. Amazingly, it did — though, to enable sound, I had to replace an included file with one from an old version of Sound Blaster 16 drivers; this, fortunately, had been a problem for other DOSBox users before, and therefore the solution was easy to find. A few more minor changes (unfortunately, I don’t have the source anymore, as I said, so major alterations aren’t viable), and here it is: a repackaging of Blagtron 3.0.1, which works without problems on a default DOSBox installation.

Blagtron
Blagtron, running under DOSBox, in 640x350 EGA mode. Modes up to 800x600 are available -- not to look "better", but to extend the play area.

As you can see from the screenshot above, Blagtron is a “Tron-like” game — hence the name. You can’t ever stop, just turn around, and you leave behind a trail wherever you go. Touching a trail left behind by any player — including yourself — means instant death, and the goal is to be the last one standing. The main feature distinguishing it from other “Tron-likes” is the 4-player support — yes, all on the same keyboard –, though you can play a 2- or 3-player game, or even practice on your own. There’s also a 2 vs 2 team option.

I remember this game being quite fun and addictive to play in groups — though it’s the kind of game that can bring out the worst in people, when they lose… you have been warned. πŸ™‚ The only caveats to playing it now, under DOSBox, is that the automatic speed detection may need some manual adjustment, and you must close DOSBox to exit the game — originally, you needed to use CTRL-Break, but that doesn’t seem to work under DOSBox. Again, I’d fix it now if I had the source, but that is not the case. For details, (including how to run it in DOSBox, though if you’re familiar with it you won’t have any problem) read the included README.TXT file.

Well, here is the game itself, a “massive” 52KB zip file:

Again, please take a look at the readme file for instructions (tip: run SETUP.EXE before running the game itself, and the game’s speed may then need manual adjustment; all of this is explained in the aforementioned file) and solutions to possible problems. I appreciate praise comments and constructive criticism (bug fixes, unfortunately, can’t be dealt with until I eventually program a new version of Blagtron from scratch, in a modern language ((perhaps Java, so I can release a multi-platform version, and eventually adapt it to Android phones and tablets?))). For the history behind this game, read on…

Continue reading Blagtron: The Resurrection!

The Quest for the Rings (Odyssey2 / Videopac, 1981)

So far the oldest game to deserve a post on this blog,Β The Quest for the Rings is my favorite Videopac / Odyssey2 game, and arguably the best. Had it been released in 1985, its computer part (more on this in a minute) would have been described as “a Gauntlet clone”… only it preceded Gauntlet by a full 4 years (and Dandy, the game that inspired Gauntlet, by 2 years).

Quest for the Rings: a dragon
Both heroes are currently thinking: can I get to the ring while that dragon eats my best buddy in the entire world?

That, however, wasn’t the extent of QftR’s innovation. It was also, as far as I know (please correct me if I’m wrong, and I’ll edit this post) the first successful combination of a video game and aΒ board game; the game came in an unusually large (and lavish) box, which included not only the game cartridge and (beautifully illustrated) manual, but also a game board and an assortment of game pieces, plus a keyboard overlay for selecting game options. Also, it was a cooperative game at a time where that was truly rare (I don’t know of a co-op game before this one, but it’s likely that one exists). Oh, and it had four character classes for the players to choose from. Remember that all of this was at a time of games such as Pac-Man and Frogger.

Continue reading The Quest for the Rings (Odyssey2 / Videopac, 1981)