Skip to content

Instantly share code, notes, and snippets.

View vincentbernat's full-sized avatar

Vincent Bernat vincentbernat

View GitHub Profile
@vincentbernat
vincentbernat / nginx.conf
Created August 14, 2011 17:23
nginx configuration for SSL benchmark
user root;
worker_processes 2;
worker_rlimit_nofile 90000;
error_log /usr/local/nginx/logs/error.log;
pid /var/run/nginx.pid;
events {
use epoll;
multi_accept off;
accept_mutex off;
@vincentbernat
vincentbernat / gist:1163077
Created August 22, 2011 18:16
haproxy configuration for SSL benchmark
global
maxconn 100000
defaults
option http-server-close
option dontlognull
option redispatch
option contstats
retries 3
timeout connect 5s
@vincentbernat
vincentbernat / gist:1180393
Created August 30, 2011 07:34
stunnel configuration for SSL benchmark
pid = /var/run/stunnel.pid
socket = a:SO_REUSEADDR=1
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
debug = 2
[ssl_frontend]
client = no
key = /WOO/server1024.key
cert = /WOO/server1024.crt
@vincentbernat
vincentbernat / openssl-1.0.0e-backport.patch
Created October 8, 2011 11:05
Patch for backporting OpenSSL 1.0.0e from Oneiric to Lucid.
diff -Naur openssl-1.0.0e/debian/changelog openssl-1.0.0e.new/debian/changelog
--- openssl-1.0.0e/debian/changelog 2011-09-27 18:16:34.000000000 +0200
+++ openssl-1.0.0e.new/debian/changelog 2011-09-30 16:25:48.000000000 +0200
@@ -1,3 +1,9 @@
+openssl (1.0.0e-2ubuntu2~bpohebex1) lucid; urgency=low
+
+ * Backport to Lucid: drop multi-arch support.
+
+ -- Vincent Bernat <bernat@debian.org> Fri, 30 Sep 2011 16:24:40 +0200
+
@vincentbernat
vincentbernat / gist:1361948
Created November 13, 2011 10:15
Testing ligatures vs font substitution
<html>
<head>
<meta charset="utf-8">
<title>Ligature tests</title>
<!-- For example to work:
1. The typekit stack should contain FF Tisa Web Pro with default subset.
2. Droid Serif should be installed on the system (with a complete subset).
-->
<script type="text/javascript" src="//use.typekit.com/hen2cfo.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
@vincentbernat
vincentbernat / gist:1460108
Created December 11, 2011 11:36
Simulation of rt_garbage_collect()
# -*- coding: utf-8 -*-
"""
Simulate route cache with the following assumptions:
1. route cache is never full (things become difficult in this case)
2. route cache is always able to meet its goal (check gc_goal_miss
counter to see if this is your case)
"""
from matplotlib.pylab import *
import random
@vincentbernat
vincentbernat / git2svn
Created March 10, 2012 16:37
My own git2svn
#!/bin/zsh
set -e
# Usage: $0 git-repos svn-repos
#
# Both repositories should be initialized. A tag will be added to the
# git repository to remember the last synced position.
GIT_DIR=$1
@vincentbernat
vincentbernat / harmony.xml
Created April 22, 2012 18:38
XBMC configuration with Logitech Harmony Remote and iMON
<keymap>
<global>
<keyboard>
<end>XBMC.ShutDown()</end>
<f1>XBMC.ActivateWindow(MusicLibrary)</f1>
<f2>XBMC.ActivateWindow(Videos,TvShowTitles)</f2>
<f3>XBMC.ActivateWindow(Videos,MovieTitles)</f3>
<f4>XBMC.ActivateWindow(Weather)</f4>
<f5>XBMC.PlayerControl(Partymode)</f5>
<two>JumpSMS2</two>
From a1631d9ee1bf27f0417af8733229f550f08672f9 Mon Sep 17 00:00:00 2001
From: Vincent Bernat <bernat@luffy.cx>
Date: Tue, 9 Oct 2012 23:19:35 +0200
Subject: [PATCH] Make timers local so that they don't mangle each others.
---
init.lua | 2 ++
1 file changed, 2 insertions(+)
diff --git a/init.lua b/init.lua
@vincentbernat
vincentbernat / bench.py
Created December 14, 2012 21:34 — forked from anonymous/bench.py
Trying to get efficient indexes with MongoDB
#!/usr/bin/env python
from pymongo import Connection, ASCENDING, DESCENDING
from datetime import datetime
c = Connection()
db = c['asynctask']
# Will select about 7/10 of the logs
now = datetime.now()
half = datetime(2012, 12, 13, 20, 30, 30, 0)