Posts filed under ‘Uncategorized’

Ubuntu, Scribus and PDF: how to reduce the size of a HUGE PDF file

It has been a while since I published anything about using Ubuntu and Ubuntu software. Does this mean that I switched to another OS in the meantime? Not at all. I am still using Ubuntu, and I am now at version 16.04, still on a perfectly working legacy HP Workstation. Apart from basic things like mail, Office processing, Whatsapp, etc., I also use one program a lot on that machine: Scribus. I use Scribus primarily to create an online sports newsletter. Scribus is really, really good for creating newsletters. However, it tends to generate huge files…with a couple of photos on each page out of e.g. 5, a PDF file of GOOD quality will easily be about 15 MB, and can grow to 30 MB, if you want to have real good quality. Now if you want to send such a HUGE file to some mail distribution list – then can have a small issue…Let me just share a very quick tip on how to reduce PDF files from e.g. 30 MB to 1,25 MB (which is quite reasonable for mass mailing a PDF). Use the gs terminal command:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress -dNOPAUSE -dQUIET -dBATCH -sOutputFile=blabla-pdf blablainput.pdf

Just give it a try. Happy Scribus Time!

19/11/2016 at 3:13 pm Plaats een reactie

MacBook Air remote sessions to Windows and Linux with Thinlinc

To fully understand this article, please read my previous articles on Thinlinc. Just search this site for keyword Thinlinc.

On March 4 of this year, Thinlinc released a beta version of their Thinlinc Mac OS X client. Thinlinc is the Open Source Thin Client solution in a mixed Linux / Windows world.

Until today, I hadn’t installed or used any Thinlinc client on my MacBook. I occasionally used Thinlinc on my MacBook, using the HTML5 based web client. It was enough for, e.g. reading and answering my e-mail, but not enough for a true desktop experience. Which, at least, should include sound support, and of course excellent video support.

With the new (beta) Thinlinc client for Mac OS X, sound and video support for MacBook Air is just rocking. One of my favorite performance tests for a remote desktop session (Linux Ubuntu as remote host /Thinlinc server) is a video on YouTube: Rammstein, Hier kommt die Sonne. This video  is full of video and sound effects. Performance of this video is excellent with the Thinlinc client for OS X , even over a SOHO WiFi extender (provided that your WAN bandwidth is sufficient)  😉

What struck me most, was the ease of installation of the Thinlinc client on the MacBook. Search Google for Thinlinc nightly builds, and select the Nightly Build Client Bundle. Once downloaded, open the download in Finder, and open the folder client-osx. Double-click on tl-4.3.0post_4693-client-osx.iso.

You will be presented with a window asking you to drag an icon to your starter menu.


Just drag the icon. Start the program. Off you go. Select the appropriate Thinlinc menu options, including sound, and mounting of local storage and printing. (this addition was done later, suggestions by Bas Auer, see comments on this article).

Mounting of local storage will allow you to copy and paste files vice versa from and to your Thinlinc host server and the Macbook. Your Macbook local personal folder will show up in Thinlinc sessions as /home/username/thindrives. All files from your Macbook local personal folder will be available under this virtual folder.

Schermafbeelding 2015-03-19 om 19.41.09

And what about printing. Well, there is nothing to add, because it really just works. No printer to add locally on the Macbook. Just connect to Thinlinc and start printing.

Again, and as stated in previous articles: Thinlinc just rocks.

15/03/2015 at 4:35 pm 2 reacties

Backing up Ubuntu home folders through far cousin OS X

As a general rule, I always make a full backup of all personal folders on my home Ubuntu 12.04 machine at least every two weeks. I don’t use scheduled backups. Backup for a private machine is just a thing I like to do manually, on a lazy Saturday morning with my first cup of coffee. I use Deja-Dup, and backup to a local USB device, with sufficient free space. Normally, I just have to plug in the device, and then start the “all personal folders” backup with this terminal command: sudo deja-dup-preferences. I then backup to this NTFS formatted disk (name: TOSHIBA EXT). Note that the default name contains a space.  But why NTFS? Simply because I never bothered reformatting it as ext3, or whatever Linux file system. Until now, my Ubuntu 12.04 machine had always detected the USB disk, so why should I care?

