Skip to content

Instantly share code, notes, and snippets.

View kovyrin's full-sized avatar

Oleksiy Kovyrin kovyrin

View GitHub Profile
@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 \
[root@html-cache04 ~]# /opt/varnish/bin/varnishstat -1
client_conn 80132379 86.09 Client connections accepted
client_drop 0 0.00 Connection dropped, no sess/wrk
client_req 80112815 86.07 Client requests received
cache_hit 62089531 66.71 Cache hits
cache_hitpass 0 0.00 Cache hits for pass
cache_miss 18023522 19.36 Cache misses
backend_conn 21460 0.02 Backend conn. success
backend_unhealthy 0 0.00 Backend conn. not attempted
backend_busy 0 0.00 Backend conn. too many
[root@html-cache04 ~]# free -m
total used free shared buffers cached
Mem: 12002 11965 37 0 3 4143
-/+ buffers/cache: 7817 4184
Swap: 8190 6610 1580
/opt/varnish/sbin/varnishd \
-a :8080 \
-T localhost:6082 \
-P /var/run/varnish.pid \
-w 20,100,300 \
-s file,/varnish/disk1,120000M \
-s file,/varnish/disk2,120000M \
-s file,/varnish/disk3,120000M \
-s file,/varnish/disk4,120000M \
-s file,/varnish/disk5,120000M \