Arun Stephens

Why does Docker restart all containers regularly?

For as long as I can remember, every now and then all my Docker containers restart. I had no idea why. I am running Ubuntu 16.04 LTS (Xenial). I got the exact start time of my containers like so: docker inspect --format='{{.State.StartedAt}}' <CONTAINERID> (Thanks to Tim Robinson for that bit of magic.) Then I looked in the syslog for entries around that date. (I used lnav to make that a bit easier to do. Read more →

View a config file without comments

Sometimes you have a config file that has is heavily annotated (which is great). But sometimes you just want to see the actual configuration without all that help text. Use grep’s -v (invert) option: cat config | grep -v \# (Note that the # has to be escaped.) Read more →

Importing a Maildir using Dovecot

I’m looking into using Dovecot as a way to store all my old emails (I have emails going back 20 years would you believe!) Before I commit to it though, I am testing how easy it is to migrate between servers. To import the contents of one Maildir into Dovecot, use the following: doveadm -Dv import maildir:<path> "" all Where: -Dv means verbose debugging. You don’t need that. maildir:<path> tells Dovecot where to get the emails from, and that they’re in the Maildir format. Read more →

Re-signing an Enterprise iOS app

If you have an in-house app that you’ve distributed across your organisation as part of the iOS Enterprise program, you may find that the app stops working or installing. This is likely because your provisioning profile and/or certificate has expired. If you look at the console (in Xcode, Devices), you’ll see something like: Apr 26 15:05:58 iPad amfid[3086] <Error>: SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName] Apr 26 15:05:58 iPad amfid[3086] <Error>: /private/var/mobile/Containers/Bundle/Application/256F1EAD-8F72-49CA-AC96-A50CD52F788A/ not valid: 0xe8008015: A valid provisioning profile for this executable was not found. Read more →

Setting up SSL on an AWS Elastic Load Balancer

Here’s how to get an SSL certificate (from DigiCert) and install it on your AWS ELB. Step 1: Create the CSR SSL is a form of PKI (public key infrastructure) encryption. It requires a key pair, which is usually generated by the user. Ideally the private key can be kept private, never moved from the computer on which it was generated. This isn’t the case for ELBs though. The following steps need to be performed on a machine that has OpenSSL installed. Read more →

DOS to Unix line endings with bash

This is a command that works in Git Bash on Windows to recursively replace \r\n line endings with \n. It uses Perl. There’s probably a version that uses sed. find . -name "*" -type f -exec perl -pi -e 's/\r\n/\n/;' $* {} \; This solves a problem where, on Windows, using Vagrant and Puppet, DOS line endings result in this error: Could not evaluate: /usr/bin/env: ruby Read more →

Replacing a domain name in WordPress with sed

I often need to do this, but always forget the syntax. So this is more for my reference than anybody else’s: sed 's/<OLD DOMAIN>/<NEW DOMAIN>/g' <INFILE>.sql > <OUTFILE>.sql It is just simple find and replace, so will also pick up domain names in email addresses, etc. Read more →

Samsung S4 browser slow with bad performance? Force Chrome on Android!

The stock browser on the Samsung Galaxy S4 (launched with the “Internet” icon) has notoriously poor performance, particularly with JavaScript. In my particular case, I was trying to run an animation created in Adobe Edge. Chrome, on the same device, however, was flawless. Why the new Samsung browser is worse than the old one from the S-III is a topic for another conversation – one that I am never going to have now that I have found this solution. Read more →

Core Data validation errors appearing twice, multiple times

Stupid thing really. I’m using validation in Core Data for the first time. I have a managed object, it fails validation, which is good. I fix it, and save again. There should be no validation errors. But there are. Why? The original, failed, managed object, is still in the managed object context. So even though my newly created second object passes validation, the other invalid one is still in there, trying to be saved, constantly failing. Read more →

What can I do on Windows 3.1?

I installed Windows for Workgroups 3.11 over the weekend. Finally got networking up today. I’m writing this post from Netscape 3.0. I tried to install IE5.01, but it can’t do much. I had to turn JavaScript off on both of the browsers, because they just can’t handle it. Nothing works. Neither of these browsers let me log into Gmail, because they don’t support high enough encryption. Mobile versions of sites don’t work because the browser doesn’t support XHTML. Read more →