-
Connman and DNS
2017-03-09 I’ve been running Connman instead of NetworkManager for a week since it is supposed to be more lightweight. Lightweight is good.
However, I had really weird problems with DNS, where some hosts wouldn’t resolve.
$ ping outlook.office365.com PING outlook.office365.com (40.101.40.226) 56(84) bytes of data. 64 bytes from 40.101.40.226 (40.101.40.226): icmp_seq=1 ttl=238 time=44.7 ms 64 bytes from 40.101.40.226 (40.101.40.226): icmp_seq=2 ttl=238 time=44.6 ms 64 bytes from 40.101.40.226 (40.101.40.226): icmp_seq=3 ttl=238 time=44.8 ms ^C --- outlook.office365.com ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2003ms rtt min/avg/max/mdev = 44.625/44.755/44.890/0.267 ms $ ping smtp.office365.com ping: smtp.office365.com: Temporary failure in name resolution
We use Outlook 365 at work, please don’t judge me.
-
Mocking datetime in Python
2017-02-06 It might be that pythonistas really don’t like monkey patching, but as I couldn’t find a quick answer on how to mock time in Python I thought I write down here how I did it.
It’s no big deal really, just replace datetime in the module tested with a local implementation. In my case I wanted to to mock
datetime.utcnow
and to match the call I created a class withutcnow
as a static method. -
Setting Browser DPI Settings in Linux
2016-12-27 I have a Lenovo X1 Carbon that has a 14 inch screen with a 2560x1440 resolution. While not quite Retina Display quality, it still has enough pixels to make everything on the screen appear tiny with a regular 96 DPI setting. Trying to fix this in browsers by increasing font sizes breaks quite a few sites, while custom DPI settings works better.
Firefox
Open
about:config
and set the propertylayout.css.devPixelsPerPx
to the desired value, in my case 1.3. -
Emacs and Firefox on Debian
2016-12-21 I have once again switched browsers, the pendulum is now on the Firefox side. However when I changed my Emacs config to open links in firefox it didn’t work.
Instead I got the error message “Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system.”
It turned out that I had both the
firefox
andfirefox-esr
packages installed, andbrowse-url-firefox
tried to openiceweasel
instead offirefox
. Uninstallingfirefox-esr
solved it. -
System Fonts
2016-12-14 Lately I’ve noticed people mentioning the use of system fonts in web design. Supposedly it all started with Medium a year ago, described in this article. The idea is that the web experience should not differ that much from what the rest of the client UI looks like.
I think this is great, I’ve felt for a long time that the web should settle on some sort of UI toolkit for the most common tasks. It’s like the whole world is doing a Kai’s Powertools, if you remember that.
-
English Version of the SLADOS Talk
2015-06-07 I have translated the talk I gave last week at Agila Sverige to English, it’s available here.
-
SLADOS Talk At Agila Sverige
2015-06-04 I gave a dinner talk yesterday at the Agila Sverige conference which was fairly rantish about the state of the agile world. The text of the talk is available here (in swedish).
-
Docker Container Orchestration
2015-05-22 In the first post on how we moved our application to Docker on AWS, I described the reason for us to do it, and how we set up the servers. This post describes how we’ve organized the different Docker containers.
Container Setup On AWS
Our setup on AWS looks like this:
We use an EC2 load balancer to route traffic to our web hosts. This is an easy way to setup clustering, but you should be aware that EC2 does not allow for any alternative route or html page if no hosts are available. This means that if all instances are down for some reason, the only thing shown is a blank page. This has been a long standing feature request which for some reason hasn’t been implemented yet.
-
Moving a Single Server App To Docker on AWS
2015-05-15 Last fall, we moved the Qwaya Facebook ads tool from a single host on Rackspace to a clustered Docker based environment on AWS. This is the first blog post of hopefully more that I’m writing to remember what we did. I’ve planned two more posts, one on how we handle CI and one on container orchestration.
Why Docker?
The task at hand was not “Move to docker”, it was “get out of single host hosting”. The old deployment consisted of some quite complicated Fabric scripts that was run from an arbitrary developers laptop. The source code repository did not match the deployment setup, so there was a lot of remote copy commands running around. I know that this is a very common way of deploying applications, but it brings a number of problems. For example, there are no build artifacts, making repeatable builds harder, and if the build fails halfway in you will have a broken system.
-
Building AMI's Incrementally With Packer and Make
2015-05-07 At Qwaya we run our servers in AWS. We build our own base AMI’s in order to ensure a stable base infrastructure and to be able to quickly launch new servers when needed.
We have a few AMI’s arranged as described in the image below:
- The base image holds all the packages we want installed on all hosts, it sets up docker, logspout logging to Papertrail and [Datadog][datadog] monitoring.
- The Web and Worker images holds different systemd files for different parts of our application.
- We use Buildkite for building and deploying, which uses a bring-your-own technique for build servers. We have two kinds, one for building and one for deploying.
While we really should have our configs in something like Consul, we’re not there at the moment. In order to limit the number of AMI rebuilds, we try to place configs in cloud-init to limit rebuilds.