Skip to content

Instantly share code, notes, and snippets.

View nathenharvey's full-sized avatar

Nathen Harvey nathenharvey

View GitHub Profile
Day Space Time Card Suit
Wednesday 1 2:20 2 Diamonds ♦
Wednesday 1 3:05 3 Diamonds ♦
Wednesday 1 4:05 4 Diamonds ♦
Wednesday 2 2:20 5 Diamonds ♦
Wednesday 2 3:05 6 Diamonds ♦
Wednesday 2 4:05 7 Diamonds ♦
Wednesday 3 2:20 8 Diamonds ♦
Wednesday 3 3:05 9 Diamonds ♦
@nathenharvey
nathenharvey / fixed_gpgcheck.rb
Created April 27, 2016 20:45
parse_config_file fails when it encounters a '['
options = {
assignment_re: /^\s*([^=]*?)\s*=\s*(.*?)\s*$/,
comment_char: '['
}
# describe parse_config_file('/etc/yum.conf') do
describe parse_config_file('yum.conf', options) do
its('gpgcheck') { should cmp 1 }
end
@nathenharvey
nathenharvey / example.rb
Created April 27, 2016 18:50
InSpec Command and stdout
# encoding: utf-8
# copyright: 2015, The Authors
# license: All rights reserved
title 'File System Configuration'
# you add controls here
control '1.2.1 Verify CentOS GPG Key is Installed' do # A unique ID for this control
impact 1.0 # The criticality, if this control fails.
title 'Verify CentOS GPG Key is Installed' # A human-readable title
2015-11-30_13:30:52.24030 [GIN] 2015/11/30 - 13:30:52 | 200 | 3.695145ms | 69.250.19.123 | GET /owners/nathenharvey/scans
2015-11-30_13:30:52.27626 [GIN] 2015/11/30 - 13:30:52 | 200 | 3.326383ms | 69.250.19.123 | GET /owners/nathenharvey/scans/6403d083-dbaa-4820-402c-adfa996e2ebc/nodes
2015-11-30_13:30:55.69568 [GIN] 2015/11/30 - 13:30:55 | 200 | 2.862087ms | 69.250.19.123 | POST /owners/nathenharvey/scans
2015-11-30_13:30:55.69582 13:30:55.695 DEB => execute job on worker 1
2015-11-30_13:30:55.69643 13:30:55.696 DEB => [nathenharvey/17dd9f92-2bc8-4fb6-7b47-35cd0c4e525e] Detect target nathenharvey/default/52.71.253.76:0
2015-11-30_13:30:55.69646 13:30:55.696 DEB => run inspec: PATH=/opt/chef-compliance/bin:/opt/chef-compliance/embedded/bin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin inspec detect --sudo --host 52.71.253.76 --user chef --key-files /var/opt/chef-compliance/core/runtime/.tmp/access_keys/17dd9f92-2bc8-4fb6-7b47-35cd0c4e525e/184db4c5-8b56-4553-577f-80601b

2015-08-13 - Supermarket and berkshelf outage - CUSTOMER

Meeting

The post mortem meeting was held at 3:30PM EDT on Friday, August 14, 2015. The meeting was be held via a Google Hangout that was live streamed to YouTube. Internally, we used #_postmortem_20150814 to discuss the post mortem.

  1. This is a blameless Post Mortem.
  2. We will not focus on the past events as they pertain to "could've", "should've", etc.
  3. All follow up action items will be assigned to a team/individual before the end of the meeting. If the item is not going to be top priority leaving the meeting, don't make it a follow up item.
---
driver:
name: ec2
aws_ssh_key_id: <%= ENV['AWS_KEYPAIR_NAME'] %>
transport.ssh_key: <%= ENV['AWS_KEY_PATH'] %>
provisioner:
name: chef_zero
platforms:
#! /bin/bash
# Required knife ec2, ec2 command line tools, and some AWS_ environment variables
# set-up some varirables
export JAVA_HOME=`/usr/libexec/java_home -v 1.7`
export NUM_INSTANCES=1
# security group
export SG=sg-29d3c14c
@nathenharvey
nathenharvey / metadata.rb
Created November 4, 2014 09:44
Metadata for chef-sugar cookbook
name "chef-sugar"
version "2.4.1"
description "Installs chef-sugar. Please see the chef-sugar Ruby gem for more information."
long_description "Chef Sugar is a Gem & Chef Recipe that includes series of helpful syntactic\
sugars on top of the Chef core and other resources to make a cleaner, more lean\
recipe DSL, enforce DRY principles, and make writing Chef recipes an awesome and\
fun experience!\
\
For the most up-to-date information and documentation, please visit the [Chef\
Sugar project page on GitHub](https://github.com/sethvargo/chef-sugar)."
@nathenharvey
nathenharvey / gist:8d2919cc8e375d8ed486
Created August 19, 2014 19:29
testing output for apache cookbook
➜ apache git:(master) rubocop .
Inspecting 5 files
.....
5 files inspected, no offenses detected
➜ apache git:(master) foodcritic .
➜ apache git:(master) rspec spec/unit/default.rb .............
Finished in 0.22822 seconds (files took 2.39 seconds to load)
@nathenharvey
nathenharvey / vhosts.rb
Last active May 31, 2016 16:41
vhosts recipe for one-day Introduction to Chef workshop
data_bag("vhosts").each do |site|
site_data = data_bag_item("vhosts", site)
site_name = site_data["id"]
document_root = "/srv/apache/#{site_name}"
template "/etc/httpd/conf.d/#{site_name}.conf" do
source "custom-vhosts.erb"
mode "0644"
variables(
:document_root => document_root,