diff --git a/notes/ai/ai-awesome.md b/notes/ai/ai-awesome.md index 25858a1e1c0..8740e5cd5f8 100644 --- a/notes/ai/ai-awesome.md +++ b/notes/ai/ai-awesome.md @@ -208,6 +208,7 @@ tags: - https://github.com/bbycroft/llm-viz - https://intro-llm.github.io/ - 大规模语言模型:从理论到实践 + - https://spreadsheets-are-all-you-need.ai - [tyxsspa/AnyText](https://github.com/tyxsspa/AnyText) - by Alibaba - [janhq/jan](https://github.com/janhq/jan) diff --git a/notes/blockchain/blockchain-awesome.md b/notes/blockchain/blockchain-awesome.md index 3427415118c..df9302e3cc3 100644 --- a/notes/blockchain/blockchain-awesome.md +++ b/notes/blockchain/blockchain-awesome.md @@ -147,13 +147,21 @@ tags: - connect a wallet - [wagmi-dev/wagmi](https://github.com/wagmi-dev/wagmi) - React Hooks for Ethereum -- API +- API/Blockchain API Provider/Proxy - [graphprotocol/graph-node](https://github.com/graphprotocol/graph-node) + - Apache-2.0, MIT, Rust + - indexes data from blockchains such as Ethereum and serves it over GraphQL + - [llamanodes/web3-proxy](https://github.com/llamanodes/web3-proxy) + - GPLv3, Rust - https://eth.wiki/json-rpc/API - https://stripe.com/zh-cn-hk/use-cases/crypto - https://api.coingecko.com/api/v3/simple/price - https://api.etherscan.io/api - https://sentinel.matic.network/api/v2/validators/metadata/totalStake + - infura.io + - 10w/day + - AWS + - Moralis - Misc - [makerdao/multicall](https://github.com/makerdao/multicall) - [makerdao/awesome-makerdao](https://github.com/makerdao/awesome-makerdao) @@ -225,7 +233,6 @@ curl 'https://api.etherscan.io/api?module=stats&action=ethprice&apikey=YourApiKe | | 11155111 | ETH | Sepolia | | https://sepolia.dev/ | https://sepolia.etherscan.io/ | | | | | Holesky | - - rETH - rinkeby ETH - Faucet - https://faucetlink.to/ diff --git a/notes/blockchain/eth/eth-faq.md b/notes/blockchain/eth/eth-faq.md index 73cf633ad3a..de63469e9d7 100644 --- a/notes/blockchain/eth/eth-faq.md +++ b/notes/blockchain/eth/eth-faq.md @@ -14,3 +14,8 @@ tags: - 混币器 - https://paper.seebug.org/1497/ - https://mirror.xyz/0xd05cFA28Eaf8B4eaFD8Cd86d33c6CeD1a1875417/YLDoqqD756FXh8Ps40c6uCOwpZZBL40V-QRP8qzn_SI + +## cannot estimate gas; transaction may fail or may require manual gas limit + +- 可能是交易注定会失败 - 例如 assert 失败 +- https://docs.ethers.org/v5/troubleshooting/errors/#help-UNPREDICTABLE_GAS_LIMIT diff --git a/notes/db/db-awesome.md b/notes/db/db-awesome.md index 3f8bc4afebb..9a24b5f3f58 100644 --- a/notes/db/db-awesome.md +++ b/notes/db/db-awesome.md @@ -219,7 +219,6 @@ curl --request POST \ ## SQLite Awesome - - [dgllghr/stanchion](https://github.com/dgllghr/stanchion) - Column - [proofrock/ws4sqlite](https://github.com/proofrock/ws4sqlite) @@ -364,6 +363,12 @@ curl --request POST \ - [Open Source SQL Parsers](https://tokern.io/blog/open-source-sql-parsers/) - [HN](https://news.ycombinator.com/item?id=31107231) - https://stripe.com/en-gb/sigma + - [runreveal/pql](https://github.com/runreveal/pql) + - Golang + - Pipelined Query Language + - https://news.ycombinator.com/item?id=39539252 + - [Azure Kusto Query Language (KQL)](https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/) + - Azure appinsights logs ## 迁移/升级/Schema 变更/Migration {#migration} diff --git a/notes/db/design-schema.md b/notes/db/design-schema.md index 520ba8f4d79..78bebb8be9d 100644 --- a/notes/db/design-schema.md +++ b/notes/db/design-schema.md @@ -70,10 +70,13 @@ tags: - ts 10msec 39bit + machine 16bit + sequence 8bit - 174 years - 处理更多的 instance -- UUIDv7 +- [UUIDv7](https://www.ietf.org/archive/id/draft-ietf-uuidrev-rfc4122bis-00.html#name-uuid-version-7) + - `{unix_ts_ms:48 bit}{ver:4bit}{rand_a:12bit}{var:2bit}{rand_b:64bit}` - 兼容 UUID - 有序 - 时间戳 - 类似于 ULID + - [craigpastro/pg_uuidv7](https://github.com/craigpastro/pg_uuidv7) + - Postgres extension - [NanoID](https://github.com/ai/nanoid) - 一般不直接用于 DB, 前端用的多 - `A-Za-z0-9_-` diff --git a/notes/db/relational/mssql/README.md b/notes/db/relational/mssql/README.md new file mode 100644 index 00000000000..9a6b197f888 --- /dev/null +++ b/notes/db/relational/mssql/README.md @@ -0,0 +1,11 @@ +--- +title: MSSQL +--- + +# MSSQL + +| port | for | +| ---- | --------------- | +| 1433 | default | +| 1434 | browser service | + diff --git a/notes/db/relational/postgresql/postgraphile.md b/notes/db/relational/postgresql/postgraphile.md index 5854c9c0ad0..6fe2028c015 100644 --- a/notes/db/relational/postgresql/postgraphile.md +++ b/notes/db/relational/postgresql/postgraphile.md @@ -4,7 +4,9 @@ title: PostGraphile # PostGraphile -- [graphile/postgraphile](https://github.com/graphile/postgraphile) 是什么? +- [graphile/crystal](https://github.com/graphile/crystal) + - Crystal Monorepo for Grafast, PostGraphile, pg-introspection, pg-sql2 + - postgraphile - GraphQL over PostgreSQL - 强调 DB 设计 - 先 DB 后 GraphQL - TypeScript+NodeJS 实现 diff --git a/notes/db/schema/README.md b/notes/db/schema/README.md index d9541ff7cf1..550862fb477 100644 --- a/notes/db/schema/README.md +++ b/notes/db/schema/README.md @@ -1,17 +1,37 @@ -## Rules +--- +title: Service Schema +--- -- singularity +# 数据和结构 + +## 规则 + +- 主键 `tagid_ULID` 或 `tagid_UUIDv7` +- 表名单数形式 - singularity + - 特殊情况除外 - users, roles - 避免冲突 +- table prefix over schema + - wecom.users -> wecom_users + - 把 schema 保留给业务/租户 + - 让 schema 更容易迁移 + - 避免出错 +- 用 表 记录枚举 +- 用 表 记录 EntitySchema +- 服务分层为 + - Resource - REST, GQL + - EntityService - RPC - 走网络 + - Entity - Native + - DB ## i18n 1. multi column - ```sql - create table article - ( - title text, - title_en text - ); - ``` + ```sql + create table article + ( + title text, + title_en text + ); + ``` 2. by message id ```sql create table message @@ -31,6 +51,6 @@ id text, title jsonb ); - insert into message (id, title) + insert into message (id, title) values ('help','{"zh_CN":"","en":""}'::jsonb); - ``` \ No newline at end of file + ``` diff --git a/notes/db/schema/pg-boss/schema.pg.sql b/notes/db/schema/pg-boss/schema.pg.sql index b4ca6fa5c2d..eb9ef877f3a 100644 --- a/notes/db/schema/pg-boss/schema.pg.sql +++ b/notes/db/schema/pg-boss/schema.pg.sql @@ -3,83 +3,83 @@ CREATE TABLE version ( - version int primary key, - maintained_on timestamp with time zone, - cron_on timestamp with time zone + version int primary key, + maintained_on timestamp with time zone, + cron_on timestamp with time zone ); CREATE TYPE job_state AS ENUM ( - '${states.created}', - '${states.retry}', - '${states.active}', - '${states.completed}', - '${states.expired}', - '${states.cancelled}', - '${states.failed}' - ) + '${states.created}', + '${states.retry}', + '${states.active}', + '${states.completed}', + '${states.expired}', + '${states.cancelled}', + '${states.failed}' + ) ; CREATE TABLE job ( - id uuid primary key not null default gen_random_uuid(), - name text not null, - priority integer not null default (0), - data jsonb, - state job_state not null default ('${states.created}'), - retryLimit integer not null default (0), - retryCount integer not null default (0), - retryDelay integer not null default (0), - retryBackoff boolean not null default false, - startAfter timestamp with time zone not null default now(), - startedOn timestamp with time zone, - singletonKey text, - singletonOn timestamp without time zone, - expireIn interval not null default interval '15 minutes', - createdOn timestamp with time zone not null default now(), - completedOn timestamp with time zone, - keepUntil timestamp with time zone NOT NULL default now() + interval '14 days', - on_complete boolean not null default false, - output jsonb + id uuid primary key not null default gen_random_uuid(), + name text not null, + priority integer not null default (0), + data jsonb, + state job_state not null default ('${states.created}'), + retryLimit integer not null default (0), + retryCount integer not null default (0), + retryDelay integer not null default (0), + retryBackoff boolean not null default false, + startAfter timestamp with time zone not null default now(), + startedOn timestamp with time zone, + singletonKey text, + singletonOn timestamp without time zone, + expireIn interval not null default interval '15 minutes', + createdOn timestamp with time zone not null default now(), + completedOn timestamp with time zone, + keepUntil timestamp with time zone NOT NULL default now() + interval '14 days', + on_complete boolean not null default false, + output jsonb ); CREATE TABLE archive ( - LIKE job + LIKE job ); ALTER TABLE archive - ADD archivedOn timestamptz NOT NULL DEFAULT now(); + ADD archivedOn timestamptz NOT NULL DEFAULT now(); -- SINGLETON_QUEUE_KEY_ESCAPED -> __pgboss__singleton_queue CREATE INDEX archive_archivedon_idx ON archive (archivedon); CREATE INDEX archive_id_idx ON archive (id); CREATE UNIQUE INDEX job_singletonKey ON job (name, singletonKey) - WHERE state < '${states.completed}' - AND singletonOn IS NULL - AND NOT singletonKey LIKE '${SINGLETON_QUEUE_KEY_ESCAPED}%'; + WHERE state < '${states.completed}' + AND singletonOn IS NULL + AND NOT singletonKey LIKE '${SINGLETON_QUEUE_KEY_ESCAPED}%'; CREATE UNIQUE INDEX job_singleton_queue ON job (name, singletonKey) - WHERE state < '${states.active}' - AND singletonOn IS NULL - AND singletonKey LIKE '${SINGLETON_QUEUE_KEY_ESCAPED}%'; + WHERE state < '${states.active}' + AND singletonOn IS NULL + AND singletonKey LIKE '${SINGLETON_QUEUE_KEY_ESCAPED}%'; CREATE UNIQUE INDEX job_singletonOn ON job (name, singletonOn) - WHERE state < '${states.expired}' AND singletonKey IS NULL; + WHERE state < '${states.expired}' AND singletonKey IS NULL; CREATE UNIQUE INDEX job_singletonKeyOn ON job (name, singletonOn, singletonKey) - WHERE state < '${states.expired}'; + WHERE state < '${states.expired}'; CREATE INDEX job_name ON job (name text_pattern_ops); CREATE INDEX job_fetch ON job (name text_pattern_ops, startAfter) WHERE state < '${states.active}'; CREATE TABLE schedule ( - name text primary key, - cron text not null, - timezone text, - data jsonb, - options jsonb, - created_on timestamp with time zone not null default now(), - updated_on timestamp with time zone not null default now() + name text primary key, + cron text not null, + timezone text, + data jsonb, + options jsonb, + created_on timestamp with time zone not null default now(), + updated_on timestamp with time zone not null default now() ); CREATE TABLE subscription ( - event text not null, - name text not null, - created_on timestamp with time zone not null default now(), - updated_on timestamp with time zone not null default now(), - PRIMARY KEY (event, name) + event text not null, + name text not null, + created_on timestamp with time zone not null default now(), + updated_on timestamp with time zone not null default now(), + PRIMARY KEY (event, name) ); diff --git a/notes/dev/dev-faq.md b/notes/dev/dev-faq.md index 8fcf7314089..d907dc7f6e9 100644 --- a/notes/dev/dev-faq.md +++ b/notes/dev/dev-faq.md @@ -204,6 +204,21 @@ tags: - /health/live - /health/ready +--- + +- /ready, /readyz + - 是否准备好接受请求 +- /livez, /live + - alive/up and running +- /health, /ping + - 通用的健康检查 +- /statusz + - 服务状态信息 +- /varz + - 内部变量和 metrics +- /rpcz + - 一般是 RPC 统计 + ## 什么是边缘计算 个人简单理解,Edge 就是 DataCenter 的反义词。 diff --git a/notes/dev/dict.md b/notes/dev/dict.md index fc07622e7bf..ea4e755fdd1 100644 --- a/notes/dev/dict.md +++ b/notes/dev/dict.md @@ -366,11 +366,21 @@ tags: ## 社交 {#social} -| abbr. | stand for | mean | -| ----- | ----------------- | -------- | -| OTOH | on the other hand | -| TL;TR | Too Long To Read | 简而言之 | -| TBH | To be honest | +> Internet forum + +| abbr. | stand for | mean | +| ------ | ----------------------- | ---------------- | +| PM | Private Message | 私信 | +| DM | Direct Message | 私信 | +| OP | Original Poster | 楼主 | +| OTOH | on the other hand | +| TL;TR | Too Long To Read | 简而言之 | +| TBH | To be honest | +| IMO | In My Opinion | 我的看法 | +| IMHO | In My Humble Opinion | 我的谦虚意见 | +| IRL | In Real Life | 现实生活 | +| IYKWIM | If You Know What I Mean | 如果你懂我的意思 | +| TTYL | Talk To You Later | 回头见 | ## 财税 {#taxation} @@ -1184,7 +1194,7 @@ tags: ## task vs job vs process vs background process -- job +- job/flow - 侧重描述可调度性 - 一个 job 可能包含多个 task - 通常具有连续运行的特点 @@ -1193,7 +1203,7 @@ tags: - process - 类似于 job - process 更多是自主运行 -- task/step +- task/step/activity - 侧重描述内容 - 通常运行一次 - background process diff --git a/notes/dev/format/format-faq.md b/notes/dev/format/format-faq.md index 0f5b25f8e6a..5d7090f979e 100644 --- a/notes/dev/format/format-faq.md +++ b/notes/dev/format/format-faq.md @@ -7,14 +7,22 @@ tags: ## Format vs Codec -- Format +- Format/格式 - 决定 **文件** 的组织和结构 - 通常为一种容器 - 容器变化不会导致实际内容变化 + - 可能存储多种编码数据 + - 可能存储多维度数据 - 音频+视频+字幕 + - 提供 兼容性 和 互操作性 - 容器格式 - 脱离于数据 - - 提供元信息 + - 提供元信息 - 作者、标题、版权 - exif - 提供不同的访问方式 -- Codec + - 提供二次压缩、加密 + - 也可能 Codec 也是 Format - 一个容器格式存储单一编码数据 +- Codec/编解码器 - 数据的压缩和解压缩 + - 软件/设备 - 可能存在 offload + - 编码 或 解码 数字数据流 或 信号 + - 压缩和解压数据 -> 以便于存储和传输 - 数据的一种呈现方式 - 此时和 Format 可互换 - JSON、YAML - 信息 <-> 数据 转化的方式 diff --git a/notes/dev/format/json.md b/notes/dev/format/json.md index bfb70691bc5..53589beadcb 100644 --- a/notes/dev/format/json.md +++ b/notes/dev/format/json.md @@ -51,16 +51,31 @@ title: JSON ## Diff -- https://github.com/andreyvit/json-diff -- http://www.jsondiff.com/ -- https://json-diff.com/ -- https://github.com/benjamine/jsondiffpatch/blob/master/docs/formatters.md -- https://benjamine.github.io/jsondiffpatch +- [benjamine/jsondiffpatch](- https://github.com/benjamine/jsondiffpatch) + - npm:jsondiffpatch + - https://github.com/benjamine/jsondiffpatch/blob/master/docs/formatters.md + - https://benjamine.github.io/jsondiffpatch +- [andreyvit/json-diff](https://github.com/andreyvit/json-diff) + - MIT, CoffeeScript + - npm:json-diff - [google/diff-match-patch](https://github.com/google/diff-match-patch) -- [Mendoza: Use stack machines to compute efficient JSON diffs](https://www.sanity.io/blog/mendoza) - - [HN](https://news.ycombinator.com/item?id=24943775) + - plain text +- [trailofbits/graphtage](https://github.com/trailofbits/graphtage) + - LGPLv3, Python + - JSON, JSON5, XML, HTML, YAML, CSV +- [sanity-io/mendoza](https://github.com/sanity-io/mendoza) + - MIT, Go + - [Mendoza: Use stack machines to compute efficient JSON diffs](https://www.sanity.io/blog/mendoza) + - [HN](https://news.ycombinator.com/item?id=24943775) - https://extendsclass.com/json-diff.html - +- [zgrossbart/jdd](https://github.com/zgrossbart/jdd) + - http://www.jsondiff.com/ +- https://json-diff.com/ +- [mattphillips/deep-object-diff](https://github.com/mattphillips/deep-object-diff) +- [flitbit/diff](https://github.com/flitbit/diff) +- [Starcounter-Jack/JSON-Patch](https://github.com/Starcounter-Jack/JSON-Patch) +- [kpdecker/jsdiff](https://github.com/kpdecker/jsdiff) + - Text Diff ## Command line tools - [antonmedv/fx](https://github.com/antonmedv/fx) diff --git a/notes/dev/tech/qrcode.md b/notes/dev/tech/qrcode.md index 0d32e3cc4fc..48c9e43fd0d 100644 --- a/notes/dev/tech/qrcode.md +++ b/notes/dev/tech/qrcode.md @@ -15,11 +15,13 @@ title: QrCode - [libdmtx](https://github.com/dmtx/libdmtx) - dmtxread - JS + - [mebjas/html5-qrcode](https://github.com/mebjas/html5-qrcode) + - cross platform HTML5 QR code reader - [@zxing/library](https://github.com/zxing-js/library) - 功能最多 - NodeJS 需要 jimp 提取亮度通道 - [nimiq/qr-scanner](https://github.com/nimiq/qr-scanner) - - 不能 NodeJS + - [Sec-ant/zxing-wasm](https://github.com/Sec-ant/zxing-wasm) - qrcode-reader - 很小 - NodeJS 可直接用 jimp 数据 diff --git a/notes/economics/accounting/accounting-glossary.md b/notes/economics/accounting/accounting-glossary.md index ff33773820c..23f8e2957aa 100644 --- a/notes/economics/accounting/accounting-glossary.md +++ b/notes/economics/accounting/accounting-glossary.md @@ -17,17 +17,35 @@ tags: | IFRS | International Financial Reporting Standards | 国际财务报告准则 | | US GAAP | United States Generally Accepted Accounting Principles | 美国一般公认会计原则 | -| en | cn | -| ----------------------- | ---------- | -| Account reconciliations | 对账 | -| Balance sheet | 资产负债表 | -| Accountant | 会计师 | -| social security | 社保 | -| individual tax | 个税 | -| Personal Income Tax | 个人所得税 | -| imposition | 征收 | +| en | cn | +| ----------------------- | ------------------------------- | +| Account reconciliations | 对账 | +| Balance sheet | 资产负债表 | +| Accountant | 会计师 | +| social security | 社保 | +| individual tax | 个税 | +| Personal Income Tax | 个人所得税 | +| imposition | 征收 | +| Accounting Period | 会计期间/会计分期/会计周期/账期 | +| Accounting Year | 会计年度 | +| Accounting Mid-term | 会计中期 | +| Accounting | 会计 | +| Closing the books | 结账 | - EBITA +- 会计期间 - Accounting Period/Fiscal Period - 会计分期 + - 对于经济活动做定期整理、汇存。 + - 一个月、一个季度、一年 + - 需要参考业务 + - 参考 + - https://quickbooks.intuit.com/global/zh-cn/glossary/accounting-period/ +- 会计中期 + - 小于一年 +- 会计年度 + - 中国 每年1月1日—每年12月31日 +- 《中华人民共和国会计法》 +- 参考 + - https://quickbooks.intuit.com/global/zh-cn/glossary/ ## 代理记账流程 diff --git a/notes/economics/finance/finance-faq.md b/notes/economics/finance/finance-faq.md index 77cfabfbc9e..ce43e0d9391 100644 --- a/notes/economics/finance/finance-faq.md +++ b/notes/economics/finance/finance-faq.md @@ -91,6 +91,8 @@ tags: - 卖方向买方出售货物或者提供服务时开具的一种书面凭证 - 记录交易的内容、数量、金额、交货日期等 +## Voucher vs Document + ## 财务 vs 税务 - 财务 - Financial - 全面的管理财务的活动 diff --git a/notes/java/spring/spring-actuator.md b/notes/java/spring/spring-actuator.md index 372cebdef59..b66a481c84f 100644 --- a/notes/java/spring/spring-actuator.md +++ b/notes/java/spring/spring-actuator.md @@ -4,6 +4,7 @@ title: Spring actuator # Spring actuator +- actuator -> “执行器”或“监控指标” - https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html ```ini diff --git a/notes/java/spring/spring-metrics.md b/notes/java/spring/spring-metrics.md new file mode 100644 index 00000000000..a88da2f0938 --- /dev/null +++ b/notes/java/spring/spring-metrics.md @@ -0,0 +1,25 @@ +--- +title: metrics +--- + +# metrics + +- /actuator/prometheus + +``` +# -Xms 申请内存 +jvm_memory_committed_bytes +# -Xmx 最大内存 +jvm_memory_max_bytes +# 实际使用的内存 +# area: heap, nonheap +jvm_memory_used_bytes +# NIO Direct Memory +jvm_buffer_memory_used_bytes +``` + +``` +jvm_memory_max_bytes > container_memory_working_set_bytes > jvm_memory_committed_bytes > jvm_memory_used_bytes +``` + +- container_memory_working_set_bytes - 容器内存使用 diff --git a/notes/languages/languages-awesome.md b/notes/languages/languages-awesome.md index 1ce05bafae8..5a4b026c226 100644 --- a/notes/languages/languages-awesome.md +++ b/notes/languages/languages-awesome.md @@ -11,7 +11,10 @@ tags: > ODE - Online IDE - https://tio.run/ + - try it online + - 可以运行各种语言 - https://godbolt.org/ + - 编译各种语言为 Assembly - [compiler-explorer/compiler-explorer](https://github.com/compiler-explorer/compiler-explorer) - BSD-2, TypeScript - https://compiler-explorer.com/ @@ -26,6 +29,8 @@ tags: - https://play.nim-lang.org/ - https://play.haskell.org/ - https://pypl.github.io/ODE.html +- [jprendes/emception](https://github.com/jprendes/emception) + - https://jprendes.github.io/emception/ ## Tools diff --git a/notes/mgmt/docs/ops-routine-plan.md b/notes/mgmt/docs/ops-routine-plan.md index a1e3053cf3e..b3173c2412b 100644 --- a/notes/mgmt/docs/ops-routine-plan.md +++ b/notes/mgmt/docs/ops-routine-plan.md @@ -16,7 +16,7 @@ tags: ## 维护任务 -| 类型 | 事项 | 周期 | 频率 | +| 类型 | 事项 | 周期 | 说明 | | ---------- | ------------------------- | ------ | -------------- | | 预防性维护 | Aliyun ECS 补丁更新 | 每月 | 每月第一个周末 | | 预防性维护 | Aliyun ECS 内核版本升级 | 每季度 | | @@ -25,6 +25,7 @@ tags: | 预防性维护 | Ali ACK K8S 服务组件更新 | 每季度 | | | 预防性维护 | 本地 K8S 集群更新 | 每季度 | | | 安全措施 | Aliyun ECS 漏洞扫描和修复 | 每两周 | 每两周的周一 | +| 安全措施 | 服务器认证信息清理 | 每季度 | | | 成本控制 | Aliyun 服务内容检查 | 每月 | ## 执行表 diff --git a/notes/os/linux/lib/libc.md b/notes/os/linux/libc/README.md similarity index 100% rename from notes/os/linux/lib/libc.md rename to notes/os/linux/libc/README.md diff --git a/notes/os/linux/lib/malloc.md b/notes/os/linux/libc/malloc.md similarity index 100% rename from notes/os/linux/lib/malloc.md rename to notes/os/linux/libc/malloc.md diff --git a/notes/os/linux/lib/musl.md b/notes/os/linux/libc/musl/musl-faq.md similarity index 77% rename from notes/os/linux/lib/musl.md rename to notes/os/linux/libc/musl/musl-faq.md index b70740ba226..c233fee282c 100644 --- a/notes/os/linux/lib/musl.md +++ b/notes/os/linux/libc/musl/musl-faq.md @@ -1,42 +1,50 @@ --- -title: musl +tags: + - FAQ --- -# musl +# MUSL FAQ -:::caution - -- malloc 大场景性能弱 - 性能要求高的场景使用 jemalloc 或 mimaloc -- 不支持 utmp/wtmp - last,who,users 命令部分功能不可用 - - 安全考虑、隐私考虑 - - 需要实现 suid/sgid 修改 记录 - - https://wiki.musl-libc.org/faq.html - -::: +- [Open Issues](https://wiki.musl-libc.org/open-issues.html) + - 不支持 LC_TIME + - 无 ucontext.h - obsolescent in POSIX.1-2001 + - [makecontext](https://pubs.opengroup.org/onlinepubs/009695399/functions/makecontext.html#tag_03_356_08) + - [glusterfs#268](https://github.com/gluster/glusterfs/issues/268) + - glusterfs 不支持 musl + - [openssl#7406](https://github.com/openssl/openssl/issues/7406) + - 使用 no-async 绕过 +- 不支持 nsswitch + - [pikhq/musl-nscd](https://github.com/pikhq/musl-nscd) +- 不支持 res_uinit + - asterisk 无法获取 nameserver +- 无 fts +- 其他软件兼容问题 + - Golang runtime: c-shared builds fail with musllibc + [golang/go#13492](https://github.com/golang/go/issues/13492) + - 无法获取 argc, argv - 基于 glibc 扩展 + - 导致 + - FluentBit 插件不支持 AlpineLinux + - libasan 不支持 musl + [google/sanitizers#1080](https://github.com/google/sanitizers/issues/1080) + - glusterfs 不支持 musl [glusterfs#268](https://github.com/gluster/glusterfs/issues/268) +- [bugs-found-by-musl](https://wiki.musl-libc.org/bugs-found-by-musl.html) + - 其他软件已知因为 musl 导致的 bug -- [musl](https://musl.libc.org/) - MIT - - [FAQ](https://www.musl-libc.org/faq.html) -- [与 glibc 的不同点](https://wiki.musl-libc.org/functional-differences-from-glibc.html) +## malloc -## 环境变量 +- musl 1.2.1 启用了重写的 malloc + - 2020-06 +- 参考 + - https://andygrove.io/2020/05/why-musl-extremely-slow/ + - https://pythonspeed.com/articles/alpine-docker-python/ + - https://www.linkedin.com/pulse/testing-alternative-c-memory-allocators-pt-2-musl-mystery-gomes/ -| Env | Used by | Note | -| --------------- | ---------------------------- | --------------------------------------------------------- | -| PATH | execvp, execlp, posix_spawnp | -| TZ | | `stdoffset[dst[offset][,start[/time],end[/time]]` 或 名字 | -| DATEMSK | getdate | -| PWD | get_current_dir_name, getcwd | -| LOGNAME | getlogin | -| LD_PRELOAD | setuid, setgid 忽略 | dl 预加载动态库列表 | -| LD_LIBRARY_PATH | setuid, setgid 忽略 | 动态库搜索目录列表 | +## DNS -- TZ 搜索目录 - - /usr/share/zoneinfo - - /share/zoneinfo - - /etc/zoneinfo -- [Environment Variables](https://wiki.musl-libc.org/environment-variables.html) +- 目前已经支持 DNS over TCP,大部分 DNS 问题已经解决 +- musl libc 1.2.4 - tcp dns - 解决 udp dns 不能返回太多解析的问题 -## DNS 问题 +--- resolv 不支持 dns over tcp/edns, 因此一次 resolve 最多返回 一个包,512 bytes,有时候解析会因此出现问题。 @@ -88,42 +96,6 @@ iptables -I OUTPUT 1 -p udp --dport 53 -j AAAA iptables -A AAAA -m string --algo bm --from 40 --hex-string '|001c|' -j DROP ``` -## musl issues - -- [Open Issues](https://wiki.musl-libc.org/open-issues.html) - - 不支持 LC_TIME - - 无 ucontext.h - obsolescent in POSIX.1-2001 - - [makecontext](https://pubs.opengroup.org/onlinepubs/009695399/functions/makecontext.html#tag_03_356_08) - - [glusterfs#268](https://github.com/gluster/glusterfs/issues/268) - - glusterfs 不支持 musl - - [openssl#7406](https://github.com/openssl/openssl/issues/7406) - - 使用 no-async 绕过 -- 不支持 nsswitch - - [pikhq/musl-nscd](https://github.com/pikhq/musl-nscd) -- 不支持 res_uinit - - asterisk 无法获取 nameserver -- 无 fts -- 其他软件兼容问题 - - Golang runtime: c-shared builds fail with musllibc - [golang/go#13492](https://github.com/golang/go/issues/13492) - - 无法获取 argc, argv - 基于 glibc 扩展 - - 导致 - - FluentBit 插件不支持 AlpineLinux - - libasan 不支持 musl - [google/sanitizers#1080](https://github.com/google/sanitizers/issues/1080) - - glusterfs 不支持 musl [glusterfs#268](https://github.com/gluster/glusterfs/issues/268) -- [bugs-found-by-musl](https://wiki.musl-libc.org/bugs-found-by-musl.html) - - 其他软件已知因为 musl 导致的 bug - -## malloc performance - -- musl 1.2.1 启用了重写的 malloc - - 2020-06 -- 参考 - - https://andygrove.io/2020/05/why-musl-extremely-slow/ - - https://pythonspeed.com/articles/alpine-docker-python/ - - https://www.linkedin.com/pulse/testing-alternative-c-memory-allocators-pt-2-musl-mystery-gomes/ - ## pthread_attr_setaffinity_np - 没有 diff --git a/notes/os/linux/libc/musl/musl-version.md b/notes/os/linux/libc/musl/musl-version.md new file mode 100644 index 00000000000..ea7c8678387 --- /dev/null +++ b/notes/os/linux/libc/musl/musl-version.md @@ -0,0 +1,8 @@ +--- +tags: + - Version +--- + +# MUSL 版本 + +- https://musl.libc.org/releases.html diff --git a/notes/os/linux/sys/cgroup.md b/notes/os/linux/sys/cgroup.md index f2b8a627dce..b52fb7ee67c 100644 --- a/notes/os/linux/sys/cgroup.md +++ b/notes/os/linux/sys/cgroup.md @@ -26,6 +26,11 @@ echo 0 > /sys/fs/cgroup/memory/slack_group/memory.swappiness ``` +```bash +cat /sys/fs/cgroup/memory/memory.usage_in_bytes +cat /sys/fs/cgroup/memory/memory.limit_in_bytes +``` + ## cgroup v2 ## 内存使用情况 diff --git a/notes/os/macos/macos-faq.md b/notes/os/macos/macos-faq.md index e4036475621..a828ad472da 100644 --- a/notes/os/macos/macos-faq.md +++ b/notes/os/macos/macos-faq.md @@ -9,6 +9,15 @@ tags: - Commands - https://gist.github.com/sergiitk/a87207a8af11d6e6d807 +```bash +# 系统版本号 +# 14.3.1 +sw_vers -productVersion + +system_profiler SPSoftwareDataType +cat /System/Library/CoreServices/SystemVersion.plist +``` + ## path_helper - /etc/paths @@ -431,3 +440,10 @@ Screen Sharing is not permitted on “10.10.1.1”. Disable and re-enable Screen - cryptographically-sealed archive - /Volumes/Preboot/Cryptexes + +## dmg + +```bash +7z x googlechrome.dmg -o/tmp/googlechrome +VER=$(cat /tmp/googlechrome/Google\ Chrome/Google\ Chrome.app/Contents/Info.plist | grep -A1 CFBundleShortVersionString | tail -1 | sed -r 's/.*>(.*?)<.*/\1/' | tr -d '[[:space:]]') +``` diff --git a/notes/os/virt/qemu/qemu-doc.md b/notes/os/virt/qemu/qemu-doc.md index a2dc7c91d7c..f322fcb6708 100644 --- a/notes/os/virt/qemu/qemu-doc.md +++ b/notes/os/virt/qemu/qemu-doc.md @@ -310,6 +310,7 @@ qemu-i386 /usr/local/qemu-i386/wine/bin/wine \ - https://www.spice-space.org - vnc +- SPICE(Simple Protocol for Independent Computing Environments) ```bash brew install tiger-vnc @@ -322,3 +323,12 @@ vncviewer :0 qemu-system-x86_64 sys.vhd-display vnc=:1 vncviewer :1 ``` + +- vga + - std - 标准 VGA + - cirrus + - vmware + - qxl - QXL 驱动 + - 为SPICE协议优化的一种虚拟VGA设备 + - virtio + - none diff --git a/notes/os/virt/qemu/qemu-faq.md b/notes/os/virt/qemu/qemu-faq.md index c41757264aa..1647eb7c953 100644 --- a/notes/os/virt/qemu/qemu-faq.md +++ b/notes/os/virt/qemu/qemu-faq.md @@ -130,3 +130,33 @@ qemu-system-x86_64 \ ```bash addgroup $USER kvm ``` + +## 鼠标偏移 + +```bash +-device usb-ehci,id=usb,bus=pci.0,addr=0x4 -device usb-mouse -device usb-tablet -device usb-kbd +``` + +## usb + +**usb2.0** + +- 兼容性更好 + +``` +-device usb-ehci,id=usb,bus=pci.0,addr=0x4 +``` + +**usb3.0** + +``` +-device nec-usb-xhci,id=usb,bus=pci.0,addr=0x4 +``` + + +## TBD + +``` +no scancode found for keysym 1185 +no scancode found for keysym 65306 +``` diff --git a/notes/os/virt/qemu/qemu-openrc.md b/notes/os/virt/qemu/qemu-openrc.md new file mode 100644 index 00000000000..86539f69812 --- /dev/null +++ b/notes/os/virt/qemu/qemu-openrc.md @@ -0,0 +1,156 @@ +--- +title: OpenRC +--- + +# Qemu OpenRC + + +- https://github.com/jirutka/qemu-openrc + +```bash +# VM_NAME=example +ln -s qemu /etc/init.d/qemu.example +cp /etc/conf.d/qemu /etc/conf.d/qemu.example + +# 4c4g +# vnc 5910 +cat < /etc/conf.d/qemu.example +smp_cpus="4" +memory="4G" +vnc_display=10 +vnc_password="$(uuidgen)" + +disk0_file="/data/vm/rms.vhdx" +disk0_format="vhdx" +EOF +``` + +## conf + + +```sh +user="qemu" +group="qemu" +pidfile="/run/qemu/${VM_NAME}/qemu.pid" +logfile="/var/log/qemu/${VM_NAME}.log" + +# Number of milliseconds to wait after starting to check if the VM is still +# running (used only with start-stop-daemon). Set to empty string to disable. +#start_wait=100 + +# How many seconds to wait after sending "system_shutdown" before force +# stopping the VM. +#shutdown_timeout=40 + + +# qemu-system-${system_type} +system_type="x86_64" +enable_kvm="yes" + +# Select CPU model. Value "host" is allowed only for KVM. +# Run `qemu-system-$system_type -cpu help` for list of options. +cpu_model="host" +# n CPUs. +smp_cpus="1" + +# Maximum number of hotpluggable CPUs, i.e. how many CPUs may be added to the +# VM after startup from the monitor console. +#smp_cpus_max="$smp_cpus" + +# Amount of RAM to allocate for the VM on startup. Use suffix "M" or "G" for +# megabytes or gigabytes respectively. +memory="1G" + +# Maximum amount of RAM the VM can reach, i.e. how much memory may be allocated +# for the VM after startup from the monitor console. Use suffix "M" or "G" for +# megabytes or gigabytes respectively. +#memory_max="$memory" + +# Number of memory slots for additional hotpluggable memory. If it's 0, then +# memory hotplug won't be enabled and the VM startup RAM will never increase. +# If $memory == $memory_max, then this is forced to 0. +#memory_slots=2 + +# Whether to use hugetlbfs mounted on $hugepages_path for the VM RAM. +#memory_hugepages="no" + +# Mount point of the hugetlbfs. +#hugepages_path="/dev/hugepages" + +# Start the RTC at the current UTC, or local time? Use "utc", or "localtime". +# Note: "localtime" is required for correct date in Windows. +#rtc_base="utc" + +# Select type of VGA card to emulate. Valid values for type are: cirrus, std, +# vmware, qxl, tcx, cg3, and none. See option -vga in man qemu for more +# information. +#vga="std" + +#vnc_listen="0.0.0.0" +# TCP port is 5900+$vnc_display. +#vnc_display= +#vnc_password= + +# Path of the QEMU monitor socket for this VM. +monitor_socket="/run/qemu/${VM_NAME}/monitor.sock" + + +## +# Network interfaces +# +# You can specify up to 10 NICs using variables netX and netX_OPTION. For list +# of available options open man qemu and find -netdev. +# +# MAC address of the NIC is automatically generated from the VM name and +# sequence number of the NIC, so it's always the same for particular VM and NIC +# and it should be unique as well. You can override the MAC address with +# variable netX_mac. +# +# The default driver for NICs is virtio-net-pci (requires virtio-net driver +# to be installed in the VM). You can override it with variable netX_device. +# +# Example: +# net0="bridge" +# net0_br="br0" +# net0_mac="52:54:12:34:56:78" +# net0_device="e1000" +# +net0="bridge" + +## +# Hard-drives +# +# You can specify up to 10 drives using variables diskX_OPTION. For list of +# available options open man qemu and find -drive. +# +# These drives will use driver scsi-disk connected to virtio-scsi-pci (requires +# virtio-scsi drivers to be installed in the VM). +# +# Example: +# disk0_file="/dev/mapper/${VM_NAME}-disk0" +# disk0_format="raw" +# disk0_cache="none" +# +# disk1_file="/var/lib/qemu/${VM_NAME}/disk0.qcow2" +# disk1_format="qcow2" +# + +## +# CD-ROMs +# +# You can specify up to 10 cdrom drives using variables cdromX_file. +# +# These drives will use driver ide-cd connected to an emulated IDE controller +# (no virtio). This is slow, but doesn't require any special drivers in the VM. +# +# Example: +# cdrom0_file="/var/lib/qemu/virtio-win.iso" +# + +# Any additional arguments to be passed to qemu-system-x86_64 command. +#extra_args="" + +# Specify service dependencies. You can use the same directives as in the +# depend() function, but as variables prefixed by "rc_" (e.g. rc_need, rc_use). +#rc_need="" +``` diff --git a/notes/os/virt/virt-faq.md b/notes/os/virt/virt-faq.md index 6ce82d0e117..a1421def88d 100644 --- a/notes/os/virt/virt-faq.md +++ b/notes/os/virt/virt-faq.md @@ -62,3 +62,15 @@ tags: - [VNC vs SPICE](http://zee-nix.blogspot.com/2011/06/welcome-to-virtual-world.html) ## kvm: vcpu0, guest rIP: disabled perfctr wrmsr: 0xc2 data 0xffff + +## vhd vs vhdx + +- vhd - Virtual Hard Disk + - 2TB +- vhdx - Virtual Hard Disk v2 + - 64TB + - 提供日志文件保护数据安全 + - 针对现代存储硬件优化 + - Windows Server 2012、Windows 8+ + - 支持自定义元数据、支持更大的逻辑扇区大小 + - 支持稀疏文件 diff --git a/notes/os/virt/vnc-awesome.md b/notes/os/virt/vnc-awesome.md index f7134cdb117..9cc0e0a9b5b 100644 --- a/notes/os/virt/vnc-awesome.md +++ b/notes/os/virt/vnc-awesome.md @@ -90,6 +90,10 @@ open vnc://127.0.0.1:5900 - cross-platform pure Go screen shot library - http://go-lang.cat-v.org/library-bindings +```bash +brew install vnc-viewer +``` + ## Virtual ```bash diff --git a/notes/platform/alipay/alipay-cloud.md b/notes/platform/alipay/alipay-cloud.md index a44a0702409..cc4450e7339 100644 --- a/notes/platform/alipay/alipay-cloud.md +++ b/notes/platform/alipay/alipay-cloud.md @@ -5,15 +5,22 @@ title: 支付宝 云 # 支付宝 云 - AMPE - Alipay Mini-Program Engine - 支付宝小程序引擎 -- https://run.cloud.alipay.com/console - - 支付宝 小程序云 -- https://open.alipay.com/develop/manage - - 支付宝 开放平台 +- 参考 + - https://run.cloud.alipay.com/console + - 支付宝 小程序云 + - https://open.alipay.com/develop/manage + - 支付宝 开放平台 + - https://opendocs.alipay.com/cloud/089qwo + - 什么是支付宝小程序云 + - https://opendocs.alipay.com/mini/089c9g + - 小程序云 > 云开发 > 操作指南 > 环境管理 > 云调用 + - https://opendocs.alipay.com/mini/089ca9 + - 小程序云 > 云开发 > 开发指南 > NodeJS SDK > 开放能力 > 云调用 OpenAPI ```bash -APPID=1234 -CLOUD_ID= -docker tag mysvr registry.cloudrun.cloudbaseapp.cn/cloudrun-$APPID-prod/mysvr:v1.0.0 +APP_ID=1234 +CLOUD_ENV=prod +docker tag mysvr registry.cloudrun.cloudbaseapp.cn/cloudrun-$APP_ID-$CLOUD_ENV/mysvr:v1.0.0 ``` - callContainer 调用服务 @@ -102,3 +109,15 @@ cpt cloudrun service list # 服务 # 部署 cpt cloudrun deploy --env prod --service server --image registry.cloudrun.cloudbaseapp.cn/cloudrun-$APP_ID-$APP_ENV/$APP_SERVIE:latest ``` + +## faas-server-sdk + +```ts +import Cloud from '@alipay/faas-server-sdk'; +const { CLOUD_ENV = 'prod' } = process.env; + +Cloud.init({ + env: CLOUD_ENV, + timeout: 10000, +}); +``` diff --git a/notes/platform/linode.md b/notes/platform/linode.md index 9a7244723dd..aa11d723dc0 100644 --- a/notes/platform/linode.md +++ b/notes/platform/linode.md @@ -13,6 +13,8 @@ title: Linode ::: +- 中国大陆区域速度 + - 最快 东京、新加坡、佛利蒙/Fremont - Nano - 1C1G, 25G, 1T $5/mo $0.0075/hr - Linode 2 GB - 1C2G, 50GB, 2T $10/mo $0.015 - GPU diff --git a/notes/queue/nats/nats-cli.md b/notes/queue/nats/nats-cli.md index f433741f3f2..8ea114b2ecd 100644 --- a/notes/queue/nats/nats-cli.md +++ b/notes/queue/nats/nats-cli.md @@ -40,6 +40,9 @@ nats server info nats-0 # nats event - JSON Schema # https://app.quicktype.io/ 生成其他语言 nats schema ls + + +nats -s wss://demo.nats.io:8443 sub '>' ``` ```json title="context/local.json" diff --git a/notes/queue/nats/nats-client.md b/notes/queue/nats/nats-client.md index f04587c072c..fc07ba9f4da 100644 --- a/notes/queue/nats/nats-client.md +++ b/notes/queue/nats/nats-client.md @@ -1,6 +1,7 @@ --- tags: - Client + - SDK --- # Client diff --git a/notes/queue/nats/nats-faq.md b/notes/queue/nats/nats-faq.md index d13a9749305..943817ae7b4 100644 --- a/notes/queue/nats/nats-faq.md +++ b/notes/queue/nats/nats-faq.md @@ -124,6 +124,13 @@ nats server mapping "tenant.X.service.*" "service.{{wildcard(1)}}" tenant.X.serv - 参考 - [Comparing NATS, NATS Streaming and NATS JetStream](https://gcoolinfo.medium.com/ec2d9f426dc8) +## queue group + +- 用于实现负载均衡和消息分发 +- 同一个队列组内的成员之间会以负载均衡的方式共享消息 + - 一个消息只会被队列组内的一个成员消费 +- https://docs.nats.io/nats-concepts/core-nats/queue + ## cannot create a queue subscription for a consumer without a deliver group - 2.4+ nats 修复 diff --git a/notes/queue/nats/nats-service.md b/notes/queue/nats/nats-service.md index cfdcdbf5ac4..2752851abe1 100644 --- a/notes/queue/nats/nats-service.md +++ b/notes/queue/nats/nats-service.md @@ -8,20 +8,24 @@ tags: # NATS Service ``` -$SRV. -$SRV.. -$SRV... +$SRV. +$SRV.. +$SRV... ``` - https://github.com/nats-io/nats.deno/blob/main/nats-base-client/service.ts -- 标准操作 - - `$SRV.PING|STATS|INFO` -- operation=method +- verb - 标准操作 + - `PING|STATS|INFO` + - operation=method - Group=相同的前缀 - headers - Nats-Service-Error - 字符串描述 - Nats-Service-Error-Code - 数字 +```bash +nats --no-context -s wss://demo.nats.io:8443 sub --match-replies '$SRV.>' +``` + ```ts // io.nats.micro.v1.info_response type InfoResponse = { @@ -201,3 +205,36 @@ test( }, ); ``` + +## Explained + +- ServiceGroup + - addEndpoint + - addGroup +- https://github.com/nats-io/nats.deno/blob/main/nats-base-client/service.ts + +```ts +type NamedEndpoint = { + name: string; + + /** + * Subject where the endpoint listens + */ + subject: string; + /** + * An optional handler - if not set the service is an iterator + * @param err + * @param msg + */ + handler?: ServiceHandler; + /** + * Optional metadata about the endpoint + */ + metadata?: Record; + /** + * Optional queue group to run this particular endpoint in. The service's configuration + * queue configuration will be used. See {@link ServiceConfig}. + */ + queue?: string; +}; +``` diff --git a/notes/queue/nats/nats-version.md b/notes/queue/nats/nats-version.md index 4416809b77c..9c0fa46737b 100644 --- a/notes/queue/nats/nats-version.md +++ b/notes/queue/nats/nats-version.md @@ -14,6 +14,7 @@ tags: | ver | date | nats.go | | ---------------------- | ---------- | ------- | +| [Nats 2.11](#nats-211) | | | [Nats 2.10](#nats-210) | 2023-09-20 | | [Nats 2.9](#nats-29) | 2022-09-09 | | [Nats 2.8](#nats-28) | 2022-04-19 | | diff --git a/notes/queue/queue-awesome.md b/notes/queue/queue-awesome.md index 89f6f987e20..1a9e2c7f7d0 100644 --- a/notes/queue/queue-awesome.md +++ b/notes/queue/queue-awesome.md @@ -115,6 +115,27 @@ tags: - Apache Storm - Apache Samza - Apache Beam +- [Apache ActiveMQ Artemis](https://activemq.apache.org/components/artemis/) + - AMQP protocol support + - OpenWire support for ActiveMQ 5 clients + - MQTT support + - STOMP protocol support + - HornetQ Core protocol support for HornetQ 2.4,2.5 clients + - JMS 2.0 and 1.1 support + - High availability with shared store and non shared store (replication) + - Flexible Clustering + - High performance journal for message persistence + - Queue memory limitation + - SSL support + - Management over JMX, JMS and core protocol + - Large message support + - Topic hierarchies + - Producer flow control + - Consumer flow control + - Diverts + - Last value queue + - Message Groups + - OSGi support ## Protocol diff --git a/notes/security/crypto/password.md b/notes/security/crypto/password.md index 941d295e764..79f12e23ca9 100644 --- a/notes/security/crypto/password.md +++ b/notes/security/crypto/password.md @@ -28,6 +28,7 @@ title: 密码加密方式 - https://passlib.readthedocs.io/en/stable/modular_crypt_format.html - PHC String Format - https://github.com/P-H-C/phc-string-format/blob/master/phc-sf-spec.md + - https://man7.org/linux/man-pages/man3/crypt.3.html ``` $[$v=][$=(,=)*][$[$]] diff --git a/notes/security/security-awesome.md b/notes/security/security-awesome.md index a614963efbf..b6772bde859 100644 --- a/notes/security/security-awesome.md +++ b/notes/security/security-awesome.md @@ -206,6 +206,9 @@ CBC, OFB and CFB are similar, however OFB/CFB is better because you only need en ## Scan +- [future-architect/vuls](https://github.com/future-architect/vuls) + - GPLv3, Golang + - Agent-less vulnerability scanner for Linux, FreeBSD, Container, WordPress, Programming language libraries, Network devices - [robertdavidgraham/masscan](https://github.com/robertdavidgraham/masscan) - [projectdiscovery](https://github.com/projectdiscovery) - [nuclei](https://github.com/projectdiscovery/nuclei) diff --git a/notes/service/api/openapi/README.md b/notes/service/api/openapi/README.md index b87d21db1ff..29ef9c544c7 100644 --- a/notes/service/api/openapi/README.md +++ b/notes/service/api/openapi/README.md @@ -60,3 +60,8 @@ title: OpenAPI - https://blog.stoplight.io/difference-between-open-v2-v3-v31 # FAQ + +## summary vs description + +- summary - 简短描述 +- description - 详细描述 diff --git a/notes/service/cn/tax/invoice.md b/notes/service/cn/tax/invoice.md new file mode 100644 index 00000000000..bbc3354ef0d --- /dev/null +++ b/notes/service/cn/tax/invoice.md @@ -0,0 +1,29 @@ +--- +title: 发票 +--- + +# 发票 + +## QR + +``` +01,32,,24312000000000000000,303.00,20240115,,8F93 +``` + +- 01 - 发票种类 +- 32 - 专票 +- 24312000000000000000 - 发票代码 +- 303.00 - 金额 +- 20240115 - 开票日期 +- 8F93 - 校验码 + +--- + +``` +种类,代码,?,号码,金额,税额,开票日期,?,校验码 +``` + +- https://inv-veri.chinatax.gov.cn/ +- 识别 + - https://github.com/sanluan/einvoice + - https://lb0726.github.io/EInvoiceQR/ diff --git a/notes/service/dns/domain.md b/notes/service/dns/domain.md index 457ce987899..646a8478289 100644 --- a/notes/service/dns/domain.md +++ b/notes/service/dns/domain.md @@ -15,8 +15,6 @@ title: Domain - .tech - .tax - 财税、企业服务行业 - 参考 - - 中国互联网域名体系 https://domain.miit.gov.cn/ - - 列举了 - [It's official: .corp, .home, .mail will never be top-level domains on the 'net](https://forums.theregister.com/forum/all/2018/02/12/icann_corp_home_mail_gtlds/) - [google/nomulus](https://github.com/google/nomulus/) - Google tld 管理服务 @@ -32,6 +30,13 @@ title: Domain ::: +## 中国 {#china} + +- 中国互联网域名体系 https://domain.miit.gov.cn/ + - 列举了可备案的顶级域名和管理公司 +- 阿里云域名列表 https://help.aliyun.com/zh/dws/support/list-of-suffixes-of-top-level-domain-names +- 腾讯云域名价格列表 https://buy.cloud.tencent.com/domain/price + ## Provider - ~~[domains.google](https://domains.google)~~ diff --git a/notes/service/erp/ams.md b/notes/service/erp/ams.md new file mode 100644 index 00000000000..b98cb5fe0ef --- /dev/null +++ b/notes/service/erp/ams.md @@ -0,0 +1,92 @@ +--- +title: ams +--- + +# Accounting management system + +- 账务处理 + - 功能:账簿管理、凭证录入、自动记账、财务报表生成。 + - 目的:自动化日常账务处理,提高准确性和效率。支持多种会计准则,包括中国会计准则。 +- 税务管理 + - 功能:税率设置、税务申报、自动计算税款、税务报表。 + - 目的:简化税务申报流程,确保税务合规,自动更新税率以符合最新税法。 +- 文件管理 + - 功能:电子凭证管理、扫描和上传纸质凭证、凭证审核。 + - 目的:实现无纸化办公,方便存储、检索和管理财务凭证。 +- 报表与分析 + - 功能:财务报表(利润表、资产负债表等)、经营分析报告、财务指标分析。 + - 目的:为代理记账人员和客户提供即时的财务状况分析,支持决策制定。 +- 审计与合规性 + - 功能:审计跟踪、合规性检查、风险评估报告。 + - 目的:确保会计和税务操作符合国家法规和国际标准,降低财务风险。 + +## QA + +- 会计期间 是否存在不是按月的? +- 会计期间 结账后是否可以修改? +- 参考 + - https://www.safe.gov.cn/safe/rmbhlzjj/index.html + - 人民币汇率中间价 - 国家外汇管理局 + - https://www.safe.gov.cn/AppStructured/hlw/exportRMBExcel.do + +## 账务处理模块 + +- AccountingPeriod - 会计期间 + - state -> status + - Open + - Active + - AboutToClose - 即将关闭 - 接近期末,提醒用户即将进入锁定阶段 + - Locked + - PendingAudit - 待审计 + - UnderAudit - 审计中 + - PendingAdjustment - 待调整 + - Closed + - Finalized - 已结账 - 所有财务活动均已完成,期间彻底关闭。 + - Archived - 已归档 - 期间数据已被存档,只供查阅。 +- FinancialVoucher - 记账凭证/财务凭证 + - state -> status + - Draft - 草稿 - 凭证已创建但尚未完成所有必要信息的录入,处于初步阶段。 + - PendingCompletion - 待完善 - 凭证需要补充更多详细信息。 + - 待复核(Pending Review):凭证待内部复核前的准备状态。 + - Submitted - 已提交 - 凭证已完成录入并提交,等待审批或进一步处理。 + - 待审批(Pending Approval):凭证已提交,等待审批。 + - 审批中(Under Review):凭证正在被审批者审查。 + - Approved - 已审批 - 凭证已经过审批,确认无误。 + - 待记账(Pending Posting):凭证已审批,等待记账处理。 + - 调整中(Adjusting):凭证在审批后需要做调整。 + - Posted - 已记账 - 凭证已经根据审批结果正式记入账簿。 + - 已完成(Completed):凭证已正式记账,整个过程完成。 + - 已锁定(Locked):凭证已记账并锁定,不允许任何进一步修改。 +- FinancialDocuments - 财务文件/财务凭证 + +--- + +1. **账簿管理**: + - 支持设置和管理多种账簿(如总账、明细账、现金流量表)。 + - 提供模板和自定义选项,以适应不同类型的业务和会计要求。 +2. **凭证录入与管理**: + - 界面简洁,方便用户录入各类会计凭证。 + - 支持批量导入和导出凭证数据,减少手动输入。 + - 凭证审核流程,确保凭证的准确性和完整性。 +3. **自动记账**: + - 根据录入的凭证自动更新账簿。 + - 支持常见的会计处理规则,自动计算和分录。 +4. **财务报表生成**: + - 自动生成包括资产负债表、利润表、现金流量表等财务报表。 + - 提供定制报表功能,满足特定分析需求。 + +## 税务管理模块 + +1. **税率和税法设置**: + - 支持自定义税率设置,适应不同税种和政策变动。 + - 提供税法更新提示,帮助用户及时调整税务处理流程。 +2. **税务申报**: + - 界面引导式的税务申报流程,简化申报操作。 + - 支持各种税种的申报,包括增值税、企业所得税等。 + - 集成电子税务局接口,实现税务申报的自动化。 +3. **税款计算**: + - 根据会计凭证自动计算应纳税额。 + - 提供税务规划建议,帮助企业合法节税。 +4. **税务报表**: + - 自动生成税务相关的财务报表和汇总分析。 + - 提供税务审计和检查的相关报告。 diff --git a/notes/service/erp/erp-glossary.md b/notes/service/erp/erp-glossary.md index 762928e6c7d..f715ade59b7 100644 --- a/notes/service/erp/erp-glossary.md +++ b/notes/service/erp/erp-glossary.md @@ -5,6 +5,30 @@ tags: # Address Book - 地址簿 +| abbr. | for | cn | +| ----: | -------------------------------: | ---------------- | +| ams | Accounting Management System | 会计管理系统 | +| hrms | Human Resource Management System | 人力资源管理系统 | +| erp | Enterprise Resource Planning | 企业资源计划 | +| crm | Customer Relationship Management | 客户关系管理 | +| wms | Warehouse Management System | 仓库管理系统 | +| tms | Transportation Management System | 运输管理系统 | +| scm | Supply Chain Management | 供应链管理 | +| plm | Product Lifecycle Management | 产品生命周期管理 | +| mes | Manufacturing Execution System | 制造执行系统 | +| dms | Document Management System | 文档管理系统 | +| pms | Project Management System | 项目管理系统 | +| cms | Content Management System | 内容管理系统 | +| lms | Learning Management System | 学习管理系统 | +| ems | Event Management System | 事件管理系统 | +| oms | Order Management System | 订单管理系统 | +| fms | Financial Management System | 财务管理系统 | +| bms | Building Management System | 建筑管理系统 | +| iot | Internet of Things | 物联网 | +| PMS | Property Rental System | 物业租赁系统 | +| RPM | Rental Property Management | 租赁物业管理 | +| HRS | House Rental System | 房屋租赁系统 | + - 企业内部人员 - 例如 - LDAP 里有地址簿的相关结构 diff --git a/notes/service/im/im-faq.md b/notes/service/im/im-faq.md index 1ff769e0768..ce6dbd36f1f 100644 --- a/notes/service/im/im-faq.md +++ b/notes/service/im/im-faq.md @@ -11,11 +11,18 @@ tags: - fan in - N Producer -> 1 Broker + - 多个发送者向一个接收者发送消息 + - 对性能影响较小,但需要确保服务端能够有效处理并发连接和数据的汇总。 + - 确保服务器能够处理高并发请求并在出现故障时快速恢复 - fan out + - 1 Broker -> N Consumer + - 一个发送者向多个接收者发送消息 + - 大规模聊天应用中可能会遇到性能瓶颈,特别是在实时广播大量消息时。 + - 使用 消息队列、发布/订阅模式 来缓冲消息并异步分发 + - 需要设计高可用的消息分发系统,避免单点故障导致的消息丢失。 - one-to-many - PubSub - PushPull - - 1 Broker -> N Consumer - fan out write - 1 Broker -> N Consumer - fan out read diff --git a/notes/service/im/telegram.md b/notes/service/im/telegram.md new file mode 100644 index 00000000000..370a1d529e7 --- /dev/null +++ b/notes/service/im/telegram.md @@ -0,0 +1,23 @@ +--- +title: Telegram +--- + +# Telegram + +- [gotd/td](https://github.com/gotd/td) + - MIT, Golang + - Telegram client, in Go. (MTProto API) +- [aykutalparslan/Telegram-Server](https://github.com/aykutalparslan/Telegram-Server) + - GPLv3, Java + - Unofficial Telegram Server +- [LonamiWebs/Telethon](https://github.com/LonamiWebs/Telethon) + - MIT, Puthon + - Pure Python 3 MTProto API Telegram client library +- 参考 + - [Applications](https://telegram.org/apps) + - [api](https://core.telegram.org/api) + - Bot API + - Telegram API + - [mtproto](https://core.telegram.org/mtproto) + - [schema](https://core.telegram.org/schema) +- [TELEGRAM常用机器人](https://www.ff98sha.me/archives/147) diff --git a/notes/service/media/README.md b/notes/service/media/README.md new file mode 100644 index 00000000000..a8c1b955c36 --- /dev/null +++ b/notes/service/media/README.md @@ -0,0 +1,10 @@ +--- +title: 媒体 +--- + +# Media + +> Media -> Audio, Video, Image + +- [Awesome](./media-awesome.md) +- [FAQ](./media-faq.md) diff --git a/notes/service/media/ffmpeg.md b/notes/service/media/ffmpeg/README.md similarity index 100% rename from notes/service/media/ffmpeg.md rename to notes/service/media/ffmpeg/README.md diff --git a/notes/service/media/ffmpeg-faq.md b/notes/service/media/ffmpeg/ffmpeg-faq.md similarity index 100% rename from notes/service/media/ffmpeg-faq.md rename to notes/service/media/ffmpeg/ffmpeg-faq.md diff --git a/notes/service/media/media-awesome.md b/notes/service/media/media-awesome.md index c63cfb0e960..7793ea60fcc 100644 --- a/notes/service/media/media-awesome.md +++ b/notes/service/media/media-awesome.md @@ -126,6 +126,14 @@ tags: ::: +- amr - Adaptive Multi-Rate + - 专为语音编码设计的压缩格式 + - 用于移动电话和语音 + - 能够根据网络条件和通话质量自适应地调整编码速率 + - 保持相对较低的数据传输速率的同时,最大限度地提高语音质量。 + - AMR-NB(Narrowband) + - AMR-WB(Wideband) + - 3GPP标准化 - mp3 - ac3 - aac diff --git a/notes/service/network/proxy/clash/mihomo.md b/notes/service/network/proxy/clash/mihomo.md index 61f2d988c1e..9fad5ce2db0 100644 --- a/notes/service/network/proxy/clash/mihomo.md +++ b/notes/service/network/proxy/clash/mihomo.md @@ -16,11 +16,22 @@ title: Clash.Meta # macOS curl -L -o mihomo.gz https://github.com/MetaCubeX/mihomo/releases/download/v1.18.1/mihomo-darwin-arm64-v1.18.1.gz # Linux -curl -L -o mihomo.gz https://github.com/MetaCubeX/mihomo/releases/download/v1.18.1/mihomo-linux-amd64-compatible-v1.18.0.gz +curl -L -o mihomo.gz https://github.com/MetaCubeX/mihomo/releases/download/v1.18.1/mihomo-linux-amd64-compatible-v1.18.1.gz gzip -d mihomo.gz chmod +x mihomo +./mihomo -v ./mihomo --help + +# install +sudo mv mihomo /usr/local/bin/mihomo + +curl -LO https://github.com/wenerme/wener/raw/master/notes/service/network/proxy/clash/mihomo.openrc.sh +sudo mv mihomo.openrc.sh /etc/init.d/mihomo +sudo chmod +x /etc/init.d/mihomo + +# /etc/mihomo/config.yaml +mkdir -p /etc/mihomo ``` ## 配置 {#config} diff --git a/notes/service/network/proxy/glider.md b/notes/service/network/proxy/glider.md index 449969b39ed..7045054119d 100644 --- a/notes/service/network/proxy/glider.md +++ b/notes/service/network/proxy/glider.md @@ -24,7 +24,6 @@ title: glider ```bash brew install glider - ``` ```ini diff --git a/notes/service/network/proxy/gost.md b/notes/service/network/proxy/gost.md index c5a8dbd327f..d946c0f00d2 100644 --- a/notes/service/network/proxy/gost.md +++ b/notes/service/network/proxy/gost.md @@ -54,7 +54,8 @@ tar zxvf gost*.tar.gz curl -LO https://github.com/go-gost/gost/releases/download/v3.0.0-rc10/gost_3.0.0-rc10_linux_amd64.tar.gz tar zxvf gost*.tar.gz -mv gost /usr/local/bin/ +./gost -V +sudo mv gost /usr/local/bin/ # v3 # -L 监听 diff --git a/notes/service/network/spec/http/http-faq.md b/notes/service/network/spec/http/http-faq.md index 32377e81b4f..775e568c133 100644 --- a/notes/service/network/spec/http/http-faq.md +++ b/notes/service/network/spec/http/http-faq.md @@ -74,8 +74,9 @@ curl -H 'Accept-encoding: zstd, br, gzip, deflate' -I https://s.wener.me ## Accept-Encoding -- Chrome 121 +- Chrome 123 - Accept-Encoding: gzip, deflate, br, zstd - [nodejs/undici#2847](https://github.com/nodejs/undici/issues/2847) - fetch zstd support - https://caniuse.com/zstd +- https://github.com/web-platform-tests/wpt/tree/master/fetch/content-encoding/zstd diff --git a/notes/service/office/fortune-sheet.md b/notes/service/office/fortune-sheet.md index 7a5eb70ca8c..78ead74d39a 100644 --- a/notes/service/office/fortune-sheet.md +++ b/notes/service/office/fortune-sheet.md @@ -12,5 +12,6 @@ title: fortune-sheet - formula fork [handsontable/formula-parser](https://github.com/handsontable/formula-parser) - @formulajs/formula-parser - @fortune-sheet/core - - 1.6MB/375kB - @formulajs/formulajs, lodash, jstat + - 1.7MB/408kB - @formulajs/formulajs, lodash, jstat, dayjs - @fortune-sheet/react + - 260kB - immer diff --git a/notes/service/office/luckysheet.md b/notes/service/office/luckysheet.md index 016263217d5..4c826bb3da6 100644 --- a/notes/service/office/luckysheet.md +++ b/notes/service/office/luckysheet.md @@ -5,6 +5,7 @@ title: univer # univer - [dream-num/univer](https://github.com/dream-num/univer) + - Apache-2.0, TS - 旧的项目 ~~[mengshukeji/luckysheet](https://github.com/mengshukeji/luckysheet)~~ - MIT, JS+jQuery - 2.9MB/606kB @@ -13,6 +14,8 @@ title: univer - 目前 **不支持导出** - [mengshukeji/Luckyexcel#16](https://github.com/mengshukeji/Luckyexcel/issues/16) - 可基于 exceljs 自行导出 [参考](https://github.com/oy-paddy/luckysheet-vue-importAndExport/blob/master/src/components/export.js) +## luckysheet + :::caution - 目前依赖很复杂 - [gulpfile.js](https://github.com/mengshukeji/Luckysheet/blob/ee5ac0313cdc6920109beb487c56c081dec5a7f1/gulpfile.js#L95-L109) diff --git a/notes/service/office/office-awesome.md b/notes/service/office/office-awesome.md index b21c01a9ad5..63fff680d9d 100644 --- a/notes/service/office/office-awesome.md +++ b/notes/service/office/office-awesome.md @@ -23,9 +23,11 @@ tags: ## Library - Java - - apache poi - - [alibaba/easyexcel](https://github.com/alibaba/easyexcel) + - [apache/poi](https://github.com/apache/poi) + - Apache-2.0, Java + - reading and writing Microsoft Office binary and OOXML file formats - Javascript/NodeJS + - [xmldom/xmldom](https://github.com/xmldom/xmldom) - [exceljs/exceljs](https://github.com/exceljs/exceljs) - MIT, JS - [handsontable/hyperformula](https://github.com/handsontable/hyperformula) @@ -43,7 +45,6 @@ tags: - Apache-2.0, JS - 不在 npm https://github.com/SheetJS/sheetjs/issues/2667 - 开发也不在 Github 上了 - - [handsontable/hyperformula](https://github.com/handsontable/hyperformula) - [foliojs](https://github.com/foliojs) - [foliojs/pdfkit](https://github.com/foliojs/pdfkit) - MIT, JavaScript @@ -53,57 +54,97 @@ tags: - brotli.js - [mgcrea/node-xlsx](https://github.com/mgcrea/node-xlsx) - based on sheetjs -- React Table - - [adazzle/react-data-grid](https://github.com/adazzle/react-data-grid) - - MIT - - [nadbm/react-datasheet](https://github.com/nadbm/react-datasheet) - - MIT, JS - - [iddan/react-spreadsheet](https://github.com/iddan/react-spreadsheet) - Golang - - [qax-os/excelize](https://github.com/qax-os/excelize) - [unidoc/unioffice](https://github.com/unidoc/unioffice) - .docx, .xlsx, .pptx - PHP - [PHPOffice/PhpSpreadsheet](https://github.com/PHPOffice/PhpSpreadsheet) - [FancyGrid/awesome-grid](https://github.com/FancyGrid/awesome-grid) -- PDF +- 应用 + - [kevinschaich/mintable](https://github.com/kevinschaich/mintable) + - personal finances + +## PDF + +- Javascript/TyepScript - [mozilla/pdf.js](https://github.com/mozilla/pdf.js) - Apache-2.0, Javascript - PDF Reader + - NPM pdfjs-dist @types/pdfjs-dist - [ZEISS/react-view-pdf](https://github.com/ZEISS/react-view-pdf) + - [modesty/pdf2json](https://github.com/modesty/pdf2json) + - Apache-2.0, JS + - 使用 @xmldom/xmldom +- React - [wojtekmaj/react-pdf](https://github.com/wojtekmaj/react-pdf) - MIT, Javascript - Viewer - [diegomura/react-pdf](https://github.com/diegomura/react-pdf) - MIT, Javascript - Builder -- 应用 - - [kevinschaich/mintable](https://github.com/kevinschaich/mintable) - - personal finances -## Sheet - -- [dream-num/Luckysheet](./luckysheet.md) -- [ruilisi/fortune-sheet](./fortune-sheet.md) - - fork Luckysheet - - rewrite in ts - - 移除 jQuery,依赖 React/Vue + immer - - formula fork [handsontable/formula-parser](https://github.com/handsontable/formula-parser) - - @formulajs/formula-parser - - @fortune-sheet/core - - 1.6MB/375kB - @formulajs/formulajs, lodash, jstat - - @fortune-sheet/react -- [sheetjs](./sheetjs.md) -- [handsontable/handsontable](https://github.com/handsontable/handsontable) - - license 不允许商业产品使用 -- [myliang/x-spreadsheet](https://github.com/myliang/x-spreadsheet) - - canvas - - -> [wolf-table/table](https://github.com/wolf-table/table) -- [jspreadsheet/ce](https://github.com/jspreadsheet/ce) - - MIT -- [nadbm/react-datasheet](https://github.com/nadbm/react-datasheet) -- [nhn/tui.grid](https://github.com/nhn/tui.grid) -- [future-architect/cheetah-grid](https://github.com/future-architect/cheetah-grid) +## Sheet/Excel + +- Java + - [alibaba/easyexcel](https://github.com/alibaba/easyexcel) +- Golang + - [qax-os/excelize](https://github.com/qax-os/excelize) +- JS/TyepScript + - [sheetjs](./sheetjs.md) + - [dream-num/Luckysheet](./luckysheet.md) + - [future-architect/cheetah-grid](https://github.com/future-architect/cheetah-grid) + - Vue, React + - [handsontable/handsontable](https://github.com/handsontable/handsontable) + - license 不允许商业产品使用 + - [myliang/x-spreadsheet](https://github.com/myliang/x-spreadsheet) + - canvas + - -> [wolf-table/table](https://github.com/wolf-table/table) + - [jspreadsheet/ce](https://github.com/jspreadsheet/ce) + - MIT + - [nhn/tui.grid](https://github.com/nhn/tui.grid) + - [LesterLyu/fast-formula-parser](https://github.com/LesterLyu/fast-formula-parser) + - MIT, JS + - 300kB,83kB + - Parse and evaluate MS Excel formula in javascript. + - [handsontable/hyperformula](https://github.com/handsontable/hyperformula) + - GPLv3, TS +- React Table + - [adazzle/react-data-grid](https://github.com/adazzle/react-data-grid) + - MIT + - [nadbm/react-datasheet](https://github.com/nadbm/react-datasheet) + - MIT, JS + - [nick-keller/react-datasheet-grid](https://github.com/nick-keller/react-datasheet-grid) + - MIT, TS + - 数据为 对象数组 + - 只支持 sticky right 列 + - 不支持 sticky left + - 使用 @tanstack/react-virtual 作为虚拟滚动 + - [iddan/react-spreadsheet](https://github.com/iddan/react-spreadsheet) + - MIT, TS + - 40kB/12kB + - 依赖的 fast-formula-parser 相对比较大 + - 渲染表格内容部分 + - 不支持: Pin, Frozen, Merge, Resize + - 数据为 matrix - 二维数组 + - [blueprintjs/table](https://blueprintjs.com/docs/#table) + - [ruilisi/fortune-sheet](./fortune-sheet.md) + - fork Luckysheet + - rewrite in ts + - 移除 jQuery,依赖 React/Vue + immer + - formula fork [handsontable/formula-parser](https://github.com/handsontable/formula-parser) + - @formulajs/formula-parser + - @fortune-sheet/core + - 1.6MB/375kB - @formulajs/formulajs, lodash, jstat + - @fortune-sheet/react + - [silevis/reactgrid](https://github.com/silevis/reactgrid) + - MIT, TS + - 260kB/70kB + - 支持: 多人、填充、多选、Column Resize、Column Reorder、Sticky columns and rows、Group +- https://en.wikipedia.org/wiki/Topological_sorting +- 商业 + - 葡萄城 + +## Word/Doc ## LowCode DataTable diff --git a/notes/service/service-awesome.md b/notes/service/service-awesome.md index 566ed55c6e4..ee1e953eb1a 100644 --- a/notes/service/service-awesome.md +++ b/notes/service/service-awesome.md @@ -74,10 +74,6 @@ tags: - Segment-alternative - 后端 PostgreSQL - Customer Data Platform, CDP -- file transfer - - [schollz/croc](https://github.com/schollz/croc) - - MIT, Go - - 命令行 - conferencing - [gjovanov/roomler](https://github.com/gjovanov/roomler) - Janus Gateway @@ -285,7 +281,7 @@ tags: - Nextcloud - [cloudreve/Cloudreve](https://github.com/cloudreve/Cloudreve) - GPLv3, Golang -- file share/airdrop +- file share/airdrop/file transfer - [localsend/localsend](https://github.com/localsend/localsend) - MIT, Dart, Flutter - 🌟 @@ -297,6 +293,8 @@ tags: - 命令行 - 依赖 relay,可以 selfhost - 支持 resume + - [psi-4ward/psitransfer](https://github.com/psi-4ward/psitransfer) + - BSD-2, JS, Vue - [tudbut/qft](https://github.com/tudbut/qft) - GPLv3, Rust - [psanford/wormhole-william](https://github.com/psanford/wormhole-william) @@ -359,6 +357,14 @@ tags: - gist/pastebin - [thomiceli/opengist](https://github.com/thomiceli/opengist) - AGPLv3, Go + - [PrivateBin/PrivateBin](https://github.com/PrivateBin/PrivateBin) + - PHP + - [szabodanika/microbin](https://github.com/szabodanika/microbin) + - Rust + - [MaxLeiter/Drift](https://github.com/MaxLeiter/Drift) + - MIT, TS + - self-hostable Gist and paste service + - Pastebin.com - form/问卷调查系统/表单系统 - [TDuckCloud/tduck-platform](https://github.com/TDuckCloud/tduck-platform) - [javahuang/surveyking](https://github.com/javahuang/surveyking) @@ -423,9 +429,11 @@ tags: - [KRTirtho/spotube](https://github.com/KRTirtho/spotube) - BSD-4, Dart, Flutter - Open source Spotify client -- Rental Property Management +- Rental Property Management/租赁管理系统 - https://gaiapm.com.hk/ - https://www.landlordstudio.com/blog/best-rental-property-management-software +- juge + - [judge0/judge0](https://github.com/judge0/judge0) - 商业 - https://nino.app/ diff --git a/notes/service/storage/storage-faq.md b/notes/service/storage/storage-faq.md index f484021aaef..1b0e419f5af 100644 --- a/notes/service/storage/storage-faq.md +++ b/notes/service/storage/storage-faq.md @@ -27,3 +27,22 @@ tags: --- - https://uploadcare.com/blog/handling-large-file-uploads/ + +## Object Storage Service vs Filesystem + +- 对象存储 + - 存储对象 + - 每个对象包含数据本身+元数据+全局唯一标识 - data, metadata, key + - 面向网络 + - 面向大规模 - 可伸缩 + - 处理大量小文件时可能不如文件系统高效,但在处理大文件或流式数据时性能良好。 + - 适合存储非结构化数据 + - 如照片、视频、日志文件和备份数据等。 + - 广泛应用于云存储、大数据分析、静态Web资源托管和数据归档。 + - RESTful +- 文件系统 + - 文件+目录 - 支持嵌套 + - 本地 + - POSIX + - 低延迟 + - 可靠 diff --git a/notes/web/browser/chrome/README.md b/notes/web/browser/chrome/README.md index 6dcafcc4d64..e2af7650c6c 100644 --- a/notes/web/browser/chrome/README.md +++ b/notes/web/browser/chrome/README.md @@ -7,6 +7,19 @@ title: Chrome - KHTML -> Webkit -> Blink - [chrome://chrome-urls](./chrome-urls.md) Chrome 内部页面 +- Windows XP/2003 + - https://github.com/win32ss/supermium + +```bash +curl -O https://dl.google.com/chrome/mac/universal/stable/GGRO/googlechrome.dmg +# 旧版本 87 +curl -O https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg + +# Linux https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb + +# Windows +curl -o googlechrome.exe "https://dl.google.com/tag/s/appguid={8A69D345-D564-463c-AFF1-A69D9E530F96}&iid={91A77F18-01A2-47AF-8B2B-7A9A78D677F7}&lang=en&browser=3&usagestats=1&appname=Google%20Chrome&needsadmin=prefers&ap=x64-stable&dl=installdata&sig=O/bkTtzTzkDKc+QWtHbLtnf9XzOs+rE2ZS+JKIIaD4=" +``` ## 快捷键 {#keyboard-shortcuts} diff --git a/notes/web/browser/chrome/chrome-faq.md b/notes/web/browser/chrome/chrome-faq.md index 439f3655d2a..33c4929a396 100644 --- a/notes/web/browser/chrome/chrome-faq.md +++ b/notes/web/browser/chrome/chrome-faq.md @@ -10,14 +10,23 @@ tags: - https://www.google.com/intl/en/chrome/?standalone=1 -``` +```bash # ChromeStandaloneSetup64.exe # https://dl.google.com/tag/s/appguid={8A69D345-D564-463C-AFF1-A69D9E530F96}&iid={E3751212-181B-0E06-8D37-4EC9E8CE331E}&lang=en&browser=4&usagestats=0&appname=Google%20Chrome&needsadmin=prefers&ap=x64-stable-statsdef_1&installdataindex=defaultbrowser/chrome/install/ChromeStandaloneSetup64.exe +# https://dl.google.com/tag/s/appguid={}&iid={}&lang=en&browser=4&usagestats=0&appname=Google%20Chrome&needsadmin=prefers&ap=x64-stable-statsdef_1&installdataindex=empty/chrome/install/ChromeStandaloneSetup64.exe + +# +curl -o ChromeStandaloneSetup64.en.exe "https://dl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7B87584CE6-0E38-80EC-E64B-445DE6CAC662%7D%26lang%3Den%26browser%3D4%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dprefers%26ap%3Dx64-stable-statsdef_1%26installdataindex%3Dempty/chrome/install/ChromeStandaloneSetup64.exe" +# +curl -o ChromeStandaloneSetup64.zh-CN.exe "https://dl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7B1AF1CCDF-A7FA-8A43-6E6D-A889DB429A87%7D%26lang%3Dzh-CN%26browser%3D4%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dprefers%26ap%3Dx64-stable-statsdef_1%26installdataindex%3Dempty/chrome/install/ChromeStandaloneSetup64.exe" # googlechrome.dmg curl -LOJC- https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg ``` +- Windows 11 x86_64 + - appguid 8A69D345-D564-463C-AFF1-A69D9E530F96 + - iid 87584CE6-0E38-80EC-E64B-445DE6CAC662 - https://dl.google.com/mac/install/googlesoftwareupdate.dmg ## 自动更新域名 diff --git a/notes/web/framework/nextjs/nextjs-app.md b/notes/web/framework/nextjs/nextjs-app.md index 7d98b384c29..6a409e8eb8e 100644 --- a/notes/web/framework/nextjs/nextjs-app.md +++ b/notes/web/framework/nextjs/nextjs-app.md @@ -127,7 +127,7 @@ export async function generateStaticParams() { ```tsx title="layout.tsx" export default function RootLayout({ children, params }: { children: React.ReactNode; params?: any }) { return ( - + Next.js @@ -214,3 +214,37 @@ export default function NotFound() { - https://beta.nextjs.org/docs/app-directory-roadmap ## Only async functions are allowed to be exported in a "use server" file + +## middleware + +- [#34179](https://github.com/vercel/next.js/discussions/34179) + - 只能运行在 edge runtime + - 一般来说不能操作数据库 +- 不能 warp - 获取不到 响应 + +```ts +import type { NextRequest } from 'next/server'; +import { NextResponse } from 'next/server'; + +export async function middleware(req: NextRequest) { + const { url, method, nextUrl } = req; + console.log(`${method} ${nextUrl}`); + // let accessToken = request.cookies.get('access_token'); + // if (!accessToken) { + // return NextResponse.redirect(new URL('/auth/login', request.url)); + // } +} + +export const config = { + matcher: [ + /* + * Match all request paths except for the ones starting with: + * - api (API routes) + * - _next/static (static files) + * - _next/image (image optimization files) + * - favicon.ico (favicon file) + */ + '/((?!api|_next/static|_next/image|favicon.ico).*)', + ], +}; +``` diff --git a/notes/web/framework/nextjs/nextjs-version.md b/notes/web/framework/nextjs/nextjs-version.md index 3bc7c2cf2bb..a2e4a63c243 100644 --- a/notes/web/framework/nextjs/nextjs-version.md +++ b/notes/web/framework/nextjs/nextjs-version.md @@ -24,16 +24,19 @@ tags: | version | date | blog | | ------------ | ---------- | --------- | +| [NextJS 14] | 2023-10-26 | [next-14] | | [NextJS 13] | 2022-10-26 | [next-13] | | [NextJS 12] | 2021-11-27 | [next-12] | | [NextJS 11] | 2021-06-16 | [next-11] | | [NextJS 10] | 2020-10-27 | [next-10] | | [NextJS 9.5] | 2020-7-28 | +[next-14]: https://nextjs.org/blog/next-14 [next-13]: https://nextjs.org/blog/next-13 [next-12]: https://nextjs.org/blog/next-12 [next-11]: https://nextjs.org/blog/next-11 [next-10]: https://nextjs.org/blog/next-10 +[nextjs 14]: #NextJS-14 [nextjs 13]: #NextJS-13 [nextjs 12]: #NextJS-12 [nextjs 11]: #NextJS-11 @@ -48,6 +51,15 @@ tags: - Server Action 文档 - 部分渲染 - 实验阶段 - 预渲染 suspense 部分 +- 14.1 - 2024-01-18 + - 提升 Self-Hosting + - cacheHandler + - cacheMaxMemorySize + - 完善 Turbopack + - 配置 logging.fetches.fullUrl + - `import { getImageProps } from 'next/image';` 可用于 picture + - https://areweturboyet.com/ + - https://nextjs.org/blog/next-14-1 ## NextJS 13 diff --git a/notes/web/dev/graphile-worker.md b/notes/web/nodejs/graphile-worker.md similarity index 100% rename from notes/web/dev/graphile-worker.md rename to notes/web/nodejs/graphile-worker.md diff --git a/notes/web/nodejs/nodejs-awesome.md b/notes/web/nodejs/nodejs-awesome.md index cfc8128a002..d2bd76a78bd 100644 --- a/notes/web/nodejs/nodejs-awesome.md +++ b/notes/web/nodejs/nodejs-awesome.md @@ -173,15 +173,22 @@ export N_PREFIX=$HOME/n - time-based scheduling, not interval-based scheduling - node-cron - cron + - [graphile-worker](./graphile-worker.md) + - PostgreSQL LISTEN/NOTIFY - [timgit/pg-boss](https://github.com/timgit/pg-boss) + - MIT, JS + - PostgreSQL SKIP LOCKED + - Queueing jobs in Node.js using PostgreSQL like a boss - [breejs/bree](https://github.com/breejs/bree) - - job scheduler + - scheduler with worker threads - [agenda/agenda](https://github.com/agenda/agenda) - mongodb - 独立服务 - Lightweight job scheduling - [kibertoad/toad-scheduler](https://github.com/kibertoad/toad-scheduler) - - [SGrondin/bottleneck](https://github.com/SGrondin/bottleneck) + - MIT, TS + - In-memory Node.js and browser job scheduler + - ~~[SGrondin/bottleneck](https://github.com/SGrondin/bottleneck)~~ - WebSocket - [ws](https://github.com/websockets/ws) - JS 实现 diff --git a/notes/web/nodejs/package.json.md b/notes/web/nodejs/package.json.md index f48300a084b..22f132698fa 100644 --- a/notes/web/nodejs/package.json.md +++ b/notes/web/nodejs/package.json.md @@ -1,5 +1,7 @@ --- title: package.json +files: +- package.json --- # package.json @@ -102,10 +104,13 @@ title: package.json ## exports +- TypeScript 4.7 支持 exports +- TypeScript 5.0 支持 bundler moduleResolution - --conditions,-C - `node --conditions=development index.js` - 运行 node 指定 condition 会根据 condition resolve - 常见类型 + - types - `d.ts` - 一般放在最前面 - import - esm - `import`,`import()` 使用 ECMAScript module loader - 可能 mjs 结尾 - module diff --git a/notes/web/react/react-awesome.md b/notes/web/react/react-awesome.md index cfa30599c49..2f094214c4e 100644 --- a/notes/web/react/react-awesome.md +++ b/notes/web/react/react-awesome.md @@ -456,6 +456,8 @@ npm add date-fns lodash-es react-fast-compare - 12kB/4.7kB - goober 2.5kB/1.3kB - css-in-js alternative + - [iamhosseindhv/notistack](https://github.com/iamhosseindhv/notistack) + - for Material UI - [react-toastify](https://github.com/fkhadra/react-toastify) - 需要 import css - [devbookhq/splitter](https://github.com/devbookhq/splitter) diff --git a/notes/web/script/js/js-awesome.md b/notes/web/script/js/js-awesome.md index 7913b6d8946..d3ac009f3dc 100644 --- a/notes/web/script/js/js-awesome.md +++ b/notes/web/script/js/js-awesome.md @@ -606,6 +606,9 @@ tags: - [bbc/peaks.js](https://github.com/bbc/peaks.js) - LGPLv3, JS - audio waveforms + - [BenzLeung/benz-amr-recorder](https://github.com/BenzLeung/benz-amr-recorder) + - [jpemartins/amr.js](https://github.com/jpemartins/amr.js) + - opencore-amr version 0.1.3 using emscripten - glob - [globby](https://github.com/sindresorhus/globby) - 基于 fast-glob 增加部分功能 diff --git a/notes/web/script/js/js-decorator.md b/notes/web/script/js/js-decorator.md index bdf4f678885..51f34e03181 100644 --- a/notes/web/script/js/js-decorator.md +++ b/notes/web/script/js/js-decorator.md @@ -10,6 +10,40 @@ title: Decorator ::: +- kind + - class + - method + - getter + - setter + - field + - accessor +- `Symbol.annotations` +- 参考 + - [proposal-decorators](https://github.com/tc39/proposal-decorators) + - 2023-08 – TS 5.2 支持 Decorator Metadata + - 2023-05 – Angular v16 + - 2023-03 – Deno 1.32 + - 2023-03 - TS 5.0 + - 2022-09 – Babel 7.19.0. Stage 3 + - 2022-08 – SpiderMonkey 支持 + - 2022-03 – Stage 3 + - 2016-07 – Stage 2 + - 2015-03 – Stage 1 - TS 1.5, --experimentalDecorators + - 2014-04 – Stage 0 + - https://caniuse.com/decorators + - [proposal-decorator-metadata](github.com/tc39/proposal-decorator-metadata) + - TS 5.2 + - [proposal-class-method-parameter-decorators](https://github.com/tc39/proposal-class-method-parameter-decorators) + - [typescript 5.0 decorators](https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#decorators) + - 没有 `--experimentalDecorators` flag + - 也能用 + - 生成逻辑不同 + - 有类型检查 + - 新的逻辑不支持 `--emitDecoratorMetadata` + - [esbuild#104](https://github.com/evanw/esbuild/issues/104) + - [nestjs/nest#11414](https://github.com/nestjs/nest/issues/11414) + - 短时间内还不会支持 + ```js type Decorator = (value: Input, context: { kind: string; @@ -86,25 +120,6 @@ type ClassAutoAccessorDecorator = ( } | void; ``` -- kind - - class - - method - - getter - - setter - - field - - accessor -- `Symbol.annotations` -- [proposal-decorators](https://github.com/tc39/proposal-decorators) - - TS 5.0 -- [proposal-decorator-metadata](github.com/tc39/proposal-decorator-metadata) - - TS 5.2 -- [typescript 5.0 decorators](https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#decorators) - - 没有 `--experimentalDecorators` flag - - 也能用 - - 生成逻辑不同 - - 有类型检查 - - 新的逻辑不支持 `--emitDecoratorMetadata` - ## Typescript legacy ```ts diff --git a/notes/web/script/js/js-version.md b/notes/web/script/js/js-version.md index 0d0c92cdee2..a61b9c73827 100644 --- a/notes/web/script/js/js-version.md +++ b/notes/web/script/js/js-version.md @@ -101,6 +101,10 @@ tags: | `#name` | Chrome74 | Private class fields | | `using` | | Explicit Resource Management | TS 5.2 | +| feat | Version | note | +| ---------- | ------------------ | ---- | +| globalThis | Chrome71, NodeJS12 | + - es5 和 es6 是一个分界线 - 2018 年所有浏览器支持 es6 - 之后统一版本概念变弱 - 都以功能特性为单位 diff --git a/notes/web/web-awesome.md b/notes/web/web-awesome.md index db33db6e179..16365202a3b 100644 --- a/notes/web/web-awesome.md +++ b/notes/web/web-awesome.md @@ -285,6 +285,22 @@ tags: - https://webcode.tools/ - https://github.com/mbrlabs/Lorien - Infinite canvas drawing/whiteboarding app for Windows, Linux and macOS. Made with Godot +- Web Desktop/Web OS + - [HeyPuter/puter](https://github.com/HeyPuter/puter) + - AGPLv3, JS + - Web OS + - https://news.ycombinator.com/item?id=39597030 + - [MercuryWorkshop/anuraOS](https://github.com/MercuryWorkshop/anuraOS) + - AGPLv3, JS + - WebOS + - 支持模拟 Linux + - https://simone.computer/ + - https://github.com/syxanash/awesome-web-desktops +- [BrowserBox/BrowserBox](https://github.com/BrowserBox/BrowserBox) + - AGPLv3, JS + - 在服务端运行 浏览器,嵌入 iframe + - RBI - remote browser isolation +- https://copy.sh/v86/ ## Reference diff --git a/story/2024/2024-03-06-why-alpine.md b/story/2024/2024-03-06-why-alpine.md new file mode 100644 index 00000000000..c8f0fc8e7b7 --- /dev/null +++ b/story/2024/2024-03-06-why-alpine.md @@ -0,0 +1,64 @@ +--- +slug: why-alpine +title: 为什么选择 Alpine Linux? +tags: + - DevOps + - Alpine +--- + +# 为什么选择 Alpine Linux? + +> Small. Simple. Secure. +> +> Alpine Linux is a security-oriented, lightweight Linux distribution based on musl libc and busybox. +> +> Alpine Linux 是一个基于 musl libc 和 busybox, 面向安全, 轻量级的 Linux 发布版. + + + + +## 为什么 + +- 开源 +- 轻量级 + - 最小安装 5MB + - 大部分都是静态链接 + - musl + - openrc +- 稳定滚动升级 + - 有稳定版和最新版 + - 每半年一个稳定版 + - 稳定版会维护两年 + - 可非常简便的升级 +- 简单的包管理 + - APK 本地存储逻辑和结构非常简单 + - APK 仓库逻辑结构简单 - 不同于 deb/rpm + - 包的构建也很简单 - abuild 能够在本地构建包 +- 现代化 + - 内核版本较新 + - 能够利用上很多新内核的功能 + - 包版本比较新 + - 例如 zfs, docker 等都是对应版本的最新版 +- 生态圈丰富 + - 包非常多 + - 兼容良好 +- 支持较多平台 + - x86_64 + - x86 + - aarch64 + - armhf + - ppc64le + - s390x + - armv7 + - riscv64 +- 支持树莓派 +- 很多 docker 镜像基于 AlpineLinux + - Docker For Mac 的基础系统是 AlpineLinux + +## Alpine 的缺点 {#when-not} + +- 文档不够全面 + - Wiki 内容较少, 更新不多 + - 但大多文档可参考 Arch 和 Gentoo +- musl libc 可能有兼容问题, 有时候需要补丁 + - 但越来越多的开发者也都会做兼容了