HTML Validation “Error”
Heh, my (x)html does not validate! At least, that’s what the w3c says after banning me for hitting refresh like twice in a single minute:
Service Temporarily Unavailable
The bwshare module will refuse your requests for the next 41 seconds.
You have made too many requests per second.Apache/2.2.4 (Debian) mod_bwshare/0.2.0 Server at validator.w3.org Port 80
And just minutes later, it lets me in:
Congratulations
The document located at *blah* was checked and found to be valid XHTML 1.0 Transitional. This means that the resource in question identified itself as “XHTML 1.0 Transitional” and that we successfully performed a formal validation using an SGML or XML Parser (depending on the markup language used)
This is unacceptably lame; if the WWW Consortium is so strapped for money they cannot afford a couple boxes to run their validation service on, expect the organization to completely fall apart in the near future. Thanks for the HTML, it was nice.
Easy Database Backup with Amazon S3
Taking Paul’s great article How To: Bulletproof Server Backups with Amazon S3 a step farther here’s an easy way to automate your Wordpress database backups. First, follow all the steps to get ruby and the s3sync client installed. Once that is setup, create a text file somewhere with the databases you’re interested in. I called mine s3backup-db.txt:
[root s3sync]# cat s3backup-db.txt db-one db-one-user db-one-pass db-two db-two-user db-two-pass
Then you’ll need to make a folder for your backups, which I put in /home/s3backup/. The shell script that does the backups is as follows:
#!/bin/bash
BUCKET=your-bucket-here
BACKUP=/home/s3backup/
ROOT=/root/s3sync/
NOW=$(date +%m%d%y)
if [ $(($# % 3)) -ne 0 ]
then
echo "Wrong number of arguments!!"
exit
fi
i=0
while [ $# -gt 0 ]
do
DBNAME=$1; shift
DBUSER=$1; shift
DBPWD=$1; shift
echo "Backing up MySQL db '$DBNAME' with '$DBUSER:$DBPWD'"
nice mysqldump -u $DBUSER -p$DBPWD -C -q $DBNAME | gzip -9 > $BACKUP$DBNAME.$NOW.sql.gz
cd $BACKUP
tar -r -f backup.$NOW.tar $DBNAME.$NOW.sql.gz
rm -f $DBNAME.$NOW.sql.gz
cd $ROOT
i=$(( $i + 3 ))
done
nice ruby ${ROOT}s3sync.rb -r --ssl --progress ${BACKUP} $BUCKET:
rm -f ${BACKUP}backup.$NOW.tar
This will dump a file called backup.040506.tar in the Amazon bucket you picked earlier containing the full database backups of the arguments you specified. You can run the script like this, and it will produce a little bit nicer output than Paul’s bare-bones backup:
[root s3sync]# cat s3backup-db.txt | xargs /root/s3sync/s3backup-db.sh Backing up MySQL db '*****' with '****:****' Backing up MySQL db '*****' with '****:****' Update node backup.080507.tar
The next step is just to set it up with cron to run every night at midnight:
[root s3sync]# crontab -e crontab: installing new crontab [root s3sync]# crontab -l 0 0 * * * cat /root/s3sync/s3backup-db.txt | xargs /root/s3sync/s3backup-db.sh
If you want an easier way to backup all your databases than specifying some of them, just use your MySQL administrative password and username with mysqldump’s –all-databases parameter. However, on my host there are things like Plesk databases I’m not particularily interested in backing up, so this works better for me. Just make sure you make s3backup-db.txt u=rw so that no one but root can see those passwords:
-rw------- 1 root root 148 Aug 5 13:40 s3backup-db.txt
Dreamhost Virtual Server
With Dreamhost’s announcement today that they are getting into the virtual hosting business our favorite virtualization company Media temple might start losing customers.

However, I don’t think this is going to happen. A Dreamhost private server is really just a dedicated virtual server with more fine-grained controls; it’s essentially comparable to the DV plan that Media Temple runs. If you go with MT, for $50 / mo you get:
- 256 MB RAM
- 20 Gb
- 1 TB Bandwidth
- 300 Mhz
With Dreamhost, for $39.71 a month, you will get:
- 256 MB RAM
- 1.5 TB of Bandwidth
- 146 GB of Storage
- 256 Mhz
In other words, I would say their virtual hosting solutions offer services at roughly the same price points. But the real reason why Dreamhost sucks is that you can’t scale beyond a single box. They have nothing like MT’s high-end Nitro, which offers a quad-core machine with 4 GB of RAM. They have nothing like the Grid Service which offers a burstable, affordable web compute cloud.
If you go with Dreamhost and need to upgrade expect pain; the model isn’t built for that. These days I would not consider hosting with a company that didn’t offer a grid-based solution. They’re the future of webhosting.