From Developer

What OS to use as a web developer (spoiler: It’s Windows)

When I set off to become a web developer in my own business around 5 years ago, I was eager to learn what seemed to be the right choices in terms of tools, frameworks and workflows.

We were just two in the company, and, coming from a mixed background of writing everything more or less from scratch, I was not very experienced with the modern ways of doing things.

My partner, Hans, was a bit different. He had been engaged with more progressive companies, and suggested I took a look at some of the stuff he had become aware of. This specifically included Ruby on Rails.

MacOS was what we had – and it met our requirements

Ruby on Rails is just an example of many modern frameworks and tools that require a Unix-style command line interface to work with. In 2014, this narrowed down our OS-choices to MacOS and Linux. Since we both preferred a shiny user interface, already had our MacBook Pros running and were familiar with them, MacOS was just the obvious choice. Everything worked smoothly, because the command line in MacOS is Unix based.

Fast forward a couple of years, I was now writing Symfony applications for a larger web agency, Peytz & Co. The MacBook Pro was the default laptop among developers.

But we began to struggle with another modern tool that we had started to use a lot: Docker.

Docker requires a Linux kernel in order to work, and although Linux, like MacOS, is also Unix-based, it’s not exactly the same. So on the Mac, the Linux kernel is virtualized along with a file system layer, which is also required by Docker. The TL;DR of this is that the performance is just not nearly as good when running larger web applications in a Docker container.

As requirements changed – so did the OS: On to Linux

Image courtesy of http://geekyplatypus.com

Although we were able to find some work-arounds, in the end I decided to switch to a real Linux OS instead. So for two years, I was running Ubuntu and being very happy with it. All my Docker containers were just running blazingly fast! During the first 18 months I used my Macbook Pro, but then later I switched to a System76 Oryx Pro laptop, because I could stuff more memory and more disks into it.

In fact, at this time, I was starting to getting really annoyed about the direction Apple was taking, with their laptops being less and less configurable and with configurations that were conflicting with my preferences. I was never a fan of the shiny display, I like to have real F-keys as opposed to a touch-bar, I disliked the new keyboard and I don’t like to have an abundance of adapters just to connect standard peripherals via Thunderbolt ports.

So, Ubuntu was great, and with the Oryx Pro I switched to Pop!_OS, which is a variant of Ubuntu provided by System76.

But something was still nagging me… Because I’m also sometimes producing music and developing sound libraries for the Kontakt sampler, I needed somewhere to run a decent Digital Audio Workstation that would also support Kontakt. In my studio I have an older (but still very powerful) Mac Pro that would happily run Logic Pro, which had been my DAW of choice for a little more than 20 years. This machine is not able to run the latest versions of MacOS. The latest version it supports is MacOS 10.11 from 2015. But with this version of MacOS, I cannot run the latest version of Kontakt…

But Linux doesn’t have to be Linux only – we can run it under Windows

So I figured, if I really wanted to get out of this short-termed life-cycle loop that Apple tries to force upon their users, there was only one way to go: Switch to Windows.

“Could this really be true?”, I asked myself… The one OS that I’d been happily ridiculing over the last 10 years since I bought my first MacBook Pro..?

The answer is: “Yes!”. Aside from being perfectly able to run a lot of different DAW’s, Windows has in fact changed in a couple of ways that would also satisfy my developer needs. Since 2016 a proper Bash command line has been available for Windows. It’s later been renamed to WSL or “Windows Subsystem for Linux” and is in fact a very powerful Linux compatibility layer that also allows me to install a real Ubuntu OS.

So: Using Windows with WSL, I am able to run all the Unix-style commands I’m used to. I can install Docker on Windows and connect to it from WSL, getting a very tolerable performance even on relatively large web applications. I can connect to remote git repositories and ssh-servers. And I can run all the usual developer tools, such as RubyMine, PHPStorm, Postman, Visual Studio Code, GitKraken, Firefox… All on the same machine that runs my DAW, without having to run Virtual Machines and without dual-booting.

As a bonus, when it comes to the laptop itself, I’m not limited to choose between the few models available from Apple. I can find laptops that far better match my requirements, and it will even save me a lot of money.

In my home studio, I’ve replaced the Mac Pro with a real powerhouse from Marius, since it was not possible to install Windows 10 on the Mac – unless I spent a ton of time in figuring it out (it was made even more difficult because I didn’t have an optical drive in it, and it doesn’t support USB-booting). The Marius PC is actually able to run MacOS, but I decided to stick with Windows, since I also might use it for development; so to be able to have similar workflows, tools and key-commands across my computers.

