Building Your Own IPv6 Tunnel with ZeroTier One

Preface Most ISPs in China do not provide IPv6 addresses to users, except for the Education Network. However, the IPv6 service on the Education Network is highly unstable (possibly specific to my institution), and once you leave campus, IPv6 becomes unavailable, which is quite frustrating. One alternative is using HE.NET's tunnel service . After SixXS shut down, they are currently the largest remaining IPv6 tunnel provider, and their service is completely free. However, their service isn't suitable for home network environments in China, as home networks typically have dynamic IPs, and some ISPs have started using large-scale NAT to save costs, preventing users from obtaining independent IPs and causing conflicts within the same internal network....

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

LT NoLitter: An Xposed Module to Prevent Android Apps from Creating Random Folders

The Android system provides user-accessible storage space, allowing users to manage their files with ease (compared to iOS). However, some applications create numerous folders directly in the storage root directory, disrupting file management and posing a significant nuisance for users with organizational preferences. To address this, I developed an Xposed module. This module hooks into Android's File class. Whenever an app attempts to read or write files/folders in the root directory, the module first checks if the target exists. If it exists, the operation proceeds normally; if not, the operation is redirected to the /Android/files directory. Compared to XInternalSD,...

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

Bilibili Danmaku Filter Tool

With the growing number of Bilibili users, many elementary school students have joined the platform and posted a large volume of danmaku that violates etiquette, significantly impacting other users' viewing experience. Many users have even turned off danmaku entirely because of this, but what's the point of using Bilibili without danmaku? I wrote a small program in Python 3 to filter out elementary school-level danmaku (this program also served as practice for a recent Python programming class). The code can be found at https://github.com/xddxdd/bilibili-dmshield . To use the filtering feature, you can either: Point the IP of comment.bilibili.com to 127.0.0.1 via the hosts file, or Use browser extensions like FoxyProxy or SwitchyOmega to route comment.bilibili....

Bilibili Bottom Danmaku to LRC Tool

Bilibili is never short of amazing works from talented creators, including original music, covers, and captivating "guichu" remixes. Sometimes we want to save these to devices that can play music with lyrics but not video (like certain MP3 players), or use them as background music while displaying lyrics on our desktop. The problem is, many excellent works can't be found in mainstream music apps. Even when available (e.g., on NetEase Cloud Music, rumored to have close ties with Bilibili), some tracks lack lyrics—especially new releases. But when you turn on Bilibili's danmaku, you'll find many volunteer "subtitle masters" have created bottom-aligned danmaku. By extracting the timestamps and content of these danmaku, we can quickly generate lyric files (like LRC)....

Illustration for Rummy Card Counting Program

Rummy Card Counting Program

In English class, our foreign teacher introduced us to the card game Rummy. This game has no official rules, so there are many variations among players. The rules our teacher taught us are as follows: The game requires at least one deck of playing cards, depending on the number of players, with all jokers removed. At the start, each player is dealt 7 cards. After dealing, flip the top card from the deck and place it aside. During each player's turn, they must perform the following actions: Choose to take the top card from the face-down deck or take any number of cards from the face-up discard pile. When taking cards from the discard pile, you must use the bottommost card you picked up during this turn according to condition 2 below. (Cannot keep it in hand or discard it)...

Illustration for Configuring Hurricane Electric IPv6 Tunnel on OpenVZ, Enabling the Entire Address Pool and Using it Alongside Native IPv6

Configuring Hurricane Electric IPv6 Tunnel on OpenVZ, Enabling the Entire Address Pool and Using it Alongside Native IPv6

AlphaRacks is a cost-effective hosting provider, offering VPS with 1 CPU, 512MB RAM, and 10GB storage for just $9.9/year. However, this provider is quite stingy with IPv6 addresses, requiring users to justify their need for IPv6. It's said they provide up to 20 addresses? But they may not allocate the full amount. For example, when I explained I needed IPv6 to serve IPv6-only users, the provider replied: We've added 1 IPv6 address to your VPS. A single IPv6 address is insufficient for my needs. Fortunately, Hurricane Electric in the US offers IPv6 tunneling services , providing each user with 5 tunnels. Each tunnel includes a /64 address pool, and users can instantly activate a /48 address pool with one click. Despite this generous service, using it on OpenVZ VPS requires extra effort....

Illustration for Enabling Color Display in Bash

Enabling Color Display in Bash

The default Bash command line in Linux is always black text on a white background, which can appear somewhat monotonous. However, we can add a few lines of commands to make Bash display information in color. This not only enhances visual appeal but also helps highlight important content. Edit the .profile file in your home directory: nano ~/.profile ``` Add the following at the end of the file: export LS_OPTIONS='--color=auto' eval "`dircolors`" alias ls='ls $LS_OPTIONS' alias ll='ls $LS_OPTIONS -l' alias l='ls $LS_OPTIONS -lA' PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[00m\]@\[\033[01;36m\]\h\[\033[00m\]:[\[\033[01;34m\]\w\[\033[00m\]]\$ ' ``` Save and exit, then either restart Bash or enter: source ~/.bashrc ``` You will now see a colorful command line....

How to Fix Slow OpenSSH Login

Today when connecting to an Azure China virtual machine, I noticed extremely slow login response. Even with a good network environment, it took over ten seconds to display the password prompt. After searching on Google, I discovered the issue was caused by DNS reverse lookup. OpenSSH performs a reverse lookup on your IP during login to determine if your IP is on the system's blacklist. However, China Telecom doesn't provide reverse lookup for residential IP addresses, causing OpenSSH to wait until the lookup times out before establishing the connection. The solution is simply to disable reverse lookup. sudo nano /etc/ssh/sshd_config # Add "UseDNS no" at the end of the file, then save and close sudo service ssh restart If the connection remains slow after this configuration,...