摘要: 常用加解密 1. md5 加密 import hashlib def private_passwd(passwd: str) -> str: return hashlib.md5(passwd.encode(encoding='UTF-8')).hexdigest() 2. base64 加解密 i 阅读全文
posted @ 2021-09-30 09:37 tt_贝塔 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 1. 多线程使用 多线程共享全局变量,利用互斥锁解决资源竞争 # -*- coding: utf-8 -*- import threading import time import os def sell_ticket(tid): """售票""" global num while True: lo 阅读全文
posted @ 2021-09-28 18:58 tt_贝塔 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 1. 安装 pt-online-schema-change 工具 可进行修改表结构:包括增加表字段、修改表字段、增加表索引等 wget https://www.percona.com/downloads/percona-toolkit/3.0.8/binary/tarball/percona-too 阅读全文
posted @ 2021-09-16 19:04 tt_贝塔 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 1. GET 请求 Content-Type: application/json;charset=utf-8 import requests url = "http://xxxx" body = {"name": "zhangsan"} headers = {"Content-Type": "app 阅读全文
posted @ 2021-09-14 18:13 tt_贝塔 阅读(38) 评论(0) 推荐(0) 编辑
摘要: 1.cmd 或 powersehll 执行 .exe文件,关闭 cmd 或 powershell 窗口后,运行的.exe进程会自动杀掉 解决方法:先创建一个.bat文件:如 test.bat 内容如下 if "%1" == "h" goto begin mshta vbscript:createob 阅读全文
posted @ 2021-09-09 20:07 tt_贝塔 阅读(843) 评论(0) 推荐(0) 编辑
摘要: python 查看系统类型 # -*- coding: utf-8 -*- import platform from logger import logger def is_platform() -> str: type = platform.system() if type in ["Window 阅读全文
posted @ 2021-09-01 18:35 tt_贝塔 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 1. filter filter() 函数用于过滤序列,过滤掉不符合条件的元素,返回由符合条件元素组成的新列表。 用法:filter(function, iterable) infoList= { "Response": { "RequestId": "9d268c8f-26c4-d41d-cdcd 阅读全文
posted @ 2021-08-30 16:32 tt_贝塔 阅读(717) 评论(0) 推荐(0) 编辑
摘要: 1. git clone xxx 2. 解决方法 控制面板 》用户账户 》管理你的凭据 》Windows 凭据 阅读全文
posted @ 2021-08-27 17:25 tt_贝塔 阅读(342) 评论(0) 推荐(0) 编辑
摘要: # -*- coding=utf-8 -*- import random import string def random_name(len: int) -> str: """生成随机字符串""" str_list = [random.choice(string.digits + string.as 阅读全文
posted @ 2021-08-26 19:58 tt_贝塔 阅读(44) 评论(0) 推荐(0) 编辑
摘要: 1.#!/usr/bin/env在脚本中的作用 在 linux 的一些脚本,需在开头一行指定脚本的解释程序,如: #!/usr/bin/env bash #!/usr/bin/bash #!/usr/bin/env python 告诉操作系统执行这个脚本的时候,调用 /usr/bin 下的 pyth 阅读全文
posted @ 2021-08-25 11:47 tt_贝塔 阅读(400) 评论(0) 推荐(0) 编辑