Posted on 20-02-2008
Filed Under (Joyent) by Nick

I just completed migrating this site across to a Joyent accelerator. It was a smooth and seamless migration. All I had to do was check out the site from my subversion repository on the new server, dump the database on the old server and import the data into the database on the new server. Then update the DNS server entries on my domain name registry website. Enable PowerDNS on the new server, then disable PowerDNS on the old server. Wait a couple of minutes for the change to propagate and refresh the browser to see the site running on the new server. I verified this by adding a simple HTML page on the new server to view in my browser. All in all it took a couple of hours.

(0) Comments    Read More   
Posted on 05-02-2008
Filed Under (Linux, Ruby on Rails, ThoughtWorks) by Nick

Goodbye Windows, and welcome back Ubuntu my long lost friend. Finally after a year of working with Windows I managed to find some time to get rid of it and install Ubuntu on my work laptop instead. I can’t tell you how much I missed not having apt-get! I am absolutely thrilled to be using Ubuntu again, and with Compiz now a part of Gutsy Gibbon I no longer have OS X envy anymore. Really I don’t, I haven’t touched my eMac in days, mostly due to wasting so much time tweaking Gnome with eye candy that my eyes hurt.

Furthermore, I made the switch because developing Ruby on Rails applications on Windows is such a pain, and most developers know this, so they go out and buy Macs. Well my friends, you can save your dosh and turn your stock standard Dell into a kick arse development environment for Rails. Just check out the screenshot of my desktop below.

Ruby on Rails development with Gedit


I am using Ubuntu Gutsy Gibbon with Compiz and Emerald. I also have AWN installed for the dock functionality. For Ruby on Rails development I am using a tweaked version of Gedit with plugins that provide much of the functionality of Textmate and more. You can also get Gedit to recognise rhtml files, and provide a real terminal for handy access to command line functionality in the bottom pane.

Sadly I have to keep my Windows partition around for Lotus Notes, but for not much longer. The next release of Lotus Notes will provide support for Ubuntu, and is due out around the middle of this year. Only a few more months until I can completely blow away my Windows partition!

(3) Comments    Read More   

On my current project we upgraded from Spring 2.0 to Spring 2.5. The upgrade was almost as simple as dropping in the new Spring jar. As of Spring 2.5 the web MVC component has been split out into its own module, so now you need to include spring.jar and spring-webmvc.jar in your project lib directory. Also the mock module has been renamed to spring-test.jar.

The project compiled after the new jars were dropped into the project, but a couple of tests broke when running the Selenium functional tests during the build process. Upon further investigation we found that the suppressValidation(HttpServletRequest request) method in BaseCommandController had been deprecated in Spring 2.5 and was no longer called in the BaseCommandController class, so our controller that overrode that method was not being called. The fix was simple, we just overrode the suppressValidation(HttpServletRequest request, Object command, BindException errors) method signature and all functional tests were working again.

All in all the upgrade was quite easy which shows that the core Spring developers are doing a fantastic job at building an excellent framework. The experience also proves that writing tests gives you more confidence when it comes to upgrading your application’s module dependencies. If you have good test coverage then you will know early on in the development cycle of any change in behaviour that an upgraded module dependency may have on your application. So you don’t have to wait until UAT or worse, after the application goes live, for the change in behaviour to be raised as a defect.

On previous client projects that I have worked on, I have found applications that still used Java 1.4 and old versions of module and library dependencies. Not surprisingly these applications had poor test coverage which led me to believe that there is a high correlation between old and stale code bases and poor test coverage.

Therefore one of the reasons that a code base becomes outdated is due to fear, uncertainty and doubt (FUD) of what might happen to the application after an upgrade. If you don’t have any tests then the greater the cloud of FUD becomes and an increasing reluctance to upgrade application dependencies. Upgrades of project dependencies are necessary for developers to make use of new features, and to benefit from bug fixes and performance improvements. Avoiding frequent upgrades will incur a cost that we call tech debt, and it means going without the new features, bug fixes and performance improvements that a newer version of a library or module dependency provides. This leads to a reduction in productivity and quality that eventually translates into a dollar cost amount to the business.

The message is simple: write tests so that any change in application behaviour from future upgrades of module and library dependencies can be detected and resolved early in the development cycle. Do not ignore upgrades, as this will only add to your tech debt, and with any debt that doesn’t get serviced you end up paying a greater cost as time goes by.

(0) Comments    Read More   
Posted on 10-08-2007
Filed Under (Ruby on Rails, ThoughtWorks) by Nick

I have been searching for a decent IDE for Rails development on Windows. I have tried RadRails (now Aptana), IntelliJ, and JEdit. I was never satisfied with either of those editors, even though I think Eclipse and IntelliJ are excellent for Java development. I almost gave up searching for an IDE and instead revert back to using Emacs. But lo and behold I came across NetBeans.

I tried NetBeans for Java development about 7 years ago, and it was so bad then that I avoided it like the plague, until now. The newest version is NetBeans 6, and it is this version that supports Ruby and Rails development through a plugin.

