Skip to content

Instantly share code, notes, and snippets.

View raphink's full-sized avatar
🐝
eBPF everything!

Raphaël Pinson raphink

🐝
eBPF everything!
View GitHub Profile
@raphink
raphink / augsed.sh
Last active December 11, 2015 02:09
augsed bash poc
#!/bin/bash
BYLINE=0
while getopts "l" opt; do
case $opt in
l)
BYLINE=1
shift
;;
module Test =
let number = [ label "number" . store Rx.integer . Util.eol ]
let lns = (Util.comment|Util.empty|number)*
let _ = print_endline (lens_format_atype lns)
STOMP error frame sent:
Message: "Processing error"
Detail: "Processing error\n"
Server private detail: {undef,
[{rabbit_auth_backend_ldap,check_user_login,
[<<"rpinson">>,[{password,<<"mypassword">>}]]},
{rabbit_access_control,
'-check_user_login/2-fun-0-',4},
{lists,foldl,3},
{rabbit_stomp_processor,do_login,7},
@raphink
raphink / check_commits.sh
Created February 7, 2013 10:46
Test all commits in range, performing a `make check` on each. Fail on first failed commit.
#!/bin/bash
RANGE=$1
while read rev def; do
echo -n "Testing $rev ($def) "
git checkout $rev >/dev/null 2>/dev/null
make check > /dev/null 2>/dev/null
[[ $? != 0 ]] && echo "NOK" && exit 1
echo "OK"
network_interface {"eth1":
ensure => up,
macaddress => 'aa:bb:cc:dd:ee:ff',
mtu => '1492',
onboot => true,
ipv4 => {
address => ['192.168.0.5/24'],
gateway => '192.168.0.1,
dhcp => false,
},
$ mco inventory wrk4 -v
The inventory application failed to run, use -v for full error details: Received a processing error from RabbitMQ: 'Processing error'
Received a processing error from RabbitMQ: 'Processing error' (RuntimeError)
from /usr/share/mcollective/plugins/mcollective/connector/rabbitmq.rb:162:in `receive' <----
from /usr/lib/ruby/1.8/mcollective/client.rb:89:in `receive'
from /usr/lib/ruby/1.8/mcollective/client.rb:152:in `req'
from /usr/lib/ruby/1.8/mcollective/client.rb:151:in `loop'
from /usr/lib/ruby/1.8/mcollective/client.rb:151:in `req'
@raphink
raphink / hash.erb
Last active December 14, 2015 07:08
<%=
class MyHash < Hash
def initialize(hash)
@hash = hash
end
def test
@hash.is_a?(Hash) ? "yes" : @hash.class
end
end
<%=
class MyHash < Hash
def to_yaml( opts = {} )
YAML::quick_emit( self, opts ) do |out|
out.map( taguri, to_yaml_style ) do |map|
keys.sort.each do |k|
v = self[k]
map.add( k, v )
end
end
$ rake package --trace
rake aborted!
GONE
/var/lib/gems/1.8/gems/rake-10.0.2/lib/rake/application.rb:191:in `deprecate'
/usr/lib/ruby/vendor_ruby/rake/rdoctask.rb:4
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/home/rpinson/dev/ruby-augeas/Rakefile:12
/var/lib/gems/1.8/gems/rake-10.0.2/lib/rake/rake_module.rb:25:in `load'
/var/lib/gems/1.8/gems/rake-10.0.2/lib/rake/rake_module.rb:25:in `load_rakefile'
rpinson@wrk4:~/bas/puppet/augeas$ ls
fakemodule puppet-stdlib
rpinson@wrk4:~/bas/puppet/augeas$ cat fakemodule/manifests/init.pp
class fakemodule {
notify { 'foo':
message => augeas("proc /proc proc nodev,noexec,nosuid 0 0\n", 'Fstab.lns', ['rm ./1/opt[3]']),
}
}
rpinson@wrk4:~/bas/puppet/augeas$ RUBYLIB=/var/lib/gems/1.8/gems/ruby-augeas-0.4.1/lib puppet apply -e 'include fakemodule' --modulepath .
notice: proc /proc proc nodev,noexec 0 0