Thursday, January 31, 2008

Comprehensive backup solution built on the DNS-323

I've previously touched on the topic of DR, how its relevant even in a home environment and how to go about it cheaply. Well, the good news is that now you can even do it easily and for FREE! Check out the open source project BackupNetClone. Good job Ben!

Wednesday, January 30, 2008

Converting a CVS repository to a SubVersion repository

Taking the opportunity of the "extreme makeover" (I am setting up a new IT infrastructure for the new house (e.g. adding NAS, print server, network media players etc) + my old PC did not survive the relocation (HDD died! Arrggg....)), I decided to finally retire my aging CVS repository and move on to SubVersion for good.

Setting up the service in my NAS (DNS-323) is easy enough (besides the small hiccup encountered), converting my 5 year old CVS repository seemed like a daunting task based on the documentation.

The tool to use is cvs2svn, which is basically a bunch of Python scripts that make use of the SVN, CVS and some UNIX utility binaries; In short, a tool developed and used on the UNIX platform primarily. Getting it to work on Windows isn't all that difficult but just alittle tedious. Here are the steps to get it working on a clean Windows XP (i.e. without any of the prerequisite already installed).
  1. Grab Python installer for Windows from here and run the exe on the PC. Once installation is complete, you should get a new folder in your start menu.
  2. Grab the Windows port of the necessary UNIX utility binaries (UnxUtils) from here and unpack the archive file into a directory of your choice. (for me, its C:\UnxUtils)
  3. Grab the cvs2svn package from here and unpack the archive file into a directory of your choice. (for me, its C:\cvs2svn)
  4. Grab the svn package from here (choose the zip file if you do not intend to run the svn server on your PC) and unpack it into a directory of your choice. (for me, its C:\svn-win32-1.4.6\)
  5. *IMPT* Set up your environment path to include the UnxUtils bin directories. (Right click on "My Computer", select "Properties", under "Advanced" tab, click on the "Environment Variables" button, in the popup dialog, scroll the listbox under "System variables" to find the "Path" variable on the left, select it and click on the "Edit" button.) Note that you will need to add both the "\bin" and "\usr\local\wbin" directories in the BEGINNING of your path. This is necessary so that the scripts will call the UNIX versions of sort.exe rather than the one included in your Windows\System32 directory. My path variable looks like this: C:\UnxUtils\bin;C:\UnxUtils\usr\local\wbin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;...
  6. Start a command prompt (Start -> All Programs -> Accessories), cd to your cvs2svn directory, and execute the python exe giving it the cvs2svn script and the necessary arguments (see the cvs2svn docs for details on the arguments). In my case, I did a full conversion with default options hence the command looks like this "c:\Python25\python cvs2svn --svnadmin=c:\svn-win32-1.4.6\bin\svnadmin.exe --svnrepo z:\SvnRepo d:\CodeRepo" Note that this creates a new svn repository at z:\SvnRepo.

The script will take awhile to run if you have a large CVS repository with alot of revisions. In my case, the conversion ended with a revision number hitting well into 4 digits.

Unlike CVS, SVN treats all folders in a repository as part of a common namespace. i.e. the revision numbers, branch and tag names will be shared across all your projects (aka subfolders). I find that rather confusing especially when the projects are entirely unrelated. Hence in my setup, I created separate SVN repository for each of my CVS project. My command then looks like this "c:\Python25\python cvs2svn --svnadmin=c:\svn-win32-1.4.6\bin\svnadmin.exe --svnrepo z:\SvnRepo\projectX d:\CodeRepo\projectX" where projectX are the names of my CVS projects.

As I kept all my SVN repositories under the \SvnRepo directory, I will only need one instance of svnserve on the server side to service all my repositories. In the svnserve.sh script (part of the fun_plug svn package), change the variable REPOSITORY to point to this root directory.

Also, you will probably want to modify the svnserve.conf file in each project repository to use the same authentication realm as well as passwd file to keep things simple. (I placed my passwd in the \SvnRepo directory)

On the client side, to access the SVN repositories, use the URL "svn://hostname/projectX/". Note that you will not be able to browse the available projects using the URL "svn://hostname/" (unlike CVS). A small price to pay in exchange for a neater setup IMHO.

Well, that's it for my encounter with cvs2svn as well as my SVN setup. Now on to figuring out the best practices on SVN usage!

Tuesday, January 29, 2008

Getting SubVersion up and running on the DNS-323

I was expecting a smooth ride in getting SubVersion up and running on my DNS-323 given that there are precompiled binaries for the box as well as a dedicated HOWTO page on the wiki. So I managed to work though all the steps (including setting up authentication) and got svnserve running in less than 30 mins. I could even browse my (empty) repository anonymously from a Windows XP machine using tortoiseSVN.

However, when I tried to do a test import, I got stuck at the authentication stage with the client returning an error message "Internet server error in authentication". Strange since I'm using the same setup as the wiki. Dug a little deeper via Google and found this.

