Ubuntu - Error while converting to PDF with Imagemagick

dropcap ubuntu imagemagick

Few days back, an Ubuntu Xenial update has broken ImageMagisk ability to generate PDF and PostScript files. I realised it when my Nautilus PDF Generate script was not working anymore when dealing with conversion of multiple picture files to generate a single PDF document.

As image conversion was done using convert (from ImageMagick package), I checked convert behaviour when converting picture files to PDF. Here is the error message you get since last update :

Terminal
# convert 'image.jpg' 'image.pdf'
convert: not authorized 'image.pdf' @ error/constitute.c/WriteImage/1028.

After some googling, I realised that ImageMagisk has recently gone thru some serious security flaws. These security flaws are quite serious for Web servers using ImageMagick for picture conversion. As an answer, some PDF generation restrictions have been implemented in Ubuntu repository for ImageMagick dfault policy.xml configuration file.

As ImageMagick PDF conversion feature is quite useful on an Ubuntu workstation, this article explains how to get back PDF generation functionality for convert utility. It also explains how to make it update proof in case of apt system updates.

It has been tested under Ubuntu Xenial 16.04 LTS and Ubuntu Bionic 18.04 LTS.

If you just want to recover PDF generation without all the explainations, you can jump to last section which provides a complete installation script.

Read more: Ubuntu - Error while converting to PDF with Imagemagick

Ubuntu - Error while flashing latest Samsung phones with Heimdall

dropcap-ubuntu-android

Last week I wanted to flash latest LineageOS 15.1 on a Samsung Galaxy A5 2016 (A500-FU).

So I installed Heimdall from official Ubuntu Xenial repository to do the job. But I encountered errors while trying to flash the recovery. After some googling, I realised that Heimdall in Ubuntu repository is too old and doesn't handle PIT extraction on latest Samsung smartphones.

From Heimdall official site https://glassechidna.com.au/heimdall/ it appears that it has been updated to handle latest Samsung devices.

But deb files available for download on official Ubuntu repositories are quite outdated. So it is compulsory to compile it from official GitLab sources.

This article explains how to compile latest GitLab version of Heimdall under Ubuntu Xenial 16.04 LTS or Bionic 18.04 LTS.

Once compiled, you should be able to flash any recovery or ROM on latest Samsung Android smartphones.

Read more: Ubuntu - Error while flashing latest Samsung phones with Heimdall

Nautilus - Thumbnailer for Ms Office documents

dropcap-gnome-msoffice

When you use Gnome Shell under Ubuntu or Debian, all Ms Office files are displayed thru some generic icons in Nautilus.

With the help of LibreOffice, it is possible to use the first page of a document as a Nautilus thumbnail.

To make it even more visual, the thumbnail can be outdrawn by the document type official icon. You will then get a display much more visual.

This article explains all the steps needed to configure Nautilus to display thumbnails of Ms Office documents including document type icon and first page content, providing a simple and efficient Ms Office documents preview. It is using LibreOffice as a conversion tool and some very basic tools.

This procedure has been tested under Ubuntu Gnome 16.04 LTS with Libre Office 5.x. It should be applicable to many Gnome based distributions. It has also been tested under Lubuntu 14.04 LTS with PCManFM.

Read more: Nautilus - Thumbnailer for Ms Office documents

Nautilus - Thumbnailer for LibreOffice documents

dropcap-gnome-libreoffice

When you use Gnome Shell under Ubuntu or Debian, all LibreOffice files are displayed thru some generic icons in Nautilus.

openoffice-iconLibreOffice files are either a ZIP archives embedding a thumbnail of the first document page(.odt, .odx, ...) or a flat XML file (.fodt, .fodx, ...). With both type of documents, it is possible to use or to generate this first page thumbnail as a Nautilus thumbnail.

To make it even more visual, the thumbnail can be outdrawn by the document type official icon. You will then get a display much more visual.

This article explains all the steps needed to configure Nautilus to display thumbnails of LibreOffice documents including document type icon and first page content, providing a simple and efficient LibreOffice documents preview. It is using some very basic tools.

