/home/martijn

My personal blog

Introducing PyWake

Recently I wrote a python script to take care of my wake-on-lan needs. It reads a json formatted config file:

1
2
3
4
5
6
7
8
9
10
{
    "hostname" : {
        "mac" : "xx:xx:xx:xx:xx:xx",
        "ip" : "10.0.0.101"
    },
    "hostname" : {
        "mac" : "xx:xx:xx:xx:xx:xx",
        "ip" : "10.0.0.102"
    }
}

The config file resides in ~/.wakefile.json. This makes it possible to include it in your dotfiles for easy updating.

PyWake sends the wol packet using the awake library to send the wol packet. After sending the wol packet PyWake pings the ip address specified in the json file until it gets a response.

New Arrivals

A few days ago my new laptop came in the mail: a ThinkPad E540. Mine is configured with a core i7, 16 GB ram, 16 GB SSD cache, a 1 TB HDD and a matte full HD screen. It was a custom order via the lenovo webshop, so it took about three weeks to build and ship it.

First impressions

My first impressions were very good. When I took it out of the box, it felt very solid. The case, is as expected from a ThinkPad, very rigid and doesn’t bend or twist. The keyboard feels solid. It has decent key travel and the room between the keys is just perfect for me. The comfort of the keyboard is very important for me since I used to have some RSI symptons in my wrists. On my desk I type with a Microsoft 4000 keyboard. That keyboard has provided some solace to my pains, swithing to Programmer Dvorak a few years later made my pains go away, even on laptop keyboards.

Linux

This laptop shipped with Windows 8 (yuk!). Since I use Fedora Linux as my primary OS one of the first thinks I did was installing it. The initial installation was a breeze, but then some problems sprung to my eye. Suspending to RAM didn’t work. Although the power led started to fade, the fan kept spinning and the system was stuck in this limbo. A second problem arose when I wanted to use the wired network interface. After resuming from suspend all packets would drop.

Troubleshooting

The first issue turned out to be a bug that was introduced after a firmware update. A workaround is to disable USB 3 support in the firmware. Fortunately the two USB 3 ports still function as your regular old-fashioned USB 2 ports.

I couldn’t find much information on the second issue, so I tried unloading the kernel module driving the interface: sudo modprobe -r r8169 before putting my laptop into suspend, and re-inserting it after resume: sudo modprobe r8169. That seemed to fix it, so I wrote a service to unload the module before suspend, and load it after suspend.

Pass 1.6 on Fedora

Recently I was looking for a better password manager. I used to use KeePass, but since I switched to linux as primary OS it has been at least to say annoying using KeePass. KeePass 2 has very nice Firefox integration using the KeeFox plugin. Unfortunately, KeePass is a .Net application, and even with mono, I could not get it to work. Even opening my database failed since password entering seems to be broken.

Then, I found pass. It lives in my shell and has a nice Firefox plugin. Installation was a breeze:

1
$ sudo yum install pass

It worked, but I missed search functionality. Searching was introduced in version 1.6.

1
2
3
4
5
6
7
8
9
$ pass --version
|-----------------------|
|   Password Store      |
|         v.1.4         |
|       by zx2c4        |
|                       |
|    Jason@zx2c4.com    |
|  Jason A. Donenfeld   |
|-----------------------|

It turns out that I am running an older version. Pass 1.6 requires version 1.7 of tree. That version is unavailable from the Fedora 20 repos, but it is available in rawhide. Switching to rawhide on a workstation is generally a bad idea, so I grabbed the rpm from the rawhide repos:

1
2
$ wget http://mirror.1000mbps.com/fedora/linux/development/rawhide/x86_64/os/Packages/t/tree-1.7.0-1.fc21.x86_64.rpm
$ sudo yum localinstall tree-1.7.0-1.fc21.x86_64.rpm -y

Then, grab pass version 1.6.1 from zx2c4’s website and install it:

1
2
3
4
$ wget http://git.zx2c4.com/password-store/snapshot/password-store-1.6.1.tar.xz
$ tar xf password-store-1.6.1.tar.xz
$ cd password-store-1.6.1
$ sudo make install

There you have it: the latest version of pass on Fedora 20