Setup ViewVC / Subversion with Apache Server on OpenSuse (2)

Blogs

some slick marks we like to share

Setup ViewVC / Subversion with Apache Server on OpenSuse (2)

Ok, it is not done yet. I found another problem today.
Everything worked great in my home network. But today, when I tried to check out code from outside network, I found a problem. I didn’t open port 22 for my home server. Instead, I open a non-stand port on my router and forward traffic on that port to port 22 at my home server. But when I use svn+ssh, it seems there no way to specify port number.
After some research, I found all you need to do is to change the configuration file of the subversion on your local machine (at outside network). Open file “~/.subversion/config”, then go to section “tunnel”, add following line:

ssh_home = $SVN_SSH ssh -p 12345

Port 12345 is the non-standard port opened on my router. Then on my local machine, I use this command to check out code:

svn co svn+svn_home://myhome.com/home/svn/repos/sandbox/trunk sandbox

Problem solved!

Setup ViewVC / Subversion with Apache Server on OpenSuse

Recently I tryied to setup a development server at home. It’s pretty easy to install the subversion server since there are so many great tutorials online. I don’t want to use HTTP protocol to remote access my code repository because I always like svn+ssh better. But I do want a web interface to browse my repositories and compare the difference between reversions. So ViewVC becomes my nature choice. To be more specific, I want to be able to access the source tree from my home network freely; if from outside network, I want some basic security so that my code is not share with the whole world for free.
It’s not that hard either. But I did spend some time to figure out the security stuff. After all, I am not a system engineer. Anyway, after it is done, I restarted the Apache server, and everything worked beautifully. Actually …

Setup a Unbreakable SSH Tunnel

My company doesn’t have VPN setup. To be able to work from home, usually I have to setup a reversed ssh tunnel from office to my home server (my home router forwards port 12345 to my home server port 22) by running this command from my office machine:
ssh -R 10000:localhost:22 my.homeserver.com -p 12345
In this way, when I get to home, I can connect to my office by command:
ssh -p 10000 localhost
But the ssh session sometimes got timed-out and then I couldn’t connect back. It happened several time and I eventually got annoyed. To keep my connection always alive, I created a file ~/.ssh/config:
Host *
Protocol 2
TCPKeepAlive yes
ServerAliveInterval 60
This helped a lot. But later, my company had some network issues and sometimes the network was down for hours. This broke my tunnel again. So I went even further and tried to find a solution to always keep my tunnel up — …

JVM Wrong Timezone Bug

A few weeks ago we noticed that one of our applications had wrong timestamps in the log files by late for an hour.
At first I thought the timezone setting in the OS could be wrong but our ops people confirmed it is actually correct. Then I thought the JVM settings on that server must have something wrong. But I compared the JVM directories on the problematic server to a good server, they are exactly the same. This puzzles me. Then I wrote a simple Java app to print out all system properties and found that on the “bad” server, the default timezone is “GMT-08:00″ instead of “US/Pacific”.
After searching online, it turned out this is actually a bug in Java.
In short, in some cases JVM can get a wrong timezone from the machine, even if all the settings are right. What happened is when JVM starts, it looks for a matched …

Install Skype on OpenSuse x86_64

More than a year ago, when I chose OpenSuse as my desktop OS, clearly I made a wrong decision — I mean, OpenSuse is very good, but I shouldn’t have chosen the x86_64 version. There are just too many compatibility issues.
Anyway, I don’t want to reinstally my OS yet, so I have to deal with it. Here is how I installed the 32-bit Skype on my 64bit OS:
# 1. download the static version of Linux Skype
wget http://www.skype.com/go/getskype-linux-static
# The file I got is skype_static-1.4.0.118.tar.bz2
#
# 2. untar it to my “apps” directory, where I usually keep all my customized applications
tar xjvf skype_static-1.4.0.118.tar.bz2 -C ~/apps/
#
# 3. get 32-bit libsigc-2.0.so.0
cd /tmp
wget ftp://fr.rpmfind.net/linux/fedora/extras/4/i386/libsigc++20-2.0.17-1.i386.rpm
rpm2cpio libsigc++20-2.0.17-1.i386.rpm | cpio -idv
cp /tmp/usr/lib/libsigc-2.0.so.0.0.0 ~/apps/skype_static-1.4.0.118/libsigc-2.0.so.0
#
# 4. create a script to start skype in /usr/bin
sudo vi /usr/bin/skype
#
# following is the script for /usr/bin/skype
#
#!/bin/bash
#
export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
cd ~/skype_static-1.4.0.118/ && ./skype &
#
# 5. make sure the new skype script is executalbe
sudo chmod 755 /usr/bin/skype
Now Skype can …

The Road to A Perfect HTPC (1) — The Start

Early last month, when I was wandering in a Fry’s store, I found a returned Netgear EVA8000 digital media center. I have always been looking for a good multimedia hub for my living room, but had never found a satisfying one. The feature set of EVA8000 looked pretty good to me, and I remembered some good reviews from Maximum PC, Amazon and Cnet. So I decided to give it a try.
My requirements for a media center actually are not that complex,

It must be able to play regular DVDs — how can you call it a media center if there is no DVD-playing feature!? But I want more than just simply playing DVDs. Since I still have some VCD movies, of course I expect it to play them as well.
It has to play other video formats from hard drives, such as Divx, AVI, MPEG4, QuickTime, … You …

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 …

1 ... 5 6