init
Some checks failed
Build / build (push) Has been cancelled
Some checks failed
Build / build (push) Has been cancelled
This commit is contained in:
6
content/_index.md
Normal file
6
content/_index.md
Normal file
@@ -0,0 +1,6 @@
|
||||
+++
|
||||
date = '2025-08-10T11:26:53Z'
|
||||
title = 'Cheatsheet'
|
||||
+++
|
||||
|
||||
Cheatsheet for useful Linux commands
|
||||
4
content/markdown/_index.md
Normal file
4
content/markdown/_index.md
Normal file
@@ -0,0 +1,4 @@
|
||||
+++
|
||||
date = '2025-08-10T12:20:42Z'
|
||||
title = 'Markdown'
|
||||
+++
|
||||
112
content/markdown/markdown-extensions.md
Normal file
112
content/markdown/markdown-extensions.md
Normal file
@@ -0,0 +1,112 @@
|
||||
+++
|
||||
date = '2025-08-10T11:50:12Z'
|
||||
title = 'Markdown Extensions'
|
||||
+++
|
||||
|
||||
## 表格
|
||||
|
||||
```markdown
|
||||
| 表头1 | 表头2 | 表头3 |
|
||||
|---|---|---|
|
||||
| 单元格1 | 单元格2 | 单元格3 |
|
||||
| 单元格4 | 单元格5 | 单元格6 |
|
||||
```
|
||||
|
||||
| 表头1 | 表头2 | 表头3 |
|
||||
|---|---|---|
|
||||
| 单元格1 | 单元格2 | 单元格3 |
|
||||
| 单元格4 | 单元格5 | 单元格6 |
|
||||
|
||||
## 分割线
|
||||
|
||||
```markdown
|
||||
___
|
||||
---
|
||||
***
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 定义
|
||||
|
||||
术语1
|
||||
: 这是术语1的定义。
|
||||
|
||||
术语2
|
||||
: 这是术语2的第一个定义。
|
||||
: 这是术语2的第二个定义。
|
||||
|
||||
```markdown
|
||||
术语1
|
||||
: 这是术语1的定义。
|
||||
|
||||
术语2
|
||||
: 这是术语2的第一个定义。
|
||||
: 这是术语2的第二个定义。
|
||||
```
|
||||
|
||||
## 语法
|
||||
|
||||
```markdown
|
||||
### Header-with {#custom-id}
|
||||
|
||||
~~delete~~
|
||||
|
||||
==highlight==
|
||||
|
||||
H~2~O
|
||||
|
||||
X^2^
|
||||
|
||||
$(x+y)^2=x^2+y^2+2xy$
|
||||
|
||||
:joy:
|
||||
```
|
||||
|
||||
### Header-with {#custom-id}
|
||||
|
||||
~~delete~~
|
||||
|
||||
==highlight==
|
||||
|
||||
H~2~O
|
||||
|
||||
X^2^
|
||||
|
||||
$(x+y)^2=x^2+y^2+2xy$
|
||||
|
||||
:joy:
|
||||
|
||||
## 脚注
|
||||
|
||||
```markdown
|
||||
这是一个有脚注的句子[^1]。
|
||||
|
||||
[^1]: 这是脚注的内容。
|
||||
|
||||
Here's a simple footnote and here's a longer one.[^note]
|
||||
|
||||
[^note]: Here's one with multiple paragraphs and code.
|
||||
```
|
||||
|
||||
这是一个有脚注的句子[^1]。
|
||||
|
||||
[^1]: 这是脚注的内容。
|
||||
|
||||
Here's a simple footnote and here's a longer one.[^note]
|
||||
|
||||
[^note]: Here's one with multiple paragraphs and code.
|
||||
|
||||
## mermaid
|
||||
|
||||
[mermaid](./mermaid.md)
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
A[Start] --> B(Process 1)
|
||||
B --> C{Condition};
|
||||
C -- Yes --> D(Result A)
|
||||
C -- No --> E(Result B)
|
||||
D --> F(End)
|
||||
E --> F
|
||||
```
|
||||
62
content/markdown/mermaid.md
Normal file
62
content/markdown/mermaid.md
Normal file
@@ -0,0 +1,62 @@
|
||||
+++
|
||||
date = '2025-08-10T11:51:03Z'
|
||||
title = 'Mermaid'
|
||||
+++
|
||||
|
||||
<https://mermaid.js.org/intro/>
|
||||
|
||||
```
|
||||
graph LR
|
||||
A --> B --> C
|
||||
A & B --> D
|
||||
D --text--> E
|
||||
D -.- F
|
||||
D ==> G
|
||||
```
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
A --> B --> C
|
||||
A & B --> D
|
||||
D --text--> E
|
||||
D -.- F
|
||||
D ==> G
|
||||
```
|
||||
|
||||
```
|
||||
graph LR
|
||||
默认
|
||||
圆角矩形(圆角矩形)
|
||||
矩形[矩形]
|
||||
棱形{棱形}
|
||||
胶囊([胶囊])
|
||||
子程序[[子程序]]
|
||||
圆柱[(圆柱)]
|
||||
圆形((圆形))
|
||||
六边形{{六边形}}
|
||||
平行四边形[/平行四边形/]
|
||||
反平行四边形[\反平行四边形\]
|
||||
正梯形[/正梯形\]
|
||||
反梯形[\反梯形/]
|
||||
非对称的矩形>非对称的矩形]
|
||||
双圆(((双圆)))
|
||||
```
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
默认
|
||||
圆角矩形(圆角矩形)
|
||||
矩形[矩形]
|
||||
棱形{棱形}
|
||||
胶囊([胶囊])
|
||||
子程序[[子程序]]
|
||||
圆柱[(圆柱)]
|
||||
圆形((圆形))
|
||||
六边形{{六边形}}
|
||||
平行四边形[/平行四边形/]
|
||||
反平行四边形[\反平行四边形\]
|
||||
正梯形[/正梯形\]
|
||||
反梯形[\反梯形/]
|
||||
非对称的矩形>非对称的矩形]
|
||||
双圆(((双圆)))
|
||||
```
|
||||
4
content/ssh/_index.md
Normal file
4
content/ssh/_index.md
Normal file
@@ -0,0 +1,4 @@
|
||||
+++
|
||||
date = '2025-08-10T11:30:43Z'
|
||||
title = 'SSH'
|
||||
+++
|
||||
24
content/ssh/port-forwarding.md
Normal file
24
content/ssh/port-forwarding.md
Normal file
@@ -0,0 +1,24 @@
|
||||
+++
|
||||
date = '2025-08-10T11:55:59Z'
|
||||
title = 'Port Forwarding'
|
||||
+++
|
||||
|
||||
- `-L` 本地转发(本地访问远程)
|
||||
- `-R` 远程转发(远程访问本地,如clash)
|
||||
|
||||
```pseudo-shell
|
||||
ssh -R <remote_listen_port>:<local_host>:<local_port> <user>@<ssh_server>
|
||||
ssh -L [<local_listen_host>]:<local_listen_port>:<remote_host>:<remote_port> <user>@<ssh_server>
|
||||
```
|
||||
|
||||
<shell-commands-builder-component
|
||||
command="ssh -R ${REMOTE_LISTEN_PORT}:${LOCAL_HOST:-localhost}:${LOCAL_PORT} ${SSH_HOST} ${COMMAND}"
|
||||
variables='[{"name":"REMOTE_LISTEN_PORT","default":"7890"},{"name":"LOCAL_HOST","default":"localhost"},{"name":"LOCAL_PORT","default":"7890"},{"name":"SSH_HOST","required":true},{"name":"COMMAND","default":"sleep infinity"}]'>
|
||||
</shell-commands-builder-component>
|
||||
|
||||
---
|
||||
|
||||
<shell-commands-builder-component
|
||||
command="ssh -L ${LOCAL_LISTEN_PORT}:${REMOTE_HOST:-localhost}:${REMOTE_PORT} ${SSH_HOST} ${COMMAND}"
|
||||
variables='[{"name":"LOCAL_LISTEN_PORT","default":"8080"},{"name":"REMOTE_HOST","default":"localhost"},{"name":"REMOTE_PORT","default":"80"},{"name":"SSH_HOST","required":true},{"name":"COMMAND","default":"sleep infinity"}]'>
|
||||
</shell-commands-builder-component>
|
||||
23
content/ssh/ssh-via-gpg.md
Normal file
23
content/ssh/ssh-via-gpg.md
Normal file
@@ -0,0 +1,23 @@
|
||||
+++
|
||||
date = '2025-08-10T11:36:00Z'
|
||||
title = 'SSH via GPG'
|
||||
+++
|
||||
|
||||
## get gpg key grip
|
||||
|
||||
<shell-commands-builder-component
|
||||
command="gpg -k --with-keygrip">
|
||||
</shell-commands-builder-component>
|
||||
|
||||
## enable ssh auth
|
||||
|
||||
<shell-commands-builder-component
|
||||
command="gpg-connect-agent 'keyattr $1 Use-for-ssh: true' /bye"
|
||||
variables='[{"position":1,"required":true}]'>
|
||||
</shell-commands-builder-component>
|
||||
|
||||
## enable ssh agent
|
||||
|
||||
<shell-commands-builder-component
|
||||
command="echo 'export SSH_AUTH_SOCK=/run/user/1000/gnupg/S.gpg-agent.ssh' >> ~/.bashrc">
|
||||
</shell-commands-builder-component>
|
||||
15
content/ssh/sshd.md
Normal file
15
content/ssh/sshd.md
Normal file
@@ -0,0 +1,15 @@
|
||||
+++
|
||||
date = '2025-08-10T12:13:32Z'
|
||||
title = 'sshd'
|
||||
+++
|
||||
|
||||
<shell-commands-builder-component
|
||||
command="cat << EOF > /etc/ssh/sshd_config.d/security.conf
|
||||
PermitRootLogin no
|
||||
PubkeyAuthentication yes
|
||||
PasswordAuthentication no
|
||||
Port $SSH_LISTEN_PORT
|
||||
EOF
|
||||
systemctl restart sshd"
|
||||
variables='[{"name":"SSH_LISTEN_PORT","default":"22"}]'>
|
||||
</shell-commands-builder-component>
|
||||
39
content/util/regex.md
Normal file
39
content/util/regex.md
Normal file
@@ -0,0 +1,39 @@
|
||||
+++
|
||||
date = '2025-08-10T12:37:16Z'
|
||||
title = '正则'
|
||||
+++
|
||||
|
||||
## 原子组
|
||||
|
||||
不回溯
|
||||
|
||||
```regex
|
||||
(?>...)
|
||||
```
|
||||
|
||||
## 占有量词
|
||||
|
||||
不回溯
|
||||
|
||||
```regex
|
||||
.*+
|
||||
.++
|
||||
.?+
|
||||
```
|
||||
|
||||
## 详细模式(Verbose Mode / Free-Spacing Mode)
|
||||
|
||||
```python
|
||||
regex_verbose = r"""
|
||||
^ # 匹配字符串开头
|
||||
(\d{4}) # 捕获四位数的年份
|
||||
- # 匹配连字符
|
||||
(\d{2}) # 捕获两位数的月份
|
||||
- # 匹配连字符
|
||||
(\d{2}) # 捕获两位数的日期
|
||||
$ # 匹配字符串结尾
|
||||
"""
|
||||
|
||||
date_string = "2023-10-26"
|
||||
match = re.match(regex_verbose, date_string, re.VERBOSE)
|
||||
```
|
||||
30
content/util/tar.md
Normal file
30
content/util/tar.md
Normal file
@@ -0,0 +1,30 @@
|
||||
+++
|
||||
date = '2025-08-10T12:31:42Z'
|
||||
title = 'tar'
|
||||
+++
|
||||
|
||||
<shell-commands-builder-component
|
||||
command="tar czf $ARCHIVE_NAME.tgz $FILES"
|
||||
variables='[{"name":"ARCHIVE_NAME","default":"archive"},{"name":"FILES","required":true}]'>
|
||||
</shell-commands-builder-component>
|
||||
|
||||
---
|
||||
|
||||
<shell-commands-builder-component
|
||||
command="tar cJf $ARCHIVE_NAME.tar.xz $FILES"
|
||||
variables='[{"name":"ARCHIVE_NAME","default":"archive"},{"name":"FILES","required":true}]'>
|
||||
</shell-commands-builder-component>
|
||||
|
||||
---
|
||||
|
||||
<shell-commands-builder-component
|
||||
command="tar cjf $ARCHIVE_NAME.tar.bz2 $FILES"
|
||||
variables='[{"name":"ARCHIVE_NAME","default":"archive"},{"name":"FILES","required":true}]'>
|
||||
</shell-commands-builder-component>
|
||||
|
||||
---
|
||||
|
||||
<shell-commands-builder-component
|
||||
command="tar --zstd -cf $ARCHIVE_NAME.tar.zst $FILES"
|
||||
variables='[{"name":"ARCHIVE_NAME","default":"archive"},{"name":"FILES","required":true}]'>
|
||||
</shell-commands-builder-component>
|
||||
4
content/vm/_index.md
Normal file
4
content/vm/_index.md
Normal file
@@ -0,0 +1,4 @@
|
||||
+++
|
||||
date = '2025-08-10T12:20:23Z'
|
||||
title = 'VM'
|
||||
+++
|
||||
10
content/vm/bbr.md
Normal file
10
content/vm/bbr.md
Normal file
@@ -0,0 +1,10 @@
|
||||
+++
|
||||
date = '2025-08-10T12:11:46Z'
|
||||
title = 'BBR'
|
||||
+++
|
||||
|
||||
<shell-commands-builder-component
|
||||
command='echo "net.core.default_qdisc=fq" >>/etc/sysctl.conf
|
||||
echo "net.ipv4.tcp_congestion_control=bbr" >>/etc/sysctl.conf
|
||||
sysctl -p'>
|
||||
</shell-commands-builder-component>
|
||||
Reference in New Issue
Block a user