Skip to content

Instantly share code, notes, and snippets.

View rrichards's full-sized avatar
💭
Rocking the CLI

Ryan Richards rrichards

💭
Rocking the CLI
  • R3 Technologies, Inc.
  • Edmond, OK
  • 07:43 (UTC -12:00)
  • X @rrichards
View GitHub Profile
@rrichards
rrichards / puma.rb
Created September 18, 2016 14:01 — forked from jtadeulopes/puma.rb
Puma config
#!/usr/bin/env puma
threads 0, 4
# workers 3
bind "unix:///var/tmp/project.sock"
pidfile "/var/run/puma/project.pid"
environment "production"
stdout_redirect "/var/log/puma/project.log"
@rrichards
rrichards / project.conf
Created September 18, 2016 13:59 — forked from jtadeulopes/project.conf
Puma upstart
description "project server config"
pre-start script
mkdir -p /var/log/puma
chown deploy. /var/log/puma
mkdir -p /var/run/puma
chown deploy. /var/run/puma
end script
@rrichards
rrichards / Import Instapaper CSV.applescript
Created September 4, 2016 01:16 — forked from annard/Import Instapaper CSV.applescript
Import Instapaper articles (exported as CSV from their site) using Numbers into DEVONthink Pro (Office). The web pages will be imported as PDF documents. The folder structure of Instapaper will be replicated in an "Instapaper" top level group for the currently open database.
-- Use Instapaper to export a CSV file of your articles.
-- Must have Numbers to open it in.
-- Will create PDF documents in /Instapaper/<your folder in Instapaper> groups.
-- Be sure to select an open database in DT Pro before you run this.
--
-- Created by Annard Brouwer, 24/08/2014
--
-- This program is free software released "as-is"; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
-- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-- Get a copy of the GNU General Public License by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@rrichards
rrichards / config.ru
Created September 2, 2016 02:45 — forked from snapper/config.ru
A sample config.ru file
# 301 rewrite!
require 'rack/rewrite'
use Rack::Rewrite do
r301 %r{.*}, 'http://somedomain.com$&', :if => Proc.new {|rack_env|
rack_env['SERVER_NAME'] != 'somedomain.com'
}
end
# Attribution goes to https://github.com/rack/rack-contrib/blob/master/lib/rack/contrib/try_static.rb
@rrichards
rrichards / slack.sh
Created August 26, 2016 19:55 — forked from zdk/slack.sh
Simple and stupid, Nagios command for Slack.
#!/bin/bash
WEBHOST_NAGIOS="<Host that nagios is runing on>"
SLACK_CHANNEL="#<Channel name>"
SLACK_BOTNAME="<Bot Name>"
WEBHOOK_URL="<Webhook URL>" #Get it from Slack Incoming WebHooks setup instruction
#Set the message icon based on Nagios service state
if [ "$NAGIOS_SERVICESTATE" = "OK" ]
then
@rrichards
rrichards / gist:0fb711e8cd5a2674cb1ab9c5fb8a6233
Created August 14, 2016 03:59 — forked from simonmorley/gist:19f9c9b1142d43b2e278
Google Compute Engine Snapshot Create and Rotate in Ruby
#!/bin/ruby
require 'json'
require 'time'
class Snapshot
def initialize()
@format = 'json'
@zone = get_zone
@hostname = hostname
@rrichards
rrichards / README.md
Created July 11, 2016 06:11 — forked from jxson/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

@rrichards
rrichards / 1_Dockerised_JMeter.md
Created June 25, 2016 00:43 — forked from hhcordero/1_Dockerised_JMeter.md
Dockerized JMeter - A Distributed Load Testing Workflow
@rrichards
rrichards / Gemfile
Created May 24, 2016 02:11
Minimal sinatra app with puma's config.
source "https://rubygems.org"
gem 'puma'
gem 'sinatra'
@rrichards
rrichards / Dockerfile
Created May 22, 2016 03:59 — forked from yefim/Dockerrun.aws.json
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
# Example Dockerfile
FROM hello-world