Tips 'n Tricks

WindowBlinds can cause general instability


No way! A system hack cause general instability, say it ain't so! It is true, folks, after uninstalling the bling-bling that is WindowBlinds, some nagging issues that had plagued both my home and work PCs disappeared. Gone are the general slowness, the jittery-as-a-junebug movie playback and games, and here to stay are improved load times, faster screen refresh and the ability to play any movie I want while I still work without thinking Max Headroom has taken over the world. Yay!

Image block rotation using


Here's a handle little Javascript function that'll let you rotate a set of DIVs as needed, e.g. to rotate a series of images for a slideshow. It uses to do a very simple looking yet quite appealing slide in/out. You'll need to load the prototype.js file and' effects.js file before running the code. One thing to note is that you can use any object to do this - DIVs, IMGs, etc, just assign the IDs accordingly, which is useful if you need to rotate entire code blocks and not just individual images. Enjoy!

// Shuffle a series of divs using
// Set it up like this:
// var shuffle_list = ['div1', 'div2', 'div3']; // an array of DIV IDs to rotate
// var shuffle_time = 8000; // 8 seconds
// var shuffle_effect = 'blind'; // the effect to us: 'appear', 'blind' or 'slide'
// setTimeout('imageShuffle();', shuffle_time);

function imageShuffle() {
if(arguments.length == 1)
var i = arguments[0];
var i = 0;
var next = i + 1;
if(next >= shuffle_list.length)
next = 0;
new Effect.toggle(shuffle_list[i], shuffle_effect, {queue: 'end'});
new Effect.toggle(shuffle_list[next], shuffle_effect, {queue: 'end'});
if(i >= shuffle_list.length)
i = 0;
setTimeout('imageShuffle('+i+');', shuffle_time);

Content filter plugin for Firefox


A common problem for parents is whether their children will accidentally discover unsavory content while online - an innocent search for "boobie joke" might get them more than they were expecting. There are lots of programs out there that purport to solve this, but the majority of them simply keep lists of inappropriate websites that you have no control over, which very often have political motives behind the content blocking. Enter a plugin for Firefox called ProCon which puts the control in your hands, so you can decide what is appropriate or not. ProCon allows you to block specific domains and URLs, block words that appear in the page itself, and add sites to a "whitelist" so that they're never blocked. While not the most powerful, it certainly is a step in the right direction and parents who are concerned about their children's viewing habits should definitely give it a try.

Apache log rotation on Windows


The Apache web server, or more correctly Apache HTTP Server, is a wonderful program for serving web pages to the world. It can be a bit tricky to set up, however, especially if you want to run it on Windows as many of the configuration examples you'll find online are for UNIX rather than Windows.

One particularly tricky thing to get working correctly is log rotation, where instead of saving all of your site traffic logs into one file it can split it up by day, month, etc. As mentioned, this is tricky because you would assume that the program you use to do this would work with the regular Windows directory names, e.g. "C:\inetpub\logs", but it doesn't.

So.... what you actually have to do is something like this:

ErrorLog "|D:/Apache2/bin/rotatelogs.exe D:/Logs/error_%Y%m%d.log 3600"

Note that I'm using the forward-slash (UNIX-style) directory separator instead of the backslash (Windows-style) directory separator. That seems to be the trick that got it to work for me.

On that note, there appears to be a bug in the rotatelogs.exe program on Windows. When you configure the rotation to use any time fields (hour, minutes, seconds) they are given "0"'s instead of the the real values, so you end up with e.g. error_20060912_184405.log instead of error_20060912_000000.log. I've not been able to find any official record of this, nor does the documentation have any mention, but as I've found other people experiencing this problem I'm going to assume that it is a bug and live with per-day log files.

Wordpress Widgets - Enhanced Search Box


After installing Wordpress 2.0 and discovering the wonderful Widgets plugin I added a few widgets to this site. While the widgets are great and give a really wonderful level of configuration over the site, I was quite disappointed to discover that the default search box looked pretty, well, aweful:

The old search box

So I did what every self-respecting geek does, I fixed it :-) I present to you, WPWidgets_EnhancedSearchBox v0.1:

The new search box

You can download a small zip file I made of both the new widgets.php file and a diff file off the SVN source code (in case you're into that kinda thing), along with a quick readme.txt file explaing how to install it, which you can download at will:


Subscribe to Tips 'n Tricks