This morning however, when plugging in the USB disk, it was not recognized by the operating system. Kernel problem? Hardware failure? I don’t know, and frankly, I don’t care too much…as long as I have my Saturday morning coffee and my weekly backup. I guess I’ll just have to wait for an Ubuntu update, to have the USB disk get detected again on my primary machine. And if really it’s a hardware problem, well, then let’s already look for a cheap alternative, and use it straightaway. And be creative, on a Saturday morning with a couple of coffees.

I also use a MacBook Air, that came with my new job as system administrator. I had already noticed that the backup USB disk was perfectly detected by this MacBook Air. So basically, I would have my backup, if I was able to access the USB disk, over my private network. Now I had two challenges:

– allow this MacBook to be accessible through SSH. Deja-Dup can use an SSH session for backup ;

– allow the NTFS disk to be read-writable, when attached to the MacBook. By default, NTFS devices are read-only when attached to Mac OS X.

Allow SSH on a MacBook is a breeze. Just start System Preferences – and allow SSH – see this print-screen.

Schermafbeelding 2015-01-24 om 18.03.17

Allowing an NTFS formatted USB drive to be read-writable on Mac OS X: well, just have a look at the following example, and create the /etc/fstab file with the following content:


toshiba usb etc fstab content


If you want to test it yourself, please notice how to escape the space in  the device name: backslash followed by 040.

Plug in the USB disk after creating this file, and you’re off!!! Your USB NTFS formatted disk will be accessible through SSH. And, thus, backup over SSH with Deja-Dup, to a MacBook with an NTFS formatted external disk.

Schermafdruk van 2015-01-25 10:06:13

Right now, my backup to the USB device, over SSH to the USB disk is running…

In the meantime I switched from coffee to a fine glass of wine, since I am writing this post in the evening. And off preparing some stamppot boerenkool for, my kids, my wife and me.

24/01/2015 at 6:20 pm Plaats een reactie

The Gimp Resynthesizer: a real world example

During a walk yesterday, I took a photograph of a herd of sheep grazing at an abandoned railroad (click the picture to view the complete image).


I liked the picture very much, but I was not so fond of the two steel constructions in the middle and at the right edge of the picture. Nor did I want to keep the streetlights (two small white bulbs to the right of the picture). I wanted the same picture, but without these objects.


Thanks Gimp, thanks Gimp Resynthesizer. Is the modification perfect? No, it isn’t. But is it good enough? Well I guess so, since it took me less than five minutes to get rid of these elements. With a little patience and tweaking, the result would have been more precise. If you look carefully, you can still see the traces of the modification in the center of the picture. But I doubt whether Photoshop’s Content Aware Fill would have done a better job…

14/05/2014 at 7:30 am Plaats een reactie

Ubuntu 12.04 and Steam games with Nvidia Quadro FX 1700 video card

As described in my three previous articles,  my base home computer is a HP xw6400 workstation (64-bit). It has an Nvidia Quadro FX 1700 video card with 512 MB dedicated RAM. With the appropriate Nvidia driver, this is more than enough for my kids to play, for example, Steam games.


Steam games need high quality video. They are being developed natively for Linux, alongside Windows.

With the default installation of the Ubuntu 12.04 driver though, you do not get the high quality video that is required for these games. At first, I tried to solve this problem by enabling an extra driver in Ubuntu.

extra driver

This left my system in an unstable state, resulting mainly in a computer session returning spontaneously to the login screen. So if you have a system with an Nvidia Quadro FX 1700 card, do not try to install an extra video driver this way.

Next, I tried the driver from Nvidia themselves. The base file for installing this driver is

To install this driver, I did the following.

