Category: ubuntu

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).

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.

The Solution

As it seems, starting up the script /etc/init.d/ntp fails. Further research revealed, that package ntp was removed though not purged during the distribution upgrade. The startup script remained and failed to launch ntp, which is not found anymore. Either

sudo aptitude purge ntp

or

sudo aptitude install ntp

fixes the problem, depending on whether you want ntp on your system to automatically adjust time or not.

With the recent release of Ubuntu 15.04 Vivid Vervet I was wondering, why my Ubuntu system does not notify me about the new distribution release. After checking this and that, I remembered turning off notifications for any new versions except new LTS versions. Half a year ago I decided to skip 14.10 and got annoyed by the regular update notifications.

How to enable notifications about any new Ubuntu version

Start Ubuntu’s update-manager, for example from a terminal

update-manager

Wait until it downloaded the current package lists and you get presented with a dialog that has a Settings … button. Click on that button, change to the Updates tab and select at the very bottom For any new version as selection for Notify me of a new Ubuntu version. Click on close and quit the update manager.

Restarting the udpate-manager with the -c flag

update-manager -c

will make it check for new distribution upgrades. Finally, you get presented with a dialog that lets you Upgrade … to the next release.

The system freezes on start up with the boot logs on the display. X.Org does not start successfully.

Solution

To make Ubuntu start in graphical mode again, we will uninstall the fglrx drivers and use the default open source radeon drivers. This will give you graphical mode back again to further configure your Ubuntu installation (and eventually reinstall fglrx).

For this, restart the computer. In boot manager grub, select the default Ubuntu entry, press keyboard key E to edit that entry, and append an S to the line starting with linux. Pressing F10 will boot into runlevel super-user, that will give you a root shell. (Please note that you will not be able to perform the following steps in a root shell provided by Ubuntu’s Recovery mode.)

In the root shell, uninstall the proprietary fglrx driver

sudo aptitude purge fglrx fglrx-amdcccle fglrx-core fglrx-pxpress

and reboot (without modification of the grub entry this time). The system will now use the default radeon drivers and boot into graphical mode. In graphical mode, you may finally reinstall the fglrx drivers, if wished.

Diagnostics

After upgrading to Ubuntu 14.10 Utopic Unicorn, we can’t boot into Ubuntu anymore. On a dual boot system with both Ubuntu Linux and Windows 8.1 installed, the boot manager GRUB does not load. Instead, Windows is booted directly without any chance to select Linux.

After booting into the live system, follow the steps over here to chroot into your original Ubuntu installation and update-grub / grub-install grub from within there. Please note that the steps’ description on that page is in German. After a reboot, the system starts the grub boot manager again.

UEFI Secure Boot Specifics

On my system with an EFI installation of Ubtunu, I had to disable Secure Boot to be able to boot into Windows. With Secure Boot on, Windows failed showing a message similar to

/EndEntire
file path: (...)
error: cannot load image.

However, with Secure Boot turned off, Windows did not show up into grub after performing above steps.

Enabling Secure Boot,

running update-grub

and disabling Secure Boot again

made grub list Windows as boot option and Windows bootable from grub again.

ghostscript is a powerful tool to process Postscript and PDF files from the command line. A typical task is to flatten a PDF or to control the processing of images when converting from RGB to CMYK color space.

A post on superuser.com summarizes the most important options to control the compression (and filtering, resp.) of images in PDFs.

prevents from color conversion and a downsampling of the images. For more information on these commands and more options, have a look at the documentation of Adobe’s Distiller. The ghostscript options’ naming resembles the Distiller parameter names very closely.

Bad news first: It is not possible to directly save a PDF from Inkscape to CMYK color space without installing an extension. However, if you are OK with running a single command from a terminal, you may simply convert any PDF from RGB to CMYK color space.

For converting the PDF from RGB to CMYK color space, we use ghostscript. ghostscript is most likely installed on your Linux computer (it is available for Windows as well), and the conversion command reads as follows