This procedure has been tested under Ubuntu Xenial 16.04 LTS and Ubuntu Gnome 16.04 LTS. It should be applicable to many Gnome based distributions. It has also been tested under Lubuntu 14.04 LTS with PCManFM.

Read more: Nautilus - Thumbnailer for LibreOffice documents

Debian 8 - Install & Monitor EATON UPS

dropcap debian eaton

Because of this sumer heat wave, I finally decided to install an Uninterrupted Power Supply for my debian server.

So I decided to buy a Eaton 3S550 UPS. This small UPS is designed like a big strip, it handles 550 VA and it provides a USB connection.

Thanks to Network UPS Tools, this UPS is very easy to manage when connected to a Debian server.

Installation procedure in a non GUI environment is quite simple, but it involves a certain number of steps that should be carefully followed.

So, this article explains a step-by-step installation procedure of a Eaton UPS connected to a Debian Jessie headless server. If followed carefully, you should get your UPS fully integrated to your server, with an automatic shutdown when your UPS battery is becoming too low during a power cut.

This procedure should be applicable to any Ubuntu or Debian-based server.

Read more: Debian 8 - Install & Monitor EATON UPS

Ubuntu - Repair corrupted or broken PDF

dropcap-ubuntu

If you are a day-to-day Linux user, you may have faced some web sites using some broken PDF generation software, where PDF files they generate can't be properly displayed with open-source viewers like Evince.

Latest site where I've faced this problem was Easyjet. I was supposed to print my e-ticket, but all important data were totally unreadable. Here is what Evince was displaying :

ubuntu-pdf-broken

While googling to find a reader able to handle these broken PDF files, I realised that this problem is quite common and that tools like gs (Ghostscript) or mutool (MuPDF) may be able to repair these files.

This article explains how to prepare your Linux desktop to be able to repair corrupted PDF files (like Easyjet e-tickets). It also explains how to integrate this tool as a custom action available from your favorite file manager (Nautilus & PcManFM) with a simple right click on the PDF file.

It has been tested on Ubuntu 16.04 LTS and Ubuntu Gnome 16.04 LTS. But, it should be applicable to any distribution using a Nautilus or PCmanFM.

Read more: Ubuntu - Repair corrupted or broken PDF

Ubuntu - Imposition or how to print a book from your documents

Ubuntu

ubuntu-imposition-bookIn daily office life, who has not thought while printing a document :

It's a waste to print that document on A4 pages.
It would have been so handy to get it in a small A5 booklet.

Imposition is the clue !

Imposition is the process of arranging pages on printer's sheet, in order to obtain faster printing, simplified binding and reduced paper waste.

This guide will explain how to achieve that simple process of converting a plain document in portrait mode into a small A5 booklet printed on recto-verso A4 pages.

As an input, it takes a an LibreOffice, Ms-Office or PDF document and generates a PDF document ready for printing.

By default you will generate a document ready for printing on A4 pages, but some other formats like A3, A5, Letter, ... are also available (thanks to Robin idea).

It has been tested on Ubuntu 12.04 LTS, Ubuntu Gnome and Lubuntu 14.04 LTS, but it should work on any Linux flavor as long as you get pdfinfo, pdfbook and unoconv utilities.

Read more: Ubuntu - Imposition or how to print a book from your documents

Ubuntu 16.04 LTS - Browse FlashAir card thru Wifi in Nautilus

dropcap flashair

Toshiba FlashAir is a very versatile Wifi enabled SD card. It includes a wifi acces point and an embedded HTTP server to serve the SD card content to any browser. Toshiba provides some Flashair clients for Android and Windows, but as usual, Linux has been forgotten. So I decided to write a Linux client that allows to browse Flashair card content straight from Nautilus file manager.

This article explains how to setup a Linux workstation to be able to browse a Toshiba FlashAir SD card directly from Nautilus file manager.

