Merging multiple PDFs into a single PDF with ghostscript

My favourite open source vector graphics program inkscape is not capable of producing multi-page PDF output. However, with open source dinosaur ghostscript, it is possible to merge multiple PDF files into a single PDF file with a single command.

Let’s assume our multiple PDF files are named file1.pdf, file2.pdf, file3.pdf and file4.pdf. Then, the following command merges these in this very order into a single PDF file called fileAll.pdf

gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=fileAll.pdf file1.pdf file2.pdf file3.pdf file4.pdf

Please note that the order of the input files matters and determines the merging order in the final PDF.

Creating self-signed SSL certificates on Debian / Ubuntu

You have probably come across SSL certificates already. This is a public key of a public key cryptographic system additionaly signed by a certificate authority (with the authority’s public key). This short step-by-step tutorial guides you through creating a self-signed certificate on a Linux-based system.

1. Generate server’s private key

openssl genrsa 1024 > server_private.key

Usually, another cipher (e.g. -des3) is passed to the genrsa pipeline to further protect the generated key file by a password. For setting up a HTTPS server, this additional password protection would require to provide this password to the web server. So we do not encrypt the private key, but protect it with very restrictive permissions instead.

2. Generate a self-signed certificate

openssl req -new -key server_private.key -x509 -days 365 -out server_public.key

Tip: There are separate man pages for each of the openssl sub commands. So check out man req for more details on the arugments. The above will create a certificate valid a year.

This command will ask you about some details about your organization. Provide all of these details as some clients might reject the certificate, if these are missing. In particular, the Common Name must match the server’s domain name (e.g.

3. Finalizing the certificate

A PEM file stores the private key followed by the public key, so we

cat server_private.key > server_cert.pem
cat server_public.key >> server_cert.pem

The PEM file is made available to the web-server. The public key file may be simply renamed to .crt ending:

mv server_public.key server_public.crt

and used as public key with the client.

4. Setting up the web server

For the setup of your web server, refer to the web server’s documentation.




1. (Optional) Install cmake to PATH


2. Open a “Developer Command Prompt for VS2013”




VC\vcvarsall amd64


4. Configure and generate NMake Makefiles


5. Build in Qt Creator


OpenMP Performance Issues: Visual Studio vs gcc

The Problem

Parallelizing a for-loop comprising a million of iterations with OpenMP

#pragma omp parallel for


The Cause of the Problem



#pragma omp parallel for schedule(...)



The Solution


#pragma omp parallel for schedule(dynamic)


hub 3-1:1.0: hub_port_status failed (err = -110)

The Problem

On a Debian Linux Jessie 8.1 installation  with standard kernel 3.16.7-ctk11, running on an Asus J1800I-C motherboard, the system logs got spammed with


messages, when no USB devices are connected.

The Solution

Blacklisting USB related kernel modules in a trial and error procedure revealed that the ehci-pci kernel module was the cause of the problem. For a temporary solution, simply remove the kernel module

rmmod ehci_pci

For a permanent solution, either blacklist the module via kernel boot arguments, e.g.


or via /etc/modprobe.d/ as described here.

Please note that blacklisting ehci_pci will also prevent kernel module ehci-hcd from getting loaded. The ehci* kernel modules are the kernel’s USB 2 drivers. Luckily, the USB 3 kernel modules xhci* support USB 2 devices as well and you will experience no performance loss with these.

console-kit-daemon[…]: GLib-CRITICAL: Source ID […] was not found when attempting to remove it

Recently the logs of a Debian-based Raspbian system were flooded with messages of the type

console-kit-daemon[...]: GLib-CRITICAL: Source ID [...] was not found when attempting to remove it

This specific Raspberry PI is running without any X11 installed, so consolekit is not needed anyways. Hence, I decided to uninstall consolekit and its dependency policykit-1

sudo apt-get purge consolekit policykit-1

to free up some more ressources.

This post is partly based on that one here.

Ubuntu 15.04 Vivid Vervet – Please enter passphrase for disk … (cryptswap1) on none

After upgrading to Ubuntu 15.04 Vivid Vervet, the startup process stopped with the message

Please enter passphrase for disk [DISKNAME] (cryptswap1) on none

Hitting enter made the boot process continue, but I ended up without active swap partition.

systemctl status dev-sda5.swap

did not reveal any further helpful  information.

The Solution

After some online research I learned that activating an encrpyted swap partition (created because of requesting an Encrypted home directory during installation of Ubuntu) made problems for months on Ubuntu. Referring to the swap partition by UUID on the one hand, with a swap partition overwriting that UUID on the other hand were identified as roots of the problem. With Ubuntu 15.04, this got finally resolved – the upgrade instructions in that post helped me to solve above issues. However, for a final solution, this archlinux wiki page turned out to be most helpful.

On my system, the configuration in /etc/crypttab pointed to a swap partition on /dev/sda4, while it was located on /dev/sda5.

Edit /etc/crypttab to point to the swap partition not by UUID, but rather by-id, e.g.

cryptswap1 /dev/disk/by-id/... /dev/urandom swap,cipher=aes-cbc-essiv:sha256

Then reboot. If the system continues to ask you for a password, the swap partition might store a LUKS header that prevents the system from using it as a swap partition right away. With

sudo dd if=/dev/zero of=/dev/disk/by-id/... bs=512 count=20480

the first bytes of the swap partition get zeroed out, and the system start without asking for password for the swap partition.




The Solution


sudo apt-get install gnome-tweak-tool

and starting





The Problem

After upgrading to recent Ubuntu 15.04, I observed an

Failed to start LSB: Start NTP daemon
See systemctl status ntp.service for details

error message from systemd during startup. Doing as told

systemctl status ntp.service -l

we get more verbose output:

 ntp.service - LSB: Start NTP daemon
   Loaded: loaded (/etc/init.d/ntp)
     Docs: man:systemd-sysv-generator(8)
Apr ... systemd[1]: ntp.service failed.

The Solution


sudo aptitude purge ntp


sudo aptitude install ntp
