Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ncharles on github.
  • I am nico_charles (https://keybase.io/nico_charles) on keybase.
  • I have a public key ASAzJIrB0xuIbw2w0moyhBBCHxrecDPy0hbQ9pS-jd92YAo

To claim this, I am signing this object:

rudder verbose: 192.168.180.86> MD5=b4874b3958831703032557a50127dfad: Client is TRUSTED, public key MATCHES stored one.
rudder verbose: 192.168.180.86> Received: STAT /var/rudder/configuration-repository/shared-files/hooks.d/file.*.template
rudder info: 192.168.180.86> Failed to canonicalise filename '/var/rudder/configuration-repository/shared-files/hooks.d/file.*.template' (realpath: No such file or directory)
rudder verbose: 192.168.180.86> REFUSAL to user='root' of request: SYNCH 1544202474 STAT /var/rudder/configuration-repository/shared-files/hooks.d/file.*.template
# ls -al /var/rudder/configuration-repository/shared-files/hooks.d/
total 20
drwxr-xr-x 2 root root 4096 7 déc. 17:56 .
drwxr-xr-x 10 root rudder 4096 7 déc. 17:55 ..
with files
/tmp/file.1.template, /tmp/file.2.template, /tmp/file.3.template
bundle agent test
{
methods:
"test" usebundle => file_from_template("/tmp/file..*.template", "/tmp/file.${match.1}");
}
bundle agent file_from_template(source_template, destination)
rudder verbose: B: BEGIN bundle sharedfile_to_node( {"root","test","/tmp/baz","90d"})
rudder verbose: B: *****************************************************************
rudder verbose: V: + Private parameter: 'target_uuid' in scope 'sharedfile_to_node' (type: s) in pass 1
rudder verbose: V: + Private parameter: 'file_id' in scope 'sharedfile_to_node' (type: s) in pass 1
rudder verbose: V: + Private parameter: 'file_path' in scope 'sharedfile_to_node' (type: s) in pass 1
rudder verbose: V: + Private parameter: 'ttl' in scope 'sharedfile_to_node' (type: s) in pass 1
rudder verbose: Skipping promise 'hash' because 'if'/'ifvarclass' is not defined
rudder verbose: execresult ran 'echo 90d | sed 's/ /+/g'' successfully
rudder verbose: Caching result for function 'execresult("echo ${ttl} | sed 's/ /+/g'","useshell")'
rudder verbose: V: .........................................................
context = {
"entry": [
{
"name": "default",
"type": "bundle"
},
{
"promise_type": "methods",
"promiser": "any",
"type": "promise"
@ncharles
ncharles / gist:f6329f01d4840a19efc0
Created October 14, 2014 09:24
Detect index usage
SELECT
t.tablename,
indexname,
c.reltuples AS num_rows,
pg_size_pretty(pg_relation_size(quote_ident(t.tablename)::text)) AS table_size,
pg_size_pretty(pg_relation_size(quote_ident(indexrelname)::text)) AS index_size,
CASE WHEN indisunique THEN 'Y'
ELSE 'N'
END AS UNIQUE,
idx_scan AS number_of_scans,
body common control {
bundlesequence => { "interface" };
}
bundle agent interface {
vars:
"interfaces" slist => getindices("sys.ipv4");
reports:
cfengine::
vars:
"value" slist =>
{
"one",
"two",
"three"
};
bundle agent example
{
type:
"promiser"
attribute => "value1";
class::
"promiser2"
attribute2 => "value2";
}
bundle common control
{
bundlesequence => { "exemple" };
}