Skip to content

Instantly share code, notes, and snippets.

View dip00dip's full-sized avatar

Denys Pankratov dip00dip

  • Consultant
  • Lviv, Ukraine
View GitHub Profile
@mattgorecki
mattgorecki / trapd.rb
Created June 7, 2012 15:59
Simple SNMP Trap receiver that dumps to a RabbitMQ queue
require 'rubygems'
require 'snmp'
require 'carrot'
require 'json'
q = Carrot.queue('traps', :durable => true)
m = SNMP::TrapListener.new(:Port => 162, :Community => 'snmpcommunity') do |manager|
puts "trapd.rb started..."
manager.on_trap_default do |trap|
@tjh
tjh / character_set_and_collation.rb
Created January 31, 2012 16:07
Convert all Rails table column collation and character set
#!/usr/bin/env ruby
# Put this file in the root of your Rails project,
# then run it to output the SQL needed to change all
# your tables and columns to the same character set
# and collation.
#
# > ruby character_set_and_collation.rb
DATABASE = ''
@funny-falcon
funny-falcon / load.c.patch
Created October 8, 2011 22:30
Patch against ruby-1.9.3-p0 to futher improve load.c
diff --git a/load.c b/load.c
index 0ff4b60..019ccb9 100644
--- a/load.c
+++ b/load.c
@@ -18,6 +18,7 @@ VALUE ruby_dln_librefs;
#define IS_DLEXT(e) (strcmp((e), DLEXT) == 0)
#endif
+static int sorted_loaded_features = 1;
@thomd
thomd / local POP3 on OSX
Created November 16, 2009 00:17
install a local POP3 server on OSX serving the system mailbox as a POP3 account.
#!/bin/sh
#
# install a local POP3 server on OSX serving the system mailbox as a POP3 account.
#
# get pre-compiled OS X binaries of UW's (University of Washington) ipop3d and imapd.
cd ~
curl -L -O http://www.macosxguru.net/downloads/localmail.zip
unzip localmail.zip