Tag Archives: wordpress

Unnecessary hoops

I just activated Akismet, because spam has again reached unbearable levels. The reason that I didn’t activate it before is the absurd procedure that I had to go through to do so. In order to activate this plugin on my blog, I have to go to wordpress.com and sign up for another blog which I will never use, so that I can obtain a wordpress.com API key. I’m a little perplexed by the logic in this – to make one blog more usable, I have to go create another one? Who does this benefit? What is the logic behind forcing me to jump through these hoops? I mean, sure, it wasn’t a hard or complicated process, just really dumb.

So, anyways, for no readily apparent reason, I now have another wordpress site. Hope it doesn’t get innundated by spam, since I’ll probably never look there after today.

Podcasting, Garage Band, Audacity, WordPress, and my patience

Things I’ve learned so far this weekend.

1) It is a much better use of my time to record stuff in Audacity, export it as a raw WAV file, and then drag that into Garage Band. It gives me *far* better audio quality, and tries my patience far less.

2) Although the WordPress documentation states authoritatively that WordPress doesn’t, and can’t, automatically recognize .m4a files as podcasts, this is untrue. It will recognize anything with an audio/* mime-type. The thing is, Apache doesn’t come default with the .m4a file type mapped to an audio mime type.

a) I’ve fixed the doc, so that it now tells the truth

b) You have to add the following to your configuration file, or .htaccess file:

AddType audio/x-m4a m4a
AddType audio/x-m4b m4b

c) I committed a patch to Apache that adds these mime types, so the next time you upgrade Apache, you’ll have these audio types by default.

Note: This patch has been reverted, due to the policy that x- mimetypes can’t be in the default config. While I find this policy to be somewhat silly, I don’t have the energy to debate it right now. So, for now, pretend that item (c) isn’t really there.

3) Running iPhoto, GarageBand, Audacity and iTunes all at the same time appears to be too much for my laptop to handle. But perhaps that goes back to my patience.

WordPress 2.0

I upgraded to WP2.0. Alas, I can’t say that it’s a big improvement. The two things that I most notice (the WYSIWYG editor, and the ajaxy admin interface) actually, from my perspective, make the thing harder to use, rather than easier.

Creating a post is now done (by default – you can turn it off) in a WYSIWYG editor thingy. This means that when I want to add a link, rather than typing the HTML to make a link, I have to type the link text, highlight it, click the link button, and then type in the URL. While this is likely easier for folks that haven’t been writing raw HTML for 14 years (holy cow, has it really been that long?) for me, it makes it considerably slower.

And the various input blocks that used to be scattered higgelty piggelty around the form are now nicely zipped up inside collapsable blocks that can be dragged to wherever you want them. This is actually very cool, except that it hides from me the stuff that I want to fill in every time. Once again, that’s the default behavior, and can be changed, by expanding the one(s) that I need, and dragging them to the top. It remembers this.

So, after turning off the WYSIWYG editor thing, and opening up all the blocks that I always want, I’m left with … what I had before I upgraded.

And, although the press release promises hugely improved spam handling, I’m getting *way* more spam after the upgrade than I was before. Perhaps this is unrelated to the upgrade, and has merely to do with some other coincidence. I really can’t say for sure.

I’m sure that there are lots of other bug fixes and other nifty things. But I haven’t encountered any of them yet. Other folks clearly think that it’s a huge improvement.


Testing linknotes:”(A plugin that makes footnotes)”:. I’ve always liked footnotes:”(My editors haven’t always shared my enthusiasm)”:, and have been casually looking around for a nice way to do them. I won’t use them quite as extensively as I do in this post:”(That would just be silly)”:, but I imagine I’ll use them occasionally.


WordPress comes with a nifty feature called Permalinks, whereby you can have links to your articles by name, rather than by the icky ID number.

I’ve never done that, because the rewrite rules necessary to make it happen are deeply inscrutable.

Well, since I’m monkeying with mod_rewrite stuff anyway, I thought that making a permalink thingy that I can actually understand would be a good example of a RewriteMap rule. So, here it is.

This is a first draft, and may have some problems. I already know one problem, and that is that RewriteMap can’t be used in .htaccess files. That’s not a problem for me, but it is a problem for a significant number of folks that use WordPress. The only way around that is to get your server admin to add a RewriteMap line to the main server config file, pointing at your map program. That problem may be insurmountable for some folks.

Anyways, in your config file, you put:

RewriteMap wp_permalinks prg:/somewhere/bin/wp_rewrite_map.pl
RewriteRule ^/perm/(.*) ${wp_permalinks:$1} [PT]

The file /somewhere/bin/wp_rewrite_map.pl looks like this:

use DBI;
my $dbh = DBI->connect(“DBI:mysql:wordpress:dbserver”, ‘username’, ‘password’);
my $sth = $dbh->prepare(“SELECT ID FROM wp_posts
WHERE post_name = ?”);
my $ID;

# Rewrite “permalink” style links to article IDs

while (my $post_name = <STDIN>) {
chomp $post_name;

print “/wordpress/index.php?p=$IDn”;

This article, for example, has the URL of https://drbacchus.com/perm/permalinks

Upgrading to 1.5

Well, I’ve upgraded to WordPress 1.5. I was pointed to a HowTo, which went through the steps in gory detail. But it turns out that, if you don’t care a whit about design, the upgrade is even simpler.

mv wordpress wordpress_bak
tar -vzxf /tmp/wordpress-latest.tar.gz ./

Edit database settings in wp-config.php. Then go to http://servername/wordpress/wp-admin/upgrade.php and click on the link.

That’s literally all there is to it.

That’s awesome. I love WordPress.

The spam continues

Since Sunday morning, mod_security has blocked 816 attempts to post spam content in the comments on this web site. Two of those have happened while I was typing this note. Additionally, I’ve received about 20 or 30 apparent “test” messages, where people posted harmless, but off-topic, nonsense, apparently in attempts to see if comments were enabled, or working, or if their address was blocked, apparently.

Almost all of these attempts were on the same small handful of topics (a card game and a diet pill) although there were also plenty for other topics like financial advice of one variety or another.

Are other people getting assaulted to this same degree? It continues to amaze me the enormous amount of time and money we spend combatting this kind of unethical behavior, which is all done in the name of the Great God Capitalism.

Come on, folks. Cut it out. It’s just annoying. and it is theft of services to advertise your product on my website, so it’s probably illegal. If you want to advertise on my website, just send me a cheque, ok?

Comment spammers are dumb

Over the last 48 hours or so, I’ve gotten upwards of 400 identical comments on my blog. Fortunately, comment spammers are really really stupid, so they were all identical.

I’ve got mod_security installed. I put the following block into my vhost block:

<LocationMatch comment>
SecFilterEngine On
SecFilterScanPOST On
SecAuditLog /dev/null
SecFilterDefaultAction “deny,log,status:402”
SecFilter “your[[:space:]]fat[[:space:]]ass”
SecFilter “poker”
SecFilter “phentermine”
SecFilter “craps strategy”
SecFilter “seend a card”

This has blocked all attempts in the last 10 hours or so. And, when they change their tactics, you can alter the rules appropriately.