<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"><channel><title>MagicLen</title><link>https://magiclen.org/cn/2020/09/</link><description>多元化原创文章，内容包罗万象，有编程语言、网站应用、软件介绍、硬件介绍、操作系统、旅行游记、专题采访、益智问题、文学创作，以及作者们的知识分享和作品分享。</description><language>zh-CN</language><lastBuildDate>Mon, 23 Nov 2026 03:35:56 +0800</lastBuildDate><atom:link href="https://magiclen.org/cn/2020/09/feed/" rel="self" type="application/rss+xml"/><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>8</sy:updateFrequency><sy:updateBase>1970-01-01T00:00+00:00</sy:updateBase><item><title>Rust 编程语言如何处理动态歌词(LyRiCs)？</title><link>https://magiclen.org/cn/lrc/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png 1x, https://magiclen.org/wp-content/uploads/2018/04/rust-440x324.png 2x, https://magiclen.org/wp-content/uploads/2018/04/rust-660x486.png 3x" alt>
LyRiCs (LRC)是一种数据格式，借由在每行歌词上加上时间戳记(timestamp)，来让音乐播放器可以在播放音乐的同时，同步将该时间点的歌词显示出来。笔者以前用 Java 实作过 MP3 标签格式 ID3 和 APE 的函数库，主要就是为了能够处理动态歌词。虽然现在没什么在用，但还是整理了以前写过的代码，将动态歌词的部份重新用 Rust 编程语言独立实作出来。]]></description><category>Rust</category><category>歌词</category><category>Rust</category><category>lrc</category><guid>https://magiclen.org/cn/lrc</guid><pubDate>Tue, 29 Sep 2020 20:00:17 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>Rust 编程语言如何运行系统的指令或是外部可可执行文件案？</title><link>https://magiclen.org/cn/execute/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png 1x, https://magiclen.org/wp-content/uploads/2018/04/rust-440x324.png 2x, https://magiclen.org/wp-content/uploads/2018/04/rust-660x486.png 3x" alt>
在设计程序的时候偶尔会需要依靠系统指令或是其它的程序来取得一些相关的消息，或是进行一些特殊的处理，如查看系统的网卡界面，或是调用 FFmpeg 来实现影音编码的格式转换。虽然这些工作基本上都可以靠 Rust 原生程序来自行实作，或是引用其它 C/C++ 函数库，但既然有已存在的指令和可执行文件可以用，能省下许多开发时间，何不去用呢？]]></description><category>研究分享</category><category>Rust</category><category>Rust</category><category>execute</category><guid>https://magiclen.org/cn/execute</guid><pubDate>Thu, 24 Sep 2020 20:00:24 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>Rust 编程语言如何在「trim」一个字符串的同时去改变该字符串？</title><link>https://magiclen.org/cn/trim-in-place/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png 1x, https://magiclen.org/wp-content/uploads/2018/04/rust-440x324.png 2x, https://magiclen.org/wp-content/uploads/2018/04/rust-660x486.png 3x" alt>
Rust 编程语言的 String 对象有提供「trim」方法，可以用来去除字符串头尾的空白字符，不过这个方法会回传字符串切片(&#38;str)，而不会去更动到原来的 String 对象。不过在少数情况下，我们还是希望原来的 String 对象可以真正被「trim」。]]></description><category>Rust</category><category>Rust</category><category>trim-in-place</category><guid>https://magiclen.org/cn/trim-in-place</guid><pubDate>Tue, 22 Sep 2020 20:00:00 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>用「async / .await」撰写 Rust 并发程序</title><link>https://magiclen.org/cn/rust-async-await/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png 1x, https://magiclen.org/wp-content/uploads/2018/04/rust-440x324.png 2x, https://magiclen.org/wp-content/uploads/2018/04/rust-660x486.png 3x" alt>
用「async / await」语法来撰写并发与并进程式是现代编程语言流行的方式，比起传统打开新的线程来完成并发处理工作的目的，「async / await」可以在同一个线程下达到同样的目的，非常适用于当并发处理的工作并不重的时候，能够省下创建线程所产生的开支(overhead)。]]></description><category>研究分享</category><category>Rust</category><category>Rust</category><category>async/await</category><category>smol</category><category>async-std</category><category>tokio</category><guid>https://magiclen.org/cn/rust-async-await</guid><pubDate>Thu, 17 Sep 2020 20:00:14 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>如何用 FFmpeg 将连续的图片转成视频？</title><link>https://magiclen.org/cn/ffmpeg-image-sequence-encode/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2016/01/shot-06-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2016/01/shot-06-220x162.png 1x, https://magiclen.org/wp-content/uploads/2016/01/shot-06-440x324.png 2x, https://magiclen.org/wp-content/uploads/2016/01/shot-06-660x486.png 3x" alt>
用 FFmpeg 将连续的图片转成视频时，要依图片文件名是连续编号、经过字典排序还是完全无顺序，分别使用「%d」文件名格式、「-pattern_type glob」或「-f concat」参数来串接。这篇文章也会说明「-r」参数放在「-i」参数前后对视频长度与帧率的影响。]]></description><category>研究分享</category><category>软件介绍</category><category>FFmpeg</category><category>影音</category><category>图像处理</category><guid>https://magiclen.org/cn/ffmpeg-image-sequence-encode</guid><pubDate>Tue, 15 Sep 2020 12:00:25 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>如何清除 Nginx 的反向代理缓存和 FastCGI 缓存？</title><link>https://magiclen.org/cn/nginx-cache-purge/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2020/09/sweep-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2020/09/sweep-220x162.png 1x, https://magiclen.org/wp-content/uploads/2020/09/sweep-440x324.png 2x, https://magiclen.org/wp-content/uploads/2020/09/sweep-660x486.png 3x" alt>
Nginx 是一个免费开源且稳定高效的 Web 服务器程序，拥有反向代理以及负载平衡的功能，经常作为最前端的服务器。当它用作反向代理服务器或是 PHP 网页服务器时，无论是「proxy_pass」还是「fastcgi_pass」，均有提供缓存的功能。然而，免费版本的 Nginx 并没有内置删除缓存的机制（官方的「proxy_cache_purge」、「fastcgi_cache_purge」命令可...]]></description><category>作品分享</category><category>网络相关</category><category>软件介绍</category><category>Linux</category><category>Lua</category><category>Nginx</category><category>Rust</category><category>nginx-cache-purge</category><category>curl</category><guid>https://magiclen.org/cn/nginx-cache-purge</guid><pubDate>Thu, 10 Sep 2020 12:00:44 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>如何用 Rust 编程语言取得 Linux 的系统信息？</title><link>https://magiclen.org/cn/m-prober-lib/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png 1x, https://magiclen.org/wp-content/uploads/2018/04/rust-440x324.png 2x, https://magiclen.org/wp-content/uploads/2018/04/rust-660x486.png 3x" alt>
取得运行环境的操作系统信息是开发软件时经常会需要被实作的功能，Rust 作为一个系统级的编程语言，对于这部份自然会有许多解决方案。不过也由于 Rust 编程语言跨操作系统，因此许多取得系统信息的套件也会以跨平台支持为主，这就导致取得到的信息可能过于低级、不够充份或是不统一，使得开发者还需要自行撰写程序将零散的信息处理为一般人习惯阅读的格式。又或者取得系统信息的方式是依靠系统中提供的指令工具，使得程...]]></description><category>研究分享</category><category>Rust</category><category>Rust</category><category>mprober</category><category>探针</category><category>mprober-lib</category><guid>https://magiclen.org/cn/m-prober-lib</guid><pubDate>Tue, 8 Sep 2020 20:00:16 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>Rust 编程语言如何将定数于编译阶段时串接成字符串？</title><link>https://magiclen.org/cn/concat-with/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png 1x, https://magiclen.org/wp-content/uploads/2018/04/rust-440x324.png 2x, https://magiclen.org/wp-content/uploads/2018/04/rust-660x486.png 3x" alt>
Rust 编程语言强大的编译器可以让它在编译阶段时就去做完许多其它编程语言在运行阶段才能进行的工作，像是 Rust 的标准函数库，就有提供一个「concat」宏，可以将任意数量定数(literal)直接串接成生命周期为「&#39;static」的字符串切片(&#38;&#39;static str)]]></description><category>Rust</category><category>Rust</category><category>concat-with</category><guid>https://magiclen.org/cn/concat-with</guid><pubDate>Thu, 3 Sep 2020 20:00:02 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>使用 Ubuntu Server 架设 FTP 服务器(vsftpd + xinetd + PAM + SSL/TLS)</title><link>https://magiclen.org/cn/ubuntu-server-vsftpd/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2020/09/ball-63527_1920-220x162.jpg" srcset="https://magiclen.org/wp-content/uploads/2020/09/ball-63527_1920-220x162.jpg 1x, https://magiclen.org/wp-content/uploads/2020/09/ball-63527_1920-440x324.jpg 2x, https://magiclen.org/wp-content/uploads/2020/09/ball-63527_1920-660x486.jpg 3x" alt>
FTP（文件传输协定，File Transfer Protocol）顾名思义，是专门用来传输文件的通信协定，并且这个文件传输的方向是双向的，换句话说，FTP 服务器可以提供文件给客户端，客户端也可以上传文件到 FTP 服务器上。vsftpd、pureftpd、proftpd 都是在 Linux 操作系统上很流行的 FTP 服务器软件，其中的 vsftpd 最轻巧，并以安全和性能为重。]]></description><category>Linux</category><category>研究分享</category><category>网络相关</category><category>FTP</category><category>Linux</category><category>SSL</category><category>Ubuntu</category><category>Ubuntu Server</category><category>vsftpd</category><category>xinetd</category><category>ss（指令）</category><guid>https://magiclen.org/cn/ubuntu-server-vsftpd</guid><pubDate>Tue, 1 Sep 2020 12:00:02 +0800</pubDate><dc:creator>Magic Len</dc:creator></item></channel></rss>