Omid's Blog

Rants on FOSS, tech, homeprod, music and other stuff.

On single points of failure

Tue Apr 14 22:33:47 2026

No, that’s not a mistake. I really did mean points, plural. Let me explain!

One day I was out of town and I realized, oh no, my Matrix instance is down. Oh no, my Synapse is on the same node that runs my website (which my students (hopefully) use to study and review materials). Well not a problem, I will ssh in, and fix this in a jiffy. Oh wait, my VPN is down. Oh no. I had hardened everything down. I was not getting into my server remotely.

It was then that I realized “wow, I am getting quite reliant on my server”. That was a wake-up call for me to:

  1. upgrade my server machine into something that is preferably not old enough to vote
  2. invest in a UPS
  3. set up a redundant machine for VPN

’A’ was quite simple. I bought a second hand Emu A1-N100 Silent. It consumed about 10% of the power that my Dell R220 used. The fans are quiet enough that I can tolerate them, however I have already purchased some Noctuas that I am going to pop in the server when I get the chance. It’s not the noise that is unbearable, but the pitch of it does get on my nerves a bit. The second necessary purchase was the UPS. Since I like buying everything used, I had to search and research and wait a bit. In the end, I settled for a recently refurbished APC SMT1500RMI2U. What a catchy name!

So, everything was hooked up. The transition and restoration from my PBS backups was painless. Booting up containers took seconds, not minutes. Reboots took a few minutes, not many minutes. The NVMe was faster, the HDDs didn’t exist (so didn’t need replacing), the power consumption was lower, life was better. Although I started to miss the spinning rust noises, I realized that I was doing it for the greater good. A basic RoI checker was the little push I needed to pull the trigger. So, thank you, /u/value1338. As for the VPN situation, I set up a second subnet forwarding Tailscale node on a Raspberry Pi.

Cue today. I knew for some time that this week there would be power cut-offs. Not a problem! I am armed with a terribly overpowered UPS, and a machine that consumes about 7w. According to my (I mean the UPS’) calculation, I have an uptime of 5 hours! That’s practically forever. I was ready. This is how preppers feel every day, probably. I will face this storm as it comes and I will permit it to pass over me and through me. And when it has gone past I will turn the inne… zap. Blackout. The UPS starts beeping, I am smiling. I shut down my PC gracefully, and prepare to send a message to my little group of Matrix users: “I may need to shut down, I will let you know”. Pressing on send puts my message in a queued state. Hmm, why is Tailscale trying to activate on my phone, I am at home. Oh no… I had forgotten about the router.

A single point of failure. I can prepare everything, but if the router doesn’t get the juice it needs, there is no connection to the outside world. I had neither powered my switch, nor the router, and so understandably, we went dark. The power outage took 70 minutes (which reduced my uptime by some many nines) but when the power came back up, I thought the issue was solved till I realized that the reconnection of the power had flipped a safety fuse in our box. Even if I set everything up properly, there is a chance that things will go down, and if I am not home and if a fuse pops, there’s nothing I can do. I guess I have to be fine with that.

I did an express order for some cables for the router. I will get to connecting it to the UPS now. I have also set up an automatic shutdown feature via the NIC of the UPS to auto-shutdown my server gracefully in the event the battery goes below a certain expected available run time. Maybe I will set up a system so that it auto-starts on AC power resume. The good news is that the popped fuse was unrelated to my UPS, so hopefully I don’t have to actually deal with this problem, but today I learned that it is possible, and that I am not a big data center, and that downtime is fine. Maybe even the internet will go down, and I still haven’t set up a cellular backup. As long as I have higher uptimes than GitHub, I will be happy.

On programming languages and education

Fri Mar 27 15:39:44 2026

Disclaimer

I am not a professional programmer, but a teacher. I enjoy writing code not because I like solving puzzles, and not because I like to think about code particularly, but because I enjoy solving problems that I personally have, and because I like learning how computing works. I like thinking about paradigms of computing, and am more interested with how computers work than how coding works. I teach Computer and IT in a German high school. My students are in the age range of 13-18, and partially are taking part in a mandatory course.

