Skip to content

Instantly share code, notes, and snippets.

View peterhuene's full-sized avatar

Peter Huene peterhuene

View GitHub Profile
@peterhuene
peterhuene / heapster.yaml
Created June 20, 2017 22:25
Kubernetes manifest for installing Heapster and InfluxDB on ARM
apiVersion: v1
kind: ServiceAccount
metadata:
name: heapster
namespace: kube-system
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: heapster
@peterhuene
peterhuene / example.md
Last active August 19, 2016 00:52
3.x resource types in the native compiler

Resource type in Ruby

$ cat /Users/peterhuene/.puppetlabs/etc/code/environments/production/modules/foo/lib/puppet/type/foo.rb
Puppet::Type.newtype(:foo) do
  newparam(:name) do
  end
end
@peterhuene
peterhuene / repro.cpp
Last active August 22, 2016 17:37
Spirit X3 1.61.0 error repro
#include <iostream>
#include <string>
#include <boost/spirit/home/x3.hpp>
#include <boost/fusion/include/std_pair.hpp>
using namespace std;
namespace x3 = boost::spirit::x3;
struct repro_string_parser : x3::parser<repro_string_parser>
{
@peterhuene
peterhuene / ouput.md
Last active July 19, 2016 21:24
Interleaved function call backtrace in the prototype native compiler

Puppet function in Ruby:

$ cat /Users/peterhuene/.puppetlabs/etc/code/environments/production/modules/foo/lib/puppet/functions/foo.rb
Puppet::Functions.create_function(:foo) do
  dispatch :foo do
    param 'Numeric', :a
    param 'String',  :b
    block_param
  end
@peterhuene
peterhuene / output.md
Last active July 14, 2016 21:16
Ruby yield to Puppet (C++)
$ cat ~/.puppetlabs/etc/code/environments/production/modules/foo/lib/puppet/functions/foo.rb
Puppet::Functions.create_function(:foo) do
  dispatch :foo do
    param 'Numeric', :a
    param 'String',  :b
    block_param
  end

 def foo(a, b)
@peterhuene
peterhuene / output.md
Last active July 15, 2016 04:48
Puppet functions in Ruby using the native compiler
$ cat ~/.puppetlabs/etc/code/environments/production/modules/foo/lib/puppet/functions/foo.rb
Puppet::Functions.create_function(:foo) do
  dispatch :foo do
    param 'Numeric', :a
    param 'String',  :b
  end

  def foo(a, b)
    a + b.to_i

Before:

Error: Evaluation Error: Error while evaluating a Function Call, inline_epp(): Invalid EPP: Syntax error at '=>' at line 1:34 at /Users/peterhuene/.puppetlabs/etc/code/environments/production/manifests/site.pp:1:1 on node peterhu-osx
Error: Failed to compile catalog for node peterhu-osx: Evaluation Error: Error while evaluating a Function Call, inline_epp(): Invalid EPP: Syntax error at '=>' at line 1:34 at /Users/peterhuene/.puppetlabs/etc/code/environments/production/manifests/site.pp:1:1 on node peterhu-osx

After:

@peterhuene
peterhuene / keybase.md
Created September 29, 2015 17:58
keybase.md

Keybase proof

I hereby claim:

  • I am peterhuene on github.
  • I am peterhuene (https://keybase.io/peterhuene) on keybase.
  • I have a public key whose fingerprint is 9B4D A4C4 989D 9F61 4F69 0757 1142 73C2 D90F BA06

To claim this, I am signing this object: