Skip to content

Instantly share code, notes, and snippets.

[ec2-user@master:~] mongo
MongoDB shell version: 1.6.5
connecting to: test
> rs.status();
{
"set" : "lbrset",
"date" : "Thu Apr 21 2011 18:03:10 GMT+0000 (UTC)",
"myState" : 2,
"members" : [
{
@rauchg
rauchg / gist:935661
Created April 21, 2011 22:57
MongoDB makefile
mongodb:
@$(MONGOD) \
--replSet=lbdevset \
--port=28017 \
--logappend \
--logpath="$(PWD)/logs/mongodb.node1.log" \
--dbpath="$(PWD)/data/db/node1" \
--pidfilepath $(PWD)/pids \
--fork \
--rest
@rauchg
rauchg / gist:935664
Created April 21, 2011 22:59
MongoDB replica set initialization
> rs.initiate({_id: "lbdevset", members: [{_id: 0, host: "HOST:28017"}, {_id: 1, host: "HOST:28018"}] })
> rs.addArb("HOST:28019")
@rauchg
rauchg / haproxy
Created August 30, 2011 21:51
node
∞ ~ ab -n 1000 -c 100 http://127.0.0.1:10000/
This is ApacheBench, Version 2.3 <$Revision: 1139530 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
/**
* Triggers a CSS3 keyframe-based animation
*
* @param {String} animation name
* @api public
*/
jQuery.fn.animation = function (name, opts, fn) {
if ('function' == typeof opts) {
#wrap .chrome-frame-message-box
background #eee
color #000
text-align center
height 140px
padding-top 16px
border-bottom solid 1px #bdbdbd
.chrome-frame-message
position relative
width 980px
@rauchg
rauchg / ms.md
Created December 21, 2011 00:25
Milliseconds conversion utility.
/**
# eq.js: minimalistic equation evaluator.
eq(str, vars)
Features:
- evaluate variables in the `vars` object
- `str` can use any `Math` function or property: round, ceil, max, E
@rauchg
rauchg / s.js
Created January 13, 2012 18:51
/**
# s.js: minimalistic javascript sprintf().
// standalone
s('http://%s:%d', 'localhost', 40)
// extend String.prototype
s.extend();
#!/usr/bin/env bash
# search directory defaults to current
dir=.
# case sensitive search
sensitive=
# colors enabled by default in ttys
if [ -t 1 ]; then