Skip to content

Instantly share code, notes, and snippets.


Scott Woods woods

View GitHub Profile
# Allow access to the vault service from the public and private subnets
# Note that this doesn't allow access from the internet; it just allows
# traffic over the private network from hosts that reside in either of our
# two subnets.
resource "aws_security_group_rule" "vault" {
security_group_id = "${}"
type = "ingress"
from_port = 8200
to_port = 8200
protocol = "tcp"
woods /
Last active May 31, 2019
Purge unused kernel packages on Ubuntu 14.04
# Get all patch versions of all kernels on the system
all_kernel_patch_versions=$( dpkg -l | egrep 'linux-headers-3.13.0-[0-9]+-generic' | awk -F '-' '{print $4}' | sort -n )
# Exclude any kernels that are in use (hard coded; you must CUSTOMIZE THIS PER MACHINE)
unused_kernel_patch_versions=$( echo "$all_kernel_patch_versions" | egrep -v '1[67]' )
for n in $unused_kernel_patch_versions ; do
echo "========== $n ========="
woods / order.html
Created Oct 25, 2018
Code snippet for purple lizard order checkout page (just the total amount)
View order.html
<td colspan="4" class="align_right"><strong>{{ '' | t }}</strong></td>
<td class="text-right"><strong>{{ order.total_price | money }} {{ order.currency }}</strong></td>
woods / command.bash
Created Oct 6, 2018
Selectively remove old kernels and source
View command.bash
for n in 57 61 68 77 79 83 85 86 87 88 91 92 93 95 96 98 100 101 103 105 106 107 108 109 110 111 112 113 115 116
apt-get purge -y \
linux-headers-3.13.0-$n \
linux-headers-3.13.0-${n}-generic \
linux-image-3.13.0-${n}-generic \
woods /
Last active Nov 7, 2017
West Arete's spec layout

Over time, West Arete has developed a convention for how we organize our spec directories. This arrangement has been very successful for us over many years and many projects. We'd love to extract it into some kind of framework/gem, but have never managed/invested to do so. So at the very least we can share this writeup of what we've found to be useful, in the hope that it's useful to others.

The top level of our spec directory looks like this:

woods / command.bash
Created Jun 12, 2017
Get IP ranges of AWS Route53 health checkers
View command.bash
curl -s \
| jq '.prefixes | map(select(.service=="ROUTE53_HEALTHCHECKS")) | map(.ip_prefix)'
View gist:9cc23c5dc97fda1671525d841e1e359f
### Keybase proof
I hereby claim:
* I am woods on github.
* I am woods ( on keybase.
* I have a public key ASBRwmuep3o_XIJa0bbb-0xxkdgyxWqCt-SEvK1MHlkjoQo
To claim this, I am signing this object:
woods / friendly_urls.markdown
Last active Aug 17, 2016 — forked from cdmwebs/friendly_urls.markdown
Friendly URLs in Rails
View friendly_urls.markdown

Friendly URLs

By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:


But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.

View map.html
<!DOCTYPE html>
<title id="PageTitle">Allegheny County Assessment</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR" />
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE" />
<meta content="JavaScript" name="vs_defaultClientScript" />
<meta content="" name="vs_targetSchema" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
woods /
Last active May 19, 2017
Nagios plugin to make sure Hashicorp Vault is unsealed
# Assumes the following:
# - The `curl` package is installed
# - Vault is listening on the standard port 8200
# - Vault is using https with a valid certificate
# The hostname of the vault server that we're supposed to check.
You can’t perform that action at this time.