Posts

Enable Wi-Fi by Default on OpenWrt

7 minutes to read

On routers with an Ethernet port, OpenWrt has Wi-Fi disabled on the first boot “for security reasons.”1 To enable Wi-Fi, users need to first connect a device to the router via Ethernet, so they can access the router in a wired manner and change its configuration to set up Wi-Fi. This is more inconvenient than most routers’ stock firmware. These routers come with a unique default SSID and password printed on a sticker affixed to the router, and for the initial setup, users can connect to the router wirelessly using these credentials; Ethernet is not required. OpenWrt, however, cannot easily make use of default Wi-Fi credentials. Constant initial Wi-Fi password in the default configuration (which would be common for every OpenWrt device on the first boot) is certainly a security risk; randomized passwords are more secure, but there is no means to inform users of the random password before the users have connected to the router, unlike what router manufacturers can do with the sticker. Therefore, disabling Wi-Fi by default on OpenWrt does improve security. …

Create an External-Facing IPv6 Subnet on OpenWrt

20 minutes to read

Some home Internet users have a need to expose some devices on their home network to the Internet and meanwhile block external access to other devices. For example, some users may wish to allow external access to their home server and prevent their smartphones and workstations from being accessible from the Internet. To achieve this goal, these users can create a subnet exposed to the Internet on their router and put the external-facing devices into this subnet; the other devices can thus be kept on the default local area network (LAN) subnet, protected behind a firewall that blocks external access. The external-facing subnet is commonly referred to as a demilitarized zone (DMZ). …

Using MultiOS-USB to Create Multiboot USB Drive

9 minutes to read

A multiboot USB drive allows its user to boot different ISOs without erasing the drive. Before I was aware of it, I had been using traditional bootable USB drive creation tools like Rufus, which would require rerunning the tool and erasing the drive every time I would like to boot a different ISO. A multiboot USB drive does not have this limitation. If I want to boot a GNU/Linux distribution’s installation ISO when I only have a USB drive on which a Windows installation ISO is already loaded, and if the USB drive supports multiboot, then I just need to copy the GNU/Linux distribution’s ISO to the drive, and the drive will allow me to choose the ISO I want to boot. The Windows ISO can still be booted and need not be erased, and an added bonus is that I can do this using just a file explorer or the cp command, instead of rerunning the bootable drive creation tool or running a complicated command. …

Slipstream Windows NT 4.0 SP6a into Installation Media

7 minutes to read

Microsoft has once released official Windows installation media with a service pack integrated, such as Windows Vista with SP1 and Windows XP with SP2. The process of integrating a service pack into the installation media is called slipstreaming. By using such a slipstreamed media, users need not install the slipstreamed service pack separately after they have installed Windows. For Windows NT 4.0 Workstation, the latest slipstreamed official installation media that can be found online only have SP1, whereas the latest service pack for Windows NT 4.0 is SP6a. This is unlike Windows 2000, XP, Vista, or 7, all of which have official installation ISOs with the latest available service pack slipstreamed. …

Trim Linux Kernel Configuration

14 minutes to read

Many Linux users who prefer to compile their own kernels definitely want to reduce kernel compilation time and minimize the on-disk footprint of compiled kernels and modules. Achieving these goals is commonly done by trimming the kernel configuration, which entails disabling kernel configuration options that the user does not need. Users can disable options for software features they do not use and hardware that they do not own; for example, those who do not need to use WireGuard can disable it in their kernel configuration, and those who do not own an AMD graphics card or an AMD CPU with integrated graphics can disable the amdgpu driver at kernel build time. …

SSH-ing into Kobo Clara BW E-book Reader’s System Software

19 minutes to read

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’s software as well as hardware. The Purchase 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. …

Trying Out the Ptyxis Terminal Emulator

12 minutes to read

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 (TIK-sis), 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. …

Set Up a Custom Gentoo Binary Package Host

Updated: 25 minutes to read

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’ 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 the official Gentoo binary package host was launched. 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. …

Build the Same LaTeX Input File Differently According to Command-Line Options

10 minutes to read

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: All your document versions have exactly the same content, but each version is formatted differently. Example: 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. …

Framework Laptop 13 with AMD Ryzen 7 7840U

