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
# 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
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
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
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
#!/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 |
NewerOlder