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
To install this init script, you should save mongodb to /etc/init.d/ and mongosharding.conf to /etc/ | |
then run the following commands as root or with sudo: | |
chmod 755 /etc/init.d/mongodb | |
chown root:root /etc/init.d mongodb | |
update-rc.d mongodb defaults | |
This installation procedure was tested on UBUNTU 11.10 |
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
MongoDB upstart scripts for Ubuntu. | |
Run following commands after installing upstart scripts: | |
ln -s /lib/init/upstart-job /etc/init.d/mongoconf | |
ln -s /lib/init/upstart-job /etc/init.d/mongodb | |
ln -s /lib/init/upstart-job /etc/init.d/mongos | |
To start services use: |
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
# Copy: | |
# /etc/init/delayed_job.conf | |
# Execute: | |
# ln -s /lib/init/upstart-job /etc/init.d/delayed_job | |
# Change user name | |
description "Start up the delayed_job service" | |
start on runlevel [2345] | |
stop on runlevel [06] |
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
class MoneyField | |
def mongoize | |
return if object.nil? | |
cents | |
end | |
class << self | |
def demongoize(object) | |
return nil unless object |
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
db.test.update({foo: "bar"}, {$set: {test: "success!"}}, false, true); |
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
# bluepill - process monitor | |
# | |
# simple process monitoring tool | |
description "bluepill: simple process monitoring tool" | |
start on runlevel [2345] | |
stop on runlevel [!2345] |
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/sh | |
### BEGIN INIT INFO | |
# Provides: bluepill | |
# Required-Start: $local_fs $remote_fs $network $syslog $time | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: bluepill daemon, providing process monitoring | |
# Description: bluepill is a monitoring tool. More info at http://github.com/arya/bluepill. |
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
## | |
# Stick an Object in the queue. | |
# Delayed::Job.enqueue(DelayedRake.new("util:mongrel_init:name")) | |
require 'rake' | |
require 'fileutils' | |
class DelayedRake | |
def initialize(task, options = {}) |
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
JS_PATH = "app/assets/javascripts/**/*.js"; | |
Dir[JS_PATH].each do |file_name| | |
puts "\n#{file_name}" | |
puts Uglifier.compile(File.read(file_name)) | |
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
# | |
# Use just this: | |
openssl req \ | |
-newkey rsa:2048 \ | |
-x509 \ | |
-nodes \ | |
-keyout server.key \ | |
-new \ |
OlderNewer