Skip to content

Instantly share code, notes, and snippets.

@kkenny
kkenny / json_to_pp.rb
Created May 1, 2012 17:13
json to ruby pp
#!/usr/bin/env ruby
## Author: Kameron Kenny, ExactTarget
## Usage:
## Output results to stdout:
## json_to_pp.rb file.json
## Output results to file:
## json_to_pp.rb file.json > file.rb
require 'pp'
@kkenny
kkenny / ubuntu.rb
Created May 15, 2012 13:52
ms scx ubuntu.rb
#
# Cookbook Name:: microsoft_scx
# Recipe:: default
#
# Copyright 2011, CoTweet
#
# 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
#
@kkenny
kkenny / check_double_domain.sh
Created May 21, 2012 18:56
Check for double domain
#!/bin/bash
# (C) 2012, Kameron Kenny
# ExactTarget
nl(){
echo ""
}
print_help(){
nl
@kkenny
kkenny / check_double_domain_chef.sh
Created May 21, 2012 19:45
check for double domain using chef
#!/bin/bash
# (C) 2012, Kameron Kenny
# ExactTarget
nl(){
echo ""
}
print_help(){
nl
@kkenny
kkenny / knife_status_plugin.rb
Created May 23, 2012 20:30
Knife node status plugin
require 'chef/knife'
require 'highline'
module Limelight
class NodeStatus < Chef::Knife
deps do
require 'chef/search/query'
require 'chef/knife/search'
end
@kkenny
kkenny / knife_status_environment_plugin.rb
Created May 23, 2012 20:32
knife environment status plugin
require 'chef/knife'
require 'highline'
module Limelight
class EnvironmentStatus < Chef::Knife
deps do
require 'chef/search/query'
require 'chef/knife/search'
end
@kkenny
kkenny / chef_inventory.rb
Created June 12, 2012 20:04
Chef Inventory Script
###################################################################
# (C)opyright 2012, Kameron Kenny, ExactTarget
#
# 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
#
# Put this file in .chef/plugins/knife/
#!/usr/bin/env python
import argparse
import socket
import time
CARBON_SERVER = ''
CARBON_PORT = 2003
{
"name": "app_servers",
"default_attributes": {
"sudo": {
"users": [
"someone"
]
}
},
"json_class": "Chef::Role",
source "https://rubygems.org"
gem "rake", '~>10.4.2'
gem "chef", '11.16.2'
gem "foodcritic", '~>4.0.0'
gem "highline"
gem "knife-ec2"
gem "knife-cloud"
gem "knife-openstack", '~>1.0.0'
gem "knife-inspect"