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
after "deploy:symlink", "deploy:restart_workers" | |
after "deploy:restart_workers", "deploy:restart_scheduler" | |
## | |
# Rake helper task. | |
# http://pastie.org/255489 | |
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/ | |
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/ | |
def run_remote_rake(rake_cmd) | |
rake_args = ENV['RAKE_ARGS'].to_s.split(',') |
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
namespace :queues do | |
desc "Run Resque workers with options and job classes loaded" | |
# Run with & appended to daemonize | |
task :workers => :environment do | |
def pid_directory | |
Rails.root.join('tmp', 'pids') | |
end |
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
The following assume that you are in the homedir of your private CA userdir (/home/myca). I would suggest creating a limited system account used solely for key creation and signing. Use homedir encryption to protect your CA keys from root compromise. | |
Create CA Certificate | |
openssl genrsa -des3 -out private/cacert.key 4096 -config conf/caconfig.cnf | |
openssl req -new -x509 -days 365 -key private/cacert.key -out certs/cacert.crt -config conf/caconfig.cnf | |
Create Server Certificate | |
openssl genrsa -des3 -out private/nullbacon.patrick-morgan.net.key 4096 -config conf/caconfig.cnf | |
openssl req -new -key private/nullbacon.patrick-morgan.net.key -out nullbacon.patrick-morgan.net.csr -config conf/caconfig.cnf |
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
RAILS_ROOT=`pwd` bundle exec resque-web config/initializers/resque.rb |
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
var CategoryPicker = function(category_picker_path, subcategory_picker_path) { | |
this.init = function(){ | |
var obj = this; | |
var category_picker = $(category_picker_path); | |
var subcategory_picker = $(subcategory_picker_path); | |
category_picker.change(function(){ | |
if (this.value != '') { | |
var target_url = "/category_groups/" + this.value + "/subcategories.json"; | |
$.ajax( target_url, { |
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
module Prepending | |
def append_features(base) | |
prepend = self | |
base.extend Module.new { define_method(:new) { |*args,&block| super(*args,&block).extend(prepend) }} | |
end | |
end | |
module CanCook | |
extend Prepending |
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
-- MySQL creates a lock on tables during updates, so a temporary table must be used by the inner query within the selection criteria. | |
-- Update Workorder Steps to 'failure_int' datareading_type | |
UPDATE workorder_steps | |
SET datareading_type_id = (SELECT id | |
FROM datareading_types | |
WHERE code = 'failure_int') | |
WHERE id IN (SELECT id | |
FROM (SELECT workorder_steps.id | |
FROM workorders |
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
SELECT DISTINCT TABLE_NAME AS `table`, COLUMN_NAME AS `key`, index_type AS `index_type` FROM information_schema.statistics WHERE table_schema=DATABASE() AND index_type='FULLTEXT'; |
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
git diff $1 | grep "^\+[^+]\{3\}" | grep -v "^\+[\t ]*$" | wc -l |
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
# This will correct the error: "boxes: can't find config file" | |
sudo ln -s /usr/local/Cellar/boxes/1.1/share/boxes-config /usr/share/boxes |