– I downloaded the file to /home/username/Downloads/nvidia/
– I pressed Ctrl-Alt F1 – This brings up a terminal instead of the graphical screen. If you get there…don’t panic. Ctrl Alt F7 will always switch you back to your graphical session
– I logged in as myself. NB: Next, all commands hereafter are terminal commands.
– I temporarily stopped the graphical screen:
– sudo sulogin (enter your password)
– service lightdm stop  -> this step is essential to be able to install the driver! If you don’t stop lightdm, you will get the following error message.

nvidia running x server
– cd /home/username/Downloads/nvidia (enter)
– sh <- to to enter this command, just type sh followed by NV, and then press TAB. The command will autocomplete. Next, I used TAB to do my selections in the menu.
-From that moment on, I simply followed the on-screen instructions. When I got to a question about DKMS, I first hesitated if I would use this feature. DKMS is a framework designed to allow individual kernel modules to be upgraded without changing the whole kernel. Without DKMS support, I would be forced to redo the above work, each time I would get a new kernel through the Ubuntu update channel. Well, DKMS support worked flawlessly, as I was able to see the next time I had a kernel update (<- check in your Ubuntu software center that DKMS is installed!)
– After finishing the Nvidia wizard, I rebooted the workstation: shutdown -r now.

Well after that, I had a very fine working Nvidia Quadro FX 1700 card with an extremely stable driver.


Happy steaming on Ubuntu!

29/04/2014 at 7:10 am Plaats een reactie

Ubuntu, Remote Desktop and Windows Remote desktop (3): ThinLinc

This article is a continuation of two previous articles: Ubuntu, Remote Desktop and Windows Remote desktop (1 and 2). It is advised to read those two articles first.

In my previous article, I have explained how to auto-start and auto-pause a VirtualBox VM with Ubuntu. Now let’s see how we can use this feature in a broader context: using a remote desktop solution that enables remote usage of Linux and Windows desktops, from any device, and basically, from anywhere. Anywhere includes access to internal computers from the Internet. For the latter, and with the product that I use for it: a good firewall protection (maybe double), a correctly working DNS, understanding of Network Address Translation and understanding how to harden an SSH server at least with Public Key Authentication are essential. I won’t go into details about accessing an internal desktop from the Internet with the solution explained below. Suffice it to say that I do so. But since security is essential, I won’t publish any details. Numerous articles on the Internet explain items like SSH, alternate SSH ports, Public Key Authentication, Port Redirection, etc.

 For remote access within my home network, I use a free ten user version of ThinLinc, which I installed on my HP xw6400 Workstation with Ubuntu 12.04.  ThinLinc is a Thin Client solution based on Linux. It has excellent sound and video support. In my home situation, even when accessed over two wireless simple SOHO access points, the sound and video quality of e.g. a complex Youtube movie is still acceptable. In other words: ThinLinc just rocks. One more thing though: I strongly advise to install this software on Ubuntu versions that are supported by ThinLinc, and not to try the software on non-LTSP versions of Ubuntu. Ubuntu 12.04 is supported, according to the documentation.

I won’t go into details about the installation of ThinLinc. An excellent instruction, though of an earlier version than the current one, can also be found on Youtube. It is also very well explained in their online documentation.

By the way, ThinLinc has many, many more possibilities than I use in my home network. I just use a fraction of their numerous options.

Anyway, if you’re interested in trying this solution, take your time to read their online installation documentation first, because for the rest of this article, I assume that the reader is familiar with ThinLinc terminology.

Next, have a look at what you can achieve with their software with their online demo.

Also, first create an Ubuntu test virtual machine to familiarize yourself with the installation procedure. Then next with the knowlegde you gained, proceed to a real life installation.

What I myself remember of the installation, is that it was not difficult. Having already installed an Apache web server (sudo apt-get install apache2) but not the SSH server, the installation procedure corrected this issue by installing all missing pieces directly from the web. In less than half an hour, I had a fully functional ThinLinc server.

After having logged in to the admin web interface, I enabled two profiles, and disabled the rest.

thinlinc profiles

