Martin @ Blog

software development and life.


Archive for the ‘Software’ Category

Using Boxen to manage your machine

What is Boxen

Boxen is a framework developed by Github to automate the initial installation of a new laptop for development (or any other task which requires a fixed set of tools). It is developed by Github and was initially called The Setup. The philosophy behind Boxen is that development is production which means that it should be automated like a production environment. Boxen is opinionated in some choices made by the developers who created Boxen, but it is also very pragmatic.

Boxen is basically a wrapper around Puppet, and should be used to manage your installed applications and tools. The nice part is that, since it is open source and used by quite a number of companies already, there are many modules available to automatically install and setup a wide variety of tools, ranging from MySQL to Skype and from Caffeïne to Minecraft. It is also highly configurable and it is very easy to made custom changes for individual developers or machines.

Initial installation of a laptop basically only requires you to install Xcode (which is very trivial since Mavericks) and cloning the our-boxen Git repository and your laptop will be installed within minutes. The best thing is that the latest changes and updates are also pulled automatically when you run boxen, so it is not only useful for when you have a brand new installation on your laptop.

Why Boxen

A while ago I looked into using Boxen to manage my laptop, especially because it would be a very easy way to setup laptops of new colleagues as well. Before I heard about Boxen, I created an install script for MacBooks which is used quite a lot within our company, but has a lot of issues. The main problem with an install script are:

  • Hard to make it idempotent (i.e. to re-run it once it has ran once)
  • Very hard to make it fail-safe. This is because every slight difference in configuration can make the script fail and impossible to recover. You have to cater for almost every possible setup which exists.
  • It doesn’t handle changes in configurations nicely.
  • It is a awful lot of work to keep it up-to-date

With Boxen, all those points are addressed.

Another nice thing is that Boxen is taking the pragmatic approach, so you can basically change everything and still benefit of the fact that a lot of code is reused and it will always be possible to re-run the script to automatically adopt changes in configurations required by your projects.

There are some downsides to Boxen as well. I started experimenting with Boxen around a year ago, at which point the documentation was not very abundant. That is a bit improved now, but many things still have to be deducted from the source. When you have problems, it is not always easy to find the cause and it requires some painfull debugging now and then. Fortunately, since quite some developers are using it nowadays, many issues are somehow covered in issues in Github, so this problem is less prominent then in the beginning.

The main issues I had where because we are using GitHub Enterprise (which means that we have our own GitHub installation running on a private server), and in the beginning that wasn’t really supported (or at least not documented). That is fixed now. Another issue is that our MacBooks are logging in on the Windows Active Directory stuff we have running internally, which causes some issues with user groups. This has been addressed in this issue.

Recommended way of starting with Boxen

Initially, I thought to create an our-boxen repository, tweak it and try it on a fresh VM installation of Mac OS X. While that sort of works, it is quite ellaborate and not very ‘eat your own dogfood’. As a result, I thinkered with the setup for over a year, without really using it. So that is definitely not the recommended way.

The way to get started with Boxen I recommend is to just start using it on your local development environment. For me, that meant that I had to delete my existing Homebrew installation and dump my rvm RVM setup. While that is not always a realistic option, in my experience it is the best one to get started with Boxen. It requires that you fix everything as quickly as possible in order to get a running environment ASAP and also ensures that everything actually works. Because of the fact that I wouldn’t have a running environment for at least a couple of hours, I decided to do this in between Christmas and New Year, because we’re not working that much at our office and it is not a problem that you’re not able to run everything locally anyway.

Don’t do everything with Boxen

Initially, I thought it was a good idea to basically do everything with Boxen, including checking out all the required repositories to run our services on your local machine. However, after a while I discovered that would be pretty much unmaintainable (our setup is quite dynamic, even more dynamic than I expected). So instead of that, I decided that it would be a better idea to make sure all required tools, like Play, Thrift, Scala, Maven, Java, IntelliJ, Skype, etc. would be managed by Boxen and the actualy projects (checking out, starting, stopping, executing database migrations) by the tools which are specialized in that. While we didn’t have a proper tool for those tasks, I decided to create that first (also while using it myself, so it forces me to have it in a working state). This turned out to work quite well and basically allowed me to improve the time to convert a freshly installed MacBook into a completely working environment from a couple of days to around an hour. Having the tools for updating, starting, stopping services to be separate also makes it a lot faster to keep my development machine up-to-date.

