18.) Review grade Flashcards
ˢᶜʰᵉᵈᵘˡᵉ ᵃ ʳᵉᵒᶜᶜᵘʳʳᶦⁿᵍ ʲᵒᵇ ᵗʰᵃᵗ ᵉˣᵉᶜᵘᵗᵉˢ ᵃ ˢᶜʳᶦᵖᵗ ᶠʳᵒᵐ ʰᵗᵗᵖˢ://* ᵗʰᵃᵗ ʳᵘⁿˢ ʰᵒᵘʳˡʸ ᵇᵉᵗʷᵉᵉⁿ ⁷ ᵃⁿᵈ ⁹ ᵒⁿ ᵃˡˡ ᵈᵃʸˢ ᵉˣᶜᵉᵖᵗ ˢᵃᵗᵘʳᵈᵃʸ ᵃⁿᵈ ˢᵘⁿᵈᵃʸ
$ curl https://* >> /home/run.sh $ chmod +x /home/run.sh $ crontab -e 0 19-21 * * * /home/run.sh $ crontab -l
Restore graphical target persistently to be multi-user.target
$ systemctl get-default # systemctl set-default multi-user.target
get a script from a server
$ wget https://*
$ chmod +x
Create a 2GB partition
# parted /dev/vdb mklabel msdos # parted /dev/vdb mkpart primary 1GiB 3 GiB # parted /dev/vdb set 1 lvm on
Create a logical volume vol_home on /dev/vdb. Call VG extra_storage
# pvcreate /dev/vdb1 # vgcreate extra_storage /dev/vdb1 # lvcreate -L 1GiB -n vol_home extra_storage
Make the newly create /dev/vdb vol_home XFS formatted and mount it on /home-directories
# mkdir /home-directories # ᵐᵏᶠˢ ⁻ᵗ ˣᶠˢ /ᵈᵉᵛ/ᵉˣᵗʳᵃ⁻ˢᵗᵒʳᵃᵍᵉ/ᵛᵒˡ⁻ʰᵒᵐᵉ
# ˡˢᵇˡᵏ ⁻ᵒ ᵁᵁᴵᴰ /ᵈᵉᵛ/ᵉˣᵗʳᵃ⁻ˢᵗᵒʳᵃᵍᵉ/ᵛᵒˡ⁻ʰᵒᵐᵉ ►ᶠˢᵗᵃᵇ > ᵁᵁᴵᴰ /ʰᵒᵐᵉ⁻ᵈᶦʳᵉᶜᵗᵒʳᶦᵉˢ ˣᶠˢ ᵈᵉᶠᵃᵘˡᵗˢ ⁰ ⁰
mount nfs share servera:/share onto /local-share
►fstab > servera:/share /local-share xfs rw,sync defaults 0 0
Create a new 512MiB swap on /dev/vdc
# parted /dev/vdc mklabel msdos # ᵖᵃʳᵗᵉᵈ /ᵈᵉᵛ/ᵛᵈᶜ ᵐᵏᵖᵃʳᵗ ᵖʳᶦᵐᵃʳʸ ˡᶦⁿᵘˣ⁻ˢʷᵃᵖ ¹ᴹᶦᴮ ⁵¹³ᴹᶦᴮ # ᵐᵏˢʷᵃᵖ /ᵈᵉᵛ/ᵛᵈᶜ¹ ᶠˢᵗᵃᵇ > ᵁᵁᴵᴰ⁼ˣ ˢʷᵃᵖ ˢʷᵃᵖ ᵈᵉᶠᵃᵘˡᵗˢ ⁰ ⁰ # swapon -a
ˢᵉᵗ ˢᵉʳᵛᵉʳᵇ ᵗᵒ ᵃᵘᵗᵒ ᵐᵒᵘⁿᵗ /ʰᵒᵐᵉ/ᵖʳᵒ ʷʰᵉⁿ ᵗʰᵉ ᵘˢᵉʳ ˡᵒᵍˢ ᶦⁿ ᵘˢᶦⁿᵍ /ʰᵒᵐᵉ⁻ᵈᶦʳ/ᵖʳᵒ
# yum install autofs ►vi /etc/auto.master.d/pro.autofs /- /etc/auto.pro5 ►vi /etc/auto.pro5 > /localhome/pro5 -rw serva.x.x.com:/home-dir/pro5 # systemctl restart autofs
configure ‘web’ container to start automatically with the server as ‘containers’ user
$ mkdir -p ~/.config/systemd/user
$ cd ~/.config/systemd/user
$ podman generate systemd –name web –files –new
$ podman stop -a | podman rm -a
$ systemctl –user daemon-reload
$ systemctl –user enable –now container-web.service
$ loginctl enable-linger