From 30b9c0e750f8682d2cec1955bedd38739c664de1 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 21 Feb 2025 17:08:02 +0200 Subject: Update content for gemtext --- about/resources.gmi | 176 +-- gemfeed/atom.xml.tmp | 1265 -------------------- index.gmi | 2 +- notes/97-things-every-sre-should-know.gmi | 311 +++++ notes/97-things-every-sre-should-know.gmi.tpl | 289 +++++ notes/implementing-service-level-objectives.gmi | 83 ++ .../implementing-service-level-objectives.gmi.tpl | 74 ++ notes/index.gmi | 3 + notes/site-reliability-engineering.gmi | 90 ++ notes/site-reliability-engineering.gmi.tpl | 74 ++ uptime-stats.gmi | 2 +- 11 files changed, 1014 insertions(+), 1355 deletions(-) delete mode 100644 gemfeed/atom.xml.tmp create mode 100644 notes/97-things-every-sre-should-know.gmi create mode 100644 notes/97-things-every-sre-should-know.gmi.tpl create mode 100644 notes/implementing-service-level-objectives.gmi create mode 100644 notes/implementing-service-level-objectives.gmi.tpl create mode 100644 notes/site-reliability-engineering.gmi create mode 100644 notes/site-reliability-engineering.gmi.tpl diff --git a/about/resources.gmi b/about/resources.gmi index 8e3a0a1c..030e3b0f 100644 --- a/about/resources.gmi +++ b/about/resources.gmi @@ -35,101 +35,101 @@ You won't find any links on this site because, over time, the links will break. In random order: -* The KCNA (Kubernetes and Cloud Native Associate) Book; Nigel Poulton -* C++ Programming Language; Bjarne Stroustrup; -* Learn You a Haskell for Great Good!; Miran Lipovaca; No Starch Press -* 21st Century C: C Tips from the New School; Ben Klemens; O'Reilly -* Leanring eBPF; Liz Rice; O'Reilly -* 100 Go Mistakes and How to Avoid Them; Teiva Harsanyi; Manning Publications -* Raku Recipes; J.J. Merelo; Apress -* The DevOps Handbook; Gene Kim, Jez Humble, Patrick Debois, John Willis; Audible -* Go Brain Teasers - Exercise Your Mind; Miki Tebeka; The Pragmatic Programmers -* DNS and BIND; Cricket Liu; O'Reilly -* Effective awk programming; Arnold Robbins; O'Reilly -* The Go Programming Language; Alan A. A. Donovan; Addison-Wesley Professional -* DevOps And Site Reliability Engineering Handbook; Stephen Fleming; Audible -* Pro Puppet; James Turnbull, Jeffrey McCune; Apress +* Learn You Some Erlang for Great Good; Fred Herbert; No Starch Press +* Clusterbau mit Linux-HA; Michael Schwartzkopff; O'Reilly +* Programming Perl aka "The Camel Book"; Tom Christiansen, brian d foy, Larry Wall & Jon Orwant; O'Reilly +* Think Raku (aka Think Perl 6); Laurent Rosenfeld, Allen B. Downey; O'Reilly +* Java ist auch eine Insel; Christian Ullenboom; * The Kubernetes Book; Nigel Poulton; Unabridged Audiobook * The Pragmatic Programmer; David Thomas; Addison-Wesley -* Site Reliability Engineering; How Google runs production systems; O'Reilly -* Kubernetes Cookbook; Sameer Naik, Sébastien Goasguen, Jonathan Michaux; O'Reilly -* Higher Order Perl; Mark Dominus; Morgan Kaufmann -* Hands-on Infrastructure Monitoring with Prometheus; Joel Bastos, Pedro Araujo; Packt -* Learn You Some Erlang for Great Good; Fred Herbert; No Starch Press -* Object-Oriented Programming with ANSI-C; Axel-Tobias Schreiner -* Polished Ruby Programming; Jeremy Evans; Packt Publishing -* Amazon Web Services in Action; Michael Wittig and Andreas Wittig; Manning Publications * Effective Java; Joshua Bloch; Addison-Wesley Professional -* 97 things every SRE should know; Emil Stolarsky, Jaime Woo; O'Reilly * Systems Performance Tuning; Gian-Paolo D. Musumeci and others...; O'Reilly -* Developing Games in Java; David Brackeen and others...; New Riders +* Ultimate Go Notebook; Bill Kennedy * Systemprogrammierung in Go; Frank Müller; dpunkt -* Programming Perl aka "The Camel Book"; Tom Christiansen, brian d foy, Larry Wall & Jon Orwant; O'Reilly -* Tmux 2: Productive Mouse-free Development; Brain P. Hogan; The Pragmatic Programmers -* Distributed Systems: Principles and Paradigms; Andrew S. Tanenbaum; Pearson -* Concurrency in Go; Katherine Cox-Buday; O'Reilly +* Go Brain Teasers - Exercise Your Mind; Miki Tebeka; The Pragmatic Programmers +* Polished Ruby Programming; Jeremy Evans; Packt Publishing +* Perl New Features; Joshua McAdams, brian d foy; Perl School +* 21st Century C: C Tips from the New School; Ben Klemens; O'Reilly +* 100 Go Mistakes and How to Avoid Them; Teiva Harsanyi; Manning Publications * Modern Perl; Chromatic ; Onyx Neon Press -* Ultimate Go Notebook; Bill Kennedy -* Think Raku (aka Think Perl 6); Laurent Rosenfeld, Allen B. Downey; O'Reilly +* Distributed Systems: Principles and Paradigms; Andrew S. Tanenbaum; Pearson +* Terraform Cookbook; Mikael Krief; Packt Publishing +* The DevOps Handbook; Gene Kim, Jez Humble, Patrick Debois, John Willis; Audible +* Raku Recipes; J.J. Merelo; Apress +* C++ Programming Language; Bjarne Stroustrup; * Funktionale Programmierung; Peter Pepper; Springer +* Raku Fundamentals; Moritz Lenz; Apress +* Amazon Web Services in Action; Michael Wittig and Andreas Wittig; Manning Publications +* Higher Order Perl; Mark Dominus; Morgan Kaufmann +* DevOps And Site Reliability Engineering Handbook; Stephen Fleming; Audible * The Practise of System and Network Administration; Thomas A. Limoncelli, Christina J. Hogan, Strata R. Chalup; Addison-Wesley Professional Pro Git; Scott Chacon, Ben Straub; Apress +* Site Reliability Engineering; How Google runs production systems; O'Reilly +* Leanring eBPF; Liz Rice; O'Reilly +* Effective awk programming; Arnold Robbins; O'Reilly +* Pro Puppet; James Turnbull, Jeffrey McCune; Apress +* Learn You a Haskell for Great Good!; Miran Lipovaca; No Starch Press +* Object-Oriented Programming with ANSI-C; Axel-Tobias Schreiner * The Docker Book; James Turnbull; Kindle -* Java ist auch eine Insel; Christian Ullenboom; -* Clusterbau mit Linux-HA; Michael Schwartzkopff; O'Reilly -* Raku Fundamentals; Moritz Lenz; Apress -* Perl New Features; Joshua McAdams, brian d foy; Perl School -* Terraform Cookbook; Mikael Krief; Packt Publishing +* The KCNA (Kubernetes and Cloud Native Associate) Book; Nigel Poulton +* Kubernetes Cookbook; Sameer Naik, Sébastien Goasguen, Jonathan Michaux; O'Reilly +* Hands-on Infrastructure Monitoring with Prometheus; Joel Bastos, Pedro Araujo; Packt +* Tmux 2: Productive Mouse-free Development; Brain P. Hogan; The Pragmatic Programmers +* Concurrency in Go; Katherine Cox-Buday; O'Reilly +* 97 things every SRE should know; Emil Stolarsky, Jaime Woo; O'Reilly +* The Go Programming Language; Alan A. A. Donovan; Addison-Wesley Professional +* DNS and BIND; Cricket Liu; O'Reilly * Data Science at the Command Line; Jeroen Janssens; O'Reilly +* Developing Games in Java; David Brackeen and others...; New Riders ## Technical references I didn't read them from the beginning to the end, but I am using them to look up things. The books are in random order: -* Relayd and Httpd Mastery; Michael W Lucas * BPF Performance Tools - Linux System and Application Observability, Brendan Gregg; Addison Wesley +* Implementing Service Level Objectives; Alex Hidalgo; O'Reilly +* Algorithms; Robert Sedgewick, Kevin Wayne; Addison Wesley * The Linux Programming Interface; Michael Kerrisk; No Starch Press +* Relayd and Httpd Mastery; Michael W Lucas * Understanding the Linux Kernel; Daniel P. Bovet, Marco Cesati; O'Reilly -* Algorithms; Robert Sedgewick, Kevin Wayne; Addison Wesley * Groovy Kurz & Gut; Joerg Staudemeier; O'Reilly -* Implementing Service Level Objectives; Alex Hidalgo; O'Reilly ## Self-development and soft-skills books In random order: -* Search Inside Yourself - The Unexpected path to Achieving Success, Happiness (and World Peace); Chade-Meng Tan, Daniel Goleman, Jon Kabat-Zinn; HarperOne -* The Obstacle Is The Way; Ryan Holiday; Profile Books Ltd -* Psycho-Cybernetics; Maxwell Maltz; Perigee Books -* Who Moved My Cheese?; Dr. Spencer Johnson; Vermilion -* Eat That Frog; Brian Tracy -* The Good Enough Job; Simone Stolzoff; Ebury Edge -* Stop starting, start finishing; Arne Roock; Lean-Kanban University -* Digital Minimalism; Cal Newport; Portofolio Penguin -* Solve for Happy; Mo Gawdat -* Slow Productivity; Cal Newport; Penguin Random House +* The Complete Software Developer's Career Guide; John Sonmez; Unabridged Audiobook +* Ultralearning; Anna Laurent; Self-published via Amazon +* The Daily Stoic; Ryan Holiday, Stephen Hanselman; Profile Books * So Good They Can't Ignore You; Cal Newport; Business Plus -* The Joy of Missing Out; Christina Crook; New Society Publishers +* Atomic Habits; James Clear; Random House Business * Ultralearning; Scott Young; Thorsons * Staff Engineer: Leadership beyond the management track; Will Larson; Audible -* Deep Work; Cal Newport; Piatkus -* The Bullet Journal Method; Ryder Carroll; Fourth Estate * The 7 Habits Of Highly Effective People; Stephen R. Covey; Simon & Schuster UK -* Eat That Frog!; Brian Tracy; Hodder Paperbacks -* Atomic Habits; James Clear; Random House Business -* Getting Things Done; David Allen -* The Daily Stoic; Ryan Holiday, Stephen Hanselman; Profile Books -* Consciousness: A Very Short Introduction; Susan Blackmore; Oxford Uiversity Press -* Influence without Authority; A. Cohen, D. Bradford; Wiley +* Who Moved My Cheese?; Dr. Spencer Johnson; Vermilion +* The Off Switch; Mark Cropley; Virgin Books * The Power of Now; Eckhard Tolle; Yellow Kite -* 101 Essays that change the way you think; Brianna Wiest; Audible +* The Joy of Missing Out; Christina Crook; New Society Publishers +* The Bullet Journal Method; Ryder Carroll; Fourth Estate +* Influence without Authority; A. Cohen, D. Bradford; Wiley +* Consciousness: A Very Short Introduction; Susan Blackmore; Oxford Uiversity Press +* The Good Enough Job; Simone Stolzoff; Ebury Edge +* Eat That Frog!; Brian Tracy; Hodder Paperbacks * Soft Skills; John Sommez; Manning Publications -* Ultralearning; Anna Laurent; Self-published via Amazon -* The Off Switch; Mark Cropley; Virgin Books * Time Management for System Administrators; Thomas A. Limoncelli; O'Reilly +* Search Inside Yourself - The Unexpected path to Achieving Success, Happiness (and World Peace); Chade-Meng Tan, Daniel Goleman, Jon Kabat-Zinn; HarperOne +* Getting Things Done; David Allen +* Psycho-Cybernetics; Maxwell Maltz; Perigee Books +* The Obstacle Is The Way; Ryan Holiday; Profile Books Ltd +* Never Split the Difference; Chris Voss, Tahl Raz; Random House Business +* 101 Essays that change the way you think; Brianna Wiest; Audible +* Digital Minimalism; Cal Newport; Portofolio Penguin +* Solve for Happy; Mo Gawdat +* Eat That Frog; Brian Tracy * The Phoenix Project - A Novel About IT, DevOps, and Helping your Business Win; Gene Kim and Kevin Behr; Trade Select +* Stop starting, start finishing; Arne Roock; Lean-Kanban University +* Deep Work; Cal Newport; Piatkus * Buddah and Einstein walk into a Bar; Guy Joseph Ale, Claire Bloom; Blackstone Publishing -* Never Split the Difference; Chris Voss, Tahl Raz; Random House Business -* The Complete Software Developer's Career Guide; John Sonmez; Unabridged Audiobook +* Slow Productivity; Cal Newport; Penguin Random House => ../notes/index.gmi Here are notes of mine for some of the books @@ -137,30 +137,30 @@ In random order: Some of these were in-person with exams; others were online learning lectures only. In random order: -* Scripting Vim; Damian Conway; O'Reilly Online -* Protocol buffers; O'Reilly Online -* Functional programming lecture; Remote University of Hagen -* MySQL Deep Dive Workshop; 2-day on-site training * Apache Tomcat Best Practises; 3-day on-site training * Structure and Interpretation of Computer Programs; Harold Abelson and more...; -* Algorithms Video Lectures; Robert Sedgewick; O'Reilly Online * Red Hat Certified System Administrator; Course + certification (Although I had the option, I decided not to take the next course as it is more effective to self learn what I need) * The Ultimate Kubernetes Bootcamp; School of Devops; O'Reilly Online -* F5 Loadbalancers Training; 2-day on-site training; F5, Inc. * Developing IaC with Terraform (with Live Lessons); O'Reilly Online +* MySQL Deep Dive Workshop; 2-day on-site training +* Functional programming lecture; Remote University of Hagen +* Protocol buffers; O'Reilly Online +* Scripting Vim; Damian Conway; O'Reilly Online +* Cloud Operations on AWS - Learn how to configure, deploy, maintain, and troubleshoot your AWS environments; 3-day online live training with labs; Amazon +* The Well-Grounded Rubyist Video Edition; David. A. Black; O'Reilly Online +* F5 Loadbalancers Training; 2-day on-site training; F5, Inc. * AWS Immersion Day; Amazon; 1-day interactive online training +* Algorithms Video Lectures; Robert Sedgewick; O'Reilly Online * Ultimate Go Programming; Bill Kennedy; O'Reilly Online * Linux Security and Isolation APIs Training; Michael Kerrisk; 3-day on-site training -* The Well-Grounded Rubyist Video Edition; David. A. Black; O'Reilly Online -* Cloud Operations on AWS - Learn how to configure, deploy, maintain, and troubleshoot your AWS environments; 3-day online live training with labs; Amazon ## Technical guides These are not whole books, but guides (smaller or larger) which I found very useful. in random order: * Raku Guide at https://raku.guide -* Advanced Bash-Scripting Guide * How CPUs work at https://cpu.land +* Advanced Bash-Scripting Guide ## Podcasts @@ -168,46 +168,46 @@ These are not whole books, but guides (smaller or larger) which I found very use In random order: -* Maintainable -* Deep Questions with Cal Newport +* The Pragmatic Engineer Podcast * BSD Now -* Fork Around And Find Out * Hidden Brain -* The Changelog Podcast(s) +* Fork Around And Find Out +* Deep Questions with Cal Newport +* Fallthrough [Golang] * Dev Interrupted -* Cup o' Go [Golang] -* Backend Banter -* The Pragmatic Engineer Podcast * The ProdCast (Google SRE Podcast) -* Fallthrough [Golang] +* Maintainable +* Backend Banter +* The Changelog Podcast(s) +* Cup o' Go [Golang] ### Podcasts I liked I liked them but am not listening to them anymore. The podcasts have either "finished" (no more episodes) or I stopped listening to them due to time constraints or a shift in my interests. * Go Time (predecessor of fallthrough) -* Java Pub House * CRE: Chaosradio Express [german] -* FLOSS weekly -* Ship It (predecessor of Fork Around And Find Out) * Modern Mentor +* Ship It (predecessor of Fork Around And Find Out) +* Java Pub House +* FLOSS weekly ## Newsletters I like This is a mix of tech and non-tech newsletters I am subscribed to. In random order: -* The Pragmatic Engineer -* Golang Weekly * Applied Go Weekly Newsletter * Monospace Mentor -* The Valuable Dev -* The Imperfectionist +* The Pragmatic Engineer +* byteSizeGo +* Register Spill +* Golang Weekly * VK Newsletter * Ruby Weekly +* The Valuable Dev * Andreas Brandhorst Newsletter (Sci-Fi author) -* Register Spill -* byteSizeGo * Changelog News +* The Imperfectionist # Formal education diff --git a/gemfeed/atom.xml.tmp b/gemfeed/atom.xml.tmp deleted file mode 100644 index 03f1b688..00000000 --- a/gemfeed/atom.xml.tmp +++ /dev/null @@ -1,1265 +0,0 @@ - - - 2025-02-21T11:13:36+02:00 - foo.zone feed - To be in the .zone! - - - gemini://foo.zone/ - - Random Weird Things - Part Ⅱ - - gemini://foo.zone/gemfeed/2025-02-08-random-weird-things-ii.gmi - 2025-02-08T11:06:16+02:00 - - Paul Buetow aka snonux - paul@dev.buetow.org - - Every so often, I come across random, weird, and unexpected things on the internet. I thought it would be neat to share them here from time to time. This is the second run. - -
-

