Skip to content

Instantly share code, notes, and snippets.

View sigerello's full-sized avatar

Oleksandr Serhiienko sigerello

View GitHub Profile
@sigerello
sigerello / Procfile
Created June 27, 2012 00:21 — forked from jamiew/Procfile
Using unicorn on heroku part 9000
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
@sigerello
sigerello / deploy.rake
Created June 27, 2012 00:20 — forked from njvitto/deploy.rake
Rakefile to deploy and rollback to Heroku in two different environments (staging and production) for the same app
#Deploy and rollback on Heroku in staging and production
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag]
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on]
@sigerello
sigerello / README.markdown
Created October 8, 2011 06:12 — forked from dora-gt/README.markdown
How to install MongoDB 2.0 on Mac OS X (>= Leopard)

How to install MongoDB 2.0 on Mac OS X (>= Leopard)

Procedure

The whole install procedure is like the following.
You would have to do 7 steps.

  1. Download the latest tar file, and expand it.
  2. Move it to /usr/local/, and make a symbolic link to the folder.
  3. Add path to MongoDB binaries.
  4. Make an user that "mongod" runs on, and group that owns the user.
@sigerello
sigerello / populate.rake
Created July 4, 2011 01:13
Populates database with fake data
namespace :db do
desc "Erase and fill the database with test data"
task :populate => :environment do
require 'populator'
require 'faker'
[UserGroup, User, Order].each(&:delete_all)
# Generates 8 user groups with 0 to 150 users.
# Each user has 0 to 7 orders..
#!/bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the unicorn web server
# Description: starts unicorn
<!-- layout file -->
<% if current_user %>
Welcome <%= current_user.username %>. Not you? <%= link_to "Log out", logout_path %>
<% else %>
<%= link_to "Sign up", signup_path %> or <%= link_to "log in", login_path %>.
<% end %>
#!/bin/bash
### BEGIN INIT INFO
# Provides: APPLICATION
# Required-Start: $all
# Required-Stop: $network $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the APPLICATION unicorns at boot
# Description: Enable APPLICATION at boot time.
### END INIT INFO
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by jay@gooby.org http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##