diff --git a/Readme.md b/Readme.md index ff2dcba..82a5d36 100644 --- a/Readme.md +++ b/Readme.md @@ -1,5 +1,29 @@ # Some useful scripts +# 一些有用的脚本 + +setup-ssr-with-net_speeder.sh +=================== +##### 一键搭建SSR脚本 +- 支持自选混淆协议,加密协议,自定义docker名字和端口 +- 来自其他人的镜像 +*** +python3.5-for-spider.sh +=================== +##### 一键运行单个的python脚本 +- 含有python3.5,requsets, beautifulsoup4 +- 运行此脚本时,接收一个参数,参数为要运行的脚本的文件名,例如"./python3.5-for-spider.sh example.py" +- 需要docker环境的支持 +*** +newlinux.sh +=================== +##### 用来在新的linux上安装必要环境 +- 含有screenfetch mycli speedometer shadowsocks 以及java8 +*** +install-docker.sh +=================== +##### docker安装脚本 +*** l2tp.sh ======= @@ -16,16 +40,16 @@ Usage: l2tp [-l,--list|-a,--add|-d,--del|-m,--mod|-h,--help] | l2tp -m,--mod | Modify a user password | | l2tp -h,--help | Print this help information | ``` - +*** bbr.sh ====== - +- 一键升级内核以支持谷歌bbr加速技术 - Description: Auto install latest kernel for TCP BBR - Intro: https://teddysun.com/489.html - +*** bench.sh ======== - +- vps性能及连接速度测试 - Description: Auto test download & I/O speed script - Intro: https://teddysun.com/444.html ```bash @@ -38,7 +62,7 @@ Usage: | 3 | wget -qO- 86.re/bench.sh | bash | | 4 | curl -so- 86.re/bench.sh | bash | ``` - +*** backup.sh ========= @@ -61,20 +85,20 @@ For i386: wget -O /usr/bin/gdrive http://dl.lamp.sh/files/gdrive-linux-386 chmod +x /usr/bin/gdrive ``` - +*** ftp_upload.sh ============= - You must modify the config before run it - Upload file(s) to FTP server - Intro: https://teddysun.com/484.html - +*** unixbench.sh ============ - Description: Auto install unixbench and test script - Intro: https://teddysun.com/245.html - +*** pptp.sh(Deprecated) =================== diff --git a/backup.sh b/backup.sh old mode 100644 new mode 100755 diff --git a/bbr.sh b/bbr.sh old mode 100644 new mode 100755 diff --git a/bench.sh b/bench.sh old mode 100644 new mode 100755 diff --git a/cet_query.py b/cet_query.py new file mode 100644 index 0000000..8849918 --- /dev/null +++ b/cet_query.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python3 +#coding=utf-8 + + +def text(files): + with open('cet.txt','w+') as f: + f.write(files) + +def read_text(): + with open('cet.txt','r') as f: + data = f.read() + return data + +import requests,os +from time import sleep +from urllib.parse import quote +from bs4 import BeautifulSoup as bs + +proxy = { + 'http':'101.200.44.5:8888' +} + +URL='http://www.chsi.com.cn/cet/' +data = 'query?zkzh={}&xm={}' + +H = {'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', +'Accept-Encoding':'gzip, deflate', +'Accept-Language':'zh-CN,zh;q=0.8', +'Host':'www.chsi.com.cn', +'Referer':'http://www.chsi.com.cn/cet/', +'Upgrade-Insecure-Requests':'1', +'User-Agent':'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36', +} + +def query(id__,name): + s = requests.Session() + req = s.get(URL,headers=H) + + if req.ok : + url = URL + data.format(id__,quote(name)) + req = requests.get(url,headers=H,cookies=req.cookies) + return req.text + else: + print(id__,name,'出错',sep='-->') + return False + + +def check(html): + soup = bs(html,'html.parser') + + if soup.find('div',{"class":"error alignC marginT20"}): + return False + elif soup.find('div',{"class":"error alignC"}): + print("缺少验证码") + return False + else: + return True + +#html = read_text() +def parse(html): + soup = bs(html,'html.parser') + + table = soup.find('table',{"border":"0","align":"center"}) + + string = '' + for n in table.getText().split(): + string += n + + return string + + +def append_file(string): + with open('cet.txt','a+') as f: + f.writelines(string + os.linesep) + +number = 420550171103500,420550171103600 ### 420550171103524 贺深 + + +### testing +'''text = query(420550171103524,'贺深') +if check(text): + print(parse(text)) +else: + print('没有') +exit(0)''' +### testing end +names = ['张嘉迪'] +for num in range(1,11): + for zkzh in [i for i in range(*number)]: + for xm in names: + text = query(zkzh,xm) + if check(text): + result = parse(text) + print(result) + append_file(result) + continue + else: + print(zkzh,xm,sep='-->') + sleep(10) diff --git a/ftp_upload.sh b/ftp_upload.sh old mode 100644 new mode 100755 diff --git a/install-docker.sh b/install-docker.sh new file mode 100755 index 0000000..f18edae --- /dev/null +++ b/install-docker.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -e +echo "开始安装docker" +wget -qO- https://get.docker.com/ | sh diff --git a/l2tp.sh b/l2tp.sh old mode 100644 new mode 100755 diff --git a/newlinux.sh b/newlinux.sh new file mode 100755 index 0000000..a53e0a5 --- /dev/null +++ b/newlinux.sh @@ -0,0 +1,7 @@ +sudo apt install screenfetch mycli speedometer shadowsocks +sudo add-apt-repository ppa:webupd8team/java +sudo apt-get update +#sudo apt-get install oracle-java8-installer oracle-java8-set-default +sudo add-apt-repository ppa:hzwhuang/ss-qt5 +sudo apt-get update +sudo apt-get install shadowsocks-qt5 diff --git a/pptp.sh b/pptp.sh old mode 100644 new mode 100755 diff --git a/python3.5-for-spider.sh b/python3.5-for-spider.sh new file mode 100755 index 0000000..ae20fa6 --- /dev/null +++ b/python3.5-for-spider.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -e +docker run -it --rm --name my-running-script -v `pwd`:/usr/src/myapp -w /usr/src/myapp ddv12138/python:3.5 python $1 diff --git a/setup-ss-test.sh b/setup-ss-test.sh new file mode 100644 index 0000000..503d365 --- /dev/null +++ b/setup-ss-test.sh @@ -0,0 +1,16 @@ +FROM ubuntu + +ENV SSR_URL https://github.com/shadowsocksr-backup/shadowsocksr.git +ENV SS_PORT 6666 +ENV SS_PASSWD liukang951006 +ENV SS_METH aes-256-cfb #encryption method +ENV SS_OBFS http_simple #obfsplugin + +RUN set -ex \ + && apt update \ + && apt install -y python-pip python-dev build-essential git \ + && pip install --upgrade pip \ + && git clone ${SSR_URL} \ + && cd ./shadowsocksr/shadowsocks \ + +CMD python server.py -p $SS_PORT -k $SS_PASSWD -m $SS_METH -o $SS_OBFS --fast-open diff --git a/setup-ssr-with-net_speeder.sh b/setup-ssr-with-net_speeder.sh new file mode 100755 index 0000000..49f0464 --- /dev/null +++ b/setup-ssr-with-net_speeder.sh @@ -0,0 +1,60 @@ +#!/bin/bash +set -e + +echo "输入端口号" && read port +echo "输入密码" && read passwd +echo "输入容器名" && read name + +method=('aes-128-ctr' 'aes-192-ctr' 'aes-256-ctr' 'aes-128-cfb' 'aes-192-cfb' 'aes-256-cfb' 'bf-cfb' 'camellia-128-cfb' 'camellia-192-cfb' 'camellia-256-cfb' 'chacha20' 'chacha20-ietf' 'rc4-md5' 'salsa20') +obfs=('plain' 'http_simple' 'http_post' 'random_head' 'tls1.2_ticketauth') +protocol=('orgin' 'auth_sha1_compatible' 'auth_sha1_v2_compatible' 'auth_sha1_v4_compatible' 'auth_aes128_md5_compatible' 'auth_aes128_sha1_compatible') +i=0 +for x in ${obfs[@]}; +do + echo $i ${x} + + i=$[i+1] +done +echo "请选择混淆协议的编号" +read a +obfs=${obfs[$a]} + + + +i=0 +for x in ${protocol[@]}; +do + echo $i ${x} + + i=$[i+1] +done +echo "请选择协议的编号" +read a +protocol=${protocol[$a]} + + + +i=0 +for x in ${method[@]}; +do + echo $i ${x} + + i=$[i+1] +done +echo "method :" +read a +method=${method[$a]} + +echo $obfs $protocol $method + +docker run -d -p $port:$port/tcp -p $port:$port/udp \ + -e ROOT_PASS="$passwd" \ + --name $name \ + lnterface/ssr-with-net_speeder \ + -s 0.0.0.0 \ + -p $port \ + -k $passwd \ + -m $method \ + -o $obfs \ + -O $protocol +docker logs -f $name diff --git a/unixbench.sh b/unixbench.sh old mode 100644 new mode 100755