Skip to content

Instantly share code, notes, and snippets.

Avatar

Julian C. Dunn juliandunn

View GitHub Profile
@BorisKourt
BorisKourt / README.md
Last active Aug 29, 2015
Introduction to Clojure for Artists
View README.md
@fnichol
fnichol / README.md
Last active Nov 19, 2019
Auto-enable Local HTTP Caching in Test Kitchen
View README.md

Auto-enable Local HTTP Caching in Test Kitchen

Note: total experiment and hack, looks nasty, could be awesome:

Setup

  • Drop the kitchen.local.yml into $HOME/.kitchen/config.yml
  • Install polipo (with Mac: brew install polipo, with Ubuntu: apt-get install polipo)
  • Drop polipo-start and polipo-console somewhere useful (perhaps $HOME/bin?)
@micgo
micgo / ec_node_fixer.rb
Created Oct 30, 2013
This should fix missing permissions on Enterprise Chef 11 after download/upload operations
View ec_node_fixer.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'chef/knife'
Chef::Config.from_file(File.join(Chef::Knife.chef_config_dir, 'knife.rb'))
rest = Chef::REST.new(Chef::Config[:chef_server_url])
Chef::Node.list.each do |node|
%w{read update delete grant}.each do |perm|
@mostlygeek
mostlygeek / demo.rb
Created Jan 24, 2012
Chef ruby_block and dynamic resource creation
View demo.rb
ruby_block "sync_build_from_s3" do
action :nothing
block do
# latest_file contains path to the latest.txt, which lists files to sync
file = File.new(latest_file, "r");
run_context = Chef::RunContext.new(node, {})
#
# Create the directory to hold the new build files
#
View noit.rb
ruby_block "configure #{p} module" do
block do
require 'chef/util/file_edit'
nc = Chef::Util::FileEdit.new("/etc/reconnoiter/noit.conf")
nc.insert_line_after_match(/lua.*noit.module.smtp/, "<module loader=\"lua\" name=\"#{p}\" object=\"noit.module.#{p}\"/>")
nc.write_file
Chef::Log.info "Inserted module config for #{p}"
end