This file contains 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 | |
file_name="text.gif" | |
for name in * | |
do | |
file_name=${name%.*} | |
echo "ffmpeg -i $name mp4/$file_name.mp4" | |
ffmpeg -i $name mp4/$file_name.mp4 | |
done |
This file contains 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 selenium import webdriver | |
from selenium.webdriver.chrome.options import Options | |
options = Options() | |
options.add_argument('--headless') | |
driver = webdriver.Chrome(options=options) | |
driver.get('http://baidu.com') | |
print(driver.current_url) |
This file contains 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
def get_logger(log_path): | |
logger = logging.getLogger(__name__) | |
logger.setLevel(logging.DEBUG) | |
st_handler = logging.StreamHandler(sys.stderr) | |
st_handler.setLevel(logging.DEBUG) | |
st_handler.setFormatter(logging.Formatter( | |
'%(asctime)s %(levelname)s: %(message)s ' | |
'[in %(pathname)s:%(lineno)d]')) | |
file_handler = RotatingFileHandler(log_path, |
This file contains 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
def split_list(li, chunks=1): | |
for i in range(0, len(li), chunks): | |
yield li[i:i+chunks] |
This file contains 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
# coding: utf-8 | |
# use module pycryptodome | |
from Crypto import Random | |
from Crypto.Cipher import PKCS1_OAEP | |
from Crypto.Hash import MD5, SHA, SHA1, SHA256, SHA384, SHA512 | |
from Crypto.PublicKey import RSA | |
from Crypto.Signature import PKCS1_v1_5 | |
from Crypto.Util import number |
This file contains 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 | |
# 移除掉旧的版本 | |
sudo yum remove docker \ | |
docker-client \ | |
docker-client-latest \ | |
docker-common \ | |
docker-latest \ | |
docker-latest-logrotate \ | |
docker-logrotate \ | |
docker-selinux \ |
This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am kadaliao on github. | |
* I am kadaliao (https://keybase.io/kadaliao) on keybase. | |
* I have a public key ASBIcqEdc6oBkcHJyH0NbyARfgSacweeqa3Lvw8PMj49fQo | |
To claim this, I am signing this object: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
""" | |
演示外部排序-桶排序 | |
拆分大文件到固定尺寸的桶中,桶内进行排序之后,再合并成排序好的大文件。 | |
""" | |
import os | |
import shutil | |
import random | |
from math import ceil |
OlderNewer