Apr 22, 2017

How to fix the PocketCHIP for Vim

I ordered me a PocketCHIp to have a cheap, portable Linux computer with a physical keyboard with the added benefit if it running Debian out of the box. I quickly discovered that in Vim the dash or minus key is not what you'd expect. A quick search turned up that the key is mapped the numpad minus via xmopmap. To change the mapping to what is for me a better setting run sed -i 's/KP_Subtract/minus/g' ~/.Xmodmap and to apply the setting afterward run xmodmap ~/.Xmodmap.

Jan 17, 2017

VirtualBox extensions

I happened to run into a Vagrant image today that required the USB2 controller extension to VirtualBox. The procedure to install the extension pack was not immediately clear to me.

Installing through the VirtualBox GUI

When trying to go through the VirtualBox GUI, the application would close when I clicked on 'add new package' in the preferences window. Guessing it had something to do with root privileges I tried to run the GUI with sudo but that failed because I'm using Wayland and it could not find display :0. Using Gnome3, gksudo is no longer available and the replacement is pkexec which uses PolicyKit. running pkexec VirtualBox opened the nice Gnome3 authentication prompt but resulted in the same error. Giving up on starting the VirtualBox GUI as root, I moved my efforts to the VBoxManage CLI.

Installing with the VBoxManage CLI

Here are the steps I took to successfully install the extension pack:

  1. Find the version of VirtualBox you have installed by running VBoxManage --version.
  2. Download the matching version of the extension pack from https://www.virtualbox.org/wiki/Downloads if you're using the latest version or from https://www.virtualbox.org/wiki/Download_Old_Builds if you're using an older version.
  3. Assuming you're using version 5.1.10, install the extension pack by running VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-5.1.10-112026.vbox-extpack. For me, this opened the same nice Gnome3 authentication prompt.

Nov 01, 2016

Testing DNS with a clean cache

Every so often I make changes to a DNS record, test it, find out it's wrong, fix it and still get the old response because of caching somewhere along the line. After it happened to me and a colleague during a launch of a new version of a website, I decided to address the issue. I wanted a way to test DNS quickly and easily (preferably locally on command line), for it to be lightweight, doesn't require changes to my existing setup and doesn't require learning new tools. I decided to create a Docker image that has its own DNS resolver and each new container from that image has a clean cache and doesn't depend on other DNS servers or is affected from their caching.


To create a new container:

docker run -it adarnimrod/resolver

Inside the container you have access to nslookup, dig and mail for testing purposes. If you need to test new changes, exit the container and create a new one with no cache.

If you want to run just a single command (like getting the MX record for shore.co.il):

docker run adarnimrod/resolver dig +short shore.co.il mx

How does it work

On launch, the container runs and uses its own DNS resolver (in this case NSD). This way the OS caching or upstream caching don't interferes with querying and every new container starts with an empty cache.