We'll setup a specific directory on your computer which will become an online/offline mirror of your SD card. When you connect for the first time, most of the files will be only thumbnails not to overload the wifi connexion. But you'll be able to download any image or video with a simple right click from Nautilus. Once you disconnect your Flashair card, all downloaded files remain on your computer. You'll be able to connect anytime to your FlashAir card to update its content.

This has been setup and tested on an Ubuntu Gnome 16.04 LTS, but it should be applicable to any modern Linux distribution.

Read more: Ubuntu 16.04 LTS - Browse FlashAir card thru Wifi in Nautilus

Ubuntu 16.04 LTS - Install Android Tools (ADB, Fastboot & QtADB)

dropcap-ubuntu-android

If you own an Android Smartphone, you will need sooner or later to use some specific Android tools like ADB or fastboot.

If you need these tools, two options are available under Ubuntu : either to install the whole Android SDK or to install some specific packages that bring only these tools.

Another very insteresting tool is QtADB. Based on ADB protocol, it allows under a graphical interface to have a complete access to your Android device filesystem, to manage your installed applications, to get some system informations, ...

As most of Android smartphone or tablet users are not needing the whole Android SDK, this article explains the simple steps needed to install Android specific tools like ADB, fastboot or QtADB on a Ubuntu computer.

It has been tested under Ubuntu Xenial 16.04 LTS and it has been used to flash and root a Google Nexus 5 & OnePlusX under LineageOS, a OnePlus 3 under OxygenOS and few other old devices. It should be applicable with any modern Linux distro.

Read more: Ubuntu 16.04 LTS - Install Android Tools (ADB, Fastboot & QtADB)

Debian - Self-hosted Web File Transfer with FileZ

Debian

debian-filez-logoFileZ is a Web file transfer project started by French university of Avignon.

It provides a simple and efficient way to upload and manage very big files that you want to share over internet. Everything is stored on your web server and handled through a web interface and some unique URLs.

University of Avignon has stopped to maintain the project, but it is still maintained by a small core team under Github repository https://github.com/FileZ/FileZ.

FileZ main features are :

  • handling of files up to 2 Gb
  • generation of short URL to retrieve these files
  • multiple users management with quotas
  • time limit and/or password management for files

Even if it is very simple to use, it is quite difficult to install. In fact, the project environment has evolved quite a lot but the provided installation procedure has not followed. As a result, whatever installation guide you find on the web is very much outdated.

So, this guide explains step by step procedure to fully install latest FileZ version 3.0 alpha from https://github.com/FileZ/FileZ on a Debian 9.0 Stretch server. It uses a MySQL database to manage users.

Read more: Debian - Self-hosted Web File Transfer with FileZ

Nautilus - Thumbnailer for APK files

dropcap-gnome-apk

On Android devices, all programs are installed thru some APK archives. Under Gnome Nautilus, these APK archives are recognised as a specific mime types and are displayed with some generic text file icon.

As most of the time the name of these APK archives is not very friendly, it is difficult to associate an APK file with the Android application it contains. To help you with this association, it could be very helpful to display the application icon as it is done under Android instead of the generic icon.

Thanksfully, under Gnome Shell, Nautilus allows to generate a specific thumbnail according to the APK mime type application/vnd.android.package-archive. As APK archive are supposed to contain their Android application icon, it becomes possible to display the application icon as the Nautilus thumbnail. You can also add APK version provided by the embedded manifest.xml.

nautilus-apk-thumbnail

This article explains all the steps needed to configure Nautilus to display the APK embedded application icon as thumbnail. This allows you to handle your APK files from Nautilus as they appear on your Android device.

This procedure has been tested under Ubuntu and Ubuntu Gnome 16.04 LTS and even LUbuntu with PCManFM.
It should be applicable to many other distributions.

Read more: Nautilus - Thumbnailer for APK files

Ubuntu 16.04 - Correct GoPro USB access bug

dropcap ubuntu gopro

Under Ubuntu 16.04 Xenial, a nasty bug stops you to mount latest GoPro action cams. 

