From 51c68803c50aa332fe5ef3ead1ea8efb90d6b5ae Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Thu, 31 Oct 2019 06:32:07 -0700 Subject: [PATCH] latest junk --- bin/unlock-syncpi-las2 | 10 ++++++++++ x/main.go | 23 +++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100755 bin/unlock-syncpi-las2 create mode 100644 x/main.go diff --git a/bin/unlock-syncpi-las2 b/bin/unlock-syncpi-las2 new file mode 100755 index 0000000..a10a48d --- /dev/null +++ b/bin/unlock-syncpi-las2 @@ -0,0 +1,10 @@ +#!/bin/bash + +KEYFILE="$HOME/Documents/sync/secrets/luks/syncpi-las2.luks.txt.gpg" + +if [[ ! -e "$KEYFILE" ]]; then + echo "wrong box!" >> /dev/stderr + exit 1 +fi + +gpg -d "$KEYFILE" | ssh root@syncpi-las2.tor "bash /root/unlock_disks" diff --git a/x/main.go b/x/main.go new file mode 100644 index 0000000..55045ac --- /dev/null +++ b/x/main.go @@ -0,0 +1,23 @@ +package main + +import "fmt" +import "time" +import "github.com/bamzi/jobrunner" + +func main() { + jobrunner.Start() // optional: jobrunner.Start(pool int, concurrent int) (10, 1) + jobrunner.Schedule("@every 5s", ReminderEmails{}) + time.Sleep(time.Second * 30) +} + +// Job Specific Functions +type ReminderEmails struct { + // filtered +} + +// ReminderEmails.Run() will get triggered automatically. +func (e ReminderEmails) Run() { + // Queries the DB + // Sends some email + fmt.Printf("Every 5 sec send reminder emails \n") +}