Skip to content

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 ​

  1. sudo apt install clevis clevis-dracut clevis-udisks2 clevis-tpm2 clevis-initramfs -y

  2. lsblk --fs

  3. Edit this file using nano: /usr/share/initramfs-tools/scripts/local-top/clevis

  4. Find 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'
         else
    
  5. sudo clevis luks bind -d /dev/nvme0n1p3 tpm2 '{"pcr_ids":"0,1,4,5,7"}'

  6. sudo dracut -f

  7. sudo update-initramfs -u -k 'all'

  8. 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).

  1. Determine disk number, then unmount the partitions on the drive but not the drive itself.

  2. Start fdisk using this command fdisk -e /dev/rdisk{disk-number}

Ignore the error "fdisk: could not open MBR file ..."

  1. Determine which partition needs to be set "Active" by typing p

  2. Set the partition "Active" f {PARTITION-NUMBER}

  3. Save and exit by running write then entering y to prompt and finally running exit