原创 利用Python my-replication讀取mysql的binlog

一、準備 Python 2.7; Python 3.4 or Python 3.5 or Python 3.6; MySQL 5.5 or MySQL 5.6 or MySQL 5.7; 二、Mysql 配置 1. Mysq

原创 Python 3 和 Django 常用安裝包

Python 標準庫 併發與並行 multiprocessing – (Python 標準庫) 基於進程的“線程”接口。 threading – (Python 標準庫)更高層的線程接口。 第三方包 包名 包命令

原创 Python 列表切割(用於多進程)

話不多,上代碼。 def get_chunks(iterable, chunks=1): # This is from http://stackoverflow.com/a/2136090/2073595 lst

原创 Nginx CORS 跨域解決方案配置

http://www.imooc.com/article/21976 https://my.oschina.net/u/260715/blog/796673

原创 安裝 redis 和 twemproxy 配置

一、準備 redis 官網 twemproxy下載 二、安裝 Redis 安裝 wget http://download.redis.io/releases/redis-5.0.8.tar.gz tar -zxvf redis-*

原创 Python3.7 Linux docx和doc文檔轉碼文本

Python3.7 轉碼文本 Docx 轉文本 安裝 pip3 install python-docx #!/usr/bin/python3.7 def doc2text(): doc = Document( filename

原创 Tampermonkey 文檔

@doc https://www.tampermonkey.net/documentation.php 目錄 @name @name 腳本的名字 @namespace @namespace 腳本的命名空間 @versio

原创 Python打開不同編碼文件

import sys, os, chardet files = [ 'utf8.txt', 'gb2312.txt', ] for filename in files: # 採樣長度,最長採樣長度爲100,可調節 sam

原创 網頁版微信自動羣發消息

操作步驟: 登陸網頁版微信 打開開發者工具 打開 console 控制檯 粘貼一下代碼到控制檯並回車 實現原理 遍歷好友列表 修改輸入框文本 點擊發送 // 拿到所有聊天對象(僅限當前網頁上展示的內容) var chat_

原创 修改Mysql步長及偏移量

可以修改系統變量 auto_increment_increment 查看步長信息 mysql> SHOW VARIABLES LIKE 'auto_inc%'; +--------------------------+-----

原创 Git 常用命令

基礎使用 配置信息 git config --global user.name 'webben' git config --global user.email [email protected] #忽略權限 git config -

原创 supervise 守護進程

一、supervise二進制文件 通過二進制supervise文件可以直接對進程進行守護,二進制文件下載 ./supervise -f 要守護的程序 -p 守護信息存儲位置 例如: ./supervise -f http_serv

原创 北京時間接口(淘寶、蘇寧、QQ)

時間接口: 平臺 接口 淘寶 http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp 蘇寧 http://quan.suning.com

原创 Python 日期時間模塊 Arrow庫

我個人在 Python 中經常使用 arrow 模塊替代datetime模塊,個人認爲非常好用, 文檔 Github:https://github.com/crsmithdev/arrow/ Doc : https://arrow

原创 Python 包的編寫與使用

一、模塊(Module) 創建一個 文件夾 或者 文件。 ├── run.py ├── calculate │ ├── add.py │ ├── divde.py │ ├── multi.py │ └── su