This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'chef/role' | |
# The gist files name role-* should be moved into a directory named 'roles'. | |
role_path = Chef::Config[:role_path] = "./roles" | |
Dir.glob(File.join(role_path, '*.{rb,json}')) do |role_file| | |
rolefilename = File.basename(role_file, File.extname(role_file)) | |
role = Chef::Role.from_disk(rolefilename) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[vagrant@vcent62 ~]$ /opt/chef/embedded/bin/irb | |
irb(main):001:0> load 'chef-handler-datadog' | |
LoadError: no such file to load -- chef-handler-datadog | |
from (irb):1:in `load' | |
from (irb):1 | |
from /opt/chef/embedded/bin/irb:12:in `<main>' | |
irb(main):002:0> load 'chef-handler-datadog.rb' | |
LoadError: no such file to load -- chef-handler-datadog.rb | |
from (irb):2:in `load' | |
from (irb):2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem "octokit", "~> 1.24.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fabric.api import task, run, hosts, sudo, cd, execute | |
from dogapi.fab import setup | |
from dogapi.fab import notify | |
setup(api_key = '<redacted>') | |
servers = ['[email protected]', '[email protected]', '[email protected]'] | |
@notify | |
@task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## mysql::master | |
ruby_block "store_mysql_master_status" do | |
block do | |
node.set[:mysql][:master] = true | |
m = Mysql.new("localhost", "root", node[:mysql][:server_root_password]) | |
m.query("show master status") do |row| | |
row.each_hash do |h| | |
node.set[:mysql][:master_file] = h['File'] | |
node.set[:mysql][:master_position] = h['Position'] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[2012-12-07T17:48:39+00:00] INFO: *** Chef 10.12.0 *** | |
[2012-12-07T17:48:39+00:00] INFO: Setting the run_list to ["recipe[test]"] from JSON | |
[2012-12-07T17:48:39+00:00] INFO: Run List is [recipe[test]] | |
[2012-12-07T17:48:39+00:00] INFO: Run List expands to [test] | |
[2012-12-07T17:48:39+00:00] INFO: Starting Chef Run for localhost | |
[2012-12-07T17:48:39+00:00] INFO: Running start handlers | |
[2012-12-07T17:48:39+00:00] INFO: Start handlers complete. | |
[2012-12-07T17:48:40+00:00] INFO: Processing service[truthiness] action start (test::default line 10) | |
[2012-12-07T17:48:40+00:00] INFO: Chef Run complete in 1.209708 seconds | |
[2012-12-07T17:48:40+00:00] INFO: Running report handlers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'csv' | |
require 'mechanize' | |
# Tested with Ruby 1.9.3, mechanize 2.5.1 against Mailman version 2.1.14-1 | |
# NOTE: Many lists have a long memebrship list, and this is not currently | |
# written to accomodate that use case. | |
# A Mailman setting, `admin_member_chunksize` should allow you to set a longer | |
# list to be displayed - set it to a value higher to the total list members. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Users/michael/.rvm/gems/ruby-1.9.3-p385@gemset/bundler/gems/foodcritic-fc5cdf7095e3/lib/foodcritic/chef.rb:58:in `read': No such file or directory - /Users/michael/.rvm/gems/ruby-1.9.3-p385@gemset/bundler/gems/foodcritic-fc5cdf7095e3/lib/foodcritic/../../chef_dsl_metadata.json (Errno::ENOENT) | |
from /Users/michael/.rvm/gems/ruby-1.9.3-p385@gemset/bundler/gems/foodcritic-fc5cdf7095e3/lib/foodcritic/chef.rb:58:in `load_metadata' | |
from /Users/michael/.rvm/gems/ruby-1.9.3-p385@gemset/bundler/gems/foodcritic-fc5cdf7095e3/lib/foodcritic/chef.rb:7:in `chef_dsl_methods' | |
from /Users/michael/.rvm/gems/ruby-1.9.3-p385@gemset/bundler/gems/foodcritic-fc5cdf7095e3/lib/foodcritic/api.rb:399:in `node_method?' | |
from /Users/michael/.rvm/gems/ruby-1.9.3-p385@gemset/bundler/gems/foodcritic-fc5cdf7095e3/lib/foodcritic/api.rb:480:in `block in vivified_attribute_access' | |
from /Users/michael/.rvm/gems/ruby-1.9.3-p385@gemset/gems/nokogiri-1.5.6/lib/nokogiri/xml/node_set.rb:239:in `block in each' | |
from /Users/michael/.rvm/gems/ruby- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'date' | |
require 'jiralicious' | |
require 'json' | |
require 'net/https' | |
require 'uri' | |
# couldn't quite figure out anonymous API search, so use some method to pass these in here. | |
username = "myusername" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# seconds of penalty assignment | |
# you may pass these in on the commandline so: | |
# => ./jammers.rb 120 60 | |
jammerA = ARGV[0] ? ARGV[0].to_i : 60 | |
jammerB = ARGV[1] ? ARGV[1].to_i : 60 | |
t = rand(0..jammerA) # => random number between 0 and the maximum time for jammerA |