Generate a secure GPG key

For some reason gpg gen-key still defaults to SHA1 and RSA2048, due to the known weaknesses of SHA1 it is probably a better idea to use SHA256. First of all, we need to create a configuration file. cat ~/.gnupg/gpg.conf" --- personal-digest-preferences SHA256 cert-digest-algo SHA256 default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed To generate a new key type (also specify to use RSA 4096): gpg --gen-key ### or gpg --full-generate-key Other useful commands are: …

Posted on

Pacman email updates notification

Pacman as long as I know does not provide any method for sending an email notification when there are updates available. SSH into the Arch box just to find out if there are updates available is really annoying so I wrote a simple bash script to do the dirty work on my behalf. [root@arch ~]# cat /etc/cron.daily/check4updates.sh #!/bin/bash HOST=hostname DOMAIN=domain SUBJECT="System update: $HOST@$DOMAIN" EMAIL_ADDR="name@domain" ### Query pacman for available updates updates_raw=$(pacman -Syu <<< n) if echo $updates_raw | grep "there is nothing to do" then echo Everything is up to date else updates=${updates_raw#*Packages ([1-9])} ### extract packages update list up_raw=${updates%Total Download*} up=$(echo $up_raw | tr ' ' '\n') #echo -e "$up" > report.txt ### extract update size us=${updates#*Total Download*} #echo -e "\nTotal Download $us" >> report.txt ### compose email email_text="New updates available for host $HOST\n\n$up\n\nTotal Download$us" echo -e "$email_text" | mail -s "$SUBJECT" "$EMAIL_ADDR" fi To schedule the cron job to run everyday at 1 am edit the following files: …

Posted on