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
# | |
# Lunar/Moon phases ruby class | |
# | |
# Code is based upon Bradley E. Schaefer''s moon phase algorithm. | |
# Ruby version based on JavaScript Phase Calculator by Stephen R. Schmitt | |
class Moon | |
attr_reader :epoch, :phase, :days, :icon, :dist, :ll | |
# Return the current (or input a date) moon. | |
# Moon.new |
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
# | |
# AuthPunkInterface | |
# | |
# This module is responsible for allowing login via | |
# HTTP Auth using an API Key (single_access_token) | |
# | |
module AuthPunkInterface | |
module HttpBasicApiKey | |
def self.included(klass) |
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
# | |
# Nanite rake tasks [start, stop, stat] | |
# | |
namespace :nanites do | |
NANITES = Dir.glob("nanite/*").map {|d| d.split("/")[1] } | |
SLEEP_TIME = RAILS_ENV == 'production' ? 1 : 3 | |
desc "Start nanites" | |
task :start, [:nanite] do |t, nanite| | |
#raise RuntimeError, "Nanite is already running." if nanite_running? | |
for nanite in get_nanites(nanite) |
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
## /etc/rc.d/rabbitmq [shell-unix-generic] | |
#!/bin/bash | |
daemon_name=rabbitmq-multi | |
node_count=1 | |
. /etc/rc.conf | |
. /etc/rc.d/functions | |
case "$1" in |
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
# | |
# God please, | |
# | |
# Generic Monitor | |
# | |
def generic_monitoring(w, options = {}) | |
w.interval = 30.seconds # default | |
w.start_if do |start| | |
start.condition(:process_running) do |c| | |
c.interval = 10.seconds |
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
#!/usr/bin/env ruby | |
require "rubygems" | |
require "nanite" | |
puts "[XMAPPER] Starting mapper!" | |
pid = fork do | |
# $stdin.close | |
# $stdout.close | |
# $stderr.close |
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
require 'tokyotyrant' | |
module Rack | |
module Session | |
class Tyrant < Abstract::ID | |
include TokyoTyrant | |
attr_reader :mutex, :pool | |
DEFAULT_OPTIONS = Abstract::ID::DEFAULT_OPTIONS.merge :tyrant_server => "localhost:1978" | |
def initialize(app, options = {}) | |
super |
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
--- PKGBUILD 2009-07-02 13:17:27.000000000 -0300 | |
+++ PKGBUILD 2009-12-21 16:31:34.000000000 -0200 | |
@@ -1,6 +1,6 @@ | |
# Contributor: p2k <[email protected]> | |
pkgname=rabbitmq | |
-pkgver=1.6.0 | |
+pkgver=1.7.0 | |
pkgrel=1 | |
pkgdesc="Highly reliable and performant enterprise messaging implementation of AMQP written in Erlang/OTP" | |
arch=(i686 x86_64) |
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
# | |
# Nanite Initializer | |
# | |
def load_mapper_opts | |
YAML.load(File.read(RAILS_ROOT + "/config/rabbitmq.yml"))#.result) #[ENV["RAILS_ENV"] || "development"] | |
end | |
if ENV["NO_NM"].nil? && RAILS_ENV != "test" | |
if defined?(PhusionPassenger) |
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
#user nobody; | |
worker_processes 1; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; | |