Skip to content

Instantly share code, notes, and snippets.

@sean-horn
sean-horn / keybase.md
Created June 27, 2018 21:02
Keybase.md

Keybase proof

I hereby claim:

  • I am sean-horn on github.
  • I am seanhorn (https://keybase.io/seanhorn) on keybase.
  • I have a public key ASCC2iPb003N1coKfe_mfd-btZRAnWtsDDXIhwC0aCMoUgo

To claim this, I am signing this object:

@sean-horn
sean-horn / 97-compliance-filter.conf
Last active December 29, 2017 20:19
compliance filter with additional output for logfile
filter {
if [type] == "inspec_report" {
if [end_time] {
date {
match => ["end_time", "YYYY-MM-dd'T'HH:mm:ssZZ"]
timezone => "UTC"
}
}
mutate {
@sean-horn
sean-horn / ls_config.sh
Last active November 9, 2017 17:28
automate-logstash-config
#!/bin/bash
usage="
This is a script used to configure your logstash tunables through delivery.rb, and to scale the number of \n
logstash processes running on your Automate server.\n
\n
You can specify the following options:\n
--workers The number of filter workers per logstash process. Defaults to number of virtual cores.\n
--total-procs The number of total logstash processes to run. Defaults to 2.\n
--heap-size The heap size allotted to each logstash process. Defaults to 2g.\n
@sean-horn
sean-horn / fake-ca.md
Last active December 17, 2015 02:06
Create SHA256-Signed Testing Cert for Tiered Chef Server with CA

Used this guy to generate a new cert, then concatenated its root ca.crt with the server cert and put it in place. https://github.com/xenolinguist/pseudo_ca

cd /etc/ssl

git clone https://github.com/xenolinguist/pseudo_ca.git

rake generate_server[hr.puffin.stuff.lxc]

With this sequence of commands, we will enable the rabbitmqadmin web interface for rabbit. All commands should be run as root

PATH=/opt/opscode/embedded/bin:$PATH /opt/opscode/embedded/bin/rabbitmqctl list_queues -p /analytics
    
PATH=/opt/opscode/embedded/bin:$PATH /opt/opscode/embedded/bin/rabbitmqctl list_consumers -p /analytics

PATH=/opt/opscode/embedded/bin:$PATH /opt/opscode/embedded/service/rabbitmq/sbin/rabbitmq-plugins enable rabbitmq_management
@sean-horn
sean-horn / gist:60eaa634a1a3edbf2b88
Created June 16, 2015 16:36
Fixup Analytics oauth

This documentation is sufficient to work with the following versions

Chef Server: 12.0.8

Analytics: 1.1.x

Problem

Analytics is no longer able to auth with the oc_id service back on the Chef Server it's pointed to in

@sean-horn
sean-horn / gist:cdca252867d7b11d3dfa
Last active August 29, 2015 14:22
Failing search?
exit unless ARGV.length == 3
nodename = ARGV[2]
50.times do
%w{role1 role2}.each do |currentrole|
n = nodes.load(nodename)
n.run_list("role[#{currentrole}]")
n.save
n = nodes.load(nodename)
@sean-horn
sean-horn / gist:f74ca91c76ab073de14f
Created June 3, 2015 19:44
chef-server-permissions.rb
#!/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|
@sean-horn
sean-horn / clone-ec11-ha-system.md
Created March 25, 2015 04:07
Clone an EC11 System

These instructions are for an HA system specifically. To use for a Standalone, just replace the /var/opt/opscode/drbd/data path to /var/opt/opscode and ignore the stages for Secondary Backend and Frontends.

All commands as root

##On the Source EC 11.0.2 system

  1. Shutdown the backend

private-chef-ctl stop

@sean-horn
sean-horn / cleanup-org-invites-api.sh
Created March 5, 2015 17:24
cleanup-org-invites-api knife exec script
# OC-11643
# OC-11644
# You can use this script by running `knife exec`
# knife exec cleanup_orphaned_invites_via_api.rb -s https://CHEF_SERVER_URL/organizations/ORG_NAME
invites = api.get('association_requests')
orphaned_invites = invites.select { |invite| invite['username'].nil? }