2

Old Ruby Script : Rnaarerge ltreets iisnde wdors and sltil raed tehm

Posted by stuporglue on Jul 20, 2010 in Computers, Something Interesting

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

Tags:

 
1

Add an email address that forwards to a script

Posted by stuporglue on May 14, 2010 in Computers

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

Tags: , ,

 
0

Google Analytics Custom Segmentation by Role in Drupal

Posted by stuporglue on Apr 30, 2010 in Computers, Programming

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

Tags: , , , ,

 
2

Update Multiple Rows At Once With Different Values in MySQL

Posted by stuporglue on Apr 22, 2010 in Programming

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

Tags: , , , ,

 
1

Have Pidgin Beep at You Through the PC Speaker

Posted by stuporglue on Apr 14, 2010 in Computers, Something Interesting

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

Tags: ,

 
0

Segmenting Drupal Users By Role in Google Analytics

Posted by stuporglue on Mar 26, 2010 in Programming, Projects

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

Tags: , , ,

 
4

Recieve E-mail and Save Attachments with a PHP script

Posted by stuporglue on Mar 24, 2010 in Programming, Projects

Here’s something fun! If you can tell your server to send e-mail to a script, you can send e-mails to PHP. Once you are processing the e-mail with PHP you can save attachments, automatically respond to the e-mail, save it to a database, make a webpage from it…really whatever you want! Here’s a script I am currently using. My brother is on a mission for our Church, in Peru for two years and has near weekly e-mail access but can’t do much more than e-mail. He wanted a way to easily send photos to the server via e-mail; this script…Read the Rest

Tags: , , , , , ,

 
0

ISOlator

Posted by stuporglue on Mar 20, 2010 in Programming, Projects

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

Tags: ,

 
0

Inkscape

Posted by stuporglue on Mar 20, 2010 in Computers, Doodles

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

Tags: ,

 
0

Writing a daemon with PHP

Posted by stuporglue on Mar 20, 2010 in Programming, Projects

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

Tags: , , , , , , , ,

Original content on this page is under the Creative Commons Attribution-ShareAlike 3.0 License unless otherwise noted.

If you found this page particularly helpful, I'd love to hear from you. A link to this page from your blog or website would also be appreciated.

I'm the real Michael Moore