Skip to content

Instantly share code, notes, and snippets.

@cavi21
cavi21 / crearswap.sh
Created February 11, 2011 18:59
Crear una particion swap en los EC2 que no la tienen
# Sacado de http://support.rightscale.com/06-FAQs/FAQ_0023_-_How_can_I_create_a_swap_partition_in_EC2%3F
#!/bin/bash -e
# RightScript: Create and initialise swap file
#
# Description: Creates a swap file and actions a swapon.
#
# Author: Chris Fordham <[email protected]>
@cavi21
cavi21 / README.md
Created April 20, 2010 21:26 — forked from jimeh/README.md

Rails Setting model

This is a semi-quick key/value store I put together for a quick way to store temporary data related to what's in my database, in a reliable way. For example, I'm using it to keep track of where a hourly and a daily crontask that processes statistics left off, so it can resume only processing and summarizing new data on the next run.

Code quality most likely is not great, but it works. And I will update this gist as I update my project.

How It Works

The settings table has two columns, a key and a value column. The value column is serialized, so you can technically store almost anything in there. Memcache is also used as a caching layer to minimize database calls.

#
# = Capistrano Passenger deploy tasks
#
# Provides tasks for deploying a Rails application with Passenger (aka mod_rails).
#
# Category:: Capistrano
# Package:: Passenger
# Author:: Simone Carletti <[email protected]>
# Copyright:: 2007-2008 The Authors
# License:: MIT License
@cavi21
cavi21 / deploy.rb
Created November 21, 2009 16:13 — forked from mrichman/deploy.rb
set :application, "myapplication"
set :repository, "[email protected]:git/#{application}.git"
set :server_name, "www.example.com"
set :scm, "git"
set :checkout, "export"
set :deploy_via, :remote_cache
set :branch, "master"
set :base_path, "/path/to/www"
set :deploy_to, "/path/to/www/#{application}"
set :apache_site_folder, "/etc/apache2/sites-enabled"