20 minutes to read

Framework Laptops 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. …

Minimize Steam When Launching a Game Shortcut on Windows

5 minutes to read

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. …

Avoid Creating -9999-only Gentoo Packages

Updated: 21 minutes to read

Some Gentoo packages provide a special 9999 version; by convention, the ebuild that bears the 9999 version is a live ebuild, which builds the package from its “live” sources in the project’s version control system (VCS) repository – e.g. a Git repository – instead of “non-live” sources in a .zip or a .tar.* archive. The project’s sources in the VCS repository are usually subject to frequent changes due to development activities, hence they are “live”. …

Installing Gentoo via Asahi Linux on an Apple Silicon-based Mac

20 minutes to read

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 Asahi Linux project’s efforts, it is now possible to exploit an Apple silicon-based Mac’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. …

Using New Feature While Maintaining Backward Compatibility in Hugo Templates

Updated: 8 minutes to read

In the recent v0.109.0 release of Hugo, a new .Ancestors page variable was added to make it easier to implement a breadcrumb navigation template. The new variable’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. breadcrumbnav in the following example) and call it recursively. …

Run Windows 98 in Vanilla DOSBox

14 minutes to read

As a DOS emulator, DOSBox is theoretically capable of running DOS-based versions of Windows, like Windows 3.1, 95, and 98. Certainly, the compatibility list on DOSBox official website classifies Windows 3.1 and 95 as supported; but for Windows 98, it is just rated runnable – even lower than the intermediate playable tier. Perhaps for this reason, most people would just resort to other DOSBox forks that offer better support for Windows 98, like DOSBox-X, when they want to run this version of Windows. …

Gentoo Configuration Guide: Full Disk LUKS2 with GRUB and systemd

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. This tutorial aims to support both new Gentoo installations and existing ones, so it can be used to encrypt an unencrypted system too.

Use Git to Manage Kernel Sources on Gentoo

Updated: 12 minutes to read