Random Weird Things - Part Ⅱ


-
-Published at 2025-02-08T11:06:16+02:00
-
-Every so often, I come across random, weird, and unexpected things on the internet. I thought it would be neat to share them here from time to time. This is the second run.
-
-2024-07-05 Random Weird Things - Part Ⅰ
-2025-02-08 Random Weird Things - Part Ⅱ (You are currently reading this)
-
-
-/\_/\           /\_/\
-( o.o ) WHOA!! ( o.o )
-> ^ <           > ^ <
-/   \    MOEEW! /   \
-/______\       /______\
-
-
-

Table of Contents


-
-
-

11. The SQLite codebase is a gem


-
-Check this out:
-
-SQLite Gem
-
-Source:
-
-https://wetdry.world/@memes/112717700557038278
-
-

Go Programming


-
-

12. Official Go font


-
-The Go programming language has an official font called "Go Font." It was created to complement the aesthetic of the Go language, ensuring clear and legible rendering of code. The font includes a monospace version for code and a proportional version for general text, supporting consistent look and readability in Go-related materials and development environments.
-
-Check out some Go code displayed using the Go font:
-
-Go font code
-
-https://go.dev/blog/go-fonts
-
-The design emphasizes simplicity and readability, reflecting Go's philosophy of clarity and efficiency.
-
-I found it interesting and/or weird, as Go is a programming language. Why should it bother having its own font? I have never seen another open-source project like Go do this. But I also like it. Maybe I will use it in the future for this blog :-)
-
-

