Porting Bad Apple to Telnet and Successfully Screening It

Today, after tinkering for half a day, I successfully ported Bad Apple to my VPS's Telnet service using the command-line animation version I published earlier. To view it yourself: telnet xuyh0120.tk or telnet 5.175.156.249 Round 1. Porting to SSH Since I originally promised a classmate I'd implement this via SSH, I started there. First, I uploaded Bad Apple to my VPS at /opt/badapple , which contains two files: badapple and badapple.in (the resource file with a modified extension). useradd badapple passwd badapple # 密码我设的badapple su badapple # 切换过去 chsh # 输入/opt/badapple/badapple exit When testing via SSH, I encountered Error 2 (resource file not found). I recompiled locally (the VPS lacks FPC), changed paths from relative to absolute, re-uploaded,...

Bad Apple Command Line Animation Version

Bad Apple is an animation produced by Touhou Project in Japan. The entire animation uses a method similar to shadow play, featuring only black and white colors, yet achieves 3D visuals through entirely hand-drawn frames! The effect is excellent with no frame skipping or dropping. Due to its monochromatic nature, many enthusiasts have ported it to various platforms. I've seen versions running on calculators, Raspberry Pi, and even JavaScript implementations. I also wrote a Pascal program to play Bad Apple, though it operates entirely in the command line. I'm too lazy to provide the compiled binary. Since I use Linux, it would be useless for Windows users anyway. Therefore, I'm sharing the source code below—compile it yourself using FPC. uses crt; var fin:text; i: longint ; s:...

W3 Total Cache Implements Memory Caching

W3 Total Cache uses disk-based caching by default. For shared hosting users, this may be the only option available. However, VPS users have significantly more flexibility, especially when using VPS providers with efficient overselling techniques (Host1Free?) where disk speeds are relatively slow. In such cases, you can leverage your surplus memory for caching. I've set up three WordPress test sites on SAE, OpenShift, and Host1Free VPS respectively. Among these, only the VPS allows for full customization, making it our focus today. (Note: SAE's file read/write restrictions prevent W3 Total Cache from even saving configurations.) Additionally, W3TC supports PHP Opcode caching solutions (such as Zend Optimizer (not Zend Guard), eAccelerator, XCache, APC, etc.)...

Using Certificates to Authenticate Linux Remote Login

Most people use passwords to log into a Linux shell remotely. Not only is it tedious, but if you use the same password everywhere and encounter an incident like the CSDN 6 million password leak, your VPS is essentially compromised. Therefore, we can replace passwords with a more convenient and secure method: RSA-encrypted certificate files. First, we need to generate a certificate. cd ~/.ssh ssh-keygen -t rsa At this point, your .ssh directory should contain two new files: id_rsa.pub and id_rsa . The latter is your private key—keep it secure—while the former is your public key, which can be shared publicly. Next, we'll configure our VPS. Upload your id_rsa.pub to the server's ~/.ssh directory using FileZilla or WinSCP, and rename it to authorized_keys ....

The Proper Usage of Caching Plugins

While visiting Blog @ Mr.Ducky today, I noticed the navigation bar showed 4 items on the homepage but 6 items on subpages. After checking with the owner, it turned out to be a caching issue... Caching plugin bugs can cause significant problems. Therefore, it's crucial to understand how to use caching plugins correctly. When publishing a new post, your website's homepage should update automatically. However, if a caching plugin is active, it may continue serving the old cached version, preventing visitors from seeing the latest content. Always clear your cache promptly after updates. Plugins like W3TC and WP Super Cache support automatic cache clearing. After modifying your website template, always clear the cache immediately....

Why Hong Kong CDN Can Be Slower Than US CDN

CDN, or Content Delivery Network, creates distributed copies of your website across multiple locations. These copies store static resources like JS, CSS, and images, accelerating access for visitors. Sometimes CDNs can also optimize network paths between regions. For example, if your website is hosted in Location B , and you (and your visitors) are in Location A , the connection between A and B might pass through Location C with poor network quality. When you ping your site, packet loss occurs at C, forcing clients to wait and retransmit data, slowing down the site. By using a CDN in Location D , traffic bypasses the problematic C, reducing packet loss and improving speed. A autoTranslated: true --- - > C ( X )...

Removing W3 Total Cache Footer Comment

The resource minification effect of W3 Total Cache is excellent - it even minifies HTML. Just look at my webpage source code: line breaks are removed, and the minification is extremely effective. However, at the end of the page, there's an added comment by W3 Total Cache: <! -- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/ Minified using disk: basic Content Delivery Network via lantian.pub Served from: lantian.pub @ 2013-02-13 20:56:59 by W3 Total Cache -- > For someone like me who pursues speed, this not only unnecessarily increases the webpage size but, more importantly, it annoys me whenever I see it. Therefore, I decided to tackle W3 Total Cache and remove the code that generates this comment....

Installing VMware Workstation 9 on Ubuntu

The VirtualBox in Ubuntu's software repositories is becoming increasingly unreliable. Previously, it could at least be installed, but now it fails even to install. The version from the official source works, but it pulls down a massive bundle of KDE components—by the time VirtualBox finishes installing, KDE is practically installed too. So I decided to try VMware instead. Download address: http://download.pchome.net/system/sysenhance/download-10771.html The downloaded file has a .bundle extension, which is VMware's installer. However, you can't run it directly—we first need to grant it execute permissions: chmod +x VMware-Workstation-Full-9.0.0-812388.i386.bundle sudo ./VMware-Workstation-Full-9.0.0-812388.i386.bundle Remember to adjust the filename accordingly....

Host1Free VPS Memory Usage Optimization

PS: After publishing the article for the first time, I realized I forgot to configure the connection between nginx and php5-fpm. When I tried to connect to my VPS to check the settings, I opened the terminal, pressed the up arrow and Enter, only to discover my last command was "exit"... PS2: Folks using port 22 on VPS should be cautious – you might get disconnected mid-command. Switch to another port like 2222. (So 2-ish) PS3: Today I set up a Debian 6 test environment on VirtualBox and discovered Lighttpd has plugin functionality... Revised accordingly. For a VPS, resources like CPU and disk space are usually sufficient for running a personal blog like mine. The real headache is insufficient memory....

Host1Free Checks If All Users Are Using Their VPS

Host1Free's free VPS campaign has been running for quite some time. They've deployed over 30 servers, allocating a total of 30,000 VPS instances (severe overselling... but it's free, so we have to bear with it). This attracted a massive number of user registrations, and most importantly, the official service doesn't discriminate against users from China. However, Chinese users have a characteristic: after getting the VPS, they play around with it until they get bored, then abandon it. Or if they obtain other VPS services (like EC2 or VPS.me, which was available months ago), they stop using it entirely. But Host1Free is quite diligent overall – whenever a server goes down, they restart all VPS instances. Consequently, those unused VPSes, each with 128MB RAM + 640MB Swap, waste resources....