Category archives for Geekery

Monday, March 12, 2007

Sidebar free in 2003!

Er, 2007. There are no good rhymes for "seven." Sidebar-less heaven in 2007? That just sounds dumb. Anyway, no more sidebar. I was mostly rather fond of my sidebar. It had good information and neato things. Plus it had that super-spiffy Docking Boxes script.

The one thing I did not like about my sidebar was how damn slow it was.

I keep tabs on all sorts of statistics from my blog, including page generation times. On average, one of my pages took 2.5 to 3.0 seconds to generate. That's crazy. And that's just the time to generate the page on the server. That doesn't count everything else that goes into a single page load. Clearly, all the spiffy data and the pretty shiny things were dragging me down. The sidebar had to go.

And go it has. Archives, categories, tags and search have been offloaded to a separate Page. The favorite blogs, top commenters, subscription links, flickr, last.fm and del.icio.us lists have all been shuffled down to a newly expanded footer. A few other items made it to other Pages or the brand new tab bar above the content area. Everything else was dropped completely.

Half the footer loads separately through AJAX and now my leaner, meaner pages generate in 0.5 to 0.6 seconds. Great success!

Tuesday, February 20, 2007

Don't be fooled

Michael Douglas thinks he can win me over with charity work. Pfft. Like that will happen. I'm wise to him.

 

I did something really stupid yesterday. My quest for Still Life led me to Usenet, where alt.binaries.sounds.mp3.complete_cd had what I wanted and a whole lot more. I downloaded something like eleven albums, including a few double albums. I snagged all the studio albums except for Brave New World and A Matter of Life and Death. Sweet. [Full disclosure: I also don't have The X Factor or Virtual XI. But those don't count. If it's not Bruce Dickinson, it's not really Iron Maiden. Except for the early albums with Paul Di'Anno. Ok, what I really mean is the albums with that Blaze guy don't count.]

My music library is set up exactly the way I want it. All these new files needed to be renamed and retagged. I keep a separate library of audio files downsampled to save space on my PDA, so I had to set that up too. All this takes time. I wasn't finished when I shot myself in the foot yesterday.

I keep a separate folder for Usenet downloads. New files stay there until I can sort them or whatever else I need to do. Yesterday I saw something in a multimedia group that caught my eye: screen captures from a zombie movie. Sweet! I loves me some zombie movies. So I downloaded about 40 of them.

Yeah, it turns out they all sucked. Not a one of them was worth even a glance. Delete, delete. While working in my Usenet downloads folder, I hit Ctrl+A to select the whole bunch [Tip for Windows users: Ctrl+A is a nearly universal shortcut for "select all"], then hit Shift+Del to bypass the Recycle Bin and get those turds off my disk that much sooner.

Hey, I thought. What did I do with those other Iron Maiden albums?

NOOOO!

Dammit. I deleted the six CDs I hadn't yet sorted out. I'm retarded.

But everything came together in the end. I fired up my newsreader to see if I could download fresh copies of those CDs. Not only were all the deleted ones still available, but now Brave New World was also available. Do you think maybe if I delete my shit again, the other album I'm missing will appear?

 

New plugin: Theme Switcher Widget, an addon for using Ryan Boren's Theme Switcher plugin with dynamic sidebars.

Monday, February 12, 2007

Randomness

I secretly want to visit the Los Angeles area and walk around until Jay Leno asks me something like, "Who's on the Supreme Court?" Then I'll tell him, "Roberts, Alito, Thomas, Ginsburg, Kennedy, Souter, Stevens, Scalia… and, uh… the ninth Justice, which I believe is the 'Mystery Justice.' " (I can never remember Breyer. I always have to look him up.)

Anyway, Leno will probably follow-up with several other questions with far more obvious answers in the hope that I'll say something like, "Uh, I think the capital of Texas is Sweden." Pfft. No way, man. You'll never catch me on Jaywalking. If he asks a question I can't answer I'll start to hump his leg or something.

 

