Martin @ Blog

software development and life.

Flower

Archive for the ‘Apple’ 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.

Conclusion

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.

Dit is wel weer origineel

De iPhone als fluit:

New Apple products

Yesterday, Apple announced new MacBooks and MacBook Pro’s. The 17″ MacBook Pro has the same housing as the previous version, but the 15″ has an updated casing which is similar to the iMacs. The 13″ MacBook is also updated and has the same casing as the MacBook Pro, making the difference between the two product families smaller. I think the new looks are pretty nice.
A nice innovation is the new trackpad is made from glass and support multi touch gestures (similar to the iPhone I suppose). The screen of the new laptops are using LED backlight and in order to support external monitors, a Mini Displayport connector is used. Unfortunately, the 13″ MacBook lacks a Firewire port.
In addition to the new laptops, Apple also introduced a 24″ Cinema Display, specifically targeted to laptops. A very good feature of this monitor is the inclusion of a MagSafe powerconnector, which charges a MacBook without the need of a seperate power adapter.

MacBook and new Cinema Display

According to Twitter, the new laptops are received pretty well. The main complaint is the missing Firewire connector and the pricing of the new models. Fortunately, the old (white) MacBook is still available for a reduced price.

Of course, I want such a new MacBook, but unfortunately, my current MacBook is only one year old and therefore I have to do with this one for another two years. Unfortunately, the screen of my MacBook broke down this week, and therefore needs to be repared…

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.

Funny way to indicate Windows systems

Due to the fact that Apple (and Linux distributions as well) may not use the Windows logo because of copyright restrictions, Apple had to find another way to represent Windows system when browsing the network. In my opinion they found an alternative which is accurate and funny in the same time:
OS X Windows machine representation

Of course, some people are insulted by this way of representing a Windows system. They claim that Apple degrade all systems not running OS X as inferior. I agree with Jakub Steiner who claims that it is a very recognizable. I think it is cool.

Mac mini EOL?

According to AppleInsider the Mac mini is nearing end-of-life this month. The site reports that Apple resellers do not get new supply of the mini computer. I wonder if the Mac mini will dissappear completely from Apple’s product list, or that a replacement will be announced. The Mac mini is a nice computer for people to get familiar with Mac OS X without paying a premium price. The current models are quite fast and should be at least sufficient for most people who only use their computer for browsing the Internet, editting family pictures and doing some word processing. The first generation Mac mini’s, the ones with the G4 processor, were a little slow, but the current models have Core Duo processors, which are identical to the ones in the MacBook. Only time will tell, I guess.

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).

Setting up development tools on Mac OS X

Because I now use a Macbook for development, I had to install some stuff I needed for development. Unfortunately, Mac OS X does not provide a convenient method to install all the stuff using a single tool (such as apt-get/Synaptic on Ubuntu), but installing some basic stuff is not very difficult. After some research, I choose to install the following packages:

  • MySQL
  • PostgreSQL
  • PHP 5
  • Eclipse

Read on for the location of the packages I used (more…)

Minimal number of buttons at Apple

The Wall Street Journal has an interesting article on the battle against buttons at Apple which is lead by CEO Steve Jobs. The article explains why he thinks buttons are evil and how various important people in the history of Apple think about this issue. For example Bruce Tognazzini, who worked with Norman and Nielsen, mentions in the article that Jobs did not want arrow keys on the keyboard for the Apple II computer in order to stimulate software developers to support the Apple mouse instead of relying on keyboard navigation. Other obvious examples of the ‘battle against buttons’ designs are obviously the iPod and the recently introduced iPhone. Very intresting article, and I think this ‘vision’ is one of the key factors for the user friendliness of the Apple products. Although some people do not agree with this statement…

Open letter of Steve Jobs on DRM

Steve Jobs, co-founder of Apple, has posted an open letter on the site of its company. In the letter he claims that Apple will embrace DRM-free music if content providers will allow this. It is quite interesting, regarding the fact that Apple in fact made DRM-protected music popular by means of its iTunes Music Store. On the other hand, it takes some courage to state in public that he, as CEO of the largest online music store, thinks it would be better if digital music is available unprotected. Microsoft clearly doesn’t have this courage, regarding the fact that DRM is a very important part of Windows Vista and even makes it easier for record companies to keep using DRM, because it is harder to circumvent the protection and the common public is made ‘familiar’ with the concept. But Microsoft now has a fairly minimal market-share in digital music, while Apple hasn’t. The open letter of Jobs could also be seen as a publicity stunt (the publicity is obvious of importance in this case), because the critical part of the consumers (a part of the so-called ‘early adopters’ and people standing for ‘free information’), are loudly protesting against DRM. DRM-protected downloads is not the success some companies probably hoped, and it clearly is not a protection against piracy (as I pointed out earlier, and Steve Jobs also mentions in his letter). Because DRM-protected music is not popular, some companies are experimenting with unprotected music. This way, the music companies were the first a small step to make unprotected distribution of music, and it seems that Jobs sees this as a change to push the companies a little further. If he succeeds, he obviously gains more popularity amongst people who are against DRM….

You are currently browsing the archives for the Apple category.