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
class shared_dict(): | |
def __init__(self): | |
self.values = dict().copy() | |
self.shmem = mmap.mmap(-1, 40000, mmap.MAP_SHARED) | |
self.lock = mmap.mmap(-1, 1024, mmap.MAP_SHARED|mmap.MAP_ANONYMOUS) | |
def save(self): | |
self.__lock() | |
self.shmem.seek(0) |
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
from pyes import * | |
conn = ES('127.0.0.1:9500') | |
try: | |
conn.delete_index('accept-index') | |
conn.delete_index('reject-index') | |
except: | |
pass |
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
#include <time.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <pthread.h> | |
#include <sys/stat.h> | |
#define NUM_THREADS 5 | |
#define MAXPATHSIZE 1024 |
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 python | |
from gevent import monkey | |
monkey.patch_all() | |
import sys | |
import redis | |
import urllib2 | |
import traceback | |
from cgi import escape | |
# -- gsdproxy |
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
Iozone: Performance Test of File I/O | |
Version $Revision: 3.308 $ | |
Compiled for 64 bit mode. | |
Build: linux | |
Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins | |
Al Slater, Scott Rhine, Mike Wisner, Ken Goss | |
Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR, | |
Randy Dunlap, Mark Montague, Dan Million, Gavin Brebner, | |
Jean-Marc Zucconi, Jeff Blomberg, Benny Halevy, |
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
lxc.utsname = takkun | |
lxc.network.type = veth | |
lxc.network.flags = up | |
lxc.network.link = br0 | |
lxc.network.veth.pair = br0_vm0 | |
lxc.network.hwaddr = 4a:59:43:49:79:bf | |
lxc.network.ipv4 = 192.168.66.2/24 | |
lxc.network.name = eth0 | |
lxc.tty = 4 | |
lxc.pts = 1024 |
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
from bottle import route, run, debug, abort, request, ServerAdapter, response, get, post | |
import redis | |
import json | |
import gevent | |
from gevent import monkey | |
monkey.patch_all() | |
QUEUESET = 'QUEUESET' | |
UUID_SUFFIX = ':UUID' | |
QUEUE_SUFFIX = ':queue' |
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 | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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 | |
if [ ${#} != 1 ] ; then | |
echo "Usage ${0/*\/} file" | |
exit | |
fi | |
file=$1 | |
ext=${file/*./} | |
sub_id=$(mkvinfo ${file} | awk ' |
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
$ go run client.go | |
2012/03/28 22:30:21 client: connected to: 127.0.0.1:8000 | |
Client: Server public key is: | |
[48 129 159 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 129 141 0 48 129 137 2 129 129 0 188 73 207 11 137 150 106 118 45 27 12 18 76 183 252 31 22 193 109 43 118 130 188 244 197 136 26 55 239 51 225 67 171 20 87 35 107 190 16 158 181 84 225 159 112 70 131 173 136 181 130 151 156 4 142 141 218 100 116 219 228 211 136 155 179 220 50 21 181 134 211 72 22 38 226 51 170 165 39 65 231 3 15 26 54 193 142 242 28 66 96 88 138 237 217 65 144 89 231 177 179 200 116 30 45 148 174 56 57 244 29 17 8 22 86 54 215 14 207 55 223 164 216 184 21 46 29 233 2 3 1 0 1] <nil> | |
2012/03/28 22:30:21 client: handshake: true | |
2012/03/28 22:30:21 client: mutual: true | |
2012/03/28 22:30:21 client: wrote "Hello\n" (6 bytes) | |
2012/03/28 22:30:21 client: read "Hello\n" (6 bytes) | |
2012/03/28 22:30:21 client: exiting | |
$ |
OlderNewer