## Clean URLs (Permalinks) for WordPress on Lighttpd

I’ve moved my blog in the last few days to a new bigger dedicated server (as well as some other sites I own). After doing some benchmarks (I plan to post those soon) I’ve decided to switch to Lighttpd. While the exact migration notes are the topic of another post, I can say that I’m fairly satisfied with the move.

After setting up the server, I started moving the blog. Importing the files and the database was pretty straight forward. But when I thought every thing is ready and I transfered the domain to the new server I’ve found out that none of my inner pages are accessible. The reason, as it turned up pretty quickly, is that the WordPress depends on Apache’s mod_rewrite to create the clean URLs (the so called permalinks). This actually posed two problems:

1. WordPress depends on Apache’s mod_rewrite.
2. WordPress used .htaccess files for the clean URLs configuration

## WordPress Backup Script

This is a small script I’ve written to automate my server-side backups of my blogs. It creates a backup of both the database and the actual WordPress files.

#!/bin/bash

# (C) 2008 Guy Rutenberg - http://www.guyrutenberg.com
# This is a script that creates backups of blogs.

DB_NAME=
DB_USER=
DB_PASS=
DB_HOST=

#no trailing slash
BLOG_DIR=
BACKUP_DIR=

echo -n "dumping database... "
mysqldump --user=${DB_USER} --password=${DB_PASS} --host=${DB_HOST}${DB_NAME} \
| bzip2 -c > ${BACKUP_DIR}/${DB_NAME}-$(date +%Y%m%d).sql.bz2 if [ "$?" -ne "0" ]; then
echo -e "\nmysqldump failed!"
exit 1
fi
echo "done"

echo -n "Creating tarball... "
tar -cjf ${BACKUP_DIR}/${BLOG_DIR##*/}-$(date +%Y%m%d).tar.bz2${BLOG_DIR}
if [ "\$?" -ne "0" ]; then
echo -e "\ntarball creation failed!"
exit 1
fi
echo "done"


## Notes About Using amsmath split Environment In Hebrew Documents

Recently I’ve worked on a Hebrew document in LaTeX and wanted to use the split environment to typeset some multiline formula. The document which compiled just fine till that point, failed to compile with the following error:

Package amsmath Error: \begin{split} won't work here.


Sometimes svn switch fails because unversion files exist in the working copy, and the need to erase them comes up. This is also true when updating to an old revision (usually one that misses directories that exist in the head revision), doing some work (like compiling), and then trying to update back to the head revision. Subversion (SVN) will fail complaining that directories/files already exist.