Skip to content

Instantly share code, notes, and snippets.

@Randommood
Randommood / gist:887697
Created March 25, 2011 21:43 — forked from PharkMillups/gist:884158
brief chat about some cluster testing basics
12:27 <nginr> Hi .. Need a suggestion. I want to test the behaviour of my
cluster as the data in the cluster keeps on increasing. Upto 1 TB.
I want to test the behaviour of Read, Write and Search. Is it possible to do with curl ??
12:28 <chids> nginr: Possible to do what with curl - execute read,
write and search requests?
12:28 <aphyr> PBC or erlang might be faster, but I've used the HTTP interface
for testing in our ruby app
@Randommood
Randommood / gist:887698
Created March 25, 2011 21:43 — forked from PharkMillups/gist:884178
conversation about using Riak for a Rails 3 project
11:55 <pferdefleisch> yo yo yo, I would like to use riak as a file serving
db for a rails 3 project. I am wondering if you can use ripple to save
images. I looked through the code(specifically casting.rb) and didn't see
an image or binary type. This makes me think that I need to use the riak_client
gem and set content type "image/jpg" or the like.
11:56 <pferdefleisch> so, can i even use the riak_client gem -- and -- is this even
a good idea in the first place?
11:56 <pferdefleisch> thx!
@Randommood
Randommood / gist:1005111
Created June 2, 2011 19:31 — forked from moneill/gist:1005105
Sample mongoid.yml generated from rails g mongoid:config (app name is 'appy')
defaults: &defaults
host: localhost
# slaves:
# - host: slave1.local
# port: 27018
# - host: slave2.local
# port: 27019
development:
<<: *defaults
@Randommood
Randommood / connection_pool_adapter.rb
Created August 18, 2011 19:14 — forked from d11wtq/connection_pool_adapter.rb
Sample database.yml for multiple slaves/masters with DataMapper
module DataMapper
module Adapters
class ConnectionPoolAdapter < AbstractAdapter
def initialize(name, options)
super
assert_kind_of 'options', @options[:pool], Array
raise ArgumentError, "The are no adapters in the adapter pool" if @options[:pool].empty?
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long;
# This script will generate the commands used to preshard a collection
# in mongodb.
#
# See:
# http://www.mongodb.org/display/DOCS/Splitting+Chunks
@Randommood
Randommood / pg extensions
Created December 14, 2011 20:28 — forked from wayneeseguin/gist:1478154
List installed then available postgresql extensions
postgres=# \dx
List of installed extensions
Name | Version | Schema | Description
---------+---------+------------+------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
(1 row)
postgres=# \dx+
Objects in extension "plpgsql"
Object Description
@Randommood
Randommood / gist:1733516
Created February 3, 2012 22:57 — forked from lightcap/gist:1440810
Restore Heroku Postgresql db to Engine Yard Cloud (Assuming beta postgres at EY)
# On Heroku
# Create dump file
heroku pgbackups:capture --app <application_name>
# On Engine Yard slice
# Get dump file from heroku
curl -o latest.dump `heroku pgbackups:url b005 --app <application_name> -e <environment>`
# drop and recreate database
bundle exec rake db:drop
@Randommood
Randommood / mongooplog
Created March 28, 2012 18:07 — forked from ajdavis/gist:1808903
mongooplog output
$ mongo --port 4000
MongoDB shell version: 2.0.2
connecting to: 127.0.0.1:4000/test
PRIMARY> db.test.insert({'foo':'bar'})
PRIMARY> use local
PRIMARY> db.oplog.rs.find().sort({$natural:-1})
{ "ts" : { "t" : 1329058902000, "i" : 1 }, "h" : NumberLong("-9209932462579884476"), "op" : "i", "ns" : "test.test", "o" : { "_id" : ObjectId("4f37d45611558d5848a3d21a"), "foo" : "bar" } }
@Randommood
Randommood / pr.md
Created August 13, 2012 17:06 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@Randommood
Randommood / 00-about.md
Created September 27, 2012 18:41 — forked from jasonrudolph/00-about.md
Rough Notes from Strange Loop 2012

About

This gist is a collection of my rough notes from Strange Loop 2012.

Follow me on Twitter to get updates as they're posted.

I'm posting these notes immediately after each talk. Expect typos, formatting glitches, incomplete thoughts, and ...