Fix "The following signatures couldn't be verified because the public key is not available" on Ubuntu 16.04 (Xenial)

Submitted by christophe on Tue, 08/11/2016 - 17:05

If you terminal looks like this after running apt-get update :

W: GPG error: xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4F4EA0AAE5267A6C
W: The repository ' xenial InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.


Drupal 8 JSON custom migration

Submitted by christophe on Fri, 04/11/2016 - 16:55


After spending some time on experimenting custom migration for Drupal 7 contents at the early stages of Drupal 8.0.0, I decided to have a look again at what the core and contrib migrate modules have out of the box for custom cases: let's say data structure change from another CMS, or even from a previous version of Drupal.
I was especially interested by the JSON and XML formats that are quite popular and easy to produce as output with Rest or even RSS.

Install Solr 6 for Drupal 8 on Ubuntu 16.04

Submitted by christophe on Wed, 26/10/2016 - 21:55


This setup is intended for production use on a dedicated server (VPS, ...).
For development purpose it should be preferable to use Drupal VM, it comes with a default configuration that can be enabled via the config.yml file.

1. Install Search API and Search API Solr modules

Make sure that you download the modules via Composer and not Drush, otherwise you will end up with missing dependencies (like Solarium).

Install Drupal 8 core and contrib modules with Composer

Submitted by christophe on Wed, 26/10/2016 - 14:00


Some modules, like Address or Search API Solr, really needs an installation with Composer.
We should now avoid to rely on Composer Manager (deprecated) so here is a kickstart.

1. Turn off XDebug

If enabled, turn it off, otherwise it will certainly result in a time out.
Edit your php.ini or specific conf file (e.g./etc/php/7.0/cli/conf.d/20-xdebug.ini) and comment the following line :

Alter Views sort by taxonomy weight

Submitted by christophe on Mon, 03/10/2016 - 19:10

The use case is that we want to sort a list of users by job title, where job title is a term reference to a dedicated vocabulary.
The sort is done by the job title term weight (defined via the vocabulary list).

I choosed to apply a custom sort function on a view, instead of a custom dynamic / entity query for two reasons :

Zero configuration Let's Encrypt under Virtualmin

Submitted by christophe on Sat, 10/09/2016 - 09:50

It has been there for a while under Virtualmin, but I was hesitating on using the GUI configuration of Let's Encrypt from Virtualmin on an existing manual configuration. Let's Encrypt does not allow you to make any change afterwards, yielding this error :

Request failed : The native Let's Encrypt client was used previously on this system, and must be used for all future certificate requests.

Drupal 8 links or where is my l() function ?

Submitted by christophe on Thu, 07/04/2016 - 07:24

The l() function is deprecated in Drupal 8, here is a starter.

Import the URL and Link classes :

use Drupal\Core\Url;
use Drupal\Core\Link;

You have several options, but basically, you can start with an url that will be used by a link.
One of the possible implementation will be used, with the Link::fromTextAndUrl method. 

A lightweight MySQL monitoring on Ubuntu

Submitted by christophe on Fri, 01/04/2016 - 16:47

In some situations, you just need a fast way to monitor MySQL and restart your service asap in case of crash. Neither a production script nor a replacement for a real server monitoring tool (like New Relic, ...) with IP fail over, but a basic solution when you just provisioned a low budget VPS with a very limited setup and still want to get a feedback for further logs details.

1) Install mailutils

It will be necessary to send an e-mail alert.

apt-get install mailutils

Kickoff a Drupal 8 development environment

Submitted by christophe on Mon, 08/02/2016 - 10:01

Drupal 8 evolves quickly, and it's easy to get lost amongst the several documentations that have been written since the beta releases, Drush and PHP version needs upgrade. Some things that I have learned.

Option 1 : No VM setup on Mac OSX, via Homebrew

Okay, VM's are easier to maintain solutions, but in some situations you just don't have enough RAM for having Virtualbox running all the time.