09 2024 档案

摘要:安装 apt install mysql-server; 初始化 mysql_secure_installation 设置密码 set global validate_password_policy=LOW; SET GLOBAL validate_password.length = 6; ALTE 阅读全文
posted @ 2024-09-25 10:49 vx_guanchaoguo0 阅读(79) 评论(0) 推荐(0) 编辑
摘要:apt-get install doxygen doxygen-doc doxygen-gui graphviz 阅读全文
posted @ 2024-09-15 16:45 vx_guanchaoguo0 阅读(5) 评论(0) 推荐(0) 编辑
摘要:查看版本 python --version python2 --version python3 --version 修改系统默认python版本 没有正常的 update-alternatives --list python 添加到版本管理 update-alternatives --install 阅读全文
posted @ 2024-09-14 17:40 vx_guanchaoguo0 阅读(63) 评论(0) 推荐(0) 编辑
摘要:同步下载 def download_file_block(url: str, file_path: str): logging.basicConfig(level=logging.DEBUG) log = logging.getLogger('requests.packages.urllib3') 阅读全文
posted @ 2024-09-14 14:15 vx_guanchaoguo0 阅读(26) 评论(0) 推荐(0) 编辑
摘要:不验证证书减少交互 curl -k -f {$url} -o {dest_path} python requests def download_file_with_requests(url: str, file_path: str): with Session() as session: sessi 阅读全文
posted @ 2024-09-14 14:09 vx_guanchaoguo0 阅读(214) 评论(0) 推荐(0) 编辑
摘要:安装 apt install gdb 查看跟踪信息 strace -T -tt -e trace=all -p pid 查看进程打开的文件 lsof -p pid gdb gdb -p pid 查看上下文 py-list 堆栈 py-bt py-bt-full 变量 py-print py-loca 阅读全文
posted @ 2024-09-14 09:37 vx_guanchaoguo0 阅读(2) 评论(0) 推荐(0) 编辑
摘要:下载 git clone https://github.com/Yggdroot/indentLine.git ~/.vim/pack/vendor/start/indentLine 配置 vim -u NONE -c "helptags ~/.vim/pack/vendor/start/inden 阅读全文
posted @ 2024-09-13 16:09 vx_guanchaoguo0 阅读(12) 评论(0) 推荐(0) 编辑
摘要:https curl 安装 apt install apt-transport-https ca-certificates curl software-properties-common 添加信任秘钥 wget -qO - https://download.sublimetext.com/subli 阅读全文
posted @ 2024-09-13 15:57 vx_guanchaoguo0 阅读(6) 评论(0) 推荐(0) 编辑
摘要:with open('request1.json', 'r',encoding='utf8') as f: data_json = json.load(f) with open('request1.json', 'w', encoding='utf8') as f: json.dump(data_j 阅读全文
posted @ 2024-09-13 11:00 vx_guanchaoguo0 阅读(4) 评论(0) 推荐(0) 编辑
摘要:这个可以再浏览器端处理 test.com a.test.com b.test.com document.domain="test.com"; 阅读全文
posted @ 2024-09-13 09:59 vx_guanchaoguo0 阅读(5) 评论(0) 推荐(0) 编辑
摘要:import asyncio import random import threading from concurrent.futures import ThreadPoolExecutor import time def blocking_task(x): time.sleep(2) thread 阅读全文
posted @ 2024-09-12 18:12 vx_guanchaoguo0 阅读(6) 评论(0) 推荐(0) 编辑
摘要:异步下载文件 async def download_file_with_curl(url: str, destination: str): curl_command = [ "curl", "-k", f"{url}", "-o", destination, ] process = await as 阅读全文
posted @ 2024-09-12 09:39 vx_guanchaoguo0 阅读(22) 评论(0) 推荐(0) 编辑
摘要:线程池 都在一个进程内 GIL 不适合密集型计算 共享进程资源,存在不安全的线程 from concurrent.futures import ThreadPoolExecutor def task(n): return n * 2 if __name__ == '__main__': with T 阅读全文
posted @ 2024-09-12 09:21 vx_guanchaoguo0 阅读(6) 评论(0) 推荐(0) 编辑
摘要:ds: Dataset = read_file(img) for element in ds: if element.tag != pydicom.dataelem.Tag(0x7FE0, 0x0010): tag = element.tag tag_name = element.name valu 阅读全文
posted @ 2024-09-11 18:21 vx_guanchaoguo0 阅读(8) 评论(0) 推荐(0) 编辑
摘要:命令行模式 gunicorn -w 4 -b 0.0.0.0:8000 --access-logfile access.log --error-logfile error.log loglevel debug 配置文件 gunicorn.conf # gunicorn.conf # 并行工作进程数 阅读全文
posted @ 2024-09-10 16:14 vx_guanchaoguo0 阅读(187) 评论(0) 推荐(0) 编辑
摘要:字段dict # Assuming `session` is your SQLAlchemy session user_instance = session.query(User).first() # Convert to Pydantic model dapter = TypeAdapter(Us 阅读全文
posted @ 2024-09-10 15:35 vx_guanchaoguo0 阅读(271) 评论(0) 推荐(0) 编辑
摘要:run_in_executor asyncio.create_task import asyncio from concurrent.futures import ThreadPoolExecutor def run(cron, *args): loop = asyncio.new_event_lo 阅读全文
posted @ 2024-09-06 18:01 vx_guanchaoguo0 阅读(3) 评论(0) 推荐(0) 编辑
摘要:追加参数 python example.py NewYork LosAngeles Chicago 给参数申明 分配内存 Locations: ['NewYork', 'LosAngeles', 'Chicago'] 具体实现 import argparse parser = argparse.Ar 阅读全文
posted @ 2024-09-06 10:08 vx_guanchaoguo0 阅读(4) 评论(0) 推荐(0) 编辑
摘要:Git 全局设置: git config --global user.name "寂寞的钢蛋儿" git config --global user.email "guanchaoguo@qq.com" 创建 git 仓库: mkdir dicom-web cd dicom-web git init 阅读全文
posted @ 2024-09-05 18:15 vx_guanchaoguo0 阅读(6) 评论(0) 推荐(0) 编辑
摘要:查看分支的源头 git reflog show dev 拉出分的分支 (8d6f4f17 提交id) git checkout -b rimag 8d6f4f17 阅读全文
posted @ 2024-09-05 12:54 vx_guanchaoguo0 阅读(4) 评论(0) 推荐(0) 编辑
摘要:安装 sudo apt-get isntall postgresql 登录(无需密码) sudo -u postgres psql 修改密码 alter user postgres with password '123456'; 新密码登录 psql -U postgres -d postgres 阅读全文
posted @ 2024-09-05 11:29 vx_guanchaoguo0 阅读(5) 评论(0) 推荐(0) 编辑
摘要:报错如下 实际设置 需要加上级包名 通过 apps.py 统一处理 阅读全文
posted @ 2024-09-05 10:57 vx_guanchaoguo0 阅读(2) 评论(0) 推荐(0) 编辑
摘要:查看全部运行的服务 systemctl list-units --type=service --state=running 关闭开机自启的服务 sudo systemctl disable orthanc.service sudo systemctl disable orthanc.service 阅读全文
posted @ 2024-09-04 16:25 vx_guanchaoguo0 阅读(3) 评论(0) 推荐(0) 编辑
摘要:失败条件 已存在获取失败 超时任务超时失败 代码 import redis_lock try: lock_key = "xxxx" with redis_lock.Lock(redis_client, lock_key, expire=10): # do something db_session.c 阅读全文
posted @ 2024-09-04 16:16 vx_guanchaoguo0 阅读(3) 评论(0) 推荐(0) 编辑
摘要:回退到需要删除的位置 git reset --hard 09ee2edf9fcef3d79391f98ce62b3428e120ce46 强制推送 git push origin rimag --force 阅读全文
posted @ 2024-09-04 16:02 vx_guanchaoguo0 阅读(2) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示