Skip to content

Instantly share code, notes, and snippets.

command "bash -c \"pkill -f svlogd -P $(pgrep -f \'runsv #{params[:name]}\')\""
---- Begin output of bash -c "pkill -f svlogd -P $(pgrep -f 'runsv fst-statsd')" ----
STDOUT:
STDERR: bash: line 1: 26340: command not found
---- End output of bash -c "pkill -f svlogd -P $(pgrep -f 'runsv fst-statsd')" ----
Ran bash -c "pkill -f svlogd -P $(pgrep -f 'runsv fst-statsd')" returned 127
@macros
macros / gist:1695881
Created January 28, 2012 21:54
chef-client --collect_only
diff --git a/chef/lib/chef/application/client.rb b/chef/lib/chef/application/client.rb
index 1c60ffb..706cf83 100644
--- a/chef/lib/chef/application/client.rb
+++ b/chef/lib/chef/application/client.rb
@@ -142,6 +142,12 @@ class Chef::Application::Client < Chef::Application
:proc => lambda {|v| puts "Chef: #{::Chef::VERSION}"},
:exit => 0
+ option :collect_only,
+ :short => "-C",
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await svctm %util
sda 0.00 0.10 0.10 0.20 0.01 0.00 50.67 0.00 4.00 4.00 0.12
sdb 0.00 0.00 0.20 0.00 0.00 0.00 8.00 1.99 27124.00 5000.00 100.00
md1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
@macros
macros / process_docs
Created June 23, 2011 22:23
fetch_from_index
sub fetch_from_index {
my $rows = 10000;
my $offset = 0;
my $size = 0;
do {
my ($j, $docs);
my $req = HTTP::Request->new(GET => "http://10.8.2.16:8983/solr/select?");
$req->url->query_form("q"=>'url:wikiaphone',
"fl"=>"title,host",
"wt"=>"json","rows"=>"$rows","start"=>"$offset");
@macros
macros / 24 drive hardware raid6
Created April 22, 2011 10:37
48 drive x-25m tests
oot@file-s4:/mnt# tiobench --size 196608 --threads 1 --threads 4 --threads 16 --threads 64 --random 20000
Run #1: /usr/bin/tiotest -t 64 -f 3072 -r 312 -b 4096 -d . -T-TT
Unit information
================
File size = megabytes
Blk Size = bytes
Rate = megabytes per second
CPU% = percentage of CPU used during the test
Latency = milliseconds
@macros
macros / gist:914288
Created April 11, 2011 20:42
First 300GB intel 320 ssd test
root@varnish-s1:/var/lib/varnish/sdd# tiobench --size 98304 --threads 1 --threads 4 --threads 8
Run #1: /usr/bin/tiotest -t 8 -f 12288 -r 500 -b 4096 -d . -TT
Unit information
================
File size = megabytes
Blk Size = bytes
Rate = megabytes per second
CPU% = percentage of CPU used during the test
Latency = milliseconds
Node 0, zone DMA
pages free 3916
min 2
low 2
high 3
scanned 0
spanned 4080
present 3923
nr_free_pages 3916
nr_inactive_anon 0
Run #1: /usr/bin/tiotest -t 8 -f 6125 -r 500 -b 4096 -d . -T
Unit information
================
File size = megabytes
Blk Size = bytes
Rate = megabytes per second
CPU% = percentage of CPU used during the test
Latency = milliseconds
Lat% = percent of requests that took longer than X seconds
def get_ifs_and_addrs
interfaces = {}
curr_inf = ""
IO.popen("ip a").each do |line|
if line =~ /^\d+?: (.*):/
interfaces[$1] = Array.new
curr_inf = $1
end
if line =~ /\s+inet\s(.*)\//
interfaces[curr_inf] << $1
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/http.rb:2103:in `error!': 500 "Internal Server Error" (Net::HTTPFatalError)
from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/chef-0.9.6/bin/../lib/chef/rest.rb:253:in `streaming_request'
from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/chef-0.9.6/bin/../lib/chef/rest.rb:268:in `retriable_rest_request'
from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/chef-0.9.6/bin/../lib/chef/rest.rb:231:in `streaming_request'
from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/chef-0.9.6/bin/../lib/chef/rest.rb:99:in `get_rest'
from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/chef-0.9.6/bin/../lib/chef/client.rb:277:in `sync_cookbook_file_cache'
from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/chef-0.9.6/bin/../lib/chef/client.rb:258:in `each'
from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/chef-0.9.6/bin/../lib/chef/client.rb:258:in `sync_cookbook_file_cache'
from /opt/r