Skip to content

Instantly share code, notes, and snippets.

View jessereynolds's full-sized avatar

Jesse Reynolds jessereynolds

  • Puppet
  • Melbourne, Victoria, Australia
View GitHub Profile
@jessereynolds
jessereynolds / Oj json dump exception enqueueing a message
Last active December 20, 2015 20:39
Issues testing the threading_restructure branch of flapjack
2013-08-09T18:24:18+09:30 [DEBUG] :: flapjack-notifier :: notification: media_to_use: {"jabber"=>"[email protected]", "pagerduty"=>"xxxxxxxx"}
2013-08-09T18:24:18+09:30 [INFO] :: flapjack-notifier :: Enqueueing email alert for foo-app-01.example.com:Foo to [email protected]
2013-08-09T18:24:18+09:30 [WARN] :: flapjack-notifier :: Failed to dump Flapjack::Data::TagSet Object to JSON in strict mode.
2013-08-09T18:24:18+09:30 [WARN] :: flapjack-notifier :: /Users/jesse/src/flpjck/flapjack-ali-graham/lib/flapjack/data/message.rb:15:in `dump'
/Users/jesse/src/flpjck/flapjack-ali-graham/lib/flapjack/data/message.rb:15:in `push'
/Users/jesse/src/flpjck/flapjack-ali-graham/lib/flapjack/notifier.rb:144:in `block in process_notification'
/Users/jesse/src/flpjck/flapjack-ali-graham/lib/flapjack/notifier.rb:101:in `each'
/Users/jesse/src/flpjck/flapjack-ali-graham/lib/flapjack/notifier.rb:101:in `process_notification'
/Users/jesse/src/flpjck/flapjack-ali-graham/lib/flapjack/notifier.rb:61:in `block (3 levels) in sta
@jessereynolds
jessereynolds / vagrant up output.txt
Created August 16, 2013 12:36
omnibus hash of cacert.pem is incorrect :-/
[fetcher:net::cacerts] fetching /var/cache/omnibus/cache/cacert.pem from http://curl.haxx.se/ca/cacert.pem
[fetcher:net::cacerts] getting from http://curl.haxx.se/ca/cacert.pem with 10 redirects left
[fetcher:net::cacerts] Invalid MD5 for cacerts
[fetcher:net::cacerts] Expected: 47961e7ef15667c93cd99be01b51f00a
[fetcher:net::cacerts] Actual: 349ba2d6964db9ca558c9e1daf38e428
Something went wrong...the Omnibus just ran off the road!
Error raised was:
Checksum of downloaded file /var/cache/omnibus/cache/cacert.pem doesn't match expected
@jessereynolds
jessereynolds / pre-commit
Created August 27, 2013 07:28
.git/hooks/pre-commit in my puppet repo
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
echo "in git pre-commit hook"
#!/usr/bin/env ruby
require 'httparty'
require 'json/pure'
class VisageClient
include HTTParty
default_timeout 10
ENDPOINTS = [ 'stats-a', 'stats-b' ]
#!/usr/bin/env ruby
require 'httparty'
require 'json/pure'
class VisageClient
include HTTParty
default_timeout 10
ENDPOINTS = [ 'stats-a', 'stats-b' ]
@jessereynolds
jessereynolds / directory_size_reduced_or_gone.sh
Last active December 23, 2015 04:19
directory size reduced or gone
#!/bin/bash
dir='/private/tmp'
if [ ! -d $dir ] ; then
echo "the directory has gone"
#echo 'body' | mailx -s "the directory has gone" [email protected]
exit 1
fi
@jessereynolds
jessereynolds / gist:6930006
Created October 11, 2013 05:31
failing rollup tests - is the gherkin expressing how we want the system to behave?
jesse@heart-of-gold flapjack $ be cucumber features/rollup.feature:121
@rollup @notification_rules @resque @processor @notifier @events
Feature: Rollup on a per contact, per media basis
Background: # features/rollup.feature:4
Given the following users exist: # features/steps/events_steps.rb:327
| id | first_name | last_name | email | sms | timezone |
| 1 | Malak | Al-Musawi | [email protected] | +61400000001 | Asia/Baghdad |
And the following entities exist: # features/steps/events_steps.rb:314
| id | name | contacts |
@jessereynolds
jessereynolds / gist:6933563
Created October 11, 2013 12:04
odd error running flapjack cucumber tests
jesse@heart-of-gold flapjack $ be rake features
/Users/jesse/.rbenv/versions/1.9.3-p448/bin/ruby -S bundle exec cucumber --format Cucumber::Formatter::Fuubar
<internal:gem_prelude>:1:in `initialize': Interrupt
from <internal:gem_prelude>:1:in `exception'
from <internal:gem_prelude>:1:in `require'
from <internal:gem_prelude>:1:in `<compiled>'
@jessereynolds
jessereynolds / gist:6987101
Created October 15, 2013 05:49
simplecov warning with cucumber and ruby 1.9
Coverage report generated for Cucumber Features, RSpec to /Users/jesse/src/flpjck/flapjack/coverage. 2754 / 3372 LOC (81.67%) covered.
/Users/jesse/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/simplecov-0.7.1/lib/simplecov/json.rb:16:in `pretty_generate': In :strict mode all Hash keys must be Strings, not Symbol. (TypeError)
from /Users/jesse/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/simplecov-0.7.1/lib/simplecov/json.rb:16:in `dump'
from /Users/jesse/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/simplecov-0.7.1/lib/simplecov/last_run.rb:15:in `block in write'
from /Users/jesse/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/simplecov-0.7.1/lib/simplecov/last_run.rb:14:in `open'
from /Users/jesse/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/simplecov-0.7.1/lib/simplecov/last_run.rb:14:in `write'
from /Users/jesse/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/simplecov-0.7.1/lib/simplecov/defaults.rb:78:in `block in <top (required)>'