Posts on Leo3418's Personal Site https://leo3418.github.io/posts/index.html Recent content in Posts on Leo3418's Personal Site Hugo en Fri, 26 Dec 2025 18:29:24 -0500 SSH-ing into Kobo Clara BW E-book Reader's System Software https://leo3418.github.io/2025/12/26/kobo-clara-bw-ssh.html Fri, 26 Dec 2025 00:00:00 +0000 https://leo3418.github.io/2025/12/26/kobo-clara-bw-ssh.html <p>I recently bought a Kobo Clara BW e-book reader. While I was copying my e-books to it, I accidentally found that its system software came with an SSH server, which, once enabled, allowed me to explore some internals of the e-book reader&rsquo;s software as well as hardware.</p> <h2 id="the-purchase"> The Purchase<a class="header-link" title="Permalink" href="#the-purchase"><i class="fas fa-link"></i></a> </h2> <p>Since I just purchased this device, I feel that this post would be incomplete if I did not comment on the reason I got it or my experience with it. I shall make some remarks on these aspects before digressing too much.</p> Trying Out the Ptyxis Terminal Emulator https://leo3418.github.io/2025/08/14/trying-ptyxis.html Thu, 14 Aug 2025 00:00:00 +0000 https://leo3418.github.io/2025/08/14/trying-ptyxis.html <p>In my years of using GNOME, I have been using GNOME Terminal, and it has served me well. There has been a newer GNOME Console; while it has a few nice new features, it lacks a small feature that GNOME Terminal has and I depend on, so I have stayed with GNOME Terminal. Now, a third terminal emulator option for GNOME, Ptyxis (<a href="https://en.wiktionary.org/wiki/ptyxis"><em>TIK-sis</em></a>), has appeared. I tried it out recently and quickly found myself liking it, though my declaration that it would be a good-enough replacement of GNOME Terminal for myself came only after I spent a few days tinkering with it.</p> Set Up a Custom Gentoo Binary Package Host https://leo3418.github.io/2025/06/22/custom-gentoo-binhost.html Sun, 22 Jun 2025 00:00:00 +0000 https://leo3418.github.io/2025/06/22/custom-gentoo-binhost.html <p>Gentoo is a GNU/Linux distribution where users themselves can easily build software packages for the entire operating system from source code. For a long time, building packages on their own was the only choice Gentoo users had because Gentoo only distributed the scripts (i.e. ebuilds) to build the packages, not the packages&rsquo; ready-to-run, pre-built binaries like on other distributions. Compiling software packages for a whole operating system takes a considerable amount of time, and Gentoo users had had to deal with it. This all changed at the end of 2023, when <a href="https://www.gentoo.org/news/2023/12/29/Gentoo-binary.html">the official Gentoo binary package host was launched</a>. It has been providing users with pre-built binary packages for many software packages available in the Gentoo ebuild repository, and users can install these binary packages to skip the build process, thus saving time.</p> Build the Same LaTeX Input File Differently According to Command-Line Options https://leo3418.github.io/2024/06/21/latex-file-cmdline-build-options.html Fri, 21 Jun 2024 00:00:00 +0000 https://leo3418.github.io/2024/06/21/latex-file-cmdline-build-options.html <p>You might have encountered situations where you would like to produce different versions of the same document or create several related documents from a single source, such as:</p> <ul> <li> <p>All your document versions have exactly the same content, but each version is formatted differently. <strong>Example:</strong> In parallel with a standard version of your document, you might also want to create a more accessible version of it that uses a larger font size.</p> Framework Laptop 13 with AMD Ryzen 7 7840U https://leo3418.github.io/2024/06/13/framework-laptop-13-ryzen-7840u.html Thu, 13 Jun 2024 00:00:00 +0000 https://leo3418.github.io/2024/06/13/framework-laptop-13-ryzen-7840u.html <p><a href="https://frame.work/">Framework Laptops</a> are a series of laptops designed with user repairability, configurability, and upgradability in mind. After two years of launching exclusively models using Intel Core processors, Framework started to ship laptops with AMD Ryzen processors, which are what I looked for since I had heard of Framework. So, I purchased a Framework Laptop 13 with AMD Ryzen 7 7840U, received it in November 2023, and have been using it ever since, but only recently have I found time to write an article about my experience with it.</p> Minimize Steam When Launching a Game Shortcut on Windows https://leo3418.github.io/2023/07/15/minimize-steam-for-game-shortcuts.html Sat, 15 Jul 2023 00:00:00 +0000 https://leo3418.github.io/2023/07/15/minimize-steam-for-game-shortcuts.html <p>The recent Steam client major update has brought predominant user interface changes as well as a regression in user experience: if the Steam client is not running, and the user launches a Steam game from its desktop or Start menu shortcut, then the Steam client window will show up before the game launches; prior to the update, Steam would start minimized in this case, thus the window would not show up on its own.</p> Avoid Creating `-9999`-only Gentoo Packages https://leo3418.github.io/2023/02/07/avoid-9999-only-gentoo-packages.html Tue, 07 Feb 2023 00:00:00 +0000 https://leo3418.github.io/2023/02/07/avoid-9999-only-gentoo-packages.html <p>Some Gentoo packages provide a special <code>9999</code> version; by convention, the ebuild that bears the <code>9999</code> version is a <em>live ebuild</em>, which builds the package from its &ldquo;live&rdquo; sources in the project&rsquo;s version control system (VCS) repository &ndash; e.g. a Git repository &ndash; instead of &ldquo;non-live&rdquo; sources in a <code>.zip</code> or a <code>.tar.*</code> archive. The project&rsquo;s sources in the VCS repository are usually subject to frequent changes due to development activities, hence they are &ldquo;live&rdquo;.</p> Installing Gentoo via Asahi Linux on an Apple Silicon-based Mac https://leo3418.github.io/2023/01/14/gentoo-asahi-linux.html Sat, 14 Jan 2023 00:00:00 +0000 https://leo3418.github.io/2023/01/14/gentoo-asahi-linux.html <p>When Apple launched Macs with Apple silicon, people speculated that a revolution in desktop computing had started. I saw on Reddit a GNU/Linux user claimed that GNU/Linux distributions should start to worry about the potential transition from x86-64 to ARM64 and do something about it to survive. What they might have not realized was that common software packages that constitute GNU/Linux had been long prepared for ARM64 thanks to portability of high-level programming languages. The power houses built by Apple would not necessarily threaten GNU/Linux but instead set up a wider stage for it. Thanks to the <a href="https://asahilinux.org/">Asahi Linux</a> project&rsquo;s efforts, it is now possible to exploit an Apple silicon-based Mac&rsquo;s performance by running GNU/Linux on it. After seeing it for myself, I think the project is very promising in making Apple silicon-based Macs a worthy choice for GNU/Linux users.</p> Using New Feature While Maintaining Backward Compatibility in Hugo Templates https://leo3418.github.io/2023/01/06/hugo-tmpl-new-feature-backward-compat.html Fri, 06 Jan 2023 00:00:00 +0000 https://leo3418.github.io/2023/01/06/hugo-tmpl-new-feature-backward-compat.html <p>In the recent <a href="https://github.com/gohugoio/hugo/releases/tag/v0.109.0">v0.109.0 release</a> of Hugo, a new <code>.Ancestors</code> page variable was added to make it easier to implement a <a href="https://en.wikipedia.org/wiki/Breadcrumb_navigation">breadcrumb navigation</a> <a href="https://gohugo.io/content-management/sections/#example-breadcrumb-navigation">template</a>. The new variable&rsquo;s usefulness is clearly shown by how the example breadcrumb template in Hugo documentation has been simplified and become easier to understand, as presented below (code modified for readability). It is no longer necessary to create a helper inline partial (i.e. <code>breadcrumbnav</code> in the following example) and call it recursively.</p> Run Windows 98 in Vanilla DOSBox https://leo3418.github.io/2023/01/03/windows-98-in-vanilla-dosbox.html Tue, 03 Jan 2023 00:00:00 +0000 https://leo3418.github.io/2023/01/03/windows-98-in-vanilla-dosbox.html <p>As a DOS emulator, DOSBox is theoretically capable of running DOS-based versions of Windows, like Windows 3.1, 95, and 98. Certainly, the <a href="https://www.dosbox.com/comp_list.php?letter=W">compatibility list</a> on DOSBox official website classifies Windows 3.1 and 95 as <em>supported</em>; but for Windows 98, it is just rated <a href="https://www.dosbox.com/comp_list.php?showID=3485&amp;letter=W"><em>runnable</em></a> &ndash; even lower than the intermediate <em>playable</em> tier. Perhaps for this reason, most people would just resort to other DOSBox forks that offer better support for Windows 98, like <a href="https://dosbox-x.com/wiki/Guide%3AInstalling-Windows-98">DOSBox-X</a>, when they want to run this version of Windows.</p> Gentoo Configuration Guide: Full Disk LUKS2 with GRUB and systemd https://leo3418.github.io/2022/08/21/gentoo-config-luks2-grub-systemd.html Sun, 21 Aug 2022 00:00:00 +0000 https://leo3418.github.io/2022/08/21/gentoo-config-luks2-grub-systemd.html <p>This collection is a tutorial which provides instructions to set up LUKS2-based full disk encryption on a Gentoo system using GRUB as the bootloader and systemd as the init system. In particular, setting up LUKS2 for use with GRUB is especially tricky, and this tutorial addresses any intricacies there.</p> <p>This tutorial aims to support both new Gentoo installations and existing ones, so it can be used to encrypt an unencrypted system too.</p> Use Git to Manage Kernel Sources on Gentoo https://leo3418.github.io/2022/03/04/gentoo-kernel-git.html Fri, 04 Mar 2022 00:00:00 +0000 https://leo3418.github.io/2022/03/04/gentoo-kernel-git.html <p>Gentoo offers its users a wide array of Linux kernel packages in the <code>sys-kernel/*</code> category, each of which may install the kernel in a different way. In particular, the <code>sys-kernel/*-sources</code> packages (such as <code>sys-kernel/gentoo-sources</code>, <code>sys-kernel/vanilla-sources</code>) install only the kernel&rsquo;s source code and do nothing else. This is suitable for users who prefer to compile and install the kernel on their own but still would like to let the system package manager update the kernel sources automatically.</p> Refine Gentoo on Windows Subsystem for Linux https://leo3418.github.io/2022/02/28/gentoo-wsl-perfection.html Mon, 28 Feb 2022 00:00:00 +0000 https://leo3418.github.io/2022/02/28/gentoo-wsl-perfection.html <p>This article covers some information that can help perfect a Gentoo installation on <a href="https://docs.microsoft.com/en-us/windows/wsl/">Windows Subsystem for Linux (WSL)</a> to maximize its performance, improve its interoperability with Windows, and even unlock new system capabilities.</p> <p>Originally, I had been planning to write a full Gentoo on WSL installation tutorial during September of the last year, but that tutorial was only halfway done before I had to move on for something more important in my real life, which is why I have disappeared from my personal site for almost another half of year (though you could find my development activities on GitHub if you looked at my profile). Now that I can enjoy a short break with some peace of mind, I have decided to at least complete that tutorial. But before I started, I happened to search for &ldquo;Gentoo WSL&rdquo; on Google out of curiosity. While I had been away, there was a new <a href="https://wiki.gentoo.org/wiki/Gentoo_in_WSL"><em>Gentoo in WSL</em> article on Gentoo Wiki</a> originally created on November 24, 2021. That article already covers the bulk of what I wanted to mention in my tutorial in a very concise way, and it is easy to find thanks to the fact that it is on Gentoo Wiki, thus I could no longer see the value of repeating the identical things in lengthy and verbose paragraphs on my personal site.</p> GSoC 2021 Final Work Products https://leo3418.github.io/2021/08/22/gsoc-final-work-products.html Sun, 22 Aug 2021 00:00:00 +0000 https://leo3418.github.io/2021/08/22/gsoc-final-work-products.html <p>As this year&rsquo;s GSoC has come and gone, it is time to compile a retrospective of all the work I have done for my GSoC project. In a nutshell, the bulk of my project was executed as I had planned in my original project proposal; some additional deliverables and enhancements not outlined in the original plan were made, while a few planned and relatively trivial deliverables were cut due to time constraints.</p> An ebuild Testing Solution for ebuild Repositories https://leo3418.github.io/2021/08/01/ebuild-repos-testing-solution.html Sun, 01 Aug 2021 00:00:00 +0000 https://leo3418.github.io/2021/08/01/ebuild-repos-testing-solution.html <p>Common package managers implement the concept of software repositories to allow the set of packages installable from the package manager to be expanded. On Fedora, there is RPM Fusion and Copr repositories created and maintained by users. Arch Linux users are fond of the AUR, the canonical repository for user-submitted packages. On Gentoo, there is GURU, which is kind of like Gentoo&rsquo;s equivalent of AUR, but it is just the tip of the iceberg of packages that are not in the official Gentoo ebuild repository (<code>::gentoo</code>). There are various testing overlays maintained by projects and development teams of Gentoo and repositories for out-of-tree ebuilds, like <code>::gnome</code>, <code>::java</code>, and <code>::science</code>, let alone plenty of user personal overlays, like the <a href="https://github.com/6-6-6/spark-overlay">Spark overlay</a> I have been working on for example.</p> Finding Leaf Packages Faster: Optimization for In-degree Computation in Dependency Graph https://leo3418.github.io/2021/07/18/find-leaf-packages.html Sun, 18 Jul 2021 00:00:00 +0000 https://leo3418.github.io/2021/07/18/find-leaf-packages.html <p>Dependency is a concept that appears often in software engineering. In the <a href="https://leo3418.github.io/2021/07/05/gentoo-build-kt-src.html">previous article</a> for my GSoC project, I discussed build systems and package managers, both of which apply the concept of dependencies. A build system usually allows programmers to define different <em>tasks</em> in building a project and let each of them depend on other tasks, hence dependency relationships are established. A package manager supports declaration of package dependency relationships, or else it is not a good package manager. This article focuses on the latter, which is dependency relationships among packages.</p> Introducing ebuilds That Build Kotlin Core Libraries from Source https://leo3418.github.io/2021/07/05/gentoo-build-kt-src.html Mon, 05 Jul 2021 00:00:00 +0000 https://leo3418.github.io/2021/07/05/gentoo-build-kt-src.html <p>Since the last blog post regarding my GSoC project was posted, I moved on to the next part of the project: improvements on the Kotlin ebuilds in the <a href="https://github.com/6-6-6/spark-overlay">Spark overlay</a> created during last year&rsquo;s GSoC, namely <code>dev-java/kotlin-common-bin</code> and <code>dev-lang/kotlin-bin</code>. As shown by the <code>-bin</code> suffix in the packages&rsquo; names, these are packages that simply install the Kotlin library and compiler binary JARs pre-built by the upstream instead of build those artifacts from source like how the vast majority of Gentoo packages do and how <a href="https://wiki.gentoo.org/wiki/Gentoo_Java_Packing_Policy#Build_from_Source">Gentoo&rsquo;s guidelines</a> propose. At first, I thought it would be hard to build Kotlin from source <em>on Gentoo with Portage</em>, so I did not make any plan to create separate versions of those packages without the <code>-bin</code> suffix. Coincidentally, I discovered a possible way to work around Portage&rsquo;s limitations that would prevent Kotlin from being built from source, so I immediately started to conduct experiments on building Kotlin libraries from source within Portage. The experiment results were promising, therefore I decided to spend some time working on this and eventually created ebuilds that can build <a href="https://github.com/JetBrains/kotlin/tree/v1.5.20/libraries#kotlin-libraries">Kotlin core libraries</a> from source with a success. In this post, I will cover possible challenges in building a project like the Kotlin programming language on Gentoo, how my method of building it on Gentoo was accidentally discovered, and how the final ebuilds were produced.</p> Properly Handling Process Output When Using Java's `ProcessBuilder` https://leo3418.github.io/2021/06/20/java-processbuilder-stdout.html Sun, 20 Jun 2021 00:00:00 +0000 https://leo3418.github.io/2021/06/20/java-processbuilder-stdout.html <p>Another mysterious disappearance of me from my personal website has happened after the previous one in last November. The reason is the same: I had been quite busy. But unlike last time, I do not think that the things which kept me busy in the past month were futile. I spent significant amount of time helping students in a <a href="https://homes.cs.washington.edu/~rjust/courses/2021Spring/CSE403">software engineering course</a> for which I was a teaching assistant, and assisting others is always a meaningful activity in my opinion, regardless of the type of assistance being offered, the context, the recipient of the assistance, or the form.</p> Gentoo Configuration Guide: systemd https://leo3418.github.io/2021/04/27/gentoo-config-systemd.html Tue, 27 Apr 2021 00:00:00 +0000 https://leo3418.github.io/2021/04/27/gentoo-config-systemd.html <p>As of now, the Gentoo Handbook, which is the official Gentoo installation guide, mainly focuses on steps to install a system based on OpenRC instead of systemd. After all, as a project mainly maintained by Gentoo developers, it would be a surprise if Gentoo did not introduce OpenRC as the distribution&rsquo;s init system with primary support. For people who want to use systemd on Gentoo, the Handbook does include some instructions in itself, but it sometimes asks the users to refer to the <a href="https://wiki.gentoo.org/wiki/Systemd">standalone systemd article</a> too. In my opinion, that article is very comprehensive but is not well organized: steps that should be performed during the installation process scatter around the entire article, making it easy to miss required steps. Therefore, this article is created as my effort to come up with a clear and working procedure for getting systemd to work on Gentoo.</p> Gentoo Configuration Guide: GNOME on systemd https://leo3418.github.io/2021/04/24/gentoo-config-gnome-systemd.html Sat, 24 Apr 2021 00:00:00 +0000 https://leo3418.github.io/2021/04/24/gentoo-config-gnome-systemd.html <p>Getting a perfect GNOME configuration on Gentoo is not hard but is tricky. In other words, it would be a piece of cake once you have done it, but it is not easy to get it right with only one shot for the first time. The <a href="https://wiki.gentoo.org/wiki/GNOME/Guide">GNOME Guide on Gentoo Wiki</a> is a good resource and is enough for a barely functional GNOME installation, but there are plenty of rooms for improvements, like removing the authentication dialog when modifying network settings, and enabling Wayland screen sharing in web browsers like Google Chrome.</p> MC Forge Mod Dev Blog: Adding a Configuration GUI - 1.16 Version https://leo3418.github.io/2021/03/31/forge-mod-config-screen-1-16.html Wed, 31 Mar 2021 00:00:00 +0000 https://leo3418.github.io/2021/03/31/forge-mod-config-screen-1-16.html <p>The <a href="https://leo3418.github.io/2020/09/09/forge-mod-config-screen.html">very first blog post for this series</a> covered how I created a configuration GUI screen for a Minecraft Forge mod targeting Minecraft 1.14.4 and above, despite the fact that the related framework and library classes have been removed from Forge, and the core developers have decided that <a href="https://github.com/MinecraftForge/MinecraftForge/pull/7395#issuecomment-779515483">it should never be added back</a>. I am extremely disappointed to see LexManos, the leader of Forge, harshly rejecting more than one year of hard work of <a href="https://github.com/Cadiboo"><strong>@Cadiboo</strong></a>, the developer who started that linked pull request, with a willy-nilly closure of the pull request. This not only means another dissatisfaction of mine with the Minecraft Forge project but also my obligation to maintain an up-to-date method for creating a mod configuration screen. From my private communication with <a href="https://github.com/yuesha-yc"><strong>@yuesha-yc</strong></a>, a Minecraft mod developer who followed me on GitHub after reading my blogs and a current student of the high school I graduated from, I learned that my blog posts about a platform with extremely incomplete documentation can be very useful to developers of that platform. Thus, I will endeavor to share my knowledge about Minecraft Forge mod as before to the greatest possible extent.</p> A Patchy System -- Applying Patches with Portage to Fix Upstream Bugs https://leo3418.github.io/2021/03/01/portage-user-patches.html Mon, 01 Mar 2021 00:00:00 +0000 https://leo3418.github.io/2021/03/01/portage-user-patches.html <p>For many free software projects, there is usually some delay between the initial annoucement of a bug fix or an enhancement and the moment when you finally get the software update that ships it. As a user, you need to wait for the patch to get reviewed and accepted by the project, wait for the change to be tested and integrated, wait for the new version containing the change to be released by the upstream, and finally, wait for your distribution to ship the new release. Suppose there is a bug fix that will be included in the upcoming GNOME 40 release, which will probably be available in March 2021. If you are using Fedora Workstation, you must wait until the end of April to get that bug fix with Fedora 34. For Gentoo users, I would not expect the arrival of that bug fix until the second half of this year, because all recent GNOME updates took about half a year to land in Gentoo.</p> Create a CPU Frequency and Temperature Monitoring Bash Script for Linux-based Systems https://leo3418.github.io/2021/02/09/linux-cpu-freq-temp-mon-script.html Tue, 09 Feb 2021 00:00:00 +0000 https://leo3418.github.io/2021/02/09/linux-cpu-freq-temp-mon-script.html <p>This post will show you a way to monitor CPU frequency and temperature on Linux-based systems without aid of any programs or packages that are not commonly preinstalled on major GNU/Linux distributions. No extra hardware drivers are required: the magic is done merely by a short Bash script in just a few lines that only relies on mechanisms provided by the Linux kernel itself and some most essential Unix commands.</p> MC Forge Mod Dev Blog: Migrating to Minecraft 1.16 https://leo3418.github.io/2021/02/06/forge-mod-migrate-to-1-16.html Sat, 06 Feb 2021 00:00:00 +0000 https://leo3418.github.io/2021/02/06/forge-mod-migrate-to-1-16.html <p>It is no longer news that Minecraft Forge has stable Minecraft 1.16 support, as the first recommended build for 1.16.x, which is Forge 34.1.0, was released in September 2020, very soon after I published <a href="https://leo3418.github.io/2020/09/09/forge-mod-config-screen.html">the previous blog post for this serires</a> about an update to my mod project. Development of Forge for Minecraft 1.16.x already had significant progress when the update for my mod was worked on, and I contemplated adding support for 1.16 along with that update. However, after a hard attempt to port my mod to Minecraft 1.16, I decided that because many method names in the Minecraft API source code decompiled by MCP were still not fully <em>deobfuscated</em>, Forge on 1.16 was still immature, and my mod&rsquo;s update would not ship with 1.16 support.</p> My Gentoo Hands-on Experience https://leo3418.github.io/2020/11/20/gentoo-hands-on.html Fri, 20 Nov 2020 00:00:00 +0000 https://leo3418.github.io/2020/11/20/gentoo-hands-on.html <p>It has been six weeks since I published the last post on this site. Myriad new topics and ideas to write about have accumulated in my drafts for new articles, but I was too busy to find enough time for converting them into high-quality articles I have been endeavored to deliver. Now, as I finally have got some free time, I want to talk about one of the things I did during the past period: trying out <a href="https://gentoo.org/">Gentoo</a>, a <em>source-based</em> GNU/Linux distribution famous for letting its users compile almost every component of the operating system, including the Linux kernel.</p> Use Btrfs on Fedora Installed from a Raw Image https://leo3418.github.io/2020/10/08/fedora-raw-image-btrfs.html Thu, 08 Oct 2020 00:00:00 +0000 https://leo3418.github.io/2020/10/08/fedora-raw-image-btrfs.html <p>Fedora <a href="https://fedoramagazine.org/btrfs-coming-to-fedora-33/">is moving</a> to <a href="https://en.wikipedia.org/wiki/Btrfs">Btrfs</a> for its default file system on its &ldquo;desktop variants&rdquo; in Fedora 33. This change is welcomed by some users because of some benefits Btrfs is offering. Other Fedora variants still default to ext4, although users may elect to use Btrfs during system installation with the Anaconda installer. But for non-desktop-variant raw image distributions like the Minimal <code>aarch64</code> image, you do not have the chance to choose a file system other than ext4, because you are applying the image directly instead of using Anaconda. This post will show you how to use Btrfs on a Fedora installation derived from such image by converting the file system after the image is applied.</p> USB Issue on Raspberry Pi 4 Running Fedora - Complex Solution https://leo3418.github.io/2020/09/21/raspi4-fedora-usb-complex.html Mon, 21 Sep 2020 00:00:00 +0000 https://leo3418.github.io/2020/09/21/raspi4-fedora-usb-complex.html <p>In <a href="https://leo3418.github.io/2020/09/20/raspi4-fedora-usb-simple.html">the previous post</a> we looked at a very simple solution to fix the USB ports on Raspberry Pi 4B 4GB/8GB RAM models running Fedora, which involves a trade-off between the USB ports' functionality and the amount of RAM available to the operating system. This post will give you another solution that takes more steps but no longer limits available memory to 3 GiB.</p> <p>As said in the previous post, no action is required for the 2GB model. The symptoms of this issue are available <a href="https://leo3418.github.io/2020/09/20/raspi4-fedora-usb-simple.html#symptoms">there</a> as well.</p> USB Issue on Raspberry Pi 4 Running Fedora - Simple Solution https://leo3418.github.io/2020/09/20/raspi4-fedora-usb-simple.html Sun, 20 Sep 2020 00:00:00 +0000 https://leo3418.github.io/2020/09/20/raspi4-fedora-usb-simple.html <p>When Fedora runs on Raspberry Pi 4B 4GB/8GB RAM models, the USB ports might not be working out-of-box as of Fedora 32 and Linux kernel 5.8. In this post, I will introduce a very simple solution to this problem that only requires you to add one line to a configuration file.</p> <h2 id="notes-and-caveats"> Notes and Caveats<a class="header-link" title="Permalink" href="#notes-and-caveats"><i class="fas fa-link"></i></a> </h2> <ul> <li> <p>If you are using the 2GB model, then rest assured - the USB ports should work out-of-box, and you do not need to do anything. This issue exists only on the 4GB and 8GB models.</p> MC Forge Mod Dev Blog: Adding a Configuration GUI https://leo3418.github.io/2020/09/09/forge-mod-config-screen.html Wed, 09 Sep 2020 00:00:00 +0000 https://leo3418.github.io/2020/09/09/forge-mod-config-screen.html <p>Minecraft Forge had been shipping a configuration GUI framework which mods could use to provide customization options, but the framework has been gone since Minecraft 1.13. This post describes how I created a mod configuration GUI without using that framework by directly using APIs of Minecraft.</p> <p>The procedure shown in this post is applicable to Minecraft 1.14.4 and 1.15.x. I did not check its correctness on Minecraft 1.13.x and old 1.14.x releases since those Minecraft versions do not have stable Minecraft Forge builds, but chances are the majority of the steps are also applicable to those versions. Nevertheless, I would recommend developing mods using only stable Minecraft Forge releases.</p> Perform Manual `dnf history undo` https://leo3418.github.io/2020/07/31/manual-dnf-history-undo.html Fri, 31 Jul 2020 00:00:00 +0000 https://leo3418.github.io/2020/07/31/manual-dnf-history-undo.html <p>My choices of GNU/Linux distributions are Fedora for desktop computers and CentOS for servers. Both of them feature DNF - Red Hat&rsquo;s package manager front-end for RPM, which is the primary reason I use these distributions. Although one might argue that it is slow, DNF is very clear on not only what it will do for an action but also <em>what it has done</em>: it maintains a history of package installation and removal operations, which are called &ldquo;transactions&rdquo;. You can undo a transaction with <code>dnf history undo</code> or roll back to a previous state with <code>dnf history rollback</code>. Other common package managers, like APT and Pacman, also save operation logs, but they generally do not offer a similar operation reverting functionality.</p> Install Raspberry Pi's `vcgencmd` on Fedora https://leo3418.github.io/2020/07/27/compile-vcgencmd-on-fedora.html Mon, 27 Jul 2020 00:00:00 +0000 https://leo3418.github.io/2020/07/27/compile-vcgencmd-on-fedora.html <p>This post is a continuation of my <a href="https://leo3418.github.io/2020/07/24/fedora-raspi-cluster.html">previous one</a> about setting up a cluster of Raspberry Pis running Fedora. After I got the cluster to compute something, <a href="https://github.com/ColsonXu"><strong>@ColsonXu</strong></a>, the cluster&rsquo;s owner, asked me if I could monitor the CPU temperature of each Raspberry Pi by running this command:</p> <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> /opt/vc/bin/vcgencmd measure_temp </span></span></code></pre></div> <p>The <a href="https://www.raspberrypi.org/documentation/raspbian/applications/vcgencmd.md"><code>vcgencmd</code> program</a> is included in Raspberry Pi OS (formerly called Raspbian) as a utility for retrieving information about Raspberry Pi&rsquo;s hardware. However, it is not included in Fedora&rsquo;s software repositories. Luckily though, the source code of <code>vcgencmd</code>, along with the entire <a href="https://github.com/raspberrypi/userland"><code>userland</code> package</a> that contains the program, is available, so we can compile it on our own.</p> Set Up Fedora on a Raspberry Pi Cluster https://leo3418.github.io/2020/07/24/fedora-raspi-cluster.html Fri, 24 Jul 2020 00:00:00 +0000 https://leo3418.github.io/2020/07/24/fedora-raspi-cluster.html <p>First and foremost, I would like to thank <a href="https://github.com/ColsonXu"><strong>@ColsonXu</strong></a> for giving me this opportunity to play with some Raspberry Pis. He had got a few Raspberry Pi 4&rsquo;s and built a cluster with them for computing purposes, but there was nothing to compute until the morning when <a href="https://github.com/mrdarcychen"><strong>@mrdarcychen</strong></a> found <a href="https://fedoramagazine.org/running-rosettahome-on-a-raspberry-pi-with-fedora-iot/">an article about running Rosetta@home on Raspberry Pi</a> from Fedora Magazine, and Colson approved the plan. I was able to take the job of installing software required to run Rosetta@home on the Raspberry Pis.</p> Use `grep` as a Substitute for `cat` https://leo3418.github.io/2020/06/21/grep-as-cat.html Sun, 21 Jun 2020 00:00:00 +0000 https://leo3418.github.io/2020/06/21/grep-as-cat.html <p>I came across a fascinating and educative article, <a href="https://www.ee.ryerson.ca/~elf/hack/recovery.html">Unix Recovery Legend</a>, when someone posted a link to it on Reddit. The article presents a story of the writer, Mario Wolczko, and some other colleagues attempting to recover a system partially destructed by <code>rm -rf /</code>.</p> <p>The <code>rm</code> command was interrupted before it scraped off directories like <code>/usr</code>, but it was too late to save <code>/bin</code>, <code>/dev</code> and <code>/etc</code>, which were respectively the directory for basic executable programs, device files, and system configuration files. Commands like <code>ls</code> and <code>ps</code> were now on strike since their executables were in <code>/bin</code>, the backup tape could not be mounted because the tape deck&rsquo;s device entries were gone with <code>/dev</code>, and absence of network configuration files in <code>/etc</code> denied any possibility to rescue the system through the network.</p> Use Cygwin's Shell or Git Bash in Windows Terminal https://leo3418.github.io/2020/05/24/cygwin-git-bash-in-wt.html Sun, 24 May 2020 00:00:00 +0000 https://leo3418.github.io/2020/05/24/cygwin-git-bash-in-wt.html <p>Recently, Microsoft has made the first stable release of Windows Terminal, a new terminal program for Windows 10. Windows Terminal allows you to add and use multiple shells, like Windows PowerShell, the old command prompt, and any shell in your Windows Subsystem for Linux (WSL) environments. It also provides way more features and customization options than the old Windows console host <code>conhost.exe</code>, which has been used for command prompt and WSL.</p> Share GTA V Game Files Between Steam and Epic Games https://leo3418.github.io/2020/05/15/gta-v-steam-epic-games.html Fri, 15 May 2020 00:00:00 +0000 https://leo3418.github.io/2020/05/15/gta-v-steam-epic-games.html <p>After Epic Games announced that it would give away free copies of GTA V for a week, many people started to claim this gift on that game platform. Even some existing GTA V players who have already purchased the game on Steam had decided to get another free copy so they could have two or more GTA Online accounts.</p> <p>It appears that if you have already installed GTA V via Steam, you still need to download a full copy of the game files via Epic Games. However, by doing some tricks, you can let Steam and Epic Games share the same set of GTA V game files to avoid downloading the game again and thus save disk space. We will use the <code>MKLINK</code> command on Windows, which is not well-known, to create a link to the existing game files. The link works as if the linked files and folders are exactly there, but it occupies very little space.</p> Restarting This Personal Site https://leo3418.github.io/2020/04/24/restarting-personal-site.html Fri, 24 Apr 2020 00:00:00 +0000 https://leo3418.github.io/2020/04/24/restarting-personal-site.html <p>I have been planning to repurpose my personal website on GitHub Pages as a blog for jotting down how I play around with different technologies. When I try something new, I usually spend some time reading tutorials, help articles, and blog posts about it. But of course, my reading is not limited to a single resource; instead, I often combine knowledge and steps across multiple resources and produce something not described by any single existing webpage. It would be very helpful if I write an article describing everything I&rsquo;ve done, so just in case the same task needs to be performed again, the resources I would need could reduce from several different webpages to a single article, which is great.</p>