I Wrote a Software: My Tech Stack

I’ve been writing recently about a side-project of mine that I’ve been doing to scratch a couple of itches I have: Using Excel as a Collaboration Tool in an Enterprise Setting and Seeing what all the fuss is about Haskell.

I started off, reasonably enough, by trying to write a web app. But getting started with anything in Haskell is hard enough: getting started with a website was a nightmare [1]. So I made a virtue of necessity. I figured if I’m going to make it easier for people to collaborate with Excel then what is the most natural way for people to collaborate with Excel in real life? The answer is simple: by sending email attachments.

So I forgot about any web interface (for now) and just concentrated on working with Excel Attachments on Emails. It meant I could just focus on learning Haskell and also forced me to work in a way that is going to be more natural for anyone who might use the service. And also it turns out that I’m bang on trend with this whole “No UI” movement [2].

In this post I’m going to get into what I’m using on this project and why:

  1. Ubuntu. I run this on the server simply because I’m used to using Ubuntu on the desktop from the past. I’ve run Ubuntu in production for a long time and it’s fine for me. (I’ve also run CentOS and Windows and going back far enough HP-UX and Solaris, but Ubuntu just seems… nice).
  2. Linode. Not all that much thought on this one. I’ve used AWS in the past and find the interface unbearably complex. I’ve used Rackspace Cloud with a lot of success. But I’ve also been curious as to how Linode and Digital Ocean stack up. I asked Twitter and I got an answer from someone in the Linode community. And so here I am.
  3. Postfix/Dovecot. I never imagined running my own mail server. I originally wanted to run all the email through Gmail. But I kept getting blocked for having a script running against the Gmail servers. In the end I figured I may as well run my own. Remains to be seen how well that works out. And (perhaps coincidentally) the best guide I could find to setting up Postfix/Dovecot was from Linode.
  4. MongoDB. I know that Mongo is no longer the cool kid on the block. But given that my use case for data storage is pretty straightforward, but I expect to need to store large Excel files, Mongo seemed neat. I’m using Mongo as a queueing system as much as a persistent data store.
  5. Haskell. For the heavy lifting. Learning it has been a long, hard slog. I must have read Learn You a Haskell 15 times (I even bought a copy). And also Real World Haskell several times. But you only really learn by doing and for me the best doing came from trying to follow Write Yourself a Scheme and then by trying to figure out how the HaExcel guys did it. Hat tips must also go to HaskellLive for getting an environment set up (though this now seems to be superseded by Stephen Diehl’s excellent write-up).
  6. Plain vanilla Ruby. Because with the wealth of gems in the community you can do a lot very easily.

[1] My brother who also works in tech bought me a copy of Building Web Applications with Haskell and Yesod. He thought that Haskell and Yesod were two individuals who were doing the teaching. This is in stark contrast to Ruby which I learnt from Alan Bradburne’s excellent Practical Rails Social Networking Sites.

[2] A cynic may say that mailing lists have been doing this for donkeys years. To which my reply is that the surely this validates the use of email for sending instructions around.

Inconsolata and Jedit on Ubuntu 8.04 (Hardy Heron)

The installation process for Jedit(*) on Ubuntu is pretty well documented – as long as you follow option 2 from the jedit download instructions. It’s well worth going for the latest release – as a lot of the plugins don’t work on earlier versions.

But the edit area font looked very uninviting, even with aliasing configured

The fabulous new Inconsolata font looked like the solution. You can install it (or at least the .otf version) as per usual.

But Jedit leans on Java and Java (apparently) requires ttf files, not otf files.

Here’s my workaround which, although a bit hacky, works for me.

  1. Install FontForge
  2. Download the FontForge sources
  3. Open the FontForge source in FontForge
  4. Export it as inconsolata.ttf (ignore any warnings)
  5. Copy it to the ttf-inconsolata font directory that was created as part of the installation of the ubuntu package, e.g: sudo cp inconsolata.ttf /usr/share/fonts/truetype/ttf-inconsolata
  6. Now edit fontconfig.properties.src in /etc/java-6-openjdk and add the following four lines
filename.Inconsolata-Regular=/usr/share/fonts/truetype/ttf-inconsolata/inconsolata.ttf
filename.Inconsolata-Bold=/usr/share/fonts/truetype/ttf-inconsolata/inconsolata.ttf
filename.Inconsolata-Oblique=/usr/share/fonts/truetype/ttf-inconsolata/inconsolata.ttf
filename.Inconsolata-BoldOblique=/usr/share/fonts/truetype/ttf-inconsolata/inconsolata.ttf

There you are, now you can use Inconsolata in your Jedit.

Was it worth it? For me – being used to Windows and Mac it has made my Ubuntu dev environment much more friendly than it was before. YMMV: screenshots of different fonts on my machine are below.

Bitstream Vera Sans 12
Bitstream Vera Sans 12
Courier New 12
Courier New 12
Deja Vu Mono 12
Deja Vu Mono 12
Inconsolata 12
Inconsolata 12

(*) FWIW – I do my RoR hacking on Textmate on the Mac and recently moved from Aptana to Jedit on Windows (I didn’t need the full-on IDE features). On Ubuntu I was looking for an alternative to Eclipse. I started with Gedit for a while but syntax highlighting was pretty poor and I spent too long chasing down all the different advice available on the interwebs and still not getting anywhere. IMHO Jedit is an altogether simpler option for RoR as it needs only a few tweaks as documented by the likes of Eadz and Xiabozz to get you moving in the right direction.