Install and configure PHP + NGINX for Ubuntu 18.04

How to install and configuration NGINX with PHP.

It’s really simple.

Install NGINX and php-fpm

apt install nginx php-fpm

Then add this configuration to the NGINX site with which you want to enable PHP.

 location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.2-fpm.sock;


This configuration will usually be added in /etc/nginx/sites-enabled/default

or the global configuration in /etc/nginx/nginx.conf




Meteor get Collections by Reference

This short code sample will show you how to get access to a Collection by reference.

The root variable is essentially referencing the this global but detects the correct global reference based on where the client is running.

var colData = function (collectionName) {

var root = Meteor.isClient ? window : global;

var col = root[collectionName];

return col.find().fetch();



Iron Router Multiple Data Context with Meteor

Here’s how to do it:

Router.route('/things', {

    name: 'things',    

    waitOn: function () {

        return [this.subscribe('thing'),this.subscribe('thinga')];


    data: function () {

        return {

            thing: Thing.find(),

            thinga: Thinga.findOne({type: "abc"})



    onAfterAction: function () {




To access the data context in the Template use the following syntax:

console.log('Template.instance().data.thinga.propertyname', Template.instance().data.thinga.propertyname);



Set Fn key to always on with Apple keyboard

If you’re using an Apple keyboard with Linux and want to use the Function keys normally, for example F2 to rename files, it’s possible to do so with a simple modification.

Open a terminal and run this command:

sudo -s 'echo 2 > /sys/module/hid_apple/parameters/fnmode'

If you want something other than Function keys taking precedence there are other options.

The following are the accepted values:

  • 0 = disabled : Disable the ‘fn’ key. Pressing ‘fn’+’F8’ will behave like you only press ‘F8’
  • 1 = fkeyslast : Function keys are used as last key. Pressing ‘F8’ key will act as a special key. Pressing ‘fn’+’F8’ will behave like a F8.
  • 2 = fkeysfirst : Function keys are used as first key. Pressing ‘F8’ key will behave like a F8. Pressing ‘fn’+’F8’ will act as special key (play/pause)



How to Fix Ubuntu Landscape – Invalid Machine token

Ubuntu Landscape allows you to keep systems updated when deployed in large clusters.

If you clone a machine and look in its logs you might find an error message similar to the ones below.

Error message:

during refresh: cannot check: cannot send status to server: bad server status 403 (URL: {"error": "Invalid Machine Token"}

You may also see this warning in the motd.

 * Canonical Livepatch is enabled.
- Livepatch server check failed.
Please see /var/log/syslog for more information.


The solution is to remove, reinstall landscape and register the node again with your license key.

apt remove landscape-common 
apt install landscape-common

It’s not clear if this is a bug or intended behavior for Landscape.

For large deploymens this could be problematic.

Fix slow GUI, sluggish interface with Mint Cinnamon


If you have been using your system heavily, with multiple workspaces, various applications that are not entirely memory efficient, these combined factors can lead to your interface feeling sluggish.

In order to resolve this issue without having to restart the entire system issue this command in a terminal windows to restart mind and preserve your workspaces and windows.

pkill -HUP -f "cinnamon --replace"