There are a few downsides to all this:

  • Non-Apple laptops tend to have larger and more clunky power supplies
  • Non-Apple laptops tend not to have track pads with the same quality of Apple’s
  • I had to dismiss my DAW of choice for twenty years. In my case, I believe I will switch to Ableton Live
  • I’m not able to open all my old Logic-projects on Windows.
Image courtesy of https://thehackernews.com/

There’s a new version of WSL out in the Windows Insider preview these days. This version includes a real Linux kernel, that will run on the Hyper-V virtualization platform, which should improve performance even more.

It feels good to know, that I’m not alone in all this. Here are some links, if you’d like some more inspiration:

Bundling rails apps on managed server

On a managed server where you do not have root access, but still would like to install some gems manually, you can install them locally – as in install them in your own user directory.

This can easily be done with the following command:
gem install somegem -v'1.2.3' -i ~/mygems

Then, the newly installed gems (now reciding in ~/mygems/cache) may be copied to the vendor/cache folder of your rails app:

cd ~/path/to/rails/app
cp ~/mygems/cache/* vendor/cache/
bundle install --local

Why am I writing this? Because the last time my hosting provider updated the FreeBSD OS, I could not simply run bundle install, Instead I had to fetch some specific version of libv8 to get it all to work. There may be other ways – but this is what I found to work in my case.

Another note to self: The RubyRacer is quite stubborn with dependencies. You may want to try bundle update libv8 before going crazy with other stuff 🙂

Danish and other special characters with Ubuntu Linux on MacBook Pro

For a while I’ve been using Ubuntu Linux on my MacBook Pro. As a developer, or just someone who likes to be able to use standard keyboard commands in many applications, I find it convenient to use the English keyboard layout, even though the keyboard is fact Danish.

So, until nowm I had to switch between Danish and English keyboard when ever I wanted to use Danish special characters, Æ, Ø and Å. While it is indeed very easy to switch keyboards in Ubuntu, it kept confusing me because I would often forget which layout I was currently using, so I wanted to find a way to map some special typing to those Danish characters.

And today I found an article that describes a way, right here: https://en.wikipedia.org/wiki/Compose_key#Common_compose_combinations

There are few things to add to this, and again, this guide is specifically for MacBook (Pro) running Ubuntu Linux using English keyboard layout, although it may also work for others.

  1. Open the keyboard configuration (cmd, then ‘keyboard’, then enter)
  2. Choose ‘Typing’ in the left pane
  3. Select a compose key (I chose ‘Right Win’ which is the cmd key to the right of the space bar)

You are now ready to type Danish characters according like this:

æ: Press and hold the compose key, then type ‘a’ (you can release the compose key now or keep it down) followed by ‘e’

ø: Same as above, just using the keys ‘/’ and ‘o’

å: Same as above, just using ‘a’ and then ‘a’ again

Æ: Press and hold Shift in addition to the compose key, then type ‘a’ followed by ‘e’ (keep Shift pressed. Compose key may be released after typing ‘a’)

Ø: Press and hold the compose key, then type ‘/’. You may now release the compose key, but you can also keep it pressed. Then type ‘O’ (capital because of pressed Shift key)

Å: Press and hold Shift in addition to the compose key, then type ‘a’. followed by ‘a’ again (keep Shift pressed. Compose key may be released after typing ‘a’).

New job in Peytz Mail

This summer I turned my office-chair around to work in another department here at Peytz & Co – more specifically the Mail team. Here we are developing a very advanced platform for composing and sending out newsletters. The product is being used by prominent and demanding clients including Politiken, DR, FOA, Bonnier Publications, Beoplay, Storebaelt, TV2, 3F and many others, and is built in Ruby On Rails – a web application framework I’ve also been using for some of my own projects.

Developer / Team Tech Lead @ Peytz & Co

Since July 2016 I have been working at Peytz & Co, a company well-known for their excellent CMS-sites and various digital communication courses. What they also have is an applications team, and this is where I fit in. I was quickly assigned two very different but very interesting projects. First up was the Danish Red Cross who needed to have their system for the annual collections moved from an old platform to a new one. This was made with the PHP Symfony framework.

The next project was for TV2 and Metronome Productions – they needed a solution that would enable them to interact with over 200.000 viewers at once during their show known as ‘Fuld Plade‘, so we came up with a solution that involved a web application written in Go using NSQ queuing and Redis to ensure maximum performance. The solution also included a backend web application made with Symfony and an additional login server that would take some of the load off of the TV2 login system.