Skip to content

Instantly share code, notes, and snippets.

View wlonkly's full-sized avatar

Rich Lafferty wlonkly

View GitHub Profile
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1ffc71bf263c fresh-website:latest /usr/sbin/httpd -DFO 6 seconds ago Up 5 seconds 443/tcp, 0.0.0.0:80->80/tcp web
e60f4f3bee2a fresh-webdb:latest /usr/local/sbin/mysq 4 minutes ago Up 4 minutes 0.0.0.0:3306->3306/tcp db,web/db
@wlonkly
wlonkly / gist:af12e7a80733a22384e0
Created October 8, 2014 21:50
authorize.net ssl failure
$ openssl s_client -tls1 -state -msg -connect secure.authorize.net:443
CONNECTED(00000003)
SSL_connect:before/connect initialization
>>> TLS 1.0 Handshake [length 005f], ClientHello
01 00 00 5b 03 01 54 35 b1 4c e1 b6 ce e7 8d a7
7f 30 f5 f7 45 fa 19 e0 b0 7d 68 21 da fc 85 80
45 80 82 2d d9 30 00 00 2e 00 39 00 38 00 35 00
16 00 13 00 0a 00 33 00 32 00 2f 00 9a 00 99 00
96 00 05 00 04 00 15 00 12 00 09 00 14 00 11 00
08 00 06 00 03 00 ff 01 00 00 04 00 23 00 00
@wlonkly
wlonkly / gist:748d163bb8736c194890
Created December 8, 2014 00:38
docker machine
:) flounder$ ./machine -D create -d digitalocean --digitalocean-access-token='token' dockertest
INFO[0000] Creating SSH key...
INFO[0000] Creating Digital Ocean droplet...
INFO[0002] Waiting for SSH...
INFO[0083] "dockertest" has been created and is now the active machine. Docker commands will now run against that machine.
:) flounder$ ./machine ls
NAME ACTIVE DRIVER STATE URL
dockertest * digitalocean Running tcp://104.236.23.196:2376
:) flounder$ export DOCKER_HOST=tcp://104.236.23.196:2376
:( flounder$ export DOCKER_AUTH=identity
@wlonkly
wlonkly / gist:b9683d71cea2852539bd
Created December 30, 2014 21:36
things to check
<ebi> things to check is permissions or cabling or full disk or cache or version conflict or duplex mismatch
or firewall rules or resolv.conf or /etc/hosts or CR/LF or setuid/setgid or default gateway or IP
conflicts or logs or port number or zonefile dot or I/O dammit or mounts or power or whitespace or
reload into bad config or ip forwarding or trailing slash or mac address or inodes
@wlonkly
wlonkly / gist:bd71bba121a70e2ffd22
Last active August 29, 2015 14:22
authorize.net + entrust + sha256 = ;_;

I was bit by not having the right root CA certificates for Authorize.net's new Entrust-originated SHA2 certificate on secure.authorize.net. Using ruby net/https produced this OpenSSL error:

/usr/local/lib/ruby/1.8/net/http.rb:586:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)

They made a blog post about it:

http://community.developer.authorize.net/t5/The-Authorize-Net-Developer-Blog/Production-Certificate-Upgrades-begin-May-27-2015/ba-p/50430

and claim that you should have:

@wlonkly
wlonkly / kops.tf
Created December 17, 2016 16:42
Example k8s cluster config from kops' terraform output option
provider "aws" {
region = "us-east-1"
}
resource "aws_autoscaling_group" "master-us-east-1a-masters-kops-rich-dev-ca" {
name = "master-us-east-1a.masters.kops.rich-dev.ca"
launch_configuration = "${aws_launch_configuration.master-us-east-1a-masters-kops-rich-dev-ca.id}"
max_size = 1
min_size = 1
vpc_zone_identifier = ["${aws_subnet.us-east-1a-kops-rich-dev-ca.id}"]

Send to OmniFocus bookmarklet

Create a new bookmark titled something like "Send to Omnifocus" or "✅", and paste this into the Location field. (Unfortunately for this purpose, but fortunately for less benevolent purposes, GFMD doesn't support javascript: links.)

javascript:q=location.href;if(document.getSelection){d='\n\n'+document.getSelection();}else{d='';};p=document.title;location.href='omnifocus:///add?name='+encodeURIComponent(p)+'&note='+encodeURIComponent(q)+encodeURIComponent(d);

It will open the OmniFocus Quick Add dialog with the title of the link as the task name, and the URL and optionally any selected text as a Note.

Important Testing Note

@wlonkly
wlonkly / haproxy.cfg
Last active June 5, 2017 19:44
haproxy.cfg for nomad
#NOMAD_IP_rsyslogd_syslog=127.0.0.1
#NOMAD_JOB_NAME=haproxy-rsyslog
#NOMAD_ADDR_rsyslogd_syslog=127.0.0.1:56254
#NOMAD_ALLOC_NAME=haproxy-rsyslog.app[0]
#NOMAD_PORT_rsyslogd_syslog=56254
global
log ${NOMAD_ADDR_rsyslogd_syslog} local0
maxconn 4096
pidfile /var/run/haproxy.pid
@wlonkly
wlonkly / manual.tf
Created February 10, 2020 20:19
Manual vs. module-ized ACM certificates in terraform
data "aws_route53_zone" "alias_zone" {
name = "example.com"
private_zone = false
}
resource "aws_acm_certificate" "certificate" {
domain_name = "example.com"
validation_method = "DNS"
tags = { some list of tags }