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
from timeit import Timer | |
_URL = 'https://baidu.com' | |
_NUMBER = 10 | |
def test_urllib(): | |
import urllib.request | |
import urllib.error | |
try: | |
response = urllib.request.urlopen(_URL) |
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 | |
for i in `ls | grep pvm` #要重命名的文件 | |
do mv $i `echo $i | sed 's/.pvm//'` #去除.pvm字段 | |
done |
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/python | |
# -*- coding: UTF-8 -*- | |
import smtplib | |
from email.mime.text import MIMEText | |
from email.header import Header | |
from email.mime.multipart import MIMEMultipart | |
import mimetypes | |
import sys,os |
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/python3 | |
# coding: utf-8 | |
# Author: EMo | |
import http.client,sys | |
def get_url(host): | |
""" 将域名转换为URL(是否协议与WWW判断) """ | |
global datas | |
conn = http.client.HTTPConnection(host,timeout=3) |
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
# 根据IP和PORT的csv文件,生成URL | |
def targetUrl(filename): | |
urllist = list() | |
with open(filename,"rU") as f: | |
reader = csv.DictReader(f) | |
for row in reader: | |
geturl = { | |
'443': lambda :"https://{}".format(row['IP']), | |
'8080': lambda :"http://{}:{}".format(row['IP'],row["PORT"]), |
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 | |
if [[ $# < 2 ]];then | |
echo "please assign Minnum and Maxnums!" | |
exit 0 | |
fi | |
min=$1; | |
max=$2-$1; | |
num=$RANDOM | |
((retnum=num%max+min)) | |
echo $retnum; |
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
# encoding:utf-8 | |
import io | |
import sys | |
import os | |
def uniq_set(file): | |
u_set = set() |
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 | |
# Author: ErDog | |
# 为了协调Mac上readlink -f无法使用,与脚本功能无关 | |
TARGET_FILE=$0 | |
cd `dirname $TARGET_FILE` | |
TARGET_FILE=`basename $TARGET_FILE` | |
while [ -L "TARGET_FILE" ] | |
do | |
TARGET_FILE=`readlink TARGET_FILE` |
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
# 去除domainArchive的无效文件,保证数据合理性 | |
cmd = "find . -name \"*\" -type f -size 0c | xargs -n 1 rm -f" | |
sub = subprocess.call(cmd,shell=True) | |
if sub == 0: | |
print("Clear vaild file success!") | |
# 获取domainArchive中的domain文件列表 | |
cmd = "ls | grep '[0-9]'" | |
stdout = subprocess.check_output(cmd,shell=True) |
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/python | |
# -*- coding=utf-8 -*- | |
# | |
# Author:EMo | |
import requests | |
import re | |
import io | |
import os | |
import sys |
NewerOlder