Igor Bubelov
About Blog Notes Photos

April 2021

Notes ยท May 2, 2021

Table of Contents

New PC

I love assembling new PCs, and I finally convinced myself to buy another one. Here are the specs:

Component Model Comments
Case Fractal Meshify 2 Compact -
Power supply Corsair CV 550 -
Motherboard X570 Aorus Master -
CPU AMD Ryzen 7 5800X The warranty do not extend beyond the first purchaser. What a bunch of assholes.
CPU cooler PC Cooler GI-CX 360 ARGB -
RAM Corsair CMD 32G DDR4 3466 C16 Old part, will replace later.
GPU Nvidia GeForce GTX 1660 Ti Old part, don’t buy that piece of garbage.
SSD Samsung 980 Pro 1 TB -

All of that hardware (except RAM and GPU), is latest-gen, which may raise a question about Linux compatibility. The answer is: it works like a charm! Linux kernel 5.11 fully supports the latest motherboard chipsets and AMD CPUs. Wi-Fi and Ethernet work without any issues. The motherboard has two Ethernet adapters from different vendors: one offers 2.5 gigabits, and the other one offers more conventional (and practical) 1 gigabit bandwidth.

As you may notice, one of those components looks odd. Why pick Linux-hostile Nvidia GPU? Well, I didn’t want to do it, but I wasn’t able to buy a new GPU because of the global supply shortages. I have no idea what causes those shortages: some sources say it’s a sign of inflation, others convinced that it’s the result of shitcoin mining craze. Let me clarify: Bitcoin has nothing to do with GPUs, it uses different hardware for mining, but there are thousands of digital coins, mostly run by scammers, and they often require GPUs to operate.

Spring Boot

There is often a trade-off between doing something interesting and being productive. Recently, I’ve been playing with Rust and I implemented a simple HTTP server based on RFC 7230. It was an interesting journey, but it took a lot of time in order to do a few basic things. After I finished with this server, one of my clients contacted me with an offer to write a simple JSON API. I really wanted to use my little Rust webserver, but I ended up using Spring Boot.

Learning new things can be entertaining, and it can help us in the long run. That’s good for me, but that would be horrible for my client. My productivity would drop, and it would be really hard to find another engineer to work on my Rust webserver. When it comes to business, it’s all about making money, and it’s really hard to make money if you’re not productive at what you’re doing. Backend software isn’t my main focus, so I contacted a few friends and asked them for advice on which tools I should use in order to be productive. The consensus were on the side of Spring Boot.

Spring Boot ended up to be a perfect choice. I must say, I’m impressed how easy it is to set up and customize my Spring Boot project. The defaults are great, and the core foundations are solid. It’s written in Java, but it also works great with Kotlin. Both of those languages are pretty strict, which means they prevent engineers from making costly mistakes. Ruby, JavaScript and Python frameworks are also popular, but they’re based on shaky ground. They may also have mature tooling around them, but nothing can compensate for their lack of strictness.

Security Vulnerabilities in curl

It’s hard to find a software engineer who don’t use curl. This little tool is written by Daniel Stenberg and this guy likes to blog about software and collect and visualize uncomfortable amounts of data. In his recent post, he analyzes the data on security vulnerabilities in curl, and the results are pretty interesting.

What caught my attention is the average age of security vulnerabilities: it’s more than seven years. This made me think about the popular argument which states that we shouldn’t update software outright and instead wait for some time just to make sure no security issues will be found. Based on curl data, waiting doesn’t make any sense. When we update our programs, we indeed risk getting new vulnerabilities. The thing is: no one will know about them for a long time, but timely applied security updates help us to make sure that our software are free of known vulnerabilities, which is far more important.

Speeding Up SSH

There are two main things which usually make SSH slow: network latency and the time establish a connection. Those two things are correlated, but initial handshake can take considerable time even if you try to connect to machine located in the same room.

The more you use SSH, the more time you waste waiting for SSH handshake. The extreme example of this overhead is Ansible playbooks. An average playbook has lots of tasks and every task needs a new SSH connection. You can easily spend 80% of your time just making handshakes. This “handshake overhead” is the only reason why you need to wait before logging in to remote machine.

Fortunately, SSH offers a way to avoid handshakes by keeping connections open after you log out. This way, every subsequent login will be instantaneous. Here is how you can enable connection caching:

mkdir -p ~/.ssh/sockets

Then, open ~/.ssh/config and add the following lines:

Host *
ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h-%p
ControlPersist 600

You can adjust ControlPersist to change caching time or to ask SSH to keep those connections forever (well, till you reboot your machine).

Before:

time ssh nextcloud exit

real	0m2.822s
user	0m0.003s
sys	    0m0.003s

After:

time ssh nextcloud exit

real	0m0.019s
user	0m0.000s
sys	    0m0.003s

Wi-Fi 6 Router

First, let me say that Wi-Fi 6 is not a revolutionary change in wireless communications. Yes, it’s a bit faster, and it has certain features aimed to make Wi-Fi more efficient in crowded places, but overall, I didn’t notice any difference in my home setup. I just saw a banner on my Internet provider’s website, and I decided to ask my provider about the possibility of upgrading the router. It uses GPON, so I can’t really go shopping and pick any router I like, unfortunately. It turned out, they offer free router upgrades, so I decided to use this opportunity. The router hardware is faster, which allows it to keep latency low under load, and their new firmware finally got advanced enough to allow custom MAC to IP mappings. I really missed that feature. Those improvements have nothing to do with Wi-Fi 6, by the way.

Ubuntu 21.04

I didn’t plan to upgrade my Ubuntu 20.04 installations till the next LTS release, but purchasing new AMD CPU made me reconsider my commitment to LTS releases. The thing is: 21.04 has the newer kernel with complete support for new AMD CPUs. They work fine with 20.04, but they lack some thermal management features. I’m not even sure if I need those features, but “complete support” indeed sounds better than “partial support”.

21.04 isn’t that different from 20.04. The most noticeable changes are related to user interface, and they are pretty minor and incremental. I’ve been running this system for a while, and it seems to be very stable. The thing I miss the most from my old workstation is Wayland. I hope this GPU craze will end soon, and I’ll be able to buy Wayland-friendly AMD GPU.

Book: UNIX for People

https://archive.org/details/unixforpeoplemod00birn

This book was written in 1985, which makes it more interesting in some sense. It aimed to teach people how to use BSD UNIX, but now it can also tell us quite a lot about the history of computing.

Game: The Elder Scrolls III: Morrowind

Recently, I’ve come across an open source project called openmw. The goal of this project is to re-implement Morrowind game engine from scratch, fix some bugs and make it playable on current generation of operating systems, including Linux and macOS. Technically, it’s still work in progress, but the game is already playable. I finished about half of the storyline and side quests, and I didn’t find a single glitch. It’s pretty shocking, given my low expectations of open-source games. This game is actually better and more stable than the original.

Morrowind is old, it was released in 2002. Most games don’t age well in a sense that they become less exciting and addictive. Graphics becomes better, interfaces and game mechanics evolve, and all of that affects our expectations, but when it comes to Morrowind, I can confirm that it’s every bit as addictive in 2021 as it was in 2002.

PC   Spring   Security   SSH   Wi-Fi   Ubuntu   Books   Games