Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add figures to illustrate ssh forwardings #41

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Erchiusx
Copy link

我想干这个事很久了.jpg

为ssh forwarding添加了三幅箭图来说明这些forwarding的功能,
这些quiver由q.uiver.app 生成

@@ -59,46 +59,50 @@ SSH 配置 TCP 端口转发的格式为 `[bind_address:]port:host:hostport`,SS

本地端口转发(**L**ocal port forwarding)

![](E:\erchius\Git\storage\igem\Linux201-docs\docs\images\ssh\local-forward.png)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

: 在本地上监听一个端口,将收到的数据转发到远程主机的指定端口。即**将远程主机上某个服务的端口转发到本地**,使本地的其他程序可以通过 SSH 访问到远程的服务。例如将远程主机的 80 端口转发到本地的 8080:

```shell
ssh -L 8080:localhost:80 example
```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不建议添加多余的 whitespace

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文本建议包裹在 \textrm 里面,而命令包裹在 \texttt 里。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

中英、中文与阿拉伯数字之间需要有空格。

@tiankaima
Copy link
Member

Also if you don't mind, check out https://mermaid.js.org/, a LaTeX PNG probably wouldn't fit here (dark mode, text selection, etc.)

@Erchiusx
Copy link
Author

Also if you don't mind, check out https://mermaid.js.org/, a LaTeX PNG probably wouldn't fit here (dark mode, text selection, etc.)

原来有mermaid插件,感谢提示

@Erchiusx
Copy link
Author

感觉mermaid的准确排版能力还是略有点弱,尝试了半天之后画出来的长这样:
图片

@iBug
Copy link
Member

iBug commented Dec 26, 2024

我觉得这篇 blog 里的图画得更好,考虑直接引用?

https://iximiuz.com/en/posts/ssh-tunnels/

@Erchiusx
Copy link
Author

我觉得这篇 blog 里的图画得更好,考虑直接引用?

https://iximiuz.com/en/posts/ssh-tunnels/

确实,但又回到了那个问题

Also if you don't mind, check out https://mermaid.js.org/, a LaTeX PNG probably wouldn't fit here (dark mode, text selection, etc.)

Though not LaTeX, it still disallow text selection and wont fit in dark mode

@tiankaima
Copy link
Member

我觉得这篇 blog 里的图画得更好,考虑直接引用?
https://iximiuz.com/en/posts/ssh-tunnels/

确实,但又回到了那个问题

Also if you don't mind, check out https://mermaid.js.org/, a LaTeX PNG probably wouldn't fit here (dark mode, text selection, etc.)

Though not LaTeX, it still disallow text selection and wont fit in dark mode

Dark mode and Text selection isn't a must per say. 我最开始在想既然你用 LaTeX 画了那么不如导出一个 SVG 然后 embed 进来,这样会好一点,然后我觉得 Mermaid 完全能做这件事情……

那个 blog 的图画的不错,我个人觉得会比这边 PR 里的图更直观一点,但是 copyright 的问题还是要注意一下。

然后稍等我来研究下 Mermaid 的问题

@iBug
Copy link
Member

iBug commented Dec 26, 2024

其实也可以直接插两张图片,这个主题是有 image auto switch 的支持的

https://squidfunk.github.io/mkdocs-material/reference/images/?h=dark#light-and-dark-mode

@tiankaima
Copy link
Member

flowchart LR
    subgraph A[本地]
        direction TB
        local[程序或用户]
        localhost[主机]

        local --> localhost
    end

    subgraph B[远程]
        direction TB
        remote[主机]
        remoteService[服务]
        remote --> remoteService
    end

    localhost --> remote
    local --> remoteService
Loading

ok 所以 Mermaid 应该是没戏了,文档里写了 Limitation

If any of a subgraph's nodes are linked to the outside, subgraph direction will be ignored. Instead the subgraph will inherit the direction of the parent graph:

考虑画两张图吧,dark mode 下看亮色图片真的不怎么舒服

@Erchiusx Erchiusx marked this pull request as draft December 31, 2024 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants