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
# Scrapyd local proxy for basic authentication. | |
# Don't forget iptables rule. | |
# iptables -A INPUT -p tcp --destination-port 6800 -s ! 127.0.0.1 -j DROP | |
server { | |
listen 6801; | |
location ~ /\.ht { | |
deny all; | |
} |
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 json, urllib | |
jlist = urllib.urlopen('http://letushide.com/export/json/http,all,all/').read() | |
print(''.join(['%s://%s:%s/\n' % (j['protocol'].lower(), j['host'], j['port']) for j in json.loads(jlist)])), |
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 argparse | |
import requests | |
DEFAULT_LANG = 'fr' | |
SOURCE_LANG = 'en' | |
def translate_text(text, trans_lang=DEFAULT_LANG, source_lang=SOURCE_LANG): | |
url = "http://translate.google.com/translate_a/" \ | |
"t?client=p&text={}&sl={}&tl={}".format(text, source_lang, trans_lang) |