Feb 17, 2009

Convert images to greyscale

There are at least a hundred ways of doing this, but I wanted a single-line way to make greyscale versions of a bunch of images on a website I was developing. The last thing I wanted was to load each one in turn into a graphics application to edit the colors.

ImageMagick to the rescue:
for img in *.gif ; do convert $img -colorspace Gray -colors 16 grey_$img ; done

Ok - so not really one line, but almost :-)

And this is what it looks like afterwards in my file explorer:

Sep 3, 2008

Install or upgrade to ubuntu 8.04 on linux with no media

I had a problem, my ubuntu server was too old for automatic updates, and the CD-ROM drive was broken and I'm allergic to floppies. A quick internet search lead to three options:
  • instlux, a nice graphical installer to run under windows
  • UNetbootin, a really nice graphical installer for linux and windows
  • A grub trick for booting the installer from grub under windows described in detail for any linux, and in less detail but for ubuntu.
The first option was no good, because it only ran on windows. The second looked really neat and easy, and is probably the best, but being the geek that I am, I wanted to try the ideas in the third option, but 'translated' to work on my old linux (in my case ubuntu 5.04). It turned out to be pretty easy. Here are the steps I used:
  • I opened my downloaded ubuntu 8.04.1 server ISO image in archive manager and extracted the 'install' directory to /boot/install on my old computer. I did this with another 8.04 desktop, but could just as easily done it with the old computer itself.
  • I edited /boot/grub/menu.lst, adding the following lines at the bottom:
    title           Ubuntu 8.04.1 Installer (hd0,0)
    kernel (hd0,0)/boot/install/netboot/ubuntu-installer/i386/linux vga=normal ramdisk_size=14972 root=/dev/rd/0 rw --
    initrd (hd0,0)/boot/install/netboot/ubuntu-installer/i386/initrd.gz
    (I actually first tried the vmlinuz and initrd.gz I found in the installer directory, but that insisted on a CD, and I did not want to try faking that with a raw partition, so I changed to the netboot option in the text above.)
  • I also commented out 'hiddenmenu' and added 'timeout 10' to menu.lst so that I would actually get to see the menu choice when I rebooted.
  • Finally I rebooted and choose the new installer, and, after answering a bunch of question, viola, I had a new Ubuntu 8.04.1 server!
These instructions assume a decently fast internet access, since everything installed is downloaded. If you have the CD already (as I had), and no internet, or slow internet, you can also copy the CD to a local hard-drive partition and install from there. That was too much trouble for me, so I did not try it :-)

Jul 13, 2008

Linux / open source OCR batch processing from PDF

I recently needed to run OCR on a PDF of scanned pages, and found no direct way to do it in Linux, but did find a suitable combination of tools that when scripted together did the job quite nicely. Firstly the job needs to be broken down into two steps:
  1. Extract individual pages from PDF. None of the open source OCR software I read about or tried could run directly on PDF. The easiest way to extract from PDF is to run ghostscript and print to TIFF or PNM, for example:
    gs -r300x300 -sDEVICE=tiffgray -sOutputFile=ocr_%02d.tif -dBATCH -dNOPAUSE inputfile.pdf
  2. Run OCR on individual pages. I tried ocrad and tesseract (versions 1.02 and 2.03). Ocrad supported the Swedish characters I had in my documents but otherwise had rather poor overall OCR performance. Tesseract did not support Swedish characters, but both versions were better than Ocrad, and version 2 was overall the best (and supports many other languages if you bother to train it). Training it on Swedish was more work than manually fixing the results, so I did not take that step, but was certainly tempted.
Since I had several PDF documents to process, and each had many pages, the above process was still too manual, so I wrote a utility Ruby script to do the work for me:
#!/usr/bin/env ruby

(ARGV.length>0) || puts("usage: ./ocr.rb file1.pdf <file2.pdf> ...") || exit(0)
$basedir=Dir.getwd
ARGV.grep(/\.pdf/i).each do |pdf|
      dir = pdf.gsub(/\.pdf/,'')
      dir += '_OCR'
      dir += '.dir' if(dir == pdf)
      Dir.mkdir(dir) unless(File.exist?(dir))
      Dir.chdir(dir)
      puts "Extracting pages from PDF: #{pdf}"
      system "gs -r300x300 -sDEVICE=tiffgray -sOutputFile=ocr_%02d.tif -dBATCH -dNOPAUSE \"#{$basedir}/#{pdf}\""
      tiff_pages = Dir.new('.').grep(/^ocr.*\.tif$/).sort
      puts "Running tesseract OCR on pages: #{tiff_pages.join(', ')}"
      tiff_pages.each do |page|
              page_base = page.gsub(/\.tif.*/,'')
              print "#{page_base} "
              system "/usr/local/bin/tesseract #{page} #{page_base}"
      end
      Dir.chdir($basedir)
      ocr_pages = Dir.new(dir).grep(/^ocr.*\.txt$/).sort
      if ocr_pages && ocr_pages.length>0
              puts "Created OCR result pages: #{ocr_pages.join(', ')}"
              archive = "#{dir}.zip"
              puts "Creating archive of result pages: #{archive}"
              system "zip -r \"#{archive}\" #{ocr_pages.map{|p| "\"#{dir}/#{p}\""}.join(' ')}"
      else
              puts "No OCR result pages found"
      end
      puts ""
end

