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
<?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"/>
$ 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>
{ "1"
{ "type" = "host" }
{ "database" = "all" }
{ "user" = "all" }
{ "address" = ".dev.example.com" }
{ "method" = "gss"
{ "options"
{ "include_realm" = "0" }
{ "krb_realm" = "EXAMPLE.COM" }
{ "map" = "somemap" } } } }
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",
(*
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
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 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" }
augeas {"setup some values":
incl => "/etc/rc.conf",
lens => "Shellvars.lns",
changes => [
'set key1 value1',
'set key2 value2',
# etc.
],
}
require 'openvz'
inventory = OpenVZ::Inventory.new()
inventory.load
hostnames=[]
inventory.to_hash.each do |k,v|
hostnames << v.config.hostname
end
puts hostnames.join(':')
$ cat /etc/passwd | auged --lens Passwd.lns set root/shell /bin/zsh
# passwd content with replacement
$ cat /etc/passwd | auged --lens Passwd.lns -f commands.augtool
# passwd content modified by commands.augtool commands
$ auged --lens Passwd.lns -i 'set root/shell /bin/zsh' /etc/passwd
# no output, replaces /etc/passwd in place
$ auged --lens Passwd.lns 'get root/shell' /etc/passwd
/bin/sh
$ auged --lens Passwd.lns 'get */shell' /etc/passwd
/bin/sh