Nextcloud versions prior to 9.0.54/10.0.1 have a broken update mechanism. The nextcloud community stepped in with a complete replacement of the update tools, which require manual intervention however. The full procedure is described in step-by-step instructions on nextcloud’s github.

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

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

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. mysub.no-ip.info).

When you are used to code and debug in Qt Creator, it is very painful to work in Visual Studio to produce VS binaries of your libraries and applications. Luckily, both cmake and Qt Creator are incredible universal tools. They allow to build Visual Studio DLLs, LIBs and EXEs directly from Qt Creator, without the need to launch the Visual Studio IDE ever again.

In the following we give a complete walk-through to build Visual Studio binaries from a cmake managed project. Please note that though you are not going to use the Visual Studio IDE, you still need Visual Studio compilers installed on your system. We will use VS2013 below, though any recent VS version will do.

1. (Optional) Install cmake to PATH

The following is much easier if you install cmake to at least the user’s PATH. By default, cmake is not added to any PATH, and you might consider reinstalling cmake. If you skip this step, you must simply provide full path to cmake below.

2. Open a “Developer Command Prompt for VS2013”

You might already know the developer command prompts of Visual Studio. These are command prompts with special environment variables set up to have the correct VS compiler in the PATH (and much more). If you are on Windows 8 and you can’t find the “Developer Command Prompt for VS2013” in your Start menu, follow the steps in this answer here to make it available.

3. (Optional) Switch the developer command prompt to x64 mode

Please note: If you build x64 binaries, Qt Creator must have a Kit (Tools -> Options -> Build & Run -> Kits) for 64-bit available. The same holds for x86 binaries. If you installed Qt x64 only, you will have a x64 Kit only but you may add a 32-bit Kit not supporting Qt. If you compile a x86 project with a x64 Kit, you will get the following error message at link time:

4. Configure and generate NMake Makefiles

Now either use command line cmake or cmake-gui to generate NMake Makefiles for your project. NMake is the Makefile system to build with the VS compilers. For this, select the NMake Makefiles generator in cmake.

5. Build in Qt Creator

We are nearly done. Launch Qt Creator and Open Project …, where you select the main CMakeLists.txt of your project. Select the build directory from above run of cmake and check that the correct generator is selected. Click Run CMake and if everything looks fine, click Finish. When you build the project now in Qt Creator, you will generate Visual Studio binaries.

The Cause of the Problem

As we are comparing Visual Studio (2013) and gcc, we need to base our discussion on OpenMP version 2.0. Microsoft has not yet managed to support more recent versions of OpenMP, though version 2.0 was released in 2002.

After various benchmarks and experiments it turned out, that the distribution of work load (e.g. which thread processes which (chunk of) iterations) among the threads was the reason for the performance difference. The work load distribution is controlled by argument schedule, that is appended to the pragma directive

#pragma omp parallel for schedule(...)

The OpenMP specification defines the default scheduling strategy to be implementation-specific. Exemplary, Microsoft summarizes the implementation-defined behavior with respect to Visual Studio – and default scheduling is defined as schedule(static) with no further arguments. In the case of gcc / GOMP, this is documented as well, though a bit scattered. For scheduling, the default is schedule(dynamic,1).

Static scheduling divides the work-load into equal sized chunks and assigns the chunks to the individual threads in a round-robin fashion. This means, that it is defined at entering the for loop, which thread will process the i-th chunk. If – as in above case – processing of some chunks takes less time than others, we achieve a non-optimal speed-up. On the other hand, dynamic scheduling assigns a waiting thread simply the next chunk – all threads are busy as long as possible.

The Solution

Given the above, the solution was easy. Overruling Visual Studio’s default scheduling strategy static by dynamic resulted in comparable performance between gcc and Visual Studio.

#pragma omp parallel for schedule(dynamic)

Please note that according to the OpenMP specification, the default chunk_size for dynamic is 1. For more information on the choice of scheduling, see Appendix D on page 93 of the OpenMP 2.0 specification.

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.

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.

It’s that time of the year again. Upgrading to a new Ubuntu distribution release makes us fixing flaws and errors. What caught my eye this time were black corners of certain windows under gnome. Obviously, the rounded corners of the window’s top bar were not rendered correctly.

The Solution

Installing

sudo apt-get install gnome-tweak-tool

and starting

gnome-tweak-tool

lets us navigate to the Appearance tab. There, I had the Radiance theme selected for both Window and GTK+ for historical reasons. Changing the GTK+ theme to Adwaita (default) makes the corners disappear. Obviously, the observed rendering artefacts are a problem with the Radiance GTK+ theme and switching from it solves the problem.