The Unity2D profile allows encrypted remote sessions to Linux machines where the VSM Agent is running. So if the VSM Agent is running on the same machine as the VSM server, the profile chooser will contain an option to connect to exactly the same server. Well, since I have only one physical machine… And that’s already the whole trick for remote sessions to your own Ubuntu machine.

 The Windows profile allows encrypted remote sessions to Windows machines where the ThinLinc WTS Tools are installed. Here, the trick is quite simple as well: under Application Servers, just point your default to the Virtualbox VM (with WTS Tools) that is auto-stated at boot time of the Ubuntu host.

thinlinc RDP server

The result, when starting a remote Thinlinc session, is the following.

tl profile chooser

Mind that for this remote desktop example, I use the HTML5 client: no client software on the client device, just a plain and simple (encrypted) HTML page in FireFox. Ready to install clients are available as well.

When clicking on Unity2D, a session is established to the Ubuntu desktop where the ThinLinc software is installed.

ubuntu session

And when choosing my Windows Desktop…a session is established to the VirtualBox VM that was auto-started…at boot time of that same Ubuntu Desktop machine.

ThinLinc remote session to Windows

Oh, and did I already mention that in this way, I am able to print from any device, to the printer that is attached to exactly the same Ubuntu host? Because that is another thing: Thinlinc allows printer redirection as well.

So basically, whether accessing a web page or using the Thinlinc client…off you go with an Open Source solution that allows you to connect to Linux and Windows your computers from any device in your home network!

Learn and have fun!

19/04/2014 at 8:48 am Plaats een reactie

Ubuntu, Remote Desktop and Windows Remote desktop (2): How to auto start (and pause) a VirtualBox VM at boot time and shutdown

This article is a continuation of my previous article: Ubuntu, Remote Desktop and Windows Remote desktop (1)

As soon as I decided to re-publish my WordPress blog (it had been offline for a couple of months), I noticed that one of the more popular articles is the article about X2Go . X2Go is a remote desktop solution for Linux, and is a fantastic product. Maybe I could have used it for my home network, but when doing this home network project, X2Go was not yet feature-rich enough.  As stated in my previous announcement, I would like to discuss the way I have organized my home network with Thin Client / remote solutions, with a combination of a couple of products. For a general overview, check out the picture in my previous article.

Ubuntu 12.04 Desktop version (LTSP) I personnally prefer Long Term Support versions (LTSP), since, generally speaking, these LTSP versions are more stable than the non-LTSP releases.

Virtualbox, which will auto-start a Windows 7 VM at boot time of the Ubuntu Desktop, and auto-pause this Windows 7 VM at Ubuntu Desktop shutdown.

Thinlinc . I believe that this product is, by far, the best commercial product for any Linux based thin client / remote solution, whether intended for a remote Linux or Windows Desktop. And best of all: it comes with a free 10 user version. I guess that this is more than sufficient for an average home usage…

Let’s first talk about some basics.

First I installed my Ubuntu “Desktop server”. It would be used, later on, as remote, say, Linux RDP server, with a virtual Windows 7 box inside. For the whole project I bought, an old HP xw6400 workstation, at less than 300 euro. It’s a 64-bit machine, with only 8 GB RAM, and a 1 TB disk, and it’s the HP XW6400 shown in my previous article.

On this machine, I installed Ubuntu 12.04 Desktop Edition. As shown in the screenshot, I did a custom partitioning of the disk:



– A boot partition (/boot) of type ext2
– a swap file partition of 2 GB
– an extended 900 GB partition (“/”; this would contain the user data)
– an extra /vms partition (this would contain the files for VirtualBox VM’s up to 100 GB)

The VirtualBox part

Okay, now let’s get started with VirtualBox: how to auto-start and auto-pause a (Windows) VirtualBox VM at boot time and at shutdown. This Windows VM will be used, later on, in the Thinlinc Remote Desktop solution.

Basically, I simply installed VirtualBox. If I remember well, I did not use the Ubuntu Software Centre to install it. At that time, I used virtualbox-4.2_4.2.6-82870~Ubuntu~precise_amd64.deb from I guess there’s a more recent version now, check it out at Virtualbox.When defining the location of the files for the Windows VM, I chose /vms (which I created earlier). For the rest, I simply did a normal install of a VirtualBox Windows VM, so I am not going into details about that.

