Skip to content

Instantly share code, notes, and snippets.

@truemped
truemped / latency.txt
Last active August 29, 2015 14:16 — forked from jboner/latency.txt
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
  1. General Background and Overview
@truemped
truemped / .bashrc
Created August 17, 2009 07:25 — forked from justintv/.bashrc
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer!
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ "
# This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty!
# ~/code/web:beta_directory$ git checkout master
# Switched to branch "master"
# ~/code/web:master$ git checkout beta_directory
# Switched to branch "beta_directory"
@truemped
truemped / btree.py
Created October 31, 2010 12:10 — forked from teepark/btree.py
import bisect
import itertools
import operator
class _BNode(object):
__slots__ = ["tree", "contents", "children"]
def __init__(self, tree, contents=None, children=None):
self.tree = tree
@truemped
truemped / logsink.py
Created February 4, 2011 12:36
A sink for the pyzmq log handler
# Copyright (c) 2011 Daniel Truemper <truemped@googlemail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is furnished to do
# so, subject to the following conditions: The above copyright notice and this
# permission notice shall be included in all copies or substantial portions of
# the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
import trombi
from tornado.ioloop import IOLoop
ioloop = IOLoop.instance()
f = open('onemb.zero')
db = trombi.from_uri('http://localhost:5984/test')
def doc_created(doc):
@truemped
truemped / sample.config
Created June 8, 2011 07:55 — forked from sidupadhyay/sample.config
Sample HA Proxy Config for Tornado/Socket.io Backends
global
maxconn 10000 # Total Max Connections. This is dependent on ulimit
nbproc 2
defaults
mode http
option redispatch
maxconn 2000
contimeout 5000
clitimeout 50000
@truemped
truemped / ubuntu puppet server passenger install.txt
Created September 30, 2011 04:30 — forked from andys/ubuntu puppet server passenger install.txt
Steps for installing puppet master in Ubuntu 10.04 with ruby 1.8 and passenger
Puppet Install steps for Ubuntu 10.04, ruby 1.8, and passenger
apt-get -y update
apt-get -y dist-upgrade
reboot
############################################
apt-get -y install build-essential
apt-get -y install bsubversion apache2 libcurl4-openssl-dev libssl-dev mysql-server
@truemped
truemped / gist:1717523
Created February 1, 2012 15:25 — forked from fennb/gist:1283573
nginx microcaching config example
# Set cache dir
proxy_cache_path /var/cache/nginx levels=1:2
keys_zone=microcache:5m max_size=1000m;
# Virtualhost/server configuration
server {
listen 80;
server_name yourhost.domain.com;
# Define cached location (may not be whole site)