Skip to main content


Showing posts from 2009

Few Tips for Running Ubuntu 9.10 Karmic Koala on HP Mini 1000

Now I have been running Ubuntu 9.10 on my HP Mini 1000 for more than a week and I'm pretty happy with it. In addition to my last post about getting the wireless to work, I thought I'd probably share a few more tricks I learnt in the pass week. Ethernet Out of box, the Ethernet seems to only work when the cable is plugged in before the system boots up and it will lock up the whole machine if you unplug it. To fix this issue you need to first open up the /etc/default/grub (used to be /boot/menu.list in grub 1 but Ubuntu 9.10 ships with grub 2) with your favourite text editor and locate the following line: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" and append acpi_os_name=Linux to it, so it should now look like this: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_os_name=Linux" save the file and run: sudo update-grub After rebooting the machine, the Ethernet should work properly. External Monitor You have to disable visual effects by setting

Getting HP Mini 1000 Wireless to Work Under Ubuntu 9.10 Karmic Koala‎ Netbook Remix

I installed Ubuntu 9.10 Netbook Remix in my (actually my wife's) HP mini 1000 this afternoon. To my surprise the wireless card did not work. Also, when I looked at System -> Administration -> Hardware Drivers, the list was blank. After few hours of googling and reading through several not too helpful forum posts, I learned that this was caused by Ubuntu 9.10 shipping "b43" driver out of box, which does not work for HP mini 1000. The proprietary driver "wl" should be used instead. However, no one said exactly what I needed to do to fix this problem. Eventually, I decided to just launch Synaptic and search for "broadcom". The first result in the filtered list was bcmwl-kernel-source, which looked promising so I just went ahead and installed it. I had a look at the /etc/modprobe.d folder after the installation finished, I noticed that the package actually created a blacklist file for "b43" related modules for me already. After reb

VirtualBox: Folder Sharing between Windows Host and Linux Guest

To start, you need to install the guest additions. I use Ubuntu Server 9.04 so I followed steps outlined in this post. install necessary tools for building kernel module by: sudo apt-get install build-essential linux-headers-`uname -r` Next, click on menu "Devices" -> "Install Guest Additions..." then mount the guest addition CD-ROM within the Linux virtual machine by: mount /dev/cdrom /media/cdrom0 Finally, run the installation script: sudo ./ If you do not have X server installed, you may see a warning message about the X driver will not be installed. Ignore this message and now we are ready to configure the shared folder. Create the a folder for sharing on the host Windows machine (say C:\Shared). Click on the menu "Devices" -> "Shared Folders..." Add a new machine level shared folder by clicking on the + icon on the right Enter "C:\Shared" for Folder Path and "shared" for the

Resolve Linux Hostname from Windows

The simplest solution is to install samba: sudo apt-get install samba According to this post , this is because SAMBA implements NBT (NetBIOS over TCP/IP) protocol, which broadcasts the Linux machine's hostname on the network. Microsoft Windows understands the NetBIOS protocol so it pickups the Linux machine's hostname.

Fix Touchpad Scroll Area in Xubuntu 9.04

I have a 6 years old Compaq Presario X1000 that I use occasionally for web browsing and programming. I installed Xubuntu 9.04 on it the other day and found out that the scroll area is too wide for the touchpad. As my usual trouble shooting procedure, I googled around for answers and I found pieces of information spread across several websites. Step 1 - Enable SHMConfig First of all, we need to enable the SHMConfig in order to determine the correct scroll area width with synclient . I am pretty sure I used to enable this from the X11 configuration file, however in Ubuntu 9.04 based distributions you are supposed to create a HAL fdi file for this. sudo vi /etc/hal/fdi/policy/touchpad.fdi Put this into the file <?xml version="1.0" encoding="UTF-8"?> <deviceinfo version="0.2"> <device> <match key="input.x11_driver" string="synaptics"> <merge key="input.x11_options.SHMConfig" type=&

Installing FIrefox 3.5 on Ubuntu 9.04 Jaunty Jackalope

Firefox is slow in Linux compared to XP or even Vista on the same hardware. Do a quick google search for " firefox slow linux " and you see it's not just me who's saying this. I tried a couple of tips from other users in discussion forums such as disabling visual effects and IPv6 but it didn't really help. That's why I started thinking about installing Firefox 3.5 on my Ubuntu 9.04 64-bits machine to see if it makes a difference. At first I though I will have to download it directly from the Firefox website, however to my surprise I found the package in Synaptic. I am not sure which repository it came from but I can see the package "firefox-3.5" from the Synaptic package manager. I went through the usual installation process and frankly it did not prompt me to remove existing firefox-3.0 packages. Instead, it installs the Firefox 3.5 alone side Firefox 3.0 under the name Shiretoko Web Browser in the Application -> Internet -> Shiretoko We

Load Testing ASP.NET Sites with JMeter

Following my previous post about using JMeter to test MOSS, I tried to figure out what are the bare minimum requirements of using JMeter against a plain ASP.NET website. I wrote a very simple ASP.NET web application with just a button, a text fields and a static label. This application displays the content of a text file in the static label when it loads and write content of the text field back to the file when the button is clicked. I found all I need to do in order to script this using JMeter is to extract __VIEWSTATE and __EVENTVALIDATION fields then send them back in the update request. My JMeter test plain looks like this:

Load Testing SharePoint (MOSS) Sites with JMeter

I have used JMeter for load testing few non-ASP.NET web sites before, however I could not get it to work with ASP.NET web sites. This is mainly due to ASP.NET ViewState and event validations, which stops a recorded JMeter script from being played back. Recently I worked on a MOSS project and we were looking for tools to perform load testing on the server. Many people said the load testing tool in Microsoft Team System for Testers works well with MOSS. However, it is quite expensive so I decided to give JMeter another go. After several hours of hacking, I actually got it to work and here’s how I did it. My test page is the pretty standard MOSS edit document property screen with few extra text fields added and the goal here is to use a JMeter script to change the document properties. Once I have a working script, I can configure JMeter to fire hundreds of instances of this script simultaneously to simulate the user workload. As shown in the screenshot below, the test plan contai

Installing VMware Server 2.0.1 on Ubuntu 9.04

I use Ubuntu on daily basis and I can live without Windows most of the time. However, once in a while I need to use Windows for things like accessing the iTunes store and editing Microsoft Word documents (yes I know works but it messes up the style from time to time). I created a WIndows VM image under VirtualBox, which worked quite well except that I noticed the constant high CPU load as mentioned by several other users . I tried their suggestions such as using nohz=off and turn off ACPI, which did reduce the CPU load to 50% on one core but didn't get rid of the problem completely. I eventually decided to give the free VMware Server a try. Setting it up on Windows was pretty simple, just double click and then click through the Wizard. However, installing it on Ubuntu 9.04 is a non-trivial task and took me a little while to complete. Launch Synaptic package manager and make sure you have linux-header, linux-source, gcc and binutils installed. Download the .tar

Ubuntu 9.04 and NVIDIA Driver

I have been using Ubuntu for quite a while and I loved it for it's simplicity. I downloaded and installed 9.04 in my machine last night and to my surprise I no longer get the nice pop-up prompting me to install proprietary NVIDIA driver for my NVIDIA 8800 GTS graphics card. The "nv" driver worked fine but it doesn't allow me to enable desktop effects. Also, I really want the full hardware acceleration so I can do some OpenGL programming. After search around the ubuntu package repository, I found several versions of the old familiar nvidia-glx. So I installed the latest one with: sudo apt-get install nvidia-glx-180 Another surprise was that it no longer updates the xorg.conf file for me so I ended up running nvidia-xconfig myself by: sudo nvidia-xconfig This overrides the xorg.conf file to make sure X server loads the proprietary "nvidia" rather than open source "nv" driver. I wonder what the Ubuntu team was thinking, this definitely felt like a ste

East Coast Trip

I met a former colleague who was born in Hawkes bay and had some random chat about work and holidays. This was when I realised that even though I’ve been living in New Zealand for 12 years, I’ve never travel to the east coast of north island before. Therefore, when my wife said she felt like to go for a holiday I immediately suggested that we should travel to the east. Day 1 Napier is quite far away from Auckland (420 km, ~6 hours drive according to Google Map), so we’ve decided to stop by few other cities alone the way. Our first stop was Rotorua, which is famous for its geothermal sites and hot pools. After checked into our hotel, we were wondering around the street trying to find a place for dinner. Eventually, I pulled out my iPhone, browsed to , found a highly rated bar Pig & Whistle and found it using iPhone GPS and Google Map. I just can’t imagine how to live without iPhone and Internet these days. After dinner, we visited the Polynesian Spa , which is

Referencing Local Variables in jQuery Callback Functions

One day I was working on a CRUD application, which contains a lot of form fields and controls. Each of them requires a mouse over event handler to display a tooltip message. After lots of copy’n’pasting, I decided to refactor the repetitive event registration code out and put them into a loop. To test out my idea, I developed a very simple page with just three <div>s: <div id="div1">Click me</div> <div id="div2">Click me</div> <div id="div3">Click me</div> and a list of messages indexed by the <div>s’ ID: var messages = new Object(); messages['div0'] = 'hello'; messages['div1'] = 'bonjour'; messages['div2'] = 'ciao'; When someone click on one of the <div>’s region, I would like to show a popup an dialog and display the message associated with it’s ID. Since my goal was to eliminate repetitive lines of code, I put the event registration code in

Building Native 64-bits Boost Library

I started using 64-bits Vista recently and I thought it made sense to make a native 64-bits build my favourite C++ library too. My first attempt was a complete failure because I naively thought all I have to do is to run the bjam in Visual Studio 64-bits Tools Command Prompt. It turned out this only builds a regular 32-bits Boost library. After some Googling and reading forum posts, I found some useful information in the Boost.Build document . Apparently, Boost does support building 64-bits target and what I end up doing is to specify the architecture and address-mode flags when running the bjam. c:\boost_1_38_0>bjam ^ More? --toolset=msvc ^ More? --build-type=complete ^ More? architecture=x86 address-model=64 ^ More? stage then I installed the library by c:\boost_1_38_0>bjam ^ More? --toolset=msvc ^ More? --build-type=complete ^ More? architecture=x86 address-model=64 ^ More? install

Installing the WTL Application Wizard in Visual C++ 2008 Express Edition

I love Google Chrome, it is fast, elegant and beautiful. After I realized that it was written using WTL, I felt quite keen to learn about this library. I downloaded WTL 8.0 from and Visual C++ 2008 Express Edition from only to realise that there is no WTL Wizard support for Visual C++ 2008 Express Edition. WTL 8.0 ships with WTL/ATL application wizard but the setup script only supports the Visual C++ 2005 Express Edition (setup80x.js). However, the good news is that you can make it work with Visual C++ 2008 Express Edition in few simple steps: Make a copy of the setup80x.js and rename it to setup90x.js. Open setup90x.js up and do a global search and replace from “8.0” to “9.0”. Save the file and execute it. If you are as lucky as I am, you should see a dialog that tells you that the wizard has been successfully installed. Now, when you run Visual C++ 2008 Express Edition and go File –> New –> Project… you should now see

Updating .config Files from Visual Studio Setup Project

To open Web.config from within a web setup project: string path = Context.Parameters["assemblypath"]; path = path.Substring(0, path.LastIndexOf( Path.DirectorySeparatorChar)); path = Path.Combine(path, "Web.config"); var config = ConfigurationManager.OpenExeConfiguration(path) To open App.config from within a setup project: var map = new ExeConfigurationFileMap(); map.ExeConfigFilename = Context.Parameters["assemblypath"] + ".config"; var config = ConfigurationManager.OpenMappedExeConfiguration( map, ConfigurationUserLevel.None); To update settings in .config files // update connection strings var cs = config.ConnectionStrings; cs.ConnectionStrings["cs1"].ConnectionString = BuildConnectionString(host, user, pass); // update app settings var appSettings = config.AppSettings; appSettings.Settings["key"].Value = "new value"; Finally, to save the .config file changes

Skype for iPhone Mini-Review

Skype just released a native client for iPhone earlier this week and I downloaded it as soon as I saw the announcement. I have been using Nimbuzz for Skype chatting for a little while but it has pretty high latency. I did a quick, non-scientific measurement and the latency can be as high as 2-3 seconds sometimes. The iPhone Skype, on the other hand, have very low latency and better voice quality. I was a little bit disappointed to find out that I cannot make voice calls over 3G network. However, with the crappy slow Vodafone 3G network speed and monthly 250MB data cap, I don’t think I have missed out too much.

2 Minutes Guide to Twitter

I started using Twitter recently and I really like it. Twitter is basically a website that allows you to micro-blog .  I find the idea of micro-blogging fascinating because a blog takes a lot of time and effort to maintain, whereas writing a micro-blog entry (it’s called a tweet on Twitter) simply takes few seconds. However, I was quite lost when I first start twittering. I saw many tweets contain strange symbols and I had no idea what they meant. Following are the three most widely used Twitter commands: @reply – Any tweet started with @< user name > (e.g. “@oscarkuo is a reply”) will be placed in the reply tab of the user’s Twitter home page. #tags – Tagging helps to organise tweets just like how you would tag your E-mails in your Gmail account or blog entries on your blog. The only difference is that #tags works across everyone’s tweet, not just your tweet. Basically the idea is you put the hash symbol (#) in front of a keyword in a tweet. For example the Twitte

ItemGroup Gotcha

At work, we have been deploying the latest build from the build server to the test server manually for a while. I know this is not smart but the fact is, it really doesn’t take that much time to copy and paste files from build server to the test server. Nevertheless, one day I was finally sick of this dumb process and decided to roll up my sleeves to make the build server do this monkey job automatically.  I wrote a MsBuild script, which automatically copies files to the test server from build server after finishing a build and the script below is the simplified version of it: <PropertyGroup> <Root>$(MSBuildProjectDirectory)</Root> <SourceFolder>$(Root)\Source</SourceFolder> <OutputFolder>$(Root)\Output</OutputFolder> <DeployFolder>$(Root)\Deploy</DeployFolder> </PropertyGroup> <ItemGroup> <DllFiles Include="$(OutputFolder)\*.dll" /> </ItemGroup> <Target Name="BuildA

Using Windows Live Writer with

I just happened to noticed today that Windows Live Writer (WLW) actually has built in support for What’s even better is that upon entering the URL and the credential of your blog, WLW retrieves other details such as styling and labels from your blog. Also, when you tries to publish a blog post with embedded images, WLW will automatically upload these images to your Picasa web albums. I never really liked’s web based blog editor because it is a bit too primitive in my opinion.

My Second First Blog Post

After spending few hours fighting with CSS and tweaking the layout, finally this blog is up. This is actually my second attempt of blogging, my last blog didn't last long and we'll see how long this one will last. In case you wonder, I based my blog on the 3-column Minima template, which can be found here . As far as I can see it works fine in IE7, Firefox and Google Chrome. I have to say I am very impressed with how flexible (read generous) is when it comes to customising the look and feel of the blog.