Arrow

Posts on this site are never sponsored.

Vancouver Sun Run Past T-Shirt Designs

Why am I posting this? I was trying to find pictures of past Sun Run t-shirts and couldn’t find any. So I decided to start a post about it. That’s what I call useful crap.

I’ve run the past four Sun Runs, so here are the t-shirt designs from each run. Got pictures from previous runs? Send ‘em over!

2002 (Thanks to Thom, who also appreciates useful crap)

2002 Vancouver Sun Run t-shirt design

2003

2003 Vancouver Sun Run t-shirt design

2004

2004 Vancouver Sun Run t-shirt design

2005

2005 Vancouver Sun Run t-shirt design

2006

2006 Vancouver Sun Run t-shirt design

2007 (thanks to Kitman Luk)

2007 Vancouver Sun Run t-shirt design

2008 (thanks to Kitman Luk)

2008 Vancouver Sun Run t-shirt design

2009 (thanks to Kitman Luk)

2009 Vancouver Sun Run t-shirt design

2010 (thanks to Kitman Luk)

2010 Vancouver Sun Run t-shirt design

2011 (thanks to Kitman Luk)

2011 Vancouver Sun Run t-shirt design

2012 (thanks to Kitman Luk)

2012 Vancouver Sun Run t-shirt design

2013 (thanks to Kitman Luk)

2013 Vancouver Sun Run t-shirt design

How to e-mail yourself an automatic backup of your MySQL database table with PHP

This script will send an e-mail to you with an .sql file attached, thus enabling you to back up specific tables easily. If you have a database-driven site, your mysql info is what is most valuable to you! You could even set up an e-mail account just to receive these backups…

First of all, this script works best if you place it in a non-web accessible folder and run a daily cron job on it. Cron is a server “tool” that can run scripts regularly or at specified times (thus you don’t need to call them in your browser). I used to be scared of cron but it’s really easy. Here are two tutorials if you are interested Cron Tutorial 1Cron Tutorial 2. If you have cPanel on your server it’s even easier (see here).

The code is below, and requires the Pear Mime and Pear Mail packages. If you want to download everything at once, I have provided a zip file at the end of this post.

Known limitations of this script: if you have a big database table over 2mb, you will probably run into php timeouts and php mail attachment limits. Check this comment for information about compressing the backup file before sending or storing it.

<?php
// Create the mysql backup file
// edit this section
$dbhost = "yourhost"; // usually localhost
$dbuser = "yourusername";
$dbpass = "yourpassword";
$dbname = "yourdb";
$sendto = "Webmaster <webmaster@yourdomain.com>";
$sendfrom = "Automated Backup <backup@yourdomain.com>";
$sendsubject = "Daily Mysql Backup";
$bodyofemail = "Here is the daily backup.";
// don't need to edit below this section

$backupfile = $dbname . date("Y-m-d") . '.sql';
system("mysqldump -h $dbhost -u $dbuser -p$dbpass $dbname > $backupfile");

// Mail the file

include( 'Mail.php' );
include( 'Mail/mime.php' );

$message = new Mail_mime();
$text = "$bodyofemail";
$message->setTXTBody( $text );
$message->AddAttachment( $backupfile );
$body = $message->get();
$extraheaders = array( "From"=> $sendfrom, "Subject"=> $sendsubject );
$headers = $message->headers( $extraheaders );
$mail = Mail::factory( "mail" );
$mail->send( $sendto, $headers, $body );

// Delete the file from your server
unlink($backupfile);
?>

Download Peter’s automatic mysql backup tool (in the zip file, backup.php is the file you need to execute).

Using php to display visitor / user information such as their IP address

There are domain names dedicated to displaying simple user information, such as your IP address. Some spam ads try and freak you out by saying that sites can tell what your IP address is. So what? Whenever you visit any website, you are usually sharing (unless you’re using a proxy server) lots of information about yourself, and you don’t have much of a choice.

Up until recently, I had no idea that if you have hosting with PHP (the vast majority of hosting offers PHP) you can show some fun information to your users about themselves. Here’s some simple info displaying your IP address, browser info, and the address that referred you to the page:

————————-

Display IP address:
127.0.0.1

More detailed host address:
localhost

Display browser info:
CCBot/2.0 (https://commoncrawl.org/faq/)

Where you came from (if you clicked on a link to get here):
Page was directly requested

————————-

Here’s the code for what was just displayed above:

<?php
$ip = $_SERVER['REMOTE_ADDR'];
$hostaddress = gethostbyaddr($ip);
$browser = $_SERVER['HTTP_USER_AGENT'];
$referred = $_SERVER['HTTP_REFERER']; // a quirky spelling mistake that stuck in php

print "<strong>Display IP address:</strong><br />\n";
print "$ip<br /><br />\n";
print "<strong>More detailed host address:</strong><br />\n";
print "$hostaddress<br /><br />\n";
print "<strong>Display browser info</strong>:<br />\n";
print "$browser<br /><br />\n";
print "<strong>Where you came from (if you clicked on a link to get here</strong>:<br />\n";
if ($referred == "") {
print "Page was directly requested";
}
else {
print "$referred";
}
?>

Note: to display php code in a WordPress post, try this plugin:
WordPress PHP Exec Plugin

PayPal’s toll free telephone number

It surprises me that PayPal still isn’t advertising their toll free number, thinking that they can scare people off by only offering their local (long distance for most!) number on their contact page.

Anyway, here’s the toll free number: 1-888-221-1161.

I’ve gotta say, I’ve had some of the worst customer service experiences with PayPal. But at least if you can speak to them over the phone, you can tell them that!

Speak to a human customer service representative on the telephone at Rogers Wireless

So, it tells me to call 1-877-764-3772. I’m trying to activate my wireless cell phone account and, of course, this stupid service has a combination of touch tone and voice recognition service. So I’m saying into the phone, “Activate account”. How does it respond? “I think you’re calling about Cable TV service”. No, no I’m not. Anyway, I don’t want to tell the full story, but let’s just say it consists of me attempting to navigate the terrible menus and shouting “shut up, I hate you” (that didn’t help either, by the way).

Then, when I finally manage to speak to a CSR, they all claim ignorance and transfer me from department to department. But that’s beside the point. I managed to speak to a nice lady, who in the end, shared this semi-secret with me. Just say “agent” when confronted with those nasty menus and you’ll be transferred to a CSR. No guarantee on getting a nice CSR, though.

By the way, I tried the “agent” trick with 1-800-575-9090, but that doesn’t seem to work. It does work wonders with 1-877-764-3772. If anybody has the magic answer to the 1-800 as well, let me know.