Change Ubuntu grub background colour

sudo -H gedit /usr/share/plymouth/themes/default.grub

And change the grub background colour as you want with RGBA code, in my case I change grub background to gray (128,128,128,0)

if background_color 128,128,128,0; then

Then, update grub

sudo update-grub2


Fix cannot start Emulator in android studio

Install Required libraries

sudo apt install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386 qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils lib64stdc++6:i386

Link library to emulator path

ln -sf /usr/lib64/ ~/Android/Sdk/emulator/lib64/libstdc++/


Install and use angular CLI with yarn

Install yarn package manager

curl -L | sudo apt-key add -
echo "deb stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt remove cmdtest
sudo apt install yarn

Check yarn global bin path

sudo yarn global bin

Install angular CLI

sudo yarn global add @angular/cli

Check ng command

ng --version

Set angular use yarn as default package manager

# angular 5
ng set --global packageManager=yarn
# angular 6
ng config -g cli.packageManager yarn


Ubuntu 16.04+ network 802.3ad LACP bonding

In juniper switch set aggregated Ethernet link mode as active

set aeX aggregated-ether-options lacp active

Edit file /etc/network/interfaces

# The loopback network interface
auto lo
iface lo inet loopback

# eth0 slave interface
iface eth0 inet manual

# eth1 slave interface
iface eth1 inet manual

# bond0 trunk interface
auto bond0
iface bond0 inet manual
    slaves eth0 eth1
    bond-mode 4
    bond-miimon 100
    bond-downdelay 200
    bond-updelay 200
    bond-lacp-rate 1
    bond-xmit-hash-policy layer3+4
    #post-up ifup eth0 eth1

# bond0.2 vlan 2 interface
auto bond0.2
iface bond0.2 inet static
    vlan-raw-device bond0
    pre-down ip -4 addr flush dev $IFACE

# bond0.3 vlan 3 interface
auto bond0.3
iface bond0.3 inet static
    vlan-raw-device bond0
    pre-down ip -4 addr flush dev $IFACE

Then restart networking service

service networking restart && ifdown bond0 && ifup bond0


Upgrade MariaDB 10.1 to MariaDB 10.2

Shutdown current MariaDB server

mysql -u root -p {-h remote.db.server}

For safety, backup current database files

rsync -aP /var/lib/mysql /path/to/backup/
rsync -aP /etc/mysql /path/to/backup/mysql-config

Uninstall MariaDB 10.1

apt-get remove mariadb-server

Add or replace MariaDB 10.1 with MariaDB 10.2 repositories
You can find suitable server in
My case use server in Thailand.

# MariaDB 10.2 repository list - created 2017-08-28 07:37 UTC
deb [arch=amd64,i386] xenial main
deb-src xenial main

Install MariaDB 10.2

apt-get update
apt-get install mariadb-server

Run upgrade database command


Stop service and edit your MariaDB server with your config

# systemd
systemctl stop mariadb
# upstart
service mysql stop
# edit config file in /etc/mysql with your config

Restart MariaDB Server

# systemd
systemctl restartmariadb
# upstart
service mysql restart