Skip to content

Instantly share code, notes, and snippets.

View stevenringo's full-sized avatar

Steven Ringo stevenringo

View GitHub Profile
@stevenringo
stevenringo / reinvent-2017-youtube.md
Created December 3, 2017 23:01
Links to YouTube recordings of AWS re:Invent 2017 sessions

| Title | Description

@stevenringo
stevenringo / deploy_stack.sh
Created September 11, 2017 00:13
Create/update/delete cloudformation stacks with events tailing
set -o pipefail
_exit_error() {
message=$1
code=$2
echo "$message" >&2
exit $code
}
_exit_ok() {
@stevenringo
stevenringo / nginx.conf
Created March 1, 2016 21:10 — forked from daveslutzkin/nginx.conf
Nginx conf for solid SSL/TLS
# Thin serving Rails.
upstream app_server {
server 127.0.0.1:3050 fail_timeout=0;
}
# SSL/TLS certificates - the key should be 4096 bit generated with: 'openssl genrsa -des3 -out server.key 4096'
ssl_certificate_key /var/app/deploy/www.thisisatest.com.key;
ssl_certificate /var/app/deploy/www.thisisatest.com.chained.crt;
# Ideally we'd have only TLSv1.2, but that compromises client support significantly
@stevenringo
stevenringo / application.sass
Created June 27, 2011 03:55
All compass stylesheet framework imports
// @import compass/css3
// @import compass/layout
// @import compass/reset
// @import compass/reset-legacy
// @import compass/support
// @import compass/typography
// @import compass/utilities
//
// @import compass/css3/appearance
// @import compass/css3/background-clip
@stevenringo
stevenringo / gist:1077311
Created July 12, 2011 03:02
Has Many through factory with fabricator
class Country < ActiveRecord::Base
has_many :registrations
has_many :members
has_many :distribution_groups, :through => :members
end
class DistributionGroup < ActiveRecord::Base
has_many :members
has_many :countries, :through => :members
end
@stevenringo
stevenringo / undent.rb
Created May 18, 2017 04:53 — forked from ashrithr/undent.rb
Ruby un-indent lines of here document
class String
def undent
gsub(/^.{#{slice(/^ +/).length}}/, '')
end
end
#Usage:
test = <<-EOS.undent
testing unindent
..another line
@stevenringo
stevenringo / explainshell.url
Created September 29, 2013 21:31
Explainshell custom search for Alfred 2
alfred://customsearch/Explainshell%20%27%7Bquery%7D%27/es/utf8/plus/http://explainshell.com/explain?cmd={query}
@stevenringo
stevenringo / aws-keychain-sts.sh
Created August 24, 2016 12:38 — forked from lox/aws-keychain-sts.sh
A wrapper for @pda's aws-keychain that generates temporary credentials via STS.
#!/bin/bash
set -euo pipefail
: ${AWS_CREDENTIALS_FILE="$HOME/.aws/credentials"}
: ${STS_SESSION_DURATION=36000}
sts_keychain_get_session_token() {
echo generating temporary credentials via sts >&2
aws-keychain exec $1 \
#!/bin/bash
usage()
{
cat <<EOF
Usage: $(basename $0) [options]
This shell script is a simple wrapper around the openssl binary. It uses
s_client to get certificate information from remote hosts, or x509 for local
certificate files. It can parse out some of the openssl output or just dump all