I discovered this problem while connecting a GoPro Hero Session 4 to my laptop via the USB cable. In Nautilus, the device was showing, but it was showing some weird directories :

  • DCIM_00000001_00000001
  • DCIM_00000001

Both directories were empty.

After some internet search, I realised that this problem seems to occur with few recent models of GoPro action cams.

This short article explains how to solve this problem and to properly mount latest GoPro action cams via USB under Ubuntu 16.04 Xerial. 

It has been tested with an original GoPro Hero and a GoPro Hero Session 4 connected on a Ubuntu Gnome 16.04.1 LTS Amd64 laptop.

Read more: Ubuntu 16.04 - Correct GoPro USB access bug

Ubuntu - Monitors Position Lost in Dual Display Setup

Ubuntu

If you are using a dual monitor display under Ubuntu Trusty 14.04 LTS or Ubuntu Xenial 16.04 LTS, you may have noticed that both screen position can be set without any glitch thru the system parameters, but that this configuration is lost after every reboot.

In fact, if your screen positions are not the default proposed one (laptop screen at the left and second monitor at the right), it will be reset to the default one after every reboot. And, this occurs even if your monitor.xml configuration file is fully configured.

This article explains how to circumvent this Ubuntu misbehavior. It allows you to set your dual monitor positions and to make it survive after every reboot.

It has been tested under Ubuntu Gnome 14.04 LTS and Ubuntu 16.04 LTS but it should be applicable under other Ubuntu flavours.

Read more: Ubuntu - Monitors Position Lost in Dual Display Setup

Gnome Shell - Create New Documents from Nautilus contextual menu

dropcap nautilus

With Gnome 3, Nautilus doesn't provide any more an empty file creation menu.

As amazing as it can be, this very simple and very productive feature has been remove with Gnome 3. You still can create an empty folder, but not an empty file !

As this very simple feature is a must have, this article explains how to get it back, but boosted with steroids.

It explains how to setup Nautilus to handle creation of different empty document types, based on some document models you have written and configured.

You'll then be able to create any type of new documents customised to your specific need (writer document with your letter head, bash script with your default title block, …) straight from :

  • any Nautilus window
  • Nautilus toolbar menu

ubuntu nautilus newfile menu

It has been tested on Ubuntu Gnome 14.04 LTS and 16.04 LTS, but should be installable on any Linux distribution running Gnome.

Read more: Gnome Shell - Create New Documents from Nautilus contextual menu

Ubuntu 12.04 - Install Android Tools (ADB, Fastboot & QtADB)

dropcap-ubuntu-android

A new updated version Ubuntu 16.04 LTS - Install Android Tools (ADB, Fastboot & QtADB) is now available.
Please don't use this procedure anymore if you run latest Ubuntu Xenial 16.04 LTS

If you own an Android Smartphone, you will need sooner or later to use some specific Android tools like adb or fastboot.

If you need these tools, two options are now available under Ubuntu :

  • Install the whole Android SDK which bring these tools among may other things
  • Install some specific android-tools packages that bring only these tools

This article explains the simple steps needed to install Android tools, including latest Android SDK on Ubuntu Precise 12.04 LTS.

Read more: Ubuntu 12.04 - Install Android Tools (ADB, Fastboot & QtADB)

Ubuntu 14.04 - Install Android Tools (ADB, Fastboot & QtADB)

dropcap-ubuntu-android

A new updated version Ubuntu 16.04 LTS - Install Android Tools (ADB, Fastboot & QtADB) is now available. Please don't use this procedure anymore if you run latest Ubuntu Xenial 16.04 LTS

If you own an Android Smartphone, you will need sooner or later to use some specific Android tools like ADB or fastboot.

If you need these tools, two options are available under Ubuntu : either to install the whole Android SDK or to install some specific packages that bring only these tools.

Another very insteresting tool is QtADB. Based on ADB protocol, it allows under a graphical interface to have a complete access to your Android device filesystem, to manage your installed applications, to get some system informations, ...

