Skip to content

Instantly share code, notes, and snippets.

View johntdyer's full-sized avatar

John Dyer johntdyer

View GitHub Profile
# 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
# 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
package configReloader
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"os/signal"
"syscall"
#!/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

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:

# 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;

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.

[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]
require 'net/http'
require 'uri'
my_msg = $currentCall.initialText
log '*'*10 + my_msg
res = Net::HTTP.post_form(URI.parse('http://mybadassserver.com/catch';),
{'smsMessage'=>my_msg, 'bar'=>'foo'})
require 'net/http'
require 'uri'
myMSG = $currentCall.initialText
log '*'*10 + myMSG
res = Net::HTTP.post_form(URI.parse('http://myServer.com/catch';),
{'smsMessage'=>myMSG, 'max'=>'50'})