13. Go functions can have methods


-
-Functions on struct types? Well, know. Functions on types like int and string? It's also known of, but a bit lesser. Functions on function types? That sounds a bit funky, but it's possible, too! For demonstration, have a look at this snippet:
-
- -
package main
-
-import "log"
-
-type fun func() string
-
-func (f fun) Bar() string {
-        return "Bar"
-}
-
-func main() {
-        var f fun = func() string {
-                return "Foo"
-        }
-        log.Println("Example 1: ", f())
-        log.Println("Example 2: ", f.Bar())
-        log.Println("Example 3: ", fun(f.Bar).Bar())
-        log.Println("Example 4: ", fun(fun(f.Bar).Bar).Bar())
-}
-
-
-It runs just fine:
-
- -
❯ go run main.go
-2025/02/07 22:56:14 Example 1:  Foo
-2025/02/07 22:56:14 Example 2:  Bar
-2025/02/07 22:56:14 Example 3:  Bar
-2025/02/07 22:56:14 Example 4:  Bar
-
-
-

macOS


-
-For personal computing, I don't use Apple, but I have to use it for work.
-
-

14. ß and ss are treated the same


-
-Know German? In German, the letter "sarp s" is written as ß. ß is treated the same as ss on macOS.
-
-On a case-insensitive file system like macOS, not only are uppercase and lowercase letters treated the same, but non-Latin characters like the German "ß" are also considered equivalent to their Latin counterparts (in this case, "ss").
-
-So, even though "Maß" and "Mass" are not strictly equivalent, the macOS file system still treats them as the same filename due to its handling of Unicode characters. This can sometimes lead to unexpected behaviour. Check this out:
-
- -
❯ touch Maß
-❯ ls -l
--rw-r--r--@ 1 paul  wheel  0 Feb  7 23:02 Maß
-❯ touch Mass
-❯ ls -l
--rw-r--r--@ 1 paul  wheel  0 Feb  7 23:02 Maß
-❯ rm Mass
-❯ ls -l
-
-❯ touch Mass
-❯ ls -ltr
--rw-r--r--@ 1 paul  wheel  0 Feb  7 23:02 Mass
-❯ rm Maß
-❯ ls -l
-
-
-
-