As most of Android smartphone or tablet users are not needing the whole Android SDK, this article explains the simple steps needed to install Android specific tools like ADB, fastboot or QtADB on a Ubuntu computer.

It has been tested under Ubuntu Trusty 14.04 LTS and it has been used to flash and root a Google Nexus 7 under Lollipop and to root a OnePlus One running CM11s.

Read more: Ubuntu 14.04 - Install Android Tools (ADB, Fastboot & QtADB)

Ubuntu 12.04 - Declare MTP device for automount in one click (Nexus 4, Nexus 7, ...)

dropcap-ubuntu-android

android-mtp-protocolLatest Android devices, like Nexus 4, Nexus 7, Galaxy Nexus, ... are using 2 different USB connexion modes : PTP and MTP.

With PTP mode, the phone is seen as a digital camera. This is working Out Of The Box under Ubuntu 12.04 LTS. But, you can only access DCIM directory of your device.

With MTP mode, the phone is seen as a multimedia device where you can access the complete exported filesystem. But it doesn't work Out Of The Box under Ubuntu 12.04 LTS. It needs some setup and configuration to work.

This guide explains how to easily configure your Ubuntu computer to directly access your Android devices filesystem in MTP mode as soon as you plug it to a USB port.

It is based on a previous guide done for Nexus 7, but has been modified to become fully automatic, providing a script which is a one click solution to configure virtually any MTP device.

Thanks to this script, your Android devices will be properly declared to automatically mount when plugged & unmount when unplugged. You'll be able to handle multiple devices at the same time on your ubuntu computer.

This guide has been completly rewritten to use mtp-detect. It has been tested with a Google Nexus 4 and a Google Nexus 7, but it should work with any other MTP device (Android phone or tablet, MP4 player, ...). It has been done under Ubuntu 12.04 LTS Amd64 but it should work or be easily adapted on many Linux flavours.

Main script used in this article is available from Github mtp-automount project.

Read more: Ubuntu 12.04 - Declare MTP device for automount in one click (Nexus 4, Nexus 7,...)

Domoticz - Handle your exhaust speed according to humidity level

dropcap domoticz

Nowadays, a Mechanical Controlled Ventilation (VMC in French) is a de-facto equipment in a bathroom.

Most of these Controlled Ventilation can run in two different speeds : low speed and high speed. VMC runs low speed any time and can be switched to high speed with a manual switch.

Thanks to home automation, it is now possible to automatically manage your Controlled Ventilation speed according to humidity level in the room.

This article explains how to automatically manage a Controlled Ventilation speed according to humidity level in a bathroom with the help of :

  • a wireless humidity sensor
  • a wireless switch
  • a wireless gateway
  • Domoticz, a very nice Open Source Home Automation Software

This setup has been tested on a Debian 8 Jessie server with a RfxTrx433 gateway, an Oregon Scientific THGR 122 Temperature/Humidity sensor and a DiO 54755 switch. All RF devices are working on 433 MHz frequency. But any other similar setup and devices should work as long as they are compatible with Domotiz.

Read more: Domoticz - Handle your exhaust speed according to humidity level

Debian - Send your Server Notifications thru Telegram

dropcap debian telegram

As a system administrator, you must be receiving your important server notifications by emails. Email has been used since decades, but it is slowly replaced in everydays life by social networks. With social network clients, messages are usually displayed as thread and get instant notification on your smartphone.

So, why not receiving your main server notifications on one of your favorite social network client ?

Telegram is becoming a very popular social network as it is free and multi-platforms. It has also a unique feature : it's allowing the use of bots. Bots are very interesting as they can be seen as an application account associated to a real person's account. They are able to send or receive messages to/from either an individual account or a group.

So, instead of sending a mail, it could be very interesting for your Debian/Ubuntu server to be able to send you Telegram notification. You can for example create an administrator group and send all your server notifications to this group. Any administrator belonging to this Telegram group will get instant notification from the server.

