This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config setup | |
uniqueids=no | |
charondebug = ike 3, cfg 3 | |
conn %default | |
dpdaction=clear | |
dpddelay=35s | |
dpdtimeout=2000s | |
keyexchange=ikev2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from elasticsearch import Elasticsearch, RequestsHttpConnection | |
from aws_requests_auth.boto_utils import BotoAWSRequestsAuth | |
# sanity check Python version | |
assert(sys.version_info >= (3,6)) | |
ES_ENDPOINT = 'search-dev-logs-kxsz2asdflkjlaksdfie7i36iry.ap-southeast-2.es.amazonaws.com' | |
AWS_REGION = 'ap-southeast-2' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def idpMetadata (slurp "FederationMetadata.xml")) | |
(defn encode64 [b] | |
(. (new sun.misc.BASE64Encoder) encode b)) | |
(defn str-to-bytes [s] (.getBytes s)) | |
(def saml-response (encode64 (str-to-bytes (slurp "saml-response.xml")))) | |
(def sts-cookie "MSISAuth=AAEasdfasdfasdfqp") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM centos | |
RUN yum makecache fast | |
RUN yum update -y | |
RUN yum install -y tree | |
WORKDIR /mnt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ## Goal | |
// | |
// A convenient and secure way to get temporary credentials for AWS which I can use | |
// with Terraform or the Python CLI. Sort of like `saml2aws` but in the browser. | |
// | |
// ## Implementation | |
// | |
// A client-side JS app which uses Cognito and IAM resources as the backend. | |
// | |
// 1) Open the app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Open a TLS connection to a remote host and verify its cert. | |
* Usage: node tls_connect.js -connect thewest.com.au:443 | |
*/ | |
var tls = require('tls'); | |
var i = process.argv.indexOf('-connect'); | |
var connect = process.argv[1+i].split(':'); | |
var servername = connect[0]; | |
var port = Number(connect[1]); | |
if (0 < i && connect && servername && port) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# This program requires two filename arguments. Each file should contain a list | |
# of address ranges (CIDR blocks). The output will be a list of address which | |
# are in the first list but not the second expressed as /32 ranges. | |
from __future__ import unicode_literals | |
import sys | |
import ipaddress |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable jobnumber { | |
default = "201802061831" | |
} | |
provider aws { | |
region = "ap-southeast-2" | |
} | |
resource aws_sqs_queue asdf { | |
receive_wait_time_seconds = 20 # enable long polling by default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install and configure Wowza Streaming Engine | |
class profile::wowza { | |
# Placeholder to install Wowza Streaming Engine (WowzaStreamingEngine-4.7.1-linux-x64-installer.run) | |
$config = hiera('wowza') | |
$audio_upstream = 'http://localhost:1935' | |
$wowza_upstream = 'http://localhost:8088' | |
$shoutcast_upstream = 'http://localhost:8000' | |
# The following URLs are for management: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So, what did I try? | |
Well, first I tried to find a CMS that didn't need MySQL. Painful. | |
Then, I tried installing MySQL. They have made this very hard to | |
automate. | |
Then, I tried running MySQL in a Docker container. The first annoying | |
thing here was that I needed a specific version of Docker's API but that | |
also meant a specific version of the Python library and adding |