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
gist title |
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
gist title |
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 'mysql2' | |
require 'rbconfig' | |
CONNECT_TIMEOUT = ARGV.empty? ? nil : ARGV.shift.to_i | |
trap("USR2") {} | |
HOST = case RbConfig::CONFIG["host_os"] |
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 'mysql2' | |
trap("USR2") {} | |
pid = fork do | |
loop do | |
client = Mysql2::Client.new | |
client.close |
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
install_package "openssl-1.0.1e" "https://www.openssl.org/source/openssl-1.0.1e.tar.gz#66bf6f10f060d561929de96f9dfe5b8c" mac_openssl --if has_broken_mac_openssl | |
install_git "ruby-2.1.0-github" [email protected]:github/ruby.git 2.1 ldflags_dirs standard verify_openssl |
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 'benchmark' | |
require 'redis' | |
require 'wolverine' | |
ITERATIONS = 200 | |
BATCH_SIZE = 200 | |
PROCESS_COUNT = 8 | |
redis = Redis.new(:host => 'localhost') |
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 'net/http' | |
require 'net/http/persistent' | |
require 'benchmark' | |
class HttpNoTcpDelay < Net::HTTP | |
def on_connect | |
@socket.io.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) | |
nil |
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 | |
# frozen_string_literal: true | |
filename = ARGV.shift | |
class MarshalPrinter | |
TYPE_NIL = '0' | |
TYPE_TRUE = 'T' | |
TYPE_FALSE = 'F' | |
TYPE_FIXNUM = 'i' |
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
#!/bin/sh | |
curl -XDELETE 'http://localhost:9200/foo' | |
curl -XPUT 'http://localhost:9200/foo/?pretty=true' -d ' | |
{ | |
"mappings" : { | |
"bar" : { | |
"properties" : { | |
"title" : { |
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
#!/bin/sh | |
curl -XDELETE localhost:9200/test | |
curl -XPUT 'http://localhost:9200/test/doc/1' -d '{ | |
"message" : "apples oranges" | |
}' | |
curl -XPUT 'http://localhost:9200/test/doc/2' -d '{ | |
"message" : "apples" |
NewerOlder