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
//v26 © 2011 Tynt | |
Tynt = window.Tynt || []; | |
if (typeof Tynt.TIL != "undefined") { | |
} else { | |
(function () { | |
var mainTynt = function () { | |
var body = document.body, | |
documentElement = document.documentElement, | |
isIE = eval("/*@cc_on!@*/false"), | |
repeat = function (a, b) { |
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
""" | |
To install this hg extenstion: | |
open /path/to/repo/.hg/hgrc | |
add this lines: | |
[extenstions] | |
lof=install/lof.py | |
""" | |
#http://selenic.com/pipermail/mercurial/2010-February/029951.html | |
#http://mercurial.selenic.com/wiki/MercurialApi |
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
def application(environ, start_response): | |
from pyinfo import pyinfo | |
output = pyinfo() | |
# or pyinfo([('custom key', 'custom value'), ...]) | |
start_response('200 OK', [('Content-type', 'text/html')]) | |
return [output] |
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
/** | |
* Compile: | |
* $ g++ -Wall -o msync msync.cpp | |
* Usage: | |
* $ msync FILE [WAIT_FACTOR] | |
* WAIT_FACTOR is a float that changes wait time between syncing two | |
* chunks (each CHUNK is 10MB). Wait time is factor of sync time, so | |
* if WAIT_FACTOR is 2.0 (default), if syncing 10MB takes 1 seconds, | |
* the program waits 2 second after that step. | |
*/ |
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
import struct | |
import logging | |
from pymongo import MongoClient | |
import bson | |
from bson.errors import InvalidBSON | |
from pymongo.mongo_replica_set_client import MongoReplicaSetClient | |
logger = logging.getLogger('mongo_dump') |
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
""" | |
Graceful Stopper | |
=================== | |
Tool to stop a TCPServer (or HTTPServer) in a graceful manner (when the all | |
currently running work is done). This script works either for forked servers or | |
single-process servers. | |
The graceful-stop process can be triggered by sending `SIGHUP` to server (in a | |
forked environment, sending SIGHUP to master server, propagates to all | |
children). Server immediately releases the listening socket (so another server |
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/python | |
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected]) | |
# The author disclaims copyright to this source code. | |
import sys | |
import struct | |
import socket | |
import time | |
import select |
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 python2 | |
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected]) | |
# The author disclaims copyright to this source code. | |
# Modifed to send heartbeat requests for both TLS v1.1 and v1.2 | |
import sys | |
import struct | |
import socket |
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/sh | |
# | |
# redis - this script starts and stops the redis-server daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Redis is a persistent key-value database | |
# processname: redis-server | |
# config: /etc/redis/redis.conf | |
# config: /etc/sysconfig/redis | |
# pidfile: /var/run/redis/redis.pid |
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
import yaml | |
yaml.safe_load(""" | |
- &a '1' | |
- &b [*a,*a] | |
- &c [*b,*b] | |
- &d [*c,*c] | |
- &e [*d,*d] | |
- &f [*e,*e] | |
- &g [*f,*f] | |
- &h [*g,*g] |
OlderNewer