Skip to content

Instantly share code, notes, and snippets.

View orweinberger's full-sized avatar

Or Weinberger orweinberger

View GitHub Profile
@orweinberger
orweinberger / gist:8764727
Created February 2, 2014 08:24
Mongo Sharding 101
Follow this manual:
http://docs.mongodb.org/manual/tutorial/deploy-shard-cluster/
The sharding structure requires:
1. 3 config servers
2. a minimum of 2 mongoS instances (the mongoS is the server that does the balancing between the different mongods)
3. 9(!) mongod instances, 3 'standalone' mongods and for each standalone there are 3 replica sets for redundancy.
4. You cannot play with the above structure, yes, you really need 9 mongods.
@orweinberger
orweinberger / gist:abec5dcf96a474fc391e
Created May 15, 2014 15:58
Get the numerical permission mode for a file/folder
stat -c "%a %n" <PATH>
.navbar.navbar-default.navbar-fixed-top(role='navigation')
.container
.navbar-header
button.navbar-toggle(type='button', data-toggle='collapse', data-target='.navbar-collapse')
span.sr-only Toggle navigation
span.icon-bar
span.icon-bar
span.icon-bar
a.navbar-brand(href='/')
img(src='https://joola.io/img/hero.png', alt='...')
doctype html
html
head
meta(charset="utf-8")
meta(name="viewport", content="width=device-width, initial-scale=1")
meta(name="description", content="")
meta(name="author", content="")
link(rel="shortcut icon", href="ico/favicon.ico")
title #{pageTitle}
link(href="css/bootstrap.min.css", rel="stylesheet")
@orweinberger
orweinberger / default.conf
Last active August 29, 2015 14:01
nginx config
server {
listen 80;
server_name example.com www.example.com;
access_log /var/log/nginx/example.access.log;
rewrite ^ https://$server_name$request_uri? permanent;
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
@orweinberger
orweinberger / keybase.md
Created September 23, 2014 12:39
keybase.md

Keybase proof

I hereby claim:

  • I am orweinberger on github.
  • I am orweinberger (https://keybase.io/orweinberger) on keybase.
  • I have a public key whose fingerprint is BAE5 9C9A AA7B A487 F99D 19EC AFE2 5EC6 4146 9280

To claim this, I am signing this object:

var insight = require('insight-api');
var bitcoin = require('bitcoinjs-lib');
var key = bitcoin.ECKey.fromWIF("L1Kzcyy88LyckShYdvoLFg1FYpB5ce1JmTYtieHrhkN65GhVoq73");