Skip to content

Instantly share code, notes, and snippets.

View woods's full-sized avatar

Scott Woods woods

View GitHub Profile
<!DOCTYPE html>
<HTML>
<head>
<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="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
@woods
woods / check_vault_seal_status.sh
Last active June 7, 2024 05:22
Nagios plugin to make sure Hashicorp Vault is unsealed
#!/bin/bash
# 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.
hostname=$1
@woods
woods / geoip.sh
Last active February 10, 2025 12:58
iptables geoip xtables firewall by country
# This is an example of how to use xtables / xt_geoip to block requests
# based on their source/destination country.
#
# It can be computationally expensive to have tons of iptables rules.
# According to the bottom of the following page, this xt_geoip is probably
# about as efficient as can be for doing this kind of thing:
# http://xtables-addons.sourceforge.net/geoip.php
# Install packages
apt-get install xtables-addons-common libtext-csv-xs-perl unzip
@woods
woods / incrementer.rb
Created October 7, 2015 21:13
We don't need no stinkin' databases!
#!/usr/bin/env ruby
require 'yaml'
puts "How many sections?"
number_of_sections = Integer(gets)
data = YAML.load(DATA)
data['start'] = data['end'] + 1
data['end'] += number_of_sections
@woods
woods / lightning.html
Last active September 22, 2015 15:24
wufoo embed code for hacky hour lightning talk form
<div id="wufoo-p1nx3plw0skd0cb">
Fill out my <a href="https://westarete.wufoo.com/forms/p1nx3plw0skd0cb">online form</a>.
</div>
<script type="text/javascript">var p1nx3plw0skd0cb;(function(d, t) {
var s = d.createElement(t), options = {
'userName':'westarete',
'formHash':'p1nx3plw0skd0cb',
'autoResize':true,
'height':'620',
'async':true,
$ echo 'puts "hi"' > hello.rb
$ irb
irb(main):001:0> require 'hello'
LoadError: cannot load such file -- hello
from /Users/woods/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/woods/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from (irb):1
from /Users/woods/.rbenv/versions/2.2.2/bin/irb:11:in `<main>'
@woods
woods / console.txt
Created August 14, 2015 02:28
load vs require
~/westarete/src/flip-learning | 30248d7 | master
[532] $ echo 'puts "hi"' > hello.rb
~/westarete/src/flip-learning | 30248d7 | master*
[533] $ irb
irb(main):001:0> require 'hello'
LoadError: cannot load such file -- hello
from /Users/woods/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/woods/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from (irb):1
class User
has_many :things
has_many :sub_things, through: :things
has_many :sub_sub_things, through: :sub_things
end
@woods
woods / current_partner.rb
Created May 13, 2015 20:19
How we might spec out the global current_partner method
# This lives in config/initializers/current_partner.rb
# A global method to return the current partner
def current_partner
Partner.current
end
irb(main):006:0* class Dog
irb(main):007:1> def bark
irb(main):008:2> puts "Ruff!!"
irb(main):009:2> end
irb(main):010:1> def age
irb(main):011:2> 12
irb(main):012:2> end
irb(main):013:1> end
=> :age
irb(main):014:0>