15. Colon as file path separator


-
-MacOS can use the colon as a file path separator on its ADFS (file system). A typical ADFS file pathname on a hard disc might be:
-
-
-ADFS::4.$.Documents.Techwriter.Myfile
-
-
-I can't reproduce this on my (work) Mac, though, as it now uses the APFS file system. In essence, ADFS is an older file system, while APFS is a contemporary file system optimized for Apple's modern devices.
-
-https://social.jvns.ca/@b0rk/113041293527832730
-
-

16. Polyglots - programs written in multiple languages


-
-A coding polyglot is a program or script written so that it can be executed in multiple programming languages without modification. This is typically achieved by leveraging syntax overlaps or crafting valid and meaningful code in each targeted language. Polyglot programs are often created as a challenge or for demonstration purposes to showcase language similarities or clever coding techniques.
-
-Check out my very own polyglot:
-
-The fibonatti.pl.c Polyglot
-
-

17. Languages, where indices start at 1


-
-Array indices start at 1 instead of 0 in some programming languages, known as one-based indexing. This can be controversial because zero-based indexing is more common in popular languages like C, C++, Java, and Python. One-based indexing can lead to off-by-one errors when developers switch between languages with different indexing schemes.
-
-Languages with One-Based Indexing:
-
-
    -
  • Fortran
  • -
  • MATLAB
  • -
  • Lua
  • -
  • R (for vectors and lists)
  • -
  • Smalltalk
  • -
  • Julia (by default, although zero-based indexing is also possible)
  • -

