把一些不太重要,但感兴趣的东西放在这里。


Ubuntu 下搭建 RustDesk 服务器

  1. 安装docker
sudo apt update && sudo apt upgrade -y
curl -fsSL https://get.docker.com | bash -s docker

# 创建工作目录
mkdir -p ~/rustdesk-server && cd ~/rustdesk-server
  1. 编写配置文件

为了安全,我们将默认的 21116 端口改为 30256(你可以自定义)。

创建一个 docker-compose.yml, nano docker-compose.yml

version: '3'

# hbbs 是 ID 服务(类似信令服务器),hbbr 是中继服务(Data Relay)
services:
  hbbs:
    container_name: rdesk-hbbs
    image: rustdesk/rustdesk-server:latest
    # -r 指定中继服务器地址和端口,-k _ 强制使用加密 Key
    command: hbbs -r <你的服务器公网IP或者域名>:30257 -p 30256 -k _
    volumes:
      - ./data:/root
    network_mode: "host"
    restart: unless-stopped

  hbbr:
    container_name: rdesk-hbbr
    image: rustdesk/rustdesk-server:latest
    command: hbbr -p 30257 -k _
    volumes:
      - ./data:/root
    network_mode: "host"
    restart: unless-stopped
  1. 后台启动
docker compose up -d

获取连接密钥: RustDesk 启动后会在 data 目录下生成一对 Ed25519 密钥对。运行以下命令查看公钥

cat data/id_ed25519.pub

记下这串长字符串,这是你客户端连接的唯一凭证 Key。

  1. 测试端口

telnet 你的ip 30256
  1. 客户端安装

设置->网络,填入端口和Ke即可


2026年网络部署

1. 连接远程机器

ssh root@ip_address -p 22

2. 部署脚本

  • 方案选择:VLESS-REALITY, sing-box
  • 解释: VLESS是加密协议; Xray/sing-box是引擎,可以选择不同的协议,路由和规则;Reality是传输层,提升隐蔽和效率。
  • 脚本参考: sing box一键安装脚本, Xray一键安装脚本