Gentoo offers its users a wide array of Linux kernel packages in the sys-kernel/* category, each of which may install the kernel in a different way. In particular, the sys-kernel/*-sources packages (such as sys-kernel/gentoo-sources, sys-kernel/vanilla-sources) install only the kernel’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. …

Refine Gentoo on Windows Subsystem for Linux

8 minutes to read

This article covers some information that can help perfect a Gentoo installation on Windows Subsystem for Linux (WSL) to maximize its performance, improve its interoperability with Windows, and even unlock new system capabilities. 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 “Gentoo WSL” on Google out of curiosity. While I had been away, there was a new Gentoo in WSL article on Gentoo Wiki 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. …

GSoC 2021 Final Work Products

10 minutes to read

As this year’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. …

An ebuild Testing Solution for ebuild Repositories

19 minutes to read

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’s equivalent of AUR, but it is just the tip of the iceberg of packages that are not in the official Gentoo ebuild repository (::gentoo). There are various testing overlays maintained by projects and development teams of Gentoo and repositories for out-of-tree ebuilds, like ::gnome, ::java, and ::science, let alone plenty of user personal overlays, like the Spark overlay I have been working on for example. …

Finding Leaf Packages Faster: Optimization for In-degree Computation in Dependency Graph

15 minutes to read

Dependency is a concept that appears often in software engineering. In the previous article 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 tasks 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. …

Introducing ebuilds That Build Kotlin Core Libraries from Source

Updated: 16 minutes to read

An initial and successful attempt to create source-based Kotlin packages on Gentoo

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 Spark overlay created during last year’s GSoC, namely dev-java/kotlin-common-bin and dev-lang/kotlin-bin. As shown by the -bin suffix in the packages’ 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 Gentoo’s guidelines propose. At first, I thought it would be hard to build Kotlin from source on Gentoo with Portage, so I did not make any plan to create separate versions of those packages without the -bin suffix. Coincidentally, I discovered a possible way to work around Portage’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 Kotlin core libraries 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. …

Properly Handling Process Output When Using Java’s ProcessBuilder

16 minutes to read

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 software engineering course 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. …

Gentoo Configuration Guide: systemd

Updated: 5 minutes to read

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’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 standalone systemd article 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. …

Gentoo Configuration Guide: GNOME on systemd

Updated: 5 minutes to read

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 GNOME Guide on Gentoo Wiki 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. …

MC Forge Mod Dev Blog: Adding a Configuration GUI - 1.16 Version

14 minutes to read

The very first blog post for this series 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 it should never be added back. I am extremely disappointed to see LexManos, the leader of Forge, harshly rejecting more than one year of hard work of @Cadiboo, 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 @yuesha-yc, 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. …

A Patchy System – Applying Patches with Portage to Fix Upstream Bugs

12 minutes to read

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. …

Create a CPU Frequency and Temperature Monitoring Bash Script for Linux-based Systems

4 minutes to read

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. …

MC Forge Mod Dev Blog: Migrating to Minecraft 1.16

Updated: 13 minutes to read

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 the previous blog post for this serires 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 deobfuscated, Forge on 1.16 was still immature, and my mod’s update would not ship with 1.16 support. …

My Gentoo Hands-on Experience

Updated: 14 minutes to read

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 Gentoo, a source-based GNU/Linux distribution famous for letting its users compile almost every component of the operating system, including the Linux kernel. …

Use Btrfs on Fedora Installed from a Raw Image

8 minutes to read

Fedora is moving to Btrfs for its default file system on its “desktop variants” 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 aarch64 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. …

USB Issue on Raspberry Pi 4 Running Fedora - Complex Solution

Updated: 7 minutes to read

In the previous post 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. As said in the previous post, no action is required for the 2GB model. The symptoms of this issue are available there as well. …

USB Issue on Raspberry Pi 4 Running Fedora - Simple Solution

3 minutes to read

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. Notes and Caveats 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. …

MC Forge Mod Dev Blog: Adding a Configuration GUI

Updated: 19 minutes to read

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. 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. …

Perform Manual dnf history undo

8 minutes to read

My choices of GNU/Linux distributions are Fedora for desktop computers and CentOS for servers. Both of them feature DNF - Red Hat’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 what it has done: it maintains a history of package installation and removal operations, which are called “transactions”. You can undo a transaction with dnf history undo or roll back to a previous state with dnf history rollback. Other common package managers, like APT and Pacman, also save operation logs, but they generally do not offer a similar operation reverting functionality. …

Install Raspberry Pi’s vcgencmd on Fedora

Updated: 5 minutes to read

This post is a continuation of my previous one about setting up a cluster of Raspberry Pis running Fedora. After I got the cluster to compute something, @ColsonXu, the cluster’s owner, asked me if I could monitor the CPU temperature of each Raspberry Pi by running this command: $ /opt/vc/bin/vcgencmd measure_temp The vcgencmd program is included in Raspberry Pi OS (formerly called Raspbian) as a utility for retrieving information about Raspberry Pi’s hardware. However, it is not included in Fedora’s software repositories. Luckily though, the source code of vcgencmd, along with the entire userland package that contains the program, is available, so we can compile it on our own. …

Set Up Fedora on a Raspberry Pi Cluster

14 minutes to read

First and foremost, I would like to thank @ColsonXu for giving me this opportunity to play with some Raspberry Pis. He had got a few Raspberry Pi 4’s and built a cluster with them for computing purposes, but there was nothing to compute until the morning when @mrdarcychen found an article about running Rosetta@home on Raspberry Pi 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. …

Use grep as a Substitute for cat

4 minutes to read

I came across a fascinating and educative article, Unix Recovery Legend, 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 rm -rf /. The rm command was interrupted before it scraped off directories like /usr, but it was too late to save /bin, /dev and /etc, which were respectively the directory for basic executable programs, device files, and system configuration files. Commands like ls and ps were now on strike since their executables were in /bin, the backup tape could not be mounted because the tape deck’s device entries were gone with /dev, and absence of network configuration files in /etc denied any possibility to rescue the system through the network. …

Use Cygwin’s Shell or Git Bash in Windows Terminal

5 minutes to read

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 conhost.exe, which has been used for command prompt and WSL. …

Share GTA V Game Files Between Steam and Epic Games

Updated: 5 minutes to read

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. 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 MKLINK 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. …

Restarting This Personal Site

4 minutes to read

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’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. …