-foo.lua example:
-
- -
arr = {10, 20, 30, 40, 50}
-print(arr[1]) -- Accessing the first element
-
-
- -
❯ lua foo.lua
-10
-
-
-One-based indexing is more natural for human-readable, mathematical, and theoretical contexts, where counting traditionally starts from one.
-
-

18. Perl Poetry


-
-Perl Poetry is a playful and creative practice within the programming community where Perl code is written as a poem. These poems are crafted to be syntactically valid Perl code and make sense as poetic text, often with whimsical or humorous intent. This showcases Perl's flexibility and expressiveness, as well as the creativity of its programmers.
-
-See this Poetry of my own; the Perl interpreter does not yield any syntax error parsing that. But also, the Peom doesn't do anything useful then executed:
-
- -
# (C) 2006 by Paul C. Buetow
-
-Christmas:{time;#!!!
-
-Children: do tell $wishes;
-
-Santa: for $each (@children) { 
-BEGIN { read $each, $their, wishes and study them; use Memoize#ing
-
-} use constant gift, 'wrapping'; 
-package Gifts; pack $each, gift and bless $each and goto deliver
-or do import if not local $available,!!! HO, HO, HO;
-
-redo Santa, pipe $gifts, to_childs;
-redo Santa and do return if last one, is, delivered; 
-
-deliver: gift and require diagnostics if our $gifts ,not break;
-do{ use NEXT; time; tied $gifts} if broken and dump the, broken, ones;
-The_children: sleep and wait for (each %gift) and try { to => untie $gifts };
-
-redo Santa, pipe $gifts, to_childs;
-redo Santa and do return if last one, is, delivered; 
-
-The_christmas_tree: formline s/ /childrens/, $gifts;
-alarm and warn if not exists $Christmas{ tree}, @t, $ENV{HOME};  
-write <<EMail
- to the parents to buy a new christmas tree!!!!111
- and send the
-EMail
-;wait and redo deliver until defined local $tree;
-
-redo Santa, pipe $gifts, to_childs;
-redo Santa and do return if last one, is, delivered ;}
-
-END {} our $mission and do sleep until next Christmas ;}
-
-__END__
-
-This is perl, v5.8.8 built for i386-freebsd-64int
-
-
-More Perl Poetry of mine
-
-

19. CSS3 is turing complete


-
-CSS3 is Turing complete because it can simulate a Turing machine using only CSS animations and styles without any JavaScript or external logic. This is achieved by using keyframe animations to change the styles of HTML elements in a way that encodes computation, performing calculations and state transitions.
-
-Is CSS turing complete?
-
-It is surprising because CSS is primarily a styling language intended for the presentation layer of web pages, not for computation or logic. Its capability to perform complex computations defies its typical use case and showcases the unintended computational power that can emerge from the creative use of seemingly straightforward technologies.
-
-Check out this 100% CSS implementation of the Conways Game of Life:
-
-
-
-CSS Conways Game of Life
-
-Conway's Game of Life is Turing complete because it can simulate a universal Turing machine, meaning it can perform any computation that a computer can, given the right initial conditions and sufficient time and space. Suppose a language can implement Conway's Game of Life. In that case, it demonstrates the language's ability to handle complex state transitions and computations. It has the necessary constructs (like iteration, conditionals, and data manipulation) to simulate any algorithm, thus confirming its Turing completeness.
-
-

20. The biggest shell programs


