scripts

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 80b96bc759618dc24ee92d34c590b6ad15e65bf8
parent 3d9c2af09d47a82d878e8408191b9ef70c0c4e59
Author: Andrew Laack <andrew@laack.co>
Date:   Tue,  7 Apr 2026 12:04:13 -0500

Added encrypted emailing to myself for usage in scripts.

Diffstat:
Aemail/email-self.sh | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Minstallers/arch-public-installation.sh | 2+-
Armount.sh | 11+++++++++++
Aslack | 2++
Mtodo.sh | 6++----
5 files changed, 78 insertions(+), 5 deletions(-)

diff --git a/email/email-self.sh b/email/email-self.sh @@ -0,0 +1,62 @@ +#!/bin/bash +set -euo pipefail + +UUID=$(uuidgen) +HOSTNAME=$(hostnamectl | head -n 1 | awk '{print $3}') + +WORKDIR="/tmp/emails" +PLAIN="$WORKDIR/$UUID.txt" +ENC="$WORKDIR/$UUID.asc" +FINAL="$WORKDIR/$UUID.eml" + +mkdir -p "$WORKDIR" + +BOUNDARY="pgp-boundary-$UUID" + +cat > "$PLAIN" <<EOF +Content-Type: text/plain; charset=utf-8 + +$(cat) +EOF + +gpg --yes --batch \ + --armor \ + --output "$ENC" \ + --encrypt \ + --recipient "$EMAIL_ADDRESS" \ + "$PLAIN" + +{ + echo "From: Automated <$EMAIL_ADDRESS>" + echo "To: Automated <$EMAIL_ADDRESS>" + echo "Subject: Message from $HOSTNAME" + echo "MIME-Version: 1.0" + echo "Content-Type: multipart/encrypted; protocol=\"application/pgp-encrypted\"; boundary=\"$BOUNDARY\"" + echo + echo "This is an OpenPGP/MIME encrypted message." + echo + echo "--$BOUNDARY" + echo "Content-Type: application/pgp-encrypted" + echo + echo "Version: 1" + echo + echo "--$BOUNDARY" + echo "Content-Type: application/octet-stream; name=\"encrypted.asc\"" + echo "Content-Transfer-Encoding: 7bit" + echo "Content-Disposition: inline; filename=\"encrypted.asc\"" + echo + cat "$ENC" + echo + echo "--$BOUNDARY--" +} > "$FINAL" + +curl -s --ssl-reqd \ + --url "smtps://$EMAIL_DOMAIN:465" \ + --user "$EMAIL_ADDRESS:$EMAIL_PW" \ + --mail-from "$EMAIL_ADDRESS" \ + --mail-rcpt "$EMAIL_ADDRESS" \ + --upload-file "$FINAL" + +rm -f "$PLAIN" "$ENC" "$FINAL" + +echo "PGP/MIME encrypted message sent." diff --git a/installers/arch-public-installation.sh b/installers/arch-public-installation.sh @@ -11,7 +11,7 @@ cd -sudo pacman -S git gnome-keyring gcc make xorg-server libxft libxinerama freetype2 pkgconf ttf-fira-code zoxide fzf openssh less arandr pass pass-otp xclip newsboat xorg-xsetroot base-devel i3lock pandoc entr ripgrep wget jq man-db btop tmux rsync cronie mpv podman pavucontrol otf-latin-modern proton-vpn-gtk-app proton-vpn-cli tk brightnessctl zip unzip signal-desktop xorg-xset lynx figlet flameshot feh ffmpeg zathura-pdf-mupdf websocat xorg-xhost yt-dlp qemu-full qbittorrent alsa-utils pipewire-alsa pipewire-pulse sshfs iotop lsof neovim wireshark-qt nmap torbrowser-launcher bandwhich ghidra bind-tools whois dunst thunderbird graphviz +sudo pacman -S git gnome-keyring gcc make xorg-server libxft libxinerama freetype2 pkgconf ttf-fira-code zoxide fzf openssh less arandr pass pass-otp xclip newsboat xorg-xsetroot base-devel i3lock pandoc entr ripgrep wget jq man-db btop tmux rsync cronie mpv podman pavucontrol otf-latin-modern proton-vpn-gtk-app proton-vpn-cli tk brightnessctl zip unzip signal-desktop xorg-xset lynx figlet flameshot feh ffmpeg zathura-pdf-mupdf websocat xorg-xhost yt-dlp qemu-full qbittorrent alsa-utils pipewire-alsa pipewire-pulse sshfs iotop lsof neovim wireshark-qt nmap torbrowser-launcher bandwhich ghidra bind-tools whois dunst thunderbird graphviz element-desktop # TODO: Which of this stuff is redundant? diff --git a/rmount.sh b/rmount.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +SELECTION=$(rclone listremotes | fzf) + +# TODO: This should probalby be mounted at /mnt/{name} + +if [[ -z "$SELECTION" ]]; then + echo "No selection made." +else + rclone mount $SELECTION/ $HOME/mount --daemon +fi diff --git a/slack b/slack @@ -0,0 +1,2 @@ +#!/bin/bash +brave https://app.slack.com/client/TSTHRQ7MY diff --git a/todo.sh b/todo.sh @@ -1,11 +1,9 @@ #!/bin/bash -# TODO: This isn't right; if I miss a day, I'm fucked... - cd "/home/andrew/gitRepos/personal-notes" || exit -YESTERDAY=$(date -d "1 day ago" +%Y-%m-%d) +PRIOR=$(ls daily/ | tail -n 1 | sed 's/\.md//g' || date -d "1 day ago" +%Y-%m-%d) TODAY=$(date +%Y-%m-%d) mkdir -p daily -ls daily/$TODAY.md || cp daily/$YESTERDAY.md daily/$TODAY.md +ls daily/$TODAY.md || cp daily/$PRIOR.md daily/$TODAY.md st -e bash -c 'cd ~/gitRepos/personal-notes && nvim daily/$(date +%Y-%m-%d).md; exec bash'