From c1195fad469ed16d02d898f48d1aeff7faa03828 Mon Sep 17 00:00:00 2001 From: earnest ma Date: Wed, 22 Jun 2022 18:08:34 -0400 Subject: [PATCH] Script to send secrets --- Brewfile | 2 ++ bin/.local/bin/sendsecrets | 16 ++++++++++++++++ zsh/.zprofile | 4 ++-- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100755 bin/.local/bin/sendsecrets diff --git a/Brewfile b/Brewfile index ed37ffc..30fc1bd 100644 --- a/Brewfile +++ b/Brewfile @@ -33,8 +33,10 @@ brew "onefetch" brew "openjdk" brew "pinentry-mac" brew "poetry" +brew "pyright" brew "restic" brew "ripgrep" +brew "rsync" brew "rust-analyzer" brew "rustup-init" brew "shellcheck" diff --git a/bin/.local/bin/sendsecrets b/bin/.local/bin/sendsecrets new file mode 100755 index 0000000..debf0ef --- /dev/null +++ b/bin/.local/bin/sendsecrets @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# Send secrets from certain files to another trusted device. +# WILL NOT DELETE FILES, BUT WILL OVERWRITE! + +set -x + +if [[ -z $1 ]]; then + echo "Missing user@host to send to" + exit 2 +fi + +files="$HOME/.ssh $HOME/.gnupg $HOME/.wakatime.cfg" + +rsync -rav \ + --exclude="$HOME/.ssh/id_*" --exclude="*.sock" \ + $files "${1}:" diff --git a/zsh/.zprofile b/zsh/.zprofile index 25fe32f..cdb3446 100644 --- a/zsh/.zprofile +++ b/zsh/.zprofile @@ -22,8 +22,8 @@ pathadd_head '/tmp/bin' pathadd_head "$HOME/.config/emacs/bin" if [[ $HOST == "core.envs.net" ]]; then - pathadd_tail '/envs/bin' - pathadd_head "$HOME/public_html/files/bin" + pathadd_tail '/envs/bin' + pathadd_head "$HOME/public_html/files/bin" fi # rust