Skip to content

Instantly share code, notes, and snippets.

View charlesjohnson's full-sized avatar

Charles Johnson charlesjohnson

View GitHub Profile
@charlesjohnson
charlesjohnson / Switch.md
Created December 16, 2014 20:52
Talk about insight

The leaders at IDEO, the world’s preeminent product design firm, have designed products and experiences ranging from the first Apple mouse to a new Red Cross blood donation procedure. They understand the need to prepare their employees — and, more important, their clients — for failure.

Tim Brown, the CEO of IDEO, says that every design process goes through “foggy periods.” One of IDEO’s designers even sketched out a “project mood chart” that predicts how people will feel at different phases of a project. It’s a U-shaped curve with a peak of positive emotion, labeled “hope,” at the beginning, and a second peak of positive emotion, labeled “confidence,” at the end. In between the two peaks is a negative emotional valley labeled “insight.” Brown says that design is “rarely a graceful leap from height to height.” When a team embarks on a new project, team members are filled with hope and optimism. As they start to collect data and observe real people struggling with existing products, they find that new ideas s

@charlesjohnson
charlesjohnson / default_spec.rb
Last active August 29, 2015 14:11
Example Chefspec
#
# Cookbook Name:: Cookbook
# Spec:: default
#
require 'spec_helper'
describe 'cookbook::default' do
shared_examples_for :the_default_behavior do
ruby_block "Copy Chef config file if running in a Vagrant guest" do
block do
::FileUtils.cp "/tmp/vagrant-chef-1/client.rb", "#{node['chef-client']['conf_dir']}/client.rb"
end
if ::File.exist?("#{node['chef-client']['conf_dir']}/client.rb")
not_if { ::FileUtils.compare_file("/tmp/vagrant-chef-1/client.rb", "#{node['chef-client']['conf_dir']}/client.rb") }
end
only_if ::File.exist?("/tmp/vagrant-chef-1/client.rb")
end
@charlesjohnson
charlesjohnson / .kitchen.yml
Created December 2, 2014 19:24
.kitchen.yml
---
driver_plugin: vagrant
driver_config:
require_chef_omnibus: true
provisioner:
name: chef_zero
platforms:
- name: centos-6.5
@charlesjohnson
charlesjohnson / machine.rb
Last active August 29, 2015 14:10
Chef Provisioning snippet
# vagrant_driver.rb
require 'chef/provisioning/vagrant_driver'
vagrant_box 'chef/ubuntu-12.04'
with_machine_options :vagrant_options => {
'vm.box' => 'chef/ubuntu-12.04'
}
# Number of webservers we want
_________
< hi bakh >
---------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
@charlesjohnson
charlesjohnson / Sadface
Last active August 29, 2015 14:09
Chef Provisioning Code
[2014-11-16T22:21:56-08:00] INFO: Forking chef instance to converge...
Starting Chef Client, version 11.16.4
[2014-11-16T22:21:57-08:00] INFO: *** Chef 11.16.4 ***
[2014-11-16T22:21:57-08:00] INFO: Chef-client pid: 39031
[2014-11-16T22:21:59-08:00] INFO: HTTP Request Returned 404 Not Found : Object not found: http://localhost:8889/nodes/opscode
[2014-11-16T22:21:59-08:00] INFO: Run List is []
[2014-11-16T22:21:59-08:00] INFO: Run List expands to []
[2014-11-16T22:21:59-08:00] INFO: Starting Chef Run for opscode
[2014-11-16T22:21:59-08:00] INFO: Running start handlers
[2014-11-16T22:21:59-08:00] INFO: Start handlers complete.
@charlesjohnson
charlesjohnson / container.rb
Created November 14, 2014 02:02
Chef Provisioning
with_driver 'docker'
machine 'web' do
from_image 'mygroup/apache_php'
end
machine 'db' do
from_image 'mygroup/mysql'
end
@charlesjohnson
charlesjohnson / Kitchen.yml driver stanza.yml
Created October 23, 2014 19:28
Use something other than omnibus to install Chef Client
---
driver:
name: vagrant
provision_command: rpm -ihv uri://to.chef.rpm
require_chef_omnibus: false