Skip to content

Instantly share code, notes, and snippets.

View jonlives's full-sized avatar

Jon Cowie jonlives

View GitHub Profile
{
"ec2": {
"instance_type": "t1.micro",
}
}
loading configuration: /etc/chef/client.rb
Session type: client
Loading..resolving cookbooks for run list: <snip>
.....Synchronizing Cookbooks:
epic fail!
/opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:2789:in `stream_check': undefined method `closed?' for nil:NilClass (NoMethodError)
from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:2709:in `read_body'
from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:2736:in `body'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2/lib/chef/formatters/error_inspectors/api_error_formatting.rb:90:in `rescue in format_rest_error'
@jonlives
jonlives / gist:252975018ad596613aca
Created September 4, 2014 17:07
Skeleton repository produced by "chef generate repo"
.
├── LICENSE
├── README.md
├── chefignore
├── cookbooks
│   ├── README.md
│   ├── example
│   │   ├── attributes
│   │   │   └── default.rb
│   │   └── recipes
#
# Author:: John E. Vincent <lusis.org+github.com@gmail.com>
# Copyright:: Copyright (c) 2012, John E. Vincent
# License:: Apache License, Version 2.0
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0

Keybase proof

I hereby claim:

  • I am jonlives on github.
  • I am jonlives (https://keybase.io/jonlives) on keybase.
  • I have a public key whose fingerprint is B2DD 000D 6BE0 871E A83A AC09 26E3 4C2C 2EEC DF76

To claim this, I am signing this object:

% trafficserver> show:cache-stats
Bytes Used --- 0 GB
Cache Size --- 9 GB
--RAM Cache--
Total Bytes -- 10737418240
Bytes Used --- 0
Hits --------- 0
Misses ------- 0
--Lookups--
<args_add_block value="false">
<args_add>
<args_add>
<args_new/>
<symbol_literal>
<symbol>
<ident value="restart">
<pos line="12" column="12"/>
</ident>
</symbol>
rule "ETSY005", "Action :restart sent to a core service" do
tags %w{correctness recipe etsy}
recipe do |ast, filename|
res = ast.xpath('//command[ident/@value = "notifies"]/args_add_block[descendant::symbol/ident/@value="restart"]/descendant::method_add_arg[fcall/ident/@value="resources"]/descendant::assoc_new[symbol/ident/@value="service"]/descendant::tstring_content')
res.each do |notifies|
if notifies.attribute('value').to_s.include?('nscd')
[match(res)]
end
end
end
<opt>
<stmts_add>
<stmts_add>
<stmts_new/>
<method_add_block>
<command>
<ident value="service">
<pos line="1" column="0"/>
</ident>
<args_add_block value="false">
[7] pry(#<FoodCritic::RuleDsl>)> resource_attributes(cmd)
=> {:name=>"/etc/nscd.conf",
"backup"=>"",
"source"=>"nscd.conf",
"owner"=>"root",
"group"=>"root",
"mode"=>"",
"notifies"=>:restart}