The Gervais Principle
by Jon on Jul.30, 2010, under Babble, Life
Go read this brilliant treatise on the pathology of the workplace as demonstrated by The Office. I think the breakdown of the workplace heierarchy into sociopaths, the clueless, and the losers is spot on.
As for myself, I think I’ve always been at a weird spot, counting myself among the bare-minimum performers (the “losers” who are cognizant of the shitty deal), while yet actually producing more like an overperformer — only because I’ve set my “bare minimums” too high, not for ever having had any delusions about the value of oveperforming. I need to work on that, if I’m going to have any hope of holding on until I can figure a way off of this infernal hamster wheel.
(For that, I’m looking really hard at what this dude has to say)
from the dept of “the more things change, the more they stay the same”
by Jon on Jul.26, 2010, under Babble, Politics
@AuntB pointed out this revealing article. Apparently xenophobes protesting whenever the scary foreign people want to build a new church is a proud Rutherford County tradition:
This plan to construct the county’s first Catholic Church was the target of a local KKK protest march. Woods was only 7 or 8 years old when he and his brother watched the “torch light” KKK march through downtown Murfreesboro.
Gallery::Remote::API
by Jon on Jun.15, 2010, under Babble, General Tech, teh internets
Awesome… all my futzing around with Gallery has led me to release my first perl CPAN module — Gallery::Remote::API, a perl module for interacting with a Gallery installation via Gallery’s remote protocol.
Funny thing was, halfway through writing it I realized the remote protocol itself didn’t let me do what I set out to do in the first place … it actually doesn’t let you do much besides fetch info and add images. Oh well, maybe someone will find it useful. It was a good exercise for me just to get a handle on packaging a module for distribution.
wordpress, gallery, and canonical urls
by Jon on Jun.12, 2010, under Babble, General Tech, teh internets
I just know you wanna know what sort of fun I’ve been having this morning.
OK, so I’m playing around with an installation of WordPress featuring an embedded installation of Gallery2 via the excellent WPG2 plugin. And I’ve got all my fancy url rewriting set up on both platforms.
So what happens is, when you go to “site.com/galleries”, you’re going to a wordpress page, at which point wpg2 does some fancy footwork to embed the appropriate gallery page, so when you go to “site.com/galleries/myalbum/” it shows that album’s page, and “site.com/galleries/myalbum/myphoto.html” shows that photo’s page, etc., all wrapped up inside your usual WordPress header, sidebar, and footer. So far so good.
Here’s the thing: Gallery’s url-permalink stuff correctly writes out the album links as “site.com/galleries/myalbum/”, but I kept getting 301 redirects to “site.com/galleries/myalbum” (notice the trailing slash difference). Now that’s not a completely insufferable thing — it does get you the correct content. But there are both performance and SEO considerations. On the one hand, you don’t want to 301 if you don’t have to (waste of bandwidth and slows down the user experience); on the other hand, you do only want one version, whichever it is, to be the “accepted” version, while the other 301s back to the first, otherwise you split your ranking juice between the two urls, and may get penalized for duplicate content.
So the easy solution would probably have been to hack Gallery and remove the slash wherever it generates links (and where it generates the rel=”canonical” link in the header [which Gallery itself doesn't actually do, I had to put that in my custom theme myself]). Except that IMHO, the slash should be there in this case — in my mind, an album is a directory, as evidenced by the fact that “files” (photo pages) exist beneath it.
So I set about trying to figure out who was redirecting my slash back to no-slash by poking around in all my redirect rules. Now that’s not an easy task, given that wordpress and gallery both write their own .htaccess files, wpg2 writes a modified version of gallery’s mod_rewrite rules into the wordpress .htaccess, and on top of that, apparently WordPress ALSO has a whole set of “virtual” rewrite rules that don’t show up in the .htaccess file. Compound this by the fact that Dreamhost doesn’t seem to let me turn on mod_rewrite’s RewriteLog, and by the fact that the galllery links have to go through some valid rewrites to get them first in a form that wpg2 can understand, and then into a form that gallery itself can understand — well I drove myself nuts trying to figure out where it was happening.
Finally out of sheer frustration I grepped for “301″ in the wordpress source code — and sure enough, I found a sneaky little wordpress function called redirect_canonical was the culprit. Apparently anytime it gets a “site.com/url/” (at least one that doesn’t actually point to a real live directory — I think), it removes that slash and 301s.
Now, normally, that’s probably the right thing to do. If someone goes to “site.com/myblogpost/”, it probably should redirect to “site.com/myblogpost”, and consider the slashless version canonical — since a single blog post/page/whatever is really more like a file than a directory. But it’s not appropriate in this embedded gallery situation. Luckily, wordpress does provide a whole system of filters and hooks with which you can fix this.
So, if you’re in a similar situation, you can add something like the following to your theme’s “functions.php” file, and that should do the trick:
//don't let wordpress "canonicalize" gallery virtual directories
function g2_reverse_canonical($rd_url,$rq_url) {
global $user_url;
$pattern1 = "~^$user_url\/galleries\/([^.]+\/)+(\?[^?]*)?$~";
$pattern2 = "~^($user_url\/galleries\/([^.]+\/)*([^.]+))(\?[^?]*)?$~";
if (!empty($rd_url) &&
preg_match($pattern1,$rq_url)
) {
#don't do it!
return false;
}
elseif (empty($rd_url) &&
preg_match($pattern2,$rq_url)
) {
#reverse it!
return preg_replace("~(\?[^?]*)?$~","\/${1}",$rq_url);
}
#otherwise, let wp do what it wants
return $rd_url;
}
add_filter('redirect_canonical','g2_reverse_canonical',10,2);
Of course you’ll want to replace “galleries” in those regex patterns with whatever path you chose for your gallery permalinks. It seems to work for me — at least, I haven’t found any bugs so far (if anyone who knows more about this stuff than I sees an issue, I’m all ears). Notice that in addition to stopping wordpress from removing the slash, I also do the reverse and add the slash when it isn’t present. It might be more efficient to move that part to an .htaccess mod_rewrite rule, but I wanted both actions in the same place for the sake of my sanity.
Further, note that it does NOT apply if the final token (prior to any query string) contains a “.” — this lets wordpress correctly do it’s thing and canonicalize the “site.com/myalbum/myphoto.html” pages without the slash. Of course the downside is that you can’t have a “.” in your album names (but since gallery album names — as far as the url is concerned — are the actual directory names where the data is stored, hopefully it’s not a problem. Yeah, you can create directory names that have a “.” in them, but hopefully you’re sane enough not to do so :)
Finally, I also let wordpress take it slashless when just going to “site.com/galleries”. Personally, I think that too should be treated like a directory, but since it’s technically a wordpress “page”, and since in this case Gallery is also generating links without the slash, I’m just going to let that one be.
And I still hate PHP.
dreamhost–
by Jon on Apr.08, 2010, under Babble, teh internets
Well, dreamhost bit me. Seems they decided to move me to a new server, which is all fine and dandy, but they also seem to have decided it would be a hoot to just delete all my files in the process.
But, the database was fine, so after some finagling I was able to restore most of the content, but I lost my theme and all my customizations, plus any images or other media some of the old posts may have included.
On the plus side, it gave me a chance to play with a new multi-domain setup I’d had in the back of my head, so I guess it worked out. It’s not like I had anything better to do today.
Russell King’s Open Letter To Conservatives
by Jon on Mar.25, 2010, under Babble, Politics
4 Comments more...in which I go all google fanboy
by Jon on Feb.08, 2010, under Arts & Entertainment, Babble, Life, TV & Movies, teh internets
Goldni and Aunt B have some thoughtful posts about the omnipresent sexism (if not outright misogyny) in last night’s superbowl ads.
I don’t have anything to add really, but did have a minor disagreement with Aunt B on one tangential item:
I mean, I thought the Google ad was cute, but it seemed like a masterpiece because it was a respite from the “Women suck and they’re ruining you. Only our product can make you more manly.” bombardment.
The disagreement being that I thought the Google ad was a masterpiece on its own without regard to the shittyness of the rest of the ads. (Which is really to say I just wanted to post about the Google ad and this was a convenient segue to do so :)
I really did think it was brilliant — maybe the best superbowl ad since that iconic one from Apple so many years ago. It was simple, thoughtful, intelligent, and emotional — and with that tag line “Keep Searching”, it was even deeply existential.
I’m no marketer, but it seems to this layman that an entire ad showing nothing but the branded product doing what the product does has got to be the gold standard, at least when it can be done this clearly and effectively, and especially when the product is shown profoundly helping the user shape the very fundamentals of his life.
But more interesting to me, and this goes to the bit about it being existential — it made a provocative observation about the human condition, how we *are* all searching. We’re searching for love, for happiness, for acceptance, for fulfillment, and for billions of things unique to the individuals doing the searching.
And back to the marketing aspect, Google just humbly accepted its place as the quiet little tool helping us answer our queries in ways never before possible, and not until recently even imaginable. Without a hint of arrogance they reminded us of just how immense a cultural revolution we’ve seen in the last 10 to 15 years or so, and how they’ve become the focal point through which we find and experience so much of that revolution.
That’s some powerful shit. And they did it without actors, celebrities, dialog — hell, I wouldn’t be surprised if they didn’t even use a camera, just captured it right from the desktop. In this they made a commentary, even if unintentional, about the elemental superiority of substance over style and function over form (the same commentary they began making the day they launched with their simple, no-nonsense prompt).
And then there’s something beautiful in knowing that they didn’t have to do it, it wasn’t part of some well-plotted marketing scheme — they just put it up there because they could, because they felt like participating in the cultural event that superbowl ads have become. And they used a piece they’d already released into the tubes.
It just worked on so many levels. It might be cliche to say it, but this thing wasn’t just an ad, it really was a work of art. Performance art, even.
Now THAT’S the Obama I voted for
by Jon on Jan.29, 2010, under Babble, Politics
Where ya been, guy? Well, anyway good to have you back.
http://www.youtube.com/watch?v=oBuG2TdgMn0
Basically, it’s 140 to 1, and he mops the floor with them all, including local favorite nitwit Marsha. Basically, don’t bring a knife to a gunfight, and don’t use “truthy” talking points to attack a guy who actually knows what the fuck he’s talking about.
falling trees in the forrest
by Jon on Jan.24, 2010, under Arts & Entertainment, Babble, Music, studiolog
Well I’ve been taking it slow, just doing a few things each weekend, trying to ease my way back in, not forcing it. There’s been some waiting as I’ve had to get a few things — the new midi controller, new monitors, a new stand, a new power supply. And I’ve still got a lot to do, getting the mixer routes all patched, with the effects and gates and eq and compressors and such all wired up.
But today, I turned it all on, for the first time in — what, is it 8 years? Maybe closer to 9, going on 10?
I’ve got sound from the xp-30. And when I fired her up, I found her right where I left off, sitting on my favorite dirty organ patch with the pitch shifted down an octave, wondering where I’ve been and happy to see me.
I’m gonna grab another beer and get back to my old friend.
