Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wenerme committed Apr 23, 2024
1 parent 3eb28b5 commit 20f217c
Show file tree
Hide file tree
Showing 36 changed files with 1,253 additions and 567 deletions.
52 changes: 46 additions & 6 deletions notes/db/relational/postgresql/postgresql-datatype.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,53 @@ title: 数据类型

# Postgres 数据类型

- [Data Types](https://www.postgresql.org/docs/current/datatype.html)
| type | alias | desc |
| -----------------------------------: | ---------------- | ------------------------------------------ |
| bigint | int8 | 有符号的八字节整数 |
| bigserial | serial8 | 自增的八字节整数 |
| `bit[(n)]` | | 固定长度的位串 |
| `bit varying[(n)]` | `varbit[(n)]` | 可变长度的位串 |
| boolean | bool | 逻辑布尔值(真/假) |
| box | | 平面上的矩形框 |
| bytea | | 二进制数据(“字节数组”) |
| `character[(n)]` | `char[(n)]` | 固定长度的字符串 |
| `character varying[(n)]` | `varchar[(n)]` | 可变长度的字符串 |
| cidr | | IPv4或IPv6网络地址 |
| circle | | 平面上的圆 |
| date | | 日历日期(年,月,日) |
| double precision | float8 | 双精度浮点数(8字节) |
| inet | | IPv4或IPv6主机地址 |
| integer | int, int4 | 有符号的四字节整数 |
| `interval [ fields ][(p)]` | | 时间跨度 |
| json | | 文本JSON数据 |
| jsonb | | 二进制JSON数据,解构后的 |
| line | | 平面上的无限线 |
| lseg | | 平面上的线段 |
| macaddr | | MAC(媒体访问控制)地址 |
| macaddr8 | | MAC(媒体访问控制)地址(EUI-64格式) |
| money | | 货币金额 |
| `numeric[(p,s)]` | `decimal[(p,s)]` | 可选择精度的精确数字 |
| path | | 平面上的几何路径 |
| pg_lsn | | PostgreSQL日志序列号 |
| pg_snapshot | | 用户级事务ID快照 |
| point | | 平面上的几何点 |
| polygon | | 平面上的封闭几何路径 |
| real | float4 | 单精度浮点数(4字节) |
| smallint | int2 | 有符号的两字节整数 |
| smallserial | serial2 | 自增的两字节整数 |
| serial | serial4 | 自增的四字节整数 |
| text | | 可变长度的字符串 |
| `time[(p)] [without time zone]` | | 时间(无时区) |
| `time[(p)] with time zone` | timetz | 包含时区的时间 |
| `timestamp[(p)] [without time zone]` | | 日期和时间(无时区) |
| `timestamp[(p)] with time zone` | timestamptz | 包含时区的日期和时间 |
| tsquery | | 文本搜索查询 |
| tsvector | | 文本搜索文档 |
| ~~txid_snapshot~~ | | 用户级事务ID快照(已弃用;见 pg_snapshot) |
| uuid | | 通用唯一标识符 |
| xml | | XML数据 |

| type |
| ---------------- |
| smallint,int2 |
| integer,int,int4 |
| bigint,int8 |
- [Data Types](https://www.postgresql.org/docs/current/datatype.html)

## UUID

Expand Down
5 changes: 5 additions & 0 deletions notes/db/relational/postgresql/postgresql-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ title: PostgreSQL JSON
- https://bitnine.net/blog-postgresql/postgresql-internals-jsonb-type-and-its-indexes/

```sql
-- json null 不是 null
select 'null'::jsonb is null;
-- 通过 typeof 判断类型
select jsonb_typeof('null'::jsonb) = 'null';

-- 数组移除 null
select jsonb_path_query_array('{"values": [null, "test", { "key": "value" }]}', '$.values[*] ? (@ != null)');

Expand Down
28 changes: 28 additions & 0 deletions notes/dev/design/design-erp.md
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,34 @@ interface GeneralResource {
| ^ | Completed | Completed |
| ^ | Canceled | Canceled |

**Invoice**

Invoice Status for Sales

| Status | Label | Desc |
| --------- | ------ | ----------------------------------------------------------------------------------- |
| Sent | 已发送 | 发票已发送给客户 |
| Paid | 已支付 | 客户已支付发票 |
| Overdue | 逾期 | 发票已超过付款日期且客户尚未支付 |
| Void | 作废 | 如果发票开具错误,你可以将其作废。客户无法支付已作废的发票。 |
| Write Off | 核销 | 只有当你确信客户欠款无法收回时,你才可以对发票进行坏账核销。 |
| Draft | 草稿 | 你已创建一张未完成的发票,并且它尚未发送给客户。Zoho Billing 无法生成任何草稿发票。 |

Invoice Status for Accounting

| State | Status | Label | Desc |
| --------- | --------------- | ------ | -------------------------------------------------------------------------------- |
| Active | Draft | 草稿 | 发票已创建但尚未最终审核或发送。这一状态用于初步录入和编辑发票信息。 |
| ^ | PendingApproval | 待审批 | 发票已提交审批流程,等待相关管理者或会计审核。这是确保发票准确无误的关键步骤。 |
| ^ | Approved | 已审批 | 发票已经过审批,等待进一步的处理,如记账或支付。 |
| ^ | Paid | 已支付 | 发票已结清款项,表明客户已完成支付,会计处理完毕。 |
| Completed | Posted | 已过账 | 发票的财务数据已经被记入总账,此状态表明发票已经在会计记录中正式体现其经济效果。 |
| Cancelled | Cancelled | 已取消 | 发票在完成所有必要流程前被取消,不再适用或有效,不需进一步操作。 |
| ^ | Written-Off | 已核销 | 发票因确定无法收回款项而被标记为已支付,处理为坏账。 |
| ^ | Void | 作废 | 如果发票因错误或其他原因被取消,使用作废状态来确保其不会影响财务记录。 |

- https://www.zoho.com/au/billing/kb/invoices/

## 银行卡 vs 银行账户

- 银行账户
Expand Down
11 changes: 11 additions & 0 deletions notes/dev/format/har.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ title: HTTP Archive format

# har


:::tip

- Chrome 导出包含了 Websocket 等信息,需要自行处理

:::

- har - HTTP Archive format
- by W3C
- **abandoned**
Expand All @@ -21,6 +28,10 @@ title: HTTP Archive format
- k6 - 记录 HTTP 请求
- http://www.softwareishard.com/blog/har-adopters/
- 参考
- https://toolbox.googleapps.com/apps/har_analyzer/
- 不会显示 _initiator, _webSocketMessages
- _resourceType=websocket
- http://www.softwareishard.com/blog/har-12-spec/
- [Everettss/puppeteer-har](https://github.com/Everettss/puppeteer-har)
- 可用于
- 记录 HTTP 请求
Expand Down
39 changes: 39 additions & 0 deletions notes/dev/hexdump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: hexdump
---

# hexdump

- 参考
- wikipedia [Hex dump](https://en.wikipedia.org/wiki/Hex_dump)

**Chrome Websocket binary dump**

```
00000000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
```

**hexdump -C**

```bash
echo -n 0123456789ABCDEF | hexdump -C
```

```
00000000 30 31 32 33 34 35 36 37 38 39 41 42 43 44 45 46 |0123456789ABCDEF|
```

| hexdump | for |
| -------------- | ---------------- |
| -b | 1 字节 |
| -c | 1 字符 |
| -d | 2 字节 |
| -o | 2 八进制 |
| -x | 2 十六进制 |
| `-C` | 显示 ASCII |
| `-c` | 显示 ASCII 字符 |
| -n LENGTH | 显示字节数 |
| -s OFFSET | 跳过字节数 |
| `-v` | 不显示重复行 |
| -e FORMAT | 格式化输出 |
| -f FORMAT_FILE | 从文件读取格式化 |
6 changes: 6 additions & 0 deletions notes/devops/concept/latency.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ title: 延迟数
| 过长响应 | > 1000ms | **用户会感到延迟** |
| VoIP | 150ms - 300ms | 语音通话 |

| debounce | for |
| ---------: | ------------------------------- |
| 100-200ms | UI元素的交互 - 滑块、拖动 |
| 200-500ms | 轻量级的用户输入 - 搜索触发请求 |
| 500-1000ms | 数据密集型的操作 - 实时数据校验 |

## Latency Comparison Numbers ~ 2012

- Interactive [Latency Numbers Every Programmer Should Know](https://colin-scott.github.io/personal_website/research/interactive_latency.html)
Expand Down
3 changes: 3 additions & 0 deletions notes/devops/devops-awesome.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ tags:
- [Normation/rudder](https://github.com/Normation/rudder)
- GPLv3, Scala
- configuration and security automation platform
- WebUI
- https://www.webmin.com
- http://phpdhcpadmin.sourceforge.net/

## Reading

Expand Down
8 changes: 8 additions & 0 deletions notes/devops/telementry.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,11 @@ User-Agent: "Open Policy Agent/v0.12.3 (darwin, amd64)"
```toml
disableTelemetry=true
```

## juicefs

```bash
juicefs --no-usage-report
```

- https://github.com/juicedata/juicefs/blob/main/pkg/usage/usage.go
32 changes: 24 additions & 8 deletions notes/economics/accounting/accounting-glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ tags:

# Accounting Glossary

| abbr. | stand for | mean | note |
| ----- | --------------------------- | -------------- | ------------------------------------------ |
| CPA | Certified Public Accountant | 注册会计师 |
| TA | | 税务师 |
| IRS | Internal Revenue Service | 美国国家税务局 | https://www.irs.gov/ |
| IRC | Internal Revenue Code | 美国国内税收法 | https://www.law.cornell.edu/uscode/text/26 |
| COA | Chart of Accounts | 会计科目表 |
| abbr. | stand for | mean | note |
| ----- | ------------------------------ | -------------- | ------------------------------------------------------------------------------------------- |
| CPA | Certified Public Accountant | 注册会计师 |
| TA | | 税务师 |
| IRS | Internal Revenue Service | 美国国家税务局 | https://www.irs.gov/ |
| IRC | Internal Revenue Code | 美国国内税收法 | https://www.law.cornell.edu/uscode/text/26 |
| COA | Chart of Accounts | 会计科目表 |
| TIN | Taxpayer Identification Number | 纳税人识别号 | https://www.irs.gov/individuals/international-taxpayers/taxpayer-identification-numbers-tin |

| abbr. | stand for | mean |
| ------- | ------------------------------------------------------ | -------------------- |
Expand All @@ -34,7 +35,22 @@ tags:
| Closing the books | 结账 |
| Accounting Set | 账套 |
| Accounting Book | 账簿 |

| Standard Entry | 蓝字 |
| Reversal Entry | 红字/红冲 |
| Credit Note | 贷项通知单 |
| Adjusting Entry | 红字 |
| Void | 作废 |
| Write Off | 冲销、坏账核销 |

- Credit Note
- 特指因商品退货或服务取消而发出的,与原销售发票相抵销的凭证。这通常用于销售和商业环境中。
- Void Invoice
- 不删除,而是标记为作废
- 不会影响发票编号序列
- 可重新 Open/未结 让客户支付
- Write Off
- 无法收回的特定发票
- 操作后发票变为 Paid
- EBITA
- 会计期间 - Accounting Period/Fiscal Period - 会计分期
- 对于经济活动做定期整理、汇存。
Expand Down
16 changes: 8 additions & 8 deletions notes/evolve/accounting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ id: accounting

| 日期 | 事项 |
| ------------------------ | -------------------- |
| 2022 01-05 - 01-24 14:00 | 初级、高级报名缴费 |
| 2022 04-08 | 初级、高级准考证打印 |
| 2022 05-07 | 高级资格考试 |
| 2022 05-07 - 05-11 | 初级资格考试 |
| 2022 05-14 - 05-15 | 初级资格考试 |
| 2022-01-05 - 01-24 14:00 | 初级、高级报名缴费 |
| 2022-04-08 | 初级、高级准考证打印 |
| 2022-05-07 | 高级资格考试 |
| 2022-05-07 - 05-11 | 初级资格考试 |
| 2022-05-14 - 05-15 | 初级资格考试 |

> 考试时间 8:30-11:30,14:30-17:30
**中级**

| 日期 | 时间 | 科目 |
| ------------------------ | ------------ | ------------ |
| 2022 03-10 - 03-31 14:00 | | 中级报名缴费 |
| 2022 08-10 | | 准考证打印 |
| 2022 09-03 - 09-05 | 8:30-11:15 | 中级会计实务 |
| 2022-03-10 - 03-31 14:00 | | 中级报名缴费 |
| 2022-08-10 | | 准考证打印 |
| 2022-09-03 - 09-05 | 8:30-11:15 | 中级会计实务 |
| ^ | 13:30-15:45 | 财务管理 |
| ^ | 18:00-20:00 | 经济法 |
| 2022-10-20 | | 成绩公布 |
Expand Down
45 changes: 27 additions & 18 deletions notes/google/README.md → notes/platform/google/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
---
title: Google
---

# Google

* [Nik collection](https://www.google.com/nikcollection/)
* 图像处理套件
* Photoshop 插件
* [Nik Software](https://en.wikipedia.org/wiki/Nik_Software)
- https://www.google.com/ncr
- No Country Redirect
- [Nik collection](https://www.google.com/nikcollection/)
- 图像处理套件
- Photoshop 插件
- [Nik Software](https://en.wikipedia.org/wiki/Nik_Software)

## Cloud service
* [GCP](https://cloud.google.com/)
* [CLOUD SPEECH API](https://cloud.google.com/speech/)
* [CLOUD VISION API](https://cloud.google.com/vision/)

- [GCP](https://cloud.google.com/)
- [CLOUD SPEECH API](https://cloud.google.com/speech/)
- [CLOUD VISION API](https://cloud.google.com/vision/)

## Photo
* [](https://developers.google.com/picasa-web/docs/3.0/developers_guide_protocol)

- [](https://developers.google.com/picasa-web/docs/3.0/developers_guide_protocol)

## Driver

https://github.com/dsoprea/GDriveFS

```bash
Expand All @@ -37,21 +46,21 @@ rec -r 16000 -c 1 record.flac
wget -q --post-file record.flac --header="Content-Type: audio/x-flac; rate=16000" -O - "https://www.google.com/speech-api/v2/recognize?client=chromium&lang=en_US&key=AIzaSyAcalCzUvPmmJ7CZBFOEWx2Z1ZSn4Vs1gg"

wget -q -U Mozilla -O output.mp3 "http://translate.google.com/translate_tts?ie=UTF-8&total=1&idx=0&textlen=32&client=tw-ob&q=你好么&tl=zh_CN"

```

## Search

[HN - spinner](https://news.ycombinator.com/item?id=13476939)

* 计时器 [timer](https://www.google.com/search?q=timer)
* 节拍器 [metronome](https://www.google.com/search?q=metronome)
* 随机数 [random number between 5 and 55](https://www.google.com/search?q=random%20number%20between%205%20and%2055)
* 轮盘 [spinner](https://www.google.com/search?q=spinner)
* 玩纸牌 [solitaire](https://www.google.com/search?q=solitaire)
* 绘图 [3*cos(sqrt(x*x+y*y))+5](https://www.google.com/search?q=3*cos(sqrt(x*x%2By*y))%2B5)
* [Manage calculator, unit converter & color codes](https://support.google.com/websearch/answer/3284611)
- 计时器 [timer](https://www.google.com/search?q=timer)
- 节拍器 [metronome](https://www.google.com/search?q=metronome)
- 随机数 [random number between 5 and 55](https://www.google.com/search?q=random%20number%20between%205%20and%2055)
- 轮盘 [spinner](https://www.google.com/search?q=spinner)
- 玩纸牌 [solitaire](https://www.google.com/search?q=solitaire)
- 绘图 [3*cos(sqrt(x*x+y\*y))+5](<https://www.google.com/search?q=3*cos(sqrt(x*x%2By*y))%2B5>)
- [Manage calculator, unit converter & color codes](https://support.google.com/websearch/answer/3284611)

## Calender
* 农历
* http://www.google.com/calendar/ical/ug2j3l2nqq7uch3m9n0pm5t2lo@group.calendar.google.com/public/basic.ics

- 农历
- http://www.google.com/calendar/ical/ug2j3l2nqq7uch3m9n0pm5t2lo@group.calendar.google.com/public/basic.ics
7 changes: 4 additions & 3 deletions notes/platform/nordvpn.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ sudo apk add jq yq fping
curl -o countries.json https://api.nordvpn.com/v1/servers/countries
curl -s https://api.nordvpn.com/v1/servers/countries | jq -r '[.[].name] | sort | unique | .[]'

curl -sfL https://nordvpn.com/api/server | jq > server.json
curl -sfL 'https://api.nordvpn.com/v1/servers?limit=9999999' | jq > server.json
yq '[ .[] | select (.features.socks) | pick(["domain","load","name","country"])] ' server.json
yq '[ .[] | select (.features.proxy_ssl) | pick(["country","domain","ip_address","load"]) | select(.country | contains("Korea","Hong","Japan"))] | sort_by(.domain) ' server.json

Expand All @@ -133,8 +133,9 @@ openssl s_client -connect 5.253.207.203:89
curl -x https://$USERNAME:$PASSWORD@at80.nordvpn.com:89 icanhazip.com
```

- https://nordvpn.com/api/server
- https://nordvpn.com/api/server/stats
- 废弃 https://support.nordvpn.com/hc/en-us/articles/21586950310801
- https://nordvpn.com/api/server
- https://nordvpn.com/api/server/stats
- `https://api.nordvpn.com/v1/servers?limit=9999999`
- https://api.nordvpn.com/v1/servers/countries

Expand Down

0 comments on commit 20f217c

Please sign in to comment.