Skip to content

Instantly share code, notes, and snippets.

View roidrage's full-sized avatar
🌱
Planting seeds

Mathias Meyer roidrage

🌱
Planting seeds
View GitHub Profile
anonymous
anonymous / gist:4263758
Created December 12, 2012 00:30
erlang ricer config for sysctrl.conf
# General gigabit tuning:
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.ipv4.tcp_syncookies = 1
# this gives the kernel more memory for tcp
# which you need with many open socket connections
net.ipv4.tcp_mem = 50576 64768 98152
net.core.netdev_max_backlog = 2500
@aledbf
aledbf / index.js
Created December 5, 2012 01:11
Alternative to https://gist.github.com/fbb99b638e9da27fe24d (generate secure environment variables)
var program = require('commander'),
request = require('request'),
fs = require('fs'),
ursa = require('ursa');
program.on('--help', function() {
console.log(' Alternative to https://gist.github.com/fbb99b638e9da27fe24d (generate secure environment variables)');
console.log(' Example:');
console.log('');
console.log(' $ node index -r github-user/user-repo -v SECURE=value');
@masonforest
masonforest / gist:4048732
Created November 9, 2012 22:28
Installing a Gem on Heroku from a Private GitHub Repo

Installing a Gem on Heroku from a Private GitHub Repo

Sometimes you want to use a gem on Heroku that is in a private repository on GitHub.

Using git over http you can authenticate to GitHub using basic authentication. However, we don't want to embed usernames and passwords in Gemfiles. Instead, we can use authentication tokens.

  1. Get an OAuth Token from GitHub

First you will need to get an OAuth Token from GitHub using your own username and "note"

@jboner
jboner / latency.txt
Last active May 6, 2024 07:06
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
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 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@stormsilver
stormsilver / ubuntu11.10-gems.erb
Created April 5, 2012 18:13
ubuntu11.10-gems.erb template
bash -c '
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>
if [ ! -f /usr/bin/chef-client ]; then
apt-get update
apt-get install -y ruby1.9.1 ruby1.9.1-dev build-essential wget
cd /tmp
wget <%= "--proxy=on " if knife_config[:bootstrap_proxy] %>http://production.cf.rubygems.org/rubygems/rubygems-1.8.15.tgz
tar zxf rubygems-1.8.15.tgz
cd rubygems-1.8.15
@kommen
kommen / 0-readme.md
Created February 28, 2012 21:23 — forked from mickm/0-readme.md
ruby-1.9.3-p125 cumulative performance patch, with Xcode 4.3 command line tools compatible.

Patched ruby 1.9.3-p125 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p125 with patches to make ruby-debug work again (#47) and boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84).

It works with Xcode 4.3 and the clang compiler it ships with its command line tools package.

Huge thanks to funny-falcon for the performance patches.

require 'lazy'
require 'system_timer'
class LibratoMetric
COUNT = 10
RESOLUTION = 1
def initialize(metric_name, timeout = 5)
@metric_name = metric_name
@timeout = timeout
@kellymclaughlin
kellymclaughlin / luwak_file_iterate.erl
Created November 29, 2011 16:50
Luwak inspection
Fun = fun(C, File) ->
{ok, TLObj} = C:get(<<"luwak_tld">>, File, 2),
{_, TLVal} = hd(riak_object:get_contents(TLObj)),
FileRoot = proplists:get_value(root, TLVal),
{ok, RootObj} = C:get(<<"luwak_node">>, FileRoot),
{_, RootVal} = hd(riak_object:get_contents(RootObj)),
{_, _, ChunkKeys} = RootVal,
[begin
case C:get(<<"luwak_node">>, K) of
{ok, _} ->
@dsanson
dsanson / custom.css
Created July 12, 2011 18:16
A custom.css for use with Marked.app
/*
This is my hacked up copy of Marked.app/Contents/Resources/gridless.css
Changes:
1. Smaller headings
2. ~~No scrollbars~~ (I now prefer the Lion default behavior)
3. Styling of definition lists ala LaTeX description lists.
4. Centering h1.title, h3.author, h4.date (pandoc's title/author/date block).
@jdmaturen
jdmaturen / pbc_pool_transport.py
Created June 20, 2011 23:39
Riak python client PBC connection pooling
import logging
log = logging.getLogger('socrates')
from Queue import Empty, Full, Queue
from riak.transports import RiakPbcTransport
from riak.transports.transport import RiakTransport
class PbcPoolTransport(RiakTransport):