Skip to content

Instantly share code, notes, and snippets.

@shedd
shedd / ideal ops.md
Created May 27, 2012 12:33 — forked from bhenerey/ideal ops.md
ideal ops checklist

In a perfect world, where things are done well, not just quickly, I would expect to find the following when joining the company:

Documentation

  • Accurate / up-to-date systems architecture diagram

  • Accurate / up-to-date network diagram

  • Out-of-hours support plan

  • Incident management plan

@shedd
shedd / README.md
Created April 21, 2012 00:13
Import Pivotal Tracker into Kanbanery - CSV export/import translation

Pivotal Tracker CSV export to Kanbanery CSV import translator

This script is designed to take a CSV input file, generated by Pivotal Tracker's CSV export process, and translate it into the CSV import format used by Kanbanery.

The fields used by the tools don't map exactly, but this tool tries to adapt them as best as possible. For instance, Pivotal makes use of labels. Kanbanery doesn't have tags or labels. Instead, this tool takes the labels and inserts them into the story title so that they can still be used for searching in Kanbanery.

Additionally, the Kanbanery import format doesn't take tasks or comments as explicit data elements. Thus, the script merges these into the Kanbanery description field separated by ASCII horizontal rules.

Hopefully, this is useful to you!

Configuration

@shedd
shedd / img_convert.rb
Created April 14, 2012 17:03 — forked from arirusso/img_convert.rb
convert html img tags to rails image_tag calls
#!/usr/bin/env ruby -Ku
require "nokogiri"
require "iconv"
# opens every file in the given dir tree and converts any html img tags to rails image_tag calls
#
# example usage:
# ruby convert.rb ~/my_rails_app/app/views
#
# ***be careful and backup before using this***
@shedd
shedd / gist:1301135
Created October 20, 2011 13:24
Rakefile snippet
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require 'rake'
# Log any errors to Hoptoad as needed
# ** define this before the lib/tasks are included
def task_with_airbrake_notification(options)
task(options) do
begin
@shedd
shedd / gist:1299851
Created October 19, 2011 22:16
Airbrake SSL certificate issues
Configuration:
notifier_name: "Airbrake Notifier"
http_open_timeout: 2
proxy_host: nil
api_key: "<REMOVED>"
notifier_url: "http://airbrakeapp.com"
http_read_timeout: 5
user_information: "Airbrake Error {{error_id}}"
proxy_user: nil
notifier_version: "3.0.4"
@shedd
shedd / gist:1255865
Created October 1, 2011 10:44
Fun with Probability
# to run this file:
# gem install rspec
# rspec prob_spec.rb
class Integer
def factorial
self.downto(1).inject(:*)
end
end
@shedd
shedd / gist:1200269
Created September 7, 2011 10:50
terminitor config for BetDash
# BETDASH DEVELOPMENT ENVIRONMENT
# tab 1: terminal in betdash project
# tab 2: Rails console
# tab 3: tail -f on development log
# tab 4: dev script
before { run 'fgb' }
tab "BetDash", :selected => true do
run "clear"
@shedd
shedd / gist:1162432
Created August 22, 2011 13:56
Wrap New Relic Instrumentation around Hoptoad Rake wrapper
# Add New Relic instrumentation
# ** define this before the lib/tasks are included
def task_with_new_relic_and_hoptoad(options)
caller_method = options.keys.first
task(options) do
require 'newrelic_rpm'
include NewRelic::Agent::Instrumentation::ControllerInstrumentation
NewRelic::Agent.manual_start
@shedd
shedd / gist:1162412
Created August 22, 2011 13:51
Wrap Rake Tasks in Hoptoad Notifier
# Log any errors to Hoptoad as needed
# ** define this before the lib/tasks are included
def task_with_hoptoad_notification(options)
task(options) do
begin
yield
rescue Exception => msg
HoptoadNotifier.notify(msg)
end
end
@shedd
shedd / pause_pingdom.rb
Created June 24, 2011 21:57
Script to use the Pingdom API to pause and unpause check
require 'net/http'
require 'net/https'
require 'uri'
PINGDOM_API_HOSTNAME = "api.pingdom.com"
PINGDOM_API_KEY = "your_api_key_here"
PINGDOM_API_VERSION = "2.0"
PINGDOM_CHECK_ID = "######"
PINGDOM_USERNAME = "user@domain.com"
PINGDOM_PASSWORD = "password"