Happy Hacking New Year

Intro

If you, like me, have some free time during these Christmas holidays, I'd suggest spending some time tinkering and learning. The feeling of accomplishing something while learning is, for me, the best feeling ever, so I have the following on the menu: learning the Go programming language, setting up remote support using Tailscale, a multi-seat setup on a single machine, and network boot. I'll describe the use cases and the reasoning behind these "projects", so you can decide for yourself whether it's worth it.

A short disclaimer: I describe all the efforts on Linux, and although you could make it work on other platforms as well, I won't be able to help you with that.

Learning Go

The invention of Go (which happened about 12 years ago, by the way) is, for me, a very important step in software development, because Go concepts try to fix the fundamental drawbacks of other languages. Here I'll describe the developer's perspective only – no performance discussion, although Go shines there as well.

Let's start with the fundamental disadvantages of object-oriented programming (OOP), which were counter-intuitive for me at first: combining data and logic (methods) and inheritance.

As we all know, a good programmer is a lazy programmer, but without clarity we get... well, Perl. Go is clear, splits data and logic, and doesn't use inheritance. And it prioritizes clarity. In my own experience, I had to write little code, it was functional and clear. So what's the problem with other languages?

Yes, it turns out that a lack of typing is a problem as well. But let's turn to another thing: programming paradigms. There are functional, procedural, and object-oriented paradigms, and the truth is that Python and JS/TS are hybrid – you can use any paradigm you like.

When I started programming, I wrote Pascal and C code, and it was procedural. I read about the advantages of functional and object-oriented paradigms and I kind of still don't get it. You end up writing more unclear code. Go returned me to programming just logic, because logic is calling one procedure after another. And switch/case is finally useful in Go, by the way.

"Don't write a GUI app in Go", I've read in one book, and started using Tk 9.0. Tcl/Tk were introduced in 1989 – that's what I call "mature software". And it has some markup language (ML), but you need to create and set up each tag; there are no function calls inside the tags. I decided to stay with Tk and generate my own tags, and that's where things got interesting:

And the UI is as abrupt as diarrhea, by the way, which I like. :)

The point is that Go provides so much: it's completely free to play with, easy to start, powerful, and just feels "right" in lots of the aspects mentioned above. And this makes writing software fun.

Tailscale

I've heard about Tailscale many times, but I ignored the ads as I didn't have a use case for it. The use case for me is remote support, but it can be a remote server of any kind. The goal was to have SSH access to the remote machine, and in case the machine is behind a router, you need to change the router setup. With Tailscale, you don't have to do that, as it creates a VPN and the machines think they are in the same local network.

First, you need to connect to the remote machine, and in the worst-case scenario (an unqualified user), you could start with AnyDesk. It doesn't work with Wayland targets, by the way. So you create your user account with sudo privileges and install Tailscale.

But Tailscale needs to be up to connect to it, so some user-related setup is required – preferably a button. In the case of GNOME there's a GNOME extension. I had to deal with XFCE, so I ended up with a Bash script for Tailscale up/down and a button on the XFCE panel launching this script. And in case of SSH/RDP we need to make sure these services are running.

After that, we can connect using SSH and first set up key-based authentication. Now it's a bit simpler to do admin tasks (update the system, for instance), but you could also add two enhancements:

Multi-seat setup

A multi-seat setup in the base variant means 2 monitors, 2 keyboards, and 2 mice connected to one PC. As a rule, you start with a video card with 2 outputs. You can add more, but there are some limiting factors: the number of video cards you can install, whether you hit CPU/RAM/HDD limits, and the length of cables for keyboards/mice.

3-seat setups were used at schools; they obviously don't fit heavy gaming scenarios. This configuration is a budget-friendly way to get computing power for 2 home-office workers, for example. Wayland does not support this configuration. The Debian how-to is a great place to start. Assuming the average CPU load is 0%, it's a natural lifehack for two people sitting next to each other.

Network boot

Network boot means having a server with OS images and booting other machines from it. It allows you to have a diskless machine with an NFS server, which is relevant for old hardware, and it also simplifies user data backups. But you will need to set up a DHCP server to point to a server with images.

You can combine diskless workstations with remote access like RDP to use the server's CPUs. The docs for the TLDP project and Fedora are probably helpful in this regard. And yes, setting up a network server for installations is also a nice option.

It's assumed that hard drives are cheap and network boot has fewer use cases now, but for me the whole diskless option was eye-opening.

Conclusion

I hope you learned something new reading this article. I don't provide detailed instructions in order not to copy or misinterpret instructions from other sites (which are also updated). When "learning" hits "useful", it can bring happiness – so happy hacking New Year to you!