I hereby claim:
- I am stympy on github.
- I am ben_curtis (https://keybase.io/ben_curtis) on keybase.
- I have a public key whose fingerprint is FC63 ED9F FA43 9CD2 F58C 578C 3DDD 5CC4 C993 CF11
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
begin | |
es3 = Aws::S3::Encryption::Client.new(kms_key_id: ENV['KMS_KEY_ID']) | |
YAML.load(es3.get_object(bucket: "yourbucket", key: "secrets.yml").body.read).each do |k, v| | |
ENV[k] ||= v # Don't override local ENV settings | |
end | |
rescue ArgumentError | |
# Raised when no KMS_KEY_ID was found in ENV, so there's nothing to do | |
rescue Aws::S3::Errors::NoSuchKey | |
# No secrets file was found, so there's nothing to do | |
end |
#!/usr/bin/bash | |
# We're only processing one solr collection named notices | |
for x in `seq 1 8`; do | |
curl "http://localhost:8983/solr/admin/cores?action=UNLOAD&core=notices_shard${x}_replica3 | |
rm -rf /var/lib/solr/data/notices_shard${x}_replica3/* | |
mkdir -p /var/lib/solr/data/notices_shard${x}_replica3/data |
A little background on my context:
We run multiple Solr JVMs per box, which live in directories like:
/mnt/solr_8983
/mnt/solr_8984
/mnt/solr_8985
...
/mnt/solr_${PORT}
CREATE KEYSPACE IF NOT EXISTS docstore WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; | |
CREATE TABLE IF NOT EXISTS docstore.metadata ( | |
userid text, | |
docid text, | |
joinkey text, | |
title text, | |
body text, | |
PRIMARY KEY(userid, docid)); |
#!/usr/bin/env ruby | |
require 'helpscout' | |
require 'fileutils' | |
api_key = ARGV[0] | |
helpscout = HelpScout::Client.new(api_key) | |
helpscout.mailboxes.each do |box| | |
FileUtils.mkdir(box.name) unless File.exists?(box.name) | |
puts "Fetching #{helpscout.conversation_count(box.id, 'all', nil)} conversations for #{box.name}" |
for x in `git diff --name-only master..head -- db/migrate | cut -d/ -f3 | cut -d_ -f1`; do rake db:migrate:down VERSION=$x; done |
{ | |
"notifier":{ | |
"name":"Honeybadger Notifier", | |
"url":"https://github.com/honeybadger-io/honeybadger-ruby", | |
"version":"1.0.0" | |
}, | |
"error":{ | |
"class":"RuntimeError", | |
"message":"RuntimeError: This is a runtime error, generated by the crywolf app at 2012-09-26 17:25:24 -0700", | |
"tags":["wubba"], |
class UsersController < ApplicationController | |
before_action :restrict_access, only: [ :new ] | |
protected | |
def restrict_access | |
if request.remote_ip != '127.0.0.1' | |
Honeybadger.notify( | |
error_class: "AccessError", | |
error_message: "Denied non-local access to users/new" |
#!/usr/bin/env ruby | |
require 'httparty' | |
require 'json' | |
class IDoneThis | |
include HTTParty | |
base_uri "https://idonethis.com/api/v0.0" | |
def initialize(token = ENV['IDONETHIS_API_KEY']) |