Intro

Having taught programming for about 5 years now and having read lots of articles on choices of languages for teaching programming, I am starting to develop an opinion, and I would like to share it with you. The way I see it, my personal choice of programming language for the purposes of teaching boils down to (in no particular order):

  • Scheme
  • C
  • Haskell
  • Python
  • HTML/CSS (bear with me)

My choices are based on a couple of criteria. It is important for me that the choice is conform to the education program in Germany (of course) and that it is not a convoluted or overloaded language, that has good tooling, relatively simple syntax, good books/literature/exercises (perhaps the most important aspect for me personally) and is easily installable in our lab environment. Other than that, a teacher also needs reference material, and the better a language is documented and has books/exercises, the easier it is to adapt these into a classroom situation. Lastly and perhaps most importantly, I have to personally like the language. If I don’t get excited about a language, then I also can’t get students to get excited about it, and I think that’s important.

So why these languages?

Scheme:

Just as Mr. Tortoise in GEB mentioned that drinking the popping tonic is said to be satisfying and refreshing, there is a deep satisfaction whenever I close the last parentheses of an expression. Yes, I know that there are some people whose main reason not to teach/work with Scheme is because of the parentheses (😊), but one can’t deny that it is a good and very readable language to teach concepts of CompSci.

lisp_cycles.png

Figure 1: xkcd 297 — Lisp Cycles

It is after all the language of choice in SICP, and has been taught in MIT for years until recently where apparently Python has taken its place. I enjoy working with Little Schemer first, and getting the students to understand the concepts of working with lists and then recursion directly. I think the prefix notation is interesting and forces one to think differently, and for me thinking differently about coding is important.

I believe that coding is a different paradigm of thinking, and having the same symbols from math suddenly mean different things is counterproductive. Other than that, Scheme belongs to a vast family of LISP dialects, under which ELISP also falls. For those who are still interested after graduation, configuring Emacs would be the next logical step and they have a solid background in how the syntax works. Scheme is also one of the languages that has the advantage of being interpreted and having a REPL, which is an excellent educational tool.

C:

Now I think my opinion is getting spicy. C, for school? What kind of mad man would do that in 2026?

I think C is the perfect language, if you want to understand how computers work, and not only understand how coding works. C being a low level language is quite close to bare metal, and there are lots of concepts regarding memory and having a bare-bone language that make it especially appealing for me to teach an older, stronger group. Concepts such as integer overflow, exit codes, compilation, architecture, flags, macros and binaries can be explained much easier in C than comparative languages.

/* Easy and understandable example of integer overflow */
#include <stdio.h>

int main(void) {
    printf("%d", 200 * 300 * 400 * 500);
    /* -884901888 */
    printf("%ld", 200 * 300 * 400 * 500);
    /* 3410065408 */
}

I like to work with C Programming: A Modern Approach by K. N. King, because I very much enjoy his spiralcase pedagogical approach (Wikipedia: The spiral approach is a technique often used in education where the initial focus of instruction is the basic facts of a subject, with further details being introduced as learning progresses), and I adore the exercises he provides. The objectives are clear, the exercises are creative, and the students can have a bit of fun with seeings instant results. Other than that, there is this excellent book I am reading right now: Computer Systems: Programmer’s Perspective which goes over almost all of aspects of a modern computer, and uses C to explain the inner workings of a computer. One can then expand on this work and work with embedded systems, for instance on Arduinos which most schools have plenty of/can buy cheaply which also has a very C-like syntax. Nothing cooler than making LEDs blink!

Haskell:

Oh Haskell, how I have hated you for no reason whatsoever for so long. Haskell has a reputation that precedes its actual implementation. Haskell is known by the general, non-CompSci people as being an obtuse and difficult language. That is until you try to implement a recursive function, and realize that it is a language that allows you to practically type out mathematical equations as they come and they will work. The Fibonacci sequence is mathematically defined as:

