View gce-vpn-install.sh
#!/bin/sh
#
# Automatic configuration of a VPN on GCE debian-7-wheezy server.
# Tested only on debian-7-wheezy.
#
# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
# Unported License: http://creativecommons.org/licenses/by-sa/3.0/
#
# Thx to: https://github.com/sarfata/voodooprivacy/blob/master/voodoo-vpn.sh for the code/idea
#
View format_disk.sh
yum update
fdisk /dev/xvdc <<EOI
n
p
1
w
EOI
View setup.sh
yum update -y
View gist:6894c1f9603e062d5e29
FROM quay.io/thinkdataworks/node
MAINTAINER Brendan Stennett <brendan@thinkdataworks.com>
ENV PACKAGE_NAME <package> # this should match the package name in package.json
ENV NODE_PATH /usr/local/lib/node_modules/$PACKAGE_NAME/node_modules
ENV PATH /usr/local/lib/node_modules/$PACKAGE_NAME/node_modules/.bin:$PATH
WORKDIR /app
COPY package.json /app/
View Guardfile
guard :rspec, cmd: 'rspec' do
watch(%r{spec/(.+)_spec.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{lib/(.+).rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
watch(%r{app/(.+).rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{app/(.*)(.erb|.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
watch(%r{app/controllers/(.+)_(controller).rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
watch(%r{spec/support/(.+).rb$}) { "spec" }
View gist:b322070eed4dac32e46b
# works
allow(MyObject).to receive(:each).and_yield(:one).and_yield(:two).and_yield(:three)
# want something like
allow(MyObject).to receive(:each).and_yield_successive_args(:one, :two, :three)
View Gemfile
group :production do
gem 'unicorn'
# Enable gzip compression on heroku, but don't compress images.
gem 'heroku-deflater'
# Heroku injects it if it's not in there already
gem 'rails_12factor'
end
View steps
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
View unicorn.rb.erb
working_directory "<%= current_path %>"
pid "<%= unicorn_pid %>"
stderr_path "<%= unicorn_log %>"
stdout_path "<%= unicorn_log %>"
listen "/tmp/unicorn.<%= application %>.sock"
worker_processes <%= unicorn_workers %>
timeout 30
preload_app true
View Guardfile
guard :rspec, cmd: 'zeus rspec --color' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
# Rails example
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }