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/env ruby | |
require 'open-uri' | |
require 'mysql2' | |
#for vmta in mailgate actions newsletters backqueue invitations wish-solicitations action-updates transactions; do for mta in pmta01 pmta03; do for domain in aol yahoo gmail hotmail comcast bellsouth att sbcglobal; do echo -n "&target="; cat tpl | sed -e "s/%VMTA%/$vmta/g" -e "s/%MTA%/$mta/g" -e "s/%DOMAIN%/$domain/g" -e '/\n/d' | while read line ; do echo -n "$line";done ;done; done; echo '&colorList=A4A4A4%2CFFFFFF%2C5858FA%2C08088A%2C088A08%2C58FA58%2CB40404%2CF78181&lineMode=connected&minXStep=10&from=-7days&width=1600&height=800';done > /tmp/render | |
#alias(divideSeries(transformNull(email.%MTA%.%VMTA%.%DOMAIN%.delivered,1),sumSeries(email.%MTA%.%VMTA%.%DOMAIN%.bounced,transformNull(email.%MTA%.%VMTA%.%DOMAIN%.delivered,1))),\\\"%DOMAIN%\\\") | |
mysql2 = Mysql2::Client.new( | |
:host => 'sfdb01.prod.causes.com', | |
:username => 'graphite', |
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
class ProxyMail | |
def initialize(contents) | |
# The mail gem is implemented using STDERR.puts for all warnings | |
# We want to suppress warnings of the format: | |
# WARNING: Could not parse (and so ignorning) 'Your message:' | |
@stderr = $stderr.clone | |
silence_warnings do | |
@mail = Mail.new(contents) | |
end | |
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/env python | |
import struct | |
from collections import defaultdict | |
# mysql -Ne "select si.space, CONCAT(st.SCHEMA,'.', st.NAME, '/', si.name) from INNODB_SYS_INDEXES si, INNODB_SYS_TABLES st where st.TABLE_ID=si.TABLE_ID" information_schema > map | |
def read_map(map_file = './map'): | |
with open(map_file, 'r') as fd: | |
return dict((int(k), v) for k, v in [line.strip().split() for line in fd.readlines()]) | |
def read_lru(lru_file = './ib_lru_dump'): |
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/env ruby | |
# | |
require 'active_support/core_ext' | |
require 'benchmark' | |
class FooException < StandardError; end | |
def fun(depth = 0) | |
if depth == 150 |
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/env python | |
# originally from git@github.com:dlrust/python-memcached-stats.git | |
import re, telnetlib, sys, time, math | |
import cStringIO as StringIO | |
from collections import defaultdict | |
class Transforms: | |
_transforms = [ | |
(re.compile(ur'[_/](\d+)[_/]?'), '_?_'), | |
(re.compile(ur':([a-f0-9]{32})$'), ':?'), |
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
[root@sfdb32 ~]# pmp | |
1051 read,??,my_net_read,do_command(THD*),do_handle_one_connection(THD*),handle_one_connection,start_thread,clone | |
96 pthread_cond_wait@@GLIBC_2.3.2,Query_cache::lock(),Query_cache::invalidate_table(THD*,,Query_cache::invalidate_table(THD*,,Query_cache::invalidate(THD*,,mysql_update(THD*,,mysql_execute_command(THD*),mysql_parse(THD*,,dispatch_command(enum_server_command,,do_handle_one_connection(THD*),handle_one_connection,start_thread,clone | |
36 ??,??,??,??,start_thread,clone | |
12 pthread_cond_wait@@GLIBC_2.3.2,Query_cache::lock(),Query_cache::invalidate_table(THD*,,Query_cache::invalidate_table(THD*,,Query_cache::invalidate(THD*,,mysql_insert(THD*,,mysql_execute_command(THD*),mysql_parse(THD*,,dispatch_command(enum_server_command,,do_handle_one_connection(THD*),handle_one_connection,start_thread,clone | |
12 pthread_cond_wait@@GLIBC_2.3.2,??,??,??,??,??,??,??,??,??,??,handler::ha_write_row(unsigned,write_record(THD*,,mysql_insert(THD*,,mysql_execute_command(THD*),mysql_par |
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
<?xml version='1.0' encoding='UTF-8'?> | |
<maven2-moduleset plugin="maven-plugin@1.530"> | |
<actions/> | |
<description>titan snapshot</description> | |
<keepDependencies>false</keepDependencies> | |
<properties> | |
<hudson.model.ParametersDefinitionProperty> | |
<parameterDefinitions> | |
<hudson.model.TextParameterDefinition> | |
<name>TITAN_VERSION</name> |
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
rpm -Uvh http://archive.cloudera.com/cdh4/one-click-install/redhat/6/x86_64/cloudera-cdh-4-0.x86_64.rpm | |
yum -y install hadoop-0.20-conf-pseudo hbase hbase-regionserver hbase-master | |
sudo -u hdfs hdfs namenode -format | |
for x in `cd /etc/init.d ; ls hadoop-hdfs-*` ; do sudo service $x start ; done | |
sudo -u hdfs hadoop fs -mkdir /tmp | |
sudo -u hdfs hadoop fs -chmod -R 1777 /tmp | |
sudo -u hdfs hadoop fs -mkdir -p /var/lib/hadoop-hdfs/cache/mapred/mapred/staging | |
sudo -u hdfs hadoop fs -chmod 1777 /var/lib/hadoop-hdfs/cache/mapred/mapred/staging | |
sudo -u hdfs hadoop fs -chown -R mapred /var/lib/hadoop-hdfs/cache/mapred | |
for x in `cd /etc/init.d ; ls hadoop-0.20-mapreduce-*` ; do sudo service $x start ; done |
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 'csv' | |
DEFAULT_ATTRS = %w[ | |
network.interfaces.eth0.addresses | |
network.interfaces.eth0.addresses | |
] | |
DEFAULT_QUERY = 'role:base' | |
DEFAULT_FILTER = Proc.new do |addresses| | |
ipa = addresses.select { |address, config| config[:family] == 'inet' }.keys | |
ipa.size == 1 ? ipa.first : ipa | |
end |
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
class Foo | |
def baz | |
'The original class is noisy' | |
raise 'Noise' | |
end | |
end | |
module MonkeyPatch | |
def self.extended(obj) | |
[ :baz ].each do |meth| |
OlderNewer