-
-One would think that shell scripts are only suitable for small tasks. Well, I must be wrong, as there are huge shell programs out there (up to 87k LOC) which aren't auto-generated but hand-written!
-
-The Biggest Sell Programs in the World
-
-My Gemtexter (bash) is only 1329 LOC as of now. So it's tiny.
-
-Gemtexter - One Bash script to rule it all
-
-I hope you had some fun. E-Mail your comments to paul@nospam.buetow.org :-)
-
-Back to the main site
-
-
-
- - f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts - - gemini://foo.zone/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi - 2025-01-30T09:22:06+02:00 - - Paul Buetow aka snonux - paul@dev.buetow.org - - This is the third blog post about my f3s series for my self-hosting demands in my home lab. f3s? The 'f' stands for FreeBSD, and the '3s' stands for k3s, the Kubernetes distribution we will use on FreeBSD-based physical machines. - -
-

f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts


-
-Published at 2025-01-30T09:22:06+02:00
-
-This is the third blog post about my f3s series for my self-hosting demands in my home lab. f3s? The "f" stands for FreeBSD, and the "3s" stands for k3s, the Kubernetes distribution we will use on FreeBSD-based physical machines.
-
-2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage
-2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation
-2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts (You are currently reading this)
-
-f3s logo
-
-

Table of Contents


-
-
-

Introduction


-
-In this blog post, we are setting up the UPS for the cluster. A UPS, or Uninterruptible Power Supply, safeguards my cluster from unexpected power outages and surges. It acts as a backup battery that kicks in when the electricity cuts out—especially useful in my area, where power cuts are frequent—allowing for a graceful system shutdown and preventing data loss and corruption. This is especially important since I will also store some of my data on the f3s nodes.
-
-

Changes since last time


-
-

FreeBSD upgrade from 14.1 to 14.2


-
-There has been a new release since the last blog post in this series. The upgrade from 14.1 was as easy as:
-
- -
paul@f0: ~ % doas freebsd-update fetch
-paul@f0: ~ % doas freebsd-update install
-paul@f0: ~ % doas freebsd-update -r 14.2-RELEASE upgrade
-paul@f0: ~ % doas freebsd-update install
-paul@f0: ~ % doas shutdown -r now
-
-
-And after rebooting, I ran:
-
- -
paul@f0: ~ % doas freebsd-update install
-paul@f0: ~ % doas pkg update
-paul@f0: ~ % doas pkg upgrade
-paul@f0: ~ % doas shutdown -r now
-
-
-And after another reboot, I was on 14.2:
-
- -
paul@f0:~ % uname -a
-FreeBSD f0.lan.buetow.org 14.2-RELEASE FreeBSD 14.2-RELEASE 
- releng/14.2-n269506-c8918d6c7412 GENERIC amd64
-
-
-And, of course, I ran this on all 3 nodes!
-
-

A new home (behind the TV)


-
-I've put all the infrastructure behind my TV, as plenty of space is available. The TV hides most of the setup, which drastically improved the SAF (spouse acceptance factor).
-
-New hardware placement arrangement
-
-I got rid of the mini-switch I mentioned in the previous blog post. I have the TP-Link EAP615-Wall mounted on the wall nearby, which is my OpenWrt-powered Wi-Fi hotspot. It also has 3 Ethernet ports, to which I connected the Beelink nodes. That's the device you see at the very top.
-
-The Ethernet cables go downward through the cable boxes to the Beelink nodes. In addition to the Beelink f3s nodes, I connected the TP-Link to the UPS as well (not discussed further in this blog post, but the positive side effect is that my Wi-Fi will still work during a power loss for some time—and during a power cut, the Beelink nodes will still be able to communicate with each other).
-
-On the very left (the black box) is the UPS, with four power outlets. Three go to the Beelink nodes, and one goes to the TP-Link. A USB output is also connected to the first Beelink node, f0.
-
-On the very right (halfway hidden behind the TV) are the 3 Beelink nodes stacked on top of each other. The only downside (or upside?) is that my 14-month-old daughter is now chaos-testing the Beelink nodes, as the red power buttons (now reachable for her) are very attractive for her to press when passing by randomly. :-) Luckily, that will only cause graceful system shutdowns!
-
-

The UPS hardware


-
-I wanted a UPS that I could connect to via FreeBSD, and that would provide enough backup power to operate the cluster for a couple of minutes (it turned out to be around an hour, but this time will likely be shortened after future hardware upgrades, like additional drives and a backup enclosure) and to automatically initiate the shutdown of all the f3s nodes.
-
-I decided on the APC Back-UPS BX750MI model because:
-
-
    -
  • Zero noise level when there is no power cut (some light noise when the battery is in operation during a power cut).
  • -
  • Cost: It is relatively affordable (not costing thousands).
  • -
  • USB connectivity: Can be connected via USB to one of the FreeBSD hosts to read the UPS status.
  • -
  • A power output of 750VA (or 410 watts), suitable for an hour of runtime for my f3s nodes (plus the Wi-Fi router).
  • -
  • Multiple power outlets: Can connect all 3 f3s nodes directly.
  • -
  • User-replaceable batteries: I can replace the batteries myself after two years or more (depending on usage).
  • -
  • Its compact design. Overall, I like how it looks.
  • -

-The APC Back-UPS BX750MI in operation.
-
-

Configuring FreeBSD to Work with the UPS


-
-

USB Device Detection


-
-Once plugged in via USB on FreeBSD, I could see the following in the kernel messages:
-
- -
paul@f0: ~ % doas dmesg | grep UPS
-ugen0.2: <American Power Conversion Back-UPS BX750MI> at usbus0
-
-
-

