perloader

python+selenium+chrome使用socks5代理

chrome_options = webdriver.ChromeOptions() chrome_options.add_argument(‘–proxy-server=socks5://localhost:1080’) browser = webdriver.Chrome(chrome_options=chrome_options) browser.get(‘http://myip.ms’)

.

Read more

Debian 9 安装pure-ftpd

apt-get install pure-ftpd 8.添加ftp用户组 groupadd ftpgroup 9.增加ftp用户 useradd -G ftpgroup music 10.创建一个用户的上传目录 mkdir -p /data/music 11.添加一个pure-ftpd用户 pure-pw useradd music -u music -d /data/music 12.生成数据库文件 pure-pw mkdb 13.添加目录的用户权限 chown music /data/music 14.启动pure-ftpd pure-ftpd -j -lpuredb:/etc/pure-ftpd/pureftpd.pdb & ps -ef|grep pure-ftpd kill -9 xxx 这样你就可以顺利使用pure-ftp了, systemctl status apache2 /etc/apache2/sites-enabled 000-default.conf里面添加 <VirtualHost *:80> ServerName xxx.com DocumentRoot /var/www/html/d2 <Directory /> […]

.

Read more

Python 安装 fitz 模块

先下载安装 traits‑5.0.0‑cp35‑cp35m‑win_amd64.whl https://www.lfd.uci.edu/~gohlke/pythonlibs/#traits 然后pip install fitz

.

Read more

wordpress添加类似Tags的标签

下载使用 Toolset Type 插件, 在相应的主题文件中添加: echo get_the_term_list( $post->ID, ‘artist’, ‘<p><strong>Artist: </strong>’, ‘, ‘, ‘</p>’); 即可在前台调用。

.

Read more

shell 编程

一键删除创建时间大于720分钟的文件 #!/bin/bash find /data/backup/* -cmin +720 -exec rm {} \; #!/bin/bash echo “Hello World!” for file in $(ls /data/backup/HZ);do echo “file:${file}” echo $file | grep “hello” #echo 字符串1 | grep 字符串2 ,对字符串1进行了匹配,如果有字符串 2的内容,就返回1,如果没有字符串2的内容就返回0。 done  

.

Read more

openload upload api(python 版)

import os import requests import urllib.request import re import hashlib def upto_openload(files): dir0 = str(os.getcwd()).replace(‘\\’, ‘/’) os.chdir(dir0) sha1 = hashlib.sha1() BLOCKSIZE = 65536 with open(files, ‘rb’) as afile: buf = afile.read(BLOCKSIZE) while len(buf) > 0: sha1.update(buf) buf = afile.read(BLOCKSIZE) sha1_hash = sha1.hexdigest() url = “https://api.openload.co/1/file/ul?login={login}&key={key}&sha1={sha1}”.format( login=’xxxxxxx’, key=’xxxxxx’, sha1=sha1_hash, ) p = { ‘url’: url, ‘headers’: […]

.

Read more

挂载2T以上硬盘

parted /dev/sdb ‘mkpart primary 0 -1’ parted /dev/sdc ‘mkpart primary 0 -1’ parted /dev/sdd ‘mkpart primary 0 -1’ mkfs -t ext4 /dev/sdb mkfs -t ext4 /dev/sdc mkfs -t ext4 /dev/sdd mount -t ext4 /dev/sdb /data mount -t ext4 /dev/sdc /data1 mount -t ext4 /dev/sdd /data2 blkid /dev/sdb 24ece9d8-1c1c-4926-82b5-ed07d99af6f6 在文件 /etc/fstab 中加入 UUID=24ece9d8-1c1c-4926-82b5-ed07d99af6f6 /data ext4 defaults […]

.

Read more

Python 使用SOCKS5代理

socks.set_default_proxy(socks.SOCKS5, ‘127.0.0.1’, 7769) socket.socket = socks.socksocket opener = urllib.request.build_opener() opener.addheaders = [(‘User-agent’, ‘Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.76 Mobile Safari/537.36’)] urllib.request.install_opener(opener) urllib.request.urlretrieve(imgurl, imgurl.split(‘/’)[-1]) proxy = ‘127.0.0.1:7769’ proxies = { ‘http’: ‘http://’ + proxy, ‘https’: ‘https://’ + proxy, } try: response = requests.get(page,headers=headers, proxies=proxies) data=response.text except requests.exceptions.ConnectionError as e: print(‘Error’, […]

.

Read more

.htaccess 和 nginx 重定向

AddDefaultCharset utf-8 RewriteEngine on RewriteRule rgj.png https://xxx.com [L,R=301] RewriteRule rgm.png https://xxx.com [L,R=301] rewrite rgj.png https://xxx.com permanent; rewrite rgm.png https://xxx.com permanent; rewrite ^/rg/rgj.png https://xxx.com permanent; rewrite ^/rg/rgm.png https://xxx.com permanent;  

.

Read more
xyz