Skip to content

Instantly share code, notes, and snippets.

@lancehudson
lancehudson / export.sh
Created May 4, 2020 18:26
Export all regions with terraforming
#!/usr/bin/env bash
TERRAFORMING="~/.gem/ruby/2.6.0/bin/terraforming"
AWS_PROFILE="dev"
AWS_REGIONS=($(AWS_PROFILE=$AWS_PROFILE aws ec2 describe-regions | jq -r '.Regions[].RegionName'))
COMPONENTS=($($TERRAFORMING help | grep terraforming | grep -v help | awk '{print $2}'))
for REGION in "${AWS_REGIONS[@]}"
do
rm -rf $REGION
@lancehudson
lancehudson / thousandeyes.yml
Created April 22, 2020 05:38
thousand eyes swagger def
openapi: 3.0.0
info:
title: Thousand Eyes API V6
version: 6.0.0
externalDocs:
description: Developer Reference
url: https://developer.thousandeyes.com/v6/
servers:
- url: https://api.thousandeyes.com/v6
description: Thousand Eyes API V6
@lancehudson
lancehudson / run.sh
Created February 11, 2019 18:04
aws unsubscribe
#!/bin/bash
# xargs -n 1 ./run.sh <list.txt
EMAIL=$1
if [ -z "$EMAIL" ]
then
echo "No email address supplied"
exit 1
@lancehudson
lancehudson / crash.log
Created May 10, 2018 21:33
Terraform crash
2018/05/10 17:27:28 [INFO] Terraform version: 0.11.7
2018/05/10 17:27:28 [INFO] Go runtime version: go1.10.1
2018/05/10 17:27:28 [INFO] CLI args: []string{"/usr/local/Cellar/terraform/0.11.7/bin/terraform", "apply"}
2018/05/10 17:27:28 [DEBUG] Attempting to open CLI config file: /Users/XXX/.terraformrc
2018/05/10 17:27:28 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2018/05/10 17:27:28 [INFO] CLI command args: []string{"apply"}
2018/05/10 17:27:28 [INFO] command: empty terraform config, returning nil
2018/05/10 17:27:28 [DEBUG] command: no data state file found for backend config
2018/05/10 17:27:28 [DEBUG] New state was assigned lineage "8a3c07bb-2eda-9897-1d7c-cc6cd3073dfe"
2018/05/10 17:27:28 [INFO] command: backend initialized: <nil>
@lancehudson
lancehudson / crash.log
Created May 10, 2018 21:33
Terraform crash
2018/05/10 17:27:28 [INFO] Terraform version: 0.11.7
2018/05/10 17:27:28 [INFO] Go runtime version: go1.10.1
2018/05/10 17:27:28 [INFO] CLI args: []string{"/usr/local/Cellar/terraform/0.11.7/bin/terraform", "apply"}
2018/05/10 17:27:28 [DEBUG] Attempting to open CLI config file: /Users/XXX/.terraformrc
2018/05/10 17:27:28 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2018/05/10 17:27:28 [INFO] CLI command args: []string{"apply"}
2018/05/10 17:27:28 [INFO] command: empty terraform config, returning nil
2018/05/10 17:27:28 [DEBUG] command: no data state file found for backend config
2018/05/10 17:27:28 [DEBUG] New state was assigned lineage "8a3c07bb-2eda-9897-1d7c-cc6cd3073dfe"
2018/05/10 17:27:28 [INFO] command: backend initialized: <nil>
@lancehudson
lancehudson / debug.log
Created May 10, 2018 21:31
Terraform Debug
$ TF_LOG=debug terraform apply
2018/05/10 17:27:28 [INFO] Terraform version: 0.11.7
2018/05/10 17:27:28 [INFO] Go runtime version: go1.10.1
2018/05/10 17:27:28 [INFO] CLI args: []string{"/usr/local/Cellar/terraform/0.11.7/bin/terraform", "apply"}
2018/05/10 17:27:28 [DEBUG] Attempting to open CLI config file: /Users/XXX/.terraformrc
2018/05/10 17:27:28 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2018/05/10 17:27:28 [INFO] CLI command args: []string{"apply"}
2018/05/10 17:27:28 [INFO] command: empty terraform config, returning nil
2018/05/10 17:27:28 [DEBUG] command: no data state file found for backend config
2018/05/10 17:27:28 [DEBUG] New state was assigned lineage "8a3c07bb-2eda-9897-1d7c-cc6cd3073dfe"
@lancehudson
lancehudson / crontab
Last active November 5, 2017 22:21
AWS Custom Metrics
*/5 * * * * /usr/local/bin/putMetrics.sh
@lancehudson
lancehudson / sketch.ino
Created October 9, 2016 02:49
Steam Car Pump Controller
const int RelayPin = 4;
const int WaterSensorPin = A0;
const int SensorWet = 100;
const int MinimumRunTime = 2000;
const int MinimumWaitTime = 2000;
const bool RelayOn = LOW;
const bool RelayOff = HIGH;
bool relayState = false;
@lancehudson
lancehudson / send.js
Created June 17, 2016 17:53
Starts a timer on the LAB's Alpha LED sign
var net = require('net');
var moment = require('moment');
var leftpad = require('leftpad');
var start = function() {
var client = net.connect({ host: '192.168.11.193', port: 10001 }, function() {
console.log('Server: connected');
client.on('data', function(data) {
console.log('----- NEW -----');