This file contains hidden or 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
# Copyright 2009 Brian Quinlan. All Rights Reserved. | |
# Licensed to PSF under a Contributor Agreement. | |
"""Execute computations asynchronously using threads or processes.""" | |
__author__ = 'Brian Quinlan ([email protected])' | |
from concurrent.futures._base import (FIRST_COMPLETED, | |
FIRST_EXCEPTION, | |
ALL_COMPLETED, |
This file contains hidden or 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 threading | |
import urllib2 | |
import time, random | |
class GrabUrl(threading.Thread): | |
def __init__(self, arg0): | |
threading.Thread.__init__(self) | |
self.host=arg0 | |
def run(self): | |
k=random.randint(10,20) |
This file contains hidden or 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 | |
# create self-signed server certificate: | |
read -p "Enter your domain [www.example.com]: " DOMAIN | |
echo "Create server key..." | |
openssl genrsa -des3 -out $DOMAIN.key 1024 |
This file contains hidden or 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/env python | |
import urllib2, httplib | |
handler=urllib2.HTTPHandler(debuglevel=1) | |
opener = urllib2.build_opener(handler) | |
urllib2.install_opener(opener) | |
url = "http://www.baidu.com" | |
print urllib2.urlopen(url).read()[:10] |
This file contains hidden or 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/env python | |
import urllib2 | |
from multiprocessing.dummy import Pool as ThreadPool | |
import redis | |
hosts_d = { | |
"host1": [6360, 6361, 6362, 6363], |
This file contains hidden or 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 | |
sudo su - | |
wget http://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-proxy-1.6.0.tar.gz | |
tar xvzf dnscrypt-proxy-1.6.0.tar.gz | |
cd dnscrypt-proxy-1.6.0 | |
./configure | |
make | |
make install | |
cd .. |
This file contains hidden or 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/env python | |
""" | |
https://github.com/juliensobrier/google-safe-browsing-lookup-python | |
""" | |
import safebrowsinglookup | |
API_KEY = "" |
This file contains hidden or 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 | |
accept_net="124.205.206.0/24 124.254.7.0/24 119.161.240.0/24 211.152.0.0/16 10.0.11.17/32 10.0.11.11/32 59.151.16.0/24 10.9.1.0/24" | |
/sbin/iptables -F | |
/sbin/iptables -Z | |
/sbin/iptables -X | |
/sbin/iptables -P INPUT DROP | |
/sbin/iptables -P OUTPUT DROP |
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
import subprocess | |
def shell(cmd): | |
""" 执行命令. |
This file contains hidden or 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 ldap | |
import base64 | |
import hashlib | |
import binascii | |
import ldap.modlist as modlist | |
import subprocess | |