Blog

During the course of the day I encounter lots of challenges, some of which take minutes to solve and others that take much longer. My goal for this section is to keep track of these challenges and their solutions. I will turn the longer ones into articles, while the shorter ones will stay as blog entries. You can expect topics to range from very specific programming challenges to broader topics like life.

Below is a list of the recent blog entries. You can also browse the blog by using the tags on the right side, or if you know what you are looking for then you can use the search box at the top right.

Windows XP Uptime

Command prompt showing the uptime

The stability of my ArchLinux based file server has been easy to measure because it generally stays running all the time. The longest I have had it running without a reboot is about 120 days or four months, when I had to shutdown it down because I had to move! I have never had to test the stability of the Windows machine because I generally turn it off when I am done since I can easily boot it remotely. This doesn’t apply to my Windows XP based computer at work because there are times when I have to access it from home from where Wake On LAN isn’t an option so I generally have the computer running all the time.

Recently I had to restart the computer after installing VMWare when I decided to check the uptime. I looked at the output of net stats server and was pleased to see that the computer had been running without any slowdown or issues for about 38 days! This is after all the customizations that I have done; things like GeoShell, AutoHotKey, fully loaded Firefox & Foobar, UltraMon, TaskSwitchXP, and a gazillion other programs. I was a little sad to restart it at this point knowing that it would reset the counter but I had to restart 🙂 Anyways, the point is that once you have a system setup just the way you want, Windows XP can handle it without any problems.

Just pre-ordered the Zune 80

Zune 80GB

I have had the Creative Zen Vision:M 30GB for a while now and I like it very much. The only problem that I have had is it’s capacity. My collection is now reaching upwards to 45GB and I would like to have all of that available. So, I have been looking around for a while and the most obvious choice is the new iPod Classic, but recently I have heard a lot about the new Zune. I am looking only at the mainstream players because these generally have a good set of accessories available, most important of which to me are the cases. I have been comparing the Zune 80GB with the 80GB iPod Classic and I have finally decided on the Zune 80GB. Below are a few thoughts.

  • For me the biggest advantage with Zune was the wireless syncing. How good this will actually work out is still remaining to be seen. I am anxious to see how the syncing will work because ideally I would like to be able to sync it with a Samba share; I don’t expect it to work out of the box but I am willing to do some reverse engineering to get it to work 🙂
  • FM Tuner is useful at times.
  • For me the bigger screen is more of a disadvantage since most of the times I am only listening to music and the bigger screen means shorter battery life.
  • I have recently bought the in-ear Griffin TuneBuds and I have fell in love with these. The in-ear style delivers very nice sound and they don’t fall off as easily, which is especially important at places like the gym. Zune 80GB comes with the Zune Premium headphones which I am expecting to be similar if not better.

I should be getting it around November 23rd so I will do further posts about it around then.

ShellExecuteEx

I created a small, pure Win32 based program called Run From Clipboard++ which executes whatever you have in your clipboard. The idea seems simple but it has proven invaluable to me because at work I get a lot of links, many times these links to documents and websites in emails that are not really links. I have to copy and paste those in the run dialog box, a lot of the times these links are broken into multiple lines so I have to open notepad2 first make it into one line and then run it. So, this programs attempts to streamline this process, in that it tries to execute the clipboard content as is, and if that it unsuccessful then it tries to execute it by removing any newlines, and if still it is unsuccessful then it pops up the following dialog box to allow the user for any changes.

Solving Fonts Issues with Installing RMagick on Ubuntu

Are you getting errors about missing fonts when compiling RMagick on Ubuntu?