\[ Fib(0) = 0, \quad Fib(1) = 1 \] \[ Fib(n) = Fib(n-1) + Fib(n-2) \]

and in Haskell looks like this:

fib 0 = 0
fib 1 = 1
fib n = fib (n - 1) + fib (n - 2)

Easy! Dare I say: elegant!

Compare it to this Python code, the ’simple’ language:

def fib (n):
    if n == 0:
        return 0
    if n == 1:
        return 1
    else:
        return fib(n - 1) + fib(n - 2)

Haskell also has great and clear type definitions, and is in my opinion very well suited for teaching recursion:

-- example of caesar encryption
import Data.Char (isLower, isUpper, ord, chr)

shift :: Int -> Char -> Char
shift n c
  | isLower c = chr $ (ord c - ord 'a' + n) `mod` 26 + ord 'a'
  | isUpper c = chr $ (ord c - ord 'A' + n) `mod` 26 + ord 'A'
  | otherwise = c

-- recursively
caesarRec :: Int -> String -> String
caesarRec _ []          = []
caesarRec n (c:cs)      = shift n c : caesarRec n cs

-- iteratively
caesar :: Int -> String -> String
caesar n = map (shift n)

Haskell is a language that lets the educator convey certain aspects of programming and algorithms very well. Much better than most other languages. There are great exercises and lessons in my favorite Haskell book, Haskell Programming from first principles by C. Allen and J. Moronuki. I love books that have lots of practical examples and exercises, and this book does not disappoint. Other than that, another great source of information is of course, learnyouahaskell. The fact that GHCi also exists helps students to learn how working in an interactive environment works, eg. loading their code into a REPL and experimenting with it interactively.

Python

Ah Python. How deceiving you can be. On one hand, I think Python is a great language for introduction in programming, and on the other hand I think that it is a language that lacks any defining features, educationally speaking, besides having a english-like syntax. The joke goes that you can write pseudocode and english and it just works in Python. I have often had students come up with in by themselves, for instance if i in list. On one hand this is good, on the other hand it disappoints when it doesn’t work.

# example of Python code that reads like english and looks like pseudocode
list_of_numbers = list(range(21))

for each_number in list_of_numbers:
    print(each_number * 2)

The main power feature for our school, and an idea that I had two years ago and we have since implemented, was using Jupyter Notebooks. This enables us to share exercises and text with the students using scripts, and the students can just use Python and it’s kernel using Jupyter Notebooks even if they are at home, or on a tablet, or on anything. We have digitalized Eric Matthes’ Python Crash Course, and we teach using it as a source and its exercises. We can share exercises via bash scripts, collect them, grade them and send them back. This saves time and allocates it from typing (also important, but time consuming for young students) to coding, learning and thinking. This book’s exercises are interesting and creative; that makes learning more fun than just working with arbitrary numbers. The fact that Python has a REPL is also of great help, but I use it only in the beginning hours of my lessons, as I mostly teach Python to younger students, and little differences between working in REPL and working in files cause unnecessary friction for the learning proces.

Python however also has its issues. It takes a lot away from the students, and does much of the work in the background. This is good if all we are interested in is making code work, or understanding how formal writing works, but I often have the feeling that the underlying concepts are not understood as well as they could be in the other languages mentioned so far.

HTML/CSS

Yes, HTML/CSS are not programming languages. Yes, HTML is Turing complete, but that’s besides the point. The inspiration for this comes from an article by I. Merdith that I read on lobsters a while ago, which suggested using HTML and CSS for teaching programming. The reasoning was simple: HTML teaches typing and form, it teaches to use weird symbols, it teaches that every character matters, and in the end you have something to show for. A website in which you can be as creative as you like.