Apparently, my box is missing the pseudo random number generator /dev/random. Still figuring out why this is so but the quick work around is to (1) roll your own using the command "mknod /dev/random c 1 8" or (2) do a symlink to /dev/urandom (which is another random number generator but a little less secure. For details, look here). I prefer (2) as we won't get into the situation of running out of entropy in our little embedded headless environment in exchange for that little bit of extra security (this is just a home NAS for goodness sake!).

To survive reset on the box, I've modified the svnserve.sh to include a check for the file and do the symlink if not found. For the benefit of others, the relevant code is as below:


svnserve_start() {
if [ -x "${BINDIR}/svnserve" ]; then
echo "Starting svnserve deamon... "
${BINDIR}/svnserve -d -r ${REPOSITORY}
if [ ! -e "/dev/random" ]; then
echo "/dev/random not found, creating symlink to /dev/urandom..."
ln -s /dev/urandom /dev/random
fi
else
echo "ERROR: svnserve not found or not executable"
fi
}

Sunday, January 20, 2008

XBMC on my Xbox finally!

Back in June last year when i was planning the IT infrastructure of the new house, I came across XBMC which is essentially a custom dashboard for the Xbox that literally turns it into a networked media player (plus you still get to play your console games!). Given that you can get a second hand Xbox for less than $200 a pop (modded ones even!), this is going to be a much cheaper alternative than buying dedicated networked media players on the market today.

So over the next few months, I shopped in ebay and Yahoo Auctions looking for a modded Xbox and finally landed one that cost $150 including two controllers and a bunch of games. Not bad indeed.

Now on to getting XBMC installed. There are a couple of ways to do it. From the hard way of compiling from source to locating a pre-compiled binary on bittorrent. As luck would have it, while lurking around the XBMC forums, I came across something known as Auto-Installer Deluxe (AID for short). This is essentially a project that packages some of the most common and useful tools and applications (such as the XBMC!) into an ISO so that you can easily get it installed on your Xbox with minimum fuss. This is a god-sent given that I'm completely new to Xbox!

Figuring out how to compile the ISO was abit of a challenge. The project is organized in such a way that it offers alot of flexibility for users to decide what gets installed on their Xbox. That means you don't simply get to download an ISO file, burn it onto a DVD and pop it into your Xbox. Nope. You have to download two separate packages (4.10 base package and the 4.13 update package as of this writing) and then build your own ISO using the supplied utilities on the PC. The manual that came along with the package was extremely helpful (Kudos to the team for supplying one) and I managed to figure my way out after awhile.

Next challenge was to find a compatible DVD media to burn. Again, thanks to the manual, I found out that I've got a Samsung DVD drive in my Xbox and its pretty picky when it comes to accepting the type of media its loaded with. I had to go out and buy a DVD-RW disc just for this as my stock of DVD media are all in the + format which the Samsung loathes.

Once I got the ISO on to the disc, the rest is easy. Simply pop the DVD into the Xbox, turn it on, wait for a few seconds and you will see the AID menu on screen. From there, select "one-click install" (there are two options here, one for those with modchip and another for those with softmod.) followed by your choice of dashboard and let it do its thing. When completed, it will ask you to reset and ta-da, XBMC running on the Xbox!

Saturday, January 19, 2008

Yakiniku part deux - down under!

Recently I was on a business trip down under and was pleasantly surprised to find a Japanese restaurant that serves authentic and excellent Yakiniku (aka Japanese BBQ or charcoal grill). I've been wanting to try wagyu beef Japanese style again after my first encounter with it late last year (and I'm in love with it ever since!).

The name of the shop is Iwa Japanese Yakiniku Dining Room and its located along Victoria Avenue about 5 mins walk from the Chatswood train station, just before Anderson Street. It has a rather indiscreet entrance and you will probably miss it if you are just strolling down the street. It must also be pretty new as I don't remember seeing it 3 years back when I was on a six-month assignment in the same neighborhood. (I practically tried every restaurant along Victoria Avenue then!)

The ambiance is cosy and chic; dim lighting, dark walnut wooden furnishing against gold colored copper exhaust tube that drops from above the tables. I do find the place alittle cram with a rather narrow passage way and little privacy between tables.

No complaints about the food though. We went in a party of three and ordered two portions of the wagyu tasting plate on the advice of the waitress. We were told a portion was good for three pax but judging by the hungry looks on our faces, she figured we could use two instead. Good call btw :)

The quality of the beef and even the accompanying vegetables were really fresh and the presentation was excellent. I was awed by just how immaculate each slice of the cucumber, eggplant and mushroom looked; something that I've only seen on menus and advertisements, but never in real life. When it was first presented on the table, I even thought that they were fakes!

The service was equally good with staff who are polite, cheerful and attentive, even when the restaurant was filling up later in the evening.

I find the pricing pretty reasonable, given the quality of the food, ambiance and service rendered. I will definitely come back again the next time I drop by Chatswood. Two thumbs up!



Iwa, Japanese Yakiniku Dining Room
380 Victoria Ave Chatswood
Tel: 9419 7009
Open 7 days 11am - 3pm & 5pm - 10pm

online reviews

Kids at Changi Terminal 3


Check out the cute little fellows in their jackets! This photo was taken in the new Changi Airport Terminal 3 when the kids came to send me off on my business trip to Sydney recently.
Apologies for the slight blur in the photo as it was taken by my PDA phone camera without flash.