apcupsd Installation


-
-To make use of the USB connection, the apcupsd package had to be installed:
-
- -
paul@f0: ~ % doas install apcupsd
-
-
-I have made the following modifications to the configuration file so that the UPS can be used via the USB interface:
-
- -
paul@f0:/usr/local/etc/apcupsd % diff -u apcupsd.conf.sample  apcupsd.conf
---- apcupsd.conf.sample 2024-11-01 16:40:42.000000000 +0200
-+++ apcupsd.conf        2024-12-03 10:58:24.009501000 +0200
-@@ -31,7 +31,7 @@
- #     940-1524C, 940-0024G, 940-0095A, 940-0095B,
- #     940-0095C, 940-0625A, M-04-02-2000
- #
--UPSCABLE smart
-+UPSCABLE usb
-
- # To get apcupsd to work, in addition to defining the cable
- # above, you must also define a UPSTYPE, which corresponds to
-@@ -88,8 +88,10 @@
- #                            that apcupsd binds to that particular unit
- #                            (helpful if you have more than one USB UPS).
- #
--UPSTYPE apcsmart
--DEVICE /dev/usv
-+UPSTYPE usb
-+DEVICE
-
- # POLLTIME <int>
- #   Interval (in seconds) at which apcupsd polls the UPS for status. This
-
-
-I left the remaining settings as the default ones; for example, the following are of main interest:
-
-
-# If during a power failure, the remaining battery percentage
-# (as reported by the UPS) is below or equal to BATTERYLEVEL,
-# apcupsd will initiate a system shutdown.
-BATTERYLEVEL 5
-
-# If during a power failure, the remaining runtime in minutes
-# (as calculated internally by the UPS) is below or equal to MINUTES,
-# apcupsd, will initiate a system shutdown.
-MINUTES 3
-
-
-I then enabled and started the daemon:
-
- -
paul@f0:/usr/local/etc/apcupsd % doas sysrc apcupsd_enable=YES
-apcupsd_enable:  -> YES
-paul@f0:/usr/local/etc/apcupsd % doas service apcupsd start
-Starting apcupsd.
-
-
-

UPS Connectivity Test


-
-And voila, I could now access the UPS information via the apcaccess command; how convenient :-) (I also read through the manual page, which provides a good understanding of what else can be done with it!).
-
- -
paul@f0:~ % apcaccess
-APC      : 001,035,0857
-DATE     : 2025-01-26 14:43:27 +0200
-HOSTNAME : f0.lan.buetow.org
-VERSION  : 3.14.14 (31 May 2016) freebsd
-UPSNAME  : f0.lan.buetow.org
-CABLE    : USB Cable
-DRIVER   : USB UPS Driver
-UPSMODE  : Stand Alone
-STARTTIME: 2025-01-26 14:43:25 +0200
-MODEL    : Back-UPS BX750MI
-STATUS   : ONLINE
-LINEV    : 230.0 Volts
-LOADPCT  : 4.0 Percent
-BCHARGE  : 100.0 Percent
-TIMELEFT : 65.3 Minutes
-MBATTCHG : 5 Percent
-MINTIMEL : 3 Minutes
-MAXTIME  : 0 Seconds
-SENSE    : Medium
-LOTRANS  : 145.0 Volts
-HITRANS  : 295.0 Volts
-ALARMDEL : No alarm
-BATTV    : 13.6 Volts
-LASTXFER : Automatic or explicit self test
-NUMXFERS : 0
-TONBATT  : 0 Seconds
-CUMONBATT: 0 Seconds
-XOFFBATT : N/A
-SELFTEST : NG
-STATFLAG : 0x05000008
-SERIALNO : 9B2414A03599
-BATTDATE : 2001-01-01
-NOMINV   : 230 Volts
-NOMBATTV : 12.0 Volts
-NOMPOWER : 410 Watts
-END APC  : 2025-01-26 14:44:06 +0200
-
-
-

APC Info on Partner Nodes:


-
-So far, so good. Host f0 would shut down itself when short on power. But what about the f1 and f2 nodes? They aren't connected directly to the UPS and, therefore, wouldn't know that their power is about to be cut off. For this, apcupsd running on the f1 and f2 nodes can be configured to retrieve UPS information via the network from the apcupsd server running on the f0 node, which is connected directly to the APC via USB.
-
-Of course, this won't work when f0 is down. In this case, no operational node would be connected to the UPS via USB; therefore, the current power status would not be known. However, I consider this a rare circumstance. Furthermore, in case of an f0 system crash, sudden power outages on the two other nodes would occur at different times making real data loss (the main concern here) less likely.
-
-And if f0 is down and f1 and f2 receive new data and crash midway, it's likely that a client (e.g., an Android app or another laptop) still has the data stored on it, making data recoverable and data loss overall nearly impossible. I'd receive an alert if any of the nodes go down (more on monitoring later in this blog series).
-
-

Installation on partners


