Skip to content

Instantly share code, notes, and snippets.

View eheydrick's full-sized avatar

Eric Heydrick eheydrick

View GitHub Profile
nginx conf for proxying the FreeIPA UI. ipa.my.org is the proxy name, realipa.my.org is the master.
server {
listen 443 ssl;
server_name ipa.my.org;
ssl on;
ssl_certificate /etc/nginx/ssl/ipa.crt;
ssl_certificate_key /etc/nginx/ssl/ipa.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers AES256+EECDH:AES256+EDH:AES128+EECDH!aNULL;
@eheydrick
eheydrick / ssh.rb
Created July 31, 2015 19:09
Kerberos/GSSAPI support for knife ssh
--- chef/lib/chef/knife/ssh.rb 2015-07-31 18:59:12.325073131 +0000
+++ /opt/chef/embedded/apps/chef/lib/chef/knife/ssh.rb 2015-07-31 18:58:04.727929333 +0000
@@ -25,6 +25,7 @@
deps do
require 'net/ssh'
require 'net/ssh/multi'
+ require 'net/ssh/kerberos'
require 'chef/monkey_patches/net-ssh-multi'
require 'readline'
require 'chef/exceptions'
@eheydrick
eheydrick / pg_gem.rb
Created October 5, 2015 22:50
install the pg gem into sensu's ruby installation
# Super hacky way to get the pg gem installed into Sensu's ruby installation.
# Ripped off from https://github.com/hw-cookbooks/postgresql/blob/develop/recipes/ruby.rb
# Credit to chrisroberts for this
gem_installed = system("/opt/sensu/embedded/bin/ruby -e \"require 'pg'\"")
pg_gem_version = '0.18.3'
unless gem_installed
Chef::Log.warn('pg gem is not installed in the sensu ruby installation. Installing it')
@eheydrick
eheydrick / multi-component-repo.sh
Last active November 12, 2015 21:24
multi component apt repo publishing with aptly
#!/bin/bash
#
# multi-component apt repo publishing with aptly - http://www.aptly.info/
# Usage:
# ./multi-component-repo.sh <component>
# where component is the component to put the package in
#
# See http://www.aptly.info/doc/feature/multi-component/ for more info
#
Recipe: chef-dk::default
* chef_dk[chef_dk] action install
Recipe: <Dynamically Defined Resource>
* chef_gem[omnijack] action install (up to date)
================================================================================
Error executing action `install` on resource 'chef_dk[chef_dk]'
================================================================================
OpenURI::HTTPError
@eheydrick
eheydrick / load_metrics.json
Created December 17, 2015 00:39
sensu metrics
/etc/sensu/conf.d/checks/load_metrics.json on clients:
{
"checks": {
"load_metrics": {
"command": "/opt/sensu/embedded/bin/metrics-load.rb -s load",
"handlers": [
"metrics"
],
"standalone": true,
@eheydrick
eheydrick / slack.rb
Last active January 22, 2016 07:39
sensu slack handler
# configuring a slack sensu handler
# create incoming-webhook at https://{your team}.slack.com/services/new/incoming-webhook
# get webhook URL
sensu_gem 'sensu-plugins-slack'
slack_conf = {
'webhook_url' => 'https://hooks.slack.com/services/XXXXXXXXX/YYYYYYYY/ZZZZZZZZZZZZZ'
}
@eheydrick
eheydrick / gist:01e79eea53702b3d453c
Created February 18, 2016 20:40
chef search for nodes running a particular Ubuntu release
knife search 'lsb_description:"Ubuntu 14.04.3 LTS"' -i
@eheydrick
eheydrick / pg_gem.rb
Last active February 26, 2016 19:38
install postgresql pg gem into the sensu embedded ruby
ark 'postgresql' do
url 'https://ftp.postgresql.org/pub/source/v9.4.6/postgresql-9.4.6.tar.bz2'
end
# build and install postgresql into the sensu embedded install
execute 'configure postgresql' do
command './configure --prefix /opt/sensu/embedded --with-openssl'
not_if '/opt/sensu/embedded/bin/gem list pg -i'
cwd '/usr/local/postgresql'
environment(
Generated at 2016-05-16 23:18:38 +0000
Gem::MissingSpecError: chef_handler[HipChat::NotifyRoom] (hipchat::handler line 49) had an error: Gem::MissingSpecError: Could not find 'multi_xml' (>= 0.5.2) among 87 total gem(s)
Checked in 'GEM_PATH=/home/eric/.gem/ruby/2.1.0:/opt/chef/embedded/lib/ruby/gems/2.1.0', execute `gem env` for more information
/opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:308:in `to_specs'
/opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1439:in `block in activate_dependencies'
/opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1428:in `each'
/opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1428:in `activate_dependencies'
/opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1410:in `activate'
/opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1442:in `block in activate_dependencies'
/opt/chef/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1428:in `each'