geek

Week eight review

This week I have made some big strides in two of the products I have been working on. The schedule I have planned out is quite ambitious and I actually wasn’t sure if I was going to get everything done that I had planned this week – but I did, yay!

There are a couple of really interesting things I have done this week. I am planning to use Amazon Web Services so have been learning how to create images to run in EC2. I now have a customised Ubuntu image setup and has Mono and MySQL installed and on startup it automatically pulls the latest version of my application from an S3 bucket. This actually turned out to be a lot easier than I expected and is pretty cool to hit a button and have a new server starup and start running my app.

The other cool thing I now have is a couple of scripts for installing mono. It will download the appropriate tarballs, extract them, makes and installs them. This took a lot of work to figure out everything that was needed and tweak the script so that it worked. It is the first shell script I have ever written so it was a good learning experience.

Developing for the cloud

The project I have been working on will be living in the so called cloud. Eventually it will be hosted within Amazon EC2 but I am not quite at that point yet.

I have been using Amazon S3 and SQS however. I am developing in c# so went looking for some libraries that would make things easier. I am not so keen on working with SOAP or dealing with http calls, especially if someone else has already done the heavy lifting!

For S3 there is ThreeSharp it has a very nice API and thankfully uses an interface that can be mocked. One of the nice things about it is that you don’t have to provide an actual file to upload to S3, you can just provide data that can be loaded into the stream. This makes it really easy in tests to load it up your bucket with data. I now have a nice suite of end to end tests that work directly with S3.

The next library I found was Amazon.SQS as with ThreeSharp it has an interface that can be mocked. The API is fairly straightforward, the only thing I had trouble with was figuring out how the Queue Url worked. When you create the queue the url is returned in the response object and from then on you need to pass that url around when you make requests.

I was expecting it to be easy to work with these services and so far I have not been disapointed.

Switching development to mono

Last week I started writing a new application using FluentNHibernate and ASP.NET MVC. Initially I was working on it in my windows vm as I was having trouble getting the latest version of MonoDevelop to work. That is all fixed now so I decided it was time to checkout the code and see if it worked.

So first thing does it compile. Yes!
Next I tried to run my tests. Nup didn’t work. I get the following exception “System.TypeInitializationException: An exception was thrown by the type initializer for NHibernate.Cfg.Environment”.
I spent forever digging around to find out why. Another lib I am using is MvcContrib and I am using the TestControllerBuilder class. It turns out that if you create an instance of this class BEFORE configuring NHibernate then you get the exception, create it afterwards and it works fine. Argghh. Frustrating. I took a look at the TestControllerBuilder class and I can’t see what it is doing to cause that.

The next problem was that SQLite doesn’t work so well on Mono and you need to use Mono.Data.SQLite instead. This required writing a custom Driver for NHibernate which is no big deal – but another step nonetheless. I have submitted a patch to the NHibernate team here and the FluentNHibernate team here

Ok so run the tests again and everything is working now.
Yay, it is kind of exciting to get this working. I am going to try and do all my development on linux now.. MonoDevelop is not as nice as VisualStudio + ReSharper though so I am not sure if this will last!

How I got everything synced

I have been going through the process of trying to get all my data synchronised across the different devices that I have. Cellphone, Laptop and the Web. I am considering the web as a device because it is like a device that is available everywhere.

Mail

So I am using Google Apps which gives me GMail and contact management. I love the web interface and because it has IMAP it easily syncs with outlook on my phone and with Evolution on my laptop.

Contacts

This was an interesting challenge. To sync with Evolution was no big deal, but syncing with Windows Mobile phone was. I tried to use OggSync but for some reason it never worked from my phone. The other option was to sync through the laptop. This can be done, Windows Mobile can sync with Evolution on Linux, however I experienced a lot of pain with it creating duplicate contacts and constantly running into conflicts so I decided to ditch this idea. The last option was to use one of the online sync services out there. I took a look at a few services before finding NeuvaSync. They have a service that looks like an Exchange Server, so using ActiveSync on my device I can point it to that server which in turn talks to GMail. It took about five minutes to get this setup and was by far the easiest option.

Calendar

NeuvaSync also gives me calendar syncing with Google Calendar. It works beautifully and finally makes using Google Calendar worthwhile for me. I had never bothered with it before, opting to use only my phones calendar. But it is nice to be able to edit it online. The calendar also syncs with evolution which is a again a no brainer to setup.

Tasks

I am trying to make more task oriented as I find it hard to know what I am supposed to be doing at any given time. Writing down tasks and just working through the list of priorities makes things a lot easier. I am using the built in task application on my phone and Remember The Milk to manage them online. RTM has an application to sync tasks called MilkSync, you have to pay $25/yr but it is nothing considering the benefits. On the laptop I am using Tasque which is a client for RTM so the data is the same. RTM ALSO comes with a widget for GMail so I can see tasks from there as well, now I have no excuse for not getting things done!

Offline Support

On my phone everything works fine without having to be connected to the net. Bizarelly this is a problem on my laptop. Evolution does not seem to copy the contacts or calendar locally so I can’t use that. And tasque stores everything directly in RTM so there is no local copy of tasks either. I am pretty sure that evolution is supposed to work offline to there must be something I am not doing right there. I am not sure about tasque. I might have to try a new program to get offline support for that one.

Conclusion

Overall I am quite happy. Since leaving dropping Outlook and switching to GMail it has been painful to not have data synced between devices. Using these services has made things a lot easier and at practically no cost. NuevaSync is currently free and RTM is cheap ($25 USD/yr). Everything else is open source and free.

Applications I use

I just came across this post talking about what applications the writer uses, like him I want to keep track of them in case (well for when) I next re-install. Currently I am running Ubuntu 8.10 but am thinking of trying out the latest release of OpenSUSE I would also like to give Nexenta as the ZFS file system sounds great!