Skip to content

Instantly share code, notes, and snippets.

View wlonkly's full-sized avatar

Rich Lafferty wlonkly

View GitHub Profile
@wlonkly
wlonkly / excuses.txt
Created April 27, 2021 22:48
BOFH excuse file++
# Includes the BOFH excuse file grabbed from:
# http://www.cs.wisc.edu/~ballard/bofh/excuses
clock speed
solar flares
electromagnetic radiation from satellite debris
static from nylon underwear
static from plastic slide rules
global warming
poor power conditioning
static buildup
@wlonkly
wlonkly / cloudwatch-to-sumo.js
Created August 7, 2020 22:34
SumoLogic cloudwatch-to-sumo lambda function
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CloudWatch Logs to SumoLogic //
// https://github.com/SumoLogic/sumologic-aws-lambda/tree/master/cloudwatchlogs //
// //
// YOU MUST CREATE A SUMO LOGIC ENDPOINT CALLED SUMO_ENDPOINT AND PASTE IN ENVIRONMENTAL VARIABLES BELOW //
// https://help.sumologic.com/Send_Data/Sources/02Sources_for_Hosted_Collectors/HTTP_Source //
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Include logStream and logGroup as json fields within the message. Required for SumoLogic AWS Lambda App
@wlonkly
wlonkly / foo.md
Created June 24, 2020 21:25
Markdown line wrapping annoyance

This is a paragraph composed of separate lines with hard line endings. "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt

zentab.js:15 993 Zentab: ERROR: TypeError: Cannot read property 'condition' of undefined
widgets.js:129 Uncaught TypeError: Cannot read property 'condition' of undefined
at Widget.weather.buildForecast (widgets.js:129)
at Widget.weather.refresh (widgets.js:165)
at Widget.weather.start (widgets.js:183)
at zentab.js:620
at Array.forEach (<anonymous>)
at zentab.js:618
at Object.$.zentab.getLocal (zentab.js:79)
at Object.$.zentab.loadWidgets (zentab.js:612)
@wlonkly
wlonkly / tls.md
Created April 14, 2020 01:36
Fun with TLS

IO::Socket::SSL defaults:

    SSL_cipher_list => join(" ",
        qw(
            ECDHE-ECDSA-AES128-GCM-SHA256
            ECDHE-ECDSA-AES128-SHA256
            ECDHE-ECDSA-AES256-GCM-SHA384
            ECDHE-ECDSA-AES256-SHA384
            ECDHE-ECDSA-AES128-SHA
@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 }
@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

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 / 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}"]
@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: