上一页 1 ··· 3 4 5 6 7 8 9 10 下一页
摘要: 记录一下 python和k8s交互方式,涵盖配置/configmap/ingress/pod/deployment/serivce等; 封装k8s处理类 from kubernetes import client, config # type: ignore from sites.config im 阅读全文
posted @ 2024-05-08 09:14 干炸小黄鱼 阅读(386) 评论(0) 推荐(0)
摘要: # 卸载/da1或者确保没有进程正在使用它 umount /da1 # 或者如果你不能卸载,确保上面的数据不会被修改 # 文件系统检查 e2fsck -f /dev/VolGroup00/LogVol03 # 缩减文件系统 resize2fs /dev/VolGroup00/LogVol03 102 阅读全文
posted @ 2024-05-07 19:51 干炸小黄鱼 阅读(288) 评论(0) 推荐(0)
摘要: 背景: 特殊原因使用wsl + vscode 开发python, 使用一段时间后突然无法上网了(dns解析失败), 宿主机能正常上网; 1 查看wsl配置 cat /etc/wsl.conf [network] generateResolvConf = false 2 查看wsl ip配置 3 查看 阅读全文
posted @ 2024-04-03 16:39 干炸小黄鱼 阅读(1683) 评论(0) 推荐(0)
摘要: 问题背景: 有个pg查询的sql很慢, 需要优化, 打印出原始sql来explain: from sqlalchemy.dialects import postgresql query = Config.query.all() try: # 引入方言, literal_binds 指定参数全部替换 阅读全文
posted @ 2024-04-01 19:26 干炸小黄鱼 阅读(154) 评论(0) 推荐(0)
摘要: 场景: 输入一段内容, 找到问题集中跟该内容最相似的问题 import jieba from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics.pairwise import cosine_simi 阅读全文
posted @ 2024-03-26 16:55 干炸小黄鱼 阅读(106) 评论(0) 推荐(0)
摘要: def merge(lists): list.sort(key=lamba x: x[0]) merges = [] for l in list: if not merges or l[0] > merges[-1][1] merges.append(l) else: merges[-1][1] = 阅读全文
posted @ 2024-02-28 20:01 干炸小黄鱼 阅读(56) 评论(0) 推荐(0)
摘要: import time class LocalStrategy: def execute(self): print("this is a local 104 execute") class SaasStrategy: def execute(self): print("this is a saas 阅读全文
posted @ 2024-02-28 19:57 干炸小黄鱼 阅读(30) 评论(0) 推荐(0)
摘要: import time class Observer: def __init__(self, name) -> None: self.name = name def update(self, message): print("name %s received message: %s" % (self 阅读全文
posted @ 2024-02-28 19:57 干炸小黄鱼 阅读(38) 评论(0) 推荐(0)
摘要: 启动测试应用时, 有时需要自己配置证书签名: 1 使用系统自带openssl openssl req \ > -x509 \ > -nodes \ > -days 365 \ > -newkey rsa:2048 \ > -keyout example.key \ > -out example.cr 阅读全文
posted @ 2024-02-23 11:09 干炸小黄鱼 阅读(662) 评论(0) 推荐(0)
摘要: iptables -A INPUT -p tcp -s {src_ip} --dport 80 -j ACCEPT iptables -A INPUT -p tcp -s {src_ip} --dport 443 -j ACCEPT iptables -A INPUT -p tcp -s {src_ 阅读全文
posted @ 2023-12-20 16:39 干炸小黄鱼 阅读(45) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 下一页