bash <(wget -qO- -o- https://gist.githubusercontent.com/crb912/ce8be1f797beda2778e963a0efc47185/raw/free_network_deploy.sh)

运行结果, 类似如下示例:

------------- 链接 (URL) -------------
vless://23879191-cf9b-4ddb-89-43ffd5e2e@112.101.111.111:443?encryption=none&security=reality&flow=xtls-rprx-vision&type=tcp&sni=www.paypal.com&pbk=wYLre3M2342344VCVxh14&fp=chrome#23xxx-reality-112.101.111.111
------------- END -------------

3. 测试是否运行

  1. 打开:https://tcp.ping.pe/
  2. 写上你的 VPS IP和端口,示例:1.1.1.1:443
  3. 运行结果如果是绿色, 类似Connection to 1.1.1.1:443 successful – 11 ms ,那说明安装成功

4. 更改端口

高位端口不安全,改用443端口

sing-box
# 选择2, 更改配置
# 选择2, 更改端口

复制或保存最新的 vless链接。

5. 安装客户端

下载sing-box 或 clash 客户端, https://github.com/xinggaoya/sing-box-windows/releases

苹果或者安卓,各种客户端都可以找到。

6. 订阅转换

vless的协议链接则需要转换成对应客户端支持的格式。网络上有别人提供的在线转换工具,但并不安全;可以将链接里的ip改一下,再转换,再改回来。(这种方式并不优雅。)

更优雅的解决方案,白嫖免费的cloudflare,每天有1万次请求

  1. 在cloudflare 部署worker。 计算和AI -> Workers 和 Pages -> 创建应用程序 -> 编辑代码
  2. 把我的订阅转换的源代码复制到cf。 订阅转换的js源代码(支持clash和sing-box): Works js code
  3. 在 cloudflare 配置存储: 存储和数据库-> Workers KV -> 创建实例 -> 名字填: my_sub_db
  4. 将存储绑定到worker。

打开对应url,测试转换服务能否成功转换。

7. 使用自定义域名

默认的url容易被屏蔽,因此应该购买使用自定义的域名。

域名购买和托管

  1. Spaceship购买一个7位数字的xyz域名。
  2. 点击clouldflare右上角的加号,连接域。
  3. 填写自己买的域名。
  4. “前往继续激活”, CF会给两个域名服务器,比如”jason.ns.cloudflare.com”, “jason.ns.cloudflare.com”
  5. Spaceship的域名设置,买到的数字域名的DNS设置,选择自定义DNS,把CF给的两个地址填写进去。
  6. 在CF上点击 “我已更新域名服务器”

等待域名激活成功

  1. 在DNS-记录的菜单,两个A类型的记录的代理状态(小黄云) 已代理。编辑它,代理状态改成仅DNS。
  2. 把原有非clouldflare的域名根服务器的两条记录删除掉。
  3. 点击CF主页,直到域名的状态不再是红色的错误,“名称服务器无效”
  4. 需要20分钟左右,邮件会有通知:“111111.xyz 现已在 Cloudflare (Free 计划下激活)”, 激活成功。

指向Worker

  1. 点击左侧菜单: 计算和AI -> Workers & Pages -> 点击你的 Worker 名字。
  2. 点击顶部的 Settings (设置) -> 域和路由。
  3. 点击 Add Custom Domain (添加自定义域名)。

输入你想要的二级域名,比如 sub.1139399.xyz。

点击保存。Cloudflare 会自动帮你添加一条 DNS 记录,指向你的 Worker。 后续就可以用自己部署的订阅链接了。


印刷与字体

我需要打印一些文档。为了获得更好的中文印刷质量,我花了一点时间解决这个问题。如果从零考究怎么保证中文印刷的美观, 很可能需要费些更多的心思,然而这不是我的专业和兴趣。因此我走了一个捷径,从我的书籍里面挑选一些印刷精良的书籍 ,关注它们是如何印刷的。模仿的方法,我就能获得不错的印刷效果了。

首先,我想到的译林出版社的《分成两半的子爵》,它的印刷精良。这本书的页面和字体适合印刷中短篇小说(不超过300页),会有很好的阅读体验。经过我的反复测量,该书的具体数据如下:

页面样式:

  • 开本:大32开,纸张实际大小为:140mm*203mm。
  • 页面的边距:左页边距20mm,右页边距22mm
  • 实际的文字内容尺寸:98mm(宽)*135mm(高)

文字:

  • 字体是:方正书宋
  • 字号是 9.5pt
  • 行间距 17pt (字号的1.8倍)

字体的选用

中文字体:

  • 华康黑体W3 电脑屏幕阅读
  • 方正字体 适合小说类读物的印刷

FVWM on Ubuntu 21.04

FVWM(https://www.fvwm.org/) is an ICCCM-compliant multiple virtual desktop window manager for the X Window system. It is configured by editing text-based configuration files.

I’m tired of the endless bugs and updates of the Ubuntu’s default GNOME desktop. Therefore, I switched to FWVM and no longer use GNOME desktop.

I tried FVWM for a few days, and it works very well. I haven’t added some features yet, but it doesn’t matter. I will continue to improve my Fvwm when I have free time. Screenshot of my desktop:

simple desktop.png

Part I: Install fvwm and quick start

Setup 1. Install the FVWM3 package.

Setup 2. Build your ~/.xinitrc file

The xinit program allows a user to manually start an Xorg display server. More details: https://wiki.archlinux.org/title/Xinit

My file ~/.xinitrc is here.

Setup 3. Test and Try basic fvwm configuration

I use the default configuration files in fvwm3/default-config/* as my starting point. So, I copy those configuration files to ~/.fvwm directory with the following command:

# copy fvwm3/default-config github directory to ~/.fvwm.
sudo cp -r /usr/local/share/fvwm3/default-config/* ~/.fvwm

sudo chown -R someuser ~/.fvwm

sudo rm -r /usr/local/share/fvwm3/default-config

If your are running Ubuntu with GNONE, you must logout current Ubuntu session, and Ctrl + Alt + F2. Then:

# Disable gnome display manager.
sudo service gdm3 stop

#  start X
startx

Part II: Build your own fvwm3 .config

You can modify the default .fvwm/config as your first start. Or copy and use my config file directly, then make your personalized twist and changes.

I use nemo as my file manager.

Part III: Switch from Gnome to Fvwm permanently

Setup 1. Disable Gdm

sudo systemctl disable gdm3

Setup 2. Boot with command-line interface:

sudo gedit /etc/default/grub

comment: #GRUB_CMDLINE_LINUX_DEFAULT="quite splash" and add “text”. This:

#GRUB_CMDLINE_LINUX_DEFAULT="quite splash"
GRUB_CMDLINE_LINUX_DEFAULT="text"

Then, sudo update-grub.

Setup 3. Tell systemd to not load the desktop with:

sudo systemctl enable multi-user.target --force
sudo systemctl set-default multi-user.target    

Setup 3. Auto-run startx

add entry to ~/.bash_profile or ~/.zprofile

if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
  exec startx
fi


文本编辑器配置

geany中文乱码,并非由于编码错误,而是字体不支持中文。查看->字体->选择中文不乱码的字体即可。

标记

英语

  1. However most of the issued interrupts are wasted if no timer function is attached to them and occupy the system with a tremendous unnecessary workload. 繁重的

连词

  • Nevertheless 虽然是前面提到的那样,但是…。例句: It shows the case of a multiprocessor board, where the I/O APIC is integrated. Nevertheless, in the case of a uniprocessor system the local APIC exists also on board of the CPU.

奇奇怪怪

  • A porter carries your luggage, whether through a train station or high into the Himalayas.