Skip to content

Mosh: Mobile shell

For the last couple of weeks I’ve been using mosh and I really like it.

If you find yourself working on a remote machine, your day probably looks like this. SSH into the remote machine, attach to an existing screen session, work, detach screen session, disconnect SSH… and begin again the next day. If you have a flaky internet connection or you are mobile it can be even more interesting as any SSH connection drop will bring you back to square one… SSH into the remote machine, attach to the screen session and back to work.

With mosh the workflow is really simplified. Connect with mosh to the remote machine, attach to the screen session, work. Even if the connection drops, or you roam between networks, it will handle the reconnection to the remote server via SSH automatically. I opened a mosh session to one of my servers two weeks ago and it is still running. In the meantime I’ve visited a dozen different locations, suspended my laptop and every time as soon as there is a connection available my session to the remote server was waiting for me as if nothing had happened.

It’s a project that started at MIT and they market themselves as:

Remote terminal application that allows roaming, supports intermittent connectivity, and provides intelligent local echo and line editing of user keystrokes.
Mosh is a replacement for SSH. It’s more robust and responsive, especially over Wi-Fi, cellular, and long-distance links.

Go ahead and give it a try. They have packages for various linux flavors, FreeBSD and OSX. You have nothing to lose and so much time to save!

Everybody should learn to code!

Recently I’ve noticed that there is a new movement on the Internet to try to get more people interested in coding. I believe that it is really important for everybody to learn how to code. Nevertheless, I don’t believe that telling everybody that they can become good developers is true and that the ultimate goal should be for them to be able to develop their own apps.

Software development is not easy. While it is true that anyone can learn how to write some toy apps, writing real software is hard. It is disingenuous to hide this fact from the poor souls that start coding and are led to believe that they can become millionaires writing software after taking a few online courses just because it is easy.

On the other hand, there is value in getting people to learn how to program and it should be done from an early age. I’ve often told people, half jokingly, that I want my son to learn Python when he’ll be 7 and that he can then move on to C or C++ (his choice) when he’ll be 10. People look at me scared and probably think that I’m an awful father. Knowing that I’m an engineer, they normally reply that he will end up majoring in literature or political science as if that would be something bad or I would be upset about it! My answer is always the same: “He can study whatever he wants, as long as he has a basic education in programming”. I strongly believe it is one of the best skills he can acquire and doing it early on in his education will have a positive impact in his day-to-day life. Let me explain you why.

If you read carefully the previous paragraph you will notice that I didn’t say that I want him to be a great programmer. What I want him is to learn how to program, or in other words: I want him to learn how to think algorithmically about a problem, divide it into smaller parts until he has a collection of simple problems he knows how to solve. Once he knows what problems he has to solve, he needs to tell a third party how to solve it, step by step, and ensure it does what it is expected.

Being able to do that is an extremely valuable skill! You would be surprised how often I meet people who are unable to analyze rationally a problem, break it down into smaller problems and explain to others how to solve them. I don’t need my kid to become the best programmer in the world, I just want him to master those skills and programming happens to provide a perfect playground to develop them. That is why I believe that everybody needs to learn how to program.

The only time I’ve seen people being forced to learn how to program was in University. People who had never touched a computer, or who had only used it to write documents in Word, had to start to work in C for the programming assignments. I couldn’t understand how people that I considered to be very intelligent were unable to produce any kind of working code and when they did, they were unable to divide the program in different functions! It is true that C is not an easy language to jump into but what I saw was not entirely due to the language, on a more deeper level what I saw were 19 year old people unable to think analytically… and that scared me!

When I said that I want my kid to learn Python when he’ll be seven, it is because it is a language that is extremely easy to learn and extremely flexible with the syntax. Once you know the basic commands, you develop a feeling for the language when you can just try things out and in most cases they work. They might not be the best way to do things or even the pythonic way of doing it, but it irons out the frustration of seeing things fail repeatedly for not getting it 100% perfect on the first try.

The joy and sense of empowerment of seeing a machine do what you asked it to do is a very powerful motivator. Once you can get a “dumb” computer to follow your instructions accurately, you know that you did a good job at breaking down the problem in pieces and explaining it to a third party. That is a key skill that is useful no matter what you want to do in your life.

PS: This post was inspired by the article in The Guardian: Why kids should be taught to code

I fell in love with EVIL

I love my Canon 5d Mark II, don’t get me wrong, but lately I realized that I was not taking as many photos as I wanted because I was not having it with me at all times. As a result, I ended up shooting quite often with my mobile.

Now, don’t get me wrong. Nothing beats the mobile phone form factor and it makes them the epitome of portability. They have come a long way in terms of photo quality, but let’s not kid ourselves… there are physical limits (as in laws of physics) that severely restrict what you can do and get.

While I generally agree with the much overused adage that in photography it is not about the equipment but about the photographer, I believe it applies mostly to situations in which you have plenty of time to work on a shot and the photographer will be adding a strong artistic component to the picture. For example, no one would dare to tell a photographer covering a soccer game that their expensive fast lenses and cameras are overrated; that it is not about the equipment but the photographer!

A certain equipment, enables a photographer to do certain things… those capabilities plus the photographer skills to work with them and his creativity are what ultimately crafts a shot.

But I disgres… let’s go back to what triggered that rant. I love shooting with my Canon 5d Mark II but I don’t carry it always with me. I end up shooting with my mobile which is handy because I always carry it with me, but the photos are good but not great. Sometimes the frustration of making a really crappy and unusable shot is worse than not having anything shot the photo at all! I was looking for a solution, but I did not like the idea of a dumbed down point-and-shoot where I cannot control any parameters of the photography.

Then is when I started to notice lots of posts from a photographer I respect and look up to, Bert Stephani. He started to sing the praises for a little EVIL camera, the Panasonic GF1, on twitter (@bertstephani) and in his blog posts and I started to get more curious about it. Nevertheless, when I saw his video tutorial of a shooting session with the GF1 and saw the whole process from shooting on location, the Lightroom workflow and the final result, I knew I had to try it. That may be it. The camera that I was looking for in order to fill in the gap between my DSLR and the mobile.

I bought a second hand GF1 with the 20mm f1.7 pancake lens and I was hooked. I was not convinced of the EVIL and Micro Four Thirds initiative, but I have to say that I’m positively impressed. You can see some of the photos I took with it below.