21 September 2009

Looking for a replacement for VMWare Server 1

I've been looking for a replacement for VMWare Server 1 for a while now. I'm having serious problem with time drifting in VMWare Server 1. I've previously tried VMWare Server 2 but it was really bad (for reasons I now have partially have forgotten). Oh, I remember that one problem was that not all of the virtual machines was compatible with VMWare Server 2. They just didn't start.

Some of my colleagues have tried Sun VirtualBox. I first though that this was a client-only virtual machine software. But after reading the user manual I have found a way to use it like VMWare Server. VirtualBox can be run on a server computer in a headless mode (read: only command line, no grapchics). For example:

> VBoxHeadless -s "Lennart test" -p 5000

This starts the already created virtual machine registered as "Lennart test" and listens for remote desktop connections on port 5000. Then I use my favorite remote desktop program to connect to the virtual machine (for example the build in Windows Remote Desktop Client).

Creating and managing virtual machines can be performed both with a GUI of command line. If you would like use a GUI and have a Linux server I recommend using some X software (for example the one included in  Cygwin).

I have not tried running graphics intense applications yet but my initial guess is that it will be a bit slower then the VMWare equalivance- VMWare Server Console. But I can be wrong...

18 September 2009

Windows Media Player and MMS (streaming) problems

Windows Media Player has some serious problems playing web radio via Microsoft Media Services (mms://). Sometimes it works and then suddenly "baaam" it doesn't. The problem is not with the server because it works with VLC.

I'm not the only one having problems, I know several other persons that has/had problems with it.

My current problem is with Windows Media Player 11. When opening a mms:// url in the external application the GUI freezes and the CPU gets high. When opening an url with embedded player (in Internet Explorer or Firefox) the player status is "Ready" and nothing happens when pressing the Play button:


I have tried various settings in Windows Media Player -> Tools -> Options -> Network. I have checked and unchecked the checkboxes but nothing works.

Update: I avoided the problem by installing WinAmp. Not only does the MMS streaming work very fast it is also possible to save play-lists with my favorite radio channels.

16 September 2009

JDK breakpoint problem fixed in update 16

As I previously posted I found a break point problem when running JDK 1.6 update 14. According to the release notes of JDK 1.6 update 16 this problem is now fixed. I'm happy that Sun fixed the break point problem and that is was so important so it got it's "own" update.

I have not yet tried the new JDK but I'm going to. I'm quite eager to try out the new Garbage First (G1) Garbage Collector that was introduced in update 14.

07 September 2009

Which license should I choose for an open source project

I was thinking on starting a (very, very, small) open source project. Just to get the hang of how it could work. I was thinking on hosting the project on Google Code. When creating a project there is a list of licenses to choose from. Even though Google Code has narrowed down the list it still is a list of 9 licenses:

So what to choose? Well this blog gave me some thoughts: http://google-opensource.blogspot.com/2008/05/standing-against-license-proliferation.html. It basically narrows downs the list to two: Apache License or GPLv3. And from there it is much easier to choose. As a software developer and not a lawyer I don't have the knowledge (or time!) to understand what the different licenses means. I'm going to have to trust someone else on this.

In my case I think the Apache License is probably the way to go. Since I'm working in a commercial company, I know that any of the GPLv3 and GPLv2 license is a big no-no. So if any company are going to use my software it must be the Apache License. And for me it is ok if another company makes profit on my code without giving back to the community.

06 September 2009

How to get faster interet connection when behind a Netgear router

I have a good internet connection that can devliver about 93 Mbit/s traffic when a computer is directly plugged into the wall. When sitting behind my Netgear WGT624 v3 router my Windows XP computer can get about 45 Mbit/s and my linux computer can get about 60 Mbit/s. I'm guessing the difference of because Linux has a better TCP/IP implementation.

When tring to find my DNS problem I tried some different settings on my router. One setting gave me a speed effect:
 
I disabled the SPI Firewall (the settings is found on the WAN Setup page). Now this is probably not so good from a sercurity perspective...
After this setting my Windows computer increased about 5-10 Mbit/s . There was no clear increase for my Linux computer.

Problem with DNS lookups on my home internet connection

I noticed that when I surfed from my home internet connection I got several timeouts and other problems when surfing. When using nslookup several times in a row (like 20) some of the queries was dropped. This is very frustrating. Here are my theories on what the problem might be:
  1. My ISP DNS
  2. My ISP special DNS-forward page for people who doesn't have an account. For every customer that does not have an account and plugs in a computer in the wall socket in my building a sign-up page is presented in the web browser.
  3. My own router
Number 1 is out of the question because I have also lost queries when using a OpenDNS server (208.67.222.222).

 My best guess so far is alternative number 2. It is a rather complicated feature requiring to catch all packets going to port 53 (I have lost DNS quires for both TCP and UDP). It could also be my router giving me the trouble. But I did not change anything in the router settings since when the problem started.

I have some problem error searching this. For that I need a computer outside my network that I has root access to so I can set up a server on port 53.

05 September 2009

I'm going to give Mercurial a go!

I watched an interesting video from Google IO 2009: http://code.google.com/events/io/sessions/DoYouBelieveUsers.html. They where talking in general on how to get a higher usability (addressed to an engineering audience (read: no Human Computer Interaction designers)). They had a graph where they placed different programs where the left of the graph where users with little experience and to the right users with extensive experience. I cut and pasted the Git vs. Mercurial comparison:
Their point was that (so fare) Mercurial is easier to use than Git.

In my opinion usability is everything! This means that I will give Mercurial a go and see if that fits my needs. If it doesn't I will perhaps give Git a go.

02 September 2009

The quest for a good version control software

One issue that has been bothering me for a couple of year now is version control software. I have experience (more than some hours) with 3: ClearCase, CVS and Subversion (SVN).

CVS
Good things
  • Fast
  • Wide spread (many knows how to use it and it has 3rd party tools (for example Eclipse plugin integrated in Eclipse)).
Bad things
  • Does not version directories. Probably that biggest design flaw.
Subversion
Good things
  • Version directories
  • Relatively wide spread.
Bad things
  • No native branches or tags. I mean what were they thinking? "Everything is a directory"? Is there someone that really likes and uses this so called "feature"? Everybody I know follows the de-facto standard "trunk", "tags", "branches".
  • Late double directed merge tracking (available only after 1.5). A bit too late I might say...
ClearCase
Good things
  • The mother of version control. Has it all. Did it all right.
  • Version tree and merge tracker. Two of the best tools a developer knows.
Bad things
  • Is so expensive that it is ridiculous. 44000 € excluding consumption tax. Can anybody afford it?
  • It has some learning curve to learn how the config spec works

My next version control software?
I first used clear case in 2004. It was some year old then so it has probably been working the way I'm used to a little bit longer. I really cannot understand how the open source world has not been able to create a better (or equally good) version control system in this time.


I have been thinking on which version control software I should use. I really don't know.  I'm leaning towards Git or Mercurial but I'm not sure. Here is my feature wish list
  • Tags and branches should exist natively and all the tools should have good support for them.
  • There should exist a good version tree that can display all the branches and the merges between the branches.
  • There should exist a merge tool so branches can easily be merged
  • It should be free (I don't care if it's open source, It should not cost me any money)
  • It should exist a plugin in Eclipse for it (and preferably in other IDE:s as well).
  • It should be wide spread so there is a high acceptance and support for it.
  • Focus on usability. Usability is so important! And developers has a tendency to forget that...

Open cmd prompt here plugin for Eclipse

A really nice thing in Microsoft Power toys is the Open Command Window Here (found at http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx). Vista has a similar feature built in when shift+right-clicking a folder.

When developing in Eclipse I have missed this feature. But with this plugin: http://code.google.com/p/tarlog-plugins/ it is possible! (Download the jar file and put it in Eclipse dropins-folder and restart Eclipse):
 
 

01 September 2009

Using LDAP as authentication in JAAS with Java

A simple example of how to use LDAP as an authentication back end in Java when using JAAS:
DefaultConfig {
 com.sun.security.auth.module.LdapLoginModule REQUIRED
     userProvider="ldap://myhost:myport/"
     authIdentity="uid={USERNAME},ou=users,ou=system"
     useSSL=true
     debug=true;
};

Change the myhost and myport. The above example assumes that the users exist in the LDAP tree in ou=system,ou=users with the uid set to the user name. I'm not sure on how the file would look like if the LDAP server is a Windows Active Directory (perhaps this will be a future blog entry).

More information on the LDAP JAAS module: http://java.sun.com/javase/6/docs/jre/api/security/jaas/spec/com/sun/security/auth/module/LdapLoginModule.html

How to make Java SSL trust a certificate

I used the LdapLoginModule via JAAS to authenticate a user. All worked fine when using plain text. But I wanted to use SSL to encrypt the trafic to my LDAP server but got this exception:
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

The problem is that my SSL certificate on my LDAP server is self signed and my client (the one running the LdapLoginModule) cannot trust it.

To solve this problem download the certificate (I used Firefox, but Internet Explorer could probably also be used).
  1. Surf to https://myserver:myport/
  2. Press "I understand the risks" (or something like that, I'm using a Swedish firefox)
  3. Press "Add an exception"
  4. Press "Get certificate"
  5. Press "Show"
  6. Press "Details"
  7. Press "Export"
  8. Save it to disc somewhere. For example "mysslcertificate.cer"
Use the keytool command supplied with the JDK:
keytool -import -file mysslcertificate.cer -keystore mykeystore

The certificate is stored in the keystore named mykeystore in the current directory (will be created if it does not exist).

When launching the java application set the following VM parameter: javax.net.ssl.trustStore. For example:
java -Djavax.net.ssl.trustStore=mykeystore MyJavaProgram

Note: The keytool command demand that a password is set for the keystore. But the password is not required to read the certificates in the keystore (probably because certificates are considered public).

The following blog post gave me the initial help of how to do this http://blogs.sun.com/andreas/entry/no_more_unable_to_find.