But now, here comes the first trick: how to auto-start and auto-pause the VM at boot and at shutdown time.

First, you need a script that I found on I tried to find it back for reference, but It seems to be gone from SourceForge. However, the original script can still be found at   Here is the content of my /etc/init.d/  windows script: vbox-windows7ultimate.

Mind your VirtualBox VM name: stick to lower case to avoild errors, and avoid space in the name of the VM.

Since the file is self-explanatory, I simply copy / paste the content here:

#! /bin/sh
# chkconfig: 2345 90 10
# Provides: vbox-windows7ultimate
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: ‘windows7ultimate’ virtual machine
# Description: Starts and stops a VirtualBox host as a service.

# Author: Brendan Kidwell <>
# License: GPL 3 <;
# Based on /etc/init.d/skeleton from Ubuntu 12.04.

# What is the name of the VM exactly as it appears in the VirtualBox control
# panel? This is the ‘name’ and the ‘long name’ of the VM.
# Does ‘name’ contain spaces or other special characters? If so, you must
# make up some other value for ‘name’ that doesn’t have spaces.
# Setup:
# 1. Copy this file to /etc/init.d/vbox-‘name’. The filename must start with
# the prefix “vbox-“. Make sure you set the ‘x’ bit on the file to make it
# executable: Note by JanV: open a terminal session, sudo sulogin, and cd into /etc/init.d and chmod +x filename.
# 2. Edit ‘Provides’, above, to match the filename.
# 3. Edit ‘Short-Description’ to describe the function of the VM.
# 4. If ‘long name’ is different from ‘name’ fill it in below, otherwise leave
# LONGNAME as an empty string.
# 5. What user owns the virtual machine?
# 6. Which stop command? “hibernate” or “powerbutton”
# 7. For the ‘start-wait’ command — waiting until network is up, what is the
# VM’s hostname?

# Do NOT “set -e”

# PATH should only include /usr/* if it runs after the script
# Pull DESC from file header
DESC=`grep –max-count=1 “^# Short-Description:” $(readlink -f $0)|cut –delimiter=’ ‘ –field=3-|sed ‘s/^ *//’`
# Pull NAME from file header
NAME=`grep –max-count=1 “^# Provides:” $(readlink -f $0)|cut –delimiter=’ ‘ –field=3-|sed ‘s/^ *//’`


# Get VM_SHORT_NAME from service name
VM_SHORT_NAME=`echo $NAME|cut –delimiter=’-‘ –field=2-`
# Actual filename of VM is VM_SHORT_NAME, or if VM_LONG_NAME is set, use that
if [ ! “$VM_LONG_NAME” ] ; then VM_LONG_NAME=$VM_SHORT_NAME ; fi

# Do not use ‘sudo’ if this script is actually running as VM_OWNER already
if [ `whoami` = $VM_OWNER ] ; then SUDO_CMD=”” ; else SUDO_CMD=”sudo -H -u $VM_OWNER” ; fi

# Set VBoxManage command for stop action
if [ $VM_STOP = powerbutton ] ; then VM_STOP_CMD=acpipowerbutton ; else VM_STOP_CMD=savestate ; fi

# If VM_HOSTNAME isn’t set (for ‘start-wait’ command) use VM_SHORTNAME

# Load the VERBOSE setting and other rcS variables
. /lib/init/

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions

# possible SHORT_STATE values: running, paused, aborted, powered off

