CheatSheet_Linux
显示文件中所有未注释的行1grep -v "#" /usr/local/nginx/conf/nginx.conf |grep -v "^$" 公网IP地址质量测试12345IP质量体检报告 https://github.com/xykt/IPQuality双栈bash <(curl -sL IP.Check.Place)v4bash <(curl -Ls IP.Check.Place) -4 查看时间范围内的 atop 记录1atop -r /var/log/atop_20240704 -b 03:53 -e 03:59 查找 Grafana 日志中remote_addr字段出现次数1awk '{ match($0, /remote_addr=([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/, ip); if(ip[1]) print ip[1] }' grafana.log | sort | uniq -c 使用 Ssh-keygen 从 Pem 文件中导出公钥1ss...
CheatSheet_Kubernetes
移除所有失败的pod1kubectl delete pod --field-selector="status.phase==Failed" 查看证书信息查看 AWS LoadBalancer 证书的信息,检查证书的有效期: 1kubectl get validatingwebhookconfigurations.admissionregistration.k8s.io aws-load-balancer-webhook -ojsonpath={.webhooks[0].clientConfig.caBundle} | base64 -d | openssl x509 -noout -text 使用 Debug 容器12345# 给特定的容器附加一个Sidecar, 并启动shell。kubectl debug -it --image=public.ecr.aws/amazonlinux/amazonlinux:latest aws-node-cpmck# netshoot容器, 比较方便的用来进行网络部分的调试。# 项目仓库地址: h...
CheatSheet_Databases
统计 MySQL 数据库占用的空间12345678910111213mysql Ver 8.4.1 for Linux on x86_64 (MySQL Community Server - GPL)mysql> select TABLE_SCHEMA, concat(truncate(sum(data_length)/1024/1024,2),' MB') as data_size, concat(truncate(sum(index_length)/1024/1024,2),'MB') as index_size from information_schema.tables group by TABLE_SCHEMA ORDER BY data_size desc;+--------------------+-----------+------------+| TABLE_SCHEMA | data_size | index_size |+--------------------+-----------+------...
CheatSheet_awscli
查看实例和对应实例的系统平台信息1aws ec2 describe-instances --query "Reservations[*].Instances[*].{InstanceId:InstanceId,PlatformDetails:Platform}" --output table 查看实例和EBS的关联关系1aws ec2 describe-volumes --query 'Volumes[*].[VolumeId, Attachments[0].InstanceId, Size]' --output table
PeaZip添加智能解压到win11右键菜单
原始地址 Win+R 输入这个路径,你就能找到注册表文件 1C:\Program Files\PeaZip\res\share\batch\Windows\Windows 11 mini context menu 安装你想要的选项,不是全部。要安装,就双击注册表文件,然后同意“UAC”,然后确定,再确定,然后重启资源管理器。 我需要的是这个 : add PeaZip, extract here (smart new folder).reg, 双击注册就好了。 PeaZip 版本: PeaZip 发布: 10.6.1 - Win64 Build, x86_64
Fortio 笔记
Fortio 官方网站Fortio Github Repo Thanks ~ https://skyao.io/learning-fortio/docs/introduction/fortio.html Fortio 是一个快速、小型(4Mb docker 镜像,最小依赖项)、可重复使用、可嵌入的 go 库以及命令行工具和服务器进程,服务器包括一个简单的 Web UI 和 REST API 来触发运行并查看结果的图形表示(单个延迟图和多个结果比较最小值、最大值、平均值、qps 和百分位数图)。 我比较感兴趣的是两个工具一个是 Fortio 本身, 可以支持 tcp 和 udp 的负载测试并且生成好观察的图表。还有一个是 DNSping, 通过命令发送 dns 请求并记录 dns 响应的延迟情况。 dnsping通过这样的工具可以非常轻松的看到在集群内的 pod 解析 dns 请求成功与否以及延迟情况, 例如: 123kubectl debug -n monitoring --profile=general grafana-694b5f9796-nqkhn -it --image=...
TrueNAS Core 自动更新UI证书
这两天提示 TrueNAS Core UI 的证书过期了, 看了一下, 默认是一年的证书, 需要更新了。 使用 certbot 自动更新证书的方式比较干净,原始文档在这里 . 比其他的方法要好, 其中记录的步骤不太细致或者已经过时了, 记录一下我的步骤。 Go 创建一个Jail, 名称是 certbot, 具体的Release选择哪个都可以。本身这个证书只是给UI使用, 所以也就不需要创建任何的 Dataset 挂载进去。 在 TrueNAS Core 创建一个新的 API Key, 用来给脚本部署证书使用。 在 Cloudflare 创建一个新的 API Key 用来作为 dns challenges 的入口, 调用 cloudflare 的接口。 通过 UI 登录到 Jail 里面执行初始化。 1234567891011121314151617181920212223242526272829303132333435363738394041424344# Install prerequisitespkg updatepkg install python311 py311-...
B+树笔记
Start下面的两个非常通俗的解释了 B tree 的定义, 以及btree 是如何完成数据插入以及查找的, 不同的程序会使用不同结构的 btree 变体, 是在通常的Btree 逻辑框架上面添加更多的限制条件和规定。 Understanding B-Trees: The Data Structure Behind Modern Databaseshttps://www.youtube.com/watch?v=K1a2Bk8NrYQ&t=42s B-trees and database indexeshttps://planetscale.com/blog/btrees-and-database-indexes#how-mysql-uses-b-trees
Kubernetes NFS CSI 启动 bitnami postgres 镜像权限不足
开始准备在kubernetes 集群里面部署一个 pgsql, 存储一些自己的个人数据,postgres pod 启动不了,pod 会反复 CrashLoopback, 查看其中postgres 进程的容器, 会遇到这样的报错: 1234567891011fixing permissions on existing directory /var/lib/postgresql/data … okcreating subdirectories … okselecting dynamic shared memory implementation … posixselecting default max_connections … 20selecting default shared_buffers … 400kBselecting default time zone … Etc/UTCcreating configuration files … okrunning bootstrap script … 2020-07-28 19:47:30.936 UTC [73] FATAL: d...
TigerVNC 在 RHEL9 的安装和配置
安装 VNC 步骤记录初始化系统, 安装图形化. ( 我还安装的 虚拟化宿主机, 我需要所以就安装了. 12345678910111213141516171819# 更新系统软件包到最新sudo dnf update -y# 查看哪些可用的 Group, (方便sudo dnf grouplist# 安装 Server GUIsudo dnf groupinstall -y "Server with GUI"# 安装 KVM (按需sudo dnf groupinstall -y "Virtualization Host"# 安装 TigerVNC 服务sudo dnf install -y tigervnc-server# 关闭 SElinuxsudo sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config# 可以重启 或者 设置为 Permissivesudo setenforce 0# 关闭防火墙.sudo systemctl stop...


