Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am micgo on github.
  • I am mpgoetz (https://keybase.io/mpgoetz) on keybase.
  • I have a public key ASBuFPh92Sq0zgRze5_-KE4ItdA_ziEuOZsHbLEN2iwaHQo

To claim this, I am signing this object:

@micgo
micgo / base.rb
Last active August 29, 2015 13:59
Chef - Intermediate Topics
name "base"
description "Base Server Role"
run_list "recipe[chef-client::delete_validation]", "recipe[chef-client]", "recipe[ntp]", "recipe[motd]", "recipe[users]", "recipe[push-jobs]"
default_attributes(
"chef_client" => {
"config" => {
"ssl_verify_mode" => ":verify_peer"
}
},
"push_jobs" => {
@micgo
micgo / remote-cert.sh
Last active August 29, 2015 13:57
Copy Remote Chef Server Certificate
echo | openssl s_client -connect <EXTERNAL_ADDRESS>:443 2>&1 | sed -n '/-\+BEGIN/,/-\+END/p' | sudo tee /etc/chef/trusted_certs/cert.pem
@micgo
micgo / Gemfile
Created February 11, 2014 22:00
Test Kitchen, Guard, Foodcritic, ChefSpec
source 'https://rubygems.org'
gem 'berkshelf', '~> 2.0'
group :development do
gem 'ruby_gntp'
gem 'test-kitchen'
gem 'kitchen-vagrant'
gem 'guard'
gem 'guard-kitchen'
@micgo
micgo / Guardfile
Created January 2, 2014 20:59
Chefspec + Foodcritic + Test-Kitchen + Guard
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
guard 'kitchen' do
watch(%r{test/.+})
watch(%r{^recipes/(.+)\.rb$})
watch(%r{^attributes/(.+)\.rb$})
watch(%r{^files/(.+)})
watch(%r{^templates/(.+)})
watch(%r{^providers/(.+)\.rb})
@micgo
micgo / ec_node_fixer.rb
Created October 30, 2013 03:32
This should fix missing permissions on Enterprise Chef 11 after download/upload operations
#!/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|
require File.expand_path('../support/helpers', __FILE__)
describe 'myface::database' do
include Helpers::Myface
# Example spec tests can be found at http://git.io/Fahwsw
# Verify that MySQL is installed & enabled:
it "Enables and starts the mysql daemon" do
@micgo
micgo / CentOS Berkshelf Config
Created August 1, 2013 14:27
CentOS 6.4 Berkshelf Configuration
{
"vagrant": {
"vm": {
"box": "opscode-centos-6.4",
"box_url": "https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_centos-6.4_provisionerless.box",
"forward_port": {},
"network": {
"bridged": false
},
"provision": "chef_solo"
@micgo
micgo / OS X: Adding Sublime Text to your $PATH
Created July 31, 2013 20:53
Adding Sublime Text to your PATH
sudo mkdir -p /usr/local/bin; \
sudo chown -R $(whoami) /usr/local/bin; \
ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
@micgo
micgo / gist:5988117
Created July 12, 2013 21:47
Packer provisioner overrides
"provisioners": [
{
"type": "shell",
"override": {
"virtualbox": {
"execute_command": "echo 'vagrant'|sudo -S sh '{{.Path}}'",
"scripts": [
"scripts/update.sh",
"scripts/vagrant.sh",
"scripts/sshd.sh",