404 - Page Not Found

The page that you are looking for could not be found. I recently switched to a new content management platform so some of the old links no longer work. Below are the search results based on the link that you clicked on.

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.

How to Set ListView Column Header Sort Icons in C#

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 can easily port the concepts explained here to other .NET languages like Visual Basic .NET.

vim is awesome!

My full-time job is to implement Health Level Seven (HL7) interfaces. HL7 is a character delimited text standard for interfacing data between Health care applications. So, I have to deal with text on a daily basis. This interaction with delimited text starts to take even more time when we get closer to moving interfaces to a production environment because you have to analyze thousands of messages and possibly change a few things around in each. This analysis and manipulation is what I have been doing most of the last week and looking back now I can say that vim has saved me lots and lots of time. I love the vglobal, global and normal commands. What prompted this post was that I was looking for a way to highlight the line that the cursor was on and after a google search I found out the “cursorline” option, which does exactly what I was looking for. I believe this was implemented in vim 7, so if you have vim (or gvim) 7.0 or higher then try it out: “set cursorline”

Overall, I am so glad that I had spent time in the past experimenting with perl, awk, grep and wc. These four commands and vim have been invaluable to me. I would suggest playing around with these five tools (well, perl is a language) if your job involves working with text. Also, make sure to learn regular expressions because regular expressions are what will take you to the next level! 🙂

Windows Update Crashing?

A diff of the services before and after the crash

Recently my main installation of Windows started having troubles. After a program crashed (more details below) the sound stopped working, the window effects stopped (i.e. the theme), and sometimes the network wouldn’t respond; in other words, it was getting very annoying and pretty much unusable. At first I thought that this had something to do with the Microsoft Zune theme because the first things that would disappear were the window effects. So, I changed back to the Silver Windows XP style but the problem did not go away. This made me pay more attention to the Visual Studio debugging window that popped up when the process crashed. The debugging window said that svchost.exe was crashing. From prior experience I realized that it could be any of the services that this one process was hosting. I decided to capture the output from tasklist /svc before and after the crash to see what were services stopped due to the crash (see the screenshot).

After a few more rounds of crashed svchost.exe, I narrowed it down to the Windows Update service. My first few searches on the internet made me look for rootkits and viruses but I didn’t find any of those on my computer. After another half hour I found Scott Swigart’s site and that is where I found the solution. Re-registering the DLLs also did not solve the problem so I tried removing the SoftwareDistribution folder and guess what? Everything came back to normal!

So, if you get random crashes of svchost.exe and you have Automatic Update turned on then the first thing you should try is “refreshing” the %windir%/SoftwareDistribution folder. Instructions for doing this can be found at Scott Swigart’s blog entry but in my case I also had to stop wuauclt.exe before I could rename the folder. So, if you keep getting access denied errors when you rename the folder then you need to stop the wuauclt.exe process (Press CTRL, SHIFT and ESCAPE at the same time to get the task manager window > Switch to “Processes” tab > Find the “wuauclt.exe” process, right click on it and “End Process”)

Good luck!

Removing all Contacts, Appointments and Tasks from Windows Mobile 5

ActiveSync showing the successful synchronization with Exchange

After I accidentally deleted one of my key notifications using MemMaid I spent quite some time trying to get it back. Several days of unsuccessful attempts passed and I finally decided that I would hard reset and start from scratch. Yesterday I started from scratch and setup all the programs. In the midst of the overhaul I accidentally messed up the appointments that I had synchronized with Exchange. So, now I was ten steps ahead and eight steps back! Now looking for ways to completely clear out the Pocket Outlook database so I could resynchronize with the Exchange server and get everything back to normal.

I spent the last hour or so looking around for ways to do this, which ranged from deleting all items on the desktop (not something that I felt comfortable with) to finding programs that were written specifically for deleting things. Finally, a few minutes ago I found a solution here, which worked perfectly. Basically, it seems that all your contacts, appointments and tasks are stored in a file called pim in the root folder of the device. To clear everything, you have to either delete or rename this file, and soft-reset the device. The next time that the device starts, you will have a fresh (i.e. empty) database for contacts, appointments and tasks. All I had to do after that was setup the Exchange source and synchronize!

expect

