Old Ruby Script : Rnaarerge ltreets iisnde wdors and sltil raed tehm
This little gem comes from October 20, 2006. I had just heard about the research saying that as long as you keep the first and last letters of a word in place the order of the other letters doesn’t matter. Supposedly your mind will still figure out the correct order. It turns out that this e-mail forward wasn’t as impressive as it made out to be, but the script was fun to make anyways. Here’s what the e-mail said: Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn’t mttaer in waht oredr the ltteers in a wrod are, the olny…Read the Rest
Add an email address that forwards to a script
I previously wrote a post about receiving e-mail and saving attachments with PHP. I was so focused on having solved that part of my problem that I neglected to write about how to send e-mail to a script in the first place. Thanks to a helpful commenter, today I am rectifying that oversight. Using CPanel Here’s how I set up an e-mail address to be sent to a PHP script in CPanel. First, go to the Forwarders section… Click the “Add Forwarder” button… Finally, enter your desired e-mail address and the name of the script you wish to have process your…Read the Rest
Google Analytics Custom Segmentation by Role in Drupal
At the company I work for, I was already using Google Analytics to track visitors to the website, but I wanted a little more information. I wanted to see how many visitors were staff, versus other visitors. Put the Pieces on the Table The first piece we needed was already in place. We are using Drupal for our website, and every staff member needs to log in from time to time for various staff only resources. Regardless of any other permissions they may have, everyone who is staff is made part of the role “staff”. Google lets you add up…Read the Rest
Update Multiple Rows At Once With Different Values in MySQL
I’ve had to figure this out on my own twice now, so I guess it’s time to document it. It is possible, and fairly easy, to update multiple rows of a MySQL table at the same time, with different values for each row. Unfortunately it’s not as easy as inserting, but once you see what’s being done you will probably say “Oh, of course!”. The key to the multiple row update query is the CASE statement. MySQL’s CASE reference page doesn’t even have the word “UPDATE” on the page anywhere, but don’t let that fool you, it can be used…Read the Rest
Have Pidgin Beep at You Through the PC Speaker
This post will show you how to make Pidgin beep at you through your PC speaker when an event occurs. The PC speaker is NOT the speaker which plays music for you. It’s the speaker that makes a beep when your computer turns on or when you do something wrong in the terminal. There are a couple of different reasons why you might want to have Pidgin beep at you through the PC speaker instead of through your normal audio output device. Both of these scenarios have been applicable to me over the years. Scenario 1 : You want computer…Read the Rest
Segmenting Drupal Users By Role in Google Analytics
We use Google Analytics and Drupal at work. We have been tracking our website usage for quite a while now, but we had no idea what percentage of our visitors were staff. We have 13 main locations, so IP filtering could’ve gotten us most of the way, but staff members do work from home and on the road quite a bit too. In the end I decided that the best route would be to use Google Analytics _setCustomVar funcitons to record the data we wanted. Staff members at work have the role “staff”, so that’s what I wanted to select…Read the Rest
ISOlator
Got a Linux CD you want another copy of, but don’t want to download it again? Got a CD that needs to be in the computer to play your game, but you don’t want to risk scratching the original? Need to make backups to protect against kids? ISOlator is for you. ISOlator takes a CD, DVD, or other mounted volume and makes an ISO out of it. The ISO can then be burned to CD, stored on your backup disk (you DO backup, right?), or put to use however you like. ISOlator uses the Unix command line program ‘dd’ to…Read the Rest
Inkscape
I just posted about 20 doodles to this blog. Doodles I’ve had for a while, but most of which I am still proud of to some extent. I’m not artistic. My wife will confirm that for you. Any semblance of art, or even the ability to recognize whatever I have drawn is 95% pure chance. When I do end up trying to doodle, I really like using Inkscape. Inkscape is a free program similar to Adobe Illustrator. It is an amazing vector graphics editor (eg. SVG files). I like working with SVG because I can tweak my drawings easily and…Read the Rest
Writing a daemon with PHP
PHP isn’t used to write daemons very often, and other languages (like Perl or C) might be more suited to your typical daemon. There are times when PHP is the right choice though, for instance if the rest of your project is a PHP website and you want to keep the same code language across the project. Everything here is available elsewhere online, but I couldn’t find a page that brought it all together neatly (fork, exec, waitpid, signal handling), so here it is. In this case, I wanted to be able to use the same DB connection file and…Read the Rest