Skip to content

Instantly share code, notes, and snippets.

View codec's full-sized avatar

codec

  • Munich
  • 08:33 (UTC +01:00)
View GitHub Profile
augeas { 'puppet-onboot':
context => '/files/etc/default/puppet',
incl => '/etc/default/puppet', # http://projects.puppetlabs.com/issues/show/17486
lens => 'Shellvars.lns', # http://projects.puppetlabs.com/issues/show/17486
changes => [
'set START yes',
],
}
root@mirror:/srv/repositories/puppetlabs# ls dists/
hardy oneiric sid testing
hardy-20121220164502045137453 oneiric-20130125153303462683049 sid-20130125153917662426743 testing-20130125155100194065296
lucid precise squeeze unstable
lucid-20130125152713336789991 precise-20130125154646712294437 squeeze-20130125154214238989172 unstable-20130125153620240304389
natty quantal stable wheezy
natty-20130125153016311673059 quantal-20130125154844894669521 stable-20130125154953486972751 wheezy-20130125154438466243674
@codec
codec / test.pp
Last active December 14, 2015 14:08
class foo {
notify { 'foo': }
}
class bar {
notify { 'bar': message => inline_template("<%= if classes.include?('foo') then 'bar' end %>") }
}
include foo
include bar
@codec
codec / gist-macro.vm
Last active October 4, 2017 18:25
Confluence User Macro for gists
## @param gist:title=gist URL|type=string|required=true
#set ( $gist = $paramgist.replace("https://gist.github.com/", '') )
#set ( $data = [] )
#foreach($part in $gist.split("/"))
#set ($t = $data.add($part))
#end
#set( $gistuser = $data.get(0) )
#set( $gisthash = $data.get(1) )
@codec
codec / child-like-table.vm
Last active December 22, 2015 15:49
Create a table including child pages and likes.
## @noparams
## wtf, seriously!?
#set($containerManagerClass = $action.class.forName('com.atlassian.spring.container.ContainerManager'))
#set($getInstanceMethod = $containerManagerClass.getDeclaredMethod('getInstance',null))
#set($containerManager = $getInstanceMethod.invoke(null,null))
#set($containerContext = $containerManager.containerContext)
## now what we actually need ...
#set($likeManager = $containerContext.getComponent('likeManager'))
define foo ($primary_interface='eth0') {
notify { "foo $name local-scope":
message => $primary_interface
} ->
notify { "foo $name top-scope":
message => $::primary_interface
}
}
#!/usr/bin/ruby
require 'webrick'
require 'json'
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(STDIN)
json_payload = JSON.parse(req.query['payload'])
branch = json_payload['ref'].split('/')[-1]