This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brad@beta $ \cat t.yaml | |
{ | |
# Set the country | |
"country": "NO", | |
} | |
brad@beta $ python3 -c 'import yaml ; y=open("t.yaml","r") ; x=yaml.safe_load(y) ; print(yaml.dump(x))' | |
country: 'NO' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using the PurePerl implementation written by the author of the YAML Spec | |
brad@beta $ perl -MYAML -MDDP -E'my $y = "country: NO"; my $x = YAML::Load($y); p($x)' | |
{ | |
country "NO" | |
} | |
brad@beta $ perl -MYAML -MDDP -E'my $y = "date: 0000-00-00"; my $x = YAML::Load($y); p($x)' | |
{ | |
date "0000-00-00" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PLAY [localhost] *************************************************************************************************************************** | |
TASK [Gathering Facts] ********************************************************************************************************************* | |
ok: [localhost] | |
TASK [Running for first] ******************************************************************************************************************* | |
TASK [bar : debug] ************************************************************************************************************************* | |
ok: [localhost] => { | |
"msg": "var_bar is second" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: "Set a global variable mid-playbook run" | |
run_once: true | |
set_fact: | |
"{{ global_name }}": "{{ global_value }}" | |
delegate_to: "{{ _all__hostname }}" | |
loop: "{{ groups['all'] }}" | |
loop_control: | |
loop_var: "_all__hostname" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install perlbrew | |
curl -L https://install.perlbrew.pl | bash | |
# Setup perlbrew | |
perlbrew install -j8 -n 5.30.0 | |
perlbrew switch 5.30.0 | |
perlbrew install-cpanm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
host: localhost | |
port: 9200 | |
base: syslog | |
days: 1 | |
meta: | |
access: | |
timestamp: timestamp | |
ossec: | |
timestamp: ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
host: localhost | |
port: 9200 | |
base: syslog | |
days: 1 | |
timestamp: '@timestamp' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brad@janus $ es-search.pl --top program error | |
= Querying Indexes: syslog-2016.11.20 | |
count program | |
487 sshd | |
33 postfix/smtpd | |
24 postfix/smtps/smtpd | |
1 freshclam | |
# Search Parameters: | |
# {"bool":{"must":[{"query_string":{"query":"error"}}]}} | |
# Displaying 4 of 545 in 0 seconds. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
udp { | |
host => "127.0.0.1" | |
port => 9514 | |
type => "syslog" | |
} | |
} | |
filter { | |
# This grok FAILS with a PARSE ERROR | |
grok { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# puppet module install zleslie-unbound | |
class dns::caching { | |
# I'm using extlookup for a very small personal network, could be hiera | |
$trusted_ipv4 = extlookup('trusted_ipv4') | |
$trusted_ipv6 = extlookup('trusted_ipv6') | |
realize(Group['unbound']) | |
realize(User['unbound']) | |
$local_ad_servers = "/etc/unbound/local.d/adservers.conf" |
NewerOlder