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
$ src/augtool -I lenses/ -r / -A -t Fstab=/etc/mtab -t Fstab=/etc/fstab
augtool> ls /files/etc/
mtab/ = (none)
fstab/ = (none)
raphink@obadiah:~/Documents$ cat fakeroot/etc/inittab
co:2345:respawn:/sbin/agetty xvc0 9600 vt100-nav
raphink@obadiah:~/Documents$ augtool -r fakeroot/ print /files/etc/inittab
/files/etc/inittab
/files/etc/inittab/co
/files/etc/inittab/co/runlevels = "2345"
/files/etc/inittab/co/action = "respawn"
/files/etc/inittab/co/process = "/sbin/agetty xvc0 9600 vt100-nav"
module ApacheParamsModule
def initialize
@oses = ['Debian', 'RedHat', 'Ubuntu', 'CentOS']
@vars = {
'Debian' => {
'pkg' => 'apache2',
'apache_root' => '/var/www',
'user' => 'www-data',
module ApacheParams
# Define default params
def oses
@oses = ['Debian', 'RedHat', 'Ubuntu', 'CentOS']
end
def vars
@vars = {
irb(main):054:0> aug.match('/files/etc/ssh/sshd_config/Match[count(Condition) == "2"]/Settings/PermitRootLogin')
SystemCallError: unknown error - Matching path expression '/files/etc/ssh/sshd_config/Match[count(Condition) == "2"]/Settings/PermitRootLogin' failed
from (irb):54:in `match'
from (irb):54
from (irb):52
# Alternative Augeas-based providers for Puppet
#
# Copyright (c) 2012 Raphaël Pinson
# Licensed under the Apache License, Version 2.0
require 'augeas' if Puppet.features.augeas?
Puppet::Type.type(:sshd_config).provide(:augeas) do
desc "Uses Augeas API to update an sshd_config parameter"
Puppet::Type.newtype(:sshd_config) do
ensurable
newparam(:name) do
desc "The name of the entry."
isnamevar
end
newparam(:value) do
desc "Entry value."
[
{
"data": {
"output": {
"ensure": "0.10.0-0ubuntu4~c2c~squeeze1",
"status": "installed",
"desired": "install",
"provider": "apt",
"name": "augeas-tools",
"error": "ok"
$ augcheck test.xml Xml
Test result: /tmp/augcheck.C6ia30/parse_file.aug:3.0-.47:
{ "str"
{ "#attribute"
{ "name" = "masterUrl" }
}
{ "#text" = "http://MY_SOLR_MASTER:8085/solr/files3/replication" }
}
@raphink
raphink / chambery.json
Created May 25, 2012 10:23
Chambery in nominatim
[
{
"icon" : "http://nominatim.openstreetmap.org/images/mapicons/poi_boundary_administrative.p.20.png",
"boundingbox" : [
"45.3524627685547",
"45.9385185241699",
"5.62203693389893",
"6.298264503479"
],
"licence" : "Data Copyright OpenStreetMap Contributors, Some Rights Reserved. CC-BY-SA 2.0.",