Skip to content

Instantly share code, notes, and snippets.

View wr0ngway's full-sized avatar

Matt Conway wr0ngway

View GitHub Profile
@wr0ngway
wr0ngway / ses-test-send.sh
Created October 21, 2019 21:34
For testing that AWS SES is configured correctly and can send emails
#!/usr/bin/env bash
# fail fast
set -e
server=email-smtp.us-east-1.amazonaws.com:587
config_set=default
subject="Amazon SES SMTP Test"
message="This message was sent using the Amazon SES SMTP interface."
@wr0ngway
wr0ngway / otp
Created December 22, 2016 21:48
#!/bin/bash
# brew install oath-toolkit
#
# ~/.otpkeys:
# name1=secret
# name2=secret
scriptname=`basename $0`
if [ -z $1 ]
@wr0ngway
wr0ngway / -
Created December 22, 2016 21:48
#!/bin/bash
# brew install oath-toolkit
#
# ~/.otpkeys:
# name1=secret
# name2=secret
scriptname=`basename $0`
if [ -z $1 ]
2016/07/19 13:59:16 [INFO] Terraform version: 0.7.0 rc3 3f4857a07a24f3c9e2db6b4458fbf5be19a8b256
2016/07/19 13:59:16 [DEBUG] Detected home directory from env var: /Users/mconway
2016/07/19 13:59:16 [DEBUG] Detected home directory from env var: /Users/mconway
2016/07/19 13:59:16 [DEBUG] Attempting to open CLI config file: /Users/mconway/.terraformrc
2016/07/19 13:59:16 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2016/07/19 13:59:16 [DEBUG] Detected home directory from env var: /Users/mconway
2016/07/19 13:59:16 [DEBUG] DestroyEdgeInclude: Checking: data.template_file.file
2016/07/19 13:59:16 [DEBUG] DestroyEdgeInclude: Checking: data.template_cloudinit_config.config
mplate_file.file (orphan) - *terraform.graphNodeOrphanResource
provider.template - *terraform.graphNodeProvider

Keybase proof

I hereby claim:

  • I am wr0ngway on github.
  • I am wr0ngway (https://keybase.io/wr0ngway) on keybase.
  • I have a public key whose fingerprint is 4420 079C 78E2 6A72 F771 42CC 5667 E853 B560 FFC6

To claim this, I am signing this object:

@wr0ngway
wr0ngway / rubytrace
Last active March 14, 2023 11:02
Uses gdb to dump ruby backtraces for all threads, and displays them in an easily readable format
#!/bin/bash
PID=$1
RUBY_BINARY=`which ruby`
BT_FILENAME="/tmp/ruby-backtrace-$PID-$(date +%s).txt"
cmdfile=$(mktemp)
cat <<EOF > $cmdfile
set \$old_stdout = dup(1)
set \$old_stderr = dup(2)
@wr0ngway
wr0ngway / bundlelocal
Created July 11, 2014 11:03
Wrapper to bundle that lets one temporarily point to local directories for gems (works better with rubymine than bundle local)
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler'
raise "Pass in local gems like: LOCAL_GEMS=foo,bar bundle ..." unless ENV['LOCAL_GEMS']
LOCAL_GEMS = ENV['LOCAL_GEMS'].split(',')
class Bundler::Dsl
#!/usr/bin/env ruby
require 'bundler'
changelog_file = 'CHANGELOG'
entries = ""
helper = Bundler::GemHelper.new(Dir.pwd)
current_version = "v#{helper.gemspec.version}"
starting_version = nil
@wr0ngway
wr0ngway / changelog
Last active August 29, 2015 13:57
For generating changelogs for bundler rubygem projects
#!/usr/bin/env ruby
require 'bundler'
changelog_file = 'CHANGELOG'
entries = ""
helper = Bundler::GemHelper.new(Dir.pwd)
current_version = "v#{helper.gemspec.version}"
starting_version = nil
@wr0ngway
wr0ngway / gc-cow.rb
Created March 23, 2012 17:46
test to see if GC in ruby 2 is truly copy on write friendly
#!/usr/bin/env ruby
rss = '.+?Rss:\s+(\d+)'
share = '.+?Shared_Clean:\s+(\d+)'
share << '.+?Shared_Dirty:\s+(\d+)'
priv = '.+?Private_Clean:\s+(\d+)'
priv << '.+?Private_Dirty:\s+(\d+)'
MEM_REGEXP = /\[heap\]#{rss}#{share}#{priv}/m
def mem_usage_linux