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:
| # Place this in your .bashrc | |
| # Covers several corner cases such as nested apostrophes, history extraction in screens/subshells, Slack being down, etc. | |
| # Strings to replace with your own credentials: | |
| ## {your email address} (1 instance) | |
| ## {slack webhook url} (1 instance) | |
| ## {your computer name} (2 instances) | |
| slack() { | |
| # Get slack message when a command exits | |
| # Example usage: python long_job.py; slack |
| require 'aws-sdk-dynamodb' | |
| require 'erb' | |
| DB = Aws::DynamoDB::Client.new | |
| Views = Hash[Dir['views/*'].map {|v| [ File.basename(v, '.html.erb').to_sym, ERB.new(File.read(v)) ] }] | |
| def list(event:, context:) | |
| @rows = DB.scan({ table_name: ENV['TABLE_NAME'] }).result.items | |
| { headers: { 'Content-type' => 'text/html' }, statusCode: 200, body: render { Views[:table].result(binding) } } | |
| end |
| FROM lambci/lambda:build-ruby2.5 | |
| WORKDIR /var/task | |
| CMD bundle install --path vendor/bundle |
| # Ruby on Rails Development Environment | |
| FROM ruby:2.5.0 | |
| # Set up Linux | |
| RUN apt-get update | |
| RUN apt-get install -y build-essential inotify-tools libpq-dev nodejs postgresql-client | |
| WORKDIR /app | |
| EXPOSE 3000 |
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Action": [ | |
| "autoscaling:CompleteLifecycleAction", | |
| "autoscaling:RecordLifecycleActionHeartbeat" | |
| ], | |
| "Effect": "Allow", | |
| "Resource": "*" |
| # A user session class, a simplified mix of the following code samples: | |
| # * https://github.com/blog/1661-modeling-your-app-s-user-session | |
| # * http://www.jonathanleighton.com/articles/2013/revocable-sessions-with-devise/ | |
| class Session < ActiveRecord::Base | |
| # Uncomment if you use Hobo Fields, else add these yourself | |
| # fields do | |
| # session_id :string, :index => true, :unique => true | |
| # accessed_at :datetime | |
| # user_ip :string |
| #!/usr/bin/env ruby | |
| require 'sidekiq' | |
| require 'sidekiq/cli' | |
| # Default to running one process per core | |
| def process_count | |
| return ENV['SK_PROCESS_COUNT'].to_i unless ENV['SK_PROCESS_COUNT'].to_i == 0 | |
| case RbConfig::CONFIG['host_os'] |
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 |