Skip to content

Instantly share code, notes, and snippets.

Omer Hasan omerhasan

View GitHub Profile
@omerhasan
omerhasan / analyze_haproxy_performance.pl
Created Jun 27, 2012 — forked from kamermans/analyze_haproxy_performance.pl
HAProxy log analyzer to show response latency distribution from the console
View analyze_haproxy_performance.pl
#!/usr/bin/perl
# HAProxy Performance Statistics
# by Steve Kamerman
#
# To use, pipe your HAProxy log with timing information (like "0/0/1/1/3 200") to
# this script. It will output min, max, med, avg and a latency distribution graph.
#
# Info on timing logging in HAProxy: http://code.google.com/p/haproxy-docs/wiki/TimingEvents
#
@omerhasan
omerhasan / ebs_raid.rb
Created May 22, 2012 — forked from tnine/ebs_raid.rb
Ebs raid mounting. Links to this jira issue http://tickets.opscode.com/browse/CHEF-2275
View ebs_raid.rb
include Opscode::Aws::Ec2
#Auto locates and attached ebs devices based on the data bag they reside in. The following test cases need to be performed
# Create multiple resources with new node: PASS
#
# Re-attach multiple resources after a reboot: PASS
#
# Create resources across 2 runs. First run creates first raid set, second run re-attaches then creates: PASS
#
@omerhasan
omerhasan / dhcpd.conf
Created Apr 16, 2012 — forked from tomoconnor/dhcpd.conf
snippet to show usage of dhcp-event (don't forget to set apparmor to allowing (complain) mode)
View dhcpd.conf
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.100 192.168.0.200;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
on commit {
set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
log(concat("Commit: IP: ", ClientIP, " Mac: ", ClientMac, "Hostname: ", host-decl-name));
execute("/usr/local/bin/dhcp-event", "commit", ClientIP, ClientMac, host-decl-name);
}
@omerhasan
omerhasan / pagerduty_munin.py
Created Oct 3, 2011 — forked from samuel/pagerduty_munin.py
PagerDuty script for Munin
View pagerduty_munin.py
#!/usr/bin/env python
try:
import json
except ImportError:
import simplejson as json
import sys
from pagerduty import PagerDuty
def parse(txt):
You can’t perform that action at this time.