Appearance
Create a cron job
Proxmox
On Proxmox, you had some trouble getting a cron job to run. Instead, you added the cron job directly to /etc/crontab using nano. The line you added was 0 0 * * * root /root/backupZFS.sh
Clevis and TPM boot
sudo apt install clevis clevis-dracut clevis-udisks2 clevis-tpm2 clevis-initramfs -ylsblk --fsEdit this file using nano:
/usr/share/initramfs-tools/scripts/local-top/clevisFind these lines and change them accordingly.
--- clevis +++ clevis-fixed @@ -112,6 +112,8 @@ # Set the path how we want it (Probably not all needed) PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin" + [ -e /dev/fd ] || ln -s -T /proc/self/fd /dev/fd + if [ -x /bin/plymouth ] && plymouth --ping; then cryptkeyscript='plymouth ask-for-password' elsesudo clevis luks bind -d /dev/nvme0n1p3 tpm2 '{"pcr_ids":"0,1,4,5,7"}'sudo dracut -fsudo update-initramfs -u -k 'all'sudo reboot
Sending mail
Multiple lines
sendmail tyler@lucidbuddy.com
From: support@couchspot.com
Subject: UPS System
Power Failure occurred.
.
Single liners
echo Test. | mailx -r “Couchspot Support <support@couchspot.com>" -s Test tyler@lucidbuddy.com
echo "The UPS system has reported it is running on the battery, and is no longer connected to power." | mail -a "From: Couchspot Support <support@couchspot.com>" tyler@lucidbuddy.com -s "WARNING - UPS running on battery"
Scripts
Removing DS_Store files
sudo find / -name .DS_Store -delete; killall Finder
Generate random string
tr -cd '[:alnum:]' < /dev/urandom | fold -w30 | head -n1
Set partition as active using fdisk
Setting Your Partition "Active" Using Fdisk
Words in bold below are things you must type (followed by Enter).
Determine disk number, then unmount the partitions on the drive but not the drive itself.
Start fdisk using this command
fdisk -e /dev/rdisk{disk-number}
Ignore the error "fdisk: could not open MBR file ..."
Determine which partition needs to be set "Active" by typing
pSet the partition "Active"
f {PARTITION-NUMBER}Save and exit by running
writethen entering y to prompt and finally runningexit