Tom Hacohen

Tom Hacohen

About Tom Hacohen

Tom has been using Linux since 2003. Previously a core developer and part of the leading team at SHR (Openmoko), he is currently a core developer for the EFL (www.enlightenment.org). He has also contributed to many other Open Source projects over the years. In 2010 he started working at Samsung's open source group on the Tizen Linux platform.

  • Projects

    EFL
  • Role

    Senior Software Engineer

Posts by Tom Hacohen

  • December 1, 2016 - Tom Hacohen

    Improving Debug Code Performance in EFL

    I work on EFL, a cross-platform graphical toolkit written in C. I recently decided to improve one aspect of the experience for developers using the API (otherwise known as users) by making EFL provide more information and stricter sanity checks when developing and debugging applications. A key requirement was ease of use. With these requirements, the solution was obvious, unfortunately obvious solutions don’t always work as well as you expect. The Obvious Solution: an Environment Variable Using an environment variable sounds like a good idea, but it comes with one major, unacceptable flaw: a significant performance impact. Unfortunately, one of the places we wanted to collect debug information was Eo, a hot-path in EFL. Believe it or not, adding a simple check to see if debug-mode is enabled was enough to degrade performance. To illustrate, consider the following code: Note: thanks to Krister Walfridsson for pointing out a mistake in […]

    Read More
  • August 26, 2016 - Tom Hacohen

    Hunting Down Dirty Memory Pages

    I recently had to debug a complex issue with memory page usage in EFL; you will likely never encounter this issue because it’s only relevant for shared libraries developers, and even then, not always. However, I think I think it is beneficial for everyone to be familiar with how things work at a lower level, so I decided to write this post. A few weeks ago I got a report about an increase in private dirty pages from our libraries that essentially caused increased memory consumption for every application linking to EFL. The main culprit was the object system (Eo), which I maintain, so I decided to take a look. For my first step I performed a manual review which led me to a mistake in related code that I eventually fixed. My fix improved the situation a bit, but the dirty page issue was mostly unchanged, so I investigated […]

    Read More
  • I have recently moved to a new flat and I love it, though unfortunately not all is perfect. One might expect central London (literally 500m away from the actual geographical centre) to have the best internet connection London has to offer. Well, one would be wrong; I am no longer able to get anything better than lousy ADSL2+, and this amazing offering comes with a high price, a long contract, and a month’s wait for the installation. This has led me to choose a 4G internet provider; the connection is usually better than what I would have expected to get with any of the landline providers, is much cheaper, and I had it up and running less than 24hrs after I joined. However, there is a problem with this: the 4G provider uses a carrier-grade NAT, that made impossible to access my home server from outside my home network. Luckily, […]

    Read More
  • As my friends and colleagues know, I think the history of a project is very important for development. Being able to bisect, blame or read the log have proven very useful for finding bugs and understanding why a piece of code was written the way it was. Therefore, it makes sense to do whatever is possible to make sure history is preserved when moving files across repositories. Luckily for us, git has made it extremely easy. Merging Repositories Merging a repository (bar) into another repository (foo) is easy.

    This is it. It is very simple and retains all of the history from bar while maintaining the same commit hashes! This means that for example daed567e will point to the same commit in both foo and bar. Unfortunately it is not always that simple. Sometimes you may face conflicts, if for example you had a README file in both repositories, […]

    Read More
  • February 23, 2016 - Tom Hacohen

    Running letsencrypt as an Unprivileged User

    Running letsencrypt as an unprivileged user (non-root) is surprisingly easy, and even more surprisingly undocumented. There is no mention in the official documentation, nor was I able to find anything online. There are alternative clients that were designed to be run as unprivileged, but they are not as beginner-friendly as the official one. Personally, I’ve switched to acme-tiny (and created an AUR package for it). Its much smaller and lets me have an even more secure setup. Why would you want to bother with this? One word: security. You should always strive to run every process with the lowest privileges possible because this reduces the chances of data loss as a result of a bug. More importantly, this reduces the chances of your server being compromised and thus improves overall security. Summary In this tutorial we will setup letsencrypt to run as an unprivileged user using the webroot plugin. This […]

    Read More
  • October 19, 2015 - Tom Hacohen

    Using OpenPGP Keys For SSH Authentication

    If you already use OpenPGP, there is no need for you to create an additional SSH key. You can just consolidate your identity and use the same key for SSH authentication. The main benefits that come to mind are: Preparing yourself for your eventual migration to using an OpenPGP smart card (hereby: SmartCard) like the YubiKey NEO. Having one less key to worry about. The rest of this post assumes: You use GnuPG version 2.1 or later (run gpg –version to verify). You already have an OpenPGP key (plenty of tutorials online). You already use gpg-agent as your SSH agent (plenty of tutorials online). Create an Authentication subkey We first need to open the relevant key for editing in expert mode:

    Now we are going to add a new authentication key:

    Select (8) RSA (set your own capabilities).

    Select (S), (E) and (A) until the current allowed […]

    Read More