basic sql query

Today we learned how to connect to sql using work bench and command line mysql client. We created a simple table, and inserted a row.

Fixed yoga 910 screen flicker in Ubuntu 17.10

To fix it, create or edit the file at /usr/share/X11/xorg.conf.d/20-intel.conf as root with the following:

Section "Device"
    Identifier "Intel Graphics"
    Driver "intel"
    Option "AccelMethod" "sna"
    Option "TearFree" "true"
    Option "DRI" "3"

And add this:
to: /etc/default/grub
cmd: sudo update-grub
restart computer.


Ubuntu install PHP mail function

It is not installed by default so you have to install it and then a little configuration is required.

sudo apt install sendmail

The run the following command and choose Y for all the options.

sudo sendmailconfig

Now edit the host file:

sudo nano /etc/hosts

And add or edit as:    localhost localhost.localdomain your_machine_name

To get your_machine_name run:


Raspberry PI enable ssh without a monitor

I spent a dozens of minutes today to learn, how to enable ssh to Raspberry Pi without a monitor. SSH is disable by default after October 2016. Here is a one minute solution.

Attach the sd card to your computer and add an empty file SSH on the root of the sd card partition.

Ubuntu 16.04 – PhpStorm – configure xdebug with PHP 7.0

Today I spent a couple of hours to figure out that ONLY the following configuration works. It is not covered in any video/tutorial.

This is the settings that MUST be added to all the files:

[xDebug] zend_extension=/usr/lib/php/20160303/
xdebug.remote_autostart = on
xdebug.remote_start = on



The files are :



MySql change part of the field or column

If you have a table with column that contains eg file names with extension and want to replace the extension of all those file names.

Eg we have a table named menu with column icon. The icon column contains image file names with extension .png eg dress.png , shoes.png and we want to replace only .png by .svg leaving the filename (without extension) intact. we can use the following command in SQL:

UPDATE menus SET icon = replace(icon, RIGHT(icon, 3), ‘svg’)
WHERE id > 0 AND icon <> ”;