Skip to content

Instantly share code, notes, and snippets.

View jschumann's full-sized avatar

James Schumann jschumann

  • 21:58 (UTC -04:00)
View GitHub Profile
@jschumann
jschumann / hubot.service
Created November 9, 2016 19:24 — forked from praseodym/hubot.service
Hubot systemd service file
[Unit]
Description=Hubot
Requires=network.target
After=network.target
[Service]
Type=simple
WorkingDirectory=/opt/hubot
User=hubot
@jschumann
jschumann / Reusable Steps
Created March 2, 2015 18:48
RSpec, Cucumber, Capybara examples
When /^I fill in "([^"]*)" with "([^"]*)"$/ do |element, text|
fill_in element, with: text
end
When /^I click "([^"]*)"$/ do |element|
click_on element
end
# This is a list of matchers that we use in our RSpec tests at Causes.
# *** CAPYBARA MATCHERS ***
#
# To check for content on a page, don't use `include`, use `have_content`:
response.body.should have_content 'A header'
# As opposed to `include`, this Capybara matcher will only look for content
# (ignoring tags and meta-info etc). And the error message is slightly easier to
#!/bin/bash
# A simple script to make live backups of an organization's GitHub repositories.
# Where to store the backup files
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"==/FULL/PATH/TO/BACKUPDIR=="}
# The GitHub organization whose repos will be backed up
GHBU_ORG=${GHBU_ORG-"==ORGANIZATION=="}
# GitHub API token.
@jschumann
jschumann / gwmm-chef
Last active December 15, 2015 02:58
IronSysAdmin: Tonight's Secret Ingredient is Chef
This talk will introduce Chef, an open source configuration, infrastructure, and deployment management tool from Opscode (http://www.opscode.com/chef/). We'll see a demo of managing a few machines with Chef, talk about the problems this solves, and discuss why you want to use the same tool Facebook uses to manage their infrastructure, even in a one person shop. You'll discover peace and tranquillity through managing configuration as code and learn more about the DevOps movement, why it's not that new to a lot of web makers, and why you should still care.
http://farm2.static.flickr.com/1114/1342330206_3708a3ece4.jpg
@jschumann
jschumann / gist:4683725
Created January 31, 2013 15:33
Server naming standard

Hostnames should be:

  • Unique
    • This is required
  • Inherently "meaningless"
    • Meaningful names are rigid and brittle; meaningless names are flexible
    • Names like mysql1 and lamp1 become inaccurate, but are not updated/changed
    • The function of a server should be able to change over time; machines can be given a wholly new name when completely repurposed without causing confusion.
    • With meaningful names, understandings of old names and new names can collide (ec-webapp2 holds the Oracle Application Server; ec-appserv1 was chosen as the name for a generic web application server)
    • There are better ways to build documentation than embedding it in hostnames
  • The information in meaningful hostnames is kept incomplete for the sake of brevity
@jschumann
jschumann / rubyMatching
Last active December 10, 2015 00:49 — forked from anonymous/rubyMatching
#Functions# {{{
def parse_team_name(line)
teamName = /[[:alpha:]]*/.match(line)
end
def parse_record(line)
record = /[[:digit:]]*-[[:digit:]]/.match(line)
end
def parse_player_name(line)