Skip to content

Instantly share code, notes, and snippets.

View kbarber's full-sized avatar

Ken Barber kbarber

View GitHub Profile
#!/usr/bin/env ruby
require 'rubygems'
require 'net/http'
require 'uri'
require 'json'
require 'facter'
require 'pp'
[ken@kb classifier]# lein run --config classifier.conf
Exception in thread "main" java.lang.IllegalStateException: Unable to find bootstrap.cfg file via --bootstrap-config command line argument, current working directory, or on classpath, compiling:(/private/var/folders/21/g1xxs_ws1rx3vc4w4lbdwbxh0000gp/T/form-init4078273981487895119.clj:1:142)
at clojure.lang.Compiler.load(Compiler.java:7142)
at clojure.lang.Compiler.loadFile(Compiler.java:7086)
@kbarber
kbarber / gist:f436f7f764272ea0a738
Last active August 29, 2015 14:01
Unable to get local issuer certificate
[ken@kb puppetdb]# openssl s_client -connect kb.local:8081 -cert /Users/ken/.puppet/ssl/certs/kb.local.pem -certform PEM -key ~/.puppet/ssl/private_keys/kb.local.pem -CAfile ~/.puppet/ssl/certs/ca.pem -ssl3
CONNECTED(00000003)
depth=1 /CN=Puppet CA: kb.local
verify return:1
depth=0 /CN=kb.local
verify return:1
---
Certificate chain
0 s:/CN=kb.local
i:/CN=Puppet CA: kb.local
#!/usr/bin/env ruby
# encoding: UTF-8
require 'rubygems'
require 'net/http'
require 'uri'
require 'json'
require 'pp'
def replace_catalog(catalog)
[ken@kb puppetdb]# telnet 0 8080
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
POST /v3/commands HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: foo
Content-Length: 40
###########################################
# Init settings for puppetdb
###########################################
# Location of your Java binary
# Debian
if [ -f /usr/lib/jvm/java-7-openjdk-amd64/bin/java ]; then
JAVA_BIN="/usr/lib/jvm/java-7-openjdk-amd64/bin/java"
elif [ -f /usr/lib/jvm/java-7-openjdk-i386/bin/java ]; then
JAVA_BIN="/usr/lib/jvm/java-7-openjdk-i386/bin/java"
root@localhost:/etc/default# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
puppetdb
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 21.7 MB of archives.
After this operation, 434 kB of additional disk space will be used.
root@localhost:/etc/apt# grep -v '^#' sources.list | sort | uniq
deb http://security.ubuntu.com/ubuntu precise-security main restricted
deb http://security.ubuntu.com/ubuntu precise-security multiverse
deb http://security.ubuntu.com/ubuntu precise-security universe
deb http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ precise main restricted
deb http://us.archive.ubuntu.com/ubuntu/ precise multiverse
deb http://us.archive.ubuntu.com/ubuntu/ precise universe
deb http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted
Last login: Tue May 6 19:50:00 on ttys006
ruby-2.0.0-p353
[ken@kb ~]# cd Development/puppetdb-vagrant
ruby-2.0.0-p353 (git)-[master]
[ken@kb puppetdb-vagrant]# vagrant status
Current machine states:
centos-5.10-64-nocm not created (vmware_fusion)
centos-6.5-64-nocm not running (vmware_fusion)
debian-7.4-64-nocm not created (vmware_fusion)
root@puppetdb1:~# cat query.json
["and",
["in","certname",
["extract","certname",
["select-facts",
["and",
["=","name","kernel"],
["=","value","Linux"]]]]],
["or",
["=","name","hostname"],