Whenever I think of the Supreme Court, I always think of the Eagles. Justice David Souter always reminds me of J. D. Souther. On the VHS release of the Eagles' Hell Freezes Over concert, Don Henley mentions something about "co-written by our good friend J. D. Souther." That line drew a smattering of polite applause. Maybe two or three people in that packed amphitheater knew who J. D. Souther is and found him worthy of applause.

Before the Eagles become light hits superstars, Souther was like the sixth member of the band. He co-write a bunch of their songs, worked as a session player on some of their studio tracks and even played a few lives shows with the band. (I can't find any references, but I swear I read something like this years ago in the liner notes for Desperado.)

How much does that suck? The guy was a whisker's breadth away from being an icon. Now hardly anyone remembers him.

 

For a while I've been thinking about adding some kind of linkblog setup here. I've seen a few people who use something like "asides" or "mini-blogs" or whatnot. Some designs I liked, some I didn't. Well, I finally got around to setting up my own, which you can see on the front page.

The thing I like most about it right now is that it doesn't require any plugins, just a few template tweaks. I'm not sure I'm satisfied with the look right now, so I'll probably change it around a few times before I'm happy with it. One thing that's a little weird is that there's a bit of an optical illusion kind of thing happening. The color of the linkblog "bubbles" is the same as the color of the sidebar boxes, but the colors around both of them make them seem noticeably different. That one color seems much lighter in the sidebar than in the main column. Or maybe that's just me.

Friday, February 9, 2007

You know…

…I always feel lazy when I don't post anything for a few days. I know, I know… when it comes to blogging I don't owe anybody anything. I blog for me, I post what I please when I please, yada yada yada. I know.

And it's not like I've been neglecting the place. I'm constantly checking in on things, recoding this, tweaking that. My own personal definition of blogging isn't so much "writing posts" as it is "doing things with my blog." In that sense, I'm almost constantly blogging. Just this week I tweaked a few things on my template and put in some work on a few plugins.

But you can't see the things I do behind the scenes, and I feel bad about people who check in for new content only to find I've not updated in several days. I do however take heart in knowing that some of these behind the scenes things are for you.

Just today I removed the list of incoming links from the sidebar. That feature's always been a little flaky and lately has been really slow. Removing it reduced my page generation time by whopping 85%, which means faster page loads for everyone. A quirk of the Docking Boxes script that powers the sidebar prevents me from removing the whole container without invalidating everyone's cookies, so the box will remain in place but empty until I figure out what to do with it.

Faster page loads are kind of for me, but there's one new shiny that's all for you. For some time now I've used Mark Jaquith's excellent Subscribe To Comments plugin to give every commenter the option to receive follow-ups by e-mail. It has a nicely rounded set of options, but lacks one key feature. The subscribe checkbox on the comments form doesn't remember your preference. People who want updates have to constantly remember to check the box when they comment on a new post.

Well, no more. I fixed that. Now when you leave a comment a cookie will be placed that stores your preference. Getting the plugin to do that was a lot easier than I thought, too. It turns out that it only required thirteen lines of new code. If I'd known it was going to be that easy I would have done it ages ago. The fix is even simple enough that I might submit it to the developer for possible inclusion in the next release.

Well, you know… when I get around to it. I can't do it right now. I'm busy blogging.

Sunday, January 28, 2007

Those security warnings are important

Last night I survived my very first hack attempt. Someone, apparently from Europe if their IP address is to be believed, attempted to use a security vulnerability to gain admin access to my blog. Why me? No idea. I don't have any enemies, except possibly Ann Coulter, so I don't think I was specifically targeted. I was a target of opportunity.

But I was not an unprepared target. I stay on top of WordPress updates, especially those that come along with security warnings. The hole the ne'er-do-well tried to weasel through is an SQL injection vulnerability found in the trackback script included with all versions of WP 2.0.5 and older. Successful exploitation of this vulnerability will provide the hacker with the password for the admin account. With that, he/she can do all sorts of nasty things.

I am not using WP 2.0.5 or lower. My system stayed secure. The only ill-effect was that I had several very odd comments in my spambox this morning. I was protected because I stay current. How protected are you? To satisfy my own curiosity, I eyeballed most of the WordPress-powered blogs on my blogroll, in my bookmarks and in my feed reader.

I checked thirty-three blogs. Twenty-five of them are vulnerable to this very same attack and one is vulnerable to a different attack, leaving only seven out of thirty-three that are protected against all known problems. This particular hacking attempt would have been very different if the target had been you. Or you, or you, or you. (Pretend those are links… I'm not so rude that I'd dog people in public like that.)

And once again, you don't have to jump up to WordPress 2.1 to stay secure. The 2.0.x line is in feature lock, but it's still being updated for bug and security fixes. There's nothing wrong with staying in the 2.0.x branch a while longer if that's where you're comfortable. Just make sure you're running the newest release in your branch.

Tuesday, January 23, 2007

One last bit about 2.1

WordPress 2.1 was released yesterday. I won't be upgrading, at least not for a while. If you read my previous bitchfest, you may remember all my problems with the beta version. Every difficulty I was having has since been addressed and the final version is now very solid. But there's still one thing holding me back: plugin compatibility.

In my testing, I'm still having issues with some plugins. To be fair, a lot of those problems are not widespread and may in fact be limited to my very specific set of circumstances. There is one incompatibility, however, that is not limited to me and that's Ultimate Tag Warrior. The current version of UTW does not play well with WP2.1. There's a nasty little bug where a new comment can erase a post's tags.

2.1 does have some excellent new features and I'm disappointed I won't be jumping on that bandwagon just yet, especially after testing it for six months. There's one bright spot in all of this. I don't need to upgrade.

The WP dev team has announced that because of the bump in minimum required MySQL versions (2.1 now requires MySQL 4.0, remember), they won't be abandoning the 2.0.x line. They've committed to maintaining 2.0.x for an additional two to three years. Most webhosts will have some sort of policy requiring you to keep your blog software (and any other scripts you run) updated for security reasons. A vulnerability in your blog software can compromise the integrity of your server and may put other people at risk. Your webhost will be seriously pissed at you if someone exploits a hole in your blog and there are server problems because of it.

The nice thing about the current situation is that I don't have to jump on 2.1 to stay on top of security. In the future we'll see WP 2.0.8 and 2.0.9, etc. (Or maybe 2.0.7.1… I'm not sure how they're going to version that.) I'll upgrade to 2.1 eventually, as soon as my issues are sorted out, but there's no pressure.

You shouldn't feel pressured either. 2.1 is a big deal, and is definitely worth the upgrade, but there are some real gotchas involved. If you can, test 2.1 on a second blog. Like I talked about (at great length) in my previous post, downgrading is a massive chore, so it would be a real kick in the teeth to find problems when it's basically too late to do anything about it. At the very least, be sure to check the (sadly, incomplete) plugin compatibility list to see if your favorites are ready to go.

Sunday, January 14, 2007

I might be a little nuts

Just the other day I was talking about WordPress 2.1 and how excited I was about it. Yeah, I'm not so excited anymore. 2.1 has some nice new features, like new plugin hooks and overhauls to the page and link systems. It also comes along with a handy new feature to export your blog to a WXR-XML file.

The biggest thing I was looking forward to was the fact that 2.1 is essentially a complete rewrite. Nearly all of the code has been rewritten and optimized to be cleaner, faster and more efficient. And it mostly is. Gone are things like the cumbersome, monolithic functions.php. In their place are leaner, more logical files.

The only problem is that 2.1 kind of sucks. Or at least for me, and at least right now. After using development builds of 2.1 on a test blog since July, I was chomping at the bit to get the new version deployed here. So last week I installed WP2.1 beta 2 on this blog. Wow, was that a mistake.

Within a day, I'd found several bugs and plugin incompatibilities. The bugs were mostly pretty minor, but the plugin problems just about killed me. Two plugins I consider absolutely crucial no longer worked worth a damn. Both of these plugins are in active development by very smart people, but 2.1 killed them anyway. Although, to be fair, one of the plugins probably works perfectly and instead the problem was with my own setup. After all, I've been using this blog for a year. That's a lot of plugins running through my database with dirty feet.

But not anymore. If you visited on Friday or part of Saturday, you were probably greeted by a "down for maintenance" message. I was yanking 2.1 out by it's roots so I could go back to a version that did all the things I wanted it to do. Incidentally, reverting like that is not something you're supposed to be able to do. The WordPress team makes upgrades easy as pie, but downgrades? Pfft. Why would you ever want to do that?

I generally agree with the idea of not making any kind of downgrade path. Developers have a general interest in moving their user base forward, not backward. But it sure did make what I wanted to do a big pain in the ass. Sometimes, installing a new version of WP will make changes to the database structure. That's the step that makes downgrades such a pain in the ass. 2.1, with it's radical changes under the hood, is definitely one of those upgrades.

I make database backups regularly (and you do too… right?), so it would have been simple to restore a pre-2.1 backup, delete 2.1 and install an older version. But that wouldn't necessarily fix any database issues that might have been exacerbating the problems I was having with 2.1. I'll probably end up upgrading eventually, so as long as I'm up to elbows now, I might as well clean house on the DB too. So database backups weren't much good to me.

I used the handy new WXR-XML export to download a backup of my blog and then used a plugin to import that XML. But there are a few issues with this. First, the XML export isn't configurable. You get what you get, and what you get kind of sucks. The exporter snags posts, comments and categories. It doesn't export your options, registered users, links, custom plugin tables, etc. That's ten shades of suck.

Second, the XML files are HUGE. When I use Scott Merrill's database backup plugin (the one bundled with WordPress), my download file is about 3MB in size for the entire database. The XML backup, with just three database tables, clocks in at a whopping 13MB. And this is the new feature intended to replace Scott's plugin, which by the way is no longer part of the WP core. WP2.1 does not include wp-db-backup, so if you intend to keep it (and you really should), you'll have to make sure you hang on to your older versions.

Even the parts the XML backup keeps are woefully incomplete. The process of exporting for 2.1 and importing to an older version stripped a lot of things. All of my tags and post layouts were lost. The tags I could do without because one of the troublesome plugins was UTW, but the post layouts? That's a pain.

Sigh. Oh well.

Another pain in the ass is that post and comment ids were lost. I kind of like that the post ids were lost because now my ids are numbered more or less chronologically, rather than the hodge podge I had before. I brought in a lot of archives from previous blogs after this blog was well underway, so I had things like post #548 being ten months older than post #547. And since I use permalinks, this isn't a big deal for me. For the most part, people have no way of knowing which post is #548. However, if I wasn't using permalinks, if I had the default cruft-based structure like /?p=548, all of my links would suddenly point to the wrong posts. This is similar to what happened to my comment ids.

On nearly every theme, including mine, the permalink to any given comment is defined by the comment id. So every link I ever made to a comment needed to be manually repaired. Fortunately, there were only about 40 of them throughout the entire blog. The thing that really kills me about this is that I pointed out this shortcoming to the dev team months ago. I had the misfortune of voicing my concern during the middle of a cat fight and I was essentially ignored.

The export/import process also stripped away all my post slugs. All slugs were automatically regenerated from the post titles. Which, if you're like some, could be a significant problem. I don't tweak post slugs often, but I have retitled posts (like adding "Updated" to signify new content), which breaks the permalinks for those posts.

Anyway, after a lot of grumbling and cursing, I'm back on stable footing again. Through a combination of SQL backups and XML exports, everything is running smoothly and all my data is back in place. Well, most of my data. It'll take ages to tag everything again and replace all my post formatting. But I'd say the effort is worth it if it leaves me with what I really want.
 

100 things about me

7. I'm a little OCD about a few things. My blog is one of them. Those few days I used WP2.1 beta drove me absolutely batty. I felt like my blog was broken, even though it really wasn't. There were some things that didn't work, but possibly I was the only one to notice. All the basic functionality was just fine. Pages loaded without error messages, people could read and comment and the site feed worked fine. That's the essence, the core functionality, of any blog.

But the little things were making me crazy. I knew they were there and I was bitchy and irritable because of it. At least now it's fixed and I'm not freaking out about it anymore.

Another thing I'm a little obsessive about is our DVD library. We've got over 700 DVDs… and they're alphabetized. With each new purchase, I rearrange everything to accommodate the new addition.

So maybe I'm a little crazy. At least now, way down here at the end, you understand the post title.

Wednesday, January 10, 2007

Well alright then

Last night I upgraded this blog to the shiny new WordPress 2.1 beta 2. In addition to finding a couple of plugins no longer working, I found something that's a real kick in the teeth. Remember my sticky posts test from just a few weeks ago? Yeah, that doesn't work in WP2.1. In fact, it fails pretty spectacularly.

Fuckbuckets. Looking on the bright side, at least I never got around to the exhaustive explanation on how to implement it. That would really bring me down. And besides… maybe this is a minor glitch that can still be fixed before 2.1 final ships.

2.1 looks likes it's going to be pretty cool. My favorite enhancements are the ability to have draft and private pages and the Word-style autosave draft function. There's also a pretty substantial overhaul to the bookmark system, including new template tags that make life easier for designer types.

However, the creamy goodness comes with a catch. 2.1 requires a newer version of MySQL than previous versions. 2.0.x and lower require at least 3.23.23, where 2.1 now requires at least 4.0. For those of you unable to hop on the 2.1 bandwagon until your webhost makes some upgrades, the WP dev team has committed to supporting WP 2.0.x for the next several years.

I'm usually not so gung ho about new versions of WP that I'll install a beta on this blog, but 2.1 is pretty cool. And I'm glad I installed it here. I found a bug last night. I always feel pretty cool when I can contribute, rather than just nod my head and say "Yeah, looks pretty good."

Wednesday, December 27, 2006

WTF?

Two weird things:

  1. You know the Forbidden City? For centuries the Chinese palace complex in the heart of Beijing was home to generations of imperial families. The city gets its name from the fact that at several points throughout its history, the only people allowed inside the complex were the emperor, his concubines and his eunuchs. In recent decades, portions of the Forbidden City have been opened to tourism.

    There is now a Starbucks located inside the Forbidden City.

  2. Through Pop Candy, I found a page linking the 50 greatest cartoons of all time. I was tickled to see both my favorite Looney Tunes (What's Opera, Doc?) and Bunny's favorite (Rabbit of Seville) made the list and they were available to download.

    I quickly hit those links to grab a copy. "What's Opera, Doc?" (#1 on the list) was served via Yahoo video. On the Yahoo page I was more than a little annoyed to see the "more videos" section of the page featured porn thumbnails.

More »

Saturday, December 23, 2006

Sticky posts without Adhesive?

Don't pay too much attention to this post. I'm testing out a template-based alternative to Owen Winkler's Adhesive plugin. This post is supposed to sit at the top of the homepage, and stay there. Since it's my current post, that's exactly what it's doing anyway. So the real test will be to see how it behaves when there are more recent posts.

So anyway, pay this post no mind, but be sure to check below for newer posts.

As long as it's sticky anyway, I might as well use it for something.

If you're visiting for the first time, or if you just missed it when it was new, you might want to check out that post where I talk about new sidebar functionality you might not have noticed.

Edit: Yup. Seems to work just ducky. Now as soon as I get around to it, I'll write up something about how to pull this off.