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
(* ocamlopt -g str.cmxa haproxy_error_flags.ml -o haproxy_error_flags *) | |
open Printf | |
let doublehyphen = Str.regexp "--" | |
let flagshash = Hashtbl.create 2000;; | |
(* http://groups.google.com/group/fa.caml/msg/0e938e47479af474 *) | |
let lines fname = | |
let cin = open_in fname in |
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
sudo apt-get install libboost1.40-all-dev libnids-dev libnids1.21 libpcap-dev libpcap0.8 pkg-config libglib2.0-dev libnet1-dev libnet1 | |
./configure | |
make # this will fail | |
cd src | |
g++ -g -O2 -o justniffer main.o formatter.o utilities.o regex.o -L../lib/libnids-1.21/src -lnids2 -lpcap -L/usr/lib -lboost_regex-mt -lboost_program_options-mt -lnet -lglib-2.0 -lgthread-2.0 | |
cd .. | |
make | |
make install |
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
require 'rubygems' | |
require "yajl" | |
require 'em-http' | |
require 'happening' | |
def main | |
EM.run { | |
parser = Yajl::Parser.new | |
parser.on_parse_complete = (Proc.new { |hash| | |
if hash["id"] |
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
#!/usr/bin/ruby | |
# uses rest_client and carrot, seems to quit when no more data is in the stream | |
require 'rubygems' | |
require "yajl/http_stream" | |
require 'rest_client' | |
require 'carrot' | |
def main |
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
#!/usr/bin/ruby | |
# as of 20100101 requires the latest yajl-ruby | |
# http://github.com/brianmario/yajl-ruby | |
require 'rubygems' | |
require "yajl/http_stream" | |
require 'em-http' | |
require 'mq' |
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
require 'ostruct' | |
UFW_SECTIONS = [:ufw_new_resource, :ufw_protocol, :ufw_src_addr, :ufw_src_port, :ufw_dest_addr, :ufw_dest_port] | |
def build_cmd | |
UFW_SECTIONS.collect{ |action| self.send(action)}.join(" ") | |
end | |
def ufw_new_resource | |
"ufw #{new_resource.action}" |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'rest_client' | |
require 'yajl' | |
def run_ops(notifications) | |
url = "http://user:*****@somehost:5984" | |
auth_doc = '{"someuser":["_reader","_writer","_admin"],"someuser1":["_reader","_writer","_admin"]}' | |
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
dir = "." | |
search = "someterm" | |
replace = "replace term" | |
extension = ".cfg" | |
files = Dir.new(dir).entries | |
files.delete(".") | |
files.delete("..") |
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
require 'rubygems' | |
require 'rest_client' | |
require 'json' | |
require 'net/ssh' | |
servers_json = RestClient.get("http://localhost:5984/chef/_design/nodes/_view/ec2_hostnames") | |
servers = JSON.parse(servers_json) | |
servers["rows"].each do |row| | |
Net::SSH.start( |
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
joes-mac-mini:dbcore joe$ ./bin/couchdb | |
sh: line 0: exec: crypto_drv: not found | |
=INFO REPORT==== 11-Nov-2009::09:44:37 === | |
application: crypto | |
exited: {shutdown,{crypto_app,start,[normal,[]]}} | |
type: temporary | |
=INFO REPORT==== 11-Nov-2009::09:44:37 === | |
application: couch |