Skip to content

Instantly share code, notes, and snippets.

@sturadnidge
sturadnidge / clean_pcf_mysql.sh
Last active November 28, 2017 00:27
Cleans a PCF MySQL host
#!/bin/bash
if [ $# -ne 3 ]
then
echo "Usage: $0 {pcf-version} {mysql-host.fqdn} {mysql-user}"
echo "Cleans PCF databases on a MySQL host"
exit 1
fi
VERSION="$1"
@sturadnidge
sturadnidge / create_pcf_mysql.sh
Last active November 28, 2017 00:26
Creates the MySQL databases required for a PCF install
#!/bin/bash
if [ $# -ne 3 ]
then
echo "Usage: $0 {pcf-version} {mysql-host.fqdn} {mysql-user}"
echo "Creates PCF databases on a MySQL host"
exit 1
fi
VERSION="$1"
@sturadnidge
sturadnidge / rootCA.cfg
Created July 14, 2017 01:40
openssl config file for a root CA that will sign requests with subjectAltName(s)
#
# OpenSSL example configuration file.
# This is mostly being used for generation of certificate requests.
#
# This definition stops the following lines choking if HOME isn't
# defined.
HOME = .
RANDFILE = $ENV::HOME/.rnd
@sturadnidge
sturadnidge / 12factor.req
Created July 14, 2017 01:42
Config file to generate a certificate signing request for 12factor.com for use with PCF (ie all required SANs)
[req]
default_bits = 2048
default_md = sha256
distinguished_name = subject
encrypt_key = no
prompt = no
req_extensions = req_ext
[subject]
countryName = AU
@sturadnidge
sturadnidge / install_tmux_macos_no_brew.sh
Last active December 10, 2017 01:13
Install tmux on macOS 10.12 without need for brew or OpenSSL
#
# all credit to https://gist.github.com/shrayasr/8714601#gistcomment-2127790
#
## setup
TMUX_VER=2.6
LIBEVENT_VER=2.1.8-stable
TEMP_COMPILE=~/tmux-temp-compile
COMMON_INSTALL_PREFIX=/usr/local
@sturadnidge
sturadnidge / is-it-down.sh
Last active July 23, 2017 02:04
Quick and dirty HTTP monitor
#!/bin/bash
if [ $# -ne 1 ]
then
echo "Usage: $0 {host.fqdn}"
echo "runs curl against a host until it doesn't"
exit 1
fi
HOST=$1
@sturadnidge
sturadnidge / tcp-server.js
Last active January 7, 2018 01:22
node.js tcp server
var net = require('net');
var server = net.createServer(function(socket) {
socket.write('ADMIN HE DOING IT SIDEWAYS\r\n');
socket.pipe(socket);
});
server.listen(process.env.PORT);