VMINFO=$($SUDO_CMD $MANAGE_CMD showvminfo “$VM_LONG_NAME” 2>/dev/null)
if [ $? = 0 ] ; then
# No error retriving state string
LONG_STATE=$(echo “$VMINFO”|grep –max-count=1 “^State:”|cut –delimiter=’ ‘ \
–fields=2-|sed ‘s/^ *//’)
SHORT_STATE=$(echo $LONG_STATE|cut –delimiter=”(” –fields=1|sed ‘s/ *$//’)
# Fix for syntax highlighting in KomodoEdit for previous line
[ 0 = 1 ] && NOOP=$(echo “)”)
# VM must be missing

# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started


if [ “$SHORT_STATE” = “missing” ] ; then
echo Could not access VM \”$VM_LONG_NAME\”.
return 2

if [ “$SHORT_STATE” = “running” ] ; then
echo VM \”$VM_LONG_NAME\” is already running.
return 1

$SUDO_CMD $MANAGE_CMD startvm “$VM_LONG_NAME” -type vrdp || {
echo Failed to start VM \”$VM_LONG_NAME\”.
return 2

# No status report; VBoxManage said if it worked.
return 0

# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred


if [ “$SHORT_STATE” = “missing” ] ; then
echo Could not access VM \”$VM_LONG_NAME\”.
return 3

if [ ! “$SHORT_STATE” = “running” ] ; then
echo VM \”$VM_LONG_NAME\” is already stopped.
return 1

echo Failed to hibernate VM \”$VM_LONG_NAME\”.
return 2

echo Waiting for \”$VM_LONG_NAME\” to complete shutdown…
while [ “$SHORT_STATE” = “running” ] ; do
sleep 1

echo The VM \”$VM_LONG_NAME\” has been stopped \($VM_STOP\).
return 0

if [ “$SHORT_STATE” = “missing” ] ; then
echo Could not access VM \”$VM_LONG_NAME\”.
return 2
echo Status of VM \”$VM_LONG_NAME\”: $LONG_STATE

if [ “$SHORT_STATE” = “running” ] ; then return 1 ; else return 0 ; fi

do_reload() {
do_stop && do_start

do_wait_for_online() {
echo Waiting for \”$VM_LONG_NAME\” to come up on the network…
while [ ! “$result” = “0” ] ; do
sleep 1
ping -c 1 $VM_HOSTNAME >/dev/null 2>/dev/null
echo Ready.

case “$1” in
[ “$VERBOSE” != no ] && log_daemon_msg “Starting $DESC” “$NAME”
case “$?” in
0|1) [ “$VERBOSE” != no ] && log_end_msg 0 ;;
2) [ “$VERBOSE” != no ] && log_end_msg 1 ;;
do_start && do_wait_for_online
[ “$VERBOSE” != no ] && log_daemon_msg “Stopping $DESC” “$NAME”
case “$?” in
0|1) [ “$VERBOSE” != no ] && log_end_msg 0 ;;
2) [ “$VERBOSE” != no ] && log_end_msg 1 ;;
do_status && exit 0 || exit $?
# If the “reload” option is implemented then remove the
# ‘force-reload’ alias
[ “$VERBOSE” != no ] && log_daemon_msg “Restarting $DESC” “$NAME”
case “$?” in
case “$?” in
0) [ “$VERBOSE” != no ] && log_end_msg 0 ;;
1) [ “$VERBOSE” != no ] && log_end_msg 1 ;; # Old process is still running
*) [ “$VERBOSE” != no ] && log_end_msg 1 ;; # Failed to start
# Failed to stop
[ “$VERBOSE” != no ] && log_end_msg 1
do_start && do_wait_for_online
echo “Usage: $SCRIPTNAME {start|start-wait|stop|status|restart|restart-wait|force-reload}” >&2
exit 3


Now when this script is inside the /etc/init.d directory, run these commands inside a terminal:

sudo sulogin (enter your password)
cd /etc/init.d
update-rc.d scriptname defaults 90

With this command, you ensure that the script is used at boot time of your Ubuntu computer.

All right, basically that’s all. If you want to check if your VM is running:

sudo sulogin (enter your password)
service scriptname status


Or your just check it out within VirtualBox:



Check it out…and have fun!!!

More about my home network configuration in an upcoming article: Thinlinc


12/04/2014 at 7:23 am Plaats een reactie

Oudere berichten

Posted previously