MariaDB and MySQL database backup
mysqldump -u USER -pPASSWORD --single-transaction --quick --skip-lock-tables --ignore-table=DATABASE.some_table DATABASE | gzip > "$(date +"%Y-%m-%d_%H-%M-%S").sql.gz"
mysqldump -u USER -pPASSWORD --single-transaction --quick --skip-lock-tables --ignore-table=DATABASE.some_table DATABASE | gzip > "$(date +"%Y-%m-%d_%H-%M-%S").sql.gz"
CREATE DATABASE mydatabase CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
<?php
$curl = curl_init('https://www.google.se');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($curl);
curl_close($curl);
echo $data;
If you are installing Slackware, after setup is done and before reboot, first chroot into the root partition:
# mount -t ext4 /dev/sda1 /mnt
# mount -o bind /proc /mnt/proc
# mount -o bind /dev /mnt/dev
# mount -o bind /sys /mnt/sys
# chroot /mnt
# mkinitrd -c -f ext4 -r /dev/sda1 -m hv_vmbus:hv_storvsc:mbcache:jbd2:ext4 -u -o /boot/initrd.gz -k 4.4.xxx
-r = boot partition
-k = kernel version
edit /etc/lilo.conf (or grub, elilo.conf etc) to match new initrd and generic kernel:
# nano -w /etc/lilo.conf
image = /boot/vmlinuz-generic-4.4.xxx
append = "elevator=noop"
initrd = /boot/initrd.gz
root = /dev/sda1
label = hyperv
read-only
# lilo
echo "beforestring-THIS IS THE STRING I WANT-afterstring" | \
grep -o -P '(?<=beforestring-).*(?=-afterstring)'