<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kerry D. Wong &#187; Ubuntu</title>
	<atom:link href="http://www.kerrywong.com/tag/ubuntu/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kerrywong.com</link>
	<description></description>
	<lastBuildDate>Fri, 03 Sep 2010 00:51:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Apache2 Logrotate</title>
		<link>http://www.kerrywong.com/2010/08/11/apache2-logrotate/</link>
		<comments>http://www.kerrywong.com/2010/08/11/apache2-logrotate/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 00:14:04 +0000</pubDate>
		<dc:creator>kwong</dc:creator>
				<category><![CDATA[Linux/BSD]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Logrotate]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.kerrywong.com/?p=2422</guid>
		<description><![CDATA[Whenever I setup a new web server, I always like the idea of keeping the Apache logs roated on a daily basis. While the procedures for changing the log rotate frequency is pretty straight forward, I have seen a lot of people having problems with it so I decided to document it. To change the [...]]]></description>
			<content:encoded><![CDATA[<p>Whenever I setup a new web server, I always like the idea of keeping the <a href="http://www.apache.org">Apache</a> logs roated on a daily basis. While the procedures for changing the log rotate frequency is pretty straight forward, I have seen a lot of people having problems with it so I decided to document it.<span id="more-2422"></span></p>
<p>To change the Apache log rotate frequency, you would want to change the apache2 configuration file located under /etc/logrotate.d. Configurations located in this directory overrides the default settings in /etc/logrotate.conf (the configurations in /etc/logrotate.d are included in logrotate.conf)</p>
<p>Here&#8217;s what my settings look like (note that I had commented out compress option so that all the logs can be easily browsed):</p>
<blockquote><p>
/var/log/apache2/*.log {<br />
        daily<br />
        missingok<br />
        rotate 365<br />
        #compress<br />
        #delaycompress<br />
        notifempty<br />
        create 640 root adm<br />
        sharedscripts<br />
        postrotate<br />
                if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then<br />
                        /etc/init.d/apache2 reload > /dev/null<br />
                fi<br />
        endscript<br />
}
</p></blockquote>
<h3>Common problem</h3>
<p>A common problem after changing the log rotate frequency is that the Apache logs do not appear to be rotating daily even though the configuration file had been changed correctly.</p>
<p>This seems to be a known issue with logrotate. If you read the manual for logrotate you&#8217;d see the following explanation:</p>
<blockquote><p>
       -f, &#8211;force<br />
              Tells logrotate to force the rotation, even if it doesn&#8217;t  think<br />
              this  is  necessary.   Sometimes this is useful after adding new<br />
              entries to a logrotate config file, or if  old  log  files  have<br />
              been removed by hand, as the new files will be created, and<br />
              logging will continue correctly.
</p></blockquote>
<p>Since the default cron daily job does not force the log rotation, you may want to add -f parameter to /etc/cron.daily/logrotate:</p>
<blockquote><p>
#!/bin/sh</p>
<p>test -x /usr/sbin/logrotate || exit 0<br />
/usr/sbin/logrotate -f /etc/logrotate.conf
</p></blockquote>
<p>With this change, the logs will be forced to rotate daily according to the setup.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerrywong.com/2010/08/11/apache2-logrotate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weekend Ubuntu Upgrade</title>
		<link>http://www.kerrywong.com/2009/11/01/weekend-ubuntu-upgrade/</link>
		<comments>http://www.kerrywong.com/2009/11/01/weekend-ubuntu-upgrade/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 00:52:16 +0000</pubDate>
		<dc:creator>kwong</dc:creator>
				<category><![CDATA[Linux/BSD]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.kerrywong.com/?p=1504</guid>
		<description><![CDATA[Karmic Koala was released into the wild last Thursday, so naturally I was going to upgrade my desktop installations at home. In this past I had been doing fresh installs whenever there was a new release, since there might be some issues with the new Ext4 file system, I decided to upgrade my current 9.04 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://releases.ubuntu.com/karmic/">Karmic Koala</a> was released into the wild last Thursday, so naturally I was going to upgrade my desktop installations at home. In this past I had been doing fresh installs whenever there was a new release, since there might be <a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/453579">some issues</a> with the new Ext4 file system, I decided to upgrade my current 9.04 installation in place and perform a fresh installation when the Ext4 file system stabilizes.<span id="more-1504"></span></p>
<p>Since I had quite a few unofficial packages installed on my primary PC, I was not quite sure how the upgrade would turn out and I was prepared to see a few gotchas at some point. But the upgrade process was surprisingly smooth (albeit slow since all new versions of the installed packages had to be fetched first), and when the upgrade process is done I was able to boot into the new desktop. The only thing I needed to do was to re-install the <a href="http://www.nvidia.com/object/cuda_get.html">CUDA driver</a> (190.18), but this was to be expected since every major kernel updates would require the CUDA driver to be re-installed. I certainly hope that NVidia would make their proprietary binary drivers  more robust by detecting kernel changes and reinstall automatically if necessary as opposed to require the end user&#8217;s manual intervention. </p>
<p>For my other machine running Ubuntu 9.04, the upgrade was equally smooth. One of the problems I ran into there was due to my VMWare Server installation. As it turned out, there are <a href="http://www.uluga.ubuntuforums.org/showthread.php?t=1305254">some issues</a> with the default installation package that came with VMWare Server 2. The problem however can be resolved with <a href="http://radu.cotescu.com/2009/10/30/how-to-install-vmware-server-2-0-x-on-ubuntu-9-10-karmic-koala/">Radu&#8217;s installation script</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerrywong.com/2009/11/01/weekend-ubuntu-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monodevelop on Ubuntu 9.04</title>
		<link>http://www.kerrywong.com/2009/07/22/monodevelop-on-ubuntu-9-04/</link>
		<comments>http://www.kerrywong.com/2009/07/22/monodevelop-on-ubuntu-9-04/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 04:00:04 +0000</pubDate>
		<dc:creator>kwong</dc:creator>
				<category><![CDATA[Linux/BSD]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[C Sharp (C#)]]></category>
		<category><![CDATA[Mono]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.kerrywong.com/?p=1408</guid>
		<description><![CDATA[I am running Ubuntu 9.04 64bit. One thing I noticed is that the integrated debugger is behaving quite flaky for the included Monodevelop 2.0 package. After some research, it turned out that a lot of people are having similar issues. So I followed the instructions given in these two blogs: Install Mono 2.4 on Ubuntu, [...]]]></description>
			<content:encoded><![CDATA[<p>I am running Ubuntu 9.04 64bit. One thing I noticed is that the integrated debugger is behaving quite flaky for the included <a href="http://monodevelop.com/">Monodevelop 2.0</a> package. After some research, it turned out that a lot of people are having similar issues.<span id="more-1408"></span></p>
<p>So I followed the instructions given in these two blogs: <a href="http://blog.ruski.co.za/page/Install-Mono-on-Ubuntu.aspx">Install Mono 2.4 on Ubuntu</a>,<br />
<a href="http://synpl.blogspot.com/2009/07/building-mono-and-monodevelop-from.html">Building Mono and MonoDevelop from source on Ubuntu 9.04 64bit</a> to re-install Monodevelop 2.0 and its dependencies from the source. </p>
<p>One thing you will need to pay special attention to is that for the monodevelop-debugger-mdb-2.0 to compile successfully, you will need mono-debugger version 2.4, instead of the latest version 2.4.1. Otherwise you will receive an error on <em>Thread.AbortInvocation</em> as there is a breaking change in mono-debugger 2.4.1 which added a parameter to the method (see <a href="http://lists.ximian.com/pipermail/mono-patches/2009-May/149225.html">mono debugger 2.4.1 change log</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerrywong.com/2009/07/22/monodevelop-on-ubuntu-9-04/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 9.04 on My Main PC</title>
		<link>http://www.kerrywong.com/2009/05/13/ubuntu-904-on-my-main-pc/</link>
		<comments>http://www.kerrywong.com/2009/05/13/ubuntu-904-on-my-main-pc/#comments</comments>
		<pubDate>Wed, 13 May 2009 22:35:07 +0000</pubDate>
		<dc:creator>kwong</dc:creator>
				<category><![CDATA[Linux/BSD]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Dual Sound Card]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[WD1001FALS]]></category>
		<category><![CDATA[WD6400AAKS]]></category>

		<guid isPermaLink="false">http://www.kerrywong.com/?p=1068</guid>
		<description><![CDATA[Last month,I upgraded one of my PCs from Ubuntu 8.10 to Ubuntu 9.04 and everything went rather smoothly. Since my main PC is running Ubuntu 8.04 (LTS) and there is no option to upgrade to 9.04 directly without going through 8.10, so I decided to try a fresh installation. I have a lot of important [...]]]></description>
			<content:encoded><![CDATA[<p>Last month,I <a href="/2009/04/23/the-jaunty-jackalope/">upgraded one of my PCs</a> from Ubuntu 8.10 to Ubuntu 9.04 and everything went rather smoothly. Since my main PC is running Ubuntu 8.04 (LTS) and there is no option to upgrade to 9.04 directly without going through 8.10, so I decided to try a fresh installation.<span id="more-1068"></span></p>
<p>I have a lot of important programs on my main PC and I wanted to be extra cautious, so instead of backing up the working harddrive and install Ubuntu 9.04 on top of it, I decided to install it on a new harddrive. This way, I could always fall back to my currently working Ubuntu 8.04 installation should something not working out the way I wanted.</p>
<p>The drive I chose to install Ubuntu 9.04 on was a <a href="http://www.wdc.com/en/products/products.asp?driveid=488">Western Digital Caviar Black WD1001FALS (1TB)</a>.  The installation went smoothly and ten minutes later I was able to use the brand new Ubuntu 9.04 desktop.</p>
<p>It took me a while to customize the desktop, install the applications I needed and migrate the data over. But everything pretty much worked out-of-box. And it certainly feels a lot faster than Ubuntu 8.04.</p>
<p>The only minor &#8220;glitch&#8221; I ran into was my dual sound card setup. As I <a href="/2008/12/09/a-dual-sound-card-setup/">mentioned in an earlier post</a>, I needed to use a second sound card because my on board Intel sound board does not have a MIDI/Game port. I needed that port to hook up my old MIDI keyboard. After the installation though, the sound playback would only go through the Sound Blaster sound card, not the on board Intel HDA sound card. There are various posts (<a href="http://ubuntuforums.org/showthread.php?t=205449">1</a>,<a href="https://help.ubuntu.com/community/SoundTroubleshooting">2</a>,<a href="http://ubuntuforums.org/showthread.php?t=331072">3</a>,<a href="https://answers.launchpad.net/ubuntu/+question/13897">4</a>,<a href="http://www.linuxquestions.org/questions/ubuntu-63/how-do-you-change-the-default-sound-card-in-kubuntu-499520/">5</a>) suggesting how to fix this issue but unfortunately none of them worked in my case. No matter which sound card I initialized first, I always ended up with the Sound Blaster Live card working but not the on-board Intel sound card. Here is how I fixed it: I removed the Sound Blaster Live card first and booted up with just the on board sound. After making sure that the on board sound worked properly, I plugged in the Sound Blaster PCI card and then everything worked as desired (the sound now comes from the on-board Intel HDA instead of the Sound Blaster card).</p>
<p>As a side note, it seems that WD1001FALS does have some performance advantage over WD6400AAKS (which is the harddrive I run Ubuntu 8.04 on) even though their platter densities are quite comparable (333MB/platter versus 320MB/platter). </p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerrywong.com/2009/05/13/ubuntu-904-on-my-main-pc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Jaunty Jackalope</title>
		<link>http://www.kerrywong.com/2009/04/23/the-jaunty-jackalope/</link>
		<comments>http://www.kerrywong.com/2009/04/23/the-jaunty-jackalope/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 15:14:48 +0000</pubDate>
		<dc:creator>kwong</dc:creator>
				<category><![CDATA[Linux/BSD]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.kerrywong.com/?p=975</guid>
		<description><![CDATA[Without much fanfare, Ubuntu 9.04 (Jaunty Jackalope) was released into the wild earlier today. But Ubuntu followers are wasting no time, overloading many of the official downloading sites. This kind of enthusiasm is certainly encouraging as Linux matures. And certainly, this kind of enthusiasm is much needed for the open source community in general. Whether [...]]]></description>
			<content:encoded><![CDATA[<p>Without much fanfare, <a href="http://www.ubuntu.com/">Ubuntu 9.04 (Jaunty Jackalope)</a> was released into the wild earlier today. But Ubuntu followers are wasting no time, overloading many of the official downloading sites. <span id="more-975"></span></p>
<p>This kind of enthusiasm is certainly encouraging as Linux matures. And certainly, this kind of enthusiasm is much needed for the open source community in general. Whether it is proprietary software or free software, the community acceptance is definitely key to the success of its future. </p>
<p>I have three systems running on Ubuntu at home right now. My WordPress server is running Ubuntu 8.04 server (32 bit). One of my working machine is running Ubuntu 8.04 64 bit and the other is running Ubuntu 8.10. For my server, I will stick to the 8.04 as it is an LTS release. But I am thinking of installing the latest Ubuntu desktops onto my workstations in the next couple of weeks&#8230;</p>
<p><strong>Update 1 8:00 PM</strong><br />
I have just installed Ubuntu 9.04 using the ISO image I downloaded earlier onto a VM. The installation was made even easier (the time zone is now selected by default). The default installation took just about five minutes. The boot time is also very impressive. It took just about 20 seconds before showing the login screen, which is a big improvement over my 8.04 installation.</p>
<p><strong>Update 2 9:00 PM</strong><br />
Even though a fresh installation might be ideal, I decided to run the update on my Ubuntu 8.10 machine anyway. This is mainly because it was used as a file and VM server and I had done very little customizations on it besides that. So I think the chances of getting a successful upgrade is pretty high. The distribution upgrade is pretty slow though, and it is downloading at about 30k/s right now&#8230;<br />
<div id="attachment_985" class="wp-caption aligncenter" style="width: 391px"><a href="http://www.kerrywong.com/blog/wp-content/uploads/2009/04/ubuntu904upgrade.jpg"><img src="http://www.kerrywong.com/blog/wp-content/uploads/2009/04/ubuntu904upgrade.jpg" alt="Upgrading from Ubuntu 8.10 to 9.04" title="Upgrading from Ubuntu 8.10 to 9.04" width="381" height="318" class="size-full wp-image-985" /></a><p class="wp-caption-text">Upgrading from Ubuntu 8.10 to 9.04</p></div></p>
<p><strong>Update 3 4/24/2009 7:00 AM</strong><br />
The 8.10 to 9.04 upgrade went surprisingly well. The only problem I had has nothing to do with Ubuntu. </p>
<p>Since the machine I was doing the update on is a file and VMs server, I did not bother attach display or keyboard to it. So when I was doing the update yesterday used an SSH connection and forgot that the updates would need to shutdown SSH and other services in order to install the newer version of the daemons. Anyway, half way through the upgrade, the connection to my server was lost. At first I thought that I could just attach a monitor and keyboard to my server and continue the whole upgrade process. Of course it wouldn&#8217;t work since the upgrade process was tied to that particular terminal. </p>
<p>So I had to reboot the machine. For whatever reason, maybe because the machine was only half upgraded, the normal boot does not work and I could not log in via the graphical login screen. I restarted in &#8220;safe&#8221; mode dropping into a root shell and did a </p>
<blockquote><p>
sudo dpkg &#8211;configure -a
</p></blockquote>
<p>And the upgrade process picked up from where it was left at before. This is truly impressive! After the upgrade process finished, I rebooted into the new 9.04 installation:</p>
<blockquote><p>
sudo lsb_release -a</p>
<p>Distributor ID:	Ubuntu<br />
Description:	Ubuntu 9.04<br />
Release:	9.04<br />
Codename:	jaunty
</p></blockquote>
<p>The only thing that did not work after the upgrade was the VMWare Server (which is totally expected as it needs to link to the correct version of libraries). But after a simple re-config, the VMWare Server came back into life.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerrywong.com/2009/04/23/the-jaunty-jackalope/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Revert to a Specific SVN Version of Code::Blocks</title>
		<link>http://www.kerrywong.com/2009/04/15/how-to-revert-to-a-specific-svn-version-of-codeblocks/</link>
		<comments>http://www.kerrywong.com/2009/04/15/how-to-revert-to-a-specific-svn-version-of-codeblocks/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 23:52:45 +0000</pubDate>
		<dc:creator>kwong</dc:creator>
				<category><![CDATA[Linux/BSD]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Code::Blocks]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.kerrywong.com/?p=960</guid>
		<description><![CDATA[I had set up my apt-get source to use latest SVN build of Code::Blocks. Everything has been running pretty smoothly until a couple of days ago when Code::Blocks was updated to SVN 5534. It seemed that for whatever reason, this particular build is extremely unstable on my Ubuntu 8.04 box and it would refuse to [...]]]></description>
			<content:encoded><![CDATA[<p>I had set up my apt-get source to use latest SVN build of Code::Blocks. Everything has been running pretty smoothly until a couple of days ago when Code::Blocks was updated to SVN 5534.<span id="more-960"></span> It seemed that for whatever reason, this particular build is extremely unstable on my Ubuntu 8.04 box and it would refuse to open any projects created prior to SVN 5534.</p>
<p>So naturally, I wanted to revert back to my previous working version (SVN 5489). There are some <a href="http://lgp203.free.fr/spip/spip.php?article1">instructions on lgp203.free.fr</a> that in theory should work to install any revisions of Code::Blocks from SVN. But the script provided there did not work for me as it was complaining about not able to find certain packages. So I decided to do it manually, and here are the steps I took to get SVN 5489 installed.</p>
<p>First, you will need to remove the installed version of Code::Blocks.</p>
<blockquote><p>sudo apt-get remove codeblocks<br />
sudo apt-get remove codeblocks-common</p></blockquote>
<p>Then you will need to install the Debian packages one by one from lgp203.free.fr. using </p>
<blockquote><p>wget http://lgp203.free.fr/pool/codeblocks/wxsmith-headers_8.02svn5489_all.deb<br />
wget http://lgp203.free.fr/pool/codeblocks/libwxsmithlib0_8.02svn5489_amd64.deb<br />
wget http://lgp203.free.fr/pool/codeblocks/codeblocks-headers_8.02svn5489_all.deb<br />
wget http://lgp203.free.fr/pool/codeblocks/libcodeblocks0_8.02svn5489_amd64.deb<br />
wget http://lgp203.free.fr/pool/codeblocks/codeblocks_8.02svn5489_amd64.deb<br />
wget http://lgp203.free.fr/pool/codeblocks/codeblocks-common_8.02svn5489_all.deb<br />
wget http://lgp203.free.fr/pool/codeblocks/codeblocks-contrib_8.02svn5489_amd64.deb<br />
wget http://lgp203.free.fr/pool/codeblocks/codeblocks-contrib-common_8.02svn5489_all.deb</p></blockquote>
<blockquote><p>sudo dpkg -i wxsmith-headers_8.02svn5489_all.deb<br />
sudo dpkg -i libwxsmithlib0_8.02svn5489_amd64.deb<br />
sudo dpkg -i codeblocks-headers_8.02svn5489_all.deb<br />
sudo dpkg -i libcodeblocks0_8.02svn5489_amd64.deb<br />
sudo dpkg -i codeblocks_8.02svn5489_amd64.deb<br />
sudo dpkg -i codeblocks-common_8.02svn5489_all.deb<br />
sudo dpkg -i codeblocks-contrib_8.02svn5489_amd64.deb<br />
sudo dpkg -i codeblocks-contrib-common_8.02svn5489_all.deb
</p></blockquote>
<p>You can find a full list of all the available Code::Blocks&#8217; SVN versions <a href="http://lgp203.free.fr/ubuntu/dists/">here</a>. Now, I am running version 5489 and everything is working again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerrywong.com/2009/04/15/how-to-revert-to-a-specific-svn-version-of-codeblocks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MIDI Setup with OSS and ALSA</title>
		<link>http://www.kerrywong.com/2008/12/14/midi-setup-with-oss-and-alsa/</link>
		<comments>http://www.kerrywong.com/2008/12/14/midi-setup-with-oss-and-alsa/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 01:11:45 +0000</pubDate>
		<dc:creator>kwong</dc:creator>
				<category><![CDATA[Linux/BSD]]></category>
		<category><![CDATA[ALSA]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MIDI]]></category>
		<category><![CDATA[OSS]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.kerrywong.com/?p=455</guid>
		<description><![CDATA[Setting up the hardware environment to support MIDI devices is relatively easy. in fact, most newer MIDI devices do not rely on the old sound card game port and adding a MIDI device is just like adding an external hard drive. The reason I had to resort to a dual sound card setup is because [...]]]></description>
			<content:encoded><![CDATA[<p>Setting up the hardware environment to support MIDI devices is relatively easy. in fact, most newer MIDI devices do not rely on the old sound card game port and adding a MIDI device is just like adding an external hard drive. The reason I had to resort to a <a href="/2008/12/09/a-dual-sound-card-setup/">dual sound card setup</a> is because my MIDI keyboard (MK-4903) is more than ten years old and it only has a game port interface.<span id="more-455"></span>As I mentioned earlier, the resources I could find on the Internet on Linux MIDI device support are few and far between. A couple of good ones I found are this one (<a href="http://www.linux-magazine.com/issues/2008/88/making_music">Making Music</a>) on <a href="http://www.linux-magazine.com">Linux Magazine</a> and this one (<a href="http://www.lesbell.com.au/Home.nsf/b8ec57204f60dfcb4a2568c60014ed0f/c4b39482154feb03ca256f8100150ad9?OpenDocument">Getting Started with MIDI on Linux</a>). Here I will show how to configure under Ubuntu 8.04.</p>
<p>Since my MIDI keyboard uses the game port interface on my Sound Blaster Live! sound card, there is no need to load any firmware. After the sound card is recognized by the system, you will find a<strong><em> /dev/midi </em></strong>device (for some reason, my midi device would change between <strong>/dev/midi </strong>and<strong> /dev/midi1</strong> once a while, but this only happens when I access the midi device using <em><strong>jack</strong></em>). Without any additional software, you should be able to do a<strong><em> cat /dev/midi</em></strong> and see some &quot;random&quot; characters printed on the console whenever you press a key on the MIDI keyboard. Even without touching the MIDI keyboard, you should still see characters get printed in the console at a rate of 3 to 5 characters per second. Alternatively, you could use <em><strong>amidi &#8211;dump</strong></em> and when a key is pressed some hex values should be displayed.</p>
<p>After confirmed that the MIDI device is working properly, we can move on to setting up the software environment. Most of the aforementioned articles are concentrated on connecting to MIDI devices using <a href="http://en.wikipedia.org/wiki/Advanced_Linux_Sound_Architecture">ALSA</a>. What I have found out though is that using <a href="http://en.wikipedia.org/wiki/Open_Sound_System">OSS</a> is much easier.</p>
<p>Various sources have suggested that connecting MIDI devices using ALSA have very low-latency (e.g. the time between when a key is pressed and the note is played) and thus is the preferred method. But for modern computers, this kind of latencies have rarely been a problem. There might be some difference in terms of latency between using ALSA and using OSS but they are not observable in my case.</p>
<p>To use OSS, all you need to do is to choose the correct option in <em><strong>qsynth</strong></em>:</p>
<p align="center"><img src="/blog/wp-content/uploads/2008/12/qsynth_setting1.png" alt="qsynth setting 1" /></p>
<p align="center"><em><strong>qsynth</strong></em> settings 1</p>
<p align="center"><img src="http://www.kerrywong.com/blog/wp-content/uploads/2008/12/qsynth_setting2.png" alt="qsynth settings 2" /></p>
<p align="center"><em><strong>qsynth</strong></em> settings 2</p>
<p align="left">If you have multiple sound cards configured like in my case, you can select from which sound card you want the sound to be outputted (e.g. <strong>/dev/audio</strong> or<strong> /dev/audio1</strong> etc.). The sound does not have to be produced on the same card where the MIDI device is connected. In fact, using a single sound card as the output device might be the most attractive solution since otherwise you will need to have one pair of speakers connects to each of the soundcard output. In my case, the Sound Blaster Live! card is only used for it&#8217;s game port to connect with my MIDI keyboard.</p>
<p align="left">After you have successfully restarted <em><strong>qsynth</strong></em>, you should be able to hear sound when you press on the MIDI keyboard and you should see the indicator on <em><strong>qsynth</strong></em> flashing, indicating that MIDI signal was received.</p>
<p align="center"><img src="/blog/wp-content/uploads/2008/12/qsynth.png" alt="" /></p>
<p align="center"><em><strong>qsynth</strong></em></p>
<p>If you see activities from qsynth but there is no sound coming out then chances are that you have chosen the wrong sound card as the output device. Note that you will have to first load a Sound Font into <em><strong>qsynth</strong></em>, otherwise you will not hear any sound either. A few popular Sound Fonts can be downloaded from <a href="http://www.personalcopy.com/linuxfiles.htm">here</a>.</p>
<p>MIDI Setup with ALSA requires a bit more work. First you need to start the jack daemon (<em><strong>jack -d alsa</strong></em>), or you could use the GUI Jack Control. Then you can start <strong>rosegarden</strong>. If you have timidity installed you you should be able to use timidity&#8217;s port (usually 128:0) as midi device port. If you are not sure, you could use <em><strong>pmidi -l</strong></em> to find out (this shows what my configuration looks like):</p>
<p>&nbsp;Port&nbsp;&nbsp;&nbsp;&nbsp; Client name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Port name<br />
&nbsp;14:0&nbsp;&nbsp;&nbsp;&nbsp; Midi Through&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Midi Through Port-0<br />
&nbsp;20:0&nbsp;&nbsp;&nbsp;&nbsp; SBLive! Value [CT4780]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EMU10K1 MPU-401 (UART)<br />
<strong style="background-color: rgb(255, 255, 0);">&nbsp;21:0&nbsp;&nbsp;&nbsp;&nbsp; Emu10k1 WaveTable&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Emu10k1 Port 0</strong><br />
&nbsp;21:1&nbsp;&nbsp;&nbsp;&nbsp; Emu10k1 WaveTable&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Emu10k1 Port 1<br />
&nbsp;21:2&nbsp;&nbsp;&nbsp;&nbsp; Emu10k1 WaveTable&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Emu10k1 Port 2<br />
&nbsp;21:3&nbsp;&nbsp;&nbsp;&nbsp; Emu10k1 WaveTable&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Emu10k1 Port 3<br />
<strong style="background-color: rgb(255, 255, 0);">128:0&nbsp;&nbsp;&nbsp;&nbsp; TiMidity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TiMidity port 0</strong><br />
128:1&nbsp;&nbsp;&nbsp;&nbsp; TiMidity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TiMidity port 1<br />
128:2&nbsp;&nbsp;&nbsp;&nbsp; TiMidity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TiMidity port 2<br />
128:3&nbsp;&nbsp;&nbsp;&nbsp; TiMidity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TiMidity port 3</p>
<p>You can use either the Emu10k1 ports (21:x) or TiMidity ports (128:x) as output.</p>
<p>Since Sound Blaster Live! utlizates hardware based SoundFont, you must load appropriate SoundFont onto the board before you can hear any playback. Due to the on-board memory limitations, not all SoundFonts can be loaded onto Sound Blaster Live! <a href="http://alsa.opensrc.org/8MBGMSFX.SF2">Here is an 8MB version of the Creative Sound Font</a> that you can use with Sound Blaster Live!. To load the sound font use the following command:</p>
<p><em><strong>sfxload 8MBGMSFX.SF2</strong></em> (assuming that the Sound Font is located in the current directory)</p>
<p>For more detailed MIDI setup using ALSA you can refer to the two articles I mentioned. What I have found is that the MIDI environment using jack is not always stable. For instance, I could instantiate the ALSA sound driver using jackd but not directly with jack GUI. And once a while jack would lock up. Another problem is that the MIDI device name seemed to change back and forth between <em><strong>/dev/midi</strong></em> and<em><strong> /dev/midi1 </strong></em>whenever I was using jack. This might be because the fact that I am using two sound cards though. Anyway, since the performance of using OSS turned out to be quite good I did not investigate the ALSA issue much further&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerrywong.com/2008/12/14/midi-setup-with-oss-and-alsa/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A Dual Sound Card Setup</title>
		<link>http://www.kerrywong.com/2008/12/09/a-dual-sound-card-setup/</link>
		<comments>http://www.kerrywong.com/2008/12/09/a-dual-sound-card-setup/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 02:15:07 +0000</pubDate>
		<dc:creator>kwong</dc:creator>
				<category><![CDATA[Linux/BSD]]></category>
		<category><![CDATA[ASUS P5QL Pro]]></category>
		<category><![CDATA[Dual]]></category>
		<category><![CDATA[MIDI keyboard]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[Sound Card]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.kerrywong.com/?p=442</guid>
		<description><![CDATA[Newer sound card usually does not&#160; come with a game port since most of the peripherals nowadays come almost exclusively with USB connections.Since I have an old MIDI keyboard (MK-4903) and the only way it can connect to a computer is via the game port, I could not use it on my either of my [...]]]></description>
			<content:encoded><![CDATA[<p>Newer sound card usually does not&nbsp; come with a <a href="http://en.wikipedia.org/wiki/Game_port">game port</a> since most of the peripherals nowadays come almost exclusively with USB connections.<span id="more-442"></span>Since I have an old MIDI keyboard (MK-4903) and the only way it can connect to a computer is via the game port, I could not use it on my either of my Linux workstations (<a href="/2008/04/12/some-pictures-of-my-new-rig/">1</a>, <a href="/2008/10/29/another-quad-core-build/">2</a>) at home. My main working station uses an ASUS P5E motherboard, which uses an add-on PCI Express sound card and the other Linux box uses an ASUS P5QL Pro motherboard with integrated sound. In theory, I could just disable the default sound on either of the machines and use a game port equipped sound card instead. But the only spare sound card I have is a SoundBlaster Live value card which does not offer much beyond the basics, so I decided to try adding it as a second sound card to my <a href="/2008/04/12/some-pictures-of-my-new-rig/">main computer</a>.</p>
<p>Ubuntu 8.04 recognized the second sound card with no problem. A <em>cat /dev/sndstat </em>confirmed that both sound cards are indeed installed:</p>
<blockquote><p>Card config: <br />
HDA Intel at 0xf9ff8000 irq 22<br />
SBLive! Value [CT4780] (rev.7, serial:0&#215;80221102) at 0xe880, irq 18
</p></blockquote>
<p>And <em>lsmod | grep snd</em> showed that midi modules were successfully loaded:</p>
<blockquote>
<p>snd_rtctimer, snd_emux_synth, snd_seq_virmidi, snd_emu10k1, snd_ac97_codec, snd_seq_dummy, snd_seq_oss, snd_hda_intel, snd_pcm_oss, snd_mixer_oss, snd_pcm, snd_rawmidi, snd_hwdep, snd_seq, snd_timer, snd_seq_device</p>
</blockquote>
<p>So the dual sound card setup is pretty effortless. Getting the MIDI keyboard setup correctly though turned out to be quite tricky and I will share my experience in a later post.</p>
<blockquote></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.kerrywong.com/2008/12/09/a-dual-sound-card-setup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Simple Beowulf Cluster</title>
		<link>http://www.kerrywong.com/2008/11/04/a-simple-beowulf-cluster/</link>
		<comments>http://www.kerrywong.com/2008/11/04/a-simple-beowulf-cluster/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 02:45:39 +0000</pubDate>
		<dc:creator>kwong</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Beowulf]]></category>
		<category><![CDATA[Cluster]]></category>
		<category><![CDATA[headless]]></category>
		<category><![CDATA[MPI]]></category>
		<category><![CDATA[Q9450]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.kerrywong.com/?p=404</guid>
		<description><![CDATA[As I mentioned previously, one of the reasons I built another quad-core PC was that I wanted to do some experiments with high performance computing. Even though the idea of a two-node mini cluster does not sound like much, the principle behind it is pretty similar to much larger and more powerful clusters. Typically a [...]]]></description>
			<content:encoded><![CDATA[<p>As I mentioned <a href="/2008/10/29/another-quad-core-build/">previously</a>, one of the reasons I built another quad-core PC was that I wanted to do some experiments with <a href="http://en.wikipedia.org/wiki/High-performance_computing">high performance computing</a>. Even though the idea of a two-node mini cluster does not sound like much, the principle behind it is pretty similar to much larger and more powerful <a href="http://en.wikipedia.org/wiki/Computer_clusters">clusters</a>.<span id="more-404"></span></p>
<p>Typically a large computer cluster has a single head node and many compute nodes. These nodes are interconnected via a fast dedicated network (e.g. Gigabit Ethernet or Infiniband). The head node typically has two network adapters which bridges the WAN (or Internet) and the cluster.</p>
<p>For a two-node <a href="http://en.wikipedia.org/wiki/Beowulf_(computing)">Beowulf</a> cluster setup however, the above requirements (e.g. one head node and many compute nodes) can be greatly relaxed. Particularly in a two node environment, we do not have the luxury of having a dedicated head node and we have to use both nodes as compute nodes in the cluster. As a result, one of the two nodes will be both the head node and the compute node. As you will see later, the difference between the head node and the compute node in a two node cluster is not all that significant. Furthermore, since the cluster sits behind a firewall, there is no need to bridge the head node from the outside world via a second network adapter. The DSL router is sufficient to isolate the LAN from the Internet. This drops the two NIC requirements.</p>
<p><span class="Title">1. Choosing an MPI (Message Passing Interface) package</span><br />
There are primarily two popular MPI implementations: <a href="http://www.mcs.anl.gov/research/projects/mpich2/">MPICH</a> and <a href="http://www.lam-mpi.org/">LAM/MPI</a>. Some technical and performance differences exist between these two implementations (you can find more information in this <a href="http://www.jyi.org/research/re.php?id=752">research paper</a>. <a href="http://debianclusters.cs.uni.edu/index.php/MPICH:_Parallel_Programming">This link</a> has some high level information). Since MPICH2 implementation relies solely on SSH and does not require a daemon running on each machine in the cluster, it is presumably easier to setup in an environment that involves a large number of nodes. But for my particular setup, either implementation should serve the purpose. I chose to use MPICH2.</p>
<p><span class="Title">2. Setting up the MPI Environment</span><br />
The two PCs (<strong>zeta</strong>, <strong>sigma</strong>) I use for the cluster both have a quad core processor (Q9450) and 8GB of RAM. The hardware configurations are slightly different (one Motherboard is based on Intel X38 chipset and the other one is based on P43) and the OSes are slightly different as well (one is running 64bit Ubuntu 8.04 and the other is running 64bit Ubuntu 8.10). None of these differences are material though.</p>
<p>In my setup, I used <strong>zeta</strong> (Ubuntu 8.04) as the head node since that is where my primary desktop is on. My new built (<strong>sigma</strong>, Ubuntu 8.10) runs in headless mode and serves as a compute node.</p>
<p>There is a lot of information on the Internet on how to setup an MPI environment. But most articles are rather dated. For Ubuntu cluster setup, <a href="https://help.ubuntu.com/community/MpichCluster">this article</a> is pretty much up-to-date (the article mainly targets Ubuntu 7.04 and there are some places that need to be updated and I will point those out as we move along). Some of the best references on MPI environment setup come from the <a href="http://www.mcs.anl.gov/research/projects/mpich2/">MPICH2</a> distribution tar ball:</p>
<blockquote>
<div>mpich2-1.0.8/doc/installguide/install.pdf</div>
<div>mpich2-1.0.8/doc/userguide/user.pdf</div>
</blockquote>
<p>
It definitely pays to read them through prior to setting up the environment. There are many useful trouble shooting tips in the installation guide as well, and they will come in handy should you run into any setup issues.</p>
<p><span class="Title">3. Setting up NFS on the Head Node</span><br />
The installation guide that came with the MPICH2 distribution points out that NFS is not necessarily required for MPICH2 to function, but it would be necessary to duplicate the MPICH2 installation and all the MPI applications in the same directory structure on each node. Things become so much easier if all the nodes can use the same NFS directory where MPICH2 installation and MPI applications are. See Step 2 in the <a href="http://help.ubuntu.com/community/MpichCluster">MPICH Cluster articl</a>e.</p>
<p><span class="Title">4. /etc/hosts, mpd.hosts and SSH Setup</span><br />
As indicated in the <a href="https://help.ubuntu.com/community/MpichCluster">article</a> I mentioned earlier, we need to change /etc/hosts on both nodes to contain the IP addresses of each server.</p>
<p>Pay special attention to the 127.0.1.1 address that points to the server name. For MPICH2 to work properly, this IP address must be changed to the real IP address of that server. For instance, here is the /etc/hosts on <strong>zeta</strong>:</p>
<blockquote>
<div>127.0.0.1&nbsp;&nbsp; &nbsp;localhost</div>
<div>#127.0.1.1&nbsp;&nbsp; &nbsp;zeta</div>
<div>192.168.1.67&nbsp;&nbsp; &nbsp;zeta</div>
<div>192.168.1.68&nbsp;&nbsp; &nbsp;sigma</div>
</blockquote>
<p>
And similarly here is the /etc/hosts file on <strong>sigma</strong>:</p>
<blockquote>
<div>127.0.0.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; localhost</div>
<div>#127.0.1.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sigma</div>
<div>192.168.1.67&nbsp;&nbsp;&nbsp; zeta</div>
<div>192.168.1.68&nbsp;&nbsp;&nbsp; sigma</div>
</blockquote>
<p>
You will also need to create a <em>mpd.hosts</em> file on each of the nodes within the user&#8217;s home directory (note, this is the user you wish to run mpi under). Here is my <em>mpd.hosts</em> (I only have two machines in the cluster):</p>
<blockquote>
<div>zeta</div>
<div>sigma</div>
</blockquote>
<p>
MPICH2 requires trusted SSH among compute nodes and head node. Please see Step 7 in <a href="http://help.ubuntu.com/community/MpichCluster">this article</a> I mentioned earlier. Note that in Ubuntu 8.04 and 8.10 the authorized keys file is called authorized_keys2 and the actual keys generated using <em>ssh-keygen</em> by default are <em>id_dsa</em> and <em>id_dsa.pub</em>. It does not really matter what type of keys you choose. Either DSA or RSA should be fine. This step should be repeated on each cluster node and the<em> id_dsa.pub</em> generated on one machine should be added to <em>authorized_keys2</em> on the other machine. In my setup, I added the <em>id_dsa.pub</em> on <strong>zeta</strong> to the <em>authorized_keys2</em> on <strong>sigma</strong> and vise versa. This is where we make distinction between&nbsp; head node and compute nodes. Since head node needs to communicate with all the compute nodes, it needs to have all compute nodes&#8217; public keys. Whereas each compute node only needs to have the head node&#8217;s public key. As you can see, in a two-node scenario, either node can be used as the head node.</p>
<p><span class="Title">5 Building and Installing MPICH2</span><br />
The <a href="https://help.ubuntu.com/community/MpichCluster">MPICH Cluster</a> article on Ubuntu documentation has some great details on this so I am not going to repeat here. One thing you need to pay special attention is the <em>.mpd.conf</em> file (located in user&#8217;s home directory).</p>
<p>This file is used to make the communications among cluster nodes more secure. To ensure that computers within the same cluster can communicate with each other, each machine must have the same secret word. If the secret word does not match, you will receive a <strong>handle_mpd_output error</strong> (e.g. <font color="#800000">failed to handshake with mpd on &lt;node name&gt;; recvd output={}</font>)</p>
<p><span class="Title">6 Test Run</span><br />
On <strong>zeta</strong> (head node) export the NFS node</p>
<blockquote><p> exportfs -a
</p></blockquote>
<p>On <strong>sigma</strong> (compute node) mount the NFS exported from zeta on the same path so that the directory structures on both machines are the same.</p>
<blockquote><p> sudo mount zeta:/mirror /mirror
</p></blockquote>
<p>
On zeta (head node) start up the mpd on both nodes according to <em>mpd.hosts</em></p>
<blockquote><p> mpdboot -n 2
</p></blockquote>
<p>
Right now running <em>mpdtrace</em> on either machine you should see both nodes get listed.</p>
<p>Running the interactive version of <em>cpi</em> on one core with an interval number of 100,000,000</p>
<blockquote><p> mpiexec -n 1 ./icpi 
</p></blockquote>
<p>
it took 1.93 second to complete.</p>
<p>Running with all 8 cores with the same paramter:</p>
<blockquote><p> mpiexec -n 8 ./icip 
</p></blockquote>
<p>
took only 0.31 second which is more than 6 times faster than the signle core version.</p>
<p>The following figure recaps the structure of my cluster setup:</p>
<p align="center"><img width="400" height="284" alt="" src="/blog/wp-content/uploads/2008/11/twonodescluster.jpeg" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerrywong.com/2008/11/04/a-simple-beowulf-cluster/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Flash 10 on Ubuntu 64 bit &#8212; Significant Performance Improvement</title>
		<link>http://www.kerrywong.com/2008/10/18/flash-10-on-ubuntu-64-bit-significant-performance-improvement/</link>
		<comments>http://www.kerrywong.com/2008/10/18/flash-10-on-ubuntu-64-bit-significant-performance-improvement/#comments</comments>
		<pubDate>Sun, 19 Oct 2008 01:29:06 +0000</pubDate>
		<dc:creator>kwong</dc:creator>
				<category><![CDATA[Linux/BSD]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[64 bit]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.kerrywong.com/?p=392</guid>
		<description><![CDATA[Flash 10 just came out a few days ago, and I just installed it using the information provided on Ubuntu Forum (I used the script from here to install on my 64bit Ubuntu).The performance of Flash 9 on Ubuntu 64 had been suboptimal. Even with a nVidia GForce 8600 graphics card, I could not view [...]]]></description>
			<content:encoded><![CDATA[<p>Flash 10 just came out a few days ago, and I just installed it using the i<a href="http://www.ubuntugeek.com/how-to-install-adobe-flash-player-10-in-ubuntu-804-hardy-heron.html">nformation provided on Ubuntu Forum</a> (I used the script from <a href="http://queleimporta.com/the-easiest-way-to-install-flash-10-on-ubuntu-64-bits/en/">here</a> to install on my 64bit Ubuntu).<span id="more-392"></span>The performance of Flash 9 on Ubuntu 64 had been suboptimal. Even with a nVidia GForce 8600 graphics card, I could not view any flash based videos using full screen (1920&#215;1200) due to the extremely low frame rate. Flash 10 seems to have made significant optimization improvement under Linux and the full screen video performance right now is superb.</p>
<p>The performance improvement in Flash 10 should bode well in the Linux community as native flash performance had been one of the major issues for users to switch from Windows to Linux.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerrywong.com/2008/10/18/flash-10-on-ubuntu-64-bit-significant-performance-improvement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PD1001 Webcam on Hardy Heron</title>
		<link>http://www.kerrywong.com/2008/10/11/pd1001-webcam-on-hardy-heron/</link>
		<comments>http://www.kerrywong.com/2008/10/11/pd1001-webcam-on-hardy-heron/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 01:07:18 +0000</pubDate>
		<dc:creator>kwong</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Linux/BSD]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Webcam]]></category>

		<guid isPermaLink="false">http://www.kerrywong.com/?p=390</guid>
		<description><![CDATA[I have an old webcam (Creative PD1001) which is not officially supported on Linux. Fortunately, Endpoints EPCAM USB Camera Driver is known to work with PD1001 on many Linux distros. To get the driver built on Ubuntu 8.04 however, I needed to make some minor changes to epcam.c. The kernel version I was compiling against [...]]]></description>
			<content:encoded><![CDATA[<p>I have an old webcam (Creative PD1001) which is not officially supported on Linux. Fortunately, <a href="http://ubuntuforums.org/showpost.php?p=2626919&amp;postcount=29">Endpoints EPCAM USB Camera Driver</a> is known to work with PD1001 on many Linux distros. <span id="more-390"></span></p>
<p>To get the driver built on Ubuntu 8.04 however, I needed to make some minor changes to epcam.c. The kernel version I was compiling against is 2.6.24-19-generic. To get the 0.7.3 driver build successfully, I needed to comment out #include &lt;linux/config.h&gt; and then ran</p>
<p>KBUILD_NOPEDANTIC=1 make install</p>
<p>If you do not want to setup the environment variables for the build, you could just modify the #include statements to where the kernel header files are located:</p>
<div>#include &quot;/usr/src/linux-headers-2.6.24-19-generic/include/linux/module.h&quot;</div>
<div>#include &quot;/usr/src/linux-headers-2.6.24-19-generic/include/linux/version.h&quot;</div>
<div>#include &quot;/usr/src/linux-headers-2.6.24-19-generic/include/linux/init.h&quot;</div>
<div>#include &quot;/usr/src/linux-headers-2.6.24-19-generic/include/linux/fs.h&quot;</div>
<div>#include &quot;/usr/src/linux-headers-2.6.24-19-generic/include/linux/vmalloc.h&quot;</div>
<div>#include &quot;/usr/src/linux-headers-2.6.24-19-generic/include/linux/slab.h&quot;</div>
<div>#include &quot;/usr/src/linux-headers-2.6.24-19-generic/include/linux/proc_fs.h&quot;</div>
<div>#include &quot;/usr/src/linux-headers-2.6.24-19-generic/include/linux/pagemap.h&quot;</div>
<div>#include &quot;/usr/src/linux-headers-2.6.24-19-generic/include/linux/usb.h&quot;</div>
<div>#include &quot;/usr/src/linux-headers-2.6.24-19-generic/include/asm/io.h&quot;</div>
<div>#include &quot;/usr/src/linux-headers-2.6.24-19-generic/include/asm/semaphore.h&quot;</div>
<p>&nbsp;</p>
<p>After the build the driver is automatically installed and when the webcam is plugged in, it should be recognized by apps such as camorama (note: /dev/video0 is automatically created when the webcam is connected).</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerrywong.com/2008/10/11/pd1001-webcam-on-hardy-heron/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux Only, Two Months Later</title>
		<link>http://www.kerrywong.com/2008/06/14/linux-only-two-months-later/</link>
		<comments>http://www.kerrywong.com/2008/06/14/linux-only-two-months-later/#comments</comments>
		<pubDate>Sun, 15 Jun 2008 01:51:00 +0000</pubDate>
		<dc:creator>kwong</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.kerrywong.com/2008/06/14/linux-only-two-months-later/</guid>
		<description><![CDATA[Since I built my new PC roughly two months ago, I have been running Linux (Ubuntu 8.04 64 bit) as my primary operating system, and I have not looked back. While in the past I have always had machines running Linux (or FreeBSD) at home, my primary PC had always been a Windows PC. But [...]]]></description>
			<content:encoded><![CDATA[<p>Since I built my new PC roughly <a href="/2008/04/12/some-pictures-of-my-new-rig/">two months</a> ago, I have been running Linux (Ubuntu 8.04 64 bit) as my primary operating system, and I have not looked back.<span id="more-309"></span></p>
<p>While in the past I have always had machines running Linux (or FreeBSD) at home, my primary PC had always been a Windows PC. But when I made the switch to a true 64-bit environment, Linux made perfect sense. My old PC was running Windows XP 32 bit, in order to take advantage of the 8 GB memory installed in my new machine, I had to move to a 64 bit OS. So my choices were either to buy a copy of Windows XP 64 bit (Vista? <a href="/2007/02/14/will-i-switch-to-vista/">No thanks</a>.) or use the freely available 64 bit Linux. And the choice was quite easy to make.</p>
<p>So, I decided to go with the most popular distro &#8211; <a href="http://www.ubuntu.com">Ubuntu</a>. In fact I could have easily chosen <a href="http://www.opensuse.org">openSUSE</a>, or even <a href="http://www.freebsd.org/">FreeBSD</a> (which is based on BSD UNIX) since my previous experience with them were quite positive as well. At first I did have some question whether or not I would be able to do the majority of my work on Linux, without having to constantly turning to a Windows PC. As it turned out, those worries were totally unnecessary. For the past two months, I had been using Linux almost exclusively at home except for a few moments when I needed to test something in Visual Studio .Net.</p>
<p>For web browsing, I use <a href="http://www.mozilla.com/">Firefox</a> 64 bit, since there&#8217;s no 64bit Flash available for 64 bit Linux yet, I installed the 32 bit version as well. The default email client GNOME supplies is Evolution, which is quite powerful. Unfortunately, it could only import my outlook mail hierarchical Inbox folder structures into a single folder. So for my mail client, I chose Mozilla&#8217;s Thunderbird instead. For word editing, <a href="http://www.openoffice.org/">OpenOffice</a> 3.0 is an excellent choice. In fact, I personally found it quite comparable to Microsoft Office 2007, and most Office documents can be opened/edited without any issues.</p>
<p>Since I like many of the tools provided in <a href="http://www.kde.org">KDE</a>, I installed the KDE environment as well (the alternative would be to install <a href="http://www.kubuntu.org">Kbuntu</a> first and install GNOME based tools later, but it really doesn&#8217;t matter, this is the beauty of the versatilities of Linux). The default simple text editing tool (gedit in GNOME/kedit in KDE) is quite powerful compare to Windows&#8217; notepad. The syntax highlighting capability is built in. For viewing PDF documents, I use kpdf, the KDE version of the PDF/PS file viewer. If you are used to the sluggish performance of Adobe&#8217;s Acrobat Reader, you&#8217;ll be surprised to find how snappy kpdf is.</p>
<p>I use K3b (KDE&#8217;s CD/DVD creator) to burn CD and DVD discs. K3b&#8217;s features rival most of the commercial CD/DVD authoring programs in the Windows world. In terms of media playback, Ubuntu handles almost all media formats out-of-box, even proprietary formats like wmv can be easily accommodated with a single mouse click. And for photo editing, I use GIMP, which is rather easy to use and almost as powerful as Photoshop.</p>
<p>For software development, I use <a href="http://www.codeblocks.org/">Code::Blocks</a> and KDevelop for C++ applications, <a href="http://www.monodevelop.org">MonoDevelop</a> for C# programs. Occasionally I needed to research some work related programming issues. Since some of these issues are Windows specific, I would fire up an instance of Windows XP (or Windows Vista) within <a href="http://www.vmware.com/products/server/">VMWare Server</a> and use Visual Studio from there.</p>
<p>There hasn&#8217;t been a single instance where I couldn&#8217;t do something conveniently in Linux for the past two months. In fact, for the majority of the stuff I do I felt that Linux was actually easier. There are a few rough edges, of course. For example, copy and paste sometimes do not play well between GNOME and KDE applications and the Flash play back performance under Linux is far inferior then under Windows. But it does not matter to me that much (I block flash content on my Windows PC anyway).&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerrywong.com/2008/06/14/linux-only-two-months-later/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello Hardy Heron</title>
		<link>http://www.kerrywong.com/2008/04/26/hello-hardy-heron/</link>
		<comments>http://www.kerrywong.com/2008/04/26/hello-hardy-heron/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 01:38:01 +0000</pubDate>
		<dc:creator>kwong</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.kerrywong.com/2008/04/26/hello-hardy-heron/</guid>
		<description><![CDATA[After building my new quad-core computer (1, 2, 3), it was time for me to choose an operating system.In the past, I have been using both Windows and Linux on my home computers. But my primary PC has always been running Windows. The main reason was that I needed to use Visual Studio and running [...]]]></description>
			<content:encoded><![CDATA[<p>After building my new quad-core computer (<a href="/2008/04/11/my-q9450-arrived/">1</a>, <a href="/2008/04/12/some-pictures-of-my-new-rig/">2</a>, <a href="/2008/04/14/q9450-initial-oc-result/">3</a>), it was time for me to choose an operating system.<span id="more-286"></span>In the past, I have been using both Windows and Linux on my home computers. But my primary PC has always been running Windows. The main reason was that I needed to use Visual Studio and running it under a virtual machine was not ideal since the resource requirement was high. This time however, I have decided to move my main OS to Linux.</p>
<p>During the past couple of weeks, I have been playing with <a href="http://www.ubuntu.com">Ubuntu</a> 8.04 (Hardy Heron) beta version and I was pretty happy with the results so as soon as Ubuntu 8.04 was released last Thursday, I downloaded the image and installed on my PC.</p>
<p>I am happy to report that Ubuntu 8.04 recognized all the hardware (see the list <a href="/2008/04/11/my-q9450-arrived/">here</a>) with no issues. And the 2.6.24 kernel fully supports Q9450 and X38 chipset. The included proprietary new nVidia driver supports my 8600 GT graphic card with no problem and I could run Beryl desktop smoothly.</p>
<p>There are a few rough edges however. In beta versions, when I booted Ubuntu, the startup logo was correctly stretched to fit the entire screen (wide screen), but the production code somehow swapped to a 4:3 mode which is kind of annoying. The major issue though is with nautilus. Everything works fine in default mode (icon view), but as soon as I change the settings to list view, dragging and dropping would cause the whole system to lock up. I noticed this behavior in beta builds and had thought that it would be resolved in the production version. So for now, I will use the default setting.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerrywong.com/2008/04/26/hello-hardy-heron/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MATLAB 7 under WINE</title>
		<link>http://www.kerrywong.com/2007/12/01/matlab-7-under-wine/</link>
		<comments>http://www.kerrywong.com/2007/12/01/matlab-7-under-wine/#comments</comments>
		<pubDate>Sun, 02 Dec 2007 03:31:10 +0000</pubDate>
		<dc:creator>kwong</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Linux/BSD]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MATLAB]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[WINE]]></category>

		<guid isPermaLink="false">http://www.kerrywong.com/2007/12/01/matlab-7-under-wine/</guid>
		<description><![CDATA[When I tried WINE many years ago, there were not that many large applications that could actually run smoothly without some sort of hacks.But when I gave it another try the other day, I was totally impressed by its abilities to run Windows applications natively under Linux. In fact, most Windows applications, as long as [...]]]></description>
			<content:encoded><![CDATA[<p>When I tried <a href="http://www.winehq.org/">WINE</a> many years ago, there were not that many large applications that could actually run smoothly without some sort of hacks.<span id="more-247"></span>But when I gave it another try the other day, I was totally impressed by its abilities to run Windows applications natively under Linux. In fact, most Windows applications, as long as they use standard Windows API&#8217;s, could almost run directly under WINE without any modifications or tweaks (support for Microsft&#8217;s latest products however is quite limited as newer API&#8217;s might not have been implemented under WINE yet).</p>
<p>To use <a href="http://www.mathworks.com/ ">MATLAB</a> 7 under WINE, all one has to do is to copy the harddrive serial number over into ~/.wine/drive_c/.windoes-serial. Here I assume that MATLAB has already been installed under Windows C drive.</p>
<p>The serial number is the disk serial number detected during MATLAB&#8217;s installation and can be found under [MATLAB root folder]/bin/win32/license.dat. The value after HOSTID=DISK_SERIAL_NUM= is the serial number.</p>
<p>After setting the disk serial number, MATLAB should be able to be invoked from the shell:</p>
<p>&nbsp;</p>
<blockquote>
<p>wine /windows/C/MATLAB701/bin/win32/MATLAB.exe</p>
</blockquote>
<p>Here is a screen shot of MATLAB 7 running under Suse 10.3 (Gome):</p>
<p>&nbsp;</p>
<p align="center"><img alt="" src="/blog/wp-content/uploads/2007/12/matlab_demo.png" /></p>
<p>And if the serial number is set incorrectly, the following message will be received instead:</p>
<p align="center"><img alt="" src="/blog/wp-content/uploads/2007/12/license_error.png" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerrywong.com/2007/12/01/matlab-7-under-wine/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>A Physical to VM Backup Strategy for Ubuntu Server</title>
		<link>http://www.kerrywong.com/2007/10/05/a-physical-to-vm-backup-strategy-for-ubuntu-server/</link>
		<comments>http://www.kerrywong.com/2007/10/05/a-physical-to-vm-backup-strategy-for-ubuntu-server/#comments</comments>
		<pubDate>Fri, 05 Oct 2007 10:42:38 +0000</pubDate>
		<dc:creator>kwong</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Ubuntu Server]]></category>
		<category><![CDATA[VMWare]]></category>

		<guid isPermaLink="false">http://www.kerrywong.com/2007/10/05/a-physical-to-vm-backup-strategy-for-ubuntu-server/</guid>
		<description><![CDATA[One benefit of using a Linux environment is that the whole system back up is extremely easy. In fact, if you are doing the backups and restores for the same machine (which is usually the case), you only need to use the TAR command (see details) and no special software is needed. However, sometimes it [...]]]></description>
			<content:encoded><![CDATA[<p>One benefit of using a Linux environment is that the whole system back up is extremely easy.<span id="more-226"></span> In fact, if you are doing the backups and restores for the same machine (which is usually the case), you only need to use the TAR command (see <a href="https://help.ubuntu.com/community/BackupYourSystem/TAR">details</a>) and no special software is needed.</p>
<p>However, sometimes it is desirable to have a standby instance of the machine. For example, in a production environment, if a standby server is hot-synced with the production server then in the event of a production server failure, the standby server can kick in right away and the downtime can be reduced to as little as a couple of minutes. Whereas if a system restore is required, the production server has to be re-imaged and that can take significantly longer.</p>
<p>Fortunately, it is relatively easy to achieve this goal. In this post I will show you how to backup a Ubuntu Server (7.04) system to a Virtual Server. It only requires a few more steps then the plain vanilla TAR backup/restore.</p>
<ul>
<li><strong>Backup</strong></li>
</ul>
<blockquote>
<p>The backup command is almost identical to the command used in a standard backup (e.g. the backup is used to restore to the same server). Because the backup machine might not have the same physical specs as the machine where we perform the backup, we need to exclude a few more items. Particularly, <br />
<strong>/dev, /etc/fstab, /etc/hostname, /etc/iftab </strong>might be different on the backup machine and we need to be careful not to overwrite them when restoring. An example of the TAR command used for backup a system is listed here:</p>
</blockquote>
<blockquote><blockquote>tar -czf /mnt/backup/sysbackup/backup.tgz &#8211;exclude=/proc &#8211;exclude=/dev &#8211;exclude=/lost+found &#8211;exclude=/mnt &#8211;exclude=/sys &#8211;exclude=/cdrom &#8211;exclude=/etc/fstab &#8211;exclude=/etc/hostname &#8211;exclude=/etc/iftab / 
</p></blockquote>
</blockquote>
<ul>
<li><strong>Preparing the Backup VM</strong></li>
</ul>
<blockquote>
<p>Here I use a virtual machine to illustrate the restore-to-a-different machine strategy. In practice though, this can also be a physical machine.</p>
<p>First, you will need to prepare a minimum VM that has the desired OS on it (in my case Ubuntu Server 7.04). The OS is needed because we are using TAR to do the backup and restore. It should be pretty easy though as most server version Linux images support unattended setup.</p>
<p>You do not need to install any security updates afterward as the system will be brought up to date during the restoration process.</p>
</blockquote>
<ul>
<li><strong>Resotring Backup Image to VM</strong></li>
</ul>
<blockquote>
<p>&nbsp;Now copy the backup image over to the VM. Because certain files can only be overwritten when they are not in use, we will perform the restoration in single user mode:</p>
<blockquote>
<p>init 1</p>
</blockquote>
<p>next we will restore the backup image:</p>
<blockquote>
<p>tar -xpzf /backup.tgz -C /</p>
</blockquote>
<p>DO NOT REBOOT AFTER RESTORE! If you reboot right after the restoration, the system will not be in a bootable state (e.g. system drive&#8217;s UUID has not been updated yet, if you reboot now you will not be able to boot into your system. In this case you will have to use a live CD to boot and fix your system from there).</p>
<p>First thing we need to do is to set the correct UUID for the partition we are booting from.</p>
<p>Do a <strong>df </strong>to see which partition is the root partition, e.g.</p>
<blockquote>
<p>Filesystem&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1K-blocks&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Used Available Use% Mounted on</p>
<p>/dev/sda1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 113892200&nbsp;&nbsp; 1007084 107099712&nbsp;&nbsp; 1% /
</p></blockquote>
<p>Find out the UUID of the partition:</p>
<blockquote>
<p>dumpe2fs /dev/sda1 | grep UUID</p>
</blockquote>
<p>Write down the UUID of the partition and double check to make sure that it is written down correctly as wrong UUID will lead to a boot failure.</p>
<p>Now, we need to edit <strong>/boot/grub/menu.lst </strong>to update the boot partition&#8217;s UUID.</p>
<p>In menu.lst, find entries like:</p>
<blockquote>
<p>title&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ubuntu, kernel 2.6.20-16-server<br />
root&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (hd0,0)<br />
kernel&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /boot/vmlinuz-2.6.20-16-server root=UUID=401eeff8-c149-4db6-b4df-6cd899b880c6 ro quiet splash<br />
initrd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /boot/initrd.img-2.6.20-16-server<br />
quiet<br />
savedefault</p>
</blockquote>
<p>And change the UUID to the one you just copied down. Again, use extra caution to ensure that the UUID is changed correctly.</p>
<p>Depending on the system, there might be quite a few entries with the same UUID as you might have different kernels installed. If you are not certain, change them all.</p>
<p>&nbsp;Now you should be able to reboot into the restored system. After reboot, you might not have access to the network any longer due to the MAC change of the ethernet during system restore. This can be fixed easily. Do a</p>
<blockquote>
<p>ipconfig -a</p>
</blockquote>
<p>you should see an entry with eth0 (or eth1). Copy down the HWaddr (e.g. 00:52:AA:C2:F9:CD) and use this value to update /etc/iftab</p>
<blockquote><p><strong>eth0</strong> mac 00:52:AA:C2:F9:CD arp 1
</p></blockquote>
<p>Make sure that the ether net interface is updated to eth0.</p>
<p>Now you should be able to use ifup eth0 to bring up the network. see <a href="http://communities.vmware.com/thread/46069">this thread</a> for more detailed discussion on this issue.</p>
</blockquote>
<p>One benefit of this backup strategy is that you are always guaranteed that the backup image works correctly, and you can have the backup system on standby using rsync to synchronize the backup machine and your production machine. And in the event of a disaster, your backup machine can kick in immediately.</p>
<p>Restoring the image back to the production machine is actually easier since you can just restore the image back without the need to change any configurations mentioned above (however, it is still a good idea to check).</p>
<blockquote>
<p>&nbsp;</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.kerrywong.com/2007/10/05/a-physical-to-vm-backup-strategy-for-ubuntu-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
