Skip to content

Instantly share code, notes, and snippets.

View imbriaco's full-sized avatar

Mark Imbriaco imbriaco

View GitHub Profile
Fetching statistics...
Statistics for devices...
device host files status
---------- ----------- ---------- ----------
dev1 mogilefs-01 30 alive
dev2 mogilefs-02 37 alive
dev3 mogilefs-03 33 alive
---------- ----------- ---------- ----------
irb(main):009:0> Integrity::Notifier.register(Integrity::Notifier::Campfire)
ArgumentError: Unknown property 'register'
from /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.10/lib/dm-core/model.rb:479:in `method_missing'
from (irb):9
ruby timeout:
user system total real
push_head(10_000) 0.550000 0.350000 0.900000 ( 1.701019)
pop_head(10_000) 0.530000 0.320000 0.850000 ( 1.655060)
push_tail(10_000) 0.580000 0.330000 0.910000 ( 1.715845)
pop_tail(10_000) 0.580000 0.320000 0.900000 ( 1.736500)
incr(10_000) 0.540000 0.300000 0.840000 ( 1.655069)
decr(10_000) 0.570000 0.310000 0.880000 ( 1.762211)
set_add(10_000) 0.560000 0.310000 0.870000 ( 1.733475)
execute "modprobe" do
command "/sbin/depmod -a"
action :run
only_if do
File.exist?("/lib/modules/#{@node[:kernel][:release]}/extra/kvm.ko") &&
( File.mtime("/lib/modules/#{@node[:kernel][:release]}/extra/kvm.ko") >
File.mtime("/lib/modules/#{@node[:kernel][:release]}/modules.dep") )
end
end
desc "Do rolling restarts of the Mongrel servers in pairs, at 90s intervals."
task :rolling do
servers = []
roles[:app].each do |server|
next unless server.options.fetch(:listener, true)
servers << [] if servers.first.nil? || servers.last.length > 1
servers.last << server.host
end
public static void main (String args[])
{
//Build the command line options
Options options = addCommandLineOptions ();
if (args.length <= 0)
printHelp (options);
CommandLineParser parser = new GnuParser();
try
private static Options addCommandLineOptions ()
{
Option help = new Option( "help", "print this message" );
Option folder = OptionBuilder.withArgName("folder")
.hasArg (true)
.withDescription ("Name of folder to upload. Only top level objects that are not folders will be uploaded.")
.create ("folder");
Option file = OptionBuilder.withArgName("file")
#!/usr/bin/env CLASSPATH=".:./lib/rabbitmq-client.jar:./lib/commons-io-1.2.jar:./commons-cli-1.2.jar" jruby --server
require 'benchmark'
require 'java'
module RabbitMQ
module RabbitMQ::Client
include_package "com.rabbitmq.client"
end
end
#!/usr/bin/env python
import cloudfiles
from threading import Thread
conn = cloudfiles.get_connection('xxx', 'yyy')
container = conn.get_container('zzz')
def upload_file(num):
file = container.create_object('test.512m.' + str(num))
#!/usr/bin/env jruby
require 'benchmark'
require 'java'
module RabbitMQ
module RabbitMQ::Client
include_package "com.rabbitmq.client"
end
end