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
augeas {"setup some values":
incl => "/etc/rc.conf",
lens => "Shellvars.lns",
changes => [
'set key1 value1',
'set key2 value2',
# etc.
],
}
module Tty =
let entry =
let dev = [ label "dev" . store Rx.fspath ]
in let rate = [ label "rate" . store Rx.integer ]
in Build.key_value_line Rx.word Sep.space (dev . Sep.space . rate)
test entry get "stty /dev/cuaU0 9600\n" =
{ "stty"
{ "dev" = "/dev/cuaU0" }
dev/EPFL_VPN
dev/apache_vhost_augeas
dev/augeas_wheezy
dev/changtse_tftp
dev/cleanup_c2c
dev/generic_nodash
dev/georchestra
dev/georchestra-centos
dev/kmod_blacklist
dev/netcf
(*
Module: FreeBSD Update
parses /etc/freebsd-update.conf
Author: Mathieu Arnold <[email protected]>
About: Licence
This file is licensed under the BSD License.
About: Lens Usage
define limits::limit ($user,$type,$item,$value,$file='/etc/security/limits.conf'){
$key = "$user/$type/$item"
$path_list = "domain[.=\"$user\"][type=\"$type\" and item=\"$item\"]"
$path_exact = "domain[.=\"$user\"][type=\"$type\" and item=\"$item\" and value=\"$value\"]"
augeas { "limits_conf/${key}/":
lens => 'Limits.lns',
incl => $file,
onlyif => "match $path_exact size==0",
{ "1"
{ "type" = "host" }
{ "database" = "all" }
{ "user" = "all" }
{ "address" = ".dev.example.com" }
{ "method" = "gss"
{ "options"
{ "include_realm" = "0" }
{ "krb_realm" = "EXAMPLE.COM" }
{ "map" = "somemap" } } } }
$ sudo puppet resource netcf_if
netcf_if { 'eth1':
ensure => 'down',
definition => '<?xml version="1.0"?>
<interface name="eth1" type="ethernet">
<start mode="onboot"/>
<protocol family="ipv4">
<ip address="192.168.0.5" prefix="24"/>
<route gateway="192.168.0.1"/>
</protocol>
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ipcalc = "http://redhat.com/xslt/netcf/ipcalc/1.0"
extension-element-prefixes="ipcalc"
version="1.0">
<xsl:import href="util-get.xsl"/>
<xsl:output method="xml" indent="yes"/>
irb(main):001:0> require 'netcf'
=> true
irb(main):002:0> n = Netcf.new
=> #<Netcf:0x2ab58b74e058>
irb(main):003:0> i = n.lookup_by_name('eth0')
=> #<NetcfIf:0x2ab58b741df8>
irb(main):004:0> puts i.xml_desc
<?xml version="1.0"?>
<interface name="eth0" type="ethernet">
<start mode="onboot"/>
D, [2012-11-30T09:38:27.661195 #21197] DEBUG -- : psk.rb:98:in `callerid' Setting callerid to uid=0 based on callertype=uid
D, [2012-11-30T09:38:27.661333 #21197] DEBUG -- : runnerstats.rb:49:in `received' Incrementing total stat
D, [2012-11-30T09:38:27.661547 #21197] DEBUG -- : base.rb:68:in `publish' Sending registration a9da6331d24aa3660126292da3bceeb9 to collective mcollective
D, [2012-11-30T09:38:27.661718 #21197] DEBUG -- : pluginmanager.rb:83:in `[]' Returning cached plugin security_plugin with class MCollective::Security::Psk
D, [2012-11-30T09:38:27.661951 #21197] DEBUG -- : pluginmanager.rb:83:in `[]' Returning cached plugin connector_plugin with class MCollective::Connector::Rabbitmq
W, [2012-11-30T09:38:27.662195 #21197] WARN -- : runner.rb:68:in `run' Failed to handle message: incompatible marshal file format (can't be read)
format version 4.8 required; 89.111 given - TypeError
D, [2012-11-30T09:38:27.662412 #21197] DEBUG -- : rabbitmq.rb:182:in `publish' Sending a broadcast message to RabbitMQ