Set default PHP version in Ubuntu

To select default PHP version in Ubuntu, run

This will show a menu, you can select the default php version

After setting PHP 5.6 as default PHP version, you will see

Run a script on boot using systemd on Ubuntu 18.04

Previous versions of Ubuntu had /etc/rc.local. that get executed after system boot.

On Ubuntu 18.04, you can use systemd to start a bash script on system boot.

Create file


Create file /etc/rc.local with

You can replace “touch /root/OK” with whatever command you need to execute.

Make it executable with

Reload systemd

Enable the service

Now reboot the server, you will see /root/OK get created.


Install AnyDesk on Ubuntu using flatpak

AnyDesk ubuntu flatpak

AnyDesk is a remote desktop sharing application like TeamViewer and Google Remote Desktop. I normally use Google Chrome Remote desk as it is completely free. TeamViewer is popuplar alternative, but if they found out you are using it more often, they will limit your session to 5 minutes, some times even less to force you pay for paid version.

AnyDesk available for Ubuntu in deb file. I don’t like installing .deb package as it run a background process on port 7070 or somthing like that. So i decided to go with flatpak version.

First install flatpak with command

Add remote

Now you can install AnyDesk with command

flatpak install anydesk

To run AnyDesk, run

Configure Failover IP in Ubuntu 18.04 OVH VPS

Default /etc/network/interfaces in Ubuntu 18.04 in OVH VPS look like following

First install

Configure Main IP

use “ip a” command to find out interface name and IP of the VPS

In this case,

IP =
Interface Name = ens3

Use “route -n” command to find out gateway.


Edit /etc/network/interfaces

Add following


For this server, i added.

Now reboot the server.

Once server is back online, you can configure failover IPS.

Configure Failover IP

Use following script to generate your config, add in end of /etc/network/inferfaces file

php script to generate ip config

Once configured, you need to reboot the servr.

Verify IP is up with fping command.


Ubuntu Grub Disable Splash

Ubuntu Slow Boot

Last day my PC become very slow to boot.

It take 3 minutes and 17 seconds to boot up.

This happend after i did some changes to my 2nd hard disk and added ZFS partition. First thing i thought it was ZFS that make my PC slow.

systemd-analyze blame did not show any useful info.

systemd analyze blame

To find the problem, i edited the file

Find the line

Replace it with

Now rebuild grub.cfg with

Rebooted the PC. Now instead of showing Ubuntu splash screen, you get lot of text, that shows what actually your PC is doing.

Ubuntu Grub Disable Splash

From the boot message i found system waiting 1 minutes 30 seconds for mounting one of the disk partition. This is because i re-partitioned my 2nd hard disk and forget to remove the disk from /etc/fstab.

I removed the non existant disk entry from /etc/fstab and rebooted PC. Now it boot much faster.

systemd analyze

See Ubuntu

Google Chrome Native Notification

Enable Native Notification in Google Chrome

To enable/disable native notification in Google chrome, go to

Google Chrome Native Notification

Once native notification is enabled/disabled, you will be asked to restart browser.

On Ubuntu 18.04, i disable Native Notification as it is buggy, come can’t control how long notification shown if you use native notification. With chrome provided notification, you can use javascript to disable notification after predefined time. On Ubuntu 16.04, native notification is disabled by default.


OVH VPS Configure failover IP in Ubuntu

On Ubuntu

Default config look like

/etc/network/interfaces.d/50-cloud-init.cfg is used to auto configure network interface with dhcp.

First find the gateway used by the VPS.

We found the gateway IP

The VPS had main IP of the server is and secondary IPS,,

Here is the modified /etc/network/interfaces

Here is a PHP script to create OVH failover IP config for Ubuntu/Debian.