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
### Keybase proof | |
I hereby claim: | |
* I am grepory on github. | |
* I am grepory (https://keybase.io/grepory) on keybase. | |
* I have a public key whose fingerprint is 18E5 DF6A 251A BB85 2482 7990 F272 9497 27A5 2E46 | |
To claim this, I am signing this object: |
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
{ | |
"api": { | |
"dc1": { | |
"host": "server.dc1" | |
}, | |
"dc2": { | |
"host": "server.dc2" | |
} | |
} | |
} |
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
__split () { | |
local arr=$1 | |
local new_ifs=$2 | |
if [ -z $arr ]; then | |
echo "__split must be called with at least one argument" && exit 1 | |
fi | |
if [ ! -z $new_ifs ]; then | |
IFS="$new_ifs" read -ra $arr |
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
We're talking about service orchestration, and that is a thing that is | |
near and dear to my heart. I'd like to introduce you to the semaphore primitive | |
that I want to add to Chef, some chef pseudocode for you and an explanation of | |
how I envision it operating: | |
current_services = node.current_services | |
services = get_services(node.fqdn) | |
services.each do |svc| | |
service_data = get_service_data(svc, node.environment) | |
semaphore_acquire "deploy/#{svc}/#{node.environment}" do |
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
** Reason for termination == | |
** {{case_clause, | |
{{{value, | |
{15825, | |
{publish,<0.1876.1333>, | |
{message_properties,undefined,false}, | |
{basic_message, | |
{resource,<<"/outbound-dev-rabbitmq">>,exchange, | |
<<"outbound.generation.exchange">>}, | |
[<<"outbound.generation.4bcc31a4-557b-46dd-86a5-efbaecc77f7b.EMAIL">>], |
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
deploy 'myservice' do | |
only_if { get_lock('myservice_counter_lock').got_lock? } | |
notify 'ruby_block[increment_myserver_counter]' | |
end | |
ruby_block 'increment_myservice_counter' do | |
action :nothing # this is so that it is only run on notify | |
block do | |
get_counter('myservice_counter').increment | |
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 ruby | |
require 'yaml' | |
results_file = ARGV[-1] | |
results = YAML.load_file(results_file) | |
blocksize = results.first.last['blocksize'] | |
bytes_written = results.first.last['bytes_written'] | |
avg_bytes_per_sec = results.map { |r| Float(r.last['bytes_per_sec']) }.reduce(:+) / results.length |
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 'dns_test/resolver' | |
require 'support/using_dns_server' | |
shared_examples :zone_transfer do |nameserver, zone, operator, quantity| | |
subject { described_class.new(nameserver).transfer(zone) } | |
it 'returns Dnsruby::RRs' do | |
expect(subject).to satisfy { |rr| be_a_kind_of(Dnsruby::RR) } | |
end | |
it "returns #{rr_quantity_comparison} Dnsruby::RRs" do | |
expect(subject.length).to be.send(operator, quantity) |
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
There’s a passage I got memorized. The Devopsekial 25:17. “The path of the | |
righteous devop is beset on allsides by the inequities of the selfish and the | |
tyranny of evil sysadmins. Blessed is he who, in the name of composition and | |
reusability, shepherds the weak through the valley of the world's worst | |
CFEngine 2 code, for he is truly his brother’s keeper and the finder of lost | |
children. And I will strike down upon thee with great frameworks and furious | |
coding those who attempt to poison and destroy My brothers. And you will know I | |
am the Devop when I lay My automation upon you.” | |
Now… I been sayin’ that shit for years. And if you ever heard it, that meant |
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 bash | |
usage() { | |
cat <<HERE | |
$0: Create a shared volume for use with docker and mount it. | |
Options: | |
-v VOLUME_PATH | |
-n VOLUME_NAME |
OlderNewer