Skip to content

Instantly share code, notes, and snippets.

View Davidsoff's full-sized avatar
🦄

David Soff Davidsoff

🦄
View GitHub Profile
@Davidsoff
Davidsoff / wampInit.js
Last active August 29, 2015 14:20
ding
var autobahn = require("autobahn");
module.exports = new autobahn.Connection({
url: "ws://188.226.208.149:3000/",
realm: "realm"
});
@Davidsoff
Davidsoff / cloud_front.rb
Created April 24, 2018 12:32
cloud_frond request log analyser for IP frequency
class CloudFront < RequestLogAnalyzer::FileFormat::Base
extend RequestLogAnalyzer::FileFormat::CommonRegularExpressions
line_definition :access do |line|
line.header = true
line.footer = true
line.regexp = /^(#{timestamp('%Y-%m-%d %H:%M:%S')})\s(\w+)\s(\d+)\s(#{ip_address})\s(\w+)\s(\S+)\s(\S+)\s(\d+)\s(\S+)\s(\S+)\s(\S+)\s(\S+)\s(\w+)\s(\S+)\s(\S+)\s(\w+)\s(\d+)\s(\S+)\s(#{ip_address}|-)\s+(\S+)\s(\S+)\s(\w+)\s(\S+)/
line.capture(:timestamp).as(:timestamp)