Suicide League 2009

Dear {INSERT NAME HERE} :-p

Late last night, I had an idea to run a Suicide football league. I’ve done these before, though I admit that this is
the first time I’m using a service and not aggregating results by hand. We’ll see how this goes.

The concept of a suicide league is painfully simple, yet the strategy can become painfully complex. In simplest form, you pick one winning team each week. You cannot pick a team that you’ve picked before (this is where strategy comes into play). If you pick a winning team, you move on to the next week. If you pick a losing team, you’re out. Simple, right?

There’s a $5 buy-in on this league which will benefit Blame Drews Cancer (http://blamedrewscancer.com) and Livestrong (http://livestrong.org). You can paypal me the money (Paypal is aaron.brazell@emmense.com). You can also send me a check if you contact me for a mailing address.

There is no immediate rush on payment so take your time, but if you leave me holding the bag, I will demand ultimate retribution from you. What this is will be decided later and unilaterally. :-)

So, get your team, send that money and tell any of your friends who want to play to send me an email
(aaron+suicide@technosailor.com). The more the merrier since you’ll all probably be dead by Week 3.

Happy picking,
Aaron

http://twitleague.football.cbssports.com/e

Our Pool password is: reds0x

BASH Script for WordPress Backups

A lot of people are worried about backing up their WordPress installs on a regular basis. I know. I get that. Here’s a script you can use if you have access to the shell. Put this sucker on cron (For many Linux distributions, you can put it in /etc/cron.daily if you have root access. Otherwise, use whatever mechanism your hosting provider offers for cronjobs/scheduled tasks.

Also note that while this script will work fine for most Linux distributions, you should know that every distribution is different and minor modifications may be necessary.

Standard Disclaimer: This script is free of charge and, thus, unsupported. Functionality is neither guaranteed nor implied. I work as a consultant and have many years making WordPress work for companies and individuals. If you want support, you have to pay but I’d be happy to work with you. Contact me for paid work only at aaron@technosailor.com.

With all that done, here’s the script. Make sure you remember to edit the appropriate variables and make it executable.
[cc lang="bash"]#!/bin/bash
#### DO NOT EDIT
DATE=`date +-%y-%m-%d–%T`

#### EDIT BELOW

# If CREATE_ZIP is 0, then a tarball will be used (default). If 1, then a zip file will be used
CREATE_ZIP=0
# Accessible/writable directory for temp storage
TMPDIR=/tmp
# Absolute path to WordPress backup storage location
WPBACKUP=/backups
# Absolute path to WordPress install.
WPDIR=/path/to/wordpress
# Enter Database connection details from your wp-config.php file
WP_DBUSER=user
WP_DBPASS=password
WP_DBHOST=localhost
WP_DBNAME=dbname

#### STOP EDITING
if [ ! -d $TMPDIR ]; then
mkdir $TMPDIR/backup
fi

if [ ! -d $WPBACKUP ]; then
mkdir $WPBACKUP
fi

# Dumps the database
mysqldump -h$WP_DBHOST -u$WP_DBUSER -p$WP_DBPASS $WP_DBNAME > $TMPDIR/backup/wordpress-db.sql

# Create Archive
if [[ CREATE_ZIP -eq 0 ]]; then
# Tarballs the Database and WP files
tar -cvf $TMPDIR/backup/backup$DATE.tar $WPDIR/.htaccess $WPDIR/wp-content $TMPDIR/backup/wordpress-db.sql 2>&1
gzip $TMPDIR/backup/backup$DATE.tar
# Move archive to backup location
mv $TMPDIR/backup/backup$DATE.tar.gz $WPBACKUP/
else
# Zips the database and WP files
zip $TMPDIR/backup/backup$DATE.zip $WPDIR/.htaccess $WPDIR/* $TMPDIR/backup/wordpress-db.sql 2>&1
# Move archive to backup location
mv $TMPDIR/backup/backup$DATE.zip $WPBACKUP/
fi[/cc]

TextMate WordPress Widget Snippet « Mark on WordPress

SIDE NOTE:

TextMate WordPress Widget Snippet « Mark on WordPress.