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 / Talk_Subjects.md
Last active May 16, 2022 10:08
Talk Subjects to be used for CFPs

General and Concepts

  • Declarative Deployments & why it matters

Over the last 30 years, the Configuration Management community has learned that using a declarative approach to resource management is beneficial for both stability and change management. How does this apply to the new paradigm of Kubernetes deployments?

YAML has become the de-facto standard to express resources in many fields linked to DevOps practices. What are YAML's strengths and weaknesses, and what are the other options going forward?

@raphink
raphink / output.sh
Last active September 23, 2015 15:03
Auglua implementation of augeasproviders_shellvar
$ ./shellvar.lua ensure=present target=/tmp/foo key=foo value=bar
Saved 1 file(s)
(1..100).each do |i|
fizz = (i % 3 == 0) ? 'Fizz' : ''
buzz = (i % 5 == 0) ? 'Buzz' : ''
num = (i % 3 == 0 || i % 5 == 0) ? '' : i
puts ("#{num}#{fizz}#{buzz}")
end
$ ./src/augtool -I lenses/ -f test.auglua
Hello, world
1.4.0
1041
module Test =
let lns = [ key "a" . store "b" ]
let _ = print_regexp (lens_ktype lns)
#!/usr/bin/env ruby
require 'jgrep'
def get_facts(facter_version, filter)
filter_str = filter.map { |f| f.map { |k,v | "#{k}=#{v}" }.join(' and ') }.join(' or ')
jsons = Dir.glob("facts/#{facter_version}/*.facts").map { |f| File.read(f) }
json = "[#{jsons.join(',')}]\n"
JGrep.jgrep(json, filter_str)

Keybase proof

I hereby claim:

  • I am raphink on github.
  • I am raphink (https://keybase.io/raphink) on keybase.
  • I have a public key whose fingerprint is 28AB 9C5A F201 E32C E21B 7864 DF0A 493B 74BF 771E

To claim this, I am signing this object:

@raphink
raphink / edit.sh
Created August 25, 2015 09:53
Edit shell script with Augeas
$ cat /tmp/test.sh
echo foo | tee bar.txt || TRUC_EGAL=baz
$ augtool -I lenses/ -Ast "Shellvars.lns incl /tmp/test.sh" set /files/tmp/test.sh/@command/@pipe/@command cat
Saved 1 file(s)
$ cat /tmp/test.sh
echo foo | cat bar.txt || TRUC_EGAL=baz
{ "dict"
{ "entry" = "key"
{ "#comment" = "my key" }
{ "string" = "value"
{ "#comment" = "my value" }
}
}
{ "#comment" = "after value" }
{ "entry" = "key2"
{ "string" = "val2" } } }
augeas_file { '/tmp/abc':
base => '/tmp/abc.base',
}
augeas { 'foo':
incl => '/tmp/abc',
lens => 'Shellvars.lns',
changes => ['set foo bar'],
}