Skip to main content

Posts

Showing posts from May, 2008

Using Firebug to test when updating large sites

Yikes, over a week since my last post. Busy, busy - thank google for coffee! Anyways, though this tip might be useful to someone. I was tasked with performing some minor changes to a site. The site was large and very high traffic, and because of how it was structured it was not feasible to create a test page or use a staging server - the changes had to be made to a live page. Normally this wouldn't be a big deal, except that the site was still using a heavy table-based layout. So many tables! Haven't seen so many in a long time... And worse, the indentation of the code was a mess, making it harder to figure out which tables needed to be moved, etc. Obviously, the goal was to find the "master table" for a section that needed to be moved, because to cut and paste that code to a new location w/out getting the closing table tag, or picking the wrong table would make for a screwed up page, which given the traffic would likely affect visitors... Here's where firebug com...

Quick movable type issue/fix

Found a fix for this movabletype issue recently. I was having problems with an MT-driven site not returning search results. It would come back with a " 500 Internal Server Error " with a log message of " Premature end of script headers ". Turns out this was due to the fact that this search was running over a very large site (thousands of entries), and presumable the search was timing out. Would be nice to have more descriptive errors! Anyways, it was fixed by limiting the number of days back that the search covered via the SearchCutoff parameter in mt-config.cgi. Maybe that'll help someone and save the some time! As an aside, it may also be helpful to know that when you set the system up to include results from multiple blogs, the system does not use the template that you can modify through the MT admin - rather it uses a file that you'll have to "manually" edit on the server ( search_templates/default.tmpl by default). This is pretty clear fr...

What to do with a metric ton of spam?

I have a site hosted on one of my servers that has a phpBB installation. The admin for the board had basically walked away from the site. Anyone who's worked with phpBB, or any forum for that matter - knows that it's like crack cocaine for spammers - they love that crap. So while moving sites off this old server, I noticed it was still there. I logged in and HOLY SH^T it's the spamocalypse in there. I think just one of the sections had like 8k new posts. Of course, any legitimate users had no doubt been driven away. So I closed it down. But just before I did the rm -rf to dump the boards, I thought - perhaps there's something useful here? So I just put an htaccess password on it instead to keep the spammers out, as well as any SEO benefit they may get from google spidering all that crap. At the very least there's a wealth of IP addresses and email addresses used by spammers. And perhaps much more - after all many of the posts are basically the same thing over and...

Paging Captain Obvious...

This is an object lesson in the importance of the sanity check. I was working on reskinning a MT blog, working on the CSS files when suddenly the posts dissapeared! Well, post actually - it had just been set up, so there was just a single test entry in the system, sitting on the homepage. Mystified, I undid my changes. Still no entries. I returned everything back to its original state - still no entries. I looked closely at the code to display the code, everything looked fine. I checked on the admin side, and the entry was still there and hadn't been changed at all. I even tried using some demo entry display code from the MT site - nada. Mystified, I told the client that something weird must have happened, although I had no idea what. That's always I fun thing to tell a client! I couldn't see how it could have been something I'd changed, since all I'd touched was css code... I asked him to have the IT people restore the blog to it's original state. Of course, a...

OpenX ad display problems

This one had me stumped for a while today, so I thought I'd post it in case it's useful to someone. I'm testing a new install of openX for a client, who plans to use it one a separate machine as an ad server. So I've set up the publisher, zones, advertiser, ads, etc. I used an already existing ad they're running (javascript to a remote server). But the zone kept showing that no ads/campaigns were assigned to it. But if I looked at the campaign properties, it showed as being assigned to that zone. So one place said one thing, one said another. Well, turns out the problem is that the zone is set to be 160x600 dimension zone. OpenX has decided that this ad is not actually 160x600 (although it is) and so it won't allow it to be assigned to the zone. Of course, it doesn't tell you that the ad was blocked for that reason . So you're left to wander the openx forums, until you stumble upon a useful post, and decide to set the zone to accept any size ad. So, here...

Tips on moving a site, Part I

Been doing a lot of work lately moving sites from an old dedicated server to a new one with a new hosting company. The old server had no (useful) control panel, so I've been doing a lot of it by hand, and I thought I'd post a few handy pointers for anyone who may be in a similar situation. For static sites, the process is dead simple - just tar up the old site's content using something like tar -cf [tar filename].tar [path to site]/* will do it. Then depending on the site, it may save you a little time to zip the tarball. Then, after doing whatever you need to do to create a new site on the new server's control panel, login in with SSH, go to the appropriate directory and pull over the tarball with scp: scp [username]@[server]:[path to tarball]/[tar file] ./ And then extract it, and you're ready to go. One thing it watch out for is absolute paths in the content from the old site. If you know what they look like, it's pretty easy to grep for that pattern in the...