mirror of
https://github.com/teddysun/across.git
synced 2025-04-22 20:09:32 +08:00
Merge 023f41f27706bc9609fa15c0c17794102bfee4c2 into b2b6aaab1c9aba74bf236a286e5fe0066c2f081f
This commit is contained in:
commit
88a17817ad
40
Readme.md
40
Readme.md
@ -1,5 +1,29 @@
|
|||||||
# Some useful scripts
|
# 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
|
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 -m,--mod | Modify a user password |
|
||||||
| l2tp -h,--help | Print this help information |
|
| l2tp -h,--help | Print this help information |
|
||||||
```
|
```
|
||||||
|
***
|
||||||
bbr.sh
|
bbr.sh
|
||||||
======
|
======
|
||||||
|
- 一键升级内核以支持谷歌bbr加速技术
|
||||||
- Description: Auto install latest kernel for TCP BBR
|
- Description: Auto install latest kernel for TCP BBR
|
||||||
- Intro: https://teddysun.com/489.html
|
- Intro: https://teddysun.com/489.html
|
||||||
|
***
|
||||||
bench.sh
|
bench.sh
|
||||||
========
|
========
|
||||||
|
- vps性能及连接速度测试
|
||||||
- Description: Auto test download & I/O speed script
|
- Description: Auto test download & I/O speed script
|
||||||
- Intro: https://teddysun.com/444.html
|
- Intro: https://teddysun.com/444.html
|
||||||
```bash
|
```bash
|
||||||
@ -38,7 +62,7 @@ Usage:
|
|||||||
| 3 | wget -qO- 86.re/bench.sh | bash |
|
| 3 | wget -qO- 86.re/bench.sh | bash |
|
||||||
| 4 | curl -so- 86.re/bench.sh | bash |
|
| 4 | curl -so- 86.re/bench.sh | bash |
|
||||||
```
|
```
|
||||||
|
***
|
||||||
backup.sh
|
backup.sh
|
||||||
=========
|
=========
|
||||||
|
|
||||||
@ -61,20 +85,20 @@ For i386:
|
|||||||
wget -O /usr/bin/gdrive http://dl.lamp.sh/files/gdrive-linux-386
|
wget -O /usr/bin/gdrive http://dl.lamp.sh/files/gdrive-linux-386
|
||||||
chmod +x /usr/bin/gdrive
|
chmod +x /usr/bin/gdrive
|
||||||
```
|
```
|
||||||
|
***
|
||||||
ftp_upload.sh
|
ftp_upload.sh
|
||||||
=============
|
=============
|
||||||
|
|
||||||
- You must modify the config before run it
|
- You must modify the config before run it
|
||||||
- Upload file(s) to FTP server
|
- Upload file(s) to FTP server
|
||||||
- Intro: https://teddysun.com/484.html
|
- Intro: https://teddysun.com/484.html
|
||||||
|
***
|
||||||
unixbench.sh
|
unixbench.sh
|
||||||
============
|
============
|
||||||
|
|
||||||
- Description: Auto install unixbench and test script
|
- Description: Auto install unixbench and test script
|
||||||
- Intro: https://teddysun.com/245.html
|
- Intro: https://teddysun.com/245.html
|
||||||
|
***
|
||||||
pptp.sh(Deprecated)
|
pptp.sh(Deprecated)
|
||||||
===================
|
===================
|
||||||
|
|
||||||
|
99
cet_query.py
Normal file
99
cet_query.py
Normal file
@ -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)
|
0
ftp_upload.sh
Normal file → Executable file
0
ftp_upload.sh
Normal file → Executable file
4
install-docker.sh
Executable file
4
install-docker.sh
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
echo "开始安装docker"
|
||||||
|
wget -qO- https://get.docker.com/ | sh
|
7
newlinux.sh
Executable file
7
newlinux.sh
Executable file
@ -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
|
3
python3.5-for-spider.sh
Executable file
3
python3.5-for-spider.sh
Executable file
@ -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
|
16
setup-ss-test.sh
Normal file
16
setup-ss-test.sh
Normal file
@ -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
|
60
setup-ssr-with-net_speeder.sh
Executable file
60
setup-ssr-with-net_speeder.sh
Executable file
@ -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
|
0
unixbench.sh
Normal file → Executable file
0
unixbench.sh
Normal file → Executable file
Loading…
x
Reference in New Issue
Block a user