This article explains how to setup a server environment to very easily send Telegram notifications from any of your server script or service. It also provides a script that allows you to send Telegram messages including text, photos, documents, logs, …

It has been tested on a Debian 8.5 server but it should work on any modern Linux distribution.

Read more: Debian - Send your Server Notifications thru Telegram

Debian - Configure Sendmail to use your Gmail account

Debian

If you are running a Debian server, you must be running some automated processes like database dump, log cleaning, data backup, …

When processing these batch treatments, it can be very convenient to get some completion reports sent by email.

Under debian, you can send mails thru command line with the help of sendmail and exim4 as a mail transfert agent. But you previously need to configure them to use an official smtp server.

This article will explain how to configure your Debian Wheezy server to be able to send emails from command line by using the smtp server provided with your Gmail account.

Configuration is given for a Gmail account, but it can obviously be adapted to any other smtp provider.

This article has been tested on a freshly installed Amd64 Debian Wheezy.

Read more: Debian - Configure Sendmail to use your Gmail account

Ubuntu 16.04 - Rotate & Stabilize your video with MLT and Vid.stab

dropcap-ubuntu-stabilize

Nowadays, street video shooting is becoming a reality.  With any modern smartphone, point-and-shoot camera or even a GoPro camera, you can shoot any video anywhere.

These devices are affordable, light-weight, very compact and easy to use. Whatever happens around you, you are able to record it on the spot. But, on the other end, as these devices are compact and light, they are not very steady. Your recordings tend to be shaky !

Another problem you can encounter when shooting from a smartphone is that your video may be recorded upside-down or even rotated by 90°.

Till date, I did not find any very simple solution under Linux to simply stabilize (unshake) and/or rotate my day-to-day videos.

Hopefully, thanks to MLT framework, it is possible to use a command line tool melt and some specific plugins (vid.stab to stabilize and affine to rotate) to do the job.

This article explains how to easily post-process any group of video files straight from Nautilus file manager to rotate and stabilize them. The tool handles following actions :

  • read important metadata
  • rotate video if needed
  • stabilize video if needed
  • transcode it to h264 & aac

It has been designed and tested nder Ubuntu and Ubuntu Gnome Xenial 16.04 LTS. It should be applicable to many up-to-date Linux distro.

Read more: Ubuntu 16.04 - Rotate & Stabilize your video with MLT and Vid.stab

Ubuntu 12.04 - Stabilize your camcorder video with MELT and Vid.stab

dropcap-ubuntu-stabilize

Since availability of Ubuntu Xenial 16.04, this procedure is obsolete and is not updated.
Please use Ubuntu 16.04 - Rotate & Stabilize your video with MLT and Vid.stab instead.

Nowadays, street video shooting is becoming a reality.
Who is not having a smartphone, a point-and-shoot camera with video capabilities or even a HD camcorder ?

These devices are affordable, light-weight, very compact and easy to use. Whatever happens around you, you are able to record it on the spot. But, on the other end, as these devices are compact and light, they are not very steady. Your recordings tend to be shaky !

Till date, there was no simple solutions under Linux to stabilize (unshake) videos. One of the first one I used was transcode with vid.stab plugin. This stabilization plugin is very efficient. But the transcode tool is giving lots of trouble as soon as you want to encode your resulting video to h264. In fact, the interface between transcode and ffmpeg is type of 'broken'.

Short time back, the MLT framework has integrated a port of vid.stab stabilization plugin. That is a very good news as MLT framework provides a command-line tool melt which interfaces very well with FFmpeg libraries for h264 encoding.

This article will explain how to easily post-process any video file to stabilize (unshake) it. It will use :

  • latest version of MELT, a command-line tool from MLT framework, which comes now with vid.stab stabilization filter
  • latest version of FFmpeg to re-encode the resulting video with h264 codec and aac audio

It will explain 2 different approaches :

  • stabilization thru command-line
  • stabilization directly from Nautilus, thru a Nautilus script
Read more: Ubuntu 12.04 - Stabilize your camcorder video with MELT and Vid.stab

Page 1 of 5