Skip to content

Instantly share code, notes, and snippets.

View bknowles's full-sized avatar

Brad Knowles bknowles

View GitHub Profile
@bknowles
bknowles / README.md
Created October 25, 2011 23:09 — forked from atomic-penguin/README.md
multi-knife-howto

Overview

Here is an example shared configuration for knife. You can drop this off in your chef-repo/.chef/ directory, and multiple developers can use the same knife configuration to interact with more than one Chef server, or the Opscode platform.

By using Bash functions and environment variables we can change the chef server, which knife is configured to use, on the fly.

NOTE: knife will probably ignore your ~/.chef/knife.rb once you begin using a shared knife.rb in your chef-repo directory.

Preparation

## Knife plugin to set node environment
# See http://wiki.opscode.com/display/chef/Environments
#
## Install
# Place in .chef/plugins/knife/set_environment.rb
#
## Usage
# Nick-Stielaus-MacBook-Pro:chef-repo nstielau$ knife node set_environment mynode.net my_env
# Looking for mynode.net
# Setting environment to my_env
@bknowles
bknowles / xkcd_passphrase.rb
Last active August 29, 2015 13:58 — forked from ThaiWood/xkcd_passphrase.rb
Here's my first pass at getting the code to pass all rubocop citations.
#!/usr/bin/ruby
require 'net/http'
require 'nokogiri'
require 'rss'
require 'open-uri'
google_news_query = 'http://news.google.com/news/feeds?q=apologize&output=rss'
google_news_result_url = ''
wordlist = []