Skip to content

Instantly share code, notes, and snippets.

View alx's full-sized avatar
🌌
exploring

Alexandre Girard alx

🌌
exploring
View GitHub Profile
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
#
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
#
#!/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
#================================================================================
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
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
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(){
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
if (-f $request_filename) {
break;
}
if (-f $request_filename.html) {
rewrite (.*) $1.html break;
}
if (!-f $request_filename) {
proxy_pass http://merb;
# 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"