Skip to content

Instantly share code, notes, and snippets.

@sreeix
sreeix / .gitconfig
Created June 14, 2012 07:31
My Git config
[user]
email = sreeix@gmail.com
name = V Sreekanth
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = auto
@sreeix
sreeix / Rakefile
Created June 4, 2012 09:58
Add ability to not load RAILS Stack for rake tasks
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require 'rake'
def with_rails
require File.expand_path('../config/application', __FILE__)
Sf::Application.send :include, Rake::DSL
Sf::Application.load_tasks
end
def without_rails
@sreeix
sreeix / pipelined.rb
Created March 28, 2012 12:55
Redis Pipelined
r = Redis.new
Benchmark.bmbm do |b|
b.report("With pipelined") do
r.pipelined { 100000.times{|i| r.set("test#{i}", i)} }
end
b.report("With pipelined inside") do
100000.times{|i| r.pipelined {r.set( "test#{i}", i)} }
end
b.report("No pipeline") do
@sreeix
sreeix / redis_proxy.js
Created February 23, 2012 11:47
Fake Redis in test
var testy = require('../testy')
var RedisProxy = require('../../lib/redis_proxy')
describe('RedisProxy', function() {
it('raises exception when no rediss available', function() {
(function(){
new RedisProxy({})
}).should.throw();
});
@sreeix
sreeix / install_redis.md
Created February 21, 2012 19:48
Our Standard Redis Server Setup
# Redis configuration file example
# Note on units: when memory size is needed, it is possible to specifiy
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
@sreeix
sreeix / Gemfile
Created February 20, 2012 07:19
Benchmarks Memcache
source :rubygems
gem "dalli", "~> 1.0.4", :require => ['dalli']
gem "trollop"
gem "statsample"
# gem "kgio"
@sreeix
sreeix / screen.txt
Created February 10, 2012 17:04
screen reference
screen -ls --> see current screens and states
screen -r <screenid> --> attach to a detached screen
screen -x <screenid> --> share an attached screen
screen -S <name> -> Create a new screen
inside screen:
ctrl+an, ctrl+pn to go to next and previous windows
ctrl+d to detach when you're finished
ctrl+ac to create a new window
ctrl+ad to detach from screen
@sreeix
sreeix / gist:1790221
Created February 10, 2012 15:18
My New publickey
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZIQY04o7NdG4QmJ3uMSYWV06fYDYIDhqyGGswItkzC52Zf5FirAblJO6ypgGjPN/Ivo69sZPR5NMxwNV9RhUw9f4NEuYc2vZuhXUXdgZhWBXGtI9FykkStpG9VBp/8ZF1GUQmxcDqoLYT3P1vLMkUU5f54C6OakHtOp3WvqeZmQLwfuBy6szRVQQaxj4+ySZw/T4p/lVe5ODhQWytxbFXxQiaiZ2VHMKCpV7zhECfmTCmK/pINJVIU1d77inuuU6RUJrRtjh0Msdx3Qez7vE6FCQK7iBYJPpGFj9fqTqablWglom4dDc/bDznjHg+7RaTPjugL+NceZD0S03HLAg1 v@gadaffi.local
@sreeix
sreeix / cassandra_benchmark.rb
Created February 9, 2012 15:31
cassandra benchmarking code
require 'benchmark'
require 'cassandra/0.7'
@client = Cassandra.new('Search', '127.0.0.1:9160')
@json = JSON.parse(File.read("coupon.json"))
@index = 0
def create_coupon
@index += 1
@client.insert(:Coupon, @index.to_s, @json)
end
@sreeix
sreeix / JSFoo Birds of Feather.md
Created February 3, 2012 17:47
Node.js Birds of Feather at JSFoo Chennai.

Hi,

This is sreekanth, I had done a Node.js talk at JSFoo.

One of the strong impressions from JSFoo Pune was the conversations in the session and outside of the session, between me and other people on the sidelines and the blogs was around

Node.js. As a scalability Solution., or weather it is faster than Ruby, or How node.js's reactor is better or worse than Erlang's Actors/share nothing processes vs threading.

There seems to be a lot FUD and very little concrete numbers around those conversations. I was thinking if there is a full on debate, maybe moderated or maybe in the BOF session