Categories
Servers

Fixing: Vagrant LXC error, mount.nfs: mount to NFS server ‘10.0.3.1:/path’ failed: timed out, giving up

Vagrant-LXC is a plugin that provides integration of Vagrant with LXC containers, a modern virtualisation technology native to Linux. To share files between the host and the container, NFS can be used. The Vagrant NFS plugin ensures that a NFS server runs at the host that exports predefined locations of the host’s filesystem. Sometimes, an […]

Categories
Magento PHP

Symlinks cause ‘Not valid template file’ in Magento 1.9.3.4

Keeping Magento shops up to date is important to reduce their vulnerability. Sometimes, security updates introduce breaking changes. The recent Magento update, version 1.9.3.4, includes such a breaking change that can cause blank pages on the front-end and back-end. This is caused by the way in which Magento handles symlinks.  When blank pages occur, take […]

Categories
MySQL Servers

Import Remote Database Directly over SSH

Developing, maintaining and debugging web-applications often involves copying a remote database to a local or another remote machine. This post lists a number of methods that I find useful. It acts as a reference for myself which I happily update and improve based on comments and experience. My favourite method:  stream the database dump directly to […]

Categories
MySQL Servers

Configuring MySQL with .my.cnf file

Connecting to a MySQL server often involves providing hostnames, usernames and passwords. Use a .my.cnf configuration file to provide defaults that simplify working with a MySQL server.  Providing a default password reduces security. Take effort to make sure that the password cannot be read by other users on the system. If the server runs locally, use credentials that […]

Categories
Geen categorie Servers

Using Key-based SSH Authentication

If you use Git or remote terminal session a lot, consider using key-based authentication. Key-based authentication is generally considered more secure than password-based authentication.  In key-based authentication, two key-files are used. One is the public key and may be distributed to other parties that should be able to authenticate you and your information. The other is the private encryption key and should […]

Categories
C Embedded

Developing for AVR with JetBrains CLion on Mac OS

Previously I used Atmel Studio 7 to do AVR development. This integrated development environment is unsurpassed in terms of ease of use and features for AVR development. However, it is Windows only. I grew tired of the hassle with virtual machines and dual boot setups as my working device is a Mac running Mac OS 10.12. I […]

Categories
Geen categorie PHP

Random values from PHP array one-liner

PHP provides the array_rand( $arr, $num )  function which returns an integer or array containing the keys of the array. To obtain an array of values the following one-liner can be used: array_intersect_key( $arr, array_flip( array_rand( $arr, $num ) ) ); This picks $num random keys from $arr (array_rand), flips keys with values (array_flip), intersects the […]

Categories
Laravel 5 PHP

Laravel 5 Cron expression validation

A Cron expression validator is created in Laravel 5.3. Laravel provides a versatile and extendable Validation class. Introducing new validations is done by registering a validation function with the extend method on the Validation facade. A Cron expression validator is created by utilising a cron-expression parser. The cron-expression parser used here is the fantastic cron-expression Composer package by Michael […]