Convert MySQL Table from Latin1 to UTF8

Last week I upgraded my blog from wordpress 2.1 to 2.2. Because the new version of wordpress uses UTF8 charset, while the older version uses Latin1, all the Chinese characters turns to question marks. I use this script to fix it:
#!/bin/bash
tables=`mysql -u WORDPRESS_DATABASE_USER_NAME -pPassword WORDPRESS_DATABASE_NAME \
-e “show tables” | grep wp_`
for table in $tables;
do
echo “processing table $table …”
mysqldump -u WORDPRESS_DATABASE_USER_NAME -pPassword WORDPRESS_DATABASE_NAME –opt \
–default-character-set=latin1 –skip-set-charset $table > $table.conv.sql
sed -e ‘s/latin1/utf8/g’ -i $table.conv.sql
mysql -u WORDPRESS_DATABASE_USER_NAME -pPassword –default-character-set=utf8 \
WORDPRESS_DATABASE_NAME < $table.conv.sql
done
After running this script, make sure the wp-config.php file under the wordpress root directory has following lines:
define(‘DB_CHARSET’, ‘utf8′);
define(‘DB_COLLATE’, ”);

Setup Apache with multiple Tomcat instances in SUSE 10.1

Recently I registered two domains: my personal domain www.coffeestone.com, — mostly for my blog, wiki, and maybe other personal usage, and … www.myseconddomain.com for our community forum. I plan to use WordPress for my blog, JSPWiki for my wiki, and JForum for my second domain. JSPWiki and Jforum will be running in Tomcat, and both domains will be in the same Linux server. A router with my static IP sits between my server and Internet, which is also a firewall and forwards incoming traffic on port 80 to my Linux server. So here are my goals:

Use one Apache to serve both domains;
Run two Java applications separately, with a script that can easily shutdown / start each of them independently;
Use Apache to redirect traffic to each Tomcat instance based on the requested domain name.

My server is running on OpenSUSE 10.1, with Apache 2.2.0 and Tomcat 5.5.20.
1. Software installation
First, I have to …

Install the latest flash plugin for 64bit Firefox (Linux x64)

My system is OpenSUSE 10.1 x64 on Athlon 64 X2 3800+. Since Adobe released Flash 9 for Linux a few weeks ago, I have been trying to install the plugin for the Firefox 2.0 (64bit), but with no luck. The reason is that the plugin is 32bit, which doesn’t work well with the 64bit Firefox. After some research, today I finally get it done by using nspluginwrapper. Here is how I did it:

Download nspluginwrapper
According to the author of nspluginwrapper, “nspluginwrapper is an Open Source compatibility plugin for Netscape 4 (NPAPI) plugins. That is, it enables you to use plugins on platforms they were not built for. For example, you can use the Adobe Flash plugin on Linux/x86_64, NetBSD and FreeBSD platforms.” Currently the latest version is 0.9.91.2. You will need both the plugin and the viewer.
Install plugins
# install the viewer; You have to install …