Use LZ4 with tar for compress multiple directories

lz4 is an extremely fast lossless compression algorithm, based on byte-aligned LZ77 family of compression scheme. lz4 offers compression speeds of 400 MB/s per core, linearly scalable with multi-core CPUs. It features an extremely fast decoder, with speed in multiple GB/s per core, typically reaching RAM speed limit on multi-core systems. The native file format is the .lz4 format. But lz4 accept input with files only if want to compress directory we need to tar them into tar files before compress it.

First install lz4

apt install liblz4-tool

Then compress it

tar cf - dir1 dir2 dir3 dirX | lz4 -v > file_name.tar.lz4
OR
tar cf - dir_pattern* | lz4 -v > file_name.tar.lz4

Finally decompress it

lz4 -d -v file_name.tar.lz4 | tar xf - -C /target/directory

 

Workaround openmediavault python 3.5 weakref.py error

When you update or install something in openmediavault 4.x and saw theses

Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x7fb7d2d82730>
Traceback (most recent call last):
  File "/usr/lib/python3.5/weakref.py", line 117, in remove
TypeError: 'NoneType' object is not callable
Exception ignored in: <function WeakValueDictionary.__init__.<locals>.remove at 0x7fb7d2d82730>
Traceback (most recent call last):
  File "/usr/lib/python3.5/weakref.py", line 117, in remove
TypeError: 'NoneType' object is not callable

You can workaround it with

curl -L https://raw.githubusercontent.com/python/cpython/3.5/Lib/weakref.py > /usr/lib/python3.5/weakref.py

 

 

Thailand ISP’s DNS

AIS
Preferred DNS server 115.178.58.10
Alternate DNS server 115.178.58.26

True
Preferred DNS server 203.144.207.29
Alternate DNS server 203.144.207.49

3BB
Preferred DNS server 110.164.252.222
Alternate DNS server 110.164.252.223

TOT
Preferred DNS server 203.113.127.199
Alternate DNS server 203.113.24.199

SINET
SINET-INET
Preferred DNS server 203.150.213.1
Alternate DNS server 203.150.218.161
SINET-BeeNet
Preferred DNS server 117.121.222.223
Alternate DNS server 117.121.210.111

CAT
Preferred DNS server 61.19.245.245
Alternate DNS server 61.19.245.246

Cloudflare
Preferred DNS server 1.1.1.1
Alternate DNS server 1.0.0.1

GOOGLE
Preferred DNS server 8.8.8.8
Alternate DNS server 8.8.4.4

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
  clear
fi

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/libstdc++.so.6 ~/Android/Sdk/emulator/lib64/libstdc++/libstdc++.so.6

 

Install and use angular CLI with yarn

Install yarn package manager

curl -L https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ 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