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 | |
""" | |
nginx log format | |
log_format main '$server_name | $host | $remote_addr | $bytes_sent | $time_local | $request_method | $request_uri | $request_time | $status | $http_referer | $http_x_forwarded_for | $http_user_agent | $gzip_ratio | $connection'; | |
""" | |
import os | |
import sys | |
import time |
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 multiprocessing | |
import time | |
def worker(num): | |
print 'worker:', num |
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
<?php | |
namespace PPI\DataSource\Connection; | |
use DALMP\dalmp; | |
use PPI\DataSource\ConnectionInferface; | |
class Dalmp implements ConnectionInferface | |
{ | |
protected $config = array(); |
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
<?php | |
/** | |
* This code can help to 'benchmark' your sessions | |
*/ | |
$url = 'http://72.55.142.33/nbari/index.php'; | |
function checkSite($url,$page=null) { | |
$cookie = '/tmp/cookie.txt'; | |
$agent = '-( DALMP )-'; |
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
<?php | |
namespace chain; | |
class Chain { | |
public function __construct() { | |
} | |
public function foo() { |
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 | |
""" | |
https://gist.github.com/cammckinnon/3971894 | |
http://stackoverflow.com/questions/1740726/python-turn-string-into-operator | |
http://www.tutorialspoint.com/python/arithmetic_operators_example.htm | |
http://erezsh.wordpress.com/2012/11/18/how-to-write-a-calculator-in-50-python-lines-without-eval/ | |
""" | |
import re |
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 socket import * | |
import sys | |
s = socket(AF_INET, SOCK_DGRAM) | |
host = sys.argv[1] | |
port = 8000 | |
buf = 1024 | |
addr = (host, port) |
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 | |
import os | |
import requests | |
import uuid | |
from random import randint | |
from uuid import uuid4 | |
def read_in_chunks(file_object, chunk_size=65536): | |
while True: |
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 | |
exec 2>&1 | |
# | |
# SMTP service | |
# | |
QMAIL="/var/qmail" | |
ME="`head -1 $QMAIL/control/me`" | |
CONCURRENCY=${CONCURRENCY:=50} | |
QUSER="qmaild" |
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 | |
exec 2>&1 | |
# | |
# SMTP service | |
# | |
QMAIL="/var/qmail" | |
ME="`head -1 $QMAIL/control/me`" | |
CONCURRENCY=${CONCURRENCY:=50} | |
QUSER="qmaild" |
OlderNewer