From 757e3ceb49d53be7ad64807c35fd2f7af002a441 Mon Sep 17 00:00:00 2001 From: wener Date: Mon, 25 Nov 2024 14:56:18 +0800 Subject: [PATCH] update nextcloud versions, edms, python, jsonschema --- notes/culture/game/minecraft.md | 37 +++ notes/culture/game/minetest.md | 27 +- notes/culture/game/roblox.md | 9 + notes/db/relational/mssql/README.md | 8 + notes/db/relational/mysql/mysql-cookbook.md | 29 ++ notes/db/relational/mysql/mysql-faq.md | 2 + .../postgresql/postgresql-version.md | 23 +- notes/db/relational/sqlite/README.md | 16 + notes/dev/dev-error.md | 161 +++++++++ notes/dev/dev-glossary.md | 51 +++ notes/dev/format/jsonschema/README.md | 170 +++++++++- .../format/jsonschema/jsonschema-awesome.md | 9 +- notes/devops/docker/docker-faq.md | 8 + notes/devops/web/caddy/README.md | 3 + notes/devops/web/caddy/caddy-l4.md | 58 ++++ notes/evolve/dev-thought.md | 3 + notes/evolve/{ => life}/life-faq.md | 0 notes/hardware/hardware-awesome.md | 10 + notes/hardware/hardware-glossary.md | 12 + notes/languages/parser/antlr/README.md | 9 +- notes/languages/parser/parser-faq.md | 70 ++++ notes/languages/parser/parser-glossary.md | 38 ++- .../parser/{peg.md => peg/README.md} | 2 +- .../parser/peg/miniquery.mikro-orm.peggy | 313 +++++++++++------- notes/languages/parser/peg/miniquery.pegjs | 131 -------- notes/languages/parser/{ => peg}/peggy.md | 6 +- notes/languages/parser/{ => peg}/pegjs.md | 0 notes/languages/python/README.md | 28 +- notes/languages/python/poetry.md | 152 +++++++++ notes/languages/python/pyinstaller.md | 24 ++ notes/languages/python/python-faq.md | 52 --- notes/os/linux/shell/shell-awesome.md | 6 +- notes/philosophy/philosophy-glossary.md | 65 +++- notes/security/security-faq.md | 1 + notes/security/security-glossary.md | 8 + notes/security/tls.md | 21 ++ notes/service/api/openapi/README.md | 13 + notes/service/api/soap.md | 3 + notes/service/auth/auth-awesome.md | 1 + notes/service/cn/cn-faq.md | 23 +- notes/service/cn/cn-glossary.md | 29 ++ notes/service/edms/cabinet.md | 94 ++++++ notes/service/edms/edms-awesome.md | 4 + notes/service/edms/edms-glossary.md | 23 +- notes/service/edms/std/dat-22.md | 66 ++++ notes/service/edms/std/dat-7.md | 17 + notes/service/edms/std/iso-15489.md | 9 + notes/service/file/nextcloud/nextcloud-faq.md | 6 + .../file/nextcloud/nextcloud-version.md | 246 +++++++++++++- notes/service/network/network-awesome.md | 11 + notes/service/network/proxy/mihomo/README.md | 12 + notes/service/service-awesome.md | 5 + notes/service/workflow/temporal/README.md | 12 +- .../{temporal-sdk.md => temporal-dev.md} | 11 +- .../service/workflow/temporal/temporal-ops.md | 10 + .../workflow/temporal/temporal-version.md | 9 + notes/service/workflow/windmill.md | 21 +- notes/software/software-awesome.md | 4 + notes/web/dev/bun.md | 11 +- notes/web/script/js/js-awesome.md | 6 + 60 files changed, 1790 insertions(+), 418 deletions(-) create mode 100644 notes/culture/game/minecraft.md create mode 100644 notes/culture/game/roblox.md create mode 100644 notes/db/relational/mysql/mysql-cookbook.md create mode 100644 notes/dev/dev-error.md create mode 100644 notes/devops/web/caddy/caddy-l4.md rename notes/evolve/{ => life}/life-faq.md (100%) rename notes/languages/parser/{peg.md => peg/README.md} (97%) delete mode 100644 notes/languages/parser/peg/miniquery.pegjs rename notes/languages/parser/{ => peg}/peggy.md (96%) rename notes/languages/parser/{ => peg}/pegjs.md (100%) create mode 100644 notes/languages/python/poetry.md create mode 100644 notes/languages/python/pyinstaller.md create mode 100644 notes/security/tls.md create mode 100644 notes/service/edms/cabinet.md create mode 100644 notes/service/edms/std/dat-22.md create mode 100644 notes/service/edms/std/dat-7.md create mode 100644 notes/service/edms/std/iso-15489.md rename notes/service/workflow/temporal/{temporal-sdk.md => temporal-dev.md} (74%) create mode 100644 notes/service/workflow/temporal/temporal-ops.md create mode 100644 notes/service/workflow/temporal/temporal-version.md diff --git a/notes/culture/game/minecraft.md b/notes/culture/game/minecraft.md new file mode 100644 index 00000000000..e319378173a --- /dev/null +++ b/notes/culture/game/minecraft.md @@ -0,0 +1,37 @@ +--- +title: Minecraft +--- + +# Minecraft + +- Minecraft:Java + - 支持 Windows、Mac、Linux +- Minecraft:Bedrock + - 只支持 Windows +- 产品 + - 标准版 + - ¥89.00 + - 豪华版 + - ¥119.00 + - iOS https://apps.apple.com/us/app/minecraft-play-with-friends/id479516143 + - $6.99 + +## Awesome + +- [bs-community/awesome-minecraft](https://github.com/bs-community/awesome-minecraft) + +## Download + +- https://www.minecraft.net/en-us/download + +## Server + +- https://www.minecraft.net/en-us/download/server +- https://findmcserver.com/ +- https://aka.ms/verifiedservers + - -> findmcserver.com +- https://aternos.org/ + +```bash +java -Xmx1024M -Xms1024M -jar minecraft_server.1.21.3.jar nogui +``` diff --git a/notes/culture/game/minetest.md b/notes/culture/game/minetest.md index 4c84ed6c618..a25c4fff4b4 100644 --- a/notes/culture/game/minetest.md +++ b/notes/culture/game/minetest.md @@ -5,14 +5,37 @@ title: minetest # minetest - [minetest](https://github.com/minetest/minetest) + - minetest -> Luanti + - 由于 (L)GPL License 原因,没有 iOS/iPad 版本 + - https://github.com/minetest/minetest/issues/12176 +- 参考 + - [MultiCraft/MultiCraft](https://github.com/MultiCraft/MultiCraft) --- - user/minetest.conf +```bash +mkdir data conf +chown -R 30000 data conf +# https://github.com/minetest/minetest/blob/master/doc/docker_server.md +# https://github.com/minetest/minetest/pkgs/container/minetest +docker run -d \ + -p 30000:30000/udp \ + -v $PWD/minetest/data:/var/lib/minetest \ + -v $PWD/minetest/conf:/etc/minetest \ + --name minetest ghcr.io/minetest/minetest +``` +- https://github.com/minetest/minetest/blob/master/minetest.conf.example +- https://wiki.minetest.net/minetest.conf -``` +## Games + +```bash +minetestserver --gameid list ``` -- https://github.com/minetest/minetest/blob/master/minetest.conf.example +- STATIC_SHAREDIR="/usr/local/share/minetest" +- https://content.minetest.net/ +- https://wiki.minetest.net/Games diff --git a/notes/culture/game/roblox.md b/notes/culture/game/roblox.md new file mode 100644 index 00000000000..501dc0e2421 --- /dev/null +++ b/notes/culture/game/roblox.md @@ -0,0 +1,9 @@ +--- +title: roblox +--- + +# roblox + +- roblox.com +- https://bgp.tools/as/22697 + - AS22697 diff --git a/notes/db/relational/mssql/README.md b/notes/db/relational/mssql/README.md index fc251b1d5c3..e695d09acbb 100644 --- a/notes/db/relational/mssql/README.md +++ b/notes/db/relational/mssql/README.md @@ -26,3 +26,11 @@ nmap -p 1433,1434 HOST ``` Windows NTbackup archive NT, with file catalog, soft size 1*512, software (0x1200): Microsoft SQL Server ``` + +## 导出 + +```bash +bcp "SELECT * FROM database.schema.table" queryout "output.csv" -c -t, -S servername -U username -P password + +Invoke-Sqlcmd -Query "SELECT * FROM database.schema.table" -ServerInstance "servername" | Export-Csv -Path "output.csv" -NoTypeInformation +``` diff --git a/notes/db/relational/mysql/mysql-cookbook.md b/notes/db/relational/mysql/mysql-cookbook.md new file mode 100644 index 00000000000..8545fe87f15 --- /dev/null +++ b/notes/db/relational/mysql/mysql-cookbook.md @@ -0,0 +1,29 @@ +--- +tags: + - Cookbook +--- + +# MySQL Cookbook + +## table_size + +```sql +CREATE VIEW table_size AS +SELECT + table_schema AS table_schema, + table_name AS table_name, + table_rows AS row_estimate, + data_length + index_length AS total_bytes, + data_length AS table_bytes, + index_length AS index_bytes, + data_free AS free_space, + CONCAT(ROUND((data_length + index_length) / 1024 / 1024, 2), ' MB') AS total_pretty, + CONCAT(ROUND(data_length / 1024 / 1024, 2), ' MB') AS table_pretty, + CONCAT(ROUND(index_length / 1024 / 1024, 2), ' MB') AS index_pretty +FROM + information_schema.tables +WHERE + table_type = 'BASE TABLE' +ORDER BY + total_bytes DESC; +``` diff --git a/notes/db/relational/mysql/mysql-faq.md b/notes/db/relational/mysql/mysql-faq.md index 1fe1b4d5817..4ba96ac25c3 100644 --- a/notes/db/relational/mysql/mysql-faq.md +++ b/notes/db/relational/mysql/mysql-faq.md @@ -39,6 +39,8 @@ SHOW MASTER STATUS; -- 查看主库状态 - mysql ```sql +-- is not allowed to connect to this MySQL server +-- /c/Program\ Files/MySQL/MySQL\ Server\ 8.0/bin/mysql -u root -p123456 app -h 127.0.0.1 -- 允许 root 远程登录 UPDATE mysql.user SET host='%' WHERE user='root' AND host='localhost'; FLUSH PRIVILEGES; -- 重载权限 diff --git a/notes/db/relational/postgresql/postgresql-version.md b/notes/db/relational/postgresql/postgresql-version.md index 6b3a0332dfb..2f0816c8dbc 100644 --- a/notes/db/relational/postgresql/postgresql-version.md +++ b/notes/db/relational/postgresql/postgresql-version.md @@ -14,6 +14,7 @@ tags: | PostgreSQL | Release Date | | --------------- | ------------ | +| [PostgreSQL 17] | 2024-09-26 | | [PostgreSQL 16] | 2023-09-14 | | [PostgreSQL 15] | 2022-10-13 | | [PostgreSQL 14] | 2021-09-30 | @@ -33,11 +34,30 @@ tags: [postgresql 12]: #postgresql-12 [postgresql 11]: #postgresql-11 +## PostgreSQL 17 + +- libpq 支持 TLS `?sslnegotiation=direct` + - https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-SSLNEGOTIATION + - alpn postgresql + - 旧版本 应用层实现的 SSL - 无法利用现有基础设施 + - https://www.postgresql.org/docs/17/protocol-flow.html#PROTOCOL-FLOW-SSL + - PGJDBC v42.7.4 + - https://github.com/pgjdbc/pgjdbc/pull/3252 + - https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/PGProperty.java#L696 + - nodejs pg https://github.com/brianc/node-postgres/issues/3346 + - `?sslnegotiation=direct&sslmode=require` +- `JSON_TABLE()` +- `pg_createsubscriber` +- `pg_basebackup` 支持增量 +- `COPY ON_ERROR ignore` +- 参考 + - https://www.postgresql.org/docs/current/release-17.html + ## PostgreSQL 16 - Logical Replication 优化 - Parallel Execution 优化 -- JSON/JSONB 支持更多操作 - 更完善的 SQL/JSON 支持 +- JSON/JSONB 支持更多操作 - 更完善的 SQL/JSON 支持 - Concurrent Bulk Loading - psql - `\bind` -> `SELECT $1::int + $2::int \bind 1 2 \g)` @@ -49,6 +69,7 @@ tags: - libpq - 参考 - https://www.postgresql.org/about/news/postgresql-16-released-2715/ + ## PostgreSQL 15 - 新增 MERGE 语句 - 用于合并两个 **表** diff --git a/notes/db/relational/sqlite/README.md b/notes/db/relational/sqlite/README.md index 5f45c751d72..228e6aaafaa 100644 --- a/notes/db/relational/sqlite/README.md +++ b/notes/db/relational/sqlite/README.md @@ -85,6 +85,22 @@ tags: ::: +:::tip Why use SQLite + +- 零配置 +- 轻量级高效 +- 读为主 +- 需要传输大量小数据 - 把 SQLite 作为容器,传输整个文件 +- 不希望有外部服务依赖 + - 大多服务能 Embed + - 大多环境直接提供 NodeJS, Bun +- 希望在 KV 之上有 SQL - 有很多 KV 的文件存储方案 +- 支持 ACID +- 跨平台兼容 +- 完善的社区和生态系统 + +::: + ```bash # macOS 安装 brew install sqlite3 diff --git a/notes/dev/dev-error.md b/notes/dev/dev-error.md new file mode 100644 index 00000000000..a4eeceae3f4 --- /dev/null +++ b/notes/dev/dev-error.md @@ -0,0 +1,161 @@ +--- +tags: + - Topic + - Error +--- + +# error + +## Postgres + +- https://github.com/jackc/pgerrcode/blob/master/errcode.go +- https://www.postgresql.org/docs/current/errcodes-appendix.html +- https://github.com/postgres/postgres/blob/master/src/backend/utils/errcodes.txt + +## libc + +```bash +apk add moreutils +errno -l +``` + +| Error | NO | Description | +| --------------- | --- | ------------------------------------------- | +| EPERM | 1 | Operation not permitted | +| ENOENT | 2 | No such file or directory | +| ESRCH | 3 | No such process | +| EINTR | 4 | Interrupted system call | +| EIO | 5 | I/O error | +| ENXIO | 6 | No such device or address | +| E2BIG | 7 | Argument list too long | +| ENOEXEC | 8 | Exec format error | +| EBADF | 9 | Bad file descriptor | +| ECHILD | 10 | No child process | +| EAGAIN | 11 | Resource temporarily unavailable | +| EWOULDBLOCK | 11 | Resource temporarily unavailable | +| ENOMEM | 12 | Out of memory | +| EACCES | 13 | Permission denied | +| EFAULT | 14 | Bad address | +| ENOTBLK | 15 | Block device required | +| EBUSY | 16 | Resource busy | +| EEXIST | 17 | File exists | +| EXDEV | 18 | Cross-device link | +| ENODEV | 19 | No such device | +| ENOTDIR | 20 | Not a directory | +| EISDIR | 21 | Is a directory | +| EINVAL | 22 | Invalid argument | +| ENFILE | 23 | Too many open files in system | +| EMFILE | 24 | No file descriptors available | +| ENOTTY | 25 | Not a tty | +| ETXTBSY | 26 | Text file busy | +| EFBIG | 27 | File too large | +| ENOSPC | 28 | No space left on device | +| ESPIPE | 29 | Invalid seek | +| EROFS | 30 | Read-only file system | +| EMLINK | 31 | Too many links | +| EPIPE | 32 | Broken pipe | +| EDOM | 33 | Domain error | +| ERANGE | 34 | Result not representable | +| EDEADLK | 35 | Resource deadlock would occur | +| EDEADLOCK | 35 | Resource deadlock would occur | +| ENAMETOOLONG | 36 | File name too long | +| ENOLCK | 37 | No locks available | +| ENOSYS | 38 | Function not implemented | +| ENOTEMPTY | 39 | Directory not empty | +| ELOOP | 40 | Too many symbolic links | +| ENOMSG | 42 | No message of desired type | +| EIDRM | 43 | Identifier removed | +| ECHRNG | 44 | Channel number out of range | +| EL2NSYNC | 45 | Level 2 not synchronized | +| EL3HLT | 46 | Level 3 halted | +| EL3RST | 47 | Level 3 reset | +| ELNRNG | 48 | Link number out of range | +| EUNATCH | 49 | Protocol driver not attached | +| ENOCSI | 50 | No CSI structure available | +| EL2HLT | 51 | Level 2 halted | +| EBADE | 52 | Invalid exchange | +| EBADR | 53 | Invalid request descriptor | +| EXFULL | 54 | Exchange full | +| ENOANO | 55 | No anode | +| EBADRQC | 56 | Invalid request code | +| EBADSLT | 57 | Invalid slot | +| EBFONT | 59 | Bad font file format | +| ENOSTR | 60 | Device not a stream | +| ENODATA | 61 | No data available | +| ETIME | 62 | Timer expired | +| ENOSR | 63 | Out of streams resources | +| ENONET | 64 | Machine is not on the network | +| ENOPKG | 65 | Package not installed | +| EREMOTE | 66 | Object is remote | +| ENOLINK | 67 | Link has been severed | +| EADV | 68 | Advertise error | +| ESRMNT | 69 | Srmount error | +| ECOMM | 70 | Communication error on send | +| EPROTO | 71 | Protocol error | +| EMULTIHOP | 72 | Multihop attempted | +| EDOTDOT | 73 | RFS specific error | +| EBADMSG | 74 | Not a data message | +| EOVERFLOW | 75 | Value too large | +| ENOTUNIQ | 76 | Name not unique on network | +| EBADFD | 77 | File descriptor in bad state | +| EREMCHG | 78 | Remote address changed | +| ELIBACC | 79 | Can not access a needed shared library | +| ELIBBAD | 80 | Accessing a corrupted shared library | +| ELIBSCN | 81 | .lib section in a.out corrupted | +| ELIBMAX | 82 | Too many shared libraries | +| ELIBEXEC | 83 | Cannot exec a shared library directly | +| EILSEQ | 84 | Illegal byte sequence | +| ERESTART | 85 | Interrupted system call should be restarted | +| ESTRPIPE | 86 | Streams pipe error | +| EUSERS | 87 | Too many users | +| ENOTSOCK | 88 | Socket operation on non-socket | +| EDESTADDRREQ | 89 | Destination address required | +| EMSGSIZE | 90 | Message too long | +| EPROTOTYPE | 91 | Protocol wrong type for socket | +| ENOPROTOOPT | 92 | Protocol not available | +| EPROTONOSUPPORT | 93 | Protocol not supported | +| ESOCKTNOSUPPORT | 94 | Socket type not supported | +| EOPNOTSUPP | 95 | Operation not supported | +| ENOTSUP | 95 | Operation not supported | +| EPFNOSUPPORT | 96 | Protocol family not supported | +| EAFNOSUPPORT | 97 | Address family not supported | +| EADDRINUSE | 98 | Address already in use | +| EADDRNOTAVAIL | 99 | Cannot assign requested address | +| ENETDOWN | 100 | Network is down | +| ENETUNREACH | 101 | Network is unreachable | +| ENETRESET | 102 | Network dropped connection | +| ECONNABORTED | 103 | Software caused connection abort | +| ECONNRESET | 104 | Connection reset by peer | +| ENOBUFS | 105 | No buffer space available | +| EISCONN | 106 | Transport endpoint is connected | +| ENOTCONN | 107 | Transport endpoint not connected | +| ESHUTDOWN | 108 | Cannot send after shutdown | +| ETOOMANYREFS | 109 | Too many references | +| ETIMEDOUT | 110 | Connection timed out | +| ECONNREFUSED | 111 | Connection refused | +| EHOSTDOWN | 112 | Host is down | +| EHOSTUNREACH | 113 | No route to host | +| EALREADY | 114 | Operation already in progress | +| EINPROGRESS | 115 | Operation now in progress | +| ESTALE | 116 | Stale file handle | +| EUCLEAN | 117 | Structure needs cleaning | +| ENOTNAM | 118 | Not a XENIX named type file | +| ENAVAIL | 119 | No XENIX semaphores available | +| EISNAM | 120 | Is a named type file | +| EREMOTEIO | 121 | Remote I/O error | +| EDQUOT | 122 | Quota exceeded | +| ENOMEDIUM | 123 | No medium found | +| EMEDIUMTYPE | 124 | Wrong medium type | +| ECANCELED | 125 | Operation canceled | +| ENOKEY | 126 | Required key not available | +| EKEYEXPIRED | 127 | Key has expired | +| EKEYREVOKED | 128 | Key has been revoked | +| EKEYREJECTED | 129 | Key was rejected by service | +| EOWNERDEAD | 130 | Owner died | +| ENOTRECOVERABLE | 131 | State not recoverable | +| ERFKILL | 132 | Operation not possible due to RF-kill | +| EHWPOISON | 133 | Memory page has hardware error | + +- ERRNO +- https://github.com/bminor/musl/blob/master/arch/generic/bits/errno.h +- https://man7.org/linux/man-pages/man3/errno.3.html diff --git a/notes/dev/dev-glossary.md b/notes/dev/dev-glossary.md index ccd2a16d260..9bbef9203fc 100644 --- a/notes/dev/dev-glossary.md +++ b/notes/dev/dev-glossary.md @@ -47,3 +47,54 @@ tags: [on-premises software]: https://en.wikipedia.org/wiki/On-premises_software ## Checksum + +## 路由 {#routing} + +- 核心问题 + - 分发 + - 选择最佳路径 + - 输入 - 映射 - 目标 + - 抽象 - 实现 + +--- + +- 网络层 + - 路由器根据数据包的目标地址,决定下一跳的转发路径。 + - 路由协议 - OSPF, BGP + - 核心思想 + - 根据规则分发 + - 选择最佳路径 +- Web 开发中的路由 + - `GET /user/1` + - 核心思想 + - 路径颜色 +- 软件架构中的服务路由 + - 服务发现: 找到服务的实例位置 + - 服务路由: 将请求路由到正确的服务(负载均衡、流量控制) + - 核心思想 + - 请求根据规则分发到适当的服务实例,本质上是一种更复杂的“路由”。 +- 函数和方法调用 + - 函数或方法的调用可以被看作是一种小范围的路由 + - CPP 中的虚函数 + - Java Interface + - 根据函数名、类名,找到对应的实现逻辑。 + - 分发逻辑:通过方法名或函数名路由到具体的实现。 +- 消息队列中的路由 + - routing key + - 基于规则的分发:不同的队列对应不同的业务逻辑处理。 +- 数据库查询路由 + - 读写分离 + - 分片 + - 查询索引定位 +- 操作系统中的路由 + - syscall + - 系统调用表 + - 中断向量表 +- 编译器和解释器中的路由 + - Link - 符号解析 - 重定位 + - 语法路由:从代码的结构映射到编译器的内部处理逻辑。 +- 用户界面的路由 + - React Router + - Vue Router + +## 通信 {#communication} diff --git a/notes/dev/format/jsonschema/README.md b/notes/dev/format/jsonschema/README.md index 0c2ff901410..dd020ee9de9 100644 --- a/notes/dev/format/jsonschema/README.md +++ b/notes/dev/format/jsonschema/README.md @@ -12,11 +12,11 @@ title: JSON Schema ::: -| version | $schema | adopted by | -| ---------- | -------------------------------------- | ----------- | +| version | $schema | adopted by | date | +| ---------- | -------------------------------------- | ----------- | ------- | | [2020-12] | | OpenAPI 3.1 | -| [2019-09] | | | -| [draft-07] | http://json-schema.org/draft-07/schema | ajv default | +| [2019-09] | | | 2019-09 | +| [draft-07] | http://json-schema.org/draft-07/schema | ajv default | 2018-06 | | [draft-06] | | | [draft-04] | | | draft-00 | | OpenAPI 3.0 | @@ -56,6 +56,150 @@ title: JSON Schema - nullable - discriminator - 不影响校验 +- 版本选择 + - ajv 默认 draft-07 + - typebox 使用 draft-07 +- 参考 + - https://github.com/json-schema-org + - https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-02 + +```ts +export type JSONSchemaTypeName = + | 'string' // + | 'number' + | 'integer' + | 'boolean' + | 'object' + | 'array' + | 'null'; +export type JSONSchemaType = + | string // + | number + | boolean + | JSONSchemaObject + | JSONSchemaArray + | null; +type JSONSchemaDefinition = JSONSchema | boolean; + +interface JSONSchema { + $id?: string; + $ref?: string; + /** + * Meta schema + * + * Recommended values: + * - 'http://json-schema.org/schema#' + * - 'http://json-schema.org/hyper-schema#' + * - 'http://json-schema.org/draft-07/schema#' + * - 'http://json-schema.org/draft-07/hyper-schema#' + * + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5 + */ + $schema?: string; + $comment?: string; + + $defs?: Record; + + // for any type + + type?: JSONSchemaTypeName | JSONSchemaTypeName[]; + enum?: JSONSchemaType[]; + const?: JSONSchemaType; + + //region keywords for strings + maxLength?: number; + minLength?: number; + pattern?: string; + + contentEncoding?: string; // e.g. base64 + contentMediaType?: string; // e.g. image/png, text/html, application/jwt + contentSchema?: JSONSchemaDefinition; // for application/jwt e.g. {type:"array"} + //endregion + + //region keywords for numbers + multipleOf?: number; + maximum?: number; + exclusiveMaximum?: number; + minimum?: number; + exclusiveMinimum?: number; + //endregion + + //region keywords for arrays + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4 + */ + items?: JSONSchemaDefinition | JSONSchemaDefinition[] | undefined; + additionalItems?: JSONSchemaDefinition | undefined; + contains?: JSONSchemaDefinition; + + maxItems?: number; + minItems?: number; + uniqueItems?: boolean; + maxContains?: number; + minContains?: number; + //endregion + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5 + */ + //region keywords for objects + maxProperties?: number; + minProperties?: number; + required?: string[]; + dependentRequired?: Record; // draft 2019-09 + + properties?: Record; + patternProperties?: Record; + additionalProperties?: JSONSchemaDefinition; + propertyNames?: JSONSchemaDefinition; + + /** + * renamed to dependentSchemas, dependentRequired + * @deprecated draft 2019-09 + */ + dependencies?: Record; + //endregion + + //region conditional subschemas + if?: JSONSchemaDefinition; + then?: JSONSchemaDefinition; + else?: JSONSchemaDefinition; + //endregion + + //region logical operations + allOf?: JSONSchemaDefinition[]; + anyOf?: JSONSchemaDefinition[]; + oneOf?: JSONSchemaDefinition[]; + not?: JSONSchemaDefinition; + //endregion + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7 + */ + format?: string; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8 + */ + contentMediaType?: string; + contentEncoding?: string; + + /** + * renamed to `$defs` to match `$ref` + */ + definitions?: Record; + + //region metadata + title?: string; + description?: string; + default?: JSONSchemaType; + deprecated?: boolean; + readOnly?: boolean; + writeOnly?: boolean; + examples?: JSONSchemaType; + //endregion +} +``` ```json { @@ -72,7 +216,7 @@ title: JSON Schema ```json { - "type": "integer", + "type": "integer" } ``` @@ -107,7 +251,7 @@ title: JSON Schema } }, // null or string - "nullable": {"type": ["string", "null"]} + "nullable": { "type": ["string", "null"] } }, "required": [], "$defs": { @@ -118,23 +262,13 @@ title: JSON Schema "single": { "$anchor": "item", "type": "object", - "additionalProperties": {"$ref": "other.json"} + "additionalProperties": { "$ref": "other.json" } } }, "$comment": "" } ``` -- 任意类型 - - enum - - const - - $data - 引用数据 -- 组合逻辑 - - not - - oneOf - - anyOf - - allOf - - if/then/else - 元数据 - title, description - $comment @@ -218,7 +352,7 @@ title: JSON Schema **decimal 精度** ```json -{"type": "number", "multipleOf": 0.01} +{ "type": "number", "multipleOf": 0.01 } ``` ## ajv formats diff --git a/notes/dev/format/jsonschema/jsonschema-awesome.md b/notes/dev/format/jsonschema/jsonschema-awesome.md index 9acff03953a..629faf0cfd6 100644 --- a/notes/dev/format/jsonschema/jsonschema-awesome.md +++ b/notes/dev/format/jsonschema/jsonschema-awesome.md @@ -57,7 +57,7 @@ tags: - [jimblackler/jsongenerator](https://github.com/jimblackler/jsongenerator) - Apache-2.0, Java - UI from JSON Schema - - [rjsf-team/react-jsonschema-form](../../web/react/react-jsonschema-form.md) + - [rjsf-team/react-jsonschema-form](https://github.com/rjsf-team/react-jsonschema-form) - [json-editor/json-editor](https://github.com/json-editor/json-editor) - MIT, JS - https://json-editor.github.io/json-editor/ @@ -132,6 +132,13 @@ tags: - [SchemaStore/schemastore](https://github.com/SchemaStore/schemastore) - https://www.schemastore.org/json/ - https://schemas.sourcemeta.com/ +- usecases + - https://json-schema.org/tools + - OpenAPI + - [snowplow/snowplow](https://github.com/snowplow/snowplow) + - for event definition & validation + - https://blog.heroku.com/json_schema_for_heroku_platform_api + - Google API discovery service https://developers.google.com/discovery/v1/getting_started - 参考 - [Understanding JSON Schema](https://json-schema.org/understanding-json-schema/index.html) - proptypes-to-json-schema diff --git a/notes/devops/docker/docker-faq.md b/notes/devops/docker/docker-faq.md index ed21e138246..1e18922506d 100644 --- a/notes/devops/docker/docker-faq.md +++ b/notes/devops/docker/docker-faq.md @@ -277,3 +277,11 @@ docker buildx create --name multiarch-builder --driver docker-container --use docker buildx ls ``` + +## Docker Image Format v1 and Docker Image manifest version 2 + +``` +Docker Image Format v1 and Docker Image manifest version 2, schema 1 support is disabled by default and will be removed in an upcoming release +``` + +- https://distribution.github.io/distribution/spec/deprecated-schema-v1/ diff --git a/notes/devops/web/caddy/README.md b/notes/devops/web/caddy/README.md index afbd87494ec..5ce235f3373 100644 --- a/notes/devops/web/caddy/README.md +++ b/notes/devops/web/caddy/README.md @@ -47,6 +47,9 @@ caddy add-package github.com/caddy-dns/cloudflare ## Caddyfile +- 全局 `{}` +- snippet `(snippet) {}` +- Site block `example.com {}` - 环境变量 `{$SITE_ADDRESS}` - `{env.HOME}` - 默认值 `{$DOMAIN:localhost}` diff --git a/notes/devops/web/caddy/caddy-l4.md b/notes/devops/web/caddy/caddy-l4.md new file mode 100644 index 00000000000..b46f90d4653 --- /dev/null +++ b/notes/devops/web/caddy/caddy-l4.md @@ -0,0 +1,58 @@ +--- +tags: + - Plugin + - Network +--- + +# Caddy L4 + +- [mholt/caddy-l4](https://github.com/mholt/caddy-l4) + - Apache-2.0, Go + - Layer 4 (TCP/UDP) app for Caddy + - 支持探测 HTTP, TLS, SNI, ALPN, SSH, PostgreSQL, QUIC, Socks4, Socks5, Winbox, Wireguard, XMPP, Proxy Protocol + - 支持 regexp 自定义探测 + - 路由支持 Socks5, TLS termination, echo, proxy protocol, tee + +```caddyfile +{ + servers { + # for current 80 443 + listener_wrappers { + layer4 { + @ssh_l4 ssh + route @ssh_l4 { + proxy 127.0.0.1:22 + } + + # PG < 17 do not support TLS SNI handshakes + # crash for now https://github.com/mholt/caddy-l4/issues/264 + @pg_l4 postgres + route @pg_l4 { + proxy 127.0.0.1:5432 + } + + # PG 17+ libpq/jdbc ?sslnegotiation=direct&sslmode=require + @tls_pg_l4 tls sni pg.example.com + route @tls_pg_l4 { + tls { + connection_policy { + alpn postgresql + } + } + proxy 127.0.0.1:5432 + } + + # redis-cli -u "rediss://default:$REDIS_PASSWORD@redis.example.com:443" --sni redis.example.com info + @tls_redis_l4 tls sni redis.example.com + route @tls_redis_l4 { + tls + proxy 127.0.0.1:6379 + } + + route + } + tls + } + } +} +``` diff --git a/notes/evolve/dev-thought.md b/notes/evolve/dev-thought.md index 93b0dd50d43..0e426e14399 100644 --- a/notes/evolve/dev-thought.md +++ b/notes/evolve/dev-thought.md @@ -1,5 +1,8 @@ --- title: 开发思考 +tags: +- Insight +- Thinking --- # 开发思考 diff --git a/notes/evolve/life-faq.md b/notes/evolve/life/life-faq.md similarity index 100% rename from notes/evolve/life-faq.md rename to notes/evolve/life/life-faq.md diff --git a/notes/hardware/hardware-awesome.md b/notes/hardware/hardware-awesome.md index 062cea132db..e7ffe2eedb8 100644 --- a/notes/hardware/hardware-awesome.md +++ b/notes/hardware/hardware-awesome.md @@ -26,3 +26,13 @@ tags: - Microcontroller VGA Interface Projects - [HN](https://news.ycombinator.com/item?id=29127582) - CP243 + +## CPU + +| cpu | year | cores | threads | freq | cache | tdp | socket | arch | process | notes | +| ----- | ---- | ----- | ------- | ----------- | ------ | --- | --------- | ------------ | ------- | --------------------------- | +| j1900 | 2013 | 4 | 4 | 2.0-2.42GHz | 2MB L2 | 10W | FCBGA1170 | Bay Trail | 22 nm | DDR3L-1333; HD Graphics | +| j4125 | 2019 | 4 | 4 | 2.0-2.7GHz | 4MB L2 | 10W | FCBGA1090 | Gemini Lake | 14 nm | DDR4-2400; UHD Graphics 600 | +| n5105 | 2021 | 4 | 4 | 2.0-2.9GHz | 4MB L3 | 10W | FCBGA1338 | Jasper Lake | 10 nm | DDR4-2933; UHD Graphics | +| n100 | 2023 | 4 | 4 | 0.8-3.4GHz | 6MB L3 | 6W | FCBGA1264 | Alder Lake N | 10 nm | DDR4/DDR5; UHD Graphics | +| n300 | 2023 | 8 | 8 | 0.8-3.8GHz | 6MB L3 | 7W | FCBGA1264 | Alder Lake N | 10 nm | DDR4/DDR5; UHD Graphics | diff --git a/notes/hardware/hardware-glossary.md b/notes/hardware/hardware-glossary.md index dc351cbfc0d..dd7f4fe950e 100644 --- a/notes/hardware/hardware-glossary.md +++ b/notes/hardware/hardware-glossary.md @@ -7,6 +7,14 @@ tags: # 硬件词汇 +**Networks** + +| abbr. | stand for | cn | +| ----- | ------------------------------ | ---------------- | +| AP | Access Point | 接入点 | +| WDS | Wireless Distribution System | 无线分布系统 | +| DAWN | Dynamic Access Windows Network | 动态访问窗口网络 | + - Form Factor - M.2 Type 2280-S3-M / 2280-D3-M - M.2 Type 2280-S2-M @@ -34,3 +42,7 @@ tags: # CH_PD - Chip power-down + +## AX3000 + +- OFDM - Orthogonal Frequency Division Multiplexing - 正交频分复用 diff --git a/notes/languages/parser/antlr/README.md b/notes/languages/parser/antlr/README.md index b8269709ac4..ef5bdeaea24 100644 --- a/notes/languages/parser/antlr/README.md +++ b/notes/languages/parser/antlr/README.md @@ -4,9 +4,9 @@ title: Antlr 4 # Antlr4 -- ANTLR - ANother Tool for Language Recognition -- 案例 - - [grammars-v4](https://github.com/antlr/grammars-v4) +- [antlr/antlr4](https://github.com/antlr/antlr4) + - BSD-3 + - ANTLR - ANother Tool for Language Recognition - 语言支持 - Java - C# @@ -17,6 +17,9 @@ title: Antlr 4 - Swift - Antlr4 - Adaptive LL(*) - https://www.antlr.org/papers/allstar-techreport.pdf - Antlr3 - LL(*) +- 参考 + - [grammars-v4](https://github.com/antlr/grammars-v4) + - http://lab.antlr.org/ ```bash java -jar antlr-4.6-complete.jar -Dlanguage=Go MyLang.g4 diff --git a/notes/languages/parser/parser-faq.md b/notes/languages/parser/parser-faq.md index 97f334eba23..ca1a59b5c7b 100644 --- a/notes/languages/parser/parser-faq.md +++ b/notes/languages/parser/parser-faq.md @@ -33,10 +33,25 @@ tags: - PEG - 语法结构更简单,类似于拼装复杂正则,不区分语法和词法 - 执行逻辑自上下下一次性执行出结果 + - 接近 Regex + - 优点 + - 简单直观的语法,易于理解和编写 + - 没有解析歧义,规则匹配顺序明确 + - 适合处理上下文相关语法 + - 缺点 + - 不能处理 LR,需要处理为 RR + - 复杂语法需要更多的规则和优先级管理 - 每个优先级一个规则 - Antlr - 语法区分词法和语法 - Lexer 和 Grammar - 解析是有分词逻辑 - Tokenize - 将 Token 放入 Grammar 逻辑得到最终的 AST + - 优点 + - 功能强大 - 支持复杂语法和词法分析 + - 支持 LR + - 生态丰富 + - 缺点 + - 语法和词法分离 - 复杂 + - 速度可能不如 PEG **概念理论区别** @@ -81,6 +96,47 @@ Int: [0-9]+ ; - 参考 - [Left Recursion in Parsing Expression Grammars](https://arxiv.org/abs/1207.0443) +## AST vs CST + +- AST - Abstract Syntax Tree - 抽象语法树 + - 抽象结构 - 一般不包含语法规则 + - 保留有意义的节点,忽略细节 + - 简洁 - 便于后续的编译优化 + - 场景 + - 语义分析、优化和代码生成 +- CST - Concrete Syntax Tree - 具体语法树 + - 具体结构 - 包含语法规则 + - 保留细节 + - 场景 + - 代码格式化 + - 语法错误提示 + +--- + +- 通常先生成 CST,再转换为 AST + +**例子** + +``` +3 + 4 * 5 +``` + +```txt title='AST' + + + / \ +3 * + / \ + 4 5 +``` + +```txt title='CST' + Expr + / | \ + 3 + Expr + / | \ + 4 * 5 +``` + ## OctetString - Sequence of Byte @@ -92,3 +148,17 @@ Int: [0-9]+ ; - https://docs.microsoft.com/en-us/windows/win32/seccertenroll/about-octet-string - https://ldapwiki.com/wiki/OctetString - https://www.iso.org/obp/ui/#iso:std:iso-iec:8825:-7:ed-2:v1:en + +## Precedence + +**PL/SQL** + +| op | for | +| ---------------------------------------------- | ------------------------------------ | +| +, - | identity, negation | +| \*, / | multiplication, division | +| +, - | addition, subtraction, concatenation | +| =, <, >, <=, >=, <>, !=, IS, LIKE, BETWEEN, IN | comparion | +| !, NOT | logical negation | +| AND | conjunction | +| OR | inclusion | diff --git a/notes/languages/parser/parser-glossary.md b/notes/languages/parser/parser-glossary.md index 7adaccea0fd..67ee03fb74b 100644 --- a/notes/languages/parser/parser-glossary.md +++ b/notes/languages/parser/parser-glossary.md @@ -6,7 +6,7 @@ tags: # Parser Glossary -| Abbr. | Word | Desc | +| Abbr. | Word | cn | | --------------- | ---------------------------------------------- | ------------------------------ | | BNF | Backus–Naur form | 巴科斯范式 - 1959 John Backus | | EBNF | extended BNF | 扩展巴科斯范式 - ISO-14977 | @@ -24,8 +24,11 @@ tags: | SLR | | Canonical LR(1) | | Minimal LR(1) | -| GLR | +| GLR | Generalized LR parser | 广义 LR 解析器 | | RPN | Reverse Polish notation | +| AST | Abstract Syntax Tree | 抽象语法树 | +| CST | Concrete Syntax Tree | 具体语法树 | +| CSG | Context-sensitive grammar | 上下文相关语法 | | en | cn | | ---------- | ------ | @@ -61,19 +64,28 @@ graph TD; LL_k["LL(k)"] ``` -## Left recursion +## 右递归 {#right-recursion} + +- `A -> αA | β` +- 不会导致无限递归,更容易处理。 +- 可能会导致更深的递归调用栈,但现代的 Parser 能优化这种情况。 + +## 左递归 {#left-recursion} + +- `A -> Aα | β` + - A 递归调用自己 - [Left recursion](https://en.wikipedia.org/wiki/Left_recursion) - Direct left recursion - Indirect left recursion -**a and b and c** +## Packrat -```json -{ - "type": "and", - // left - "left": {"type": "and", "left": {"term": "a"}, "right": {"term": "b"}}, - // - "right": {"term": "c"} -} -``` +- 动态规划 +- 在解析过程中缓存(memoization)中间结果 +- 适合处理具有无限前瞻能力的语法。 +- 优点 + - 能够处理左递归和右递归。 + - 解析速度快,适合实时解析。 +- 缺点 + - 需要额外的内存空间。 +- [Packrat parsing](https://en.wikipedia.org/wiki/Packrat_parser) diff --git a/notes/languages/parser/peg.md b/notes/languages/parser/peg/README.md similarity index 97% rename from notes/languages/parser/peg.md rename to notes/languages/parser/peg/README.md index 5da8a5a9fa7..dbdb01bee2c 100644 --- a/notes/languages/parser/peg.md +++ b/notes/languages/parser/peg/README.md @@ -7,6 +7,7 @@ sidebar_label: PEG - PEG 类似 CFG,但不存在歧义 - 不会回溯执行 - 例如 `a|ab` 只会匹配第一个 + - `LL(*)` with infinite lookahead - 优化 - Packrat - [Parsing expression grammar](https://en.wikipedia.org/wiki/Parsing_expression_grammar) @@ -59,4 +60,3 @@ Boolean = "true" / "false" _ "whitespace" = [ \t\n\r]* ``` -## Packrat diff --git a/notes/languages/parser/peg/miniquery.mikro-orm.peggy b/notes/languages/parser/peg/miniquery.mikro-orm.peggy index 6342d07dc86..aca46f4bcf3 100644 --- a/notes/languages/parser/peg/miniquery.mikro-orm.peggy +++ b/notes/languages/parser/peg/miniquery.mikro-orm.peggy @@ -11,149 +11,224 @@ and tags @> ['Hello'] and !( tags @> ['Hello'] ) */ {{ -/* eslint-disable @typescript-eslint/interface-name-prefix,@typescript-eslint/no-empty-interface,no-case-declarations,no-control-regex,prefer-const */ -// ts-nocheck -const pick = (obj, keys) => keys.reduce((o, k) => (o[k] = obj[k], o), {}) -// https://mikro-orm.io/docs/query-conditions -const OPERATORS = { - ">=":"$gte", - "<=":"$lte", - ">":"$gt", - "<":"$lt", - // ":":"$eq",// fixme has - "=":"$eq", - "==":"$eq", - "===":"$eq", - "<>":"$ne", - "!=":"$ne", - "in":"$in", - "not in":"$nin", - '&&':'$and', - 'and':'$and', - '||':'$or', - 'or':'$or', - 'nor':'$nor', - '!' : '$not', - '~' : '$re', - 'like' : '$like', - 'ilike' : '$ilike', - // https://www.postgresql.org/docs/current/functions-json.html - '@>' : '$contains', - '<@' : '$contained', - // $overlap && - // https://www.postgresql.org/docs/current/functions-textsearch.html - // $fulltext - 'between': '$between', -} -// https://www.postgresql.org/docs/current/functions-array.html -const ARRAY_OPERATORS = Object.assign({'&&':'$overlap'},pick(OPERATORS,['@>','<@'])) + /* eslint-disable @typescript-eslint/interface-name-prefix,@typescript-eslint/no-empty-interface,no-case-declarations,no-control-regex,prefer-const */ + // ts-nocheck + const pick = (obj, keys) => keys.reduce((o, k) => ((o[k] = obj[k]), o), {}); + // https://mikro-orm.io/docs/query-conditions + const OPERATORS = { + ">=": "$gte", + "<=": "$lte", + ">": "$gt", + "<": "$lt", + // ":":"$eq",// fixme has + "=": "$eq", + "==": "$eq", + "===": "$eq", + "<>": "$ne", + "!=": "$ne", + in: "$in", + "not in": "$nin", + "&&": "$and", + and: "$and", + "||": "$or", + or: "$or", + nor: "$nor", + "!": "$not", + "~": "$re", + like: "$like", + ilike: "$ilike", + // https://www.postgresql.org/docs/current/functions-json.html + "@>": "$contains", + "<@": "$contained", + // $overlap && + // https://www.postgresql.org/docs/current/functions-textsearch.html + // $fulltext + between: "$between", + }; + // https://www.postgresql.org/docs/current/functions-array.html + const ARRAY_OPERATORS = Object.assign( + { "&&": "$overlap" }, + pick(OPERATORS, ["@>", "<@"]) + ); }} { -function _op(op){ - if(typeof op === 'string' && op.startsWith('$')) return op; - op = !Array.isArray(op)?op:op.flat().filter(v=>v && v.trim()).join(' ').toLowerCase() - return OPERATORS[op] || (console.error('unexpected op',op),op) -} -function _compound(op,a,b){ - if(!op)return a - op = _op(op) - if(b[op])return {[op]:[a,...b[op]]} - return {[op]:[a,b]} -} -function _make(field, op, a, b) { - // NOTE 如果做了 join 支持 {'a.b':{$gt:1}} - const out = {}; - let cur = out; - if (Array.isArray(field)) { - for (const v of field) { - cur = cur[v] ||= {}; - } - } else { - cur = out[field] ||= {}; + function _op(op) { + if (typeof op === "string" && op.startsWith("$")) return op; + op = !Array.isArray(op) + ? op + : op + .flat() + .filter((v) => v && v.trim()) + .join(" ") + .toLowerCase(); + return OPERATORS[op] || (console.error("unexpected op", op), op); } - switch (op) { - case '$between': - cur['$gte'] = a; - cur['$lte'] = b; - break; - default: - cur[_op(op)] = a; - break; + function _compound(op, a, b) { + if (!op) return a; + op = _op(op); + if (b[op]) return { [op]: [a, ...b[op]] }; + return { [op]: [a, b] }; + } + function _make(field, op, a, b) { + // NOTE 如果做了 join 支持 {'a.b':{$gt:1}} + const out = {}; + let cur = out; + if (Array.isArray(field)) { + for (const v of field) { + cur = cur[v] ||= {}; + } + } else { + cur = out[field] ||= {}; + } + switch (op) { + case "$between": + cur["$gte"] = a; + cur["$lte"] = b; + break; + default: + cur[_op(op)] = a; + break; + } + return out; } - return out; -} } - // https://github.com/stalniy/ucast // https://www.mongodb.com/docs/manual/reference/operator/query/ -Main = next:ValueExpr EOF {return next} +Main = next:QueryExpr EOF { return next; } -Expr = _ next:CompoundExpr _ {return next} +// miniquery +QueryExpr = _ @next:CompoundExpr _ + +Expr = _ next:CompoundExpr _ { return next; } CompoundExpr = left:RelExpr rest:( - op:(_('&&'/'||')_/(__ (and/or) __)) - right:CompoundExpr {return {op,right}} - )? {return rest?.right?_compound(rest?.op,left,rest?.right):left} + op:(_ ("&&" / "||") _ / (__ (and / or) __)) right:CompoundExpr { + return { op, right }; + } + )? { return rest?.right ? _compound(rest?.op, left, rest?.right) : left; } RelExpr - = '(' next:Expr ')' {return next} // NOTE: and > or - / '!' next:RelExpr {return {'$not':next}} - / field:Field __ 'between' __ value1:literal __ 'and' __ value2:literal { return _make(field, '$between', value1, value2); } - / field:Field _ op:('>=' / '<='/ '<>' / '>' / '<' / '===' / '==' / '!=' / '=' / ':') _ value:literal {return _make(field,op,value)} - / field:Field _ op:('@>' / '<@' / '&&' ) _ value:Array {return _make(field,ARRAY_OPERATORS[op],value)} - / field:Field _ op:('~') _ value:string {return _make(field,op,value)} - / field:Field __ op:(is __ null) {return _make(field,'=',null)} - / field:Field __ op:(is __ not __ null) {return _make(field,'!=',null)} - / field:Field __ op:((not __)? (in)) __ value:Array {return _make(field,op,value)} - / field:Field __ op:((not __)? (like/ilike)) __ value:string {return _make(field,op,value)} + = "(" next:Expr ")" { return next; } // NOTE: and > or + / "!" next:RelExpr { return { $not: next }; } + / field:Field __ "between" __ value1:literal __ "and" __ value2:literal { + return _make(field, "$between", value1, value2); + } + / field:Field + _ + op:(">=" / "<=" / "<>" / ">" / "<" / "===" / "==" / "!=" / "=" / ":") + _ + value:literal { return _make(field, op, value); } + / field:Field _ op:("@>" / "<@" / "&&") _ value:Array { + return _make(field, ARRAY_OPERATORS[op], value); + } + / field:Field _ op:"~" _ value:string { return _make(field, op, value); } + / field:Field __ op:(is __ null) { return _make(field, "=", null); } + / field:Field __ op:(is __ not __ null) { return _make(field, "!=", null); } + / field:Field __ op:((not __)? in) __ value:Array { + return _make(field, op, value); + } + / field:Field __ op:((not __)? (like / ilike)) __ value:string { + return _make(field, op, value); + } + +FunctionExpr + = name:name _ "(" _ args:Values? _ ")" { + return { type: "function", name, values: args || [] }; + } ValueExpr - = Value + = FunctionExpr / Field - / Function + / Value -Function - = name:name _ "(" _ args:Values? _ ")" { - return { type: 'function', name, values: args || [] }; - } +Field + = ref + / name -Field = ref / name -//ref = a:name b:('.' v:name {return v})+ {return [a,...b].join('.')} -ref = a:name|1..,_ '.'_ | {return a} -name = ([a-zA-Z]([_a-zA-Z0-9])*) {return text()} +// Value = literal / Field +Value = literal -Value = literal / Field // Values = next:(a:Value _ b:(_ ',' _ next:Value {return next})* ','? {return b?[a,...b]:a})? {return next || []} -Values = next:(Value|.., _ "," _ |) _ ','? {return next || []} -Array = '[' _ next:Values _ ']' {return next} / '(' _ next:Values _ ')' {return next} - -in = 'in' / 'IN' {return 'in'} -is = 'is' / 'IS' {return 'is'} -like = 'like' / 'LIKE' {return 'like'} -ilike = 'ilike' / 'ILIKE' {return 'ilike'} -between = 'between' / 'BETWEEN' {return 'between'} -and = ('and' / 'AND') {return 'and'} -not = ('not' / 'NOT') {return 'not'} -or = ('or' / 'OR') {return 'or'} -logic = and / or - -literal = string / float / int / bool / null -int = [1-9][0-9]* {return parseInt(text())} -float = [0-9]* '.'[0-9]+ {return parseFloat(text())} +Values = next:Value|.., _ "," _| _ ","? { return next || []; } + +Array + = "[" _ next:Values _ "]" { return next; } + / "(" _ next:Values _ ")" { return next; } + +//ref = a:name b:('.' v:name {return v})+ {return [a,...b].join('.')} +ref = a:name|1.., _ "." _| { return a; } + +name = ([a-zA-Z] [_a-zA-Z0-9]*) { return text(); } + +in + = "in" + / "IN" { return "in"; } + +is + = "is" + / "IS" { return "is"; } + +like + = "like" + / "LIKE" { return "like"; } + +ilike + = "ilike" + / "ILIKE" { return "ilike"; } + +between + = "between" + / "BETWEEN" { return "between"; } + +and = ("and" / "AND") { return "and"; } + +not = ("not" / "NOT") { return "not"; } + +or = ("or" / "OR") { return "or"; } + +logic + = and + / or + +literal + = string + / float + / int + / bool + / null + +int = [0-9]+ { return parseInt(text()); } + +float = [0-9]+ "." [0-9]+ { return parseFloat(text()); } + string - = "'" v:([^']*) "'" {return v.join('')} - / '"' v:[^"]* '"' {return v.join('')} -null = ('null' / 'NULL') {return null} -bool = ('true' / 'false' / 'TRUE' / 'FALSE') {return text().toLowerCase() === 'true'} + = "'" v:[^']* "'" { return v.join(""); } + / "\"" v:[^"]* "\"" { return v.join(""); } + +null = ("null" / "NULL") { return null; } + +bool + = ("true" / "false" / "TRUE" / "FALSE") { + return text().toLowerCase() === "true"; + } + +ident_start = [A-Za-z_] + +KW_AND = "and" !ident_start + +KW_OR = "or" !ident_start + +_ "whitespace" = white* { return ""; } + +__ "whitespace" = white+ { return " "; } -_ "whitespace" = white* {return ''} -__ "whitespace" = white+ {return ' '} white - = '/*' ([^*]*) '*/' - / '--' ([^\r\n]*) ('\n'/EOF) - / [ \t\n\r] + = "/*" [^*]* "*/" + / "--" [^\r\n]* ("\n" / EOF) + / [ \t\n\r] + EOF = !. diff --git a/notes/languages/parser/peg/miniquery.pegjs b/notes/languages/parser/peg/miniquery.pegjs deleted file mode 100644 index 7dc91c6a78c..00000000000 --- a/notes/languages/parser/peg/miniquery.pegjs +++ /dev/null @@ -1,131 +0,0 @@ -// https://peggyjs.org/online -/* --- test -(id > 10) and b < 10 or ( -1 = 1 --- comment -or a in [] -or a in () -- a -or a not in [] -or a not in () -or a is true -or a is false -or a is not true -or a is not false -or a is null -or a is not null -or a like '%a%' -or a not like '%a%' -or a between 1 and 2 -or a between "11" and "12" -or a in [1,] -or a in [1,1.1,true,false,null,b] -or a > now() -or a > +1.0 -or a < -.1 -and a > date(col) -and b > date( col1, ) -and b<>date( c1,1,.1,true, null,) -and true -and false -and 1 -and "1" -and a.b.c > 1 -) -*/ - -{ -/* eslint-disable @typescript-eslint/interface-name-prefix,@typescript-eslint/no-empty-interface,no-case-declarations,no-control-regex,prefer-const */ -// ts-nocheck - -function logic(op,left,right){ - if (!op) { - return left - } - if(right.type === 'logic' && right.op === op){ - return {type:'logic',op,exprs:[left,...right.exprs]} - } - return {type:'logic',op,exprs:[left,right]} -} -function _op(op){ -return op.flat().filter(v=>v && v.trim()).join(' ').toLowerCase() -} -} - -// https://github.com/wenerme/wener/tree/master/tricks/languages/parser/peg/miniquery.pegjs -// https://www.postgresql.org/docs/current/sql-select.html -// https://google.aip.dev/160 - -Expr - = _ expr:LogicExpr _ {return expr} - -LogicExpr - = left:RelExpr rest:(__ op:logic __ right:LogicExpr {return {op,right}})? {return logic(rest?.op,left,rest?.right)} - -RelExpr - = left:InExpr rest:(_ op:('>=' / '<='/ '<>' / '>' / '<' / '==' / '!=' / '=' / ':') _ right:RelExpr {return {op,right}}) ? {return rest?{type:'rel',op:rest.op,left,right:rest.right}:left} - -InExpr - = left:PredicateExpr rest:(__ op:((not __)? in) _ values:Array {return {op:_op(op),values}})? {return rest?{type:'in',left,...rest}:left} - -PredicateExpr - = left:BetweenExpr rest:( - __ op:(is __ (not __)?) right:(null / bool) {return {op:_op(op),right}} - / __ op:((not __)? like) __ right:string {return {op:_op(op),right}} - )? {return rest?{type:'predicate',left,...rest}:left} - -BetweenExpr - = left:CallExpr rest:(__ op:((not __)? between) __ a:CallExpr _ and _ b:CallExpr {return {op:_op(op),a,b}}) ? {return rest?{type:'between',left,...rest}:left} - -CallExpr - = name:name '(' _ Values _ ')' {return {type:'function',name}} - / next:PriExpr {return next} - -PriExpr - = '(' expr:Expr ')' {return {type:'paren',expr}} // paren - / not __ expr:Expr {return {type:'not',expr}} // not - // / Array - / next:Value {return next} - / '+' _ expr:Expr {return {type:'positive',expr}}// pos - / '-' expr:Expr {return {type:'negetive',expr}}// neg - - -in = 'in'/'IN' -is = 'is' / 'IS' -like = 'like' / 'LIKE' -between = 'between' / 'BETWEEN' -and = ('and' / 'AND' / '&&') {return 'and'} -not = ('not' / 'NOT') {return 'not'} -or = ('or' / 'OR' / '||') {return 'or'} -logic = and / or - -Value = literal / ref / ident -Values = next:(a:Value _ b:(_ ',' _ next:Value {return next})* ','? {return b?[a,...b]:a})? {return next || []} -Array = '[' next:Values ']' {return next} / '(' next:Values ')' {return next} - - -JsonReference = field (('->'/'->>') string)+ -field = ident / ref - -ident = name {return {type:'id',name:text()}} -ref = a:name b:('.' v:name {return v})+ {return {type:'ref',refs:[a,...b]}} -name = ([a-zA-Z]([_a-zA-Z0-9])*) {return text()} - -literal = string / float / int / bool / null -int = [1-9][0-9]* {return {type:'integer',value:parseInt(text())}} -float = [0-9]* '.'[0-9]+ {return {type:'float',value:parseFloat(text())}} -string - = "'" v:([^']*) "'" {return {type:'string',value:v.join('')}} - / '"' v:[^"]* '"' {return {type:'string',value:v.join('')}} -null = ('null' / 'NULL') {return {type:'null',value:null}} -bool = ('true' / 'false' / 'TRUE' / 'FALSE') {return {type:'boolean',value:text().toLowerCase() === 'true'}} - - -_ "whitespace" - = white* {return ''} -__ "whitespace" - = white+ {return ' '} -white - = '/*' ([^*]*) '*/' - / '--' ([^\r\n]*) '\n' - / [ \t\n\r] diff --git a/notes/languages/parser/peggy.md b/notes/languages/parser/peg/peggy.md similarity index 96% rename from notes/languages/parser/peggy.md rename to notes/languages/parser/peg/peggy.md index 14f9fe3be44..a3f02387624 100644 --- a/notes/languages/parser/peggy.md +++ b/notes/languages/parser/peg/peggy.md @@ -11,6 +11,10 @@ title: peggy - https://peggyjs.org/online - [metadevpro/ts-pegjs](https://github.com/metadevpro/ts-pegjs) - TS code generation plugin for peggy + - Formatter https://siefkenj.github.io/prettier-pegjs-playground/ + - examples + - https://github.com/alsotang/sql.pegjs/blob/master/lib/sql.pegjs + - https://www.sqlite.org/syntaxdiagrams.html - PEG.js 之后新功能 - Global Initializers `{{}}` - 全局 @@ -139,7 +143,7 @@ Values = next:(Value|..,","|) ','? {return next || []} - reserved/保留关键词 - count -```pegjs +```peggy {{ // 全局初始化 - 定义的方法和变量全局有效 }} diff --git a/notes/languages/parser/pegjs.md b/notes/languages/parser/peg/pegjs.md similarity index 100% rename from notes/languages/parser/pegjs.md rename to notes/languages/parser/peg/pegjs.md diff --git a/notes/languages/python/README.md b/notes/languages/python/README.md index 4eb8d4633a8..3da5d8a4650 100644 --- a/notes/languages/python/README.md +++ b/notes/languages/python/README.md @@ -1,5 +1,7 @@ --- title: Python +tags: +- Topic --- # Python @@ -17,8 +19,9 @@ title: Python ```bash # venv -python3 -m venv venv -source venv/bin/activate +python3 -m venv .venv +# VIRTUAL_ENV_PROMPT 增加在 PS1 的内容 +source .venv/bin/activate # 确保安装 pip python -m ensurepip @@ -39,20 +42,6 @@ python3 -m venv build/useful source build/useful/bin/activate ``` -## FAQ - -### venv, pyvenv, pyenv, virtualenv, virtualenvwrapper, pipenv - -- venv - py3 自带,创建隔离环境,不需要拷贝二进制 -- virtualenv - 创建虚拟隔离环境,支持 py2 py3 -- pyenv - 多版本隔离 -- pyvenv - venv+pyenv -- virtualenvwrapper - virtualenv 扩展 -- pipenv - Pipefile+pip+virtualenv -- Pipenv、Poetry - 类似于 yanr 和 bundler - -- [What is the difference between venv, pyvenv, pyenv, virtualenv, virtualenvwrapper, pipenv, etc?](https://stackoverflow.com/questions/41573587) - ## 词汇 - setup.py @@ -103,7 +92,7 @@ pip install -i http://localhost:3141/testuser/dev my-package - Python 转可执行文件 - shiv - 类似于 pex,但更简单,直接使用 pip -- xar - eXecutable ARchive) +- xar - eXecutable ARchive - 设计于打包自包含可的可执文件,以 py 为主 ```bash @@ -116,5 +105,6 @@ entry_points=dict( ) ``` -pyproject.toml -flit +- pyproject.toml + - poetry +- flit diff --git a/notes/languages/python/poetry.md b/notes/languages/python/poetry.md new file mode 100644 index 00000000000..b1df215a355 --- /dev/null +++ b/notes/languages/python/poetry.md @@ -0,0 +1,152 @@ +--- +tags: + - Package Management +--- + +# poetry + +- [python-poetry/poetry](https://github.com/python-poetry/poetry) + - MIT, Python +- pyproject.toml <- setup.py, requirements.txt, setup.cfg, MANIFEST.in, Pipfile + +```bash +brew install poetry # by macOS Homebrew +pip install poetry # by pip + +poetry init # for existing project +poetry new my-project # for new project + +# brew install python@3.12 +python3.12 --version # 修改 python 版本 +poetry env use python3.12 + +poetry run which python # venv +poetry run python --version + +poetry self update # update poetry + +poetry config --list # 查看配置 + +# POETRY_VIRTUALENVS_PATH +poetry config virtualenvs.path # 查看 virtualenvs 路径 +# 可以考虑不提交 poetry.toml 到仓库 +poetry config virtualenvs.create false --local # 项目维度配置 poetry.toml +poetry config virtualenvs.in-project true --local # 推荐 - 创建到 .venv 而不是 {cache-dir}/virtualenvs +``` + +## Configuration {#conf} + +- 配置 POETRY_CONFIG_DIR, cache-dir + - `~/Library/Application Support/pypoetry` + - `%APPDATA%\pypoetry` + - `$XDG_CONFIG_HOME/.config/pypoetry` + - `~/.config/pypoetry` +- 数据 POETRY_HOME, POETRY_DATA_DIR + - `$XDG_DATA_HOME/pypoetry`, `~/.local/share/pypoetry` + - `%APPDATA%\pypoetry` + - `~/Library/Application Support/pypoetry` +- 缓存目录 POETRY_CACHE_DIR + - Linux: `$XDG_CACHE_HOME/pypoetry`, `~/.cache/pypoetry` + - Windows: `%LOCALAPPDATA%\pypoetry` + - macOS: `~/Library/Caches/pypoetry` +- 参考 + - https://python-poetry.org/docs/configuration/#available-settings + +## system site-packages + +```bash +python -m venv --system-site-packages .venv +poetry env use .venv/bin/python +``` + +## Monorepo + +- https://gitlab.com/gerbenoostra/poetry-monorepo/ + +# FAQ + +## using requirements.txt + +```toml +[project] +dynamic = ["dependencies", "optional-dependencies"] +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} +optional-dependencies = {dev = { file = ["requirements-dev.txt"] }} +``` + +## Docker + +- https://miguel-mendez-ai.com/2024/03/12/poetry-torch-docker + +## Torch CPU only + +```bash +pip install torch --index-url https://download.pytorch.org/whl/cpu +pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu + +# TORCH_ARCH cu116 +poetry run pip install torch==2.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html +``` + +```bash +poetry source add --priority explicit pytorch https://download.pytorch.org/whl/cpu +poetry add --source pytorch torch touchvision + +poetry add --source pytorch torch=2.5.0+cpu +``` + +- 2.2.2 之后版本失败 Unable to find installation candidates for torch +- macOS 会安装失败 + - https://github.com/python-poetry/poetry/issues/9524 +- Instructions for installing PyTorch [python-poetry/poetry#6409](https://github.com/python-poetry/poetry/issues/6409) + +**支持切换的配置方式** + +```toml + +[tool.poetry.group.cpu] +optional = true + +[tool.poetry.group.cpu.dependencies] +torch = { version = "^2.5.0", source = "pytorch-cpu", markers = "extra=='cpu' and extra!='gpu'" } + +[tool.poetry.group.gpu] +optional = true + +[tool.poetry.group.gpu.dependencies] +torch = { version = "^2.5.0", source = "pytorch-gpu", markers = "extra=='gpu' and extra!='cpu'" } + +[tool.poetry.extras] +cpu = ["torch", "torchvision"] +gpu = ["torch", "torchvision"] + +[[tool.poetry.source]] +name = "pytorch-cpu" +url = "https://download.pytorch.org/whl/cpu" +priority = "explicit" + +[[tool.poetry.source]] +name = "pytorch-gpu" +url = "https://download.pytorch.org/whl/cu121" +priority = "explicit" + +[[tool.poetry.source]] +name = "pytorch-cuda" +url = "https://download.pytorch.org/whl/cu121" +priority = "explicit" +``` + +```bash +poetry install -E cpu --with cpu --sync + +poetry install -E gpu --with gpu --sync +``` + +## 只初始化 venv {#init-venv-only} + +```bash +poetry run echo "Venv initialized" +``` + +用于先有 venv, 然后需要使用 pip 安装部分依赖, 然后再使用 poetry 安装的场景 diff --git a/notes/languages/python/pyinstaller.md b/notes/languages/python/pyinstaller.md new file mode 100644 index 00000000000..efdd88e29cd --- /dev/null +++ b/notes/languages/python/pyinstaller.md @@ -0,0 +1,24 @@ +--- +title: PyInstaller +--- + +# PyInstaller + +- pyi-makespec +- MEI - MEIPASS + - sys.\_MEIPASS + - `C:\Users\\AppData\Local\Temp` + +```bash +pyi-makespec --onefile --windowed --name myapp app.py +``` + +```py +import sys +import os + +def resource_path(relative_path): + """ Get absolute path to resource, works for dev and for PyInstaller """ + base_path = getattr(sys, '_MEIPASS', os.path.dirname(os.path.abspath(__file__))) + return os.path.join(base_path, relative_path) +``` diff --git a/notes/languages/python/python-faq.md b/notes/languages/python/python-faq.md index 1944a81f092..88e6567cbc4 100644 --- a/notes/languages/python/python-faq.md +++ b/notes/languages/python/python-faq.md @@ -13,55 +13,3 @@ pip list --outdated - PYTHONHOME - PYTHONPATH - https://docs.python.org/3/using/cmdline.html - -## venv - -:::caution - -- 不要在 venv 环境下工作 - 不要放项目内容 - -::: - - -```bash -# 以前为 pyvenv - 3.3 - 3.7 -# 有些 distro 需要额外安装 python3-venv -# 只有部分 virtualenv 功能 -python3 -m venv venv - -source venv/bin/activate -deactivate - -# 如果只删除虚拟环境 -cd venv -rm -rf bin include lib lib64 Scripts Lib pyvenv.cfg -``` - -``` -venv/ -├── bin/ (Linux/macOS) or Scripts/ (Windows) -│ ├── activate -│ ├── activate.csh -│ ├── activate.fish -│ ├── pip -│ ├── python -> python3 -│ └── python3 -├── include/ -├── lib/ (Linux/macOS) or Lib/ (Windows) -│ └── pythonX.Y/ -│ └── site-packages/ -├── lib64/ (Linux, optional) -├── pyvenv.cfg -└── share/ (Linux, optional) -``` - -- [pyenv](./pyenv.md) - - 多版本管理 -- [python-poetry/poetry](https://github.com/python-poetry/poetry) -- pyenv-virtualenv -- venv - - https://docs.python.org/3/library/venv.html -- virtualenv - - https://virtualenv.pypa.io/en/latest/ -- pipenv -- ~~pyvenv~~ diff --git a/notes/os/linux/shell/shell-awesome.md b/notes/os/linux/shell/shell-awesome.md index 3e001bd8de0..731a5fdda1e 100644 --- a/notes/os/linux/shell/shell-awesome.md +++ b/notes/os/linux/shell/shell-awesome.md @@ -23,7 +23,8 @@ tags: - [shell-pool/shpool](https://github.com/shell-pool/shpool) - remote/ssh - openssh - - bear + - [mkj/dropbear](https://github.com/mkj/dropbear) + - Dropbear SSH - mosh - [moul/quicssh](https://github.com/moul/quicssh) - SSH over QUIC @@ -126,6 +127,8 @@ tags: - [ibraheemdev/modern-Unix](https://github.com/ibraheemdev/modern-Unix) - [explainshell](https://explainshell.com/) - [shellinabox/shellinabox](https://github.com/shellinabox/shellinabox) +- sshrc +- [xxh/xxh](https://github.com/xxh/xxh) - awk - Awk: The Power and Promise of a 40-Year-Old Language [HN](https://news.ycombinator.com/item?id=28441887) - [benhoyt/prig](https://github.com/benhoyt/prig) @@ -155,6 +158,7 @@ tags: - 支持 tmux - 支持 iTerm2 https://trzsz.github.io/iterm2 - trzsz-go, trzsz-ssh + - [trzsz/trzsz-ssh](https://github.com/trzsz/trzsz-ssh) - [trzsz/trzsz.js](https://github.com/trzsz/trzsz.js) - https://github.com/jumpserver/jumpserver/issues/10679 diff --git a/notes/philosophy/philosophy-glossary.md b/notes/philosophy/philosophy-glossary.md index 23ec2a7808b..b43c2341318 100644 --- a/notes/philosophy/philosophy-glossary.md +++ b/notes/philosophy/philosophy-glossary.md @@ -1,12 +1,69 @@ --- tags: -- Glossary + - Glossary --- -# Logic Glossary +# Philosophy Glossary -paradox -: 悖论 +| en | cn | +| ---------- | ---- | +| paradox | 悖论 | +| Philosophy | 哲学 | - Self-Reference - https://plato.stanford.edu/entries/self-reference/ + +## 第一性原则 {#first-principle} + +- 明确核心问题 + - 问题本质 + - 目标 +- 分解问题 +- 质疑现有假设 +- 重构解决方案 + +--- + +- 回归本质 +- 质疑假设 +- 创新求变 + +## 精力 {#energy} + +指个体在生理、心理和情感层面上投入和维持活动的能力。它决定了一个人能否高效完成任务和面对挑战。 + +- 是一种动态的资源,会随着时间、行为和环境而变化。 +- 时间是固定的,精力是动态的 +- 精力决定了效率 + +--- + +**精力的四个维度** + +1. 身体精力:身体的健康和体能状态,例如睡眠质量、饮食习惯和运动状况。 +2. 情绪精力:情绪的稳定性和积极性,例如开心、满足时更容易高效工作。 +3. 心理精力:专注力和思维能力,例如完成复杂任务所需的认知投入。 +4. 精神精力:个人信念和价值观带来的动力,例如追求意义感或使命感。 + +**精力的表现** + +- 高精力状态:充满动力,专注且高效。 +- 低精力状态:疲劳、拖延、分心。 + +## 整理 {#organize} + +- 整理是系统化的行为 +- 整理 + - 分类 + - 功能性 + - 频率性 + - 逻辑性 + - 清理 - 移除多余项 + - 布局 - 优化物品摆放位置 + - 建立维护机制 +- 分类是其中的一个方法 + - 分类让整理更加高效和逻辑化。 +- 目的 + - 提高效率 + - 降低压力 + - 释放资源 diff --git a/notes/security/security-faq.md b/notes/security/security-faq.md index f58bbfce31f..9ef6e443c50 100644 --- a/notes/security/security-faq.md +++ b/notes/security/security-faq.md @@ -6,6 +6,7 @@ tags: # Security FAQ + ## X.509 vs PEM 都用于对证书进行编码 diff --git a/notes/security/security-glossary.md b/notes/security/security-glossary.md index 4424fa6edf8..bc493842baf 100644 --- a/notes/security/security-glossary.md +++ b/notes/security/security-glossary.md @@ -21,12 +21,20 @@ tags: | RSA | Rivest–Shamir–Adleman | | TPM | Trusted Platform Modules | 受信任平台模块 | | ED25519 | Edwards-curve Digital Signature Algorithm | 爱德华曲线数字签名算法 | +| ECDSA | Elliptic Curve Digital Signature Algorithm | 椭圆曲线数字签名算法 | | X.509 | | SLSA | Supply chain Levels for Software Artifacts | 软件构件供应链级别 | | CA | Certificate Authority | 证书颁发机构 | | OCSP | Online Certificate Status Protocol | 在线证书状态协议 | | CRL | Certificate Revocation List | 证书吊销列表 | | PKI | Public Key Infrastructure | 公钥基础设施 | +| GSS | Generic Security Service | 通用安全服务 | +| FIPS | Federal Information Processing Standards | 联邦信息处理标准 | +| SNI | Server Name Indication | 服务器名称指示 | +| TLS | Transport Layer Security | 传输层安全 | +| SSL | Secure Sockets Layer | 安全套接字层 | +| ECH | Encrypted Client Hello | 加密客户端 Hello | +| SSH | Secure Shell | | [rfc1421]: https://www.rfc-editor.org/rfc/rfc1421 [rfc7292]: https://www.rfc-editor.org/rfc/rfc7292 diff --git a/notes/security/tls.md b/notes/security/tls.md new file mode 100644 index 00000000000..5e872f3d14a --- /dev/null +++ b/notes/security/tls.md @@ -0,0 +1,21 @@ +--- +title: TLS +--- + +# TLS + +- TLS - Transport Layer Security +- ECH - Encrypted Client Hello +- Redis 支持 TLS + - `redis-cli -u "rediss://default:$REDIS_PASSWORD@redis.example.com:443" --sni redis.example.com info` +- Postgres 17 支持 TLS + - PG17 支持 `?sslnegotiation=direct&sslmode=require` + - alpn postgresql + - https://www.postgresql.org/docs/17/protocol-flow.html#PROTOCOL-FLOW-SSL + - 旧版本 应用层实现的 SSL + - PJJDBC v42.7.4 + - https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/PGProperty.java#L696 +- SSH 不支持 TLS + - 使用的应用层协议 +- https://docs.kernel.org/networking/tls.html +- 不支持 TLS 的可以使用 stunnel/frp 等 tunnel - 但是需要额外运维 diff --git a/notes/service/api/openapi/README.md b/notes/service/api/openapi/README.md index 29ef9c544c7..e46dc15244a 100644 --- a/notes/service/api/openapi/README.md +++ b/notes/service/api/openapi/README.md @@ -31,6 +31,19 @@ title: OpenAPI - https://github.com/AdguardTeam/AdGuardHome/blob/master/openapi/openapi.yaml - https://api.twitter.com/2/openapi.json +## Schema + +- ComponentType + - Schema + - Response + - Parameter + - Example + - RequestBody + - Header + - SecurityScheme + - Link + - Callback + ## Version - OpenAPI v3.1 - 2020-06-18 diff --git a/notes/service/api/soap.md b/notes/service/api/soap.md index 0df552ac728..07471febf99 100644 --- a/notes/service/api/soap.md +++ b/notes/service/api/soap.md @@ -29,6 +29,9 @@ title: SOAP - 请求-响应 - 通知 - 请求-多响应 +- WADL - Web Application Description Language - Web 应用描述语言 + - 描述 Web 应用的资源、方法、输入/输出参数 + - RESTful - UDDI - Universal Description, Discovery, and Integration - 通用描述、发现和集成 - 用于注册和查找 Web 服务 - 三个部分 diff --git a/notes/service/auth/auth-awesome.md b/notes/service/auth/auth-awesome.md index f366cf60be6..69feed1cdc7 100644 --- a/notes/service/auth/auth-awesome.md +++ b/notes/service/auth/auth-awesome.md @@ -97,6 +97,7 @@ tags: - Apache-2.0, Go - by Auth0 FGA - https://dashboard.fga.dev/ + - PostgreSQL 14, MySQL 8, SQLite - [ory/keto](https://github.com/ory/keto) - Apache-2.0, Go - [josephglanville/zanzibar-pg](https://github.com/josephglanville/zanzibar-pg) diff --git a/notes/service/cn/cn-faq.md b/notes/service/cn/cn-faq.md index 8fe4bb3cee5..41dd35ee54f 100644 --- a/notes/service/cn/cn-faq.md +++ b/notes/service/cn/cn-faq.md @@ -74,16 +74,20 @@ tags: ## 公司类型 -- 企业 - 包括个人独资企业、合伙企业和公司、非公司企业法人等组织形式 +- 企业 + - 包括个人独资企业、合伙企业、公司、非公司企业法人等组织形式 - 公司 - 公司只是企业组织形式的其中一种 -- 个体工商户 - 自然人范畴 - - 可以起字号,也可以不起字号,可以个人经营,也可以家庭经营 +- 个体工商户 + - 自然人范畴,可以起字号,也可以不起字号,可以个人经营,也可以家庭经营 + - 不是法人,承担无限责任 - 个人独资企业 - 属于非法人组织,需登记企业名称 + - 不是法人,承担无限责任 - 一人有限公司 -- 法人 -> 企业公司 -> 法定代表人 -> 自然人 -- 法人是一个组织 +- 法人 + - 法人 -> 企业公司 -> 法定代表人 -> 自然人 + - 法人是一个组织 --- @@ -93,7 +97,14 @@ tags: --- -- 个体工商户、个人独资企业、有限责任公司、股份有限公司、合伙企业 +- 企业类型 + - 个体工商户 + - 个人独资企业 + - 有限责任公司 + - 股份有限公司 + - 合伙企业 + + ## 基本存款账户 diff --git a/notes/service/cn/cn-glossary.md b/notes/service/cn/cn-glossary.md index df923c57dbf..52d7d377beb 100644 --- a/notes/service/cn/cn-glossary.md +++ b/notes/service/cn/cn-glossary.md @@ -29,6 +29,35 @@ tags: | 工商局 | Industrial and Commercial Bureau | | 工商局 | Administration for Industry and Commerce | +公司 +: coproration / company +: 依照公司法设立的企业法人,包括有限责任公司和股份有限公司。 + +法定代表人 +: legal representative +: 根据法律或法人组织章程的规定,代表法人行使职权的负责人,在法律文件上具有签署效力。 +: **法人代表** 不是正式术语,正式的称谓是“法定代表人”。 + +法人 +: legal person +: 在法律上具有独立人格的组织,可以独立承担民事责任,包括企业法人、机关法人、事业单位法人和社会团体法人等。 + +legal entity +: 法人/法律实体 +: 与“legal person”同义,指在法律上被视为具有独立权利和义务的组织。 + +corporate representative +: 公司代表/企业代表 +: 指受公司或企业委托,代表其处理特定事务的人员,可能包括但不限于法定代表人。 + +- 企业 - enterprise, business entity + - 所有从事生产、经营活动的 **经济组织** 。 + - 法人企业:如有限责任公司、股份有限公司等,具有独立的法人资格。 + - 非法人企业:如个人独资企业、合伙企业、个体工商户等,不具有法人资格。 +- 公司一定是法人 + - 《中华人民共和国公司法》,公司是依法成立的企业法人。 +- 合伙企业、个人独资企业 **不是法人** + # 中国行政区划(administrative division) 分为几个级别(government level/level);宪法(Constitution)规定了三个级别(de jure level),但实际上有五个级别(de facto level/practical level)——33 个省级(province/province-level region/province-level division)、333 个地区级(prefecture/prefecture-level region/prefecture-level division/second-level division)【非宪法区划】、2862 个县级(county/county-level region/county-level division)、41636 个乡级(township/township-level region/township-level division)及无数村级(village/village-level region/village-level division)【非宪法区划】行政区。各个级别又有不同名称,下面加以详细讨论【具体数字以 2005 年统计数据为准】。 diff --git a/notes/service/edms/cabinet.md b/notes/service/edms/cabinet.md new file mode 100644 index 00000000000..8b39e40c3a2 --- /dev/null +++ b/notes/service/edms/cabinet.md @@ -0,0 +1,94 @@ +--- +title: 密集架 +--- + +## 密集架 + +- 密集架 Compact Shelving +- 密集柜 Movable Rack + - [Mobile shelving](https://en.wikipedia.org/wiki/Mobile_shelving) + - 日语 移动棚 +- 起源于日本 +- 用于机关、企事业单位图书资料室、档案室、样品室等存放图书资料、档案、货价、档案财务凭证、货物的新型装具。 +- 与传统式书架、货架、档案架相比,储存量大,节省空间且更有传统性。 +- 固定列 + - 控制列 - 一般不动 + - 上面通常能统管其他移动列 +- 参考 + - DA/T 7-1992 直列式档案密集架 + - GB/T 13667.3 图书密集架 +- 产品 + - https://www.bjroit.com/news/list-80-cn.html + - https://www.jx-jh.cn/product/473.html + - https://www.jx-jh.cn/product/12/ + - RFID 档案柜 https://www.cykeo.com/dangan/117.html + - 档案库房综合管理系统 https://zhuanlan.zhihu.com/p/699025522 + + +## 档案柜 + +- 凭证盒 + - 250×145×20 +- 档案盒 + - 200×310×20 + - 200×310×35 +- 档案柜 + - 列 - 横排 + - 高 - 2300mm + - 宽 - 570mm + - 组 - 纵排 + - 宽 900m + - 一列一组 宽约 1050mm + - 一列二组 宽约 1950mm + - 以此类推 + - 轨道余 1米 + - 固定列 + - 主机 +- 智能、电动、手动、固定 + +```ts +// 档案柜位置编码 +interface CabinetLocationCode { + region?: string; // 区域 + org?: string; // 机构 + repository?: string; // 库房 + + area: string; // 区号 + column: number; // 列号 + section: number; // 节号 + shelf?: number; // 架号 + level: number; // 层号 + side: number; // 左右号 1左 2右, A, B + serial: number; // 顺序号 +} + +// 档案柜设置 +interface CabinetSetting { + areaCode?: string; // 区号 + columnCount: number; // 列数 + sectionCount: number; // 节数 + levelCount: number; // 层数 + sideCount?: number; // 左右数 + sideType?: string; // 左右类型 A, B , AB + // serialCount?: number; // 顺序号数 + fixedColumnNumber: number; // 固定列号 + firstColumnNumber: number; // 起始列号 + // 每格容量 +} +``` + +--- + +- 常见 + - 5节 6 层 +- 同时会记录档案存储状态 +- 可能会存储 盒 信息 + - 盒号、盒内号 +- 可能会存储顺序号 +- 可能的编号方式 + - 从左到右 + - 从右到左 +- 固定列 + - 通常为 Android/Windows + - 可能支持存储基础的档案信息 + - 标题、年度、案号、位置、借阅状态 diff --git a/notes/service/edms/edms-awesome.md b/notes/service/edms/edms-awesome.md index 2b2f6fb6e5e..4e864de8a43 100644 --- a/notes/service/edms/edms-awesome.md +++ b/notes/service/edms/edms-awesome.md @@ -30,3 +30,7 @@ tags: - SobekCM - EPrints - Ex Libris Ltd.'s Rosetta, Preservica's Cloud, Standard and Enterprise Editions, CONTENTdm, Digital Commons, Equella, intraLibrary, Open Repository and Vital + +## 公司 + +- 上海兰台 diff --git a/notes/service/edms/edms-glossary.md b/notes/service/edms/edms-glossary.md index a8169751f4a..6a64c13984b 100644 --- a/notes/service/edms/edms-glossary.md +++ b/notes/service/edms/edms-glossary.md @@ -78,6 +78,9 @@ https://cdarchive.chengdu.gov.cn/cdarchive/uploads/201808231539113wkmdljxvgl.pdf | specialized archives | 专业档案 | | transfer | 移交 | | usability | 可用性 | +| Compact Shelving | 密集架 | +| Movable Rack | 密集柜/移动棚 | +| Filing cabinet | 文件柜 | - 移交 transfer - 按照国家规定将电子档案的保管权交给档案馆的过程。 @@ -391,23 +394,3 @@ https://cdarchive.chengdu.gov.cn/cdarchive/uploads/201808231539113wkmdljxvgl.pdf - 《中华人民共和国档案法》 - 《政府信息公开条例》 - “主动公开”“依申请公开”“不予公开” - -## 密集架 - -- 密集架 Compact Shelving -- 密集柜 Movable Rack - - [Mobile shelving](https://en.wikipedia.org/wiki/Mobile_shelving) - - 日语 移动棚 -- 起源于日本 -- 用于机关、企事业单位图书资料室、档案室、样品室等存放图书资料、档案、货价、档案财务凭证、货物的新型装具。 -- 与传统式书架、货架、档案架相比,储存量大,节省空间且更有传统性。 -- 固定列 - - 控制列 - 一般不动 - - 上面通常能统管其他移动列 -- 参考 - - DA/T 7-1992 直列式档案密集架 - - GB/T 13667.3 图书密集架 -- 产品 - - https://www.bjroit.com/news/list-80-cn.html - - https://www.jx-jh.cn/product/473.html - - https://www.jx-jh.cn/product/12/ diff --git a/notes/service/edms/std/dat-22.md b/notes/service/edms/std/dat-22.md new file mode 100644 index 00000000000..40ba9f14267 --- /dev/null +++ b/notes/service/edms/std/dat-22.md @@ -0,0 +1,66 @@ +--- +tags: + - Glossary + - Standard +refs: + - DA/T 22 +--- + +# DA/T 22 归档文件整理规则 + +- The arrangement rule of archival documents +- DA/T 22—2015 <- ~~DA/T 22—2000~~ + +:::tip + +- 归档文件目录推荐由系统生成或使用电子表格进行编制。目录表格采用 A4 幅面,页面宜横向设置 + +::: + +- 档案盒 + - 310mm×220mm (长×宽) + - 盒脊厚度可以根据需要设置为 20 mm、30mm、40mm、50mm 等 + - 档案盒应采用无酸纸制作。 +- 备考表 + - 置于盒内文件之后 + - 内容 + - 盒内文件情况说明:填写盒内文件缺损、修改、补充、移出、销毁等情况。 + - 整理人:负责整理归档文件的人员签名或签章。 + - 整理日期:归档文件整理完成日期。 + - 检查人:负责检查归档文件整理质量的人员签名或签章。 + - 检查日期:归档文件检查完毕的日期。 +- 排架 + - 上架排列方法应与本单位归档文件分类方案一致 + +--- + +归档文件 +: archival document(s) +: 立档单位在其职能活动中形成的、办理完毕、应作为文书档案保存的文件材料,包括纸质和电子文件材料。 + +整理 +: arrangement +: 将归档文件以件为单位进行组件、分类、排列、编号、编目等(纸质归档文件还包括修整、装订、编页、装盒、排架;电子文件还包括格式转换、元数据收集、归档数据包组织、存储等),使之有序化的过程。 + +件 +: item +: 归档文件的整理单位。 + +档号 +: archival code +: 在归档文件整理过程中赋予其的一组字符代码,以体现归档文件的类别和排列顺序。 + + +**归档章** + +| | | | +| :----------- | :------- | :--- | +| 全宗号 | 年度 | 件号 | +| \*机构或问题 | 保管期限 | 页数 | + + +**归档文件目录** + +| 序号 | 档号 | 文号 | 责任者 | 题名 | 日期 | 密级 | 页数 | 备注 | +| ---- | ----------------------- | -------------- | ------ | :-------------: | ---- | ---- | ---- | ---- | +| 1 | Z109-WS·2011-Y-BGS-0001 | 沪〔2001〕01号 | | 关于 XYZ 的通知 | 2021 | 公开 | 10 | diff --git a/notes/service/edms/std/dat-7.md b/notes/service/edms/std/dat-7.md new file mode 100644 index 00000000000..5d2723b9a6f --- /dev/null +++ b/notes/service/edms/std/dat-7.md @@ -0,0 +1,17 @@ +--- +tags: + - Glossary + - Standard +refs: + - DA/T 7 +--- + +# DA/T 7 直列式档案密集架 + +- DA/T 7-1992 直列式档案密集架 +- 型号 AAA XXX-X + - AAA + - SZM - 手动 + - DZM - 电动 + - XXX - 规格 +- 单⾯搁板上均布载重 40kg diff --git a/notes/service/edms/std/iso-15489.md b/notes/service/edms/std/iso-15489.md new file mode 100644 index 00000000000..31247d836e3 --- /dev/null +++ b/notes/service/edms/std/iso-15489.md @@ -0,0 +1,9 @@ +--- +tags: + - Glossary + - Standard +refs: + - ISO 15489 +--- + +# ISO 15489 diff --git a/notes/service/file/nextcloud/nextcloud-faq.md b/notes/service/file/nextcloud/nextcloud-faq.md index 693f91b6207..811e3ebbe99 100644 --- a/notes/service/file/nextcloud/nextcloud-faq.md +++ b/notes/service/file/nextcloud/nextcloud-faq.md @@ -20,6 +20,12 @@ export PHP_MEMORY_LIMIT=8G tail -f /var/www/html/data/nextcloud.log ``` +```bash +occ files:scan --all +occ maintenance:repair --include-expensive +occ db:add-missing-indices +``` + ## 移除获取免费账号的 Footer ```bash diff --git a/notes/service/file/nextcloud/nextcloud-version.md b/notes/service/file/nextcloud/nextcloud-version.md index 46ccbe020e7..b5ab127f6c0 100644 --- a/notes/service/file/nextcloud/nextcloud-version.md +++ b/notes/service/file/nextcloud/nextcloud-version.md @@ -4,31 +4,251 @@ title: Nextcloud 版本 # Nextcloud 版本 +:::caution + +- 一次只能升级一个大版本 + +::: + - [Changelog](https://nextcloud.com/changelog/) - [Releases](https://nextcloud.com/release-channels/) - - production - 企业版 + - production - 企业版 - 通过企业客户渠道获取 - stable - 每个版本有第一个 minor fix 后才进入 stable - - beta - - daily - -| version | date | -| ------------ | ---------- | -| Nextcloud 27 | | -| Nextcloud 26 | | -| Nextcloud 25 | 2022-12-08 | -| Nextcloud 24 | 2022-05-03 | -| Nextcloud 23 | 2021-11-30 | -| Nextcloud 23 | 2022-05-03 | -| Nextcloud 22 | 2021-07-06 | + - beta - 面向测试人员,自动生成,每日开发版本 + - daily - 自动生成的每日构建版本 +- https://nextcloud.com/changelog-unsupported/ + - 不再支持的版本 + +| version | date | Notes | +| ----------------------------- | ---------- | --------------- | +| [Nextcloud 30](#nextcloud-30) | 2024-09-14 | Nextcloud Hub 9 | +| [Nextcloud 29](#nextcloud-29) | 2024-04-24 | Nextcloud Hub 8 | +| [Nextcloud 28](#nextcloud-28) | 2023-12-12 | Nextcloud Hub 7 | +| [Nextcloud 27](#nextcloud-27) | 2023-06-13 | Nextcloud Hub 6 | +| [Nextcloud 26](#nextcloud-26) | 2023-03-21 | +| [Nextcloud 25](#nextcloud-25) | 2022-10-19 | +| [Nextcloud 24](#nextcloud-24) | 2022-05-03 | +| [Nextcloud 23](#nextcloud-23) | 2021-11-30 | +| [Nextcloud 23](#nextcloud-23) | 2022-05-03 | +| [Nextcloud 22](#nextcloud-22) | 2021-07-06 | + +## Nextcloud 30 + +- **设计改进**: + - 更紧凑的界面设计,优化了输入字段、按钮和链接的大小。 + - 使用圆角设计,提升视觉平衡。 + - 支持动态背景,界面颜色方案根据背景自动调整。 +- **Nextcloud Flow**: + - 基于 Windmill 的新应用,支持企业级流程自动化。 + - 提供图形界面设计、管理和监控工作流。 +- **Nextcloud Whiteboard**: + - 新的协作白板应用,支持手绘、多种形状和图像导入。 + - 与 Nextcloud Talk 无缝集成,支持实时协作。 +- **联邦功能**: + - 支持跨实例的联邦视频通话。 + - 用户可以使用联邦云 ID 加入其他 Nextcloud 服务器的群聊和视频通话。 +- **性能和可扩展性**: + - 切换到 Vite 工具,减少应用程序大小,提高加载速度。 + - 支持高性能后端,改进了 Nextcloud Text 的同步性能。 + - 数据库分片和异步复制,支持更多用户。 +- **AI 和 Nextcloud Assistant**: + - 引入聊天界面,支持对话格式的交互。 + - 支持数百种语言的翻译。 + - 与 Analytics 应用集成,支持上下文聊天查询数据。 +- **Nextcloud Files**: + - 新增文件请求功能,支持安全收集文件。 + - 文件过滤功能,支持按文件类型、修改日期和人员过滤。 + - 文件夹树视图,简化复杂文件夹路径的导航。 +- **Nextcloud Office**: + - 支持 PDF 模板和表单填写。 + - 幻灯片支持 3D 过渡效果。 + - 改进的安全性和互操作性,包括 ODF 文件的全面加密。 +- **Nextcloud Talk**: + - 改进的聊天管理功能,支持用户禁言和移除。 + - 支持离线浏览聊天记录。 + - 支持 Apple Vision Pro 设备。 +- **Nextcloud Groupware**: + - 邮件应用支持智能跟进提醒和高级搜索过滤。 + - 日历应用改进了事件窗口和资源可用性显示。 + - 联系人应用支持设置外出替代人员。 +- **新集成**: + - 支持 LLama 3 和 XWiki 等新应用。 + - 引入捐赠机制,支持开发者通过应用商店接受捐赠。 + +## Nextcloud 29 + +- **Nextcloud Assistant 2.0**: + - 引入上下文感知功能,包括 Context Chat 和 Context Write,提升工作效率。 + - 支持生成邮件回复和自动创建日历事件。 + - 提供聊天总结功能,自动生成会议记录和任务。 + - 增加了内置图像生成和语音转文本功能。 +- **Nextcloud Teams**: + - 全新团队概览,快速访问共享资源和仪表板小部件。 +- **Nextcloud Mail**: + - 背景同步速度提升两倍。 + - 改进的用户界面和 AI 驱动的回复建议。 +- **Nextcloud Talk**: + - 支持跨实例的联邦消息传递。 + - 增加消息编辑功能。 + - 改进的会议功能,包括演讲者画中画和投票功能。 +- **Nextcloud Files**: + - 新增个人文件部分,提供干净的私人空间。 + - 支持一次性下载链接和生成二维码共享。 + - 改进的照片导航和预览加载。 +- **Nextcloud Office**: + - 支持生成 QR 码和条形码。 + - 电子表格中的单元格保护和条件格式化功能。 + - 改进的文档布局和变更跟踪功能。 +- **Nextcloud Groupware**: + - 改进的邮件同步和事件创建功能。 + - 日历自动建议空闲时间。 +- **新集成**: + - 支持 Paperless-ngx 文档管理解决方案。 + - 新的 LLM 模型集成,包括 NeuralBeagle14 7B 和 Smaug-72B。 +- **性能优化**: + - 引入数据库分片功能,提升可扩展性。 + - 改进的读写行为,支持更多数据库集群节点。 + +## Nextcloud 28 + +- **统一搜索**: + - 改进的统一搜索功能,可以在所有核心应用和外部位置(如 GitHub、GitLab、Giphy、Reddit 等)中搜索。 + - 通过单一搜索框查找文件、任务、通信记录等。 +- **全局外出状态**: + - 在个人设置中配置外出状态,自动应用于邮件自动回复、日历事件和 Talk 聊天。 + - 在联系人资料中显示共享的文件、任务、事件、邮件等。 +- **AI 和 Nextcloud Assistant**: + - 引入 Aleph Alpha 和本地 Stable Diffusion 模型,用于图像生成和文本生成。 + - 支持 AI 请求限制和任务通知。 +- **Nextcloud Photos**: + - 支持 iOS Live Photos 上传和查看。 + - 显示照片的 EXIF 元数据,包括拍摄时间、地点和相机信息。 +- **Nextcloud Files**: + - 迁移到 Vue.js,提高性能和加载速度。 + - 支持 PDF 注释和表单填写。 + - 自定义导航栏顺序,合并评论和活动标签。 +- **Nextcloud Office**: + - 支持生成 QR 码和条形码。 + - 电子表格中的条件格式化功能。 + - 共享笔记和改进的重新连接体验。 + - 改进的无障碍支持和键盘快捷键。 +- **Nextcloud Groupware**: + - 联系人应用中显示共享的项目和自动“忙碌”状态。 + - 邮件应用支持在邮件正文中搜索、按日期排序和改进的标签管理。 + - Deck 应用支持卡片封面图像、“完成”状态和键盘快捷键。 +- **Nextcloud Talk**: + - 支持屏幕共享时的演讲者画中画。 + - 录音同意功能和通过电话号码邀请通话。 + - 支持自定义来宾名称和通知中的通话链接。 + - 动画反应和“自我笔记”聊天功能。 + - 文件共享时支持文件说明。 +- **新集成**: + - 支持 Aleph Alpha 和 Memegen 应用。 + - 提供示例应用程序,帮助开发者快速入门。 ## Nextcloud 27 +- **AI 功能和集成**: + - 智能收件箱和相关资源 + - 照片中的面部和对象识别 + - Nextcloud Talk 中的背景图像和背景模糊 + - 基于提示的图像生成 + - Nextcloud Translate 翻译功能,集成于 Nextcloud Talk 和 Nextcloud Text + - Nextcloud Dictation 语音识别 + - 视频通话记录的转录 +- **Nextcloud Files**: + - 高级版本控制,支持命名版本和时间算法 + - 文件推荐功能 + - 改进的桌面客户端和移动应用,包括虚拟文件支持和文档扫描 + - 标签功能增强,支持自动分类和安全策略 +- **Nextcloud Talk**: + - 桌面客户端预览版 + - 录音和分组讨论室功能 + - 消息过期和直接从聊天栏上传文件 + - 提高加载速度和减少服务器负载 + - 实时消息翻译和虚拟背景图像 +- **Nextcloud Groupware**: + - 共享邮箱和 S/MIME 支持 + - 日历应用支持附件 + - Mail 应用改进,包括 XOAUTH2 支持和智能收件箱 + - 系统通讯录和组织结构图 +- **Nextcloud Office**: + - 实时光标跟踪 + - Collectives 应用改进,支持文件关联 + - Deck 应用支持实时编辑和 CSV 导出 + - 文档模板和导航侧栏 +- **性能和安全**: + - 提高文件夹挂载和容器处理速度 + - OCS API 请求速度提高 3 倍 + - 改进的端到端加密,支持文件夹共享和文件上传 +- **新应用和集成**: + - Nextcloud Tables: 开源的 SharePoint 替代方案 + - 深度集成 Zimbra、Cisco Webex、NUITEQ Stage、OpenProject、Google Drive 和 Microsoft OneDrive + - Outlook 和 Teams 集成 + ## Nextcloud 26 +- **智能功能集成**: + - **Smart Picker**: 跨应用的智能选择器,支持 AI 语音转文本、图像生成和 ChatGPT 文本生成。 + - **语音转文本**: 使用 Whisper via Replicate 实现语音转文本功能。 + - **图像生成**: 使用 Dall-E 2 和 StableDiffusion 生成图像。 + - **ChatGPT 文本生成**: 使用 GPT-3 技术生成智能文本。 +- **Nextcloud Talk**: + - 桌面客户端预览版。 + - 录音和分组讨论室功能。 + - 消息过期和直接从聊天栏上传文件。 + - 提高加载速度和减少服务器负载。 +- **Nextcloud Files**: + - 高级版本控制,支持命名版本和时间算法。 + - 文件推荐功能。 + - 改进的桌面客户端和移动应用,包括虚拟文件支持和文档扫描。 +- **Nextcloud Groupware**: + - 共享邮箱和 S/MIME 支持。 + - 日历应用支持附件。 + - Mail 应用改进,包括 XOAUTH2 支持和智能收件箱。 +- **Nextcloud Office**: + - 实时光标跟踪。 + - Collectives 应用改进,支持文件关联。 + - Deck 应用支持实时编辑和 CSV 导出。 +- **性能和安全**: + - 提高文件夹挂载和容器处理速度。 + - OCS API 请求速度提高 3 倍。 + - 改进的端到端加密,支持文件夹共享和文件上传。 +- **新应用和集成**: + - Nextcloud Tables: 开源的 SharePoint 替代方案。 + - Notes 应用成为核心应用,移动应用免费。 + - 深度集成 Zimbra、Cisco Webex、NUITEQ Stage、OpenProject、Google Drive 和 Microsoft OneDrive。 + ## Nextcloud 25 +- **全新设计**: 引入了全新的 Nextcloud 界面设计,强调个性化和可访问性。 +- **Photos 2.0**: + - 新的平铺视图 + - 照片相册和共享选项 + - 内置照片上传器 + - 照片编辑器 + - AI 自动面部和对象识别 +- **Nextcloud Talk**: + - 消息反应和媒体标签 + - 改进的桌面集成和工作时间配置 + - 消息过期和直接从聊天栏上传文件 +- **Groupware 改进**: + - Mail 2.0: 改进的性能和用户界面,支持撤销发送和计划发送 + - Contacts: 引入组织结构图视图 + - 改进了服务器端和端到端加密技术 +- **新集成**: + - 与 Zimbra、Cisco Webex、NUITEQ Stage、OpenProject、Google Drive 和 Microsoft OneDrive 的更深层次集成 + ## Nextcloud 24 +- 用户迁移功能 - 从一个 Nextcloud 实例导出并导入到另一个实例,包括用户和配置文件设置、日历、邮件设置、评论、收藏等。 +- 智能文件锁定 - 自动锁定正在编辑的文件,防止并发写入冲突。 +- 数据库负载降低 4 倍 +- Nextcloud Talk 增加消息反应和媒体标签 +- 邮件应用新增撤销发送和计划发送功能 +- Nextcloud Office 引入新标签菜单界面 +- Nextcloud Text 增加表格、信息框、直接图片上传和表情符号自动完成功能 + ## Nextcloud 23 - Nextcloud Files diff --git a/notes/service/network/network-awesome.md b/notes/service/network/network-awesome.md index 1324d37a8cd..dd616435032 100644 --- a/notes/service/network/network-awesome.md +++ b/notes/service/network/network-awesome.md @@ -14,6 +14,15 @@ tags: - [openziti/ziti](https://github.com/openziti/ziti) - Apache-2.0, Go - zero trust, application embedded, programmable network +- Proxy/Multiplexer + - [yrutschle/sslh](https://github.com/yrutschle/sslh) + - GPLv2, C + - Applicative Protocol Multiplexer + - protocol demultiplexer + - 支持探测 HTTP, TLS/SSL (SNI, ALPN), SSH, OpenVPN, tinc, XMPP, SOCKS5 + - [mholt/caddy-l4](https://github.com/mholt/caddy-l4) + - Caddy L4 模块 + - 支持探测 RDP, OpenVPN, Postgres, ProxyProtocol, QUIC, Socks, SSH, TLS, Winbox, Wireguard, XMPP - TCP over ICMP - https://github.com/esrrhs/pingtunnel/tree/delete - VIP @@ -37,6 +46,8 @@ tags: - Tunnel - [frp](./proxy/frp/README.md) - ssh + - gost + - [proxytunnel/proxytunnel](https://github.com/proxytunnel/proxytunnel) - [rapiz1/rathole](https://github.com/rapiz1/rathole) - Apache-2.0, Rust - [stunnel](./tunnel/stunnel.md) diff --git a/notes/service/network/proxy/mihomo/README.md b/notes/service/network/proxy/mihomo/README.md index cbeffc94985..ac4eb24db29 100644 --- a/notes/service/network/proxy/mihomo/README.md +++ b/notes/service/network/proxy/mihomo/README.md @@ -41,3 +41,15 @@ mkdir -p /etc/mihomo - https://github.com/MetaCubeX/mihomo/blob/Alpha/docs/config.yaml - https://wiki.metacubex.one/config/ - rules + +# FAQ + +## ASN + +```yaml +rules: + - IP-ASN,22697,Proxy,no-resolve # Roblox +``` + +- ~/.config/mihomo/ASN.mmdb +- https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/GeoLite2-ASN.mmdb diff --git a/notes/service/service-awesome.md b/notes/service/service-awesome.md index 952622b1c12..238b7d0bbc8 100644 --- a/notes/service/service-awesome.md +++ b/notes/service/service-awesome.md @@ -349,10 +349,13 @@ tags: - https://datasciencenotebook.org/ - Storage/File/Drive - [Nextcloud](./file/nextcloud/README.md) + - [filegator/filegator](https://github.com/filegator/filegator) + - MIT, PHP, Vue - [cryptpad](https://github.com/cryptpad/cryptpad) - AGPLv3, JS - [cloudreve/Cloudreve](https://github.com/cloudreve/Cloudreve) - GPLv3, Golang + - file management system with muilt-cloud support - collaboration - [hedgedoc](https://github.com/hedgedoc/hedgedoc) - AGPLv3, TS @@ -383,6 +386,8 @@ tags: - fork of Snapdrop - [RobinLinus/snapdrop](https://github.com/RobinLinus/snapdrop) - GPLv3, JS + - LANDrop + - Dukto - [mozilla/send](https://github.com/mozilla/send) - MPLv2 - [timvisee/send](https://github.com/timvisee/send) diff --git a/notes/service/workflow/temporal/README.md b/notes/service/workflow/temporal/README.md index 7a7e6b00177..5ae15876a36 100644 --- a/notes/service/workflow/temporal/README.md +++ b/notes/service/workflow/temporal/README.md @@ -18,7 +18,6 @@ title: temporal - MIT, Rust - Core Temporal SDK - ```bash # https://github.com/temporalio/docker-compose # Elasticsearch + PostgreSQL + Web + UI @@ -349,3 +348,14 @@ auth: callback_base_uri: http://localhost:8088 pass_id_token: false # adds ID token as 'authorization-extras' header with every request to server ``` + +# FAQ + +- Temporal Nexus + - HTTP 7243 + - `/namespaces/{namespace}/task-queues/{task_queue}/nexus-services` + - `/nexus/endpoints/{endpoint}/services` + - `/namespaces/{namespace}/nexus/callback` + - 面向 长时间运行的服务 + - https://github.com/temporalio/temporal/blob/main/docs/architecture/nexus.md + - [nexus-rpc/sdk-go](https://github.com/nexus-rpc/sdk-go) diff --git a/notes/service/workflow/temporal/temporal-sdk.md b/notes/service/workflow/temporal/temporal-dev.md similarity index 74% rename from notes/service/workflow/temporal/temporal-sdk.md rename to notes/service/workflow/temporal/temporal-dev.md index 80193ffaa4c..c822eae9e0b 100644 --- a/notes/service/workflow/temporal/temporal-sdk.md +++ b/notes/service/workflow/temporal/temporal-dev.md @@ -1,11 +1,16 @@ --- -title: temporal-sdk +title: Development +tags: + - Development + - SDK --- -# temporal-sdk +# Temporal Development - https://github.com/temporalio/sdk-typescript/blob/main/packages/worker/src/workflow/bundler.ts - swc-loader +- 参考 + - https://api-docs.temporal.io/ ## Can't extract inlined source map from the provided Workflow Bundle @@ -23,4 +28,4 @@ esbuild --sourcemap=inline esbuild --banner:js="module = typeof module === 'undefined'? {exports:{}}:module" ``` -## ReferenceError: __TEMPORAL__ is not defined +## ReferenceError: **TEMPORAL** is not defined diff --git a/notes/service/workflow/temporal/temporal-ops.md b/notes/service/workflow/temporal/temporal-ops.md new file mode 100644 index 00000000000..0d87bfc6ab8 --- /dev/null +++ b/notes/service/workflow/temporal/temporal-ops.md @@ -0,0 +1,10 @@ +--- +tags: + - OPS +--- + +# Temporal OPS + +- SERVICES: history, matching, worker, frontend +- 参考 + - https://docs.temporal.io/self-hosted-guide/deployment diff --git a/notes/service/workflow/temporal/temporal-version.md b/notes/service/workflow/temporal/temporal-version.md new file mode 100644 index 00000000000..09aab9dbe22 --- /dev/null +++ b/notes/service/workflow/temporal/temporal-version.md @@ -0,0 +1,9 @@ +--- +tags: +- Version +--- + + +# Temporal Version + +- https://temporal.io/change-log diff --git a/notes/service/workflow/windmill.md b/notes/service/workflow/windmill.md index 7270574d94e..0b6db59585f 100644 --- a/notes/service/workflow/windmill.md +++ b/notes/service/workflow/windmill.md @@ -5,10 +5,14 @@ title: windmill # windmill - [windmill-labs/windmill](https://github.com/windmill-labs/windmill) - - AGPLv3 - backend, frontend + - AGPLv3, Rust, Svelte - Apache-2.0 - client - turn scripts into workflows and UIs - - alternative to Airplane and Retool + - alternative to + - Airflow + - Retool + - [Temporal](./temporal/README.md) + - Prefect - 架构 - Postgres - [google/nsjail](https://github.com/google/nsjail) - Sandboxing @@ -16,3 +20,16 @@ title: windmill - ts runtime - deno - python - golang +- 参考 + - Nextcloud [Windmill Workflows](https://docs.nextcloud.com/server/latest/admin_manual/windmill_workflows/index.html) + - https://raw.githubusercontent.com/windmill-labs/windmill/main/docker-compose.yml + - db - postgres + - windmill_server + - 2525 - SMTP + - windmill_worker + - windmill_worker_native - for "native" jobs + - windmill_worker_reports + - windmill_indexer - EE, full text search + - lsp - for language server protocol + - multiplayer - EE feature + - caddy diff --git a/notes/software/software-awesome.md b/notes/software/software-awesome.md index 99e67e11d5a..e48f27836e1 100644 --- a/notes/software/software-awesome.md +++ b/notes/software/software-awesome.md @@ -23,6 +23,10 @@ tags: - VNC Server & Client - Java TigerVNC-viewer 客户端 - [下载](https://bintray.com/tigervnc/stable/tigervnc) +- 压缩/解压缩 + - [peazip/PeaZip](https://github.com/peazip/PeaZip) + - LGPLv3 + - 跨平台 - [safing/portmaster](https://github.com/safing/portmaster) - 端口映射 - [wmjordan/PDFPatcher](https://github.com/wmjordan/PDFPatcher) diff --git a/notes/web/dev/bun.md b/notes/web/dev/bun.md index 060eb87d368..1e24739d7a5 100644 --- a/notes/web/dev/bun.md +++ b/notes/web/dev/bun.md @@ -16,6 +16,7 @@ title: bun :::caution +- Roadmap [#159](https://github.com/oven-sh/bun/issues/159) - bun:ffi 能力是独一无二的 - 可以为了 ffi 而使用 bun - bun 目前还不适用于通用的生产环境 @@ -23,15 +24,10 @@ title: bun - bun 非常不建议直接用于后端 - 可能会遇到各式各样无法修复的错误 - 库的开发者一般也不会针对 bun 测试 -- musl 支持 - - [#918](https://github.com/oven-sh/bun/issues/918) - - [#255](https://github.com/oven-sh/bun/issues/255) - deploy [bun#211](https://github.com/oven-sh/bun/issues/211) -- ~~无 dns 模块~~ - 0.5+ - pg 不支持 [#288](https://github.com/oven-sh/bun/issues/288) -- ~~无 async_hooks - sequelize 不支持~~ -- 未实现 ~~dns~~, http2, https, child_process, vm, tls, async_hooks, worker_threads, inspector +- 未实现 ~~dns~~, ~~http2~~, https, child_process, vm, tls, async_hooks, worker_threads, inspector - 未实现 HTTP request body streaming -- 未实现 HTTP2 不支持 gRPC + - Streaming upload with fetch [#6017](https://github.com/oven-sh/bun/issues/6017) - 兼容 - 支持 vitest [#4145](https://github.com/oven-sh/bun/issues/4145) - 支持 ReactNative [#123](https://github.com/oven-sh/bun/issues/123) @@ -145,6 +141,7 @@ import { random } from './random.ts' with { type: 'macro' }; ## compile ```bash +# --sourcemap --minify --target bun-linux-x64-modern # 90MB+ bun build --compile ./src/main.ts --outfile myapp --external={pg-query-stream,better-sqlite3,tedious,oracledb,mysql2,sqlite3,mysql} --external=@mikro-orm/{migrations,entity-generator,better-sqlite,sqlite,mariadb,mysql,mongodb,seeder} ``` diff --git a/notes/web/script/js/js-awesome.md b/notes/web/script/js/js-awesome.md index 7e326d48b97..778bd054cc7 100644 --- a/notes/web/script/js/js-awesome.md +++ b/notes/web/script/js/js-awesome.md @@ -1092,6 +1092,12 @@ tags: - [List of ECMAScript engines](https://en.wikipedia.org/wiki/List_of_ECMAScript_engines) - [privatenumber/ts-runtime-comparison](https://github.com/privatenumber/ts-runtime-comparison) +## Bun Awesome + +- [oven-sh/awesome-bun](https://github.com/oven-sh/awesome-bun) +- [tr1ckydev/webview-bun](https://github.com/tr1ckydev/webview-bun) + - Binding for [webview/webview](https://github.com/webview/webview) + ## WebServer - Reuqest/Response/WebStandard - 支持 EdgeRuntime/Deno/Bun/Cloudflare