<--- ext/RMagick
... Output intentionally deleted ...
<--- ext/RMagick
<--- ext
setup.rb: entering post-setup phase...
post-setup.rb: setting up documentation...
/usr/bin/ruby1.8 -I /home/thebitguru/RoR/RMagick-2.0.0/./lib -I /home/thebitguru/RoR/RMagick-2.0.0/./ext/RMagick InitialCoords.rb
/home/thebitguru/RoR/RMagick-2.0.0/./lib/rvg/misc.rb:321:in `get_type_metrics': unable to read font `/usr/share/ghostscript/fonts/n019003l.pfb' (Magick::ImageMagickError)
        from /home/thebitguru/RoR/RMagick-2.0.0/./lib/rvg/misc.rb:321:in `render'
        from /home/thebitguru/RoR/RMagick-2.0.0/./lib/rvg/misc.rb:696:in `text'
        from /home/thebitguru/RoR/RMagick-2.0.0/./lib/rvg/text.rb:65:in `add_primitives'
        from /home/thebitguru/RoR/RMagick-2.0.0/./lib/rvg/container.rb:72:in `add_primitives'
        from /home/thebitguru/RoR/RMagick-2.0.0/./lib/rvg/container.rb:72:in `each'
        from /home/thebitguru/RoR/RMagick-2.0.0/./lib/rvg/container.rb:72:in `add_primitives'
        from /home/thebitguru/RoR/RMagick-2.0.0/./lib/rvg/rvg.rb:264:in `add_outermost_primitives'
        from /home/thebitguru/RoR/RMagick-2.0.0/./lib/rvg/rvg.rb:264:in `each'
        from /home/thebitguru/RoR/RMagick-2.0.0/./lib/rvg/rvg.rb:264:in `add_outermost_primitives'
        from /home/thebitguru/RoR/RMagick-2.0.0/./lib/rvg/rvg.rb:236:in `draw'
        from InitialCoords.rb:22

The fonts are available but they are in a different location. You can validate this by running locate n019003l. This command should print out the location of the fonts. On my kubuntu system I created a symbolic link to the correct location and then it worked fine.

root@vision:~# ln -s /usr/share/fonts/type1/gsfonts/ /usr/share/ghostscript/fonts/

Looking for a good task tracking system

As my responsibilities are growing at my job I am seeing a very critical need for a better task tracking and time management system. There are several things that make this very challenging.

  • Changing priorities, a.k.a. moving targets
  • Unpredictable additions of tasks. i.e. several new tasks are added as the day proceeds
  • Not much estimates of the time that the current tasks might take
  • My nature of not easily saying no to new things that come my way

To add to that, my responsibilities at home have also grown tremendously. This is mainly because I have been managing all of the finances, and as the income sources and expenses are increasing so is the complexity. Add to that the fact that I am working on my MBA, which means that I also have to plan for the tuition and other related expenses.

Considering all this, my goal for this week is to research ways that I can track my tasks and implement a better system. I have also been discussing this with my team lead at work who is also cooperating in my pursuit for a better management system. I will post further updates as I make progress.

SSH public key authentication not working?

Are you having trouble with SSH authentication when using public key authentication? i.e. OpenSSH doesn’t like your key? Running SSH in debugging mode produces an output like the following?


[thebitguru@dreamer .ssh]$ ssh -vvv YYY@XXXXX.com

OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to XXXXXX.com [64.22.96.40] port 22.
debug1: Connection established.
debug1: identity file /home/thebitguru/.ssh/identity type -1
debug3: Not a RSA1 key file /home/thebitguru/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '——-BEGIN’
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'Proc-Type:’
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'DEK-Info:’
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
… ///// Removed for clarity /////
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '——-END’
debug3: key_read: missing keytype
debug1: identity file /home/thebitguru/.ssh/id_rsa type 1
debug1: identity file /home/thebitguru/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.9p1
debug1: match: OpenSSH_3.9p1 pat OpenSSH_3.*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
… ///// Removed for clarity /////
debug3: check_host_in_hostfile: match line 8
debug1: Host 'XXXXXX.com’ is known and matches the RSA host key.
debug1: Found key in /home/thebitguru/.ssh/known_hosts:9
debug2: bits set: 526/1024
debug1: ssh_rsa_verify: signature correct
… ///// Removed for clarity /////
debug2: key: /home/thebitguru/.ssh/id_rsa (0×8093f00)
debug2: key: /home/thebitguru/.ssh/identity ((nil))
debug2: key: /home/thebitguru/.ssh/id_dsa ((nil))
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug3: start over, passed a different list publickey,gssapi-with-mic,password
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/thebitguru/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Trying private key: /home/thebitguru/.ssh/identity
debug3: no such identity: /home/thebitguru/.ssh/identity
debug1: Trying private key: /home/thebitguru/.ssh/id_dsa
debug3: no such identity: /home/thebitguru/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password

