Archive for the ‘Linux’ Category

Relative paths in Desktop Entry files

I was playing around a bit with Desktop Entry files which provide a nice facade for hiding the execution details of a desktop application. However, a somewhat odd limitation is that relative paths are not supported. At least for the Exec key, I found a nice solution which makes use of bash and the %k field code allowed for the Exec value.

[Desktop Entry] Version=1.0 Name=Run Comment=Runner Test Application Exec=bash -c 'cd $(dirname %k) && ./runner-linux-x86_64/dist/bin/run --app application.ini' Path= Icon=/usr/share/icons/hicolor/scalable/status/application-running.svg Terminal=false Type=Application Categories=Utility;Application;Development;

The code above presumes that the application to run is at runner-linux-x86_64/dist/bin/run, relative to the location of the .desktop file.

E: tzdata: subprocess installed post-installation script returned error exit status 1

I got the above error while attempting to install updates on a Linux Mint system. This thread provided a few possible solutions, none of which worked for me (though I was glad I discovered the grub » recovery mode » repair broken packages option, which might come in handy in the future). Digging a bit, I ran:

dpkg --configure tzdata

and noticed,

debconf: DbDriver "config": could not open /var/cache/debconf/config.dat

There was no /var/cache/debconf/ directory and, as indicated here, simply creating it would provide a fix. So a simple:

sudo mkdir /var/cache/debconf

… and I was good to go!

Linux threading model

Like many (I’m guessing) I was under the assumption that processes incurred a higher cost on performance compared to threads. On Linux, at least, this appears to not be the case,

Linux uses a 1-1 threading model, with (to the kernel) no distinction between processes and threads — everything is simply a runnable task…

More details in the comment on stackoverflow.