ssh-agent, kwallet-pam, ssh-add and ksshaskpass under Plasma

Auto-unlocking of SSH keys through KWallet had been broken for me for a while. I finally got around to fixing it, so just tossing this out there in case someone is in the same boat.

I’m on Arch Linux, but the steps should be the same on other distributions I think.

Step 1: Install and configure kwallet-pam

pacman -S kwallet-pam

and load the modules from your /etc/pam.d/sddm:


auth            include         system-login
auth            optional
auth            optional kdehome=.kde4
account         include         system-login
password        include         system-login
session         include         system-login
session         optional auto_start
session         optional

This way, your KWallet is unlocked when you login. Note that your login and KWallet passwords must match, you must use Blowfish encryption for the wallet (not GPG), and the name of the wallet must be kdewallet (the default).

Step 2: Start ssh-agent through a systemd user unit file

Create ~/.config/systemd/user/ssh-agent.service with:

Description=SSH key agent

ExecStart=/usr/bin/ssh-agent -a $SSH_AUTH_SOCK


and enable the service with systemctl --user enable ssh-agent. Make sure you use and not, as at least I had problems with ssh-agent not starting early enough with the latter.

Step 3: Install and configure ksshaskpass

pacman -S ksshaskpass

Then create /etc/profile.d/ with:

export SSH_ASKPASS="/usr/bin/ksshaskpass"

This way, ksshaskpass, which will store your passphrase in your wallet, will be the preferred program to unlock your SSH keys.

Step 4: Run ssh-add on Plasma start

Create ~/config/autostart-scripts/ with:


export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"

ssh-add < /dev/null

Setting SSH_AUTH_SOCK is necessary, since apparently .bashrc is not picked up. Make sure you make the script executable with chmod +x.

Step 5: Export SSH_AUTH_SOCK also in ~/.bashrc

Make sure you have

export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"

also in .bashrc.

Hope this can be of use to someone else!

Help! Looking for thesis project in Stockholm area

(Sorry in advance for this slight abuse of Planet KDE, but I figured we might have a few Stockholm readers here.)

EDIT: I found a great thesis project through this post, yay!

I’m currently in my fifth year of the Computer Science program at KTH Royal Institute of Technology (time flies!), and I’m looking for a master’s thesis project this spring.

A little bit about me:

  • 30 years old.
  • Moved to Stockholm with my wife in 2010.
  • Keen interest in programming and software engineering.
  • Two-times participant in Google Summer of Code (Summer of 2009 and 2011).
  • Built an application level proxy in Java/Vert.x (Summer of 2013 and 2014).
  • Keywords: Linux, BSD, C, C++, Qt, Java, Python, Shell, Git, SVN.

Courses I’m taking at KTH this term include

  • Computer Organization and Components
  • Patterns for Large-scale Development
  • Program System Construction Using C++
  • Management of Technology

Topics covered include: digital circuits, C and C++ development, software engineering principles, design patterns, testability and maintainability of software, and project management. In the past I’ve taken courses on operating systems, databases, distributed systems, computer security and compiler construction.

As for thesis topics, I’m very much open to suggestions. I’m a hacker at heart, and I do love building things and seeing them used by other people, be they fellow programmers or end users. Being a master’s thesis project, it should of course be carried out in a scientific manner, and be followed by a thorough report.

Does your company have something you need built? An idea you would like to try out or something you want evaluated? Don’t hesitate to contact me at removed because of spam and we can discuss. I’ll send over my CV, including references, and a full results transcript for my completed courses.


Documentation Generator for Google Protocol Buffers

As part of my summer job these past two summers I’ve had to work quite a lot with Protocol Buffers, Google’s data interchange format. The Protocol Buffers compiler (protoc) takes message definitions like

message Person {
  required int32 id = 1;
  required string name = 2;
  optional string email = 3;

and generates C++, Java or Python code for message manipulation and (de)serialization. Protocol Buffers has been around for a while, and nowadays there are cooler kids on the block like Cap’n Proto and MessagePack. But Protocol Buffers remains a quite popular serialization format, and it is widely used.

One thing that always bothered me is that Protocol Buffers has no built-in support for documentation comments, something like Doxygen or JavaDoc. I found one third party tool, but it could only generate DocBook and was quite Windows-centric.

Long story short, I wrote my own little tool. It’s quite simple, but supports /// or /** */ documentation comments for messages, fields, enums and enum values within Protocol Buffer message definitions. Like this:

 * A Person is something with a personality.
 * Most of the time...
message Person {
  required int32 id = 1;    /// How impersonal...
  required string name = 2; /// Yay!

  /** Optional? In this day and age?! */
  optional string email = 3;

The tool works as a plugin for the protoc compiler. It runs on Linux, Windows and Mac OS X and can output HTML, Markdown or DocBook documentation natively, with support for custom output formats through Mustache templates. See the GitHub repo for more examples and sample output.

I hope someone else finds it useful :)

Opinions on Lenovo X220?

(Sorry in advance for this possible misuse of the planet, but I feel this might be geeky enough).

My old Fujitsu-Siemens Amilo Si1520 laptop, which has served me well all in all, has started to fall apart on me hardware-wise. Since I recently got hold of a bit of extra cash, I’m looking for a replacement. I’m considering the Lenovo X220. It’s basically the same form factor as my current one, which is nice since it’s what I’m looking for. And it seems it has gotten some good reviews. I’ve never owned a Thinkpad, or an IBM/Lenovo machine for that matter.

Anyone have an X220 who can give me the inside scoop on what annoys you most about the machine? I see in the spec sheet that it’s certfied for Redhat/Novell/Ubuntu, but has anyone had any problems getting things to work?

If I get this model, I’d probably be getting the Core i7 one, but without an SSD since I already have a 180 GB SSD to put in it.

Thanks for any answers/recommendations!

Brief GSoC Update — Interactive Table Resizing and Cell Selections

Hi everybody,

In the coming days, I’ll try to write a longer post with more technical details about my recent work on the project. Until then, here’s a short screencast showing some of the new features; interactive table resizing and cell selections. This time it includes me speaking a bit (!). And the format is now WebM/VP8 instead of Ogg/Theora. White areas in the capture got some weird tinting, but that’s a screencasting problem and not my code :)

Download Video (~12 MB WebM)

Bye ’til next time!