<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Felix&#039;s Blog</title>
	<atom:link href="https://felixc.at/feed/?dualfeed=2" rel="self" type="application/rss+xml" />
	<link>https://felixc.at</link>
	<description>@felixonmars</description>
	<lastBuildDate>Tue, 08 Nov 2022 20:19:03 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>[Arch] systemd 时代的 NBD 客户端持久化配置方法</title>
		<link>https://felixc.at/2022/11/arch-systemd-era-nbd-client-persistent-config/</link>
					<comments>https://felixc.at/2022/11/arch-systemd-era-nbd-client-persistent-config/#comments</comments>
		
		<dc:creator><![CDATA[Felix Yan]]></dc:creator>
		<pubDate>Tue, 08 Nov 2022 20:19:02 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Arch]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[systemd]]></category>
		<guid isPermaLink="false">https://felixc.at/?p=1911</guid>

					<description><![CDATA[<p>NBD 用于提供块设备给远程设备使用是一种非常简便、低成本的方法。然而，让 NBD 开始工作的方法在网上能找到很多，但是 NBD 客户端的配置持久化却很难搜到比较完整的资料。在参考了一些过时博客、manpage 等比较分散的资料之后，我总算是凭借蛛丝马迹找到了应当是正确的配置方法。 1、自动加载 nbd 内核模块 echo nbd > /etc/modules-load.d/nbd.conf （虽然——我觉得这件事应该在 nbd 包里完成，因为上游不愿意默认提供的理由只是为了考虑 nbd 未被编译为内核模块的情况。） 2、/etc/nbdtab 没错，光是发现这个东西就花了我不少时间。 nbd 服务器、连接选项等本来在 nbd-client 命令中配置的内容，应当被写到这个文件里。 一个简单的例子： nbd0 192.168.0.10 export0 persist 显而易见，分别对应设备名、服务器地址、服务器上配置的 export 名、其他选项。完整的介绍可以参考对应的 manpage。 &#8230; [visit site to read more]</p>
The post <a href="https://felixc.at/2022/11/arch-systemd-era-nbd-client-persistent-config/">[Arch] systemd 时代的 NBD 客户端持久化配置方法</a> first appeared on <a href="https://felixc.at">Felix's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>NBD 用于提供块设备给远程设备使用是一种非常简便、低成本的方法。然而，让 NBD 开始工作的方法在网上能找到很多，但是 NBD 客户端的配置持久化却很难搜到比较完整的资料。在参考了一些过时博客、manpage 等比较分散的资料之后，我总算是凭借蛛丝马迹找到了应当是正确的配置方法。</p>



<h2 class="wp-block-heading">1、自动加载 nbd 内核模块</h2>



<pre class="wp-block-code"><code lang="bash" class="language-bash">echo nbd > /etc/modules-load.d/nbd.conf</code></pre>



<p>（虽然——我觉得这件事应该在 nbd 包里完成，因为<a href="https://github.com/NetworkBlockDevice/nbd/issues/56#issuecomment-331634532" title="上游不愿意默认提供的理由只是为了考虑 nbd 未被编译为内核模块的情况">上游不愿意默认提供的理由只是为了考虑 nbd 未被编译为内核模块的情况</a>。）</p>



<h2 class="wp-block-heading">2、/etc/nbdtab</h2>



<p><s>没错，光是发现这个东西就花了我不少时间。</s></p>



<p>nbd 服务器、连接选项等本来在 nbd-client 命令中配置的内容，应当被写到这个文件里。</p>



<p>一个简单的例子：</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">nbd0 192.168.0.10 export0 persist</code></pre>



<p>显而易见，分别对应设备名、服务器地址、服务器上配置的 export 名、其他选项。完整的介绍可以参考<a href="https://man.archlinux.org/man/nbdtab.5" title="对应的 manpage">对应的 manpage</a>。</p>



 &#8230; [<a href="https://felixc.at/2022/11/arch-systemd-era-nbd-client-persistent-config/">visit site to read more</a>]The post <a href="https://felixc.at/2022/11/arch-systemd-era-nbd-client-persistent-config/">[Arch] systemd 时代的 NBD 客户端持久化配置方法</a> first appeared on <a href="https://felixc.at">Felix's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://felixc.at/2022/11/arch-systemd-era-nbd-client-persistent-config/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>[Arch] OpenSSL 3 更新杂记</title>
		<link>https://felixc.at/2022/11/notes-about-arch-openssl-3-update/</link>
					<comments>https://felixc.at/2022/11/notes-about-arch-openssl-3-update/#comments</comments>
		
		<dc:creator><![CDATA[Felix Yan]]></dc:creator>
		<pubDate>Mon, 07 Nov 2022 14:10:36 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Arch]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">https://felixc.at/?p=1904</guid>

					<description><![CDATA[<p>最近 Arch Linux 终于把 OpenSSL 更新到了 3.x 系列版本。一直以来，在处理涉及打包工具链本身的 soname bump 等更新问题时，我们一直缺乏一个透明、优雅的流程。 以往采用过的方法包括但不限于：临时往编译环境里手动塞旧版本兼容包、手动在过渡版本的新版 PKGBUILD 里再编译一份旧版包然后把 lib 装进去等。由于处理这件事的开发者一般独自完成了整个过程，留下来的资料除了 IRC 里的寥寥几语往往十分有限，对于其他开发者、或是下游发行版试图重现这个过程来说，都是一个比较痛苦的过程。 这一次趁着 OpenSSL 3 的机会，本喵深度参与了整个 bootstrap rebuild 过程，并且在 RISC-V port 里复现了一遍。现在记录一下大致的过程和遇到的问题，以备不时之需。 1、首先把旧版库打包，使其可以与新版库同时安装。 openssl-1.1：https://github.com/archlinux/svntogit-packages/commit/d50ecccc79b637830b71795bd919e6467e118ef0 由于需要避免文件冲突，相应的编译选项（&#8211;libdir）和 package() 过程中做了一些兼容性处理。如果这个包还需要在 rebuild 之后留下来，比如这次的 openssl-1.1 的情况，头文件和 pkgconfig 的 .pc 文件也需要做处理。如果只是作为兼容包，可以仅保留带 soname 和具体版本的库文件本身。（当然，这种情况下也可以考虑在新版包里直接编译一份旧版库安装进去，毕竟只是临时使用。） &#8230; [visit site to read more]</p>
The post <a href="https://felixc.at/2022/11/notes-about-arch-openssl-3-update/">[Arch] OpenSSL 3 更新杂记</a> first appeared on <a href="https://felixc.at">Felix's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>最近 Arch Linux 终于把 OpenSSL 更新到了 3.x 系列版本。一直以来，在处理涉及打包工具链本身的 soname bump 等更新问题时，我们一直缺乏一个透明、优雅的流程。</p>



<p>以往采用过的方法包括但不限于：临时往编译环境里手动塞旧版本兼容包、手动在过渡版本的新版 PKGBUILD 里再编译一份旧版包然后把 lib 装进去等。由于处理这件事的开发者一般独自完成了整个过程，留下来的资料除了 IRC 里的寥寥几语往往十分有限，对于其他开发者、或是下游发行版试图重现这个过程来说，都是一个比较痛苦的过程。</p>



<p>这一次趁着 OpenSSL 3 的机会，本喵深度参与了整个 bootstrap rebuild 过程，并且在 RISC-V port 里复现了一遍。现在记录一下大致的过程和遇到的问题，以备不时之需。</p>



<p>1、首先把旧版库打包，使其可以与新版库同时安装。</p>



<p>openssl-1.1：<a href="https://github.com/archlinux/svntogit-packages/commit/d50ecccc79b637830b71795bd919e6467e118ef0">https://github.com/archlinux/svntogit-packages/commit/d50ecccc79b637830b71795bd919e6467e118ef0</a></p>



<p>由于需要避免文件冲突，相应的编译选项（&#8211;libdir）和 package() 过程中做了一些兼容性处理。如果这个包还需要在 rebuild 之后留下来，比如这次的 openssl-1.1 的情况，头文件和 pkgconfig 的 .pc 文件也需要做处理。如果只是作为兼容包，可以仅保留带 soname 和具体版本的库文件本身。（<s>当然，这种情况下也可以考虑在新版包里直接编译一份旧版库安装进去，毕竟只是临时使用。</s>）</p>



 &#8230; [<a href="https://felixc.at/2022/11/notes-about-arch-openssl-3-update/">visit site to read more</a>]The post <a href="https://felixc.at/2022/11/notes-about-arch-openssl-3-update/">[Arch] OpenSSL 3 更新杂记</a> first appeared on <a href="https://felixc.at">Felix's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://felixc.at/2022/11/notes-about-arch-openssl-3-update/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>用 pacman-accel 给 pacman 加速</title>
		<link>https://felixc.at/2022/11/use-pacman-accel-to-accelerate-pacman/</link>
					<comments>https://felixc.at/2022/11/use-pacman-accel-to-accelerate-pacman/#comments</comments>
		
		<dc:creator><![CDATA[Felix Yan]]></dc:creator>
		<pubDate>Sun, 06 Nov 2022 00:43:00 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Arch]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ruby]]></category>
		<guid isPermaLink="false">https://felixc.at/?p=1825</guid>

					<description><![CDATA[<p>我在选镜像站的时候，总会遇到一个矛盾：镜像站访问快、镜像站和上游同步延迟低（同步到了最新的包）两者不可兼得。 比较容易想到的解决思路是：只从同步延迟低的镜像下 db，然后从速度快的镜像开始依次试，跳过 404 的镜像，直到找到一个已经存在该文件的镜像。 在过往的十来年里，我一直是通过写一个脚本来分别给 pacman -Sy 和 pacman -Su 设置不同的镜像来勉强解决的。但是这个用法在 pacman 最新系列中被破坏了——pacman 加入了一个镜像站如果 404 次数过多，在同一次更新中就再也不尝试了的新行为。 想到以往的用法会在命令中夹杂许多 404 报错，需要专门的脚本来换镜像体验也并不是很好，我写了个非常简单的本地服务来实现这个需求： #!/usr/bin/ruby # # A simple local redirector for pacman, to get you the latest packages and # utilize available mirrors. # # Usage: # - Set multiple mirrors in /etc/pacman.d/mirrorlist-accel with ordering: # https://fastest-mirror-but-updates-once-a-day/archlinux/ # &#8230; <a href="https://felixc.at/2022/11/use-pacman-accel-to-accelerate-pacman/" class="more-link">Continue reading <span class="screen-reader-text">用 pacman-accel 给 pacman 加速</span></a></p>
The post <a href="https://felixc.at/2022/11/use-pacman-accel-to-accelerate-pacman/">用 pacman-accel 给 pacman 加速</a> first appeared on <a href="https://felixc.at">Felix's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>我在选镜像站的时候，总会遇到一个矛盾：镜像站访问快、镜像站和上游同步延迟低（同步到了最新的包）两者不可兼得。</p>



<p>比较容易想到的解决思路是：只从同步延迟低的镜像下 db，然后从速度快的镜像开始依次试，跳过 404 的镜像，直到找到一个已经存在该文件的镜像。</p>



<p>在过往的十来年里，我一直是通过写一个脚本来分别给 pacman -Sy 和 pacman -Su 设置不同的镜像来勉强解决的。但是这个用法在 pacman 最新系列中被破坏了——pacman 加入了一个镜像站如果 404 次数过多，在同一次更新中就再也不尝试了的新行为。</p>



<p>想到以往的用法会在命令中夹杂许多 404 报错，需要专门的脚本来换镜像体验也并不是很好，我写了个非常简单的本地服务来实现这个需求：</p>



<pre class="wp-block-code"><code lang="ruby" class="language-ruby">#!/usr/bin/ruby
#
# A simple local redirector for pacman, to get you the latest packages and
# utilize available mirrors.
#
# Usage:
# - Set multiple mirrors in /etc/pacman.d/mirrorlist-accel with ordering:
# https://fastest-mirror-but-updates-once-a-day/archlinux/
# https://relatively-slower-mirror-that-updates-more-frequently/archlinux/
# ...
# https://pkgbuild-dot-com-or-another-mirror-that-gives-you-the-latest-packages/
#
# - Set /etc/pacman.d/mirrorlist to this redirector:
# Server = http://127.0.0.1:4567/$repo/os/$arch

require 'http'
require 'sinatra'

mirrors = File.readlines("/etc/pacman.d/mirrorlist-accel").filter_map { |line| line.strip if line &amp;&amp; line[0] != "#" }

get '/*' do |path|
    # Set TIER 0/1 mirrors as the last one, for:
    #  - DB syncing
    #  - Download fallback
    # These two use cases always the same server for consistency.
    mirror = mirrors[-1]

    unless path.end_with? '.db'
        # Find a faster mirror with the requested file present
        mirrors[..-2].each { |m|
            response = HTTP.head(m + path)
            if response.status == 200
                mirror = m
                break
            else
                logger.info "skipping #{m} for #{path}, code: #{response.status}"
            end
        }
    end

    logger.info "redirecting to #{mirror + path}"
    redirect mirror + path, 302
end

set :bind, ENV.fetch("PACMAN_ACCEL_BIND", "127.0.0.1")
set :port, ENV.fetch("PACMAN_ACCEL_PORT", "4567")</code></pre>



<p>如注释所说，在 /etc/pacman.d/mirrorlist-accel 里按照本地访问速度依次设置几个快的镜像，并把最后一个镜像设置为和上游同步频繁的镜像即可。</p>



 &#8230; [<a href="https://felixc.at/2022/11/use-pacman-accel-to-accelerate-pacman/">visit site to read more</a>]The post <a href="https://felixc.at/2022/11/use-pacman-accel-to-accelerate-pacman/">用 pacman-accel 给 pacman 加速</a> first appeared on <a href="https://felixc.at">Felix's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://felixc.at/2022/11/use-pacman-accel-to-accelerate-pacman/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>萌新的 PolarFire SoC Icicle Kit 初体验</title>
		<link>https://felixc.at/2022/06/newbies-polarfire-soc-icicle-kit-first-experience/</link>
					<comments>https://felixc.at/2022/06/newbies-polarfire-soc-icicle-kit-first-experience/#comments</comments>
		
		<dc:creator><![CDATA[Felix Yan]]></dc:creator>
		<pubDate>Fri, 03 Jun 2022 19:26:07 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Arch]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[RISC-V]]></category>
		<guid isPermaLink="false">https://felixc.at/?p=1729</guid>

					<description><![CDATA[<p>这两天翻出来了去年代收的 PolarFire SoC Icicle Kit。因为隔壁的 FPGA 大佬们看不上这块板子，我打算尝试物尽其用一下，目标只是用板子上的 RISC-V 核启动 Arch Linux RISC-V 的 rootfs 测试（把它当作一块 SD 卡槽没有问题、并且带 PCIE 的 HiFive Unleashed 来用。隔壁嵌入式群的大佬们：买椟还珠！）。如此便开始了年轻人的 FPGA 初体验（可能还是不能算）。 噩梦的开始 一开始尝试的当然是最新版的 Yocto 镜像，毕竟这是“官方”的 Linux 镜像。结果刷完后立刻遇到了启动失败： 一开始我还以为是 SD 卡坏了。在多次尝试未果后…… 当时的猜测是（不一定对），可能因为板子上 FPGA 部分（抱歉，我不知道专业的称呼）不够新，所以我打算刷一下 HSS。结果这成为了噩梦的开始。 &#8230; [visit site to read more]</p>
The post <a href="https://felixc.at/2022/06/newbies-polarfire-soc-icicle-kit-first-experience/">萌新的 PolarFire SoC Icicle Kit 初体验</a> first appeared on <a href="https://felixc.at">Felix's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>这两天翻出来了去年代收的 PolarFire SoC Icicle Kit。因为隔壁的 FPGA 大佬们看不上这块板子，我打算尝试<s>物尽其用</s>一下，目标只是用板子上的 RISC-V 核启动 Arch Linux RISC-V 的 rootfs 测试（把它当作一块 SD 卡槽没有问题、并且带 PCIE 的 HiFive Unleashed 来用。隔壁嵌入式群的大佬们：买椟还珠！）。如此便开始了年轻人的 FPGA 初体验（可能还是不能算）。</p>



<h2 class="wp-block-heading">噩梦的开始</h2>



<p>一开始尝试的当然是<a href="https://github.com/polarfire-soc/meta-polarfire-soc-yocto-bsp/releases/tag/v2022.05">最新版的 Yocto 镜像</a>，毕竟这是“官方”的 Linux 镜像。结果刷完后立刻遇到了启动失败：</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="841" src="https://felixc.at/wp-content/uploads/2022/06/2022-05-31-12-13-51-1024x841.png" alt="" class="wp-image-1731" srcset="https://felixc.at/wp-content/uploads/2022/06/2022-05-31-12-13-51-1024x841.png 1024w, https://felixc.at/wp-content/uploads/2022/06/2022-05-31-12-13-51-300x246.png 300w, https://felixc.at/wp-content/uploads/2022/06/2022-05-31-12-13-51-768x631.png 768w, https://felixc.at/wp-content/uploads/2022/06/2022-05-31-12-13-51.png 1153w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>一开始我还以为是 SD 卡坏了。在多次尝试未果后……</p>



<p>当时的猜测是（不一定对），可能因为板子上 FPGA 部分（抱歉，我不知道专业的称呼）不够新，所以我打算刷一下 <a href="https://github.com/polarfire-soc/hart-software-services">HSS</a>。结果这成为了噩梦的开始。</p>



 &#8230; [<a href="https://felixc.at/2022/06/newbies-polarfire-soc-icicle-kit-first-experience/">visit site to read more</a>]The post <a href="https://felixc.at/2022/06/newbies-polarfire-soc-icicle-kit-first-experience/">萌新的 PolarFire SoC Icicle Kit 初体验</a> first appeared on <a href="https://felixc.at">Felix's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://felixc.at/2022/06/newbies-polarfire-soc-icicle-kit-first-experience/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>nspawn.org：简单的 systemd 发行版容器</title>
		<link>https://felixc.at/2019/04/nspawn-org-simple-container-for-systemd-distributions/</link>
					<comments>https://felixc.at/2019/04/nspawn-org-simple-container-for-systemd-distributions/#comments</comments>
		
		<dc:creator><![CDATA[Felix Yan]]></dc:creator>
		<pubDate>Thu, 04 Apr 2019 22:03:09 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Arch]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">https://blog.felixc.at/?p=1640</guid>

					<description><![CDATA[<p>如果你想要运行一个发行版容器，而又不想被 docker 一类的重量级方案打扰，现在有一个新的简单方案了。 nspawn.org 目前提供了 Arch、CentOS、Debian、Fedora、Ubuntu 的各版本镜像，并可以直接用 systemd-nspawn 的验证机制进行签名验证。 推荐的用法是使用其提供的 &#8220;nspawn&#8221; 工具。下面以创建一个 Fedora 30 容器为例： 1、获取工具： $ wget https://raw.githubusercontent.com/nspawn/nspawn/master/nspawn $ chmod +x nspawn 2、获取 Fedora 30 镜像： $ sudo ./nspawn init fedora/30/tar 3、启动容器并获取 shell： $ sudo machinectl start fedora-30-tar $ sudo machinectl shell fedora-30-tar Connected to machine fedora-30-tar. Press ^] three times within 1s to &#8230; <a href="https://felixc.at/2019/04/nspawn-org-simple-container-for-systemd-distributions/" class="more-link">Continue reading <span class="screen-reader-text">nspawn.org：简单的 systemd 发行版容器</span></a></p>
The post <a href="https://felixc.at/2019/04/nspawn-org-simple-container-for-systemd-distributions/">nspawn.org：简单的 systemd 发行版容器</a> first appeared on <a href="https://felixc.at">Felix's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>如果你想要运行一个发行版容器，而又不想被 docker 一类的重量级方案打扰，现在有一个新的简单方案了。</p>



<p><a href="http://nspawn.org">nspawn.org</a> 目前提供了 Arch、CentOS、Debian、Fedora、Ubuntu 的各版本镜像，并可以直接用 systemd-nspawn 的验证机制进行签名验证。</p>



<p>推荐的用法是使用其提供的 &#8220;nspawn&#8221; 工具。下面以创建一个 Fedora 30 容器为例：</p>



<p>1、获取工具：</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash"><pre class="wp-block-syntaxhighlighter-code">$ wget https://raw.githubusercontent.com/nspawn/nspawn/master/nspawn
$ chmod +x nspawn</pre></code></pre>



<p>2、获取 Fedora 30 镜像：</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash"><pre class="wp-block-syntaxhighlighter-code">$ sudo ./nspawn init fedora/30/tar</pre></code></pre>



<p>3、启动容器并获取 shell：</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash"><pre class="wp-block-syntaxhighlighter-code">$ sudo machinectl start fedora-30-tar
$ sudo machinectl shell fedora-30-tar
Connected to machine fedora-30-tar. Press ^] three times within 1s to exit session.
[root@fedora30 ~]#</pre></code></pre>



 &#8230; [<a href="https://felixc.at/2019/04/nspawn-org-simple-container-for-systemd-distributions/">visit site to read more</a>]The post <a href="https://felixc.at/2019/04/nspawn-org-simple-container-for-systemd-distributions/">nspawn.org：简单的 systemd 发行版容器</a> first appeared on <a href="https://felixc.at">Felix's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://felixc.at/2019/04/nspawn-org-simple-container-for-systemd-distributions/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>用脏办法解决 BLE 鼠标重连后指针不动的问题</title>
		<link>https://felixc.at/2019/01/dirty-hack-to-workaround-cursor-not-move-issue-after-ble-mouse-reconnect/</link>
					<comments>https://felixc.at/2019/01/dirty-hack-to-workaround-cursor-not-move-issue-after-ble-mouse-reconnect/#comments</comments>
		
		<dc:creator><![CDATA[Felix Yan]]></dc:creator>
		<pubDate>Thu, 10 Jan 2019 18:39:43 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">https://blog.felixc.at/?p=1630</guid>

					<description><![CDATA[<p>我的蓝牙鼠标（雷柏 MT750）使用 BLE（Bluetooth Low Energy） 连接笔记本时，时常遇到自动重连后电脑这边认为已连接，而鼠标那边灯自动灭掉，鼠标指针无反应的问题。在网上反复搜索 bluez 相关问题找到了许多类似问题，鼠标类型也集中在罗技、ThinkPad 等 BLE 鼠标上。 偶然间发现每次重连后，如果手动用 bluetoothctl 发一个 &#8230; [visit site to read more]</p>
The post <a href="https://felixc.at/2019/01/dirty-hack-to-workaround-cursor-not-move-issue-after-ble-mouse-reconnect/">用脏办法解决 BLE 鼠标重连后指针不动的问题</a> first appeared on <a href="https://felixc.at">Felix's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>我的蓝牙鼠标（雷柏 MT750）使用 BLE（Bluetooth Low Energy） 连接笔记本时，时常遇到自动重连后电脑这边认为已连接，而鼠标那边灯自动灭掉，鼠标指针无反应的问题。在网上反复搜索 bluez 相关问题找到了许多类似问题，鼠标类型也集中在罗技、ThinkPad 等 BLE 鼠标上。</p>



<p>偶然间发现每次重连后，如果手动用 bluetoothctl 发一个 &#8230; [<a href="https://felixc.at/2019/01/dirty-hack-to-workaround-cursor-not-move-issue-after-ble-mouse-reconnect/">visit site to read more</a>]The post <a href="https://felixc.at/2019/01/dirty-hack-to-workaround-cursor-not-move-issue-after-ble-mouse-reconnect/">用脏办法解决 BLE 鼠标重连后指针不动的问题</a> first appeared on <a href="https://felixc.at">Felix's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://felixc.at/2019/01/dirty-hack-to-workaround-cursor-not-move-issue-after-ble-mouse-reconnect/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>为 glibc localedata 添加民国纪年支持</title>
		<link>https://felixc.at/2018/11/add-minguo-calendar-support-as-glibc-localedata-era/</link>
					<comments>https://felixc.at/2018/11/add-minguo-calendar-support-as-glibc-localedata-era/#comments</comments>
		
		<dc:creator><![CDATA[Felix Yan]]></dc:creator>
		<pubDate>Sat, 03 Nov 2018 14:11:35 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">https://blog.felixc.at/?p=1612</guid>

					<description><![CDATA[<p>昨天被 @聞其詳 问起 glibc 对日本平成XX年的纪年支持情况（感谢 @farseerfc 老师），发现 glibc localedata 中并未包括民国纪年支持。在查询文档后稍微鼓捣了一下，简单实现了这个功能： $ LC_TIME=zh_TW.UTF-8 date +%EY 民國107年 $ LC_TIME=zh_TW.UTF-8 date +%EY --date="1912/4/3" 民國元年 $ LC_TIME=zh_TW.UTF-8 date +%EY --date="1913/4/3" 民國2年 $ LC_TIME=zh_TW.UTF-8 date +%EY --date="1911/4/3" 民前1年 $ LC_TIME=zh_TW.UTF-8 date +%EY --date="1900/4/3" 民前12年 修改方法： 编辑&#160;/usr/share/i18n/locales/zh_TW 文件，找到 END LC_TIME，在它之前加入这样三行： era "+:2:1913//01//01:+*:民國:%EC%Ey年";/ "+:1:1912//01//01:1912//12//31:民國:%EC元年";/ "+:1:1911//12//31:-*:民前:%EC%Ey年" 保存后重新 locale-gen 即可。 &#8230; [visit site to &#8230; <a href="https://felixc.at/2018/11/add-minguo-calendar-support-as-glibc-localedata-era/" class="more-link">Continue reading <span class="screen-reader-text">为 glibc localedata 添加民国纪年支持</span></a></p>
The post <a href="https://felixc.at/2018/11/add-minguo-calendar-support-as-glibc-localedata-era/">为 glibc localedata 添加民国纪年支持</a> first appeared on <a href="https://felixc.at">Felix's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>昨天被 @聞其詳 问起 glibc 对日本平成XX年的纪年支持情况（感谢 @farseerfc 老师），发现 glibc localedata 中并未包括民国纪年支持。在查询文档后稍微鼓捣了一下，简单实现了这个功能：</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash"><pre class="wp-block-syntaxhighlighter-code">$ LC_TIME=zh_TW.UTF-8 date +%EY
民國107年
$ LC_TIME=zh_TW.UTF-8 date +%EY --date="1912/4/3"
民國元年
$ LC_TIME=zh_TW.UTF-8 date +%EY --date="1913/4/3"
民國2年
$ LC_TIME=zh_TW.UTF-8 date +%EY --date="1911/4/3"
民前1年
$ LC_TIME=zh_TW.UTF-8 date +%EY --date="1900/4/3"
民前12年
</pre></code></pre>



<p>修改方法：</p>



<p>编辑&nbsp;/usr/share/i18n/locales/zh_TW 文件，找到 END LC_TIME，在它之前加入这样三行：</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash"><pre class="wp-block-syntaxhighlighter-code">era "+:2:1913//01//01:+*:民國:%EC%Ey年";/
    "+:1:1912//01//01:1912//12//31:民國:%EC元年";/
    "+:1:1911//12//31:-*:民前:%EC%Ey年"
</pre></code></pre>



<p>保存后重新 locale-gen 即可。</p>



 &#8230; [<a href="https://felixc.at/2018/11/add-minguo-calendar-support-as-glibc-localedata-era/">visit site to read more</a>]The post <a href="https://felixc.at/2018/11/add-minguo-calendar-support-as-glibc-localedata-era/">为 glibc localedata 添加民国纪年支持</a> first appeared on <a href="https://felixc.at">Felix's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://felixc.at/2018/11/add-minguo-calendar-support-as-glibc-localedata-era/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>请不要把 Wifi Dongle 翻译成加密狗</title>
		<link>https://felixc.at/2018/10/please-dont-translate-wifi-dongle-to-encryption-lock/</link>
					<comments>https://felixc.at/2018/10/please-dont-translate-wifi-dongle-to-encryption-lock/#comments</comments>
		
		<dc:creator><![CDATA[Felix Yan]]></dc:creator>
		<pubDate>Mon, 08 Oct 2018 08:25:41 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<guid isPermaLink="false">https://blog.felixc.at/?p=1595</guid>

					<description><![CDATA[<p>在许多翻译过来的文本里，无线网卡（Wifi Dongle / Wifi Adapter）被翻译成了“加密狗”。最近在微博大火的一篇《俄罗斯特工又蠢了！实名行动暴露自己还卖了300多特工队友&#8230;..》里面，又出现了类似的错误，让我不得不想说说这个问题。 先来看看这个例子： 文章描述了几个黑客在目标附近发射伪造热点钓鱼，此处的未翻译单词包括了 Wifi 和 Dongle。根据上下文，带一个无线网卡发射热点应该是正确的意思，而加密狗在这里和上下文没啥关系…… 我尝试在搜索引擎里搜索对应词组，很不幸，惨状令人叹息： &#8230; [visit site to read more]</p>
The post <a href="https://felixc.at/2018/10/please-dont-translate-wifi-dongle-to-encryption-lock/">请不要把 Wifi Dongle 翻译成加密狗</a> first appeared on <a href="https://felixc.at">Felix's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>在许多翻译过来的文本里，无线网卡（Wifi Dongle / Wifi Adapter）被翻译成了“加密狗”。最近在微博大火的一篇《俄罗斯特工又蠢了！实名行动暴露自己还卖了300多特工队友&#8230;..》里面，又出现了类似的错误，让我不得不想说说这个问题。</p>



<p>先来看看这个例子：</p>



<figure class="wp-block-image"><a class="highslide img_2" href="https://blog.felixc.at/wp-content/uploads/2018/10/2018-10-08-160502-971220.png" onclick="return hs.expand(this)"><img decoding="async" width="1041" height="210" src="https://blog.felixc.at/wp-content/uploads/2018/10/2018-10-08-160502-971220.png" alt="" class="wp-image-1596" srcset="https://felixc.at/wp-content/uploads/2018/10/2018-10-08-160502-971220.png 1041w, https://felixc.at/wp-content/uploads/2018/10/2018-10-08-160502-971220-300x61.png 300w, https://felixc.at/wp-content/uploads/2018/10/2018-10-08-160502-971220-768x155.png 768w, https://felixc.at/wp-content/uploads/2018/10/2018-10-08-160502-971220-1024x207.png 1024w" sizes="(max-width: 1041px) 100vw, 1041px" /></a></figure>



<p>文章描述了几个黑客在目标附近发射伪造热点钓鱼，此处的未翻译单词包括了 Wifi 和 Dongle。根据上下文，带一个无线网卡发射热点应该是正确的意思，而加密狗在这里和上下文没啥关系……</p>



<p>我尝试在搜索引擎里搜索对应词组，很不幸，惨状令人叹息：</p>



 &#8230; [<a href="https://felixc.at/2018/10/please-dont-translate-wifi-dongle-to-encryption-lock/">visit site to read more</a>]The post <a href="https://felixc.at/2018/10/please-dont-translate-wifi-dongle-to-encryption-lock/">请不要把 Wifi Dongle 翻译成加密狗</a> first appeared on <a href="https://felixc.at">Felix's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://felixc.at/2018/10/please-dont-translate-wifi-dongle-to-encryption-lock/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title>Thunderbolt 3 eGPU Bumblebee 方案尝鲜</title>
		<link>https://felixc.at/2018/09/trying-out-thunderbolt-3-egpu-with-bumblebee/</link>
					<comments>https://felixc.at/2018/09/trying-out-thunderbolt-3-egpu-with-bumblebee/#comments</comments>
		
		<dc:creator><![CDATA[Felix Yan]]></dc:creator>
		<pubDate>Fri, 28 Sep 2018 08:54:53 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Arch]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">https://blog.felixc.at/?p=1585</guid>

					<description><![CDATA[<p>最近从公司淘了一块 GTX 1060，淘宝了一个显卡盒折腾 TB3 eGPU 方案。由于笔记本经常带出门，打算采用即插即用的 bumblebee 方案（回家插上盒子用独显，拔下盒子可以带出门，可以正常待机不用重启）。下面记录一下 Arch 上配置的步骤和遇到的坑。 1、准备软件包 # pacman -S bumblebee primus lib32-primus nvidia-dkms lib32-nvidia-utils bolt 2、修改 bumblebee 配置 修改 /etc/bumblebee/xorg.conf.nvidia，在 Section &#8220;Device&#8221; 中加入： Option "AllowExternalGpus" "true" 修改 /etc/bumblebee/bumblebee.conf，在 [optirun] 中修改： Bridge=primus 3、插入 TB 线，验证设备（不建议完全关闭设备验证！） &#8230; [visit site to read more]</p>
The post <a href="https://felixc.at/2018/09/trying-out-thunderbolt-3-egpu-with-bumblebee/">Thunderbolt 3 eGPU Bumblebee 方案尝鲜</a> first appeared on <a href="https://felixc.at">Felix's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>最近从公司淘了一块 GTX 1060，淘宝了一个显卡盒折腾 TB3 eGPU 方案。由于笔记本经常带出门，打算采用即插即用的 bumblebee 方案（回家插上盒子用独显，拔下盒子可以带出门，可以正常待机不用重启）。下面记录一下 Arch 上配置的步骤和遇到的坑。</p>



<h4 class="wp-block-heading">1、准备软件包</h4>



<pre class="wp-block-code"><code lang="bash" class="language-bash"><pre class="wp-block-syntaxhighlighter-code"># pacman -S bumblebee primus lib32-primus nvidia-dkms lib32-nvidia-utils bolt</pre></code></pre>



<h4 class="wp-block-heading">2、修改 bumblebee 配置</h4>



<p>修改 /etc/bumblebee/xorg.conf.nvidia，在 Section &#8220;Device&#8221; 中加入：</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash"><pre class="wp-block-syntaxhighlighter-code">Option "AllowExternalGpus" "true"</pre></code></pre>



<p>修改 /etc/bumblebee/bumblebee.conf，在 [optirun] 中修改：</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash"><pre class="wp-block-syntaxhighlighter-code">Bridge=primus</pre></code></pre>



<h4 class="wp-block-heading">3、插入 TB 线，验证设备（不建议完全关闭设备验证！）</h4>



 &#8230; [<a href="https://felixc.at/2018/09/trying-out-thunderbolt-3-egpu-with-bumblebee/">visit site to read more</a>]The post <a href="https://felixc.at/2018/09/trying-out-thunderbolt-3-egpu-with-bumblebee/">Thunderbolt 3 eGPU Bumblebee 方案尝鲜</a> first appeared on <a href="https://felixc.at">Felix's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://felixc.at/2018/09/trying-out-thunderbolt-3-egpu-with-bumblebee/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Arch Linux 社区中不成文的约定（一）</title>
		<link>https://felixc.at/2018/08/arch-linux-community-undocumented-details-1/</link>
					<comments>https://felixc.at/2018/08/arch-linux-community-undocumented-details-1/#comments</comments>
		
		<dc:creator><![CDATA[Felix Yan]]></dc:creator>
		<pubDate>Sun, 26 Aug 2018 17:33:13 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Arch]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">https://blog.felixc.at/?p=1577</guid>

					<description><![CDATA[<p>作为一个年轻和小众的社区（咳咳），Arch Linux 社区中有着许多不成文的约定。本文希望通过稍稍讲解一二，来消除一些新人们常常感到的困惑。由于预感到日后可能还会有更多问题，暂且认为这是系列里的第一篇 😛 修理“坏”包和提醒更新 仓库里一般的包可能有一个或多个维护者，也可能没有维护者，成为“孤儿”。如果坏掉或者过期的包是一个孤儿，申请从仓库里删掉是更有效的方法，这样它可以在 AUR 找到新的主人。发邮件到 aur-general 解释一下情况，并表明自己或者别人想维护它，一般都会很快得到解决。 如果“坏”包有维护者，但他太忙了呢？这种情况下，这个包很可能已经在 Bug Tracker 里泥足深陷。这种时候可以通过帮维护者一个小忙的方式来促进问题的解决。如果有人找到了上游 Bug Report，并且上游已经修复提供了 patch 的话，可以考虑把 patch 贴到 Arch 的 Bug Tracker；如果这件事已经有人做了，可以修改 PKGBUILD 打上 patch，然后把改好的 PKGBUILD 贴上去；如果连 PKGBUILD 都有人准备好了，而且过去了一段时间的话，可以考虑把这份准备好的 srcpkg 或者 diff 直接发邮件给维护者，附上简短的感谢和一个笑脸 🙂 同样的道理，如果一个过期包已经被标记过期很久了，也可以准备一个新版的 PKGBUILD 发邮件给维护者。 &#8230; [visit site to read more]</p>
The post <a href="https://felixc.at/2018/08/arch-linux-community-undocumented-details-1/">Arch Linux 社区中不成文的约定（一）</a> first appeared on <a href="https://felixc.at">Felix's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>作为一个年轻和小众的社区（咳咳），Arch Linux 社区中有着许多不成文的约定。本文希望通过稍稍讲解一二，来消除一些新人们常常感到的困惑。由于预感到日后可能还会有更多问题，暂且认为这是系列里的第一篇 😛</p>



<ul class="wp-block-list">
<li>
<h4>修理“坏”包和提醒更新</h4>
</li>
</ul>



<p>仓库里一般的包可能有一个或多个维护者，也可能没有维护者，成为“孤儿”。如果坏掉或者过期的包是一个孤儿，<strong>申请从仓库里删掉是更有效的方法</strong>，这样它可以在 AUR 找到新的主人。发邮件到 aur-general 解释一下情况，并表明自己或者别人想维护它，一般都会很快得到解决。</p>



<p>如果“坏”包有维护者，但他太忙了呢？这种情况下，这个包很可能已经在 Bug Tracker 里泥足深陷。<strong>这种时候可以通过帮维护者一个小忙的方式来促进问题的解决</strong>。如果有人找到了上游 Bug Report，并且上游已经修复提供了 patch 的话，可以考虑把 patch 贴到 Arch 的 Bug Tracker；如果这件事已经有人做了，可以修改 PKGBUILD 打上 patch，然后把改好的 PKGBUILD 贴上去；如果连 PKGBUILD 都有人准备好了，而且过去了一段时间的话，可以考虑把这份准备好的 srcpkg 或者 diff 直接发邮件给维护者，附上简短的感谢和一个笑脸 🙂</p>



<p>同样的道理，如果一个过期包已经被标记过期很久了，也可以准备一个新版的 PKGBUILD 发邮件给维护者。</p>



 &#8230; [<a href="https://felixc.at/2018/08/arch-linux-community-undocumented-details-1/">visit site to read more</a>]The post <a href="https://felixc.at/2018/08/arch-linux-community-undocumented-details-1/">Arch Linux 社区中不成文的约定（一）</a> first appeared on <a href="https://felixc.at">Felix's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://felixc.at/2018/08/arch-linux-community-undocumented-details-1/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
			</item>
	</channel>
</rss>
