Skip to content

Instantly share code, notes, and snippets.

@neilhwatson
neilhwatson / gist:5292866
Last active December 15, 2015 16:59
Dynamic inputs and bundlesequence without common bundles
newatson@ltipc682:~/.cfagent/inputs$ cat promises.cf
body common control
{
bundlesequence => { "first", @{first.bs} };
inputs => { "first.cf", @{first.inputs} };
}
newatson@ltipc682:~/.cfagent/inputs$ cat first.cf
@neilhwatson
neilhwatson / gist:9762620
Last active August 29, 2015 13:57
Defaults from other bundles.
body common control
{
bundlesequence =>
{ "main", };
}
bundle agent g
{
vars:
@neilhwatson
neilhwatson / gist:cf77953c3958862e101f
Created May 5, 2014 17:40
conary perl-json search
[root@ltipc682 ~]# conary rq --recurse --all-troves |grep -i json
perl-JSON=2.15_5.el6-1-1[is: x86_64]
perl-JSON:debuginfo=2.15_5.el6-1-1[is: x86_64]
perl-JSON:rpm=2.15_5.el6-1-1[is: x86_64]
python-simplejson=2.0.9_3.1.el6-1-1[is: x86_64]
python-simplejson:debuginfo=2.0.9_3.1.el6-1-1[is: x86_64]
python-simplejson:rpm=2.0.9_3.1.el6-1-1[is: x86_64]
python-turbojson=1.2.1_8.1.el6-1-1[is: x86_64]
python-turbojson:debuginfo=1.2.1_8.1.el6-1-1[is: x86_64]
python-turbojson:rpm=1.2.1_8.1.el6-1-1[is: x86_64]
2014-06-09T11:08:48-0400 verbose: /default/efl_main/methods/'methods loop wrapper'/default/efl_bug2638/methods/'delta reporting log collecti
on_5'/default/deltarep_client_get/methods/'deltarep'/default/bg_deltarep_get/files: Connection to 2001:470:1d:a2f::9 is closed
2014-06-09T11:08:48-0400 verbose: /default/efl_main/methods/'methods loop wrapper'/default/efl_bug2638/methods/'delta reporting log collecti
on_5'/default/deltarep_client_get/methods/'deltarep'/default/bg_deltarep_get/commands: Evaluating promise '/opt/delta_reporting/app/script/lo
ad '${download_dir}/${clients}.log''
2014-06-09T11:08:48-0400 verbose: /default/efl_main/methods/'methods loop wrapper'/default/efl_bug2638/methods/'delta reporting log collecti
on_5'/default/deltarep_client_get/methods/'deltarep'/default/bg_deltarep_get/commands/'/opt/delta_reporting/app/script/load '/var/cfengine/de
lta_reporting/log/client_logs/2001:470:1d:a2f::9.log''[0]: Comment 'Insert data into database'
2014-06-09T11:08:48-0400 verbose: /default/efl_main/me
@neilhwatson
neilhwatson / gist:7a868feafd8f47c6801b
Created July 8, 2014 19:52
router advertisement packages
tcpdump -s0 -n -i eth0 -v 'icmp6 and ((ip6[40+0] == 133) or (ip6[40+0] == 134))'
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
15:45:02.213000 IP6 (hlim 255, next-header ICMPv6 (58) payload length: 56) fe80::1 > ff02::1: [icmp6 sum ok] ICMP6, router advertisement, length 56
hop limit 64, Flags [none], pref medium, router lifetime 1800s, reachable time 0s, retrans time 0s
source link-address option (1), length 8 (1): 64:87:88:ad:f6:81
prefix info option (3), length 32 (4): 2a02:2770:11::/64, Flags [onlink, auto], valid time 2592000s, pref. time 604800s
#
# radvd configuration generated by radvdump 1.8.5
# based on Router Advertisement from fe80::1
# received by interface eth0
#
interface eth0
{
AdvSendAdvert on;
# Note: {Min,Max}RtrAdvInterval cannot be obtained with radvdump
# rdisc6 -1 eth0
Soliciting ff02::2 (ff02::2) on eth0...
Hop limit : 64 ( 0x40)
Stateful address conf. : No
Stateful other conf. : No
Router preference : medium
Router lifetime : 1800 (0x00000708) seconds
Reachable time : unspecified (0x00000000)
Retransmit time : unspecified (0x00000000)
@neilhwatson
neilhwatson / Final log for download
Last active August 29, 2015 14:04
EFL and Delta reporting logs
A script on each client makes a union of the two logs into something ready for the Delta Reporting database.
2014-07-30T15:54:17-0400 ;; linux_x86_64_3_12_1_amd64__1_SMP_Debian_3_12_9_1__2014_02_01_ ;; empty ;; empty ;; empty ;; empty
2014-07-30T15:54:17-0400 ;; net_iface_lo ;; empty ;; empty ;; empty ;; empty
2014-07-30T15:54:17-0400 ;; _usr_share_games_fortunes_taow_handle_efl_copy_files_single_perms_kept ;; efl_copy_files_single_perms ;; empty ;; kept ;; empty
2014-07-30T15:54:17-0400 ;; _stdlib_has_path_sed ;; empty ;; empty ;; empty ;; empty
2014-07-30T15:54:17-0400 ;; _etc_default_slapd_handle_efl_service_files_config_kept ;; efl_service_files_config ;; empty ;; kept ;; empty
2014-07-30T15:54:17-0400 ;; _stdlib_path_exists_crontab ;; empty ;; empty ;; empty ;; empty
2014-07-30T15:54:17-0400 ;; _stdlib_path_exists_ifconfig ;; empty ;; empty ;; empty ;; empty
2014-07-30T15:54:17-0400 ;; mac_00_1e_67_8b_f7_13 ;; empty ;; empty ;; empty ;; empty
semanage simulator:
#!/usr/bin/perl
use strict;
use warnings;
foreach my $line (<DATA>)
{
print $line. "\n";
@neilhwatson
neilhwatson / gist:fae9465229863387f70a
Created September 18, 2014 12:37
Dymanic inputs and bundlesequence without common bundles
newatson@ltipc682:~/.cfagent/inputs$ cat nocommon.cf
body common control
{
bundlesequence => { "first", @{first.bs} };
inputs => { "first.cf", @{first.inputs} };
}
newatson@ltipc682:~/.cfagent/inputs$ cat first.cf
bundle agent first
{
vars: