Skip to content

Instantly share code, notes, and snippets.

View ffi.patch
diff --git a/augeas/ b/augeas/
index 6f4b639..6d145a1 100644
--- a/augeas/
+++ b/augeas/
@@ -5,7 +5,8 @@ ffi.set_source("augeas",
#include <augeas.h>
- libraries=['augeas'])
+ libraries=['augeas'],
lutter / ssh_authorized_key.prov
Last active Mar 4, 2017
Sketch of a libral provider using mruby
View ssh_authorized_key.prov
#! /usr/bin/env mruby
# -*- ruby -*-
class SshAuthorizedKey
# All methods that get called by the runtime get a context argument that
# provides access to convenience methods
lutter / idempotent.rb
Created Oct 28, 2016
Idempotent augeas
View idempotent.rb
# We want a function that makes it easier to write down how
# to make idempotent changes with augeas rather than the
# clunky mechanism the augeas Puppet type gives you today.
# I was thinking we could achieve this with a function like the following:
:find => "/files/etc/hosts/*[ipaddr = '']",
:create => ["ins 01 before /files/etc/hosts/*[1]",
"set /files/etc/hosts/01/ipaddr"],
:tree => {
lutter / shell
Created Jun 7, 2016
Puppet augeas and ODBC inst
View shell
> puppet apply /tmp/test.pp
Notice: Compiled catalog for in environment production in 0.04 seconds
Error: /Stage[main]/Main/Augeas[oracle odbc driver config]: Could not evaluate: Saving failed, see debug
Notice: Applied catalog in 0.02 seconds
# The debug information shows that the tree correctly has a node { "Oracle" { "Driver Logging" = "7" } }
# The failure comes from the Augeas ODBC lens which does not allow spaces in the names of the entries.
# Please file a bug at to make sure this gets addressed
View forge-latest
#! /usr/bin/ruby
# To use this, untar the forge backup tarball from
# somewhere and
# then run this script, passing the name of the directory where you
# unpacked the tarball.
# The script will print the names of the latest version of each tarball;
# you can feed that into something like 'xargs -iF tar xf DIR/F'
lutter /
Last active May 26, 2016
Test resources for i18n
# test/puppetlabs/i18n/
msg1=Das ist deutsch
#include <locale>
#include <boost/locale.hpp>
int main() {
boost::locale::generator gen;
std::locale loc = gen("");
std::string lang = std::use_facet<boost::locale::info>(loc).language();
std::string country = std::use_facet<boost::locale::info>(loc).country();
std::cout << "Locale: " << << std::endl;
View unbind_node.rb
command :unbind_node do |data|
data['name'] or error 400,
:error => "Supply 'name' to indicate which node to unbind"
if node = Razor::Data::Node.find_by_name(data['name'])
if node.policy
policy_name =
node.log_append(:event => :unbind, :policy => policy_name)
node.policy = nil
node.bound = false
lutter /
Last active Dec 25, 2015
Some thoughts on evolving the Server/Microkernel protocol


The main point of interaction between server and microkernel is the /svc/checkin/:id endpoint. It currently expects that the Microkernel peridoically posts the following JSON to that URL:

  "facts": { ... facts hash ... }
lutter / network.xml
Created Sep 25, 2013
libvirt network on my laptop
View network.xml
<forward mode='nat'/>
<bridge name='virbr2' stp='on' delay='0' />
<mac address='52:54:00:ca:8d:34'/>
<domain name=''/>
<ip address='' netmask=''>
<tftp root='/var/lib/tftpboot' />