Skip to content

Instantly share code, notes, and snippets.

View cwjohnston's full-sized avatar

Cameron Johnston cwjohnston

  • Salt Lake City, UT
View GitHub Profile
{
"filters": {
"filter_repeated": {
"attributes": {
"action": "eval: [:create, :resolve].include?(value)",
"occurrences": "eval: value == :::check.occurrences|1::: || (value - :::check.occurrences|1:::) % :::check.refresh|1800:::.fdiv(:::check.interval|30:::).to_i == 0"
}
}
}
}
@cwjohnston
cwjohnston / chefspec_coverage_berkshelf.txt
Last active May 17, 2016 20:45
chefspec coverage report discrepancies, running runit cookbook specs w/ berkshelf vs librarian
Finished in 2 minutes 57.6 seconds (files took 3.14 seconds to load)
187 examples, 0 failures
ChefSpec Coverage report generated...
Total Resources: 454
Touched Resources: 146
Touch Coverage: 32.16%
From 82f55f44fbff29004a350b4471b10d2d968b1a77 Mon Sep 17 00:00:00 2001
From: Cameron Johnston <cameron@rootdown.net>
Date: Wed, 11 May 2016 13:03:17 -0600
Subject: [PATCH] update custom supervisor integration tests to use default
logger for simplicity
---
test/cookbooks/runit_test/recipes/service.rb | 3 +++
.../runit_test/templates/default/sv-supervisor_group-log-run.erb | 2 --
.../runit_test/templates/default/sv-supervisor_owner-log-run.erb | 2 --
@cwjohnston
cwjohnston / instructions.md
Last active March 25, 2016 18:56
Installing sensu-client as a service on Mac OS X

Download package from sensuapp.com

$ curl -LO https://core.sensuapp.com/osx-unstable/sensu-0.22.0-1.pkg

You can find a link to the latest package here: https://sensuapp.org/download

$ shasum -a 1 sensu-0.22.0-1.pkg  | grep 3af3e6a3ad1596371786e3015706d8d1c68cfbad
DEVOPS WEEKLY
ISSUE #246 - 20th September 2015
I mentioned last week it was conference season. This week’s issue features lots of content from event last week, in particular the excellent looking Automacon. Next week I’m hoping WinOps and Operability both in London have similar high quality content.
[...]
News
====
Batali.define do
source 'https://supermarket.chef.io'
cookbook 'sudo'
end
resources(:my_eni) do
type 'AWS::EC2::NetworkInterface'
properties do
subnet_id ref!(:my_subnet_id)
group_set [ref!(:my_security_group)]
end
end
resources(:my_eip) do
type 'AWS::EC2::EIP'
[1] pry(main)> e.response
=> #<HTTP::Response/1.1 400 Bad Request {"Transfer-Encoding"=>"chunked", "Date"=>"Fri, 15 May 2015 22:17:08 GMT", "Connection"=>"close", "Server"=>"AmazonEC2"}>
@cwjohnston
cwjohnston / keybase.md
Created March 24, 2015 23:28
keybase.md

Keybase proof

I hereby claim:

  • I am cwjohnston on github.
  • I am cwjohnston (https://keybase.io/cwjohnston) on keybase.
  • I have a public key whose fingerprint is 6EB6 1883 2535 2BEC A1FF F658 09A1 12AB C0BE 88CE

To claim this, I am signing this object:

;; Put autosave files (ie #foo#) in one place, *not* scattered all over the
;; file system! (The make-autosave-file-name function is invoked to determine
;; the filename of an autosave file.)
(defvar autosave-dir "~/.emacs-dir/autosaves/")
(make-directory autosave-dir t)
(defun auto-save-file-name-p (filename) (string-match "^#.*#$" (file-name-nondirectory filename)))
(defun make-auto-save-file-name () (concat autosave-dir (if buffer-file-name (concat "#" (file-name-nondirectory buffer-file-name) "#") (expand-file-name (concat "#%" (buffer-name) "#")))))