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
# | |
# 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
## /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
# | |
# 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
# | |
# 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
# | |
# 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
#!/usr/bin/env ruby | |
# | |
# Simple script to rename all columns/index/seq on rails app postgresql db | |
# | |
# Usage: pg_rename foo bar | |
# | |
require 'rubygems' | |
require 'activerecord' | |
require 'annotate/annotate_models' | |
require 'config/boot' |
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 | |
# NGINX RC.D SCRIPT | |
# Archlinux | |
NGINX_CONFIG="/opt/nginx/conf/nginx.conf" | |
NGINX_BIN="/opt/nginx/sbin/" | |
#. /etc/conf.d/nginx | |
. /etc/rc.conf | |
. /etc/rc.d/functions |
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
# | |
# Tokyo Tyrant rake tasks | |
# | |
# rake tyrant:restart # Restart Tyrant server | |
# rake tyrant:start # Start Tyrant server | |
# rake tyrant:stop # Stop Tyrant server | |
# | |
namespace :tyrant do | |
desc "Start Tyrant server" |
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 LogApp | |
def initialize(m, c, text, req) | |
HoptoadNotifier.notify( | |
:error_class => m.to_s.capitalize, | |
:error_message => text, | |
:request => req, | |
:backtrace => c) | |
end |