Styling the website teaches its own useful set of skills. Attaching classes and ids to elements and attaching styles to them teaches the elements of how variables work and can be referenced. Importing stylesheets teaches the idea of an import or a module: the idea of linking code files from different places together. ~I. Meredith

It’s a great approach in my opinion, and one that is not in the education plan/curriculum. I think this approach should be explored more, and it’s perhaps besides Python the one approach that can potentially make you money down the line. That’s always good, isn’t it?

Conclusion

Each language has its pros and cons. I prefer HTML/CSS for complete beginners, and then go into Python if the goal is just to teach programming. I like teaching C for groups that have graduated from Python, and I like teaching Haskell for those who are doing the german Abitur in contrast to Scheme (it’s either/or in Abitur). Where does Scheme fall here? I don’t know. I haven’t had an opportunity to test using Scheme a lot so far, other than breakout groups/singular sessions. It is definitely something that I want to explore later.

On Matrix

Sun Feb 15 21:24:15 2026

There seems to be a giant misconception about Matrix. The protocol, and its clients. Due to the news emerging on Discord and its future, it seems as if many people are looking for a new ’home’. Stoat, Rocket.chat, mattermost and what not are always recommended; however I have the feeling that every time Matrix is recommended that it’s immediately shot down from someone saying ’it doesn’t work’, or ’its not like discord’. As if rocket.chat is anything like Discord. The arguments usually seem to be that the channels are not working properly, there are permission issues, or that there’s no screen sharing/video calling.

All of these are not true. There is great video calling using Matrix’s new implementation of MatrixRTC using Element. The permission system whilst not as robust as that of Discord, is still great.

Some people also say that Synapse has issues, or federating your own instance is hard. Yes, if you are the kind of person like me who runs his own instance then you will come into these hardships, but talking to Discord refugees on the niceties of continuwuity and its Rust codebase as opposed to the Python codebase on Synapse is like telling a person who wants to switch from Windows to Linux as a casual user that they should really install Linux from Scratch.

To keep things short, Matrix is great. It’s not flawless, it’s not as polished as Discord. However, it is very usable and just fine for 99% of things the average user wants to do. Just join matrix.org, download Element and get online and enjoy a federated future.

Edit on Wed Feb 25 17:46:33 2026: I still see misinformation about Matrix. Including one thread today where a vibecoded E2E chat program was being hailed as the replacement for Discord. Matrix is here. Instead of wasting time and trying to create other standards, push your code to Matrix and make it a great standard.

I had some fun setting up MatrixRTC this week. I used this guide, and it works well so far!

Quieting my R220

I slowly have nothing left to configure. So before I start completely breaking my stuff or – god forbid – switch to Gentoo, I’ll start with some light blogging. It started on my website, but I think I will move it on here for now. On the side, nice and relaxed!

For a few years now, I’ve owned an R220 server that was initially only in operation occasionally. Electricity costs are of course high in Germany (almost 0.40 Cent per kw/h), but besides the electricity costs, the fan noise was also a problem. That’s why I only used it occasionally to try things out and then turned it off again after a week at most. I am also a musician, so when I needed to record, I had to kill the server… Suboptimal.

In 2024, however, I had an idea: Making the Dell R220 server even quieter.

I found a post on reddit. First, I only replaced the PSU fans with a Noctua variant, as the PSU fans are the only fans that aren’t controllable via IPMI and thus run at a volume similar to a lawnmower. However, as /u/Apserger96 warned:

IMPORTANT: When you put the fan back into the power supply, you must only use the two top screws to secure it. The lower ones cause short circuits! The two upper screws are sufficient for a firm hold!

I didn’t pay attention to that and wondered why my server only started for a few seconds. That was the reason.

Of course, I don’t recommend anyone to screw around in PSUs – the capacitors in PSUs theoretically retain their charge for a very long time. I waited half a day, and they do have safety features, but still: if something had gone wrong, it could have been deadly.

But it’s running now! Everything is quiet, and since then my server has been running 24/7. This post is also hosted on that server.