Skip to content

Instantly share code, notes, and snippets.

View cwjohnston's full-sized avatar

Cameron Johnston cwjohnston

View GitHub Profile
def lookup_resource(type, name, run_context)
begin
run_context.resource_collection.find("#{ type }[#{ name }]")
rescue ArgumentError => e
puts "You provided invalid arugments to resource_collection.find: #{ e }"
return nil
rescue RuntimeError => e
puts "The resources you searched for were not found: #{ e }"
return nil
end
================================================================================
Error executing action `run` on resource 'redisio_install[redis-servers]'
================================================================================
ArgumentError
-------------
You must supply a name when declaring a file resource
Run options: include {:focus=>true}
All examples were filtered out; ignoring {:focus=>true}
.FFFF........................................................................................
@cwjohnston
cwjohnston / Gemfile
Last active August 29, 2015 14:08
How to Sparkle
gem 'knife-cloudformation', :git => 'https://github.com/heavywater/knife-cloudformation.git', :ref => 'feature/miasma'
gem 'miasma', :git => 'https://github.com/chrisroberts/miasma.git', :ref => 'develop'
;; 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) "#")))))
@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:

[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"}>
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'
root@ctrlportal:~# chef-client
[Thu, 15 Apr 2010 16:35:30 +0000] INFO: Starting Chef Run
[Thu, 15 Apr 2010 16:35:33 +0000] WARN: Missing gem 'mysql'
[Thu, 15 Apr 2010 16:35:35 +0000] INFO: Ran execute[apt-get update] successfully
[Thu, 15 Apr 2010 16:35:35 +0000] WARN: Could not find previously defined grants.sql resource
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- mysql (LoadError)
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /var/cache/chef/cookbooks/control_portal/recipes/default.rb:53:in `from_file'
from /usr/lib/ruby/1.8/chef/cookbook.rb:171:in `load_recipe'
from /usr/lib/ruby/1.8/chef/mixin/language_include_recipe.rb:41:in `include_recipe'
#
# Cookbook Name:: mysql
# Recipe:: client
#
# Copyright 2008-2009, Opscode, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#