This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{locale.format_date(c['_id'].generation_time.replace(tzinfo=None))}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -------- /etc/nginx/nginx.conf -------- | |
user www-data; | |
worker_processes 4; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 768; | |
# multi_accept on; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _merge_new_params_with_referring_url(url, param_name=None, param_value=None): | |
if not url: | |
return '/' | |
if not param_name or not param_value: | |
return url | |
scheme, network, path, query, fragment = urlparse.urlsplit(url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import pymongo | |
CRUNCHBASE_API = 'http://api.crunchbase.com/v/1/company/' | |
CRUNCHBASE_API_END = '.js?api_key=CRUNCHBASE_API' | |
db_connection = pymongo.Connection('localhost', 27017) | |
db = db_connection['tc'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import pymongo | |
import json | |
# Requires crunchbase data loaded by this gist: https://gist.github.com/4202360 | |
NOWA_API_KEY = 'NOWA_KEY' | |
NOWA_URL = 'http://ingeniapi.com/train' | |
db_connection = pymongo.Connection('localhost', 27017) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Start mongodb replica servers: | |
mongod --replSet abc --dbpath /db/1 --port 27001 --oplogSize 50 --logpath log.1 --logappend --fork --rest | |
mongod --replSet abc --dbpath /db/2 --port 27002 --oplogSize 50 --logpath log.2 --logappend --fork --rest | |
mongod --replSet abc --dbpath /db/3 --port 27003 --oplogSize 50 --logpath log.3 --logappend --fork --rest | |
Basic config for a replica set: | |
cfg= | |
{ | |
"_id" : "abc", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
<style type="text/css"> | |
.from_to_text { | |
position: relative; /*Parent is relative */ | |
} | |
.from_to_text_real_name { | |
/*No position - this sets the spacing for the html */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load 'deploy' if respond_to?(:namespace) | |
require 'railsless-deploy' | |
require 'capistrano_colors' | |
set :application, "grata" | |
set :user, "ubuntu" | |
set :use_sudo, false | |
# Forward your github ssh keys to the server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install guide: | |
http://docs.basho.com/riak/latest/tutorials/installation/Installing-on-Debian-and-Ubuntu/ | |
Note: If you dont build from source (if you use the easy way: 'sudo dpkg -i riak_1.2.1-1_i386.deb') then you wont be able to setup a 4 node cluster with Rebar. | |
Dependencies for 32bit ubuntu: | |
sudo apt-get install build-essential libncurses5-dev m4 | |
sudo apt-get install libssl0.9.8 | |
-------- Thoughts --------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# colors | |
export CLICOLOR=1 | |
export TERM=xterm-color | |
export LSCOLORS=gxgxcxdxbxegedabagacad # cyan directories | |
# old Prompt | |
#export PS1='\[\033[01;32m\]\u@:\[\033[01;36m\]\w\[\033[00m\]\$ ' | |
#Android sdk add to PATH | |
#PATH=$PATH:/System/Library/android-sdk-mac_x86/tools/ |