NetBeans provides code completion (with hints and API documentation), source navigation, syntax highlighting, code folds, JRuby integration, SVN integration, and contextual menu items for rake tasks and generators. You can also start the web server and launch a browser to view your running application. These are just some of the features that I have come across today. Which is enough to keep me productive with my Ruby and Rails development.

The IDE itself looks to have had a face lift, the UI is now a lot cleaner and responsive. Also the IDE is not as bloated as it used to be with what appears to be an all new plugin architecture. I only have the base and ruby plugins installed. Who knows I might install the Java plugin as well, and give it a whirl with some Java development. But for now I think NetBeans will remain primarily as my Ruby and Rails IDE on Windows.

(2) Comments    Read More   
Posted on 29-01-2007
Filed Under (Ruby on Rails) by Nick

You can use rake to manage rails versions in the vendor/rails directory of your rails project. This is useful for freezing your project to a particular version of rails. This solves a problem that many rails developers faced when their hosting providers upgraded rails on the servers, and subsequently broke all the rails apps running on the servers. Freezing to a specific version of rails means that the hosting providers can upgrade rails on the server without affecting your application.

Use any of the following rake commands to copy a version of rails into your vendor/rails directory.


rake rails:freeze:edge
rake rails:freeze:edge REVISION=100
rake rails:freeze:edge TAG=rel_1-2-1
rake rails:freeze:gems

The last rake command above will copy the local gems version of rails into vendor/rails. Whereas the other commands will checkout a version from the Rails subversion repository.

The above rake commands should be followed with an update as follows.


rake rails:update

(0) Comments    Read More   
Posted on 23-01-2007
Filed Under (Joyent) by Nick

Apparently yesterday was the last day to purchase a Mixed Grill or Three Martini Lunch hosting special from TextDrive. If you missed out, then you really missed out on two excellent deals.

You snooze, you lose.

(0) Comments    Read More   
Posted on 04-01-2007
Filed Under (Joyent) by Nick

I really wish that I found this posting in the Joyent Forums earlier. It tells you how to set up email and web domain aliasing to your Joyent account.

I purchased a Mixed Grill bundle from TextDrive which included hosting, online storage for secure backups, and Joyent collaboration applications. To access your joyent applications you have to go to http://username.joyent.net, and your resulting email address would be username@username.joyent.net, which to me doesn’t look that great.

So I came across the above forum posting which shows you how to set up an alias for username.joyent.net, so that you can access your joyent applications from home.yourdomain.tld, and your emails will be username@yourdomain.tld.

If your hosting is with TextDrive, then all you need to do is submit a ticket requesting that they add an MX entry for smtp.joyent.net, and a CNAME entry for home.yourdomain.com that points to username.joyent.net.

You then have to go to your Joyent Customer Control Panel and click on the Domains tab. This allows you to add a web domain and an email domain. Your web domain will be home.yourdomain.com, and your email domain is yourdomain.com. You should also select the “this is the primary domain” option.

Finally, make sure that the email aliases set up for yourdomain.com in your TextDrive webmin match the usernames of the users in your Joyent account.

All this means I can finally make use of my massive Joyent quota, which is about 50 times bigger than my Gmail account!

The other advantage of using the Joyent account is that it has IMAP, which Gmail doesn’t have. So I can access my email not only from an ajax web application, but also from a desktop mail client. The settings for your IMAP client are:

imap server: imap.joyent.net
smtp server: smtp.joyent.net
username: yourname@yourdomain.joyent.net

The Mixed Grill specials at TextDrive apparently end on 15 January 2007. If you are looking for great hosting, service, generous quotas, and a friendly community, then I highly recommend TextDrive.

(1) Comment    Read More   
Posted on 18-12-2006
Filed Under (Ruby on Rails) by Nick

The Working with Rails site is a neat little app for keeping track of the rails community.

(0) Comments    Read More   
Posted on 02-10-2006
Filed Under (Joyent) by Nick

Today I migrated my site over to TextDrive. It was a simple migration, but I still need to fix up email. I guess I will just have to wait until the MX rules propagate across the network.

Anyway I should be thanking David Peterson for the hosting he has provided me for the past year. I’ve decided to have a go at podcasting, and I couldn’t chew up bandwidth that way on David’s box, which hosts a few critical sites. So I’ve moved to TextDrive to use up their bandwidth. :)

(0) Comments    Read More   
Posted on 23-09-2006
Filed Under (Joyent, StrongSpace) by Nick

I came across this forum thread on how to add a subversion repository to your StrongSpace account. This means you are able to use StrongSpace as your subversion repository, instead of having to use up precious disk space in TextDrive. The following is a rehash of what was covered in that forum thread.

Start by creating a subversion repository locally.


$ svnadmin create ./repos

Then secure copy the repository to your StrongSpace account.


$ scp -r ./repos ss_user@ss_user.strongspace.com:/home/ss_user/repos

From your local computer, you can access your subversion repository on StrongSpace using the svn+ssh URL schema. For example:


$ svn list svn+ssh://ss_user@ss_user.strongspace.com/home/ss_user/repos

(0) Comments    Read More