Skip to content

Instantly share code, notes, and snippets.

# Adopted from Han Boetes.
set -g visual-bell on
set -g default-command zsh
set -g status-right "#(uptime|awk '{print $11}') #(date)"
# Statusbar properties.
set -g display-time 3000
set -g status-bg black
interactive("readable", "Readable bookmarklet",
"find-alternate-url",
$browser_object = "javascript:(function(){_readableOptions={'text_font':'Verdana,%20Geneva,%20sans-serif','text_font_monospace':'quote(Courier%20New),%20Courier,%20monospace','text_font_header':'quote(Times%20New%20Roman),%20Times,%20serif','text_size':'16px','text_line_height':'1.5','box_width':'80%','color_text':'#282828','color_background':'#F5F5F5','color_links':'#0000FF','text_align':'normal','base':'blueprint','custom_css':''};if(document.getElementsByTagName('body').length>0);else{return;}if(window.$readable){if(window.$readable.bookmarkletTimer){return;}}else{window.$readable={};}window.$readable.bookmarkletTimer=true;window.$readable.options=_readableOptions;if(window.$readable.bookmarkletClicked){window.$readable.bookmarkletClicked();return;}_readableScript=document.createElement('script');_readableScript.setAttribute('src','http://readable-static.tastefulwords.com/target.js?rand='+encodeURIComponent(Math.r
@volh
volh / index.html
Created August 26, 2011 21:50
html gist? test test
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Teh Default Layout</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="generator" content="GNU Emacs 23.0.60.1">
<style type="text/css">
/* reset.css */
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, im
# $Id: PKGBUILD 134523 2011-08-05 07:55:30Z juergen $
# Maintainer: Juergen Hoetzel <juergen@archlinux.org>
# Contributor: Renchi Raju <renchi@green.tam.uiuc.edu>
pkgname=emacs-athena
pkgver=23.3a
pkgrel=1
pkgdesc="The Emacs Editor, with Athena widget toolkit"
arch=(i686 x86_64)
url="http://www.gnu.org/software/emacs/emacs.html"
license=('GPL')
#! /bin/sh
. /etc/rc.conf
. /etc/rc.d/functions
#change this. too bad emacs daemon can't really work in mutli-user mode. for now.
USERNAME=volh
DESC="Run the emacs daemon."
NAME=emacs
#change this
@volh
volh / gist:829606
Last active September 24, 2015 23:58
Minimal Single Sign On using Sinatra
class SessionManager < Sinatra::Base
use Rack::Session::Memcache,
:key => 'customsessionkey',
:memcache_server => 'a.b.c.d:11211',
:cookie_only => false,
:secure => true,
:secret => 'secretpassphrase'
get '/cookies/set' do
# Newly set cookie points to the same session
@volh
volh / gist:760407
Created December 30, 2010 22:25
/etc/pacman.conf
#
# GENERAL OPTIONS
#
[options]
HoldPkg = pacman glibc
SyncFirst = pacman
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#XferCommand = /usr/bin/curl %u > %o
CAMLprim value mlzmq_version(value unit)
{
CAMLparam1(unit);
int major, minor, patch;
zmq_version(&major, &minor, &patch);
CAMLlocal1( result );
result = caml_alloc(3, 0);
Store_field( result, 0, Val_int major );
something = [1,"two",['t','h','r','e','e']][rand(3)]
case something
when Integer
something + 1
when String
something << "flower"
when Array
something + ["forty", "two"]

Even with their software and hardware architecture in place, there were still obstacles to overcome.

Their monster server uses CentOS Linux, but very few people are running memory-intensive applications on machines with so much RAM, so they ran into performance problems. For example, by default the kernel will start paging out to disk once the memory is about 60% full, which left them with only about 150 GB of RAM available before swapping kicked in and performance cratered. There's not much documentation available around these parameters, so the team ended up scouring the kernel source to understand how it worked before they could produce a set hand-tuned for TasteGraph's needs.