You need to change the permissions on authorized_keys2 file on the server to be only owner writable. A good option is: chmod 600 ~/.ssh/*

Once again this solution was posted deep down in a mailing list archive. The credit goes to Stephen Biggs for posting the explanation in this mailing list thread.

Giving Windows Vista an Honest Try

I have had Windows Vista on my tablet for a while and I finally decided that I would try it out on my desktop. But, I didn’t go at it blindly. Especially since when the Vista had open Beta I tried it out and noticed that it was considerably slower than my Windows XP installation. Considering this, I first installed it on my “playing around” 15GB partition to see how it performed. After trying it out for a few days I then decided that it was ready.

Windows Vista Desktop

So, I installed Vista around 8pm today on the main 40GB OS partition replacing the Windows XP installation. Visual Studio is one of the key programs that I use quite often so knowing that they have the 2008 beta out I had wget on the ArchLinux server working at downloading the img file. The initial Windows Vista install took under half an hour and after that it was ready for my installations and customizations. Here is what I have done so far.

  1. Applied all 29 or so critical and recommended Windows Updates (amazing, isn’t it? :))
  2. Installed Windows Mobile Device Center
  3. Connected the imate phone and the printer
  4. Installed tons of programs with only three restarts, which were mostly because of the programs that changed Windows at core. This list includes programs such as TortoiseSVN, AutoHotkey, Cisco VPN client, Daemon Tools, and cygwin.
  5. Turned off the autotuning feature.

Here is my impression so far.

  • My computer, even though it is fairly new, is running faster than I was expecting. In some cases it seems faster than Windows XP.
  • I just copied the 3.5GB Visual Studio 2005 (orcas) beta image from the server without any issues. So, hopefully I won’t have to worry about the slow file copy over the network.
  • The only major annoyance that I have had is with permissions on the data partition that I was previously using with the Windows XP installation. I don’t completely blame Microsoft for this because permissions generally are hard synchronize across installations. I just think that they could have done a better job on guiding the users through fixing the permissions.
  • Up until now there have only been two programs with compatibility issues.
    • InterSystems’ Cache’ Studio won’t work. This isn’t too big of an issue because I have to be on the work VPN to connect to the server, and now I will just have to use Cache’ Studio on my Windows XP machine at work.
    • I used AnyPassword to keep track of my passwords and this program isn’t compatible with Vista. I was surprised to find this out when I double clicked on the exe and Vista told me about it even before installing it.

In summary, so far everything is going awesome!

Published a new article about ListView

I just finished publishing a new article about displaying ListView column header sorting icons. Check it out if you have to show the column sorting icons in .NET versions prior to 3.0.

Below is a brief text about the article.

A Windows Vista ListView showing the sort icon

There are numerous articles online that show how to use the ListView control in C# but, unfortunately, you won’t find any that explain how to show the user which column you are actually sorting on. This article explains how to display a sorting icon in the ListView column header using Visual C# .NET. You you can easily port the concepts explained here to other .NET languages like Visual Basic .NET.

Recent Noteworthy Windows Vista Update

I was looking through the Windows Vista updates and noticed that there were two optional updates. I decided to take a peak at those to see what they contained. Interestingly, one of two included the following in the description.

  • “When you copy or move a large file, the “estimated time remaining” takes a long time to be calculated and displayed.” Quoted from the accompanying kb article.
An example of the copy dialog showing that it is calculating the remaining time

Now, I am not sure about you but I copy a lot of files and therefore get to see this a lot; so, to me it is an annoying bug. Along the same lines, if nothing else, this tends to portray a bad image of the operating system. Because guess what your Mac or Linux fanboy friend is going to say when they see the copy dialog box? “If Vista takes this long to calculate the time that it needs to transfer files, I bet it will take twice as long to actually copy the files!” Considering all this I personally think that if this fix works then it should be a critical update 🙂

There have also been posts on the internet about how slow copying in Vista can sometimes be. You can refer to this, this, and this as examples. A while back I personally encountered these slow speeds with a few files that I was transferring but that only happened once.

Anyways, out of curiosity I did some simple benchmarking to figure out what this new hotfix fixed. In my test the calculation time decreased almost 10 seconds, where without the fix it took around 17 seconds to calculate out how long a 36 MB file would take to transfer, and after the fix (and restart) the time went down to 7 seconds for the same file. I did this test on a wireless network so the actual transfer took a little more than the time it took to calculate.

Final verdict? Get this fix even though it is released as an optional update.

Experiencing slow internet speeds on Windows Vista?

I recently purchased the HP Verve for my dad. This laptop comes with Windows Vista and has great specs but somehow the internet was performing worst than my older Windows XP notebook. So, I went on a search for a solution to the problem and after some time found the solution buried in a forum post. I have expanded on that post and documented it an article. This is also a great example of how a feature of Windows Vista seems like its drawback. Check it out if you are experience slow speeds on laptops running Windows Vista or if you are just curious.