-
-To do this, I installed apcupsd via doas pkg install apcupsd on f1 and f2, and then I could connect to it this way:
-
- -
paul@f1:~ % apcaccess -h f0.lan.buetow.org | grep Percent
-LOADPCT  : 12.0 Percent
-BCHARGE  : 94.0 Percent
-MBATTCHG : 5 Percent
-
-
-But I want the daemon to be configured and enabled in such a way that it connects to the master UPS node (the one with the UPS connected via USB) so that it can also initiate a system shutdown when the UPS battery reaches low levels. For that, apcupsd itself needs to be aware of the UPS status.
-
-On f1 and f2, I changed the configuration to use f0 (where apcupsd is listening) as a remote device. I also changed the MINUTES setting from 3 to 6 and the BATTERYLEVEL setting from 5 to 10 to ensure that the f1 and f2 nodes could still connect to the f0 node for UPS information before f0 decides to shut down itself. So f1 and f2 must shut down earlier than f0:
-
- -
paul@f2:/usr/local/etc/apcupsd % diff -u apcupsd.conf.sample apcupsd.conf
---- apcupsd.conf.sample 2024-11-01 16:40:42.000000000 +0200
-+++ apcupsd.conf        2025-01-26 15:52:45.108469000 +0200
-@@ -31,7 +31,7 @@
- #     940-1524C, 940-0024G, 940-0095A, 940-0095B,
- #     940-0095C, 940-0625A, M-04-02-2000
- #
--UPSCABLE smart
-+UPSCABLE ether
-
- # To get apcupsd to work, in addition to defining the cable
- # above, you must also define a UPSTYPE, which corresponds to
-@@ -52,7 +52,6 @@
- #                            Network Information Server. This is used if the
- #                            UPS powering your computer is connected to a
- #                            different computer for monitoring.
--#
- # snmp      hostname:port:vendor:community
- #                            SNMP network link to an SNMP-enabled UPS device.
- #                            Hostname is the ip address or hostname of the UPS
-@@ -88,8 +87,8 @@
- #                            that apcupsd binds to that particular unit
- #                            (helpful if you have more than one USB UPS).
- #
--UPSTYPE apcsmart
--DEVICE /dev/usv
-+UPSTYPE net
-+DEVICE f0.lan.buetow.org:3551
-
- # POLLTIME <int>
- #   Interval (in seconds) at which apcupsd polls the UPS for status. This
-@@ -147,12 +146,12 @@
- # If during a power failure, the remaining battery percentage
- # (as reported by the UPS) is below or equal to BATTERYLEVEL,
- # apcupsd will initiate a system shutdown.
--BATTERYLEVEL 5
-+BATTERYLEVEL 10
-
- # If during a power failure, the remaining runtime in minutes
- # (as calculated internally by the UPS) is below or equal to MINUTES,
- # apcupsd, will initiate a system shutdown.
--MINUTES 3
-+MINUTES 6
-
- # If during a power failure, the UPS has run on batteries for TIMEOUT
- # many seconds or longer, apcupsd will initiate a system shutdown.
-
-
-So I also ran the following commands on f1 and f2:
-
- -
paul@f1:/usr/local/etc/apcupsd % doas sysrc apcupsd_enable=YES
-apcupsd_enable:  -> YES
-paul@f1:/usr/local/etc/apcupsd % doas service apcupsd start
-Starting apcupsd.
-
-
-And then I was able to connect to localhost via the apcaccess command:
-
- -
paul@f1:~ % doas apcaccess | grep Percent
-LOADPCT  : 5.0 Percent
-BCHARGE  : 95.0 Percent
-MBATTCHG : 5 Percent
-
-
-

Power outage simulation


-
-

Pulling the plug


-
-I simulated a power outage by removing the power input from the APC. Immediately, the following message appeared on all the nodes:
-
-
-Broadcast Message from root@f0.lan.buetow.org
-        (no tty) at 15:03 EET...
-
-Power failure. Running on UPS batteries.                                              
-
-
-I ran the following command to confirm the available battery time:
-
- -
paul@f0:/usr/local/etc/apcupsd % apcaccess -p TIMELEFT
-63.9 Minutes
-
-
-And after around one hour (f1 and f2 a bit earlier, f0 a bit later due to the different BATTERYLEVEL and MINUTES settings outlined earlier), the following broadcast was sent out:
-
-
-Broadcast Message from root@f0.lan.buetow.org
-        (no tty) at 15:08 EET...
-
-        *** FINAL System shutdown message from root@f0.lan.buetow.org ***
-
-System going down IMMEDIATELY
-
-apcupsd initiated shutdown
-
-
-And all the nodes shut down safely before the UPS ran out of battery!
-
-

Restoring power


-
-After restoring power, I checked the logs in /var/log/daemon.log and found the following on all 3 nodes:
-
-
-Jan 26 17:36:24 f2 apcupsd[2159]: Power failure.
-Jan 26 17:36:30 f2 apcupsd[2159]: Running on UPS batteries.
-Jan 26 17:36:30 f2 apcupsd[2159]: Battery charge below low limit.
-Jan 26 17:36:30 f2 apcupsd[2159]: Initiating system shutdown!
-Jan 26 17:36:30 f2 apcupsd[2159]: User logins prohibited
-Jan 26 17:36:32 f2 apcupsd[2159]: apcupsd exiting, signal 15
-Jan 26 17:36:32 f2 apcupsd[2159]: apcupsd shutdown succeeded
-
-
-All good :-) See you in the next post of this series!
-
-Other BSD related posts are:
-
-2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts (You are currently reading this)
-2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation
-2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage
-2024-04-01 KISS high-availability with OpenBSD
-2024-01-13 One reason why I love OpenBSD
-2022-10-30 Installing DTail on OpenBSD
-