This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # based on http://gist.github.com/29838 | |
| # logging to syslog added | |
| # added killing orphaned procs | |
| # added culling applications to maintain some per application limits | |
| # Find bloating passengers and kill them gracefully. Run from cron every so often. | |
| # | |
| require "rubygems" | |
| require "logging" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #migration to allow nulls for Authlogic Account Activation Tutorial | |
| #http://www.claytonlz.com/index.php/2009/07/authlogic-account-activation-tutorial/ | |
| class AllowNullCryptedPassword < ActiveRecord::Migration | |
| def self.up | |
| change_column :users, :crypted_password, :string, :null => true | |
| change_column :users, :password_salt, :string, :null => true | |
| end | |
| def self.down |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Helper to execute blocks of shell commands via capistrano run | |
| def run_chunk(cmd,options={}) | |
| run cmd.split("\n").map {|l| l.strip }.join(" "), options | |
| end | |
| # Example | |
| task :revision, :roles => [:app] do | |
| run_chunk %Q{ | |
| cd #{current_release}; | |
| cp REVISION public/REVISION; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # How to exit if any command in a bash subshell fails with piping all output | |
| set -o pipefail | |
| ( | |
| set -o errexit; | |
| echo -n "T"; | |
| # false; | |
| echo -n "e"; | |
| # false; | |
| echo -n "s"; |
NewerOlder