Skip to content

Instantly share code, notes, and snippets.

@jeremiahsnapp
jeremiahsnapp / gist:dcbcebf600a0a535491dc3ae4910a1e1
Last active March 22, 2017 19:37
Reconciling Chef Server database and Solr index inconsistencies

Sometimes a database object can get deleted but the Solr index entry will remain.

This can cause problems such as infinite Chef Search API request loops (for knife and I believe for Manage).

The following procedure identifies remaining index entries and provides a way to delete them.

# set the name of the organization you are interested in
export ORG_NAME=demo
@jeremiahsnapp
jeremiahsnapp / easy_statsd_in_chef_server.md
Last active November 20, 2015 19:00
Easy statsd in Chef Server

Configure the chef server to push statistics in statsd format

cat >>/etc/opscode/chef-server.rb <<EOF
estatsd['protocol'] = 'statsd'
EOF
chef-server-ctl reconfigure
@jeremiahsnapp
jeremiahsnapp / create_chef11_key_file.rb
Last active March 25, 2016 21:37
Manually download Open Source Chef Server 11 data to migrate to separate Chef Server 12 server
require 'pg'
require 'json'
def pull_chef11_db_credentials
puts "Pulling open source Chef 11 database credentials"
if !File.exists?("/etc/chef-server/chef-server-running.json")
puts "Failed to find /etc/chef-server/chef-server-running.json"
exit 1
end
@jeremiahsnapp
jeremiahsnapp / 01_setup_dev-lxc.md
Last active July 19, 2016 07:52
Quick Setup dev-lxc-platform
input {
stdin {
type => "stdin-type"
}
file {
type => "erchef"
path => [ "/dev-shared/logstash/*" ]
start_position => "beginning"
}
@jeremiahsnapp
jeremiahsnapp / gist:fc829ac990b1581826ec
Created May 22, 2014 16:28
async process on windows that doesn't block chef run
async process on windows that doesn't block chef run
batch "run" do
code 'powershell -c "start-process notepad.exe"'
end
https://opscode.hipchat.com/history/room/12542/2013/10/15?q=notepad.exe#17:43:33
http://technet.microsoft.com/en-us/library/hh849848.aspx
@jeremiahsnapp
jeremiahsnapp / Chef_Heartbleed_Releases
Last active August 29, 2015 13:59
Chef Heartbleed Releases
The following Chef products were released with security patches in response to the Heartbleed openssl vulnerability.
* Enterprise Chef Server 11.1.3
* Manage add-on 1.3.1
* Reporting add-on 1.1.1
* Push-Jobs-Server add-on 1.1.1
* Push-Jobs-Client 1.0.2
* Chef Client 11.12.2
### Upgrade Instructions for Enterprise Chef Server
@jeremiahsnapp
jeremiahsnapp / upgrade.md
Last active August 29, 2015 13:57
Upgrade opscode-manage add-on in HA configured Enterprise Chef server

Authoritative docs are here

@jeremiahsnapp
jeremiahsnapp / upgrade.md
Last active August 29, 2015 13:57
Modified Upgrade Procedures for HA configured Enterprise Chef Server
@jeremiahsnapp
jeremiahsnapp / gatling_chef
Last active December 27, 2015 02:19
gatling_chef is a command line tool that updates timestamps and re-signs Chef authentication headers in a Gatling http://gatling-tool.org/ simulation file.
#!/usr/bin/env ruby
# encoding: UTF-8
require 'thor'
require 'base64'
require 'openssl'
require 'time'
class GatlingChef < Thor
desc 'update FILE', 'Update timestamps and re-sign Chef authentication ' +