Karton – running Linux programs on macOS, a different Linux distro, or a different architecture


At work I use Linux, but my personal laptop is a Mac (due to my previous job developing for macOS).

A few months ago, I decided I want to be able to do some work from home without carrying my work laptop home every day.
I considered using a VM, but I don’t like the experience of mixing two operating systems. On Mac I want to use the native key bindings and applications, not a confusing mix of Linux and Mac UI applications.

In the end, I wrote Karton, a program which, using Docker, manages semi-persistent containers with easy to use automatic folder sharing and lots of small details which make the experience smooth. You shouldn’t notice you are using command line programs from a different OS.

Karton logo

After defining which distro and packages you need (this is called an “image”), you can just execute Linux programs by prefixing them with karton run IMAGE-NAME LINUX-COMMAND. For example:

$ uname -a # Running on macOS.
Darwin my-hostname 16.4.0 Darwin Kernel Version 16.4.0 [...]

$ # Run the compiler in the Ubuntu image we use for work
$ # (which we called "ubuntu-work"):
$ karton run ubuntu-work gcc -o test_linux test.c

$ # Verify that the program is actually a Linux one.
$ # The files are shared and available both on your
$ # system and in the image:
$ file test_linux
test_linux: ELF 64-bit LSB executable, x86-64, [...]

Karton runs on Linux as well, so you can do development targeting a different distro or a different architecture (for instance ARMv7 while using an x86_64 computer).

For more examples, installation instructions, etc. see the Karton website.

Markoshiki 1.1


In the last month I managed to spend some time on Markoshiki (a puzzle game I developed) to rewrite the way the user interacts with the game and to do several other user interface changes.
I think this is a very good improvement and brings the game 99% close to what I wanted to achieve.

Markoshiki with an empty board  Markoshiki with a partially filled board

Enjoy and let me know what you think about it!

Download from the App Store Download from Google Play

Markoshiki


Lately, I’ve been working on a web app to learn more about JavaScript, jQuery and other technologies that web developers use. This app is available as a web app, on iPhones/iPads and on Android.

Markoshiki is a logic puzzle game, similar to Sudoku, Futoshiki, etc. The user needs to fill the numbers missing from a board, split in four quadrants, which already has some numbers in it.
The rules are simple:

  • Numbers grow in a clockwise direction following the arrows.
  • Consecutive numbers are in the same row or column as the previous number, but in different quadrants.
  • The numbers that are already in the board when you start the game cannot be modified.

Markoshiki with an empty board  Markoshiki with a partially filled board

For the next version I will focus on making the iOS and Android apps look more native, improve the flow of inserting notes (it’s a bit cumbersome now) and use better the available screen space (including support for landscape mode).

Please play online or install the apps.
If you have any feedback, please let me know at markoshiki@markoshiki.com.

Bye bye Bromium, hello Undo


In March 2015, I joined Bromium to work on a very cool security product. Unfortunately, my project was put on hold and I was not really interested in the new one, so I decided to leave.

In a couple of weeks, I will start working for Undo on their reversible debugger.
Imagine how cool it is to just wait to reproduce a bug and then step backwards to see what caused it instead of spending hours in a debugger hoping for a bug to happen! And all of this without affecting performance much!

Smart home?


I recently moved into a new home and I started to get it renovated. The first two steps were fixing the heating (I installed a evohome system and I’m very happy with it) and get some old roof Velux windows replaced as one wouldn’t open any more and another had some other problems.

Two of the windows are in the master bedroom close to the bed and the other one is in what will be the study, just on top of where a desk will be. Considering the unpredictable weather in England, I was worried that sudden rain would damage my bed and the stuff on the desk (probably a laptop).
Velux makes some automated roof windows, called Integra, that can close by themselves in case of rain, plus you can control them with a remote, you can set the blinds to open at a certain time of the day, etc.
The cost of the automated feature is small compared to the very expensive windows (roof windows are shockingly expensive compared to normal ones) and to the cost of replacing a laptop and mattress in case they get damaged by rain.

The windows seemed to work fine except from automated programs with a timer (for instance to wake you up by raising the blinds), but I assumed Velux could tell me how to fix this.
Today I came home from work and I discovered that all of the windows opened by themselves! And it was even raining!
Moreover, one of the windows damaged the insect net I got installed (mainly to keep my cat inside) by opening too much.
After this, one of the windows stopped responding to the remote control completely, see the picture below.

Velux Integra failure
The right window stopped working, the left one still works
(click for a bigger image)

Welcome to the glorious and shiny future of home automation!

Update: After spending some time resetting all the windows and controllers, I found out that probably the problem was due to a misbehaving remote controller that would just do things on its own (I watched while it was randomly and repeatedly clicking buttons on its own). The customer support at Velux was good and efficient and sent me a replacement controller.

Bye bye Collabora


Seven years ago, immediately after finishing my master’s degree, I visited Cambridge for an “interview” with Collabora. I was hired and, shortly afterwards, I moved to Cambridge.

It has been seven great years since then, even if there were some low points, like when Nokia cancelled some of their projects.
At Collabora I had the opportunity to learn a lot of new things and to work with a lot of incredibly competent and smart people. Despite this, after all this time, I felt like I wanted some little change, but not enough to start looking for another job and risk losing all the good things I had here at Collabora.

Recently, another company got in touch with me and offered me a job. The projects they work on are very interesting and the people there seem great (and, in many ways, similar to the people at Collabora). It was a difficult decision, but I decided to accept.

Today was my last day at Collabora. Thanks to everybody that I’ve met while working there! It was great!
Next week I will start working for Bromium!

(By the way, Collabora is hiring.)

WebKit on the new Raspberry Pi 2


Today the Raspberry Pi Foundation announced a new model of the Raspberry Pi!
While the new Raspberry Pi looks almost identical to the previous one, it’s much more powerful (and with four cores instead of one) and costs just $35.

Here at Collabora we have worked together with the Raspberry Pi Foundation on optimising WebKit for the first Raspberry Pi, achieving a good browsing experience (notwithstanding hardware limitations) with smooth 720 videos, good responsivity, etc.
Despite this work, a lot of web sites are just incredibly heavy and don’t run too well on the RPi1, so the extra CPU power is very useful. Just look at this video to see the difference in performances between the two Pis.


Comparison between the RPi1 and RPi2 (mp4 video file)

Our optimised WebKit-based web browser (i.e. GNOME Web, AKA Epiphany) is already available in Raspbian images, so you will get this out of the box.

Previous Articles

A web browser for the Raspberry Pi


Maynard: a Wayland desktop shell for the Raspberry Pi


Empathy chat accounts and GOA


Welcome to my blog

meI'm an Italian software engineer living in Cambridge (UK). Here I work for Collabora on open source projects like GNOME and Telepathy.
I have a skeleton in the cupboard: Opera is my favourite web browser.