Skip to content

Instantly share code, notes, and snippets.

@natedaiger
natedaiger / dj.god
Created December 5, 2008 22:52
dj.god
rails_root = "/home/chunkbot/current"
1.times do |num|
God.watch do |w|
w.name = "chunkbot-dj-#{num}"
w.group = 'chunkbot'
w.interval = 30.seconds
cmd = "cd #{rails_root} && HOME=/home/chunkbot script/delayed_job_worker_control"
w.start = "#{cmd} start -- production"
w.stop = "#{cmd} stop -- production"
#!/bin/bash
VERSION="1.1"
REEV="http://rubyforge.org/frs/download.php/50087/ruby-enterprise-1.8.6-20090113.tar.gz"
REEF="ruby-enterprise-1.8.6-20090113.tar.gz"
REEFF=${REEF%".tar.gz"}
PASSENGER="2.0.6"
echo "#####################################"
echo "Welcome, let's get this party rollin'"
echo "#####################################"
@natedaiger
natedaiger / gist:46749
Created January 14, 2009 02:42
check_areca.sh
#!/bin/bash
#
# Nikolay Diulgerov
#
# WARNING!!!
# cli32 should be located at /usr/bin
# and should be owned by root.nagios with mode 750
# AND !!!
# chmod u+s /usr/bin/cli32
# this is because only root can start cli32 properly (ordinary user will not receive output)
@natedaiger
natedaiger / check_mysql_slave.pl
Created January 17, 2009 21:32
check_mysql_slave
#!/usr/bin/perl
use strict;
my $VERSION = '0.1.1';
my $COPYRIGHT = 'Copyright (C) 2008 Jonathan Buhacoff <[email protected]>';
my $LICENSE = 'http://www.gnu.org/licenses/gpl.txt';
my %status = ( 'OK' => 0, 'WARNING' => 1, 'CRITICAL' => 2, 'UNKNOWN' => 3 );
my $SERVICE = "MYSQL SLAVE";
# look for required modules
exit $status{UNKNOWN} unless load_modules(qw/Getopt::Long DBI DBD::mysql/);
# http://www.jamesbritt.com/2007/12/18/sending-mail-through-gmail-with-ruby-s-net-smtp
# http://d.hatena.ne.jp/zorio/20060416
require "openssl"
require "net/smtp"
Net::SMTP.class_eval do
private
def do_start(helodomain, user, secret, authtype)
raise IOError, 'SMTP session already started' if @started
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s
@natedaiger
natedaiger / hack.sh
Created March 31, 2012 17:44 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@natedaiger
natedaiger / address.py
Created November 19, 2012 23:37
deterministic bitcoin address generator...
# I FOUND THIS HERE:
#
# https://bitcointalk.org/index.php?action=printpage;topic=84238.0
import ecdsa
secp256k1curve = ecdsa.ellipticcurve.CurveFp(115792089237316195423570985008687907853269984665640564039457584007908834671663, 0, 7)
secp256k1point = ecdsa.ellipticcurve.Point(secp256k1curve, 0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798, 0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141)
secp256k1 = ecdsa.curves.Curve('secp256k1', secp256k1curve, secp256k1point, (1, 3, 132, 0, 10))