Wednesday, January 16, 2008

Getting MioTV and Internet surfing to play nice

Well, I'm sick of having to manually switch the network cables between my wireless router and the MioTV set-top box to the ST536v6 ADSL modem/router each time I wanted to surf the Internet or watch MioTV respectively. (Look here for the reason why I'm in this predicament.) So I took some time out to check out my options.

The quick and easy way is to shell out for a wireless ADSL modem router like the 2Wire 2700HGV-2. This is the standard triple-play (IPTV, VoIP and Internet surfing) modem provided by SingTel when you choose the wireless modem option. Its not really that expensive given that you can easily find fairly new one on eBay for around S$100. But going with this option means that I will have to junk both my spanking new ST536v6 as well as my trusty DI-524 wifi router.

The poor man's option is to reconfigure the DI-524 as a wireless access point (as compared to its current role as a WAP cum router) and let the ST536v6 be the router instead. Although I personally will prefer to let the DI-524 be the router (it has much better security features) while the ST536v6 play the modem role only. However, getting the latter into bridged mode seems tedious and complicated so I'm giving that thought up for now.

Here are the basic steps to set up the above configuration:

  • Plug the ST536v6 into one of the LAN ports on the DI-524
  • Plug the MioTV set-top box into another LAN port on the DI-524
  • Login to the admin console of the DI-524 (i.e. http://192.168.0.1/ if you did not change its IP previously)
  • Disable DHCP
  • Change the IP to fall within the subnet of the ST536v6 (e.g. http://192.168.1.1/)
  • That's it!

So after nearly a week of cable swapping, I can finally sit back in my couch and enjoy both MioTV and Internet surfing at the same time!

Friday, January 11, 2008

bittorent on the DNS-323

Found out that the latest season of Lost (season 4) has started in the US hence decided to expedite my plans to get mldonkey up and running on the DNS-323 :)

Thanks to shadowandy and his work, getting this done was a piece of cake. Simply download one of his packages and follow the instructions on his blog.

In my case, I chose version 2.9.3 lite as I only wanted bittorrent and nothing else. I also needed to do some DIY as the package included fun_plug which I already have installed and configured to my liking. Here are the stuff I did:
  1. Unpack the archive in a temp folder.
  2. Copy the binary ./lnx_bin/mlnet to the /mnt/HD_a2/fun_plug.d/bin directory.
  3. Copy the script mlnet.sh to the /mnt/HD_a2/fun_plug.d/start directory (or use my enhanced script).
  4. Telnet into the DNS-323 as root.
  5. CD into the directory where the script lives (i.e. /mnt/HD_a2/fun_plug.d/start)
  6. Change the user and group to that of root (i.e. chown root.root mlnet.sh)
  7. Set the right permissions (i.e. chmod 770 mlnet.sh)
  8. Edit the script to reflect the appropriate paths to the mlnet runtime and log files.
  9. Run the script and after a couple of seconds you will see three new processes (run the command ps -ef grep mlnet) and a new folder (/mnt/HD_a2/mldonkey) created.
  10. Next just follow the rest of the instructions found here (under "Initial Setup").
  11. Set allowed IPs to include PCs on your local network (i.e. set allowed_ips "127.0.0.1 192.168.1.255")
  12. The web GUI for mldonkey is found on port 4080 by default.

Note that if you do the above, mldonkey will start automatically on every reboot (due to the excutable script in the fun_plug.d/start directory). To shutdown mldonkey properly, you will need to telnet in (local host at port 4000), authenticate as admin and execute the command kill.

Thursday, January 10, 2008

Singtel - not such a smooth operator afterall

I took the opportunity to re-examine my triple play needs recently due to the relocation as well as the fact that the house will be occupied most of the time from here on. Decided to go with Singtel for its cheap 1Mbps Broadband plus its flexible MioTV package (residential line is a given). Also took the opportunity to grab myself a pair of cheap homeplugs under their MioTV promotion (~$50 for a pair of Homeplug AV!). I thought I had it all planned out until the MioTV installer came today.

First bad news. The package does not come with a HDMI cable! What? You can't even throw in a cheap brandless HDMI cable that cost less than $30!? Ok, so I settled for the lesser component video and separate audio plugs (contributing to my cable mess along the way).

Second bad news. Apparently, going with the standard Ethernet modem package (since I already have a wireless router, I did not choose the more expensive wireless modem) means you cannot watch MioTV and get online at the same time! WTF?! According to the technician who did the install, its because of bandwidth issues. Yeah right. A quick search on Google shows that it is technically possible... but just a lot of tweaking and configuration to be done (i.e. setting the modem in bridge mode, configuring the PPoE settings in the wireless router, etc).

Why am I pissed? Well, because I expected to be told about such a big issue/limitation as (2) at the point when I sign up/choose the package. Not a week later when I can no longer switch packages. So now, if I want a fuss free solution, my only option is to buy an "approved" wireless modem thus rendering my 1 week old ADSL modem useless. Otherwise, I will have to waste time trying out the various "fixes" that's floating around the Internet. Sigh... what joy...