- Trade-off: scale vs. functionality. MongoDB tries to have good functionality and good scalability.
- Auto-sharding to maintain equilibrium between shards
- Scalable datastore != scalable application: use of datastore may still be non-scalable (e.g. many queries across all shards)
- Get low latency by ensuring shard data is always in memory: datastore
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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
# Outputs the reading time | |
# Read this in “about 4 minutes” | |
# Put into your _plugins dir in your Jekyll site | |
# Usage: Read this in about {{ page.content | reading_time }} | |
module ReadingTimeFilter | |
def reading_time( input ) | |
words_per_minute = 180 |
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
module Jekyll | |
module DateFilter | |
def ord(v) | |
(['1', '21', '31'].include?(v) && "st") || | |
(['2', '22'].include?(v) && "nd") || | |
(['3', '23'].include?(v) && "rd") || | |
"th" | |
end | |
def date_post(postdate) |
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
#!/usr/bin/env sh | |
set -e | |
dot_env=`cat .env` | |
env $dot_env $@ |
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
########################################################### | |
# Two factor authentication with DuoSecurity # | |
# # | |
# (c) 2012 P. Mathis <[email protected]> # | |
########################################################### | |
# This script will improve the normal UNIX integration # | |
# of DuoSecurity. You can specify for each SSH subsystem # | |
# if the two factor authentication is required. # | |
# # | |
# I am not responsible for lost or breached servers, # |
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
# memcached requires libevent | |
cd /usr/local/src | |
curl -L -O http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.17-stable.tar.gz | |
tar -xvzf libevent-2.0.17-stable.tar.gz | |
cd libevent-2.0.17-stable* | |
./configure | |
make | |
sudo make install | |
# Compile memcached utility |
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
module RetryableTyphoeus | |
require 'typhoeus' | |
include Typhoeus | |
DEFAULT_RETRIES = 1 | |
class Request < Typhoeus::Request | |
def original_on_complete=(proc) | |
@original_on_complete = proc |
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
#!/bin/bash | |
echo "*****************************************" | |
echo " Based on information from Google" | |
echo " http://dev.chromium.org/spdy/spdy-best-practices" | |
echo "*****************************************" | |
sudo su | |
yum –y update | |
echo "*****************************************" | |
echo " Changing initcwnd and initrwnd" | |
echo " Step 1: check route settings." |
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
#!/bin/bash | |
# CentOS rbenv system wide installation script | |
# Forked from https://gist.github.com/1237417 | |
# Installs rbenv system wide on CentOS 5/6, also allows single user installs. | |
# Install pre-requirements | |
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel \ | |
make bzip2 autoconf automake libtool bison iconv-devel git-core |