This file contains 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
def media_upload_form(options = {}, &block) | |
form :action => url(:upload) do | |
# | |
# You can disallow tag text_field by setting options[:tags_enabled] to 0 | |
# | |
if options[:tags_enabled].nil? or options[:tags_enabled] != 0 | |
text_field(:name => "tags", :label => options[:tags_label] || "Tags") | |
end | |
# |
This file contains 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
def media_upload_form(options = {}, &block) | |
form :action => url(:upload) do | |
# | |
# You can disallow tag text_field by setting options[:tags_enabled] to 0 | |
# | |
if options[:tags_enabled].nil? or options[:tags_enabled] != 0 | |
text_field(:name => "tags", :label => options[:tags_label] || "Tags") | |
end | |
# |
This file contains 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 | |
#================================================================================ | |
# /usr/local/bin/monit_merb_mpc | |
#================================================================================ | |
# This script controls the multi-process Merb 1.0 service | |
# | |
# Do not forget to ensure this script is executable: | |
# $ chmod a+x /usr/local/bin/monit_merb_mpc | |
#================================================================================ |
This file contains 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
merb : /home/deploy/legodata/slice_production : worker (port 4001) ~ FATAL: Permission denied for changing user:group to deploy:www-data. | |
merb : /home/deploy/legodata/slice_production : worker (port 4001) ~ | |
merb : /home/deploy/legodata/slice_production : worker (port 4001) ~ FRAMEWORK_ROOT = /usr/local/lib/ruby/gems/1.8/gems/merb-core-1.0.7.1/lib | |
merb : /home/deploy/legodata/slice_production : worker (port 4001) ~ | |
merb : /home/deploy/legodata/slice_production : worker (port 4001) ~ Errno::EPERM: Operation not permitted | |
merb : /home/deploy/legodata/slice_production : worker (port 4001) ~ FRAMEWORK_ROOT/merb-core/server.rb:345:in `initgroups' | |
merb : /home/deploy/legodata/slice_production : worker (port 4001) ~ FRAMEWORK_ROOT/merb-core/server.rb:345:in `_change_privilege' | |
merb : /home/deploy/legodata/slice_production : worker (port 4001) ~ FRAMEWORK_ROOT/merb-core/server.rb:194:in `change_privilege' | |
merb : /home/deploy/legodata/slice_production : worker (port 4001) ~ FRAMEWORK_ROOT/merb-core/rack/adapt |
This file contains 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
check process merb_app_master | |
with pidfile /var/log/merb/app-production-merb.main.pid | |
start program = "/usr/local/bin/monit_merb_mpc /home/deploy/legodata/slice start_master -c2 -n4000" | |
stop program = "/usr/local/bin/monit_merb_mpc /home/deploy/legodata/slice stop_master" | |
#if totalmem is greater than 80.0 MB for 2 cycles then restart # eating up memory? | |
group merb_app | |
# Worker configuration (one for each worker port required) | |
check process merb_app_4000 | |
with pidfile /var/log/merb/app-production-merb.4000.pid |
This file contains 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
GitHub.editableGenerator = function(options){ | |
return function(_,self){ | |
var defaults={ | |
id:'field', | |
tooltip:'Click to edit!', | |
indicator:'Saving...', | |
data:function(data){return $(self).attr('data') || data }, | |
style:"display: inline",onblur:'submit', | |
callback:function(){ | |
(function(){ |
This file contains 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
check process merb_app_master | |
with pidfile /home/deploy/legodata/slice/shared/pids/production-merb.main.pid | |
start program = "/home/deploy/bin/monit_merb_mpc slice start_master /home/deploy/legodata -c2 -n4000" | |
stop program = "/home/deploy/bin/monit_merb_mpc slice stop_master /home/deploy/legodata" | |
#if totalmem is greater than 80.0 MB for 2 cycles then restart # eating up memory? | |
group master.slice.legodata.com | |
# Worker configuration (one for each worker port required) | |
check process merb_app_4000 | |
with pidfile /home/deploy/legodata/slice/shared/pids/production-merb.4000.pid |
This file contains 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
if (-f $request_filename) { | |
break; | |
} | |
if (-f $request_filename.html) { | |
rewrite (.*) $1.html break; | |
} | |
if (!-f $request_filename) { | |
proxy_pass http://merb; |
This file contains 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
File.copy options[:file], @filename.path | |
file_deleted = false | |
while !file_deleted | |
begin | |
File.unlink options[:file] | |
file_deleted = true | |
rescue | |
end | |
end |
This file contains 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
# run with: god -c /path/to/merb_mpc.god | |
# | |
# This script controls the multi-process Merb 1.0 service | |
# To implement: | |
# start program = "/home/deploy/bin/monit_merb_mpc slice start_master /home/deploy/legodata -c2 -n4000" | |
# stop program = "/home/deploy/bin/monit_merb_mpc slice stop_master /home/deploy/legodata" | |
# | |
# start program = "/home/deploy/bin/monit_merb_mpc slice register_worker /home/deploy/legodata 4000" |