Skip to content

Instantly share code, notes, and snippets.

[2014-02-06 16:35:21.000574] IRC::jdyer::freenode == Timeout()
[2014-02-06 16:35:21.000674] (jdyer/freenode) ZNC -> CLI [:*status!znc@znc.in PRIVMSG dyer :IRC connection timed out. Reconnecting...]
[2014-02-06 16:35:21.000882] Connecting user/network [jdyer/freenode]
[2014-02-06 16:35:21.000921] TDNS: initiating resolving of [irc.freenode.net] and bindhost []
[2014-02-06 16:35:21.001249] ConnectQueueTimer done
[2014-02-06 16:35:21.001969] TDNS: IRC::jdyer::freenode, connecting to [84.240.3.129] using bindhost []
[2014-02-06 16:35:28.669975] (jdyer/freenode) CLI -> ZNC [PRIVMSG *status :setbindhost 0.0.0.0]
[2014-02-06 16:35:28.670147] (jdyer/freenode) ZNC -> CLI [:*status!znc@znc.in PRIVMSG dyer :Set bind host for network [freenode] to [0.0.0.0]]
[2014-02-06 16:35:31.352113] (jdyer/freenode) CLI -> ZNC [ISON *status]
[2014-02-06 16:35:31.352209] (jdyer/freenode) ZNC -> IRC [ISON *status]

logstash queries graphed with graphite.

Operation: Decouple whisper from graphite.

Method: Create a graphite function that does a date histogram facet query against elasticsearch for a given query string for the time period viewed in the current graph.

Reason: graphite has some awesome math functions. Wouldn't it be cool if we could use those on logstash results?

The screenshot below is using logstash to watch the twitter stream of keywords "iphone" "apple" and "samsung" - then I graph them each, so we get an idea of popularity. As a bonus, I also do a movingAverage() on the iphone curve to show you why this is awesome.

# example location parts of nginx.conf
# add your own AWS keys, server lines etc, and set your aws domains, paths
http {
# you will need the luacrypto in the cpath, download from http://luacrypto.luaforge.net/
lua_package_cpath "/home/justin/lua/luacrypto-0.2.0/src/l?.so.0.2.0;;";
server {
listen 80;

Keybase proof

I hereby claim:

  • I am johntdyer on github.
  • I am johntdyer (https://keybase.io/johntdyer) on keybase.
  • I have a public key whose fingerprint is AA33 3137 9FD5 2A0E 7406 3996 0AD7 41BB 1CE4 3748

To claim this, I am signing this object:

#!/usr/bin/env ruby
#
# Sensu Logstash Handler
#
# Heavily inspried (er, copied from) the GELF Handler writeen by
# Joe Miller.
#
# Designed to take sensu events, transform them into logstah JSON events
# and ship them to a redis server for logstash to index. This also
# generates a tag with either 'sensu-ALERT' or 'sensu-RECOVERY' so that
package configReloader
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"os/signal"
"syscall"
# jdyer at MacBook-Pro.local in ~/Projects/consul [15:48:45]
$ dig @localhost -p 8600 _sip._udp.service.consul srv
; <<>> DiG 9.10.0-P2 <<>> @localhost -p 8600 _sip._udp.service.consul srv
; (3 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 5926
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
# jdyer at MacBook-Pro.local in ~/Projects/consul [15:56:56]
$ dig @localhost -p 8600 _sip._udp.service.consul srv
; <<>> DiG 9.10.0-P2 <<>> @localhost -p 8600 _sip._udp.service.consul srv
; (3 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55514
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available
@johntdyer
johntdyer / com.tropo.sensu.plist
Created October 1, 2014 12:12
com.tropo.sensu.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd>
<plist version="1.0">
<dict>
<key>Label</key><string>com.tropo.sensu</string>
<key>ProgramArguments</key>
<array>
<string>/var/root/.rvm/bin/launchctl_sensu-client</string>
<string>-c/var/root/etc/sensu/config.json</string>
<string>-d/var/root/etc/sensu/conf.d/</string>
@johntdyer
johntdyer / support_data_collector.sh
Created October 1, 2014 17:59
support_data_collector
#!/bin/bash
# create working dir
mkdir /tmp/report
# archive some basic files
for h in /proc/cpuinfo /etc/redhat-release /opt/voxeo/prism/conf/version.xml /opt/voxeo/prism/conf/capacity.json; do
cat h > /tmp/report/$h.report
done