I have an Actiontec linux-based modem/router. The default configuration for this router saves the last fifty-so host names that anyone on your network looked up. This is cool but not something that I normally use or prefer to have. So I looked up instructions on disabling this feature on this site. The only problem was that since /var is mapped to the RAM, my changes would get reset every time I restarted the modem. Me being the type of person that I am, had to come up with a way to automate this.

Microsoft Word and a Vim Tip

MS Word displaying a field code

A few days ago I noticed that somehow the links and images that I was putting in my e-mails and MS Word documents were changing into { HYPERLINK "https://thebitguru.com" } or similar texts. I put up with it for a few days but then it became annoying enough that I had to find a solution. After some research I found out that somehow Word’s configuration was changed to display the “Field codes.” To bring it back to the original state, I had to uncheck “Field codes” on the “View” tab of the options.

To turn off field codes: Tools menu, Options menu, Uncheck Field codes

On a second note, I was looking around for finding a way of deleting every other line in Vim to clean up a text file that I generated. Guess what I found out about, the normal command. To accomplish my specific goal I had to run :%normal jdd or the shorter version :%norm jdd; which deleted every other line. The normal command executes everything after it as a “normal” command, which in this case is, go down one line and dd, or in other words, delete it. That is just one way of using the normal command. I am excited to make this discovery because I can see myself utilizing this command in so many other ways. If you are curious, this is where I found about this specific command. Vim is truly an awesome editor!

ProcessMonitor

The new ProcessMonitor filter window

Majority of my job revolves around analysis and implementation of HL7 interfaces. Friday, I got a unique opportunity to test my skills. Basically, our front-end GUI application was instantiating a third-party object using the CreateObject call but it was not able to instantiate the object. Unfortunately, the application error logging did not point to anything specific, and since this was on a Citrix server, it would not be easy for easy to install the IDE and debug through the code. So, we had to look at alternatives. The first two things that were brought up were FileMon and RegMon. After spending about an hour analyzing the calls that were going and verifying almost each one we found out that the cause was a Windows Registry permission.

Just thinking about it, my “almost jack of all trades” quality proved to be of great use 🙂 What I mean is that, most of the times when I am working on something, in addition to doing the basic things I also do things around it, a lot of time on things that you wouldn’t normally do. For instance, I was working on an application that created a few DLLs, so there were times when I had to verify the locations and versions of these DLLs. I looked around on the internet and found a few applications, but I had to work around the quirks of these applications to get the information that I needed. Well, guess what I did? After a few uses of these applications, I went and wrote one for my specific needs. In order to write this app I had to learn the ins and outs of COM components and how it was laid out in the Windows Registry. At that time it was probably overkill, but this knowledge became very useful when I was helping troubleshoot the issue on Friday. I always knew that this extra knowledge was not a waste of time; it’s just a fairly long term investment! =D

Coming back to the topic: ProcessMonitor. Sysinternals has recently released the next version of FileMon and RegMon utilities, called ProcessMonitor. I have been playing around with ProcessMonitor and it is a very good progression of these utilities. If you use either FileMon or Regmon, you have to checkout ProcessMonitor.

Great Rails References

Last night I was moving the Shahab Lab website to Site5 and had the need to lookup some Rails commands. Looking around I found a few different resources, some were good, some were bad. To save you some time, below are a few that I thought were very good.

Firefox Memory Leak

Firefox has been my favorite brower for the past year or two but upgrading to the latest 1.5 is starting to change that. Looks like the latest release has a big problem with memory leaks. I have browsed on previous versions for hours and hours and not even a single crash but the latest 1.5 has been crashing way too often. There have been times when I have seen it using about 200MBs of RAM! This is insane considering that I only had four of five tabs open none of which had anything that would require any special memory considerations.

So I started looking around and found a page that demonstrated Firefox’s javascript leaks. Fire up task manager and then this page in firefox, then watch how the memory usages spikes up! Now, even if you close that tab the memory usuage will stay the same. Due to time constraints I haven’t looked into the reason but for now I am just going to downgrade to 1.0.7, the last version that seemed to be working fine.

Update: Ok, I think the reason Firefox has been crashing a lot on me is because lately I have been visiting newegg a lot and that seems to be another site which causes the leak. Ah, this is anonying. From reading online it seems like this has been happening since 1.05 or even earlier; I guess I just got lucky! Damn, as I am doing this post and a little browsing the memory usuage is again around 110MBs! I guess it’s time for me to seriously consider Opera, especially since now it’s actually free.