Skip to content

Instantly share code, notes, and snippets.

View kovyrin's full-sized avatar

Oleksiy Kovyrin kovyrin

View GitHub Profile
#!/usr/bin/perl
use strict;
use warnings;
our $VERSION = '0.03';
use File::Find qw(find);
use Getopt::Long;
use YAML;
@kovyrin
kovyrin / ruby-1.8.7-hash-randomize.patch
Created December 29, 2011 18:51
Ruby EE 2011.03 Hash Collision Fix
From 4f69a748ab820c6a8bd204f94d13d970847f575c Mon Sep 17 00:00:00 2001
From: RPM Builder <rpmbuild@livingsocial.com>
Date: Thu, 29 Dec 2011 19:48:52 +0000
Subject: [PATCH] Backport randomized hash patch from upstream
---
source/inits.c | 4 ++
source/random.c | 74 ++++++++++++++++++++++++++++++---------
source/st.c | 14 +++++++-
source/string.c | 7 +++-
@kovyrin
kovyrin / ticket.rb
Created November 2, 2011 16:07
Flickr-inspired Ticket Server client
class Ticket
class CouldNotRetrieveTicket < StandardError ; end
def self.connections(connections)
@connections = connections
end
def self.set_table_name(table_name)
@table_name = table_name
end
@kovyrin
kovyrin / rb-gsl.patch
Created September 14, 2011 22:22
Fix for "matrix_complex.c:1525: error: conflicting types for ‘gsl_matrix_complex_equal’"
diff --git a/ext/matrix_complex.c b/ext/matrix_complex.c
index 8a77ac1..1b1d8af 100644
--- a/ext/matrix_complex.c
+++ b/ext/matrix_complex.c
@@ -1519,8 +1519,7 @@ static VALUE rb_gsl_matrix_complex_indgen_singleton(int argc, VALUE *argv, VALUE
return Data_Wrap_Struct(cgsl_matrix_complex, 0, gsl_matrix_complex_free, mnew);
}
-
-static int gsl_matrix_complex_equal(const gsl_matrix_complex *m1,
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://hbase01.local:9000/hbase</value>
</property>
<property>
@kovyrin
kovyrin / gist:1163402
Created August 22, 2011 20:13
Hbase Client Wrapper (scanner part)
#---------------------------------------------------------------------------------
# Scanner-related methods
def self.open_scanner(table, params)
scanner = nil
scanner = client(table).scannerOpenWithPrefix(table, params[:prefix], params[:columns]) if params[:prefix]
scanner = client(table).scannerOpenWithStop(table, params[:start_id], params[:stop_id], params[:columns]) if params[:stop_id]
scanner ||= client(table).scannerOpen(table, params[:start_id], params[:columns])
return scanner
end
@kovyrin
kovyrin / gist:778603
Created January 13, 2011 21:05
add this to your plurk styles to hide "front page" link on Plurk.com
td.content { position:absolute !important; left:-8em !important }
#!/bin/sh
# Set up an ssh tunnel to our proxy server + socks5 proxy endpoint at 127.0.0.1:1080
ssh -D 1080 -N -c blowfish -f proxy.local
#!/usr/bin/env ruby
require 'fileutils'
Dir.chdir("/var/log/hadoop/userlogs") do
Dir.glob("attempt_2*") do |dir|
next unless File.readlines("#{dir}/syslog").last.match(/Task.*done/)
FileUtils.rm_rf("/var/log/hadoop/userlogs/#{dir}")
end
end
exec /opt/varnish/sbin/varnishd \
-a :8080 \
-T localhost:6082 \
-P /var/run/varnish.pid \
-s file,/varnish/disk1,25GB \
-s file,/varnish/disk2,25GB \
-s file,/varnish/disk3,25GB \
-f /opt/varnish/etc/varnish/default.vcl \
-u nobody \
-F \