cover image about fixing zsh glitches

Fix Annoying Cursor Glitches of Zsh Autosuggestions

Installing new Arch Linux machines are always delightful. Customization, lightweight, and maximum performance. However, in my career of installing 5 Arch Linux servers, there is this one server that always seems fishy. When zsh-autosuggestions tries to suggest past commands, the terminal’s cursor always gets messed up and starts to glitch everywhere. Deleting current characters would result in random characters disappearing, and random typing errors would appear when you press enter. This has never appeared on my other machines....

July 12, 2021 · 1 min · bhat
cover image about Wireguard with shadowsocks

Hide your VPN traffic: Obfuscate Wireguard with Shadowsocks Tunnel

Wireguard sure is nice. It is both easy to use and has quite good network performance. It is almost unambiguously better than its predecessor, OpenVPN. Moreover, Wireguard is already deployed everywhere (yes, Cloudflare Warp is pure Wireguard). So, what’s the problem? If Wireguard is so good, just use a Wireguard VPN everywhere, and you can forget about leaking your IP addresses or being DDoSed. Besides the miniature network latency impact, there is a simple problem: Wireguard traffic can be easily identified....

July 11, 2021 · 4 min · bhat
cover image about AVIF images

Use AVIF Images in your webpage with JPEG Fallback

AVIF is the next big thing in image format. It is a lossy/lossless image format that originates from the video codec AV1. In other words, AVIF to AV1 is like HEIF to HEVC, except AVIF is open, royalty-free, and pushed by a lot of big companies. Just like AV1, AVIF has a bunch of modern features. HDR, 10-bit color depth, etc. In a webpage, AVIF means saving bandwidth and higher compression ration....

July 1, 2021 · 2 min · bhat
cover image about printing docker env variables

Output Environment Variables of a Docker Container

One time, I set up a Docker container with my Cloudflare API token as the environment variable. docker run -e API_KEY=<my_api_key> <some_user/some_container> I forgot the token in the process, and now I want to retrieve the API token. It should be as easy as listing all manually added environment variables. Apparently Docker does not have such function? There is no such command as docker container env ls. Well, turns out we have to do it the old-fashioned way....

June 27, 2021 · 2 min · bhat
cover image about benchmarking shadowsocks

Benchmarking Different Implementations of Shadowsocks

Hosting Shadowsocks proxy servers is usually an easy task. You install it, and just forget about everything. And due to it being a lightweight proxy, shadowsocks is usually I/O-bounded: To achieve highest throughput, you need higher ethernet, not faster CPU. However, it is not always the case. It is known that some VPS providers only focus on premium connections and bandwidth, and completely ignores CPU and RAM performance to save money(cough bandwagonhost cough)....

June 17, 2021 · 4 min · bhat