This file contains hidden or 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
| metrics:/etc/logstash # cat ls-debug | |
| #!/bin/bash | |
| echo "Wait for logstash to start, then paste test lines as needed" | |
| echo "To finish, press ctrl-C , ctrl-D" | |
| /opt/logstash/bin/logstash -f /etc/logstash/debug-conf.d/ -l /var/log/logstash/logstash-debug.log | |
| metrics:/etc/logstash # ls debug-conf.d/ | |
| 00_stdin_input.conf 31_nginx.conf 51_useragent.conf 52_querystring.conf 99_stdout_output.conf | |
| metrics:/etc/logstash # cat debug-conf.d/00_stdin_input.conf |
This file contains hidden or 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
| { | |
| "facets": { | |
| "map": { | |
| "terms": { | |
| "field": "geoip.country_code2.raw", | |
| "size": 100, | |
| "exclude": [] | |
| }, | |
| "facet_filter": { | |
| "fquery": { |
This file contains hidden or 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
| ## | |
| ## Put me in ~/.irssi/scripts, and then execute the following in irssi: | |
| ## | |
| ## /load perl | |
| ## /script load notify | |
| ## | |
| use strict; | |
| use Irssi; | |
| use vars qw($VERSION %IRSSI); |
This file contains hidden or 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
| body common control | |
| { | |
| bundlesequence => { "suicide", "glados" }; | |
| } | |
| body agent control | |
| { | |
| abortclasses => { "diediedie" }; | |
| } |
This file contains hidden or 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
| root@monitor:/etc/nagios3# snmptable -v2c -c COMMUNITY server.example.com dskTable | |
| SNMP table: UCD-SNMP-MIB::dskTable | |
| dskIndex dskPath dskDevice dskMinimum dskMinPercent dskTotal dskAvail dskUsed dskPercent dskPercentNode dskErrorFlag dskErrorMsg | |
| 1 / /dev/vdb -1 10 101573920 81299792 15031252 16 1 noError | |
| 2 /proc proc -1 10 0 0 0 0 100 noError | |
| 3 /sys sysfs -1 10 0 0 0 0 100 noError | |
| 4 /dev/pts devpts -1 10 0 0 0 0 100 noError | |
| 5 /boot /dev/vda1 -1 10 1019208 919724 46876 5 0 noError | |
| 6 |
This file contains hidden or 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
| vars: | |
| "dir" string => "/etc/apache2/modules-enabled"; | |
| "index" slist => getindices("array"); | |
| "cindex[$(index)]" string => canonify("$(index)"); | |
| "files" slist => lsdir("$(dir)", ".*", "false"); | |
| classes: | |
| "should_exist_$(cindex[$(index)])" expression => "any"; | |
| files: | |
| "/$(dir)/$(index)" | |
| create => "true"; |
This file contains hidden or 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
| infra:~ # cf-agent -KI | |
| !! Duplicate selection of value for variable "missing" in scope dead_hosts | |
| !! Rule from /var/cfengine/inputs/actions/update.cf at/before line 38 | |
| !! Duplicate selection of value for variable "missing" in scope dead_hosts | |
| !! Rule from /var/cfengine/inputs/actions/update.cf at/before line 38 | |
| ------------------- | |
| bundle agent dead_hosts { | |
| vars: | |
| "delay" int => "24"; |
This file contains hidden or 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
| infra:~ # cf-agent -KI | |
| !! Duplicate selection of value for variable "missing" in scope dead_hosts | |
| !! Rule from /var/cfengine/inputs/actions/update.cf at/before line 38 | |
| !! Duplicate selection of value for variable "missing" in scope dead_hosts | |
| !! Rule from /var/cfengine/inputs/actions/update.cf at/before line 38 | |
| ------------------- | |
| bundle agent dead_hosts { | |
| vars: | |
| "delay" int => "24"; |
This file contains hidden or 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 | |
| while read oldrev newrev ref | |
| do | |
| branch=`echo $ref | cut -d/ -f3` | |
| if [ "prod" == "$branch" ]; then | |
| git --work-tree=/var/cfengine/masterfiles checkout -f $branch | |
| echo 'Changes pushed live.' | |
| fi |
This file contains hidden or 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
| For starters, you need an AWS account (not really getting into detail here, you only need a valid credit card for that with at least a couple of bucks on it). Make sure you sign on for EC2 and IAM at least. | |
| In the IAM console I added a 'debuild' user, with permissions for everything ec2, made a key and cert for it (TODO: figure out finer-grained permissions, if possible). | |
| Start some Linux instance in the region you want (I operate on eu-west-1, for now). Get root on it. mkdir /root/ec2 , go there. | |
| wget http://s3.amazonaws.com/ec2-downloads/ec2-ami-tools.zip and http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip, unzip both of them. | |
| Download https://github.com/andsens/ec2debian-build-ami/tarball/master, untar it. get the environment script at the end of README.md in a file and edit it. For the private cert and key, get the ones made for the debuild IAM user. AWS_USER_ID is actually the username (for a IAM user). |
NewerOlder