Skip to content

Instantly share code, notes, and snippets.

View solarmicrobe's full-sized avatar

Russell Parks solarmicrobe

View GitHub Profile
@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 / 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 / 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 / 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 / delcmpt.bash
Created February 3, 2025 21:45
Delete all resources from compartment in OCI
#!/usr/bin/env bash
# Taken from https://stackoverflow.com/a/65676174
# Input parameter pattern changed and run through shellcheck
delcmpt(){
if [ -z ${OCI_TENANCY_NAME+x} ]; then
echo "Tenancy Name:"
read -r OCI_TENANCY_NAME
echo ""
fi
if [ -z ${OCI_TENANCY_OCID+x} ]; then