Skip to content

Instantly share code, notes, and snippets.

View dradtke's full-sized avatar

Damien Radtke dradtke

View GitHub Profile
@dradtke
dradtke / tf.log
Created June 28, 2021 16:21
Linode Terraform Debug Logs
2021-06-28T11:19:26.579-0500 [DEBUG] Adding temp file log sink: /tmp/terraform-log020064480
2021-06-28T11:19:26.579-0500 [INFO] Terraform version: 1.0.1
2021-06-28T11:19:26.579-0500 [INFO] Go runtime version: go1.16.4
2021-06-28T11:19:26.579-0500 [INFO] CLI args: []string{"/home/damien/bin/terraform-1.0.1", "apply"}
2021-06-28T11:19:26.579-0500 [DEBUG] Attempting to open CLI config file: /home/damien/.terraformrc
2021-06-28T11:19:26.580-0500 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021-06-28T11:19:26.580-0500 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021-06-28T11:19:26.580-0500 [DEBUG] ignoring non-existing provider search directory /home/damien/.terraform.d/plugins
2021-06-28T11:19:26.580-0500 [DEBUG] ignoring non-existing provider search directory /home/damien/.local/share/terraform/plugins
2021-06-28T11:19:26.580-0500 [DEBUG] ignoring non-existing provider search directory /home/damien/.local/share/flatpak/exports/share/terraform/plugins
@dradtke
dradtke / opensuse_custom_image.txt
Created April 21, 2020 18:51
Discrepancies in "ip addr"
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 1a:ee:43:6d:a6:a5 brd ff:ff:ff:ff:ff:ff
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether f2:3c:92:3e:bd:f6 brd ff:ff:ff:ff:ff:ff
job "hubot" {
region = "us"
datacenters = ["us-central"]
type = "service"
group "hubots" {
count = 1
task "hubot" {
@dradtke
dradtke / damienradtkecom.nomad
Created June 28, 2019 22:09
Certificate renewer addition to damienradtkecom.nomad
group "certrenewer" {
count = 1
task "certrenewer" {
driver = "raw_exec"
config {
command = "cert-renewer"
}
service {
@dradtke
dradtke / damienradtkecom.nomad
Created June 28, 2019 22:04
Nomad job for damienradtke.com
job "damienradtkecom" {
region = "us"
datacenters = ["us-central"]
type = "service"
group "server" {
count = 1
task "server" {
@dradtke
dradtke / cert-renewer.go
Last active June 28, 2019 22:01
Go program that periodically renews SSL certificates using Let's Encrypt and updates a Lindode NodeBalancer
package main
import (
"context"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"encoding/pem"
"errors"
"fmt"
@dradtke
dradtke / balance.rb
Created June 26, 2019 17:56
Consul watch script for updating a Linode NodeBalancer's config
#!/usr/bin/env ruby
#
# This script is intended to be run as part of a Consul watch listening for services.
# It then uses Linode's API to remove nodes no longer available, and to add new ones.
#
require 'json'
require 'httparty'
BALANCER_NAME, CONFIG_PORT = ARGV
@dradtke
dradtke / install-hashicorp.sh
Created June 25, 2019 14:43
Hashicorp tool installation script
#!/bin/bash
#
# This script installs Hashicorp tools from their releases page.
#
# It follows the Checksum Verification recommendation described
# at https://www.hashicorp.com/security, and downloads the app
# as /usr/local/bin/<app>-<version>.
if [[ $# -ne 2 ]]; then
echo "usage: $0 <app> <version>"
#!/usr/bin/env python
from marionette_driver.marionette import Actions, Marionette, Keys
from marionette_driver.errors import NoSuchElementException
from marionette_driver.expected import element_present, element_not_present from marionette_driver import By, Wait
import base64
import os
import time
root_url = 'https://teaas.fyi/'
@dradtke
dradtke / import-github-issues.sh
Created June 22, 2018 21:27
A script for importing GitHub issues into a Fossil repository
#!/bin/bash
# +o histexpand is to avoid issues with ! showing up in ticket descriptions.
# The rest are just good Bash script practice.
set -eu -o pipefail +o histexpand
if [[ $# -lt 2 ]]; then
echo "usage: $0 <user> <repo>"
exit 1
fi