Distributing Boxen

There is a project called Boxen-web available which makes it easy to distribute a Boxen setup. However, as far as I could see, that uses Heroku. I didn’t really try it yet, but for now I opted to create a simple script which does the initial setup required for Boxen.

Some things we had to fix

We were still manipulating /etc/hosts file to actually get development domains point to your localhost. With Boxen it is relatively trivial to let everything ending in .dev point to your localmachine. This blogpost has a nice explaination on how to do this.


I have just started using Boxen on my own laptop and besides some testing in VM’s, it is not used yet to install fresh laptops (that will happen this week), so we don’t have much experience yet, but so far it looks very nice.

Java Date and Time API and JSR-310

Dutch version can be found at the Finalist IT Group weblog.

Since the start of the development of JDK 7, there is quite some discussion on the API’s in the standard Java libraries which covers date and time. In the current Java version (1.6) there are roughly three major (groups of) classes which are responsible for handling date and time: Date and Calendar, the formatting classes, and the classes in the java.sql package, including java.sql.Date, java.sql.Time and java.sql.Timestamp. Most developers agree that these classes are far from perfect.

In order to resolve this issue, JSR-310 is started to improve the date and time API in the standard Java libraries. However, due to lack of developers and slow progress, it became very uncertain if the JSR would be ready for inclusion in JDK 7 (which will eventually become Java 7, the name I will use in the rest of this article). JSR-310 is lead by Stephan Colebourne and Michael Nascimento Santos. Colebourne is the original author of the increasingly popular Joda Time project, which is a replacement for the default Java date and time API’s. At Devoxx 2009, taking place last November, Mark Reinhold of Sun announced that Java 7 will be delayed until September 2010 at the earliest. Stephan Colebourne sees this as a opportunity to release at least a partially complete JSR-310 in time for the upcoming Java release. (more…)

My blog was hacked

So, if anybody is visiting this weblog (probably that aren’t many people anymore, partly because I didn’t post anything recently…) they definitely noticed that I was a victim of one of the many exploits that are available for WordPress weblogs. The frontpage looked alright, but if one tried to view a single post or clicked some random link on my weblog, the page didn’t work. Of course, I was running an old version of WordPress (2.5 actually…). (more…)

Java 7: new coffee

Last week, I wrote an article for our corporate weblog on the development of Java 7. Since the article was in Dutch, I didn’t post it on my personal blog. But I wanted to post some follow ups, and since it is not very easy to do this on the weblog of Finalist, I decided to translate the article to English and post it here. The translation is done pretty quickly, and thus very likely a bit rough on the edges. I think it is also interesting for non-Dutch readers. (more…)

Devoxx 2008: JavaFX, Java 7 and dynamic languages

Each year during the middle of December, the European Java community gathers at Antwerp to get updated on the latest developments in their profession. This year, Devoxx was organised for the first time from 8 until 12 December. The event was sold out for the second time in a row. This contradiction is caused by the fact that Devoxx until this year was known under the name JavaPolis, but due to a dispute with regards to the Java brand, the name was changed into Javox and finally to Devoxx. In this post I will give my impressions of two days of this event. A Dutch version of this post is available at the weblog of my employer. (more…)

Domain specific languages are hot!

Tonight, I attended a lecture of Markus Völter (also founder of Software Engineering Radio, which I can recommend to listen to) about Domain Specific Languages. The lecture, organized by Sioux in ther ‘hot-or-not’ series, was quite interesting. He started with an introduction on what DSL’s are and what they are not (fluent API’s or ontologies are not DSL’s according to Völter). He continued with discussing various ways to implement DSL’s including using Ruby by implementing a DSL using the dynamic features of this language and Scala using a similar technique. In the second part he gave a demonstration with XText in Eclipse, which was very impressive. In only five minutes, he developed a text DSL for describing the states of a microwave, and generated a plugin for Eclipse for this DSL, including syntax highlighting and code completion.
Another demonstration involved JetBrains MPS.
All in all it was a interesting lecture, but sometimes it was a bit difficult to follow, especially since I’m not very experienced with DSL’s.

