Illustration for Preventing Pipewire from being SIGKILLed

Preventing Pipewire from being SIGKILLed

Problem I frequently encounter the situation that the Pipewire audio server is suddenly stopped: The problem usually appears when I connect/disconnect my laptop from the power adapter. My computer usually lags for a short time while switching between performance profiles. systemctl --user status pipewire.service only shows that the Pipewire process was terminated by a SIGKILL signal, without any other useful log information. Neither coredumpctl nor dmesg shows the existence of a core dump event. Cause The Pipewire process runs with realtime priority, with which its scheduling needs are satisfied first, so it can process audio data in time to prevent stuttering. To increase its process priority,...

Reverse Engineered Linux Driver for HP OMEN Macro Keys

I got a new laptop some time ago, an HP OMEN 17t-ck000. While it's a nice laptop with excellent build quality and performance, it has one problem: it's drivers under Linux are far from complete. No support for fan speed control. You can see the fan speed but that's it. In addition, HP's default fan control strategy is very agressive, in the sense that even with fan spin down enabled in BIOS, the fan keeps running with the CPU being around 40 degrees celsius and GPU being idle. Actually, NBFC can be used to control the fan speed by directly writing to EC registers, but in an unfortunate accident I lost my configuration file. I was trying NixOS on my new laptop when I set up NBFC. When the accident happened, I had removed NixOS from the laptop,...

Disabling Webcams During an Online Course

This post will explain the way to disable your webcam on Windows and Linux, so: On the OS level, prevent you from turning on the webcam by mistake, and live-stream your footage of having a meal lying on the bed playing games (NSFW) Prevent certain online lecturing software from secretly turning on the webcam. Windows Procedures Press the Win+R combination key to open the Run window, type devmgmt.msc and enter to open the Device Manager. Your camera will be in Image Acquisition Devices category, right-click on it to disable it. (The following picture is taken from a Simplified Chinese Windows XP, but the procedure and icons should be similar for Windows 7 and 10.) When you need to use the camera, come back to re-enable it, and then close and reopen your browser or online lecturing software....

Raspberry Pi 3B Tinkering Notes: BT Download and Policy Routing

Let's get straight to the point this time. (Actually, I'm not sure how to start.) Installing Transmission for PT As a compact computer that can freely connect to various sensors, the Raspberry Pi offers high playability. Even if you don't want to connect a bunch of sensors to the GPIO (or like me, think additional sensors are temporarily unnecessary), you can leverage its low-power characteristics to run it 24/7 for tasks that don't require heavy CPU computation but take a long time to complete due to other factors—like... background downloading. My university has an intranet PT (Private Tracker) site. A PT site is a platform for releasing BT seeds, but it adds user management features on top of traditional BT. By restricting client types and enforcing upload ratio requirements,...

Illustration for Using the SSH Blacklist System of Northeastern University Network Center

Using the SSH Blacklist System of Northeastern University Network Center

The Network Center of Northeastern University provides an SSH blacklist on its official website, which records IP addresses detected using port scanning tools on SSH ports. This system appears to be based on statistics collected from their own honeypot servers. They also offer a downloadable hosts.deny file corresponding to the blacklist, allowing users to automatically update the SSH blacklist and block these scanners (preventing them from logging in) using scheduling tools like cron. It's unclear exactly when this system was implemented, but it has been operational for at least two years. Additionally, the blocking duration for these IP addresses appears to be 60 days from their last detection. Usage method: Install cron on your server and run the following commands to set up the script:...

Illustration for Troubleshooting a Linux Memory Leak

Troubleshooting a Linux Memory Leak

Root Cause I recently developed a VPS monitoring system using PHP, consisting of both server-side and client-side components. At 3 PM today, I added a service monitoring feature to check running services on VPS instances. Since all my VPSes run Debian 8, I used service --status-all to retrieve service statuses. After successful testing, I moved on to other tasks. Around 9 PM, I received an alert email from NodeQuery indicating high memory usage on one of my VPS instances since 7 PM. Checking my monitoring system, I found this VPS consuming 400M/500M memory. Another VPS showed even higher usage at 600M/1G, though it didn't trigger alerts due to larger total memory. The mystery was:...

Installing Closed-Source Driver for BCM4331 Network Card on Ubuntu

The Ubuntu system supports a wide range of devices out-of-the-box because it includes numerous open-source drivers provided by the community. However, open-source drivers often suffer from stability and performance issues compared to official drivers. Due to licensing restrictions, closed-source drivers cannot be bundled with the installation media, so users typically need to install them immediately after setting up Ubuntu. As noted by Zhihu user Deng Boyuan: http://www.zhihu.com/question/22776909 Windows消失后:一时间世界人民给石油工地的电脑装上Linux和新开发的Linux上的工业软件,但是圈内就石油设备的驱动问题分成两派,美国的开源原教旨主义者坚持在墨西哥湾的钻井平台上使用开源驱动,导致产能大大下降;大庆油田被cnbeta的技术宅装上了5种桌面8种发行版并逐一美化跑分,而且要用石油设备放个Bad Apple,...

Installing Ubuntu on a Macbook Pro

The macOS is indeed beautiful and smooth. However, VirtualBox runs terribly slow on it, and many functions that are simple to implement on Windows or Ubuntu require significant effort on Mac. Additionally, I've seen online articles showing that Ubuntu scores much higher than macOS in UnixBench tests. Therefore, I decided to install Ubuntu on my Macbook. After researching, I found my Macbook is a mid-2012 model (Macbook 9-2). According to Ubuntu's official wiki, Ubuntu can only coexist with macOS on this model – it cannot be installed alone, otherwise boot issues will occur. Seriously? Mac's bootloader and OS are separate! GParted in Ubuntu's live environment shows macOS created three partitions: a 200MB FAT32 EFI boot partition, an HFS+ formatted system partition,...

Illustration for Booting SliTaz Linux Using an Android Phone

Booting SliTaz Linux Using an Android Phone

For Android phone users, almost everyone knows that connecting your phone to a computer via USB allows it to function as a USB drive for file storage. But did you know that an Android phone can also be used to boot Linux on a computer? First, let's discuss computer booting. When you press the power button, components like the CPU and memory receive power and begin executing a pre-installed program on the motherboard called BIOS. BIOS then starts your operating system in the following ways: It searches devices in the boot order sequence (optical drive, hard disk, network, etc.) as configured. If a bootable device is found, it executes the code on that device to start the system. If you press the boot menu key (usually Esc or F12) to manually select the hardware,...

Illustration for Installing LRC Lyrics Display Plugin and Enabling SRS WOW-like Sound Effects in Ubuntu

Installing LRC Lyrics Display Plugin and Enabling SRS WOW-like Sound Effects in Ubuntu

My ASUS laptop originally had a sound card driver in Windows 7 that included a technology called ASUS Sonic Focus. Its principle involves adjusting the audio equalizer to create a psychological Dolby surround effect, making listeners perceive the sound as spatial. After enabling Sonic Focus, I found the audio quality significantly improved. (I'm not an audiophile.) However, on Ubuntu, there's naturally no Sonic Focus – ASUS wouldn't bother supporting such a rapidly evolving system. Dolby and SRS also don't provide Linux support, so the open-source community developed Extra Stereo to replicate these features. There's also Crystalizer, which enhances high-frequency loudness for clearer sound. Those who've used Creative Sound Blaster or X-Fi cards should be familiar with this. Meanwhile,...