Skip to content

Commit aa9694b

Browse files
committed
Enhance documentation with new content and updates
- Added new sections to PostgreSQL version notes detailing upcoming features and enhancements for PostgreSQL 18. - Updated MSSQL README with additional SQL queries for table management. - Included new resources in the MCP documentation for PostgreSQL. - Expanded Just documentation with caution notes on escaping characters. - Created a new ERP design document outlining key concepts and models. - Added various hardware and protocol notes for Raspberry Pi, including installation and configuration details. - Introduced new IP scan documentation in the security section. - Updated the story with a new chapter reflecting on past experiences.
1 parent 38b07cc commit aa9694b

File tree

23 files changed

+446
-210
lines changed

23 files changed

+446
-210
lines changed

notes/ai/dev/mcp/mcp-awesome.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,11 @@ tags:
248248

249249
## Postgres
250250

251+
- [crystaldba/postgres-mcp](https://github.com/crystaldba/postgres-mcp)
252+
- restricted
253+
- read-only transactions
254+
- unrestricted
255+
251256
```json
252257
{
253258
"mcpServers": {

notes/db/relational/mssql/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ SELECT SERVERPROPERTY('ProductVersion') AS ProductVersion, -- e.g., 15
4646
-- LIMIT
4747
SELECT TOP 3 * FROM Users;
4848

49+
-- show tables
50+
SELECT TABLE_SCHEMA, TABLE_NAME
51+
FROM INFORMATION_SCHEMA.TABLES
52+
WHERE TABLE_TYPE = 'BASE TABLE'
53+
ORDER BY TABLE_SCHEMA, TABLE_NAME;
54+
4955
-- 系统用户
5056
-- type S = SQL Login, U = Windows Login, G = Windows Group
5157
select *

notes/db/relational/postgresql/postgresql-version.md

Lines changed: 96 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ tags:
1313

1414
| PostgreSQL | Release Date |
1515
| --------------- | ------------ |
16-
| [PostgreSQL 18] |
16+
| [PostgreSQL 18] | 2025-09-25 |
1717
| [PostgreSQL 17] | 2024-09-26 |
1818
| [PostgreSQL 16] | 2023-09-14 |
1919
| [PostgreSQL 15] | 2022-10-13 |
@@ -39,29 +39,112 @@ tags:
3939

4040
## PostgreSQL 18
4141

42+
- 异步 I/O 子系统
43+
- 新的 AIO 子系统,支持并发 I/O 请求
44+
- 支持 `worker``io_uring` 方法
45+
- 顺序扫描、位图堆扫描、vacuum 操作性能提升高达 3 倍
46+
- 通过 `io_method` 参数配置
4247
- 虚拟生成列
43-
- `generated always as (EXPR) virtual`
48+
- `generated always as (EXPR) virtual` - 查询时计算,默认选项
49+
- 存储生成列支持逻辑复制
4450
- 提升写入性能、减少存储空间
45-
- 影响查询性能
51+
- 升级优化
52+
- 保留规划器统计信息通过主版本升级
53+
- `pg_upgrade` 支持并行检查和 `--swap` 标志
54+
- 减少升级后性能恢复时间
55+
- 查询性能增强
56+
- 多列 B-tree 索引的 "skip scan" 查找
57+
- `OR` 条件查询可使用索引优化
58+
- 哈希连接和合并连接性能提升
59+
- GIN 索引支持并行构建
60+
- 开发者体验
61+
- `RETURNING` 子句支持访问 `OLD``NEW`
62+
- `uuidv7()` 函数生成时间戳排序的 UUID
63+
- `uuidv4()` 作为 `gen_random_uuid()` 的别名
64+
- 时间约束支持 `WITHOUT OVERLAPS``PERIOD` 子句
65+
- `CREATE FOREIGN TABLE ... LIKE` 命令
66+
- 文本处理改进
67+
- `PG_UNICODE_FAST` 排序规则,加速 Unicode 比较
68+
- 支持非确定性排序规则的 `LIKE` 比较
69+
- 全文搜索使用集群默认排序规则提供程序
70+
- 认证和安全
71+
- OAuth 2.0 认证支持
72+
- FIPS 模式验证
73+
- TLS v1.3 密码套件配置 `ssl_tls13_ciphers`
74+
- 弃用 `md5` 密码认证,推荐使用 SCRAM
75+
- `pgcrypto` 支持 SHA-2 加密
76+
- 复制增强
77+
- 逻辑复制写冲突报告
78+
- `CREATE SUBSCRIPTION` 默认使用并行流
79+
- `pg_createsubscriber` 支持 `--all` 标志
80+
- 自动删除空闲复制槽
81+
- 维护和可观测性
82+
- 主动冻结更多页面,减少 vacuum 开销
83+
- `EXPLAIN ANALYZE` 显示缓冲区访问信息
84+
- `EXPLAIN ANALYZE VERBOSE` 包含 CPU、WAL 和平均读取统计
85+
- `pg_stat_all_tables` 增加 vacuum 操作时间统计
86+
- 其他重要变更
87+
- 默认启用页面校验和
88+
- 新的 PostgreSQL 线协议版本 3.2
89+
- 硬件加速支持 ARM NEON 和 SVE CPU 指令
90+
- 参考
91+
- [PostgreSQL 18 Released!](https://www.postgresql.org/about/news/postgresql-18-released-3142/)
4692

4793
## PostgreSQL 17
4894

49-
- libpq 支持 TLS `?sslnegotiation=direct`
50-
- https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-SSLNEGOTIATION
95+
- 内存管理优化
96+
- 新的 `VACUUM` 内存管理系统,减少内存消耗并提升整体 vacuum 性能
97+
- SQL/JSON 增强
98+
- 新的 SQL/JSON 功能,包括构造函数、标识函数
99+
- `JSON_TABLE()` 函数,将 JSON 数据转换为表表示
100+
- 查询性能改进
101+
- 使用流式 I/O 的顺序读取性能提升
102+
- 高并发下的写入吞吐量提升
103+
- btree 索引中多值搜索优化
104+
- 逻辑复制增强
105+
- 故障转移控制
106+
- `pg_createsubscriber` 工具,从物理备用服务器创建逻辑副本
107+
- `pg_upgrade` 现在保留发布者的逻辑复制槽和订阅者的完整订阅状态
108+
- 支持未来主版本升级时继续逻辑复制而无需重新同步
109+
- 客户端连接优化 - libpq 支持 TLS `?sslnegotiation=direct`
110+
- 执行直接 TLS 握手,避免往返协商
51111
- alpn postgresql
52-
- 旧版本 应用层实现的 SSL - 无法利用现有基础设施
112+
- 旧版本应用层实现的 SSL - 无法利用现有基础设施
113+
- `?sslnegotiation=direct&sslmode=require`
114+
- https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-SSLNEGOTIATION
53115
- https://www.postgresql.org/docs/17/protocol-flow.html#PROTOCOL-FLOW-SSL
54116
- PGJDBC v42.7.4
55117
- https://github.com/pgjdbc/pgjdbc/pull/3252
56118
- https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/PGProperty.java#L696
57119
- nodejs pg https://github.com/brianc/node-postgres/issues/3346
58-
- `?sslnegotiation=direct&sslmode=require`
59-
- `JSON_TABLE()`
60-
- `pg_createsubscriber`
61-
- `pg_basebackup` 支持增量
62-
- `COPY ON_ERROR ignore`
120+
- 备份和恢复
121+
- `pg_basebackup` 支持增量备份
122+
- 数据导入导出
123+
- `COPY` 新增 `ON_ERROR ignore` 选项,允许在出错时继续复制操作
124+
- 优化器改进
125+
- 允许优化器通过考虑早期行输出子句中引用列的统计信息和排序顺序来改进 CTE 计划
126+
- 改进 `IS NOT NULL``IS NULL` 查询限制的优化
127+
- 允许在布尔列上进行分区修剪,支持 `IS [NOT] UNKNOWN` 条件
128+
- 改进使用包含操作符 `<@``@>` 时的范围值优化
129+
- 允许相关 `IN` 子查询转换为连接
130+
- 改进分区表、继承父表和 `UNION ALL` 查询的 `LIMIT` 子句优化
131+
- 允许查询节点在更多情况下并行运行
132+
- 允许 `GROUP BY` 列内部排序以匹配 `ORDER BY`
133+
- 允许 `UNION`(无 `ALL`)使用 MergeAppend
134+
- 索引优化
135+
- 允许 btree 索引更高效地查找一组值,如 `IN` 子句提供的常量
136+
- 允许使用并行工作器创建 BRIN 索引
137+
- 允许 GiST 和 SP-GiST 索引成为增量排序的一部分
138+
- 兼容性变更
139+
- 维护操作期间使用安全 search_path 的函数变更
140+
- 限制 `ago` 仅出现在 `interval` 值的末尾
141+
- 移除服务器变量 `old_snapshot_threshold`
142+
- 更改 `SET SESSION AUTHORIZATION` 处理初始会话用户的超级用户状态
143+
- 移除模拟每数据库用户的功能 `db_user_namespace`
144+
- 移除 adminpack contrib 扩展
145+
- 移除 Windows 上的 `wal_sync_method``fsync_writethrough`
63146
- 参考
64-
- https://www.postgresql.org/docs/current/release-17.html
147+
- [PostgreSQL 17 Release Notes](https://www.postgresql.org/docs/current/release-17.html)
65148

66149
## PostgreSQL 16
67150

@@ -79,7 +162,7 @@ tags:
79162
- libpq
80163
- `GRANT role_a TO role_b` 支持 `INHERIT | SET`
81164
- 参考
82-
- https://www.postgresql.org/about/news/postgresql-16-released-2715/
165+
- [PostgreSQL 16 Released](https://www.postgresql.org/about/news/postgresql-16-released-2715/)
83166

84167
## PostgreSQL 15
85168

notes/dev/build/just.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ title: just
44

55
# just
66

7+
:::caution
8+
9+
- just 能解决 Makefile 需要 escape `${}` 的问题
10+
- just 需要处理 `{{`,`}}` 的 escape 问题 -> `{{{{}}}}`
11+
12+
:::
13+
714
- [casey/just](https://github.com/casey/just)
815
- CC0-1.0, Rust
916
- command runner, **不是** 构建工具
@@ -38,7 +45,7 @@ just foo/
3845
just bar::b # 搜索 foo.just, foo/mod.just, foo/justfile, foo/.justfile
3946

4047
just --fmt --check --unstable
41-
just --dump # --dump-format json
48+
just --dump # --dump-format json
4249
just --timestamp recipe --timestamp-format '%H:%M:%S%.3f %Z' # strftime
4350
```
4451

@@ -53,7 +60,7 @@ just --timestamp recipe --timestamp-format '%H:%M:%S%.3f %Z' # strftime
5360

5461
| opt | for |
5562
| -------- | --------------------------------------- |
56-
quite | 静默模式 |
63+
| quite | 静默模式 |
5764
| fallback | 如果 recipe 不存在,尝试向上找 justfile |
5865

5966
```justfile

notes/dev/design/design-erp.md renamed to notes/dev/design/erp/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,14 @@ Menu Cancel Submit
917917
- 中间过程
918918
- 后置确认验收
919919

920+
```
921+
Draft ─Submit→ Pending ─Approve→ Approved
922+
↑ ↓
923+
└────Revise────Reject─→ Rejected
924+
│ ↑
925+
└────────Cancel───────────┘
926+
```
927+
920928
<!--
921929
- Entity
922930
- State

notes/dev/ide/cursor.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@ title: Cursor
88
- The AI Code Editor
99
- 注意 可能会用非常多 Token
1010
- 参考
11-
- https://docs.cursor.com/en/models
11+
- https://docs.cursor.com/en/models
1212
- MCP https://cursor.com/docs/context/mcp/directory
1313

14+
# MCP
15+
16+
- ~/.cursor/mcp.json
17+
- `%USERPROFILE%\.cursor\mcp.json`
18+
- `.cursor/mcp.json`
19+
1420
# FAQ
1521

1622
## 不能补全 Markdown

notes/dev/ide/jetbrain/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ title: Jetbrain IDE
4343

4444
:::
4545

46+
```bash
47+
curl https://www.jetbrains.com/config/JetBrainsAIPlatform.json
48+
```
49+
50+
- https://account.jetbrains.com/profile-details
51+
- 修改 Region
52+
- AI 服务区域 https://www.jetbrains.com/legal/docs/terms/jetbrains-ai/service-territory/
53+
4654
**特殊正则替换语法**
4755

4856
| syntax | for |
@@ -52,6 +60,7 @@ title: Jetbrain IDE
5260
| \L | 小写直到 \E 或 替换结束 |
5361
| \U | 大写直到 \E 或 替换结束 |
5462
| \E | \U, \L 结束标志 |
63+
| (?S) | dotAll |
5564

5665
- https://www.jetbrains.com/help/idea/regular-expressions.html
5766

notes/electrical/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
title: 电学基础
33
---
44

5-
# 电学基础
5+
# Electrical
66

77
- [术语](./electrical-glossary.md)
88

9-
## 电路基础
9+
## Circuit
1010

11-
12-
## 资源
11+
## Awesome
1312

1413
- [awesome-electronics](https://github.com/monostable/awesome-electronics)
1514
- [HN](https://news.ycombinator.com/item?id=13507122)
16-
15+
- [logicemu](https://github.com/lvandeve/logicemu)
16+
- MIT, JS
17+
- logic circuit emulator that runs in the browser.

notes/electrical/electrical-glossary.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ tags:
4141
| Rectified current |
4242
| Three-phase current | 三相电流 |
4343

44+
- cadence - Cadence Design Systems,主流EDA(电子设计自动化)工具厂商,常用于IC、PCB设计
45+
- pads - Mentor Graphics(现为西门子)出品的PCB设计软件,适合中小型电路板设计
46+
- protel - 早期流行的PCB设计软件,现已发展为Altium Designer
47+
- altium designer - Altium公司出品的高端PCB设计工具,集成原理图、PCB、仿真等功能
48+
4449
## Symbols
4550

4651
| Symbol | Symbol Name | Stand for |

notes/hardware/sbc/rpi/README.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,100 @@ title: 树莓派
3434
- 2 × USB 3.0, 1 × USB 2.0
3535
- 40-pin GPIO
3636
- 2 × micro HDMI - 4Kp60
37+
38+
## 安装
39+
40+
全程未使用显示器,但使用了一个直连网线.
41+
42+
0. 前往[官网](https://www.raspberrypi.org/downloads/raspbian/)下载镜像
43+
44+
- 使用种子文件下载才是最新版
45+
- 下载完成后务必确认文件完整 `sha1sum *-raspbian-jessie.zip`
46+
47+
0. 烧录启动盘
48+
49+
```bash
50+
unzup *-raspbian-jessie.zip
51+
# 修改磁盘为相应盘符
52+
dd if=*-raspbian-jessie.img of=/dev/rdisk2 bs=64M
53+
```
54+
55+
2. 挂载烧录的盘符,在 cmdline.txt 末尾添加 `ip=192.168.2.1`, 如果该网段在使用,则修改为其他网段
56+
3. 插入 SDCard 到 Raspberry
57+
4. 连接直连网线, RJ45 电脑直连树莓
58+
5. 打开电源
59+
6. 修改主机直连为手动配置
60+
地址: `192.168.2.2` 子网掩码:`255.255.255.0`
61+
7. `ssh [email protected]` 密码为 `raspberry` 进入系统
62+
63+
## 连接 WIFI
64+
65+
```bash
66+
# 扫描 WIFI
67+
sudo iwlist wlan0 scan
68+
69+
# 添加 WIFI 配置
70+
cat << CFG | sudo tee -a /etc/wpa_supplicant/wpa_supplicant.conf > /dev/null
71+
network={
72+
ssid="名字"
73+
psk="密码"
74+
}
75+
CFG
76+
77+
sudo ifdown wlan0
78+
sudo ifup wlan0
79+
80+
# 确认链接成功
81+
ifconfig wlan0
82+
```
83+
84+
## rasp-config
85+
86+
`sudo raspi-config` 可用于
87+
88+
- 扩展文件系统
89+
- 修改用户密码
90+
- 修改启动选项
91+
- 启动等待网络链接
92+
- 启动相机
93+
- 添加到 Rastrack
94+
- 配置 Overclock
95+
- 调整高级选项
96+
97+
## 环境
98+
99+
```bash
100+
# 安装 Golang
101+
GOVERSION=1.6
102+
wget https://storage.googleapis.com/golang/go$GOVERSION.linux-armv61.tar.gz
103+
sudo tar -C /usr/local -xzf go$GOVERSION.*.tar.gz
104+
export GOROOT=/usr/local/go
105+
export PATH=$GOROOT/bin:$PATH
106+
107+
# 跨平台编译并且缓存编译后的包
108+
env GOOS=linux GOARCH=arm GOBIN=$(pwd)/bin go install main.go
109+
# 压缩程序大小
110+
env GOOS=linux GOARCH=arm GOBIN=$(pwd)/bin go install -ldflags '-s -w' main.go
111+
# 可使用 -9 或者 --ultra-brute 来达到更高的压缩效果
112+
upx bin/main
113+
114+
# 挂载远程目录,可操作一些特殊文件
115+
sshfs -o sshfs_sync,sync_readdir,reconnect,follow_symlinks,direct_io pi:/ pi
116+
```
117+
118+
## 常用命令
119+
120+
```bash
121+
# GPU 温度
122+
/opt/vc/bin/vcgencmd measure_temp
123+
# CPU 温度
124+
cat /sys/class/thermal/thermal_zone0/temp
125+
# 监控 CPU 和 GPU 温度
126+
watch -n 1 'sed -re "s/(..)(.).*/CPU Temp: \1.\2°C/" /sys/class/thermal/thermal_zone0/temp;vcgencmd measure_temp | sed -re "s/temp=([[:digit:]]+.[[:digit:]]+).*/GPU Temp: \1°C/"'
127+
```
128+
129+
## 资源
130+
131+
- [相关硬件文档](https://www.raspberrypi.org/documentation/hardware/raspberrypi/)
132+
- [针脚](http://pinout.xyz/)
133+
- [Pi 3 硬件图](https://www.element14.com/community/docs/DOC-73950/l/raspberry-pi-3-model-b-gpio-40-pin-block-pinout)

0 commit comments

Comments
 (0)