分类 Linux 下的文章

RustDesk 是一款开源的跨平台远程桌面软件,类似于 TeamViewer 的 UI 样式,但它是完全免费的。

RustDesk 提供了 3 个免费的转发服务器,会根据你的地理位置自动选择最快的,一般使用足够了,如果对安全性有担忧,它们也提供了 server 端应用,可以自建转发服务器。下面就对搭建 server 端做一些介绍。

RustDesk GitHub 主页:https://github.com/rustdesk/rustdesk
RustDesk Server GitHub 主页:https://github.com/rustdesk/rustdesk-server

服务器平台:ubuntu 20.04

阅读全文


joplin 是一款开源笔记应用,全平台适用,支持多种云端同步方式。最近体验了下感觉不错,尤其是可以自行搭建 server 服务端保存数据,适合喜欢管理整个数据流程的人士。下面介绍如何在服务器通过 docker 搭建 joplin server 的方法。

joplin 官网:https://joplinapp.org/
GitHub 主页:https://github.com/laurent22/joplin
各个平台客户端下载:https://joplinapp.org/download/

我的服务器系统平台是 Ubuntu 20.04。

阅读全文


最近在我家里的 Ubuntu 上安装了 jellyfin 媒体中心,发现局域网内播放高码率视频卡顿严重,原因是默认设置的是软解码导致 cpu 负载很高,在设置里可以开启硬件解码,但是配置后发现播放视频会报错:

客户端配置文件存在问题,服务器未发送兼容的媒体格式

看后台 log 日志,发现在 ffmpeg 解码时有如下报错信息:

[AVHWDeviceContext @ 0x558b80b15a80] libva: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[AVHWDeviceContext @ 0x558b80b15a80] Failed to initialise VAAPI connection: -1 (unknown libva error).
Device creation failed: -5.
Failed to set value 'vaapi=va:/dev/dri/renderD128' for option 'init_hw_device': Input/output error
Error parsing global options: Input/output error

阅读全文



最近在测试中发现,通过 systemd service 启动的 python 脚本无法加载系统 bashrc 内定义的环境变量。需要在 uint 中定义自定义环境变量才能生效。

首先建立自定义环境变量文件,如: /etc/env_addon,其中定义需要的环境变量:

ENV1=abcd
ENV2=5678

然后在 unit 的 service 块中加入 EnvironmentFile 指向建立的环境变量文件:

[Unit]
Description=demo
After=network.target nss-lookup.target

[Service]
User=root
EnvironmentFile=/etc/env_addon
ExecStart=/usr/bin/python /path/main.py
Restart=on-failure

[Install]
WantedBy=multi-user.target

重新加载并重启服务:

sudo systemctl daemon-reload
sudo systemctl restart demo.service

如果需要系统的 ~/.bashrc 同时加载这个自定义的环境变量文件,可以在 bashrc 中加入下面内容:

set -a; source /etc/env_addon; set +a

重新加载环境:

source ~/.bashrc

参考链接
Using a user's .bashrc in a systemd service
Using environment variables in systemd units Environment directive