Ethical problems with Wifi experiment

The Dutch computer magazine Computer Idee! (intended for novice computer users) is critized for an article in which they investigated the behaviour of people on public wireless networks. The editors of the magazine installed a freely accessible public Wifi network at Shiphol Airport and monitored the usage of it. Obviously, there were people using this network and sending private data over it without any encryption. Now the editors of the magazine are critizied for not obeying the ethical laws common to the hacker community. Interestingly, this comment is made by Roel Schouwenberg, a researcher for Kaspersky.
I don’t think I agree with Schouwenberg. Computer Idee! exposed a real problem and in my opinion this is not a ethical problem. Users of public wireless networks should be aware that their data is exposed and can be used by anyone. Obviously, it is a bit questionabel that Computer Idee! stored the private data on their systems, but I think it is strange that researchers from Kaspersky are complaining about this. I think they should be complaining about the behaviour of users, who should use encryption technologies when sending private data over a public wireless network. Never trust systems and networks you don’t control.
But maybe Schouwenberg is complaining because the ignorance of users is essentially their business. If computer users were more security aware, the amount of virusses and other malware would be less, because the won’t be as succesfull as they currently are…. Making the public more aware and reducing the security risks by changing the habits of users is not in the interest of Kaspersky.

Problems with Parallels

Last week, I installed Ubuntu 8.04 in a Parallels Virtual Machine on my MacBook. Today, I decided it would be nice if the Parallels tools were working, so I tried to install them. This didn’t work.
After some searching using Google, I discovered this is a known problem, and there doesn’t seem to be a solution for it yet. On a forum there is a topic on this issue in which some complaining about this, because VMWare Fusion seems to work perfectly well with the latest Ubuntu release. There is also no comments from the Parallels developers on this issue, which is a bad thing in my opinion, because it is a serious issue. Like most Parallels users, I mainly use it to test stuff on Linux and Windows, which requires a perfect working of both platforms to make this as effortless as possible. Hopefully, this issue will be resolved quickly, because this kind of stuff makes users switch from Parallels to VMWare.

The Gimp 2.4

The developers of the Gimp project released version 2.4 today. It seems to contain a lot of improvements, including a tool to extract foreground objects from their background (like Photoshop can already do for a very long time), full-screen editing of photo’s and improved selection tools. The looks of the application is also improved. All in all it seems like a very big improvement over the previous Gimp version and I think it is a little bit more capable in competing with Photoshop, especially since the program now also includes support for color management and color profiles, which was also a standard complaint when people suggested Gimp as a Photoshop alternative. While releasing the 2.4 version of the Gimp, the web developers of the project also updated the website giving it a new look. Also a big improvement over the previous look in my opinion!

Hello from Eindhoven!

‘Hello from Seattle’ is Microsoft’s alternative on the Zune to the ‘Designed by Apple in California’ that is printed on the packaging of Apple products. I think it is a bit of sad in a way an indicator that Microsoft is actually losing its leading position on the IT market. I don’t think it is a very good sign that you have to imitate (or react, depending on your view) this kind of gimmicks of the competitor.

Last weekend was quite busy. We went to the Efteling because the employer of my girlfriend was having a family day there. It was very nice, especially because the weather was exeptional good for this time of the year.

I also read today about a new mainbord from ASUS which incorporates a embedded Linux installation for configuring the system and also provides some functionality, such as Skype. I think it is a nice idea, but unfortunately, it is a little expensive with a price of 360 dollars. You can buy a complete system for that money.

Rikkert Koppes has created a library which enables some Web Forms 2.0 elements for existing browsers. Not all additions are implemented and some parts, like css pseudo classes, work a little different than in it will be in the ‘real’ WF2 implementtions, but it is a very nice start and I think it can definitely be useful in web applications (especially the various date controls).

You are currently browsing the archives for the Software category.