Skip to content

Instantly share code, notes, and snippets.

require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'rails', '~> 5.2.0'
gem 'sqlite3'
end
require 'active_record'
require 'minitest/autorun'
#!/usr/bin/env bash
# From https://github.com/kubernetes/AWS/issues/226#issuecomment-278879348
# and https://github.com/kubernetes/AWS/blob/master/docs/mfa.md
# set -euo pipefail
main() {
local role_arn="${AWS_MFA_ROLE_ARN:-}"
local serial_number="${AWS_MFA_ARN:-}"
@bpo
bpo / gist:d4b144c1f217c13bfef054cf47bec1cc
Created January 16, 2020 20:59
KeyDB 5.3.0 crash on replica promotion from 5.2.0
Jan 16 20:21:03 keydb-server[5309]: 5309:S 16 Jan 2020 20:21:03.370 * Before turning into a replica, using my master parameters to synthesize a cached master: I may be able to synchronize with the new master with just a partial transfer.
Jan 16 20:21:03 keydb-server[5309]: 5309:S 16 Jan 2020 20:21:03.370 * REPLICAOF XXXXXXX:YYYYYY enabled (user request from 'id=10 addr=X.X.X.X:34354 fd=96 name=redisgreen age=0 idle=0 flags=x db=0 sub=0 psub=0 multi=2 qbuf=197 qbuf-free=32571 obl=27 oll=0 omem=0 events=r cmd=exec')
Jan 16 20:21:03 keydb-server[5309]: 5309:S 16 Jan 2020 20:21:03.977 * Connecting to MASTER X.X.X.X:11042
Jan 16 20:21:03 keydb-server[5309]: 5309:S 16 Jan 2020 20:21:03.981 * MASTER <-> REPLICA sync started
Jan 16 20:21:03 keydb-server[5309]: 5309:S 16 Jan 2020 20:21:03.982 * Non blocking connect for SYNC fired the event.
Jan 16 20:21:03 keydb-server[5309]: 5309:S 16 Jan 2020 20:21:03.983 * Master replied to PING, replication can continue...
Jan 16 20:21:03 keydb-server[5309]: 5309:S 16 Jan 2020 20:
Thread 10 (Thread 0x7f9bf61fb700 (LWP 5572)):
#0 0x00000000004cac91 in fastlock_lock.LLoop ()
#1 0x0000000000007463 in ?? ()
#2 0x00000000000015c4 in ?? ()
#3 0x00000000004378ce in beforeSleepLite (eventLoop=0x7faaedc22280) at server.cpp:2164
#4 0x0000000000433c13 in aeMain (eventLoop=eventLoop@entry=0x7faaedc22280) at ae.cpp:810
#5 0x0000000000437cc4 in workerThreadMain (parg=0x5) at server.cpp:4990
#6 0x00007faaee3ce40b in start_thread () from /lib64/libpthread.so.0
#7 0x00007faaee108e7f in clone () from /lib64/libc.so.6
#!/bin/sh
echo
echo "Use netcat instead"
echo
exit 1
2018/11/16 12:35:28 [INFO] Terraform version: 0.11.10
2018/11/16 12:35:28 [INFO] Go runtime version: go1.11.2
2018/11/16 12:35:28 [INFO] CLI args: []string{"/usr/local/Cellar/terraform/0.11.10/bin/terraform", "import", "heroku_cert.ssl_certificate", "foo"}
2018/11/16 12:35:28 [DEBUG] Attempting to open CLI config file: /Users/REDACTED/.terraformrc
2018/11/16 12:35:28 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2018/11/16 12:35:28 [INFO] CLI command args: []string{"import", "heroku_cert.ssl_certificate", "foo"}
2018/11/16 12:35:28 [INFO] command: empty terraform config, returning nil
2018/11/16 12:35:28 [DEBUG] command: no data state file found for backend config
2018/11/16 12:35:28 [DEBUG] New state was assigned lineage "ae14bcd7-1de4-ca38-53eb-506acd360b4d"
2018/11/16 12:35:28 [INFO] command: backend initialized: <nil>
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQGiBEnzy8IRBACRuhmgUKgKS4qsjmIvx5eAtLvSauMHv2sr99bU/ep9jbg1jeEI
G4gtChEtrE1Uy9pB1e6cupmLT0vrn8ZM6Xo9u8ntmsLH6aHpzznCl6uKn8p4pUOa
nMYuVpetdAMScPqwKjLjc0nM/93K3d3rLWwV1Vbs48M8yySvjWPpZprrdwCgk35r
vw2+jyieO5eT71nx5zJFps8D/ifMdOpTgSRYuVSrSPpdukblJRkZpNsStCdfRoPC
jqjduUzoomq78FpHRNJIkCRcVADm0k5bVbjOTIqKR2IXbwMeVjogxRewgpsVq+Ut
BNe943fy6SR5yaFAardUaC0C1CfFqp3vHjaPIgB2zLi+OVoYhHZTvwTSIEMY/vvf
GobCBACOgpLqPq/9bzf9GRDNo4teP26h8QPlk3fnqjvU1ToXWAKLGZTqVqRwKmLy
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQENBFk3gqEBCADvjfVLvqrDXh2GxQM3d0f1qi9fxHDG7dQCSsqAhRMdKMe5W81i
H4V84LnOw0XKgVtDz2S7XnO6niYfJMSzEaMzqJclurA6leMJquXRd/7KEzYNgNtw
bK+/ojGGSBjiY+S0E73clIozRYmEQCN62r/b3/mY6HCJtXxlkuwfIz7vA0dmCNkp
81SoLMmMtmoEhg+HN2c63NS607/gHs9eqEKoqF7Dxsrh/iIA/pBgMFFfYz2jEyP3
jr6CTZ3m01ACvQ7Azi0BU8GC+cCLRLMEhYwcUwiJ8Ywj9U9POEGBLVyjQTFdUOZm
1rWYLyb37ctcrBgcjzlW7FIkCvu//9eN+Mj1ABEBAAG0JkJyaWFuIFAgTydSb3Vy
a2UgPGJvcm91cmtlQGZhc3RseS5jb20+iQE3BBMBCgAhBQJZN4KhAhsDBQsJCAcD
BRUKCQgLBRYCAwEAAh4BAheAAAoJEEYfqBzl8G4+77gH+wfdrIAk7TzApq8K8ZLP
#!/bin/bash
#
# DROPKICK.SH
#
# Detect and Disconnect the DropCam and Withings devices some people are using to
# spy on guests in their home, especially in AirBnB rentals. Based on Glasshole.sh:
#
# http://julianoliver.com/output/log_2014-05-30_20-52
#
# This script was named by Adam Harvey (http://ahprojects.com), who also
@bpo
bpo / gist:a3ed23da181d6954e429
Created October 29, 2015 23:52
strip a document of formatted address lists and names down to just the email addresses themselves
#! /usr/bin/ruby
require 'mail'
$stdin.each_line do |line|
addresses = Mail::AddressList.new(line.chomp)
addresses.addresses.each do |a|
puts a.address
end
end