Boot manually from GRUB
grub> insmod lvm # only when using LVM
grub> ls
grub> cat (lvm/rhel-root)/etc/fstab
grub> set root=(lvm/rhel-root)
grub> linux (hd0,msdos1)/vmlinuz-<TAB> root=/dev/mapper/rhel-root
grub> initrd (hd0,msdos1)/initramfs-<TAB>
grub> boot
WPAConfig example
WPAConfigSection=(
'ssid="ap_name"'
'key_mgmt=WPA-EAP'
'eap=PEAP'
'group=TKIP CCMP'
'pairwise=TKIP CCMP'
'anonymous_identity=""'
'identity="username"'
'password="password"'
'priority=1'
'phase2="auth=MSCHAPV2"'
)
Yum swap packages
yum swap -- install foo -- remove bar
Subtract lines in one file from another
grep -F -x -v -f fileB fileA
Build Nvidia driver for specific kernel
sh NVIDIA-Linux-x86_64-384.111.run --kernel-name=3.10.0-693.21.1.el7.x86_64 --kernel-source-path=/lib/modules/3.10.0-693.21.1.el7.x86_64/source
Make IPv6 work with NetworkManager on Hetzner
nmcli con modify <connection id> ipv6.addr-gen-mode eui64
nmcli networking off; nmcli networking on
Redirect IPv4:port to IPv6
socat TCP4-LISTEN:22,fork,su=nobody TCP6:[2a01:4f8:141:12a5::1]:22
Sync with rsync
# receiving host
rsync -avm --include="01-*" --include="*/" --exclude="*" /var/lib/tftpboot/ /home/admin/pxe/
# sending host
rsync /home/admin/pxe/ /var/lib/tftpboot/ -av
Growpart packages
centos: cloud-utils-growpart
debian: cloud-guest-utils
Extend disk
echo 1 > /sys/block/<dev>/device/rescan
growpart /dev/<dev> <index>
pvresize /dev/<partition>
lvextend -l +100%FREE /dev/mapper/<name>
# xfs
xfs_growfs
# ext
resize2fs