<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>sh1marin's blog</title><link>https://blog.sh1mar.in/</link><description>Recent content on sh1marin's blog</description><generator>Hugo -- gohugo.io</generator><language>zh</language><copyright>Copyright © 2019-2024, Avimitin and the sh1mar.in; all rights reserved.</copyright><lastBuildDate>Sat, 03 Jan 2026 00:00:00 +0800</lastBuildDate><atom:link href="https://blog.sh1mar.in/index.xml" rel="self" type="application/rss+xml"/><item><title>Running Multiple swaybg Instances for Niri Overview Backdrop</title><link>https://blog.sh1mar.in/post/linux/niri-backdrop/</link><pubDate>Sat, 03 Jan 2026 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/linux/niri-backdrop/</guid><description>By default, swaybg use fixed layer namespace for all instance. However, to achieve a nice visual effect in Niri where the overview has a different (e.g., blurred) wallpaper than the main desktop, we need two instances of swaybg with namespace running simultaneously.
This requires a patched version of swaybg that supports configurable Wayland layer-shell namespaces: https://github.com/swaywm/swaybg/pull/87
Building the Patched Package First, download the Arch Linux build scripts for swaybg:
yay -G swaybg cd swaybg Next, apply the patch to the PKGBUILD.</description></item><item><title>从 bilinovel 扒小说</title><link>https://blog.sh1mar.in/post/linux/scrape-bili-novel/</link><pubDate>Mon, 16 Sep 2024 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/linux/scrape-bili-novel/</guid><description>最近买了个电子书看漫画和轻小说，漫画从 mox.moe 上下载了，但是轻小说没找到啥好资源站。 最后盯上了对 bilinovel.com 爬虫的方案。 主要用的 https://github.com/lightnovel-center/linovelib2epub 这个项目。 项目本身只是一个</description></item><item><title>在 Arch Linux 上用 Exact Audio Copy 扒碟</title><link>https://blog.sh1mar.in/post/linux/rip-my-first-cd/</link><pubDate>Wed, 04 Sep 2024 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/linux/rip-my-first-cd/</guid><description>刺团的几张碟在 nyaa.si 上只有 「天使动漫」的 TSDM 资源。 虽然有资源，但是是用的 RAR 打包的，看着就很没有下载欲望。 正好其实这几张碟我都有买，我决定学一下扒碟</description></item><item><title>【中二呓语】我开始讨厌群聊了</title><link>https://blog.sh1mar.in/post/ideology/why-i-hate-community/</link><pubDate>Sat, 24 Aug 2024 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/ideology/why-i-hate-community/</guid><description>这里是我的【中二呓语】的第一篇文章。本质上是找不到人聊天了，但是心里面又有很多话想找个地方说出来， 最后想着顺便用来水博客的一些碎碎念。不过我</description></item><item><title>Nand To Tetris 第一章记录</title><link>https://blog.sh1mar.in/post/nand-to-tetris/01/</link><pubDate>Sun, 10 Mar 2024 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/nand-to-tetris/01/</guid><description>知识点摘要 芯片本身由大量布尔门组合构建而成 任何布尔算子 (Boolean Operator) 都可以只用 Nand: NOT( x AND y ) 或者 Nor: NOT( x OR y ) 构建而成。 可以把门看作是一个黑箱函数：只关心</description></item><item><title>在中国移动 RAX3000M 上使用主线 openwrt 记录</title><link>https://blog.sh1mar.in/post/cmcc-rax3000m/</link><pubDate>Thu, 29 Feb 2024 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/cmcc-rax3000m/</guid><description>上电，用网线把路由器 LAN1 和电脑连接。 浏览器打开 192.168.10.1，登录账户进入设置，关闭 2.4G WIFI 和 5G WIFI，设置 DHCP。 等待重启，然后再</description></item><item><title>MLIR - Sparse Vectorization</title><link>https://blog.sh1mar.in/post/mlir/sparse-vectorization/</link><pubDate>Mon, 10 Jul 2023 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/mlir/sparse-vectorization/</guid><description>MLIR Sparse Compiler 里对循环做向量化的方式是靠 Transform OP 的代码重写。 向量化的初步实现实现位于 lib/Dialect/SparseTensor/Transforms/SparseVectorization.cpp 里。 Transform 选项 Sparse Vectorization transform 的操作支持三个自定义选项， 通过 sparse_tensor::VL 结构体传递。 struct VL {</description></item><item><title>Sparse storage scheme used in MLIR</title><link>https://blog.sh1mar.in/post/mlir/sparse-storage-scheme/</link><pubDate>Mon, 03 Jul 2023 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/mlir/sparse-storage-scheme/</guid><description>在 MLIR 里，sparse compiler 会更根据 sparse tensor encoding 的属性，调整 tensor 的存储方式。 SparseTensor Dialect 里提供了 coordinates/values/positions operations， 这三个 operations 有点类似于 bufferizatio</description></item><item><title>Using latest LLVM in nix</title><link>https://blog.sh1mar.in/post/nix/bump-vector-llvm/</link><pubDate>Thu, 29 Jun 2023 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/nix/bump-vector-llvm/</guid><description>The vector project is a RISC-V Vector compliant hardware generator. They use Nix to setup the environment. In the vector project, they use buddy-mlir to write the test case which required LLVM. And this post record what problem have I met to just bump the buddy-mlir to the mainline.
The beginning A couple of weeks ago, I started to learn in how to integrate the buddy-mlir into the vector project. Just like other languages, MLIR has a built-in language server (the mlir-lsp-server).</description></item><item><title>Tensor concept</title><link>https://blog.sh1mar.in/post/mlir/tensor/</link><pubDate>Mon, 12 Jun 2023 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/mlir/tensor/</guid><description>Tensor 的一些概念 不论是 Pytorch 还是 TensorFlow，Tensor 的表现都和 Numpy 的 Array 类似。 在 PyTorch 里一个 2 维的 Tensor 可以用这样的方式来一探究竟： tensor = torch.ones(4, 4) print(f&amp;#34;First row: {tensor[0]}&amp;#34;)</description></item><item><title>MLIR Sparse Compiler - SparsificationAndBufferizationPass</title><link>https://blog.sh1mar.in/post/mlir/sparse-compiler-pass-sparsification-and-bufferization-pass/</link><pubDate>Mon, 05 Jun 2023 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/mlir/sparse-compiler-pass-sparsification-and-bufferization-pass/</guid><description>如我上上篇博客所提，MLIR 实现稀疏算法的方式是靠类似于 TACO 的 Sparse Compiler 来将普通操作转换成稀疏矩阵操作。 为了不引入新的操作和语义，MLIR sparse_tensor 只引入了</description></item><item><title>How mlir-opt work</title><link>https://blog.sh1mar.in/post/mlir/mlir-opt/</link><pubDate>Fri, 02 Jun 2023 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/mlir/mlir-opt/</guid><description>The main entry for running the mlir-opt program is mlir::MlirOptMain. It will register all the command line options, parse the command line input, open the input file, create the output file, and finally execute the shadowed mlir::MlirOptMain(output, buffer, registry, config) function. For convenience, name it MlirOptMainExec
The MlirOptMainExec function will set up threads and then start processing the input file memory buffer. The file memory buffer is added to the LLVM SourceMgr, a parser to handle include stacks and diagnostic wrangling.</description></item><item><title>Sparse Compiler</title><link>https://blog.sh1mar.in/post/sparsity/compiler/</link><pubDate>Fri, 26 May 2023 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/sparsity/compiler/</guid><description>除了前一篇文章提到的 List of list 结构，还有如 Coodinate format, Compress Sparse Row/Column， Diagonal 等数据结构，这些结构虽然设计上大有不同，但理念上是一样的： 一个只存数据</description></item><item><title>Sparsity 初见</title><link>https://blog.sh1mar.in/post/sparsity/intro/</link><pubDate>Fri, 12 May 2023 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/sparsity/intro/</guid><description>最近在研读 Direct Methods for Sparse Matrices 这本书。 发现国内似乎没有这本书的中文翻译，也很少见对这本书的讨论。 于是打算不让博客落灰，开一个读书笔记系列。 顺便利用博客</description></item><item><title>Debugging in function chain calling</title><link>https://blog.sh1mar.in/post/coding/debug-in-chain-calling/</link><pubDate>Tue, 28 Feb 2023 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/coding/debug-in-chain-calling/</guid><description>Sometimes I will write some code like:
let client = reqwest::Client::new(); let res = client .post(&amp;#34;example...&amp;#34;) .json(&amp;amp;payload) .send() .await .unwrap() .json::&amp;lt;Response&amp;gt;() .await .unwrap(); And there might be some error during the query, then the final json parser will get an unexpected JSON response that I need to figure out the actual content. But it is inconvenient to have to rewrite the code and break the chain call to debug.
let response = client.</description></item><item><title>Rust Builder pattern 学习总结</title><link>https://blog.sh1mar.in/post/coding/rust-builder/</link><pubDate>Wed, 01 Feb 2023 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/coding/rust-builder/</guid><description>过年期间用 Rust 写了个 DeepL API 的库，学了不少 Rust Builder Pattern 的知识，借此来水一篇新的博客。 本文的参考示例代码：Rust Playground DeepL 库源码： deepl-rs 本文将提到的 Async Builder 相关代码：</description></item><item><title>边造车轮边学习</title><link>https://blog.sh1mar.in/post/write-a-simple-server-state/</link><pubDate>Mon, 07 Nov 2022 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/write-a-simple-server-state/</guid><description>国庆几天把 Ruby，TypeScript 和 React 都粗粗浅浅地学了一下。 光看肯定不够，而学习新语言的一个办法之一就是造个轮子。 学 Ruby 的原因是想拿它来</description></item><item><title>给 Unmatched Bootloader 写个自动化！</title><link>https://blog.sh1mar.in/post/unmatched-bootloader-ci/</link><pubDate>Tue, 01 Nov 2022 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/unmatched-bootloader-ci/</guid><description>Unmatched 是 SiFive 发行的一款 RISC-V 的板子。 办公室的同事写了几个脚本，给这块板子弄了个非常清真，自主可控的 Arch Linux 固件。但是那几个脚本有些问题， 同时也必须需要一个</description></item><item><title>记我在 ThinkBook 16P 遇到的一些坑</title><link>https://blog.sh1mar.in/post/linux/thinkbook16p/</link><pubDate>Thu, 04 Aug 2022 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/linux/thinkbook16p/</guid><description>入职的时候公司给配了一台 ThinkBook 16p，i5-12500H 无显卡版本的。 然后装好 Arch Linux 后遇到了大量的坑。 首先是显示。联想的机器因为一些莫名其妙的原因</description></item><item><title>2022 年的租房经验总结</title><link>https://blog.sh1mar.in/post/ideology/house_renting/</link><pubDate>Sun, 31 Jul 2022 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/ideology/house_renting/</guid><description>前言 虽然在租房之前查了很多资料，也写了一个 TODO 表格来一项一项 确认租房事宜。但就算这样我还是趟了不少坑。所以想着把这次租房 的经历记录下来，不仅可</description></item><item><title>不喝咖啡之后我是怎么解决疲惫的</title><link>https://blog.sh1mar.in/post/health/mourning-routine/</link><pubDate>Thu, 14 Jul 2022 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/health/mourning-routine/</guid><description>从大三开始，我每天早上起床第一件事情就是手磨咖啡豆，然后法压一杯咖啡， 靠这点黑色浆液来消除昨天熬夜的疲惫。起初的半年还算有效，但到后面我需要</description></item><item><title>2022 年中忏悔</title><link>https://blog.sh1mar.in/post/ideology/summary_for_mid_2022/</link><pubDate>Fri, 20 May 2022 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/ideology/summary_for_mid_2022/</guid><description>前言 五月将尽，六月将至。眨眼间 2022 已经过去了一大半了。 就在昨天（五月十九日），我终于把毕业论文的终稿给定下来，同时顺利的结束了答辩。 一切都将尘</description></item><item><title>Rust 的 futures 实现（WIP）</title><link>https://blog.sh1mar.in/post/coding/futures-explained/2-futures-in-rust/</link><pubDate>Tue, 03 May 2022 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/coding/futures-explained/2-futures-in-rust/</guid><description>翻译自 https://cfsamson.github.io/books-futures-explained/1_futures_in_rust.html 2. Rust 的 Futures 实现 在这一章中，你将会学到： Rust 的高层级并发概念 当你写 async 代码时，Rust 为你提供的东西和缺少的东西 为什么我们在写 async 时需要一个 runtime</description></item><item><title>在 Arch Linux 上玩 osu stable</title><link>https://blog.sh1mar.in/post/tools/osu_on_arch/</link><pubDate>Wed, 27 Apr 2022 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/tools/osu_on_arch/</guid><description>前言 在 Arch Linux 上玩 osu 是我许久以来的愿望了。 我现在日常在 Linux 上工作，但有时候手痒想玩游戏的时候却总要重启， 切双系统到 Windows 上。因为历史原因，osu stable 没有</description></item><item><title>给 gauche 写个 bootstrap 脚本</title><link>https://blog.sh1mar.in/post/coding/bootstrap-gauch-on-archrv/</link><pubDate>Sun, 13 Feb 2022 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/coding/bootstrap-gauch-on-archrv/</guid><description>前言 上周在给 Arch 打包的时候看到了一个还没进仓库的包 gauche 需要 bootstrap。 因为我以前没打过 bootstrap 的包，有点想学，遂尝试挑战了一下。 gauche 的 x86 版本的 PKGBUILD</description></item><item><title>我的忏悔 2021</title><link>https://blog.sh1mar.in/post/ideology/summary_for_2021/</link><pubDate>Mon, 31 Jan 2022 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/ideology/summary_for_2021/</guid><description>我的忏悔 2021 2021 年我摸鱼了一整年。不管是自己的本科专业，还是计算机，亦或是在其他方面的发展都 停滞不前。而我只是纵容自己，任由自己摆烂。我对自己的</description></item><item><title>对 commit title 的一些思考</title><link>https://blog.sh1mar.in/post/git/thought-about-the-commit-title/</link><pubDate>Mon, 10 Jan 2022 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/git/thought-about-the-commit-title/</guid><description>前言 最近对自己的 commit convention 看得有点烦躁了。 我觉得自己又再次陷入了用一堆问题来解决另一堆问题的困境。 先简单讲讲具体发生了一些什么事情。 以前我一直在用</description></item><item><title>去你的 emo 和内卷</title><link>https://blog.sh1mar.in/post/ideology/fuck-emo-and-involution/</link><pubDate>Sun, 28 Nov 2021 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/ideology/fuck-emo-and-involution/</guid><description>今天在水群的时候，和群友们聊起了 “emo 和卷一样被 abused” 的话题。虽然两个词已经不是现在的潮流了（对的，只过了一个 月网友们就已经更新换</description></item><item><title>neovim 的简易教程 [WIP]</title><link>https://blog.sh1mar.in/post/neovim/neovim-tutorial/</link><pubDate>Sun, 31 Oct 2021 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/neovim/neovim-tutorial/</guid><description>前言 最近我打算开一个 neovim 系列，这个博客系列会分成几块来讲，首先是 neovim 的一些键位和 设置，然后再讲如何配置 packer 这个插件管理器，之后就是零零碎碎的写一写</description></item><item><title>How to write commit</title><link>https://blog.sh1mar.in/post/git/how-to-write-commit/</link><pubDate>Fri, 22 Oct 2021 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/git/how-to-write-commit/</guid><description>前言 对我而言，撰写 git commit 的内容是一个很重要的事情。因为我会把 commit 里的信息当成一份邮件，在开源社区里每个人都需要知道我做了什么，我为什么 要这么做，</description></item><item><title>Sign Your Commit With GPG</title><link>https://blog.sh1mar.in/post/git/sign-your-commit-with-gpg/</link><pubDate>Tue, 06 Jul 2021 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/git/sign-your-commit-with-gpg/</guid><description>使用 GPG 来签名 Commit 前几天一个朋友在群里提出了一个我从未考虑过的问题： “如果我在一个项目里用你的邮箱 commit，你会知道吗？”。 这个问题把我问住</description></item><item><title>Golang Polling Control Flow</title><link>https://blog.sh1mar.in/post/coding/circulate_job_gurdian_in_go/</link><pubDate>Sun, 21 Feb 2021 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/coding/circulate_job_gurdian_in_go/</guid><description>Go 的循环任务守护 前言 这几天在做的一个项目里，有一个功能需求是：长期运行一个轮询任务，通过轮询得到的返回的信息进行下一步操作。这个问题初一看是</description></item><item><title>让你的 neovim 像 IDE 一样强大</title><link>https://blog.sh1mar.in/post/neovim/neovim/</link><pubDate>Thu, 04 Feb 2021 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/neovim/neovim/</guid><description>让你的 NeoVim 和 IDE 一样强大 前言 Neovim 是一款完全拥有 vim 特性且拥有高度支持插件的编辑器软件，而他的高可自定义能力也深深吸引了像我这样的人。这篇文章我会带着</description></item><item><title>8个开发者需要的好习惯</title><link>https://blog.sh1mar.in/post/coding/%E5%BC%80%E5%8F%91%E8%80%85%E9%9C%80%E8%A6%81%E7%9A%84%E5%A5%BD%E4%B9%A0%E6%83%AF/</link><pubDate>Tue, 27 Oct 2020 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/coding/%E5%BC%80%E5%8F%91%E8%80%85%E9%9C%80%E8%A6%81%E7%9A%84%E5%A5%BD%E4%B9%A0%E6%83%AF/</guid><description>今天看到的一个很有价值的文章，决定自行翻译，英语水平有限，有歧义欢迎指出，原文地址 。 最佳做法 (Best Practices) 这段标题仍有改进空间 #1： 把解决问题放在第一</description></item><item><title>使用 Python 实现 JSON Web Token</title><link>https://blog.sh1mar.in/post/coding/%E7%94%A8python%E5%AE%9E%E7%8E%B0jwt/</link><pubDate>Sat, 19 Sep 2020 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/coding/%E7%94%A8python%E5%AE%9E%E7%8E%B0jwt/</guid><description>&lt;h2 id="前言">前言&lt;/h2>
&lt;p>涉及到无状态鉴权时，&lt;code>Token&lt;/code> 是比较好的验证用户身份的方案，而 &lt;code>Token&lt;/code> 如何制作也是一个设计难点。只是一个 &lt;code>Token&lt;/code> 去下载模块又增加依赖的负担，于是我去学习了 &lt;code>JWT(JSON Web Token)&lt;/code> 的设计方式。&lt;/p></description></item><item><title>黑苹果安装教程</title><link>https://blog.sh1mar.in/post/tools/%E9%BB%91%E8%8B%B9%E6%9E%9C/</link><pubDate>Sun, 25 Aug 2019 00:00:00 +0800</pubDate><guid>https://blog.sh1mar.in/post/tools/%E9%BB%91%E8%8B%B9%E6%9E%9C/</guid><description>前言 本篇文章的目的是为了减少新手爬贴的麻烦，但是怕麻烦的人尽早放弃黑苹果。一旦决心折腾黑苹果了，就一定要耐心做下去。黑苹果的安装就是刚完成一</description></item><item><title>Who is sh1marin</title><link>https://blog.sh1mar.in/about/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://blog.sh1mar.in/about/</guid><description>我叫 Avimitin，也叫 sh1marin，还叫 CookieBacon。 叫 Avimitin 是因为高中的时候迷恋各类音乐。 那段时间我很喜欢 Avicii 的电子乐，Col</description></item></channel></rss>