Skip to content

Instantly share code, notes, and snippets.

View mhanline's full-sized avatar

Michael Hanline mhanline

View GitHub Profile
@mhanline
mhanline / dynu-updater.sh
Created January 25, 2023 13:27
Dynu IPv6 update shell script. Can be run by cron job. Only updates IPv6.
#!/bin/bash
IPV6_ADDR=$(dig +short -6 myip.opendns.com aaaa @resolver1.opendns.com)
regex='^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$'
LOGGERNAME=dynu-cron
if [[ $IPV6_ADDR =~ $regex ]]; then
#Add an IPv4 variable replacing myip=no with myip=$IPV4_ADDR to update IPv4 as well.
RESULT=$(curl -s "https://api.dynu.com/nic/update?myipv6=${IPV6_ADDR}&myip=no" -u USER:PASS 2>/dev/null
else
@mhanline
mhanline / inadyn.conf
Created January 25, 2023 13:22
How to set up a custom provider with Inadyn and dynu for IPv6 address updates
period = 1800
allow-ipv6 = true
provider dynu.com {
username = USERNAME
password = PASSWORD
hostname = HOSTNAME
}
2020/07/13 09:19:17 [INFO] Terraform version: 0.12.28
2020/07/13 09:19:17 [INFO] Go runtime version: go1.12.13
2020/07/13 09:19:17 [INFO] CLI args: []string{"/home/redacteddir/bin/terraform", "apply", "-auto-approve"}
2020/07/13 09:19:17 [DEBUG] Attempting to open CLI config file: /home/redacteddir/.terraformrc
2020/07/13 09:19:17 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/07/13 09:19:17 [INFO] CLI command args: []string{"apply", "-auto-approve"}
2020/07/13 09:19:17 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2020/07/13 09:19:17 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2020/07/13 09:19:17 [DEBUG] New state was assigned lineage "1c542c4e-d915-3624-94e6-39cae4f7c6d0"
2020/07/13 09:19:17 [TRACE] Meta.Backend: using default local state only (no backend configuration, and no existing initialized backend)
@mhanline
mhanline / debugs.log
Created July 12, 2020 03:58
Debug output
2020/07/12 13:37:40 [INFO] Terraform version: 0.12.28
2020/07/12 13:37:40 [INFO] Go runtime version: go1.12.13
2020/07/12 13:37:40 [INFO] CLI args: []string{"/home/redacteduserID/bin/terraform", "apply", "-auto-approve"}
2020/07/12 13:37:40 [DEBUG] Attempting to open CLI config file: /home/redacteduserID/.terraformrc
2020/07/12 13:37:40 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/07/12 13:37:40 [INFO] CLI command args: []string{"apply", "-auto-approve"}
2020/07/12 13:37:40 [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/07/12 13:37:40 [DEBUG] New state was assigned lineage "b6fb0548-f306-aaf6-ed5a-ca26f45ceace"
provider "google" {
project = "<your project ID here>"
}
resource "google_compute_network" "vpc" {
name = "newvpc"
auto_create_subnetworks = false
}
resource "google_compute_subnetwork" "region-a-sub" {