Auto-restart MariaDB after crash

Open file in nano (or other text editor) from root user:

nano /etc/systemd/system/multi-user.target.wants/mariadb.service

Change parameters in file:

# Restart crashed server only, on-failure would also restart, for example, when
# my.cnf contains unknown option
Restart=always
RestartSec=45s

Restart daemons:

systemctl daemon-reload
systemctl restart mariadb.service

Serial (COM port) to USB cable for old APC UPS

Firstly find and buy cable on aliexpress by keywords «APC Smart UPS DB9, CP2102, USB RS232, serial 9 D-Sub, cable 940-0024C, Windows 7/8/10, Mac, Linux».

Continue reading

Mount VirtualBox vdi image (debian, ubuntu)

You can use qemu package.

apt-get install qemu

After you can check and load network block device kernel-module:

rmmod nbd
modprobe nbd max_part=8

Then you connect image:

qemu-nbd -c /dev/nbd0 image.vdi

And mount (don’t forget create mount directory /media/image):

mount /dev/nbd0p1 /media/image

And unmount:

qemu-nbd -d /dev/nbd0