Skip to content

Instantly share code, notes, and snippets.

View danielsdeleo's full-sized avatar

Dan DeLeo danielsdeleo

View GitHub Profile
@danielsdeleo
danielsdeleo / cookbook_data.json
Created October 28, 2016 23:10
knife raw cookbooks/apache2/1.2.0
{
"recipes": [
{
"name": "default.rb",
"path": "recipes/default.rb",
"checksum": "7662da1adad28445e4bc3a3e466ed979",
"specificity": "default",
"url": "https://s3-external-1.amazonaws.com:443/opscode-platform-production-data/organization-0a6b5a0357ea4ff4816a6e3ffb0cb561/checksum-7662da1adad28445e4bc3a3e466ed979?AWSAccessKeyId=AKIAIQKPG2CTSTRVDO4Q&Expires=1477725013&Signature=CQXv9znJQPrC1fV0F0R3NUsMW3c%3D"
},
{
@danielsdeleo
danielsdeleo / attributes-dsls.md
Last active August 29, 2015 14:18
Attributes Styles in Policyfiles

It just occurred to me that it's weird that roles have a totally different DSL for attributes than cookbooks, and we should take a moment to think about how attributes should work in policyfiles. In this gist are two examples, one "role style" and one "cookbook style". Let me know what you like best (but remember there's no notifications for gist comments so you have to use some other medium to make sure I see your comments).

@danielsdeleo
danielsdeleo / README.md
Last active August 29, 2015 14:16
Chef 2919 Certificate Data

Chef 2919 Cert Data

See other attached file

@danielsdeleo
danielsdeleo / rfc-policyfile-api.md
Last active August 29, 2015 14:14
DRAFT Chef RFC for Policyfile Storage API
RFC Author Status Type
unassigned
Daniel DeLeo <dan@chef.io>
Draft
Standards Track

Policyfile HTTP Resource API

Policyfiles are a new feature of Chef that allow the user to specify a

@danielsdeleo
danielsdeleo / apps.md
Created July 31, 2014 19:37
How to Run Custom Apps in ChefDK

Firstly, the primary apps in ChefDK use executables generated by appbundler:

  • chef (chef-client/knife/etc.)
  • berks
  • chef-dk (the chef tool)
  • TK

The appbundler code is here: https://github.com/opscode/appbundler/ and the README explains what it does and why. You can see the executables that appbundler generates in /opt/chefdk/bin (there are other executables in there, but the executables for the primary apps are the appbundler ones).

The primary apps in ChefDK all live in the "apps" directory, in /opt/chefdk/embedded/apps.

#!/usr/bin/env ruby
#
def clean_fds
# Don't clean $stdin, $stdout, $stderr, process_status_pipe.
3.upto(256) do |n|
begin
fd = File.for_fd(n)
fd.close if fd
rescue
end
@danielsdeleo
danielsdeleo / bad-berksfile.rb
Created April 1, 2014 17:20
Running gecode/dep-selector based solver on a Berksfile from https://github.com/berkshelf/berkshelf/issues/959
source "https://api.berkshelf.com"
cookbook 'annoyances',
:github => 'mattray/annoyances-cookbook'
cookbook 'apt',
:github => 'opscode-cookbooks/apt'
cookbook 'ark',
:github => 'opscode-cookbooks/ark'
cookbook 'avahi-daemon',
:github => 'jackl0phty/opschef-cookbook-avahi-daemon'
@danielsdeleo
danielsdeleo / shadow-check.rb
Created March 26, 2014 22:12
Show all the places where you have multiple cookbooks that shadow each other.
# Show all the places where you have multiple cookbooks that shadow each other.
#
# Run this as:
#
# knife exec shadow-check.rb
config = Chef::Config
cookbook_loader = begin
Chef::Cookbook::FileVendor.on_create { |manifest| Chef::Cookbook::FileSystemFileVendor.new(manifest, config[:cookbook_path]) }
@danielsdeleo
danielsdeleo / gemfile-to-activate.rb
Last active August 29, 2015 13:56
Another crack at loading ruby apps faster
require 'bundler'
parser = Bundler::LockfileParser.new(IO.read("Gemfile.lock"))
gem_activates = parser.specs.map {|s| %Q|gem "#{s.name}", "= #{s.version}"|}
preamble = "#TODO setup gem paths\n"
File.open("activate.rb", "w+") do |f|
f << preamble
f << gem_activates.join("\n")
@danielsdeleo
danielsdeleo / chef-11.6.rc-update.md
Last active December 19, 2015 15:29
Updated Chef 11.6 Release Candidate Available

Hi Chefs,

Since we announced the 11.6 Release Candidate, we've been busy running test scenarios to verify new features and bug fixes. This round of testing is complete, and we've released a new RC with a handful of fixes. Unless any new issues are found, this RC will become the 11.6.0 release. If you've been wondering how you can contribute to Chef, testing this release in your environment is a great way to help out.

For the full list of changes in this release, please see the draft