Skip to content

Instantly share code, notes, and snippets.

View mathie's full-sized avatar

Graeme Mathieson mathie

View GitHub Profile
@mathie
mathie / puma.rb
Created June 5, 2016 08:03
Puma configuration
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum, this matches the default thread size of Active Record.
#
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
threads threads_count, threads_count
# Specifies the `port` that Puma will listen on to receive requests, default is 3000.
@mathie
mathie / foreman.log
Created June 3, 2016 16:36
Puma log output on a vanilla-ish Rails 5.rc3
> foreman start Personal/amazon_link 2.3.1 master@c244df1
17:34:43 web.1 | started with pid 75366
17:34:43 web.1 | [75366] Puma starting in cluster mode...
17:34:43 web.1 | [75366] * Version 3.4.0 (ruby 2.3.1-p112), codename: Owl Bowl Brawl
17:34:43 web.1 | [75366] * Min threads: 5, max threads: 5
17:34:43 web.1 | [75366] * Environment: development
17:34:43 web.1 | [75366] * Process workers: 2
17:34:43 web.1 | [75366] * Preloading application
17:34:45 web.1 | [75366] * Listening on tcp://0.0.0.0:5000
17:34:45 web.1 | [75366] ! WARNING: Detected 25 Thread(s) started in app boot:
> bundle exec middleman build
create build/stylesheets/site.css
create build/javascripts/all.js
create build/images/middleman-logo.svg
create build/index.html
Project built successfully.
> cd the-internet.io
> git init
Initialized empty Git repository in /Users/mathie/Development/Personal/the-internet.io/.git/
> git add .
> git commit -m 'middleman init the-internet.io' Personal/the-internet.io 2.3.1 master@ ●
[master (root-commit) f6a4d2c] middleman init the-internet.io
11 files changed, 756 insertions(+)
create mode 100644 .gitignore
create mode 100644 Gemfile
create mode 100644 Gemfile.lock
> middleman init the-internet.io Development/Personal 2.3.1
run git clone --depth 1 git://github.com/middleman/middleman-templates-default.git /var/folders/0r/mcpgtk_x3_vcg_15t33nt0b40000gn/T/d20160506-3746-13gjqjh from "."
[ ... ]
exist
create .gitignore
create Gemfile
create config.rb
create source/images/middleman-logo.svg
create source/index.html.erb
create source/javascripts/all.js
> gem install middleman
Successfully installed middleman-4.1.7
Parsing documentation for middleman-4.1.7
Done installing documentation for middleman after 0 seconds
1 gem installed
@mathie
mathie / update-the-internet.io.json
Last active May 6, 2016 04:30
JSON policy document for the-internet.io IAM user on AWS
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1462507905000",
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
> host www.the-internet.io www.the-internet.io has address 54.240.166.188
www.the-internet.io has address 54.240.166.251
www.the-internet.io has address 54.240.166.38
www.the-internet.io has address 54.240.166.216
www.the-internet.io has address 54.240.166.153
www.the-internet.io has address 54.240.166.127
www.the-internet.io has address 54.240.166.92
www.the-internet.io has address 54.240.166.61
@mathie
mathie / policy.json
Created May 4, 2016 16:43
Default policy for the-internet.io bucket.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AddPerm",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::the-internet.io/*”
}
@mathie
mathie / index.html
Created May 4, 2016 16:24
The simplest thing that could possibly work...
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>A Sneak Peek at The Internet</title>
</head>
<body>
<h1>A Sneak Peek at The Internet</h1>
<p>Now hosted on <a href=“https://aws.amazon.com/“>Amazon Web Services</a>!</p>
</body>
</html>