Skip to content

Instantly share code, notes, and snippets.

View solarmicrobe's full-sized avatar

Russell Parks solarmicrobe

View GitHub Profile
@solarmicrobe
solarmicrobe / delete_all_from_sender.scpt
Created April 19, 2023 05:19 — forked from xunker/delete_all_from_sender.scpt
Delete all from sender - an Applescript for the Mail.app in Mac OS X that will search for all messages set by the sender of the email message currently open and allow you to delete them all at once.
-- Delete all from sender - https://gist.github.com/xunker/44fa4404c882c27e0ad25857e9470552
-- For the Mail.app in Mac OS X. It will search for all messages set by the sender of the email message currently open,
-- highlight them all and ask if you want to delete them. If you choose "yes" it will delete them for you and then clear
-- the search.
--
-- Important notes:
-- You can load this in Script Editor and then save it as an application so you can run it without Script Editor being open.
-- This does not work when Mail.app is in fullscreen mode; it must be in windowed mode.
-- You will need to enable "Assistive Devices" support for Script Editor (if run there) or for the .app you saved if you converted it to a standalone app.
@solarmicrobe
solarmicrobe / gist:a2533da7293ce6ed1056ac616c8f8d85
Last active June 2, 2020 16:28
Output of a "simple" terraform apply spinning up my first ovf to
TF_LOG=debug terraform apply
2020/06/02 11:27:42 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
Use TF_LOG=TRACE to see Terraform's internal logs.
----
2020/06/02 11:27:42 [INFO] Terraform version: 0.12.26
2020/06/02 11:27:42 [INFO] Go runtime version: go1.12.13
2020/06/02 11:27:42 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply"}
2020/06/02 11:27:42 [DEBUG] Attempting to open CLI config file: /home/zeus/.terraformrc
2020/06/02 11:27:42 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/06/02 11:27:42 [INFO] CLI command args: []string{"apply"}
@solarmicrobe
solarmicrobe / gist:b4d827eceff51f9ead3cd6bfae9f2d53
Created June 1, 2020 05:00
Output of a "simple" terraform apply spinning up my first ovf to
TF_LOG=debug terraform apply
2020/05/31 23:59:07 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
Use TF_LOG=TRACE to see Terraform's internal logs.
----
2020/05/31 23:59:07 [INFO] Terraform version: 0.12.26
2020/05/31 23:59:07 [INFO] Go runtime version: go1.12.13
2020/05/31 23:59:07 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply"}
2020/05/31 23:59:07 [DEBUG] Attempting to open CLI config file: /home/zeus/.terraformrc
2020/05/31 23:59:07 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/05/31 23:59:07 [INFO] CLI command args: []string{"apply"}
@solarmicrobe
solarmicrobe / datetimes.scala
Created February 18, 2020 20:47
Examples of date time and timezone fun in the JVM
import java.sql.Timestamp
import java.time.{Instant, OffsetDateTime}
import java.util.{Calendar, TimeZone}
val tz = TimeZone.getTimeZone("UTC")
val tzid = tz.toZoneId
val ts = Timestamp.from(Instant.now)
val inst = ts.toInstant
@solarmicrobe
solarmicrobe / marid.sh
Created August 18, 2017 19:27
Marid shell init.d script for SuSE 11SP4
#!/bin/bash
### BEGIN INIT INFO
# Provides: marid
# Required-Start: $network $named $remote_fs $syslog
# Required-Stop: $network $named $remote_fs $syslog
# Should-Start:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: marid
# Description: marid
@solarmicrobe
solarmicrobe / add_zerotier.sh
Last active September 13, 2021 17:29
Add zerotier to FreeNAS
#! /usr/bin/env sh
NETWORKS="8056c2e21c000001" # Space seperated list of networks to join, default here is the public network Earth
VERSION=1.2.4
wget http://pkg.freebsd.org/freebsd:11:x86:64/latest/All/zerotier-${VERSION}.txz -O /tmp/zerotier-${VERSION}.txz
pkg add -f /tmp/zerotier-${VERSION}.txz
for n in $NETWORKS; do
zerotier-cli join ${n}
@solarmicrobe
solarmicrobe / is_cert_expiring.sh
Last active May 3, 2017 13:46
Determine if SSL cert is about to expire
#!/usr/bin/env sh
# http://stackoverflow.com/questions/21297853/how-to-determine-ssl-cert-expiration-date-from-a-pem-encoded-certificate
# Usage: is_cert_expiring.sh [/path/to/cert/file.pem [seconds]]
1=${1:file.pem} # File path
2=${2:-86400} # Seconds to expiry
if openssl x509 -checkend $2 -noout -in $1; then
echo "Certificate is good for another day!"
else
echo "Certificate has expired or will do so within 24 hours!"
echo "(or is invalid/not found)"
#!/bin/bash
# Promethus SuSE system startup script
# Copyright (C) 2017 Russell Parks, Bats Global Markets, Inc.
# /etc/init.d/prometheus
#
# LSB compatible service control script; see http://www.linuxbase.org/spec/
#
### BEGIN INIT INFO
# Provides: prometheus
# Required-Start: $network $remote_fs
@solarmicrobe
solarmicrobe / backup_to_local.sh
Created January 19, 2017 01:25
Backup remote /etc/letsencrypt to local
#!/bin/sh
# $1 - [user@]server
rsync -O -e 'ssh -p 22' -rltgoDvz $1:/etc/letsencrypt/ /etc/letsencrypt