This script will extract the images to TIFF, run the Tesseract OCR on each page and finally build a ZIP file of the result with a filename similar to the original PDF. So MyDoc.PDF is converted to MyDoc_OCR.ZIP. Intermediate TIFF and TXT files are maintained in a subdirectory (MyDoc/*).

If, on the other hand, I simply did not look far enough and there are better utilities and GUI applications for this on Linux, feel free to comment.

Apr 11, 2008

Bongi's voice - and the size of the Kruger Park

My brothers blog 'other-things-amanzi', which is hugely more popular than mine, for obvious reasons if you read it, just got a boost as he was invited to be interviewed on BlogTalkRadio.com. Sid Schwab of surgeonsblog fame was a guest host, which worked well as he and 'bongi' got chatting about everything from the pleasures of living near the Kruger National Park, to regional issues facing surgeons, like the bad treatment sometimes delivered by the local witchdoctors or 'sangomas'.

Sid even mentioned my blog, but I'm guessing the ultra-geek content stopped him in his tracks :-). Of my blog, Bongi said: 'I don't understand a single word of it!' Perhaps this post will score better?

One thing Bongi said that I fear is some misinformation I might be responsible for, was that the Kruger Park is the size of England. I used to claim that myself, but recently decided to double check my facts and found I was WRONG! A quick google search reveals several sites claiming it is the size of Wales, and one claiming it is bigger than Ireland:
(Size: The Kruger Park is huge. It stretches for 350km (217 miles) from north to south and averages 60 kilometres in width which makes it bigger than Ireland. Most of the park is fenced so it is a self contained ecosystem.)

So, I stand corrected. So I decided to investigate and figure out what is really going on. How does the park compare to England, Ireland and Wales? Right now these are the facts I could find:
Kruger Park:
Area: 18 989 km2
Length: 350 km
England:
Area: 130 395 km2
Length: 580 km
Wales:
Area: 20 79 km2
Length: 215 km
Irland:
Area: 84 412 km2
Length: 360 km
Skåne:
Area: 10 939 km2
Length: 115 km
Great Limpopo Transfrontier Park:
Area: 35 000 km2 - 99 800 km2 (planned expansion)
(England, Ireland, Wales lengths were roughly north-south measured by me on google earth 'ruler'. Kruger length is from wikipedia.)

So England is about 7 times the area, and about 65% longer. So the Kruger is comparable in terms of length (60% the length of England), but not by area, since the Park is so narrow. The website that claimed the park was bigger than Ireland is wrong. It's a bit shorter, and less than a quarter the area. It is, however 60% longer than Wales and nearly the same area, so that is the best match. If the full-size transfrontier park materializes, it will close in on the size of England, which is really impressive.

It is especially interesting to me that the Kruger Park is nearly twice the length and over three times the area of Skåne, the province in Sweden in which I live.

Apr 4, 2008

Hardy Heron Beta (and release)

I've had a generally good time with the Ubuntu 8.04 Hardy Heron Beta since it was released in late March, and have installed it on two different machines. I especially enjoyed getting compiz to work for the first time (possibly due to a new machine with better hardware, not something related to Hardy in particular). However, I have had three issues I thought worth mentioning here:
  1. admin-users does not work
    I reported this as a bug to ubuntu. Basically the problem is that no groups or users added with gnomes user administration tool actually get added, and in one case the tool crashed. I've had to add users and groups on the command line with tools like 'addgroup' and 'adduser'.
  2. eclipse crashes silently
    This happened several times before I thought to run it in the console and catch the error, which turned out to be 'java.lang.OutOfMemoryError: PermGen space'. Normally eclipse reports this to the user in a dialog, and I do not know why that was not done, but the solution is the same, add '-vmargs -Xmx1280m -XX:MaxPermSize=1024m' or similar to the eclipse launcher. I noticed the error first happen after switching from the Ruby to the Java perspective, and the virtual memory requirements of eclipse jumped from 0.5GB to 1.2GB. Amazing. (update: the symptoms returned on a new java6 update, and the new fix was to add -XX:CompileCommand=exclude,org/eclipse/core/internal/dtree/DataTreeNode,forwardDeltaWith to vmargs - see comments below for more details)
  3. unable to set HumanList theme for login window
    Once a change to the login window settings were made, logging out waited indefinitely (or in one case just about 30 minutes), before showing the login screen. No errors in the X log or any other log. Nasty. I had to kill gdm and hand edit gdm.conf-custom to remove the theme line.
  4. sudo fails with: unable to resolve host
    I found a lot of discussion about this on the internet, but in most cases it was due to people foolishly changing their hosts files. While sudo should not be sensitive to something like that, it was not my situation. I simply ran the usual daily upgrade with the list of updates for Hardy, and after the reboot this issue happened. With a lot of investigation I found how to 'fix' it, by getting /etc/hosts and /etc/hostname to have the same entry. Interestingly enough they do not have the same entry if you enter the 'obvious' values in the network manager applet for host and domain. For example, putting 'foo' and 'bar.com' as host and domain will put 'foo' into /etc/hostname and 'foo.bar.com' on the 127.0.1.1 line in /etc/hosts. My sudo continued to work for a week before my reboot because my DNS settings, and my 'search' list in particular allowed 'foo' to be resolved even without the 'bar.com', but after the reboot it failed due to the additional issue below:
  5. static eth0 failed on reboot
    Strangely enough eth0 appeared on the ifconfig output, but with no IP address, while my network configuration in the network applet, as well as in /etc/network/interfaces, looked just fine. I needed to add 'auto eth0' to the config file to get it to work correctly. I vaguely remember seeing this before on much older ubuntu versions, but have not seen it for a while, so it was quite a surprise. This issue caused the sudo issue above to appear suddenly after a reboot.
The sudo and eth0 issue was tricky to deal with because a non-working sudo means you cannot access and/or edit the files you need to to get things working. I found reports of people rebooting to single user or recovery mode, and other booting the live CD to access the hard drive, both of which seem like an over-sized hammer for this small nail. One mentioned using 'aptitude' and the the menu to switch to root, but from there I could not get a shell from there. One mentioned using gksudo to run xterm as root, and that should work. I tried to used the network admin tool to fiddle settings until I got the hosts and hostname files to match. This was not easy because that tool did not allow simple hostnames (no domains) in the hosts file.

Mar 10, 2008

Rails authentication: restful_authentication and acts_as_state_machine

I have written a couple of rails apps with user authentication, but finally decided to start using some of the excellent plugins available for this. After a quick search I got the impression that restful_authentication was the current standard for rails (I'm using rails 2.0.2 at the moment), and especially with the link to the state machine plugin. However, my initial quick search did not yield a decent quick 'howto' for fast-tracking getting this all working. So I started writing notes on my findings here in my blog:
  1. Create your rails application:
    rails -d mysql myapp
    cd myapp
    rake db:create # you might need to edit config/database.yml first to match your db installation
  2. Install the two plugins required:
    script/plugin install http://elitists.textdriven.com/svn/plugins/acts_as_state_machine/trunk
    # I needed to use trunk, as other versions have a missing const RailsStudio error
    script/plugin source http://svn.techno-weenie.net/projects/plugins
    script/plugin install restful_authentication
    # obviously these last two lines can be combined

  3. Create the users model and controllers:
    script/generate authenticated user sessions --include-activation --stateful
    # This will create the users model and the users and sessions controllers.

    It also adds map.resource entries for these in the routes.rb file. 'include-activation' is for email activation and 'stateful' is the tie to the state machine (for easily managing user activation and login status)

  4. Edit the routes.rb file to specify the user states and add some useful routes:
    map.resources :users, :member => {
    :suspend => :put,
    :unsuspend => :put,
    :purge => :delete
    }
    map.resource :session
    map.activate '/activate/:activation_code', :controller => 'users', :action => 'activate'
    map.signup '/signup', :controller => 'users', :action => 'new'
    map.login '/login', :controller => 'sessions', :action => 'new'
    map.logout '/logout', :controller => 'sessions', :action => 'destroy'
    map.forgot_password '/forgot_password', :controller => 'users', :action => 'forgot_password'
    map.reset_password '/reset_password/:code', :controller => 'users', :action => 'reset_password'
    map.account '/account', :controller => 'users', :action => 'account'
  5. Edit the environment.rb file to include the line:
    config.active_record.observers = :user_observer
    This allows for activation emails to be sent.
  6. Edit the migration, in this case db/migrate/001_create_users.rb, and add lines for the 'forgot password' feature and the option to have administrator users:
    t.column :password_reset_code,       :string, :limit => 40
    t.column :is_admin, :boolean, :default => false
  7. Update the database:
    rake db:migrate
  8. Remove the following line from sessions_controller and users_controller and add it to application_controller to enable authentication application wide:
    include AuthenticatedSystem
  9. Remove or comment out these two lines from the UsersController.create method:
    self.current_user = @user
    redirect_back_or_default('/')
    This allows us to add further processing of the user registration request, by adding a create.html.erb view and email activation.
  10. Add the view/users/create.html.erb file with content similar to:
    <fieldset>
    <legend>New account</legend>
    <p>Instructions for activating your account
    have been sent to <%=h @user.email %>
    If this address is incorrect, please
    <%= link_to 'signup', signup_path %>
    again. If you do not receive the email
    soon, please check your spam filter.</p>
    </fieldset>
  11. Add the following helper methods to application_helper.rb:
    def user_logged_in?
    session[:user_id]
    end
    def user_is_admin?
    session[:user_id] && (user = User.find(session[:user_id])) && user.is_admin
    end
  12. Add a 'forgot password?' link to the views/sessions/new.html.erb form (usually near the 'submit tag'):
    <%= link_to 'Forgot password?', forgot_password_url %>
  13. Add links to login/out and signup to your main page or layout. For example, I used a fixed position div like this:
    <div style="position: absolute; right: 0px; top: 0px; height: 20px;">
    <% if user_logged_in? %>
    <%= link_to 'Logout', logout_url %>
    <% else %>
    <%= link_to 'Signup', signup_url %>
    | <%= link_to 'Login', login_url %>
    <% end %>
  14. Support admin restrictions with the following method in the application controller:
    protected
    # Protect controllers with code like:
    # before_filter :admin_required, :only => [:suspend, :unsuspend, :destroy, :purge]
    def admin_required
    current_user.respond_to?('is_admin') && current_user.send('is_admin')
    end
  15. If you want admin control, add a before filter to the users_controller to restrict key actions to admin users only:
    before_filter :admin_required, :only => [:suspend, :unsuspend, :destroy, :purge]
  16. Add actions in users_controller.rb for account, change_password, forgot_password and reset_password:

    def account
    if logged_in?
    @user = current_user
    else
    flash[:alert] = 'You are not logged in - please login first'
    render :controller => 'session', :action => 'new'
    end
    end

    # action to perform when the user wants to change their password
    def change_password
    return unless request.post?
    if User.authenticate(current_user.login, params[:old_password])
    # if (params[:password] == params[:password_confirmation])
    current_user.password_confirmation = params[:password_confirmation]
    current_user.password = params[:password]
    if current_user.save
    flash[:notice] = "Password updated successfully"
    redirect_to account_url
    else
    flash[:alert] = "Password not changed"
    end
    # else
    # flash[:alert] = "New password mismatch"
    # @old_password = params[:old_password]
    # end
    else
    flash[:alert] = "Old password incorrect"
    end
    end

    # action to perform when the users clicks forgot_password
    def forgot_password
    return unless request.post?
    if @user = User.find_by_email(params[:user][:email])
    @user.forgot_password
    @user.save
    redirect_back_or_default('/')
    flash[:notice] = "A password reset link has been sent to your email address: #{params[:user][:email]}"
    else
    flash[:alert] = "Could not find a user with that email address: #{params[:user][:email]}"
    end
    end

    # action to perform when the user resets the password
    def reset_password
    @user = User.find_by_password_reset_code(params[:code])
    return if @user unless params[:user]

    if ((params[:user][:password] && params[:user][:password_confirmation]))
    self.current_user = @user # for the next two lines to work
    current_user.password_confirmation = params[:user][:password_confirmation]
    current_user.password = params[:user][:password]
    @user.reset_password
    flash[:notice] = current_user.save ? "Password reset successfully" : "Unable to reset password"
    redirect_back_or_default('/')
    else
    flash[:alert] = "Password mismatch"
    end
    end

  17. Create html.erb forms in views/users for the change_password, forgot_password and reset_password actions.
  18. Edit models/user_mailer.rb and replace YOURSITE and ADMINEMAIL with values appropriate for the new website. A good way of doing this is to define the variable SITE in the config/environments/*.rb files and then use that in the strings in the UserMailer with the "#{SITE}" format. Also add methods for forgot_password and reset_password (ie. send mails when those actions are invoked):
    class UserMailer < ActionMailer::Base
    def signup_notification(user)
    setup_email(user,'Please activate your new account')
    @body[:url] = "#{SITE}/activate/#{user.activation_code}"
    end

    def activation(user)
    setup_email(user,'Your account has been activated!')
    @body[:url] = "#{SITE}/"
    end

    def forgot_password(user)
    setup_email(user,'You have requested to change your password')
    @body[:url] = "#{SITE}/reset_password/#{user.password_reset_code}"
    end

    def reset_password(user)
    setup_email(user,'Your password has been reset.')
    end

    protected

    def setup_email(user,subj=nil)
    recipients "#{user.email}"
    from %{"Your Admin" <bounce@yourdomain.com>}
    subject "[#{SITE}] #{subj}"
    sent_on Time.now
    body :user => user
    end
    end
  19. Add forgot_password.html.erb and reset_password.html.erb to the user_mailer view.
  20. Add methods to models/user.rb: forgot_password, reset_password, recently_forgot_password, recently_reset_password and recently_activated. Also add protected method make_password_reset_code.
      def forgot_password
    @forgotten_password = true
    self.make_password_reset_code
    end

    def reset_password
    # First update the password_reset_code before setting the
    # reset_password flag to avoid duplicate mail notifications.
    update_attributes(:password_reset_code => nil)
    @reset_password = nil
    end

    # Used in user_observer
    def recently_forgot_password?
    @forgotten_password
    end

    # Used in user_observer
    def recently_reset_password?
    @reset_password
    end

    # Used in user_observer
    def recently_activated?
    @activated
    end

    protected
    def make_password_reset_code
    self.password_reset_code = Digest::SHA1.hexdigest( Time.now.to_s.split(//).sort_by {rand}.join )
    end

  21. Modify UserObserver.after_save(user) to send activation only based on user.recently_activated? Also add to this method mail sending for forgot_password and reset_password events:
      def after_save(user)
    UserMailer.deliver_activation(user) if user.recently_activated?
    UserMailer.deliver_forgot_password(user) if user.recently_forgot_password?
    UserMailer.deliver_reset_password(user) if user.recently_reset_password?
    end
  22. Make sure your mail subsystem is properly prepared to send mail. I installed postfix on my development and deployment machines (both ubuntu, so I used 'apt-get install postfix'). It is a good idea to test this with a command-line mail like:
    sendmail -f admin@mydomain.com me@myaddress.com
    Subject: test


    Hello, world!
    .
  23. Add appropriate administrative links. In my case I created an 'account' route to a new account action and view in the users controller, and in this displayed current user settings and provided a link to the 'change_password' action. Since this is very similar to many of the actions above, it is left as an exercise to the reader :-)
  24. Test everything, sign up a user, login, logout, click 'forgot password', respond to all emails sent, change the password, etc.
  25. What's next? Well, in my case I continued by adding a boolean 'is_admin' flag to the users table and then adding extra capability to my site for admin users. I also created a cool layout and used it for all controllers in my site. This is rails after all, the sky is the limit :-)

Mar 7, 2008

Even Microsoft is getting cool

When you think of 'cool' modern companies, names like 'yahoo' and 'google' spring to mind. For many 'apple' is also synonymous with cool. But Microsoft generally never gets that classification. 'Serious', 'business focused', even 'ruthless'. But take a look at the photo gallery of research projects from Microsoft's seventh annual techFest. Now that is cool!

Feb 19, 2008

IT back to business

A recent ComputerWorld article describes a 'new trend' in IT towards having business savy 'IT' people working within business departments instead of centralized generic IT personnel. I think this is a trend that started a while ago with pragmatic companies focusing on operational efficiency. Unfortunately not all companies are pragmatic, but hopefully more start to follow this trend.

I had a gripe with the way IT was moving in two previous companies I worked for. In the first, the IT department was standardized across the very large international organization, and focused on the common low-tech user, which was completely unsuitable for our high-tech development site, dramatically restricting our efficiency. We had to do our own internal 'skunk-works' IT, and hide the costs, in order to operate efficiently. My worst case horror story was the time it took 6 months and 5 engineers in 4 countries to install a local printer! (previously we had one local IT tech who would do it in a couple of hours).

The second company was a start-up which meant it had good pragmatic IT for a while, but as it grew, the new management tried to increase operational efficiency by 'centralizing' and 'standardizing' IT. Sounds good on paper, but simply does not work in reality. Costs increased and performance decreased due to the separation of IT from the people actually doing the business. People working towards true operational efficiency were marginalized and often left the company. By the time I left it was well on the way to the level of operational inefficiency of the large multi-national I worked with before.

Over the years I've developed a very strong feeling that IT must be integrated into the business. I'm thrilled to see a prominent article claiming this as an industry trend! So I end this blog with a nice quote:

"I want them to think of themselves as people who work for this company, not people who work for this company's IT department," he says. "We have an energy supply business to manage. That's our business, and we want to do it as efficiently as possible. It doesn't really matter what the IT job is."

Jan 23, 2008

Jazz, software development and the Sun/MySQL deal

Jazz - I kept hearing that word over and over the last couple of weeks, culminating in me finally joining YouTube and putting together a play list of jazz music videos. However, it all started with software development:
  • First IBM announced the partial open sourcing of their jazz.net service. This was interestingly relevant to my current search for on-line software project hosting services. The jazz.net site says: 'Developing software in a team is much like playing an instrument in a band. Both require a balance of collaboration and virtuosity. Jazz defines a vision for the way products can integrate to support this kind of collaborative work, and a technology platform to deliver on this vision.' Sounds great, but I'm not sure it is mature enough to replace my current top contender: launchpad.net. However, considering the great job IBM did with eclipse, I'm certainly going to keep an eye on this new offering.
  • Then I read an article about the new trend in developer recruitment, calling top candidates 'rock star coders'. This trend was countered by some well written blogs asserting that it is better to be a 'jazz musician programmer':
    • 'I would rather be a jazz programmer' does a lovely comparison of rock stars and jazz musicians w.r.t. programming, emphasising creativity. I tried to paraphrase the key points here, but I think it just has to be read, so go take a look.
    • 'I'd rather be a DJ than a rock star developer' likes the jazz programmer idea, but prefers to be a DJ, emphasising code reuse and web-mashups.
    • 'Monks versus music' says that agile development teams are a lot like 'jazz bands'. This blog got me onto the YouTube jazz search, starting with Count Bassie and culminating with Nora Jones! In many videos artists joined forces to create a blend of music. I really like Nora Jones singing with Ray Charles, what a combo!
  • Sun's acquisition of MySQL - OK, no jazz mentioned there, but with jazz on my mind I saw a fit. It is yet another interesting merger of talents, the mature Sun trying their hand at the new world of open source, partnering with the younger, hipper MySQL with a very solid open source presence. It reminded me so much of the YouTube video of Ray Charles being introduced by Johnny Cash and then singing Johnny's song 'Ring of Fire' with a strong jazz slant. Let's see if MySQL will jazz up Sun's product offerings, or will Sun dull down MySQL? (considering Sun's recent moves towards open source, with Java and Solaris, I'm betting on the former, which is great).

Nov 2, 2007

Quick Ruby on Rails on Ubuntu 7.10 (and 8.04 and 9.04)

There are many howto's on this subject out there, but since I ended up blending a few of them to get exactly the environment I wanted setup (and took notes so I could repeat this), I thought I'd blog it for future reference, and hopefully this info is useful to others.

So, what exactly do I want: a development and deployment machine with the following specifications:
  • A recent Ubuntu Linux, in this case 7.10 (Gutsy Gibbon) [update: I also installed on 8.04, hardy heron beta, with good success]
    [update2: I have now installed on 9.04, with a few changes]
  • Web-App server comprised of apache2, mongrel, ruby on rails, mysql5
  • Development environment comprised of Aptana RadRails (based on eclipse), for both Java and Ruby on Rails development (I use Java for other projects, but also plan to do some JRuby work), and since eclipse rocks, I use it for everything I can, even rails. If you don't want java development, you can use the pure Aptana IDE, but then you also loose out on CVS support).
  • Some additional libraries for graphics and charting support in the rails apps.
The quickest setup procedure that worked for me, on four very different computers, a Dell Precision 380 desktop, an Acer Aspire 3100 laptop and most recently a Packard Bell quad core workstation and Acer Aspire 7530G, was:
  1. Install ubuntu. I simply did a standard install from the live cd (downloaded from www.ubuntu.com)
  2. Update all packages. I usually just click the update icon on the top right of the screen, but you can use synaptic ('mark all updates' and then 'apply'), or apt-get with the following commands:
    • sudo apt-get update
    • sudo apt-get upgrade
  3. Install packages required for this setup. I used synaptic, but you could just as easily use 'sudo apt-get install ...':
    • sun-java6-jdk / openjdk-6-jdk (includes a number of other required packages)
    • sun-java6-source / openjdk-6-source (optional)
    • joe (just my preferred old text editor, you choose what you like)
    • flashplugin-nonfree (since I will need that for some sites I view/develop)
    • ruby-full (bundles a bunch of ruby packages, including irb, rdoc and ri, but not rake and rubygems, see later for those - do not install them as ubuntu packages now)
    • apache2 (provides version 2.2)
    • mysql-server (provides version 5.0)
    • libsqlite3-dev (required for the gem install of sqlite3-ruby, if you need that)
    • build-essential (provides a c/c++ development environment required by some ruby gems which build on install)
    • libmysqlclient15-dev (required by the mysql ruby library)
    • eclipse (for 3.2 support in ubuntu 7.10 and 8.04) - to get eclipse 3.3 or 3.4 you need to download it from www.eclipse.org.
    • On recent versions of Ubuntu (like 9.04) you also need to install xulrunner as described at this link. This is to get around a library issue between SWT (in eclipse) and Firefox3.0.
  4. Install rubygems from source. This is a contested point, as ubuntu provides rubygems as a package also, but since it is a package management facility itself, it can conflict with the debian package management provided by ubuntu, so it is easiest to keep it completely separate:
    • wget http://rubyforge.org/frs/download.php/57643/rubygems-1.3.4.tgz
    • tar xzvf rubygems-1.3.4.tgz
    • cd rubygems-1.3.4
    • sudo ruby setup.rb
    • sudo ln -s /usr/bin/gem1.8 /usr/bin/gem # This was not required for rubygems 0.9.4, but is required now on ubuntu with rubygems 1.0.1 and above
    • sudo gem update --system # With 0.9.4 I needed to repeat this as the first time gave an error, but with 1.0.1 and 1.3.4 it worked first time
  5. Use rubygems to install rails and some other useful gems using the command 'sudo gem install X' where X is any number of the following (I did all):
    • rails # this includes dependencies like rake
    • mongrel # for the deployment server
    • mongrel_cluster # if you want to try out clustering
    • capistrano # if you want to do the easy deployment as described in the 'agile' book
    • mysql # for mysql database access from ruby
    • termios # well, this was mentioned in several blogs and the agile book, so I just did it :-)
    • sqlite3-ruby (sqlite3 is now the default database in rails2, so you might need this)
  6. Add the Aptana Radrails plugins to the eclipse IDE:
    • Start eclipse from the applications menu
    • Go to menu 'Help->Software Updates->Find and Install'
    • Select 'Search for new features to install' and click 'Next'
    • Click 'New Remote Site'
    • Enter name as 'Apatana' and URL 'http://update.aptana.com/install/3.2' and click OK
    • Click 'New Remote Site' again
    • Enter name as 'Apatana Radrails' and URL 'http://update.aptana.com/install/rails/3.2' and click OK
    • Click 'finish' to start the search for updates
    • Once the search is complete, you should check both 'aptana' and 'aptana radrails' and click 'next' to install
    • Accept the license agreement and click 'next' and then 'finish' to start the actual download
    • When prompted click 'install all' to finish the install
    • Restart eclipse
  7. Modify Eclipse to use Java6 (based on http://help.ubuntu.com/community/EclipseIDE). For Ubuntu 8.04 and 9.04, this was not necessary, but I did it for Ubuntu 7.10 and earlier.
    • edit /etc/eclipse/java_home and move java6 up in the list so that eclipse uses java6 for running itself (which is faster)
    • To get projects inside eclipse to use java6, open eclipse and go to the menu 'Window->Preferences->Java->JREs' and select the Java6 JRE.
  8. Add some extra libraries to rails (optional, depends on your apps):
    • I wanted ImageMagick for photo uploads and resizing in my rails apps, so I installed the ubuntu package for ImageMagick using synaptic, and then installed the rubygem 'mini-magick'. I had tried 'RMagick', but the gem did not install, and online help indicates that you need to re-install ImageMagick from source to get RMagick to work, so I opted for the simpler mini-magick.
    • For charting support in my web apps, the popular approach of using 'gruff' wrapping ImageMagick seemed to generate a lot of help requests, so I went for the lighter approach of using client side flash as described in the following blog.
    • For nicer color control, I installed pdf-writer to get the color-tools gem (and in case I needed pdf-writer itself for future development).
  9. Once you have created a rails app, using the usual 'rails myapp', you should consider adding a number of cool rails plugins. There are a huge number out there. Currently I'm using attachment_fu, will_paginate, acts_as_state_machine, restful_authentication and ext_scaffold. See some of my more recent blogs for some more info on these.
  10. Miscellaneous. I also changed my ubuntu font sizes down to 9pt on 'system->preferences->appearance' to get a bit more screen real-estate on the laptop. Windows uses smaller fonts so it looks better (to me), especially when developing in an IDE like eclipse where it is nice to have many panels open together. And for some reason the Ubuntu install had visual effects disabled (Composite extension not available), so I needed to edit /etc/X11/xorg.conf and change the "0" to a "1" on the Composite line near the end of the file. And I changed the theme to 'glossy' but with 'human' icons and darker colors. Looks cool now!
Well, quiet a few steps, but most of the time the computer is downloading packages, updates, plugins and gems from the internet, so you can just lounge around with a good latte :-)



And of course the required screenshot, this one is of the Acer laptop with firefox showing this page and eclipse with a Ruby on Rails application in production (ubuntu 7.10).

Next steps - there are lots of blogs out there on setting up production deployments for rails, and here's one I just read: http://www.urbanpuddle.com/articles/2008/01/09/install-ruby-on-rails-on-ubutu-gutsy-gibbon-apache-version

Jun 1, 2007

VMWare & Dual-Boot Ubuntu Feisty and Windows XP

A long title I know, but I had to do some serious google searches to get this to work, and it was thanks to other long titles that I found the info I needed. So let me start with the references:
  1. VMWare's document: Configuring a Dual-Boot Computer for Use with a Virtual Machine - good background info covering many (but not all) issues.
  2. Running VMWare on a Physical Partition by Scott Bronson is a really good howto-style article with most of the details you need to do the job step-by-step.
  3. How to install Vmware server From Canonical commercial repository in Ubuntu Feisty - that got me onto the easy install route
  4. HOWTO Configure a dual boot windows linux to be able to open each os in vmware - gentoo based article, but had an interesting suggestion for windows IDE drivers.
So, as the first vmware document says, this is not necessarily a very easy thing to do, getting the same OS installation to boot on both the real physical machine and the virtual machine. Most issues relate to the different drivers and configurations required, or to the multitude of boot problems. However, the documents above, and the second one in particular, covered most of what I needed. So if you have a similar setup to me, you should be able to get this working OK by following that second article, with a few small changes suggested below.

So why did I bother to write this article? Well, not one of the above articles was enough to cover my setup, and I did not find any real help (hints, but not explicit help) for some of the problems I had:
  • My SATA drives are seen by Ubuntu as SCSI drives, but by Windows as IDE drives, preventing windows from even booting in VMWare without installing the vmscsi drivers *before* booting windows!
  • Any change I made to the Ubuntu network configuration after setting up vmware completely broke the vmware installation (and made gnome runs super-slow). This seems to be a edgy-feisty problem, and a google search found the solution (add the hostname to 127.0.0.1 in /etc/hosts - simple!)
So, let me outline the basic approach I took to get windows running inside ubuntu. The reverse is possible, and covered in the above articles, but I focused on this approach only.

My setup:
  • Dell Precision 370 with SATA drives, 2GB RAM, Dell 20" flatscreen (1600x1200)
  • Windows XP installed on C: (/dev/sda1)
  • Ubuntu Feisty (7.04) installed on /dev/sda3
Installation procedure:
  • Install the OS's (I think it is best to install windows first, making the C: partition 50% of the space and leaving the rest for Ubuntu, but other routes usually work too).
  • Make sure dual boot works, disable the timeout in grub so you are always forced to choose the OS (for now) - see article 2 above.
  • Under linux:
    • Prepare the disk as in article 2 (see article 1 for more info)
    • Install vmware-server from the canonical commercial - see article 4 above, or just use: deb http://archive.canonical.com/ubuntu feisty-commercial main
    • Make a floppy with the windows SCSI drivers from VMWare (either write a floppy with dd, or mount the image and copy the files to the windows partition)
  • Under windows
    • Prepare windows as in article 2 above (again article 1 has more info)
      • Make sure you make the two hardware profiles, and reboot to the new virtual profile for any driver changes.
      • Also install the vmscsi drivers by running the 'add hardware' wizard of the control panel, and clicking 'no I have not connected the hardware yet' to get windows to allow you to install the scsi drivers even through it cannot see any scsi hardware.
      • Consider changing the IDE drive as in article 4, although I'm not sure that was really required
  • Back in Ubuntu create the virtual machine according to article 2 (and reference article 3 for Ubuntu specifics if you need).
    • I recommend choosing the entire disk, not the partitions, as this seems to help a lot with windows/linux/vmware different views of the partition table.
  • Start the virtual machine as in article 2 and install VMWare tools (which will re-install the scsi drivers, but we needed to do that before this just to get it to boot in the first place).
  • Prepare the GRUB bootdisk for user-free reboots according to article 2. This is great because you can (mostly), not worry about rebooting to the wrong OS, or having the same OS running on both the hardware and the vmware at the same time (which would be disastrous). There are no solution to having to choose the windows hardware profile, but if you are like me and normally run windows inside linux, then having the virtual profile first, with a timeout, is great because even if you do boot the virtual profile on the real hardware by mistake and mess it up, it is much less serious than messing up the physical machine profile, and you can simply re-create the virtual profile by repeating some of the steps above.
Finally, more info on the two problems I had:
  • The need to install the vmscsi drivers in the windows virtual profile, but with windows booted onto the physical machine, is covered in the discussion above.
  • The issue with slow-gnome and broken vmware-server is really strange and I do not know the inner reason, but adding the line '127.0.0.1 localhost hostname' to /etc/hosts (with 'hostname' changed to your host), magically solves it. I wonder if the problem is related to the mysterious '127.0.1.1' line in the hosts file?
And, last of all, here is the obligatory screenshot showing the ubuntu desktop, with gimp and a gnome game running above the VMWare server console with Windows XP running eclipse showing a Ruby on Rail application with InstantRails windows as well. I know it's weird to be doing ruby and rails development in Windows, but I just happened to get started there, and I like the fact that eclipse on XP has nice compact fonts by default.

May 4, 2007

Amanzi Snippets

Recently I've begun giving a weekly series of ultra-short tech talks to the other developers in our office. The original problem we had was that, while we were all interested in learning about, or hearing about, technologies outside our working domain, it was generally not possible to spent office working hours on projects not directly of benefit to the company. The solution has been to give 15 minute talks during normal coffee-breaks. One really positive aspect of this is that it forced me to focus on a single specific 'hot' topic, and thereby blocking my usual tendency to lecture on for hours. While the resulting tech-talks are not comprehensive, they were easily digestible. Anyway you can always go to the books referenced below if you want something comprehensive.
These ‘snippets’ follow my progression as I learned Ruby, JRuby and Rails from the books I read, internet articles, and trial-and-error with real scripting projects I did. Each week I thought of something that was of particular interest to me as a Java and sometimes Perl programmer, and presented it in a 2-4 slide ‘snippet’. Where possible I used examples directly relevant to the work we do, which is mostly Java programming of data models and numerical analysis in mobile phone networks (not mobile phones). Sometimes I used examples from the books I read along the way:

For a more specific Ruby-2-Java comparison, see the extract in ComputerWorld of the book ‘Rails for Java Developers.’ This is a nice soft intro to Ruby for Java developers. However, while my snippets are not as complete, I think they are more interesting and relevant to me, of course. And I hope they will be of interest to others too.

Mar 28, 2007

Amanzi Down Under

My other brother and his wife have recently moved to the remote north west of Australia and started blogging from there too. Interesting place. I'd love to visit, but damn it's far away!

Nov 10, 2006

Bongi

This week my brother started his own blog about being a surgeon in the notorious Mpumalanga province in South Africa. Three rich posts in only the first week make my own blog-rate of about 3 a year look rather dismal. Also the content is very interesting, dealing with the hard issues of facing death in an environment that seriously increases the chances of death by violence (read the blog for details!).

And his text is very well written, to the extent that I'm almost able to ignore the strict lack of capitalization :-)

Oct 6, 2006

Google GapMinder - Wow!

I recently read a blog posting by Simon Chapman called simply Google Gapminder Beta 2. The google application it references, Gapminder, is absolutely fascinating. It is an AJAX style web animation of global human population statistics that are most incredible to observe.

The original Gapminder data with visualization tools and presentations is available at http://www.gapminder.org, but I spent more time running the google animations, and here are a few points I found interesting:

  • phone versus internetAnimating phone use versus internet use shows a slow increase of phone use over the last 30 years, with high use countries remaining high, and not much shuffling, and then over the last 15 years internet use races to catch up with phone use, mostly reaching it, with individual countries increasing internet use in growth spurts. Now, in most cases, internet use and phone use are highly correlated, or even matching. In the late 90's, not surprisingly the Scandinavian countries, Sweden, Norway and Finland lead the pack, with the US close on their heels (and the rest of Europe and richer SE Asia a little further back), but over the last 10 years, possibly drive by internet use, the phone use seems to have sped up, with the global distribution narrowing, and all of the wealthier countries crowding up in the maximum penetration area.
  • life expectancy versus incomeAnimating income versus life expectancy is even more amazing. For the first 15 years there is reasonable global correlation, with low income countries having low life expectancy, but in the last 15 years most of Africa has veered severely off that correlation line. Consider Botswana in 1990, with the highest income of continental Africa, sitting right up there with the better off third world countries in Asia and South America, on both income and longevity. Then over the last 15 years, while income continues to increase, the life expectancy drops from 65 to 35 years. This was the most dramatic impact of AIDS I had ever seen. We do not feel this in Europe, but certainly it is horrific in Africa. Both my brothers are doctors in South Africa, where life expectancy dropped from 63 to 45 since 1992. They have often described the severe impact of AIDS on their work, and like most doctors in South Africa are frustrated by the authorities apparent lack of interest in helping the situation.
  • On the same life-expectancy animation above, you can see Rwanda hanging around the 45 year mark in the early and mid-80's, but in the late 80's it dramatically drops, to an incredible minimum of 24 years in 1992 due to the civil war (read 'genocide'). This atrocity was so horrific it makes Bosnia look mild, but being in deepest, darkest Africa did not generate the same media coverage as the European conflict did. Since that date, the life expectancy has come back up to 44, but income has slightly reduced (with a big drop in the mid-90's from which it has partly recovered). Africa is surely full of the most amazing, but unfortunately horrific patterns on this gapminder plot.
  • contraception versus childrenPlotting female contraceptive use versus children per woman is also interesting. Not surprisingly there is a strong correlation, with high contraceptive use linked to fewer children. China sits in a strong position, with a very high level of contraceptive use, peaking at 90% in the mid-90's (and slightly less than 2 children), and most of Africa sits at the other end of the scale, generally below 20% and around 6 children (South Africa is unusual at 56% and 3 children, but still on the correlation curve). One fascinating anomaly is Russia, remaining consistently below the curve, with surprisingly few children considering the low use of contraception. One wonders if there is a cultural aversion to admitting contraceptive use, or perhaps just a low incidence of sex?

Wow! I could spend hours poring over this incredible mine of information. But I better save the rest for another day :-)

Mar 29, 2006

The perception of control

Over the last few years I've begun using the phrase "the perception of control" to describe a phenomenon in company decision making I've seen unpleasantly often. I view it somewhat as a successor to my previous pet phrase "un/informed decision making" and coupled to the phrase "the illusion of efficiency" which I’ve also enjoyed using.

Un/informed decision making

I'm pleased to say I've spent most of my career working for small startup companies, where necessity requires that decision making is done by the same people that actually do the work. This usually leads to relatively well informed decision making. However, at least once I have worked for a large company that was structured with vertical silos such that decisions were made by managers that usually knew very little about the subject on which they needed to take the decision. Generally they also didn't have the time or inclination to educate themselves, or at least talk to the 'people on the ground' who actually knew something. Take a look at a recent posting on this subject by an IT professional forced to follow IT decisions taken by his IT-illiterate boss: When servers crash and burn

This vertical silo structure has a secondary effect when large companies try to increase efficiency by creating narrow, specialized roles, which leads me to my second phrase:

The illusion of efficiency

Back in the same large company, I had the rather illuminating experience of being part of a 5 man international team that took 6 months to install a printer. Yes, you heard me right, six months and 4 teleconferences simply to install a printer. This amazing level of extreme inefficiency was the direct result of IT projects designed to increase company operational efficiency through specialization. The point was that if each individual only did one specific task, they would do it faster, perhaps as much as 20% or even 30% faster than someone switching context between several tasks. The end result: IT support was located in Asia, core networking in Germany, Windows domain management in Norway, hardware requisition in Belgium and Project management in Scotland. With business management in California, things could have been even more complicated, but luckily they were only required in one of the meetings. Had we had an onsite IT individual handling all the various IT-related tasks, the project would have taken a couple of hours at most.

More recently I've been in discussions with my current management on the subject of software development efficiency. They can see that 20% to 30% efficiency gains might be possible through the reuse of software code components across the company product lines. I have argued that any fractional operational cost gains will be offset by dramatically increased time-to-market losses. We're not talking 6 months for a 2 hour project, like my previous example, but we're certainly talking about taking 6 month software projects and scaling them up to years. This problem is nothing new. Software companies have battled with these issues for decades, and many books have been written on the subject. One of the earlier ones is ‘The mythical man-month’ covering related issues, but more recently the flood of Agile development books, like ‘Lean software development’, ‘Extreme programming’ and of course the entire ‘pragmatic programmer’ series.

Drawing from experience I can say that for years I too believed in trying to increase software development costs through increased code re-use, or the sibling concept:- coupling existing software projects together to prevent re-inventing the wheel. However, retrospective analyses of such projects lead me to a few ‘startling’ conclusions:

  • Projects easily became much more complex than initially expected if any one of a few conditions existed:
    • more than one pre-existing code-base or product
    • more than one team of software developers
    • specification and core development are geographically separated
  • Projects intended as ‘prototypes’ or ‘research only’, and as a result were run with small teams with close access to a ‘trial customer’ magically hit much, much tighter deadlines and often with a feature set and level of quality akin to what would have been planned with a ‘real product’ development, but minus much of the heavy project planning.

These observations have made me a natural believer in much of the new Agile development methodology that is such a hot topic these days. Clearly there is a growing body of software developers that no longer believe in ‘silo’d’ projects with ‘uninformed decision making’ and ‘the illusion of efficiency’ driving project decisions. I’m certainly one of them, but unfortunately many managers are not in agreement. This leads me to the main point of this article:

The perception of control

In a small startup company, where there are few people interacting, people generally have a high level of ‘control’ over their environment, colleagues or projects. This is a natural consequence of the fact that any decision maker needs to talk to very few people, if any, to take an “informed decision”. Quite often the decision maker is actually the person that knows the most, and the person that needs to follow through with actions. However, as companies grow, the number of employees increases and jobs become more specialized, decision makers start ending up in the position where they no longer know enough to make an informed decision. Things can go in two ways:

  • Delegate. The decision makers entrust aspects of the decision to others who are closer to the data, the customers, or the people on the ground. This requires the ability to trust others, to stick with decisions and to not change the rules of interaction or balance of authority depending on the current political climate. It is a challenging task surprisingly often excelled at by people who are not entrepreneurs, and need to delegate and trust by necessity. Coupled to this is the ability to take blame when necessary, and not look for scapegoats. See this very interesting article on the subject: My Bad!
  • Dictate. The decision maker takes the decisions themselves, and maintains total control. This is where the ‘perception of control’ comes into play. No matter how brilliant any leader is, they can only scale so far. Sooner or later a growing company exceeds their ability to maintain genuine control over everything that happens. This is a very common situation for entrepreneurs to end up in. The same strong leadership characteristics that helped that person excel at starting a company and build a new business, often lead to this situation where they cannot successfully delegate. All decisions end up being made based on the dictators ‘perception of control’. They can never have real control because the company has grown beyond that, however their need to feel in control means that they will take decisions based on that feeling, not on real knowledge of the situation.

Paradoxically enough, those that are most dictatorial are exposed soonest and often thrown out by the first controlling VC around the corner, while those that try hardest to do it right and delegate are those that end up maintaining the dictatorial approach for longest. But it cannot last. Dictators are always overthrown.

So, how do you tell the difference between true delegation and dictators operating with the ‘perception of control’? Well it’s not as hard as you might expect. There are a few rather simple things to look for:

  • Middle managers admit that success within the company requires having the ear of the ‘decision makers’ (ie. decisions are made through ‘lobbying’, not informed decision making). I observed this situation once when an external management consultant asked key questions as part of management training, and was somewhat distressed by the answers, even though several of the managers involved did not see the problem (since they did indeed have the ‘ear of the decision maker’).
  • Strategy decisions are taken in closed meetings, or without the considered input of a reasonable representation of management. This one can be harder to judge, but can show itself through a simply polling of people in the company with the question: do you feel that your opinions are considered in company decision making? Another side to this situation is that the people placed in specific decision making positions end up not having real decision making power, and become mere puppets, which is usually a very unsatisfying role, leading to lack of motivation and often early departure from the company.
  • The use of FUD.
  • The decision makers are never willing to admit they are wrong: See My Bad!
  • Individuals that express contrary opinions to the decision makers are removed from positions of influence. When such people are few, this might not be a real sign of a problem, but when this involves a large number of people, you know immediately that it is a major effort to maintain ‘the perception of control’.
This last point reminds me of a situation I experienced a few years ago, where the large majority of the people involved in a key project were removed from the project and from positions of influence, in order to kill the project. This drastic level of ‘surgery’ was required because the particular project had substantial internal company support, and a very strong business case. The fallout from that executive decision resulted in the loss of a major customer, the loss of several highly talented employees, and several years of subsequent squabbling within the company as it attempted to deal with the business case, which had simply failed to go away. And all this was done in the name of ‘the perception of control’.

Clearly the executives taking the decisions did not feel like they had control over that specific project. And that was in fact quite true. But to achieve the nirvana of stable management for the benefit of the company, true delegation is a necessity, complete control an impossibility, and the ‘perception of control’ a destructive middle ground.

Mar 3, 2006

SkypeOut versus JabPhone quality

I've just had the opportunity to compare voice quality with back-to-back calls on GSM, JabPhone and SkypeOut. JabPhone wins easily, but there are provisos.

First, the test:

  • Calling from Sweden to a fixed line in Johannesburg, South Africa
  • Three calls, GSM, JabPhone and SkypeOut
  • The latter two on a well spec’d machine connected to a 2Mbit frame relay (not loaded)

The results:

  • Best voice quality was certainly JabPhone, according to both parties (and I asked the receiver before expressing my potentially biased opinion :-)
  • The GSM call was worst in basic voice quality, but did not suffer from the same time-lag and occasional moments of silence that both VoIP services had.
  • Best price was certainly SkypeOut (who probably have a POP in Johannesburg, which I suspect JabPhone doesn't). Skype was about 30% the JabPhone price, which in turn was much cheaper than GSM.
  • JabPhone killed the call with no warning when my credit ran out, which was a bit unprofessional (as are many aspects of the JabPhone service).
  • Overall, all three were passable as voice calls, but none were great.

Because JabPhone has the best basic voice quality, I rank it best overall for longer term potential, since the remaining problems are all things that can presumably be addressed. The service is currently advertised as version 0.2, so I expect it will be much better by version 1.0.

Of course, it goes without saying that these opinions are entirely subjective. I’ve always found Skype voice quality to be a bit weird, even back in the days when I did not have the occasional ‘really-bad’ Skype calls (today’s was a good call). I know of others that disagree and find Skype to be great.

When all is said and done, although I have access to, and use, three different VoIP systems (jabber/GoogleTalk/JabPhone, Skype/SkypeOut and a SIP service with x-lite), I still use Skype the most. So, no matter what I think of the voice quality, the continued convenience and professionalism of the service still keeps them in the winning seat as a service (for now :-).

Next to test: compare some other systems like www.jajah.com and the standard SIP service I mentioned above

Feb 23, 2006

It lives! (finally making calls with JabPhone)


Well, I finally got JabPhone to work. Or rather I should say JabPhone finally started working. It seemed they had some severe teething problems in the beginning, and then worked with Google to make better use of the google federated jabber servers. After that they advertised that everything was back on-line and even gave us early adopters a $1 bonus to our accounts (err..., wow?)

But for me it still did not work. Or rather calls went through once in about five attempts. That was a week ago. Todays test worked first time. Voice quality was good, not as good as pure GoogleTalk, but better than SkypeOut (at least my last few calls with SkypeOut have been rather poor).

My overall impression is that it is heading in the right direction, but has a long way to go. It is not nearly as polished a product as SkypeOut, and having to initiate the call with a text message is a minor inconvenience, but an inconvenience nevertheless. No dialpad is more serious. I view this as an alpha level service. I am a bit surprised it is 'on the market'. Hopefully they get it dramatically polished up before it develops a negative image.

Jan 30, 2006

JabPhone - GoogleTalk 'SkypeOut'

Most people know of Skype and the SkypeOut/SkypeIn services allowing you to phone PSTN numbers and receive calls from PSTN numbers. I, for one, have made quite a lot of use of SkypeOut. When GoogleTalk was released (in beta) last year I tried it out, and felt that the voice quality outclassed skype, but it had no SkypeOut facility, so I was not sure how far it could go. But, being Google, I assumed it would get there soon enough.

Well, it turns out that the Jabber software foundation (which made the jabber protocol Google Talk uses) has created a JabPhone site that is basically a SkypeOut service, with the first 15 minutes free. It started just last week, and has already suffered from problems with overload, but they are getting there. I think the fact that GoogleTalk is based on a free and open standard like Jabber, is an excellent thing, and should easily lead to them providing serious competition to Skype. Skype has a massive lead, but perhaps they will start looking over their shoulders for some new competition from the open-protocol camp.

Amanzi Wiki

Contrary to an implication in an earlier posting, I have been updating my Wiki, mostly with news about VoIP that I find interesting to myself. Take a look at http://wiki.amanzi.com.