Fast random post in WordPress (with Apache’s help)

In this tutorial, I’m going to walk through how to use mod_rewrite‘s RewriteMap directive to redirect to a random WordPress post any time a visitor visits a specific URL, in this case /random. This technique is very fast, requires no PHP overhead beyond that which is normally needed to serve pages from WordPress, so it should be compatible with any caching methods being employed within WordPress. If you are using an upstream cache, like Varnish, you’ll need to exclude the URL you set up in the rewrite. Continue reading “Fast random post in WordPress (with Apache’s help)”

Decimal hour display for Taskcoach, Part 2

UPDATE: The latest version of TaskCoach (1.3.37) has this patch included. So, head on over to the download page and update.
This is an update to an earlier post which changed the effort panel display to use decimal hours instead of hh:mm:ss, but it did not have any settings or configuration. This new version provides an entry in the features tab of the preferences for turning this functionality on and off, for those of you who only want the feature enabled when it’s time to create an invoice.
Continue reading “Decimal hour display for Taskcoach, Part 2”

How to prevent Linux from waking up due to USB devices

I’ll start this one off with a funny story. Whenever I spark something in the room (like, my hand on a doorknob), my linux box wakes up from sleep. I tracked the problem down to the wireless receiver for the Logitech M570 wireless mouse on my desk – the electrostatic discharge from the spark causes the USB receiver to send some signal to the computer.

The problem is, that every time this happens (4+ times per day), it wakes up my machine. I then have to wait for everything to wake up, enter my password to unlock it, then put it back to sleep. Not fun. So I determined what I needed to do was prevent the USB ports from waking up the machine (or replace my beloved mouse). I chose the former, but for the longest time, could not figure out how the hell to do it. I finally figured it out, and to save anyone else from my misery, here’s the short version.
Continue reading “How to prevent Linux from waking up due to USB devices”