Skip to content

Instantly share code, notes, and snippets.

View gregory's full-sized avatar
🎯
Focusing

Grégory Horion gregory

🎯
Focusing
View GitHub Profile
@gregory
gregory / how_i_got_my_mom_running_her_ruby_cms_on_a_cluster.md
Created September 4, 2014 15:37
This is a quick post on how to setup locomotive_cms locally for testing or production. Or, how you can get your mom running her own cluster.

#Panamax - Or how I got my mom running her ruby cms ... on a cluster!

First things first:

If you know the pain to get your mom running her own cluster please show me some love here by clicking on the star button!

##Pana what?

Panamax is not the new trendy word for yet another icebucket challenge, but the new open source tool for humans to help you manage your docker architecture, that made some noise lately.

require File.expand_path(File.dirname(__FILE__) + "/../../config/environment")
require 'adhearsion'
require 'adhearsion/initializer/asterisk'
require 'drb'
# http://help.cloudvox.com/faqs/getting-started/setup-for-ruby-adhearsion
desc "Make an outgoing phone call to number provided as 'call' (via Cloudvox)"
task :make_outgoing_call do
if ENV['call']
# Outgoing context from Cloudvox Switchboard, under "Outgoing settings (AMI)."
fs = require 'fs'
webpage = require 'webpage'
page = webpage.create()
renderedUrls = 0
totalUrls = 0
# Taken from https://github.com/ariya/phantomjs/blob/master/examples/waitfor.js
# Converted into coffee
waitFor = (testFx, onReady, timeOutMillis) ->
maxtimeOutMillis = (if timeOutMillis then timeOutMillis else 5000) #< Default Max Timout is 3s
# using VirtualBox version $VBOX_VERSION
FROM boot2docker/boot2docker
RUN apt-get install p7zip-full
RUN mkdir -p /vboxguest && \
cd /vboxguest && \
curl -L -o vboxguest.iso http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso && \
7z x vboxguest.iso -ir'!VBoxLinuxAdditions.run' && \
sh VBoxLinuxAdditions.run --noexec --target . && \

Deploy Rails 4 app with Dokku on DigitalOcean

Install dokku

First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel

Then ssh with root account, run this in termianl:

$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
@gregory
gregory / deploy.rb
Created March 3, 2014 17:55 — forked from dpsk/deploy.rb
# Capistrano configuration
#
# require 'new_relic/recipes' - Newrelic notification about deployment
# require 'capistrano/ext/multistage' - We use 2 deployment environment: staging and production.
# set :deploy_via, :remote_cache - fetch only latest changes during deployment
# set :normalize_asset_timestamps - no need to touch (date modification) every assets
# "deploy:web:disable" - traditional maintenance page (during DB migrations deployment)
# task :restart - Unicorn with preload_app should be reloaded by USR2+QUIT signals, not HUP