This commit is contained in:
wenyongda 2025-12-12 09:30:15 +08:00
parent 4224b80991
commit 04faca660a
2 changed files with 177 additions and 3 deletions

View File

@ -3418,4 +3418,99 @@ snap install --classic certbot
ln -s /snap/bin/certbot /usr/bin/certbot
```
### 范
## 安装 frp
### 配置服务端 (frps) 为服务
在公网服务器上部署服务端
创建 Systemd 服务文件
```bash
sudo vim /etc/systemd/system/frps.service
```
写入配置内容
```toml
[Unit]
# 服务描述
Description=FRP Server Daemon
# 在网络服务启动后才启动
After=network.target syslog.target
Wants=network.target
[Service]
Type=simple
# 启动命令:请修改为你的 frps 和配置文件实际路径
ExecStart=/usr/local/frp/frps -c /usr/local/frp/frps.toml
# 退出后自动重启
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target
```
启动并设置开机自启
```bash
# 重载 systemd 配置
sudo systemctl daemon-reload
# 启动 frps 服务
sudo systemctl start frps
# 设置开机自启
sudo systemctl enable frps
# 查看运行状态
sudo systemctl status frps
```
### 配置客户端 (frpc) 为服务
在内网机器上部署客户端
创建 Systemd 服务文件
```bash
sudo vim /etc/systemd/system/frpc.service
```
写入配置内容
```toml
[Unit]
Description=FRP Client Daemon
After=network.target syslog.target
Wants=network.target
[Service]
Type=simple
# 启动命令:请修改为你的 frpc 和配置文件实际路径
ExecStart=/usr/local/frp/frpc -c /usr/local/frp/frpc.toml
# 这里的 restart 非常重要,防止因为断网导致客户端停止运行
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target
```
启动并设置开机自启
```bash
# 重载 systemd 配置
sudo systemctl daemon-reload
# 启动 frpc 服务
sudo systemctl start frpc
# 设置开机自启
sudo systemctl enable frpc
# 查看运行状态
sudo systemctl status frpc
```

View File

@ -688,13 +688,15 @@ source ~/.zshrc
>
## 安装
## 全局
### 安装
```shell
pip install jupyter
```
## 运行
### 运行
```shell
jupyter notebook
@ -702,6 +704,83 @@ jupyter notebook
jupyter notebook --allow-root
```
## Conda 虚拟环境
### 安装
#### 使用 nb_conda_kernels 添加所有环境
```bash
conda activate my-conda-env # this is the environment for your project and code
conda install ipykernel
conda deactivate
conda activate base # could be also some other environment
conda install nb_conda_kernels
jupyter notebook
```
## 配置密码(适用于 Jupyter 7+ / JupyterLab 4+
在 安装有 jupyter 包的终端中运行
```bash
jupyter server password
```
然后按提示输入并确认密码。
Jupyter 会自动将加密后的密码写入配置文件(通常是 `~/.jupyter/jupyter_server_config.json`)。
### 生成并编辑配置文件
**生成配置文件**(如果还没有):
```bash
jupyter notebook --generate-config
```
(对于新版本):
```bash
jupyter server --generate-config
```
**编辑配置文件**(通常是 `~/.jupyter/jupyter_server_config.py``jupyter_notebook_config.py`
```python
c = get_config()
# 允许远程访问
c.ServerApp.ip = '0.0.0.0' # 注意:新版本用 ServerApp 而非 NotebookApp
# 禁用自动打开浏览器
c.ServerApp.open_browser = False
# 设置端口(可选)
c.ServerApp.port = 8888
# (可选)设置工作目录
c.ServerApp.root_dir = '/path/to/your/notebooks'
# (可选)允许通过 token 或密码登录(设了密码后 token 会失效)
c.ServerApp.token = '' # 禁用 token如果已设密码
c.ServerApp.password_required = True
```
> 🔔注意:**Jupyter 新版本中 `NotebookApp` 已被 `ServerApp` 取代**,所以配置项要使用 `c.ServerApp.xxx`
### 启动 Jupyter
```bash
jupyter notebook --ip=0.0.0.0 --port=5600 --no-browser
```
或直接:
```bash
jupyter lab --ip=0.0.0.0 --port=5600 --no-browser
```
# UnSloth
# vLLM