Skip to content

Instantly share code, notes, and snippets.

@zetavg
zetavg / set-app.sh
Last active August 29, 2015 14:14
`bin/rake` tasks and `bin/rails console` with ease on AWS OpsWorks Instances running Unicorn Rails App Server.
# $ curl -L http://git.io/opsru_setapp > set-app.sh
# $ . set-app.sh app_name
#
# cd into app directory and sets the environment variables
# on AWS OpsWorks Instances running Unicorn Rails App Server.
APP_NAME=$1 && \
cd "/srv/www/${APP_NAME}/current" && \
export RAILS_ENV=production && \
cat "/srv/www/${APP_NAME}/shared/config/unicorn.conf" | grep ENV > "/tmp/${APP_NAME}_env" && \
@hughevans
hughevans / application.rb
Created October 27, 2014 00:12
Invalidate CloudFront cache of S3 assets in Comfortable Mexican Sofa after update or destroy using the Fog gem
module YourApp
class Application < Rails::Application
config.after_initialize do
Comfy::Cms::File.send(:include, ComfyCloudfront)
end
end
end
require 'comfy_cloudfront'
@svenvarkel
svenvarkel / bamboo
Created September 23, 2013 07:30
Bamboo init script for Debian
#!/bin/sh
### BEGIN INIT INFO
# Provides: bamboo
# Required-Start: $local_fs $remote_fs $network $syslog nginx
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts bamboo server
# Description: starts bamboo using start-stop-daemon