#1118 – Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.

I had this message error in mySQL during a database import. The dump was exported from another server:

#1118 - Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.

On this machine I'm currently using MAMP (Not the PRO version) on a Mac, but I think you can try to use the same config file in other systems.

This is what I did to solve this problem, hopefully will be fine for you as well:

  1. I ttopped the server in MAMP
  2. Inside the folder: /Applications/MAMP/config/ I created a file config my.cnf. I used the template file my-default.cnf that I found in /Applications/MAMP/Library/support-files/ to create it.
  3. The following is the my.cnf file where I added also => innodb_strict_mode = 0
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.


# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# socket = .....

# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
join_buffer_size = 128M
sort_buffer_size = 2M
read_rnd_buffer_size = 2M
innodb_strict_mode = 0


I hope this can help you!

TP-Link AC1200 up and running on ubuntu 18.xx

Finally I got from Amazon this fast wifi dongle that's working also with Ubuntu 18.04. The TP-link AC1200(T4UH) doesn't come up with plug and play functionality but the driver is very easy to install on Ubuntu and Debian distributions.

The dongle is based on the RealteK RTL8812AU chipset, and luckly this driver it's already present on the official repository. All you need to do it's launch this command from you terminal to install it:

sudo apt install rtl8812au-dkms

plug in your device and it should be ready to connect to the WIFI!

Check your ssh key passphrase

How can we check the passphrase of a private key?

Is it possible to do that using the following command:

ssh-keygen -y
  • If the input is the correct passphrase, it will show you the associated public key.
  • the wrong passphrase, it will display load failed.
  • If the key has no passphrase, it will not prompt you for a passphrase and will immediately show you the associated public key.

How to use multiple SSH private keys on a client

To use multiple shh private keys on a client you need to create the file config inside the folder .ssh and use the following entries:

Host myshortname realname.example.com
HostName realname.example.com
IdentityFile ~/.ssh/realname_rsa
User remoteusername

Host myother realname2.example.org
HostName realname2.example.org
IdentityFile ~/.ssh/realname2_rsa
User remoteusername

where IdentityFile is the private key for realname.

Create Autoloader using Composer

How to create an autoloader using composer?

  • Create a new file composer.json in the main folder and insert the just curly brackets

  • Run, to generate the autoload structure :
$ composer install
        "autoload" : {
            "psr-4": {
                    "Acme\\" : "src"

Acme is a example of Company/Project name, and src is the directory that contains all the files we want include in our project.

  • Run, to generate the psr-4 autoload file, the command:
$ composer dump-autoload

The content of the file will be the following one:


// autoload_psr4.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
    'Acme\\' => array($baseDir . '/src'),
  • Require the file autoload.php in your main project file (e.g.: index.php):
require 'vendor/autoload.php';
  • Use namespaces Acme in your project for the file not in subfolder but just in src: So for example if you have the class Test.php in src you just need to use this.
namespace Acme; //in your class called Test

class Test


use Acme\Test; //to use the class Test

You don't need to use src in your namespace because the autoload has the $basedir on src.

The general rule is >>> what is inside the namespace + Class Name

So for example if you have the folder User in src for the class Person:

You must have the following code structure:

Class Person.php in src/User/:


namespace Acme\User; //Use Acme + User

class Person
    protected $name;

     * @return name
    public function getName(): string
        return $this->name;

    public function setName(string $name)
        $this->name = $name;
        return $this->name;
  • index.php:

    require 'vendor/autoload.php';

    use Acme\User\Person; //Use the namespace + the class name

    $person1 = new Person();
    $person1->setName('John Doe');
    echo $person1->getName();

Read a JSON file with php

Json file, how to read it using php?

Most importantly, get the JSON content using file_get_contents() and to not avoid warnings specify the sources:

To read the file with an http request specify http/https:

$jsonData = file_get_contents('http://www.sitename.io/data/jsondata.JSON');

To read the file form the filesystem:

$config = file_get_contents(__DIR__ . '/config.json');

decode the JSON using json_decode():

$data = json_decode($config, true);

Use var_dump or print_r to understand the data structure. Having this data:

  "databaseOne": {
    "dbhost": "localhost:8889",
    "dbname": "dev_db_1",
    "dbusername": "root",
    "dbpassword": "root"
  "databaseTwo": {
    "dbhost": "localhost:8889",
    "dbname": "dev_db_2",
    "dbusername": "root",
    "dbpassword": "root"

To print the database name of databaseOne:

echo $data['databaseOne']['dbname'];

Use this code to loop through the array:

foreach ($data['databaseOne'] as $field => $value) {
    echo $field . ':' . $value . '</br>';

This is an example to show how to print the database name for each entries:

foreach ($$data as $content) {
        if($content) {
            foreach ($content as $key => $value) {
                if ($key === 'dbname'){
                    echo ($value . '</br>');

Composer basics

Here a basics list of Composer commands to retrieve the most used one.

Start new php project:

composer init

Install a new packages with:

composer require packageName

Use https://packagist.org/ to find the exact component name

In order to get the latest versions:

composer update

Uninstall packages from composer:

composer remove packageName

Search package from composer:

composer search packageName

Shows a list of installed packages that have updates available:

composer outdated

You should always run the validate command before you commit your composer.json file:

composer validate


When you try to connect to a remote server via ssh and you receive the message:

Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
Please contact your system administrator.
Add correct host key in /Users/username/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/username/.ssh/known_hosts:21
RSA host key for IP_ADDRESS has changed and you have requested strict checking.
Host key verification failed.

you can reset the known_host for the ip_address with the command:

ssh-keygen -R <hostname or ip_address>

the -R hostname Removes all keys belonging to hostname from a known_hosts file.