diff options
| author | Paul Buetow <paul@buetow.org> | 2025-02-21 10:55:25 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-02-21 10:55:25 +0200 |
| commit | 5a76af565ea910512b0418c56437467068821fd6 (patch) | |
| tree | d8ee7610db5f698703d5891eb9b6aabd1f699f14 | |
| parent | a30460cc038708e3a01cbe8cf4d90c6572e26784 (diff) | |
| parent | 75655782fe8ad0b8b9b5fd26a6837e8a745b7268 (diff) | |
Merge branch 'content-gemtext' of codeberg.org:snonux/foo.zone into content-gemtext
205 files changed, 17022 insertions, 5682 deletions
diff --git a/about/README.md b/about/README.md new file mode 100644 index 00000000..87bbeb17 --- /dev/null +++ b/about/README.md @@ -0,0 +1,13 @@ +The paul.buetow.org internet site +================================= + +This repository contains the static files of my internet site. [gemini://paul.buetow.org](gemini://paul.buetow.org) and [https://paul.buetow.org](https://paul.buetow.org). + +Each format is in it's own branch in this repository. E.g.: + +* Gemtext is in `content-gemtext` +* HTML is in `content-html` +* Markdown is in `content-md` +* ... ando so on. + +You can find more about my internet site and the static content generator at [snonux/gemtexter](https://codeberg.org/snonux/gemtexter). diff --git a/about/index.gmi b/about/index.gmi new file mode 100644 index 00000000..dd1432f8 --- /dev/null +++ b/about/index.gmi @@ -0,0 +1,30 @@ +# About + +* Name: Paul Buetow +* Father, Husband, Computer tinkerer, Yogi, Science fiction lover, cat owner +* Born in: Germany, currently living in: Sofia, Bulgaria +* Profession: Computerist - Solving problems with computers that we wouldn't have without them +* Current job: Site Reliability Engineer +* Education: Diplom-Informatiker (FH) (Diploma from a German University of Applied Sciences, before hey had international Bachelor and Masters programs) +* E-Mail: `paul@nospam.buetow.org` + +=> ./paul.jpg Paul Buetow + +## My sites + +=> ../ My blog here at foo.zone +=> https://codeberg.org/snonux codeberg.org/snonux - My Codeberg page +=> https://dtail.dev dtail.dev - DTail at Mimecast +=> https://irregular.ninja irregular.ninja - My street photography site (warn: multiple MBs, it's photos after all) +=> ./resources.gmi Books, Podcasts, Courses and Guides I recommend +=> ./novels.gmi Novels I've read + +## Social Media and Communities + +=> https://fosstodon.org/@snonux @snonux@fosstodon.org - Me at Mastodon +=> https://www.linkedin.com/in/paul-buetow-b4857270/ My LinkedIn profile +=> https://gophers.slack.com Gophers Slack - Under my real name + +That's all for now... + +=> ../ Back to the main site diff --git a/about/newsletters.txt b/about/newsletters.txt new file mode 100644 index 00000000..4bf9e1ca --- /dev/null +++ b/about/newsletters.txt @@ -0,0 +1,12 @@ +* Register Spill +* Ruby Weekly +* Golang Weekly +* Applied Go Weekly Newsletter +* byteSizeGo +* Andreas Brandhorst Newsletter (Sci-Fi author) +* The Imperfectionist +* The Valuable Dev +* VK Newsletter +* Monospace Mentor +* Changelog News +* The Pragmatic Engineer diff --git a/about/novels.gmi b/about/novels.gmi new file mode 100644 index 00000000..97cbf0a3 --- /dev/null +++ b/about/novels.gmi @@ -0,0 +1,140 @@ +# Novels + +## Table of Contents + +* ⇢ Novels +* ⇢ ⇢ Introduction +* ⇢ ⇢ Read +* ⇢ ⇢ ⇢ Alastair Reynolds +* ⇢ ⇢ ⇢ Arthur C. Clarke +* ⇢ ⇢ ⇢ Andreas Brandhorst (german) +* ⇢ ⇢ ⇢ David Reimer (german) +* ⇢ ⇢ ⇢ Ian Banks +* ⇢ ⇢ ⇢ Dan Simmons +* ⇢ ⇢ ⇢ Other authors +* ⇢ ⇢ Currently reading +* ⇢ ⇢ ⇢ Andreas Brandhorst +* ⇢ ⇢ Unread books already in my shelf +* ⇢ ⇢ ⇢ Alastair Reynolds +* ⇢ ⇢ ⇢ Andreas Brandhorst + +## Introduction + +This site lists my favourite novels I have read. I prefer to read them in German though. You will notice that these are mostly Science Fiction novels. Where possible, this page shows both, english (english) and german (german), titles. + +Some were read as paperback, others as eBooks, and some were listened to (Audiobook). + +``` + . . ' . + ' . . ' . + + ` ' . ' + . ,'`. . + . .." _.-;' `. . + _.-"`.##%"_.--" ,' `. "#" ___,,od000 + ,'"-_ _.-.--"\ ,' `-_ '%#%',,/////00000HH + ,' |_.' )`/- __..--""`-_`-._ J L/////00000HHHHM + . + ,' _.-" / / _-"" `-._`-_/___\///0000HHHHMMM + .'_.-"" ' :_/_.-' _,`-/__V__\0000HHHHHMMMM + . _-"" . ' _,////\ | /000HHHHHMMMMM +_-" . ' + . . ,//////0\ | /00HHHHHHHMMMMM + ` ,//////000\|/00HHHHHHHMMMMMM +. ' . ' . . ' ,//////00000|00HHHHHHHHMMMMMM + . . . ' ,//////000000|00HHHHHHHMMMMMMM + . ' . . ,///////000000|0HHHHHHHHMMMMMMM + ' ' . ' ///////000000000HHHHHHHHMMMMMMM + + . . ' . ,///////000000000HHHHHHHMMMMMMMM + ' . ' . ///////000000000HHHHHHHHMMMMMMMM + ' . ' ///////000000000HHHHHHHHMMMMMMMM + . ' ,///////000000000HHHHHHHHMMMMMMMM +``` + +## Read + +### Alastair Reynolds + +* 2000 - Revelation Space (english) / Unendlichkeit (german) - Revelation Space Universe +* 2001 - Chasm City - Revelation Space Universe +* 2002 - Redemption Ark (english) / Die Arche (german) - Revelation Space Universe +* 2003 - Absolution Gap (english) / Offenbarung (german) - Revelation Space Universe + +### Arthur C. Clarke + +* 1973 - Rendezvous with Rama (english), Audiobook +* 1989 - Rama II (english), Audiobook +* 1991 - The Garden of Rama (english), Audiobook +* 1993 - Rama Revealed (english), Audiobook + +### Andreas Brandhorst (german) + +* 2004 - Diamant (german) - Diamant-Trilogie +* 2004 - Der Metamorph (german) - Diamant-Trilogie +* 2005 - Der Zeitkrieg (german) - Diamant-Trilogie +* 2006 - Feuervögel (german) - Graken-Trilogie +* 2007 - Feuerstürme (german) - Graken-Trilogie +* 2008 - Feuerträume (german) - Graken-Trilogie +* 2010 - Kinder der Ewigkeit (german) +* 2012 - Das Artefakt (german) +* 2013 - Der letzte Regent (german) +* 2014 - Das Kosmotop (german) +* 2015 - Ikarus (german) +* 2015 - Das Schiff (german) +* 2016 - Omni (german) - Omniversum +* 2017 - Das Arkonadia-Rätsel (german) - Omniversum +* 2017 - Das Erwachen (german) - Maschinenintelligenz-Trilogie +* 2018 - Ewiges Leben (german), Andreas Brandhorst +* 2019 - Das Netz der Sterne (german), Audiobook +* 2019 - Seelenfänger (german), Andreas Brandhorst, Audiobook +* 2020 - Die Eskalation (german) - Maschinenintelligenz-Trilogie +* 2021 - Mars Discovery (german) - Maschinenintelligenz-Trilogie +* 2022 - Eklipse (german) +* 2022 - Ruf der Unendlichkeit (german), Audiobook +* 2024 - Infinitia (german), Audiobook +* 2024 - Zeta (german), Andreas Brandhorst, Audiobook + +### David Reimer (german) + +* 2022 - Die Anomalie in der Finsternis - Die Wächter des Wissens - Band 1 (german), (Audiobook) +* 2022 - Der dunkle Reisende - Die Wächter des Wissens - Band 2 (german), (Audiobook) +* 2022 - Das Signal der Schöpfer - Die Wächter des Wissens - Band 3 (german), (Audiobook) +* 2022 - Das Ende des Universums - Die Wächter des Wissens - Band 4 (german), (Audiobook) + +### Ian Banks + +* 1987 - Consider Pheblas (english) / Bedenke Pheblas (german) - Culture Book 1 +* 1988 - The Player of Games (english) - Culture Book 2, Audiobook + +### Dan Simmons + +* 1989 - Hyperion, Audiobook +* 1990 - The fall of Hyperion, Audiobook + +### Other authors + +* 1949 - 1984, George Orwell, Audiobook +* 1979 - The Hitchhikers Guide to the Galaxy (english) / Per Anhalter durch die Galaxis (german), Adam Douglas - All books of the series +* 2009 - Quest, Andreas Eschbach +* 2010 - The Icarus Hunt (english) / Jagt auf Ikarus (german), Timothy Zahn +* 2010 - Der Astronaut (german), Andy Weir, Audiobook +* 2019 - Die Unvollkommenen (german), Theresa Hannig, Audiobook +* 2022 - Mickey 7 - Der letzte Klon (german), Edward Ashton, Audiobook + +## Currently reading + +### Andreas Brandhorst + +* 2023 - Oxygen: Welt ohne Sauerstoff, Audiobook (german) +* 2024 - Der Riss (german) + +## Unread books already in my shelf + +### Alastair Reynolds + +* 2004 - Träume von Unendlichkeit (german) + +### Andreas Brandhorst + +* 2021 - Die Tiefe der Zeit (german) + +Do you recommend a good Science Fiction Novel? E-Mail at paul at buetow dot org! :-) + +=> ./ Go back diff --git a/about/novels.gmi.tpl b/about/novels.gmi.tpl new file mode 100644 index 00000000..e1416570 --- /dev/null +++ b/about/novels.gmi.tpl @@ -0,0 +1,124 @@ +# Novels + +<< template::inline::toc + +## Introduction + +This site lists my favourite novels I have read. I prefer to read them in German though. You will notice that these are mostly Science Fiction novels. Where possible, this page shows both, english (english) and german (german), titles. + +Some were read as paperback, others as eBooks, and some were listened to (Audiobook). + +``` + . . ' . + ' . . ' . + + ` ' . ' + . ,'`. . + . .." _.-;' `. . + _.-"`.##%"_.--" ,' `. "#" ___,,od000 + ,'"-_ _.-.--"\ ,' `-_ '%#%',,/////00000HH + ,' |_.' )`/- __..--""`-_`-._ J L/////00000HHHHM + . + ,' _.-" / / _-"" `-._`-_/___\///0000HHHHMMM + .'_.-"" ' :_/_.-' _,`-/__V__\0000HHHHHMMMM + . _-"" . ' _,////\ | /000HHHHHMMMMM +_-" . ' + . . ,//////0\ | /00HHHHHHHMMMMM + ` ,//////000\|/00HHHHHHHMMMMMM +. ' . ' . . ' ,//////00000|00HHHHHHHHMMMMMM + . . . ' ,//////000000|00HHHHHHHMMMMMMM + . ' . . ,///////000000|0HHHHHHHHMMMMMMM + ' ' . ' ///////000000000HHHHHHHHMMMMMMM + + . . ' . ,///////000000000HHHHHHHMMMMMMMM + ' . ' . ///////000000000HHHHHHHHMMMMMMMM + ' . ' ///////000000000HHHHHHHHMMMMMMMM + . ' ,///////000000000HHHHHHHHMMMMMMMM +``` + +## Read + +### Alastair Reynolds + +* 2000 - Revelation Space (english) / Unendlichkeit (german) - Revelation Space Universe +* 2001 - Chasm City - Revelation Space Universe +* 2002 - Redemption Ark (english) / Die Arche (german) - Revelation Space Universe +* 2003 - Absolution Gap (english) / Offenbarung (german) - Revelation Space Universe + +### Arthur C. Clarke + +* 1973 - Rendezvous with Rama (english), Audiobook +* 1989 - Rama II (english), Audiobook +* 1991 - The Garden of Rama (english), Audiobook +* 1993 - Rama Revealed (english), Audiobook + +### Andreas Brandhorst (german) + +* 2004 - Diamant (german) - Diamant-Trilogie +* 2004 - Der Metamorph (german) - Diamant-Trilogie +* 2005 - Der Zeitkrieg (german) - Diamant-Trilogie +* 2006 - Feuervögel (german) - Graken-Trilogie +* 2007 - Feuerstürme (german) - Graken-Trilogie +* 2008 - Feuerträume (german) - Graken-Trilogie +* 2010 - Kinder der Ewigkeit (german) +* 2012 - Das Artefakt (german) +* 2013 - Der letzte Regent (german) +* 2014 - Das Kosmotop (german) +* 2015 - Ikarus (german) +* 2015 - Das Schiff (german) +* 2016 - Omni (german) - Omniversum +* 2017 - Das Arkonadia-Rätsel (german) - Omniversum +* 2017 - Das Erwachen (german) - Maschinenintelligenz-Trilogie +* 2018 - Ewiges Leben (german), Andreas Brandhorst +* 2019 - Das Netz der Sterne (german), Audiobook +* 2019 - Seelenfänger (german), Andreas Brandhorst, Audiobook +* 2020 - Die Eskalation (german) - Maschinenintelligenz-Trilogie +* 2021 - Mars Discovery (german) - Maschinenintelligenz-Trilogie +* 2022 - Eklipse (german) +* 2022 - Ruf der Unendlichkeit (german), Audiobook +* 2024 - Infinitia (german), Audiobook +* 2024 - Zeta (german), Andreas Brandhorst, Audiobook + +### David Reimer (german) + +* 2022 - Die Anomalie in der Finsternis - Die Wächter des Wissens - Band 1 (german), (Audiobook) +* 2022 - Der dunkle Reisende - Die Wächter des Wissens - Band 2 (german), (Audiobook) +* 2022 - Das Signal der Schöpfer - Die Wächter des Wissens - Band 3 (german), (Audiobook) +* 2022 - Das Ende des Universums - Die Wächter des Wissens - Band 4 (german), (Audiobook) + +### Ian Banks + +* 1987 - Consider Pheblas (english) / Bedenke Pheblas (german) - Culture Book 1 +* 1988 - The Player of Games (english) - Culture Book 2, Audiobook + +### Dan Simmons + +* 1989 - Hyperion, Audiobook +* 1990 - The fall of Hyperion, Audiobook + +### Other authors + +* 1949 - 1984, George Orwell, Audiobook +* 1979 - The Hitchhikers Guide to the Galaxy (english) / Per Anhalter durch die Galaxis (german), Adam Douglas - All books of the series +* 2009 - Quest, Andreas Eschbach +* 2010 - The Icarus Hunt (english) / Jagt auf Ikarus (german), Timothy Zahn +* 2010 - Der Astronaut (german), Andy Weir, Audiobook +* 2019 - Die Unvollkommenen (german), Theresa Hannig, Audiobook +* 2022 - Mickey 7 - Der letzte Klon (german), Edward Ashton, Audiobook + +## Currently reading + +### Andreas Brandhorst + +* 2023 - Oxygen: Welt ohne Sauerstoff, Audiobook (german) +* 2024 - Der Riss (german) + +## Unread books already in my shelf + +### Alastair Reynolds + +* 2004 - Träume von Unendlichkeit (german) + +### Andreas Brandhorst + +* 2021 - Die Tiefe der Zeit (german) + +Do you recommend a good Science Fiction Novel? E-Mail at paul at buetow dot org! :-) + +=> ./ Go back diff --git a/about/old-podcasts.txt b/about/old-podcasts.txt new file mode 100644 index 00000000..ab5c691e --- /dev/null +++ b/about/old-podcasts.txt @@ -0,0 +1,6 @@ +* Java Pub House +* Modern Mentor +* CRE: Chaosradio Express [german] +* FLOSS weekly +* Go Time (predecessor of fallthrough) +* Ship It (predecessor of Fork Around And Find Out) diff --git a/about/paul.jpg b/about/paul.jpg Binary files differnew file mode 100644 index 00000000..8acac9b8 --- /dev/null +++ b/about/paul.jpg diff --git a/about/podcasts.txt b/about/podcasts.txt new file mode 100644 index 00000000..182d02cc --- /dev/null +++ b/about/podcasts.txt @@ -0,0 +1,12 @@ +* The Pragmatic Engineer Podcast +* Backend Banter +* The Changelog Podcast(s) +* Cup o' Go [Golang] +* Deep Questions with Cal Newport +* Dev Interrupted +* Fallthrough [Golang] +* Hidden Brain +* Maintainable +* Fork Around And Find Out +* The ProdCast (Google SRE Podcast) +* BSD Now diff --git a/about/resources.gmi b/about/resources.gmi new file mode 100644 index 00000000..a70b80d3 --- /dev/null +++ b/about/resources.gmi @@ -0,0 +1,231 @@ +# Resources + +This site contains a list of resources I find and found helpful. I am not an expert in all of these topics, but all the resources listed here impacted me. I read some of the books quite a long time ago, so there might be newer editions out there already, and I might need to refresh some of the knowledge. + +The list may not be exhaustive, but I will be adding more in the future. I firmly believe that educating yourself further is one of the most important things to advance. The lists are in random order and reshuffled every time (via *sort -R*) when updates are made. + +You won't find any links on this site because, over time, the links will break. Please use your favourite search engine when you are interested in one of the resources... + +``` + .--. .---. .-. + .---|--| .-. | A | .---. |~| .--. +.--|===|Go|---|_|--.__| S |--|:::| |~|-==-|==|---. +|%%|Lin|la|===| |~~|%%| C |--| |_|~|Perl| |___|-. +| |ux |ng|===| |==| | I | |k8s|=| | 7 |Ra|---|=| +| | | | |_|__| | I |__| | | | |ku|___| | +|~~|===|--|===|~|~~|%%|~~~|--|:::|=|~|----|==|---|=| +^--^---'--^---^-^--^--^---'--^---^-^-^-==-^--^---^-'hjw +``` + +## Table of Contents + +* ⇢ Resources +* ⇢ ⇢ Technical books +* ⇢ ⇢ Technical references +* ⇢ ⇢ Self-development and soft-skills books +* ⇢ ⇢ Technical video lectures and courses +* ⇢ ⇢ Technical guides +* ⇢ ⇢ Podcasts +* ⇢ ⇢ ⇢ Podcasts I like +* ⇢ ⇢ ⇢ Podcasts I liked +* ⇢ ⇢ Newsletters I like +* ⇢ Formal education + +## Technical books + +In random order: + +* Java ist auch eine Insel; Christian Ullenboom; +* Hands-on Infrastructure Monitoring with Prometheus; Joel Bastos, Pedro Araujo; Packt +* Modern Perl; Chromatic ; Onyx Neon Press +* Systemprogrammierung in Go; Frank Müller; dpunkt +* The Go Programming Language; Alan A. A. Donovan; Addison-Wesley Professional +* Effective Java; Joshua Bloch; Addison-Wesley Professional +* Concurrency in Go; Katherine Cox-Buday; O'Reilly +* Pro Puppet; James Turnbull, Jeffrey McCune; Apress +* Object-Oriented Programming with ANSI-C; Axel-Tobias Schreiner +* Think Raku (aka Think Perl 6); Laurent Rosenfeld, Allen B. Downey; O'Reilly +* The KCNA (Kubernetes and Cloud Native Associate) Book; Nigel Poulton +* The DevOps Handbook; Gene Kim, Jez Humble, Patrick Debois, John Willis; Audible +* Ultimate Go Notebook; Bill Kennedy +* Higher Order Perl; Mark Dominus; Morgan Kaufmann +* Tmux 2: Productive Mouse-free Development; Brain P. Hogan; The Pragmatic Programmers +* Data Science at the Command Line; Jeroen Janssens; O'Reilly +* Systems Performance Tuning; Gian-Paolo D. Musumeci and others...; O'Reilly +* Effective awk programming; Arnold Robbins; O'Reilly +* 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 +* Learn You a Haskell for Great Good!; Miran Lipovaca; No Starch Press +* Go Brain Teasers - Exercise Your Mind; Miki Tebeka; The Pragmatic Programmers +* The Docker Book; James Turnbull; Kindle +* Amazon Web Services in Action; Michael Wittig and Andreas Wittig; Manning Publications +* Polished Ruby Programming; Jeremy Evans; Packt Publishing +* Learn You Some Erlang for Great Good; Fred Herbert; No Starch Press +* Perl New Features; Joshua McAdams, brian d foy; Perl School +* Raku Fundamentals; Moritz Lenz; Apress +* DevOps And Site Reliability Engineering Handbook; Stephen Fleming; Audible +* Developing Games in Java; David Brackeen and others...; New Riders +* 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 +* C++ Programming Language; Bjarne Stroustrup; +* Distributed Systems: Principles and Paradigms; Andrew S. Tanenbaum; Pearson +* Terraform Cookbook; Mikael Krief; Packt Publishing +* DNS and BIND; Cricket Liu; O'Reilly +* 100 Go Mistakes and How to Avoid Them; Teiva Harsanyi; Manning Publications +* Funktionale Programmierung; Peter Pepper; Springer +* Kubernetes Cookbook; Sameer Naik, Sébastien Goasguen, Jonathan Michaux; O'Reilly +* Site Reliability Engineering; How Google runs production systems; O'Reilly +* Raku Recipes; J.J. Merelo; Apress +* 97 things every SRE should know; Emil Stolarsky, Jaime Woo; O'Reilly +* The Pragmatic Programmer; David Thomas; Addison-Wesley +* Leanring eBPF; Liz Rice; O'Reilly +* 21st Century C: C Tips from the New School; Ben Klemens; O'Reilly +* The Kubernetes Book; Nigel Poulton; Unabridged Audiobook + +## 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: + +* Understanding the Linux Kernel; Daniel P. Bovet, Marco Cesati; O'Reilly +* Implementing Service Level Objectives; Alex Hidalgo; O'Reilly +* Relayd and Httpd Mastery; Michael W Lucas +* Algorithms; Robert Sedgewick, Kevin Wayne; Addison Wesley +* BPF Performance Tools - Linux System and Application Observability, Brendan Gregg; Addison Wesley +* Groovy Kurz & Gut; Joerg Staudemeier; O'Reilly +* The Linux Programming Interface; Michael Kerrisk; No Starch Press + +## Self-development and soft-skills books + +In random order: + +* Solve for Happy; Mo Gawdat +* Deep Work; Cal Newport; Piatkus +* Who Moved My Cheese?; Dr. Spencer Johnson; Vermilion +* The Bullet Journal Method; Ryder Carroll; Fourth Estate +* Digital Minimalism; Cal Newport; Portofolio Penguin +* 101 Essays that change the way you think; Brianna Wiest; Audible +* The Daily Stoic; Ryan Holiday, Stephen Hanselman; Profile Books +* Consciousness: A Very Short Introduction; Susan Blackmore; Oxford Uiversity Press +* Atomic Habits; James Clear; Random House Business +* Staff Engineer: Leadership beyond the management track; Will Larson; Audible +* The Phoenix Project - A Novel About IT, DevOps, and Helping your Business Win; Gene Kim and Kevin Behr; Trade Select +* Time Management for System Administrators; Thomas A. Limoncelli; O'Reilly +* The Power of Now; Eckhard Tolle; Yellow Kite +* Search Inside Yourself - The Unexpected path to Achieving Success, Happiness (and World Peace); Chade-Meng Tan, Daniel Goleman, Jon Kabat-Zinn; HarperOne +* The Off Switch; Mark Cropley; Virgin Books +* Buddah and Einstein walk into a Bar; Guy Joseph Ale, Claire Bloom; Blackstone Publishing +* Ultralearning; Anna Laurent; Self-published via Amazon +* Stop starting, start finishing; Arne Roock; Lean-Kanban University +* The Good Enough Job; Simone Stolzoff; Ebury Edge +* So Good They Can't Ignore You; Cal Newport; Business Plus +* The Joy of Missing Out; Christina Crook; New Society Publishers +* The Complete Software Developer's Career Guide; John Sonmez; Unabridged Audiobook +* Soft Skills; John Sommez; Manning Publications +* Influence without Authority; A. Cohen, D. Bradford; Wiley +* Eat That Frog!; Brian Tracy; Hodder Paperbacks +* Never Split the Difference; Chris Voss, Tahl Raz; Random House Business +* Getting Things Done; David Allen +* Slow Productivity; Cal Newport; Penguin Random House +* Ultralearning; Scott Young; Thorsons +* The Obstacle Is The Way; Ryan Holiday; Profile Books Ltd +* The 7 Habits Of Highly Effective People; Stephen R. Covey; Simon & Schuster UK +* Eat That Frog; Brian Tracy +* Psycho-Cybernetics; Maxwell Maltz; Perigee Books + +=> ../notes/index.gmi Here are notes of mine for some of the books + +## Technical video lectures and courses + +Some of these were in-person with exams; others were online learning lectures only. In random order: + +* Functional programming lecture; Remote University of Hagen +* Developing IaC with Terraform (with Live Lessons); O'Reilly Online +* The Well-Grounded Rubyist Video Edition; David. A. Black; O'Reilly Online +* AWS Immersion Day; Amazon; 1-day interactive online training +* Apache Tomcat Best Practises; 3-day on-site training +* Linux Security and Isolation APIs Training; Michael Kerrisk; 3-day on-site training +* Scripting Vim; Damian Conway; O'Reilly Online +* The Ultimate Kubernetes Bootcamp; School of Devops; O'Reilly Online +* 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) +* MySQL Deep Dive Workshop; 2-day on-site training +* Structure and Interpretation of Computer Programs; Harold Abelson and more...; +* Ultimate Go Programming; Bill Kennedy; 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 +* Protocol buffers; O'Reilly Online +* F5 Loadbalancers Training; 2-day on-site training; F5, Inc. + +## 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 + +## Podcasts + +### Podcasts I like + +In random order: + +* Maintainable +* Fork Around And Find Out +* Deep Questions with Cal Newport +* Backend Banter +* Dev Interrupted +* Hidden Brain +* The Changelog Podcast(s) +* The Pragmatic Engineer Podcast +* The ProdCast (Google SRE Podcast) +* BSD Now +* Cup o' Go [Golang] +* Fallthrough [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. + +* CRE: Chaosradio Express [german] +* Java Pub House +* Modern Mentor +* FLOSS weekly +* Ship It (predecessor of Fork Around And Find Out) +* Go Time (predecessor of fallthrough) + +## Newsletters I like + +This is a mix of tech and non-tech newsletters I am subscribed to. In random order: + +* VK Newsletter +* The Pragmatic Engineer +* Andreas Brandhorst Newsletter (Sci-Fi author) +* The Imperfectionist +* byteSizeGo +* Golang Weekly +* Monospace Mentor +* Changelog News +* Applied Go Weekly Newsletter +* Register Spill +* Ruby Weekly +* The Valuable Dev + +# Formal education + +I have met many self-taught IT professionals I highly respect. In my own opinion, a formal degree does not automatically qualify a person for a particular job. It is more about how you educate yourself further *after* formal education. The pragmatic way of thinking and getting things done do not require a college or university degree. + +However, I still believe a degree in Computer Science helps to understand all the theories involved that you would have never learned otherwise. Isn't it cool to understand how compilers work under the hood (automata theory) even if you are not required to hack the compiler in your current position? You could apply the same theory for other things too. This was just *one* example. + +* One year Student exchange program in OH, USA +* German School Majors (Abitur), focus areas: German and Mathematics +* Half-year internship as a C/C++ programmer in Sofia, Bulgaria +* Graduated from University as Diplom-Inform. (FH) at the Aachen University of Applied Sciences, Germany + +My diploma thesis, "Object-oriented development of a GUI based tool for event-based simulation of distributed systems," can be found at: + +=> https://codeberg.org/snonux/vs-sim + +I was one of the last students handed out an "old fashioned" German Diploma degree before the University switched to the international Bachelor and Master versions. To give you an idea: The "Diplom-Inform. (FH)" means translated "Diploma in Informatics from a University of Applied Sciences (FH: Fachhochschule)". Going after the international student credit score, it can be seen as an equivalent to a "Master in Computer Science" degree. + +Colleges and Universities are costly in many countries. Come to Germany, the first college degree is for free (if you finish within a certain deadline!) + +=> ./ Go back diff --git a/about/resources.gmi.tpl b/about/resources.gmi.tpl new file mode 100644 index 00000000..561e7ef1 --- /dev/null +++ b/about/resources.gmi.tpl @@ -0,0 +1,93 @@ +# Resources + +This site contains a list of resources I find and found helpful. I am not an expert in all of these topics, but all the resources listed here impacted me. I read some of the books quite a long time ago, so there might be newer editions out there already, and I might need to refresh some of the knowledge. + +The list may not be exhaustive, but I will be adding more in the future. I firmly believe that educating yourself further is one of the most important things to advance. The lists are in random order and reshuffled every time (via *sort -R*) when updates are made. + +You won't find any links on this site because, over time, the links will break. Please use your favourite search engine when you are interested in one of the resources... + +``` + .--. .---. .-. + .---|--| .-. | A | .---. |~| .--. +.--|===|Go|---|_|--.__| S |--|:::| |~|-==-|==|---. +|%%|Lin|la|===| |~~|%%| C |--| |_|~|Perl| |___|-. +| |ux |ng|===| |==| | I | |k8s|=| | 7 |Ra|---|=| +| | | | |_|__| | I |__| | | | |ku|___| | +|~~|===|--|===|~|~~|%%|~~~|--|:::|=|~|----|==|---|=| +^--^---'--^---^-^--^--^---'--^---^-^-^-==-^--^---^-'hjw +``` + +<< template::inline::toc + +## Technical books + +In random order: + +<< sort -R technical-books.txt + +## 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: + +<< sort -R technical-references.txt + +## Self-development and soft-skills books + +In random order: + +<< sort -R self-skills.txt + +=> ../notes/index.gmi Here are notes of mine for some of the books + +## Technical video lectures and courses + +Some of these were in-person with exams; others were online learning lectures only. In random order: + +<< sort -R technical-courses.txt + +## Technical guides + +These are not whole books, but guides (smaller or larger) which I found very useful. in random order: + +<< sort -R technical-guides.txt + +## Podcasts + +### Podcasts I like + +In random order: + +<< sort -R podcasts.txt + +### 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. + +<< sort -R old-podcasts.txt + +## Newsletters I like + +This is a mix of tech and non-tech newsletters I am subscribed to. In random order: + +<< sort -R newsletters.txt + +# Formal education + +I have met many self-taught IT professionals I highly respect. In my own opinion, a formal degree does not automatically qualify a person for a particular job. It is more about how you educate yourself further *after* formal education. The pragmatic way of thinking and getting things done do not require a college or university degree. + +However, I still believe a degree in Computer Science helps to understand all the theories involved that you would have never learned otherwise. Isn't it cool to understand how compilers work under the hood (automata theory) even if you are not required to hack the compiler in your current position? You could apply the same theory for other things too. This was just *one* example. + +* One year Student exchange program in OH, USA +* German School Majors (Abitur), focus areas: German and Mathematics +* Half-year internship as a C/C++ programmer in Sofia, Bulgaria +* Graduated from University as Diplom-Inform. (FH) at the Aachen University of Applied Sciences, Germany + +My diploma thesis, "Object-oriented development of a GUI based tool for event-based simulation of distributed systems," can be found at: + +=> https://codeberg.org/snonux/vs-sim + +I was one of the last students handed out an "old fashioned" German Diploma degree before the University switched to the international Bachelor and Master versions. To give you an idea: The "Diplom-Inform. (FH)" means translated "Diploma in Informatics from a University of Applied Sciences (FH: Fachhochschule)". Going after the international student credit score, it can be seen as an equivalent to a "Master in Computer Science" degree. + +Colleges and Universities are costly in many countries. Come to Germany, the first college degree is for free (if you finish within a certain deadline!) + +=> ./ Go back diff --git a/about/self-skills.txt b/about/self-skills.txt new file mode 100644 index 00000000..d82d7f02 --- /dev/null +++ b/about/self-skills.txt @@ -0,0 +1,33 @@ +* Eat That Frog; Brian Tracy +* Getting Things Done; David Allen +* Solve for Happy; Mo Gawdat +* 101 Essays that change the way you think; Brianna Wiest; Audible +* Slow Productivity; Cal Newport; Penguin Random House +* Search Inside Yourself - The Unexpected path to Achieving Success, Happiness (and World Peace); Chade-Meng Tan, Daniel Goleman, Jon Kabat-Zinn; HarperOne +* Atomic Habits; James Clear; Random House Business +* Buddah and Einstein walk into a Bar; Guy Joseph Ale, Claire Bloom; Blackstone Publishing +* Consciousness: A Very Short Introduction; Susan Blackmore; Oxford Uiversity Press +* Deep Work; Cal Newport; Piatkus +* Digital Minimalism; Cal Newport; Portofolio Penguin +* Eat That Frog!; Brian Tracy; Hodder Paperbacks +* Influence without Authority; A. Cohen, D. Bradford; Wiley +* Never Split the Difference; Chris Voss, Tahl Raz; Random House Business +* Psycho-Cybernetics; Maxwell Maltz; Perigee Books +* Soft Skills; John Sommez; Manning Publications +* So Good They Can't Ignore You; Cal Newport; Business Plus +* Staff Engineer: Leadership beyond the management track; Will Larson; Audible +* Stop starting, start finishing; Arne Roock; Lean-Kanban University +* The 7 Habits Of Highly Effective People; Stephen R. Covey; Simon & Schuster UK +* The Bullet Journal Method; Ryder Carroll; Fourth Estate +* The Complete Software Developer's Career Guide; John Sonmez; Unabridged Audiobook +* The Daily Stoic; Ryan Holiday, Stephen Hanselman; Profile Books +* The Good Enough Job; Simone Stolzoff; Ebury Edge +* The Joy of Missing Out; Christina Crook; New Society Publishers +* The Obstacle Is The Way; Ryan Holiday; Profile Books Ltd +* The Off Switch; Mark Cropley; Virgin Books +* The Phoenix Project - A Novel About IT, DevOps, and Helping your Business Win; Gene Kim and Kevin Behr; Trade Select +* The Power of Now; Eckhard Tolle; Yellow Kite +* Time Management for System Administrators; Thomas A. Limoncelli; O'Reilly +* Ultralearning; Anna Laurent; Self-published via Amazon +* Ultralearning; Scott Young; Thorsons +* Who Moved My Cheese?; Dr. Spencer Johnson; Vermilion diff --git a/about/technical-books.txt b/about/technical-books.txt new file mode 100644 index 00000000..fa7c6a8a --- /dev/null +++ b/about/technical-books.txt @@ -0,0 +1,45 @@ +* 100 Go Mistakes and How to Avoid Them; Teiva Harsanyi; Manning Publications +* The KCNA (Kubernetes and Cloud Native Associate) Book; Nigel Poulton +* Hands-on Infrastructure Monitoring with Prometheus; Joel Bastos, Pedro Araujo; Packt +* 21st Century C: C Tips from the New School; Ben Klemens; O'Reilly +* 97 things every SRE should know; Emil Stolarsky, Jaime Woo; O'Reilly +* Amazon Web Services in Action; Michael Wittig and Andreas Wittig; Manning Publications +* Clusterbau mit Linux-HA; Michael Schwartzkopff; O'Reilly +* Concurrency in Go; Katherine Cox-Buday; O'Reilly +* C++ Programming Language; Bjarne Stroustrup; +* Data Science at the Command Line; Jeroen Janssens; O'Reilly +* Developing Games in Java; David Brackeen and others...; New Riders +* DevOps And Site Reliability Engineering Handbook; Stephen Fleming; Audible +* Distributed Systems: Principles and Paradigms; Andrew S. Tanenbaum; Pearson +* DNS and BIND; Cricket Liu; O'Reilly +* Effective awk programming; Arnold Robbins; O'Reilly +* Effective Java; Joshua Bloch; Addison-Wesley Professional +* Funktionale Programmierung; Peter Pepper; Springer +* Go Brain Teasers - Exercise Your Mind; Miki Tebeka; The Pragmatic Programmers +* Higher Order Perl; Mark Dominus; Morgan Kaufmann +* Java ist auch eine Insel; Christian Ullenboom; +* Leanring eBPF; Liz Rice; O'Reilly +* Learn You a Haskell for Great Good!; Miran Lipovaca; No Starch Press +* Learn You Some Erlang for Great Good; Fred Herbert; No Starch Press +* Modern Perl; Chromatic ; Onyx Neon Press +* Object-Oriented Programming with ANSI-C; Axel-Tobias Schreiner +* Perl New Features; Joshua McAdams, brian d foy; Perl School +* Polished Ruby Programming; Jeremy Evans; Packt Publishing +* Programming Perl aka "The Camel Book"; Tom Christiansen, brian d foy, Larry Wall & Jon Orwant; O'Reilly +* Pro Puppet; James Turnbull, Jeffrey McCune; Apress +* Raku Fundamentals; Moritz Lenz; Apress +* Raku Recipes; J.J. Merelo; Apress +* Site Reliability Engineering; How Google runs production systems; O'Reilly +* Systemprogrammierung in Go; Frank Müller; dpunkt +* Systems Performance Tuning; Gian-Paolo D. Musumeci and others...; O'Reilly +* Terraform Cookbook; Mikael Krief; Packt Publishing +* The Kubernetes Book; Nigel Poulton; Unabridged Audiobook +* Kubernetes Cookbook; Sameer Naik, Sébastien Goasguen, Jonathan Michaux; O'Reilly +* The DevOps Handbook; Gene Kim, Jez Humble, Patrick Debois, John Willis; Audible +* The Docker Book; James Turnbull; Kindle +* The Go Programming Language; Alan A. A. Donovan; Addison-Wesley Professional +* 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 +* The Pragmatic Programmer; David Thomas; Addison-Wesley +* Think Raku (aka Think Perl 6); Laurent Rosenfeld, Allen B. Downey; O'Reilly +* Tmux 2: Productive Mouse-free Development; Brain P. Hogan; The Pragmatic Programmers +* Ultimate Go Notebook; Bill Kennedy diff --git a/about/technical-courses.txt b/about/technical-courses.txt new file mode 100644 index 00000000..ac67f997 --- /dev/null +++ b/about/technical-courses.txt @@ -0,0 +1,16 @@ +* Algorithms Video Lectures; Robert Sedgewick; O'Reilly Online +* Apache Tomcat Best Practises; 3-day on-site training +* AWS Immersion Day; Amazon; 1-day interactive online training +* Cloud Operations on AWS - Learn how to configure, deploy, maintain, and troubleshoot your AWS environments; 3-day online live training with labs; Amazon +* Developing IaC with Terraform (with Live Lessons); O'Reilly Online +* F5 Loadbalancers Training; 2-day on-site training; F5, Inc. +* Functional programming lecture; Remote University of Hagen +* Linux Security and Isolation APIs Training; Michael Kerrisk; 3-day on-site training +* MySQL Deep Dive Workshop; 2-day on-site training +* Protocol buffers; 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) +* Scripting Vim; Damian Conway; O'Reilly Online +* Structure and Interpretation of Computer Programs; Harold Abelson and more...; +* The Ultimate Kubernetes Bootcamp; School of Devops; O'Reilly Online +* The Well-Grounded Rubyist Video Edition; David. A. Black; O'Reilly Online +* Ultimate Go Programming; Bill Kennedy; O'Reilly Online diff --git a/about/technical-guides.txt b/about/technical-guides.txt new file mode 100644 index 00000000..19ee85dd --- /dev/null +++ b/about/technical-guides.txt @@ -0,0 +1,3 @@ +* Advanced Bash-Scripting Guide +* Raku Guide at https://raku.guide +* How CPUs work at https://cpu.land diff --git a/about/technical-references.txt b/about/technical-references.txt new file mode 100644 index 00000000..20b34486 --- /dev/null +++ b/about/technical-references.txt @@ -0,0 +1,7 @@ +* Algorithms; Robert Sedgewick, Kevin Wayne; Addison Wesley +* BPF Performance Tools - Linux System and Application Observability, Brendan Gregg; Addison Wesley +* Implementing Service Level Objectives; Alex Hidalgo; O'Reilly +* Relayd and Httpd Mastery; Michael W Lucas +* The Linux Programming Interface; Michael Kerrisk; No Starch Press +* Understanding the Linux Kernel; Daniel P. Bovet, Marco Cesati; O'Reilly +* Groovy Kurz & Gut; Joerg Staudemeier; O'Reilly diff --git a/gemfeed/2008-06-26-perl-poetry.gmi b/gemfeed/2008-06-26-perl-poetry.gmi index 0f3ba25b..5c1f8077 100644 --- a/gemfeed/2008-06-26-perl-poetry.gmi +++ b/gemfeed/2008-06-26-perl-poetry.gmi @@ -2,6 +2,12 @@ > Published at 2008-06-26T21:43:51+01:00; Updated at 2021-05-04 +Here are some Perl Poems I wrote. They don't do anything useful when you run them, but they don't produce a compiler error either. They only exist for fun and demonstrate what you can do with Perl syntax. + +Wikipedia: "Perl poetry is the practice of writing poems that can be compiled as legal Perl code, for example the piece known as Black Perl. Perl poetry is made possible by the large number of English words that are used in the Perl language. New poems are regularly submitted to the community at PerlMonks." + +=> https://en.wikipedia.org/wiki/Perl + ``` '\|/' * -- * ----- @@ -25,11 +31,13 @@ _~~|~/_|_|__/|~~~~~~~ | / ~~~~~ | | ~~~~~~~~ (__) (____) ``` -Here are some Perl Poems I wrote. They don't do anything useful when you run them, but they don't produce a compiler error either. They only exist for fun and demonstrate what you can do with Perl syntax. - -Wikipedia: "Perl poetry is the practice of writing poems that can be compiled as legal Perl code, for example the piece known as Black Perl. Perl poetry is made possible by the large number of English words that are used in the Perl language. New poems are regularly submitted to the community at PerlMonks." +## Table of Contents -=> https://en.wikipedia.org/wiki/Perl +* ⇢ Perl Poetry +* ⇢ ⇢ math.pl +* ⇢ ⇢ christmas.pl +* ⇢ ⇢ shopping.pl +* ⇢ ⇢ More... ## math.pl @@ -165,8 +173,8 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -=> ./2008-06-26-perl-poetry.gmi 2008-06-26 Perl Poetry (You are currently reading this) -=> ./2011-05-07-perl-daemon-service-framework.gmi 2011-05-07 Perl Daemon (Service Framework) => ./2022-05-27-perl-is-still-a-great-choice.gmi 2022-05-27 Perl is still a great choice +=> ./2011-05-07-perl-daemon-service-framework.gmi 2011-05-07 Perl Daemon (Service Framework) +=> ./2008-06-26-perl-poetry.gmi 2008-06-26 Perl Poetry (You are currently reading this) => ../ Back to the main site diff --git a/gemfeed/2008-06-26-perl-poetry.gmi.tpl b/gemfeed/2008-06-26-perl-poetry.gmi.tpl index 257e21a8..bb16451a 100644 --- a/gemfeed/2008-06-26-perl-poetry.gmi.tpl +++ b/gemfeed/2008-06-26-perl-poetry.gmi.tpl @@ -2,6 +2,12 @@ > Published at 2008-06-26T21:43:51+01:00; Updated at 2021-05-04 +Here are some Perl Poems I wrote. They don't do anything useful when you run them, but they don't produce a compiler error either. They only exist for fun and demonstrate what you can do with Perl syntax. + +Wikipedia: "Perl poetry is the practice of writing poems that can be compiled as legal Perl code, for example the piece known as Black Perl. Perl poetry is made possible by the large number of English words that are used in the Perl language. New poems are regularly submitted to the community at PerlMonks." + +=> https://en.wikipedia.org/wiki/Perl + ``` '\|/' * -- * ----- @@ -25,11 +31,7 @@ _~~|~/_|_|__/|~~~~~~~ | / ~~~~~ | | ~~~~~~~~ (__) (____) ``` -Here are some Perl Poems I wrote. They don't do anything useful when you run them, but they don't produce a compiler error either. They only exist for fun and demonstrate what you can do with Perl syntax. - -Wikipedia: "Perl poetry is the practice of writing poems that can be compiled as legal Perl code, for example the piece known as Black Perl. Perl poetry is made possible by the large number of English words that are used in the Perl language. New poems are regularly submitted to the community at PerlMonks." - -=> https://en.wikipedia.org/wiki/Perl +<< template::inline::toc ## math.pl @@ -165,6 +167,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -<< template::inline::index perl +<< template::inline::rindex perl => ../ Back to the main site diff --git a/gemfeed/2009-02-13-sgi-onyx-3200.gmi b/gemfeed/2009-02-13-sgi-onyx-3200.gmi new file mode 100644 index 00000000..fd10c754 --- /dev/null +++ b/gemfeed/2009-02-13-sgi-onyx-3200.gmi @@ -0,0 +1,68 @@ +# SGI Onyx 3200 + +> Published at 2025-02-13T21:17:16+02:00 + +For nostalgia, I've kept this output of the 'dmesg' around. It's from an SGI Onyx 3200 graphics supercomputer running IRIX with the following specs: + +* 4 x 400 MHz IP35 MIPS CPUs +* 4GB of RAM + +=> ./sgi-onyx-3200/desk.webp + +We used this monster when I was a student worker at the Fraunhofer Institute for Production Technology around the year 2006. It operated a walk-in 2-sided 3D cave (unfortunately, I don't have any pictures of that cave), where you could literally walk around with a set of VR glasses and see everything in 3D (that was when there wasn't any Oculus Quest yet). That was useful for running industrial simulations. + +``` +4 400 MHZ IP35 Processors +CPU: MIPS R12000 Processor Chip Revision: 3.5 +FPU: MIPS R12010 Floating Point Chip Revision: 3.5 +Main memory size: 4096 Mbytes +Instruction cache size: 32 Kbytes +Data cache size: 32 Kbytes +Secondary unified instruction/data cache size: 8 Mbytes +Integral SCSI controller 8: Version Fibre Channel QL2200A +Integral SCSI controller 6: Version QL12160, single ended +Integral SCSI controller 7: Version QL12160, low voltage differential +Integral SCSI controller 9: Version IEEE1394 SBP2 + IEEE1394 CDROM: node 1010031001a454 port 0 on SCSI controller 9 +Integral SCSI controller 0: Version Fibre Channel QL2200A + Disk drive: unit 1 on SpCSI controller 0 + Disk drive: unit 2 on SCSI controller 0 +Integral SCSI controller 5: Version IEEE1394 SBP2 + IEEE1394 CDROM: node 1010031001c080 port 0 on SCSI controller 5 +IOC3 serial port: tty3 +IOC3 serial port: tty4 +IOC3 serial port: tty10 +IOC3 serial port: tty11 +IOC3 serial port: tty12 +IOC3 serial port: tty5 +IOC3 serial port: tty6 +IOC3 serial port: tty7 +IOC3 serial port: tty8 +IOC3 serial port: tty9 +Graphics board: InfiniteReality3 +Graphics board: InfiniteReality3 +Gigabit Ethernet: eg0, module 001c04, pci_bus 2, pci_slot 2, firmware version 12.4.10 +Fast Ethernet: ef1, version 1, module 001c07, pci 4 +Integral Fast Ethernet: ef0, version 1, module 001c04, pci 4 +Iris Audio Processor: version RAD revision 13.0, number 1 +IOC3 external interrupts: 2 +IOC3 external interrupts: 1 +IEEE 1394 High performance serial bus controller 0: Type: OHCI, Version 0 0 +IEEE 1394 High performance serial bus controller 1: Type: OHCI, Version 0 0 +USB controller: type OHCI +USB Human Interface Device: device id 1 type keyboard +USB Human Interface Device: device id 1 type mouse +USB controller: type OHCI +USB Human Interface Device: device id 0 type keyboard +USB Human Interface Device: device id 0 type mouse +``` + +=> ./sgi-onyx-3200/collage.webp + +I was mainly working on drilling simulations on this machine. Sometimes I worked directly at one of the 2 terminal screens of the Onyx, or often I used a nearby Linux machine and forwarded the X11 windows to my local screen. + +=> ./sgi-onyx-3200/collage2.webp + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2010-04-09-standard-ml-and-haskell.gmi b/gemfeed/2010-04-09-standard-ml-and-haskell.gmi index 844fd595..17bd4651 100644 --- a/gemfeed/2010-04-09-standard-ml-and-haskell.gmi +++ b/gemfeed/2010-04-09-standard-ml-and-haskell.gmi @@ -8,6 +8,16 @@ As you will see, SML and Haskell are very similar (at least when it comes to the Haskell is also a "pure functional" programming language, whereas SML also makes explicit use of imperative concepts. I am by far not a specialist in either of these languages, but here are a few functions implemented in both SML and Haskell: +## Table of Contents + +* ⇢ Standard ML and Haskell +* ⇢ ⇢ Defining a multi-data type +* ⇢ ⇢ Processing a multi +* ⇢ ⇢ Simplify function +* ⇢ ⇢ Delete all +* ⇢ ⇢ Delete one +* ⇢ ⇢ Higher-order functions + ## Defining a multi-data type Standard ML: diff --git a/gemfeed/2010-04-09-standard-ml-and-haskell.gmi.tpl b/gemfeed/2010-04-09-standard-ml-and-haskell.gmi.tpl new file mode 100644 index 00000000..a3d3ed79 --- /dev/null +++ b/gemfeed/2010-04-09-standard-ml-and-haskell.gmi.tpl @@ -0,0 +1,176 @@ +# Standard ML and Haskell + +> Published at 2010-04-09T22:57:36+01:00 + +I am currently looking into the functional programming language Standard ML (aka SML). The purpose is to refresh my functional programming skills and to learn something new too. Since I already knew a little Haskell, I could not help myself, and I also implemented the same exercises in Haskell. + +As you will see, SML and Haskell are very similar (at least when it comes to the basics). However, the syntax of Haskell is a bit more "advanced". Haskell utilizes fewer keywords (e.g. no val, end, fun, fn ...). Haskell also allows to write down the function types explicitly. What I have been missing in SML so far is the so-called pattern guards. Although this is a very superficial comparison for now, so far, I like Haskell more than SML. Nevertheless, I thought it would be fun to demonstrate a few simple functions of both languages to show off the similarities. + +Haskell is also a "pure functional" programming language, whereas SML also makes explicit use of imperative concepts. I am by far not a specialist in either of these languages, but here are a few functions implemented in both SML and Haskell: + +<< template::inline::toc + +## Defining a multi-data type + +Standard ML: + +```sml +datatype ’a multi + = EMPTY + | ELEM of ’a + | UNION of ’a multi * ’a multi +``` + +Haskell: + +```haskell +data (Eq a) => Multi a + = Empty + | Elem a + | Union (Multi a) (Multi a) + deriving Show +``` + +## Processing a multi + +Standard ML: + +```sml +fun number (EMPTY) _ = 0 + | number (ELEM x) w = if x = w then 1 else 0 + | number (UNION (x,y)) w = (number x w) + (number y w) +fun test_number w = number (UNION (EMPTY, \ + UNION (ELEM 4, UNION (ELEM 6, \ + UNION (UNION (ELEM 4, ELEM 4), EMPTY))))) w +``` + +Haskell: + +```haskell +number Empty _ = 0 +number (Elem x) w = if x == w then 1 else 0 +test_number w = number (Union Empty \ + (Union (Elem 4) (Union (Elem 6) \ + (Union (Union (Elem 4) (Elem 4)) Empty)))) w +``` + +## Simplify function + +Standard ML: + +```sml +fun simplify (UNION (x,y)) = + let fun is_empty (EMPTY) = true | is_empty _ = false + val x’ = simplify x + val y’ = simplify y + in if (is_empty x’) andalso (is_empty y’) + then EMPTY + else if (is_empty x’) + then y’ + else if (is_empty y’) + then x’ + else UNION (x’, y’) + end + | simplify x = x +``` + +Haskell: + +```haskell +simplify (Union x y) + | (isEmpty x’) && (isEmpty y’) = Empty + | isEmpty x’ = y’ + | isEmpty y’ = x’ + | otherwise = Union x’ y’ + where + isEmpty Empty = True + isEmpty _ = False + x’ = simplify x + y’ = simplify y +simplify x = x +``` + +## Delete all + +Standard ML: + +```sml +fun delete_all m w = + let fun delete_all’ (ELEM x) = if x = w then EMPTY else ELEM x + | delete_all’ (UNION (x,y)) = UNION (delete_all’ x, delete_all’ y) + | delete_all’ x = x + in simplify (delete_all’ m) + end +``` + +Haskell: + +```haskell +delete_all m w = simplify (delete_all’ m) + where + delete_all’ (Elem x) = if x == w then Empty else Elem x + delete_all’ (Union x y) = Union (delete_all’ x) (delete_all’ y) + delete_all’ x = x +``` + +## Delete one + +Standard ML: + +```sml +fun delete_one m w = + let fun delete_one’ (UNION (x,y)) = + let val (x’, deleted) = delete_one’ x + in if deleted + then (UNION (x’, y), deleted) + else let val (y’, deleted) = delete_one’ y + in (UNION (x, y’), deleted) + end + end + | delete_one’ (ELEM x) = + if x = w then (EMPTY, true) else (ELEM x, false) + | delete_one’ x = (x, false) + val (m’, _) = delete_one’ m + in simplify m’ + end +``` + +Haskell: + +```haskell +delete_one m w = do + let (m’, _) = delete_one’ m + simplify m’ + where + delete_one’ (Union x y) = + let (x’, deleted) = delete_one’ x + in if deleted + then (Union x’ y, deleted) + else let (y’, deleted) = delete_one’ y + in (Union x y’, deleted) + delete_one’ (Elem x) = + if x == w then (Empty, True) else (Elem x, False) + delete_one’ x = (x, False) +``` + +## Higher-order functions + +The first line is always the SML code, the second line the Haskell variant: + +``` +fun make_map_fn f1 = fn (x,y) => f1 x :: y +make_map_fn f1 = \x y -> f1 x : y + +fun make_filter_fn f1 = fn (x,y) => if f1 x then x :: y else y +make_filter_fn f1 = \x y -> if f1 then x : y else y + +fun my_map f l = foldr (make_map_fn f) [] l +my_map f l = foldr (make_map_fn f) [] l + +fun my_filter f l = foldr (make_filter_fn f) [] l +my_filter f l = foldr (make_filter_fn f) [] l +``` + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2010-05-09-the-fype-programming-language.gmi b/gemfeed/2010-05-09-the-fype-programming-language.gmi index 5f847c35..b77d49fa 100644 --- a/gemfeed/2010-05-09-the-fype-programming-language.gmi +++ b/gemfeed/2010-05-09-the-fype-programming-language.gmi @@ -2,6 +2,12 @@ > Published at 2010-05-09T12:48:29+01:00; Updated at 2021-05-05 +Fype is an interpreted programming language created by me for learning and fun. The interpreter is written in C. It has been tested on FreeBSD and NetBSD and may also work on other Unix like operating systems such as Linux based ones. Besides learning and fun, there is no other use case of why Fype exists as many other programming languages are much faster and more powerful. + +The Fype syntax is straightforward and uses a maximum look ahead of 1 and an effortless top-down parsing mechanism. Fype is parsing and interpreting its code simultaneously. This means that syntax errors are only detected during program runtime. + +Fype is a recursive acronym and means "Fype is For Your Program Execution" or "Fype is Free Yak Programmed for ELF". You could also say, "It's not a hype - it's Fype!". + ``` ____ _ __ / / _|_ _ _ __ ___ _ _ ___ __ _| |__ / _|_ _ @@ -11,11 +17,33 @@ |___/|_| |___/ |___/ ``` -Fype is an interpreted programming language created by me for learning and fun. The interpreter is written in C. It has been tested on FreeBSD and NetBSD and may also work on other Unix like operating systems such as Linux based ones. Besides learning and fun, there is no other use case of why Fype exists as many other programming languages are much faster and more powerful. - -The Fype syntax is straightforward and uses a maximum look ahead of 1 and an effortless top-down parsing mechanism. Fype is parsing and interpreting its code simultaneously. This means that syntax errors are only detected during program runtime. - -Fype is a recursive acronym and means "Fype is For Your Program Execution" or "Fype is Free Yak Programmed for ELF". You could also say, "It's not a hype - it's Fype!". +## Table of Contents + +* ⇢ The Fype Programming Language +* ⇢ ⇢ Object-oriented C style +* ⇢ ⇢ Data types +* ⇢ ⇢ Syntax +* ⇢ ⇢ ⇢ Comments +* ⇢ ⇢ ⇢ Variables +* ⇢ ⇢ ⇢ Synonyms +* ⇢ ⇢ Statements and expressions +* ⇢ ⇢ ⇢ Parenthesis +* ⇢ ⇢ ⇢ Basic expressions +* ⇢ ⇢ ⇢ Bitwise expressions +* ⇢ ⇢ ⇢ Numeric expressions +* ⇢ ⇢ Control statements +* ⇢ ⇢ Scopes +* ⇢ ⇢ Definedness +* ⇢ ⇢ System +* ⇢ ⇢ ⇢ I/O +* ⇢ ⇢ Procedures and functions +* ⇢ ⇢ ⇢ Procedures +* ⇢ ⇢ ⇢ Nested procedures +* ⇢ ⇢ ⇢ Functions +* ⇢ ⇢ ⇢ Nested functions +* ⇢ ⇢ Arrays +* ⇢ ⇢ Fancy stuff +* ⇢ ⇢ May the source be with you ## Object-oriented C style diff --git a/gemfeed/2010-05-09-the-fype-programming-language.gmi.tpl b/gemfeed/2010-05-09-the-fype-programming-language.gmi.tpl new file mode 100644 index 00000000..d4dac222 --- /dev/null +++ b/gemfeed/2010-05-09-the-fype-programming-language.gmi.tpl @@ -0,0 +1,512 @@ +# The Fype Programming Language + +> Published at 2010-05-09T12:48:29+01:00; Updated at 2021-05-05 + +Fype is an interpreted programming language created by me for learning and fun. The interpreter is written in C. It has been tested on FreeBSD and NetBSD and may also work on other Unix like operating systems such as Linux based ones. Besides learning and fun, there is no other use case of why Fype exists as many other programming languages are much faster and more powerful. + +The Fype syntax is straightforward and uses a maximum look ahead of 1 and an effortless top-down parsing mechanism. Fype is parsing and interpreting its code simultaneously. This means that syntax errors are only detected during program runtime. + +Fype is a recursive acronym and means "Fype is For Your Program Execution" or "Fype is Free Yak Programmed for ELF". You could also say, "It's not a hype - it's Fype!". + +``` + ____ _ __ + / / _|_ _ _ __ ___ _ _ ___ __ _| |__ / _|_ _ + / / |_| | | | '_ \ / _ \ | | | |/ _ \/ _` | '_ \ | |_| | | | + _ / /| _| |_| | |_) | __/ | |_| | __/ (_| | | | |_| _| |_| | +(_)_/ |_| \__, | .__/ \___| \__, |\___|\__,_|_| |_(_)_| \__, | + |___/|_| |___/ |___/ +``` + +<< template::inline::toc + +## Object-oriented C style + +The Fype interpreter is written in an object-oriented style of C. Each "main component" has its own .h and .c file. There is a struct type for each (most components at least) component, which can be initialized using a "COMPONENT_new" function and destroyed using a "COMPONENT_delete" function. Method calls follow the same schema, e.g. "COMPONENT_METHODNAME". There is no such as class inheritance and polymorphism involved. + +To give you an idea of how it works here as an example is a snippet from the main Fype "class header": + +```c +typedef struct { + Tupel *p_tupel_argv; // Contains command line options + List *p_list_token; // Initial list of token + Hash *p_hash_syms; // Symbol table + char *c_basename; +} Fype; +``` + +And here is a snippet from the primary Fype "class implementation": + +```c +Fype* +fype_new() { + Fype *p_fype = malloc(sizeof(Fype)); + + p_fype->p_hash_syms = hash_new(512); + p_fype->p_list_token = list_new(); + p_fype->p_tupel_argv = tupel_new(); + p_fype->c_basename = NULL; + + garbage_init(); + + return (p_fype); +} + +void +fype_delete(Fype *p_fype) { + argv_tupel_delete(p_fype->p_tupel_argv); + + hash_iterate(p_fype->p_hash_syms, symbol_cleanup_hash_syms_cb); + hash_delete(p_fype->p_hash_syms); + + list_iterate(p_fype->p_list_token, token_ref_down_cb); + list_delete(p_fype->p_list_token); + + if (p_fype->c_basename) + free(p_fype->c_basename); + + garbage_destroy(); +} + +int +fype_run(int i_argc, char **pc_argv) { + Fype *p_fype = fype_new(); + + // argv: Maintains command line options + argv_run(p_fype, i_argc, pc_argv); + + // scanner: Creates a list of token + scanner_run(p_fype); + + // interpret: Interpret the list of token + interpret_run(p_fype); + + fype_delete(p_fype); + + return (0); +} +``` + +## Data types + +Fype uses auto type conversion. However, if you want to know what's going on, you may take a look at the following basic data types: +* integer - Specifies a number +* double - Specifies a double-precision number +* string - Specifies a string +* number - May be an integer or a double number +* any- May be any type above +* void - No type +* identifier - It's a variable name or a procedure name, or a function name + +There is no boolean type, but we can use the integer values 0 for false and 1 for true. There is support for explicit type casting too. + +## Syntax + +### Comments + +Text from a # character until the end of the current line is considered being a comment. Multi-line comments may start with an #* and with a *# anywhere. Exceptions are if those signs are inside of strings. + +### Variables + +Variables are defined with the "my" keyword (inspired by Perl :-). If you don't assign a value during declaration, it uses the default integer value 0. Variables may be changed during program runtime. Variables may be deleted using the "undef" keyword! Example: + +``` +my foo = 1 + 2; +say foo; + +my bar = 12, baz = foo; +say 1 + bar; +say bar; + +my baz; +say baz; # Will print out 0 +``` + +You may use the "defined" keyword to check if an identifier has been defined or not: + +``` +ifnot defined foo { + say "No foo yet defined"; +} + +my foo = 1; + +if defined foo { + put "foo is defined and has the value "; + say foo; +} +``` + +### Synonyms + +Each variable can have as many synonyms as wished. A synonym is another name to access the content of a specific variable. Here is an example of how to use it: + +``` +my foo = "foo"; +my bar = \foo; +foo = "bar"; + +# The synonym variable should now also set to "bar" +assert "bar" == bar; +``` + +Synonyms can be used for all kind of identifiers. It's not limited to standard variables but can also be used for function and procedure names (more about functions and procedures later). + +``` +# Create a new procedure baz +proc baz { say "I am baz"; } + +# Make a synonym baz, and undefine baz +my bay = \baz; + +undef baz; + +# bay still has a reference of the original procedure baz +bay; # this prints aut "I am baz" +``` + +The "syms" keyword gives you the total number of synonyms pointing to a specific value: + +``` +my foo = 1; +say syms foo; # Prints 1 + +my baz = \foo; +say syms foo; # Prints 2 +say syms baz; # Prints 2 + +undef baz; +say syms foo; # Prints 1 +``` + +## Statements and expressions + +A Fype program is a list of statements. Each keyword, expression or function call is part of a statement. Each statement is ended with a semicolon. Example: + +``` +my bar = 3, foo = 1 + 2; +say foo; +exit foo - bar; +``` + +### Parenthesis + +All parenthesis for function arguments is optional. They help to make the code better readable. They also help to force the precedence of expressions. + +### Basic expressions + +Any "any" value holding a string will be automatically converted to an integer value. + +``` +(any) <any> + <any> +(any) <any> - <any> +(any) <any> * <any> +(any) <any> / <any> +(integer) <any> == <any> +(integer) <any> != <any> +(integer) <any> <= <any> +(integer) <any> gt <any> +(integer) <any> <> <any> +(integer) <any> gt <any> +(integer) not <any> +``` + +### Bitwise expressions + +``` +(integer) <any> :< <any> +(integer) <any> :> <any> +(integer) <any> and <any> +(integer) <any> or <any> +(integer) <any> xor <any> +``` + +### Numeric expressions + +``` +(number) neg <number> +``` + +... returns the negative value of "number": + +``` +(integer) no <integer> +``` + +... returns 1 if the argument is 0; otherwise, it will return 0! If no argument is given, then 0 is returned! + +``` +(integer) yes <integer> +``` + +... always returns 1. The parameter is optional. Example: + +``` +# Prints out 1, because foo is not defined +if yes { say no defined foo; } +``` + +## Control statements + +Control statements available in Fype: + +``` +if <expression> { <statements> } +``` + +... runs the statements if the expression evaluates to a true value. + +``` +ifnot <expression> { <statements> } +``` + +... runs the statements if the expression evaluates to a false value. + +``` +while <expression> { <statements> } +``` + +... runs the statements as long as the expression evaluates to a true value. + +``` +until <expression> { <statements> } +``` + +... runs the statements as long as the expression evaluates to a false value. + +## Scopes + +A new scope starts with an { and ends with an }. An exception is a procedure, which does not use its own scope (see later in this manual). Control statements and functions support scopes. The "scope" function prints out all available symbols at the current scope. Here is a small example: + +``` +my foo = 1; + +{ + # Prints out 1 + put defined foo; + { + my bar = 2; + + # Prints out 1 + put defined bar; + + # Prints out all available symbols at this + # point to stdout. Those are: bar and foo + scope; + } + + # Prints out 0 + put defined bar; + + my baz = 3; +} + +# Prints out 0 +say defined bar; +``` + +Another example including an actual output: + +``` +./fype -e ’my global; func foo { my var4; func bar { my var2, var3; func baz { my var1; scope; } baz; } bar; } foo;’ +Scopes: +Scope stack size: 3 +Global symbols: +SYM_VARIABLE: global (id=00034, line=-0001, pos=-001, type=TT_INTEGER, dval=0.000000, refs=-1) +SYM_FUNCTION: foo +Local symbols: +SYM_VARIABLE: var1 (id=00038, line=-0001, pos=-001, type=TT_INTEGER, dval=0.000000, refs=-1) +1 level(s) up: +SYM_VARIABLE: var2 (id=00036, line=-0001, pos=-001, type=TT_INTEGER, dval=0.000000, refs=-1) +SYM_VARIABLE: var3 (id=00037, line=-0001, pos=-001, type=TT_INTEGER, dval=0.000000, refs=-1) +SYM_FUNCTION: baz +2 level(s) up: +SYM_VARIABLE: var4 (id=00035, line=-0001, pos=-001, type=TT_INTEGER, dval=0.000000, refs=-1) +SYM_FUNCTION: bar +``` + +## Definedness + +``` +(integer) defined <identifier> +``` + +... returns 1 if "identifier" has been defined. Returns 0 otherwise. + +``` +(integer) undef <identifier> +``` + +... tries to undefine/delete the "identifier". Returns 1 if it succeeded, otherwise 0 is returned. + +## System + +These are some system and interpreter specific built-in functions supported: + +``` +(void) end +``` + +... exits the program with the exit status of 0. + +``` +(void) exit <integer> +``` + +... exits the program with the specified exit status. + +``` +(integer) fork +``` + +... forks a subprocess. It returns 0 for the child process and the PID of the child process otherwise! Example: + +``` +my pid = fork; + +if pid { + put "I am the parent process; child has the pid "; + say pid; + +} ifnot pid { + say "I am the child process"; +} +``` + +To execute the garbage collector do: + +``` +(integer) GC +``` + +It returns the number of items freed! You may wonder why most of the time, it will produce a value of 0! Fype tries to free not needed memory ASAP. This may change in future versions to gain faster execution speed! + +### I/O + +``` +(any) put <any> +``` + +... prints out the argument + +``` +(any) say <any> +``` + +is the same as put, but also includes an ending newline. + +``` +(void) ln +``` + +... just prints a new line. + +## Procedures and functions + +### Procedures + +A procedure can be defined with the "proc" keyword and deleted with the "undef" keyword. A procedure does not return any value and does not support parameter passing. It's using already defined variables (e.g. global variables). A procedure does not have its own namespace. It's using the calling namespace. It is possible to define new variables inside of a procedure in the current namespace. + +``` +proc foo { + say 1 + a * 3 + b; + my c = 6; +} + +my a = 2, b = 4; + +foo; # Run the procedure. Print out "11\n" +say c; # Print out "6\n"; +``` + +### Nested procedures + +It's possible to define procedures inside of procedures. Since procedures don't have their own scope, nested procedures will be available to the current scope as soon as the main procedure has run the first time. You may use the "defined" keyword to check if a procedure has been defined or not. + +``` +proc foo { + say "I am foo"; + + undef bar; + proc bar { + say "I am bar"; + } +} + +# Here bar would produce an error because +# the proc is not yet defined! +# bar; + +foo; # Here the procedure foo will define the procedure bar! +bar; # Now the procedure bar is defined! +foo; # Here the procedure foo will redefine bar again! +``` + +### Functions + +A function can be defined with the "func" keyword and deleted with the "undef" keyword. Function do not yet return values and do not yet supports parameter passing. It's using local (lexical scoped) variables. If a certain variable does not exist, when It's using already defined variables (e.g. one scope above). + +``` +func foo { + say 1 + a * 3 + b; + my c = 6; +} + +my a = 2, b = 4; + +foo; # Run the procedure. Print out "11\n" +say c; # Will produce an error because c is out of scope! +``` + +### Nested functions + +Nested functions work the same way the nested procedures work, except that nested functions will not be available anymore after the function has been left! + +``` +func foo { + func bar { + say "Hello i am nested"; + } + + bar; # Calling nested +} + +foo; +bar; # Will produce an error because bar is out of scope! +``` + +## Arrays + +Some progress on arrays has been made too. The following example creates a multidimensional array "foo". Its first element is the return value of the func which is "bar". The fourth value is a string" 3" converted to a double number. The last element is an anonymous array which itself contains another anonymous array as its final element: + +``` +func bar { say ”bar” } +my foo = [bar, 1, 4/2, double ”3”, [”A”, [”BA”, ”BB”]]]; +say foo; +``` + +It produces the following output: + +``` +% ./fype arrays.fy +bar +01 +2 +3.000000 +A +BA +BB +``` + +## Fancy stuff + +Fancy stuff like OOP or Unicode or threading is not planed. But fancy stuff like function pointers and closures may be considered.:) + +## May the source be with you + +You can find all of this on the GitHub page. There is also an "examples" folders containing some Fype scripts! + +=> https://codeberg.org/snonux/fype + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2011-05-07-perl-daemon-service-framework.gmi b/gemfeed/2011-05-07-perl-daemon-service-framework.gmi index 887a7210..8483dfd0 100644 --- a/gemfeed/2011-05-07-perl-daemon-service-framework.gmi +++ b/gemfeed/2011-05-07-perl-daemon-service-framework.gmi @@ -2,6 +2,8 @@ > Published at 2011-05-07T22:26:02+01:00; Updated at 2021-05-07 +PerlDaemon is a minimal daemon for Linux and other Unix like operating systems programmed in Perl. It is a minimal but pretty functional and fairly generic service framework. This means that it does not do anything useful other than providing a framework for starting, stopping, configuring and logging. To do something useful, a module (written in Perl) must be provided. + ``` a'! _,,_ a'! _,,_ a'! _,,_ \\_/ \ \\_/ \ \\_/ \.-, @@ -9,7 +11,18 @@ //\ //\\ //\ //\\ //\ //\\jrei ``` -PerlDaemon is a minimal daemon for Linux and other Unix like operating systems programmed in Perl. It is a minimal but pretty functional and fairly generic service framework. This means that it does not do anything useful other than providing a framework for starting, stopping, configuring and logging. To do something useful, a module (written in Perl) must be provided. +## Table of Contents + +* ⇢ Perl Daemon (Service Framework) +* ⇢ ⇢ Features +* ⇢ ⇢ Quick Guide +* ⇢ ⇢ How to configure +* ⇢ ⇢ Example +* ⇢ ⇢ HiRes event loop +* ⇢ ⇢ Writing your own modules +* ⇢ ⇢ ⇢ Example module +* ⇢ ⇢ ⇢ Your own module +* ⇢ ⇢ May the source be with you ## Features @@ -162,8 +175,8 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -=> ./2008-06-26-perl-poetry.gmi 2008-06-26 Perl Poetry -=> ./2011-05-07-perl-daemon-service-framework.gmi 2011-05-07 Perl Daemon (Service Framework) (You are currently reading this) => ./2022-05-27-perl-is-still-a-great-choice.gmi 2022-05-27 Perl is still a great choice +=> ./2011-05-07-perl-daemon-service-framework.gmi 2011-05-07 Perl Daemon (Service Framework) (You are currently reading this) +=> ./2008-06-26-perl-poetry.gmi 2008-06-26 Perl Poetry => ../ Back to the main site diff --git a/gemfeed/2011-05-07-perl-daemon-service-framework.gmi.tpl b/gemfeed/2011-05-07-perl-daemon-service-framework.gmi.tpl index 36baca1c..8465297b 100644 --- a/gemfeed/2011-05-07-perl-daemon-service-framework.gmi.tpl +++ b/gemfeed/2011-05-07-perl-daemon-service-framework.gmi.tpl @@ -2,6 +2,8 @@ > Published at 2011-05-07T22:26:02+01:00; Updated at 2021-05-07 +PerlDaemon is a minimal daemon for Linux and other Unix like operating systems programmed in Perl. It is a minimal but pretty functional and fairly generic service framework. This means that it does not do anything useful other than providing a framework for starting, stopping, configuring and logging. To do something useful, a module (written in Perl) must be provided. + ``` a'! _,,_ a'! _,,_ a'! _,,_ \\_/ \ \\_/ \ \\_/ \.-, @@ -9,7 +11,7 @@ //\ //\\ //\ //\\ //\ //\\jrei ``` -PerlDaemon is a minimal daemon for Linux and other Unix like operating systems programmed in Perl. It is a minimal but pretty functional and fairly generic service framework. This means that it does not do anything useful other than providing a framework for starting, stopping, configuring and logging. To do something useful, a module (written in Perl) must be provided. +<< template::inline::toc ## Features @@ -162,6 +164,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -<< template::inline::index perl +<< template::inline::rindex perl => ../ Back to the main site diff --git a/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.gmi b/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.gmi index f31ba96b..9328b1bf 100644 --- a/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.gmi +++ b/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.gmi @@ -2,6 +2,12 @@ > Published at 2015-12-05T16:12:57+00:00; Updated at 2021-05-16 +You can use the following tutorial to install a full-blown Debian GNU/Linux Chroot on an LG G3 D855 CyanogenMod 13 (Android 6). First of all, you need to have root permissions on your phone, and you also need to have the developer mode activated. The following steps have been tested on Linux (Fedora 23). + +=> ./run-debian-on-your-phone-with-debroid/Deboroid.png + +A couple of years have passed since I last worked on Debroid. Currently, I am using the Termux app on Android, which is less sophisticated than a fully blown Debian installation but sufficient for my current requirements. The content of this site may be still relevant, and it would also work with more recent versions of Debian and Android. I would expect that some minor modifications need to be made, though. + ``` ____ _ _ _ | _ \ ___| |__ _ __ ___ (_) __| | @@ -11,13 +17,16 @@ ``` -You can use the following tutorial to install a full-blown Debian GNU/Linux Chroot on an LG G3 D855 CyanogenMod 13 (Android 6). First of all, you need to have root permissions on your phone, and you also need to have the developer mode activated. The following steps have been tested on Linux (Fedora 23). - -=> ./run-debian-on-your-phone-with-debroid/Deboroid.png +## Table of Contents -## Foreword - -A couple of years have passed since I last worked on Debroid. Currently, I am using the Termux app on Android, which is less sophisticated than a fully blown Debian installation but sufficient for my current requirements. The content of this site may be still relevant, and it would also work with more recent versions of Debian and Android. I would expect that some minor modifications need to be made, though. +* ⇢ Run Debian on your phone with Debroid +* ⇢ ⇢ Step by step guide +* ⇢ ⇢ ⇢ First debootstrap stage +* ⇢ ⇢ ⇢ Copy Debian image to the phone +* ⇢ ⇢ ⇢ Second debootstrap stage +* ⇢ ⇢ ⇢ Setup of various scripts +* ⇢ ⇢ ⇢ Entering Debroid and enable a service +* ⇢ ⇢ ⇢ Include to Android startup: ## Step by step guide diff --git a/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.gmi.tpl b/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.gmi.tpl new file mode 100644 index 00000000..40539e7f --- /dev/null +++ b/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.gmi.tpl @@ -0,0 +1,180 @@ +# Run Debian on your phone with Debroid + +> Published at 2015-12-05T16:12:57+00:00; Updated at 2021-05-16 + +You can use the following tutorial to install a full-blown Debian GNU/Linux Chroot on an LG G3 D855 CyanogenMod 13 (Android 6). First of all, you need to have root permissions on your phone, and you also need to have the developer mode activated. The following steps have been tested on Linux (Fedora 23). + +=> ./run-debian-on-your-phone-with-debroid/Deboroid.png + +A couple of years have passed since I last worked on Debroid. Currently, I am using the Termux app on Android, which is less sophisticated than a fully blown Debian installation but sufficient for my current requirements. The content of this site may be still relevant, and it would also work with more recent versions of Debian and Android. I would expect that some minor modifications need to be made, though. + +``` + ____ _ _ _ +| _ \ ___| |__ _ __ ___ (_) __| | +| | | |/ _ \ '_ \| '__/ _ \| |/ _` | +| |_| | __/ |_) | | | (_) | | (_| | +|____/ \___|_.__/|_| \___/|_|\__,_| + +``` + +<< template::inline::toc + +## Step by step guide + +All scripts mentioned here can be found on GitHub at: + +=> https://codeberg.org/snonux/debroid + +### First debootstrap stage + +This is to be performed on a Fedora Linux machine (could work on a Debian too, but Fedora is just what I use on my Laptop). The following steps prepare an initial Debian base image, which can then be transferred to the phone. + +```sh +sudo dnf install debootstrap +# 5g +dd if=/dev/zero of=jessie.img bs=$[ 1024 * 1024 ] \ + count=$[ 1024 * 5 ] + +# Show used loop devices +sudo losetup -f +# Store the next free one to $loop +loop=loopN +sudo losetup /dev/$loop jessie.img + +mkdir jessie +sudo mkfs.ext4 /dev/$loop +sudo mount /dev/$loop jessie +sudo debootstrap --foreign --variant=minbase \ + --arch armel jessie jessie/ \ + http://http.debian.net/debian +sudo umount jessie +``` + +### Copy Debian image to the phone + +Now setup the Debian image on an external SD card on the Phone via Android Debugger as follows: + +```sh +adb root && adb wait-for-device && adb shell +mkdir -p /storage/sdcard1/Linux/jessie +exit + +# Sparse image problem, may be too big for copying otherwise +gzip jessie.img +# Copy over +adb push jessie.img.gz /storage/sdcard1/Linux/jessie.img.gz +adb shell +cd /storage/sdcard1/Linux +gunzip jessie.img.gz + +# Show used loop devices +losetup -f +# Store the next free one to $loop +loop=loopN + +# Use the next free one (replace the loop number) +losetup /dev/block/$loop $(pwd)/jessie.img +mount -t ext4 /dev/block/$loop $(pwd)/jessie + +# Bind-Mound proc, dev, sys` +busybox mount --bind /proc $(pwd)/jessie/proc +busybox mount --bind /dev $(pwd)/jessie/dev +busybox mount --bind /dev/pts $(pwd)/jessie/dev/pts +busybox mount --bind /sys $(pwd)/jessie/sys + +# Bind-Mound the rest of Android +mkdir -p $(pwd)/jessie/storage/sdcard{0,1} +busybox mount --bind /storage/emulated \ + $(pwd)/jessie/storage/sdcard0 +busybox mount --bind /storage/sdcard1 \ + $(pwd)/jessie/storage/sdcard1 + +# Check mounts +mount | grep jessie +``` + +### Second debootstrap stage + +This is to be performed on the Android phone itself (inside a Debian chroot): + +```sh +chroot $(pwd)/jessie /bin/bash -l +export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin +/debootstrap/debootstrap --second-stage +exit # Leave chroot +exit # Leave adb shell +``` + +### Setup of various scripts + +jessie.sh deals with all the loopback mount magic and so on. It will be run later every time you start Debroid on your phone. + +```sh +# Install script jessie.sh +adb push storage/sdcard1/Linux/jessie.sh /storage/sdcard/Linux/jessie.sh +adb shell +cd /storage/sdcard1/Linux +sh jessie.sh enter + +# Bashrc +cat <<END >~/.bashrc +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH +export EDITOR=vim +hostname $(cat /etc/hostname) +END + +# Fixing an error message while loading the profile +sed -i s#id#/usr/bin/id# /etc/profile + +# Setting the hostname +echo phobos > /etc/hostname +echo 127.0.0.1 phobos > /etc/hosts +hostname phobos + +# Apt-sources +cat <<END > sources.list +deb http://ftp.uk.debian.org/debian/ jessie main contrib non-free +deb-src http://ftp.uk.debian.org/debian/ jessie main contrib non-free +END +apt-get update +apt-get upgrade +apt-get dist-upgrade +exit # Exit chroot +``` + +### Entering Debroid and enable a service + +This enters Debroid on your phone and starts the example service uptimed: + +```sh +sh jessie.sh enter + +# Setup example serice uptimed +apt-get install uptimed +cat <<END > /etc/rc.debroid +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH +service uptimed status &>/dev/null || service uptimed start +exit 0 +END + +chmod 0755 /etc/rc.debroid +exit # Exit chroot +exit # Exit adb shell +``` + +### Include to Android startup: + +If you want to start Debroid automatically whenever your phone starts, then do the following: + +```sh +adb push data/local/userinit.sh /data/local/userinit.sh +adb shell +chmod +x /data/local/userinit.sh +exit +``` + +Reboot & test! Enjoy! + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi b/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi index fe07f8c5..9e337116 100644 --- a/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi +++ b/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi @@ -2,6 +2,8 @@ > Published at 2016-04-09T18:29:47+01:00 +Over the last couple of years I wrote quite a few Puppet modules in order to manage my personal server infrastructure. One of them manages FreeBSD Jails and another one ZFS file systems. I thought I would give a brief overview in how it looks and feels. + ``` __ __ (( \---/ )) @@ -22,7 +24,13 @@ \ `. ``` -Over the last couple of years I wrote quite a few Puppet modules in order to manage my personal server infrastructure. One of them manages FreeBSD Jails and another one ZFS file systems. I thought I would give a brief overview in how it looks and feels. +## Table of Contents + +* ⇢ Jails and ZFS with Puppet on FreeBSD +* ⇢ ⇢ ZFS +* ⇢ ⇢ Jails +* ⇢ ⇢ Inside-Jail Puppet +* ⇢ ⇢ Managing multiple Jails ## ZFS @@ -389,10 +397,13 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other *BSD related posts are: -=> ./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi 2016-04-09 Jails and ZFS with Puppet on FreeBSD (You are currently reading this) -=> ./2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi 2022-07-30 Let's Encrypt with OpenBSD and Rex -=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD -=> ./2024-01-13-one-reason-why-i-love-openbsd.gmi 2024-01-13 One reason why I love OpenBSD +=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts +=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation +=> ./2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi 2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage => ./2024-04-01-KISS-high-availability-with-OpenBSD.gmi 2024-04-01 KISS high-availability with OpenBSD +=> ./2024-01-13-one-reason-why-i-love-openbsd.gmi 2024-01-13 One reason why I love OpenBSD +=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD +=> ./2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi 2022-07-30 Let's Encrypt with OpenBSD and Rex +=> ./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi 2016-04-09 Jails and ZFS with Puppet on FreeBSD (You are currently reading this) => ../ Back to the main site diff --git a/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi.tpl b/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi.tpl index c5595a87..75bb7ac3 100644 --- a/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi.tpl +++ b/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi.tpl @@ -2,6 +2,8 @@ > Published at 2016-04-09T18:29:47+01:00 +Over the last couple of years I wrote quite a few Puppet modules in order to manage my personal server infrastructure. One of them manages FreeBSD Jails and another one ZFS file systems. I thought I would give a brief overview in how it looks and feels. + ``` __ __ (( \---/ )) @@ -22,7 +24,7 @@ \ `. ``` -Over the last couple of years I wrote quite a few Puppet modules in order to manage my personal server infrastructure. One of them manages FreeBSD Jails and another one ZFS file systems. I thought I would give a brief overview in how it looks and feels. +<< template::inline::toc ## ZFS @@ -389,6 +391,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other *BSD related posts are: -<< template::inline::index bsd +<< template::inline::rindex bsd => ../ Back to the main site diff --git a/gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.gmi b/gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.gmi index 41ae6512..6bcd8948 100644 --- a/gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.gmi +++ b/gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.gmi @@ -2,12 +2,20 @@ > Published at 2016-05-22T18:59:01+01:00 -## Background - Finally, I had time to deploy my authoritative DNS servers (master and slave) for my domains "buetow.org" and "buetow.zone". My domain name provider is Schlund Technologies. They allow their customers to edit the DNS records (BIND files) manually. And they also allow you to set your authoritative DNS servers for your domains. From now, I am making use of that option. => http://www.schlundtech.de Schlund Technologies +## Table of Contents + +* ⇢ Spinning up my own authoritative DNS servers +* ⇢ ⇢ All FreeBSD Jails +* ⇢ ⇢ PF firewall +* ⇢ ⇢ Puppet managed BIND zone files +* ⇢ ⇢ The result +* ⇢ ⇢ Monitoring +* ⇢ ⇢ DNS update workflow + ## All FreeBSD Jails To set up my authoritative DNS servers, I installed a FreeBSD Jail dedicated for DNS with Puppet on my root machine as follows: diff --git a/gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.gmi.tpl b/gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.gmi.tpl new file mode 100644 index 00000000..39415e69 --- /dev/null +++ b/gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.gmi.tpl @@ -0,0 +1,239 @@ +# Spinning up my own authoritative DNS servers + +> Published at 2016-05-22T18:59:01+01:00 + +Finally, I had time to deploy my authoritative DNS servers (master and slave) for my domains "buetow.org" and "buetow.zone". My domain name provider is Schlund Technologies. They allow their customers to edit the DNS records (BIND files) manually. And they also allow you to set your authoritative DNS servers for your domains. From now, I am making use of that option. + +=> http://www.schlundtech.de Schlund Technologies + +<< template::inline::toc + +## All FreeBSD Jails + +To set up my authoritative DNS servers, I installed a FreeBSD Jail dedicated for DNS with Puppet on my root machine as follows: + +``` +include freebsd + +freebsd::ipalias { '2a01:4f8:120:30e8::14': + ensure => up, + proto => 'inet6', + preflen => '64', + interface => 're0', + aliasnum => '5', +} + +include jail::freebsd + +class { 'jail': + ensure => present, + jails_config => { + dns => { + '_ensure' => present, + '_type' => 'freebsd', + '_mirror' => 'ftp://ftp.de.freebsd.org', + '_remote_path' => 'FreeBSD/releases/amd64/10.1-RELEASE', + '_dists' => [ 'base.txz', 'doc.txz', ], + '_ensure_directories' => [ '/opt', '/opt/enc' ], + 'host.hostname' => "'dns.ian.buetow.org'", + 'ip4.addr' => '192.168.0.15', + 'ip6.addr' => '2a01:4f8:120:30e8::15', + }, + . + . + } +} +``` + +## PF firewall + +Please note that "dns.ian.buetow.org" is just the Jail name of the master DNS server (and "caprica.ian.buetow.org" the name of the Jail for the slave DNS server) and that I am using the DNS names "dns1.buetow.org" (master) and "dns2.buetow.org" (slave) for the actual service names (these are the DNS servers visible to the public). Please also note that the IPv4 address is an internal one. I have a PF to use NAT and PAT. The DNS ports are being forwarded (TCP and UDP) to that Jail. By default, all ports are blocked, so I am adding an exception rule for the IPv6 address. These are the PF rules in use: + +``` +% cat /etc/pf.conf +. +. +# dns.ian.buetow.org +rdr pass on re0 proto tcp from any to $pub_ip port {53} -> 192.168.0.15 +rdr pass on re0 proto udp from any to $pub_ip port {53} -> 192.168.0.15 +pass in on re0 inet6 proto tcp from any to 2a01:4f8:120:30e8::15 port {53} flags S/SA keep state +pass in on re0 inet6 proto udp from any to 2a01:4f8:120:30e8::15 port {53} flags S/SA keep state +. +. +``` + +## Puppet managed BIND zone files + +In "manifests/dns.pp" (the Puppet manifest for the Master DNS Jail itself), I configured the BIND DNS server this way: + +``` +class { 'bind_freebsd': + config => "puppet:///files/bind/named.${::hostname}.conf", + dynamic_config => "puppet:///files/bind/dynamic.${::hostname}", +} +``` + +The Puppet module is a pretty simple one. It installs the file "/usr/local/etc/named/named.conf" and it populates the "/usr/local/etc/named/dynamicdb" directory with all my zone files. + +Once (Puppet-) applied inside of the Jail, I get this: + +``` +paul uranus:~/git/blog/source [4268]% ssh admin@dns1.buetow.org.buetow.org pgrep -lf named +60748 /usr/local/sbin/named -u bind -c /usr/local/etc/namedb/named.conf +paul uranus:~/git/blog/source [4269]% ssh admin@dns1.buetow.org.buetow.org tail -n 13 /usr/local/etc/namedb/named.conf +zone "buetow.org" { + type master; + notify yes; + allow-update { key "buetoworgkey"; }; + file "/usr/local/etc/namedb/dynamic/buetow.org"; +}; + +zone "buetow.zone" { + type master; + notify yes; + allow-update { key "buetoworgkey"; }; + file "/usr/local/etc/namedb/dynamic/buetow.zone"; +}; +paul uranus:~/git/blog/source [4277]% ssh admin@dns1.buetow.org.buetow.org cat /usr/local/etc/namedb/dynamic/buetow.org +$TTL 3600 +@ IN SOA dns1.buetow.org. domains.buetow.org. ( + 25 ; Serial + 604800 ; Refresh + 86400 ; Retry + 2419200 ; Expire + 604800 ) ; Negative Cache TTL +; Infrastructure domains +@ IN NS dns1 +@ IN NS dns2 +* 300 IN CNAME web.ian +buetow.org. 86400 IN A 78.46.80.70 +buetow.org. 86400 IN AAAA 2a01:4f8:120:30e8:0:0:0:11 +buetow.org. 86400 IN MX 10 mail.ian +dns1 86400 IN A 78.46.80.70 +dns1 86400 IN AAAA 2a01:4f8:120:30e8:0:0:0:15 +dns2 86400 IN A 164.177.171.32 +dns2 86400 IN AAAA 2a03:2500:1:6:20:: +. +. +. +. +``` + +That is my master DNS server. My slave DNS server runs in another Jail on another bare-metal machine. Everything is set up similar to the master DNS server. However, that server is located in a different DC and different IP subnets. The only difference is the "named.conf". It's configured to be a slave, and that means that the "dynamicdb" gets populated by BIND itself while doing zone transfers from the master. + +``` +paul uranus:~/git/blog/source [4279]% ssh admin@dns2.buetow.org tail -n 11 /usr/local/etc/namedb/named.conf +zone "buetow.org" { + type slave; + masters { 78.46.80.70; }; + file "/usr/local/etc/namedb/dynamic/buetow.org"; +}; + +zone "buetow.zone" { + type slave; + masters { 78.46.80.70; }; + file "/usr/local/etc/namedb/dynamic/buetow.zone"; +}; +``` + +## The result + +The result looks like this now: + +``` +% dig -t ns buetow.org +; <<>> DiG 9.10.3-P4-RedHat-9.10.3-12.P4.fc23 <<>> -t ns buetow.org +;; global options: +cmd +;; Got answer: +;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37883 +;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1 + +;; OPT PSEUDOSECTION: +; EDNS: version: 0, flags:; udp: 512 +;; QUESTION SECTION: +;buetow.org. IN NS + +;; ANSWER SECTION: +buetow.org. 600 IN NS dns2.buetow.org. +buetow.org. 600 IN NS dns1.buetow.org. + +;; Query time: 41 msec +;; SERVER: 192.168.1.254#53(192.168.1.254) +;; WHEN: Sun May 22 11:34:11 BST 2016 +;; MSG SIZE rcvd: 77 + +% dig -t any buetow.org @dns1.buetow.org +; <<>> DiG 9.10.3-P4-RedHat-9.10.3-12.P4.fc23 <<>> -t any buetow.org @dns1.buetow.org +;; global options: +cmd +;; Got answer: +;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49876 +;; flags: qr aa rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 7 + +;; OPT PSEUDOSECTION: +; EDNS: version: 0, flags:; udp: 4096 +;; QUESTION SECTION: +;buetow.org. IN ANY + +;; ANSWER SECTION: +buetow.org. 86400 IN A 78.46.80.70 +buetow.org. 86400 IN AAAA 2a01:4f8:120:30e8::11 +buetow.org. 86400 IN MX 10 mail.ian.buetow.org. +buetow.org. 3600 IN SOA dns1.buetow.org. domains.buetow.org. 25 604800 86400 2419200 604800 +buetow.org. 3600 IN NS dns2.buetow.org. +buetow.org. 3600 IN NS dns1.buetow.org. + +;; ADDITIONAL SECTION: +mail.ian.buetow.org. 86400 IN A 78.46.80.70 +dns1.buetow.org. 86400 IN A 78.46.80.70 +dns2.buetow.org. 86400 IN A 164.177.171.32 +mail.ian.buetow.org. 86400 IN AAAA 2a01:4f8:120:30e8::12 +dns1.buetow.org. 86400 IN AAAA 2a01:4f8:120:30e8::15 +dns2.buetow.org. 86400 IN AAAA 2a03:2500:1:6:20:: + +;; Query time: 42 msec +;; SERVER: 78.46.80.70#53(78.46.80.70) +;; WHEN: Sun May 22 11:34:41 BST 2016 +;; MSG SIZE rcvd: 322 +``` + +## Monitoring + +For monitoring, I am using Icinga2 (I am operating two Icinga2 instances in two different DCs). I may have to post another blog article about Icinga2, but to get the idea, these were the snippets added to my Icinga2 configuration: + +``` +apply Service "dig" { + import "generic-service" + + check_command = "dig" + vars.dig_lookup = "buetow.org" + vars.timeout = 30 + + assign where host.name == "dns.ian.buetow.org" || host.name == "caprica.ian.buetow.org" +} + +apply Service "dig6" { + import "generic-service" + + check_command = "dig" + vars.dig_lookup = "buetow.org" + vars.timeout = 30 + vars.check_ipv6 = true + + assign where host.name == "dns.ian.buetow.org" || host.name == "caprica.ian.buetow.org" +} +``` + +## DNS update workflow + +Whenever I have to change a DNS entry, all I have to do is: + +* Git clone or update the Puppet repository +* Update/commit and push the zone file (e.g. "buetow.org") +* Wait for Puppet. Puppet will deploy that updated zone file. And it will reload the BIND server. +* The BIND server will notify all slave DNS servers (at the moment, only one). And it will transfer the new version of the zone. + +That's much more comfortable now than manually clicking at some web UIs at Schlund Technologies. + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux.gmi b/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux.gmi index 4aeae0c6..0d7fcc6c 100644 --- a/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux.gmi +++ b/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux.gmi @@ -2,6 +2,16 @@ > Published at 2018-06-01T14:50:29+01:00; Updated at 2021-05-08 +This text first was published in the german IT-Administrator computer Magazine. 3 years have passed since and I decided to publish it on my blog too. + +=> https://www.admin-magazin.de/Das-Heft/2018/06/Realistische-Lasttests-mit-I-O-Riot + +I havn't worked on I/O Riot for some time now, but all what is written here is still valid. I am still using I/O Riot to debug I/O issues and pattern once in a while, so by all means the tool is not obsolete yet. The tool even helped to resolve a major production incident at work caused by disk I/O. + +I am eagerly looking forward to revamp I/O Riot so that it uses the new BPF Linux capabilities instead of plain old Systemtap (or alternatively: Newer versions of Systemtap can also use BPF as the backend I have learned). Also, when I wrote I/O Riot initially, I didn't have any experience with the Go programming language yet and therefore I wrote it in C. Once it gets revamped I might consider using Go instead of C as it would spare me from many segmentation faults and headaches during development ;-). I might also just stick to C for plain performance reasons and just refactor the code dealing with concurrency. + +Pleace notice that some of the screenshots show the command "ioreplay" instead of "ioriot". That's because the name has changed after taking those. + ``` .---. / \ @@ -13,17 +23,21 @@ jgs\__/'---'\__/ ``` -## Foreword - -This text first was published in the german IT-Administrator computer Magazine. 3 years have passed since and I decided to publish it on my blog too. - -=> https://www.admin-magazin.de/Das-Heft/2018/06/Realistische-Lasttests-mit-I-O-Riot - -I havn't worked on I/O Riot for some time now, but all what is written here is still valid. I am still using I/O Riot to debug I/O issues and pattern once in a while, so by all means the tool is not obsolete yet. The tool even helped to resolve a major production incident at work caused by disk I/O. - -I am eagerly looking forward to revamp I/O Riot so that it uses the new BPF Linux capabilities instead of plain old Systemtap (or alternatively: Newer versions of Systemtap can also use BPF as the backend I have learned). Also, when I wrote I/O Riot initially, I didn't have any experience with the Go programming language yet and therefore I wrote it in C. Once it gets revamped I might consider using Go instead of C as it would spare me from many segmentation faults and headaches during development ;-). I might also just stick to C for plain performance reasons and just refactor the code dealing with concurrency. - -Pleace notice that some of the screenshots show the command "ioreplay" instead of "ioriot". That's because the name has changed after taking those. +## Table of Contents + +* ⇢ Realistic load testing with I/O Riot for Linux +* ⇢ The article +* ⇢ ⇢ Background: Existing Techniques +* ⇢ ⇢ Benchmarking the Email Cloud at Mimecast +* ⇢ ⇢ Using I/O Riot +* ⇢ ⇢ ⇢ Installation +* ⇢ ⇢ ⇢ Recording of I/O events +* ⇢ ⇢ ⇢ Test preparation +* ⇢ ⇢ ⇢ Test Initialization +* ⇢ ⇢ ⇢ Replay +* ⇢ ⇢ I/O Riot is Open Source +* ⇢ ⇢ Systemtap +* ⇢ ⇢ More refereces # The article diff --git a/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux.gmi.tpl b/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux.gmi.tpl new file mode 100644 index 00000000..2fdea893 --- /dev/null +++ b/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux.gmi.tpl @@ -0,0 +1,191 @@ +# Realistic load testing with I/O Riot for Linux + +> Published at 2018-06-01T14:50:29+01:00; Updated at 2021-05-08 + +This text first was published in the german IT-Administrator computer Magazine. 3 years have passed since and I decided to publish it on my blog too. + +=> https://www.admin-magazin.de/Das-Heft/2018/06/Realistische-Lasttests-mit-I-O-Riot + +I havn't worked on I/O Riot for some time now, but all what is written here is still valid. I am still using I/O Riot to debug I/O issues and pattern once in a while, so by all means the tool is not obsolete yet. The tool even helped to resolve a major production incident at work caused by disk I/O. + +I am eagerly looking forward to revamp I/O Riot so that it uses the new BPF Linux capabilities instead of plain old Systemtap (or alternatively: Newer versions of Systemtap can also use BPF as the backend I have learned). Also, when I wrote I/O Riot initially, I didn't have any experience with the Go programming language yet and therefore I wrote it in C. Once it gets revamped I might consider using Go instead of C as it would spare me from many segmentation faults and headaches during development ;-). I might also just stick to C for plain performance reasons and just refactor the code dealing with concurrency. + +Pleace notice that some of the screenshots show the command "ioreplay" instead of "ioriot". That's because the name has changed after taking those. + +``` + .---. + / \ + \.@-@./ + /`\_/`\ + // _ \\ + | \ )|_ + /`\_`> <_/ \ +jgs\__/'---'\__/ +``` + +<< template::inline::toc + +# The article + +With I/O Riot IT administrators can load test and optimize the I/O subsystem of Linux-based operating systems. The tool makes it possible to record I/O patterns and replay them at a later time as often as desired. This means bottlenecks can be reproduced and eradicated. + +When storing huge amounts of data, such as more than 200 billion archived emails at Mimecast, it's not only the available storage capacity that matters, but also the data throughput and latency. At the same time, operating costs must be kept as low as possible. The more systems involved, the more important it is to optimize the hardware, the operating system and the applications running on it. + +## Background: Existing Techniques + +Conventional I/O benchmarking: Administrators usually use open source benchmarking tools like IOZone and bonnie++. Available database systems such as Redis and MySQL come with their own benchmarking tools. The common problem with these tools is that they work with prescribed artificial I/O patterns. Although this can test both sequential and randomized data access, the patterns do not correspond to what can be found on production systems. + +Testing by load test environment: Another option is to use a separate load test environment in which, as far as possible, a production environment with all its dependencies is simulated. However, an environment consisting of many microservices is very complex. Microservices are usually managed by different teams, which means extra coordination effort for each load test. Another challenge is to generate the load as authentically as possible so that the patterns correspond to a productive environment. Such a load test environment can only handle as many requests as its weakest link can handle. For example, load generators send many read and write requests to a frontend microservice, whereby the frontend forwards the requests to a backend microservice responsible for storing the data. If the frontend service does not process the requests efficiently enough, the backend service is not well utilized in the first place. As a rule, all microservices are clustered across many servers, which makes everything even more complicated. Under all these conditions it is very difficult to test I/O of separate backend systems. Moreover, for many small and medium-sized companies, a separate load test environment would not be feasible for cost reasons. + +Testing in the production environment: For these reasons, benchmarks are often carried out in the production environment. In order to derive value from this such tests are especially performed during peak hours when systems are under high load. However, testing on production systems is associated with risks and can lead to failure or loss of data without adequate protection. + +## Benchmarking the Email Cloud at Mimecast + +For email archiving, Mimecast uses an internally developed microservice, which is operated directly on Linux-based storage systems. A storage cluster is divided into several replication volumes. Data is always replicated three times across two secure data centers. Customer data is automatically allocated to one or more volumes, depending on throughput, so that all volumes are automatically assigned the same load. Customer data is archived on conventional, but inexpensive hard disks with several terabytes of storage capacity each. I/O benchmarking proved difficult for all the reasons mentioned above. Furthermore, there are no ready-made tools for this purpose in the case of self-developed software. The service operates on many block devices simultaneously, which can make the RAID controller a bottleneck. None of the freely available benchmarking tools can test several block devices at the same time without extra effort. In addition, emails typically consist of many small files. Randomized access to many small files is particularly inefficient. In addition to many software adaptations, the hardware and operating system must also be optimized. + +Mimecast encourages employees to be innovative and pursue their own ideas in the form of an internal competition, Pet Project. The goal of the pet project I/O Riot was to simplify OS and hardware level I/O benchmarking. The first prototype of I/O Riot was awarded an internal roadmap prize in the spring of 2017. A few months later, I/O Riot was used to reduce write latency in the storage clusters by about 50%. The improvement was first verified by I/O replay on a test system and then successively applied to all storage systems. I/O Riot was also used to resolve a production incident caused by disk I/O load. + +## Using I/O Riot + +First, all I/O events are logged to a file on a production system with I/O Riot. It is then copied to a test system where all events are replayed in the same way. The crucial point here is that you can reproduce I/O patterns as they are found on a production system as often as you like on a test system. This results in the possibility of optimizing the set screws on the system after each run. + +### Installation + +I/O Riot was tested under CentOS 7.2 x86_64. For compiling, the GNU C compiler and Systemtap including kernel debug information are required. Other Linux distributions are theoretically compatible but untested. First of all, you should update the systems involved as follows: + +``` +% sudo yum update +``` + +If the kernel is updated, please restart the system. The installation would be done without a restart but this would complicate the installation. The installed kernel version should always correspond to the currently running kernel. You can then install I/O Riot as follows: + +``` +% sudo yum install gcc git systemtap yum-utils kernel-devel-$(uname -r) +% sudo debuginfo-install kernel-$(uname -r) +% git clone https://github.com/mimecast/ioriot +% cd ioriot +% make +% sudo make install +% export PATH=$PATH:/opt/ioriot/bin +``` + +Note: It is not best practice to install any compilers on production systems. For further information please have a look at the enclosed README.md. + +### Recording of I/O events + +All I/O events are kernel related. If a process wants to perform an I/O operation, such as opening a file, it must inform the kernel of this by a system call (short syscall). I/O Riot relies on the Systemtap tool to record I/O syscalls. Systemtap, available for all popular Linux distributions, helps you to take a look at the running kernel in productive environments, which makes it predestined to monitor all I/O-relevant Linux syscalls and log them to a file. Other tools, such as strace, are not an alternative because they slow down the system too much. + +During recording, ioriot acts as a wrapper and executes all relevant Systemtap commands for you. Use the following command to log all events to io.capture: + +``` +% sudo ioriot -c io.capture +``` + +=> ./realistic-load-testing-with-ioriot-for-linux/figure1-ioriot-io-recording.png Screenshot I/O recording + +A Ctrl-C (SIGINT) stops recording prematurely. Otherwise, ioriot terminates itself automatically after 1 hour. Depending on the system load, the output file can grow to several gigabytes. Only metadata is logged, not the read and written data itself. When replaying later, only random data is used. Under certain circumstances, Systemtap may omit some system calls and issue warnings. This is to ensure that Systemtap does not consume too many resources. + +### Test preparation + +Then copy io.capture to a test system. The log also contains all accesses to the pseudo file systems devfs, sysfs and procfs. This makes little sense, which is why you must first generate a cleaned and playable version io.replay from io.capture as follows: + +``` +% sudo ioriot -c io.capture -r io.replay -u $USER -n TESTNAME +``` + +The parameter -n allows you to assign a freely selectable test name. An arbitrary system user under which the test is to be played is specified via paramater -u. + +### Test Initialization + +The test will most likely want to access existing files. These are files the test wants to read but does not create by itself. The existence of these must be ensured before the test. You can do this as follows: + +``` +% sudo ioriot -i io.replay +``` + +To avoid any damage to the running system, ioreplay only works in special directories. The tool creates a separate subdirectory for each file system mount point (e.g. /, /usr/local, /store/00,...) (here: /.ioriot/TESTNAME, /usr/local/.ioriot/TESTNAME, /store/00/.ioriot/TESTNAME,...). By default, the working directory of ioriot is /usr/local/ioriot/TESTNAME. + +=> ./realistic-load-testing-with-ioriot-for-linux/figure2-ioriot-test-preparation.png Screenshot test preparation + +You must re-initialize the environment before each run. Data from previous tests will be moved to a trash directory automatically, which can be finally deleted with "sudo ioriot -P". + +### Replay + +After initialization, you can replay the log with -r. You can use -R to initiate both test initialization and replay in a single command and -S can be used to specify a file in which statistics are written after the test run. + +You can also influence the playback speed: "-s 0" is interpreted as "Playback as fast as possible" and is the default setting. With "-s 1" all operations are performed at original speed. "-s 2" would double the playback speed and "-s 0.5" would halve it. + +=> ./realistic-load-testing-with-ioriot-for-linux/figure3-ioriot-replay.png Screenshot replaying I/O + +As an initial test, for example, you could compare the two Linux I/O schedulers CFQ and Deadline and check which scheduler the test runs the fastest. They run the test separately for each scheduler. The following shell loop iterates through all attached block devices of the system and changes their I/O scheduler to the one specified in variable $new_scheduler (in this case either cfq or deadline). Subsequently, all I/O events from the io.replay protocol are played back. At the end, an output file with statistics is generated: + +``` +% new_scheduler=cfq +% for scheduler in /sys/block/*/queue/scheduler; do + echo $new_scheduler | sudo tee $scheduler +done +% sudo ioriot -R io.replay -S cfq.txt +% new_scheduler=deadline +% for scheduler in /sys/block/*/queue/scheduler; do + echo $new_scheduler | sudo tee $scheduler +done +% sudo ioriot -R io.replay -S deadline.txt +``` + +According to the results, the test could run 940 seconds faster with Deadline Scheduler: + +``` +% cat cfq.txt +Num workers: 4 +hreads per worker: 128 +otal threads: 512 +Highest loadavg: 259.29 +Performed ioops: 218624596 +Average ioops/s: 101544.17 +Time ahead: 1452s +Total time: 2153.00s +% cat deadline.txt +Num workers: 4 +Threads per worker: 128 +Total threads: 512 +Highest loadavg: 342.45 +Performed ioops: 218624596 +Average ioops/s: 180234.62 +Time ahead: 2392s +Total time: 1213.00s +``` + +In any case, you should also set up a time series database, such as Graphite, where the I/O throughput can be plotted. Figures 4 and 5 show the read and write access times of both tests. The break-in makes it clear when the CFQ test ended and the deadline test was started. The reading latency of both tests is similar. Write latency is dramatically improved using the Deadline Scheduler. + +=> ./realistic-load-testing-with-ioriot-for-linux/figure4-ioriot-read-latency.png Graphite visualization of the mean read access times in ms with CFQ and Deadline Scheduler. + +=> ./realistic-load-testing-with-ioriot-for-linux/figure5-ioriot-write-latency.png Graphite visualization of the average write access times in ms with CFQ and Deadline Scheduler. + +You should also take a look at the iostat tool. The iostat screenshot shows the output of iostat -x 10 during a test run. As you can see, a block device is fully loaded with 99% utilization, while all other block devices still have sufficient buffer. This could be an indication of poor data distribution in the storage system and is worth pursuing. It is not uncommon for I/O Riot to reveal software problems. + +=> ./realistic-load-testing-with-ioriot-for-linux/figure6-iostat.png Output of iostat. The block device sdy seems to be almost fully utilized by 99%. + +## I/O Riot is Open Source + +The tool has already proven to be very useful and will continue to be actively developed as time and priority permits. Mimecast intends to be an ongoing contributor to Open Source. You can find I/O Riot at: + +=> https://github.com/mimecast/ioriot + +## Systemtap + +Systemtap is a tool for the instrumentation of the Linux kernel. The tool provides an AWK-like programming language. Programs written in it are compiled from Systemtap to C- and then into a dynamically loadable kernel module. Loaded into the kernel, the program has access to Linux internals. A Systemtap program written for I/O Riot monitors when, with which parameters, at which time, and from which process I/O syscalls take place and their return values. + +For example, the open syscall opens a file and returns the responsible file descriptor. The read and write syscalls can operate on a file descriptor and return the number of read or written bytes. The close syscall closes a given file descriptor. I/O Riot comes with a ready-made Systemtap program, which you have already compiled into a kernel module and installed to /opt/ioriot. In addition to open, read and close, it logs many other I/O-relevant calls. + +=> https://sourceware.org/systemtap/ + +## More refereces + +=> http://www.iozone.org/ IOZone +=> https://www.coker.com.au/bonnie++/ Bonnie++ +=> https://graphiteapp.org Graphite +=> https://en.wikipedia.org/wiki/Memory-mapped_I/O Memory mapped I/O + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.gmi b/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.gmi index 21e7d316..3341e27e 100644 --- a/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.gmi +++ b/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.gmi @@ -2,8 +2,6 @@ > Published at 2021-04-22T19:28:41+01:00; Updated at 2021-04-26 -=> ./dtail-the-distributed-log-tail-program/title.png DTail logo image - This article first appeared at the Mimecast Engineering Blog but I made it available here in my personal internet site too. => https://medium.com/mimecast-engineering/dtail-the-distributed-log-tail-program-79b8087904bb Original Mimecast Engineering Blog post at Medium @@ -16,6 +14,21 @@ Every engineer familiar with UNIX or a UNIX-like platform (e.g., Linux) is well Think of DTail as a distributed version of the tail program which is very useful when you have a distributed application running on many servers. DTail is an Open-Source, cross-platform, fairly easy to use, support and maintain log file analysis & statistics gathering tool designed for Engineers and Systems Administrators. It is programmed in Google Go. +=> ./dtail-the-distributed-log-tail-program/title.png DTail logo image + +## Table of Contents + +* ⇢ DTail - The distributed log tail program +* ⇢ ⇢ A Mimecast Pet Project +* ⇢ ⇢ Differentiating from log management systems +* ⇢ ⇢ Combining simplicity, security and efficiency +* ⇢ ⇢ The DTail family of commands +* ⇢ ⇢ Usage example +* ⇢ ⇢ Fitting it in +* ⇢ ⇢ Advanced features +* ⇢ ⇢ For the future +* ⇢ ⇢ Open Source + ## A Mimecast Pet Project DTail got its inspiration from public domain tools available already in this area but it is a blue sky from-scratch development which was first presented at Mimecast’s annual internal Pet Project competition (awarded with a Bronze prize). It has gained popularity since and is one of the most widely deployed DevOps tools at Mimecast (reaching nearly 10k server installations) and many engineers use it on a regular basis. The Open-Source version of DTail is available at: @@ -107,9 +120,9 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -=> ./2021-04-22-dtail-the-distributed-log-tail-program.gmi 2021-04-22 DTail - The distributed log tail program (You are currently reading this) -=> ./2022-03-06-the-release-of-dtail-4.0.0.gmi 2022-03-06 The release of DTail 4.0.0 -=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD => ./2023-09-25-dtail-usage-examples.gmi 2023-09-25 DTail usage examples +=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD +=> ./2022-03-06-the-release-of-dtail-4.0.0.gmi 2022-03-06 The release of DTail 4.0.0 +=> ./2021-04-22-dtail-the-distributed-log-tail-program.gmi 2021-04-22 DTail - The distributed log tail program (You are currently reading this) => ../ Back to the main site diff --git a/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.gmi.tpl b/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.gmi.tpl index 5c955c66..79693808 100644 --- a/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.gmi.tpl +++ b/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.gmi.tpl @@ -2,8 +2,6 @@ > Published at 2021-04-22T19:28:41+01:00; Updated at 2021-04-26 -=> ./dtail-the-distributed-log-tail-program/title.png DTail logo image - This article first appeared at the Mimecast Engineering Blog but I made it available here in my personal internet site too. => https://medium.com/mimecast-engineering/dtail-the-distributed-log-tail-program-79b8087904bb Original Mimecast Engineering Blog post at Medium @@ -16,6 +14,10 @@ Every engineer familiar with UNIX or a UNIX-like platform (e.g., Linux) is well Think of DTail as a distributed version of the tail program which is very useful when you have a distributed application running on many servers. DTail is an Open-Source, cross-platform, fairly easy to use, support and maintain log file analysis & statistics gathering tool designed for Engineers and Systems Administrators. It is programmed in Google Go. +=> ./dtail-the-distributed-log-tail-program/title.png DTail logo image + +<< template::inline::toc + ## A Mimecast Pet Project DTail got its inspiration from public domain tools available already in this area but it is a blue sky from-scratch development which was first presented at Mimecast’s annual internal Pet Project competition (awarded with a Bronze prize). It has gained popularity since and is one of the most widely deployed DevOps tools at Mimecast (reaching nearly 10k server installations) and many engineers use it on a regular basis. The Open-Source version of DTail is available at: @@ -107,6 +109,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -<< template::inline::index dtail +<< template::inline::rindex dtail => ../ Back to the main site diff --git a/gemfeed/2021-04-24-welcome-to-the-geminispace.gmi b/gemfeed/2021-04-24-welcome-to-the-geminispace.gmi index 26e56715..8243f000 100644 --- a/gemfeed/2021-04-24-welcome-to-the-geminispace.gmi +++ b/gemfeed/2021-04-24-welcome-to-the-geminispace.gmi @@ -2,14 +2,6 @@ > Published at 2021-04-24T19:28:41+01:00; Updated at 2021-06-18 -ASCII Art by Andy Hood! - -Have you reached this article already via Gemini? It requires a Gemini client; web browsers such as Firefox, Chrome, Safari, etc., don't support the Gemini protocol. The Gemini address of this site (or the address of this capsule as people say in Geminispace) is: - -=> gemini://foo.zone - -However, if you still use HTTP, you are just surfing the fallback HTML version of this capsule. In that case, I suggest reading on what this is all about :-). - ``` /\ @@ -30,6 +22,26 @@ However, if you still use HTTP, you are just surfing the fallback HTML version o ``` +## Table of Contents + +* ⇢ Welcome to the Geminispace +* ⇢ ⇢ Introduction +* ⇢ ⇢ Motivation +* ⇢ ⇢ ⇢ My urge to revamp my personal website +* ⇢ ⇢ ⇢ My still great Laptop running hot +* ⇢ ⇢ Discovering the Gemini internet protocol +* ⇢ ⇢ My own Gemini capsule +* ⇢ ⇢ Gemini advantages summarised +* ⇢ ⇢ Dive into deep Gemini space + +## Introduction + +Have you reached this article already via Gemini? It requires a Gemini client; web browsers such as Firefox, Chrome, Safari, etc., don't support the Gemini protocol. The Gemini address of this site (or the address of this capsule as people say in Geminispace) is: + +=> gemini://foo.zone + +However, if you still use HTTP, you are just surfing the fallback HTML version of this capsule. In that case, I suggest reading on what this is all about :-). + ## Motivation ### My urge to revamp my personal website @@ -82,10 +94,11 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -=> ./2021-04-24-welcome-to-the-geminispace.gmi 2021-04-24 Welcome to the Geminispace (You are currently reading this) -=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all -=> ./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi 2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again -=> ./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi 2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again² +=> ./2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.gmi 2024-10-02 Gemtexter 3.0.0 - Let's Gemtext again⁴ => ./2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.gmi 2023-07-21 Gemtexter 2.1.0 - Let's Gemtext again³ +=> ./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi 2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again² +=> ./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi 2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again +=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all +=> ./2021-04-24-welcome-to-the-geminispace.gmi 2021-04-24 Welcome to the Geminispace (You are currently reading this) => ../ Back to the main site diff --git a/gemfeed/2021-04-24-welcome-to-the-geminispace.gmi.tpl b/gemfeed/2021-04-24-welcome-to-the-geminispace.gmi.tpl index 0a036349..1a65cd3e 100644 --- a/gemfeed/2021-04-24-welcome-to-the-geminispace.gmi.tpl +++ b/gemfeed/2021-04-24-welcome-to-the-geminispace.gmi.tpl @@ -2,14 +2,6 @@ > Published at 2021-04-24T19:28:41+01:00; Updated at 2021-06-18 -ASCII Art by Andy Hood! - -Have you reached this article already via Gemini? It requires a Gemini client; web browsers such as Firefox, Chrome, Safari, etc., don't support the Gemini protocol. The Gemini address of this site (or the address of this capsule as people say in Geminispace) is: - -=> gemini://foo.zone - -However, if you still use HTTP, you are just surfing the fallback HTML version of this capsule. In that case, I suggest reading on what this is all about :-). - ``` /\ @@ -30,6 +22,16 @@ However, if you still use HTTP, you are just surfing the fallback HTML version o ``` +<< template::inline::toc + +## Introduction + +Have you reached this article already via Gemini? It requires a Gemini client; web browsers such as Firefox, Chrome, Safari, etc., don't support the Gemini protocol. The Gemini address of this site (or the address of this capsule as people say in Geminispace) is: + +=> gemini://foo.zone + +However, if you still use HTTP, you are just surfing the fallback HTML version of this capsule. In that case, I suggest reading on what this is all about :-). + ## Motivation ### My urge to revamp my personal website @@ -82,6 +84,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -<< template::inline::index gemtext gemini +<< template::inline::rindex gemtext gemini => ../ Back to the main site diff --git a/gemfeed/2021-05-16-personal-bash-coding-style-guide.gmi b/gemfeed/2021-05-16-personal-bash-coding-style-guide.gmi index 349b39b5..66c78be6 100644 --- a/gemfeed/2021-05-16-personal-bash-coding-style-guide.gmi +++ b/gemfeed/2021-05-16-personal-bash-coding-style-guide.gmi @@ -2,6 +2,10 @@ > Published at 2021-05-16T14:51:57+01:00 +Lately, I have been polishing and writing a lot of Bash code. Not that I never wrote a lot of Bash, but now as I also looked through the Google Shell Style Guide, I thought it is time also to write my thoughts on that. I agree with that guide in most, but not in all points. + +=> https://google.github.io/styleguide/shellguide.html Google Shell Style Guide + ``` .---------------------------. /,--..---..---..---..---..--. `. @@ -15,9 +19,26 @@ "\__/"---------------"\__/"-+---+' ``` -Lately, I have been polishing and writing a lot of Bash code. Not that I never wrote a lot of Bash, but now as I also looked through the Google Shell Style Guide, I thought it is time also to write my thoughts on that. I agree with that guide in most, but not in all points. - -=> https://google.github.io/styleguide/shellguide.html Google Shell Style Guide +## Table of Contents + +* ⇢ Personal Bash coding style guide +* ⇢ ⇢ My modifications +* ⇢ ⇢ ⇢ Shebang +* ⇢ ⇢ ⇢ Two space soft-tabs indentation +* ⇢ ⇢ ⇢ Breaking long pipes +* ⇢ ⇢ ⇢ Quoting your variables +* ⇢ ⇢ ⇢ Prefer built-in commands over external commands +* ⇢ ⇢ My additions +* ⇢ ⇢ ⇢ Use of 'yes' and 'no' +* ⇢ ⇢ ⇢ Non-evil alternative to variable assignments via eval +* ⇢ ⇢ ⇢ Prefer pipes over arrays for list processing +* ⇢ ⇢ ⇢ Assign-then-shift +* ⇢ ⇢ ⇢ Paranoid mode +* ⇢ ⇢ Learned +* ⇢ ⇢ ⇢ Unintended lexicographical comparison. +* ⇢ ⇢ ⇢ PIPESTATUS +* ⇢ ⇢ Use common sense and BE CONSISTENT. +* ⇢ ⇢ Advanced Bash learning pro tip ## My modifications @@ -388,10 +409,10 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -=> ./2021-05-16-personal-bash-coding-style-guide.gmi 2021-05-16 Personal Bash coding style guide (You are currently reading this) -=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all -=> ./2021-11-29-bash-golf-part-1.gmi 2021-11-29 Bash Golf Part 1 -=> ./2022-01-01-bash-golf-part-2.gmi 2022-01-01 Bash Golf Part 2 => ./2023-12-10-bash-golf-part-3.gmi 2023-12-10 Bash Golf Part 3 +=> ./2022-01-01-bash-golf-part-2.gmi 2022-01-01 Bash Golf Part 2 +=> ./2021-11-29-bash-golf-part-1.gmi 2021-11-29 Bash Golf Part 1 +=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all +=> ./2021-05-16-personal-bash-coding-style-guide.gmi 2021-05-16 Personal Bash coding style guide (You are currently reading this) => ../ Back to the main site diff --git a/gemfeed/2021-05-16-personal-bash-coding-style-guide.gmi.tpl b/gemfeed/2021-05-16-personal-bash-coding-style-guide.gmi.tpl index 04e3f708..d7903de2 100644 --- a/gemfeed/2021-05-16-personal-bash-coding-style-guide.gmi.tpl +++ b/gemfeed/2021-05-16-personal-bash-coding-style-guide.gmi.tpl @@ -2,6 +2,10 @@ > Published at 2021-05-16T14:51:57+01:00 +Lately, I have been polishing and writing a lot of Bash code. Not that I never wrote a lot of Bash, but now as I also looked through the Google Shell Style Guide, I thought it is time also to write my thoughts on that. I agree with that guide in most, but not in all points. + +=> https://google.github.io/styleguide/shellguide.html Google Shell Style Guide + ``` .---------------------------. /,--..---..---..---..---..--. `. @@ -15,9 +19,7 @@ "\__/"---------------"\__/"-+---+' ``` -Lately, I have been polishing and writing a lot of Bash code. Not that I never wrote a lot of Bash, but now as I also looked through the Google Shell Style Guide, I thought it is time also to write my thoughts on that. I agree with that guide in most, but not in all points. - -=> https://google.github.io/styleguide/shellguide.html Google Shell Style Guide +<< template::inline::toc ## My modifications @@ -388,6 +390,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -<< template::inline::index bash +<< template::inline::rindex bash => ../ Back to the main site diff --git a/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi b/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi index c8e39d48..f6ddab74 100644 --- a/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi +++ b/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi @@ -2,6 +2,10 @@ > Published at 2021-06-05T19:03:32+01:00 +You might have read my previous blog posts about entering the Geminispace, where I pointed out the benefits of having and maintaining an internet presence there. This whole site (the blog and all other pages) is composed in the Gemtext markup language. + +This comes with the benefit that I can write content in my favourite text editor (Vim). + ``` o .,<>., o |\/\/\/\/| @@ -43,9 +47,21 @@ `+a:f:......jrei''' ``` -You might have read my previous blog posts about entering the Geminispace, where I pointed out the benefits of having and maintaining an internet presence there. This whole site (the blog and all other pages) is composed in the Gemtext markup language. - -This comes with the benefit that I can write content in my favourite text editor (Vim). +## Table of Contents + +* ⇢ Gemtexter - One Bash script to rule it all +* ⇢ ⇢ Motivation +* ⇢ ⇢ Output formats +* ⇢ ⇢ Taking it as far as I should, but no farther +* ⇢ ⇢ ⇢ Modularization +* ⇢ ⇢ ⇢ Bash best practises and ShellCheck +* ⇢ ⇢ ⇢ Unit testing +* ⇢ ⇢ ⇢ HTML unit test example +* ⇢ ⇢ ⇢ Markdown unit test example +* ⇢ ⇢ Handcrafted HTML styles +* ⇢ ⇢ Configurability +* ⇢ ⇢ Future features +* ⇢ ⇢ Conclusion ## Motivation @@ -167,14 +183,15 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -=> ./2021-04-24-welcome-to-the-geminispace.gmi 2021-04-24 Welcome to the Geminispace -=> ./2021-05-16-personal-bash-coding-style-guide.gmi 2021-05-16 Personal Bash coding style guide -=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all (You are currently reading this) -=> ./2021-11-29-bash-golf-part-1.gmi 2021-11-29 Bash Golf Part 1 -=> ./2022-01-01-bash-golf-part-2.gmi 2022-01-01 Bash Golf Part 2 -=> ./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi 2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again -=> ./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi 2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again² -=> ./2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.gmi 2023-07-21 Gemtexter 2.1.0 - Let's Gemtext again³ +=> ./2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.gmi 2024-10-02 Gemtexter 3.0.0 - Let's Gemtext again⁴ => ./2023-12-10-bash-golf-part-3.gmi 2023-12-10 Bash Golf Part 3 +=> ./2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.gmi 2023-07-21 Gemtexter 2.1.0 - Let's Gemtext again³ +=> ./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi 2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again² +=> ./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi 2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again +=> ./2022-01-01-bash-golf-part-2.gmi 2022-01-01 Bash Golf Part 2 +=> ./2021-11-29-bash-golf-part-1.gmi 2021-11-29 Bash Golf Part 1 +=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all (You are currently reading this) +=> ./2021-05-16-personal-bash-coding-style-guide.gmi 2021-05-16 Personal Bash coding style guide +=> ./2021-04-24-welcome-to-the-geminispace.gmi 2021-04-24 Welcome to the Geminispace => ../ Back to the main site diff --git a/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi.tpl b/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi.tpl index 61cd65be..b8cd1588 100644 --- a/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi.tpl +++ b/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi.tpl @@ -2,6 +2,10 @@ > Published at 2021-06-05T19:03:32+01:00 +You might have read my previous blog posts about entering the Geminispace, where I pointed out the benefits of having and maintaining an internet presence there. This whole site (the blog and all other pages) is composed in the Gemtext markup language. + +This comes with the benefit that I can write content in my favourite text editor (Vim). + ``` o .,<>., o |\/\/\/\/| @@ -43,9 +47,7 @@ `+a:f:......jrei''' ``` -You might have read my previous blog posts about entering the Geminispace, where I pointed out the benefits of having and maintaining an internet presence there. This whole site (the blog and all other pages) is composed in the Gemtext markup language. - -This comes with the benefit that I can write content in my favourite text editor (Vim). +<< template::inline::toc ## Motivation @@ -167,6 +169,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -<< template::inline::index gemtext gemini bash +<< template::inline::rindex gemtext gemini bash => ../ Back to the main site diff --git a/gemfeed/2021-07-04-the-well-grounded-rubyist.gmi b/gemfeed/2021-07-04-the-well-grounded-rubyist.gmi index 55e8b0b1..6f2952e8 100644 --- a/gemfeed/2021-07-04-the-well-grounded-rubyist.gmi +++ b/gemfeed/2021-07-04-the-well-grounded-rubyist.gmi @@ -14,6 +14,20 @@ Superficially, Perl seems to have many similarities to Ruby (but, of course, it Yukihiro Matsumoto, the inventor of Ruby, said: "I wanted a scripting language that was more powerful than Perl and more object-oriented than Python" - So I can see where some of the similarities come from. I personally don't believe that Ruby is more powerful than Perl, though, especially when you take CPAN and/or Perl 6 (now known as Raku) into the equation. Well, it all depends on what you mean with "more powerful". But I want to stay pragmatic and use what's already used at my workplace. +## Table of Contents + +* ⇢ The Well-Grounded Rubyist +* ⇢ ⇢ My Ruby problem domain +* ⇢ ⇢ Being stuck in Ruby-mediocrity +* ⇢ ⇢ O'Reilly Safari Books Online +* ⇢ ⇢ Key takeaways +* ⇢ ⇢ ⇢ "Everything" is an object +* ⇢ ⇢ ⇢ "Normal" objects and singleton objects +* ⇢ ⇢ ⇢ Domain specific languages +* ⇢ ⇢ ⇢ Ruby is "self-ish" +* ⇢ ⇢ ⇢ Functional programming +* ⇢ ⇢ Perl + ## My Ruby problem domain I wrote a lot of Ruby code over the last couple of years. There were many small to medium-sized tools and other projects such as Nagios monitoring checks, even an internal monitoring & reporting site based on Sinatra. All Ruby scripts I wrote do their work well; I didn't encounter any significant problems using Ruby for any of these tasks. Of course, there's nothing that couldn't be written in Perl (or Python), though, after all, these languages are all Turing-complete and all these languages also come with a huge set of 3rd party libraries :-). diff --git a/gemfeed/2021-07-04-the-well-grounded-rubyist.gmi.tpl b/gemfeed/2021-07-04-the-well-grounded-rubyist.gmi.tpl new file mode 100644 index 00000000..4434f170 --- /dev/null +++ b/gemfeed/2021-07-04-the-well-grounded-rubyist.gmi.tpl @@ -0,0 +1,109 @@ +# The Well-Grounded Rubyist + +> Published at 2021-07-04T10:51:23+01:00 + +When I was a Linux System Administrator, I have been programming in Perl for years. I still maintain some personal Perl programming projects (e.g. Xerl, guprecords, Loadbars). After switching jobs a couple of years ago (becoming a Site Reliability Engineer), I found Ruby (and some Python) widely used there. As I wanted to do something new, I decided to give Ruby a go. + +You should learn or try out one new programming language once yearly anyway. If you end up not using the new language, that's not a problem. You will learn new techniques with each new programming language and this also helps you to improve your overall programming skills even for other languages. Also, having some background in a similar programming language makes it reasonably easy to get started. Besides that, learning a new programming language is kick-a** fun! + +=> ./the-well-grounded-rubyist/book-cover.jpg + +Superficially, Perl seems to have many similarities to Ruby (but, of course, it is entirely different to Perl when you look closer), which pushed me towards Ruby instead of Python. I have tried Python a couple of times before, and I managed to write good code, but I never felt satisfied with the language. I didn't love the syntax, especially the indentations used; they always confused me. I don't dislike Python, but I don't prefer to program in it if I have a choice, especially when there are more propelling alternatives available. Personally, it's so much more fun to program in Ruby than in Python. + +=> ./the-well-grounded-rubyist/book-backside.jpg + +Yukihiro Matsumoto, the inventor of Ruby, said: "I wanted a scripting language that was more powerful than Perl and more object-oriented than Python" - So I can see where some of the similarities come from. I personally don't believe that Ruby is more powerful than Perl, though, especially when you take CPAN and/or Perl 6 (now known as Raku) into the equation. Well, it all depends on what you mean with "more powerful". But I want to stay pragmatic and use what's already used at my workplace. + +<< template::inline::toc + +## My Ruby problem domain + +I wrote a lot of Ruby code over the last couple of years. There were many small to medium-sized tools and other projects such as Nagios monitoring checks, even an internal monitoring & reporting site based on Sinatra. All Ruby scripts I wrote do their work well; I didn't encounter any significant problems using Ruby for any of these tasks. Of course, there's nothing that couldn't be written in Perl (or Python), though, after all, these languages are all Turing-complete and all these languages also come with a huge set of 3rd party libraries :-). + +I don't use Ruby for all programming projects, though. + +* I am using Bash for small sized (usually below 500 lines of code) scripts and ad-hoc command-line automation. +* I program in Google Go for more complex tools (such as DTail) and for problem solving involving data crunching. +* Occasionally, I write some lines of Java code for minor feature enhancements and fixes to improve the reliability of some the services. +* Sometimes, I still program in good old C. This is for special projects (e.g. I/O Riot) or low-level PoCs or SystemTap guru mode scripts. + +=> ./2021-05-16-personal-bash-coding-style-guide.gmi Also have a look at my personal Bash coding style. +=> ./2021-04-22-dtail-the-distributed-log-tail-program.gmi Read here about DTail - the distributed log tail program. +=> ./2018-06-01-realistic-load-testing-with-ioriot-for-linux.gmi This is a magazine article about I/O Riot I wrote. + +For all other in-between tasks I mainly use the Ruby programming language (unless I decide to give something new a shot once in a while). + +## Being stuck in Ruby-mediocrity + +As a Site Reliability Engineer there were many tasks and problems to be solved as efficiently and quickly as possible and, of course, without bugs. So I learned Ruby relatively fast by doing and the occasional web search for "how to do thing X". I always was eager to get the problem at hand solved and as long as the code solved the problem I usually was happy. + +Until now, I never read a whole book or took a course on Ruby. As a result, I found myself writing Ruby in a Perl-ish procedural style (with Perl, you can do object-oriented programming too, but Perl wasn't designed from the ground up to be an object-oriented language). I didn't take advantage of all the specialities Ruby has to offer as I invested most of my time in the problems at hand and not in the Ruby idiomatic way of doing things. + +An unexpected benefit was that most of my Ruby code (probably not all, there are always dark corners in some old code bases lurking around) was easy to follow and extend or fix, even by people who usually don't speak Ruby, as there wasn't too much magic involved in my code - However, I could have done better still. Looking at other Ruby projects, I noticed over time that there is so much more to the language I wanted to explore. For example new techniques and the Ruby best practise, and much more about how things work under the hood, I wanted to learn about. + +## O'Reilly Safari Books Online + +I do have an O'Reilly Safari Online subscription (thank you, employer). To my liking, I found the "The Well-Grounded Rubyist" book there (the text version and also the video version of it). I watched the video version for a couple of weeks, chunking the content into small pieces so it was able to fit into my schedule, increasing the playback speed for the topics I knew already well enough and slowed it down to actual pace when there was something new to learn and occasionally jumped back to the text book to review what I just learned. To my satisfaction, I was already familiar with over half of the language. But there was still the big chunk, especially how the magic happens under the hood in Ruby, which I missed out on, but I am happy now to be aware of it now. + +I also loved the occasional dry humour in the book: "An enumerator is like a brain in a science fiction movie, sitting on a table with no connection to a body but still able to think". :-) + +Will I rewrite and refactor all of my existing Ruby programs? Probably not, as they all do their work as intended. Some of these scripts will be eventually replaced or retired. But depending on the situation, I might refactor a module, class or a method or two once in a while. I already knew how to program in an object-oriented style from other languages (e.g. Java, C++, Perl Moose and plain) before I started Ruby, so my existing Ruby code is not as bad as you might assume after reading this article :-). In contrast to Java/C++, Ruby is a dynamic language, and the idiomatic ways of doing things differs from statically typed languages. + +## Key takeaways + +These are my key takeaways. These only point out some specific things I have learned, and represent, by far, not everything I've learned from the book. + +### "Everything" is an object + +In Ruby, everything is an object. However, Ruby is not Smalltalk. It depends on what you mean by "everything". Fixnums are objects. Classes also are, as instances of class Class. Methods, operators and blocks aren't but can be wrapped by objects via a "Proc". A simple assignment is not and can't. Statements like "while" also aren't and can't. Comments obviously also fall in the latter group. Ruby is more object-oriented than everything else I have ever seen, except for Smalltalk. + +In Ruby, like in Java/C++, classes are classes, objects are instances of classes, and there are class inheritances. There is single inheritance in Ruby, but with the power of mixing in modules, you can extend your classes in a better way than multiple class inheritances (like in C++) would allow. It's also different to Java interfaces, as interfaces in Java only come with the method prototypes and not with the actual method implementations like Ruby modules. + +### "Normal" objects and singleton objects + +In Ruby, you can also have singleton objects. A singleton object can be an instance of a class but be modified after its creation (e.g. a method added to only this particular instance after its instantiation). Or, another variant of a singleton object is a class (yes, classes are also objects in Ruby). All of that is way better described in the book, so have a read by yourself if you are confused now; just remember: Rubys object system is very dynamic and flexible. At runtime, you can add and modify classes, objects of classes, singleton objects and modules. You don't need to restart the Ruby interpreter; you can change the code during runtime dynamically through Ruby code. + +### Domain specific languages + +Due to Ruby's flexibility through object individualization (e.g. adding methods at runtime, or changing the core behaviour of classes, catching unknown method calls and dynamically dispatch and/or generate the missing methods via the "method_missing" method), Ruby is a very good language to write your own small domain specific language (DSL) on top of Ruby syntax. I only noticed that after reading this book. Maybe, this is one of the reasons why even the configuration management system Puppet once tried to use a Ruby DSL instead of the Puppet DSL for its manifests. I am not sure why the project got abandoned though, probably it has to do with performance. Do be honest, Ruby is not the fastest language, but it is fast enough for most use cases. And, especially from Ruby 3, performance is one of the main things being worked on currently. If I want performance, I can always use another programming language. + +### Ruby is "self-ish" + +Ruby will fall back to the default "self" object if you don't specify an object method receiver. To give you an example, some more explanation is needed: There is the "Kernel" module mixed into almost every Ruby object. For example, "puts" is just a method of module "Kernel". When you write "puts :foo", Ruby sends the message "puts" to the current object "self". The class of object "self" is "Object". Class Object has module "Kernel" mixed in, and "Kernel" defines the method "puts". + +``` +>> self +=> main +>> self.class +=> Object +>> self.class.included_modules +=> [PP::ObjectMixin, Kernel] +>> Kernel.class +=> Module +>> Kernel.methods.grep(/puts/) +=> [:puts] +>> puts 'Hello Ruby' +Hello Ruby +=> nil +>> self.puts 'Hello World' +Hello World +=> nil +``` + +Ruby offers a lot of syntactic sugar and seemingly magic, but it all comes back to objects and messages to objects under the hood. As all is hidden in objects, you can unwrap and even change the magic and see what's happening under the hood. Then, suddenly everything makes so much sense. + +### Functional programming + +Ruby embraces an object-oriented programming style. But there is good news for fans of the functional programming paradigm: From immutable data (frozen objects), pure functions, lambdas and higher-order functions, lazy evaluation, tail-recursion optimization, method chaining, currying and partial function application, all of that is there. I am delighted about that, as I am a big fan of functional programming (having played with Haskell and Standard ML before). + +Remember, however, that Ruby is not a pure functional programming language. You, the Rubyist, need to explicitly decide when to apply a functional style, as, by heart, Ruby is designed to be an object-oriented language. The language will not enforce side effect avoidance, and you will have to enable tail-recursion optimization (as of Ruby 2.5) explicitly, and variables/objects aren't immutable by default either. But that all does not hinder you from using these features. + +I liked this book so much so that I even bought myself a (used) paper copy of it. To my delight, there was also a free eBook version in ePub format included, which I now have on my Kobo Forma eBook reader. :-) + +## Perl + +Will I abandon my beloved Perl? Probably not. There are also some Perl scripts I use at work. But unfortunately I only have a limited amount of time and I have to use it wisely. I might look into Raku (formerly known as Perl 6) next year and use it for a personal pet project, who knows. :-). I also highly recommend reading the two Perl books "Modern Perl" and "Higher-Order Perl". + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2021-08-01-on-being-pedantic-about-open-source.gmi b/gemfeed/2021-08-01-on-being-pedantic-about-open-source.gmi index ac811e0b..17a91104 100644 --- a/gemfeed/2021-08-01-on-being-pedantic-about-open-source.gmi +++ b/gemfeed/2021-08-01-on-being-pedantic-about-open-source.gmi @@ -2,6 +2,8 @@ > Published at 2021-08-01T10:37:58+03:00; Updated at 2023-01-23 +I believe that it is essential to always have free and open-source alternatives to any kind of closed-source proprietary software available to choose from. But there are a couple of points you need to take into consideration. + ``` __ _____....--' .' @@ -14,7 +16,23 @@ '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^' LGB - Art by lgbearrd ``` -I believe that it is essential to always have free and open-source alternatives to any kind of closed-source proprietary software available to choose from. But there are a couple of points you need to take into consideration. +## Table of Contents + +* ⇢ On being Pedantic about Open-Source +* ⇢ ⇢ The costs of open-source +* ⇢ ⇢ Commercial providers +* ⇢ ⇢ Earning on open-source +* ⇢ ⇢ Open-source organizations and individual contributors +* ⇢ ⇢ Lesser known projects and the charm of clunkiness +* ⇢ ⇢ The security aspect +* ⇢ ⇢ Always watch out for open-source alternatives +* ⇢ ⇢ What about mobile? +* ⇢ ⇢ Know the alternatives +* ⇢ ⇢ You can't control it all +* ⇢ ⇢ The middle way +* ⇢ ⇢ The downside of being a nobody +* ⇢ ⇢ Mobile open-source OSes are still evolving +* ⇢ ⇢ Conclusion ## The costs of open-source diff --git a/gemfeed/2021-08-01-on-being-pedantic-about-open-source.gmi.tpl b/gemfeed/2021-08-01-on-being-pedantic-about-open-source.gmi.tpl new file mode 100644 index 00000000..08dff942 --- /dev/null +++ b/gemfeed/2021-08-01-on-being-pedantic-about-open-source.gmi.tpl @@ -0,0 +1,121 @@ +# On being Pedantic about Open-Source + +> Published at 2021-08-01T10:37:58+03:00; Updated at 2023-01-23 + +I believe that it is essential to always have free and open-source alternatives to any kind of closed-source proprietary software available to choose from. But there are a couple of points you need to take into consideration. + +``` + __ + _____....--' .' + ___...---'._ o -`( + ___...---' \ .--. `\ + ___...---' | \ \ `| +| |o o | | | +| \___'.-`. '. +| | `---' +'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^' LGB - Art by lgbearrd +``` + +<< template::inline::toc + +## The costs of open-source + +One benefit of using open-source software is that it doesn't cost anything, right? That's correct in many cases. However, in some cases you still need to spend a significant amount of time configuring the software to work for you. It will be more expensive to use open-source software than proprietary commercial one if you aren't careful. + +Not to say that I haven't seen the same effect with commercial software where people had to, after buying it, put a bunch of effort to make it work due to the lack of quality or due to high complexity. But that's either bad luck or bad decision-making. Most commercial providers I have worked with try to make it work for you, so you also will buy other products and services from them later on and don't lose you as a happy customer. + +## Commercial providers + +Producers of commercial software want to earn money after all. This is to grow their businesses and also to be able to pay their employees, who also need to care for their families. Employees build up their careers, build houses, and are proud of their accomplishments in the company. + +So per se, commercial software is not a bad thing. Right? At least, commercial closed-source software is not a bad thing in its heart. Unfortunately, some companies have to keep their software closed-source to not lose their competitive edge over other competitors. + +## Earning on open-source + +There are also companies that earn on open-source software. All the code they write is free for download and use, but you, as a customer, could pay for service and support if you are not an expert and can't manage it by yourself. + +I like this approach, as you can balance the effort and costs the way it suits you best, and in doubt, you can audit the source code. Are you already an expert? Perfect, you don't need to buy additional support for the software. Everything can be set up by yourself, given that you have the time and priority. + +Also, once an open-source project reached a certain size, it is unlikely to be abandoned one day. As long as at least one person is willing to be the open-source maintainer, the project won't die. Whereas commercial providers can decide from today to tomorrow to retire software or go bankrupt (unless you purchase Microsoft Word, I don't believe it will die anytime soon). + +## Open-source organizations and individual contributors + +Besides corporations, millions of individual open-source contributors write free and open-source software not for money but for pleasure. Often, they are organized in non-profit organizations, working together to reach a common goal (it is worth mentioning that there are also many professionals, payed by large corporations, working full-time for non-profit open-source projects in order to push the features and reach the goals of the corporations). Sometimes, people don't agree on the project goal, so it gets forked, which can be a good thing. The more diversity, the better, as this is where competition and innovation happens. Also, the end user will end up with more choices. + +These open-source projects are of a very high quality standard and are rock-solid, if not better, alternatives to proprietary counterparts. If the project isn't backed by a large corporation already, you should donate to these open-source organizations and/or individual contributors. I have donated to some projects I use personally. Do you learn a foreign language and use Anki flashcards? It's entirely free and open-source, and they happily accept donations ensuring future maintenance and development. + +## Lesser known projects and the charm of clunkiness + +Looking at the smaller, lesser-known open-source projects (not talking about established open-source projects like FreeBSD and Linux): You can't, however, expect the software to be perfect and bug-free. After all, most of the code is written for pleasure and fun in the developers' free time. Besides the developer himself, you might be the only user of the project. The software may be a bit clunky to use, and probably bugs are lurking around, and it might only work for a very specific use case. + +Clunkiness can be charmful, though. And it can also encourage you to contribute code to make it better. There is a lot of such code in personal GitHub and GitLab repositories. The quality of such small open-source projects varies drastically. Many hobbyist programmers see programming as an art and put tons of effort into their projects. Others upload broken crap, which is dangerous to use. So have a look at the code before you use it! + +## The security aspect + +One of the main conceptions about open-source software is that it is more secure than closed-source software because everybody can read and fix the code. Is that actually true? You can only be sure when you audit the code by yourself. If you are like me, you won't have time to audit all the open-source software you use. It's impossible to audit more than 100 million lines of Linux kernel code. Static code analysis tools come in handy here, but they still require humans to look at the results. + +Security bugs in open-source projects are exposed to the public and fixed quickly, while we don't know exactly what happens to security bugs in closed-source ones. Still, hackers and security specialists can find them through reverse engineering and penetration testing. Overall, thinking of security, In my opinion it is still better to prefer open-source software because the more significant the project, the higher the probability that security bugs are found and fixed as more parties are looking into it. Furthermore, provided you have the necessary resources, you could still deduct an audit by yourself. The latter especially happens when companies with its own security and penetration testing departments are evaluating the use of open-source. This is something not every company can afford though. + +## Always watch out for open-source alternatives + +Do you need Microsoft Word? Why don't you just use the Vim text editor or GNU Emacs to write your letters? If that's too nerdy, you can still use open-source alternatives such as AbiWord or LibreOffice. Larger organizations have the tendency to standardize the software their employees have to use. Unfortunately, as Microsoft Word is the de-facto standard text processing program, most companies prefer Word over LibreOffice. Same with Microsoft Excel vs LibreOffice Calc or other spreadsheet alternatives like Gnumeric. I don't know why that is; please.... + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +I only use free and open-source operating systems on my personal Laptops, Desktop PCs and servers (FreeBSD and Linux based ones). Most of the programs and apps I use on them are free and open-source as well, and I am comfortable with it for over twenty years. Exceptions are the BIOSes and some firmwares of my devices. I also use Skype as most of my friends and family are using it. They are, unfortunately, proprietary software still. But I will be looking into Matrix as a Skype alternative when I have time. There are also open BIOS alternatives, but they usually don't work on my devices. + +## What about mobile? + +> Update 2023-01-21: Check out my newer post about GrapheneOS, which solves some of my dilemmas + +=> ./2023-01-23-why-grapheneos-rox.gmi Why GrapheneOS Rox + +I struggle to go 100% open-source on my Smartphone. I use a Samsung phone with the stock Android as provided by Samsung. I love the device as it is large enough to use as a portable reading and note-taking device, and it can also take decent pictures. As a cloud backup solution, I have my own NextCloud server (open-source). Android is mainly open-source software, but many closed parts are still included. I replaced most of the standard apps with free and open-source variants from the F-Droid store though. + +I could get a LineageOS based phone to get rid of the proprietary Android parts (I tried that out a couple of times in the past). But then a couple of convenient apps, such as Google Maps or Banking or Skype or the E-Ticket apps of various Airlines, various review apps when searching for restaurants, Audible (I think Audible offers an excellent service), etc., won't work anymore. The proprietary Google Maps is still the best maps app, even though there are open alternatives available. It's not that I couldn't live without these apps, but they make life a lot more convenient. + +## Know the alternatives + +Thinking about alternative solutions is always a good idea. My advice is never to be entirely dependant on any proprietary software. Before you decide to use proprietary software, try to find alternatives in the open-source world. You might need to invest some time playing around with the options available. Maybe they are good enough for you, or maybe not. + +If you still want to use proprietary software, use it with caution. Have a look at the recent change at Google Photos: For a long time, "high quality" photos could be uploaded there quota-less for free. However, Google recently changed the model so that people exceeding a quota have to start paying for the extra space consumed. I am not against Google's decision, but it shows you that a provider can always change its direction. So you can't entirely rely on these. I repeat myself: Don't fully rely on anything proprietary, but you might still use proprietary software or services for your own convenience. + +## You can't control it all + +The biggest problem I have with going 100% open-source is actually time. You can't control all the software you use or might be using in the future. You have only a finite amount of time available in your life. So you have to decide what's more important: Investigate and use an open-source alternative of every program and app you have installed, or rather spend quality time with your family and have a nice walk in the park or go to a sports class or cook a nice meal? You can't control it all in today's world of tech, not as a user and even not as a tech worker. There's a great blog post worth reading: + +=> https://unixsheikh.com/articles/how-to-stay-sane-in-todays-world-of-tech.html + +## The middle way + +Regarding my personal Smartphone dilemma: I guess the middle way is to use two phones: + +* Have a secondary, proprietary Android phone with Google Play store (or an Apple iPhone if this is more your thing) and all its benefits for occasional use. Use the proprietary phone only with intention. Such a phone implies some risks regarding your privacy. If you aren't careful, app providers will collect your personal data for building a digital profile of you, which gets used for online advertisement and other things. This doesn't only applies to the Smartphone, this also applies to some proprietary software (including cloud services such as Google Photos) you use on your home computer or websites you visit (I am looking at you, Facebook, Twitter and friends). Try to disable all tracking features on such a phone. It's not a guarantee that nobody will be collecting data from you anymore, but you should take at least the chance. Cal Newport once mentioned that you should not use privacy concerning apps as much anyway and instead spend more time on things which matter. +* Have a primary phone, entirely based on free and open-source software. There will be probably no app collecting your personal data. Try to use the primary phone for all of your everyday activities and fall back to the proprietary phone only for particular use cases. Once there is decent hardware (with a decent camera) running Linux (such as Mobian, for example) available, I will consider a purchase. The only 3rd party which then will still be able to track you will be your network provider. You could start your own phone network, but that seems overkill. There is already the Pinephone and the Librem 5 running a real Linux (Android is Linux based, but it doesn't count as a real Linux for me). Still, I want to wait a bit longer for better hardware to be available (I want to have a good camera always with me). +* You could also add a tertiary phone to the mix, which you only use for work and nothing else. That one will be very likely a proprietary phone too. You only have to keep this one around when you are working or when you are on-call. + +I have been playing with other smartphone OS alternatives, especially with MeeGo (which has died already) and SailfishOS, too. Security and privacy seem to be significantly improved compared to an Android. As a matter of fact, I bought a cheap and used Sony Xperia XA2 last year and installed SailfishOS on it. It's a nice toy, but it's still not the holy open-source grail as there are also proprietary parts in SailfishOS. Platforms such as Mobian, Ubuntu Touch and Plasma Mobile are more compelling to me. People must explore alternatives to Android and Apple here, as otherwise, you won't own any gadgets anymore: + +=> https://news.slashdot.org/story/21/07/10/0120236/by-2030-you-wont-own-any-gadgets + +Anyhow, any gadgets, including your phone, should be a tool you use. Don't let the phone use you! + +## The downside of being a nobody + +Be aware that it might be to your disadvantage if you manage to go completely under cover without anyone collecting data from you. Suppose you are a nobody on the web (no social media profiles, no tracking history, etc.). In that case, you aren't behaving like the mass, and therefore you are suspicious. So it might be even a good thing to leave your marks here and there once in a while. You aren't hiding anything anyway, correct? Just be mindful what you are sharing about yourself. I share personal things very rarely on Facebook for example. And I only share a small subset of my personal life on my personal homepage and this blog and on all of my social media accounts. Nobody is interested in what I have for breakfast anyway I guess. Write me an E-Mail if you are interested in what I am having for breakfast. + +## Mobile open-source OSes are still evolving + +You might have noticed that I wrote a lot about Smartphones in this article. The reason is that free and open-source software for Smartphones is still evolving. In contrast, for Laptops and Desktop PCs, it's already there. There is no reason to use proprietary operating systems such as Windows or macOS on your computers unless your employer forces you to use one of these. Why would they force you? It has to do with standardization again. The IT department only can manage so many platforms. It wouldn't be manageable by IT if every employee would install their own Linux distribution or one of the *BSDs. That might work for small startups but not for larger companies, especially not for a security-focused companies. + +I would love a standardized Linux at work, though. Dell and Lenovo also officially support Linux on their notebooks. The culprit may be knowledgeable IT staff maintaining and giving support to the Desktop Linux users. Not all colleagues are Linux geeks like you and me. I am using macOS for work, but I am not an Apple expert. Occasionally I have to contact IT support regarding some issues I have. I don't use the macOS GUI a lot; I mainly live in the terminal so I can run the same tools I also use on Linux. + +## Conclusion + +Should you be pedantic about open-source software? It depends. It depends on your fundamental values and how much time you are ready to invest. Open-source software is not just free as in money, but also free as in freedom. You will gain back complete control of your personal data. Unfortunately, installing ready proprietary apps from the Play Store is much more convenient than building up a trustworthy open-source-based infrastructure by yourself. As a guideline, use proprietary software and services with caution. Be mindful about your choices and where you leave your digital fingerprints. In doubt, think less is more. Do you really need this new shiny app? What benefit does it provide to you? Probably you don't really need that shiny new app. + +You have better chances when you know how to manage your own server and install and manage alternatives to the big cloud providers by yourself. I have the advantage that I have work experience as a Linux Systems Administrator here. I mentioned NextCloud already. I use NextCloud for online photo and file storage, contact and calendar sync and as an RSS news feed server. You could do the same with your own E-Mail server, you can also host your own website and blog. I also mentioned Matrix as a Skype alternative (which could also be an alternative to WhatsApp, Skype, Telegram, Viber, ...). I don't know a lot about Matrix yet, but it seems to be a very neat alternative. I am ready to invest time in it as one of my future personal pet projects. Not only because I think it's better, but also because for fun and as a hobby. But this doesn't mean that I invest *all* of my personal free time in it. + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2021-09-12-keep-it-simple-and-stupid.gmi b/gemfeed/2021-09-12-keep-it-simple-and-stupid.gmi index 834c4020..0796ddfc 100644 --- a/gemfeed/2021-09-12-keep-it-simple-and-stupid.gmi +++ b/gemfeed/2021-09-12-keep-it-simple-and-stupid.gmi @@ -2,6 +2,8 @@ > Published at 2021-09-12T09:39:20+03:00; Updated at 2023-03-23 +A robust computer system must be kept simple and stupid (KISS). The fancier the system is, the more can break. Unfortunately, most systems tend to become complex and challenging to maintain in today's world. In the early days, so I was told, engineers understood every part of the system, but nowadays, we see more of the "lasagna" stack. One layer or framework is built on top of another layer, and in the end, nobody has got a clue what's going on. + ``` _______________ |*\_/*|_______ | ___________ | .-. .-. ||_/-\_|______ | @@ -17,25 +19,40 @@ -------------------- -------------------- ``` -A robust computer system must be kept simple and stupid (KISS). The fancier the system is, the more can break. Unfortunately, most systems tend to become complex and challenging to maintain in today's world. In the early days, so I was told, engineers understood every part of the system, but nowadays, we see more of the "lasagna" stack. One layer or framework is built on top of another layer, and in the end, nobody has got a clue what's going on. - -# Need faster hardware +## Table of Contents + +* ⇢ Keep it simple and stupid +* ⇢ ⇢ Need faster hardware +* ⇢ ⇢ Too complex to be replaced +* ⇢ ⇢ ⇢ On COBOL +* ⇢ ⇢ ⇢ On Kubernetes +* ⇢ ⇢ ⇢ The younger generation of IT professionals +* ⇢ ⇢ The bloated web +* ⇢ ⇢ Fancy log-management solutions +* ⇢ ⇢ More KISS +* ⇢ ⇢ ⇢ The Adslowbe PDF Reader +* ⇢ ⇢ ⇢ The power of plain text files +* ⇢ ⇢ ⇢ KISS for programmers +* ⇢ ⇢ When KISS is not KISS anymore +* ⇢ ⇢ Other relevant readings + +## Need faster hardware This not just makes the system much more complex, difficult to maintain and challenging to troubleshoot, but also slow. So more experts are needed to support it. Also, newer and faster hardware is required to make it run smoothly. Often, it's so much easier to buy speedier hardware than rewrite a whole system from scratch from the bottom-up. The latter would require much more resources in the short run, but in the long run, it should pay off. Unfortunately, many project owners scare away from it as they only want to get their project done and then move on. -# Too complex to be replaced +## Too complex to be replaced -## On COBOL +### On COBOL Have a look at COBOL, a prevalent programming language of the past. No one is learning COBOL in college or university anymore, but many legacy systems still require COBOL experts. Why is this? It's just too scary to write everything from scratch. There's too much COBOL code out there that can't be replaced from today to tomorrow. => https://nymag.com/intelligencer/2020/04/what-is-cobol-what-does-it-have-to-do-with-the-coronavirus.html -## On Kubernetes +### On Kubernetes Now have a look at Kubernetes (k8s), the current trendy infrastructure thing to use nowadays. Of course, there are many benefits of using k8s (auto-scaling, reproducible deployments, dynamic resource allocation and resource sharing, saving of hardware costs, good commercial for potential employees as it is the current hot sauce of infrastructure). But all of this also comes with costs: You need experts operating the k8s cluster (or you need to pay extra for a managed cluster in the cloud), increased complexity of the system (k8s comes with a steep learning curve). The latter not only applies to the engineers managing the k8s cluster - it also applies to the software engineers, who now have to develop 'cloud native' applications and, therefore, have to change how they developed software how they used to. They all need to be re-educated on what cloud-native means, and they also need to understand the key concepts of k8s for writing optimal software for it. -## The younger generation of IT professionals +### The younger generation of IT professionals Maybe the younger generation knows all of this already after graduation, but then they are missing other critical parts of the system for sure. I have seen engineers who knew about containers and how to configure resource restrictions for a Docker container managed via k8s but have never heard the terms Linux control groups and Linux namespaces. So obviously, there is some knowledge gap of the underlying architecture. This can be a big problem when you have to troubleshoot such a system during a production incident and k8s adds a lot of abstraction to the mix which doesn't make it easier. @@ -51,7 +68,7 @@ And here is something to smile about: => https://christine.website/blog/theres-a-node-2021-10-02 -# The bloated web +## The bloated web Another example is the modern web. Have you ever wondered why the internet becomes slower and slower nowadays? The modern web is so much like lasagna that I decided to use Gemini to be the primary protocol of my website. The HTML version of this website is just a fallback as many visitors don't know what Gemini is and don't have any compatible software installed for surfing the Geminispace: @@ -59,7 +76,7 @@ Another example is the modern web. Have you ever wondered why the internet becom The Gemtext protocol is KISS. There's no way to do other formattings than headings, links, paragraphs, lists, quotes, and bare text blocks (e.g., ASCII art or code snippets). There's no way to create bloated Gemini sites, and due to its limited capabilities, there's also no way to commercialise it (e.g. there's no good way to track the site visitors as things like cookies don't exist). By design, the Gemini protocol can't be extended, so there is no chance to abuse it even in the future. Gemini sites will stay KISS forever, and there won't be any fancy HTML/JavaScript frameworks like we see on the modern web. -# Fancy log-management solutions +## Fancy log-management solutions Yet another example I want to bring up is DTail, the distributed log tail program I wrote. There are many great and fancy log-management solutions available to choose from, and they all seem complex to set up and maintain. The ELK stack, for example, requires you to operate an ElasticSearch cluster (or multiple, if you are geo-redundant), Logstash (different configurations and instances, depending on your infrastructure) and a Kibana web-frontend (which also needs to be highly available). I have operated ElasticSearch clusters on multiple occasions, and I must say that it is not an easy task to optimise it for the particular workload you might encounter. I also have seen many ES clusters operated by other people, and I have seen these clusters failing a lot (so it's not just me). The reduced complexity of DTail also makes it more robust against outages. You won't troubleshoot your distributed application very well if the log management infrastructure isn't working either. @@ -67,23 +84,23 @@ Yet another example I want to bring up is DTail, the distributed log tail progra I don't say that the ELK stack doesn't work, but it requires experts and additional hardware resources to support it. But instead, if you keep your infrastructure simple (e.g. only use DTail), it will maintain pretty much by itself. -# More KISS +## More KISS -## The Adslowbe PDF Reader +### The Adslowbe PDF Reader Another perfect example is the Adobe PDF reader. How can it be that the inventor of the PDF format creates such a terrible user experience with its official reader? The reader is awful bloated, and slow. There are much better alternatives around (especially for Linux and other UNIX like operating systems, look at Zathura for example). I believe the reason Adobe's reader is like this is featuritis, and 90% of the users don't use 90% of all available features. Less is more; keep it simple and stupid. -## The power of plain text files +### The power of plain text files Speaking of file formats, never underestimate the power of plain text files. Plain text files don't require any special software to be opened, and they outlive the software which created them in the first place. You will still be able to read a plain text file on a modern computer system ten (or twenty) years from now, but you probably won't be able to read such an old version of an Adobe Photoshop image file if the software required for reading that format isn't supported anymore and doesn't run anymore on modern computers. -## KISS for programmers +### KISS for programmers Not to mention, keeping things simple and stupid also reduces the potential malicious attack surface. It's not just about the software and services you use and operate. It's also about the software you write. Here is a nice article about the KISS principle in software development: => https://thevaluable.dev/kiss-principle-explained/ -# When KISS is not KISS anymore +## When KISS is not KISS anymore There is, however, a trap. The more you spend time with things, the more these things feel natural to you and you become an expert. The more you become an expert, the more you introduce more abstractions and other clever ways of doing things. For you, things seem to be KISS still, but another person may not be an expert and might not understand what you do. One of the fundamental challenges is to keep things really KISS. You might add abstraction upon abstraction to a system and don't even notice it until it is too late. @@ -98,10 +115,10 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other KISS-related posts are: -=> ./2021-09-12-keep-it-simple-and-stupid.gmi 2021-09-12 Keep it simple and stupid (You are currently reading this) -=> ./2023-06-01-kiss-server-monitoring-with-gogios.gmi 2023-06-01 KISS server monitoring with Gogios -=> ./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.gmi 2023-10-29 KISS static web photo albums with `photoalbum.sh` => ./2024-04-01-KISS-high-availability-with-OpenBSD.gmi 2024-04-01 KISS high-availability with OpenBSD +=> ./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.gmi 2023-10-29 KISS static web photo albums with `photoalbum.sh` +=> ./2023-06-01-kiss-server-monitoring-with-gogios.gmi 2023-06-01 KISS server monitoring with Gogios +=> ./2021-09-12-keep-it-simple-and-stupid.gmi 2021-09-12 Keep it simple and stupid (You are currently reading this) > Controversially, a lack of features is a feature. Enjoy your peace an quiet. - Michael W Lucas diff --git a/gemfeed/2021-09-12-keep-it-simple-and-stupid.gmi.tpl b/gemfeed/2021-09-12-keep-it-simple-and-stupid.gmi.tpl index 753587bf..dcec5dd7 100644 --- a/gemfeed/2021-09-12-keep-it-simple-and-stupid.gmi.tpl +++ b/gemfeed/2021-09-12-keep-it-simple-and-stupid.gmi.tpl @@ -2,6 +2,8 @@ > Published at 2021-09-12T09:39:20+03:00; Updated at 2023-03-23 +A robust computer system must be kept simple and stupid (KISS). The fancier the system is, the more can break. Unfortunately, most systems tend to become complex and challenging to maintain in today's world. In the early days, so I was told, engineers understood every part of the system, but nowadays, we see more of the "lasagna" stack. One layer or framework is built on top of another layer, and in the end, nobody has got a clue what's going on. + ``` _______________ |*\_/*|_______ | ___________ | .-. .-. ||_/-\_|______ | @@ -17,25 +19,25 @@ -------------------- -------------------- ``` -A robust computer system must be kept simple and stupid (KISS). The fancier the system is, the more can break. Unfortunately, most systems tend to become complex and challenging to maintain in today's world. In the early days, so I was told, engineers understood every part of the system, but nowadays, we see more of the "lasagna" stack. One layer or framework is built on top of another layer, and in the end, nobody has got a clue what's going on. +<< template::inline::toc -# Need faster hardware +## Need faster hardware This not just makes the system much more complex, difficult to maintain and challenging to troubleshoot, but also slow. So more experts are needed to support it. Also, newer and faster hardware is required to make it run smoothly. Often, it's so much easier to buy speedier hardware than rewrite a whole system from scratch from the bottom-up. The latter would require much more resources in the short run, but in the long run, it should pay off. Unfortunately, many project owners scare away from it as they only want to get their project done and then move on. -# Too complex to be replaced +## Too complex to be replaced -## On COBOL +### On COBOL Have a look at COBOL, a prevalent programming language of the past. No one is learning COBOL in college or university anymore, but many legacy systems still require COBOL experts. Why is this? It's just too scary to write everything from scratch. There's too much COBOL code out there that can't be replaced from today to tomorrow. => https://nymag.com/intelligencer/2020/04/what-is-cobol-what-does-it-have-to-do-with-the-coronavirus.html -## On Kubernetes +### On Kubernetes Now have a look at Kubernetes (k8s), the current trendy infrastructure thing to use nowadays. Of course, there are many benefits of using k8s (auto-scaling, reproducible deployments, dynamic resource allocation and resource sharing, saving of hardware costs, good commercial for potential employees as it is the current hot sauce of infrastructure). But all of this also comes with costs: You need experts operating the k8s cluster (or you need to pay extra for a managed cluster in the cloud), increased complexity of the system (k8s comes with a steep learning curve). The latter not only applies to the engineers managing the k8s cluster - it also applies to the software engineers, who now have to develop 'cloud native' applications and, therefore, have to change how they developed software how they used to. They all need to be re-educated on what cloud-native means, and they also need to understand the key concepts of k8s for writing optimal software for it. -## The younger generation of IT professionals +### The younger generation of IT professionals Maybe the younger generation knows all of this already after graduation, but then they are missing other critical parts of the system for sure. I have seen engineers who knew about containers and how to configure resource restrictions for a Docker container managed via k8s but have never heard the terms Linux control groups and Linux namespaces. So obviously, there is some knowledge gap of the underlying architecture. This can be a big problem when you have to troubleshoot such a system during a production incident and k8s adds a lot of abstraction to the mix which doesn't make it easier. @@ -51,7 +53,7 @@ And here is something to smile about: => https://christine.website/blog/theres-a-node-2021-10-02 -# The bloated web +## The bloated web Another example is the modern web. Have you ever wondered why the internet becomes slower and slower nowadays? The modern web is so much like lasagna that I decided to use Gemini to be the primary protocol of my website. The HTML version of this website is just a fallback as many visitors don't know what Gemini is and don't have any compatible software installed for surfing the Geminispace: @@ -59,7 +61,7 @@ Another example is the modern web. Have you ever wondered why the internet becom The Gemtext protocol is KISS. There's no way to do other formattings than headings, links, paragraphs, lists, quotes, and bare text blocks (e.g., ASCII art or code snippets). There's no way to create bloated Gemini sites, and due to its limited capabilities, there's also no way to commercialise it (e.g. there's no good way to track the site visitors as things like cookies don't exist). By design, the Gemini protocol can't be extended, so there is no chance to abuse it even in the future. Gemini sites will stay KISS forever, and there won't be any fancy HTML/JavaScript frameworks like we see on the modern web. -# Fancy log-management solutions +## Fancy log-management solutions Yet another example I want to bring up is DTail, the distributed log tail program I wrote. There are many great and fancy log-management solutions available to choose from, and they all seem complex to set up and maintain. The ELK stack, for example, requires you to operate an ElasticSearch cluster (or multiple, if you are geo-redundant), Logstash (different configurations and instances, depending on your infrastructure) and a Kibana web-frontend (which also needs to be highly available). I have operated ElasticSearch clusters on multiple occasions, and I must say that it is not an easy task to optimise it for the particular workload you might encounter. I also have seen many ES clusters operated by other people, and I have seen these clusters failing a lot (so it's not just me). The reduced complexity of DTail also makes it more robust against outages. You won't troubleshoot your distributed application very well if the log management infrastructure isn't working either. @@ -67,23 +69,23 @@ Yet another example I want to bring up is DTail, the distributed log tail progra I don't say that the ELK stack doesn't work, but it requires experts and additional hardware resources to support it. But instead, if you keep your infrastructure simple (e.g. only use DTail), it will maintain pretty much by itself. -# More KISS +## More KISS -## The Adslowbe PDF Reader +### The Adslowbe PDF Reader Another perfect example is the Adobe PDF reader. How can it be that the inventor of the PDF format creates such a terrible user experience with its official reader? The reader is awful bloated, and slow. There are much better alternatives around (especially for Linux and other UNIX like operating systems, look at Zathura for example). I believe the reason Adobe's reader is like this is featuritis, and 90% of the users don't use 90% of all available features. Less is more; keep it simple and stupid. -## The power of plain text files +### The power of plain text files Speaking of file formats, never underestimate the power of plain text files. Plain text files don't require any special software to be opened, and they outlive the software which created them in the first place. You will still be able to read a plain text file on a modern computer system ten (or twenty) years from now, but you probably won't be able to read such an old version of an Adobe Photoshop image file if the software required for reading that format isn't supported anymore and doesn't run anymore on modern computers. -## KISS for programmers +### KISS for programmers Not to mention, keeping things simple and stupid also reduces the potential malicious attack surface. It's not just about the software and services you use and operate. It's also about the software you write. Here is a nice article about the KISS principle in software development: => https://thevaluable.dev/kiss-principle-explained/ -# When KISS is not KISS anymore +## When KISS is not KISS anymore There is, however, a trap. The more you spend time with things, the more these things feel natural to you and you become an expert. The more you become an expert, the more you introduce more abstractions and other clever ways of doing things. For you, things seem to be KISS still, but another person may not be an expert and might not understand what you do. One of the fundamental challenges is to keep things really KISS. You might add abstraction upon abstraction to a system and don't even notice it until it is too late. @@ -98,7 +100,7 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other KISS-related posts are: -<< template::inline::index kiss simple-and-stupid +<< template::inline::rindex kiss simple-and-stupid > Controversially, a lack of features is a feature. Enjoy your peace an quiet. - Michael W Lucas diff --git a/gemfeed/2021-10-22-defensive-devops.gmi b/gemfeed/2021-10-22-defensive-devops.gmi index af6274c3..4d62d188 100644 --- a/gemfeed/2021-10-22-defensive-devops.gmi +++ b/gemfeed/2021-10-22-defensive-devops.gmi @@ -2,6 +2,16 @@ > Published at 2021-10-22T10:02:46+03:00 +I have seen many different setups and infrastructures during my carreer. My roles always included front-line ad-hoc fire fighting production issues. This often involves identifying and fixing these under time pressure, without the comfort of 2-week-long SCRUM sprints and without an exhaustive QA process. I also wrote a lot of code (Bash, Ruby, Perl, Go, and a little Java), and I followed the typical software development process, but that did not always apply to critical production issues. + +Unfortunately, no system is 100% reliable, and you can never be prepared for a subset of the possible problem-space. IT infrastructures can be complex. Not even mentioning Kubernetes yet, a Microservice-based infrastructure can complicate things even further. You can take care of 99% of all potential problems by following all DevOps best practices. Those best practices are not the subject of this blog post; this post is about the sub 1% of the issues arising from nowhere you can't be prepared for. + +Is there a software bug in a production, even though the software passed QA (after all, it is challenging to reproduce production behaviour in an artificial testing environment) and the software didn't show any issues running in production until a special case came up just now after it got deployed to production a week ago? Are there multiple hardware failure happening which causes loss of service redundancy or data inaccessibility? Is the automation of external customers connected to our infrastructure putting unexpectedly extra pressure on your grid, driving higher latencies and putting the SLAs at risk? You bet the solution is: Sysadmins, SREs and DevOps Engineers to the rescue. + +You agree that fixing production issues this way is not proactive but rather reactive. I prefer to call it defensive, though, as you "defend" your system against a production issue. But, at the same time, you have to take a cautious (defensive) approach to fix it, as you don't want to make things worse. + +Over time, I have compiled a list of fire-fighting automation strategies, which I would like to share here. + ``` c=====e H @@ -12,15 +22,17 @@ ASCII Art by Clyde Watson ``` -I have seen many different setups and infrastructures during my carreer. My roles always included front-line ad-hoc fire fighting production issues. This often involves identifying and fixing these under time pressure, without the comfort of 2-week-long SCRUM sprints and without an exhaustive QA process. I also wrote a lot of code (Bash, Ruby, Perl, Go, and a little Java), and I followed the typical software development process, but that did not always apply to critical production issues. - -Unfortunately, no system is 100% reliable, and you can never be prepared for a subset of the possible problem-space. IT infrastructures can be complex. Not even mentioning Kubernetes yet, a Microservice-based infrastructure can complicate things even further. You can take care of 99% of all potential problems by following all DevOps best practices. Those best practices are not the subject of this blog post; this post is about the sub 1% of the issues arising from nowhere you can't be prepared for. - -Is there a software bug in a production, even though the software passed QA (after all, it is challenging to reproduce production behaviour in an artificial testing environment) and the software didn't show any issues running in production until a special case came up just now after it got deployed to production a week ago? Are there multiple hardware failure happening which causes loss of service redundancy or data inaccessibility? Is the automation of external customers connected to our infrastructure putting unexpectedly extra pressure on your grid, driving higher latencies and putting the SLAs at risk? You bet the solution is: Sysadmins, SREs and DevOps Engineers to the rescue. - -You agree that fixing production issues this way is not proactive but rather reactive. I prefer to call it defensive, though, as you "defend" your system against a production issue. But, at the same time, you have to take a cautious (defensive) approach to fix it, as you don't want to make things worse. - -Over time, I have compiled a list of fire-fighting automation strategies, which I would like to share here. +## Table of Contents + +* ⇢ Defensive DevOps +* ⇢ ⇢ Meet Defensive DevOps +* ⇢ ⇢ Don't fully automate from the beginning +* ⇢ ⇢ Develop code directly on production systems +* ⇢ ⇢ ⇢ Don't make it worse +* ⇢ ⇢ Test your code +* ⇢ ⇢ Automation +* ⇢ ⇢ Out of office hours +* ⇢ ⇢ Retrospective ## Meet Defensive DevOps diff --git a/gemfeed/2021-10-22-defensive-devops.gmi.tpl b/gemfeed/2021-10-22-defensive-devops.gmi.tpl new file mode 100644 index 00000000..96237193 --- /dev/null +++ b/gemfeed/2021-10-22-defensive-devops.gmi.tpl @@ -0,0 +1,106 @@ +# Defensive DevOps + +> Published at 2021-10-22T10:02:46+03:00 + +I have seen many different setups and infrastructures during my carreer. My roles always included front-line ad-hoc fire fighting production issues. This often involves identifying and fixing these under time pressure, without the comfort of 2-week-long SCRUM sprints and without an exhaustive QA process. I also wrote a lot of code (Bash, Ruby, Perl, Go, and a little Java), and I followed the typical software development process, but that did not always apply to critical production issues. + +Unfortunately, no system is 100% reliable, and you can never be prepared for a subset of the possible problem-space. IT infrastructures can be complex. Not even mentioning Kubernetes yet, a Microservice-based infrastructure can complicate things even further. You can take care of 99% of all potential problems by following all DevOps best practices. Those best practices are not the subject of this blog post; this post is about the sub 1% of the issues arising from nowhere you can't be prepared for. + +Is there a software bug in a production, even though the software passed QA (after all, it is challenging to reproduce production behaviour in an artificial testing environment) and the software didn't show any issues running in production until a special case came up just now after it got deployed to production a week ago? Are there multiple hardware failure happening which causes loss of service redundancy or data inaccessibility? Is the automation of external customers connected to our infrastructure putting unexpectedly extra pressure on your grid, driving higher latencies and putting the SLAs at risk? You bet the solution is: Sysadmins, SREs and DevOps Engineers to the rescue. + +You agree that fixing production issues this way is not proactive but rather reactive. I prefer to call it defensive, though, as you "defend" your system against a production issue. But, at the same time, you have to take a cautious (defensive) approach to fix it, as you don't want to make things worse. + +Over time, I have compiled a list of fire-fighting automation strategies, which I would like to share here. + +``` + c=====e + H + ____________ _,,_H__ + (__((__((___() //| | + (__((__((___()()_____________________________________// |ACME | + (__((__((___()()()------------------------------------' |_____| + ASCII Art by Clyde Watson +``` + +<< template::inline::toc + +## Meet Defensive DevOps + +Defensive DevOps is a term I invented by myself. I define it this way: + +* It is the practice of automating production issues away ASAP as they appear. +* For rapid development, ignore most of the CI and QA best practices. +* Ignore the SCRUM process (if your team does SCRUM), as it will take too long to implement a solution. +* Be extremely careful (defensive) executing any fixing code in production, taking all failure scenarios into consideration and always have a rollback plan at hand. +* Still deliver a high-quality solution so that no customer will ever notice that there was an issue in the first place. + +That sounds a bit crazy, but this is, unfortunately, in rare occasions the reality. As the question is not whether production issues will happen, the question is WHEN they will happen. Every large provider, such as Google, Netflix, and so on, suffered significant outages before, and I firmly believe that their engineers know what they are doing. But you can prepare for the unexpected only to a certain degree. + +## Don't fully automate from the beginning + +Do you have to solve problem X? The best solution would be to fully automate it away, correct? No, the best way is to fix problem X manually first. Does the problem appear on one server or on thousand servers? The scale does not matter here. The point is that you should fix the problem at least once manually, so you understand the problem and how to solve it before implementing automation around it. + +You should also have a short meeting with your team. Every person may has a different perspective and can give valuable input for determining the best strategy. But, again, keep the session short and efficient. Focus on the facts. After all, you are the domain expert and you probably know what you are doing. + +Once you understand the problem, fix it on a different server again. This time maybe write a small program or script. Semi-automate the process, but don't fully automate it yet. Start the semi-automated solution manually on a couple of more servers and observe the result. You want to gain more confidence that this really solved the problem. This can take a couple of hours manually running it over and over again. During that process, you will improve your script iteratively. + +## Develop code directly on production systems + +You have to develop code directly on a production system. This sounds a bit controversial, but you want to get a working solution ASAP, and there is a very high chance that you can't reproduce problem X in a development or QA environment. Or at least it will consume significant effort and time to reproduce the problem, and by the time your code is ready, it's already too late. So the most practical solution is to directly develop your solution against a production system with the problem at hand. + +You might not have your full-featured IDE available on a production system, but a text editor, such as Vim (or Neovim), is sufficient for writing scripts. Some editors allow you to edit files remotely. With Vim you can accomplish it with "vim scp://SERVER///path/to/file.sh". Every time you save the file, it will be automatically uploaded via SCP to the server. From there, you can execute it directly. This comes with the additional benefits of still having access to all the Vim plugins installed locally, which you might not have installed on any production machines. This approach also removes any network delays you might experience when running your editor directly on a remote machine. + +Unfortunately, it will be a bit more complicated when you rely on code reviews (e.g. in a FIPS environment). Pair-programming could be the solution here. + +### Don't make it worse + +You want to triple-check that your script is not damaging your system even further. You might introduce a bug to the code, so there should always be a way to roll back any permanent change it causes. You have to program it in a defensive style: + +* Make sure that all that your script does is logged to a file. Best, when it's a Bash script, use "set -x". This makes the script print all commands as they are executed. Always write the output to a file. This helps to verify that your script is working as intended. The log output should always include timestamps for each significant operation performed. +* Make sure that no command executed by your script is failing. You should use "set -e" in your script, which makes the whole script terminate immediately if a command in it exits with a non-zero status. This will save you from apparent errors, e.g. trying to move files to a non-existent directory or trying to operate on a non-existent file. +* Your script should never delete any files. If solving problem X involves deleting files, don't delete them but rename or move them to a separate directory so that these can be recovered just in case. +* When you rename/move files around, always add a timestamp to a directory or the end of the file name (e.g. with "mv FILE FILE.$(date +%s"). This ensures that a backup never gets overwritten by another backup during a subsequential run of your script. Alternatively, before renaming a file, check whether the destination file already exists or not. +* When solving problem X involves manipulating files in place, be ultra-cautious. Best try to avoid in-place file manipulation. But if you really have to, you should, if disk space permits, always create a backup of the file first. Depending on the particular case, you might add a timestamp to the backup or only keep the very first initial backup of a file. +* You should implement a "--dry" switch in your script. When you run the script in dry mode, it won't manipulate anything on the system, but it would only print out what it would do. Always run your script in dry mode before running it for real. + +Furthermore, when you write Bash script, always run the tool ShellSheck (https://shellshock.io/) on it. This helps to catch many potential issues before applying it in production. + +## Test your code + +You probably won't have time for writing unit tests. But what you can do is to pedantically test your code manually. But you have to do the testing on a production machine. So how can you test your code in production without causing more damage? + +Your script should be idempotent. This means you can run it infinite times in a row, and you will always get the same result. For example, in the first run of the script, a file A get's renamed to A.backup. The second time you run the script, it attempts to do the same, but it recognises that A has already been renamed to A.backup and then it is skipping that step. This is very helpful for manually testing, as it means that you can re-run the script every time you extended it. You should dry-run the script at least once before running it for real. You can apply the same principle for almost all features you add to the code. + +You may also want to inject manual negative testing into your script. For example, you want to run a particular function F in your script but only if a certain pre-condition is met, and you want to ensure that the code branching works as expected. The pre-condition check could be pretty complex (e.g. N log messages containing a specific warning string are found in the applications logs, but only on the cluster leader server). You can flip the switch directly in the code manually (e.g. run F only, when the pre-condition isn't met) and then perform a dry run of the script and study the output. Once done, flip the switch back to its correct configuration. For double insurance, test the same on a different server type (e.g. on a follower and not on a leader system). + +By following these principles, you test every line of code while you are developing on it. + +## Automation + +At one point, you will be tired of manually running your script and also confident enough to automate it. You could deploy it with a configuration management system such as puppet Puppet and schedule a periodic execution via cron, a systemd timer or even a separate background daemon process. You have to be extremely careful here. The more you automate, the more damage you can cause. You don't want to automate it on all servers involved at once, but you want to slowly ramp up the automation. + +First, automate it only on one single server and monitor the result closely. At first, only automate running the script in dry mode. Also, don't forget that you still should log everything that the script is doing. Once everything looks fine, you can automate the script on the canary server for real. It shouldn't be a disaster if something goes wrong as usually systems are designed in a HA fashion, where the same data is still at least on another server available. In the worst-case scenario, you could recover data from there or from the local backup files your script created. + +Now, you can add a handful more canary servers to the automation. You should keep close attention to what the automation is doing. You could use a tool like DTail for distributed log file following. At this point, you could also think of deploying a monitoring check (e.g. Icinga) to see whether your script is not terminating abnormally or logging warnings or errors. + +=> ./2021-04-22-dtail-the-distributed-log-tail-program.gmi DTail - The distributed log tail program + +From there, you could automate the solution on more and more servers. Best, ramp up the automation to a handful of systems, and later to a whole line of servers (e.g. all secondary servers of a given cluster). And afterwards, automate it on all servers. + +Remember, whenever something goes wrong, you will have plenty of logs and backup files available. The disaster recovery would involve extending your script to take care of that too or writing a new script for rolling back the backups. + +## Out of office hours + +If possible, don't deploy any automation shortly before out of office hours, such as in the evening, before holidays or weekends. The only exception would be that you, or someone else, will be available to monitor the automation out of office hours. If it is a critical issue, someone, for example, the on-call person, could take over. Or ask your boss to work now but to take off another day to compensate. + +You should add an easy off-switch to your automation so that everyone from your team knows how to pause it if something goes wrong in order to adjust the automation accordingly. Of course, you should still follow all the principles mentioned in this blog post when making any changes. + +## Retrospective + +For every major incident, you need to follow up with an incident retrospective. A blame-free, detailed description of exactly what went wrong to cause the incident, along with a list of steps to take to prevent a similar incident from occurring again in the future. + +This usually means creating one or more tickets, which will be dealt with soon. Once the permanent fix is deployed, you can remove your ad-hoc automation and monitoring around it and focus on your regular work again. + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2021-11-29-bash-golf-part-1.gmi b/gemfeed/2021-11-29-bash-golf-part-1.gmi index ebb317d7..2f0eab35 100644 --- a/gemfeed/2021-11-29-bash-golf-part-1.gmi +++ b/gemfeed/2021-11-29-bash-golf-part-1.gmi @@ -2,6 +2,12 @@ > Published at 2021-11-29T14:06:14+00:00; Updated at 2022-01-05 +This is the first blog post about my Bash Golf series. This series is about random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content. + +=> ./2021-11-29-bash-golf-part-1.gmi 2021-11-29 Bash Golf Part 1 (You are currently reading this) +=> ./2022-01-01-bash-golf-part-2.gmi 2022-01-01 Bash Golf Part 2 +=> ./2023-12-10-bash-golf-part-3.gmi 2023-12-10 Bash Golf Part 3 + ``` '\ . . |>18>> @@ -14,11 +20,17 @@ jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Art by Joan Stark ``` -This is the first blog post about my Bash Golf series. This series is about random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content. +## Table of Contents -=> ./2021-11-29-bash-golf-part-1.gmi 2021-11-29 Bash Golf Part 1 (You are currently reading this) -=> ./2022-01-01-bash-golf-part-2.gmi 2022-01-01 Bash Golf Part 2 -=> ./2023-12-10-bash-golf-part-3.gmi 2023-12-10 Bash Golf Part 3 +* ⇢ Bash Golf Part 1 +* ⇢ ⇢ TCP/IP networking +* ⇢ ⇢ Process substitution +* ⇢ ⇢ Grouping +* ⇢ ⇢ Expansions +* ⇢ ⇢ - aka stdin and stdout placeholder +* ⇢ ⇢ Alternative argument passing +* ⇢ ⇢ : aka the null command +* ⇢ ⇢ (No) floating point support ## TCP/IP networking @@ -468,10 +480,10 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -=> ./2021-05-16-personal-bash-coding-style-guide.gmi 2021-05-16 Personal Bash coding style guide -=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all -=> ./2021-11-29-bash-golf-part-1.gmi 2021-11-29 Bash Golf Part 1 (You are currently reading this) -=> ./2022-01-01-bash-golf-part-2.gmi 2022-01-01 Bash Golf Part 2 => ./2023-12-10-bash-golf-part-3.gmi 2023-12-10 Bash Golf Part 3 +=> ./2022-01-01-bash-golf-part-2.gmi 2022-01-01 Bash Golf Part 2 +=> ./2021-11-29-bash-golf-part-1.gmi 2021-11-29 Bash Golf Part 1 (You are currently reading this) +=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all +=> ./2021-05-16-personal-bash-coding-style-guide.gmi 2021-05-16 Personal Bash coding style guide => ../ Back to the main site diff --git a/gemfeed/2021-11-29-bash-golf-part-1.gmi.tpl b/gemfeed/2021-11-29-bash-golf-part-1.gmi.tpl index 5b5885a4..5945835f 100644 --- a/gemfeed/2021-11-29-bash-golf-part-1.gmi.tpl +++ b/gemfeed/2021-11-29-bash-golf-part-1.gmi.tpl @@ -2,6 +2,10 @@ > Published at 2021-11-29T14:06:14+00:00; Updated at 2022-01-05 +This is the first blog post about my Bash Golf series. This series is about random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content. + +<< template::inline::index bash-golf + ``` '\ . . |>18>> @@ -14,9 +18,7 @@ jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Art by Joan Stark ``` -This is the first blog post about my Bash Golf series. This series is about random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content. - -<< template::inline::index bash-golf +<< template::inline::toc ## TCP/IP networking @@ -466,6 +468,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -<< template::inline::index bash +<< template::inline::rindex bash => ../ Back to the main site diff --git a/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.gmi b/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.gmi index 858c3982..e9ca9728 100644 --- a/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.gmi +++ b/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.gmi @@ -2,6 +2,12 @@ > Published at 2021-12-26T12:02:02+00:00; Updated at 2022-01-12 +Log4shell (CVE-2021-44228) made it clear, once again, that working in information technology is not an easy job (especially when you are a DevOps person). I thought it would be interesting to summarize a few techniques to help you to relax. + +(PS: When I mean DevOps, I also mean Site Reliability Engineers and Sysadmins. I believe SRE, DevOps Engineer and Sysadmin are just synonym titles for the same job). + +=> https://en.wikipedia.org/wiki/Log4Shell + ``` ) ) (( ( @@ -22,13 +28,25 @@ ||| \ __/_|| __||__ -----||-/------`-._/||-o--o---o--- ~~~~~' -``` - -Log4shell (CVE-2021-44228) made it clear, once again, that working in information technology is not an easy job (especially when you are a DevOps person). I thought it would be interesting to summarize a few techniques to help you to relax. - -(PS: When I mean DevOps, I also mean Site Reliability Engineers and Sysadmins. I believe SRE, DevOps Engineer and Sysadmin are just synonym titles for the same job). - -=> https://en.wikipedia.org/wiki/Log4Shell +``` + +## Table of Contents + +* ⇢ How to stay sane as a DevOps person +* ⇢ ⇢ Set clear expectations +* ⇢ ⇢ Always respond to requests but set expectations and boundaries +* ⇢ ⇢ ⇢ Dealing with requests +* ⇢ ⇢ ⇢ Escalation is only a tool +* ⇢ ⇢ Think positively +* ⇢ ⇢ Go slower even if you could go faster +* ⇢ ⇢ ⇢ You work in a team +* ⇢ ⇢ ⇢ Don't rush +* ⇢ ⇢ You are not a superhero +* ⇢ ⇢ ⇢ Give away some of your superpowers +* ⇢ ⇢ Don't jump on all problems immediately +* ⇢ ⇢ Force breaks; and shutdown now +* ⇢ ⇢ Block time every day for personal advance +* ⇢ ⇢ More ## Set clear expectations diff --git a/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.gmi.tpl b/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.gmi.tpl new file mode 100644 index 00000000..394c8d6a --- /dev/null +++ b/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.gmi.tpl @@ -0,0 +1,130 @@ +# How to stay sane as a DevOps person + +> Published at 2021-12-26T12:02:02+00:00; Updated at 2022-01-12 + +Log4shell (CVE-2021-44228) made it clear, once again, that working in information technology is not an easy job (especially when you are a DevOps person). I thought it would be interesting to summarize a few techniques to help you to relax. + +(PS: When I mean DevOps, I also mean Site Reliability Engineers and Sysadmins. I believe SRE, DevOps Engineer and Sysadmin are just synonym titles for the same job). + +=> https://en.wikipedia.org/wiki/Log4Shell + +``` + ) + ) (( ( + ( )) ) + ) ) // ( + _ ( __ ( ~->> + ,-----' |__,_~~___<'__`)-~__--__-~->> < + | // : | -__ ~__ o)____)),__ - '> >- > + | // : |- \_ \ -\_\ -\ \ \ ~\_ \ ->> - , >> + | // : |_~_\ -\__\ \~'\ \ \, \__ . -<- >> + `-----._| ` -__`-- - ~~ -- ` --~> > + _/___\_ //)_`// | ||] + _____[_______]_[~~-_ (.L_/ || + [____________________]' `\_,/'/ + ||| / ||| ,___,'./ + ||| \ |||,'______| + ||| / /|| I==|| + ||| \ __/_|| __||__ +-----||-/------`-._/||-o--o---o--- + ~~~~~' +``` + +<< template::inline::toc + +## Set clear expectations + +It's important to set clear expectations. It can be difficult to guess what others expect or don't expect from you. If you know exactly what you are supposed to do, you can work towards a specific goal and don't worry about all the other noise so much. + +However, if you are in a more senior position, it is expected from you to plan your tasks by yourself to a large degree and also be flexible, so you can react quickly to new situations (e.g. resolving incidents). Also, to a large degree, you have to prioritise your work by yourself. This can overthrow all of your plans. In extreme cases, it can help to share your plans with your team so that everyone is on the same page. Afterwards, be the execution machine. People are happy when they see that stuff gets done. Communicate clearly all critical work you do. This will capture all the technical debt there might be. It does not help in the long run if things are fixed in the background without any visibility. + +Due to politeness, many people are not setting clear expectations. I personally may sound sometimes "too German" when setting expectations, but so far nobody complained, and I have even received positive feedback about it. + +## Always respond to requests but set expectations and boundaries + +There are many temptations to get side-tracked by other projects and/or issues. It is important to set boundaries here. But always answer to all requests as nothing is more frustrating than asking a person and never getting any answer back. This is especially the case when everyone is working form home where people are using tools such as Slack and E-Mail for most of their communications. + +### Dealing with requests + +If the request is urgent, and you have the capacity to help, probably you should help. If it's not urgent, maybe ask to pospone the request (e.g. ask to create a ticket, so that someone from your team can work on it later). + +If the request is urgent, but you don't have the knowledge or the capacity to help, try to defer to a colleague who might be able to help. You could also provide some quick tips and hints, so that the requester can resolve the issue by himself. Make it transparent why you might not have the time right now, as this can help the person to review his own priorities or to escalate. + +### Escalation is only a tool + +Never make or take an escalation personally. The only forms of escalation should be due to technical issues or lack of resources. An escalation then becomes like a math equation and does not need human resources involved. So de-facto, an escalation is nothing negative, but just a process people can follow to form decision-making. In a good company escalations tend to be an exception, though. Staff knows how to deal with the things by themselves without bothering management too much. + +## Think positively + +If times are very stressful, think that it could always be worse: + +* Nobody is dying, we are only doing some IT stuff. +* Your time after work is your own time, look forward to time with your family or a nice dinner or your favourite sports class. +* You probably will never run out of work in the IT sector. So you will always be able to make a living. +* Your IT job and life is actually pretty good (compared to a homeless person for example). You are probably part of the world's top 1% regarding life standard. + +## Go slower even if you could go faster + +When working in a team, you may feel that you could get done things faster when you just did everything by yourself. This can be a bit frustrating at times, as you might need to work late hours and also might need to explain things over and over again to others. Also, you could be the one who needs to get things explained over and over again as you are not so familiar with the topic (yet). You will appreciate it if the other person is slowing down for you a bit. + +### You work in a team + +Security is a team sport. So slow down and make sure that everyone is on track with the goals. You can go full-speed with your very own subtasks, though. Not everyone knows how to use all the tools so well like a full-time DevOps person. As a DevOps person, you are not a security expert, though. Security experts are different people in your company, but DevOps will be the main tribe deploying mitigations (following the security recommendations) and management will be the main tribe coordinating all the efforts. + +So even if you think that you can do everything faster by your own, can you really? You probably don't know what you don't know about IT security. The more you know about it, the more you know about what you don't know. + +### Don't rush + +Slowing down also helps to prevent errors. Don't rush your tasks, even if they are urgent. Try to be quick, but don't rush them. Maybe you are writing a script to mitigate a production issue. You could others peer review that script, for example. Their primary programming language may not be the same (e.g. Golang vs Perl), but they would understand the logic. Or ask another DevOps person from your company with good scripting skills review your mitigation, but he then may lack the domain knowledge of the software you are patching. So in either case, the review will take a bit longer as the reviewer might not be an expert in everything. + +So relax, don't always expect immediate results. Set clear and reasonable timelines for the management about the mitigations. You are not a superhero who has to do everything by yourself. Sometimes, you will miss a deadline. But that will have good reasons. Don't rush to complete just to meet a deadline. + +=> ./2021-10-22-defensive-devops.gmi Read also "Defensive DevOps" about deploying mitigation scripts. + +## You are not a superhero + +Always keep that in mind. You can't solve all problems by your own. Maybe you could, but that would be a lot of additional stress (and this will reflect to your personal life). Also, Superman and Wonder Woman receive much higher salaries than you will ever do ;-). + +I have been a superhero multiple times mitigating critical incidents, and I was proud about it in those moments. But actually, I am not proud looking at those retrospectively as for everything there should be other people around who should be able to resolve an incident. No company should rely on a single person, there must always be a substitute. You are not a superhero and as harsh as it sounds, everyone is replaceable. Every superhero can be replaced with another superhero. The only thing it takes to become a superhero is time to get to know the infrastructure and tools very well, paired with work dedication. + +This doesn't mean, that you shouldn't try your best. But you don't need to try to be the superhero. Maybe someone else will be the superhero, but that's OK as long as it's not always the same person every time. Everyone can have a good day after all. If I could choose between being a superhero or having a good night sleep, I would probably prefer the sleep. + +### Give away some of your superpowers + +If you are a superhero, try to give away some of your superpowers, so that you can relax in the evening knowing that others (e.g. the current on-call engineers) know how to tackle things. Every member of the team needs to do DevOps (even the team managers, in my humble opinion). Some may be less experienced than others or have other expertises, but to counteract this you could document the recurring tasks so that they are easy to follow (which then later could be either automated away or, even better, fully fixed). + +On the other side, if you are a DevOps person, try to sneak into other people's shoes too. For example, you might not be an expert in Java programming, but a lot of the infrastructure is programmed in Java. This is where usually the Software Developers and Engineers shine. But if you know how to read, debug and even extend Java code too (by learning from the Software Developer superheroes), then your will only benefit from it. + +So you are not a superhero. Or, if you are a superhero, then all colleagues should be superheroes too. + +## Don't jump on all problems immediately + +In a perfect world, every member of a team comes along with the same strengths and skills. But in reality, everyone is different. + +In order to distribute the troubleshooting skills across the team, you should not jump on every problem immediately. Leave some space for others to resolve the issue. This is where the best learning happens. Nobody will learn from you when you solve all problems. People might learn something after you explained what you did, but the takeaways will be minimal compared to when people try to resolve issues by themselves. Always be available for questions which will help your colleagues to steer into the right direction and if you think it helps, give them some tips resolving the issue, even if they didn't ask for it. Sometimes, engineers are too proud to ask. + +The whole paragraph changes when there is an issue you don't know how to resolve. Jump on it, so you can learn from it. But also ask for advice if you are unsure about it. + +If the issue is a very critical one, then you might better off trying to resolve it as fast as possible with your full powers in order to avoid any major damage to the company. This, of course, only works if you know how to resolve it quickly. So, don't leave others with not much experience yet looking at it. If possible, work with the team to resolve the issue. Unfortunately, solving it with the team is not always the fastest way. So in this particular circumstance, the company may be better off being saved by a single superhero. Make sure that the problem will not occur again or, at least, that others can fix it the next time without Superman flying by. + +## Force breaks; and shutdown now + +Be strict about your time off. Nowadays, tech workers check their messages also out of office hours and are reachable 24/7. This really should only be the case when you are on-call, to be honest (or if you work for a startup). All other out-of-office time is owned by you and not your employer. You have signed an 40 hour/week and not 7 days/week contract. Of course, there will be always some sort of flexibility and exceptions. You might need to work over the weekend to get a migration done or a problem solved. But to balance it out, you should have other days off as substitutes. + +It's important to shut down your brain from work during your breaks (be strict with your breaks, leave your desk for lunch or for a walk early afternoon and if you aren't on-call also don't take your work-phone with you). You will be happier and also much more energized and productive in the afternoon. Also, when you are reachable 24/7, your colleagues will start thinking that you don't have anything more important to do than work. + +## Block time every day for personal advance + +It does not matter how many tasks are in your backlog or how many issues are to be tackled. *Always* find time for personal advance. The most issues aren't critical anyway and can wait a bit. At the end of the day, you will have a nice feeling that you have accomplished something meaningful. This can be an interesting project or learning a new technology you are interested in. Of course, there must be consensus with your manager (unless you do that kind of thing in your personal time of course). + +If you are too busy at work and just can't block time, then maybe it's time to think about alternatives. But before you do that, probably there is something else you can do. Perhaps you just think you can't block time, but you would be positively surprised to hear from your manager that he will fully support you. Of course, he won't agree to you working full-time on your pet projects. But a certain portion of your time should be allocated for personal advance. After all, your employer also want's you to stay happy so that you don't look for alternatives. It's of everyone's interest that you like your job and stay motivated. The more you are motivated, the more productive you are. The more productive you are, the more valuable you are for the company. + +## More + +Another blog post worth reading: + +=> https://unixsheikh.com/articles/how-to-stay-sane-in-todays-world-of-tech.html + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2022-01-01-bash-golf-part-2.gmi b/gemfeed/2022-01-01-bash-golf-part-2.gmi index 2fc2d2be..5fc23c32 100644 --- a/gemfeed/2022-01-01-bash-golf-part-2.gmi +++ b/gemfeed/2022-01-01-bash-golf-part-2.gmi @@ -2,6 +2,12 @@ > Published at 2022-01-01T23:36:15+00:00; Updated at 2022-01-05 +This is the second blog post about my Bash Golf series. This series is random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content. + +=> ./2021-11-29-bash-golf-part-1.gmi 2021-11-29 Bash Golf Part 1 +=> ./2022-01-01-bash-golf-part-2.gmi 2022-01-01 Bash Golf Part 2 (You are currently reading this) +=> ./2023-12-10-bash-golf-part-3.gmi 2023-12-10 Bash Golf Part 3 + ``` '\ '\ . . |>18>> @@ -14,11 +20,16 @@ jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Art by Joan Stark, mod. by Paul Buetow ``` -This is the second blog post about my Bash Golf series. This series is random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content. +## Table of Contents -=> ./2021-11-29-bash-golf-part-1.gmi 2021-11-29 Bash Golf Part 1 -=> ./2022-01-01-bash-golf-part-2.gmi 2022-01-01 Bash Golf Part 2 (You are currently reading this) -=> ./2023-12-10-bash-golf-part-3.gmi 2023-12-10 Bash Golf Part 3 +* ⇢ Bash Golf Part 2 +* ⇢ ⇢ Redirection +* ⇢ ⇢ HERE +* ⇢ ⇢ RANDOM +* ⇢ ⇢ set -x and set -e and pipefile +* ⇢ ⇢ ⇢ -x +* ⇢ ⇢ ⇢ -e +* ⇢ ⇢ ⇢ pipefail ## Redirection @@ -487,10 +498,10 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -=> ./2021-05-16-personal-bash-coding-style-guide.gmi 2021-05-16 Personal Bash coding style guide -=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all -=> ./2021-11-29-bash-golf-part-1.gmi 2021-11-29 Bash Golf Part 1 -=> ./2022-01-01-bash-golf-part-2.gmi 2022-01-01 Bash Golf Part 2 (You are currently reading this) => ./2023-12-10-bash-golf-part-3.gmi 2023-12-10 Bash Golf Part 3 +=> ./2022-01-01-bash-golf-part-2.gmi 2022-01-01 Bash Golf Part 2 (You are currently reading this) +=> ./2021-11-29-bash-golf-part-1.gmi 2021-11-29 Bash Golf Part 1 +=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all +=> ./2021-05-16-personal-bash-coding-style-guide.gmi 2021-05-16 Personal Bash coding style guide => ../ Back to the main site diff --git a/gemfeed/2022-01-01-bash-golf-part-2.gmi.tpl b/gemfeed/2022-01-01-bash-golf-part-2.gmi.tpl index ec589a69..1938de51 100644 --- a/gemfeed/2022-01-01-bash-golf-part-2.gmi.tpl +++ b/gemfeed/2022-01-01-bash-golf-part-2.gmi.tpl @@ -2,6 +2,10 @@ > Published at 2022-01-01T23:36:15+00:00; Updated at 2022-01-05 +This is the second blog post about my Bash Golf series. This series is random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content. + +<< template::inline::index bash-golf + ``` '\ '\ . . |>18>> @@ -14,9 +18,7 @@ jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Art by Joan Stark, mod. by Paul Buetow ``` -This is the second blog post about my Bash Golf series. This series is random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content. - -<< template::inline::index bash-golf +<< template::inline::toc ## Redirection @@ -485,6 +487,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -<< template::inline::index bash +<< template::inline::rindex bash => ../ Back to the main site diff --git a/gemfeed/2022-02-04-computer-operating-systems-i-use.gmi b/gemfeed/2022-02-04-computer-operating-systems-i-use.gmi index 7ad8b7d9..c55f00d3 100644 --- a/gemfeed/2022-02-04-computer-operating-systems-i-use.gmi +++ b/gemfeed/2022-02-04-computer-operating-systems-i-use.gmi @@ -2,6 +2,8 @@ > Published at 2022-02-04T09:58:22+00:00; Updated at 2022-02-18 +This is a list of Operating Systems I currently use. This list is in no particular order and also will be updated over time. The very first operating system I used was MS-DOS (mainly for games) and the very first Unix like operating system I used was SuSE Linux 5.3. My first smartphone OS was Symbian on a clunky Sony Ericsson device. + ``` /( )` \ \___ / | @@ -23,7 +25,29 @@ `--{__________) \/ "Berkeley Unix Daemon" ``` -This is a list of Operating Systems I currently use. This list is in no particular order and also will be updated over time. The very first operating system I used was MS-DOS (mainly for games) and the very first Unix like operating system I used was SuSE Linux 5.3. My first smartphone OS was Symbian on a clunky Sony Ericsson device. +## Table of Contents + +* ⇢ Computer operating systems I use(d) +* ⇢ ⇢ Fedora Linux +* ⇢ ⇢ EndeavourOS +* ⇢ ⇢ FreeBSD +* ⇢ ⇢ CentOS 7 +* ⇢ ⇢ OpenBSD +* ⇢ ⇢ macOS (proprietary) +* ⇢ ⇢ LineageOS (mobile) +* ⇢ ⇢ Samsung's Stock Android (mobile proprietary) +* ⇢ ⇢ iOS (mobile proprietary) +* ⇢ ⇢ Other OSes +* ⇢ ⇢ ⇢ InfinyTime (smartwatch) +* ⇢ ⇢ ⇢ motionEyeOS +* ⇢ ⇢ ⇢ Kobo OS (proprietary) +* ⇢ ⇢ ⇢ Android TV (proprietary) +* ⇢ ⇢ Other OSes.. +* ⇢ ⇢ ⇢ NetBSD +* ⇢ ⇢ ⇢ Other OSes in use... +* ⇢ ⇢ ⇢ Other OSes not used any more... +* ⇢ ⇢ ⇢ Other OSes I only had a glance at... +* ⇢ ⇢ ⇢ Other OSes which seem interesting... ## Fedora Linux diff --git a/gemfeed/2022-02-04-computer-operating-systems-i-use.gmi.tpl b/gemfeed/2022-02-04-computer-operating-systems-i-use.gmi.tpl new file mode 100644 index 00000000..14638c92 --- /dev/null +++ b/gemfeed/2022-02-04-computer-operating-systems-i-use.gmi.tpl @@ -0,0 +1,232 @@ +# Computer operating systems I use(d) + +> Published at 2022-02-04T09:58:22+00:00; Updated at 2022-02-18 + +This is a list of Operating Systems I currently use. This list is in no particular order and also will be updated over time. The very first operating system I used was MS-DOS (mainly for games) and the very first Unix like operating system I used was SuSE Linux 5.3. My first smartphone OS was Symbian on a clunky Sony Ericsson device. + +``` + /( )` + \ \___ / | + /- _ `-/ ' + (/\/ \ \ /\ + / / | ` \ + O O ) / | + `-^--'`< ' + (_.) _ ) / + `.___/` / + `-----' / + <----. __ / __ \ + <----|====O)))==) \) /==== + <----' `--' `.__,' \ + | | + \ / + ______( (_ / \______ + (FL) ,' ,-----' | \ + `--{__________) \/ "Berkeley Unix Daemon" +``` + +<< template::inline::toc + +## Fedora Linux + +Fedora Linux is the operating system I use on my primary (personal) laptop. It's a ThinkPad X1 Carbon Gen. 9. Lenovo which comes along with official Lenovo Linux support. I already noticed hardware firmware updates being installed directly through Fedora from Lenovo. Fedora is a real powerhouse, cutting-edge and reasonably stable at the same time. It's baked by Red Hat. + +I also use Fedora on my Microsoft Surface Go 2 convertible tablet. Fedora works quite OK (and much better than Windows) on this device. It's also the perfect travel companion. + +I use the GNOME Desktop on my Fedora boxes. I have memorized and customized a bunch of keyboard shortcuts. But the fact that I mostly work in the terminal (with tmux) makes the Desktop environment I use only secondary. + +## EndeavourOS + +I installed EndeavourOS on my (older) ThinkPad X240 to try out an Arch based Linux distribution. I also could have installed plain Arch, but I don't see the point when there is EndeavourOS. EndeavourOS is as close as you can get to the plain Arch experience but with an easy installer. I am not saying that it's difficult to install plain Arch but it's, unless you are new to Linux and want to learn about the installation procedure, just waste of time in my humble opinion. Give Linux From Scratch a shot instead if you really want to learn about Linux. + +=> https://www.linuxfromscratch.org/ + +On EndeavourOS, I use the Xfce desktop environment which feels very snappy and fast on the X240 (which I purchased back in 2014). Usually, I have my X240 standing right next to my work laptop and use it for playing music (mainly online radio streams), for personal note taking and occasional emailing and instant messaging. + +As this is a rolling Linux distribution there are a lot of software updates coming through every day. Sometimes, it only takes a minute until the next version of a package is available. Honestly, I find that a bit annoying to constantly catch up with all the updates. As for now I will live with it and/or automate it a bit more. It'll be OK if it breaks occasionally, as this is not my primary laptop anyway. + +Arch Linux and EndeavourOS are community distributions. This means, that there is no big corporation in the backyard lurking around. They won't give you the firmware updates for cutting edge hardware out of the box, though, but they are still a very good choice for hobbyist and also for older hardware where future firmware updates are less likely to happen. + +I am very happy with the package availability through the official repository and AUR. + +=> https://endeavouros.com/ + +## FreeBSD + +I have run FreeBSD in many occasions. Right after SuSE Linux, FreeBSD (around 4.x) was the second open source system I used in my life on regular basis. I didn't even go to university yet then I started using it :-). Also, a former employer of mine even allowed me to install FreeBSD on my main workstation (which I actually did and used it for a couple of years). + +I remember it used to be a pain bootstrapping Java for FreeBSD due to the lack of pre-compiled binary packages. You had first to enable the Linux compatibility layer, then install Linux Java, and then compile FreeBSD Java with the bootstrapped Linux Java (yes, Java is mainly programmed in C++, but for some reason compiling Java for FreeBSD also required an installation of Java). Nowadays, there are ready OpenJDK binary packages you could install. So things have improved a lot since. + +FreeBSD always had a place somewhere in my life: + +* On a Desktop PC (personal and work) +* On a Laptop +* On a webserver, FTP server, DNS server, mail server +* On a server offering FreeBSD jails to customers for rent +* As an experiment running Debian GNU/kFreeBSD inside of jails + +Debian GNU/kFreeBSD is now dead (same is my experiment)... + +=> https://www.debian.org/ports/kfreebsd-gnu/ + +...but I still have saved and old uname output :-): + +``` +[root@saturn /usr/jail/serv14/etc] # jexec 21 bash +root@rhea:/ # uname -a +GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 27 13:10:09 CET + 2010 root@saturn.buetow.org:/usr/obj/usr/srcs/freebsd.src8/src/sys/SERV10 x86 64 amd64 Intel(R) + Core(TM) i7 CPU 920 @ 2.67GHz GNU/kFreeBSD +``` + +Currently, I use FreeBSD on my personal NAS server. The server is a regular PC with a bunch of hard drives and a ZFS RAIDZ (with 4x2TB drives) + a couple of external backup drives. + +=> https://www.FreeBSD.org + +## CentOS 7 + +While CentOS 8 is already out of support, I still use CentOS 7 (which will receive security updates until 2024). CentOS 7 runs in a cloud VM and is the home to my personal NextCloud and Wallabag installations. You probably know already NextCloud. About Wallabag: It is a great free and open source alternative to Pocket (for reading articles from the web offline later). Yes, you can pay for a Wallabag subscription, but you can also host it for free on your own server. + +=> https://nextcloud.com NextCloud +=> https://www.wallabag.it/en Wallabag + +The reason I use Linux and not *BSD at the moment for these services is Docker. With Docker, it's so easy-peasy to get these up and running. I will have to switch to another OS before CentOS 7 runs out of support, though. It might be CentOS Stream, Rocky Linux, or, more likely, I will use FreeBSD. On FreeBSD there isn't Docker, but what can be done is to create a self-contained Jail for each of the web-apps. + +I have been using FreeBSD Jails for LAMP stacks before I started using CentOS. The reason why I switched to CentOS (it was still CentOS 6 at that time) in the first place was, that I wanted to try out something new. + +=> https://www.centos.org + +## OpenBSD + +I use two small OpenBSD "cloud" boxes for my "public facing internet front-ends". The services I run here are: + +* HTTP server (serving this site via https://foo.zone) +* Gemini server (serving this site via gemini://foo.zone) +* MTA server (for receiving E-Mails to my hosts) +* Authorative DNS server (for all of my "domains") +* Some personal/private git repositories (accessible only via SSH) + +OpenBSD is a complete operating system. I love it due to it's "simplicity" and "correctness" and the good documentation (I love the manual pages in particular). OpenBSD is also known for its innovations in security. I must admin, though, that most Unix like operating system would be secure enough for my personal needs and that I don't really need to use OpenBSD here. But nevertheless, I think it's the ideal operating system for what I am using it for. + +The only softwares which were not part of the base system and I had to install additionally were the Gemini server (vger) and Git, which both were available as pre-compiled OpenBSD binary packages. So, besides of these two packages, it is indeed a pretty complete operating system for my use case. + +=> https://www.openbsd.org + +## macOS (proprietary) + +I have to use a MacBook Pro with macOS for work. What else can I say but that this would have never been my personal choice. At least macOS is a UNIX under the hood and comes with a decent terminal and there are plenty of terminal apps available via Brew. Some of the inner workings of macOS were actually forked from the FreeBSD project. + +=> https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/BSD/BSD.html developer.apple.com: BSD in macOS/Darwin + +I find the macOS UI rather confusing. + +## LineageOS (mobile) + +At some point I got fed up with big tech, like Google and Samsung (or Apple, but personally I don't use Apple), spying on me. So I purchased a Google phone (a midrange Pixel phone) and installed LineageOS, a free and open source distribution of Android, on it. I don't have anything from Google installed on it (not even the play store, I install my apps from F-Droid). It's my daily driver since mid 2021 now. + +So far the experience is not great but good. The main culprits are not having Google Maps, Google Gboard and the camera app. The latter lacks some features on LineageOS (e.g. No wide angle lens support). Also, I can't use my banking apps anymore. Sometimes apps crash for no apparent reason(s) but I get around it so far. I shouldn't spend so much time on my smartphone anyway! And the whole point of switching to LineageOS was to get away of big tech and therefore I should not complain :-). What I do like is that 95% the things I used to do on a proprietary mobile phone also can be done with LineageOS. + +=> ./2021-08-01-on-being-pedantic-about-open-source.gmi Read also "The Midle Way" section of this blog post regarding smartphones. + +There's also the excellent Termux app in the F-Droid store, which transforms the phone into a small Linux handheld device. I am able to run all of my Linux/Unix terminal apps with it. + +=> https://lineageos.org/ +=> https://termux.com/ + +## Samsung's Stock Android (mobile proprietary) + +Unfortunatley, I still have to keep my proprietary Android phone around. Sometimes, I really need to use some proprietary apps which are only available form the Google play store and also require the Google services installed on the phone. I don't carry this phone around all the time and I only use it intentionally for very specific use cases. I think this is the best compromise I can make. + +## iOS (mobile proprietary) + +I have to use an iPhone for work. I like the hardware but I hate the OS (you can also call it spyOS), but it's the necessarries evil, unfortunately. Apple is even worse than Google here (despite claiming for themselves to produce the most secure phone(s)). I don't have it with me all the time or switched off when I don't need it. I also find iOS quite unintuitive to use. + +Being on-call for work means to to be reachable 24/7. This implies that the phone is carried around all the time (in an switched-on state). 1984 is now. +=> https://en.wikipedia.org/wiki/Nineteen_Eighty-Four + +## Other OSes + +### InfinyTime (smartwatch) + +I use it on my PineTime smartwatch. Other than checking the time and my step count, I really don't do anything else fancy with it (yet). + +=> https://www.pine64.org/pinetime/ +=> https://infinitime.io/ + +### motionEyeOS + +I usually install an army of RaspberryPi 3's in my house before I travel for a prolonged amount of time. All Pi's are equipped with an camera and have motionEyeOS (Linux based video surveillance system) installed. There's a neat Android app in the F-Droid store which let's me keep an eye on everything. I make the Pi's accessible from the internet via reverse SSH tunnels through one of my frontend servers. + +=> https://github.com/ccrisan/motioneyeos + +### Kobo OS (proprietary) + +I use a Kobo Forma as my e-reader device. I have started to switch off the Wifi and to only sideload DRM free ePubs on it. Even offline, it's a fully capable reader device. I wouldn't like the Kobo to call home to Rakuten. I would love to replace it one day with an open source e-reader alternative like the PineNote. There are also some interesting attempts installing postmarketOS Linux on Kobo devices. The latter boots already, but is far from being usable as a normal e-reader. + +=> https://www.pine64.org/pinenote/ The PineNote +=> https://liliputing.com/2021/07/kobo-clara-hd-becomes-an-e-ink-linux-tablet-with-the-help-of-postmarketos.html Kobo Clara HD becomes an e-ink Linux tablet + +But as a fall-back, someone could still use the good old dead tree format! + +### Android TV (proprietary) + +An Android TV box is used for watching movies and series on Netflix and Amazon Prime video (yes, I am human too and rely once in a while on big tech streaming services). The Android TV box is currently in the process of being replaced by OSMC, though. Most services seem to work fine with OSMC, but didn't get around tinkering with Netflix and Amazon there yet. + +=> https://osmc.tv/ + +## Other OSes.. + +This section is just for the sake of having a complete list of all OSes I used for some significant amount of time. I might not use all of them any more... + +### NetBSD + +I have been using NetBSD on an old Sun Sparcstation 10 as a student. I also have run NetBSD on a very old ThinkPad with 96MB!!! of RAM (even with X/evilWM). I also installed (but never really used) NetBSD on an HP Jornada 680. But that's all more than 10 years ago. I haven't looked at NetBSD for long time. I want to revive it on an "old" ThinkPad T450 of mine which I currently don't use. + +=> https://netbsd.org + +### Other OSes in use... + +=> https://sailfish.org SailfishOS - Nice mobile OS, but unfortunately includes proprietary components +=> https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux Red Hat Enterprise Linux - Only for some work stuff + +### Other OSes not used any more... + +=> https://en.opensuse.org/Archive:S.u.S.E._Linux_5.3 SuSE Linux 5.3 - The first Linux OS I used +=> https://en.wikipedia.org/wiki/IRIX SGI's IRIX - On a SGI Onyx 3200 +=> https://en.wikipedia.org/wiki/MeeGo MeeGo - On a Nokia N9 +=> https://en.wikipedia.org/wiki/Microsoft_Windows Microsoft Windows +=> https://en.wikipedia.org/wiki/MS-DOS Microsoft DOS - With and without Windows 3.x +=> https://en.wikipedia.org/wiki/Symbian Symbian - The first smartphone OS I used +=> https://en.wikipedia.org/wiki/Wear_OS WearOS - On a Google smartwatch +=> https://www.debian.org Debian GNU/Linux - Rock solid, but atm. I prefer Fedora/EndeavourOS +=> https://www.ubuntu.com Ubuntu Linux (based on Debian) +=> https://www.linuxfromscratch.org/ Linux from scratch - The best way to learn Linux +=> https://www.suse.com/products/server/ SUSE Linux Enterprise - Only for some work stuff + +### Other OSes I only had a glance at... + +=> https://archiveos.org/opensolaris/ OpenSolaris - Continuation of the open source version of Solaris +=> https://archlinuxarm.org/ Arch Linux ARM +=> https://ecomstation.com/ eComStation - Continuation of IBM OS/2 +=> https://en.wikipedia.org/wiki/Minix MINIX +=> https://en.wikipedia.org/wiki/OpenVMS OpenVMS +=> https://en.wikipedia.org/wiki/OS/2 IBM OS/2 Warp +=> https://freedos.org FreeDOS - Open source alternative to DOS +=> https://plan9.io/plan9/ Plan9 +=> https://reactos.org/ ReactOS - A Microsoft Windows open source clone +=> https://www.debian.org/ports/hurd/ Debian GNU/Hurd - Debian on the GNU kernel +=> https://www.debian.org/ports/kfreebsd-gnu/ Debian GNU/kFreeBSD - Debian on the FreeBSD kernel +=> https://www.gentoo.org Gentoo Linux +=> https://www.haiku-os.org/ Haiku - A BeOS open source clone +=> https://www.oracle.com/solaris/solaris11/ Sun Solaris (now owned by Oracle) +=> https://www.puredarwin.org/ OpenDarwin ("now" PureDarwin) - Open source operating system based on the open parts of macOS + +### Other OSes which seem interesting... + +=> https://asteroidos.org/ Asteroids OS - Open source smartphone OS +=> https://www.dragonflybsd.org/ DragonFly BSD - Fork of FreeBSD 4 +=> http://wiki.postmarketos.org/wiki/Phosh Phosh (on postmarketOS) - A true Linux shell for the smartphone + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.gmi b/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.gmi index cd8bb6a4..5d78a420 100644 --- a/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.gmi +++ b/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.gmi @@ -2,6 +2,10 @@ > Published at 2022-03-06T18:11:39+00:00 +I have recently released DTail 4.0.0 and this blog post goes through all the new goodies. If you want to jump directly to DTail, do it here (there are nice animated gifs which demonstrates the usage pretty well): + +=> https://dtail.dev + ``` ,_---~~~~~----._ _,,_,*^____ _____``*g*\"*, @@ -16,9 +20,22 @@ | | ``` -I have recently released DTail 4.0.0 and this blog post goes through all the new goodies. If you want to jump directly to DTail, do it here (there are nice animated gifs which demonstrates the usage pretty well): - -=> https://dtail.dev +## Table of Contents + +* ⇢ The release of DTail 4.0.0 +* ⇢ ⇢ So, what's new in 4.0.0? +* ⇢ ⇢ ⇢ Rewritten logging +* ⇢ ⇢ ⇢ Configurable terminal color codes +* ⇢ ⇢ ⇢ Serverless mode +* ⇢ ⇢ ⇢ Shorthand flags +* ⇢ ⇢ ⇢ Spartan (aka plain) mode +* ⇢ ⇢ ⇢ Standard input pipe +* ⇢ ⇢ ⇢ New command dtailhealth +* ⇢ ⇢ ⇢ Improved documentation +* ⇢ ⇢ ⇢ Integration testing suite +* ⇢ ⇢ ⇢ Improved code +* ⇢ ⇢ ⇢ Use of memory pools +* ⇢ ⇢ What's next ## So, what's new in 4.0.0? @@ -290,10 +307,10 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -=> ./2021-04-22-dtail-the-distributed-log-tail-program.gmi 2021-04-22 DTail - The distributed log tail program -=> ./2022-03-06-the-release-of-dtail-4.0.0.gmi 2022-03-06 The release of DTail 4.0.0 (You are currently reading this) -=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD => ./2023-09-25-dtail-usage-examples.gmi 2023-09-25 DTail usage examples +=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD +=> ./2022-03-06-the-release-of-dtail-4.0.0.gmi 2022-03-06 The release of DTail 4.0.0 (You are currently reading this) +=> ./2021-04-22-dtail-the-distributed-log-tail-program.gmi 2021-04-22 DTail - The distributed log tail program Thanks! diff --git a/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.gmi.tpl b/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.gmi.tpl index a7d6bdd5..b9dd4ab4 100644 --- a/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.gmi.tpl +++ b/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.gmi.tpl @@ -2,6 +2,10 @@ > Published at 2022-03-06T18:11:39+00:00 +I have recently released DTail 4.0.0 and this blog post goes through all the new goodies. If you want to jump directly to DTail, do it here (there are nice animated gifs which demonstrates the usage pretty well): + +=> https://dtail.dev + ``` ,_---~~~~~----._ _,,_,*^____ _____``*g*\"*, @@ -16,9 +20,7 @@ | | ``` -I have recently released DTail 4.0.0 and this blog post goes through all the new goodies. If you want to jump directly to DTail, do it here (there are nice animated gifs which demonstrates the usage pretty well): - -=> https://dtail.dev +<< template::inline::toc ## So, what's new in 4.0.0? @@ -290,7 +292,7 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -<< template::inline::index dtail +<< template::inline::rindex dtail Thanks! diff --git a/gemfeed/2022-04-10-creative-universe.gmi b/gemfeed/2022-04-10-creative-universe.gmi index a050149d..d43407b3 100644 --- a/gemfeed/2022-04-10-creative-universe.gmi +++ b/gemfeed/2022-04-10-creative-universe.gmi @@ -2,6 +2,22 @@ > Published at 2022-04-10T10:09:11+01:00; Updated at 2022-04-18 +I have been participating in an annual work-internal project contest (we call it Pet Project contest) since I moved to London and switched jobs to my current employer. I am very happy to say that I won a "silver" prize last week here 🎆. Over the last couple of years I have been a finalist in this contest six times and won some kind of prize five times. Some of my projects were also released as open source software. One had a magazine article published, and for another one I wrote an article on my employer's engineering blog. If you have followed all my posts on this blog (the one you are currently reading), then you have probably figured out what these projects were: + +=> ./2021-04-22-dtail-the-distributed-log-tail-program.gmi DTail - The distributed log tail program +=> ./2018-06-01-realistic-load-testing-with-ioriot-for-linux.gmi Realistic load testing with I/O Riot for linux + +Note that my latest silver prize project isn't open source software and because of that there is no public material I can refer to. Maybe the next one again? + +I want to point out that I never won the "gold" prize and it's the first time I won "silver", though. I believe, looking at the company's contest history, I am the employee with the most consecutive successful project submissions (my streak broke as I didn't participate last year) and am also the one with the highest successful project count in total. Sorry if this all sounds a bit self-promotional, but I think it is something to be proud of. Consistency beats a one-off success. + +I often put endless hours and sometimes sleepless nights into such projects and all of that in my own time. I, an engineer whose native tongue is not English, also have to present such a project in front of the CEO, CTO and CPO, the Chief Scientist, the founders of the company, and, if it is not enough, to all other staff of the company too. I usually also demonstrate a working prototype live on a production grid during the presentation. 😓 + +So why would I sign up myself for such side projects? Isn't it a lot of stress and extra work? Besides the prize in form of money (you can not count on that, you may win or you may not win something) and recognition, there are also other motivational points: + +* I want to learn new technologies or to deepen my knowledge of a given technology. I want to have a personal benefit from the project, even when I don't win any prize. So when the company is offering a contest, why not use it as a motivational trampoline? It's good to have a hard deadline for a project. And the project will also benefit the company in some way. So it's a win-win. +* I love the idea of combining several old things into a new thing. You can call this creativity. At work, we call this sometimes Lego: Building new things from given blocks. But I also love to add something new and unique to the mix, something that didn't exist as a Lego block before and could not be built by using only the already existing blocks. + ``` . + . . . . . . . . . * @@ -23,23 +39,18 @@ - the universe ``` -## Prelude +## Table of Contents -I have been participating in an annual work-internal project contest (we call it Pet Project contest) since I moved to London and switched jobs to my current employer. I am very happy to say that I won a "silver" prize last week here 🎆. Over the last couple of years I have been a finalist in this contest six times and won some kind of prize five times. Some of my projects were also released as open source software. One had a magazine article published, and for another one I wrote an article on my employer's engineering blog. If you have followed all my posts on this blog (the one you are currently reading), then you have probably figured out what these projects were: - -=> ./2021-04-22-dtail-the-distributed-log-tail-program.gmi DTail - The distributed log tail program -=> ./2018-06-01-realistic-load-testing-with-ioriot-for-linux.gmi Realistic load testing with I/O Riot for linux - -Note that my latest silver prize project isn't open source software and because of that there is no public material I can refer to. Maybe the next one again? - -I want to point out that I never won the "gold" prize and it's the first time I won "silver", though. I believe, looking at the company's contest history, I am the employee with the most consecutive successful project submissions (my streak broke as I didn't participate last year) and am also the one with the highest successful project count in total. Sorry if this all sounds a bit self-promotional, but I think it is something to be proud of. Consistency beats a one-off success. - -I often put endless hours and sometimes sleepless nights into such projects and all of that in my own time. I, an engineer whose native tongue is not English, also have to present such a project in front of the CEO, CTO and CPO, the Chief Scientist, the founders of the company, and, if it is not enough, to all other staff of the company too. I usually also demonstrate a working prototype live on a production grid during the presentation. 😓 - -So why would I sign up myself for such side projects? Isn't it a lot of stress and extra work? Besides the prize in form of money (you can not count on that, you may win or you may not win something) and recognition, there are also other motivational points: - -* I want to learn new technologies or to deepen my knowledge of a given technology. I want to have a personal benefit from the project, even when I don't win any prize. So when the company is offering a contest, why not use it as a motivational trampoline? It's good to have a hard deadline for a project. And the project will also benefit the company in some way. So it's a win-win. -* I love the idea of combining several old things into a new thing. You can call this creativity. At work, we call this sometimes Lego: Building new things from given blocks. But I also love to add something new and unique to the mix, something that didn't exist as a Lego block before and could not be built by using only the already existing blocks. +* ⇢ Creative universe +* ⇢ ⇢ How to be creative +* ⇢ ⇢ ⇢ Know which problem you want to solve +* ⇢ ⇢ ⇢ Immerse / deep dive +* ⇢ ⇢ ⇢ Always have a notebook with you +* ⇢ ⇢ ⇢ When you didn't sleep enough +* ⇢ ⇢ ⇢ Have regular breaks and relax +* ⇢ ⇢ ⇢ Upside-down approach +* ⇢ ⇢ ⇢ Don't be busy all the time +* ⇢ ⇢ Conclusion ## How to be creative @@ -79,7 +90,7 @@ I am not saying that you should skip sleep. By all means, if you can sleep, then Have regular breaks. Don't skip your lunch break. Best, have a walk during lunchtime. And after work, do some kind of workout or visit a sports class. Do something completely unrelated to work before going to sleep (e.g. visit a parallel universe and read a Science Fiction novel). In short: Totally hit the off-switch after your work for the day is finished. You will be much more energised and motivated the next time you open your work laptop. -=> ../other-resources.gmi I personally love to read Science Fiction novels +=> ../about/novels.gmi I personally love to read Science Fiction novels I skip breakfast and lunch during the week. This means that on average, I intermittent fast on average 18-20 hours daily. It may sound odd to most people (who don't intermittent fast), but in a fasted state, I can be even more focused, thus helping me immerse myself in something even more. Not having breakfast and lunch also gives me back some time for other things (e.g. a nice walk, where I listen to podcasts or audiobooks or practise using my camera (street photography)). I relax my routine during the week ends, where I may enjoy a meal at any given time of the day. diff --git a/gemfeed/2022-04-10-creative-universe.gmi.tpl b/gemfeed/2022-04-10-creative-universe.gmi.tpl new file mode 100644 index 00000000..9c447b15 --- /dev/null +++ b/gemfeed/2022-04-10-creative-universe.gmi.tpl @@ -0,0 +1,142 @@ +# Creative universe + +> Published at 2022-04-10T10:09:11+01:00; Updated at 2022-04-18 + +I have been participating in an annual work-internal project contest (we call it Pet Project contest) since I moved to London and switched jobs to my current employer. I am very happy to say that I won a "silver" prize last week here 🎆. Over the last couple of years I have been a finalist in this contest six times and won some kind of prize five times. Some of my projects were also released as open source software. One had a magazine article published, and for another one I wrote an article on my employer's engineering blog. If you have followed all my posts on this blog (the one you are currently reading), then you have probably figured out what these projects were: + +=> ./2021-04-22-dtail-the-distributed-log-tail-program.gmi DTail - The distributed log tail program +=> ./2018-06-01-realistic-load-testing-with-ioriot-for-linux.gmi Realistic load testing with I/O Riot for linux + +Note that my latest silver prize project isn't open source software and because of that there is no public material I can refer to. Maybe the next one again? + +I want to point out that I never won the "gold" prize and it's the first time I won "silver", though. I believe, looking at the company's contest history, I am the employee with the most consecutive successful project submissions (my streak broke as I didn't participate last year) and am also the one with the highest successful project count in total. Sorry if this all sounds a bit self-promotional, but I think it is something to be proud of. Consistency beats a one-off success. + +I often put endless hours and sometimes sleepless nights into such projects and all of that in my own time. I, an engineer whose native tongue is not English, also have to present such a project in front of the CEO, CTO and CPO, the Chief Scientist, the founders of the company, and, if it is not enough, to all other staff of the company too. I usually also demonstrate a working prototype live on a production grid during the presentation. 😓 + +So why would I sign up myself for such side projects? Isn't it a lot of stress and extra work? Besides the prize in form of money (you can not count on that, you may win or you may not win something) and recognition, there are also other motivational points: + +* I want to learn new technologies or to deepen my knowledge of a given technology. I want to have a personal benefit from the project, even when I don't win any prize. So when the company is offering a contest, why not use it as a motivational trampoline? It's good to have a hard deadline for a project. And the project will also benefit the company in some way. So it's a win-win. +* I love the idea of combining several old things into a new thing. You can call this creativity. At work, we call this sometimes Lego: Building new things from given blocks. But I also love to add something new and unique to the mix, something that didn't exist as a Lego block before and could not be built by using only the already existing blocks. + +``` + . + . . . . . . + . . . * + . * . . . . . . + . + "You Are Here" . . + . . . +. | . . . . . . + | . . . +. + . + \|/ . . . . + . . V . * . . . . + . + + . . . + + . . + .+. . + . . . + . . . . . + . . . . . . . . ! / + * . . . + . . - O - + . . . + . . * . . / | + . + . . . .. + . +. . . . * . * . +.. . * + . . . . . . . . + . . + + - the universe +``` + +<< template::inline::toc + +## How to be creative + +How did I manage to be creative with all these Pet Projects? Unfortunately, there is no step-by-step guide I could point you to. But what I want to do in this blog post is share my personal experience so far. + +### Know which problem you want to solve + +There must be a problem to be solved or a thing to be improved. It makes no sense to have a project without a goal. A problem might be obvious to you, and you don't even need to think about it. In that case, you are all set, and you can immerse yourself with the problem. + +If, however, you don't know what problem you want to solve: Do you really need to be creative? All problems are solved anyway, correct? In that case, just go on with your work. As you immerse yourself with your daily work, you will find a project naturally after a while. I don't believe you should artificially find a project. It should come naturally to you. You should have an interest in the problem domain and a strong desire to find a proper solution for the problem. Artificially created projects come with the catch that you might give up on it rather sooner than later due to lack of motivation and desire. + +### Immerse / deep dive + +If you want to be creative in a field, you must know a lot about it. The more you know about it, the more dots you can connect. When you are learning a new technology or if you are thinking about a tough problem, do it thoroughly. Don't let anything distract you. Read books, watch lectures, listen to podcasts or audiobooks about the topic, talk to other people working on similar topics. Immerse yourself for multiple hours per day, multiple days per week, multiple weeks and maybe even months. Create your own inner universe. + +But once a day is over, shut your thoughts down. Hit the off-switch. Stop thinking about this problem for the remainder of the day. This can be difficult, as you didn't solve the problem- or didn't understand everything of the new technology yet, and you really want to get to the point. But be strict to yourself and stop thinking about it for a while. + +You must understand that you are more than just your conscious thoughts. Your brain does a lot of work in the background that you aren't aware of consciously. What happens when you stop consciously thinking about a problem is that your brain continues processing it. You might have experienced the "AHA"-effect, where suddenly you had an idea out of nowhere (e.g. during a walk, in the shower, or in the morning when you woke up)? This is your conscious self downloading a result from the background thread of your brain. You can elevate this effect by immersing with the problem immensely before giving your conscious self a break. + +Sometimes, depending on how deeply you were immersed, you may need to let the problem go for a couple of days (e.g. over a weekend) before you can download a new insight. + +### Always have a notebook with you + +Wherever you go, ensure that you always have something to take notes with you. Once you have an idea from nowhere (or from your unconscious but volatile brain), you really want to write it down to persistent storage. It doesn't matter what kind of note-taking device you use here. It can be a paper journal, or it can be your smartphone. + +My advice is to have a separate section where you put your notes of all of your ideas. At home or in the office, I write everything in my paper journal. When I am not at home, I use a digital note-taking app on my phone. Later, I copy the digital notes from it into a project-specific section of my paper journal. + +I prefer taking notes on paper, as it gives you more freedom of how to structure it. You can use any colour, and you can also quickly create diagrams without the use of any complex computer program. + +### When you didn't sleep enough + +I noticed while being sleep-deprived I am (obviously) unable to concentrate so much, and it is difficult to be immersed in a focused way. But on the other hand, I am a lot more creative compared to when I am not sleep-deprived. Then, my brain suddenly presents me with connections I have not thought of before. Here, I usually write any idea I have down on a sheet of paper or in my journal, so I can pick it up later. I then often continue to philosophise about a possible solution. Sometimes to the absurd, and sometimes to something pretty useful. + +I am not saying that you should skip sleep. By all means, if you can sleep, then sleep. But there are some days when you don't manage to sleep (e.g. think too much about a project and didn't manage to hit the off switch). This is, where you can take advantage of your current state of mind. Disclaimer: Skipping sleep damages your health. So, please don't try this out on purpose. But in case you had a bad night, remember this trick. + +### Have regular breaks and relax + +Have regular breaks. Don't skip your lunch break. Best, have a walk during lunchtime. And after work, do some kind of workout or visit a sports class. Do something completely unrelated to work before going to sleep (e.g. visit a parallel universe and read a Science Fiction novel). In short: Totally hit the off-switch after your work for the day is finished. You will be much more energised and motivated the next time you open your work laptop. + +=> ../about/novels.gmi I personally love to read Science Fiction novels + +I skip breakfast and lunch during the week. This means that on average, I intermittent fast on average 18-20 hours daily. It may sound odd to most people (who don't intermittent fast), but in a fasted state, I can be even more focused, thus helping me immerse myself in something even more. Not having breakfast and lunch also gives me back some time for other things (e.g. a nice walk, where I listen to podcasts or audiobooks or practise using my camera (street photography)). I relax my routine during the week ends, where I may enjoy a meal at any given time of the day. + +It also helps a lot eat healthy. Healthy food makes your brain work more efficiently. But I won't go into more details here, as nothing is as contradictory as the health and food industry. Conduct your own research. Your opinion may be different from mine anyway, and everyone's body reacts to certain foods differently. What for one person works may not work for another person. But be aware that you will find a lot of wrong and also conflicting information on the internet. So always use multiple resources for your research. + +### Upside-down approach + +It's easy to fall into the habit of "boxed" thinking, but creativity is exactly the opposite. Once in a while, make yourself think "Is A really required to do B?". Many assumptions are believed to be true. But are they really? A concrete example: "At work we only use the programming language L and framework F" and therefore, it is the standard we must use. + +Another way to think about it is "Is there an alternative way to accomplish the desired result? What if there were no programming language L and framework F? What would I do instead?". Maybe you would use programming language X to implement your own domain-specific language, which does what framework F would have done but in exactly the way you want to + much more flexible than F! And maybe language X would be much better suitable than L to implement a DSL anyway. Conclusion: It never hurts to verify your assumptions. + +Often, you will also find solutions to problems you never intended to solve and find new problems you never imagined to actually exist. That might not be a bad thing, but it might sidetrack you on your path to finding a solution for a particular problem. So be careful not to get sidetracked too much. In this case, just save a note for later reference (maybe your next Pet Project?) somewhere and go on with your actual problem. + +Don't be afraid to think about weird and unconventional solutions. Sometimes, the most unconventional solution is the best solution to a problem. Also, try to keep to the basics. The best solutions are KISS. + +=> ./2021-09-12-keep-it-simple-and-stupid.gmi Keep it simple and stupid + +A small additional trick: you can train yourself to generate new and unconventional ideas. Just write down 20 random ideas every day. It doesn't matter what the ideas are about and whether they are useful or not. The purpose of this exercise is to make your brain think about something new and unconventional. These can be absurd ideas such as "Jump out of the window naked in the morning in order to wake up faster". Of course, you would never do that, but at least you had an idea and made your brain generate something. + +### Don't be busy all the time + +Especially as a DevOps Engineer, you could be busy all the time with small, but frequent, ad hoc tasks. Don't lose yourself here. Yes, you should pay attention to your job and those tasks, but you should also make some room for creativity. Don't schedule meeting after ad hoc work after meeting after Jira ticket work after another Jira ticket. There should also be some "free" space in your calendar. + +Use the "free" time to play around with your tech stack. Try out new options, explore the system metrics, explore new tools, etc. Dividends will pay off with new ideas, which you would have never come up with if you were "just busy" like a machine. + +Sometimes, I pick a Unix manual page of a random command and start reading it. I have a bash helper function which will pick one for me: + +``` +❯ where learn +learn () { + man $(ls /bin /sbin /usr/bin /usr/sbin 2>/dev/null | shuf -n 1) | + sed -n "/^NAME/ { n;p;q }" +} +❯ learn + perltidy - a perl script indenter and reformatter +❯ learn + timedatectl - Control the system time and date +``` + +## Conclusion + +This all summarises advice I have, really. I hope this was interesting and helpful for you. + +I have one more small tip: I never published a blog post the same day I wrote it. After finishing writing it, I always wait for a couple of days. In all cases so far, I had an additional idea to add or to fine tune the blog post. + +Another article I found interesting and relevant is + +=> https://thesephist.com/posts/paradise/ Creative Paradise by The Sephist + +Relevant books I can recommend are: + +* Consciousness: A Very Short Introduction; Susan Blackmore; Oxford Uiversity Press +* Deep Work; Cal Newport; Piatkus +* So Good They Can't Ignore You; Cal Newport; Business Plus +* The Off Switch; Mark Cropley; Virgin Books +* Ultralearning; Scott Young; Thorsons + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2022-05-27-perl-is-still-a-great-choice.gmi b/gemfeed/2022-05-27-perl-is-still-a-great-choice.gmi index 5719847c..d8675612 100644 --- a/gemfeed/2022-05-27-perl-is-still-a-great-choice.gmi +++ b/gemfeed/2022-05-27-perl-is-still-a-great-choice.gmi @@ -2,8 +2,6 @@ > Published at 2022-05-27T07:50:12+01:00; Updated at 2023-01-28 -=> ./perl-is-still-a-great-choice/regular_expressions.png Comic source: XKCD - Perl (the Practical Extraction and Report Language) is a battle-tested, mature, multi-paradigm dynamic programming language. Note that it's not called PERL, neither P.E.R.L. nor Pearl. "Perl" is the name of the language and `perl` the name of the interpreter or the interpreter command. Unfortunately (it makes me sad), Perl's popularity has been declining over the last years as Google trends shows: @@ -17,6 +15,17 @@ So why is that? Once the de-facto standard super-glue language for the web nowad * Why use Perl as there are better alternatives? * Why all the sigils? It looks like an exploding ASCII factory!! +=> ./perl-is-still-a-great-choice/regular_expressions.png Comic source: XKCD + +## Table of Contents + +* ⇢ Perl is still a great choice +* ⇢ ⇢ Write-only language +* ⇢ ⇢ Is Perl abandoned? +* ⇢ ⇢ Why use Perl as there are better alternatives? +* ⇢ ⇢ Why all the sigils? It looks like an exploding ASCII factory!! +* ⇢ ⇢ Where do I personally still use perl? + ## Write-only language Is Perl really a write-only language? You have to understand that Perl 5 was released in 1994 (28 years ago as of this writing) and when we refer to Perl we usually mean Perl 5. That's many years, and there are many old scripts not following the modern Perl best practices (as they didn't exist yet). So yes, legacy scripts may be difficult to read. Japanese may be difficult to read too if you don't know Japanese, though. @@ -138,9 +147,9 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -=> ./2008-06-26-perl-poetry.gmi 2008-06-26 Perl Poetry -=> ./2011-05-07-perl-daemon-service-framework.gmi 2011-05-07 Perl Daemon (Service Framework) -=> ./2022-05-27-perl-is-still-a-great-choice.gmi 2022-05-27 Perl is still a great choice (You are currently reading this) => ./2023-05-01-unveiling-guprecords:-uptime-records-with-raku.gmi 2023-05-01 Unveiling `guprecords.raku`: Global Uptime Records with Raku +=> ./2022-05-27-perl-is-still-a-great-choice.gmi 2022-05-27 Perl is still a great choice (You are currently reading this) +=> ./2011-05-07-perl-daemon-service-framework.gmi 2011-05-07 Perl Daemon (Service Framework) +=> ./2008-06-26-perl-poetry.gmi 2008-06-26 Perl Poetry => ../ Back to the main site diff --git a/gemfeed/2022-05-27-perl-is-still-a-great-choice.gmi.tpl b/gemfeed/2022-05-27-perl-is-still-a-great-choice.gmi.tpl index ea0170e2..8b04d87a 100644 --- a/gemfeed/2022-05-27-perl-is-still-a-great-choice.gmi.tpl +++ b/gemfeed/2022-05-27-perl-is-still-a-great-choice.gmi.tpl @@ -2,8 +2,6 @@ > Published at 2022-05-27T07:50:12+01:00; Updated at 2023-01-28 -=> ./perl-is-still-a-great-choice/regular_expressions.png Comic source: XKCD - Perl (the Practical Extraction and Report Language) is a battle-tested, mature, multi-paradigm dynamic programming language. Note that it's not called PERL, neither P.E.R.L. nor Pearl. "Perl" is the name of the language and `perl` the name of the interpreter or the interpreter command. Unfortunately (it makes me sad), Perl's popularity has been declining over the last years as Google trends shows: @@ -17,6 +15,10 @@ So why is that? Once the de-facto standard super-glue language for the web nowad * Why use Perl as there are better alternatives? * Why all the sigils? It looks like an exploding ASCII factory!! +=> ./perl-is-still-a-great-choice/regular_expressions.png Comic source: XKCD + +<< template::inline::toc + ## Write-only language Is Perl really a write-only language? You have to understand that Perl 5 was released in 1994 (28 years ago as of this writing) and when we refer to Perl we usually mean Perl 5. That's many years, and there are many old scripts not following the modern Perl best practices (as they didn't exist yet). So yes, legacy scripts may be difficult to read. Japanese may be difficult to read too if you don't know Japanese, though. @@ -138,6 +140,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -<< template::inline::index perl raku +<< template::inline::rindex perl raku => ../ Back to the main site diff --git a/gemfeed/2022-06-15-sweating-the-small-stuff.gmi b/gemfeed/2022-06-15-sweating-the-small-stuff.gmi index aba7fa93..1e0c4e8c 100644 --- a/gemfeed/2022-06-15-sweating-the-small-stuff.gmi +++ b/gemfeed/2022-06-15-sweating-the-small-stuff.gmi @@ -2,14 +2,6 @@ > Published at 2022-06-15T08:47:44+01:00; Updated at 2022-06-18 -``` - _ - /_/_ .'''. - =O(_)))) ...' `. - jgs \_\ `. .''' - `..' -``` - This blog post is a bit different from the others. It consists of multiple but smaller projects worth mentioning. I got inspired by Julia Evan's "Tiny programs" blog post and the side projects of The Sephist, so I thought I would also write a blog posts listing a couple of small projects of mine: => https://jvns.ca/blog/2022/03/08/tiny-programs/ Tiny programs @@ -19,6 +11,39 @@ Working on tiny projects is a lot of fun as you don't need to worry about any st But before going through the tiny projects let's take a paragraph for the `1y` anniversary retrospective. +``` + _ + /_/_ .'''. + =O(_)))) ...' `. + jgs \_\ `. .''' + `..' +``` + +## Table of Contents + +* ⇢ Sweating the small stuff - Tiny projects of mine +* ⇢ ⇢ `1y` anniversary +* ⇢ ⇢ Static photo album generator +* ⇢ ⇢ ⇢ The Irregular Ninja +* ⇢ ⇢ Random journal page extractor +* ⇢ ⇢ Global uptime records statistic generator +* ⇢ ⇢ Server configuration management +* ⇢ ⇢ Fancy SSH execution loop +* ⇢ ⇢ A KISS dynamic DNS solution +* ⇢ ⇢ CPU information gatherer for Linux +* ⇢ ⇢ Show differences of two files over the network +* ⇢ ⇢ Delay sending out E-Mails with Mutt +* ⇢ ⇢ Graphical UI for sending text messages +* ⇢ ⇢ IPv6 and IPv4 connectivity testing site +* ⇢ ⇢ List open Jira tickets in the terminal +* ⇢ ⇢ Debian running on "your" Android phone +* ⇢ ⇢ Perl service framework +* ⇢ ⇢ More +* ⇢ ⇢ ⇢ Work time tracker +* ⇢ ⇢ ⇢ Password and document store +* ⇢ ⇢ ⇢ Backup procedure +* ⇢ ⇢ konpeito.media + ## `1y` anniversary It has been one year since I started posting regularly (at least once monthly) on this blog again. It has been a lot of fun (and work) doing so for various reasons: diff --git a/gemfeed/2022-06-15-sweating-the-small-stuff.gmi.tpl b/gemfeed/2022-06-15-sweating-the-small-stuff.gmi.tpl new file mode 100644 index 00000000..423be12e --- /dev/null +++ b/gemfeed/2022-06-15-sweating-the-small-stuff.gmi.tpl @@ -0,0 +1,330 @@ +# Sweating the small stuff - Tiny projects of mine + +> Published at 2022-06-15T08:47:44+01:00; Updated at 2022-06-18 + +This blog post is a bit different from the others. It consists of multiple but smaller projects worth mentioning. I got inspired by Julia Evan's "Tiny programs" blog post and the side projects of The Sephist, so I thought I would also write a blog posts listing a couple of small projects of mine: + +=> https://jvns.ca/blog/2022/03/08/tiny-programs/ Tiny programs +=> https://thesephist.com/projects/ The Sephist's project list + +Working on tiny projects is a lot of fun as you don't need to worry about any standards or code reviews and you decide how and when you work on it. There aren't restrictions regarding technologies used. You are likely the only person working on these tiny projects and that means that there is no conflict with any other developers. This is complete freedom :-). + +But before going through the tiny projects let's take a paragraph for the `1y` anniversary retrospective. + +``` + _ + /_/_ .'''. + =O(_)))) ...' `. + jgs \_\ `. .''' + `..' +``` + +<< template::inline::toc + +## `1y` anniversary + +It has been one year since I started posting regularly (at least once monthly) on this blog again. It has been a lot of fun (and work) doing so for various reasons: + +* I practice English writing (I am not a native speaker). I am far from being a novelist, but this blog helps improves my writing skills. I also tried out tools like Grammarly.com and Languagetool.org and also worked with `:spell` in Vim or the LibreOffice checker. This post was checked with the `write-better` Node application. +* I force myself to "finish" some kind of project worth writing about every month. If its not a project, then its still a topic which requires research and deep thinking. Producing 2k words of text can actually be challenging. +* It's fun to rely on KISS (keep it simple & stupid) tools. E.g. use of Gemtexter and not WordPress, use of Vim instead of an office suite or a rich web editor. + +Retrospectively, these have been the most popular blog posts of mine over the last year: + +=> ./2021-09-12-keep-it-simple-and-stupid.gmi Keep it simple and stupid +=> ./2022-04-10-creative-universe.gmi Creative universe +=> ./2021-11-29-bash-golf-part-1.gmi Bash Golf series +=> ./2021-12-26-how-to-stay-sane-as-a-devops-person.gmi How to stay sane as a DevOps person +=> ./2022-05-27-perl-is-still-a-great-choice.gmi Perl is still a great choice + +But now, let's continue with the small projects worth mentioning :-) + +## Static photo album generator + +`photoalbum.sh` is a minimal static HTML photo album generator. I use it to drive "The Irregular Ninja" site and for some ad-hoc (personal) albums to share photos with the family and friends. + +=> https://codeberg.org/snonux/photoalbum + +### The Irregular Ninja + +Photography is one of my casual hobbies. I love to capture interesting perspectives and motifs. I love to walk new streets and neighbourhoods I never walked before so I can capture those unexpected motifs, colours and moments. Unfortunately, because of time constraints (and sometime weather constraints), I do that on a pretty infrequent basis. + +=> ./sweating-the-small-stuff/ninja.jpg + +More than 10 years ago I wrote the bespoke small static photo album generator in Bash `photoalbum.sh` which I recently refactored to a modern Bash coding style and also freshened up the Cascading Style Sheets. Last but not least, the new domain name `irregular.ninja` has been registered. + +The thumbnails are presented in a random order and there are also random CSS effects for each preview. There's also a simple background blur for each page generated. And that's all in less than 300 lines of Bash code! The script requires ImageMagick (available for all common Linux and *BSD distributions) to be installed. + +As you can see, there is a lot of randomization and irregularity going on. Thus, the name "Irregular Ninja" was born. + +=> https://irregular.ninja + +I only use a digital compact camera or a smartphone to take the photos. I don't like the idea of carrying around a big camera with me "just in case" so I keep it small and simple. The best camera is the camera you have with you. :-) + +I hope you like this photo site. It's worth checking it out again around once every other month! + +## Random journal page extractor + +I bullet journal. I write my notes into a Leuchtturm paper notebook. Once full, I am scanning it to a PDF file and archive it. As of writing this, I am at journal #7 (each from 123 up to 251 pages in A5). It means that there is a lot of material already. + +Once in a while I want to revisit older notes and ideas. For that I have written a simple Bash script `randomjournalpage.sh` which randomly picks a PDF file from a folder and extracts 42 pages from it at a random page offset and opens them in a PDF viewer (Evince in this case, as I am a GNOME user). + +=> https://codeberg.org/snonux/randomjournalpage + +There's also a weekly `CRON` job on my servers to send me a reminder that I might want to read in my old journals again. My laptop also runs this script each time it boots and saves the output to a NextCloud folder. From there, it's synchronized to the NextCloud server so I can pick it up from there with my smartphone later when I am "on the road". + +## Global uptime records statistic generator + +`guprecords` is a Perl script which reads multiple `uprecord` files (produced by `uptimed` - a widely available daemon for recording server uptimes) and generates uptime statistics of multiple hosts combined. I keep all the record files of all my personal computers in a Git repository (I even keep the records of the boxes I don't own or use anymore) and there's already quite a collection of it. It looks like this: + +``` +❯ perl ~/git/guprecords/src/guprecords --indir=./stats/ --count=20 --all +Pos | System | Kernel | Uptime | Boot time + 1 | sun | FreeBSD 10.1-RELEA.. | 502d 03:29:19 | Sun Aug 16 15:56:40 2015 + 2 | vulcan | Linux 3.10.0-1160... | 313d 13:19:39 | Sun Jul 25 18:32:25 2021 + 3 | uugrn | FreeBSD 10.2-RELEASE | 303d 15:19:35 | Tue Dec 22 21:33:07 2015 + 4 | uugrn | FreeBSD 11.0-RELEA.. | 281d 14:38:04 | Fri Oct 21 15:22:02 2016 + 5 | deltavega | Linux 3.10.0-957.2.. | 279d 11:15:00 | Sun Jun 30 11:42:38 2019 + 6 | vulcan | Linux 3.10.0-957.2.. | 279d 11:12:14 | Sun Jun 30 11:43:41 2019 + 7 | deltavega | Linux 3.10.0-1160... | 253d 04:42:22 | Sat Apr 24 13:34:34 2021 + 8 | host0 | FreeBSD 6.2-RELEAS.. | 240d 02:23:23 | Wed Jan 31 20:34:46 2007 + 9 | uugrn | FreeBSD 11.1-RELEA.. | 202d 21:12:41 | Sun May 6 18:06:17 2018 + 10 | tauceti | Linux 3.2.0-4-amd64 | 197d 18:45:40 | Mon Dec 16 19:47:54 2013 + 11 | pluto | Linux 2.6.32-5-amd64 | 185d 11:53:04 | Wed Aug 1 07:34:10 2012 + 12 | sun | FreeBSD 10.3-RELEA.. | 164d 22:31:55 | Sat Jul 22 18:47:21 2017 + 13 | vulcan | Linux 3.10.0-1160... | 161d 07:08:43 | Sun Feb 14 10:05:38 2021 + 14 | sun | FreeBSD 10.3-RELEA.. | 158d 21:18:36 | Sat Jan 27 10:18:57 2018 + 15 | uugrn | FreeBSD 11.1-RELEA.. | 157d 20:57:24 | Fri Nov 3 05:02:54 2017 + 16 | tauceti-f | Linux 3.2.0-3-amd64 | 150d 04:12:38 | Mon Sep 16 09:02:58 2013 + 17 | tauceti | Linux 3.2.0-4-amd64 | 149d 09:21:43 | Mon Aug 11 09:47:50 2014 + 18 | pluto | Linux 3.2.0-4-amd64 | 142d 02:57:31 | Mon Sep 8 01:59:02 2014 + 19 | tauceti-f | Linux 3.2.0-3-amd64 | 132d 22:46:26 | Mon May 6 11:11:35 2013 + 20 | keppler-16b | Darwin 13.4.0 | 131d 08:17:12 | Thu Jun 11 10:44:25 2015 +``` + +It can also sum up all uptimes for each host to generate a total per host uptime top list: + +``` +❯ perl ~/git/guprecords/src/guprecords --indir=./stats/ --count=20 --total +Pos | System | Kernel | Uptime | + 1 | uranus | Linux 5.4.17-200.f.. | 1419d 19:05:39 | + 2 | sun | FreeBSD 10.1-RELEA.. | 1363d 11:41:14 | + 3 | vulcan | Linux 3.10.0-1160... | 1262d 20:27:48 | + 4 | uugrn | FreeBSD 10.2-RELEASE | 1219d 15:10:16 | + 5 | deltavega | Linux 3.10.0-957.2.. | 1115d 06:33:55 | + 6 | pluto | Linux 2.6.32-5-amd64 | 1086d 10:44:05 | + 7 | tauceti | Linux 3.2.0-4-amd64 | 846d 12:58:21 | + 8 | tauceti-f | Linux 3.2.0-3-amd64 | 625d 07:16:39 | + 9 | host0 | FreeBSD 6.2-RELEAS.. | 534d 19:50:13 | + 10 | keppler-16b | Darwin 13.4.0 | 448d 06:15:00 | + 11 | tauceti-e | Linux 3.2.0-4-amd64 | 415d 18:14:13 | + 12 | moon | Darwin 18.7.0 | 326d 11:21:42 | + 13 | callisto | Linux 4.0.4-303.fc.. | 303d 12:18:24 | + 14 | alphacentauri | FreeBSD 10.1-RELEA.. | 300d 20:15:00 | + 15 | earth | Linux 5.13.14-200... | 289d 08:05:05 | + 16 | makemake | Linux 5.11.9-200.f.. | 286d 21:53:03 | + 17 | london | Linux 3.2.0-4-amd64 | 258d 15:10:38 | + 18 | fishbone | OpenBSD 4.1 .. | 223d 05:55:26 | + 19 | sagittarius | Darwin 15.6.0 | 198d 23:53:59 | + 20 | mars | Linux 3.2.0-4-amd64 | 190d 05:44:21 | +``` + +=> https://codeberg.org/snonux/guprecords + +This all is of no real practical use but fun! + +## Server configuration management + +The `rexfiles` project contains all Rex files for my (personal) server setup automation. A `Rexfile` is written in a Perl DSL run by the Rex configuration management system. It's pretty much KISS and that's why I love it. It suits my personal needs perfectly. + +=> https://codeberg.org/snonux/rexfiles +=> https://www.rexify.org + +This is an E-Mail I posted to the Rex mailing list: + +> Hi there! I was searching for a simple way to automate my personal OpenBSD setup. I found that configuration management systems like Puppet, Salt, Chef, etc.. were too bloated for my personal needs. So for a while I was configuring everything by hand. At one point I got fed up and started writing Shell scripts. But that was not the holy grail so that I looked at Ansible. I found that Ansible had some dependencies on Python on the target machine when you want to use all the features. Furthermore, I am not really familiar with Python. But then I remembered that there was also Rex. It's written in my beloved Perl. Also, OpenBSD comes with Perl in the base system out of the box which makes it integrate better than all my scripts (automation and also scripts deployed via the automation to the system) are all in the same language. Rex may not have all the features like other configuration management systems, but its easy to work-around or extend when you know Perl. Thanks! + +## Fancy SSH execution loop + +`rubyfy` is a fancy SSH loop wrapper written in Ruby for running shell commands on multiple remote servers at once. I also forked this project for work (under a different name) where I added even more features such as automatic server discovery. It's used by many colleagues on a frequent basis. Here are some examples: + +``` +# Run command 'hostname' on server foo.example.com +./rubyfy.rb -c 'hostname' <<< foo.example.com + +# Run command 'id' as root (via sudo) on all servers listed in the list file +# Do it on 10 servers in parallel +./rubyfy.rb --parallel 10 --root --command 'id' < serverlist.txt + +# Run a fancy script in background on 50 servers in parallel +./rubyfy.rb -p 50 -r -b -c '/usr/local/scripts/fancy.zsh' < serverlist.txt + +# Grep for specific process on both servers and write output to ./out/grep.txt +echo {foo,bar}.example.com | ./rubyfy.rb -p 10 -c 'pgrep -lf httpd' -n grep.txt + +# Reboot server only if file /var/run/maintenance.lock does NOT exist! +echo foo.example.com | +./rubyfy.rb --root --command reboot --precondition /var/run/maintenance.lock +``` + +=> https://codeberg.org/snonux/rubyfy + +## A KISS dynamic DNS solution + +`dyndns` is a tiny shell script which implements "your" own DynDNS service. It relies on SSH access to the authoritative DNS server and the `nsupdate` command. There is really no need to use any of the "other" free DynDNS services out there. + +Syntax (this must run from the client connecting to the DNS server through SSH): + +``` +ssh dyndns@dyndnsserver /path/to/dyndns-update \ + your.host.name. TYPE new-entry TIMEOUT +``` + +This is a real world example: + +``` +ssh dyndns@dyndnsserver /path/to/dyndns-update \ + local.buetow.org. A 137.226.50.91 30 +``` + +=> https://codeberg.org/snonux/dyndns + +## CPU information gatherer for Linux + +This is a tiny GNU Awk script for Linux which displays information about the CPU. All what it does is presenting `/proc/cpuinfo` in an easier to read way. The output is somewhat more compact than the standard `lscpu` command you find commonly on Linux distributions. + +``` +❯ ./cpuinfo +cpuinfo (c) 1.0.2 Paul Buetow + + 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz GenuineIntel 12288 KB cache + +p = 001 Physical processors +c = 004 Cores +s = 008 Siblings (Hyper-Threading enabled if s != c) +v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs + Hyper-Threading is enabled + +0003000 MHz each core +0012000 MHz total +0005990 Bogomips each processor (including virtual) +0023961 Bogomips total +``` + +=> https://codeberg.org/snonux/cpuinfo + +## Show differences of two files over the network + +This is a shell wrapper to use the standard diff tool over the network to compare a file between two computers. It uses NetCat for the network part and also encrypts all traffic using OpenSSL. This is how its used: + +1. Open two terminal windows and login to two different hosts (you could use ClusterSSH or `tmux` here). 2. Run on the first host `netdiff otherhost.example.org /file/to/diff.txt` and run on the second host `netdiff firsthost.example.org /file/to/diff.txt`. 3. You then will see the file differences. + +=> https://codeberg.org/snonux/netdiff + +## Delay sending out E-Mails with Mutt + +This is a shell script for the Mutt email client for delaying sending out E-Mails. For example, you want to write an email on Saturday but don't want to bother the recipient earlier than Monday. It relies on CRON. + +=> https://codeberg.org/snonux/muttdelay + +## Graphical UI for sending text messages + +`jsmstrade` is a minimalistic graphical Java swing client for sending SMS messages over the SMStrade service. + +=> ./sweating-the-small-stuff/jsmstrade.png + +=> https://codeberg.org/snonux/jsmstrade +=> https://smstrade.de + +## IPv6 and IPv4 connectivity testing site + +`ipv6test` is a quick and dirty Perl CGI script for testing whether your browser connects via IPv4 or IPv6. It requires you to setup three sub-domains: One reachable only via IPv4 (e.g. `test4.ipv6.buetow.org`), another reachable only via IPv6 (e.g. `test6.ipv6.buetow.org`) and the main one reachable through both protocols (e.g. `ipv6.buetow.org`). + +I don't have it running on any of my servers at the moment. This means that there is no demo to show now. Sorry! + +## List open Jira tickets in the terminal + +`japi` s a small Perl script for listing open Jira issues. It might be broken by now as the Jira APIs may have changed. Sorry! But feel free to fork and modernize it. :-) + +=> https://codeberg.org/snonux/jsmstrade + +## Debian running on "your" Android phone + +Debroid is a tutorial and a set of scripts to install and to run a Debian `chroot` on an Android phone. + +=> ./2015-12-05-run-debian-on-your-phone-with-debroid.gmi Check out my previous post about it + +I am not using Debroid anymore as I have switched to Termux now. + +=> https://termux.com + +## Perl service framework + +PerlDaemon is a minimal daemon for Linux and other Unix like operating systems programmed in Perl. It is a minimal but pretty functional and fairly generic service framework. This means that it does not do anything useful other than providing a framework for starting, stopping, configuring and logging. To do something useful, a module (written in Perl) must be provided. + +=> ./2011-05-07-perl-daemon-service-framework.gmi Checkout my previous post about it + +## More + +There are more projects on my Codeberg page but they aren't as tiny as the ones mentioned in this post or aren't finished yet so I won't bother listing them here. However, there also a few more scripts used frequently by me (not publicly accessible (yet?)) which I would like to mention here: + +### Work time tracker + +`worktime.rb`, for example, is a command line Ruby script I use to track my time spent working. This is to make sure that I don't overwork (in particular useful when working from home). It also generates some daily and weekly stats and carries over work time (surpluses or minuses) to the next work day, week or even year. + +It has some special features such as tracking time for self-improvement/development, days off and time spent at the lunch break and time spent on Pet Projects. + +An example weekly report looks like this (I often don't track my lunch time but what I do instead I stop the work timer when I go out for lunch and start the work timer once back at the desk): + +``` + Mon 20211213 50: work:5.92h + Tue 20211214 50: work:7.47h lunch:0.50h pet:0.42h + Wed 20211215 50: work:8.86h pet:0.50h + Thu 20211216 50: work:8.02h pet:0.50h + Fri 20211217 50: work:9.81h + * Sat 20211218 50: work:0.00h selfdevelopment:1.00h + * Sun 20211219 50: work:2.08h pet:1.00h selfdevelopment:-2.08h +================================================ + balance:0.06h work:42.15h lunch:0.50h pet:2.42h selfdevelopment:-1.08h buffer:8.38h +``` + +All I do when I start work is to run the `wtlogin` command and after finishing work to run the `wtlogout` command. My shell will remind me when I work without having logged in. It uses a simple JSON database which is editable with `wtedit` (this opens the JSON in Vim). The report shown above can be generated with `wtreport`. Any out-of-bounds reporting can be added with the `wtadd` command. + +### Password and document store + +`geheim.rb` is my personal password and document store ("geheim" is the German word for secret). It's written in Ruby and heavily relies on Git, FZF (for search), Vim and standard encryption algorithms. Other than the standard `pass` Unix password manager, `geheim` also encrypts the file names and password titles. + +The tool is command line driven but also provides an interactive shell when invoked with `geheim shell`. It also works on my Android phone via Termux so I have all my documents and passwords always with me. + +### Backup procedure + +`backup` is a Bash script which does run once daily (or every time on boot) on my home FreeBSD NAS server and performs backup related tasks such as creating a local backup of my remote NextCloud instance, creating encrypted (incremental) ZFS snapshots of everything what's stored on the NAS and synchronizes (via `rsync`) backups to a remote cloud storage. It also can synchronize backups to a local external USB drive. + +=> ./2016-04-03-offsite-backup-with-zfs.gmi Check out my offsite backup series + +## konpeito.media + +Here's a bonus... + +``` + ▄ █ ▄ ▄ █ ▄ ▄ █ ▄ + ▄▀█▀▄ ▄▀█▀▄ ▄▀█▀▄ + ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▀ ▀ ▀ + █ ▄▄ ▄▄ █ + █ █ █▀▀▀█ █ █ █ ▄▀ ▄▀▀▀▀▄ █▄ █ █▀▀▀▀▀▄ ▄▀▀▀▀▄ █ ▀▀▀█▀▀▀ ▄▀▀▀▀▄ + █ ▀▀▀▀▀▀▀▀▀ █ █ ▄█ █ █ █ ▀▄ █ █▄▄▄▄▄▀ █▄▄▄▄▄▄█ █ █ █ █ + █ ▄▀▀▀▀▀▀▀▀▀▀▀▄ █ █▀ ▀▄ ▀▄ ▄▀ █ ▀▄█ █ ▀▄ ▄ █ █ ▀▄ ▄▀ + ▀▄█▄█▄▄▄▄▄▄▄█▄█▄▀ ▀ ▀ ▀▀▀▀ ▀ ▀ ▀ ▀▀▀▀ ▀ ▀ ▀▀▀ +``` + +*THIS ISN'T MY PROJECT* but I found KONPEITO an interesting Gemini capsule. It's a quarterly released Low-Fi music mix tape distributed only through Gemini (and not the web). + +=> gemini://konpeito.media + +If you wonder what Gemini is: + +=> ./2021-04-24-welcome-to-the-geminispace.gmi Welcome to the Geminispae + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi b/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi index 9180891b..2015a0a4 100644 --- a/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi +++ b/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi @@ -2,6 +2,8 @@ > Published at 2022-07-30T12:14:31+01:00 +I was amazed at how easy it is to automatically generate and update Let's Encrypt certificates with OpenBSD. + ``` / _ \ The Hebern Machine \ ." ". / @@ -29,9 +31,23 @@ ASCII Art by John Savard ``` -I was amazed at how easy it is to automatically generate and update Let's Encrypt certificates with OpenBSD. +## Table of Contents -## What's Let's Encrypt? +* ⇢ Let's Encrypt with OpenBSD and Rex +* ⇢ ⇢ ⇢ What's Let's Encrypt? +* ⇢ ⇢ Meet `acme-client` +* ⇢ ⇢ Configuration +* ⇢ ⇢ ⇢ acme-client.conf +* ⇢ ⇢ ⇢ httpd.conf +* ⇢ ⇢ ⇢ CRON job +* ⇢ ⇢ relayd.conf and smtpd.conf +* ⇢ ⇢ Rexification +* ⇢ ⇢ ⇢ General ACME client configuration +* ⇢ ⇢ ⇢ Service rexification +* ⇢ ⇢ All pieces together +* ⇢ ⇢ Conclusion + +### What's Let's Encrypt? > Let's Encrypt is a non-profit certificate authority run by Internet Security Research Group that provides X.509 certificates for Transport Layer Security (TLS) encryption at no charge. It is the world's largest certificate authority, used by more than 265 million websites, with the goal of all websites being secure and using HTTPS. @@ -660,10 +676,13 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other *BSD related posts are: -=> ./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi 2016-04-09 Jails and ZFS with Puppet on FreeBSD -=> ./2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi 2022-07-30 Let's Encrypt with OpenBSD and Rex (You are currently reading this) -=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD -=> ./2024-01-13-one-reason-why-i-love-openbsd.gmi 2024-01-13 One reason why I love OpenBSD +=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts +=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation +=> ./2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi 2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage => ./2024-04-01-KISS-high-availability-with-OpenBSD.gmi 2024-04-01 KISS high-availability with OpenBSD +=> ./2024-01-13-one-reason-why-i-love-openbsd.gmi 2024-01-13 One reason why I love OpenBSD +=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD +=> ./2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi 2022-07-30 Let's Encrypt with OpenBSD and Rex (You are currently reading this) +=> ./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi 2016-04-09 Jails and ZFS with Puppet on FreeBSD => ../ Back to the main site diff --git a/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi.tpl b/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi.tpl index de5ee1f0..55eea7b6 100644 --- a/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi.tpl +++ b/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi.tpl @@ -2,6 +2,8 @@ > Published at 2022-07-30T12:14:31+01:00 +I was amazed at how easy it is to automatically generate and update Let's Encrypt certificates with OpenBSD. + ``` / _ \ The Hebern Machine \ ." ". / @@ -29,9 +31,9 @@ ASCII Art by John Savard ``` -I was amazed at how easy it is to automatically generate and update Let's Encrypt certificates with OpenBSD. +<< template::inline::toc -## What's Let's Encrypt? +### What's Let's Encrypt? > Let's Encrypt is a non-profit certificate authority run by Internet Security Research Group that provides X.509 certificates for Transport Layer Security (TLS) encryption at no charge. It is the world's largest certificate authority, used by more than 265 million websites, with the goal of all websites being secure and using HTTPS. @@ -660,6 +662,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other *BSD related posts are: -<< template::inline::index bsd +<< template::inline::rindex bsd => ../ Back to the main site diff --git a/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi b/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi index 2e0d0535..22f90421 100644 --- a/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi +++ b/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi @@ -2,6 +2,12 @@ > Published at 2022-08-27T18:25:57+01:00 +I proudly announce that I've released Gemtexter version `1.1.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash. + +=> https://codeberg.org/snonux/gemtexter + +It has been around a year since I released the first version `1.0.0`. Although, there aren't any groundbreaking changes, there have been a couple of smaller commits and adjustments. I was quite surprised that I received a bunch of feedback and requests about Gemtexter so it means that I am not the only person in the universe actually using it. + ``` -=[ typewriter ]=- 1/98 @@ -14,11 +20,18 @@ jgs `"""""""""` ``` -I proudly announce that I've released Gemtexter version `1.1.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash. - -=> https://codeberg.org/snonux/gemtexter +## Table of Contents -It has been around a year since I released the first version `1.0.0`. Although, there aren't any groundbreaking changes, there have been a couple of smaller commits and adjustments. I was quite surprised that I received a bunch of feedback and requests about Gemtexter so it means that I am not the only person in the universe actually using it. +* ⇢ Gemtexter 1.1.0 - Let's Gemtext again +* ⇢ ⇢ What's new? +* ⇢ ⇢ ⇢ Automatic check for GNU version requirements +* ⇢ ⇢ ⇢ Backticks now produce `inline code blocks` in the HTML output +* ⇢ ⇢ ⇢ Cache for Atom feed generation +* ⇢ ⇢ ⇢ Input filter support +* ⇢ ⇢ ⇢ Revamped `git` support +* ⇢ ⇢ ⇢ Addition of `htmlextras` and web font support +* ⇢ ⇢ ⇢ Sub-section support +* ⇢ ⇢ ⇢ More ## What's new? @@ -89,10 +102,11 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -=> ./2021-04-24-welcome-to-the-geminispace.gmi 2021-04-24 Welcome to the Geminispace -=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all -=> ./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi 2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again (You are currently reading this) -=> ./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi 2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again² +=> ./2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.gmi 2024-10-02 Gemtexter 3.0.0 - Let's Gemtext again⁴ => ./2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.gmi 2023-07-21 Gemtexter 2.1.0 - Let's Gemtext again³ +=> ./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi 2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again² +=> ./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi 2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again (You are currently reading this) +=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all +=> ./2021-04-24-welcome-to-the-geminispace.gmi 2021-04-24 Welcome to the Geminispace => ../ Back to the main site diff --git a/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi.tpl b/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi.tpl index 383a5d39..c1672488 100644 --- a/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi.tpl +++ b/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi.tpl @@ -2,6 +2,12 @@ > Published at 2022-08-27T18:25:57+01:00 +I proudly announce that I've released Gemtexter version `1.1.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash. + +=> https://codeberg.org/snonux/gemtexter + +It has been around a year since I released the first version `1.0.0`. Although, there aren't any groundbreaking changes, there have been a couple of smaller commits and adjustments. I was quite surprised that I received a bunch of feedback and requests about Gemtexter so it means that I am not the only person in the universe actually using it. + ``` -=[ typewriter ]=- 1/98 @@ -14,11 +20,7 @@ jgs `"""""""""` ``` -I proudly announce that I've released Gemtexter version `1.1.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash. - -=> https://codeberg.org/snonux/gemtexter - -It has been around a year since I released the first version `1.0.0`. Although, there aren't any groundbreaking changes, there have been a couple of smaller commits and adjustments. I was quite surprised that I received a bunch of feedback and requests about Gemtexter so it means that I am not the only person in the universe actually using it. +<< template::inline::toc ## What's new? @@ -89,6 +91,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -<< template::inline::index gemtext gemini +<< template::inline::rindex gemtext gemini => ../ Back to the main site diff --git a/gemfeed/2022-09-30-after-a-bad-nights-sleep.gmi b/gemfeed/2022-09-30-after-a-bad-nights-sleep.gmi index da06f41a..66c0c25c 100644 --- a/gemfeed/2022-09-30-after-a-bad-nights-sleep.gmi +++ b/gemfeed/2022-09-30-after-a-bad-nights-sleep.gmi @@ -2,6 +2,8 @@ > Published at 2022-09-30T09:53:23+03:00; Updated at 2022-10-12 +Everyone has it once in a while: A bad night's sleep. Here I attempt to list valuable tips on how to deal with it. + ``` z z @@ -16,7 +18,24 @@ jgs (________\ \ '-' ``` -Everyone has it once in a while: A bad night's sleep. Here I attempt to list valuable tips on how to deal with it. +## Table of Contents + +* ⇢ After a bad night's sleep +* ⇢ ⇢ Don't take the day off. +* ⇢ ⇢ Start work early +* ⇢ ⇢ Sweat the small stuff +* ⇢ ⇢ Enter the flow state +* ⇢ ⇢ Reschedule meetings +* ⇢ ⇢ Invent +* ⇢ ⇢ Fast +* ⇢ ⇢ Stretch +* ⇢ ⇢ Walk +* ⇢ ⇢ Red Bull +* ⇢ ⇢ Power nap +* ⇢ ⇢ Don't take anything personally. +* ⇢ ⇢ Meditate +* ⇢ ⇢ Write things down +* ⇢ ⇢ Social media ## Don't take the day off. diff --git a/gemfeed/2022-09-30-after-a-bad-nights-sleep.gmi.tpl b/gemfeed/2022-09-30-after-a-bad-nights-sleep.gmi.tpl new file mode 100644 index 00000000..02bc0121 --- /dev/null +++ b/gemfeed/2022-09-30-after-a-bad-nights-sleep.gmi.tpl @@ -0,0 +1,100 @@ +# After a bad night's sleep + +> Published at 2022-09-30T09:53:23+03:00; Updated at 2022-10-12 + +Everyone has it once in a while: A bad night's sleep. Here I attempt to list valuable tips on how to deal with it. + +``` + z + z + Z + .--. Z Z + / _(c\ .-. __ + | / / '-; \'-'` `\______ + \_\/'/ __/ ) / ) | \--, + | \`""`__-/ .'--/ /--------\ \ + \\` ///-\/ / /---;-. '-' +jgs (________\ \ + '-' +``` + +<< template::inline::toc + +## Don't take the day off. + +Don't take a day off after not sleeping enough the previous night. That would be wasting the holiday allowance. It wouldn't be possible to enjoy my free time anyway, so why not just work? There's still a way for an IT Engineer to be productive (sometimes even more) with half or less of the concentration power available! + +## Start work early + +Probably I am already awake early and am unable to fall asleep again. My strategy here is to "attack" the day: Start work early and finish early. The early bird will also encounter fewer distractions from colleagues. + +## Sweat the small stuff + +There's never a shortage of small items to hook off my list. Most of these items don't require my full concentration power, and I will be happy to get them off my list so that the next day, after a good night's sleep, I can immerse myself again in focused, deep work with all concentration powers at hand. + +Examples of "small work items" are: + +* Tidying up the workspace. +* Installing pending computer software updates. +* Going through the work backlog: Create new tickets, close obsolete ones, and roughly pre-plan upcoming work. +* Finishing off the easy tickets from the current sprint. +* Going through any tedious paperwork. +* Catch up with the journal and mark off all trivial action items. + +## Enter the flow state + +I find it easy to enter the "flow state" after a bad night's sleep. All I need to do is to put on some ambient music (preferably instrumental chill house) and start to work on a not-too-difficult ticket. + +Usually, the "flow state" is associated with deep-focused work, but deep-focused work isn't easily possible under sleep deprivation. It's still possible to be in the flow by working on more manageable tasks and leaving the difficult ones for the next day. + +## Reschedule meetings + +I find engaging in discussions and demanding meetings challenging after a lousy night's sleep. I still attend the sessions I am invited to as "only" a participant, but I prefer to reschedule all meetings I am the primary driver of. + +This, unfortunately, also includes interviews. Interviews require full concentration power. So for interviews, I would find a colleague to step in for me or ask to reschedule the interview altogether. Everything else wouldn't make it justice and would waste everyone's time! + +## Invent + +The mind works differently under sleep deprivation: It's easier to invent new stuff as it's easier to have a look at things from different perspectives. Until an hour ago, I didn't know yet what I would be blogging about for this month, and then I just started writing this, and it took me only half an hour to write the first draft of this blog post! + +## Fast + +I don't eat breakfast, and I don't eat lunch on these days. I only have dinner. Not eating means my mind doesn't get foggy, and I keep up the work momentum. This is called intermittent fasting, which not only generally helps to keep the weight under control and boosts the concentration power. Furthermore, intermittent fasting is healthy. You should include it in your routine, even after a good night's sleep. + +## Stretch + +I won't have enough energy for strenuous physical exercise on those days, but a 30 to a 60-minute stretching session can make the day. Stretching will even hurt less under sleep deprivation! The stretching could also be substituted with a light Yoga session. + +## Walk + +Walking is healthy, and the time can be used to listen to interesting podcasts. The available concentration power might not be enough for more sophisticated audio literature. I will have enough energy for one or two daily walks (~10k steps for the day in total). Sometimes, I listen to music during walks. I also try to catch the bright sunlight. + +## Red Bull + +I don't think that Red Bull is a healthy drink. But once in a while, a can in the early afternoon brings wonders, and productivity will skyrocket. Other than Red Bull, drink a lot of water throughout the day. Don't forget to drink the sugar-free version; otherwise, your intermittent fast will be broken. + +## Power nap + +I don't know how to "enforce" a nap, but sometimes I manage to power nap, and it helps wonders. A 30-minute nap sometimes brings me back to normal. If you don't tend to fast as you are too hungry, it helps to try to nap approximately 30 minutes after eating something. + +## Don't take anything personally. + +It's much more challenging to keep the mind "under control" in this state. Every annoyance can potentially upset, which could reflect on the work colleagues. It is wise to attempt to go with a positive attitude into the day, always smile and be polite to the family and colleagues at work. Don't let anything drop out to the people next; they don't deserve it as they didn't do anything wrong! Also, remember, it can't be controlled at all. It's time to let go of the annoyances for the day. + +## Meditate + +To keep the good vibe, it helps to meditate for 10 minutes. Meditation must nothing be fancy. It can be just lying on the sofa and observing your thoughts as they come and go. Don't judge your thoughts, as that could put you in a negative mood. It's not necessary to sit in an uncomfortable Yoga pose, and it is not required to chant "Ohhmmmmm". + +## Write things down + +Sometimes something requiring more concentration power demands time. This is where it helps to write a note in a journal and return to it another day. This doesn't mean slacking off but managing the rarely available concentration power for the day. I might repeat myself: Today, sweat all the small stuff. Tomorrow, do the deep-focused work on that crucial project again. + +It's easier to forget things on those days, so everything should be written down so that it can be worked off later. Things written down will not be overlooked! + +## Social media + +I wouldn't say I like checking social media, as it can consume a lot of time and can become addictive. But once in a while, I want to catch up with my "networks". After a bad night's sleep, it's the perfect time to check your social media. Once done, you don't have to do it anymore for the next couple of days! + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2022-10-30-installing-dtail-on-openbsd.gmi b/gemfeed/2022-10-30-installing-dtail-on-openbsd.gmi index 5941a7cb..9d719e05 100644 --- a/gemfeed/2022-10-30-installing-dtail-on-openbsd.gmi +++ b/gemfeed/2022-10-30-installing-dtail-on-openbsd.gmi @@ -2,6 +2,18 @@ > Published at 2022-10-30T11:03:19+02:00 +This will be a quick blog post, as I am busy with my personal life now. I have relocated to a different country and am still busy arranging things. So bear with me :-) + + In this post, I want to give a quick overview (or how-to) about installing DTail on OpenBSD, as the official documentation only covers Red Hat and Fedora Linux! And this blog post will also be used as my reference! + +=> https://dtail.dev + +I am using Rexify for my OpenBSD automation. Check out the following article covering my Rex setup in a little bit more detail: + +=> ./2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi Let's Encrypt with OpenBSD and Rex + +I will also mention some relevant `Rexfile` snippets in this post! + ``` ,_---~~~~~----._ _,,_,*^____ _____``*g*\"*, @@ -39,17 +51,19 @@ ' ' ``` -This will be a quick blog post, as I am busy with my personal life now. I have relocated to a different country and am still busy arranging things. So bear with me :-) - - In this post, I want to give a quick overview (or how-to) about installing DTail on OpenBSD, as the official documentation only covers Red Hat and Fedora Linux! And this blog post will also be used as my reference! - -=> https://dtail.dev - -I am using Rexify for my OpenBSD automation. Check out the following article covering my Rex setup in a little bit more detail: - -=> ./2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi Let's Encrypt with OpenBSD and Rex +## Table of Contents -I will also mention some relevant `Rexfile` snippets in this post! +* ⇢ Installing DTail on OpenBSD +* ⇢ ⇢ Compile it +* ⇢ ⇢ Install it +* ⇢ ⇢ ⇢ Rexification +* ⇢ ⇢ Configure it +* ⇢ ⇢ ⇢ Rexification +* ⇢ ⇢ Update the key cache for it +* ⇢ ⇢ ⇢ Rexification +* ⇢ ⇢ Start it +* ⇢ ⇢ Use it +* ⇢ ⇢ Conclusions ## Compile it @@ -343,9 +357,9 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -=> ./2021-04-22-dtail-the-distributed-log-tail-program.gmi 2021-04-22 DTail - The distributed log tail program -=> ./2022-03-06-the-release-of-dtail-4.0.0.gmi 2022-03-06 The release of DTail 4.0.0 -=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD (You are currently reading this) => ./2023-09-25-dtail-usage-examples.gmi 2023-09-25 DTail usage examples +=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD (You are currently reading this) +=> ./2022-03-06-the-release-of-dtail-4.0.0.gmi 2022-03-06 The release of DTail 4.0.0 +=> ./2021-04-22-dtail-the-distributed-log-tail-program.gmi 2021-04-22 DTail - The distributed log tail program => ../ Back to the main site diff --git a/gemfeed/2022-10-30-installing-dtail-on-openbsd.gmi.tpl b/gemfeed/2022-10-30-installing-dtail-on-openbsd.gmi.tpl index 2bb239e2..dbe4cdf7 100644 --- a/gemfeed/2022-10-30-installing-dtail-on-openbsd.gmi.tpl +++ b/gemfeed/2022-10-30-installing-dtail-on-openbsd.gmi.tpl @@ -2,6 +2,18 @@ > Published at 2022-10-30T11:03:19+02:00 +This will be a quick blog post, as I am busy with my personal life now. I have relocated to a different country and am still busy arranging things. So bear with me :-) + + In this post, I want to give a quick overview (or how-to) about installing DTail on OpenBSD, as the official documentation only covers Red Hat and Fedora Linux! And this blog post will also be used as my reference! + +=> https://dtail.dev + +I am using Rexify for my OpenBSD automation. Check out the following article covering my Rex setup in a little bit more detail: + +=> ./2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi Let's Encrypt with OpenBSD and Rex + +I will also mention some relevant `Rexfile` snippets in this post! + ``` ,_---~~~~~----._ _,,_,*^____ _____``*g*\"*, @@ -39,17 +51,7 @@ ' ' ``` -This will be a quick blog post, as I am busy with my personal life now. I have relocated to a different country and am still busy arranging things. So bear with me :-) - - In this post, I want to give a quick overview (or how-to) about installing DTail on OpenBSD, as the official documentation only covers Red Hat and Fedora Linux! And this blog post will also be used as my reference! - -=> https://dtail.dev - -I am using Rexify for my OpenBSD automation. Check out the following article covering my Rex setup in a little bit more detail: - -=> ./2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi Let's Encrypt with OpenBSD and Rex - -I will also mention some relevant `Rexfile` snippets in this post! +<< template::inline::toc ## Compile it @@ -343,6 +345,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -<< template::inline::index dtail +<< template::inline::rindex dtail => ../ Back to the main site diff --git a/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.gmi b/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.gmi index 98cacabc..dfe9fbd8 100644 --- a/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.gmi +++ b/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.gmi @@ -2,6 +2,18 @@ > Published at 2022-11-24T11:17:15+02:00; Updated at 2022-11-26 +As a long-lasting user of Vim (and NeoVim), I always wondered what GNU Emacs is really about, so I decided to try it. I didn't try vanilla GNU Emacs, but Doom Emacs. I chose Doom Emacs as it is a neat distribution of Emacs with Evil mode enabled by default. Evil mode allows Vi(m) key bindings (so to speak, it's emulating Vim within Emacs), and I am pretty sure I won't be ready to give up all the muscle memory I have built over more than a decade. + +=> https://www.gnu.org/software/emacs/ GNU Emacs +=> https://github.com/doomemacs/ Doom Emacs + +I used Doom Emacs for around two months. Still, ultimately I decided to switch back to NeoVim as my primary editor and IDE and Vim (usually pre-installed on Linux-based systems) and Nvi (usually pre-installed on *BSD systems) as my "always available editor" for quick edits. (It is worth mentioning that I don't have a high opinion on whether Vim or NeoVim is the better editor, I prefer NeoVim as it comes with better defaults out of the box, but there is no real blocker to use Vim instead). + +=> https://www.vim.org Vim +=> https://neovim.io NeoVim + +So why did I switch back to the Vi-family? + ``` _/ \ _(\(o / \ / _ ^^^o @@ -15,17 +27,16 @@ Art by \ \_! / __! ^^----^^ "^--v' ``` -As a long-lasting user of Vim (and NeoVim), I always wondered what GNU Emacs is really about, so I decided to try it. I didn't try vanilla GNU Emacs, but Doom Emacs. I chose Doom Emacs as it is a neat distribution of Emacs with Evil mode enabled by default. Evil mode allows Vi(m) key bindings (so to speak, it's emulating Vim within Emacs), and I am pretty sure I won't be ready to give up all the muscle memory I have built over more than a decade. - -=> https://www.gnu.org/software/emacs/ GNU Emacs -=> https://github.com/doomemacs/ Doom Emacs +## Table of Contents -I used Doom Emacs for around two months. Still, ultimately I decided to switch back to NeoVim as my primary editor and IDE and Vim (usually pre-installed on Linux-based systems) and Nvi (usually pre-installed on *BSD systems) as my "always available editor" for quick edits. (It is worth mentioning that I don't have a high opinion on whether Vim or NeoVim is the better editor, I prefer NeoVim as it comes with better defaults out of the box, but there is no real blocker to use Vim instead). - -=> https://www.vim.org Vim -=> https://neovim.io NeoVim - -So why did I switch back to the Vi-family? +* ⇢ I tried (Doom) Emacs, but I switched back to (Neo)Vim +* ⇢ ⇢ Emacs is a giant dragon +* ⇢ ⇢ Magit love +* ⇢ ⇢ Graphical UI +* ⇢ ⇢ Scripting it +* ⇢ ⇢ The famous Emacs Org mode +* ⇢ ⇢ Seeking simplicity +* ⇢ ⇢ Conclusion ## Emacs is a giant dragon diff --git a/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.gmi.tpl b/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.gmi.tpl new file mode 100644 index 00000000..8e44271e --- /dev/null +++ b/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.gmi.tpl @@ -0,0 +1,117 @@ +# I tried (Doom) Emacs, but I switched back to (Neo)Vim + +> Published at 2022-11-24T11:17:15+02:00; Updated at 2022-11-26 + +As a long-lasting user of Vim (and NeoVim), I always wondered what GNU Emacs is really about, so I decided to try it. I didn't try vanilla GNU Emacs, but Doom Emacs. I chose Doom Emacs as it is a neat distribution of Emacs with Evil mode enabled by default. Evil mode allows Vi(m) key bindings (so to speak, it's emulating Vim within Emacs), and I am pretty sure I won't be ready to give up all the muscle memory I have built over more than a decade. + +=> https://www.gnu.org/software/emacs/ GNU Emacs +=> https://github.com/doomemacs/ Doom Emacs + +I used Doom Emacs for around two months. Still, ultimately I decided to switch back to NeoVim as my primary editor and IDE and Vim (usually pre-installed on Linux-based systems) and Nvi (usually pre-installed on *BSD systems) as my "always available editor" for quick edits. (It is worth mentioning that I don't have a high opinion on whether Vim or NeoVim is the better editor, I prefer NeoVim as it comes with better defaults out of the box, but there is no real blocker to use Vim instead). + +=> https://www.vim.org Vim +=> https://neovim.io NeoVim + +So why did I switch back to the Vi-family? + +``` + _/ \ _(\(o + / \ / _ ^^^o + / ! \/ ! '!!!v' + ! ! \ _' ( \____ + ! . \ _!\ \===^\) +Art by \ \_! / __! + Gunnar Z. \! / \ <--- Emacs is a giant dragon + (\_ _/ _\ ) + \ ^^--^^ __-^ /(__ + ^^----^^ "^--v' +``` + +<< template::inline::toc + +## Emacs is a giant dragon + +Emacs feels like a giant dragon as it is much more than an editor or an integrated development environment. Emacs is a whole platform on its own. There's an E-Mail client, an IRC client, or even games you can run within Emacs. And you can also change Emacs within Emacs using its own Lisp dialect, Emacs Lisp (Emacs is programmed in Emacs Lisp). Therefore, Emacs is also its own programming language. You can change every aspect of Emacs within Emacs itself. People jokingly state Emacs is an operating system and that you should directly use it as the `init 1` process (if you don't know what the `init 1` process is: Under UNIX and similar operating systems, it's the very first userland processed launched. That's usually `systemd` on Linux-based systems, `launchd` on macOS, or any other init script or init system used by the OS)! + +In many aspects, Emacs is like shooting at everything with a bazooka! However, I prefer it simple. I only wanted Emacs to be a good editor (which it is, too), but there's too much other stuff in Emacs that I don't need to care about! Vim and NeoVim do one thing excellent: Being great text editors and, when loaded with plugins, decent IDEs, too. + +## Magit love + +I almost fell in love with Magit, an integrated Git client for Emacs. But I think the best way to interact with Git is to use the `git` command line directly. I don't worry about typing out all the commands, as the most commonly used commands are in my shell history. Other useful Git programs I use frequently are `bit` and `tig`. Also, get a mechanical keyboard that makes hammering whole commands into the terminal even more enjoyable. + +=> https://magit.vc/ Magit +=> https://github.com/jonas/tig Tig + +Magit is pretty neat for basic Git operations, but I found myself searching the internet for the correct sub-commands to do the things I wanted to do in Git. Mainly, the way how branches are managed is confusing. Often, I fell back to the command line to fix up the mess I produced with Magit (e.g. accidentally pushing to the wrong remote branch, so I found myself fixing things manually on the terminal with the `git` command with forced pushes....). Magit is hotkey driven, and common commands are quickly explorable through built-in hotkey menus. Still, I found it challenging to navigate to more advanced Git sub-commands that way which was much easier accomplished by using the `git` command directly. + +## Graphical UI + +If there is one thing I envy about Emacs is that it's a graphical program, whereas the Vi-family of editors are purely terminal-based. I see the benefits of being a graphical program as this enables the use of multiple fonts simultaneously to embed pictures and graphs (that would be neat as a Markdown preview, for example). There's also GVim (Vim with GTK UI), but that's more of an afterthought. + +There are now graphical front-end clients for NeoVim, but I still need to dig into them. Let me know your experience if you have one. Luckily, I don't rely on something graphical in my text editor, but it would improve how the editor looks and feels. UTF8 can already do a lot in the terminal, and terminal emulators also allow you to use TrueType fonts. Still, you will always be limited to one TTF font for the whole terminal, and it isn't possible to have, for example, a different font for headings, paragraphs, etc... you get the idea. TTF+UTF8 can't beat authentic graphics. + +## Scripting it + +It is possible to customize every aspect of Emacs through Emacs Lisp. I have done some Elk Scheme programming in the past (a dialect of Lisp), but that was a long time ago, and I am not willing to dive here again to customize my environment. I would instead take the pragmatic approach and script what I need in VimScript (a terrible language, but it gets the job done!). I watched Damian Conway's VimScript course on O'Reilly Safari Books Online, which I greatly recommend. Yes, VimScript feels clunky, funky and weird and is far less elegant than Lisp, but it gets its job done - in most cases! (That reminds me that the Vim team has announced a new major version of VimScript with improvements and language changes made - I haven't gotten to it yet - but I assume that VimScript will always stay VimScript). + +=> https://en.wikipedia.org/wiki/Emacs_Lisp Emacs Lisp +=> http://sam.zoy.org/elk/ Elk Scheme +=> http://vimscript.org/ VimScript +=> https://www.oreilly.com/library/view/scripting-vim/9781491996287/ Scripting Vim by Damian Conway + +NeoVim is also programmable with Lua, which seems to be a step up and Vim comes with a Perl plugin API (which was removed from NeoVim, but that is a different story - why would someone remove the most potent mature text manipulation programming language from one of the most powerful text editors?). + +=> https://neovim.io/doc/user/lua.html NeoVim Lua API + +One example is my workflow of how I compose my blog articles (e.g. this one you are currently reading): I am writing everything in NeoVim, but I also want to have every paragraph checked against Grammarly (as English is not my first language). So I write a whole paragraph, then I select the entire paragraph via visual selection with `SHIFT+v`, and then I press `,y` to yank the paragraph to the systems clipboard, then I paste the paragraph to Grammarly's browser window with `CTRL+v`, let Grammarly suggest the improvements, and then I copy the result back with `CTRL+c` to the system clipboard and in NeoVim I type `,i` to insert the result back overriding the old paragraph (which is still selected in visual mode) with the new content. That all sounds a bit complicated, but it's surprisingly natural and efficient. + +To come back to the example, for the clipboard integration, I use this small VimScript snippet, and I didn't have to dig into any Lisp or Perl for this: + +```vim +" Clipboard +vnoremap ,y !pbcopy<CR>ugv +vnoremap ,i !pbpaste<CR> +nmap ,i !wpbpaste<CR> +``` + +That's only a very few lines and does precisely what I want. It's quick and dirty but get's the job done! If VimScript becomes too cumbersome, I can use Lua for NeoVim scripting. + +## The famous Emacs Org mode + +Org-mode is an Emacs mode for keeping notes, authoring documents, computational notebooks, literate programming, maintaining to-do lists, planning projects, and more — in a fast and effective plain-text system. There's even a dedicated website for it: + +=> https://orgmode.org/ + +In short, Org-mode is an "interactive markup language" that helps you organize everything mentioned above. I rarely touched the surface during my two-month experiment with Emacs, and I am impressed by it, so I see the benefits of having that. But it's not for me. + +I use "Dead Tree Mode" to organize my work and notes. Dead tree? Yeah, I use an actual pen and a real paper journal (Leuchtturm or a Moleskine and a set of coloured `0.5` Muji Pens are excellent choices). That's far more immersive and flexible than a computer program can ever be. Yes, some automation and interaction with the computer (like calendar scheduling etc.) are missing. Still, an actual paper journal forces you to stay simple and focus on the actual work rather than tinkering with your computer program. (But I could not resist, and I wrote a VimScript which parses a table of contents page in Markdown format of my scanned paper journals, and NeoVim allows me to select a topic so that the corresponding PDF scan on the right journal page gets opened in an external PDF viewer (the PDF viewer is `zathura`, it uses Vi-keybindings, of course) :-). (See the appendix of this blog post for that script). + +=> https://pwmt.org/projects/zathura/ Zathura + +On the road, I also write some of my notes in Markdown format to NextCloud Notes, which is editable from my phone and via NeoVim on my computers. Markdown is much less powerful than Org-mode, but I prefer it the simple way. There's a neat terminal application, `ranger`, which I use to browse my NextCloud Notes when they are synced to a local folder on my machine. `ranger` is a file manager inspired by Vim and therefore makes use of Vim keybindings and it feels just natural to me. + +=> https://github.com/ranger/ranger Ranger - A Vim inspired file manager +Did I mention that I also use my `zsh` (my default shell) and my `tmux` (terminal multiplexer) in Vi-mode? + +=> https://zsh.sourceforge.io/ Z shell +=> https://github.com/tmux/tmux tmux terminal multiplexer + +## Seeking simplicity + +I am not ready to dive deep into the whole world of Emacs. I prefer small and simple tools as opposed to complex tools. Emacs comes with many features out of the box, whereas in Vim/NeoVim, you would need to install many plugins to replicate some of the behaviour. Yes, I need to invest time managing all the Vim/NeoVim plugins I use, but I feel more in control compared to Doom Emacs, where a framework around vanilla Emacs manages all the plugins. I could use vanilla Emacs and manage all my plugins the vanilla way, but for me, it's not worth the effort to learn and dive into that as all that I want to do I can already do with Vim/NeoVim. + +I am not saying that Vim/NeoVim are simple programs, but they are much simpler than Emacs with much smaller footprints; furthermore, they appear to be more straightforward as I am used to them. I only need Vim/NeoVim to be an editor, an IDE (through some plugins), and nothing more. + +## Conclusion + +I understand the Emacs users now. Emacs is an incredibly powerful platform for almost everything, not just text editing. With Emacs, you can do nearly everything (Writing, editing, programming, calendar scheduling and note taking, Jira integration, playing games, listening to music, reading/writing emails, browsing the web, using as a calculator, generating HTML pages, configuring interactive menus, jumping around between every feature and every file within one single session, chat on IRC, surf the Gopherspace, ... the options are endless....). If you want to have one piece of software which rules it all and you are happy to invest a large part of your time in your platform: Pick Emacs, and over time Emacs will become "your" Emacs, customized to your own needs and change the way it works, which makes the Emacs users stick even more to it. + +Vim/NeoVim also comes with a very high degree of customization options, but to a lesser extreme than Emacs (but still, a much higher degree than most other editors out there). If you want the best text editor in the world, which can also be tweaked to be a decent IDE, you are only looking for: Pick Vim or NeoVim! You would also need to invest a lot of time in learning, tweaking and customizing Vim/NeoVim, but that's a little more straightforward, and the result is much more lightweight once you get used to the "Vi way of doing things" you never would want to change back. I haven't tried the Emacs vanilla keystrokes, but they are terrible (that's probably one of the reasons why Doom Emacs uses Vim keybindings by default). + +> Update: One reader recommended to have a look at NvChad. NvChad is a NeoVim config written in Lua aiming to provide a base configuration with very beautiful UI and blazing fast startuptime (around `0.02` secs ~ `0.07` secs). They tweak UI plugins such as telescope, nvim-tree, bufferline etc well to provide an aesthetic UI experience. That sounds interesting! + +=> https://github.com/NvChad/NvChad + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2022-12-24-ultrarelearning-java-my-takeaways.gmi b/gemfeed/2022-12-24-ultrarelearning-java-my-takeaways.gmi index d3b4d94d..8c58d5de 100644 --- a/gemfeed/2022-12-24-ultrarelearning-java-my-takeaways.gmi +++ b/gemfeed/2022-12-24-ultrarelearning-java-my-takeaways.gmi @@ -2,8 +2,6 @@ > Published at 2022-12-24T23:18:40+02:00 -=> ./ultrarelearning-java-my-takeaways/learnjava.jpg - As a regular participant in the annual Pet Project competition at work, I always try to find a project where I can learn something new. In this post, I would like to share my takeaways after revisiting Java. You can read about my motivations in my "Creative universe" post: => ./2022-04-10-creative-universe.gmi Creative universe @@ -16,6 +14,23 @@ However, after that, I became a Linux Sysadmin and mainly continued programming At my workplace, as an SRE, I don't do Java a lot. I have been reading Java code to understand the software better so I can apply and suggest workarounds or fixes to existing issues and bugs. However, most of our stack is in Java, and our Software Engineers use Java as their primary programming language. +=> ./ultrarelearning-java-my-takeaways/learnjava.jpg + +## Table of Contents + +* ⇢ (Re)learning Java - My takeaways +* ⇢ ⇢ Stuck at Java 1.4 +* ⇢ ⇢ (Re)learning & upskilling to Java 18 +* ⇢ ⇢ ⇢ Effective Java +* ⇢ ⇢ ⇢ Java Pub House +* ⇢ ⇢ ⇢ Java Concurrency course +* ⇢ ⇢ ⇢ Read a lot of Java code +* ⇢ ⇢ ⇢ Observed Java code reviews +* ⇢ ⇢ ⇢ Took ownership of a roadmap-Java project +* ⇢ ⇢ The good +* ⇢ ⇢ The bad and the ugly +* ⇢ ⇢ Conclusion + ## Stuck at Java 1.4 Over time, I had been missing out on many new features that were added to the language since Java 1.4, so I decided to implement my next Pet Project in Java and learn every further aspect of the language as my main goal. Of course, I still liked the idea of winning a Pet Project Prize, but my main objective was to level up my Java skills. diff --git a/gemfeed/2022-12-24-ultrarelearning-java-my-takeaways.gmi.tpl b/gemfeed/2022-12-24-ultrarelearning-java-my-takeaways.gmi.tpl new file mode 100644 index 00000000..8c23cfb5 --- /dev/null +++ b/gemfeed/2022-12-24-ultrarelearning-java-my-takeaways.gmi.tpl @@ -0,0 +1,109 @@ +# (Re)learning Java - My takeaways + +> Published at 2022-12-24T23:18:40+02:00 + +As a regular participant in the annual Pet Project competition at work, I always try to find a project where I can learn something new. In this post, I would like to share my takeaways after revisiting Java. You can read about my motivations in my "Creative universe" post: + +=> ./2022-04-10-creative-universe.gmi Creative universe + +I have been programming in Java back in the days as a university student, and even my Diploma Thesis I implemented in Java (it would require some overhaul so that it is fully compatible with a recent version of Java, though - It still compiles and runs, but with a lot of warnings, though!): + +=> https://codeberg.org/snonux/vs-sim VS-Sim: Distributed systems simulator + +However, after that, I became a Linux Sysadmin and mainly continued programming in Perl, Puppet, bash, and a little Python. For personal use, I also programmed a bit in Haskell and C. After my Sysadmin role, I moved to London and became a Site Reliability Engineer (SRE), where I mainly programmed in Ruby, bash, Puppet and Golang and a little bit of C. + +At my workplace, as an SRE, I don't do Java a lot. I have been reading Java code to understand the software better so I can apply and suggest workarounds or fixes to existing issues and bugs. However, most of our stack is in Java, and our Software Engineers use Java as their primary programming language. + +=> ./ultrarelearning-java-my-takeaways/learnjava.jpg + +<< template::inline::toc + +## Stuck at Java 1.4 + +Over time, I had been missing out on many new features that were added to the language since Java 1.4, so I decided to implement my next Pet Project in Java and learn every further aspect of the language as my main goal. Of course, I still liked the idea of winning a Pet Project Prize, but my main objective was to level up my Java skills. + +## (Re)learning & upskilling to Java 18 + +### Effective Java + +This book was recommended by my brother and also by at least another colleague at work to be one of the best, if not the best, book about Java programming. I read the whole book from the beginning to the end and immersed myself in it. I fully agree; this is a great book. Every Java developer or Java software engineer should read it! + +=> ./ultrarelearning-java-my-takeaways/effective-java.jpg + +I recommend reading the 90-part effective Java Series on `dev.to`. It's a perfect companion to the book as it explains all the chapters again but from a slightly different perspective and helps you to really understand the content. + +=> https://dev.to/kylec32/series/2292 Kyle Carter's 90-part Effective Java Series + +### Java Pub House + +During my lunch breaks, I usually have a walk around the block or in a nearby park. I used that time to listen to the Java Pub House podcast. I listened to *every* episode and learned tons of new stuff. I can highly recommend this podcast. Especially GraalVM, a high-performance JDK distribution written for Java and other JVM languages, captured my attention. GraalVM can compile Java code into native binaries, improving performance and easing the distribution of Java programs. Because of the latter, I should release a VS-Sim GraalVM edition one day through a Linux AppImage ;-). + +=> https://www.javapubhouse.com +=> https://www.graalvm.org + +### Java Concurrency course + +I also watched a course on O'Reilly Safari Books online about Java Concurrency. That gave an excellent refresher on how the Java thread pools work and what were the concurrency primitives available in the standard library. + +### Read a lot of Java code + +First, the source code is often the best documentation (if programmed nicely), and second, it helps to get the hang of the language and standard practices. I started to read more and more Java code at work. I did that whenever I had to understand how something, in particular, worked (e.g. while troubleshooting and debugging an issue). + +### Observed Java code reviews + +Another great way to get the hang of Java again was to sneak into the code reviews of the Software Engineer colleagues. They are the expert on the matter and are a great source to copy knowledge. It's OK to stay passive and only follow the reviews. Sometimes, it's OK to step up and take ownership of the review. The developers will also always be happy to answer any naive questions which come up. + +### Took ownership of a roadmap-Java project + +Besides my Pet Project, I also took ownership of a regular roadmap Java project at work, making an internal Java service capable of running in Kubernetes. This was a bunch of minor changes and adding a bunch of classes and unit tests dealing with the statelessness and a persistent job queue in Redis. The job also involved reading and understanding a lot of already existing Java code. It wasn't part of my job description, but it was fun, and I learned a lot. The service runs smoothly in production now. Of course, all of my code got reviewed by my Software Engineering colleagues. + +## The good + +From the new language features and syntaxes, there are many personal takeaways, and I can't possibly list them all, but here are some of my personal highlights: + +* Static factory methods and public constructors both have their uses, and it pays to understand their relative merits. Often static factories are preferable (cleaner and easier to read), so avoid the reflex to provide public constructors without first considering static factories. +* Java streams were utterly new to me. I love how they can help to produce more compact code. But it's challenging to set the line of when enough is enough. Overusing streams can have the opposite effect: Code becomes more complex and challenging to understand. And it is so easy to parallelize the computation of streams by "just" marking the stream as `.parallel()` (more on that later in this post). +* Overall, object-oriented languages tend to include more and more functional paradigms. The functional interfaces, which Java provides now, are fantastic. Their full powers shine in combination with the use of streams. An entire book can be written about Java functional interfaces, so I leave it to you to do any further digging. +* Local type inference help to reduce even more boilerplate code. E.g. instead of `Hash<String,Hash<String,String>> foo = new Hash<String,Hash<String,String>>();` it's possible to just write `var foo = new Hash<String,Hash<String,String>>();` +* Class inheritance isn't the preferred way anymore to structure reusable code. Now, it's composition over inheritance. E.g. use dependency injection (inject one object to another object through its constructor) or prefer interfaces (which now also support default implementations of methods) over class inheritance. This makes sense to me as I do that already when I program in Ruby. +* I learned the `try-with-resources` pattern. Very useful in ensuring closing resources again correctly. No need anymore for complicated and nested `finally`-blocks, which used to be almost impossible to get right previously in case of an error condition (e.g. I/O error somewhere deeply nested in an input or output stream). +* Optimize only when required. It's considered to be cleaner to prefer immutable variables (declaring them as `final`). I knew that already, but for Java, it always seemed to be a waste of resources (creating entirely new objects whenever states change), but apparently, it's okay. Java also does many internal tricks for performance optimization here, e.g. interning strings. +* I learned about the concept of static member classes and the difference between non-static member classes (also sometimes known as inner classes). Non-static member classes have full access to all members of their outer class (think of closure). In contrast, static member classes act like completely separate classes without such access but provide the benefit of a nested name that can help group functionality in the code. +* I learned about the existence of thread-local variables. These are only available to the current thread and aren't shared with other threads. +* I learned about the concept of Java modules, which help to structure larger code bases better. The traditional Java packages are different. +* I learned to love the new `Optional` type. I already knew the concept from Haskell, where `Maybe` would be the corresponding type. `Optional` helps to avoid `null`-pointers but comes with some (minimal) performance penalty. So, in the end, you end up with both `Optional` types and `null`-pointers in your code (depending on the requirements). But I like to prefer `Optional` over `null`-pointer when "no result" is a valid return value from a method. +* The `enum` type is way more powerful than I thought. Initially, I felt an `enum` could only be used to define a list of constants and then to compare an instance to another instance of the same. An `enum` is still there to define a list of constants, but it's also almost like a `class` (you can implement constructors, and methods, inherit from other enums). There are quite a lot of possible use cases. +* A small but almost the most helpful thing I learned is always to use the `@Override` annotation when overriding a method from a parent class. If done, Java helps to detect any typos or type errors when overriding methods. That's useful and spares a lot of time debugging where a method was mistakenly overloaded but not overridden. +* Lambdas are much cleaner, shorter and easier to read than anonymous classes. Many Java libraries require passing instances of (anonymous) classes (e.g. in Swing) to other objects. Lambdas are so lovely because they are primarily compatible with the passing of anonymous classes, so they are a 1:1 replacement in many instances. Lambdas also play very nicely together with the Java functional interfaces, as each Lambda got a type, and the type can be an already existing functional interface (or, if you got a particular case, you could define your custom functional interface for your own set of Lambdas, of course). +* I love the concept of Java records. You can think of a record as an immutable object holding some data (as members). They are ideal for pipe and stream processing. They are much easier to define (with much less boilerplate) and come with write protection out of the box. + +## The bad and the ugly + +There are also many ugly corners in Java. Many are doomed to stay there forever due to historical decisions and ensuring backward compatibility with older versions of the Java language and the Java standard library. + +* Finalizers and cleaners seem obsolete, fragile and still, you can use them. +* In many cases, extreme caution needs to be taken to minimize the accessibility of class members. You might think that Java provides the best "out-of-the-box" solution for proper encapsulation, but the language has many loopholes. +* In the early days, Java didn't support generics yet. So what you would use is to cast everything to `Object`. Java now fully supports generics (for a while already), but you can still cast everything to `Object` and back to whatever type you want. That can lead to nasty runtime errors. Also, there's a particular case to convert between an Array of Object to an Array of String or from an Array of String to a List of String. Java can't convert between these types automatically, and extreme caution needs to be taken when enforcing so (e.g. through explicit type casts). In many of these cases, Java would print out warnings that need to be manually suppressed via annotations. Programming that way, converting data between old and new best practices, is clunky. +* If you don't know what you do, Java streams can be all wrong. Side effects in functions used in streams can be nasty to debug. Also, don't just blindly add a `.parallel()` to your stream. You need to understand what the stream does and how it exactly works; otherwise, parallelizing a stream can impact the performance drastically (in a negative way). There need to be language constructs preventing you from doing the wrong things. That's so much easier to do it right in a purely functional programming language like Haskell. +* Java is a pretty old language (already), so there are many obstacles to consider. There are too many exceptions and different outcomes of how Java code can behave. In most cases, when you write an API, every method you program needs to be documented so the user won't encounter any surprises using your code. Writing and reading a lot of documentation seems to be quite the overhead when the method name is already descriptive. +* Java serialization is broken. It works, and the language still supports it, but you better not use Java's native way of object serialization and deserialization. Unbelievable how much can get wrong here, especially regarding security (injecting arbitrary code). +* Being a bit spoiled by Golang's Goroutines, I was shocked about the limitations of the Java threads. They are resource hungry, and you can't just spin up millions of them as you would with Goroutines. I knew this limitation of threads already (as it's not a problem of the language but of how threads work in the OS), but still, I was pretty shocked when I got reminded of them again. Of course, there's a workaround: Use asynchronous sockets so that you don't waste a whole thread on a single I/O operation (in my case, waiting for a network response). Golang's runtime does that automatically for you: An OS thread will be re-used for other tasks until the network socket unblocks. Every modern programming language should support lightweight threads or Coroutines like Go's Goroutines. + + +## Conclusion + +While (re)learning Java, I felt like a student again and was quite enthusiastic about it initially. I invested around half a year, immersing myself intensively in Java (again). The last time I did that was many years ago as a university student. I even won a Silver Prize at work, implementing a project this year (2022 as of writing this). I feel confident now with understanding, debugging and patching Java code at work, which boosted my debugging and troubleshooting skills. + +I don't hate Java, but I don't love programming in it, either. I will, I guess, always see Java as the necessary to get stuff done (reading code to understand how the service works, adding a tiny feature to make my life easier, adding a quick bug fix to overcome an obstacle...). + +Although Java has significantly improved since 1.4, its code still tends to be more boilerplate. Not mainly because due to lines of code (Golang code tends to be quite repetitive, primarily when no generics are used), but due to the levels of abstractions it uses. Class hierarchies can be ten classes or deeper, and it is challenging to understand what the code is doing. Good test coverage and much documentation can mitigate the problem partially. Big enterprises use Java, and that also reflects to the language. There are too many libraries and too many abstractions that are bundled with too many legacy abstractions and interfaces and too many exceptions in the library APIs. There's even an external library named Lombok, which aims to reduce Java boilerplate code. Why is there a need for an external library? It should be all part of Java itself. + +=> https://projectlombok.org/ + +Java needs a clean cut. The clean cut shall be incompatible with previous versions of Java and only promote modern best practices without all the legacy burden carried around. The same can be said for other languages, e.g. Perl, but in Perl, they already attack the problem with the use of flags which change the behaviour of the language to more modern standards. Or do it like Python, where they had a hard (incompatible) cut from version 2 to version 3. It will be painful, for sure. But that would be the only way I would enjoy using that language as one of my primary languages to code new stuff regularly. Currently, my Java will stay limited to very few projects and the more minor things already mentioned in this post. + +Am I a Java expert now? No, by far not. But I am better now than before :-). + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2023-01-23-why-grapheneos-rox.gmi b/gemfeed/2023-01-23-why-grapheneos-rox.gmi index f9f4350d..3f869b65 100644 --- a/gemfeed/2023-01-23-why-grapheneos-rox.gmi +++ b/gemfeed/2023-01-23-why-grapheneos-rox.gmi @@ -2,6 +2,19 @@ > Published at 2023-01-23T15:31:52+02:00 +In 2021 I wrote "On Being Pedantic about Open-Source", and there was a section "What about mobile?" where I expressed the dilemma about the necessity of using proprietary mobile operating systems. With GrapheneOS, I found my perfect solution for personal mobile phone use. + +=> ./2021-08-01-on-being-pedantic-about-open-source.gmi On Being Pedantic about Open-Source + +What is GrapheneOS? + +> GrapheneOS is a privacy and security-focused mobile OS with Android app compatibility developed as a non-profit open-source project. It's focused on the research and development of privacy and security technologies, including substantial improvements to sandboxing, exploits mitigations and the permission model. + +GrapheneOS is an independent Android distribution based on the Android Open Source Project (AOSP) but hardened in multiple ways. Other independent Android distributions, like LineageOS, are also based on AOSP, but GrapheneOS takes it further so that it can be my daily driver on my phone. + +=> https://GrapheneOS.org +=> https://LineageOS.org + ``` Art by Joan Stark _.===========================._ @@ -25,18 +38,17 @@ Art by Joan Stark '-'-'-'--' ``` -In 2021 I wrote "On Being Pedantic about Open-Source", and there was a section "What about mobile?" where I expressed the dilemma about the necessity of using proprietary mobile operating systems. With GrapheneOS, I found my perfect solution for personal mobile phone use. - -=> ./2021-08-01-on-being-pedantic-about-open-source.gmi On Being Pedantic about Open-Source - -What is GrapheneOS? - -> GrapheneOS is a privacy and security-focused mobile OS with Android app compatibility developed as a non-profit open-source project. It's focused on the research and development of privacy and security technologies, including substantial improvements to sandboxing, exploits mitigations and the permission model. - -GrapheneOS is an independent Android distribution based on the Android Open Source Project (AOSP) but hardened in multiple ways. Other independent Android distributions, like LineageOS, are also based on AOSP, but GrapheneOS takes it further so that it can be my daily driver on my phone. - -=> https://GrapheneOS.org -=> https://LineageOS.org +## Table of Contents + +* ⇢ Why GrapheneOS rox +* ⇢ ⇢ User Profiles +* ⇢ ⇢ Proxying some of the Google offerings +* ⇢ ⇢ Google Play Sandboxing +* ⇢ ⇢ The camera and the cloud +* ⇢ ⇢ Fine granular permissions +* ⇢ ⇢ Termux +* ⇢ ⇢ So, why not use a pure Linux phone? +* ⇢ ⇢ Small GrapheneOS downsides ## User Profiles diff --git a/gemfeed/2023-01-23-why-grapheneos-rox.gmi.tpl b/gemfeed/2023-01-23-why-grapheneos-rox.gmi.tpl new file mode 100644 index 00000000..e266d22e --- /dev/null +++ b/gemfeed/2023-01-23-why-grapheneos-rox.gmi.tpl @@ -0,0 +1,143 @@ +# Why GrapheneOS rox + +> Published at 2023-01-23T15:31:52+02:00 + +In 2021 I wrote "On Being Pedantic about Open-Source", and there was a section "What about mobile?" where I expressed the dilemma about the necessity of using proprietary mobile operating systems. With GrapheneOS, I found my perfect solution for personal mobile phone use. + +=> ./2021-08-01-on-being-pedantic-about-open-source.gmi On Being Pedantic about Open-Source + +What is GrapheneOS? + +> GrapheneOS is a privacy and security-focused mobile OS with Android app compatibility developed as a non-profit open-source project. It's focused on the research and development of privacy and security technologies, including substantial improvements to sandboxing, exploits mitigations and the permission model. + +GrapheneOS is an independent Android distribution based on the Android Open Source Project (AOSP) but hardened in multiple ways. Other independent Android distributions, like LineageOS, are also based on AOSP, but GrapheneOS takes it further so that it can be my daily driver on my phone. + +=> https://GrapheneOS.org +=> https://LineageOS.org + +``` +Art by Joan Stark + _.===========================._ + .'` .- - __- - - -- --__--- -. `'. + __ / ,'` _|--|_________|--|_ `'. \ + /'--| ; _.'\ | ' ' | /'._ ; | + // | |_.-' .-'.' ___ '.'-. '-._| | + (\) \"` _.-` / .-'`_ `'-. \ `-._ `"/ + (\) `-' | .' .-'" "'-. '. | `-` + (\) | / .'(3)(2)(1)'. \ | + (\) | / / (4) .-. \ \ | + (\) | | |(5) ( )'==,J | | + (\) | \ \ (6) '-' (0) / / | + (\) | \ '.(7)(8)(9).' / | + (\) ___| '. '-.._..-' .' | + (\) /.--| '-._____.-' | + (\) (\) |\_ _ __ _ __ __/| + (\) (\) | | +(\)_._._.__(\) | | + (\\\\jgs\\\) '.___________________.' + '-'-'-'--' +``` + +<< template::inline::toc + +## User Profiles + +GrapheneOS allows configuring up to 32 user profiles (including a guest profile) on a single phone. A profile is a completely different environment within the phone, and it is possible to switch between them instantly. Sessions of a profile can continue running in the background or be fully terminated. Each profile can have completely different settings and different applications installed. + +I use my default profile with primarily open-source applications installed, which I trust. I use another profile for banking (PayPal, various proprietary bank apps, Amazon store app, etc.) and another profile for various Google services (which I try to avoid, but I have to use once in a while). Furthermore, I have configured a profile for Social Media use (that one isn't in my default profile, as otherwise I am tempted to scroll social media all the time, which I try to avoid and only want to do intentionally when switching to the corresponding profile!). + +The neat thing about the profiles is that some can run a sandboxed version of Google Play (see later in this post), while others don't. So some profiles can entirely operate without any Google Play, and only some profiles (to which I rarely switch) have Google Play enabled. + +You notice how much longer (multiple days) your phone can be on a single charge when Google Play Services isn't running in the background. This tells a lot about the background activities and indicates that using Google Play shouldn't be the norm. + +## Proxying some of the Google offerings + +There's also the case that I am using an app from the Google Play store (as the app isn't available from F-Droid), which doesn't require Google Play Services to run in the background. Here's where I use the Aurora Android store. The Aurora store can be installed through F-Droid. Aurora acts as an anonymous proxy from your phone to the Google Play Store and lets you install apps from there. No Google credentials are required for that! + +=> https://f-droid.org + +There's a similar solution for watching videos on YouTube. You can use the NewPipe app (also from F-Droid), which acts as an anonymous proxy for watching videos from YouTube. So there isn't any need to install the official YouTube app, and there isn't any need to login to your Google account. What's so bad about the official app? You don't know which data it is sending about you to Google, so it is a privacy concern. + +## Google Play Sandboxing + +Before switching to GrapheneOS, I had been using LineageOS on one of my phones for a couple of years. Still, I always had to have a secondary personal phone with all of these proprietary apps which (partially) only work with Google Play on the phone (e.g. Banking, Navigation, various travel apps from various Airlines, etc.) somewhere around as I didn't install Google Play on my LineageOS phone due to privacy concerns and only installed apps from the F-Droid store on it. When travelling, I always had to carry around a second phone with Google Play on it, as without it; life would become inconvenient pretty soon. + +With GrapheneOS, it is different. Here, I do not just have a separate user profile, "Google", for various Google apps where Google Play runs, but Google Play also runs in a sandbox!!! + +> GrapheneOS has a compatibility layer providing the option to install and use the official releases of Google Play in the standard app sandbox. Google Play receives no special access or privileges on GrapheneOS instead of bypassing the app sandbox and receiving a massive amount of highly privileged access. Instead, the compatibility layer teaches it how to work within the full app sandbox. It also isn't used as a backend for the OS services as it would be elsewhere since GrapheneOS doesn't use Google Play even when it's installed. + +When I need to access Google Play, I can switch to the "Google" profile. Even there, Google is sandboxed to the absolute minimum permissions required to be operational, which gives additional privacy protection. + +The sad truth is that Google Maps is still the best navigation app. When driving unknown routes, I can switch to my Google profile to use Google Maps. I don't need to do that when going streets I know about, but it is crucial (for me) to have Google Maps around when driving to a new destination. + +Also, Google Translate and Google Lens are still the best translation apps I know. I just recently relocated to another country, where I am still learning the language, so Google Lens has been proven very helpful on various occasions by ad-hoc translating text into English or German for me. + +The same applies to banking. Many banking apps require Google Play to be available (It might be even more secure to only use banking apps from the Google Play store due to official support and security updates). I rarely need to access my mobile banking app, but once in a while, I need to. As you have guessed by now, I can switch to my banking profile (with Google Play enabled), do what I need to do, and then terminate the session and go back to my default profile, and then my life can go on :-). + +It is great to have the flexibility to use any proprietary Android app when needed. That only applies to around 1% of my phone usage time, but you often don't always know when you need "that one app now". So it's perfect that it's covered with the phone you always have with you. + +## The camera and the cloud + +I really want my phone to shoot good looking pictures, so that I can later upload them to the Irregular Ninja: + +=> https://irregular.ninja + +The stock camera app of the OASP could be better. Photos usually look washed out, and the app lacks features. With GrapheneOS, there are two options: + +* Use the official Google camera app with sandboxed Google Play Services running. You will get the full Google experience here. +* Or, just use the default GrapheneOS camera app. + +The GrapheneOS camera app is much better than the stock OASP camera app. I have been comparing the photo quality of my Pixel phone under LineageOS and GrapheneOS, and the differences are pronounced. I didn't compare the quality with the official Google camera app, but I have seen some comparison videos and the differences seem like they aren't groundbreaking. + +For automatic backups of my photos, I am relying on a self-hosted instance of NextCloud (with a client app available via F-Droid). So there isn't any need to rely on any Google apps and services (Google Play Photos or Google Camera app) anymore, and that's great! + +=> https://nextcloud.com + +I also use NextCloud to synchronize my notes (NextCloud Notes), my RSS news feeds (NextCloud News) and contacts (DAVx5). All apps required are available in the F-Droid store. + +## Fine granular permissions + +Another great thing about GrapheneOS is that, besides putting your apps into different profiles, you can also restrict network access and configure storage scopes per app individually. + +For example, let's say you are installing that one proprietary app from the Google Play Store through the Aurora store, and then you want to ensure that the app doesn't send data "home" through the internet. Nothing is easier to do than that. Just remove network access permissions from that only app. + +The app also wants to store and read some data from your phone (e.g. it could be a proprietary app for enhancing photos, and therefore storage access to a photo folder would be required). In GrapheneOS, you can configure a storage scope for that particular app, e.g. only read and write from one folder but still forbid access to all other folders on your phone. + +## Termux + +Termux can be installed on any Android phone through F-Droid, so it doesn't need to be a GrapheneOS phone. But I have to mention Termux here as it significantly adds value to my phone experience. + +> Termux is an Android terminal emulator and Linux environment app that works directly with no rooting or setup required. A minimal base system is installed automatically - additional packages are available using the APT package manager. + +=> https://termux.dev + +In short, Termux is an entire Linux environment running on your Android phone. Just pair your phone with a Bluetooth keyboard, and you will have the whole Linux experience. I am only using terminal Linux applications with Termux, though. What makes it especially great is that I could write on a new blog post (in Neovim through Termux on my phone) or do some coding whilst travelling (e.g. during a flight), or look up my passwords or some other personal documents (through my terminal-based password manager). All changes I commit to Git can be synced to the server with a simple `git push` once online (e.g. after the plane landed) again. + +There are Pixel phones with a screen size of 6", and that's decent enough for occasional use like that, and everything (the phone, the BT keyboard, maybe an external battery pack) all fit nicely in a small travel pocket. + +## So, why not use a pure Linux phone? + +Strictly speaking, an Android phone is a Linux phone, but it's heavily modified and customized. For me, a "pure" Linux phone is a more streamlined Linux kernel running in a distribution like Ubuntu Touch or Mobian. + +A pure Linux phone, e.g. with Ubuntu Touch installed, e.g. on a PinePhone, Fairphone, the Librem 5 or the Volla phone, is very appealing to me. And they would also provide an even better Linux experience than Termux does. Some support running LineageOS within an Anbox, enabling you to run various proprietary Android apps occasionally within Linux. + +=> https://ubuntu-touch.io/ Ubuntu Touch +=> https://en.wikipedia.org/wiki/Linux_for_mobile_devices More Linux distributions for mobile devices + +But here, Google Play would not be sandboxed; you could not configure individual network permissions and storage scopes like in GrapheneOS. Pure Linux-compatible phones usually come with a crappy camera, and the battery life is generally pretty bad (only a few hours). Also, no big tech company pushes the development of Linux phones. Everything relies on hobbyists, whereas multiple big tech companies put a lot of effort into the Android project, and a lot of code also goes into the Android Open-Source project. + +Currently, pure Linux phones are only a nice toy to tinker with but are still not ready (will they ever?) to be the daily driver. SailfishOS may be an exception; I played around with it in the past. It is pretty usable, but it's not an option for me as it is partial a proprietary operating system. + +=> https://sailfishos.org SailfishOS + +## Small GrapheneOS downsides + +Sometimes, switching a profile to use a different app is annoying, and you can't copy and paste from the system clipboard from one profile to another. But that's a small price I am willing to pay! + +Another thing is that GrapheneOS can only run on Google Pixel phones, whereas LineageOS can be installed on a much larger variety of hardware. But on the other hand, GrapheneOS works very well on Pixel phones. The GrapheneOS team can concentrate their development efforts on a smaller set of hardware which then improves the software's quality (best example: The camera app). + +And, of course, GrapheneOS is an open-source project. This is a good thing; however, on the other side, nobody can guarantee that the OS will not break or will not damage your phone. You have to trust the GrapheneOS project and donate to the project so they can keep up with the great work. But I rather trust the GrapheneOS team than big tech. + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2023-02-26-how-to-shut-down-after-work.gmi b/gemfeed/2023-02-26-how-to-shut-down-after-work.gmi index b44387a8..fa8ea4c6 100644 --- a/gemfeed/2023-02-26-how-to-shut-down-after-work.gmi +++ b/gemfeed/2023-02-26-how-to-shut-down-after-work.gmi @@ -2,6 +2,8 @@ > Published at 2023-02-26T23:48:01+02:00 +Do you need help fully discharging from work in the evenings or for the weekend? Shutting down from work won't just improve your work-life balance; it will also significantly improve the quality of your personal life and work. After a restful weekend, you will be much more energized and productive the next working day. So it should not just be in your own, but also your employers' interest that you fully relax and shut down after work. + ``` |\ "Music should be heard not only with the ears, but also the soul." |---|--\-----------------------|-----------------------------------------| @@ -17,7 +19,16 @@ -@- [kom...@uwec.edu] ``` -Do you need help fully discharging from work in the evenings or for the weekend? Shutting down from work won't just improve your work-life balance; it will also significantly improve the quality of your personal life and work. After a restful weekend, you will be much more energized and productive the next working day. So it should not just be in your own, but also your employers' interest that you fully relax and shut down after work. +## Table of Contents + +* ⇢ How to shut down after work +* ⇢ ⇢ Have a shutdown routine +* ⇢ ⇢ Don't work when you officially don't work +* ⇢ ⇢ Distract your mind +* ⇢ ⇢ Get a pet +* ⇢ ⇢ Journal your day +* ⇢ ⇢ Don't stress about what your employer expects from you +* ⇢ ⇢ Call it a day ## Have a shutdown routine diff --git a/gemfeed/2023-02-26-how-to-shut-down-after-work.gmi.tpl b/gemfeed/2023-02-26-how-to-shut-down-after-work.gmi.tpl new file mode 100644 index 00000000..dbbb82f5 --- /dev/null +++ b/gemfeed/2023-02-26-how-to-shut-down-after-work.gmi.tpl @@ -0,0 +1,80 @@ +# How to shut down after work + +> Published at 2023-02-26T23:48:01+02:00 + +Do you need help fully discharging from work in the evenings or for the weekend? Shutting down from work won't just improve your work-life balance; it will also significantly improve the quality of your personal life and work. After a restful weekend, you will be much more energized and productive the next working day. So it should not just be in your own, but also your employers' interest that you fully relax and shut down after work. + +``` + |\ "Music should be heard not only with the ears, but also the soul." +|---|--\-----------------------|-----------------------------------------| +| | |\ | |@ |\ | +|---|---|--\-------------------|-------------/|----|------|--\----|------| +| @| | |\ |O | 3 / | |@ | | | +|---|--@|---|--\--------|------|---------/----|----|------|-------|------| +| @| @| \ |O | / | | |@ @| @|. | +|-----------|-----|-----|------|-----/---|---@|----|--------------|------| +| @| | |O | | | | @|. | +|-----------|----@|-----|------|----|---@|------------------------|------| + @| | | Larry Komro @|. + -@- [kom...@uwec.edu] +``` + +<< template::inline::toc + +## Have a shutdown routine + +Have a routine. Try to finish work around the same time every day. Write any outstanding tasks down for the next day, so you are sure you will remember them. Writing them down brings wonders as you can remove them from your mind for the remainder of the day (or the upcoming weekend) as you know you will surely pick them up the next working day. Tidying up your workplace could also count toward your daily shutdown routine. + +A commute home from the office also greatly helps, as it disconnects your work from your personal life. Don't work on your commute home, though! If you don't commute but work from home, then it helps to walk around the block or in a nearby park to disconnect from work. + +## Don't work when you officially don't work + +Unless you are self-employed, you have likely signed an N-hour per week contract with your employer, and your regular working times are from X o'clock in the morning to Y o'clock in the evening (with M minutes lunch break in the middle). And there might be some flexibility in your working times, too. But that kind of flexibility (e.g. extending the lunch break so that there is time to pick up a family member from the airport) will be agreed upon, and you will counteract it, for example, by starting working earlier the next day or working late, that one exception. But overall, your weekly working time will stay N hours. + +Another exception would be when you are on an on-call schedule and are expected to watch your work notifications out-of-office times. But that is usually only a few days per month and, therefore, not the norm. And it should also be compensated accordingly. + +There might be some maintenance work you must carry out, which can only be done over the weekend, but it should be explicitly agreed upon and compensated for. Also, there might be a scenario that a production incident comes up shortly before the end of the work day, requiring you (and your colleagues) to stay a bit longer. But this should be an exceptional case. + +Other than that, there is no reason why you should work out-of-office hours. I know many people who suffer "the fear of missing out", so slack messages and E-Mails are checked until late in the evening, during weekends or holidays. I have been improving here personally a lot over the last couple of months, but still, I fall into this trap occasionally. + +Also, when you respond to slack messages and E-Mails, your colleagues can think that you have nothing better to do. They also will take it for granted and keep slacking and messaging you out of regular office times. + +Checking for your messages constantly outside of regular office times makes it impossible to shut down and relax from work altogether. + +## Distract your mind + +Often, your mind goes back to work-related stuff even after work. That's normal as you concentrated highly on your work throughout the day. The brain unconsciously continues to work and will automatically present you with random work-related thoughts. You can counteract this by focusing on non-work stuff, which may include: + +* Exercise. A half an hour workout or yoga session, followed by some stretching, helps to calm your mind after work. +* Play (with your family, pets, friends, or video game) +* Mindfully listen to music. When have you ever "really" listened to music? I mean, not just as a background stimulation but really paid attention to the melody, rhythm, voice and lyrics? That requires focused attention and distracts you from other thoughts. +* Think of or work on that fun passion project. I currently, for example, like to learn and code a bit in Rakulang. +* Read. Nothing beats reading a good Science Fiction Novel (or whatever you prefer) before falling asleep. + +Some of these can be habit-stacked: Exercise could be combined with watching videos about your passion project (e.g. watching lectures about that new programming language you are currently learning for fun). With walking, for example, you could combine listening to an Audiobook or music, or you could also think about your passion project during that walk. + +## Get a pet + +Even if you have children, it helps wonders to get a pet. My cat, for example, will remind me a few times daily to take a few minute's breaks to pet, play or give food. So my cat not only helps me after work but throughout the day. + +My neighbour also works from home, and he has dogs, which he regularly has to take out to the park. + +## Journal your day + +If you are upset about something, making it impossible to shut down from work, write down everything (e.g., with a pen in a paper journal). Writing things down helps you to "get rid" of the negative. Especially after conflicts with colleagues or company decisions, you don't agree on. This kind of self-therapy is excellent. Brainstorm all your emotions and (even if opinionated) opinions so you have everything on paper. Once done, you don't think about it so much anymore, as you know you can access that information if required. But stopping ruminating about it will be much easier now. You will likely never access that information again, though. But at least writing the thoughts down saved your day. + +Write down three things which went well for the day. This helps you to appreciate the day. + +## Don't stress about what your employer expects from you + +Think about what's fun and motivates you. Maybe the next promotion to Principal or a Manager role isn't for you. Many fall into the trap of stressing themselves out to satisfy the employer so that the next upgrade will happen and think about it constantly, even after work. But it is more important that you enjoy your craftsmanship. Work on what you expect from yourself. Ideally, your goals should be aligned with your employer. I am not saying you should abandon everything what your manager is asking you to do, but it is, after all, your life. And you have to decide where and on what you want to work. But don't sell yourself short. Keep track of your accomplishments. + +## Call it a day + +Every day you gave your best was good; the day's outcome doesn't matter. What matters is that you know you gave your best and are closer to your goals than the previous day. This gives you a sense of progress and accomplishment. + +There are some days at work you feel drained afterwards and think you didn't progress towards your goals at all. It's more challenging to shut down from work after such a day. A quick hack is to work on a quick win before the end of the day, giving you a sense of accomplishment after all. Another way is to make progress on your fun passion project after work. It must not be work-related, but a sense of accomplishment will still be there. + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.gmi b/gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.gmi index 4646a29c..73b693f8 100644 --- a/gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.gmi +++ b/gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.gmi @@ -80,13 +80,13 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other book notes of mine are: -=> ./2023-03-16-the-pragmatic-programmer-book-notes.gmi 2023-03-16 "The Pragmatic Programmer" book notes (You are currently reading this) -=> ./2023-04-01-never-split-the-difference-book-notes.gmi 2023-04-01 "Never split the difference" book notes -=> ./2023-05-06-the-obstacle-is-the-way-book-notes.gmi 2023-05-06 "The Obstacle is the Way" book notes -=> ./2023-07-17-career-guide-and-soft-skills-book-notes.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes -=> ./2023-11-11-mind-management-book-notes.gmi 2023-11-11 "Mind Management" book notes -=> ./2024-05-01-slow-productivity-book-notes.gmi 2024-05-01 "Slow Productivity" book notes +=> ./2024-10-24-staff-engineer-book-notes.gmi 2024-10-24 "Staff Engineer" book notes => ./2024-07-07-the-stoic-challenge-book-notes.gmi 2024-07-07 "The Stoic Challenge" book notes +=> ./2024-05-01-slow-productivity-book-notes.gmi 2024-05-01 "Slow Productivity" book notes +=> ./2023-11-11-mind-management-book-notes.gmi 2023-11-11 "Mind Management" book notes +=> ./2023-07-17-career-guide-and-soft-skills-book-notes.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes +=> ./2023-05-06-the-obstacle-is-the-way-book-notes.gmi 2023-05-06 "The Obstacle is the Way" book notes +=> ./2023-04-01-never-split-the-difference-book-notes.gmi 2023-04-01 "Never split the difference" book notes +=> ./2023-03-16-the-pragmatic-programmer-book-notes.gmi 2023-03-16 "The Pragmatic Programmer" book notes (You are currently reading this) -=> ../resources.gmi More books and other resources I found useful. => ../ Back to the main site diff --git a/gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.gmi.tpl b/gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.gmi.tpl index ac8a9ae7..c9dcf7bb 100644 --- a/gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.gmi.tpl +++ b/gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.gmi.tpl @@ -80,7 +80,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other book notes of mine are: -<< template::inline::index book-notes +<< template::inline::rindex book-notes -=> ../resources.gmi More books and other resources I found useful. => ../ Back to the main site diff --git a/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi b/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi index 82e61126..43c6c9e6 100644 --- a/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi +++ b/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi @@ -2,6 +2,14 @@ > Published at 2023-03-25T17:50:32+02:00 +I proudly announce that I've released Gemtexter version `2.0.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash. + +=> https://codeberg.org/snonux/gemtexter + +This is a new major release, so it contains a breaking change (see "Meta cache made obsolete"). + +Let's list what's new! + ``` -=[ typewriters ]=- 1/98 @@ -15,13 +23,15 @@ mod. by Paul Buetow `"""""""""` ``` -I proudly announce that I've released Gemtexter version `2.0.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash. - -=> https://codeberg.org/snonux/gemtexter - -This is a new major release, so it contains a breaking change (see "Meta cache made obsolete"). +## Table of Contents -Let's list what's new! +* ⇢ Gemtexter 2.0.0 - Let's Gemtext again² +* ⇢ ⇢ Minimal template engine +* ⇢ ⇢ Added hooks +* ⇢ ⇢ Use of safer Bash options +* ⇢ ⇢ Meta cache made obsolete +* ⇢ ⇢ XMLLint support +* ⇢ ⇢ More ## Minimal template engine @@ -71,7 +81,7 @@ Another thing you can do is insert an index with links to similar blog posts. E. ``` See more entries about DTail and Golang: -<< template::inline::index dtail golang +<< template::inline::rindex dtail golang Blablabla... ``` @@ -140,10 +150,11 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -=> ./2021-04-24-welcome-to-the-geminispace.gmi 2021-04-24 Welcome to the Geminispace -=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all -=> ./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi 2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again -=> ./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi 2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again² (You are currently reading this) +=> ./2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.gmi 2024-10-02 Gemtexter 3.0.0 - Let's Gemtext again⁴ => ./2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.gmi 2023-07-21 Gemtexter 2.1.0 - Let's Gemtext again³ +=> ./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi 2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again² (You are currently reading this) +=> ./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi 2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again +=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all +=> ./2021-04-24-welcome-to-the-geminispace.gmi 2021-04-24 Welcome to the Geminispace => ../ Back to the main site diff --git a/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi.tpl b/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi.tpl index 2e322cac..b2718dda 100644 --- a/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi.tpl +++ b/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi.tpl @@ -2,6 +2,14 @@ > Published at 2023-03-25T17:50:32+02:00 +I proudly announce that I've released Gemtexter version `2.0.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash. + +=> https://codeberg.org/snonux/gemtexter + +This is a new major release, so it contains a breaking change (see "Meta cache made obsolete"). + +Let's list what's new! + ``` -=[ typewriters ]=- 1/98 @@ -15,13 +23,7 @@ mod. by Paul Buetow `"""""""""` ``` -I proudly announce that I've released Gemtexter version `2.0.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash. - -=> https://codeberg.org/snonux/gemtexter - -This is a new major release, so it contains a breaking change (see "Meta cache made obsolete"). - -Let's list what's new! +<< template::inline::toc ## Minimal template engine @@ -71,7 +73,7 @@ Another thing you can do is insert an index with links to similar blog posts. E. ``` See more entries about DTail and Golang: -[[ template::inline::index dtail golang +[[ template::inline::rindex dtail golang Blablabla... ``` @@ -140,6 +142,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -<< template::inline::index gemtext gemini +<< template::inline::rindex gemtext gemini => ../ Back to the main site diff --git a/gemfeed/2023-04-01-never-split-the-difference-book-notes.gmi b/gemfeed/2023-04-01-never-split-the-difference-book-notes.gmi index e8731c16..b2d8997f 100644 --- a/gemfeed/2023-04-01-never-split-the-difference-book-notes.gmi +++ b/gemfeed/2023-04-01-never-split-the-difference-book-notes.gmi @@ -16,6 +16,21 @@ These are my personal takeaways after reading "Never split the difference" by Ch ''' ``` +## Table of Contents + +* ⇢ "Never split the difference" book notes +* ⇢ ⇢ Tactical listening, spreading empathy +* ⇢ ⇢ Mindset of discovery +* ⇢ ⇢ ⇢ More tips +* ⇢ ⇢ "No" starts the conversation +* ⇢ ⇢ Win-win +* ⇢ ⇢ On Deadlines +* ⇢ ⇢ Analyse the opponent +* ⇢ ⇢ Use different ways of saying "no." +* ⇢ ⇢ Calibrated question +* ⇢ ⇢ The black swan +* ⇢ ⇢ More + ## Tactical listening, spreading empathy Be a mirror, copy each other to be comfy with each other to build up trust. Mirroring is mainly body language. A mirror is to repeat the words the other just said. Simple but effective. @@ -124,12 +139,13 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other book notes of mine are: -=> ./2023-03-16-the-pragmatic-programmer-book-notes.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ./2023-04-01-never-split-the-difference-book-notes.gmi 2023-04-01 "Never split the difference" book notes (You are currently reading this) -=> ./2023-05-06-the-obstacle-is-the-way-book-notes.gmi 2023-05-06 "The Obstacle is the Way" book notes -=> ./2023-07-17-career-guide-and-soft-skills-book-notes.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes -=> ./2023-11-11-mind-management-book-notes.gmi 2023-11-11 "Mind Management" book notes -=> ./2024-05-01-slow-productivity-book-notes.gmi 2024-05-01 "Slow Productivity" book notes +=> ./2024-10-24-staff-engineer-book-notes.gmi 2024-10-24 "Staff Engineer" book notes => ./2024-07-07-the-stoic-challenge-book-notes.gmi 2024-07-07 "The Stoic Challenge" book notes +=> ./2024-05-01-slow-productivity-book-notes.gmi 2024-05-01 "Slow Productivity" book notes +=> ./2023-11-11-mind-management-book-notes.gmi 2023-11-11 "Mind Management" book notes +=> ./2023-07-17-career-guide-and-soft-skills-book-notes.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes +=> ./2023-05-06-the-obstacle-is-the-way-book-notes.gmi 2023-05-06 "The Obstacle is the Way" book notes +=> ./2023-04-01-never-split-the-difference-book-notes.gmi 2023-04-01 "Never split the difference" book notes (You are currently reading this) +=> ./2023-03-16-the-pragmatic-programmer-book-notes.gmi 2023-03-16 "The Pragmatic Programmer" book notes => ../ Back to the main site diff --git a/gemfeed/2023-04-01-never-split-the-difference-book-notes.gmi.tpl b/gemfeed/2023-04-01-never-split-the-difference-book-notes.gmi.tpl index d4751c4f..d2624473 100644 --- a/gemfeed/2023-04-01-never-split-the-difference-book-notes.gmi.tpl +++ b/gemfeed/2023-04-01-never-split-the-difference-book-notes.gmi.tpl @@ -16,6 +16,8 @@ These are my personal takeaways after reading "Never split the difference" by Ch ''' ``` +<< template::inline::toc + ## Tactical listening, spreading empathy Be a mirror, copy each other to be comfy with each other to build up trust. Mirroring is mainly body language. A mirror is to repeat the words the other just said. Simple but effective. @@ -124,6 +126,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other book notes of mine are: -<< template::inline::index book-notes +<< template::inline::rindex book-notes => ../ Back to the main site diff --git a/gemfeed/2023-04-09-algorithms-and-data-structures-in-golang-part-1.gmi b/gemfeed/2023-04-09-algorithms-and-data-structures-in-golang-part-1.gmi deleted file mode 100644 index 3a05cd59..00000000 --- a/gemfeed/2023-04-09-algorithms-and-data-structures-in-golang-part-1.gmi +++ /dev/null @@ -1,231 +0,0 @@ -# Algorithms and Data Structures in Go - Part 1 - -> Published at 2023-04-09T22:31:42+03:00 - -``` - ,_---~~~~~----._ - _,,_,*^____ _____``*g*\"*, - / __/ /' ^. / \ ^@q f -[ @f | @)) | | @)) l 0 _/ - \`/ \~____ / __ \_____/ \ - | _l__l_ I - } [______] I - ] | | | | - ] ~ ~ | - | | - | | -``` - -This is the first blog post about my Algorithms and Data Structures in Go series. I am not a Software Developer in my day job. In my current role, programming and scripting skills are desirable but not mandatory. I have been learning about Data Structures and Algorithms many years ago at University. I thought it would be fun to revisit/refresh my knowledge here and implement many of the algorithms in Go. - -=> ./2023-04-09-algorithms-and-data-structures-in-golang-part-1.gmi 2023-04-09 Algorithms and Data Structures in Go - Part 1 (You are currently reading this) - -This post is about setting up some basic data structures and methods for this blog series. I promise, everything will be easy to follow in this post. It will become more interesting later in this series. - -## Type constraints - -First, the package `ds` (data structures) defines the `types.go`. All examples will either operate on the `Integer` or `Number` type: - -```go -package ds - -import ( - "golang.org/x/exp/constraints" -) - -type Integer interface { - constraints.Integer -} - -type Number interface { - constraints.Integer | constraints.Float -} - -``` - -## ArrayList - -Next comes the `arraylist.go`, which defines the underlying data structure all the algorithms of this series will use. `ArrayList` is just a type alias of a Go array (or slice) with custom methods on it: - -```go -package ds - -import ( - "fmt" - "math/rand" - "strings" -) - -type ArrayList[V Number] []V - -func NewArrayList[V Number](l int) ArrayList[V] { - return make(ArrayList[V], l) -} -``` - -As you can see, the code uses Go generics, which I refactored recently. Besides the default constructor (which only returns an empty `ArrayList` with a given capacity), there are also a bunch of special constructors. `NewRandomArrayList` is returning an `ArrayList` with random numbers, `NewAscendingArrayList` and `NewDescendingArrayList` are returning `ArrayList`s in either ascending or descending order. They all will be used later on for testing and benchmarking the algorithms. - -```go -func NewRandomArrayList[V Number](l, max int) ArrayList[V] { - a := make(ArrayList[V], l) - for i := 0; i < l; i++ { - if max > 0 { - a[i] = V(rand.Intn(max)) - continue - } - a[i] = V(rand.Int()) - } - return a -} - -func NewAscendingArrayList[V Number](l int) ArrayList[V] { - a := make(ArrayList[V], l) - for i := 0; i < l; i++ { - a[i] = V(i) - } - return a -} - -func NewDescendingArrayList[V Number](l int) ArrayList[V] { - a := make(ArrayList[V], l) - j := l - 1 - for i := 0; i < l; i++ { - a[i] = V(j) - j-- - } - return a -} -``` - -## Helper methods - -The `FirstN` method only returns the first N elements of the `ArrayList`. This is useful for printing out only parts of the data structure: - -```go -func (a ArrayList[V]) FirstN(n int) string { - var sb strings.Builder - j := n - - l := len(a) - if j > l { - j = l - } - - for i := 0; i < j; i++ { - fmt.Fprintf(&sb, "%v ", a[i]) - } - - if j < l { - fmt.Fprintf(&sb, "... ") - } - - return sb.String() -} -``` - -The `Sorted` method checks whether the `ArrayList` is sorted. This will be used by the unit tests later on: - -```go -func (a ArrayList[V]) Sorted() bool { - for i := len(a) - 1; i > 0; i-- { - if a[i] < a[i-1] { - return false - } - } - return true -} -``` - -And the last utility method used is `Swap`, which allows swapping the values of two indices in the `ArrayList`: - -```go -func (a ArrayList[V]) Swap(i, j int) { - aux := a[i] - a[i] = a[j] - a[j] = aux -} - -``` - -## Sleep sort - -Let's implement our first algorithm, sleep sort. Sleep sort is a non-traditional and unconventional sorting algorithm based on the idea of waiting a certain amount of time corresponding to the value of each element in the input `ArrayList`. It's more of a fun, creative concept rather than an efficient or practical sorting technique. This is not a sorting algorithm you would use in any production code. As you can imagine, it is quite an inefficient sorting algorithm (it's only listed here as a warm-up exercise). This sorting method may also return false results depending on how the Goroutines are scheduled by the Go runtime. - - -```go -package sort - -import ( - "codeberg.org/snonux/algorithms/ds" - "sync" - "time" -) - -func Sleep[V ds.Integer](a ds.ArrayList[V]) ds.ArrayList[V] { - sorted := ds.NewArrayList[V](len(a)) - - numCh := make(chan V) - var wg sync.WaitGroup - wg.Add(len(a)) - - go func() { - wg.Wait() - close(numCh) - }() - - for _, num := range a { - go func(num V) { - defer wg.Done() - time.Sleep(time.Duration(num) * time.Second) - numCh <- num - }(num) - } - - for num := range numCh { - sorted = append(sorted, num) - } - - return sorted -} -``` - -This Go code implements the sleep sort algorithm using generics and goroutines. The main function `Sleep[V ds.Integer](a ds.ArrayList[V]) ds.ArrayList[V]` takes a generic `ArrayList` as input and returns a sorted `ArrayList`. The code creates a separate goroutine for each element in the input array, sleeps for a duration proportional to the element's value, and then sends the element to a channel. Another goroutine waits for all the sleeping goroutines to finish and then closes the channel. The sorted result `ArrayList` is constructed by appending the elements received from the channel in the order they arrive. The `sync.WaitGroup` is used to synchronize goroutines and ensure that all of them have completed before closing the channel. - -### Testing - -For testing, we only allow values up to 10, as otherwise, it would take too long to finish: - -```go -package sort - -import ( - "fmt" - "testing" - - "codeberg.org/snonux/algorithms/ds" -) - -func TestSleepSort(t *testing.T) { - a := ds.NewRandomArrayList[int](10, 10) - a = Sleep(a) - if !a.Sorted() { - t.Errorf("Array not sorted: %v", a) - } -} -``` - -As you can see, it takes `9s` here for the algorithm to finish (which is the highest value in the `ArrayList`): - -```sh -❯ go test ./sort -v -run SleepSort -=== RUN TestSleepSort ---- PASS: TestSleepSort (9.00s) -PASS -ok codeberg.org/snonux/algorithms/sort 9.002s -``` - -I won't write any benchmark for sleep sort; that will be done for the algorithms to come in this series :-). - -E-Mail your comments to `paul@nospam.buetow.org` :-) - -=> ../ Back to the main site diff --git a/gemfeed/2023-04-09-algorithms-and-data-structures-in-golang-part-1.gmi.tpl b/gemfeed/2023-04-09-algorithms-and-data-structures-in-golang-part-1.gmi.tpl deleted file mode 100644 index 5f03693e..00000000 --- a/gemfeed/2023-04-09-algorithms-and-data-structures-in-golang-part-1.gmi.tpl +++ /dev/null @@ -1,231 +0,0 @@ -# Algorithms and Data Structures in Go - Part 1 - -> Published at 2023-04-09T22:31:42+03:00 - -``` - ,_---~~~~~----._ - _,,_,*^____ _____``*g*\"*, - / __/ /' ^. / \ ^@q f -[ @f | @)) | | @)) l 0 _/ - \`/ \~____ / __ \_____/ \ - | _l__l_ I - } [______] I - ] | | | | - ] ~ ~ | - | | - | | -``` - -This is the first blog post about my Algorithms and Data Structures in Go series. I am not a Software Developer in my day job. In my current role, programming and scripting skills are desirable but not mandatory. I have been learning about Data Structures and Algorithms many years ago at University. I thought it would be fun to revisit/refresh my knowledge here and implement many of the algorithms in Go. - -<< template::inline::index algorithms-and-data-structures-in-golang-part - -This post is about setting up some basic data structures and methods for this blog series. I promise, everything will be easy to follow in this post. It will become more interesting later in this series. - -## Type constraints - -First, the package `ds` (data structures) defines the `types.go`. All examples will either operate on the `Integer` or `Number` type: - -```go -package ds - -import ( - "golang.org/x/exp/constraints" -) - -type Integer interface { - constraints.Integer -} - -type Number interface { - constraints.Integer | constraints.Float -} - -``` - -## ArrayList - -Next comes the `arraylist.go`, which defines the underlying data structure all the algorithms of this series will use. `ArrayList` is just a type alias of a Go array (or slice) with custom methods on it: - -```go -package ds - -import ( - "fmt" - "math/rand" - "strings" -) - -type ArrayList[V Number] []V - -func NewArrayList[V Number](l int) ArrayList[V] { - return make(ArrayList[V], l) -} -``` - -As you can see, the code uses Go generics, which I refactored recently. Besides the default constructor (which only returns an empty `ArrayList` with a given capacity), there are also a bunch of special constructors. `NewRandomArrayList` is returning an `ArrayList` with random numbers, `NewAscendingArrayList` and `NewDescendingArrayList` are returning `ArrayList`s in either ascending or descending order. They all will be used later on for testing and benchmarking the algorithms. - -```go -func NewRandomArrayList[V Number](l, max int) ArrayList[V] { - a := make(ArrayList[V], l) - for i := 0; i < l; i++ { - if max > 0 { - a[i] = V(rand.Intn(max)) - continue - } - a[i] = V(rand.Int()) - } - return a -} - -func NewAscendingArrayList[V Number](l int) ArrayList[V] { - a := make(ArrayList[V], l) - for i := 0; i < l; i++ { - a[i] = V(i) - } - return a -} - -func NewDescendingArrayList[V Number](l int) ArrayList[V] { - a := make(ArrayList[V], l) - j := l - 1 - for i := 0; i < l; i++ { - a[i] = V(j) - j-- - } - return a -} -``` - -## Helper methods - -The `FirstN` method only returns the first N elements of the `ArrayList`. This is useful for printing out only parts of the data structure: - -```go -func (a ArrayList[V]) FirstN(n int) string { - var sb strings.Builder - j := n - - l := len(a) - if j > l { - j = l - } - - for i := 0; i < j; i++ { - fmt.Fprintf(&sb, "%v ", a[i]) - } - - if j < l { - fmt.Fprintf(&sb, "... ") - } - - return sb.String() -} -``` - -The `Sorted` method checks whether the `ArrayList` is sorted. This will be used by the unit tests later on: - -```go -func (a ArrayList[V]) Sorted() bool { - for i := len(a) - 1; i > 0; i-- { - if a[i] < a[i-1] { - return false - } - } - return true -} -``` - -And the last utility method used is `Swap`, which allows swapping the values of two indices in the `ArrayList`: - -```go -func (a ArrayList[V]) Swap(i, j int) { - aux := a[i] - a[i] = a[j] - a[j] = aux -} - -``` - -## Sleep sort - -Let's implement our first algorithm, sleep sort. Sleep sort is a non-traditional and unconventional sorting algorithm based on the idea of waiting a certain amount of time corresponding to the value of each element in the input `ArrayList`. It's more of a fun, creative concept rather than an efficient or practical sorting technique. This is not a sorting algorithm you would use in any production code. As you can imagine, it is quite an inefficient sorting algorithm (it's only listed here as a warm-up exercise). This sorting method may also return false results depending on how the Goroutines are scheduled by the Go runtime. - - -```go -package sort - -import ( - "codeberg.org/snonux/algorithms/ds" - "sync" - "time" -) - -func Sleep[V ds.Integer](a ds.ArrayList[V]) ds.ArrayList[V] { - sorted := ds.NewArrayList[V](len(a)) - - numCh := make(chan V) - var wg sync.WaitGroup - wg.Add(len(a)) - - go func() { - wg.Wait() - close(numCh) - }() - - for _, num := range a { - go func(num V) { - defer wg.Done() - time.Sleep(time.Duration(num) * time.Second) - numCh <- num - }(num) - } - - for num := range numCh { - sorted = append(sorted, num) - } - - return sorted -} -``` - -This Go code implements the sleep sort algorithm using generics and goroutines. The main function `Sleep[V ds.Integer](a ds.ArrayList[V]) ds.ArrayList[V]` takes a generic `ArrayList` as input and returns a sorted `ArrayList`. The code creates a separate goroutine for each element in the input array, sleeps for a duration proportional to the element's value, and then sends the element to a channel. Another goroutine waits for all the sleeping goroutines to finish and then closes the channel. The sorted result `ArrayList` is constructed by appending the elements received from the channel in the order they arrive. The `sync.WaitGroup` is used to synchronize goroutines and ensure that all of them have completed before closing the channel. - -### Testing - -For testing, we only allow values up to 10, as otherwise, it would take too long to finish: - -```go -package sort - -import ( - "fmt" - "testing" - - "codeberg.org/snonux/algorithms/ds" -) - -func TestSleepSort(t *testing.T) { - a := ds.NewRandomArrayList[int](10, 10) - a = Sleep(a) - if !a.Sorted() { - t.Errorf("Array not sorted: %v", a) - } -} -``` - -As you can see, it takes `9s` here for the algorithm to finish (which is the highest value in the `ArrayList`): - -```sh -❯ go test ./sort -v -run SleepSort -=== RUN TestSleepSort ---- PASS: TestSleepSort (9.00s) -PASS -ok codeberg.org/snonux/algorithms/sort 9.002s -``` - -I won't write any benchmark for sleep sort; that will be done for the algorithms to come in this series :-). - -E-Mail your comments to `paul@nospam.buetow.org` :-) - -=> ../ Back to the main site diff --git a/gemfeed/2023-05-01-unveiling-guprecords b/gemfeed/2023-05-01-unveiling-guprecords index e69de29b..8b137891 100644 --- a/gemfeed/2023-05-01-unveiling-guprecords +++ b/gemfeed/2023-05-01-unveiling-guprecords @@ -0,0 +1 @@ + diff --git a/gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.gmi b/gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.gmi index 8ba2d64a..d8ca61fd 100644 --- a/gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.gmi +++ b/gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.gmi @@ -19,7 +19,15 @@ +-----+-----------------+-----------------------------+ ``` -# Introduction +## Table of Contents + +* ⇢ Unveiling `guprecords.raku`: Global Uptime Records with Raku +* ⇢ ⇢ Introduction +* ⇢ ⇢ How Guprecords works +* ⇢ ⇢ Example +* ⇢ ⇢ Conclusion + +## Introduction For fun, I am tracking the uptime of various personal machines (servers, laptops, workstations...). I have been doing this for over ten years now, so I have a lot of statistics collected. @@ -151,10 +159,10 @@ E-Mail your comments to hi@foo.zone :-) Other related posts are: -=> ./2008-06-26-perl-poetry.gmi 2008-06-26 Perl Poetry -=> ./2011-05-07-perl-daemon-service-framework.gmi 2011-05-07 Perl Daemon (Service Framework) -=> ./2022-05-27-perl-is-still-a-great-choice.gmi 2022-05-27 Perl is still a great choice -=> ./2022-06-15-sweating-the-small-stuff.gmi 2022-06-15 Sweating the small stuff - Tiny projects of mine => ./2023-05-01-unveiling-guprecords:-uptime-records-with-raku.gmi 2023-05-01 Unveiling `guprecords.raku`: Global Uptime Records with Raku (You are currently reading this) +=> ./2022-06-15-sweating-the-small-stuff.gmi 2022-06-15 Sweating the small stuff - Tiny projects of mine +=> ./2022-05-27-perl-is-still-a-great-choice.gmi 2022-05-27 Perl is still a great choice +=> ./2011-05-07-perl-daemon-service-framework.gmi 2011-05-07 Perl Daemon (Service Framework) +=> ./2008-06-26-perl-poetry.gmi 2008-06-26 Perl Poetry => ../ Back to the main site diff --git a/gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.gmi.tpl b/gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.gmi.tpl index d1edab1d..bddc2c9b 100644 --- a/gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.gmi.tpl +++ b/gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.gmi.tpl @@ -19,7 +19,9 @@ +-----+-----------------+-----------------------------+ ``` -# Introduction +<< template::inline::toc + +## Introduction For fun, I am tracking the uptime of various personal machines (servers, laptops, workstations...). I have been doing this for over ten years now, so I have a lot of statistics collected. @@ -151,6 +153,6 @@ E-Mail your comments to hi@foo.zone :-) Other related posts are: -<< template::inline::index perl raku sweating-the-small-stuff +<< template::inline::rindex perl raku sweating-the-small-stuff => ../ Back to the main site diff --git a/gemfeed/2023-05-06-the-obstacle-is-the-way-book-notes.gmi b/gemfeed/2023-05-06-the-obstacle-is-the-way-book-notes.gmi index 3626c547..69df8d57 100644 --- a/gemfeed/2023-05-06-the-obstacle-is-the-way-book-notes.gmi +++ b/gemfeed/2023-05-06-the-obstacle-is-the-way-book-notes.gmi @@ -4,7 +4,6 @@ These are my personal takeaways after reading "The Obstacle Is the Way" by Ryan Holiday. This is mainly for my own use, but you might find it helpful too. - ``` ,.......... .........., ,..,' '.' ',.., @@ -17,6 +16,22 @@ These are my personal takeaways after reading "The Obstacle Is the Way" by Ryan ''' ``` +## Table of Contents + +* ⇢ "The Obstacle is the Way" book notes +* ⇢ ⇢ Reframe your perspective +* ⇢ ⇢ Embrace rationality +* ⇢ ⇢ Control your response +* ⇢ ⇢ Practice emotional and physical resilience +* ⇢ ⇢ Persistence and patience +* ⇢ ⇢ Embrace failure +* ⇢ ⇢ Be adaptable +* ⇢ ⇢ Embrace non-action +* ⇢ ⇢ Leverage crisis +* ⇢ ⇢ Build your inner citadel +* ⇢ ⇢ Love everything that happens +* ⇢ ⇢ Conclusion + "The obstacle is the way" is a powerful statement that encapsulates the wisdom of turning challenges into opportunities for growth and success. We will explore using obstacles as fuel, transforming weaknesses into strengths, and adopting a mindset that allows us to be creative and persistent in the face of adversity. ## Reframe your perspective @@ -27,7 +42,6 @@ We spend a lot of time trying to get things perfect and look at the rules, but w Don't always try to use the front door; a backdoor could open. It's nonsense. Don't fight the judo master with judo. Non-action can be action, exposing the weaknesses of others. - ## Embrace rationality It is a superpower to see things rationally when others are fearful. Focus on the reality of the situation without letting emotions, such as anger, cloud your judgment. This ability will enable you to make better decisions in adversity. Ability to see things what they really are. E.g. wine is old fermented grapes, or other people behaving like animals during a fight. Show the middle finger if someone persists on the stupid rules occasionally. @@ -86,13 +100,13 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other book notes of mine are: -=> ./2023-03-16-the-pragmatic-programmer-book-notes.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ./2023-04-01-never-split-the-difference-book-notes.gmi 2023-04-01 "Never split the difference" book notes -=> ./2023-05-06-the-obstacle-is-the-way-book-notes.gmi 2023-05-06 "The Obstacle is the Way" book notes (You are currently reading this) -=> ./2023-07-17-career-guide-and-soft-skills-book-notes.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes -=> ./2023-11-11-mind-management-book-notes.gmi 2023-11-11 "Mind Management" book notes -=> ./2024-05-01-slow-productivity-book-notes.gmi 2024-05-01 "Slow Productivity" book notes +=> ./2024-10-24-staff-engineer-book-notes.gmi 2024-10-24 "Staff Engineer" book notes => ./2024-07-07-the-stoic-challenge-book-notes.gmi 2024-07-07 "The Stoic Challenge" book notes +=> ./2024-05-01-slow-productivity-book-notes.gmi 2024-05-01 "Slow Productivity" book notes +=> ./2023-11-11-mind-management-book-notes.gmi 2023-11-11 "Mind Management" book notes +=> ./2023-07-17-career-guide-and-soft-skills-book-notes.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes +=> ./2023-05-06-the-obstacle-is-the-way-book-notes.gmi 2023-05-06 "The Obstacle is the Way" book notes (You are currently reading this) +=> ./2023-04-01-never-split-the-difference-book-notes.gmi 2023-04-01 "Never split the difference" book notes +=> ./2023-03-16-the-pragmatic-programmer-book-notes.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ../resources.gmi More books and other resources I found useful. => ../ Back to the main site diff --git a/gemfeed/2023-05-06-the-obstacle-is-the-way-book-notes.gmi.tpl b/gemfeed/2023-05-06-the-obstacle-is-the-way-book-notes.gmi.tpl index 92ccc20b..20522eb9 100644 --- a/gemfeed/2023-05-06-the-obstacle-is-the-way-book-notes.gmi.tpl +++ b/gemfeed/2023-05-06-the-obstacle-is-the-way-book-notes.gmi.tpl @@ -4,7 +4,6 @@ These are my personal takeaways after reading "The Obstacle Is the Way" by Ryan Holiday. This is mainly for my own use, but you might find it helpful too. - ``` ,.......... .........., ,..,' '.' ',.., @@ -17,6 +16,8 @@ These are my personal takeaways after reading "The Obstacle Is the Way" by Ryan ''' ``` +<< template::inline::toc + "The obstacle is the way" is a powerful statement that encapsulates the wisdom of turning challenges into opportunities for growth and success. We will explore using obstacles as fuel, transforming weaknesses into strengths, and adopting a mindset that allows us to be creative and persistent in the face of adversity. ## Reframe your perspective @@ -27,7 +28,6 @@ We spend a lot of time trying to get things perfect and look at the rules, but w Don't always try to use the front door; a backdoor could open. It's nonsense. Don't fight the judo master with judo. Non-action can be action, exposing the weaknesses of others. - ## Embrace rationality It is a superpower to see things rationally when others are fearful. Focus on the reality of the situation without letting emotions, such as anger, cloud your judgment. This ability will enable you to make better decisions in adversity. Ability to see things what they really are. E.g. wine is old fermented grapes, or other people behaving like animals during a fight. Show the middle finger if someone persists on the stupid rules occasionally. @@ -86,7 +86,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other book notes of mine are: -<< template::inline::index book-notes +<< template::inline::rindex book-notes -=> ../resources.gmi More books and other resources I found useful. => ../ Back to the main site diff --git a/gemfeed/2023-06-01-kiss-server-monitoring-with-gogios.gmi b/gemfeed/2023-06-01-kiss-server-monitoring-with-gogios.gmi index cec0f470..cea5942b 100644 --- a/gemfeed/2023-06-01-kiss-server-monitoring-with-gogios.gmi +++ b/gemfeed/2023-06-01-kiss-server-monitoring-with-gogios.gmi @@ -2,16 +2,31 @@ > Published at 2023-06-01T21:10:17+03:00 -=> ./kiss-server-monitoring-with-gogios/gogios-small.png Gogios logo - -## Introduction - Gogios is a minimalistic and easy-to-use monitoring tool I programmed in Google Go designed specifically for small-scale self-hosted servers and virtual machines. The primary purpose of Gogios is to monitor my personal server infrastructure for `foo.zone`, my MTAs, my authoritative DNS servers, my NextCloud, Wallabag and Anki sync server installations, etc. With compatibility with the Nagios Check API, Gogios offers a simple yet effective solution to monitor a limited number of resources. In theory, Gogios scales to a couple of thousand checks, though. You can clone it from Codeberg here: => https://codeberg.org/snonux/gogios +=> ./kiss-server-monitoring-with-gogios/gogios-small.png Gogios logo + +## Table of Contents + +* ⇢ KISS server monitoring with Gogios +* ⇢ ⇢ Motivation +* ⇢ ⇢ Features +* ⇢ ⇢ Example alert +* ⇢ ⇢ Installation +* ⇢ ⇢ ⇢ Compiling and installing Gogios +* ⇢ ⇢ ⇢ Setting up user, group and directories +* ⇢ ⇢ ⇢ Installing monitoring plugins +* ⇢ ⇢ Configuration +* ⇢ ⇢ ⇢ MTA +* ⇢ ⇢ ⇢ Configuring Gogios +* ⇢ ⇢ Running Gogios +* ⇢ ⇢ ⇢ High-availability +* ⇢ ⇢ Conclusion: + ``` _____________________________ ____________________________ / \ / \ @@ -240,9 +255,9 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other KISS-related posts are: -=> ./2021-09-12-keep-it-simple-and-stupid.gmi 2021-09-12 Keep it simple and stupid -=> ./2023-06-01-kiss-server-monitoring-with-gogios.gmi 2023-06-01 KISS server monitoring with Gogios (You are currently reading this) -=> ./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.gmi 2023-10-29 KISS static web photo albums with `photoalbum.sh` => ./2024-04-01-KISS-high-availability-with-OpenBSD.gmi 2024-04-01 KISS high-availability with OpenBSD +=> ./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.gmi 2023-10-29 KISS static web photo albums with `photoalbum.sh` +=> ./2023-06-01-kiss-server-monitoring-with-gogios.gmi 2023-06-01 KISS server monitoring with Gogios (You are currently reading this) +=> ./2021-09-12-keep-it-simple-and-stupid.gmi 2021-09-12 Keep it simple and stupid => ../ Back to the main site diff --git a/gemfeed/2023-06-01-kiss-server-monitoring-with-gogios.gmi.tpl b/gemfeed/2023-06-01-kiss-server-monitoring-with-gogios.gmi.tpl index ec42c787..f306499e 100644 --- a/gemfeed/2023-06-01-kiss-server-monitoring-with-gogios.gmi.tpl +++ b/gemfeed/2023-06-01-kiss-server-monitoring-with-gogios.gmi.tpl @@ -2,16 +2,16 @@ > Published at 2023-06-01T21:10:17+03:00 -=> ./kiss-server-monitoring-with-gogios/gogios-small.png Gogios logo - -## Introduction - Gogios is a minimalistic and easy-to-use monitoring tool I programmed in Google Go designed specifically for small-scale self-hosted servers and virtual machines. The primary purpose of Gogios is to monitor my personal server infrastructure for `foo.zone`, my MTAs, my authoritative DNS servers, my NextCloud, Wallabag and Anki sync server installations, etc. With compatibility with the Nagios Check API, Gogios offers a simple yet effective solution to monitor a limited number of resources. In theory, Gogios scales to a couple of thousand checks, though. You can clone it from Codeberg here: => https://codeberg.org/snonux/gogios +=> ./kiss-server-monitoring-with-gogios/gogios-small.png Gogios logo + +<< template::inline::toc + ``` _____________________________ ____________________________ / \ / \ @@ -240,6 +240,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other KISS-related posts are: -<< template::inline::index kiss simple-and-stupid +<< template::inline::rindex kiss simple-and-stupid => ../ Back to the main site diff --git a/gemfeed/2023-07-17-career-guide-and-soft-skills-book-notes.gmi b/gemfeed/2023-07-17-career-guide-and-soft-skills-book-notes.gmi index ac5fcbb4..21c3d1ed 100644 --- a/gemfeed/2023-07-17-career-guide-and-soft-skills-book-notes.gmi +++ b/gemfeed/2023-07-17-career-guide-and-soft-skills-book-notes.gmi @@ -16,9 +16,41 @@ These notes are of two books by "John Sommez" I found helpful. I also added some ''' ``` -# Improve - -## Always learn new things +## Table of Contents + +* ⇢ "Software Developmers Career Guide and Soft Skills" book notes +* ⇢ ⇢ Improve +* ⇢ ⇢ ⇢ Always learn new things +* ⇢ ⇢ ⇢ Set goals +* ⇢ ⇢ ⇢ Ratings +* ⇢ ⇢ ⇢ Promotions +* ⇢ ⇢ ⇢ Finish things +* ⇢ ⇢ Expand the empire +* ⇢ ⇢ Be pragmatic and also manage your time +* ⇢ ⇢ ⇢ The quota system +* ⇢ ⇢ ⇢ Don't waste time +* ⇢ ⇢ ⇢ Habits +* ⇢ Work-life balance +* ⇢ ⇢ Mental health +* ⇢ ⇢ Physical health +* ⇢ ⇢ No drama +* ⇢ Personal brand +* ⇢ ⇢ Market yourself +* ⇢ ⇢ Networking +* ⇢ ⇢ Public speaking +* ⇢ New job +* ⇢ ⇢ For the interview +* ⇢ ⇢ Find the right type of company +* ⇢ ⇢ Apply for the new job +* ⇢ ⇢ Negotiation +* ⇢ ⇢ Leaving the old job +* ⇢ Other things +* ⇢ ⇢ Testing +* ⇢ ⇢ Books to read + +## Improve + +### Always learn new things When you learn something new, e.g. a programming language, first gather an overview, learn from multiple sources, play around and learn by doing and not consuming and form your own questions. Don't read too much upfront. A large amount of time is spent in learning technical skills which were never use. You want to have a practical set of skills you are actually using. You need to know 20 percent to get out 80 percent of the results. @@ -35,18 +67,18 @@ Fake it until you make it. But be honest about your abilities or lack of. There Boot camps: The advantage of a boot camp is to pragmatically learn things fast. We almost always overestimate what we can do in a day. Especially during boot camps. Connect to others during the boot camps -## Set goals +### Set goals Your own goals are important but the manager also looks at how the team performs and how someone can help the team perform better. Check whether you are on track with your goals every 2 weeks in order to avoid surprises for the annual review. Make concrete goals for next review. Track and document your progress. Invest in your education. Make your goals known. If you want something, then ask for it. Nobody but you knows what you want. -## Ratings +### Ratings That's a trap: If you have to rate yourself, that's a trap. That never works in an unbiased way. Rate yourself always the best way but rate your weakest part as high as possible minus one point. Rate yourself as good as you can otherwise. Nobody is putting for fun a gun on his own head. * Don't do peer rating, it can fire back on you. What if the colleague becomes your new boss? * Cooperate rankings are unfortunately HR guidelines and politics and only mirror a little your actual performance. -## Promotions +### Promotions The most valuable employees are the ones who make themselves obsolete and automate all away. Keep a safety net of 3 to 6 months of finances. Safe at least 10 percent of your earnings. Also, if you make money it does not mean that you have to spent more money. Is a new car better than a used car which both can bring you from A to B? Liability vs assets. @@ -58,7 +90,7 @@ The most valuable employees are the ones who make themselves obsolete and automa * If you want a raise be specific how much and know to back your demands. Don't make a thread and no ultimatums. * Best way for a promotion is to switch jobs. You can even switch back with a better salary. -## Finish things +### Finish things Hard work is necessary for accomplish results. However, work smarter not harder. Furthermore, working smart is not a substitute for working hard. Work both, hard and smart. @@ -276,13 +308,13 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other book notes of mine are: -=> ./2023-03-16-the-pragmatic-programmer-book-notes.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ./2023-04-01-never-split-the-difference-book-notes.gmi 2023-04-01 "Never split the difference" book notes -=> ./2023-05-06-the-obstacle-is-the-way-book-notes.gmi 2023-05-06 "The Obstacle is the Way" book notes -=> ./2023-07-17-career-guide-and-soft-skills-book-notes.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes (You are currently reading this) -=> ./2023-11-11-mind-management-book-notes.gmi 2023-11-11 "Mind Management" book notes -=> ./2024-05-01-slow-productivity-book-notes.gmi 2024-05-01 "Slow Productivity" book notes +=> ./2024-10-24-staff-engineer-book-notes.gmi 2024-10-24 "Staff Engineer" book notes => ./2024-07-07-the-stoic-challenge-book-notes.gmi 2024-07-07 "The Stoic Challenge" book notes +=> ./2024-05-01-slow-productivity-book-notes.gmi 2024-05-01 "Slow Productivity" book notes +=> ./2023-11-11-mind-management-book-notes.gmi 2023-11-11 "Mind Management" book notes +=> ./2023-07-17-career-guide-and-soft-skills-book-notes.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes (You are currently reading this) +=> ./2023-05-06-the-obstacle-is-the-way-book-notes.gmi 2023-05-06 "The Obstacle is the Way" book notes +=> ./2023-04-01-never-split-the-difference-book-notes.gmi 2023-04-01 "Never split the difference" book notes +=> ./2023-03-16-the-pragmatic-programmer-book-notes.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ../resources.gmi More books and other resources I found useful. => ../ Back to the main site diff --git a/gemfeed/2023-07-17-career-guide-and-soft-skills-book-notes.gmi.tpl b/gemfeed/2023-07-17-career-guide-and-soft-skills-book-notes.gmi.tpl index 0fdeac5a..40101547 100644 --- a/gemfeed/2023-07-17-career-guide-and-soft-skills-book-notes.gmi.tpl +++ b/gemfeed/2023-07-17-career-guide-and-soft-skills-book-notes.gmi.tpl @@ -16,9 +16,11 @@ These notes are of two books by "John Sommez" I found helpful. I also added some ''' ``` -# Improve +<< template::inline::toc -## Always learn new things +## Improve + +### Always learn new things When you learn something new, e.g. a programming language, first gather an overview, learn from multiple sources, play around and learn by doing and not consuming and form your own questions. Don't read too much upfront. A large amount of time is spent in learning technical skills which were never use. You want to have a practical set of skills you are actually using. You need to know 20 percent to get out 80 percent of the results. @@ -35,18 +37,18 @@ Fake it until you make it. But be honest about your abilities or lack of. There Boot camps: The advantage of a boot camp is to pragmatically learn things fast. We almost always overestimate what we can do in a day. Especially during boot camps. Connect to others during the boot camps -## Set goals +### Set goals Your own goals are important but the manager also looks at how the team performs and how someone can help the team perform better. Check whether you are on track with your goals every 2 weeks in order to avoid surprises for the annual review. Make concrete goals for next review. Track and document your progress. Invest in your education. Make your goals known. If you want something, then ask for it. Nobody but you knows what you want. -## Ratings +### Ratings That's a trap: If you have to rate yourself, that's a trap. That never works in an unbiased way. Rate yourself always the best way but rate your weakest part as high as possible minus one point. Rate yourself as good as you can otherwise. Nobody is putting for fun a gun on his own head. * Don't do peer rating, it can fire back on you. What if the colleague becomes your new boss? * Cooperate rankings are unfortunately HR guidelines and politics and only mirror a little your actual performance. -## Promotions +### Promotions The most valuable employees are the ones who make themselves obsolete and automate all away. Keep a safety net of 3 to 6 months of finances. Safe at least 10 percent of your earnings. Also, if you make money it does not mean that you have to spent more money. Is a new car better than a used car which both can bring you from A to B? Liability vs assets. @@ -58,7 +60,7 @@ The most valuable employees are the ones who make themselves obsolete and automa * If you want a raise be specific how much and know to back your demands. Don't make a thread and no ultimatums. * Best way for a promotion is to switch jobs. You can even switch back with a better salary. -## Finish things +### Finish things Hard work is necessary for accomplish results. However, work smarter not harder. Furthermore, working smart is not a substitute for working hard. Work both, hard and smart. @@ -276,7 +278,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other book notes of mine are: -<< template::inline::index book-notes +<< template::inline::rindex book-notes -=> ../resources.gmi More books and other resources I found useful. => ../ Back to the main site diff --git a/gemfeed/2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.gmi b/gemfeed/2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.gmi index e9b3590c..4a7b4191 100644 --- a/gemfeed/2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.gmi +++ b/gemfeed/2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.gmi @@ -2,6 +2,10 @@ > Published at 2023-07-21T10:19:31+03:00 +I proudly announce that I've released Gemtexter version `2.1.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown, written in GNU Bash. + +=> https://codeberg.org/snonux/gemtexter + ``` -=[ typewriters ]=- 1/98 .-------. @@ -15,9 +19,16 @@ mod. by Paul Buetow `"""""""""` ``` -I proudly announce that I've released Gemtexter version `2.1.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown, written in GNU Bash. +## Table of Contents -=> https://codeberg.org/snonux/gemtexter +* ⇢ Gemtexter 2.1.0 - Let's Gemtext again³ +* ⇢ ⇢ Why Bash? +* ⇢ ⇢ Switch to GPL3 license +* ⇢ ⇢ Source code highlighting support +* ⇢ ⇢ HTML exact variant +* ⇢ ⇢ Use of Hack webfont by default +* ⇢ ⇢ HTML Mastodon verification support +* ⇢ ⇢ More ## Why Bash? @@ -95,10 +106,11 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -=> ./2021-04-24-welcome-to-the-geminispace.gmi 2021-04-24 Welcome to the Geminispace -=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all -=> ./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi 2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again -=> ./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi 2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again² +=> ./2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.gmi 2024-10-02 Gemtexter 3.0.0 - Let's Gemtext again⁴ => ./2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.gmi 2023-07-21 Gemtexter 2.1.0 - Let's Gemtext again³ (You are currently reading this) +=> ./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi 2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again² +=> ./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi 2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again +=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all +=> ./2021-04-24-welcome-to-the-geminispace.gmi 2021-04-24 Welcome to the Geminispace => ../ Back to the main site diff --git a/gemfeed/2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.gmi.tpl b/gemfeed/2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.gmi.tpl index 95e5ea54..8e777003 100644 --- a/gemfeed/2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.gmi.tpl +++ b/gemfeed/2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.gmi.tpl @@ -2,6 +2,10 @@ > Published at 2023-07-21T10:19:31+03:00 +I proudly announce that I've released Gemtexter version `2.1.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown, written in GNU Bash. + +=> https://codeberg.org/snonux/gemtexter + ``` -=[ typewriters ]=- 1/98 .-------. @@ -15,9 +19,7 @@ mod. by Paul Buetow `"""""""""` ``` -I proudly announce that I've released Gemtexter version `2.1.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown, written in GNU Bash. - -=> https://codeberg.org/snonux/gemtexter +<< template::inline::toc ## Why Bash? @@ -95,6 +97,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -<< template::inline::index gemtext gemini +<< template::inline::rindex gemtext gemini => ../ Back to the main site diff --git a/gemfeed/2023-08-18-site-reliability-engineering-part-1.gmi b/gemfeed/2023-08-18-site-reliability-engineering-part-1.gmi index 92432a6a..91b1b0d9 100644 --- a/gemfeed/2023-08-18-site-reliability-engineering-part-1.gmi +++ b/gemfeed/2023-08-18-site-reliability-engineering-part-1.gmi @@ -2,11 +2,12 @@ > Published at 2023-08-18T22:43:47+03:00 -The universe of Site Reliability Engineering (SRE) is like an intricate tapestry woven with diverse technology, culture, and personal grit threads. Site Reliability Engineering is one of the most demanding jobs. With all the facets, it's impossible to get bored. There is always a new challenge to master, and there is always a new technology to tinker with. It's not just technical; it's also about communication, collaboration and teamwork. I am currently employed as a Site Reliability Engineer and will try to share what SRE is about in this blog series. +Being a Site Reliability Engineer (SRE) is like stepping into a lively, ever-evolving universe. The world of SRE mixes together different tech, a unique culture, and a whole lot of determination. It’s one of the toughest but most exciting jobs out there. There's zero chance of getting bored because there's always a fresh challenge to tackle and new technology to play around with. It's not just about the tech side of things either; it's heavily rooted in communication, collaboration, and teamwork. As someone currently working as an SRE, I’m here to break it all down for you in this blog series. Let's dive into what SRE is really all about! => ./2023-08-18-site-reliability-engineering-part-1.gmi 2023-08-18 Site Reliability Engineering - Part 1: SRE and Organizational Culture (You are currently reading this) -=> ./2023-11-19-site-reliability-engineering-part-2.gmi 2023-11-19 Site Reliability Engineering - Part 2: Operational Balance in SRE -=> ./2024-01-09-site-reliability-engineering-part-3.gmi 2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect +=> ./2023-11-19-site-reliability-engineering-part-2.gmi 2023-11-19 Site Reliability Engineering - Part 2: Operational Balance +=> ./2024-01-09-site-reliability-engineering-part-3.gmi 2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture +=> ./2024-09-07-site-reliability-engineering-part-4.gmi 2024-09-07 Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers ``` ▓▓▓▓░░ @@ -32,27 +33,27 @@ DC on fire: ## SRE and Organizational Culture: Navigating the Nexus -At the heart of SRE lies the proactive mindset of "prevention over cure." Traditional IT models focused predominantly on reactive solutions, but SRE mandates a shift towards foresight. By adopting Service Level Indicators (SLIs) and Service Level Objectives (SLOs), teams are equipped with clear metrics and goals that guide them toward ensuring reliability and user satisfaction. They reflect an organisational culture prioritising user experience and constant system alignment with user needs. +At the core of SRE is the principle of "prevention over cure." Unlike traditional IT setups that mostly react to problems, SRE focuses on spotting issues before they happen. This proactive approach involves using Service Level Indicators (SLIs) and Service Level Objectives (SLOs). These tools give teams specific metrics and targets to aim for, helping them keep systems reliable and users happy. It's all about creating a culture that prioritizes user experience and makes sure everything runs smoothly to meet their needs. -Another defining SRE idea concept the "error budget." This ingenious framework accepts that no system is flawless. Failures are inevitable. However, instead of being punitive, the culture here is to accept, learn, and iterate. By providing teams with a "budget" for errors, organisations create an environment where innovation is encouraged, and failures are viewed as learning opportunities. +Another key concept in SRE is the "error budget." It’s a clever approach that recognizes no system is perfect and that failures will happen. Instead of punishing mistakes, SRE culture embraces them as chances to learn and improve. The idea is to give teams a "budget" for errors, creating a space where innovation can thrive and failures are simply seen as lessons learned. -But SRE isn't just about technology and metrics; it's also human. It challenges the "hero culture" that plagues many IT teams. While individual heroics might occasionally save the day, a sustainable model requires collective expertise. An SRE culture recognises that heroes achieve their best within teams, negating the need for a hero-centric environment. This philosophy promotes a balanced on-call experience, emphasising the importance of trust, ownership, effective communication, and collaboration as cornerstones of team success. I personally have fallen into the hero trap, and know it's unsustainable to be the only go-to person for every arising problem. +SRE isn't just about tech and metrics; it's also about people. It tackles the "hero culture" that often ends up burning out IT teams. Sure, having a hero swoop in to save the day can be great, but relying on that all the time just isn’t sustainable. Instead, SRE focuses on collective expertise and teamwork. It recognizes that heroes are at their best within a solid team, making the need for constant heroics unnecessary. This way of thinking promotes a balanced on-call experience and highlights trust, ownership, good communication, and collaboration as key to success. I've been there myself, falling into the hero trap, and I know firsthand that it's just not feasible to be the go-to person for every problem that comes up. -Additionally, the SRE model requires good documentation. However, it's essential ensuring that this documentation undergoes the same quality checks as code, reinforcing effective onboarding, training and communication. +Also, the SRE model puts a big emphasis on good documentation. It's not enough to just have docs; they need to be top-notch and go through the same quality checks as code. This really helps with onboarding new team members, training, and keeping everyone on the same page. -Organisations might face a significant challenge when adopting SRE. Some might feel SRE principles counter their goals. They might prioritise feature rollouts over reliability or view SRE practices as cumbersome. Hence, creating an SRE culture often demands patient explanations and showcasing benefits, such as increased release velocity and improved user experience. +Adopting SRE can be a big challenge for some organizations. They might think the SRE approach goes against their goals, like preferring to roll out new features quickly rather than focusing on reliability, or seeing SRE practices as too much hassle. Building an SRE culture often means taking the time to explain things patiently and showing the benefits, like faster release cycles and a better user experience. -Monitoring and observability form another SRE aspect, emphasising the need for high-quality tools to query and analyse data. This ties back to the cultural emphasis on continuous learning and adaptability. SREs, by nature, need to be curious, ready to delve into anomalies, and keen on adopting new tools and practices. +Monitoring and observability are also big parts of SRE, highlighting the need for top-notch tools to query and analyze data. This aligns with the SRE focus on continuous learning and being adaptable. SREs naturally need to be curious, ready to dive into any strange issues, and always open to picking up new tools and practices. -The success of SRE within any organisation depends on the broader acceptance of its principles. It demands a move away from siloed operations, where SRE acts as a bandage on flawed systems, to a model where reliability is everyone's responsibility. +For SRE to really work in any organization, everyone needs to buy into its principles. It's about moving away from working in isolated silos and relying on SRE to just patch things up. Instead, it’s about making reliability a shared responsibility across the whole team. -In essence, the integration of SRE principles transcends technical practices. It paves the way for a shift in organisational culture that values proactive prevention, continuous learning, collaboration, and transparent communication. The successful melding of SRE and corporate culture promises not just reliable systems but also a robust, resilient, and progressive work environment. +In short, bringing SRE principles into the mix goes beyond just the technical stuff. It helps shift the whole organizational culture to value things like preventing issues before they happen, always learning, working together, and being open with communication. When SRE and corporate culture blend well, you end up with not just reliable systems but also a strong, resilient, and forward-thinking workplace. -Organisations with the implementation of SLIs, SLOs and error budgets are already advanced in their SRE journey. It takes a lot of communication, convincing, and patience until that point is reached. +Organizations that have SLIs, SLOs, and error budgets in place are already pretty far along in their SRE journey. Getting there takes a lot of communication, convincing people, and patience. Continue with the second part of this series: -=> ./2023-11-19-site-reliability-engineering-part-2.gmi 2023-11-19 Site Reliability Engineering - Part 2: Operational Balance in SRE +=> ./2023-11-19-site-reliability-engineering-part-2.gmi 2023-11-19 Site Reliability Engineering - Part 2: Operational Balance E-Mail your comments to `paul@nospam.buetow.org` :-) diff --git a/gemfeed/2023-08-18-site-reliability-engineering-part-1.gmi.tpl b/gemfeed/2023-08-18-site-reliability-engineering-part-1.gmi.tpl index 4338da2e..d136d48a 100644 --- a/gemfeed/2023-08-18-site-reliability-engineering-part-1.gmi.tpl +++ b/gemfeed/2023-08-18-site-reliability-engineering-part-1.gmi.tpl @@ -2,7 +2,7 @@ > Published at 2023-08-18T22:43:47+03:00 -The universe of Site Reliability Engineering (SRE) is like an intricate tapestry woven with diverse technology, culture, and personal grit threads. Site Reliability Engineering is one of the most demanding jobs. With all the facets, it's impossible to get bored. There is always a new challenge to master, and there is always a new technology to tinker with. It's not just technical; it's also about communication, collaboration and teamwork. I am currently employed as a Site Reliability Engineer and will try to share what SRE is about in this blog series. +Being a Site Reliability Engineer (SRE) is like stepping into a lively, ever-evolving universe. The world of SRE mixes together different tech, a unique culture, and a whole lot of determination. It’s one of the toughest but most exciting jobs out there. There's zero chance of getting bored because there's always a fresh challenge to tackle and new technology to play around with. It's not just about the tech side of things either; it's heavily rooted in communication, collaboration, and teamwork. As someone currently working as an SRE, I’m here to break it all down for you in this blog series. Let's dive into what SRE is really all about! << template::inline::index site-reliability-engineering-part @@ -30,23 +30,23 @@ DC on fire: ## SRE and Organizational Culture: Navigating the Nexus -At the heart of SRE lies the proactive mindset of "prevention over cure." Traditional IT models focused predominantly on reactive solutions, but SRE mandates a shift towards foresight. By adopting Service Level Indicators (SLIs) and Service Level Objectives (SLOs), teams are equipped with clear metrics and goals that guide them toward ensuring reliability and user satisfaction. They reflect an organisational culture prioritising user experience and constant system alignment with user needs. +At the core of SRE is the principle of "prevention over cure." Unlike traditional IT setups that mostly react to problems, SRE focuses on spotting issues before they happen. This proactive approach involves using Service Level Indicators (SLIs) and Service Level Objectives (SLOs). These tools give teams specific metrics and targets to aim for, helping them keep systems reliable and users happy. It's all about creating a culture that prioritizes user experience and makes sure everything runs smoothly to meet their needs. -Another defining SRE idea concept the "error budget." This ingenious framework accepts that no system is flawless. Failures are inevitable. However, instead of being punitive, the culture here is to accept, learn, and iterate. By providing teams with a "budget" for errors, organisations create an environment where innovation is encouraged, and failures are viewed as learning opportunities. +Another key concept in SRE is the "error budget." It’s a clever approach that recognizes no system is perfect and that failures will happen. Instead of punishing mistakes, SRE culture embraces them as chances to learn and improve. The idea is to give teams a "budget" for errors, creating a space where innovation can thrive and failures are simply seen as lessons learned. -But SRE isn't just about technology and metrics; it's also human. It challenges the "hero culture" that plagues many IT teams. While individual heroics might occasionally save the day, a sustainable model requires collective expertise. An SRE culture recognises that heroes achieve their best within teams, negating the need for a hero-centric environment. This philosophy promotes a balanced on-call experience, emphasising the importance of trust, ownership, effective communication, and collaboration as cornerstones of team success. I personally have fallen into the hero trap, and know it's unsustainable to be the only go-to person for every arising problem. +SRE isn't just about tech and metrics; it's also about people. It tackles the "hero culture" that often ends up burning out IT teams. Sure, having a hero swoop in to save the day can be great, but relying on that all the time just isn’t sustainable. Instead, SRE focuses on collective expertise and teamwork. It recognizes that heroes are at their best within a solid team, making the need for constant heroics unnecessary. This way of thinking promotes a balanced on-call experience and highlights trust, ownership, good communication, and collaboration as key to success. I've been there myself, falling into the hero trap, and I know firsthand that it's just not feasible to be the go-to person for every problem that comes up. -Additionally, the SRE model requires good documentation. However, it's essential ensuring that this documentation undergoes the same quality checks as code, reinforcing effective onboarding, training and communication. +Also, the SRE model puts a big emphasis on good documentation. It's not enough to just have docs; they need to be top-notch and go through the same quality checks as code. This really helps with onboarding new team members, training, and keeping everyone on the same page. -Organisations might face a significant challenge when adopting SRE. Some might feel SRE principles counter their goals. They might prioritise feature rollouts over reliability or view SRE practices as cumbersome. Hence, creating an SRE culture often demands patient explanations and showcasing benefits, such as increased release velocity and improved user experience. +Adopting SRE can be a big challenge for some organizations. They might think the SRE approach goes against their goals, like preferring to roll out new features quickly rather than focusing on reliability, or seeing SRE practices as too much hassle. Building an SRE culture often means taking the time to explain things patiently and showing the benefits, like faster release cycles and a better user experience. -Monitoring and observability form another SRE aspect, emphasising the need for high-quality tools to query and analyse data. This ties back to the cultural emphasis on continuous learning and adaptability. SREs, by nature, need to be curious, ready to delve into anomalies, and keen on adopting new tools and practices. +Monitoring and observability are also big parts of SRE, highlighting the need for top-notch tools to query and analyze data. This aligns with the SRE focus on continuous learning and being adaptable. SREs naturally need to be curious, ready to dive into any strange issues, and always open to picking up new tools and practices. -The success of SRE within any organisation depends on the broader acceptance of its principles. It demands a move away from siloed operations, where SRE acts as a bandage on flawed systems, to a model where reliability is everyone's responsibility. +For SRE to really work in any organization, everyone needs to buy into its principles. It's about moving away from working in isolated silos and relying on SRE to just patch things up. Instead, it’s about making reliability a shared responsibility across the whole team. -In essence, the integration of SRE principles transcends technical practices. It paves the way for a shift in organisational culture that values proactive prevention, continuous learning, collaboration, and transparent communication. The successful melding of SRE and corporate culture promises not just reliable systems but also a robust, resilient, and progressive work environment. +In short, bringing SRE principles into the mix goes beyond just the technical stuff. It helps shift the whole organizational culture to value things like preventing issues before they happen, always learning, working together, and being open with communication. When SRE and corporate culture blend well, you end up with not just reliable systems but also a strong, resilient, and forward-thinking workplace. -Organisations with the implementation of SLIs, SLOs and error budgets are already advanced in their SRE journey. It takes a lot of communication, convincing, and patience until that point is reached. +Organizations that have SLIs, SLOs, and error budgets in place are already pretty far along in their SRE journey. Getting there takes a lot of communication, convincing people, and patience. Continue with the second part of this series: diff --git a/gemfeed/2023-09-25-dtail-usage-examples.gmi b/gemfeed/2023-09-25-dtail-usage-examples.gmi index 1bc4cd86..7cb424dd 100644 --- a/gemfeed/2023-09-25-dtail-usage-examples.gmi +++ b/gemfeed/2023-09-25-dtail-usage-examples.gmi @@ -22,6 +22,22 @@ DTail is a distributed DevOps tool for tailing, grepping, catting logs and other | | ``` +## Table of Contents + +* ⇢ DTail usage examples +* ⇢ ⇢ Commands +* ⇢ ⇢ Following logs +* ⇢ ⇢ Aggregating logs +* ⇢ ⇢ How to use `dcat` +* ⇢ ⇢ How to use `dgrep` +* ⇢ ⇢ How to use `dmap` +* ⇢ ⇢ How to use the DTail serverless mode +* ⇢ ⇢ ⇢ Serverless map-reduce query +* ⇢ ⇢ ⇢ Aggregating CSV files +* ⇢ ⇢ ⇢ Other serverless commands + +## Commands + DTail consists out of a server and several client binaries. In this post, I am showcasing their use! * Use `dtail` to follow logs @@ -232,10 +248,10 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -=> ./2021-04-22-dtail-the-distributed-log-tail-program.gmi 2021-04-22 DTail - The distributed log tail program -=> ./2022-03-06-the-release-of-dtail-4.0.0.gmi 2022-03-06 The release of DTail 4.0.0 -=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD => ./2023-09-25-dtail-usage-examples.gmi 2023-09-25 DTail usage examples (You are currently reading this) +=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD +=> ./2022-03-06-the-release-of-dtail-4.0.0.gmi 2022-03-06 The release of DTail 4.0.0 +=> ./2021-04-22-dtail-the-distributed-log-tail-program.gmi 2021-04-22 DTail - The distributed log tail program I hope you find the tools presented in this post useful! diff --git a/gemfeed/2023-09-25-dtail-usage-examples.gmi.tpl b/gemfeed/2023-09-25-dtail-usage-examples.gmi.tpl index 8c41c1f7..8dc6f852 100644 --- a/gemfeed/2023-09-25-dtail-usage-examples.gmi.tpl +++ b/gemfeed/2023-09-25-dtail-usage-examples.gmi.tpl @@ -22,6 +22,10 @@ DTail is a distributed DevOps tool for tailing, grepping, catting logs and other | | ``` +<< template::inline::toc + +## Commands + DTail consists out of a server and several client binaries. In this post, I am showcasing their use! * Use `dtail` to follow logs @@ -232,7 +236,7 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -<< template::inline::index dtail +<< template::inline::rindex dtail I hope you find the tools presented in this post useful! diff --git a/gemfeed/2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.gmi b/gemfeed/2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.gmi index a8c48449..0bb322e1 100644 --- a/gemfeed/2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.gmi +++ b/gemfeed/2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.gmi @@ -2,6 +2,12 @@ > Published at 2023-10-29T22:25:04+02:00 +Once in a while, I share photos on the inter-web with either family and friends or on my The Irregular Ninja photo site. One hobby of mine is photography (even though I don't have enough time for it - so I am primarily a point-and-shoot photographer). + +I'm not particularly eager to use any photo social sharing platforms such as Flickr, 500px (I used them regularly in the past), etc., anymore. I value self-hosting, DIY and privacy (nobody should data mine my photos), and no third party should have any rights to my pictures. + +I value KISS (keep it simple and stupid) and simplicity. All that's required for a web photo album is some simple HTML and spice it up with CSS. No need for JavaScript, no need for a complex dynamic website. + ``` ___ .---------.._ ______!fsc!_....-' .g8888888p. '-------....._ @@ -19,13 +25,16 @@ '._____________________________________________.' ``` -## Motivation - -Once in a while, I share photos on the inter-web with either family and friends or on my The Irregular Ninja photo site. One hobby of mine is photography (even though I don't have enough time for it - so I am primarily a point-and-shoot photographer). - -I'm not particularly eager to use any photo social sharing platforms such as Flickr, 500px (I used them regularly in the past), etc., anymore. I value self-hosting, DIY and privacy (nobody should data mine my photos), and no third party should have any rights to my pictures. +## Table of Contents -I value KISS (keep it simple and stupid) and simplicity. All that's required for a web photo album is some simple HTML and spice it up with CSS. No need for JavaScript, no need for a complex dynamic website. +* ⇢ KISS static web photo albums with `photoalbum.sh` +* ⇢ ⇢ Introducing `photoalbum.sh` +* ⇢ ⇢ Installation +* ⇢ ⇢ Setting it up +* ⇢ ⇢ Generating the static photo album +* ⇢ ⇢ Cleaning it up +* ⇢ ⇢ HTML templates +* ⇢ ⇢ Conclusion ## Introducing `photoalbum.sh` @@ -263,14 +272,14 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other Bash and KISS-related posts are: -=> ./2021-05-16-personal-bash-coding-style-guide.gmi 2021-05-16 Personal Bash coding style guide -=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all -=> ./2021-09-12-keep-it-simple-and-stupid.gmi 2021-09-12 Keep it simple and stupid -=> ./2021-11-29-bash-golf-part-1.gmi 2021-11-29 Bash Golf Part 1 -=> ./2022-01-01-bash-golf-part-2.gmi 2022-01-01 Bash Golf Part 2 -=> ./2023-06-01-kiss-server-monitoring-with-gogios.gmi 2023-06-01 KISS server monitoring with Gogios -=> ./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.gmi 2023-10-29 KISS static web photo albums with `photoalbum.sh` (You are currently reading this) -=> ./2023-12-10-bash-golf-part-3.gmi 2023-12-10 Bash Golf Part 3 => ./2024-04-01-KISS-high-availability-with-OpenBSD.gmi 2024-04-01 KISS high-availability with OpenBSD +=> ./2023-12-10-bash-golf-part-3.gmi 2023-12-10 Bash Golf Part 3 +=> ./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.gmi 2023-10-29 KISS static web photo albums with `photoalbum.sh` (You are currently reading this) +=> ./2023-06-01-kiss-server-monitoring-with-gogios.gmi 2023-06-01 KISS server monitoring with Gogios +=> ./2022-01-01-bash-golf-part-2.gmi 2022-01-01 Bash Golf Part 2 +=> ./2021-11-29-bash-golf-part-1.gmi 2021-11-29 Bash Golf Part 1 +=> ./2021-09-12-keep-it-simple-and-stupid.gmi 2021-09-12 Keep it simple and stupid +=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all +=> ./2021-05-16-personal-bash-coding-style-guide.gmi 2021-05-16 Personal Bash coding style guide => ../ Back to the main site diff --git a/gemfeed/2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.gmi.tpl b/gemfeed/2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.gmi.tpl index e4878261..c3e54b4e 100644 --- a/gemfeed/2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.gmi.tpl +++ b/gemfeed/2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.gmi.tpl @@ -2,6 +2,12 @@ > Published at 2023-10-29T22:25:04+02:00 +Once in a while, I share photos on the inter-web with either family and friends or on my The Irregular Ninja photo site. One hobby of mine is photography (even though I don't have enough time for it - so I am primarily a point-and-shoot photographer). + +I'm not particularly eager to use any photo social sharing platforms such as Flickr, 500px (I used them regularly in the past), etc., anymore. I value self-hosting, DIY and privacy (nobody should data mine my photos), and no third party should have any rights to my pictures. + +I value KISS (keep it simple and stupid) and simplicity. All that's required for a web photo album is some simple HTML and spice it up with CSS. No need for JavaScript, no need for a complex dynamic website. + ``` ___ .---------.._ ______!fsc!_....-' .g8888888p. '-------....._ @@ -19,13 +25,7 @@ '._____________________________________________.' ``` -## Motivation - -Once in a while, I share photos on the inter-web with either family and friends or on my The Irregular Ninja photo site. One hobby of mine is photography (even though I don't have enough time for it - so I am primarily a point-and-shoot photographer). - -I'm not particularly eager to use any photo social sharing platforms such as Flickr, 500px (I used them regularly in the past), etc., anymore. I value self-hosting, DIY and privacy (nobody should data mine my photos), and no third party should have any rights to my pictures. - -I value KISS (keep it simple and stupid) and simplicity. All that's required for a web photo album is some simple HTML and spice it up with CSS. No need for JavaScript, no need for a complex dynamic website. +<< template::inline::toc ## Introducing `photoalbum.sh` @@ -263,6 +263,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other Bash and KISS-related posts are: -<< template::inline::index bash kiss simple-and-stupid +<< template::inline::rindex bash kiss simple-and-stupid => ../ Back to the main site diff --git a/gemfeed/2023-11-11-mind-management-book-notes.gmi b/gemfeed/2023-11-11-mind-management-book-notes.gmi index ad3dcaa2..3fecb34a 100644 --- a/gemfeed/2023-11-11-mind-management-book-notes.gmi +++ b/gemfeed/2023-11-11-mind-management-book-notes.gmi @@ -16,6 +16,21 @@ These are my personal takeaways after reading "Mind Management" by David Kadavy. ''' ``` +## Table of Contents + +* ⇢ "Mind Management" book notes +* ⇢ ⇢ It's not about time management +* ⇢ ⇢ Empty slots in the calendar +* ⇢ ⇢ When you safe time... +* ⇢ ⇢ Follow your mood +* ⇢ ⇢ Boosting creativity +* ⇢ ⇢ The right mood for the task at hand +* ⇢ ⇢ Creativity hacks +* ⇢ ⇢ Planning and strategizing +* ⇢ ⇢ Fake it until you make it. + +## It's not about time management + Productivity isn't about time management - it's about mind management. When you put a lot of effort into something, there are: * The point of diminishing returns @@ -95,13 +110,13 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other book notes of mine are: -=> ./2023-03-16-the-pragmatic-programmer-book-notes.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ./2023-04-01-never-split-the-difference-book-notes.gmi 2023-04-01 "Never split the difference" book notes -=> ./2023-05-06-the-obstacle-is-the-way-book-notes.gmi 2023-05-06 "The Obstacle is the Way" book notes -=> ./2023-07-17-career-guide-and-soft-skills-book-notes.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes -=> ./2023-11-11-mind-management-book-notes.gmi 2023-11-11 "Mind Management" book notes (You are currently reading this) -=> ./2024-05-01-slow-productivity-book-notes.gmi 2024-05-01 "Slow Productivity" book notes +=> ./2024-10-24-staff-engineer-book-notes.gmi 2024-10-24 "Staff Engineer" book notes => ./2024-07-07-the-stoic-challenge-book-notes.gmi 2024-07-07 "The Stoic Challenge" book notes +=> ./2024-05-01-slow-productivity-book-notes.gmi 2024-05-01 "Slow Productivity" book notes +=> ./2023-11-11-mind-management-book-notes.gmi 2023-11-11 "Mind Management" book notes (You are currently reading this) +=> ./2023-07-17-career-guide-and-soft-skills-book-notes.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes +=> ./2023-05-06-the-obstacle-is-the-way-book-notes.gmi 2023-05-06 "The Obstacle is the Way" book notes +=> ./2023-04-01-never-split-the-difference-book-notes.gmi 2023-04-01 "Never split the difference" book notes +=> ./2023-03-16-the-pragmatic-programmer-book-notes.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ../resources.gmi More books and other resources I found useful. => ../ Back to the main site diff --git a/gemfeed/2023-11-11-mind-management-book-notes.gmi.tpl b/gemfeed/2023-11-11-mind-management-book-notes.gmi.tpl index bd5cb4d4..d9f9dae5 100644 --- a/gemfeed/2023-11-11-mind-management-book-notes.gmi.tpl +++ b/gemfeed/2023-11-11-mind-management-book-notes.gmi.tpl @@ -16,6 +16,10 @@ These are my personal takeaways after reading "Mind Management" by David Kadavy. ''' ``` +<< template::inline::toc + +## It's not about time management + Productivity isn't about time management - it's about mind management. When you put a lot of effort into something, there are: * The point of diminishing returns @@ -95,7 +99,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other book notes of mine are: -<< template::inline::index book-notes +<< template::inline::rindex book-notes -=> ../resources.gmi More books and other resources I found useful. => ../ Back to the main site diff --git a/gemfeed/2023-11-19-site-reliability-engineering-part-2.gmi b/gemfeed/2023-11-19-site-reliability-engineering-part-2.gmi index 2ba7b8b8..abb1255d 100644 --- a/gemfeed/2023-11-19-site-reliability-engineering-part-2.gmi +++ b/gemfeed/2023-11-19-site-reliability-engineering-part-2.gmi @@ -1,12 +1,13 @@ -# Site Reliability Engineering - Part 2: Operational Balance in SRE +# Site Reliability Engineering - Part 2: Operational Balance > Published at 2023-11-19T00:18:18+03:00 This is the second part of my Site Reliability Engineering (SRE) series. I am currently employed as a Site Reliability Engineer and will try to share what SRE is about in this blog series. => ./2023-08-18-site-reliability-engineering-part-1.gmi 2023-08-18 Site Reliability Engineering - Part 1: SRE and Organizational Culture -=> ./2023-11-19-site-reliability-engineering-part-2.gmi 2023-11-19 Site Reliability Engineering - Part 2: Operational Balance in SRE (You are currently reading this) -=> ./2024-01-09-site-reliability-engineering-part-3.gmi 2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect +=> ./2023-11-19-site-reliability-engineering-part-2.gmi 2023-11-19 Site Reliability Engineering - Part 2: Operational Balance (You are currently reading this) +=> ./2024-01-09-site-reliability-engineering-part-3.gmi 2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture +=> ./2024-09-07-site-reliability-engineering-part-4.gmi 2024-09-07 Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers ``` ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⣷⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ @@ -23,27 +24,26 @@ This is the second part of my Site Reliability Engineering (SRE) series. I am cu ⠀⠀⠀⠀⠀⠀⠴⠶⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠶⠦⠀⠀ ``` -## Operational Balance in SRE: Finding the Equilibrium in Reliability and Velocity +## Striking the Right Balance Between Reliability and Speed -Site Reliability Engineering has established itself as more than just a set of best practices or methodologies. Instead, it stands as a beacon of operational excellence, which guides engineering teams through the turbulent waters of modern software development and system management. +Site Reliability Engineering is more than just a bunch of best practices or methods. It's a guiding light for engineering teams, helping them navigate the tricky waters of modern software development and system management. +In the world of software production, there are two big forces that often clash: the push for fast feature releases (velocity) and the need for reliable systems. Traditionally, moving faster meant more risk. SRE helps balance these opposing goals with things like error budgets and SLIs/SLOs. These tools give teams a clear way to measure how much they can push changes without hurting system health. So, the error budget becomes a balancing act, helping teams trade off between innovation and reliability. -In the universe of software production, two fundamental forces are often at odds: The drive for rapid feature release (velocity) and the need for system reliability. Traditionally, the faster teams moved, the more risk was introduced into systems. SRE offers a approach to mitigate these conflicting drives through concepts like error budgets and SLIs/SLOs. These mechanisms offer a tangible metric, allowing teams to quantify how much they can push changes while ensuring they don't compromise system health. Thus, the error budget becomes a balancing act, where teams weigh the trade-offs between innovation and reliability. +Finding the right balance in SRE means juggling operations and coding. Ideally, engineers should split their time 50/50 between these tasks. This isn't just a random rule; it highlights how much SRE values both maintaining smooth operations and driving innovation. This way, SREs not only handle today's problems but also prepare for tomorrow's challenges. -An important part of this balance is the dichotomy between operations and coding. According to SRE principles, an engineer should ideally spend an equal amount of time on operations work and coding - 50% on each. This isn't just a random metric; it's a reflection of the value SRE places on both maintaining operational excellence and progressing forward with innovations. This balance ensures that while SREs are solving today's problems, they are also preparing for tomorrow's challenges. +But not all operations tasks are the same. SRE makes a clear distinction between "ops work" and "toil." Ops work is essential for maintaining systems and adds value, while toil is the repetitive, boring stuff that doesn’t. It's super important to recognize and minimize toil because a culture that lets engineers get bogged down in it will kill innovation and growth. The way an organization handles toil says a lot about its operational health and commitment to balance. -However, not all operational tasks are equal. SRE differentiates between "ops work" and "toil". While ops work is integral to system maintenance and can provide value, toil represents repetitive, mundane tasks which offer little value in the long run. Recognising and minimising toil is crucial. A culture that allows engineers to drown in toil stifles innovation and growth. Hence, an organisation's approach to toil indicates its operational health and commitment to balance. +A key part of finding operational balance is the tools and processes that SREs use. Great monitoring and observability tools, especially those that can handle lots of complex data, are essential. This isn’t just about having the right tech—it shows that the organization values proactive problem-solving. With systems that can spot potential issues early, SREs can keep things stable while still pushing forward. -A cornerstone of achieving operational balance lies in the tools and processes SREs use. Effective monitoring, observability tools, and ensuring that tools can handle high cardinality data are foundational. These aren't just technical requisites but reflective of an organisational culture prioritising proactive problem-solving. By having systems that effectively flag potential issues before they escalate, SREs can maintain the balance between system stability and forward momentum. +Operational balance isn't just about tech or processes; it's also about people. The well-being of on-call engineers is just as important as the health of the services they manage. Doing postmortems after incidents, having continuous feedback loops, and identifying gaps in tools, skills, or resources all help make sure the human side of operations gets the attention it deserves. -Moreover, operational balance isn't just a technological or process challenge; it's a human one. The health of on-call engineers is as crucial as the health of the services they manage. On-call postmortems, continuous feedback loops, and recognising gaps (be it tooling, operational expertise, or resources) ensure that the human elements of operations are noticed. +In the end, finding operational balance in SRE is an ongoing journey, not a one-time thing. Companies need to keep reassessing their practices, tools, and especially their culture. When they get this balance right, they can keep innovating without sacrificing the reliability of their systems, leading to long-term success. -In conclusion, operational balance in SRE isn't static thing but an ongoing journey. It requires organisations to constantly evaluate their practices, tools, and, most importantly, their culture. By achieving this balance, organisations can ensure that they have time for innovation while maintaining the robustness and reliability of their systems, resulting in sustainable long-term success. - -That all sounds very romantic. The truth is, it's brutal to archive the perfect balance. No system will ever be perfect. But at least we should aim for it! +That all sounds pretty idealistic. The reality is that getting the perfect balance is really tough. No system is ever going to be perfect. But hey, we should still strive for it! Continue with the third part of this series: -=> ./2024-01-09-site-reliability-engineering-part-3.gmi 2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect +=> ./2024-01-09-site-reliability-engineering-part-3.gmi 2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture E-Mail your comments to `paul@nospam.buetow.org` :-) diff --git a/gemfeed/2023-11-19-site-reliability-engineering-part-2.gmi.tpl b/gemfeed/2023-11-19-site-reliability-engineering-part-2.gmi.tpl index 6378ebbf..02307011 100644 --- a/gemfeed/2023-11-19-site-reliability-engineering-part-2.gmi.tpl +++ b/gemfeed/2023-11-19-site-reliability-engineering-part-2.gmi.tpl @@ -1,4 +1,4 @@ -# Site Reliability Engineering - Part 2: Operational Balance in SRE +# Site Reliability Engineering - Part 2: Operational Balance > Published at 2023-11-19T00:18:18+03:00 @@ -21,23 +21,22 @@ This is the second part of my Site Reliability Engineering (SRE) series. I am cu ⠀⠀⠀⠀⠀⠀⠴⠶⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠶⠦⠀⠀ ``` -## Operational Balance in SRE: Finding the Equilibrium in Reliability and Velocity +## Striking the Right Balance Between Reliability and Speed -Site Reliability Engineering has established itself as more than just a set of best practices or methodologies. Instead, it stands as a beacon of operational excellence, which guides engineering teams through the turbulent waters of modern software development and system management. +Site Reliability Engineering is more than just a bunch of best practices or methods. It's a guiding light for engineering teams, helping them navigate the tricky waters of modern software development and system management. +In the world of software production, there are two big forces that often clash: the push for fast feature releases (velocity) and the need for reliable systems. Traditionally, moving faster meant more risk. SRE helps balance these opposing goals with things like error budgets and SLIs/SLOs. These tools give teams a clear way to measure how much they can push changes without hurting system health. So, the error budget becomes a balancing act, helping teams trade off between innovation and reliability. -In the universe of software production, two fundamental forces are often at odds: The drive for rapid feature release (velocity) and the need for system reliability. Traditionally, the faster teams moved, the more risk was introduced into systems. SRE offers a approach to mitigate these conflicting drives through concepts like error budgets and SLIs/SLOs. These mechanisms offer a tangible metric, allowing teams to quantify how much they can push changes while ensuring they don't compromise system health. Thus, the error budget becomes a balancing act, where teams weigh the trade-offs between innovation and reliability. +Finding the right balance in SRE means juggling operations and coding. Ideally, engineers should split their time 50/50 between these tasks. This isn't just a random rule; it highlights how much SRE values both maintaining smooth operations and driving innovation. This way, SREs not only handle today's problems but also prepare for tomorrow's challenges. -An important part of this balance is the dichotomy between operations and coding. According to SRE principles, an engineer should ideally spend an equal amount of time on operations work and coding - 50% on each. This isn't just a random metric; it's a reflection of the value SRE places on both maintaining operational excellence and progressing forward with innovations. This balance ensures that while SREs are solving today's problems, they are also preparing for tomorrow's challenges. +But not all operations tasks are the same. SRE makes a clear distinction between "ops work" and "toil." Ops work is essential for maintaining systems and adds value, while toil is the repetitive, boring stuff that doesn’t. It's super important to recognize and minimize toil because a culture that lets engineers get bogged down in it will kill innovation and growth. The way an organization handles toil says a lot about its operational health and commitment to balance. -However, not all operational tasks are equal. SRE differentiates between "ops work" and "toil". While ops work is integral to system maintenance and can provide value, toil represents repetitive, mundane tasks which offer little value in the long run. Recognising and minimising toil is crucial. A culture that allows engineers to drown in toil stifles innovation and growth. Hence, an organisation's approach to toil indicates its operational health and commitment to balance. +A key part of finding operational balance is the tools and processes that SREs use. Great monitoring and observability tools, especially those that can handle lots of complex data, are essential. This isn’t just about having the right tech—it shows that the organization values proactive problem-solving. With systems that can spot potential issues early, SREs can keep things stable while still pushing forward. -A cornerstone of achieving operational balance lies in the tools and processes SREs use. Effective monitoring, observability tools, and ensuring that tools can handle high cardinality data are foundational. These aren't just technical requisites but reflective of an organisational culture prioritising proactive problem-solving. By having systems that effectively flag potential issues before they escalate, SREs can maintain the balance between system stability and forward momentum. +Operational balance isn't just about tech or processes; it's also about people. The well-being of on-call engineers is just as important as the health of the services they manage. Doing postmortems after incidents, having continuous feedback loops, and identifying gaps in tools, skills, or resources all help make sure the human side of operations gets the attention it deserves. -Moreover, operational balance isn't just a technological or process challenge; it's a human one. The health of on-call engineers is as crucial as the health of the services they manage. On-call postmortems, continuous feedback loops, and recognising gaps (be it tooling, operational expertise, or resources) ensure that the human elements of operations are noticed. +In the end, finding operational balance in SRE is an ongoing journey, not a one-time thing. Companies need to keep reassessing their practices, tools, and especially their culture. When they get this balance right, they can keep innovating without sacrificing the reliability of their systems, leading to long-term success. -In conclusion, operational balance in SRE isn't static thing but an ongoing journey. It requires organisations to constantly evaluate their practices, tools, and, most importantly, their culture. By achieving this balance, organisations can ensure that they have time for innovation while maintaining the robustness and reliability of their systems, resulting in sustainable long-term success. - -That all sounds very romantic. The truth is, it's brutal to archive the perfect balance. No system will ever be perfect. But at least we should aim for it! +That all sounds pretty idealistic. The reality is that getting the perfect balance is really tough. No system is ever going to be perfect. But hey, we should still strive for it! Continue with the third part of this series: diff --git a/gemfeed/2023-12-10-bash-golf-part-3.gmi b/gemfeed/2023-12-10-bash-golf-part-3.gmi index d480ae80..b4034bc8 100644 --- a/gemfeed/2023-12-10-bash-golf-part-3.gmi +++ b/gemfeed/2023-12-10-bash-golf-part-3.gmi @@ -2,6 +2,12 @@ > Published at 2023-12-10T11:35:54+02:00 +This is the third blog post about my Bash Golf series. This series is random Bash tips, tricks, and weirdnesses I have encountered over time. + +=> ./2021-11-29-bash-golf-part-1.gmi 2021-11-29 Bash Golf Part 1 +=> ./2022-01-01-bash-golf-part-2.gmi 2022-01-01 Bash Golf Part 2 +=> ./2023-12-10-bash-golf-part-3.gmi 2023-12-10 Bash Golf Part 3 (You are currently reading this) + ``` '\ '\ '\ . . |>18>> @@ -14,11 +20,17 @@ jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Art by Joan Stark, mod. by Paul Buetow ``` -This is the third blog post about my Bash Golf series. This series is random Bash tips, tricks, and weirdnesses I have encountered over time. +## Table of Contents -=> ./2021-11-29-bash-golf-part-1.gmi 2021-11-29 Bash Golf Part 1 -=> ./2022-01-01-bash-golf-part-2.gmi 2022-01-01 Bash Golf Part 2 -=> ./2023-12-10-bash-golf-part-3.gmi 2023-12-10 Bash Golf Part 3 (You are currently reading this) +* ⇢ Bash Golf Part 3 +* ⇢ ⇢ `FUNCNAME` +* ⇢ ⇢ `:(){ :|:& };:` +* ⇢ ⇢ Inner functions +* ⇢ ⇢ Exporting functions +* ⇢ ⇢ Dynamic variables with `local` +* ⇢ ⇢ `if` conditionals +* ⇢ ⇢ Multi-line comments +* ⇢ ⇢ Don't change it while it's executed ## `FUNCNAME` @@ -359,10 +371,10 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -=> ./2021-05-16-personal-bash-coding-style-guide.gmi 2021-05-16 Personal Bash coding style guide -=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all -=> ./2021-11-29-bash-golf-part-1.gmi 2021-11-29 Bash Golf Part 1 -=> ./2022-01-01-bash-golf-part-2.gmi 2022-01-01 Bash Golf Part 2 => ./2023-12-10-bash-golf-part-3.gmi 2023-12-10 Bash Golf Part 3 (You are currently reading this) +=> ./2022-01-01-bash-golf-part-2.gmi 2022-01-01 Bash Golf Part 2 +=> ./2021-11-29-bash-golf-part-1.gmi 2021-11-29 Bash Golf Part 1 +=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all +=> ./2021-05-16-personal-bash-coding-style-guide.gmi 2021-05-16 Personal Bash coding style guide => ../ Back to the main site diff --git a/gemfeed/2023-12-10-bash-golf-part-3.gmi.tpl b/gemfeed/2023-12-10-bash-golf-part-3.gmi.tpl index 45ae457e..e28d4bc5 100644 --- a/gemfeed/2023-12-10-bash-golf-part-3.gmi.tpl +++ b/gemfeed/2023-12-10-bash-golf-part-3.gmi.tpl @@ -2,6 +2,10 @@ > Published at 2023-12-10T11:35:54+02:00 +This is the third blog post about my Bash Golf series. This series is random Bash tips, tricks, and weirdnesses I have encountered over time. + +<< template::inline::index bash-golf + ``` '\ '\ '\ . . |>18>> @@ -14,9 +18,7 @@ jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Art by Joan Stark, mod. by Paul Buetow ``` -This is the third blog post about my Bash Golf series. This series is random Bash tips, tricks, and weirdnesses I have encountered over time. - -<< template::inline::index bash-golf +<< template::inline::toc ## `FUNCNAME` @@ -357,6 +359,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -<< template::inline::index bash +<< template::inline::rindex bash => ../ Back to the main site diff --git a/gemfeed/2024-01-09-site-reliability-engineering-part-3.gmi b/gemfeed/2024-01-09-site-reliability-engineering-part-3.gmi index 96ddea9b..609c6e58 100644 --- a/gemfeed/2024-01-09-site-reliability-engineering-part-3.gmi +++ b/gemfeed/2024-01-09-site-reliability-engineering-part-3.gmi @@ -1,12 +1,13 @@ -# Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect +# Site Reliability Engineering - Part 3: On-Call Culture > Published at 2024-01-09T18:35:48+02:00 -This is the third part of my Site Reliability Engineering (SRE) series. I am currently employed as a Site Reliability Engineer and will try to share what SRE is about in this blog series. +Welcome to Part 3 of my Site Reliability Engineering (SRE) series. I'm currently working as a Site Reliability Engineer, and I’m here to share what SRE is all about in this blog series. => ./2023-08-18-site-reliability-engineering-part-1.gmi 2023-08-18 Site Reliability Engineering - Part 1: SRE and Organizational Culture -=> ./2023-11-19-site-reliability-engineering-part-2.gmi 2023-11-19 Site Reliability Engineering - Part 2: Operational Balance in SRE -=> ./2024-01-09-site-reliability-engineering-part-3.gmi 2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect (You are currently reading this) +=> ./2023-11-19-site-reliability-engineering-part-2.gmi 2023-11-19 Site Reliability Engineering - Part 2: Operational Balance +=> ./2024-01-09-site-reliability-engineering-part-3.gmi 2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture (You are currently reading this) +=> ./2024-09-07-site-reliability-engineering-part-4.gmi 2024-09-07 Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers ``` ..--""""----.. @@ -34,23 +35,29 @@ This is the third part of my Site Reliability Engineering (SRE) series. I am cur ``` -## On-Call Culture and the Human Aspect: Prioritising Well-being in the Realm of Reliability +## Putting Well-being First -Site Reliability Engineering is synonymous with ensuring system reliability, but the human factor is an often-underestimated part of this discipline. Ensuring an healthy on-call culture is as critical as any technical solution. The well-being of the engineers is an important factor. +Site Reliability Engineering is all about keeping systems reliable, but we often forget how important the human side is. A healthy on-call culture is just as crucial as any technical fix. The well-being of the engineers really matters. -Firstly, a healthy on-call rotation is about more than just managing and responding to incidents. It's about the entire ecosystem that supports this practice. This involves reducing pain points, offering mentorship, rapid iteration, and ensuring that engineers have the right tools and processes. One ceavat is, that engineers should be willing to learn. Especially in on-call rotation embedding SREs with other engineers (for example Software Engineers or QA Engineers), it's difficult to motivate everyone to engage. QA Engineers want to test the software, Software Engineers want to implement new features; they don't want to troubleshoot and debug production incidents. It can be depressing for the mentoring SRE. +First off, a healthy on-call rotation is about more than just handling incidents. It's about creating a supportive ecosystem. This means cutting down on pain points, offering mentorship, quickly iterating on processes, and making sure engineers have the right tools. But there's a catch—engineers need to be willing to learn. Especially in on-call rotations where SREs work with Software Engineers or QA Engineers, it can be tough to get everyone motivated. QA Engineers want to test, Software Engineers want to build new features; they don’t want to deal with production issues. This can be really frustrating for the SREs trying to mentor them. -Furthermore, the metrics that measure the success of an on-call experience are only sometimes straightforward. While one might assume that fewer pages translate to better on-call expertise (which is true to a degree, as who wants to receive a page out of office hours?), it's not always the volume of pages that matters most. Trust, ownership, accountability, and effective communication play the important roles. +Plus, measuring a good on-call experience isn't always clear-cut. You might think fewer pages mean a better on-call setup—and yeah, no one wants to get paged after hours—but it's not just about the number of pages. Trust, ownership, accountability, and solid communication are what really matter. -An important part is giving feedback about the on-call experience to ensure continuous learning. If alerts are mostly noise, they should be tuned or even eliminated. If alerts are actionable, can recurring tasks be automated? If there are knowledge gaps, is the documentation not good enough? Continuous retrospection ensures that not only do systems evolve, but the experience for the on-call engineers becomes progressively better. +A key part is giving feedback about the on-call experience to keep learning and improving. If alerts are mostly noise, they need to be tweaked or even ditched. If alerts are helpful, can we automate the repetitive tasks? If there are knowledge gaps, is the documentation lacking? Regular retrospectives ensure that the systems get better over time and the on-call experience improves for the engineers. -Onboarding for on-call duties is a crucial aspect of ensuring the reliability and efficiency of systems. This process involves equipping new team members with the knowledge, tools, and support to handle incidents confidently. It begins with an overview of the system architecture and common challenges, followed by training on monitoring tools, alerting mechanisms, and incident response protocols. Shadowing experienced on-call engineers can offer practical exposure. Too often, new engineers are thrown into the cold water without proper onboarding and training because the more experienced engineers are too busy fire-fighting production issues in the first place. +Getting new team members ready for on-call duties is super important for keeping systems reliable and efficient. This means giving them the knowledge, tools, and support they need to handle incidents with confidence. It starts with a rundown of the system architecture and common issues, then training on monitoring tools, alerting systems, and incident response protocols. Watching experienced on-call engineers in action can provide some hands-on learning. Too often, though, new engineers get thrown into the deep end without proper onboarding because the more experienced engineers are too busy dealing with ongoing production issues. -An always-on, always-alert culture can lead to burnout. Engineers should be encouraged to recognise their limits, take breaks, and seek support when needed. This isn't just about individual health; a burnt-out engineer can have cascading effects on the entire team and the systems they manage. A successful on-call culture ensures that while systems are kept running, the engineers are kept happy, healthy, and supported. The more experienced engineers should take time to mentor the junior engineers, but the junior engineers should also be fully engaged, try to investigate and learn new things by themselves. +A culture where everyone's always on and alert can cause burnout. Engineers need to know their limits, take breaks, and ask for help when they need it. This isn't just about personal health; a burnt-out engineer can drag down the whole team and the systems they manage. A good on-call culture keeps systems running while making sure engineers are happy, healthy, and supported. Experienced engineers should take the time to mentor juniors, but junior engineers should also stay engaged, investigate issues, and learn new things on their own. -For the junior engineer, it's too easy to fall back and ask the experts in the team every time an issue arises. This seems reasonable, but serving recipes for solving production issues on a silver tablet won't scale forever, as there are infinite scenarios of how production systems can break. So every engineer should learn to debug, troubleshoot and resolve production incidents independently. The experts will still be there for guidance and step in when the junior gets stuck after trying, but the experts should also learn to step down so that lesser experienced engineers can step up and learn. But mistakes can always happen here; that's why having a blameless on-call culture is essential. +For junior engineers, it's tempting to always ask the experts for help whenever something goes wrong. While that might seem reasonable, constantly handing out solutions doesn't scale—there are endless ways for production systems to break. So, every engineer needs to learn how to debug, troubleshoot, and resolve incidents on their own. The experts should be there for guidance and can step in when a junior gets really stuck, but they also need to give space for less experienced engineers to grow and learn. -A blameless on-call culture is a must for a safe and collaborative environment where engineers can effectively respond to incidents without fear of retribution. This approach acknowledges that mistakes are a natural part of the learning and innovation process. When individuals are assured they won't be punished for errors, they're more likely to openly discuss mistakes, allowing the entire team to learn and grow from each incident. Furthermore, a blameless culture promotes psychological safety, enhances job satisfaction, reduces burnout, and ensures that talent remains committed and engaged. +A blameless on-call culture is essential for creating a safe and collaborative environment where engineers can handle incidents without worrying about getting blamed. It recognizes that mistakes are just part of learning and innovating. When people know they won’t be punished for errors, they’re more likely to talk openly about what went wrong, which helps the whole team learn and improve. Plus, a blameless culture boosts psychological safety, job satisfaction, and reduces burnout, keeping everyone committed and engaged. + +Mistakes are gonna happen, which is why having a blameless on-call culture is so important. + +Continue with the fourth part of this series: + +=> ./2024-09-07-site-reliability-engineering-part-4.gmi 2024-09-07 Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers E-Mail your comments to `paul@nospam.buetow.org` :-) diff --git a/gemfeed/2024-01-09-site-reliability-engineering-part-3.gmi.tpl b/gemfeed/2024-01-09-site-reliability-engineering-part-3.gmi.tpl index b78cdb66..22efe0b4 100644 --- a/gemfeed/2024-01-09-site-reliability-engineering-part-3.gmi.tpl +++ b/gemfeed/2024-01-09-site-reliability-engineering-part-3.gmi.tpl @@ -1,8 +1,8 @@ -# Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect +# Site Reliability Engineering - Part 3: On-Call Culture > Published at 2024-01-09T18:35:48+02:00 -This is the third part of my Site Reliability Engineering (SRE) series. I am currently employed as a Site Reliability Engineer and will try to share what SRE is about in this blog series. +Welcome to Part 3 of my Site Reliability Engineering (SRE) series. I'm currently working as a Site Reliability Engineer, and I’m here to share what SRE is all about in this blog series. << template::inline::index site-reliability-engineering-part @@ -32,23 +32,29 @@ This is the third part of my Site Reliability Engineering (SRE) series. I am cur ``` -## On-Call Culture and the Human Aspect: Prioritising Well-being in the Realm of Reliability +## Putting Well-being First -Site Reliability Engineering is synonymous with ensuring system reliability, but the human factor is an often-underestimated part of this discipline. Ensuring an healthy on-call culture is as critical as any technical solution. The well-being of the engineers is an important factor. +Site Reliability Engineering is all about keeping systems reliable, but we often forget how important the human side is. A healthy on-call culture is just as crucial as any technical fix. The well-being of the engineers really matters. -Firstly, a healthy on-call rotation is about more than just managing and responding to incidents. It's about the entire ecosystem that supports this practice. This involves reducing pain points, offering mentorship, rapid iteration, and ensuring that engineers have the right tools and processes. One ceavat is, that engineers should be willing to learn. Especially in on-call rotation embedding SREs with other engineers (for example Software Engineers or QA Engineers), it's difficult to motivate everyone to engage. QA Engineers want to test the software, Software Engineers want to implement new features; they don't want to troubleshoot and debug production incidents. It can be depressing for the mentoring SRE. +First off, a healthy on-call rotation is about more than just handling incidents. It's about creating a supportive ecosystem. This means cutting down on pain points, offering mentorship, quickly iterating on processes, and making sure engineers have the right tools. But there's a catch—engineers need to be willing to learn. Especially in on-call rotations where SREs work with Software Engineers or QA Engineers, it can be tough to get everyone motivated. QA Engineers want to test, Software Engineers want to build new features; they don’t want to deal with production issues. This can be really frustrating for the SREs trying to mentor them. -Furthermore, the metrics that measure the success of an on-call experience are only sometimes straightforward. While one might assume that fewer pages translate to better on-call expertise (which is true to a degree, as who wants to receive a page out of office hours?), it's not always the volume of pages that matters most. Trust, ownership, accountability, and effective communication play the important roles. +Plus, measuring a good on-call experience isn't always clear-cut. You might think fewer pages mean a better on-call setup—and yeah, no one wants to get paged after hours—but it's not just about the number of pages. Trust, ownership, accountability, and solid communication are what really matter. -An important part is giving feedback about the on-call experience to ensure continuous learning. If alerts are mostly noise, they should be tuned or even eliminated. If alerts are actionable, can recurring tasks be automated? If there are knowledge gaps, is the documentation not good enough? Continuous retrospection ensures that not only do systems evolve, but the experience for the on-call engineers becomes progressively better. +A key part is giving feedback about the on-call experience to keep learning and improving. If alerts are mostly noise, they need to be tweaked or even ditched. If alerts are helpful, can we automate the repetitive tasks? If there are knowledge gaps, is the documentation lacking? Regular retrospectives ensure that the systems get better over time and the on-call experience improves for the engineers. -Onboarding for on-call duties is a crucial aspect of ensuring the reliability and efficiency of systems. This process involves equipping new team members with the knowledge, tools, and support to handle incidents confidently. It begins with an overview of the system architecture and common challenges, followed by training on monitoring tools, alerting mechanisms, and incident response protocols. Shadowing experienced on-call engineers can offer practical exposure. Too often, new engineers are thrown into the cold water without proper onboarding and training because the more experienced engineers are too busy fire-fighting production issues in the first place. +Getting new team members ready for on-call duties is super important for keeping systems reliable and efficient. This means giving them the knowledge, tools, and support they need to handle incidents with confidence. It starts with a rundown of the system architecture and common issues, then training on monitoring tools, alerting systems, and incident response protocols. Watching experienced on-call engineers in action can provide some hands-on learning. Too often, though, new engineers get thrown into the deep end without proper onboarding because the more experienced engineers are too busy dealing with ongoing production issues. -An always-on, always-alert culture can lead to burnout. Engineers should be encouraged to recognise their limits, take breaks, and seek support when needed. This isn't just about individual health; a burnt-out engineer can have cascading effects on the entire team and the systems they manage. A successful on-call culture ensures that while systems are kept running, the engineers are kept happy, healthy, and supported. The more experienced engineers should take time to mentor the junior engineers, but the junior engineers should also be fully engaged, try to investigate and learn new things by themselves. +A culture where everyone's always on and alert can cause burnout. Engineers need to know their limits, take breaks, and ask for help when they need it. This isn't just about personal health; a burnt-out engineer can drag down the whole team and the systems they manage. A good on-call culture keeps systems running while making sure engineers are happy, healthy, and supported. Experienced engineers should take the time to mentor juniors, but junior engineers should also stay engaged, investigate issues, and learn new things on their own. -For the junior engineer, it's too easy to fall back and ask the experts in the team every time an issue arises. This seems reasonable, but serving recipes for solving production issues on a silver tablet won't scale forever, as there are infinite scenarios of how production systems can break. So every engineer should learn to debug, troubleshoot and resolve production incidents independently. The experts will still be there for guidance and step in when the junior gets stuck after trying, but the experts should also learn to step down so that lesser experienced engineers can step up and learn. But mistakes can always happen here; that's why having a blameless on-call culture is essential. +For junior engineers, it's tempting to always ask the experts for help whenever something goes wrong. While that might seem reasonable, constantly handing out solutions doesn't scale—there are endless ways for production systems to break. So, every engineer needs to learn how to debug, troubleshoot, and resolve incidents on their own. The experts should be there for guidance and can step in when a junior gets really stuck, but they also need to give space for less experienced engineers to grow and learn. -A blameless on-call culture is a must for a safe and collaborative environment where engineers can effectively respond to incidents without fear of retribution. This approach acknowledges that mistakes are a natural part of the learning and innovation process. When individuals are assured they won't be punished for errors, they're more likely to openly discuss mistakes, allowing the entire team to learn and grow from each incident. Furthermore, a blameless culture promotes psychological safety, enhances job satisfaction, reduces burnout, and ensures that talent remains committed and engaged. +A blameless on-call culture is essential for creating a safe and collaborative environment where engineers can handle incidents without worrying about getting blamed. It recognizes that mistakes are just part of learning and innovating. When people know they won’t be punished for errors, they’re more likely to talk openly about what went wrong, which helps the whole team learn and improve. Plus, a blameless culture boosts psychological safety, job satisfaction, and reduces burnout, keeping everyone committed and engaged. + +Mistakes are gonna happen, which is why having a blameless on-call culture is so important. + +Continue with the fourth part of this series: + +<< template::inline::index site-reliability-engineering-part-4 E-Mail your comments to `paul@nospam.buetow.org` :-) diff --git a/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.gmi b/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.gmi index 5cdb2fe0..63c48f9c 100644 --- a/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.gmi +++ b/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.gmi @@ -51,10 +51,13 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other *BSD related posts are: -=> ./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi 2016-04-09 Jails and ZFS with Puppet on FreeBSD -=> ./2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi 2022-07-30 Let's Encrypt with OpenBSD and Rex -=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD -=> ./2024-01-13-one-reason-why-i-love-openbsd.gmi 2024-01-13 One reason why I love OpenBSD (You are currently reading this) +=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts +=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation +=> ./2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi 2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage => ./2024-04-01-KISS-high-availability-with-OpenBSD.gmi 2024-04-01 KISS high-availability with OpenBSD +=> ./2024-01-13-one-reason-why-i-love-openbsd.gmi 2024-01-13 One reason why I love OpenBSD (You are currently reading this) +=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD +=> ./2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi 2022-07-30 Let's Encrypt with OpenBSD and Rex +=> ./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi 2016-04-09 Jails and ZFS with Puppet on FreeBSD => ../ Back to the main site diff --git a/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.gmi.tpl b/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.gmi.tpl index e86fb30a..2dc17a39 100644 --- a/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.gmi.tpl +++ b/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.gmi.tpl @@ -51,6 +51,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other *BSD related posts are: -<< template::inline::index bsd +<< template::inline::rindex bsd => ../ Back to the main site diff --git a/gemfeed/2024-02-04-from-babylon5.buetow.org-to-.cloud.gmi b/gemfeed/2024-02-04-from-babylon5.buetow.org-to-.cloud.gmi index e33dbf46..bd2d7519 100644 --- a/gemfeed/2024-02-04-from-babylon5.buetow.org-to-.cloud.gmi +++ b/gemfeed/2024-02-04-from-babylon5.buetow.org-to-.cloud.gmi @@ -8,6 +8,23 @@ So, I migrated all of my Docker-based self-hosted services to AWS. Usually, I am => ./from-.org-to-.cloud/old-man-yells-at-cloud.jpg Old man yells at cloud +## Table of Contents + +* ⇢ From `babylon5.buetow.org` to `*.buetow.cloud` +* ⇢ ⇢ The old `*.buetow.org` way +* ⇢ ⇢ I kept my `buetow.org` OpenBSD boxes alive +* ⇢ ⇢ The new `*.buetow.cloud` way +* ⇢ ⇢ The container apps +* ⇢ ⇢ ⇢ `flux.buetow.cloud` +* ⇢ ⇢ ⇢ `audiobookshelf.buetow.cloud` +* ⇢ ⇢ ⇢ `syncthing.buetow.cloud` +* ⇢ ⇢ ⇢ `radicale.buetow.cloud` +* ⇢ ⇢ ⇢ `bag.buetow.cloud` +* ⇢ ⇢ ⇢ `anki.buetow.cloud` +* ⇢ ⇢ ⇢ `vault.buetow.cloud` +* ⇢ ⇢ ⇢ `bastion.buetow.cloud` +* ⇢ ⇢ Conclusion + ## The old `*.buetow.org` way Before the migration, all those services were reachable through `buetow.org`-subdomains (Buetow is my last name) and ran on Docker containers on a single Rocky Linux 9 VM at Hetzner. And there was a Nginx reverse proxy with TLS offloading (with Let's Encrypt certificates). The Rocky Linux 9's hostname was `babylon5.buetow.org` (based on the Science Fiction series). diff --git a/gemfeed/2024-02-04-from-babylon5.buetow.org-to-.cloud.gmi.tpl b/gemfeed/2024-02-04-from-babylon5.buetow.org-to-.cloud.gmi.tpl new file mode 100644 index 00000000..67419606 --- /dev/null +++ b/gemfeed/2024-02-04-from-babylon5.buetow.org-to-.cloud.gmi.tpl @@ -0,0 +1,165 @@ +# From `babylon5.buetow.org` to `*.buetow.cloud` + +> Published at 2024-02-04T00:50:50+02:00 + +Recently, my employer sent me to a week-long AWS course. After the course, there wasn't any hands-on project I could dive into immediately, so I moved parts of my personal infrastructure to AWS to level up a bit through practical hands-on. + +So, I migrated all of my Docker-based self-hosted services to AWS. Usually, I am not a big fan of big cloud providers and instead use smaller hosters or indie providers and self-made solutions. However, I also must go with the times and try out technologies currently hot on the job market. I don't want to become the old man who yells at cloud :D + +=> ./from-.org-to-.cloud/old-man-yells-at-cloud.jpg Old man yells at cloud + +<< template::inline::toc + +## The old `*.buetow.org` way + +Before the migration, all those services were reachable through `buetow.org`-subdomains (Buetow is my last name) and ran on Docker containers on a single Rocky Linux 9 VM at Hetzner. And there was a Nginx reverse proxy with TLS offloading (with Let's Encrypt certificates). The Rocky Linux 9's hostname was `babylon5.buetow.org` (based on the Science Fiction series). + +=> https://en.wikipedia.org/wiki/Babylon_5 + +The downsides of this setup were: + +* Not highly available. If the server goes down, no service is reachable until it's repaired. To be fair, the Hetzner cloud VM is redundant by itself and would have re-spawned on a different worker node, I suppose. +* Manual installation. + +About the manual installation part: I could have used a configuration management system like Rexify, Puppet, etc. But I decided against it back in time, as setting up Docker containers isn't so complicated through simple start scripts. And it's only a single Linux box where a manual installation is less painful. However, regular backups (which Hetzner can do automatically for you) were a must. + +The benefits of this setup were: + +* KISS (Keep it Simple Stupid) +* Cheap + +## I kept my `buetow.org` OpenBSD boxes alive + +As pointed out, I only migrated the Docker-based self-hosted services (which run on the Babylon 5 Rocky Linux box) to AWS. Many self-hostable apps come with ready-to-use container images, making deploying them easy. + +My other two OpenBSD VMs (`blowfish.buetow.org`, hosted at Hetzner, and `fishfinger.buetow.org`, hosted at OpenBSD Amsterdam) still run (and they will keep running) the following services: + +* HTTP server for my websites (e.g. `https://foo.zone`, ...) +* ACME for Let's Encrypt TLS certificate auto-renewal. +* Gemini server for my capsules (e.g. `gemini://foo.zone`) +* Authoritative DNS servers for my domains (but `buetow.cloud`, which is on Route 53 now) +* Mail transfer agent (MTA) +* My Gogios monitoring system. +* My IRC bouncer. + +It is all automated with Rex, aka Rexify. This OpenBSD setup is my "fun" or "for pleasure" setup. Whereas the Rocky Linux 9 one I always considered the "pratical means to the end"-setup to have 3rd party Docker containers up and running with as little work as possible. + +=> https://www.rexify.org (R)?ex, the friendly automation framework +=> ./2023-06-01-kiss-server-monitoring-with-gogios.gmi KISS server monitoring with Gogios +=> ./2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi Let's encrypt with OpenBSD and Rex + +## The new `*.buetow.cloud` way + +With AWS, I decided to get myself a new domain name, as I could fully separate my AWS setup from my conventional setup and give Route 53 as an authoritative DNS a spin. + +I decided to automate everything with Terraform, as I wanted to learn to use it as it appears standard now in the job market. + +All services are installed automatically to AWS ECS Fargate. ECS is AWS's Elastic Container Service, and Fargate automatically manages the underlying hardware infrastructure (e.g., how many CPUs, RAM, etc.) for me. So I don't have to bother about having enough EC2 instances to serve my demands, for example. + +The authoritative DNS for the `buetow.cloud` domain is AWS Route 53. TLS certificates are free here at AWS and offloaded through the AWS Application Load Balancer. The LB acts as a proxy to the ECS container instances of the services. A few services I run in ECS Fargate also require the AWS Network Load Balancer. + +All services require some persistent storage. For that, I use an encrypted EFS file system, automatically replicated across all AZs (availability zones) of my region of choice, `eu-central-1`. + +In case of an AZ outage, I could re-deploy all the failed containers in another AZ, and all the data would still be there. + +The EFS automatically gets backed up by AWS for me following their standard Backup schedule. The daily backups are kept for 30 days. + +Domain registration, TLS certificate configuration and configuration of the EFS backup were quickly done through the AWS web interface. These were only one-off tasks, so they weren't fully automated through Terraform. + +You can find all Terraform manifests here: + +=> https://codeberg.org/snonux/terraform + +Whereas: + +* `org-buetow-base` sets up the bare VPC (IPv4 and IPv6 subnets in 3 AZs, EFS, ECR (the AWS container registry for some self-built containers) and Route 53 zone. It's the requirement for most other Terraform manifests in this repository. +* `org-buetow-bastion` sets up a minimal Amazon Linux EC2 instance where I can manually SSH into and look at the EFS file system (if required). +* `org-buetow-elb` sets up the Elastic Load Balancer, a prerequisite for any service running in ECS Fargate. +* `org-buetow-ecs` finally sets up and deploys all the Docker apps mentioned above. Any apps can be turned on or off via the `variables.tf` file. + +## The container apps + +And here, finally, is the list of all the container apps my Terraform manifests deploy. The FQDNs here may not be reachable. I spin them up only on demand (for cost reasons). All services are fully dual-stacked (IPv4 & IPv6). + +### `flux.buetow.cloud` + +Miniflux is a minimalist and opinionated feed reader. With the move to AWS, I also retired my bloated instance of NextCloud. So, with Miniflux, I retired from NextCloud News. + +Miniflux requires two ECS containers. One is the Miniflux app, and the other is the PostgreSQL DB. + +=> https://miniflux.app/ + + +### `audiobookshelf.buetow.cloud` + +Audiobookshelf was the first Docker app I installed. It is a Self-hosted audiobook and podcast server. It comes with a neat web interface, and there is also an Android app available, which works also in offline mode. This is great, as I only have the ECS instance sometimes running for cost savings. + +With Audiobookshelf, I replaced my former Audible subscription and my separate Podcast app. For Podcast synchronisation I used to use the Gpodder NextCloud sync app. But that one I retired now with Audiobookshelf as well :-) + +=> https://www.audiobookshelf.org + +### `syncthing.buetow.cloud` + +Syncthing is a continuous file synchronisation program. In real-time, it synchronises files between two or more computers, safely protected from prying eyes. Your data is your own, and you deserve to choose where it is stored, whether it is shared with some third party, and how it's transmitted over the internet. + +With Syncthing, I retired my old NextCloud Files and file sync client on all my devices. I also quit my NextCloud Notes setup. All my Notes are now plain Markdown files in a `Notes` directory. On Android, I can edit them with any text or Markdown editor (e.g. Obsidian), and they will be synchronised via Syncthing to my other computers, both forward and back. + +I use Syncthing to synchronise some of my Phone's data (e.g. Notes, Pictures and other documents). Initially, I synced all of my pictures, videos, etc., with AWS. But that was pretty expensive. So for now, I use it only whilst travelling. Otherwise, I will use my Syncthing instance here on my LAN (I have a cheap cloud backup in AWS S3 Glacier Deep Archive, but that's for another blog post). + +=> https://syncthing.net/ + +### `radicale.buetow.cloud` + +Radicale is an excellent minimalist WebDAV calendar and contact synchronisation server. It was good enough to replace my NextCloud Calendar and NextCloud Contacts setup. Unfortunately, there wasn't a ready-to-use Docker image. So, I created my own. + +On Android, it works great together with the DAVx5 client for synchronisation. + +=> https://radicale.org/ +=> https://codeberg.org/snonux/docker-radicale-server +=> https://www.davx5.com/ + +### `bag.buetow.cloud` + +Wallabag is a self-hostable "save now - read later" service, and it also comes with an Android app which also has an offline mode. Think of Getpocket, but open-source! + +=> https://wallabag.org/ +=> https://github.com/wallabag/wallabag + +### `anki.buetow.cloud` + +Anki is a great (the greatest) flash-card learning program. I am currently learning Bulgarian as my 3rd language. There is also an Android app that has an offline mode, and advanced users can also self-host the server `anki-sync-server`. For some reason (not going into the details here), I had to build my own Docker image for the server. + +=> https://apps.ankiweb.net/ +=> https://codeberg.org/snonux/docker-anki-sync-server + +### `vault.buetow.cloud` + +Vaultwarden is an alternative implementation of the Bitwarden server API written in Rust and compatible with upstream Bitwarden clients, perfect for self-hosted deployment where running the official resource-heavy service might not be ideal. So, this is a great password manager server which can be used with any Bitwarden Android app. + +I currently don't use it, but I may in the future. I made it available in my ECS Fargate setup anyway for now. + +=> https://github.com/dani-garcia/vaultwarden + +I currently use `geheim`, a Ruby command line tool I wrote, as my current password manager. You can read a little bit about it here under "More": + +=> ./2022-06-15-sweating-the-small-stuff.gmi Sweating the small stuff + +### `bastion.buetow.cloud` + +This is a tiny ARM-based Amazon Linux EC2 instance, which I sometimes spin up for investigation or manual work on my EFS file system in AWS. + +## Conclusion + +I have learned a lot about AWS and Terraform during this migration. This was actually my first AWS hands-on project with practical use. + +All of this was not particularly difficult (but at times a bit confusing). I see the use of Terraform managing more extensive infrastructures (it was even helpful for my small setup here). At least I know now what all the buzz is about :-). I don't think Terraform's HCL is a nice language. It get's it's job done, but it could be more elegant IMHO. + +Deploying updates to AWS are much easier, and some of the manual maintenance burdens of my Rocky Linux 9 VM are no longer needed. So I will have more time for other projects! + +Will I keep it in the cloud? I don't know yet. But maybe I won't renew the `buetow.cloud` domain and instead will use `*.cloud.buetow.org` or `*.aws.buetow.org` subdomains. + +Will the AWS setup be cheaper than my old Rocky Linux setup? It might be more affordable as I only turn ECS and the load balancers on or off on-demand. Time will tell! The first forecasts suggest that it will be around the same costs. + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.gmi b/gemfeed/2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.gmi index 833c5b35..e767ecb3 100644 --- a/gemfeed/2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.gmi +++ b/gemfeed/2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.gmi @@ -8,6 +8,14 @@ I have tried many note apps for my Android (I use GrapheneOS) phone. Most of the => a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang/logo-small.png Quick logger Logo +## Table of Contents + +* ⇢ A fine Fyne Android app for quickly logging ideas programmed in Go +* ⇢ ⇢ Enter Quick logger +* ⇢ ⇢ All easy-peasy? + +## Enter Quick logger + Enter Quick logger – a compact GUI Android (well, cross-platform due to Fyne) app I've crafted using Go and the nifty Fyne framework. With Fyne, the app can be compiled easily into an Android APK. As of this writing, this app's whole Go source code is only 75 lines short!! This little tool is designed for spontaneous moments, allowing me to quickly log my thoughts as plain text files on my Android phone. There are no fancy file formats. Just plain text! => https://codeberg.org/snonux/quicklogger @@ -46,7 +54,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other Go related posts are: -=> ./2023-04-09-algorithms-and-data-structures-in-golang-part-1.gmi 2023-04-09 Algorithms and Data Structures in Go - Part 1 => ./2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.gmi 2024-03-03 A fine Fyne Android app for quickly logging ideas programmed in Go (You are currently reading this) => ../ Back to the main site diff --git a/gemfeed/2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.gmi.tpl b/gemfeed/2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.gmi.tpl index c5f106af..a1b063a5 100644 --- a/gemfeed/2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.gmi.tpl +++ b/gemfeed/2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.gmi.tpl @@ -8,6 +8,10 @@ I have tried many note apps for my Android (I use GrapheneOS) phone. Most of the => a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang/logo-small.png Quick logger Logo +<< template::inline::toc + +## Enter Quick logger + Enter Quick logger – a compact GUI Android (well, cross-platform due to Fyne) app I've crafted using Go and the nifty Fyne framework. With Fyne, the app can be compiled easily into an Android APK. As of this writing, this app's whole Go source code is only 75 lines short!! This little tool is designed for spontaneous moments, allowing me to quickly log my thoughts as plain text files on my Android phone. There are no fancy file formats. Just plain text! => https://codeberg.org/snonux/quicklogger @@ -46,6 +50,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other Go related posts are: -<< template::inline::index golang +<< template::inline::rindex golang => ../ Back to the main site diff --git a/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi b/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi index 656cd33e..51e60c82 100644 --- a/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi +++ b/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi @@ -2,6 +2,14 @@ > Published at 2024-03-30T22:12:56+02:00 +I have always wanted a highly available setup for my personal websites. I could have used off-the-shelf hosting solutions or hosted my sites in an AWS S3 bucket. I have used technologies like (in unsorted and slightly unrelated order) BGP, LVS/IPVS, ldirectord, Pacemaker, STONITH, scripted VIP failover via ARP, heartbeat, heartbeat2, Corosync, keepalived, DRBD, and commercial F5 Load Balancers for high availability at work. + +But still, my personal sites were never highly available. All those technologies are great for professional use, but I was looking for something much more straightforward for my personal space - something as KISS (keep it simple and stupid) as possible. + +It would be fine if my personal website wasn't highly available, but the geek in me wants it anyway. + +> PS: ASCII-art below reflects an OpenBSD under-water world with all the tools available in the base system. + ``` Art by Michael J. Penick (mod. by Paul B.) ACME-sky @@ -27,30 +35,19 @@ _____|_:_:_| (o)-(o) |_:_:_|--'`-. ,--. ksh under-water (((\'/ ``` -``` -Table of contents -================= - -KISS high-availability with OpenBSD - My auto-failover requirements - My HA solution - Only OpenBSD base installation required - Fairly cheap and geo-redundant - Failover time and split-brain - Failover support for multiple protocols - Let's encrypt TLS certificates - Monitoring - Rex automation - More HA -``` - -I have always wanted a highly available setup for my personal websites. I could have used off-the-shelf hosting solutions or hosted my sites in an AWS S3 bucket. I have used technologies like (in unsorted and slightly unrelated order) BGP, LVS/IPVS, ldirectord, Pacemaker, STONITH, scripted VIP failover via ARP, heartbeat, heartbeat2, Corosync, keepalived, DRBD, and commercial F5 Load Balancers for high availability at work. +## Table of Contents -But still, my personal sites were never highly available. All those technologies are great for professional use, but I was looking for something much more straightforward for my personal space - something as KISS (keep it simple and stupid) as possible. - -It would be fine if my personal website wasn't highly available, but the geek in me wants it anyway. - -> PS: ASCII-art reflects an OpenBSD under-water world with all the tools available in the base system. +* ⇢ KISS high-availability with OpenBSD +* ⇢ ⇢ My auto-failover requirements +* ⇢ ⇢ My HA solution +* ⇢ ⇢ ⇢ Only OpenBSD base installation required +* ⇢ ⇢ ⇢ Fairly cheap and geo-redundant +* ⇢ ⇢ ⇢ Failover time and split-brain +* ⇢ ⇢ ⇢ Failover support for multiple protocols +* ⇢ ⇢ ⇢ Let's encrypt TLS certificates +* ⇢ ⇢ ⇢ Monitoring +* ⇢ ⇢ ⇢ Rex automation +* ⇢ ⇢ More HA ## My auto-failover requirements @@ -303,12 +300,15 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other *BSD and KISS related posts are: -=> ./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi 2016-04-09 Jails and ZFS with Puppet on FreeBSD -=> ./2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi 2022-07-30 Let's Encrypt with OpenBSD and Rex -=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD -=> ./2023-06-01-kiss-server-monitoring-with-gogios.gmi 2023-06-01 KISS server monitoring with Gogios -=> ./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.gmi 2023-10-29 KISS static web photo albums with `photoalbum.sh` -=> ./2024-01-13-one-reason-why-i-love-openbsd.gmi 2024-01-13 One reason why I love OpenBSD +=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts +=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation +=> ./2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi 2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage => ./2024-04-01-KISS-high-availability-with-OpenBSD.gmi 2024-04-01 KISS high-availability with OpenBSD (You are currently reading this) +=> ./2024-01-13-one-reason-why-i-love-openbsd.gmi 2024-01-13 One reason why I love OpenBSD +=> ./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.gmi 2023-10-29 KISS static web photo albums with `photoalbum.sh` +=> ./2023-06-01-kiss-server-monitoring-with-gogios.gmi 2023-06-01 KISS server monitoring with Gogios +=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD +=> ./2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi 2022-07-30 Let's Encrypt with OpenBSD and Rex +=> ./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi 2016-04-09 Jails and ZFS with Puppet on FreeBSD => ../ Back to the main site diff --git a/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi.tpl b/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi.tpl index 92343e10..041327ce 100644 --- a/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi.tpl +++ b/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi.tpl @@ -2,6 +2,14 @@ > Published at 2024-03-30T22:12:56+02:00 +I have always wanted a highly available setup for my personal websites. I could have used off-the-shelf hosting solutions or hosted my sites in an AWS S3 bucket. I have used technologies like (in unsorted and slightly unrelated order) BGP, LVS/IPVS, ldirectord, Pacemaker, STONITH, scripted VIP failover via ARP, heartbeat, heartbeat2, Corosync, keepalived, DRBD, and commercial F5 Load Balancers for high availability at work. + +But still, my personal sites were never highly available. All those technologies are great for professional use, but I was looking for something much more straightforward for my personal space - something as KISS (keep it simple and stupid) as possible. + +It would be fine if my personal website wasn't highly available, but the geek in me wants it anyway. + +> PS: ASCII-art below reflects an OpenBSD under-water world with all the tools available in the base system. + ``` Art by Michael J. Penick (mod. by Paul B.) ACME-sky @@ -29,14 +37,6 @@ _____|_:_:_| (o)-(o) |_:_:_|--'`-. ,--. ksh under-water (((\'/ << template::inline::toc -I have always wanted a highly available setup for my personal websites. I could have used off-the-shelf hosting solutions or hosted my sites in an AWS S3 bucket. I have used technologies like (in unsorted and slightly unrelated order) BGP, LVS/IPVS, ldirectord, Pacemaker, STONITH, scripted VIP failover via ARP, heartbeat, heartbeat2, Corosync, keepalived, DRBD, and commercial F5 Load Balancers for high availability at work. - -But still, my personal sites were never highly available. All those technologies are great for professional use, but I was looking for something much more straightforward for my personal space - something as KISS (keep it simple and stupid) as possible. - -It would be fine if my personal website wasn't highly available, but the geek in me wants it anyway. - -> PS: ASCII-art reflects an OpenBSD under-water world with all the tools available in the base system. - ## My auto-failover requirements * Be OpenBSD-based (I prefer OpenBSD because of the cleanliness and good documentation) and rely on as few external packages as possible. @@ -288,6 +288,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other *BSD and KISS related posts are: -<< template::inline::index bsd kiss +<< template::inline::rindex bsd kiss => ../ Back to the main site diff --git a/gemfeed/2024-05-01-slow-productivity-book-notes.gmi b/gemfeed/2024-05-01-slow-productivity-book-notes.gmi index 3329d51c..b280d739 100644 --- a/gemfeed/2024-05-01-slow-productivity-book-notes.gmi +++ b/gemfeed/2024-05-01-slow-productivity-book-notes.gmi @@ -20,6 +20,18 @@ These notes are mainly for my own use, but you may find them helpful. ''' ``` +## Table of Contents + +* ⇢ "Slow Productivity" book notes +* ⇢ ⇢ It's not "slow productivity" +* ⇢ ⇢ Pseudo-productivity and Shallow work +* ⇢ ⇢ Accomplishments without burnout +* ⇢ ⇢ Do fewer things +* ⇢ ⇢ Work at a natural pace +* ⇢ ⇢ Obsess over quality + +## It's not "slow productivity" + "Slow productivity" does not mean being less productive. Cal Newport wants to point out that you can be much more productive with "slow productivity" than you would be without it. It is a different way of working than most of us are used to in the modern workplace, which is hyper-connected and always online. ## Pseudo-productivity and Shallow work @@ -126,13 +138,13 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other book notes of mine are: -=> ./2023-03-16-the-pragmatic-programmer-book-notes.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ./2023-04-01-never-split-the-difference-book-notes.gmi 2023-04-01 "Never split the difference" book notes -=> ./2023-05-06-the-obstacle-is-the-way-book-notes.gmi 2023-05-06 "The Obstacle is the Way" book notes -=> ./2023-07-17-career-guide-and-soft-skills-book-notes.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes -=> ./2023-11-11-mind-management-book-notes.gmi 2023-11-11 "Mind Management" book notes -=> ./2024-05-01-slow-productivity-book-notes.gmi 2024-05-01 "Slow Productivity" book notes (You are currently reading this) +=> ./2024-10-24-staff-engineer-book-notes.gmi 2024-10-24 "Staff Engineer" book notes => ./2024-07-07-the-stoic-challenge-book-notes.gmi 2024-07-07 "The Stoic Challenge" book notes +=> ./2024-05-01-slow-productivity-book-notes.gmi 2024-05-01 "Slow Productivity" book notes (You are currently reading this) +=> ./2023-11-11-mind-management-book-notes.gmi 2023-11-11 "Mind Management" book notes +=> ./2023-07-17-career-guide-and-soft-skills-book-notes.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes +=> ./2023-05-06-the-obstacle-is-the-way-book-notes.gmi 2023-05-06 "The Obstacle is the Way" book notes +=> ./2023-04-01-never-split-the-difference-book-notes.gmi 2023-04-01 "Never split the difference" book notes +=> ./2023-03-16-the-pragmatic-programmer-book-notes.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ../resources.gmi More books and other resources I found useful. => ../ Back to the main site diff --git a/gemfeed/2024-05-01-slow-productivity-book-notes.gmi.tpl b/gemfeed/2024-05-01-slow-productivity-book-notes.gmi.tpl index 3436f89b..712bf047 100644 --- a/gemfeed/2024-05-01-slow-productivity-book-notes.gmi.tpl +++ b/gemfeed/2024-05-01-slow-productivity-book-notes.gmi.tpl @@ -20,6 +20,10 @@ These notes are mainly for my own use, but you may find them helpful. ''' ``` +<< template::inline::toc + +## It's not "slow productivity" + "Slow productivity" does not mean being less productive. Cal Newport wants to point out that you can be much more productive with "slow productivity" than you would be without it. It is a different way of working than most of us are used to in the modern workplace, which is hyper-connected and always online. ## Pseudo-productivity and Shallow work @@ -126,7 +130,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other book notes of mine are: -<< template::inline::index book-notes +<< template::inline::rindex book-notes -=> ../resources.gmi More books and other resources I found useful. => ../ Back to the main site diff --git a/gemfeed/2024-05-03-projects-i-currently-dont-have-time-for.gmi b/gemfeed/2024-05-03-projects-i-currently-dont-have-time-for.gmi index 6e12585c..3809376e 100644 --- a/gemfeed/2024-05-03-projects-i-currently-dont-have-time-for.gmi +++ b/gemfeed/2024-05-03-projects-i-currently-dont-have-time-for.gmi @@ -2,6 +2,8 @@ > Published at 2024-05-03T16:23:03+03:00 +Over the years, I have collected many ideas for my personal projects and noted them down. I am currently in the process of cleaning up all my notes and reviewing those ideas. I don’t have time for the ones listed here and won’t have any soon due to other commitments and personal projects. So, in order to "get rid of them" from my notes folder, I decided to simply put them in this blog post so that those ideas don't get lost. Maybe I will pick up one or another idea someday in the future, but for now, they are all put on ice in favor of other personal projects or family time. + ``` Art by Laura Brown @@ -15,50 +17,42 @@ Art by Laura Brown ``` -## Introduction - -Over the years, I have collected many ideas for my personal projects and noted them down. I am currently in the process of cleaning up all my notes and reviewing those ideas. I don’t have time for the ones listed here and won’t have any soon due to other commitments and personal projects. So, in order to "get rid of them" from my notes folder, I decided to simply put them in this blog post so that those ideas don't get lost. Maybe I will pick up one or another idea someday in the future, but for now, they are all put on ice in favor of other personal projects or family time. - -``` -Table of contents -================= - -Projects I currently don't have time for - Introduction - Hardware projects I don't have time for - I use Arch, btw! - OpenBSD home router - Pi-Hole server - Infodash - Reading station - Retro station - Sound server - Project Freekat - Programming projects I don't have time for - CLI-HIVE - Enhanced KISS home photo albums - KISS file sync server with end-to-end encryption - A language that compiles to `bash` - A language that compiles to `sed` - Renovate VS-Sim - KISS ticketing system - A domain-specific language (DSL) for work - Self-hosting projects I don't have time for - My own Matrix server - Ampache music server - Librum eBook reader - Memos - Note-taking service - Bepasty server - Books I don't have time to read - Fluent Python - Programming Ruby - Peter F. Hamilton science fiction books - New websites I don't have time for - Create a "Why Raku Rox" site - Research projects I don't have time for - Project secure - CPU utilisation is all wrong -``` +## Table of Contents + +* ⇢ Projects I currently don't have time for +* ⇢ ⇢ Hardware projects I don't have time for +* ⇢ ⇢ ⇢ I use Arch, btw! +* ⇢ ⇢ ⇢ OpenBSD home router +* ⇢ ⇢ ⇢ Pi-Hole server +* ⇢ ⇢ ⇢ Infodash +* ⇢ ⇢ ⇢ Reading station +* ⇢ ⇢ ⇢ Retro station +* ⇢ ⇢ ⇢ Sound server +* ⇢ ⇢ ⇢ Project Freekat +* ⇢ ⇢ Programming projects I don't have time for +* ⇢ ⇢ ⇢ CLI-HIVE +* ⇢ ⇢ ⇢ Enhanced KISS home photo albums +* ⇢ ⇢ ⇢ KISS file sync server with end-to-end encryption +* ⇢ ⇢ ⇢ A language that compiles to `bash` +* ⇢ ⇢ ⇢ A language that compiles to `sed` +* ⇢ ⇢ ⇢ Renovate VS-Sim +* ⇢ ⇢ ⇢ KISS ticketing system +* ⇢ ⇢ ⇢ A domain-specific language (DSL) for work +* ⇢ ⇢ Self-hosting projects I don't have time for +* ⇢ ⇢ ⇢ My own Matrix server +* ⇢ ⇢ ⇢ Ampache music server +* ⇢ ⇢ ⇢ Librum eBook reader +* ⇢ ⇢ ⇢ Memos - Note-taking service +* ⇢ ⇢ ⇢ Bepasty server +* ⇢ ⇢ Books I don't have time to read +* ⇢ ⇢ ⇢ Fluent Python +* ⇢ ⇢ ⇢ Programming Ruby +* ⇢ ⇢ ⇢ Peter F. Hamilton science fiction books +* ⇢ ⇢ New websites I don't have time for +* ⇢ ⇢ ⇢ Create a "Why Raku Rox" site +* ⇢ ⇢ Research projects I don't have time for +* ⇢ ⇢ ⇢ Project secure +* ⇢ ⇢ ⇢ CPU utilisation is all wrong ## Hardware projects I don't have time for diff --git a/gemfeed/2024-05-03-projects-i-currently-dont-have-time-for.gmi.tpl b/gemfeed/2024-05-03-projects-i-currently-dont-have-time-for.gmi.tpl index 1fbf5e57..afac0b42 100644 --- a/gemfeed/2024-05-03-projects-i-currently-dont-have-time-for.gmi.tpl +++ b/gemfeed/2024-05-03-projects-i-currently-dont-have-time-for.gmi.tpl @@ -2,6 +2,8 @@ > Published at 2024-05-03T16:23:03+03:00 +Over the years, I have collected many ideas for my personal projects and noted them down. I am currently in the process of cleaning up all my notes and reviewing those ideas. I don’t have time for the ones listed here and won’t have any soon due to other commitments and personal projects. So, in order to "get rid of them" from my notes folder, I decided to simply put them in this blog post so that those ideas don't get lost. Maybe I will pick up one or another idea someday in the future, but for now, they are all put on ice in favor of other personal projects or family time. + ``` Art by Laura Brown @@ -15,10 +17,6 @@ Art by Laura Brown ``` -## Introduction - -Over the years, I have collected many ideas for my personal projects and noted them down. I am currently in the process of cleaning up all my notes and reviewing those ideas. I don’t have time for the ones listed here and won’t have any soon due to other commitments and personal projects. So, in order to "get rid of them" from my notes folder, I decided to simply put them in this blog post so that those ideas don't get lost. Maybe I will pick up one or another idea someday in the future, but for now, they are all put on ice in favor of other personal projects or family time. - << template::inline::toc ## Hardware projects I don't have time for diff --git a/gemfeed/2024-06-23-terminal-multiplexing-with-tmux.gmi b/gemfeed/2024-06-23-terminal-multiplexing-with-tmux.gmi index 42f01cb5..17db3c9f 100644 --- a/gemfeed/2024-06-23-terminal-multiplexing-with-tmux.gmi +++ b/gemfeed/2024-06-23-terminal-multiplexing-with-tmux.gmi @@ -2,6 +2,15 @@ > Published at 2024-06-23T22:41:59+03:00 +Tmux (Terminal Multiplexer) is a powerful, terminal-based tool that manages multiple terminal sessions within a single window. Here are some of its primary features and functionalities: + +* Session management +* Window and Pane management +* Persistent Workspace +* Customization + +=> https://github.com/tmux/tmux/wiki + ``` _______ |.-----.| @@ -14,39 +23,27 @@ jgs `-=========-`() mod. by Paul B. ``` -``` -Table of contents -================= - -Terminal multiplexing with `tmux` - Introduction - Shell aliases - The `tn` alias - Creating a new session - Cleaning up default sessions automatically - Renaming sessions - The `ta` alias - Attaching to a session - The `tr` alias - For a nested remote session - Change of the Tmux prefix for better nesting - The `ts` alias - Searching sessions with fuzzy finder - The `tssh` alias - Cluster SSH replacement - The `tmux::tssh_from_argument` helper - The `tmux::tssh_from_file` helper - `tssh` examples - Common Tmux commands I use in `tssh` - Copy and paste workflow - Tmux configurations -``` - -## Introduction - -Tmux (Terminal Multiplexer) is a powerful, terminal-based tool that manages multiple terminal sessions within a single window. Here are some of its primary features and functionalities: - -* Session management -* Window and Pane management -* Persistent Workspace -* Customization - -=> https://github.com/tmux/tmux/wiki +## Table of Contents + +* ⇢ Terminal multiplexing with `tmux` +* ⇢ ⇢ Before continuing... +* ⇢ ⇢ Shell aliases +* ⇢ ⇢ The `tn` alias - Creating a new session +* ⇢ ⇢ ⇢ Cleaning up default sessions automatically +* ⇢ ⇢ ⇢ Renaming sessions +* ⇢ ⇢ The `ta` alias - Attaching to a session +* ⇢ ⇢ The `tr` alias - For a nested remote session +* ⇢ ⇢ ⇢ Change of the Tmux prefix for better nesting +* ⇢ ⇢ The `ts` alias - Searching sessions with fuzzy finder +* ⇢ ⇢ The `tssh` alias - Cluster SSH replacement +* ⇢ ⇢ ⇢ The `tmux::tssh_from_argument` helper +* ⇢ ⇢ ⇢ The `tmux::tssh_from_file` helper +* ⇢ ⇢ ⇢ `tssh` examples +* ⇢ ⇢ ⇢ Common Tmux commands I use in `tssh` +* ⇢ ⇢ Copy and paste workflow +* ⇢ ⇢ Tmux configurations + +## Before continuing... Before continuing to read this post, I encourage you to get familiar with Tmux first (unless you already know the basics). You can go through the official getting started guide: diff --git a/gemfeed/2024-06-23-terminal-multiplexing-with-tmux.gmi.tpl b/gemfeed/2024-06-23-terminal-multiplexing-with-tmux.gmi.tpl index 626a2d61..3c729b98 100644 --- a/gemfeed/2024-06-23-terminal-multiplexing-with-tmux.gmi.tpl +++ b/gemfeed/2024-06-23-terminal-multiplexing-with-tmux.gmi.tpl @@ -2,6 +2,15 @@ > Published at 2024-06-23T22:41:59+03:00 +Tmux (Terminal Multiplexer) is a powerful, terminal-based tool that manages multiple terminal sessions within a single window. Here are some of its primary features and functionalities: + +* Session management +* Window and Pane management +* Persistent Workspace +* Customization + +=> https://github.com/tmux/tmux/wiki + ``` _______ |.-----.| @@ -16,16 +25,7 @@ jgs `-=========-`() << template::inline::toc -## Introduction - -Tmux (Terminal Multiplexer) is a powerful, terminal-based tool that manages multiple terminal sessions within a single window. Here are some of its primary features and functionalities: - -* Session management -* Window and Pane management -* Persistent Workspace -* Customization - -=> https://github.com/tmux/tmux/wiki +## Before continuing... Before continuing to read this post, I encourage you to get familiar with Tmux first (unless you already know the basics). You can go through the official getting started guide: diff --git a/gemfeed/2024-07-05-random-weird-things.gmi b/gemfeed/2024-07-05-random-weird-things.gmi index dd8e75e6..5ad17655 100644 --- a/gemfeed/2024-07-05-random-weird-things.gmi +++ b/gemfeed/2024-07-05-random-weird-things.gmi @@ -1,9 +1,12 @@ -# Random Weird Things +# Random Weird Things - Part Ⅰ -> Published at 2024-07-05T10:59:59+03:00 +> Published at 2024-07-05T10:59:59+03:00; Updated at 2025-02-08 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. As a start, here are ten of them. +=> ./2024-07-05-random-weird-things.gmi 2024-07-05 Random Weird Things - Part Ⅰ (You are currently reading this) +=> ./2025-02-08-random-weird-things-ii.gmi 2025-02-08 Random Weird Things - Part Ⅱ + ``` /\_/\ WHOA!! ( o.o ) @@ -13,43 +16,74 @@ WHOA!! ( o.o ) /______\ \ ``` +## Table of Contents + +* ⇢ Random Weird Things - Part Ⅰ +* ⇢ ⇢ 1. `bad.horse` traceroute +* ⇢ ⇢ 2. ASCII cinema +* ⇢ ⇢ 3. Netflix's Hello World application +* ⇢ ⇢ C programming +* ⇢ ⇢ ⇢ 4. Indexing an array +* ⇢ ⇢ ⇢ 5. Variables with prefix `$` +* ⇢ ⇢ 6. Object oriented shell scripts using `ksh` +* ⇢ ⇢ 7. This works in Go +* ⇢ ⇢ 8. "I am a Teapot" HTTP response code +* ⇢ ⇢ 9. `jq` is a functional programming language +* ⇢ ⇢ 10. Regular expression to verify email addresses + ## 1. `bad.horse` traceroute Run traceroute to get the poem (or song). +> Update: A reader hinted that by specifying `-n 60`, there will be even more output! + ```bash -% traceroute bad.horse -traceroute to bad.horse (162.252.205.157), 30 hops max, 60 byte packets - 1 dsldevice.lan (192.168.1.1) 5.712 ms 5.800 ms 6.466 ms - 2 87-243-116-2.ip.btc-net.bg (87.243.116.2) 8.017 ms 7.506 ms 8.432 ms - 3 * * * +❯ traceroute -m 60 bad.horse +traceroute to bad.horse (162.252.205.157), 60 hops max, 60 byte packets + 1 _gateway (192.168.1.1) 5.237 ms 5.264 ms 6.009 ms + 2 77-85-0-2.ip.btc-net.bg (77.85.0.2) 8.753 ms 7.112 ms 8.336 ms + 3 212-39-69-103.ip.btc-net.bg (212.39.69.103) 9.434 ms 9.268 ms 9.986 ms 4 * * * - 5 xe-1-2-0.mpr1.fra4.de.above.net (80.81.194.26) 39.952 ms 40.155 ms 40.139 ms - 6 ae12.cs1.fra6.de.eth.zayo.com (64.125.26.172) 128.014 ms * * + 5 xe-1-2-0.mpr1.fra4.de.above.net (80.81.194.26) 39.812 ms 39.030 ms 39.772 ms + 6 * ae12.cs1.fra6.de.eth.zayo.com (64.125.26.172) 123.576 ms * 7 * * * 8 * * * - 9 ae10.cs1.lhr15.uk.eth.zayo.com (64.125.29.17) 120.625 ms 121.117 ms 121.050 ms -10 * * * + 9 ae10.cr1.lhr15.uk.eth.zayo.com (64.125.29.17) 119.097 ms 119.478 ms 120.767 ms +10 ae2.cr1.lhr11.uk.zip.zayo.com (64.125.24.140) 120.398 ms 121.147 ms 120.948 ms 11 * * * -12 * * * -13 ae5.mpr1.tor3.ca.zip.zayo.com (64.125.23.118) 192.605 ms 205.741 ms 203.607 ms -14 64.124.217.237.IDIA-265104-ZYO.zip.zayo.com (64.124.217.237) 204.673 ms 134.674 ms 131.442 ms +12 ae25.mpr1.yyz1.ca.zip.zayo.com (64.125.23.117) 145.072 ms * 181.773 ms +13 ae5.mpr1.tor3.ca.zip.zayo.com (64.125.23.118) 168.239 ms 168.158 ms 168.137 ms +14 64.124.217.237.IDIA-265104-ZYO.zip.zayo.com (64.124.217.237) 168.026 ms 167.999 ms 165.451 ms 15 * * * -16 67.223.96.90 (67.223.96.90) 128.245 ms 127.844 ms 127.843 ms -17 bad.horse (162.252.205.130) 128.194 ms 122.854 ms 121.786 ms -18 bad.horse (162.252.205.131) 128.831 ms 128.341 ms 186.559 ms -19 bad.horse (162.252.205.132) 185.716 ms 180.121 ms 180.042 ms -20 bad.horse (162.252.205.133) 203.170 ms 203.076 ms 203.168 ms -21 he.rides.across.the.nation (162.252.205.134) 203.115 ms 141.830 ms 141.799 ms -22 the.thoroughbred.of.sin (162.252.205.135) 147.965 ms 148.230 ms 170.478 ms -23 he.got.the.application (162.252.205.136) 165.161 ms 164.939 ms 159.085 ms -24 that.you.just.sent.in (162.252.205.137) 162.310 ms 158.569 ms 158.896 ms -25 it.needs.evaluation (162.252.205.138) 162.927 ms 163.046 ms 163.085 ms -26 so.let.the.games.begin (162.252.205.139) 233.363 ms 233.545 ms 233.317 ms -27 a.heinous.crime (162.252.205.140) 237.745 ms 233.614 ms 233.740 ms -28 a.show.of.force (162.252.205.141) 237.974 ms 176.085 ms 175.927 ms -29 a.murder.would.be.nice.of.course (162.252.205.142) 181.838 ms 181.858 ms 182.059 ms -30 bad.horse (162.252.205.143) 187.731 ms 187.416 ms 187.532 ms +16 t00.toroc1.on.ca.sn11.net (162.252.204.2) 131.598 ms 131.308 ms 131.482 ms +17 bad.horse (162.252.205.130) 131.430 ms 145.914 ms 130.514 ms +18 bad.horse (162.252.205.131) 136.634 ms 145.295 ms 135.631 ms +19 bad.horse (162.252.205.132) 139.158 ms 148.363 ms 138.934 ms +20 bad.horse (162.252.205.133) 145.395 ms 148.054 ms 147.140 ms +21 he.rides.across.the.nation (162.252.205.134) 149.687 ms 147.731 ms 150.135 ms +22 the.thoroughbred.of.sin (162.252.205.135) 156.644 ms 155.155 ms 156.447 ms +23 he.got.the.application (162.252.205.136) 161.187 ms 162.318 ms 162.674 ms +24 that.you.just.sent.in (162.252.205.137) 166.763 ms 166.675 ms 164.243 ms +25 it.needs.evaluation (162.252.205.138) 172.073 ms 171.919 ms 171.390 ms +26 so.let.the.games.begin (162.252.205.139) 175.386 ms 174.180 ms 175.965 ms +27 a.heinous.crime (162.252.205.140) 180.857 ms 180.766 ms 180.192 ms +28 a.show.of.force (162.252.205.141) 187.942 ms 186.669 ms 186.986 ms +29 a.murder.would.be.nice.of.course (162.252.205.142) 191.349 ms 191.939 ms 190.740 ms +30 bad.horse (162.252.205.143) 195.425 ms 195.716 ms 196.186 ms +31 bad.horse (162.252.205.144) 199.238 ms 200.620 ms 200.318 ms +32 bad.horse (162.252.205.145) 207.554 ms 206.729 ms 205.201 ms +33 he-s.bad (162.252.205.146) 211.087 ms 211.649 ms 211.712 ms +34 the.evil.league.of.evil (162.252.205.147) 212.657 ms 216.777 ms 216.589 ms +35 is.watching.so.beware (162.252.205.148) 220.911 ms 220.326 ms 221.961 ms +36 the.grade.that.you.receive (162.252.205.149) 225.384 ms 225.696 ms 225.640 ms +37 will.be.your.last.we.swear (162.252.205.150) 232.312 ms 230.989 ms 230.919 ms +38 so.make.the.bad.horse.gleeful (162.252.205.151) 235.761 ms 235.291 ms 235.585 ms +39 or.he-ll.make.you.his.mare (162.252.205.152) 241.350 ms 239.407 ms 238.394 ms +40 o_o (162.252.205.153) 246.154 ms 247.650 ms 247.110 ms +41 you-re.saddled.up (162.252.205.154) 250.925 ms 250.401 ms 250.619 ms +42 there-s.no.recourse (162.252.205.155) 256.071 ms 251.154 ms 255.340 ms +43 it-s.hi-ho.silver (162.252.205.156) 260.152 ms 261.775 ms 261.544 ms +44 signed.bad.horse (162.252.205.157) 262.430 ms 261.410 ms 261.365 ms ``` ## 2. ASCII cinema @@ -245,7 +279,7 @@ This is a pretty old meme, but still worth posting here (as some may be unaware) ?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\0 31]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\ -](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+ +>(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+ (?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?: (?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z |(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n) @@ -261,8 +295,8 @@ r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ |\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r \n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?: \r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t -]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031 -]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\]( +>))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031 +>+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\]( ?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(? :(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(? :\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(? @@ -281,7 +315,7 @@ r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ :\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([ ^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\" .\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\ -]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\ +>\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\ [\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\ r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\] @@ -293,17 +327,17 @@ r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] (?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\". \[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[ ^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\] -]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)(?:,\s*( +>))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)(?:,\s*( ?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\ ".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:( ?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[ \["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t -])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t -])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(? +>)*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t +>)+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(? :\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+| \Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?: [^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\ -]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n) +>]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n) ?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[" ()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n) ?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<> diff --git a/gemfeed/2024-07-05-random-weird-things.gmi.tpl b/gemfeed/2024-07-05-random-weird-things.gmi.tpl new file mode 100644 index 00000000..24022f62 --- /dev/null +++ b/gemfeed/2024-07-05-random-weird-things.gmi.tpl @@ -0,0 +1,352 @@ +# Random Weird Things - Part Ⅰ + +> Published at 2024-07-05T10:59:59+03:00; Updated at 2025-02-08 + +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. As a start, here are ten of them. + +<< template::inline::index random-weird-things + +``` + /\_/\ +WHOA!! ( o.o ) + > ^ < + / - \ + / \ + /______\ \ +``` + +<< template::inline::toc + +## 1. `bad.horse` traceroute + +Run traceroute to get the poem (or song). + +> Update: A reader hinted that by specifying `-n 60`, there will be even more output! + +```bash +❯ traceroute -m 60 bad.horse +traceroute to bad.horse (162.252.205.157), 60 hops max, 60 byte packets + 1 _gateway (192.168.1.1) 5.237 ms 5.264 ms 6.009 ms + 2 77-85-0-2.ip.btc-net.bg (77.85.0.2) 8.753 ms 7.112 ms 8.336 ms + 3 212-39-69-103.ip.btc-net.bg (212.39.69.103) 9.434 ms 9.268 ms 9.986 ms + 4 * * * + 5 xe-1-2-0.mpr1.fra4.de.above.net (80.81.194.26) 39.812 ms 39.030 ms 39.772 ms + 6 * ae12.cs1.fra6.de.eth.zayo.com (64.125.26.172) 123.576 ms * + 7 * * * + 8 * * * + 9 ae10.cr1.lhr15.uk.eth.zayo.com (64.125.29.17) 119.097 ms 119.478 ms 120.767 ms +10 ae2.cr1.lhr11.uk.zip.zayo.com (64.125.24.140) 120.398 ms 121.147 ms 120.948 ms +11 * * * +12 ae25.mpr1.yyz1.ca.zip.zayo.com (64.125.23.117) 145.072 ms * 181.773 ms +13 ae5.mpr1.tor3.ca.zip.zayo.com (64.125.23.118) 168.239 ms 168.158 ms 168.137 ms +14 64.124.217.237.IDIA-265104-ZYO.zip.zayo.com (64.124.217.237) 168.026 ms 167.999 ms 165.451 ms +15 * * * +16 t00.toroc1.on.ca.sn11.net (162.252.204.2) 131.598 ms 131.308 ms 131.482 ms +17 bad.horse (162.252.205.130) 131.430 ms 145.914 ms 130.514 ms +18 bad.horse (162.252.205.131) 136.634 ms 145.295 ms 135.631 ms +19 bad.horse (162.252.205.132) 139.158 ms 148.363 ms 138.934 ms +20 bad.horse (162.252.205.133) 145.395 ms 148.054 ms 147.140 ms +21 he.rides.across.the.nation (162.252.205.134) 149.687 ms 147.731 ms 150.135 ms +22 the.thoroughbred.of.sin (162.252.205.135) 156.644 ms 155.155 ms 156.447 ms +23 he.got.the.application (162.252.205.136) 161.187 ms 162.318 ms 162.674 ms +24 that.you.just.sent.in (162.252.205.137) 166.763 ms 166.675 ms 164.243 ms +25 it.needs.evaluation (162.252.205.138) 172.073 ms 171.919 ms 171.390 ms +26 so.let.the.games.begin (162.252.205.139) 175.386 ms 174.180 ms 175.965 ms +27 a.heinous.crime (162.252.205.140) 180.857 ms 180.766 ms 180.192 ms +28 a.show.of.force (162.252.205.141) 187.942 ms 186.669 ms 186.986 ms +29 a.murder.would.be.nice.of.course (162.252.205.142) 191.349 ms 191.939 ms 190.740 ms +30 bad.horse (162.252.205.143) 195.425 ms 195.716 ms 196.186 ms +31 bad.horse (162.252.205.144) 199.238 ms 200.620 ms 200.318 ms +32 bad.horse (162.252.205.145) 207.554 ms 206.729 ms 205.201 ms +33 he-s.bad (162.252.205.146) 211.087 ms 211.649 ms 211.712 ms +34 the.evil.league.of.evil (162.252.205.147) 212.657 ms 216.777 ms 216.589 ms +35 is.watching.so.beware (162.252.205.148) 220.911 ms 220.326 ms 221.961 ms +36 the.grade.that.you.receive (162.252.205.149) 225.384 ms 225.696 ms 225.640 ms +37 will.be.your.last.we.swear (162.252.205.150) 232.312 ms 230.989 ms 230.919 ms +38 so.make.the.bad.horse.gleeful (162.252.205.151) 235.761 ms 235.291 ms 235.585 ms +39 or.he-ll.make.you.his.mare (162.252.205.152) 241.350 ms 239.407 ms 238.394 ms +40 o_o (162.252.205.153) 246.154 ms 247.650 ms 247.110 ms +41 you-re.saddled.up (162.252.205.154) 250.925 ms 250.401 ms 250.619 ms +42 there-s.no.recourse (162.252.205.155) 256.071 ms 251.154 ms 255.340 ms +43 it-s.hi-ho.silver (162.252.205.156) 260.152 ms 261.775 ms 261.544 ms +44 signed.bad.horse (162.252.205.157) 262.430 ms 261.410 ms 261.365 ms +``` + +## 2. ASCII cinema + +Fancy watching Star Wars Episode IV in ASCII? Head to the ASCII cinema: + +=> https://asciinema.org/a/569727 + +## 3. Netflix's Hello World application + +Netflix has got the Hello World application run in production 😱 + +* https://www.Netflix.com/helloworld + +> By the time this is posted, it seems that Netflix has taken it offline... I should have created a screenshot! + +## C programming + +### 4. Indexing an array + +In C, you can index an array like this: `array[i]` (not surprising). But this works as well and is valid C code: `i[array]`, 🤯 It's because after the spec `A[B]` is equivalent to `*(A + B)` and the ordering doesn't matter for the `+` operator. All 3 loops are producing the same output. Would be funny to use `i[array]` in a merge request of some code base on April Fool's day! + +```c +#include <stdio.h> + +int main(void) { + int array[5] = { 1, 2, 3, 4, 5 }; + + for (int i = 0; i < 5; i++) + printf("%d\n", array[i]); + + for (int i = 0; i < 5; i++) + printf("%d\n", i[array]); + + for (int i = 0; i < 5; i++) + printf("%d\n", *(i + array)); +} +``` + +### 5. Variables with prefix `$` + +In C you can prefix variables with `$`! E.g. the following is valid C code 🫠: + +```c +#include <stdio.h> + +int main(void) { + int $array[5] = { 1, 2, 3, 4, 5 }; + + for (int $i = 0; $i < 5; $i++) + printf("%d\n", $array[$i]); + + for (int $i = 0; $i < 5; $i++) + printf("%d\n", $i[$array]); + + for (int $i = 0; $i < 5; $i++) + printf("%d\n", *($i + $array)); +} +``` + +## 6. Object oriented shell scripts using `ksh` + +Experienced software developers are aware that scripting languages like Python, Perl, Ruby, and JavaScript support object-oriented programming (OOP) concepts such as classes and inheritance. However, many might be surprised to learn that the latest version of the Korn shell (Version 93t+) also supports OOP. In ksh93, OOP is implemented using user-defined types: + +```ksh +#!/usr/bin/ksh93 + +typeset -T Point_t=( + integer -h 'x coordinate' x=0 + integer -h 'y coordinate' y=0 + typeset -h 'point color' color="red" + + function getcolor { + print -r ${_.color} + } + + function setcolor { + _.color=$1 + } + + setxy() { + _.x=$1; _.y=$2 + } + + getxy() { + print -r "(${_.x},${_.y})" + } +) + +Point_t point + +echo "Initial coordinates are (${point.x},${point.y}). Color is ${point.color}" + +point.setxy 5 6 +point.setcolor blue + +echo "New coordinates are ${point.getxy}. Color is ${point.getcolor}" + +exit 0 +``` + +=> https://blog.fpmurphy.com/2010/05/ksh93-using-types-to-create-object-orientated-scripts.html Using types to create object oriented Korn shell 93 scripts + +## 7. This works in Go + +There is no pointer arithmetic in Go like in C, but it is still possible to do some brain teasers with pointers 😧: + +```go +package main + +import "fmt" + +func main() { + var i int + f := func() *int { + return &i + } + *f()++ + fmt.Println(i) +} +``` + +=> https://go.dev/play/p/sPRdyDvXefK?__s=mk8u899owb9yurl256gw Go playground + +## 8. "I am a Teapot" HTTP response code + +Defined in 1998 as one of the IETF's traditional April Fools' jokes (RFC 2324), the Hyper Text Coffee Pot Control Protocol specifies an HTTP status code that is not intended for actual HTTP server implementation. According to the RFC, this code should be returned by teapots when asked to brew coffee. This status code also serves as an Easter egg on some websites, such as Google.com's "I'm a teapot" feature. Occasionally, it is used to respond to a blocked request, even though the more appropriate response would be the 403 Forbidden status code. + +=> https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#418 + +## 9. `jq` is a functional programming language + +Many know of `jq`, the handy small tool and swiss army knife for JSON parsing. + +=> https://github.com/jqlang/jq + +What many don't know that `jq` is actually a full blown functional programming language `jqlang`, have a look at the language description: + +=> https://github.com/jqlang/jq/wiki/jq-Language-Description + +As a matter of fact, the language is so powerful, that there exists an implementation of `jq` in `jq` itself: + +=> https://github.com/wader/jqjq + +Here some snipped from `jqjq`, to get a feel of `jqlang`: + +``` +def _token: + def _re($re; f): + ( . as {$remain, $string_stack} + | $remain + | match($re; "m").string + | f as $token + | { result: ($token | del(.string_stack)) + , remain: $remain[length:] + , string_stack: + ( if $token.string_stack == null then $string_stack + else $token.string_stack + end + ) + } + ); + if .remain == "" then empty + else + ( . as {$string_stack} + | _re("^\\s+"; {whitespace: .}) + // _re("^#[^\n]*"; {comment: .}) + // _re("^\\.[_a-zA-Z][_a-zA-Z0-9]*"; {index: .[1:]}) + // _re("^[_a-zA-Z][_a-zA-Z0-9]*"; {ident: .}) + // _re("^@[_a-zA-Z][_a-zA-Z0-9]*"; {at_ident: .}) + // _re("^\\$[_a-zA-Z][_a-zA-Z0-9]*"; {binding: .}) + # 1.23, .123, 123e2, 1.23e2, 123E2, 1.23e+2, 1.23E-2 or 123 + // _re("^(?:[0-9]*\\.[0-9]+|[0-9]+)(?:[eE][-\\+]?[0-9]+)?"; {number: .}) + // _re("^\"(?:[^\"\\\\]|\\\\.)*?\\\\\\("; + ( .[1:-2] + | _unescape + | {string_start: ., string_stack: ($string_stack+["\\("])} + ) + ) + . + . + . +``` + +## 10. Regular expression to verify email addresses + +This is a pretty old meme, but still worth posting here (as some may be unaware). The RFC822 Perl regex to validate email addresses is 😱: + +``` +(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t] +)+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?: +\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:( +?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ +\t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\0 +31]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\ +](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+ +(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?: +(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z +|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n) +?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\ +r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ + \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n) +?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t] +)*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ + \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])* +)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t] +)+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*) +*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+ +|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r +\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?: +\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t +]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031 +]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\]( +?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(? +:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(? +:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(? +:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)? +[ \t]))*"(?:(?:\r\n)?[ \t])*)*:(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] +\000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]| +\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<> +@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|" +(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t] +)*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\ +".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(? +:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[ +\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000- +\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|( +?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,; +:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([ +^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\" +.\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\ +]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\ +[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\ +r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] +\000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\] +|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \0 +00-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\ +.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@, +;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(? +:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])* +(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\". +\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[ +^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\] +]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)(?:,\s*( +?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\ +".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:( +?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[ +\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t +])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t +])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(? +:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+| +\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?: +[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\ +]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n) +?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[" +()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n) +?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<> +@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ + \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@, +;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t] +)*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\ +".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)? +(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\". +\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?: +\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[ +"()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t]) +*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]) ++|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\ +.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z +|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:( +?:\r\n)?[ \t])*))*)?;\s*) +``` + +=> https://pdw.ex-parrot.com/Mail-RFC822-Address.html + +I hope you had some fun. E-Mail your comments to `paul@nospam.buetow.org` :-) + +other related posts are: + +=> ../ Back to the main site diff --git a/gemfeed/2024-07-07-the-stoic-challenge-book-notes.gmi b/gemfeed/2024-07-07-the-stoic-challenge-book-notes.gmi index 7537801f..504c8175 100644 --- a/gemfeed/2024-07-07-the-stoic-challenge-book-notes.gmi +++ b/gemfeed/2024-07-07-the-stoic-challenge-book-notes.gmi @@ -16,6 +16,15 @@ These are my personal takeaways after reading "The Stoic Challenge: A Philosoph ''' ``` +## Table of Contents + +* ⇢ "The Stoic Challenge" book notes +* ⇢ ⇢ God sets you up for a challenge +* ⇢ ⇢ Negative visualization +* ⇢ ⇢ Oh, nice trick, you stoic "god"! ;-) + +## God sets you up for a challenge + Gods set you up for a challenge to see how resilient you are. Is getting angry worth the price? If you stay calm then you can find the optimal workaround for the obstacle. Stay calm even with big setbacks. Practice minimalism of negative emotions. Put a positive spin on everything. What should you do if someone wrong you? Don't get angry, there is no point in that, it just makes you suffer. Do the best what you got now and keep calm and carry on. A resilient person will refuse to play the role of a victim. You can develop the setback response skills. Turn a setback. e.g. a handycap, into a personal triumph. @@ -48,13 +57,13 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other book notes of mine are: -=> ./2023-03-16-the-pragmatic-programmer-book-notes.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ./2023-04-01-never-split-the-difference-book-notes.gmi 2023-04-01 "Never split the difference" book notes -=> ./2023-05-06-the-obstacle-is-the-way-book-notes.gmi 2023-05-06 "The Obstacle is the Way" book notes -=> ./2023-07-17-career-guide-and-soft-skills-book-notes.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes -=> ./2023-11-11-mind-management-book-notes.gmi 2023-11-11 "Mind Management" book notes -=> ./2024-05-01-slow-productivity-book-notes.gmi 2024-05-01 "Slow Productivity" book notes +=> ./2024-10-24-staff-engineer-book-notes.gmi 2024-10-24 "Staff Engineer" book notes => ./2024-07-07-the-stoic-challenge-book-notes.gmi 2024-07-07 "The Stoic Challenge" book notes (You are currently reading this) +=> ./2024-05-01-slow-productivity-book-notes.gmi 2024-05-01 "Slow Productivity" book notes +=> ./2023-11-11-mind-management-book-notes.gmi 2023-11-11 "Mind Management" book notes +=> ./2023-07-17-career-guide-and-soft-skills-book-notes.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes +=> ./2023-05-06-the-obstacle-is-the-way-book-notes.gmi 2023-05-06 "The Obstacle is the Way" book notes +=> ./2023-04-01-never-split-the-difference-book-notes.gmi 2023-04-01 "Never split the difference" book notes +=> ./2023-03-16-the-pragmatic-programmer-book-notes.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ../resources.gmi More books and other resources I found useful. => ../ Back to the main site diff --git a/gemfeed/2024-07-07-the-stoic-challenge-book-notes.gmi.tpl b/gemfeed/2024-07-07-the-stoic-challenge-book-notes.gmi.tpl index 0c6a4e6f..9b178f5e 100644 --- a/gemfeed/2024-07-07-the-stoic-challenge-book-notes.gmi.tpl +++ b/gemfeed/2024-07-07-the-stoic-challenge-book-notes.gmi.tpl @@ -16,6 +16,10 @@ These are my personal takeaways after reading "The Stoic Challenge: A Philosoph ''' ``` +<< template::inline::toc + +## God sets you up for a challenge + Gods set you up for a challenge to see how resilient you are. Is getting angry worth the price? If you stay calm then you can find the optimal workaround for the obstacle. Stay calm even with big setbacks. Practice minimalism of negative emotions. Put a positive spin on everything. What should you do if someone wrong you? Don't get angry, there is no point in that, it just makes you suffer. Do the best what you got now and keep calm and carry on. A resilient person will refuse to play the role of a victim. You can develop the setback response skills. Turn a setback. e.g. a handycap, into a personal triumph. @@ -48,7 +52,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other book notes of mine are: -<< template::inline::index book-notes +<< template::inline::rindex book-notes -=> ../resources.gmi More books and other resources I found useful. => ../ Back to the main site diff --git a/gemfeed/2024-08-05-typing-127.1-words-per-minute.gmi b/gemfeed/2024-08-05-typing-127.1-words-per-minute.gmi index d942f41d..b6b848bd 100644 --- a/gemfeed/2024-08-05-typing-127.1-words-per-minute.gmi +++ b/gemfeed/2024-08-05-typing-127.1-words-per-minute.gmi @@ -17,6 +17,37 @@ Nieminen Mika ``` +## Table of Contents + +* ⇢ Typing `127.1` words per minute (`>100wpm average`) +* ⇢ ⇢ Introduction +* ⇢ ⇢ Kinesis review +* ⇢ ⇢ ⇢ Top build quality +* ⇢ ⇢ ⇢ Bluetooth connectivity +* ⇢ ⇢ ⇢ Gateron Brown key switches +* ⇢ ⇢ ⇢ Keycaps +* ⇢ ⇢ ⇢ Keymap editor +* ⇢ ⇢ First steps +* ⇢ ⇢ Considering alternate layouts +* ⇢ ⇢ Training how to type +* ⇢ ⇢ ⇢ Tools +* ⇢ ⇢ My `keybr.com` statistics +* ⇢ ⇢ Tips and tricks +* ⇢ ⇢ ⇢ Relax +* ⇢ ⇢ ⇢ Focus on accuracy first +* ⇢ ⇢ ⇢ Chording +* ⇢ ⇢ ⇢ Punctuation and Capitalization +* ⇢ ⇢ ⇢ Reverse shifting +* ⇢ ⇢ ⇢ Enter the flow state +* ⇢ ⇢ ⇢ Repeat every word +* ⇢ ⇢ ⇢ Don't use the same finger for two consecutive keystrokes +* ⇢ ⇢ ⇢ Warm-up +* ⇢ ⇢ Travel keyboard +* ⇢ ⇢ Upcoming custom Kinesis build +* ⇢ ⇢ Conclusion + +## Introduction + After work one day, I noticed some discomfort in my right wrist. Upon research, it appeared to be a mild case of Repetitive Strain Injury (RSI). Initially, I thought that this would go away after a while, but after a week it became even worse. This led me to consider potential causes such as poor posture or keyboard use habits. As an enthusiast of keyboards, I experimented with ergonomic concave ortholinear split keyboards. Wait, what?... * Concave: Some fingers are longer than others. A concave keyboard makes it so that the keycaps meant to be pressed by the longer fingers are further down (e.g., left middle finger for `e` on a Qwerty layout), and keycaps meant to be pressed by shorter fingers are further up (e.g., right pinky finger for the letter `p`). @@ -41,7 +72,7 @@ Overall, the keyboard feels excellent quality and robust. It has got some weight Despite encountering concerns about Bluetooth connectivity issues with the Kinesis keyboard during my research, I purchased one anyway as I intended to use it only via USB. However, I discovered that the firmware updates available afterwards had addressed these reported Bluetooth issues, and as a result, I did not experience any difficulties with the Bluetooth functionality. This positive outcome allowed me to enjoy using the keyboard also wirelessly. -### Gateron Browm key switches +### Gateron Brown key switches Many voices on the internet seem to dislike the Gateron Brown switches, the only official choice for non-clicky tactile switches in the Kinesis, so I was also a bit concerned. I almost went with Cherry MX Browns for my Kinesis (a custom build from a 3rd party provider that is partnershipping with Kinesis). Still, I decided on Gateron Browns to try different switches than the Cherry MX Browns I already have on my ZSA Moonlander keyboard (another ortho-linear split keyboard, but without a concave keycap layout). @@ -104,11 +135,11 @@ I wrote myself a small Ruby script that would randomly select a paragraph from o Overall, I trained for around 4 months in more than 5,000 sessions. My top speed in a session was 127.1wpm (up from barely 10wpm at the beginning). -=> ./typing-127.1-words-per-minute/all-time-stats.png +=> ./typing-127.1-words-per-minute/all-time-stats.png All time stats My overall average speed over those 5,000 sessions was 80wpm. The average speed over the last week was over 100wpm. The green line represents the wpm average (increasing trend), the purple line represents the number of keys in the practices (not much movement there, as all keys are unlocked), and the red line represents the average typing accuracy. -=> ./typing-127.1-words-per-minute/typing-speed-over-lessons.png +=> ./typing-127.1-words-per-minute/typing-speed-over-lessons.png Typing speed over leson Around the middle, you see a break-in of the wpm average value. This was where I swapped the `p` and `;` keys, but after some retraining, I came back to the previous level and beyond. @@ -119,6 +150,7 @@ These are some tips and tricks I learned along the way to improve my typing spee ### Relax It's easy to get cramped when trying to hit this new wpm mark, but this is just holding you back. Relax and type at a natural pace. Now I also understand why my Katate Sensei back in London kept screaming "RELAAAX" at me during practice.... It didn't help much back then, though, as it is difficult to relax while someone screams at you! + ### Focus on accuracy first This goes with the previous point. Instead of trying to speed through sessions as quickly as possible, slow down and try to type the words correctly—so don't rush it. If you aren't fast yet, the reason is that your brain hasn't trained enough. It will come over time, and you will be faster. diff --git a/gemfeed/2024-08-05-typing-127.1-words-per-minute.gmi.tpl b/gemfeed/2024-08-05-typing-127.1-words-per-minute.gmi.tpl new file mode 100644 index 00000000..62630df6 --- /dev/null +++ b/gemfeed/2024-08-05-typing-127.1-words-per-minute.gmi.tpl @@ -0,0 +1,203 @@ +# Typing `127.1` words per minute (`>100wpm average`) + +> Published at 2024-08-05T17:39:30+03:00 + +``` +,---,---,---,---,---,---,---,---,---,---,---,---,---,-------, +|1/2| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | + | ' | <- | +|---'-,-'-,-'-,-'-,-'-,-'-,-'-,-'-,-'-,-'-,-'-,-'-,-'-,-----| +| ->| | Q | W | E | R | T | Y | U | I | O | P | ] | ^ | | +|-----',--',--',--',--',--',--',--',--',--',--',--',--'| | +| Caps | A | S | D | F | G | H | J | K | L | \ | [ | * | | +|----,-'-,-'-,-'-,-'-,-'-,-'-,-'-,-'-,-'-,-'-,-'-,-'---'----| +| | < | Z | X | C | V | B | N | M | , | . | - | | +|----'-,-',--'--,'---'---'---'---'---'---'-,-'---',--,------| +| ctrl | | alt | |altgr | | ctrl | +'------' '-----'--------------------------'------' '------' + Nieminen Mika +``` + +<< template::inline::toc + +## Introduction + +After work one day, I noticed some discomfort in my right wrist. Upon research, it appeared to be a mild case of Repetitive Strain Injury (RSI). Initially, I thought that this would go away after a while, but after a week it became even worse. This led me to consider potential causes such as poor posture or keyboard use habits. As an enthusiast of keyboards, I experimented with ergonomic concave ortholinear split keyboards. Wait, what?... + +* Concave: Some fingers are longer than others. A concave keyboard makes it so that the keycaps meant to be pressed by the longer fingers are further down (e.g., left middle finger for `e` on a Qwerty layout), and keycaps meant to be pressed by shorter fingers are further up (e.g., right pinky finger for the letter `p`). +* Ortholinear: The keys are arranged in a straight vertical line, unlike most conventional keyboards. The conventional keyboards still resemble the old typewriters, where the placement of the keys was optimized so that the typewriter would not jam. There is no such requirement anymore. +* Split: The keyboard is split into two halves (left and right), allowing one to place either hand where it is most ergonomic. + +After discovering ThePrimagen (I found him long ago, but I never bothered buying the same keyboard he is on) on YouTube and reading/watching a couple of reviews, I thought that as a computer professional, the equipment could be expensive anyway (laptop, adjustable desk, comfortable chair), so why not invest a bit more into the keyboard? I purchased myself the Kinesis Advantage360 Professional keyboard. + +## Kinesis review + +For an in-depth review, have a look at this great article: + +=> https://arslan.io/2022/10/22/review-of-the-kinesis-advantage360-professional Review of the Kinesis Advantage360 Professional keyboard + +### Top build quality + +Overall, the keyboard feels excellent quality and robust. It has got some weight to it. Because of that, it is not ideally suited for travel, though. But I have a different keyboard to solve this (see later in this post). Overall, I love how it is built and how it feels. + +=> ./typing-127.1-words-per-minute/kinesis2.jpg Kinesis Adv.360 Pro at home + +### Bluetooth connectivity + +Despite encountering concerns about Bluetooth connectivity issues with the Kinesis keyboard during my research, I purchased one anyway as I intended to use it only via USB. However, I discovered that the firmware updates available afterwards had addressed these reported Bluetooth issues, and as a result, I did not experience any difficulties with the Bluetooth functionality. This positive outcome allowed me to enjoy using the keyboard also wirelessly. + +### Gateron Brown key switches + +Many voices on the internet seem to dislike the Gateron Brown switches, the only official choice for non-clicky tactile switches in the Kinesis, so I was also a bit concerned. I almost went with Cherry MX Browns for my Kinesis (a custom build from a 3rd party provider that is partnershipping with Kinesis). Still, I decided on Gateron Browns to try different switches than the Cherry MX Browns I already have on my ZSA Moonlander keyboard (another ortho-linear split keyboard, but without a concave keycap layout). + +At first, I was disappointed by the Gaterons, as they initially felt a bit meshy compared to the Cherries. Still, over the weeks I grew to prefer them because of their smoothness. Over time, the tactile bumps also became more noticeable (as my perception of them improved). Because of their less pronounced tactile feedback, the Gaterons are less tiring for long typing sessions and better suited for a relaxed typing experience. + +So, the Cherry MX feel sharper but are more tiring in the long run, and the Gaterons are easier to write on and the tactile Feedback is slightly less pronounced. + +### Keycaps + +If you ever purchase a Kinesis keyboard, go with the PCB keycaps. They upgrade the typing experience a lot. The only thing you will lose is that the backlighting won't shine through them. But that is a reasonable tradeoff. When do I need backlighting? I am supposed to look at the screen and not the keyboard while typing. + +I went with the blank keycaps, by the way. + +=> ./typing-127.1-words-per-minute/kinesis1.jpg Kinesis Adv.360 Pro at home + +### Keymap editor + +There is no official keymap editor. You have to edit a configuration file manually, build the firmware from scratch, and upload the firmware with the new keymap to both keyboard halves. The Professional version of his keyboard, by the way, runs on the ZMK open-source firmware. + +Many users find the need for an easy-to-use keymap editor an issue. But this is the Pro model. You can also go with the non-Pro, which runs on non-open-source firmware and has no Bluetooth (it must be operated entirely on USB). + +There is a 3rd party solution which is supposed to configure the keymap for the Professional model as bliss, but I have never used it. As a part-time programmer and full-time Site Reliability Engineer, I am okay configuring the keymap in my text editor and building it in a local docker container. This is one of the standard ways of doing it here. You could also use a GitHub pipeline for the firmware build, but I prefer building it locally on my machine. This all seems natural to me, but this may be an issue for "the average Joe" user. + +## First steps + +I didn't measure the usual words per minute (wpm) on my previous keyboard, the ZSA Moonlander, but I guess that it was around 40-50wpm. Once the Kinesis arrived, I started practising. The experience was quite different due to the concave keycaps, so I barely managed 10wpm on the first day. + +I quickly noticed that I could not continue using the freestyle 6-finger typing system I was used to on my Moonlander or any previous keyboards I worked with. I learned ten-finger touch typing from scratch to be more efficient with the Kinesis keyboard. The keyboard forces you to embrace touch typing. + +Sometimes, there were brain farts, and I couldn't type at all. The trick was not to freak out about it, but to move on. If your average goes down a bit for a day, it doesn't matter; the long-term trend over several days and weeks matters, not the one-off wpm high score. + +Although my wrist pain seemed to go away aftre the first week of using the Kinesis, my fingers became tired of adjusting to the new way of typing. My hands were stiff, as if I had been training for the Olympics. Only after three weeks did I start to feel comfortable with it. If it weren't for the comments I read online, I would have sent it back after week 2. + +I also had a problem with the left pinky finger, where I could not comfortably reach the `p` key. This involved moving the whole hand. An easy fix was to swap `p` with `;` on the keyboard layout. + +## Considering alternate layouts + +As I was going to learn 10-finger touch typing from scratch, I also played with the thought of switching from the Qwerty to the Dvorak or Colemak keymap, but after reading some comments on the internet, I decided against it: + +* These layouts (Dvorak and Colemak) will minimize the finger travel for the most commonly used English words, but they necessarily don't give you a better wpm score. +* One comment on Redit also mentioned that getting stiffer fingers with these layouts is more likely than with Qwerty, as in Qwerty, he had to stretch out his fingers more often, which helps here. +* There are also many applications and websites with keyboard shortcuts and are Qwerty-optimized. +* You won't be able to use someone else's computer as there will be likely Qwerty. Some report that after using an alternative layout for a while, they forget how to use Qwerty. + +## Training how to type + +### Tools + +One of the most influential tools in my touch typing journey has been `keybr.com`. This site/app helped me learn 10-finger touch typing, and I practice daily for 30 minutes (in the first two weeks, up to an hour every day). The key is persistence and focus on technique rather than speed; the latter naturally improves with regular practice. Precision matters, too, so I always correct my errors using the backspace key. + +=> https://keybr.com + +I also used a command-line tool called `tt`, which is written in Go. It has a feature that I found very helpful: the ability to practice typing by piping custom text into it. Additionally, I appreciated its customization options, such as choosing a colour theme and specifying how statistics are displayed. + +=> https://github.com/lemnos/tt + +I wrote myself a small Ruby script that would randomly select a paragraph from one of my eBooks or book notes and pipe it to `tt`. This helped me remember some of the books I read and also practice touch typing. + +## My `keybr.com` statistics + +Overall, I trained for around 4 months in more than 5,000 sessions. My top speed in a session was 127.1wpm (up from barely 10wpm at the beginning). + +=> ./typing-127.1-words-per-minute/all-time-stats.png All time stats + +My overall average speed over those 5,000 sessions was 80wpm. The average speed over the last week was over 100wpm. The green line represents the wpm average (increasing trend), the purple line represents the number of keys in the practices (not much movement there, as all keys are unlocked), and the red line represents the average typing accuracy. + +=> ./typing-127.1-words-per-minute/typing-speed-over-lessons.png Typing speed over leson + +Around the middle, you see a break-in of the wpm average value. This was where I swapped the `p` and `;` keys, but after some retraining, I came back to the previous level and beyond. + +## Tips and tricks + +These are some tips and tricks I learned along the way to improve my typing speed: + +### Relax + +It's easy to get cramped when trying to hit this new wpm mark, but this is just holding you back. Relax and type at a natural pace. Now I also understand why my Katate Sensei back in London kept screaming "RELAAAX" at me during practice.... It didn't help much back then, though, as it is difficult to relax while someone screams at you! + +### Focus on accuracy first + +This goes with the previous point. Instead of trying to speed through sessions as quickly as possible, slow down and try to type the words correctly—so don't rush it. If you aren't fast yet, the reason is that your brain hasn't trained enough. It will come over time, and you will be faster. + +### Chording + +A trick to getting faster is to type by word and pause between each word so you learn the words by chords. From 80wpm and beyond, this makes a real difference. + +### Punctuation and Capitalization + +I included 10% punctuation and 20% capital letters in my `keybr.com` practice sessions to simulate real typing conditions, which improved my overall working efficiency. I guess I would have gone to 120wpm in average if I didn't include this options... + +### Reverse shifting + +Reverse shifting aka left-right shifting is to... + +* ...use the left shift key for letters on the right keyboard side. +* ...use the right shift key for letters on the left keyboard side. + +This makes using the shift key a blaze. + +### Enter the flow state + +Listening to music helps me enter a flow state during practice sessions, which makes typing training a bit addictive (which is good, or isn't it?). + +### Repeat every word + +There's a setting on `keybr.com` that makes it so that every word is always repeated, having you type every word twice in a row. I liked this feature very much, and I think it also helped to improve my practice. + +### Don't use the same finger for two consecutive keystrokes + +Apparently, if you want to type fast, avoid using the same finger for two consecutive keystrokes. This means you don't always need to use the same finger for the same keys. +However, there are no hard and fast rules. Thus, everyone develops their system for typing word combinations. An exception would be if you are typing the very same letter in a row (e.g., t in letter)—here, you are using the same finger for both ts. + +### Warm-up + +You can't reach your average typing speed first ting the morning. It would help if you warmed up before the exercise or practice later during the day. Also, some days are good, others not so, e.g., after a bad night's sleep. What matters is the mid- and long-term trend, not the fluctuations here, though. + +## Travel keyboard + +As mentioned, the Kinesis is a great keyboard, but it is not meant for travel. + +I guess keyboards will always be my expensive hobby, so I also purchased another ergonomic, ortho-linear, concave split keyboard, the Glove80 (with the Red Pro low-profile switches). This keyboard is much lighter and, in my opinion, much better suited for travel than the Kinesis. It also comes with a great travel case. + +Here is a photo of me using it with my Surface Go 2 (it runs Linux, by the way) while waiting for the baggage drop at the airport: + +=> ./typing-127.1-words-per-minute/glove80.jpg Traveling with the Glove80 using my Surface Go 2 + +For everyday work, I prefer the tactile Browns on the Kinesis over the Red Pro I have on the Glove80 (normal profile vs. low profile). The Kinesis feels much more premium, whereas the Glove80 is much lighter and easier to store away in a rucksack (the official travel case is a bit bulky, so I wrapped it simply in bubble plastic). + +The F-key row is odd at the Glove80. I would have preferred more keys on the sides like the Kinesis, and I use them for `[]` `{}` `()`, which is pretty handy there. However, I like the thumb cluster of the Glove80 more than the one on the Kinesis. + +The good thing is that I can switch between both keyboards instantly without retraining my typing memories. I've configured (as much as possible) the same keymaps on both my Kinesis and Glove80, making it easy to switch between them at any occasion. + +Interested in the Glove80? I suggest also reading this review: + +=> https://arslan.io/2024/04/22/review-of-the-moergo-glove80-keyboard/ Review of the Glove80 keyboard + +## Upcoming custom Kinesis build + +As I mentioned, keyboards will remain an expensive hobby of mine. I don't regret anything here, though. After all, I use keyboards at my day job. I've ordered a Kinesis custom build with the Gateron Kangaroo switches, and I'm excited to see how that compares to my current setup. I'm still deciding whether to keep my Gateron Brown-equipped Kinesis as a secondary keyboard or possibly leave it at my in-laws for use when visiting or to sell it. + +## Conclusion + +When I traveled with the Glove80 for work to the London office, a colleague stared at my keyboard and made jokes that it might be broken (split into two halves). But other than that... + +Ten-finger touch typing has improved my efficiency and has become a rewarding discipline. Whether it's the keyboards I use, the tools I practice with, or the techniques I've adopted, each step has been a learning experience. I hope sharing my journey provides valuable insights and inspiration for anyone looking to improve their touch typing skills. + +I also accidentally started using a 10-finger-like system (maybe still 6 fingers, but better than before) on my regular laptop keyboard. I could be more efficient on the laptop keyboard. The form is different there (not ortholinear, not concave keycaps, etc.), but my typing has improved there too (even if it is only by a little bit). + +I don't want to return to a non-concave keyboard as my default. I will use other keyboards still once in a while but only for short periods or when I have to (e.g. travelling with my Laptop and when there is no space to put an external keyboard) + +Learning to touch type has been an eye-opening experience for me, not just for work but also for personal projects. Now, writing documentation is so much fun; who could believe that? Furthermore, working with Slack (communicating with colleagues) is more fun now as well. + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2024-09-07-projects-i-support.gmi b/gemfeed/2024-09-07-projects-i-support.gmi new file mode 100644 index 00000000..4f713ca9 --- /dev/null +++ b/gemfeed/2024-09-07-projects-i-support.gmi @@ -0,0 +1,106 @@ +# Projects I financially support + +> Published at 2024-09-07T16:04:19+03:00 + +This is the list of projects and initiatives I support/sponsor. + +``` +||====================================================================|| +||//$\\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\//$\\|| +||(100)==================| FEDERAL SPONSOR NOTE |================(100)|| +||\\$// ~ '------========--------' \\$//|| +||<< / /$\ // ____ \\ \ >>|| +||>>| 12 //L\\ // ///..) \\ L38036133B 12 |<<|| +||<<| \\ // || <|| >\ || |>>|| +||>>| \$/ || $$ --/ || One Hundred |<<|| +||<<| L38036133B *\\ |\_/ //* series |>>|| +||>>| 12 *\\/___\_//* 1989 |<<|| +||<<\ Open Source ______/Franklin\________ Supporting />>|| +||//$\ ~| SPONSORING AND FUNDING |~ /$\\|| +||(100)=================== AWESOME OPEN SOURCE =================(100)|| +||\\$//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\$//|| +||====================================================================|| + +``` + +## Table of Contents + +* ⇢ Projects I financially support +* ⇢ ⇢ Motivation +* ⇢ ⇢ OSnews +* ⇢ ⇢ Cup o' Go Podcast +* ⇢ ⇢ Codeberg +* ⇢ ⇢ GrapheneOS +* ⇢ ⇢ AnkiDroid +* ⇢ ⇢ OpenBSD through OpenBSD.Amsterdam +* ⇢ ⇢ ProtonMail +* ⇢ ⇢ `Libro.fm` + +## Motivation + +Sponsoring free and open-source projects, even for personal use, is important to ensure the sustainability, security, and continuous improvement of the software. It supports developers who often maintain these projects without compensation, helping them provide updates, new features, and security patches. By contributing, you recognize their efforts, foster a culture of innovation, and benefit from perks like early access or support, all while ensuring the long-term viability of the tools you rely on. + +Albeit I am not putting a lot of money into my sponsoring efforts, it still helps the open-source maintainers because the more little sponsors there are, the higher the total sum. + +## OSnews + +I am a silver Patreon member of OSnews. I have been following this site since my student years. It's always been a great source of independent and slightly alternative IT news. + +=> https://osnews.com + +## Cup o' Go Podcast + +I am a Patreon of the Cup o' Go Podcast. The podcast helps me stay updated with the Go community for around 15 minutes per week. I am not a full-time software developer, but my long-term ambition is to become better in Go every week by working on personal projects and tools for work. + +=> https://cupogo.dev + +## Codeberg + +Codeberg e.V. is a nonprofit organization that provides online resources for software development and collaboration. I am a user and a supporting member, paying an annual membership of €24. I didn't have to pay that membership fee, as Codeberg offers all the services I use for free. + +=> https://codeberg.org +=> https://codeberg.org/snonux https://codeberg.org/snonux - My Codeberg page + +## GrapheneOS + +GrapheneOS is an open-source project that improves Android's privacy and security with sandboxing, exploit mitigations, and a permission model. It does not include Google apps or services but offers a sandboxed Google Play compatibility layer and its own apps and services. + +I've made a one-off €100 donation because I really like this, and I run GrapheneOS on my personal Phone as my main daily driver. + +=> https://grapheneos.org/ +=> https://foo.zone/gemfeed/2023-01-23-why-grapheneos-rox.html Why GrapheneOS Rox + +## AnkiDroid + +AnkiDroid is an app that lets you learn flashcards efficiently with spaced repetition. It is compatible with Anki software and supports various flashcard content, syncing, statistics, and more. + +I've been learning vocabulary with this free app, and it is, in my opinion, the best flashcard app I know. I've made a 20$ one-off donation to this project. + +=> https://opencollective.com/ankidroid + +## OpenBSD through OpenBSD.Amsterdam + + The OpenBSD project produces a FREE, multi-platform 4.4BSD-based UNIX-like operating system. Our efforts emphasize portability, standardization, correctness, proactive security and integrated cryptography. As an example of the effect OpenBSD has, the popular OpenSSH software comes from OpenBSD. OpenBSD is freely available from their download sites. + +I implicitly support the OpenBSD project through a VM I have rented at OpenBSD Amsterdam. They donate €10 per VM and €15 per VM for every renewal to the OpenBSD Foundation, with dedicated servers running vmm(4)/vmd(8) to host opinionated VMs. + +=> https://www.OpenBSD.org +=> https://OpenBSD.Amsterdam + +## ProtonMail + +I am not directly funding this project, but I am a very happy paying customer, and I am listing it here as an alternative to big tech if you don't want to run your own mail infrastructure. I am listing ProtonMail here as it is a non-profit organization, and I want to emphasize the importance of considering alternatives to big tech. + +=> https://proton.me/ + +## `Libro.fm` + +This is the alternative to Audible if you are into audiobooks (like I am). For every book or every month of membership, I am also supporting a local bookstore I selected. Their catalog is not as large as Audible's, but it's still pretty decent. + +Libro.fm began as a conversation among friends at Third Place Books, a local bookstore in Seattle, Washington, about the growing popularity of audiobooks and the lack of a way for readers to purchase them from independent bookstores. Flash forward, and Libro.fm was founded in 2014. + +=> https://libro.fm + +E-mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2024-09-07-projects-i-support.gmi.tpl b/gemfeed/2024-09-07-projects-i-support.gmi.tpl new file mode 100644 index 00000000..081e2b38 --- /dev/null +++ b/gemfeed/2024-09-07-projects-i-support.gmi.tpl @@ -0,0 +1,95 @@ +# Projects I financially support + +> Published at 2024-09-07T16:04:19+03:00 + +This is the list of projects and initiatives I support/sponsor. + +``` +||====================================================================|| +||//$\\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\//$\\|| +||(100)==================| FEDERAL SPONSOR NOTE |================(100)|| +||\\$// ~ '------========--------' \\$//|| +||<< / /$\ // ____ \\ \ >>|| +||>>| 12 //L\\ // ///..) \\ L38036133B 12 |<<|| +||<<| \\ // || <|| >\ || |>>|| +||>>| \$/ || $$ --/ || One Hundred |<<|| +||<<| L38036133B *\\ |\_/ //* series |>>|| +||>>| 12 *\\/___\_//* 1989 |<<|| +||<<\ Open Source ______/Franklin\________ Supporting />>|| +||//$\ ~| SPONSORING AND FUNDING |~ /$\\|| +||(100)=================== AWESOME OPEN SOURCE =================(100)|| +||\\$//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\$//|| +||====================================================================|| + +``` + +<< template::inline::toc + +## Motivation + +Sponsoring free and open-source projects, even for personal use, is important to ensure the sustainability, security, and continuous improvement of the software. It supports developers who often maintain these projects without compensation, helping them provide updates, new features, and security patches. By contributing, you recognize their efforts, foster a culture of innovation, and benefit from perks like early access or support, all while ensuring the long-term viability of the tools you rely on. + +Albeit I am not putting a lot of money into my sponsoring efforts, it still helps the open-source maintainers because the more little sponsors there are, the higher the total sum. + +## OSnews + +I am a silver Patreon member of OSnews. I have been following this site since my student years. It's always been a great source of independent and slightly alternative IT news. + +=> https://osnews.com + +## Cup o' Go Podcast + +I am a Patreon of the Cup o' Go Podcast. The podcast helps me stay updated with the Go community for around 15 minutes per week. I am not a full-time software developer, but my long-term ambition is to become better in Go every week by working on personal projects and tools for work. + +=> https://cupogo.dev + +## Codeberg + +Codeberg e.V. is a nonprofit organization that provides online resources for software development and collaboration. I am a user and a supporting member, paying an annual membership of €24. I didn't have to pay that membership fee, as Codeberg offers all the services I use for free. + +=> https://codeberg.org +=> https://codeberg.org/snonux https://codeberg.org/snonux - My Codeberg page + +## GrapheneOS + +GrapheneOS is an open-source project that improves Android's privacy and security with sandboxing, exploit mitigations, and a permission model. It does not include Google apps or services but offers a sandboxed Google Play compatibility layer and its own apps and services. + +I've made a one-off €100 donation because I really like this, and I run GrapheneOS on my personal Phone as my main daily driver. + +=> https://grapheneos.org/ +=> https://foo.zone/gemfeed/2023-01-23-why-grapheneos-rox.html Why GrapheneOS Rox + +## AnkiDroid + +AnkiDroid is an app that lets you learn flashcards efficiently with spaced repetition. It is compatible with Anki software and supports various flashcard content, syncing, statistics, and more. + +I've been learning vocabulary with this free app, and it is, in my opinion, the best flashcard app I know. I've made a 20$ one-off donation to this project. + +=> https://opencollective.com/ankidroid + +## OpenBSD through OpenBSD.Amsterdam + + The OpenBSD project produces a FREE, multi-platform 4.4BSD-based UNIX-like operating system. Our efforts emphasize portability, standardization, correctness, proactive security and integrated cryptography. As an example of the effect OpenBSD has, the popular OpenSSH software comes from OpenBSD. OpenBSD is freely available from their download sites. + +I implicitly support the OpenBSD project through a VM I have rented at OpenBSD Amsterdam. They donate €10 per VM and €15 per VM for every renewal to the OpenBSD Foundation, with dedicated servers running vmm(4)/vmd(8) to host opinionated VMs. + +=> https://www.OpenBSD.org +=> https://OpenBSD.Amsterdam + +## ProtonMail + +I am not directly funding this project, but I am a very happy paying customer, and I am listing it here as an alternative to big tech if you don't want to run your own mail infrastructure. I am listing ProtonMail here as it is a non-profit organization, and I want to emphasize the importance of considering alternatives to big tech. + +=> https://proton.me/ + +## `Libro.fm` + +This is the alternative to Audible if you are into audiobooks (like I am). For every book or every month of membership, I am also supporting a local bookstore I selected. Their catalog is not as large as Audible's, but it's still pretty decent. + +Libro.fm began as a conversation among friends at Third Place Books, a local bookstore in Seattle, Washington, about the growing popularity of audiobooks and the lack of a way for readers to purchase them from independent bookstores. Flash forward, and Libro.fm was founded in 2014. + +=> https://libro.fm + +E-mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2024-09-07-site-reliability-engineering-part-4.gmi b/gemfeed/2024-09-07-site-reliability-engineering-part-4.gmi new file mode 100644 index 00000000..4500e7bb --- /dev/null +++ b/gemfeed/2024-09-07-site-reliability-engineering-part-4.gmi @@ -0,0 +1,71 @@ +# Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers + +> Published at 2024-09-07T16:27:58+03:00 + +Welcome to Part 4 of my Site Reliability Engineering (SRE) series. I'm currently working as a Site Reliability Engineer, and I’m here to share what SRE is all about in this blog series. + +=> ./2023-08-18-site-reliability-engineering-part-1.gmi 2023-08-18 Site Reliability Engineering - Part 1: SRE and Organizational Culture +=> ./2023-11-19-site-reliability-engineering-part-2.gmi 2023-11-19 Site Reliability Engineering - Part 2: Operational Balance +=> ./2024-01-09-site-reliability-engineering-part-3.gmi 2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture +=> ./2024-09-07-site-reliability-engineering-part-4.gmi 2024-09-07 Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers (You are currently reading this) + +``` + __..._ _...__ + _..-" `Y` "-._ + \ Once upon | / + \\ a time..| // + \\\ | /// + \\\ _..---.|.---.._ /// +jgs \\`_..---.Y.---.._`// +``` + +This time, I want to share some tips on how to onboard software engineers, QA engineers, and Site Reliability Engineers (SREs) to the primary on-call rotation. Traditionally, onboarding might take half a year (depending on the complexity of the infrastructure), but with a bit of strategy and structured sessions, we've managed to reduce it to just six weeks per person. Let's dive in! + +## Setting the Scene: Tier-1 On-Call Rotation + +First things first, let's talk about Tier-1. This is where the magic begins. Tier-1 covers over 80% of the common on-call cases and is the perfect breeding ground for new on-call engineers to get their feet wet. It's designed to be manageable training ground. + +### Why Tier-1? + +* Easy to Understand: Every on-call engineer should be familiar with Tier-1 tasks. +* Training Ground: This is where engineers start their on-call career. It's purposefully kept simple so that it's not overwhelming right off the bat. +* Runbook/recipe driven: Every alert is attached to a comprehensive runbook, making it easy for every engineer to follow. + +## Onboarding Process: From 6 Months to 6 Weeks + +So how did we cut down the onboarding time so drastically? Here’s the breakdown of our process: + +Knowledge Transfer (KT) Sessions: We kicked things off with more than 10 KT sessions, complete with video recordings. These sessions are comprehensive and cover everything from the basics to some more advanced topics. The recorded sessions mean that new engineers can revisit them anytime they need a refresher. + +Shadowing Sessions: Each new engineer undergoes two on-call week shadowing sessions. This hands-on experience is invaluable. They get to see real-time incident handling and resolution, gaining practical knowledge that's hard to get from just reading docs. + +Comprehensive Runbooks: We created 64 runbooks (by the time writing this probably more than 100) that are composable like Lego bricks. Each runbook covers a specific scenario and guides the engineer step-by-step to resolution. Pairing these with monitoring alerts linked directly to Confluence docs, and from there to the respective runbooks, ensures every alert can be navigated with ease (well, there are always exceptions to the rule...). + +Self-Sufficiency & Confidence Building: With all these resources at their fingertips, our on-call engineers become self-sufficient for most of the common issues they'll face (new starters can now handle around 80% of the most common issue after 6 weeks they had joined the company). This boosts their confidence and ensures they can handle Tier-1 incidents independently. + +Documentation and Feedback Loop: Continuous improvement is key. We regularly update our documentation based on feedback from the engineers. This makes our process even more robust and user-friendly. + +## It's All About the Tiers + +Let’s briefly touch on the Tier levels: + +* Tier 1: Easy and foundational tasks. Perfect for getting new engineers started. This covers around 80% of all on-call cases we face. This is what we trained on. +* Tier 2: Slightly more complex, requiring more background knowledge. We trained on some of the topics but not all. +* Tier 3: Requires a good understanding of the platform/architecture. Likely needs KT sessions with domain experts. +* Tier DE (Domain Expert): The heavy hitters. Domain experts are required for these tasks. + +### Growing into Higher Tiers + +From Tier-1, engineers naturally grow into Tier-2 and beyond. The structured training and gradual increase in complexity help ensure a smooth transition as they gain experience and confidence. The key here is that engineers stay curous and engaged in the on-call, so that they always keep learning. + +## Keeping Runbooks Up to Date + +It is important that runbooks are not a "project to be finished"; runbooks have to be maintained and updated over time. Sections may change, new runbooks need to be added, and old ones can be deleted. So the acceptance criteria of an on-call shift would not just be reacting to alerts and incidents, but also reviewing and updating the current runbooks. + +## Conclusion + +By structuring the onboarding process with KT sessions, shadowing, comprehensive runbooks, and a feedback loop, we've been able to fast-track the process from six months to just six weeks. This not only prepares our engineers for the on-call rotation quicker but also ensures they're confident and capable when handling incidents. + +If you're looking to optimize your on-call onboarding process, these strategies could be your ticket to a more efficient and effective transition. Happy on-calling! + +=> ../ Back to the main site diff --git a/gemfeed/2024-09-07-site-reliability-engineering-part-4.gmi.tpl b/gemfeed/2024-09-07-site-reliability-engineering-part-4.gmi.tpl new file mode 100644 index 00000000..b07e94fa --- /dev/null +++ b/gemfeed/2024-09-07-site-reliability-engineering-part-4.gmi.tpl @@ -0,0 +1,68 @@ +# Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers + +> Published at 2024-09-07T16:27:58+03:00 + +Welcome to Part 4 of my Site Reliability Engineering (SRE) series. I'm currently working as a Site Reliability Engineer, and I’m here to share what SRE is all about in this blog series. + +<< template::inline::index site-reliability-engineering-part + +``` + __..._ _...__ + _..-" `Y` "-._ + \ Once upon | / + \\ a time..| // + \\\ | /// + \\\ _..---.|.---.._ /// +jgs \\`_..---.Y.---.._`// +``` + +This time, I want to share some tips on how to onboard software engineers, QA engineers, and Site Reliability Engineers (SREs) to the primary on-call rotation. Traditionally, onboarding might take half a year (depending on the complexity of the infrastructure), but with a bit of strategy and structured sessions, we've managed to reduce it to just six weeks per person. Let's dive in! + +## Setting the Scene: Tier-1 On-Call Rotation + +First things first, let's talk about Tier-1. This is where the magic begins. Tier-1 covers over 80% of the common on-call cases and is the perfect breeding ground for new on-call engineers to get their feet wet. It's designed to be manageable training ground. + +### Why Tier-1? + +* Easy to Understand: Every on-call engineer should be familiar with Tier-1 tasks. +* Training Ground: This is where engineers start their on-call career. It's purposefully kept simple so that it's not overwhelming right off the bat. +* Runbook/recipe driven: Every alert is attached to a comprehensive runbook, making it easy for every engineer to follow. + +## Onboarding Process: From 6 Months to 6 Weeks + +So how did we cut down the onboarding time so drastically? Here’s the breakdown of our process: + +Knowledge Transfer (KT) Sessions: We kicked things off with more than 10 KT sessions, complete with video recordings. These sessions are comprehensive and cover everything from the basics to some more advanced topics. The recorded sessions mean that new engineers can revisit them anytime they need a refresher. + +Shadowing Sessions: Each new engineer undergoes two on-call week shadowing sessions. This hands-on experience is invaluable. They get to see real-time incident handling and resolution, gaining practical knowledge that's hard to get from just reading docs. + +Comprehensive Runbooks: We created 64 runbooks (by the time writing this probably more than 100) that are composable like Lego bricks. Each runbook covers a specific scenario and guides the engineer step-by-step to resolution. Pairing these with monitoring alerts linked directly to Confluence docs, and from there to the respective runbooks, ensures every alert can be navigated with ease (well, there are always exceptions to the rule...). + +Self-Sufficiency & Confidence Building: With all these resources at their fingertips, our on-call engineers become self-sufficient for most of the common issues they'll face (new starters can now handle around 80% of the most common issue after 6 weeks they had joined the company). This boosts their confidence and ensures they can handle Tier-1 incidents independently. + +Documentation and Feedback Loop: Continuous improvement is key. We regularly update our documentation based on feedback from the engineers. This makes our process even more robust and user-friendly. + +## It's All About the Tiers + +Let’s briefly touch on the Tier levels: + +* Tier 1: Easy and foundational tasks. Perfect for getting new engineers started. This covers around 80% of all on-call cases we face. This is what we trained on. +* Tier 2: Slightly more complex, requiring more background knowledge. We trained on some of the topics but not all. +* Tier 3: Requires a good understanding of the platform/architecture. Likely needs KT sessions with domain experts. +* Tier DE (Domain Expert): The heavy hitters. Domain experts are required for these tasks. + +### Growing into Higher Tiers + +From Tier-1, engineers naturally grow into Tier-2 and beyond. The structured training and gradual increase in complexity help ensure a smooth transition as they gain experience and confidence. The key here is that engineers stay curous and engaged in the on-call, so that they always keep learning. + +## Keeping Runbooks Up to Date + +It is important that runbooks are not a "project to be finished"; runbooks have to be maintained and updated over time. Sections may change, new runbooks need to be added, and old ones can be deleted. So the acceptance criteria of an on-call shift would not just be reacting to alerts and incidents, but also reviewing and updating the current runbooks. + +## Conclusion + +By structuring the onboarding process with KT sessions, shadowing, comprehensive runbooks, and a feedback loop, we've been able to fast-track the process from six months to just six weeks. This not only prepares our engineers for the on-call rotation quicker but also ensures they're confident and capable when handling incidents. + +If you're looking to optimize your on-call onboarding process, these strategies could be your ticket to a more efficient and effective transition. Happy on-calling! + +=> ../ Back to the main site diff --git a/gemfeed/2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.gmi b/gemfeed/2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.gmi new file mode 100644 index 00000000..991245e8 --- /dev/null +++ b/gemfeed/2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.gmi @@ -0,0 +1,86 @@ +# Gemtexter 3.0.0 - Let's Gemtext again⁴ + +> Published at 2024-10-01T21:46:26+03:00 + +I proudly announce that I've released Gemtexter version `3.0.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown, written in GNU Bash. + +=> https://codeberg.org/snonux/gemtexter + +``` +-=[ typewriters ]=- 1/98 + .-------. + .-------. _|~~ ~~ |_ + _|~~ ~~ |_ .-------. =(_|_______|_) + =(_|_______|_)= _|~~ ~~ |_ |:::::::::| .-------. + |:::::::::| =(_|_______|_) |:::::::[]| _|~~ ~~ |_ + |:::::::[]| |:::::::::| |o=======.| =(_|_______|_) + |o=======.| |:::::::[]| `"""""""""` |:::::::::| + jgs `"""""""""` |o=======.| |:::::::[]| + mod. by Paul Buetow `"""""""""` |o=======.| + `"""""""""` +``` + +## Table of Contents + +* ⇢ Gemtexter 3.0.0 - Let's Gemtext again⁴ +* ⇢ ⇢ Why Bash? +* ⇢ ⇢ HTML exact variant is the only variant +* ⇢ ⇢ Table of Contents auto-generation +* ⇢ ⇢ Configurable themes +* ⇢ ⇢ No use of webfonts by default +* ⇢ ⇢ More + +## Why Bash? + +This project is too complex for a Bash script. Writing it in Bash was to try out how maintainable a "larger" Bash script could be. It's still pretty maintainable and helps me try new Bash tricks here and then! + +Let's list what's new! + +## HTML exact variant is the only variant + +The last version of Gemtexter introduced the HTML exact variant, which wasn't enabled by default. This version of Gemtexter removes the previous (inexact) variant and makes the exact variant the default. This is a breaking change, which is why there is a major version bump of Gemtexter. Here is a reminder of what the exact variant was: + +> Gemtexter is there to convert your Gemini Capsule into other formats, such as HTML and Markdown. An HTML exact variant can now be enabled in the `gemtexter.conf` by adding the line `declare -rx HTML_VARIANT=exact`. The HTML/CSS output changed to reflect a more exact Gemtext appearance and to respect the same spacing as you would see in the Geminispace. + +## Table of Contents auto-generation + +Just add... + +``` + << template::inline::toc +``` + +...into a Gemtexter template file and Gemtexter will automatically generate a table of contents for the page based on the headings (see this page's ToC for example). The ToC will also have links to the relevant sections in HTML and Markdown output. The Gemtext format does not support links, so the ToC will simply be displayed as a bullet list. + +## Configurable themes + +It was always possible to customize the style of a Gemtexter's resulting HTML page, but all the config options were scattered across multiple files. Now, the CSS style, web fonts, etc., are all configurable via themes. + +Simply configure `HTML_THEME_DIR` in the `gemtexter.conf` file to the corresponding directory. For example: + +```bash +declare -xr HTML_THEME_DIR=./extras/html/themes/simple +``` + +To customize the theme or create your own, simply copy the theme directory and modify it as needed. This makes it also much easier to switch between layouts. + +## No use of webfonts by default + +The default theme is now "back to the basics" and does not utilize any web fonts. The previous themes are still part of the release and can be easily configured. These are currently the `future` and `business` themes. You can check them out from the themes directory. + +## More + +Additionally, there were a couple of bug fixes, refactorings and overall improvements in the documentation made. + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +Other related posts are: + +=> ./2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.gmi 2024-10-02 Gemtexter 3.0.0 - Let's Gemtext again⁴ (You are currently reading this) +=> ./2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.gmi 2023-07-21 Gemtexter 2.1.0 - Let's Gemtext again³ +=> ./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi 2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again² +=> ./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi 2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again +=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all +=> ./2021-04-24-welcome-to-the-geminispace.gmi 2021-04-24 Welcome to the Geminispace + +=> ../ Back to the main site diff --git a/gemfeed/2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.gmi.tpl b/gemfeed/2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.gmi.tpl new file mode 100644 index 00000000..02e86275 --- /dev/null +++ b/gemfeed/2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.gmi.tpl @@ -0,0 +1,73 @@ +# Gemtexter 3.0.0 - Let's Gemtext again⁴ + +> Published at 2024-10-01T21:46:26+03:00 + +I proudly announce that I've released Gemtexter version `3.0.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown, written in GNU Bash. + +=> https://codeberg.org/snonux/gemtexter + +``` +-=[ typewriters ]=- 1/98 + .-------. + .-------. _|~~ ~~ |_ + _|~~ ~~ |_ .-------. =(_|_______|_) + =(_|_______|_)= _|~~ ~~ |_ |:::::::::| .-------. + |:::::::::| =(_|_______|_) |:::::::[]| _|~~ ~~ |_ + |:::::::[]| |:::::::::| |o=======.| =(_|_______|_) + |o=======.| |:::::::[]| `"""""""""` |:::::::::| + jgs `"""""""""` |o=======.| |:::::::[]| + mod. by Paul Buetow `"""""""""` |o=======.| + `"""""""""` +``` + +<< template::inline::toc + +## Why Bash? + +This project is too complex for a Bash script. Writing it in Bash was to try out how maintainable a "larger" Bash script could be. It's still pretty maintainable and helps me try new Bash tricks here and then! + +Let's list what's new! + +## HTML exact variant is the only variant + +The last version of Gemtexter introduced the HTML exact variant, which wasn't enabled by default. This version of Gemtexter removes the previous (inexact) variant and makes the exact variant the default. This is a breaking change, which is why there is a major version bump of Gemtexter. Here is a reminder of what the exact variant was: + +> Gemtexter is there to convert your Gemini Capsule into other formats, such as HTML and Markdown. An HTML exact variant can now be enabled in the `gemtexter.conf` by adding the line `declare -rx HTML_VARIANT=exact`. The HTML/CSS output changed to reflect a more exact Gemtext appearance and to respect the same spacing as you would see in the Geminispace. + +## Table of Contents auto-generation + +Just add... + +``` + << template::inline::toc +``` + +...into a Gemtexter template file and Gemtexter will automatically generate a table of contents for the page based on the headings (see this page's ToC for example). The ToC will also have links to the relevant sections in HTML and Markdown output. The Gemtext format does not support links, so the ToC will simply be displayed as a bullet list. + +## Configurable themes + +It was always possible to customize the style of a Gemtexter's resulting HTML page, but all the config options were scattered across multiple files. Now, the CSS style, web fonts, etc., are all configurable via themes. + +Simply configure `HTML_THEME_DIR` in the `gemtexter.conf` file to the corresponding directory. For example: + +```bash +declare -xr HTML_THEME_DIR=./extras/html/themes/simple +``` + +To customize the theme or create your own, simply copy the theme directory and modify it as needed. This makes it also much easier to switch between layouts. + +## No use of webfonts by default + +The default theme is now "back to the basics" and does not utilize any web fonts. The previous themes are still part of the release and can be easily configured. These are currently the `future` and `business` themes. You can check them out from the themes directory. + +## More + +Additionally, there were a couple of bug fixes, refactorings and overall improvements in the documentation made. + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +Other related posts are: + +<< template::inline::rindex gemtext gemini + +=> ../ Back to the main site diff --git a/gemfeed/2024-10-24-staff-engineer-book-notes.gmi b/gemfeed/2024-10-24-staff-engineer-book-notes.gmi new file mode 100644 index 00000000..d5c26ad3 --- /dev/null +++ b/gemfeed/2024-10-24-staff-engineer-book-notes.gmi @@ -0,0 +1,133 @@ +# "Staff Engineer" book notes + +> Published at 2024-10-24T20:57:44+03:00 + +These are my personal takeaways after reading "Staff Engineer" by Will Larson. Note that the book contains much more knowledge wisdom and that these notes only contain points I personally found worth writing down. This is mainly for my own use, but you might find it helpful too. + +``` + ,.......... .........., + ,..,' '.' ',.., + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,'............., : ,.............', ', +,' '............ '.' ............' ', + '''''''''''''''''';''';'''''''''''''''''' + ''' +``` + +## Table of Contents + +* ⇢ "Staff Engineer" book notes +* ⇢ ⇢ The Four Archetypes of a Staff Engineer +* ⇢ ⇢ Influence and Impact over Authority +* ⇢ ⇢ Breadth and Depth of Knowledge +* ⇢ ⇢ Mentorship and Sponsorship +* ⇢ ⇢ Managing Up and Across +* ⇢ ⇢ Strategic Thinking +* ⇢ ⇢ Emotional Intelligence +* ⇢ ⇢ Navigating Ambiguity +* ⇢ ⇢ Visible and Invisible Work +* ⇢ ⇢ Scaling Yourself +* ⇢ ⇢ Career Progression and Title Inflation +* ⇢ ⇢ Not a faster Senior Engineer +* ⇢ ⇢ The Balance +* ⇢ ⇢ More things + +## The Four Archetypes of a Staff Engineer + +Larson breaks down the role of a Staff Engineer into four main archetypes, which can help frame how you approach the role: + +* Tech Lead: Focuses on the technical direction of a team, ensuring high-quality execution, architecture, and aligning the team around shared goals. +* Solver: Gets pulled into complex, high-impact problems that often involve many teams or systems, operating as a fixer or troubleshooter. +* Architect: Works on the long-term technical vision for an organization, setting standards and designing systems that will scale and last over time. +* Right Hand: Functions as a trusted technical advisor to leadership, providing input on strategy, long-term decisions, and navigating organizational politics. + +## Influence and Impact over Authority + +As a Staff Engineer, influence is often more important than formal authority. You’ll rarely have direct control over teams or projects but will need to drive outcomes by influencing peers, other teams, and leadership. It’s about understanding how to persuade, align, and mentor others to achieve technical outcomes. + +## Breadth and Depth of Knowledge + +Staff Engineers often need to maintain a breadth of knowledge across various areas while maintaining depth in a few. This can mean keeping a high-level understanding of several domains (e.g., infrastructure, security, product development) but being able to dive deep when needed in certain core areas. + +## Mentorship and Sponsorship + +An important part of a Staff Engineer’s role is mentoring others, not just in technical matters but in career development as well. Sponsorship goes a step beyond mentorship, where you actively advocate for others, create opportunities for them, and push them toward growth. + +## Managing Up and Across + +Success as a Staff Engineer often depends on managing up (influencing leadership and setting expectations) and managing across (working effectively with peers and other teams). This is often tied to communication skills, the ability to advocate for technical needs, and fostering alignment across departments or organizations. + +## Strategic Thinking + +While Senior Engineers may focus on execution, Staff Engineers are expected to think strategically, making decisions that will affect the company or product months or years down the line. This means balancing short-term execution needs with long-term architectural decisions, which may require challenging short-term pressures. + +## Emotional Intelligence + +The higher you go in engineering roles, the more soft skills, particularly emotional intelligence (EQ), come into play. Building relationships, resolving conflicts, and understanding the broader emotional dynamics of the team and organization become key parts of your role. + +## Navigating Ambiguity + +Staff Engineers are often placed in situations with high ambiguity—whether in defining the problem space, coming up with a solution, or aligning stakeholders. The ability to operate effectively in these unclear areas is critical to success. + +## Visible and Invisible Work + +Much of the work done by Staff Engineers is invisible. Solving complex problems, creating alignment, or influencing decisions doesn’t always result in tangible code, but it can have a massive impact. Larson emphasizes that part of the role is being comfortable with this type of invisible contribution. + +## Scaling Yourself + +At the Staff Engineer level, you must scale your impact beyond direct contribution. This can involve improving documentation, developing repeatable processes, mentoring others, or automating parts of the workflow. The idea is to enable teams and individuals to be more effective, even when you’re not directly involved. + +## Career Progression and Title Inflation + +Larson touches on how different companies have varying definitions of "Staff Engineer," and titles don’t always correlate directly with responsibility or skill. He emphasizes the importance of focusing more on the work you're doing and the impact you're having, rather than the title itself. + +These additional points reflect more of the strategic, interpersonal, and leadership aspects that go beyond the technical expertise expected at this level. The role of a Staff Engineer is often about balancing high-level strategy with technical execution, while influencing teams and projects in a sustainable, long-term way. + +## Not a faster Senior Engineer + +* A Staff engineer is more than just a faster Senior. +* A staff engineer is not a senior engineer but a bit better. + +It's important to know what work or which role most energizes you. A Staff engineer is not a more senior engineer. A Staff engineer also fits into another archetype. + +As a staff engineer, you are always expected to go beyond your comfort zone and learn new things. + +Your job sometimes will feel like an SEM and sometimes strangely similar to your senior roles. + +A Staff engineer is, like a Manager, a leader. However, being a Manager is a specific job. Leaders can apply to any job, especially to Staff engineers. + +## The Balance + +The more senior you become, the more responsibility you will have to cope with them in less time. Balance your speed of progress with your personal life, don't work late hours and don't skip these personal care events. + +Do fewer things but do them better. Everything done will accelerate the organization. Everything else will drag it down—quality over quantity. + +Don't work at ten things and progress slowly; focus on one thing and finish it. + +Only spend some of the time firefighting. Have time for deep thinking. Only deep think some of the time. Otherwise, you lose touch with reality. + +Sebactical: Take at least six months. Otherwise, it won't be as restored. + +## More things + +* Provide simple but widely used tools. Complex and powerful tools will have power users but only a very few. All others will not use the tool. +* In meetings, when someone is inactive, try to pull him in. Pull in max one person at a time. Don't open the discussion to multiple people. +* Get used to writing things down and repeating yourself. You will scale yourself much more. +* Title inflation: skills correspond to work, but the titles don't. + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +Other book notes of mine are: + +=> ./2024-10-24-staff-engineer-book-notes.gmi 2024-10-24 "Staff Engineer" book notes (You are currently reading this) +=> ./2024-07-07-the-stoic-challenge-book-notes.gmi 2024-07-07 "The Stoic Challenge" book notes +=> ./2024-05-01-slow-productivity-book-notes.gmi 2024-05-01 "Slow Productivity" book notes +=> ./2023-11-11-mind-management-book-notes.gmi 2023-11-11 "Mind Management" book notes +=> ./2023-07-17-career-guide-and-soft-skills-book-notes.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes +=> ./2023-05-06-the-obstacle-is-the-way-book-notes.gmi 2023-05-06 "The Obstacle is the Way" book notes +=> ./2023-04-01-never-split-the-difference-book-notes.gmi 2023-04-01 "Never split the difference" book notes +=> ./2023-03-16-the-pragmatic-programmer-book-notes.gmi 2023-03-16 "The Pragmatic Programmer" book notes + +=> ../ Back to the main site diff --git a/gemfeed/2024-10-24-staff-engineer-book-notes.gmi.tpl b/gemfeed/2024-10-24-staff-engineer-book-notes.gmi.tpl new file mode 100644 index 00000000..67e0cebb --- /dev/null +++ b/gemfeed/2024-10-24-staff-engineer-book-notes.gmi.tpl @@ -0,0 +1,110 @@ +# "Staff Engineer" book notes + +> Published at 2024-10-24T20:57:44+03:00 + +These are my personal takeaways after reading "Staff Engineer" by Will Larson. Note that the book contains much more knowledge wisdom and that these notes only contain points I personally found worth writing down. This is mainly for my own use, but you might find it helpful too. + +``` + ,.......... .........., + ,..,' '.' ',.., + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,'............., : ,.............', ', +,' '............ '.' ............' ', + '''''''''''''''''';''';'''''''''''''''''' + ''' +``` + +<< template::inline::toc + +## The Four Archetypes of a Staff Engineer + +Larson breaks down the role of a Staff Engineer into four main archetypes, which can help frame how you approach the role: + +* Tech Lead: Focuses on the technical direction of a team, ensuring high-quality execution, architecture, and aligning the team around shared goals. +* Solver: Gets pulled into complex, high-impact problems that often involve many teams or systems, operating as a fixer or troubleshooter. +* Architect: Works on the long-term technical vision for an organization, setting standards and designing systems that will scale and last over time. +* Right Hand: Functions as a trusted technical advisor to leadership, providing input on strategy, long-term decisions, and navigating organizational politics. + +## Influence and Impact over Authority + +As a Staff Engineer, influence is often more important than formal authority. You’ll rarely have direct control over teams or projects but will need to drive outcomes by influencing peers, other teams, and leadership. It’s about understanding how to persuade, align, and mentor others to achieve technical outcomes. + +## Breadth and Depth of Knowledge + +Staff Engineers often need to maintain a breadth of knowledge across various areas while maintaining depth in a few. This can mean keeping a high-level understanding of several domains (e.g., infrastructure, security, product development) but being able to dive deep when needed in certain core areas. + +## Mentorship and Sponsorship + +An important part of a Staff Engineer’s role is mentoring others, not just in technical matters but in career development as well. Sponsorship goes a step beyond mentorship, where you actively advocate for others, create opportunities for them, and push them toward growth. + +## Managing Up and Across + +Success as a Staff Engineer often depends on managing up (influencing leadership and setting expectations) and managing across (working effectively with peers and other teams). This is often tied to communication skills, the ability to advocate for technical needs, and fostering alignment across departments or organizations. + +## Strategic Thinking + +While Senior Engineers may focus on execution, Staff Engineers are expected to think strategically, making decisions that will affect the company or product months or years down the line. This means balancing short-term execution needs with long-term architectural decisions, which may require challenging short-term pressures. + +## Emotional Intelligence + +The higher you go in engineering roles, the more soft skills, particularly emotional intelligence (EQ), come into play. Building relationships, resolving conflicts, and understanding the broader emotional dynamics of the team and organization become key parts of your role. + +## Navigating Ambiguity + +Staff Engineers are often placed in situations with high ambiguity—whether in defining the problem space, coming up with a solution, or aligning stakeholders. The ability to operate effectively in these unclear areas is critical to success. + +## Visible and Invisible Work + +Much of the work done by Staff Engineers is invisible. Solving complex problems, creating alignment, or influencing decisions doesn’t always result in tangible code, but it can have a massive impact. Larson emphasizes that part of the role is being comfortable with this type of invisible contribution. + +## Scaling Yourself + +At the Staff Engineer level, you must scale your impact beyond direct contribution. This can involve improving documentation, developing repeatable processes, mentoring others, or automating parts of the workflow. The idea is to enable teams and individuals to be more effective, even when you’re not directly involved. + +## Career Progression and Title Inflation + +Larson touches on how different companies have varying definitions of "Staff Engineer," and titles don’t always correlate directly with responsibility or skill. He emphasizes the importance of focusing more on the work you're doing and the impact you're having, rather than the title itself. + +These additional points reflect more of the strategic, interpersonal, and leadership aspects that go beyond the technical expertise expected at this level. The role of a Staff Engineer is often about balancing high-level strategy with technical execution, while influencing teams and projects in a sustainable, long-term way. + +## Not a faster Senior Engineer + +* A Staff engineer is more than just a faster Senior. +* A staff engineer is not a senior engineer but a bit better. + +It's important to know what work or which role most energizes you. A Staff engineer is not a more senior engineer. A Staff engineer also fits into another archetype. + +As a staff engineer, you are always expected to go beyond your comfort zone and learn new things. + +Your job sometimes will feel like an SEM and sometimes strangely similar to your senior roles. + +A Staff engineer is, like a Manager, a leader. However, being a Manager is a specific job. Leaders can apply to any job, especially to Staff engineers. + +## The Balance + +The more senior you become, the more responsibility you will have to cope with them in less time. Balance your speed of progress with your personal life, don't work late hours and don't skip these personal care events. + +Do fewer things but do them better. Everything done will accelerate the organization. Everything else will drag it down—quality over quantity. + +Don't work at ten things and progress slowly; focus on one thing and finish it. + +Only spend some of the time firefighting. Have time for deep thinking. Only deep think some of the time. Otherwise, you lose touch with reality. + +Sebactical: Take at least six months. Otherwise, it won't be as restored. + +## More things + +* Provide simple but widely used tools. Complex and powerful tools will have power users but only a very few. All others will not use the tool. +* In meetings, when someone is inactive, try to pull him in. Pull in max one person at a time. Don't open the discussion to multiple people. +* Get used to writing things down and repeating yourself. You will scale yourself much more. +* Title inflation: skills correspond to work, but the titles don't. + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +Other book notes of mine are: + +<< template::inline::rindex book-notes + +=> ../ Back to the main site diff --git a/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi b/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi new file mode 100644 index 00000000..a915ea77 --- /dev/null +++ b/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi @@ -0,0 +1,173 @@ +# f3s: Kubernetes with FreeBSD - Part 1: Setting the stage + +> Published at 2024-11-16T23:20:14+02:00 + +This is the first 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 I will use on FreeBSD-based physical machines. + +I will post a new entry every month or so (there are too many other side projects for more frequent updates—I bet you can understand). + +These are all the posts so far: + +=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts +=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation +=> ./2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi 2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage (You are currently reading this) + +=> ./f3s-kubernetes-with-freebsd-part-1/f3slogo.png f3s logo + +> Logo was generated by ChatGPT. + +Let's begin... + +## Table of Contents + +* ⇢ f3s: Kubernetes with FreeBSD - Part 1: Setting the stage +* ⇢ ⇢ Why this setup? +* ⇢ ⇢ The infrastructure +* ⇢ ⇢ ⇢ Physical FreeBSD nodes and Linux VMs +* ⇢ ⇢ ⇢ Kubernetes with k3s +* ⇢ ⇢ ⇢ HA volumes for k3s with HAST/ZFS and NFS +* ⇢ ⇢ ⇢ OpenBSD/`relayd` to the rescue for external connectivity +* ⇢ ⇢ Data integrity +* ⇢ ⇢ ⇢ Periodic backups +* ⇢ ⇢ ⇢ Power protection +* ⇢ ⇢ Monitoring: Keeping an eye on everything +* ⇢ ⇢ ⇢ Prometheus and Grafana +* ⇢ ⇢ ⇢ Gogios: My custom alerting system +* ⇢ ⇢ What's after this all? + +## Why this setup? + +My previous setup was great for learning Terraform and AWS, but it is too expensive. Costs are under control there, but only because I am shutting down all containers after use (so they are offline ninety percent of the time and still cost around $20 monthly). With the new setup, I could run all containers 24/7 at home, which would still be cheaper in terms of electricity consumption. I have a 50 MBit/s uplink (I could have more if I wanted, but it is plenty for my use case already). + +=> ./2024-02-04-from-babylon5.buetow.org-to-.cloud.gmi From `babylon5.buetow.org` to `.cloud` + +Migrating off all my containers from AWS ECS means I need a reliable and scalable environment to host my workloads. I wanted something: + +* To self-host all my open-source apps (Docker containers). +* Fully under my control (goodbye cloud vendor lock-in). +* Secure and redundant. +* Cost-efficient (after the initial hardware investment). +* Something I can poke around with and also pick up new skills. + +## The infrastructure + +This is still in progress, and I need to own the hardware. But in this first part of the blog series, I will outline what I intend to do. + +=> ./f3s-kubernetes-with-freebsd-part-1/diagram.png Diagram + +### Physical FreeBSD nodes and Linux VMs + +The setup starts with three physical FreeBSD nodes deployed into my home LAN. On these, I'm going to run Rocky Linux virtual machines with bhyve. Why Linux VMs in FreeBSD and not Linux directly? I want to leverage the great ZFS integration in FreeBSD (among other features), and I have been using FreeBSD for a while in my home lab. And with bhyve, there is a very performant hypervisor available which makes the Linux VMs de-facto run at native speed (another use case of mine would be maybe running a Windows bhyve VM on one of the nodes - but out of scope for this blog series). + +=> https://www.freebsd.org/ +=> https://wiki.freebsd.org/bhyve + +I selected Rocky Linux because it comes with long-term support (I don't want to upgrade the VMs every 6 months). Rocky Linux 9 will reach its end of life in 2032, which is plenty of time! Of course, there will be minor upgrades, but nothing will significantly break my setup. + +=> https://rockylinux.org/ +=> https://wiki.rockylinux.org/rocky/version/ + +Furthermore, I am already using "RHEL-family" related distros at work and Fedora on my main personal laptop. Rocky Linux belongs to the same type of Linux distribution family, so I already feel at home here. I also used Rocky 9 before I switched to AWS ECS. Now, I am switching back in one sense or another ;-) + +### Kubernetes with k3s + +These Linux VMs form a three-node k3s Kubernetes cluster, where my containers will reside moving forward. The 3-node k3s cluster will be highly available (in `etcd` mode), and all apps will probably be deployed with Helm. Prometheus will also be running in k3s, collecting time-series metrics and handling monitoring. Additionally, a private Docker registry will be deployed into the k3s cluster, where I will store some of my self-created Docker images. k3s is the perfect distribution of Kubernetes for homelabbers due to its simplicity and the inclusion of the most useful features out of the box! + +=> https://k3s.io/ + +### HA volumes for k3s with HAST/ZFS and NFS + +Persistent storage for the k3s cluster will be handled by highly available (HA) NFS shares backed by ZFS on the FreeBSD hosts. + +On two of the three physical FreeBSD nodes, I will add a second SSD drive to each and dedicate it to a `zhast` ZFS pool. With HAST (FreeBSD's solution for highly available storage), this `pool` will be replicated at the byte level to a standby node. + +A virtual IP (VIP) will point to the master node. When the master node goes down, the VIP will failover to the standby node, where the ZFS pool will be mounted. An NFS server will listen to both nodes. k3s will use the VIP to access the NFS shares. + +=> https://wiki.freebsd.org/HighlyAvailableStorage FreeBSD Wiki: Highly Available Storage + +You can think of DRBD being the Linux equivalent to FreeBSD's HAST. + +### OpenBSD/`relayd` to the rescue for external connectivity + +All apps should be reachable through the internet (e.g., from my phone or computer when travelling). For external connectivity and TLS management, I've got two OpenBSD VMs (one hosted by OpenBSD Amsterdam and another hosted by Hetzner) handling public-facing services like DNS, relaying traffic, and automating Let's Encrypt certificates. + +All of this (every Linux VM to every OpenBSD box) will be connected via WireGuard tunnels, keeping everything private and secure. There will be 6 WireGuard tunnels (3 k3s nodes times two OpenBSD VMs). + +=> https://en.wikipedia.org/wiki/WireGuard + +So, when I want to access a service running in k3s, I will hit an external DNS endpoint (with the authoritative DNS servers being the OpenBSD boxes). The DNS will resolve to the master OpenBSD VM (see my KISS highly-available with OpenBSD blog post), and from there, the `relayd` process (with a Let's Encrypt certificate—see my Let's Encrypt with OpenBSD and Rex blog post) will accept the TCP connection and forward it through the WireGuard tunnel to a reachable node port of one of the k3s nodes, thus serving the traffic. + +=> ./2024-04-01-KISS-high-availability-with-OpenBSD.gmi KISS high-availability with OpenBSD +=> ./2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi Let's Encrypt with OpenBSD and Rex + +The OpenBSD setup described here already exists and is ready to use. The only thing that does not yet exist is the configuration of `relayd` to forward requests to k3s through the WireGuard tunnel(s). + +## Data integrity + +### Periodic backups + +Let's face it, backups are non-negotiable. + +On the HAST master node, incremental and encrypted ZFS snapshots are created daily and automatically backed up to AWS S3 Glacier Deep Archive via CRON. I have a bunch of scripts already available, which I currently use for a similar purpose on my FreeBSD Home NAS server (an old ThinkPad T440 with an external USB drive enclosure, which I will eventually retire when the HAST setup is ready). I will copy them and slightly modify them to fit the purpose. + +There's also `zfstools` in the ports, which helps set up an automatic snapshot regime: + +=> https://www.freshports.org/sysutils/zfstools + +The backup scripts also perform some zpool scrubbing now and then. A scrub once in a while keeps the trouble away. + +### Power protection + +Power outages are regularly in my area, so a UPS keeps the infrastructure running during short outages and protects the hardware. I'm still trying to decide which hardware to get, and I still need one, as my previous NAS is simply an older laptop that already has a battery for power outages. However, there are plenty of options to choose from. My main criterion is that the UPS should be silent, as the whole setup will be installed in an upper shelf unit in my daughter's room. ;-) + +## Monitoring: Keeping an eye on everything + +Robust monitoring is vital to any infrastructure, especially one as distributed as mine. I've thought about a setup that ensures I'll always be aware of what's happening in my environment. + +### Prometheus and Grafana + +Inside the k3s cluster, Prometheus will be deployed to handle metrics collection. It will be configured to scrape data from my Kubernetes workloads, nodes, and any services I monitor. Prometheus also integrates with Alertmanager to generate alerts based on predefined thresholds or conditions. + +=> https://prometheus.io + +For visualization, Grafana will be deployed alongside Prometheus. Grafana lets me build dynamic, customizable dashboards that provide a real-time view of everything from resource utilization to application performance. Whether it's keeping track of CPU load, memory usage, or the health of Kubernetes pods, Grafana has it covered. This will also make troubleshooting easier, as I can quickly pinpoint where issues are arising. + +=> https://grafana.com + +### Gogios: My custom alerting system + +Alerts generated by Prometheus are forwarded to Alertmanager, which I will configure to work with Gogios, a lightweight monitoring and alerting system I wrote myself. Gogios runs on one of my OpenBSD VMs. At regular intervals, Gogios scrapes the alerts generated in the k3s cluster and notifies me via Email. + +=> ./2023-06-01-kiss-server-monitoring-with-gogios.gmi KISS server monitoring with Gogios + +Ironically, I implemented Gogios to avoid using more complex alerting systems like Prometheus, but here we go—it integrates well now. + +## What's after this all? + +This setup may be just the beginning. Some ideas I'm thinking about for the future: + +* Adding more FreeBSD nodes (in different physical locations, maybe at my wider family's places? WireGuard would make it possible!) for better redundancy. (HA storage then might be trickier) +* Deploying more Docker apps (data-intensive ones, like a picture gallery, my entire audiobook catalogue, or even a music server) to k3s. + +For now, though, I'm focused on completing the migration from AWS ECS and getting all my Docker containers running smoothly in k3s. + +What's your take on self-hosting? Are you planning to move away from managed cloud services? Stay tuned for the second part of this series, where I will likely write about the hardware and the OS setups. + +Read the next post of this series: + +=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation + +Other *BSD-related posts: + +=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts +=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation +=> ./2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi 2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage (You are currently reading this) +=> ./2024-04-01-KISS-high-availability-with-OpenBSD.gmi 2024-04-01 KISS high-availability with OpenBSD +=> ./2024-01-13-one-reason-why-i-love-openbsd.gmi 2024-01-13 One reason why I love OpenBSD +=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD +=> ./2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi 2022-07-30 Let's Encrypt with OpenBSD and Rex +=> ./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi 2016-04-09 Jails and ZFS with Puppet on FreeBSD + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi.tpl b/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi.tpl new file mode 100644 index 00000000..330c3437 --- /dev/null +++ b/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi.tpl @@ -0,0 +1,149 @@ +# f3s: Kubernetes with FreeBSD - Part 1: Setting the stage + +> Published at 2024-11-16T23:20:14+02:00 + +This is the first 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 I will use on FreeBSD-based physical machines. + +I will post a new entry every month or so (there are too many other side projects for more frequent updates—I bet you can understand). + +These are all the posts so far: + +<< template::inline::rindex f3s + +=> ./f3s-kubernetes-with-freebsd-part-1/f3slogo.png f3s logo + +> Logo was generated by ChatGPT. + +Let's begin... + +<< template::inline::toc + +## Why this setup? + +My previous setup was great for learning Terraform and AWS, but it is too expensive. Costs are under control there, but only because I am shutting down all containers after use (so they are offline ninety percent of the time and still cost around $20 monthly). With the new setup, I could run all containers 24/7 at home, which would still be cheaper in terms of electricity consumption. I have a 50 MBit/s uplink (I could have more if I wanted, but it is plenty for my use case already). + +=> ./2024-02-04-from-babylon5.buetow.org-to-.cloud.gmi From `babylon5.buetow.org` to `.cloud` + +Migrating off all my containers from AWS ECS means I need a reliable and scalable environment to host my workloads. I wanted something: + +* To self-host all my open-source apps (Docker containers). +* Fully under my control (goodbye cloud vendor lock-in). +* Secure and redundant. +* Cost-efficient (after the initial hardware investment). +* Something I can poke around with and also pick up new skills. + +## The infrastructure + +This is still in progress, and I need to own the hardware. But in this first part of the blog series, I will outline what I intend to do. + +=> ./f3s-kubernetes-with-freebsd-part-1/diagram.png Diagram + +### Physical FreeBSD nodes and Linux VMs + +The setup starts with three physical FreeBSD nodes deployed into my home LAN. On these, I'm going to run Rocky Linux virtual machines with bhyve. Why Linux VMs in FreeBSD and not Linux directly? I want to leverage the great ZFS integration in FreeBSD (among other features), and I have been using FreeBSD for a while in my home lab. And with bhyve, there is a very performant hypervisor available which makes the Linux VMs de-facto run at native speed (another use case of mine would be maybe running a Windows bhyve VM on one of the nodes - but out of scope for this blog series). + +=> https://www.freebsd.org/ +=> https://wiki.freebsd.org/bhyve + +I selected Rocky Linux because it comes with long-term support (I don't want to upgrade the VMs every 6 months). Rocky Linux 9 will reach its end of life in 2032, which is plenty of time! Of course, there will be minor upgrades, but nothing will significantly break my setup. + +=> https://rockylinux.org/ +=> https://wiki.rockylinux.org/rocky/version/ + +Furthermore, I am already using "RHEL-family" related distros at work and Fedora on my main personal laptop. Rocky Linux belongs to the same type of Linux distribution family, so I already feel at home here. I also used Rocky 9 before I switched to AWS ECS. Now, I am switching back in one sense or another ;-) + +### Kubernetes with k3s + +These Linux VMs form a three-node k3s Kubernetes cluster, where my containers will reside moving forward. The 3-node k3s cluster will be highly available (in `etcd` mode), and all apps will probably be deployed with Helm. Prometheus will also be running in k3s, collecting time-series metrics and handling monitoring. Additionally, a private Docker registry will be deployed into the k3s cluster, where I will store some of my self-created Docker images. k3s is the perfect distribution of Kubernetes for homelabbers due to its simplicity and the inclusion of the most useful features out of the box! + +=> https://k3s.io/ + +### HA volumes for k3s with HAST/ZFS and NFS + +Persistent storage for the k3s cluster will be handled by highly available (HA) NFS shares backed by ZFS on the FreeBSD hosts. + +On two of the three physical FreeBSD nodes, I will add a second SSD drive to each and dedicate it to a `zhast` ZFS pool. With HAST (FreeBSD's solution for highly available storage), this `pool` will be replicated at the byte level to a standby node. + +A virtual IP (VIP) will point to the master node. When the master node goes down, the VIP will failover to the standby node, where the ZFS pool will be mounted. An NFS server will listen to both nodes. k3s will use the VIP to access the NFS shares. + +=> https://wiki.freebsd.org/HighlyAvailableStorage FreeBSD Wiki: Highly Available Storage + +You can think of DRBD being the Linux equivalent to FreeBSD's HAST. + +### OpenBSD/`relayd` to the rescue for external connectivity + +All apps should be reachable through the internet (e.g., from my phone or computer when travelling). For external connectivity and TLS management, I've got two OpenBSD VMs (one hosted by OpenBSD Amsterdam and another hosted by Hetzner) handling public-facing services like DNS, relaying traffic, and automating Let's Encrypt certificates. + +All of this (every Linux VM to every OpenBSD box) will be connected via WireGuard tunnels, keeping everything private and secure. There will be 6 WireGuard tunnels (3 k3s nodes times two OpenBSD VMs). + +=> https://en.wikipedia.org/wiki/WireGuard + +So, when I want to access a service running in k3s, I will hit an external DNS endpoint (with the authoritative DNS servers being the OpenBSD boxes). The DNS will resolve to the master OpenBSD VM (see my KISS highly-available with OpenBSD blog post), and from there, the `relayd` process (with a Let's Encrypt certificate—see my Let's Encrypt with OpenBSD and Rex blog post) will accept the TCP connection and forward it through the WireGuard tunnel to a reachable node port of one of the k3s nodes, thus serving the traffic. + +=> ./2024-04-01-KISS-high-availability-with-OpenBSD.gmi KISS high-availability with OpenBSD +=> ./2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi Let's Encrypt with OpenBSD and Rex + +The OpenBSD setup described here already exists and is ready to use. The only thing that does not yet exist is the configuration of `relayd` to forward requests to k3s through the WireGuard tunnel(s). + +## Data integrity + +### Periodic backups + +Let's face it, backups are non-negotiable. + +On the HAST master node, incremental and encrypted ZFS snapshots are created daily and automatically backed up to AWS S3 Glacier Deep Archive via CRON. I have a bunch of scripts already available, which I currently use for a similar purpose on my FreeBSD Home NAS server (an old ThinkPad T440 with an external USB drive enclosure, which I will eventually retire when the HAST setup is ready). I will copy them and slightly modify them to fit the purpose. + +There's also `zfstools` in the ports, which helps set up an automatic snapshot regime: + +=> https://www.freshports.org/sysutils/zfstools + +The backup scripts also perform some zpool scrubbing now and then. A scrub once in a while keeps the trouble away. + +### Power protection + +Power outages are regularly in my area, so a UPS keeps the infrastructure running during short outages and protects the hardware. I'm still trying to decide which hardware to get, and I still need one, as my previous NAS is simply an older laptop that already has a battery for power outages. However, there are plenty of options to choose from. My main criterion is that the UPS should be silent, as the whole setup will be installed in an upper shelf unit in my daughter's room. ;-) + +## Monitoring: Keeping an eye on everything + +Robust monitoring is vital to any infrastructure, especially one as distributed as mine. I've thought about a setup that ensures I'll always be aware of what's happening in my environment. + +### Prometheus and Grafana + +Inside the k3s cluster, Prometheus will be deployed to handle metrics collection. It will be configured to scrape data from my Kubernetes workloads, nodes, and any services I monitor. Prometheus also integrates with Alertmanager to generate alerts based on predefined thresholds or conditions. + +=> https://prometheus.io + +For visualization, Grafana will be deployed alongside Prometheus. Grafana lets me build dynamic, customizable dashboards that provide a real-time view of everything from resource utilization to application performance. Whether it's keeping track of CPU load, memory usage, or the health of Kubernetes pods, Grafana has it covered. This will also make troubleshooting easier, as I can quickly pinpoint where issues are arising. + +=> https://grafana.com + +### Gogios: My custom alerting system + +Alerts generated by Prometheus are forwarded to Alertmanager, which I will configure to work with Gogios, a lightweight monitoring and alerting system I wrote myself. Gogios runs on one of my OpenBSD VMs. At regular intervals, Gogios scrapes the alerts generated in the k3s cluster and notifies me via Email. + +=> ./2023-06-01-kiss-server-monitoring-with-gogios.gmi KISS server monitoring with Gogios + +Ironically, I implemented Gogios to avoid using more complex alerting systems like Prometheus, but here we go—it integrates well now. + +## What's after this all? + +This setup may be just the beginning. Some ideas I'm thinking about for the future: + +* Adding more FreeBSD nodes (in different physical locations, maybe at my wider family's places? WireGuard would make it possible!) for better redundancy. (HA storage then might be trickier) +* Deploying more Docker apps (data-intensive ones, like a picture gallery, my entire audiobook catalogue, or even a music server) to k3s. + +For now, though, I'm focused on completing the migration from AWS ECS and getting all my Docker containers running smoothly in k3s. + +What's your take on self-hosting? Are you planning to move away from managed cloud services? Stay tuned for the second part of this series, where I will likely write about the hardware and the OS setups. + +Read the next post of this series: + +=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation + +Other *BSD-related posts: + +<< template::inline::rindex bsd + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi b/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi new file mode 100644 index 00000000..de0e5b8a --- /dev/null +++ b/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi @@ -0,0 +1,312 @@ +# f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation + +> Published at 2024-12-02T23:48:21+02:00 + +This is the second 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 I will use on FreeBSD-based physical machines. + +We set the stage last time; this time, we will set up the hardware for this project. + +These are all the posts so far: + +=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts +=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation (You are currently reading this) +=> ./2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi 2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage + +=> ./f3s-kubernetes-with-freebsd-part-1/f3slogo.png f3s logo + +> Logo was generated by ChatGPT. + +Let's continue... + +## Table of Contents + +* ⇢ f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation +* ⇢ Deciding on the hardware +* ⇢ ⇢ Not ARM but Intel N100 +* ⇢ ⇢ Beelink unboxing +* ⇢ ⇢ Network switch +* ⇢ Installing FreeBSD +* ⇢ ⇢ Base install +* ⇢ ⇢ Latest patch level and customizing `/etc/hosts` +* ⇢ ⇢ After install +* ⇢ ⇢ ⇢ Helix editor +* ⇢ ⇢ ⇢ `doas` +* ⇢ ⇢ ⇢ Periodic ZFS snapshotting +* ⇢ ⇢ ⇢ Uptime tracking +* ⇢ Hardware check +* ⇢ ⇢ Ethernet +* ⇢ ⇢ RAM +* ⇢ ⇢ CPUs +* ⇢ ⇢ CPU throttling +* ⇢ Conclusion + +# Deciding on the hardware + +Note that the OpenBSD VMs included in the f3s setup (which will be used later in this blog series for internet ingress - as you know from the first part of this blog series) are already there. These are virtual machines that I rent at OpenBSD Amsterdam and Hetzner. + +=> https://openbsd.amsterdam +=> https://hetzner.cloud + +This means that the FreeBSD boxes need to be covered, which will later be running k3s in Linux VMs via bhyve hypervisor. + +I've been considering whether to use Raspberry Pis or look for alternatives. It turns out that complete N100-based mini-computers aren't much more expensive than Raspberry Pi 5s, and they don't require assembly. Furthermore, I like that they are AMD64 and not ARM-based, which increases compatibility with some applications (e.g., I might want to virtualize Windows (via bhyve) on one of those, though that's out of scope for this blog series). + +## Not ARM but Intel N100 + +I needed something compact, efficient, and capable enough to handle the demands of a small-scale Kubernetes cluster and preferably something I don't have to assemble a lot. After researching, I decided on the Beelink S12 Pro with Intel N100 CPUs. + +=> https://www.bee-link.com/products/beelink-mini-s12-pro-n100 Beelink Mini S12 Pro N100 official page + +The Intel N100 CPUs are built on the "Alder Lake-N" architecture. These chips are designed to balance performance and energy efficiency well. With four cores, they're more than capable of running multiple containers, even with moderate workloads. Plus, they consume only around 8W of power (ok, that's more than the Pis...), keeping the electricity bill low enough and the setup quiet - perfect for 24/7 operation. + +=> ./f3s-kubernetes-with-freebsd-part-2/f3s-collage1.jpg Beelink preparation + +The Beelink comes with the following specs: + +* 12th Gen Intel N100 processor, with four cores and four threads, and a maximum frequency of up to 3.4 GHz. +* 16 GB of DDR4 RAM, with a maximum (official) size of 16 GB (but people could install 32 GB on it). +* 500 GB M.2 SSD, with the option to install a 2nd 2.5 SSD drive (which I want to make use of later in this blog series). +* GBit ethernet +* Four USB 3.2 Gen2 ports (maybe I want to mount something externally at some point) +* Dimensions and weight: 115*102*39mm, 280g +* Silent cooling system. +* HDMI output (needed only for the initial installation and maybe for troubleshooting later) +* Auto power on via WoL (may make use of it) +* Wi-Fi (not going to use it) + +I bought three (3) of them for the cluster I intend to build. + +## Beelink unboxing + +Unboxing was uneventful. Every Beelink PC came with: + +* An AC power adapter +* An HDMI cable +* A VESA mount with screws (not using it as of now) +* Some manuals +* The pre-assembled Beelink PC itself. +* A "Hello" post card (??) + +Overall, I love the small form factor. + +## Network switch + +I went with the tp-link mini 5-port switch, as I had a spare one available. That switch will be plugged into my wall ethernet port, which connects directly to my fiber internet router with 100 Mbit/s down and 50 Mbit/s upload speed. + +=> ./f3s-kubernetes-with-freebsd-part-2/switch.jpg Switch + +# Installing FreeBSD + +## Base install + +First, I downloaded the boot-only ISO of the latest FreeBSD release and dumped it on a USB stick via my Fedora laptop: + +```sh +[paul@earth]~/Downloads% sudo dd \ + if=FreeBSD-14.1-RELEASE-amd64-bootonly.iso \ + of=/dev/sda conv=sync +``` + +Next, I plugged the Beelinks (one after another) into my monitor via HDMI (the resolution of the FreeBSD text console seems strangely stretched, as I am using the LG Dual Up monitor), connected Ethernet, an external USB keyboard, and the FreeBSD USB stick, and booted the devices up. With F7, I entered the boot menu and selected the USB stick for the FreeBSD installation. + +The installation was uneventful. I selected: + +* Guided ZFS on root (pool `zroot`) +* Unencrypted ZFS (I will encrypt separate datasets later; I want it to be able to boot without manual interaction) +* Static IP configuration (to ensure that the boxes always have the same IPs, even after switching the router/DHCP server) +* I decided to enable the SSH daemon, NTP server, and NTP time synchronization at boot, and I also enabled `powerd` for automatic CPU frequency scaling. +* In addition to `root,` I added a personal user, `paul,` whom I placed in the `wheel` group. + +After doing all that three times (once for each Beelink PC), I had three ready-to-use FreeBSD boxes! Their hostnames are `f0`, `f1` and `f2`! + +=> ./f3s-kubernetes-with-freebsd-part-2/f3s-collage2.jpg Beelink installation + +## Latest patch level and customizing `/etc/hosts` + +After the first boot, I upgraded to the latest FreeBSD patch level as follows: + +```sh +root@f0:~ # freebsd-update fetch +root@f0:~ # freebsd-update install +root@f0:~ # freebsd-update reboot +``` + +I also added the following entries for the three FreeBSD boxes to the `/etc/hosts` file: + +```sh +root@f0:~ # cat <<END >>/etc/hosts +192.168.1.130 f0 f0.lan f0.lan.buetow.org +192.168.1.131 f1 f1.lan f1.lan.buetow.org +192.168.1.132 f2 f2.lan f2.lan.buetow.org +END +``` + +You might wonder why bother using the hosts file? Why not use DNS properly? The reason is simplicity. I don't manage 100 hosts, only a few here and there. Having an OpenWRT router in my home, I could also configure everything there, but maybe I'll do that later. For now, keep it simple and straightforward. + +## After install + +After that, I installed the following additional packages: + +```sh +root@f0:~ # pkg install helix doas zfs-periodic uptimed +``` + +### Helix editor + +Helix? It's my favourite text editor. I have nothing against `vi` but like `hx` (Helix) more! + +=> https://helix-editor.com/ + +### `doas` + +`doas`? It's a pretty neat (and KISS) replacement for `sudo`. It has far fewer features than `sudo`, which is supposed to make it more secure. Its origin is the OpenBSD project. For `doas`, I accepted the default configuration (where users in the `wheel` group are allowed to run commands as `root`): + +```sh +root@f0:~ # cp /usr/local/etc/doas.conf.sample /usr/local/etc/doas.conf +``` + +=> https://man.openbsd.org/doas + +### Periodic ZFS snapshotting + +`zfs-periodic` is a nifty tool for automatically creating ZFS snapshots. I decided to go with the following configuration here: + +```sh +root@f0:~ # cat <<END >>/etc/periodic.conf +daily_zfs_snapshot_enable="YES" +daily_zfs_snapshot_pools="zroot" +daily_zfs_snapshot_keep="7" +weekly_zfs_snapshot_enable="YES" +weekly_zfs_snapshot_pools="zroot" +weekly_zfs_snapshot_keep="5" +monthly_zfs_snapshot_enable="YES" +monthly_zfs_snapshot_pools="zroot" +monthly_zfs_snapshot_keep="6" +END +``` + +=> https://github.com/ross/zfs-periodic + +### Uptime tracking + +`uptimed`? I like to track my uptimes. This is how I configured the daemon: + +```sh +root@f0:~ # cp /usr/local/mimecast/etc/uptimed.conf-dist \ + /usr/local/mimecast/etc/uptimed.conf +root@f0:~ # hx /usr/local/mimecast/etc/uptimed.conf +``` + +In the Helix editor session, I changed `LOG_MAXIMUM_ENTRIES` to `0` to keep all uptime entries forever and not cut off at 50 (the default config). After that, I enabled and started `uptimed`: + +```sh +root@f0:~ # service uptimed enable +root@f0:~ # service uptimed start +``` + +To check the current uptime stats, I can now run `uprecords`: + +```sh + root@f0:~ # uprecords + # Uptime | System Boot up +----------------------------+--------------------------------------------------- +-> 1 0 days, 00:07:34 | FreeBSD 14.1-RELEASE Mon Dec 2 12:21:44 2024 +----------------------------+--------------------------------------------------- +NewRec 0 days, 00:07:33 | since Mon Dec 2 12:21:44 2024 + up 0 days, 00:07:34 | since Mon Dec 2 12:21:44 2024 + down 0 days, 00:00:00 | since Mon Dec 2 12:21:44 2024 + %up 100.000 | since Mon Dec 2 12:21:44 2024 +``` + +This is how I track the uptimes for all of my host: + +=> ./2023-05-01-unveiling-guprecords:-uptime-records-with-raku.gmi Unveiling `guprecords.raku`: Global Uptime Records with Raku- +=> https://github.com/rpodgorny/uptimed + +# Hardware check + +## Ethernet + +Works. Nothing eventful, really. It's a cheap Realtek chip, but it will do what it is supposed to do. + +```sh +paul@f0:~ % ifconfig re0 +re0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 + options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE> + ether e8:ff:1e:d7:1c:ac + inet 192.168.1.130 netmask 0xffffff00 broadcast 192.168.1.255 + inet6 fe80::eaff:1eff:fed7:1cac%re0 prefixlen 64 scopeid 0x1 + inet6 fd22:c702:acb7:0:eaff:1eff:fed7:1cac prefixlen 64 detached autoconf + inet6 2a01:5a8:304:1d5c:eaff:1eff:fed7:1cac prefixlen 64 autoconf pltime 10800 vltime 14400 + media: Ethernet autoselect (1000baseT <full-duplex>) + status: active + nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL> +``` + +## RAM + +All there: + +```sh +paul@f0:~ % sysctl hw.physmem +hw.physmem: 16902905856 + +``` + +## CPUs + +They work: + +```sh +paul@f0:~ % sysctl dev.cpu | grep freq: +dev.cpu.3.freq: 705 +dev.cpu.2.freq: 705 +dev.cpu.1.freq: 604 +dev.cpu.0.freq: 604 +``` + +## CPU throttling + +With `powerd` running, CPU freq is dowthrottled when the box isn't jam-packed. To stress it a bit, I run `ubench` to see the frequencies being unthrottled again: + +```sh +paul@f0:~ % doas pkg install ubench +paul@f0:~ % rehash # For tcsh to find the newly installed command +paul@f0:~ % ubench & +paul@f0:~ % sysctl dev.cpu | grep freq: +dev.cpu.3.freq: 2922 +dev.cpu.2.freq: 2922 +dev.cpu.1.freq: 2923 +dev.cpu.0.freq: 2922 +``` + +Idle, all three Beelinks plus the switch consumed 26.2W. But with `ubench` stressing all the CPUs, it went up to 38.8W. + +=> ./f3s-kubernetes-with-freebsd-part-2/watt.jpg Idle consumption. + +# Conclusion + +The Beelink S12 Pro with Intel N100 CPUs checks all the boxes for a k3s project: Compact, efficient, expandable, and affordable. Its compatibility with both Linux and FreeBSD makes it versatile for other use cases, whether as part of your cluster or as a standalone system. If you’re looking for hardware that punches above its weight for Kubernetes, this little device deserves a spot on your shortlist. + +=> ./f3s-kubernetes-with-freebsd-part-2/3beelinks.jpg Beelinks stacked + +To ease cable management, I need to get shorter ethernet cables. I will place the tower on my shelf, where most of the cables will be hidden (together with a UPS, which will also be added to the setup). + +Read the next post of this series: + +=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts + +Other *BSD-related posts: + +=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts +=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation (You are currently reading this) +=> ./2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi 2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage +=> ./2024-04-01-KISS-high-availability-with-OpenBSD.gmi 2024-04-01 KISS high-availability with OpenBSD +=> ./2024-01-13-one-reason-why-i-love-openbsd.gmi 2024-01-13 One reason why I love OpenBSD +=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD +=> ./2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi 2022-07-30 Let's Encrypt with OpenBSD and Rex +=> ./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi 2016-04-09 Jails and ZFS with Puppet on FreeBSD + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi.tpl b/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi.tpl new file mode 100644 index 00000000..cf64719d --- /dev/null +++ b/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi.tpl @@ -0,0 +1,283 @@ +# f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation + +> Published at 2024-12-02T23:48:21+02:00 + +This is the second 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 I will use on FreeBSD-based physical machines. + +We set the stage last time; this time, we will set up the hardware for this project. + +These are all the posts so far: + +<< template::inline::rindex f3s + +=> ./f3s-kubernetes-with-freebsd-part-1/f3slogo.png f3s logo + +> Logo was generated by ChatGPT. + +Let's continue... + +<< template::inline::toc + +# Deciding on the hardware + +Note that the OpenBSD VMs included in the f3s setup (which will be used later in this blog series for internet ingress - as you know from the first part of this blog series) are already there. These are virtual machines that I rent at OpenBSD Amsterdam and Hetzner. + +=> https://openbsd.amsterdam +=> https://hetzner.cloud + +This means that the FreeBSD boxes need to be covered, which will later be running k3s in Linux VMs via bhyve hypervisor. + +I've been considering whether to use Raspberry Pis or look for alternatives. It turns out that complete N100-based mini-computers aren't much more expensive than Raspberry Pi 5s, and they don't require assembly. Furthermore, I like that they are AMD64 and not ARM-based, which increases compatibility with some applications (e.g., I might want to virtualize Windows (via bhyve) on one of those, though that's out of scope for this blog series). + +## Not ARM but Intel N100 + +I needed something compact, efficient, and capable enough to handle the demands of a small-scale Kubernetes cluster and preferably something I don't have to assemble a lot. After researching, I decided on the Beelink S12 Pro with Intel N100 CPUs. + +=> https://www.bee-link.com/products/beelink-mini-s12-pro-n100 Beelink Mini S12 Pro N100 official page + +The Intel N100 CPUs are built on the "Alder Lake-N" architecture. These chips are designed to balance performance and energy efficiency well. With four cores, they're more than capable of running multiple containers, even with moderate workloads. Plus, they consume only around 8W of power (ok, that's more than the Pis...), keeping the electricity bill low enough and the setup quiet - perfect for 24/7 operation. + +=> ./f3s-kubernetes-with-freebsd-part-2/f3s-collage1.jpg Beelink preparation + +The Beelink comes with the following specs: + +* 12th Gen Intel N100 processor, with four cores and four threads, and a maximum frequency of up to 3.4 GHz. +* 16 GB of DDR4 RAM, with a maximum (official) size of 16 GB (but people could install 32 GB on it). +* 500 GB M.2 SSD, with the option to install a 2nd 2.5 SSD drive (which I want to make use of later in this blog series). +* GBit ethernet +* Four USB 3.2 Gen2 ports (maybe I want to mount something externally at some point) +* Dimensions and weight: 115*102*39mm, 280g +* Silent cooling system. +* HDMI output (needed only for the initial installation and maybe for troubleshooting later) +* Auto power on via WoL (may make use of it) +* Wi-Fi (not going to use it) + +I bought three (3) of them for the cluster I intend to build. + +## Beelink unboxing + +Unboxing was uneventful. Every Beelink PC came with: + +* An AC power adapter +* An HDMI cable +* A VESA mount with screws (not using it as of now) +* Some manuals +* The pre-assembled Beelink PC itself. +* A "Hello" post card (??) + +Overall, I love the small form factor. + +## Network switch + +I went with the tp-link mini 5-port switch, as I had a spare one available. That switch will be plugged into my wall ethernet port, which connects directly to my fiber internet router with 100 Mbit/s down and 50 Mbit/s upload speed. + +=> ./f3s-kubernetes-with-freebsd-part-2/switch.jpg Switch + +# Installing FreeBSD + +## Base install + +First, I downloaded the boot-only ISO of the latest FreeBSD release and dumped it on a USB stick via my Fedora laptop: + +```sh +[paul@earth]~/Downloads% sudo dd \ + if=FreeBSD-14.1-RELEASE-amd64-bootonly.iso \ + of=/dev/sda conv=sync +``` + +Next, I plugged the Beelinks (one after another) into my monitor via HDMI (the resolution of the FreeBSD text console seems strangely stretched, as I am using the LG Dual Up monitor), connected Ethernet, an external USB keyboard, and the FreeBSD USB stick, and booted the devices up. With F7, I entered the boot menu and selected the USB stick for the FreeBSD installation. + +The installation was uneventful. I selected: + +* Guided ZFS on root (pool `zroot`) +* Unencrypted ZFS (I will encrypt separate datasets later; I want it to be able to boot without manual interaction) +* Static IP configuration (to ensure that the boxes always have the same IPs, even after switching the router/DHCP server) +* I decided to enable the SSH daemon, NTP server, and NTP time synchronization at boot, and I also enabled `powerd` for automatic CPU frequency scaling. +* In addition to `root,` I added a personal user, `paul,` whom I placed in the `wheel` group. + +After doing all that three times (once for each Beelink PC), I had three ready-to-use FreeBSD boxes! Their hostnames are `f0`, `f1` and `f2`! + +=> ./f3s-kubernetes-with-freebsd-part-2/f3s-collage2.jpg Beelink installation + +## Latest patch level and customizing `/etc/hosts` + +After the first boot, I upgraded to the latest FreeBSD patch level as follows: + +```sh +root@f0:~ # freebsd-update fetch +root@f0:~ # freebsd-update install +root@f0:~ # freebsd-update reboot +``` + +I also added the following entries for the three FreeBSD boxes to the `/etc/hosts` file: + +```sh +root@f0:~ # cat <<END >>/etc/hosts +192.168.1.130 f0 f0.lan f0.lan.buetow.org +192.168.1.131 f1 f1.lan f1.lan.buetow.org +192.168.1.132 f2 f2.lan f2.lan.buetow.org +END +``` + +You might wonder why bother using the hosts file? Why not use DNS properly? The reason is simplicity. I don't manage 100 hosts, only a few here and there. Having an OpenWRT router in my home, I could also configure everything there, but maybe I'll do that later. For now, keep it simple and straightforward. + +## After install + +After that, I installed the following additional packages: + +```sh +root@f0:~ # pkg install helix doas zfs-periodic uptimed +``` + +### Helix editor + +Helix? It's my favourite text editor. I have nothing against `vi` but like `hx` (Helix) more! + +=> https://helix-editor.com/ + +### `doas` + +`doas`? It's a pretty neat (and KISS) replacement for `sudo`. It has far fewer features than `sudo`, which is supposed to make it more secure. Its origin is the OpenBSD project. For `doas`, I accepted the default configuration (where users in the `wheel` group are allowed to run commands as `root`): + +```sh +root@f0:~ # cp /usr/local/etc/doas.conf.sample /usr/local/etc/doas.conf +``` + +=> https://man.openbsd.org/doas + +### Periodic ZFS snapshotting + +`zfs-periodic` is a nifty tool for automatically creating ZFS snapshots. I decided to go with the following configuration here: + +```sh +root@f0:~ # cat <<END >>/etc/periodic.conf +daily_zfs_snapshot_enable="YES" +daily_zfs_snapshot_pools="zroot" +daily_zfs_snapshot_keep="7" +weekly_zfs_snapshot_enable="YES" +weekly_zfs_snapshot_pools="zroot" +weekly_zfs_snapshot_keep="5" +monthly_zfs_snapshot_enable="YES" +monthly_zfs_snapshot_pools="zroot" +monthly_zfs_snapshot_keep="6" +END +``` + +=> https://github.com/ross/zfs-periodic + +### Uptime tracking + +`uptimed`? I like to track my uptimes. This is how I configured the daemon: + +```sh +root@f0:~ # cp /usr/local/mimecast/etc/uptimed.conf-dist \ + /usr/local/mimecast/etc/uptimed.conf +root@f0:~ # hx /usr/local/mimecast/etc/uptimed.conf +``` + +In the Helix editor session, I changed `LOG_MAXIMUM_ENTRIES` to `0` to keep all uptime entries forever and not cut off at 50 (the default config). After that, I enabled and started `uptimed`: + +```sh +root@f0:~ # service uptimed enable +root@f0:~ # service uptimed start +``` + +To check the current uptime stats, I can now run `uprecords`: + +```sh + root@f0:~ # uprecords + # Uptime | System Boot up +----------------------------+--------------------------------------------------- +-> 1 0 days, 00:07:34 | FreeBSD 14.1-RELEASE Mon Dec 2 12:21:44 2024 +----------------------------+--------------------------------------------------- +NewRec 0 days, 00:07:33 | since Mon Dec 2 12:21:44 2024 + up 0 days, 00:07:34 | since Mon Dec 2 12:21:44 2024 + down 0 days, 00:00:00 | since Mon Dec 2 12:21:44 2024 + %up 100.000 | since Mon Dec 2 12:21:44 2024 +``` + +This is how I track the uptimes for all of my host: + +=> ./2023-05-01-unveiling-guprecords:-uptime-records-with-raku.gmi Unveiling `guprecords.raku`: Global Uptime Records with Raku- +=> https://github.com/rpodgorny/uptimed + +# Hardware check + +## Ethernet + +Works. Nothing eventful, really. It's a cheap Realtek chip, but it will do what it is supposed to do. + +```sh +paul@f0:~ % ifconfig re0 +re0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 + options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE> + ether e8:ff:1e:d7:1c:ac + inet 192.168.1.130 netmask 0xffffff00 broadcast 192.168.1.255 + inet6 fe80::eaff:1eff:fed7:1cac%re0 prefixlen 64 scopeid 0x1 + inet6 fd22:c702:acb7:0:eaff:1eff:fed7:1cac prefixlen 64 detached autoconf + inet6 2a01:5a8:304:1d5c:eaff:1eff:fed7:1cac prefixlen 64 autoconf pltime 10800 vltime 14400 + media: Ethernet autoselect (1000baseT <full-duplex>) + status: active + nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL> +``` + +## RAM + +All there: + +```sh +paul@f0:~ % sysctl hw.physmem +hw.physmem: 16902905856 + +``` + +## CPUs + +They work: + +```sh +paul@f0:~ % sysctl dev.cpu | grep freq: +dev.cpu.3.freq: 705 +dev.cpu.2.freq: 705 +dev.cpu.1.freq: 604 +dev.cpu.0.freq: 604 +``` + +## CPU throttling + +With `powerd` running, CPU freq is dowthrottled when the box isn't jam-packed. To stress it a bit, I run `ubench` to see the frequencies being unthrottled again: + +```sh +paul@f0:~ % doas pkg install ubench +paul@f0:~ % rehash # For tcsh to find the newly installed command +paul@f0:~ % ubench & +paul@f0:~ % sysctl dev.cpu | grep freq: +dev.cpu.3.freq: 2922 +dev.cpu.2.freq: 2922 +dev.cpu.1.freq: 2923 +dev.cpu.0.freq: 2922 +``` + +Idle, all three Beelinks plus the switch consumed 26.2W. But with `ubench` stressing all the CPUs, it went up to 38.8W. + +=> ./f3s-kubernetes-with-freebsd-part-2/watt.jpg Idle consumption. + +# Conclusion + +The Beelink S12 Pro with Intel N100 CPUs checks all the boxes for a k3s project: Compact, efficient, expandable, and affordable. Its compatibility with both Linux and FreeBSD makes it versatile for other use cases, whether as part of your cluster or as a standalone system. If you’re looking for hardware that punches above its weight for Kubernetes, this little device deserves a spot on your shortlist. + +=> ./f3s-kubernetes-with-freebsd-part-2/3beelinks.jpg Beelinks stacked + +To ease cable management, I need to get shorter ethernet cables. I will place the tower on my shelf, where most of the cables will be hidden (together with a UPS, which will also be added to the setup). + +Read the next post of this series: + +=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts + +Other *BSD-related posts: + +<< template::inline::rindex bsd + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2024-12-15-random-helix-themes.gmi b/gemfeed/2024-12-15-random-helix-themes.gmi new file mode 100644 index 00000000..1c062c34 --- /dev/null +++ b/gemfeed/2024-12-15-random-helix-themes.gmi @@ -0,0 +1,92 @@ +# Random Helix Themes + +> Published at 2024-12-15T13:55:05+02:00; Last updated 2024-12-18 + +I thought it would be fun to have a random Helix theme every time I open a new shell. Helix is the text editor I use. + +=> https://helix-editor.com/ + +So I put this into my `zsh` dotfiles (in some `editor.zsh.source` in my `~` directory): + +```sh +export EDITOR=hx +export VISUAL=$EDITOR +export GIT_EDITOR=$EDITOR +export HELIX_CONFIG_DIR=$HOME/.config/helix + +editor::helix::random_theme () { + # May add more theme search paths based on OS. This one is + # for Fedora Linux, but there is also MacOS, etc. + local -r theme_dir=/usr/share/helix/runtime/themes + if [ ! -d $theme_dir ]; then + echo "Helix theme dir $theme_dir doesnt exist" + return 1 + fi + + local -r config_file=$HELIX_CONFIG_DIR/config.toml + local -r random_theme="$(basename "$(ls $theme_dir \ + | grep -v random.toml | grep .toml | sort -R \ + | head -n 1)" | cut -d. -f1)" + + sed "/^theme =/ { s/.*/theme = \"$random_theme\"/; }" \ + $config_file > $config_file.tmp && + mv $config_file.tmp $config_file +} + +if [ -f $HELIX_CONFIG_DIR/config.toml ]; then + editor::helix::random_theme +fi +``` + +So every time I open a new terminal or shell, `editor::helix::random_theme` gets called, which randomly selects a theme from all installed ones and updates the helix config accordingly. + +```sh +[paul@earth] ~ % editor::helix::random_theme +[paul@earth] ~ % head -n 1 ~/.config/helix/config.toml +theme = "jellybeans" +[paul@earth] ~ % editor::helix::random_theme +[paul@earth] ~ % head -n 1 ~/.config/helix/config.toml +theme = "rose_pine" +[paul@earth] ~ % editor::helix::random_theme +[paul@earth] ~ % head -n 1 ~/.config/helix/config.toml +theme = "noctis" +[paul@earth] ~ % +``` + +## A better version + +> Update 2024-12-18: This is an improved version, which works cross platform (e.g., also on MacOS) and multiple theme directories: + +```sh +export EDITOR=hx +export VISUAL=$EDITOR +export GIT_EDITOR=$EDITOR +export HELIX_CONFIG_DIR=$HOME/.config/helix + +editor::helix::theme::get_random () { + for dir in $(hx --health \ + | awk '/^Runtime directories/ { print $3 }' | tr ';' ' '); do + if [ -d $dir/themes ]; then + ls $dir/themes + fi + done | grep -F .toml | sort -R | head -n 1 | cut -d. -f1 +} + +editor::helix::theme::set () { + local -r theme="$1"; shift + + local -r config_file=$HELIX_CONFIG_DIR/config.toml + + sed "/^theme =/ { s/.*/theme = \"$theme\"/; }" \ + $config_file > $config_file.tmp && + mv $config_file.tmp $config_file +} + +if [ -f $HELIX_CONFIG_DIR/config.toml ]; then + editor::helix::theme::set $(editor::helix::theme::get_random) +fi +``` + +I hope you had some fun. E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2025-01-01-posts-from-october-to-december-2024.gmi b/gemfeed/2025-01-01-posts-from-october-to-december-2024.gmi new file mode 100644 index 00000000..05f33513 --- /dev/null +++ b/gemfeed/2025-01-01-posts-from-october-to-december-2024.gmi @@ -0,0 +1,337 @@ +# Posts from October to December 2024 + +> Published at 2024-12-31T18:09:58+02:00 + +Happy new year! + +These are my social media posts from the last three months. I keep them here to reflect on them and also to not lose them. Social media networks come and go and are not under my control, but my domain is here to stay. + +These are from Mastodon and LinkedIn. Have a look at my about page for my social media profiles. This list is generated with Gos, my social media platform sharing tool. + +=> ../about/index.gmi My about page +=> https://codeberg.org/snonux/gos + +## Table of Contents + +* ⇢ Posts from October to December 2024 +* ⇢ Posts for 202410 202411 202412 +* ⇢ ⇢ October 2024 +* ⇢ ⇢ ⇢ First on-call experience in a startup. Doesn't ... +* ⇢ ⇢ ⇢ Reviewing your own PR or MR before asking ... +* ⇢ ⇢ ⇢ Fun with defer in `#golang`, I did't know, that ... +* ⇢ ⇢ ⇢ I have been in incidents. Understandably, ... +* ⇢ ⇢ ⇢ Little tips using strings in `#golang` and I ... +* ⇢ ⇢ ⇢ Reading this post about `#rust` (especially the ... +* ⇢ ⇢ ⇢ The opposite of `#ChaosMonkey` ... ... +* ⇢ ⇢ November 2024 +* ⇢ ⇢ ⇢ I just became a Silver Patreon for OSnews. What ... +* ⇢ ⇢ ⇢ Until now, I wasn't aware, that Go is under a ... +* ⇢ ⇢ ⇢ These are some book notes from "Staff Engineer" ... +* ⇢ ⇢ ⇢ Looking at `#Kubernetes`, it's pretty much ... +* ⇢ ⇢ ⇢ There has been an outage at the upstream ... +* ⇢ ⇢ ⇢ One of the more confusing parts in Go, nil ... +* ⇢ ⇢ ⇢ Agreeably, writing down with Diagrams helps you ... +* ⇢ ⇢ ⇢ I like the idea of types in Ruby. Raku is ... +* ⇢ ⇢ ⇢ So, `#Haskell` is better suited for general ... +* ⇢ ⇢ ⇢ At first, functional options add a bit of ... +* ⇢ ⇢ ⇢ Revamping my home lab a little bit. `#freebsd` ... +* ⇢ ⇢ ⇢ Wondering to which `#web` `#browser` I should ... +* ⇢ ⇢ ⇢ eks-node-viewer is a nifty tool, showing the ... +* ⇢ ⇢ ⇢ Have put more Photos on - On my static photo ... +* ⇢ ⇢ ⇢ In Go, passing pointers are not automatically ... +* ⇢ ⇢ ⇢ Myself being part of an on-call rotations over ... +* ⇢ ⇢ ⇢ Feels good to code in my old love `#Perl` again ... +* ⇢ ⇢ ⇢ This is an interactive summary of the Go ... +* ⇢ ⇢ December 2024 +* ⇢ ⇢ ⇢ Thats unexpected, you cant remove a NaN key ... +* ⇢ ⇢ ⇢ My second blog post about revamping my home lab ... +* ⇢ ⇢ ⇢ Very insightful article about tech hiring in ... +* ⇢ ⇢ ⇢ for `#bpf` `#ebpf` performance debugging, have ... +* ⇢ ⇢ ⇢ 89 things he/she knows about Git commits is a ... +* ⇢ ⇢ ⇢ I found that working on multiple side projects ... +* ⇢ ⇢ ⇢ Agreed? Agreed. Besides `#Ruby`, I would also ... +* ⇢ ⇢ ⇢ Plan9 assembly format in Go, but wait, it's not ... +* ⇢ ⇢ ⇢ This is a neat blog post about the Helix text ... +* ⇢ ⇢ ⇢ This blog post is basically a rant against ... +* ⇢ ⇢ ⇢ Quick trick to get Helix themes selected ... +* ⇢ ⇢ ⇢ Example where complexity attacks you from ... +* ⇢ ⇢ ⇢ LLMs for Ops? Summaries of logs, probabilities ... +* ⇢ ⇢ ⇢ Excellent article about your dream Product ... +* ⇢ ⇢ ⇢ I just finished reading all chapters of CPU ... +* ⇢ ⇢ ⇢ Indeed, useful to know this stuff! `#sre` ... +* ⇢ ⇢ ⇢ It's the small things, which make Unix like ... +* ⇢ ⇢ ⇢ My New Year's resolution is not to start any ... + +# Posts for 202410 202411 202412 + +## October 2024 + +### First on-call experience in a startup. Doesn't ... + +First on-call experience in a startup. Doesn't sound a lot of fun! But the lessons were learned! `#sre` + +=> https://ntietz.com/blog/lessons-from-my-first-on-call/ ntietz.com/blog/lessons-from-my-first-on-call/ + +### Reviewing your own PR or MR before asking ... + +Reviewing your own PR or MR before asking others to review it makes a lot of sense. Have seen so many silly mistakes which would have been avoided. Saving time for the real reviewer. + +=> https://www.jvt.me/posts/2019/01/12/self-code-review/ www.jvt.me/posts/2019/01/12/self-code-review/ + +### Fun with defer in `#golang`, I did't know, that ... + +Fun with defer in `#golang`, I did't know, that a defer object can either be heap or stack allocated. And there are some rules for inlining, too. + +=> https://victoriametrics.com/blog/defer-in-go/ victoriametrics.com/blog/defer-in-go/ + +### I have been in incidents. Understandably, ... + +I have been in incidents. Understandably, everyone wants the issue to be resolved as quickly and others want to know how long TTR will be. IMHO, providing no estimates at all is no solution either. So maybe give a rough estimate but clearly communicate that the estimate is rough and that X, Y, and Z can interfere, meaning there is a chance it will take longer to resolve the incident. Just my thought. What's yours? + +=> https://firehydrant.com/blog/hot-take-dont-provide-incident-resolution-estimates/ firehydrant.com/blog/hot-take-dont-provide-incident-resolution-estimates/ + +### Little tips using strings in `#golang` and I ... + +Little tips using strings in `#golang` and I personally think one must look more into the std lib (not just for strings, also for slices, maps,...), there are tons of useful helper functions. + +=> https://www.calhoun.io/6-tips-for-using-strings-in-go/ www.calhoun.io/6-tips-for-using-strings-in-go/ + +### Reading this post about `#rust` (especially the ... + +Reading this post about `#rust` (especially the first part), I think I made a good choice in deciding to dive into `#golang` instead. There was a point where I wanted to learn a new programming language, and Rust was on my list of choices. I think the Go project does a much better job of deciding what goes into the language and how. What are your thoughts? + +=> https://josephg.com/blog/rewriting-rust/ josephg.com/blog/rewriting-rust/ + +### The opposite of `#ChaosMonkey` ... ... + +The opposite of `#ChaosMonkey` ... automatically repairing and healing services helping to reduce manual toil work. Runbooks and scripts are only the first step, followed by a fully blown service written in Go. Could be useful, but IMHO why not rather address the root causes of the manual toil work? `#sre` + +=> https://blog.cloudflare.com/nl-nl/improving-platform-resilience-at-cloudflare/ blog.cloudflare.com/nl-nl/improving-platform-resilience-at-cloudflare/ + +## November 2024 + +### I just became a Silver Patreon for OSnews. What ... + +I just became a Silver Patreon for OSnews. What is OSnews? It is an independent news site about IT. It is slightly independent and, at times, alternative. I have enjoyed it since my early student days. This one and other projects I financially support are listed here: + +=> gemini://foo.zone/gemfeed/2024-09-07-projects-i-support.gmi foo.zone/gemfeed/2024-09-07-projects-i-support.gmi (Gemini) +=> https://foo.zone/gemfeed/2024-09-07-projects-i-support.html foo.zone/gemfeed/2024-09-07-projects-i-support.html + +### Until now, I wasn't aware, that Go is under a ... + +Until now, I wasn't aware, that Go is under a BSD-style license (3-clause as it seems). Neat. I don't know why, but I always was under the impression it would be MIT. `#bsd` `#golang` + +=> https://go.dev/LICENSE go.dev/LICENSE + +### These are some book notes from "Staff Engineer" ... + +These are some book notes from "Staff Engineer" – there is some really good insight into what is expected from a Staff Engineer and beyond in the industry. I wish I had read the book earlier. + +=> gemini://foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.gmi foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.gmi (Gemini) +=> https://foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.html foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.html + +### Looking at `#Kubernetes`, it's pretty much ... + +Looking at `#Kubernetes`, it's pretty much following the Unix way of doing things. It has many tools, but each tool has its own single purpose: DNS, scheduling, container runtime, various controllers, networking, observability, alerting, and more services in the control plane. Everything is managed by different services or plugins, mostly running in their dedicated pods. They don't communicate through pipes, but network sockets, though. `#k8s` + +### There has been an outage at the upstream ... + +There has been an outage at the upstream network provider for OpenBSD.Amsterdam (hoster, I am using). This was the first real-world test for my KISS HA setup, and it worked flawlessly! All my sites and services failed over automatically to my other `#OpenBSD` VM! + +=> gemini://foo.zone/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi foo.zone/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi (Gemini) +=> https://foo.zone/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.html foo.zone/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.html +=> https://openbsd.amsterdam/ openbsd.amsterdam/ + +### One of the more confusing parts in Go, nil ... + +One of the more confusing parts in Go, nil values vs nil errors: `#golang` + +=> https://unexpected-go.com/nil-errors-that-are-non-nil-errors.html unexpected-go.com/nil-errors-that-are-non-nil-errors.html + +### Agreeably, writing down with Diagrams helps you ... + +Agreeably, writing down with Diagrams helps you to think things more through. And keeps others on the same page. Only worth for projects from a certain size, IMHO. + +=> https://ntietz.com/blog/reasons-to-write-design-docs/ ntietz.com/blog/reasons-to-write-design-docs/ + +### I like the idea of types in Ruby. Raku is ... + +I like the idea of types in Ruby. Raku is supports that already, but in Ruby, you must specify the types in a separate .rbs file, which is, in my opinion, cumbersome and is a reason not to use it extensively for now. I believe there are efforts to embed the type information in the standard .rb files, and that the .rbs is just an experiment to see how types could work out without introducing changes into the core Ruby language itself right now? `#Ruby` `#RakuLang` + +=> https://github.com/ruby/rbs github.com/ruby/rbs + +### So, `#Haskell` is better suited for general ... + +So, `#Haskell` is better suited for general purpose than `#Rust`? I thought deploying something in Haskell means publishing an academic paper :-) Interesting rant about Rust, though: + +=> https://chrisdone.com/posts/rust/ chrisdone.com/posts/rust/ + +### At first, functional options add a bit of ... + +At first, functional options add a bit of boilerplate, but they turn out to be quite neat, especially when you have very long parameter lists that need to be made neat and tidy. `#golang` + +=> https://www.calhoun.io/using-functional-options-instead-of-method-chaining-in-go/ www.calhoun.io/using-functional-options-instead-of-method-chaining-in-go/ + +### Revamping my home lab a little bit. `#freebsd` ... + +Revamping my home lab a little bit. `#freebsd` `#bhyve` `#rocky` `#linux` `#vm` `#k3s` `#kubernetes` `#wireguard` `#zfs` `#nfs` `#ha` `#relayd` `#k8s` `#selfhosting` `#homelab` + +=> gemini://foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi (Gemini) +=> https://foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.html foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.html + +### Wondering to which `#web` `#browser` I should ... + +Wondering to which `#web` `#browser` I should switch now personally ... + +=> https://www.osnews.com/story/141100/mozilla-foundation-lays-off-30-of-its-employees-ends-advocacy-for-open-web-privacy-and-more/ www.osnews.com/story/141100/mozilla-fo..-..dvocacy-for-open-web-privacy-and-more/ + +### eks-node-viewer is a nifty tool, showing the ... + +eks-node-viewer is a nifty tool, showing the compute nodes currently in use in the `#EKS` cluster. especially useful when dynamically allocating nodes with `#karpenter` or auto scaling groups. + +=> https://github.com/awslabs/eks-node-viewer github.com/awslabs/eks-node-viewer + +### Have put more Photos on - On my static photo ... + +Have put more Photos on - On my static photo sites - Generated with a `#bash` script + +=> https://irregular.ninja irregular.ninja + +### In Go, passing pointers are not automatically ... + +In Go, passing pointers are not automatically faster than values. Pointers often force the memory to be allocated on the heap, adding GC overhad. With values, Go can determine whether to put the memory on the stack instead. But with large structs/objects (how you want to call them) or if you want to modify state, then pointers are the semantic to use. `#golang` + +=> https://blog.boot.dev/golang/pointers-faster-than-values/ blog.boot.dev/golang/pointers-faster-than-values/ + +### Myself being part of an on-call rotations over ... + +Myself being part of an on-call rotations over my whole professional life, just have learned this lesson "Tell people who are new to on-call: Just have fun" :-) This is a neat blog post to read: + +=> https://ntietz.com/blog/what-i-tell-people-new-to-oncall/ ntietz.com/blog/what-i-tell-people-new-to-oncall/ + +### Feels good to code in my old love `#Perl` again ... + +Feels good to code in my old love `#Perl` again after a while. I am implementing a log parser for generating site stats of my personal homepage! :-) @Perl + +### This is an interactive summary of the Go ... + +This is an interactive summary of the Go release, with a lot of examples utilising iterators in the slices and map packages. Love it! `#golang` + +=> https://antonz.org/go-1-23/ antonz.org/go-1-23/ + +## December 2024 + +### Thats unexpected, you cant remove a NaN key ... + +Thats unexpected, you cant remove a NaN key from a map without clearing it! `#golang` + +=> https://unexpected-go.com/you-cant-remove-a-nan-key-from-a-map-without-clearing-it.html unexpected-go.com/you-cant-remove-a-nan-key-from-a-map-without-clearing-it.html + +### My second blog post about revamping my home lab ... + +My second blog post about revamping my home lab a little bit just hit the net. `#FreeBSD` `#ZFS` `#n100` `#k8s` `#k3s` `#kubernetes` + +=> gemini://foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi (Gemini) +=> https://foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.html foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.html + +### Very insightful article about tech hiring in ... + +Very insightful article about tech hiring in the age of LLMs. As an interviewer, I have experienced some of the scrnarios already first hand... + +=> https://newsletter.pragmaticengineer.com/p/how-genai-changes-tech-hiring newsletter.pragmaticengineer.com/p/how-genai-changes-tech-hiring + +### for `#bpf` `#ebpf` performance debugging, have ... + +for `#bpf` `#ebpf` performance debugging, have a look at bpftop from Netflix. A neat tool showing you the estimated CPU time and other performance statistics for all the BPF programs currently loaded into the `#linux` kernel. Highly recommend! + +=> https://github.com/Netflix/bpftop github.com/Netflix/bpftop + +### 89 things he/she knows about Git commits is a ... + +89 things he/she knows about Git commits is a neat list of `#Git` wisdoms + +=> https://www.jvt.me/posts/2024/07/12/things-know-commits/ www.jvt.me/posts/2024/07/12/things-know-commits/ + +### I found that working on multiple side projects ... + +I found that working on multiple side projects concurrently is better than concentrating on just one. This seems inefficient at first, but whenever you tend to lose motivation, you can temporarily switch to another one with full élan. However, remember to stop starting and start finishing. This doesn't mean you should be working on 10+ (and a growing list of) side projects concurrently! Select your projects and commit to finishing them before starting the next thing. For example, my current limit of concurrent side projects is around five. + +### Agreed? Agreed. Besides `#Ruby`, I would also ... + +Agreed? Agreed. Besides `#Ruby`, I would also add `#RakuLang` and `#Perl` @Perl to the list of languages that are great for shell scripts - "Making Easy Things Easy and Hard Things Possible" + +=> https://lucasoshiro.github.io/posts-en/2024-06-17-ruby-shellscript/ lucasoshiro.github.io/posts-en/2024-06-17-ruby-shellscript/ + +### Plan9 assembly format in Go, but wait, it's not ... + +Plan9 assembly format in Go, but wait, it's not the Operating System Plan9! `#golang` `#rabbithole` + +=> https://www.osnews.com/story/140941/go-plan9-memo-speeding-up-calculations-450/ www.osnews.com/story/140941/go-plan9-memo-speeding-up-calculations-450/ + +### This is a neat blog post about the Helix text ... + +This is a neat blog post about the Helix text editor, to which I personally switched around a year ago (from NeoVim). I should blog about my experience as well. To summarize: I am using it together with the terminal multiplexer `#tmux`. It doesn't bother me that Helix is purely terminal-based and therefore everything has to be in the same font. `#HelixEditor` + +=> https://jonathan-frere.com/posts/helix/ jonathan-frere.com/posts/helix/ + +### This blog post is basically a rant against ... + +This blog post is basically a rant against DataDog... Personally, I don't have much experience with DataDog (actually, I have never used it), but one reason to work with logs at my day job (with over 2,000 physical server machines) and to be cost-effective is by using dtail! `#dtail` `#logs` `#logmanagement` + +=> https://crys.site/blog/2024/reinventint-the-weel/ crys.site/blog/2024/reinventint-the-weel/ +=> https://dtail.dev dtail.dev + +### Quick trick to get Helix themes selected ... + +Quick trick to get Helix themes selected randomly `#HelixEditor` + +=> gemini://foo.zone/gemfeed/2024-12-15-random-helix-themes.gmi foo.zone/gemfeed/2024-12-15-random-helix-themes.gmi (Gemini) +=> https://foo.zone/gemfeed/2024-12-15-random-helix-themes.html foo.zone/gemfeed/2024-12-15-random-helix-themes.html + +### Example where complexity attacks you from ... + +Example where complexity attacks you from behind `#k8s` `#kubernetes` `#OpenAI` + +=> https://surfingcomplexity.blog/2024/12/14/quick-takes-on-the-recent-openai-public-incident-write-up/ surfingcomplexity.blog/2024/12/14/quic..-..ecent-openai-public-incident-write-up/ + +### LLMs for Ops? Summaries of logs, probabilities ... + +LLMs for Ops? Summaries of logs, probabilities about correctness, auto-generating Ansible, some uses cases are there. Wouldn't trust it fully, though. + +=> https://youtu.be/WodaffxVq-E?si=noY0egrfl5izCSQI youtu.be/WodaffxVq-E?si=noY0egrfl5izCSQI + +### Excellent article about your dream Product ... + +Excellent article about your dream Product Manager: Why every software team needs a product manager to thrive via @wallabagapp + +=> https://testdouble.com/insights/why-product-managers-accelerate-improve-software-delivery testdouble.com/insights/why-product-ma..-..s-accelerate-improve-software-delivery + +### I just finished reading all chapters of CPU ... + +I just finished reading all chapters of CPU land: ... not claiming to remember every detail, but it is a great refresher how CPUs and operating systems actually work under the hood when you execute a program, which we tend to forget in our higher abstraction world. I liked the "story" and some of the jokes along the way! Size wise, it is pretty digestable (not talking about books, but only 7 web articles/chapters)! `#cpu` `#linux` `#unix` `#kernel` `#macOS` + +=> https://cpu.land/ cpu.land/ + +### Indeed, useful to know this stuff! `#sre` ... + +Indeed, useful to know this stuff! `#sre` + +=> https://biriukov.dev/docs/resolver-dual-stack-application/0-sre-should-know-about-gnu-linux-resolvers-and-dual-stack-applications/ biriukov.dev/docs/resolver-dual-stack-..-..resolvers-and-dual-stack-applications/ + +### It's the small things, which make Unix like ... + +It's the small things, which make Unix like systems, like GNU/Linux, interesting. Didn't know about this `#GNU` `#Tar` behaviour yet: + +=> https://xeiaso.net/notes/2024/pop-quiz-tar/ xeiaso.net/notes/2024/pop-quiz-tar/ + +### My New Year's resolution is not to start any ... + +My New Year's resolution is not to start any new non-fiction books (or only very few) but to re-read and listen to my favorites, which I read to reflect on and see things from different perspectives. Every time you re-read a book, you gain new insights.<nil>17491 + +Other related posts: + +=> ./2025-01-01-posts-from-october-to-december-2024.gmi 2025-01-01 Posts from October to December 2024 (You are currently reading this) + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2025-01-01-posts-from-october-to-december-2024.gmi.tpl b/gemfeed/2025-01-01-posts-from-october-to-december-2024.gmi.tpl new file mode 100644 index 00000000..66a8ea22 --- /dev/null +++ b/gemfeed/2025-01-01-posts-from-october-to-december-2024.gmi.tpl @@ -0,0 +1,288 @@ +# Posts from October to December 2024 + +> Published at 2024-12-31T18:09:58+02:00 + +Happy new year! + +These are my social media posts from the last three months. I keep them here to reflect on them and also to not lose them. Social media networks come and go and are not under my control, but my domain is here to stay. + +These are from Mastodon and LinkedIn. Have a look at my about page for my social media profiles. This list is generated with Gos, my social media platform sharing tool. + +=> ../about/index.gmi My about page +=> https://codeberg.org/snonux/gos + +<< template::inline::toc + +# Posts for 202410 202411 202412 + +## October 2024 + +### First on-call experience in a startup. Doesn't ... + +First on-call experience in a startup. Doesn't sound a lot of fun! But the lessons were learned! `#sre` + +=> https://ntietz.com/blog/lessons-from-my-first-on-call/ ntietz.com/blog/lessons-from-my-first-on-call/ + +### Reviewing your own PR or MR before asking ... + +Reviewing your own PR or MR before asking others to review it makes a lot of sense. Have seen so many silly mistakes which would have been avoided. Saving time for the real reviewer. + +=> https://www.jvt.me/posts/2019/01/12/self-code-review/ www.jvt.me/posts/2019/01/12/self-code-review/ + +### Fun with defer in `#golang`, I did't know, that ... + +Fun with defer in `#golang`, I did't know, that a defer object can either be heap or stack allocated. And there are some rules for inlining, too. + +=> https://victoriametrics.com/blog/defer-in-go/ victoriametrics.com/blog/defer-in-go/ + +### I have been in incidents. Understandably, ... + +I have been in incidents. Understandably, everyone wants the issue to be resolved as quickly and others want to know how long TTR will be. IMHO, providing no estimates at all is no solution either. So maybe give a rough estimate but clearly communicate that the estimate is rough and that X, Y, and Z can interfere, meaning there is a chance it will take longer to resolve the incident. Just my thought. What's yours? + +=> https://firehydrant.com/blog/hot-take-dont-provide-incident-resolution-estimates/ firehydrant.com/blog/hot-take-dont-provide-incident-resolution-estimates/ + +### Little tips using strings in `#golang` and I ... + +Little tips using strings in `#golang` and I personally think one must look more into the std lib (not just for strings, also for slices, maps,...), there are tons of useful helper functions. + +=> https://www.calhoun.io/6-tips-for-using-strings-in-go/ www.calhoun.io/6-tips-for-using-strings-in-go/ + +### Reading this post about `#rust` (especially the ... + +Reading this post about `#rust` (especially the first part), I think I made a good choice in deciding to dive into `#golang` instead. There was a point where I wanted to learn a new programming language, and Rust was on my list of choices. I think the Go project does a much better job of deciding what goes into the language and how. What are your thoughts? + +=> https://josephg.com/blog/rewriting-rust/ josephg.com/blog/rewriting-rust/ + +### The opposite of `#ChaosMonkey` ... ... + +The opposite of `#ChaosMonkey` ... automatically repairing and healing services helping to reduce manual toil work. Runbooks and scripts are only the first step, followed by a fully blown service written in Go. Could be useful, but IMHO why not rather address the root causes of the manual toil work? `#sre` + +=> https://blog.cloudflare.com/nl-nl/improving-platform-resilience-at-cloudflare/ blog.cloudflare.com/nl-nl/improving-platform-resilience-at-cloudflare/ + +## November 2024 + +### I just became a Silver Patreon for OSnews. What ... + +I just became a Silver Patreon for OSnews. What is OSnews? It is an independent news site about IT. It is slightly independent and, at times, alternative. I have enjoyed it since my early student days. This one and other projects I financially support are listed here: + +=> gemini://foo.zone/gemfeed/2024-09-07-projects-i-support.gmi foo.zone/gemfeed/2024-09-07-projects-i-support.gmi (Gemini) +=> https://foo.zone/gemfeed/2024-09-07-projects-i-support.html foo.zone/gemfeed/2024-09-07-projects-i-support.html + +### Until now, I wasn't aware, that Go is under a ... + +Until now, I wasn't aware, that Go is under a BSD-style license (3-clause as it seems). Neat. I don't know why, but I always was under the impression it would be MIT. `#bsd` `#golang` + +=> https://go.dev/LICENSE go.dev/LICENSE + +### These are some book notes from "Staff Engineer" ... + +These are some book notes from "Staff Engineer" – there is some really good insight into what is expected from a Staff Engineer and beyond in the industry. I wish I had read the book earlier. + +=> gemini://foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.gmi foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.gmi (Gemini) +=> https://foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.html foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.html + +### Looking at `#Kubernetes`, it's pretty much ... + +Looking at `#Kubernetes`, it's pretty much following the Unix way of doing things. It has many tools, but each tool has its own single purpose: DNS, scheduling, container runtime, various controllers, networking, observability, alerting, and more services in the control plane. Everything is managed by different services or plugins, mostly running in their dedicated pods. They don't communicate through pipes, but network sockets, though. `#k8s` + +### There has been an outage at the upstream ... + +There has been an outage at the upstream network provider for OpenBSD.Amsterdam (hoster, I am using). This was the first real-world test for my KISS HA setup, and it worked flawlessly! All my sites and services failed over automatically to my other `#OpenBSD` VM! + +=> gemini://foo.zone/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi foo.zone/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi (Gemini) +=> https://foo.zone/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.html foo.zone/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.html +=> https://openbsd.amsterdam/ openbsd.amsterdam/ + +### One of the more confusing parts in Go, nil ... + +One of the more confusing parts in Go, nil values vs nil errors: `#golang` + +=> https://unexpected-go.com/nil-errors-that-are-non-nil-errors.html unexpected-go.com/nil-errors-that-are-non-nil-errors.html + +### Agreeably, writing down with Diagrams helps you ... + +Agreeably, writing down with Diagrams helps you to think things more through. And keeps others on the same page. Only worth for projects from a certain size, IMHO. + +=> https://ntietz.com/blog/reasons-to-write-design-docs/ ntietz.com/blog/reasons-to-write-design-docs/ + +### I like the idea of types in Ruby. Raku is ... + +I like the idea of types in Ruby. Raku is supports that already, but in Ruby, you must specify the types in a separate .rbs file, which is, in my opinion, cumbersome and is a reason not to use it extensively for now. I believe there are efforts to embed the type information in the standard .rb files, and that the .rbs is just an experiment to see how types could work out without introducing changes into the core Ruby language itself right now? `#Ruby` `#RakuLang` + +=> https://github.com/ruby/rbs github.com/ruby/rbs + +### So, `#Haskell` is better suited for general ... + +So, `#Haskell` is better suited for general purpose than `#Rust`? I thought deploying something in Haskell means publishing an academic paper :-) Interesting rant about Rust, though: + +=> https://chrisdone.com/posts/rust/ chrisdone.com/posts/rust/ + +### At first, functional options add a bit of ... + +At first, functional options add a bit of boilerplate, but they turn out to be quite neat, especially when you have very long parameter lists that need to be made neat and tidy. `#golang` + +=> https://www.calhoun.io/using-functional-options-instead-of-method-chaining-in-go/ www.calhoun.io/using-functional-options-instead-of-method-chaining-in-go/ + +### Revamping my home lab a little bit. `#freebsd` ... + +Revamping my home lab a little bit. `#freebsd` `#bhyve` `#rocky` `#linux` `#vm` `#k3s` `#kubernetes` `#wireguard` `#zfs` `#nfs` `#ha` `#relayd` `#k8s` `#selfhosting` `#homelab` + +=> gemini://foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi (Gemini) +=> https://foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.html foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.html + +### Wondering to which `#web` `#browser` I should ... + +Wondering to which `#web` `#browser` I should switch now personally ... + +=> https://www.osnews.com/story/141100/mozilla-foundation-lays-off-30-of-its-employees-ends-advocacy-for-open-web-privacy-and-more/ www.osnews.com/story/141100/mozilla-fo..-..dvocacy-for-open-web-privacy-and-more/ + +### eks-node-viewer is a nifty tool, showing the ... + +eks-node-viewer is a nifty tool, showing the compute nodes currently in use in the `#EKS` cluster. especially useful when dynamically allocating nodes with `#karpenter` or auto scaling groups. + +=> https://github.com/awslabs/eks-node-viewer github.com/awslabs/eks-node-viewer + +### Have put more Photos on - On my static photo ... + +Have put more Photos on - On my static photo sites - Generated with a `#bash` script + +=> https://irregular.ninja irregular.ninja + +### In Go, passing pointers are not automatically ... + +In Go, passing pointers are not automatically faster than values. Pointers often force the memory to be allocated on the heap, adding GC overhad. With values, Go can determine whether to put the memory on the stack instead. But with large structs/objects (how you want to call them) or if you want to modify state, then pointers are the semantic to use. `#golang` + +=> https://blog.boot.dev/golang/pointers-faster-than-values/ blog.boot.dev/golang/pointers-faster-than-values/ + +### Myself being part of an on-call rotations over ... + +Myself being part of an on-call rotations over my whole professional life, just have learned this lesson "Tell people who are new to on-call: Just have fun" :-) This is a neat blog post to read: + +=> https://ntietz.com/blog/what-i-tell-people-new-to-oncall/ ntietz.com/blog/what-i-tell-people-new-to-oncall/ + +### Feels good to code in my old love `#Perl` again ... + +Feels good to code in my old love `#Perl` again after a while. I am implementing a log parser for generating site stats of my personal homepage! :-) @Perl + +### This is an interactive summary of the Go ... + +This is an interactive summary of the Go release, with a lot of examples utilising iterators in the slices and map packages. Love it! `#golang` + +=> https://antonz.org/go-1-23/ antonz.org/go-1-23/ + +## December 2024 + +### Thats unexpected, you cant remove a NaN key ... + +Thats unexpected, you cant remove a NaN key from a map without clearing it! `#golang` + +=> https://unexpected-go.com/you-cant-remove-a-nan-key-from-a-map-without-clearing-it.html unexpected-go.com/you-cant-remove-a-nan-key-from-a-map-without-clearing-it.html + +### My second blog post about revamping my home lab ... + +My second blog post about revamping my home lab a little bit just hit the net. `#FreeBSD` `#ZFS` `#n100` `#k8s` `#k3s` `#kubernetes` + +=> gemini://foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi (Gemini) +=> https://foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.html foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.html + +### Very insightful article about tech hiring in ... + +Very insightful article about tech hiring in the age of LLMs. As an interviewer, I have experienced some of the scrnarios already first hand... + +=> https://newsletter.pragmaticengineer.com/p/how-genai-changes-tech-hiring newsletter.pragmaticengineer.com/p/how-genai-changes-tech-hiring + +### for `#bpf` `#ebpf` performance debugging, have ... + +for `#bpf` `#ebpf` performance debugging, have a look at bpftop from Netflix. A neat tool showing you the estimated CPU time and other performance statistics for all the BPF programs currently loaded into the `#linux` kernel. Highly recommend! + +=> https://github.com/Netflix/bpftop github.com/Netflix/bpftop + +### 89 things he/she knows about Git commits is a ... + +89 things he/she knows about Git commits is a neat list of `#Git` wisdoms + +=> https://www.jvt.me/posts/2024/07/12/things-know-commits/ www.jvt.me/posts/2024/07/12/things-know-commits/ + +### I found that working on multiple side projects ... + +I found that working on multiple side projects concurrently is better than concentrating on just one. This seems inefficient at first, but whenever you tend to lose motivation, you can temporarily switch to another one with full élan. However, remember to stop starting and start finishing. This doesn't mean you should be working on 10+ (and a growing list of) side projects concurrently! Select your projects and commit to finishing them before starting the next thing. For example, my current limit of concurrent side projects is around five. + +### Agreed? Agreed. Besides `#Ruby`, I would also ... + +Agreed? Agreed. Besides `#Ruby`, I would also add `#RakuLang` and `#Perl` @Perl to the list of languages that are great for shell scripts - "Making Easy Things Easy and Hard Things Possible" + +=> https://lucasoshiro.github.io/posts-en/2024-06-17-ruby-shellscript/ lucasoshiro.github.io/posts-en/2024-06-17-ruby-shellscript/ + +### Plan9 assembly format in Go, but wait, it's not ... + +Plan9 assembly format in Go, but wait, it's not the Operating System Plan9! `#golang` `#rabbithole` + +=> https://www.osnews.com/story/140941/go-plan9-memo-speeding-up-calculations-450/ www.osnews.com/story/140941/go-plan9-memo-speeding-up-calculations-450/ + +### This is a neat blog post about the Helix text ... + +This is a neat blog post about the Helix text editor, to which I personally switched around a year ago (from NeoVim). I should blog about my experience as well. To summarize: I am using it together with the terminal multiplexer `#tmux`. It doesn't bother me that Helix is purely terminal-based and therefore everything has to be in the same font. `#HelixEditor` + +=> https://jonathan-frere.com/posts/helix/ jonathan-frere.com/posts/helix/ + +### This blog post is basically a rant against ... + +This blog post is basically a rant against DataDog... Personally, I don't have much experience with DataDog (actually, I have never used it), but one reason to work with logs at my day job (with over 2,000 physical server machines) and to be cost-effective is by using dtail! `#dtail` `#logs` `#logmanagement` + +=> https://crys.site/blog/2024/reinventint-the-weel/ crys.site/blog/2024/reinventint-the-weel/ +=> https://dtail.dev dtail.dev + +### Quick trick to get Helix themes selected ... + +Quick trick to get Helix themes selected randomly `#HelixEditor` + +=> gemini://foo.zone/gemfeed/2024-12-15-random-helix-themes.gmi foo.zone/gemfeed/2024-12-15-random-helix-themes.gmi (Gemini) +=> https://foo.zone/gemfeed/2024-12-15-random-helix-themes.html foo.zone/gemfeed/2024-12-15-random-helix-themes.html + +### Example where complexity attacks you from ... + +Example where complexity attacks you from behind `#k8s` `#kubernetes` `#OpenAI` + +=> https://surfingcomplexity.blog/2024/12/14/quick-takes-on-the-recent-openai-public-incident-write-up/ surfingcomplexity.blog/2024/12/14/quic..-..ecent-openai-public-incident-write-up/ + +### LLMs for Ops? Summaries of logs, probabilities ... + +LLMs for Ops? Summaries of logs, probabilities about correctness, auto-generating Ansible, some uses cases are there. Wouldn't trust it fully, though. + +=> https://youtu.be/WodaffxVq-E?si=noY0egrfl5izCSQI youtu.be/WodaffxVq-E?si=noY0egrfl5izCSQI + +### Excellent article about your dream Product ... + +Excellent article about your dream Product Manager: Why every software team needs a product manager to thrive via @wallabagapp + +=> https://testdouble.com/insights/why-product-managers-accelerate-improve-software-delivery testdouble.com/insights/why-product-ma..-..s-accelerate-improve-software-delivery + +### I just finished reading all chapters of CPU ... + +I just finished reading all chapters of CPU land: ... not claiming to remember every detail, but it is a great refresher how CPUs and operating systems actually work under the hood when you execute a program, which we tend to forget in our higher abstraction world. I liked the "story" and some of the jokes along the way! Size wise, it is pretty digestable (not talking about books, but only 7 web articles/chapters)! `#cpu` `#linux` `#unix` `#kernel` `#macOS` + +=> https://cpu.land/ cpu.land/ + +### Indeed, useful to know this stuff! `#sre` ... + +Indeed, useful to know this stuff! `#sre` + +=> https://biriukov.dev/docs/resolver-dual-stack-application/0-sre-should-know-about-gnu-linux-resolvers-and-dual-stack-applications/ biriukov.dev/docs/resolver-dual-stack-..-..resolvers-and-dual-stack-applications/ + +### It's the small things, which make Unix like ... + +It's the small things, which make Unix like systems, like GNU/Linux, interesting. Didn't know about this `#GNU` `#Tar` behaviour yet: + +=> https://xeiaso.net/notes/2024/pop-quiz-tar/ xeiaso.net/notes/2024/pop-quiz-tar/ + +### My New Year's resolution is not to start any ... + +My New Year's resolution is not to start any new non-fiction books (or only very few) but to re-read and listen to my favorites, which I read to reflect on and see things from different perspectives. Every time you re-read a book, you gain new insights.<nil>17491 + +Other related posts: + +<< template::inline::rindex posts-from + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2025-01-15-working-with-an-sre-interview.gmi b/gemfeed/2025-01-15-working-with-an-sre-interview.gmi new file mode 100644 index 00000000..fd95f583 --- /dev/null +++ b/gemfeed/2025-01-15-working-with-an-sre-interview.gmi @@ -0,0 +1,178 @@ +# Working with an SRE Interview + +> Published at 2025-01-15T00:16:04+02:00 + +I have been interviewed by Florian Buetow on `cracking-ai-engineering.com` about what it's like working with a Site Reliability Engineer from the point of view of a Software Engineer, Data Scientist, and AI Engineer. + +=> https://www.cracking-ai-engineering.com/writing/2025/01/12/working-with-an-sre-interview/ See original interview here +=> https://www.cracking-ai-engineering.com Cracking AI Engineering + +Below, I am posting the interview here on my blog as well. + +## Table of Contents + +* ⇢ Working with an SRE Interview +* ⇢ ⇢ Preamble +* ⇢ ⇢ Introducing Paul +* ⇢ ⇢ How did you get started? +* ⇢ ⇢ Roles and Career Progression +* ⇢ ⇢ Anecdotes and Best Practices +* ⇢ ⇢ Working with Different Teams +* ⇢ ⇢ Using AI Tools +* ⇢ ⇢ SRE Learning Resources +* ⇢ ⇢ Blogging +* ⇢ ⇢ Wrap-up +* ⇢ ⇢ Closing comments + +## Preamble + +In this insightful interview, Paul Bütow, a Principal Site Reliability Engineer at Mimecast, shares over a decade of experience in the field. Paul highlights the role of an Embedded SRE, emphasizing the importance of automation, observability, and effective incident management. We also focused on the key question of how you can work effectively with an SRE weather you are an individual contributor or a manager, a software engineer or data scientist. And how you can learn more about site reliability engineering. + +## Introducing Paul + +Hi Paul, please introduce yourself briefly to the audience. Who are you, what do you do for a living, and where do you work? + +> My name is Paul Bütow, I work at Mimecast, and I’m a Principal Site Reliability Engineer there. I’ve been with Mimecast for almost ten years now. The company specializes in email security, including things like archiving, phishing detection, malware protection, and spam filtering. + +You mentioned that you’re an ‘Embedded SRE.’ What does that mean exactly? + +> It means that I’m directly part of the software engineering team, not in a separate Ops department. I ensure that nothing is deployed manually, and everything runs through automation. I also set up monitoring and observability. These are two distinct aspects: monitoring alerts us when something breaks, while observability helps us identify trends. I also create runbooks so we know what to do when specific incidents occur frequently. + +> Infrastructure SREs on the other hand handle the foundational setup, like providing the Kubernetes cluster itself or ensuring the operating systems are installed. They don't work on the application directly but ensure the base infrastructure is there for others to use. This works well when a company has multiple teams that need shared infrastructure. + +## How did you get started? + +How did your interest in Linux or FreeBSD start? + +> It began during my school days. We had a PC with DOS at home, and I eventually bought Suse Linux 5.3. Shortly after, I discovered FreeBSD because I liked its handbook so much. I wanted to understand exactly how everything worked, so I also tried Linux from Scratch. That involves installing every package manually to gain a better understanding of operating systems. + +=> https://www.FreeBSD.org +=> https://linuxfromscratch.org/ + +And after school, you pursued computer science, correct? + +> Exactly. I wasn’t sure at first whether I wanted to be a software developer or a system administrator. I applied for both and eventually accepted an offer as a Linux system administrator. This was before 'SRE' became a buzzword, but much of what I did back then-automation, infrastructure as code, monitoring-is now considered part of the typical SRE role. + +## Roles and Career Progression + +Tell us about how you joined Mimecast. When did you fully embrace the SRE role? + +> I started as a Linux sysadmin at 1&1. I managed an ad server farm with hundreds of systems and later handled load balancers. Together with an architect, we managed F5 load balancers distributing around 2,000 services, including for portals like web.de and GMX. I also led the operations team technically for a while before moving to London to join Mimecast. + +> At Mimecast, the job title was explicitly 'Site Reliability Engineer.' The biggest difference was that I was no longer in a separate Ops department but embedded directly within the storage and search backend team. I loved that because we could plan features together-from automation to measurability and observability. Mimecast also operates thousands of physical servers for email archiving, which was fascinating since I already had experience with large distributed systems at 1&1. It was the right step for me because it allowed me to work close to the code while remaining hands-on with infrastructure. + +What are the differences between SRE, DevOps, SysAdmin, and Architects? + +> SREs are like the next step after SysAdmins. A SysAdmin might manually install servers, replace disks, or use simple scripts for automation, while SREs use infrastructure as code and focus on reliability through SLIs, SLOs, and automation. DevOps isn’t really a job-it’s more of a way of working, where developers are involved in operations tasks like setting up CI/CD pipelines or on-call shifts. Architects focus on designing systems and infrastructures, such as load balancers or distributed systems, working alongside SREs to ensure the systems meet the reliability and scalability requirements. The specific responsibilities of each role depend on the company, and there is often overlap. + +What are the most important reliability lessons you’ve learned so far? + +* Don’t leave SRE aspects as an afterthought. It’s much better to discuss automation, monitoring, SLIs, and SLOs early on. Traditional sysadmins often installed systems manually, but today, we do everything via infrastructure as code-using tools like Terraform or Puppet. +* I also distinguish between monitoring and observability. Monitoring tells us, 'The server is down, alarm!' Observability dives deeper, showing trends like increasing latency so we can act proactively. +* SLI, SLO, and SLA are core elements. We focus on what users actually experience-for example, how quickly an email is sent-and set our goals accordingly. +* Runbooks are also crucial. When something goes wrong at night, you don’t want to start from scratch. A runbook outlines how to debug and resolve specific problems, saving time and reducing downtime. + +## Anecdotes and Best Practices + +Runbooks sound very practical. Can you explain how they’re used day-to-day? + +> Runbooks are essentially guides for handling specific incidents. For instance, if a service won’t start, the runbook will specify where the logs are and which commands to use. Observability takes it a step further, helping us spot changes early-like rising error rates or latency-so we can address issues before they escalate. + +When should you decide to put something into a runbook, and when is it unnecessary? + +> If an issue happens frequently, it should be documented in a runbook so that anyone, even someone new, can follow the steps to fix it. The idea is that 90% of the common incidents should be covered. For example, if a service is down, the runbook would specify where to find logs, which commands to check, and what actions to take. On the other hand, rare or complex issues, where the resolution depends heavily on context or varies each time, don’t make sense to include in detail. For those, it’s better to focus on general troubleshooting steps. + +How do you search for and find the correct runbooks? + +> Runbooks should be linked directly in the alert you receive. For example, if you get an alert about a service not running, the alert will have a link to the runbook that tells you what to check, like logs or commands to run. Runbooks are best stored in an internal wiki, so if you don’t find the link in the alert, you know where to search. The important thing is that runbooks are easy to find and up to date because that’s what makes them useful during incidents. + +Do you have an interesting war story you can share with us? + +> Sure. At 1&1, we had a proprietary ad server software that ran a SQL query during startup. The query got slower over time, eventually timing out and preventing the server from starting. Since we couldn’t access the source code, we searched the binary for the SQL and patched it. By pinpointing the issue, a developer was able to adjust the SQL. This collaboration between sysadmin and developer perspectives highlights the value of SRE work. + +## Working with Different Teams + +You’re embedded in a team-how does collaboration with developers work practically? + +> We plan everything together from the start. If there’s a new feature, we discuss infrastructure, automated deployments, and monitoring right away. Developers are experts in the code, and I bring the infrastructure expertise. This avoids unpleasant surprises before going live. + +How about working with data scientists or ML engineers? Are there differences? + +> The principles are the same. ML models also need to be deployed and monitored. You deal with monitoring, resource allocation, and identifying performance drops. Whether it’s a microservice or an ML job, at the end of the day, it’s all running on servers or clusters that must remain stable. + +What about working with managers or the FinOps team? + +> We often discuss costs, especially in the cloud, where scaling up resources is easy. It’s crucial to know our metrics: do we have enough capacity? Do we need all instances? Or is the CPU only at 5% utilization? This data helps managers decide whether the budget is sufficient or if optimizations are needed. + +Do you have practical tips for working with SREs? + +> Yes, I have a few: + +* Early involvement: Include SREs from the beginning in your project. +* Runbooks & documentation: Document recurring errors. +* Try first: Try to understand the issue yourself before immediately asking the SRE. +* Basic infra knowledge: Kubernetes and Terraform aren’t magic. Some basic understanding helps every developer. + +## Using AI Tools + +Let’s talk about AI. How do you use it in your daily work? + +> For boilerplate code, like Terraform snippets, I often use ChatGPT. It saves time, although I always review and adjust the output. Log analysis is another exciting application. Instead of manually going through millions of lines, AI can summarize key outliers or errors. + +Do you think AI could largely replace SREs or significantly change the role? + +> I see AI as an additional tool. SRE requires a deep understanding of how distributed systems work internally. While AI can assist with routine tasks or quickly detect anomalies, human expertise is indispensable for complex issues. + +## SRE Learning Resources + +What resources would you recommend for learning about SRE? + +> The Google SRE book is a classic, though a bit dry. I really like 'Seeking SRE,' as it offers various perspectives on SRE, with many practical stories from different companies. + +=> https://sre.google/books/ +=> https://www.oreilly.com/library/view/seeking-sre/9781491978856 Seeking SRE + +Do you have a podcast recommendation? + +> The Google SRE prodcast is quite interesting. It offers insights into how Google approaches SRE, along with perspectives from external guests. + +=> https://sre.google/prodcast/ + +## Blogging + +You also have a blog. What motivates you to write regularly? + +> Writing helps me learn the most. It also serves as a personal reference. Sometimes I look up how I solved a problem a year ago. And of course, others tackling similar projects might find inspiration in my posts. + +What do you blog about? + +> Mostly technical topics I find exciting, like homelab projects, Kubernetes, or book summaries on IT and productivity. It’s a personal blog, so I write about what I enjoy. + +## Wrap-up + +To wrap up, what are three things every team should keep in mind for stability? + +> First, maintain runbooks and documentation to avoid chaos at night. Second, automate everything-manual installs in production are risky. Third, define SLIs, SLOs, and SLAs early so everyone knows what we’re monitoring and guaranteeing. + +Is there a motto or mindset that particularly inspires you as an SRE? + +> "Keep it simple and stupid"-KISS. Not everything has to be overly complex. And always stay curious. I’m still fascinated by how systems work under the hood. + +Where can people find you online? + +> You can find links to my socials on my website paul.buetow.org +> I regularly post articles and link to everything else I’m working on outside of work. + +=> https://paul.buetow.org + +Thank you very much for your time and this insightful interview into the world of site reliability engineering + +> My pleasure, this was fun. + +## Closing comments + +Dear reader, I hope this conversation with Paul Bütow provided an exciting peak into the world of Site Reliability Engineering. Whether you’re a software developer, data scientist, ML engineer, or manager, reliable systems are always a team effort. Hopefully, you’ve taken some insights or tips from Paul’s experiences for your own team or next project. Thanks for joining us, and best of luck refining your own SRE practices! + +E-Mail your comments to `paul@nospam.buetow.org` or contact Florian via the Cracking AI Engineering :-) + +=> ../ Back to the main site diff --git a/gemfeed/2025-01-15-working-with-an-sre-interview.gmi.tpl b/gemfeed/2025-01-15-working-with-an-sre-interview.gmi.tpl new file mode 100644 index 00000000..ac27ab94 --- /dev/null +++ b/gemfeed/2025-01-15-working-with-an-sre-interview.gmi.tpl @@ -0,0 +1,165 @@ +# Working with an SRE Interview + +> Published at 2025-01-15T00:16:04+02:00 + +I have been interviewed by Florian Buetow on `cracking-ai-engineering.com` about what it's like working with a Site Reliability Engineer from the point of view of a Software Engineer, Data Scientist, and AI Engineer. + +=> https://www.cracking-ai-engineering.com/writing/2025/01/12/working-with-an-sre-interview/ See original interview here +=> https://www.cracking-ai-engineering.com Cracking AI Engineering + +Below, I am posting the interview here on my blog as well. + +<< template::inline::toc + +## Preamble + +In this insightful interview, Paul Bütow, a Principal Site Reliability Engineer at Mimecast, shares over a decade of experience in the field. Paul highlights the role of an Embedded SRE, emphasizing the importance of automation, observability, and effective incident management. We also focused on the key question of how you can work effectively with an SRE weather you are an individual contributor or a manager, a software engineer or data scientist. And how you can learn more about site reliability engineering. + +## Introducing Paul + +Hi Paul, please introduce yourself briefly to the audience. Who are you, what do you do for a living, and where do you work? + +> My name is Paul Bütow, I work at Mimecast, and I’m a Principal Site Reliability Engineer there. I’ve been with Mimecast for almost ten years now. The company specializes in email security, including things like archiving, phishing detection, malware protection, and spam filtering. + +You mentioned that you’re an ‘Embedded SRE.’ What does that mean exactly? + +> It means that I’m directly part of the software engineering team, not in a separate Ops department. I ensure that nothing is deployed manually, and everything runs through automation. I also set up monitoring and observability. These are two distinct aspects: monitoring alerts us when something breaks, while observability helps us identify trends. I also create runbooks so we know what to do when specific incidents occur frequently. + +> Infrastructure SREs on the other hand handle the foundational setup, like providing the Kubernetes cluster itself or ensuring the operating systems are installed. They don't work on the application directly but ensure the base infrastructure is there for others to use. This works well when a company has multiple teams that need shared infrastructure. + +## How did you get started? + +How did your interest in Linux or FreeBSD start? + +> It began during my school days. We had a PC with DOS at home, and I eventually bought Suse Linux 5.3. Shortly after, I discovered FreeBSD because I liked its handbook so much. I wanted to understand exactly how everything worked, so I also tried Linux from Scratch. That involves installing every package manually to gain a better understanding of operating systems. + +=> https://www.FreeBSD.org +=> https://linuxfromscratch.org/ + +And after school, you pursued computer science, correct? + +> Exactly. I wasn’t sure at first whether I wanted to be a software developer or a system administrator. I applied for both and eventually accepted an offer as a Linux system administrator. This was before 'SRE' became a buzzword, but much of what I did back then-automation, infrastructure as code, monitoring-is now considered part of the typical SRE role. + +## Roles and Career Progression + +Tell us about how you joined Mimecast. When did you fully embrace the SRE role? + +> I started as a Linux sysadmin at 1&1. I managed an ad server farm with hundreds of systems and later handled load balancers. Together with an architect, we managed F5 load balancers distributing around 2,000 services, including for portals like web.de and GMX. I also led the operations team technically for a while before moving to London to join Mimecast. + +> At Mimecast, the job title was explicitly 'Site Reliability Engineer.' The biggest difference was that I was no longer in a separate Ops department but embedded directly within the storage and search backend team. I loved that because we could plan features together-from automation to measurability and observability. Mimecast also operates thousands of physical servers for email archiving, which was fascinating since I already had experience with large distributed systems at 1&1. It was the right step for me because it allowed me to work close to the code while remaining hands-on with infrastructure. + +What are the differences between SRE, DevOps, SysAdmin, and Architects? + +> SREs are like the next step after SysAdmins. A SysAdmin might manually install servers, replace disks, or use simple scripts for automation, while SREs use infrastructure as code and focus on reliability through SLIs, SLOs, and automation. DevOps isn’t really a job-it’s more of a way of working, where developers are involved in operations tasks like setting up CI/CD pipelines or on-call shifts. Architects focus on designing systems and infrastructures, such as load balancers or distributed systems, working alongside SREs to ensure the systems meet the reliability and scalability requirements. The specific responsibilities of each role depend on the company, and there is often overlap. + +What are the most important reliability lessons you’ve learned so far? + +* Don’t leave SRE aspects as an afterthought. It’s much better to discuss automation, monitoring, SLIs, and SLOs early on. Traditional sysadmins often installed systems manually, but today, we do everything via infrastructure as code-using tools like Terraform or Puppet. +* I also distinguish between monitoring and observability. Monitoring tells us, 'The server is down, alarm!' Observability dives deeper, showing trends like increasing latency so we can act proactively. +* SLI, SLO, and SLA are core elements. We focus on what users actually experience-for example, how quickly an email is sent-and set our goals accordingly. +* Runbooks are also crucial. When something goes wrong at night, you don’t want to start from scratch. A runbook outlines how to debug and resolve specific problems, saving time and reducing downtime. + +## Anecdotes and Best Practices + +Runbooks sound very practical. Can you explain how they’re used day-to-day? + +> Runbooks are essentially guides for handling specific incidents. For instance, if a service won’t start, the runbook will specify where the logs are and which commands to use. Observability takes it a step further, helping us spot changes early-like rising error rates or latency-so we can address issues before they escalate. + +When should you decide to put something into a runbook, and when is it unnecessary? + +> If an issue happens frequently, it should be documented in a runbook so that anyone, even someone new, can follow the steps to fix it. The idea is that 90% of the common incidents should be covered. For example, if a service is down, the runbook would specify where to find logs, which commands to check, and what actions to take. On the other hand, rare or complex issues, where the resolution depends heavily on context or varies each time, don’t make sense to include in detail. For those, it’s better to focus on general troubleshooting steps. + +How do you search for and find the correct runbooks? + +> Runbooks should be linked directly in the alert you receive. For example, if you get an alert about a service not running, the alert will have a link to the runbook that tells you what to check, like logs or commands to run. Runbooks are best stored in an internal wiki, so if you don’t find the link in the alert, you know where to search. The important thing is that runbooks are easy to find and up to date because that’s what makes them useful during incidents. + +Do you have an interesting war story you can share with us? + +> Sure. At 1&1, we had a proprietary ad server software that ran a SQL query during startup. The query got slower over time, eventually timing out and preventing the server from starting. Since we couldn’t access the source code, we searched the binary for the SQL and patched it. By pinpointing the issue, a developer was able to adjust the SQL. This collaboration between sysadmin and developer perspectives highlights the value of SRE work. + +## Working with Different Teams + +You’re embedded in a team-how does collaboration with developers work practically? + +> We plan everything together from the start. If there’s a new feature, we discuss infrastructure, automated deployments, and monitoring right away. Developers are experts in the code, and I bring the infrastructure expertise. This avoids unpleasant surprises before going live. + +How about working with data scientists or ML engineers? Are there differences? + +> The principles are the same. ML models also need to be deployed and monitored. You deal with monitoring, resource allocation, and identifying performance drops. Whether it’s a microservice or an ML job, at the end of the day, it’s all running on servers or clusters that must remain stable. + +What about working with managers or the FinOps team? + +> We often discuss costs, especially in the cloud, where scaling up resources is easy. It’s crucial to know our metrics: do we have enough capacity? Do we need all instances? Or is the CPU only at 5% utilization? This data helps managers decide whether the budget is sufficient or if optimizations are needed. + +Do you have practical tips for working with SREs? + +> Yes, I have a few: + +* Early involvement: Include SREs from the beginning in your project. +* Runbooks & documentation: Document recurring errors. +* Try first: Try to understand the issue yourself before immediately asking the SRE. +* Basic infra knowledge: Kubernetes and Terraform aren’t magic. Some basic understanding helps every developer. + +## Using AI Tools + +Let’s talk about AI. How do you use it in your daily work? + +> For boilerplate code, like Terraform snippets, I often use ChatGPT. It saves time, although I always review and adjust the output. Log analysis is another exciting application. Instead of manually going through millions of lines, AI can summarize key outliers or errors. + +Do you think AI could largely replace SREs or significantly change the role? + +> I see AI as an additional tool. SRE requires a deep understanding of how distributed systems work internally. While AI can assist with routine tasks or quickly detect anomalies, human expertise is indispensable for complex issues. + +## SRE Learning Resources + +What resources would you recommend for learning about SRE? + +> The Google SRE book is a classic, though a bit dry. I really like 'Seeking SRE,' as it offers various perspectives on SRE, with many practical stories from different companies. + +=> https://sre.google/books/ +=> https://www.oreilly.com/library/view/seeking-sre/9781491978856 Seeking SRE + +Do you have a podcast recommendation? + +> The Google SRE prodcast is quite interesting. It offers insights into how Google approaches SRE, along with perspectives from external guests. + +=> https://sre.google/prodcast/ + +## Blogging + +You also have a blog. What motivates you to write regularly? + +> Writing helps me learn the most. It also serves as a personal reference. Sometimes I look up how I solved a problem a year ago. And of course, others tackling similar projects might find inspiration in my posts. + +What do you blog about? + +> Mostly technical topics I find exciting, like homelab projects, Kubernetes, or book summaries on IT and productivity. It’s a personal blog, so I write about what I enjoy. + +## Wrap-up + +To wrap up, what are three things every team should keep in mind for stability? + +> First, maintain runbooks and documentation to avoid chaos at night. Second, automate everything-manual installs in production are risky. Third, define SLIs, SLOs, and SLAs early so everyone knows what we’re monitoring and guaranteeing. + +Is there a motto or mindset that particularly inspires you as an SRE? + +> "Keep it simple and stupid"-KISS. Not everything has to be overly complex. And always stay curious. I’m still fascinated by how systems work under the hood. + +Where can people find you online? + +> You can find links to my socials on my website paul.buetow.org +> I regularly post articles and link to everything else I’m working on outside of work. + +=> https://paul.buetow.org + +Thank you very much for your time and this insightful interview into the world of site reliability engineering + +> My pleasure, this was fun. + +## Closing comments + +Dear reader, I hope this conversation with Paul Bütow provided an exciting peak into the world of Site Reliability Engineering. Whether you’re a software developer, data scientist, ML engineer, or manager, reliable systems are always a team effort. Hopefully, you’ve taken some insights or tips from Paul’s experiences for your own team or next project. Thanks for joining us, and best of luck refining your own SRE practices! + +E-Mail your comments to `paul@nospam.buetow.org` or contact Florian via the Cracking AI Engineering :-) + +=> ../ Back to the main site diff --git a/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi b/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi new file mode 100644 index 00000000..9c101a7e --- /dev/null +++ b/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi @@ -0,0 +1,366 @@ +# 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.gmi 2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage +=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation +=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts (You are currently reading this) + +=> ./f3s-kubernetes-with-freebsd-part-1/f3slogo.png f3s logo + +## Table of Contents + +* ⇢ f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts +* ⇢ ⇢ Introduction +* ⇢ ⇢ Changes since last time +* ⇢ ⇢ ⇢ FreeBSD upgrade from 14.1 to 14.2 +* ⇢ ⇢ ⇢ A new home (behind the TV) +* ⇢ ⇢ The UPS hardware +* ⇢ ⇢ Configuring FreeBSD to Work with the UPS +* ⇢ ⇢ ⇢ USB Device Detection +* ⇢ ⇢ ⇢ `apcupsd` Installation +* ⇢ ⇢ ⇢ UPS Connectivity Test +* ⇢ ⇢ APC Info on Partner Nodes: +* ⇢ ⇢ ⇢ Installation on partners +* ⇢ ⇢ Power outage simulation +* ⇢ ⇢ ⇢ Pulling the plug +* ⇢ ⇢ ⇢ Restoring power + +## 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: + +```sh +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: + +```sh +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: + +```sh +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). + +=> ./f3s-kubernetes-with-freebsd-part-3/f3s-changes.jpg 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. + +=> ./f3s-kubernetes-with-freebsd-part-3/apc-back-ups.jpg 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: + +```sh +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: + +```sh +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: + +```sh +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: + +```sh +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!). + +```sh +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: + +```sh +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`: + +```sh +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`: + +```sh +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: + +```sh +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: + +```sh +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.gmi 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.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation +=> ./2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi 2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage +=> ./2024-04-01-KISS-high-availability-with-OpenBSD.gmi 2024-04-01 KISS high-availability with OpenBSD +=> ./2024-01-13-one-reason-why-i-love-openbsd.gmi 2024-01-13 One reason why I love OpenBSD +=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD +=> ./2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi 2022-07-30 Let's Encrypt with OpenBSD and Rex +=> ./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi 2016-04-09 Jails and ZFS with Puppet on FreeBSD + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi.tpl b/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi.tpl new file mode 100644 index 00000000..ec091b5f --- /dev/null +++ b/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi.tpl @@ -0,0 +1,341 @@ +# 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. + +<< template::inline::index f3s-kubernetes-with-freebsd-part + +=> ./f3s-kubernetes-with-freebsd-part-1/f3slogo.png f3s logo + +<< template::inline::toc + +## 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: + +```sh +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: + +```sh +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: + +```sh +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). + +=> ./f3s-kubernetes-with-freebsd-part-3/f3s-changes.jpg 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. + +=> ./f3s-kubernetes-with-freebsd-part-3/apc-back-ups.jpg 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: + +```sh +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: + +```sh +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: + +```sh +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: + +```sh +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!). + +```sh +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: + +```sh +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`: + +```sh +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`: + +```sh +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: + +```sh +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: + +```sh +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: + +<< template::inline::rindex bsd + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/2025-02-08-random-weird-things-ii.gmi b/gemfeed/2025-02-08-random-weird-things-ii.gmi new file mode 100644 index 00000000..b9cff06e --- /dev/null +++ b/gemfeed/2025-02-08-random-weird-things-ii.gmi @@ -0,0 +1,251 @@ +# 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.gmi 2024-07-05 Random Weird Things - Part Ⅰ +=> ./2025-02-08-random-weird-things-ii.gmi 2025-02-08 Random Weird Things - Part Ⅱ (You are currently reading this) + +``` +/\_/\ /\_/\ +( o.o ) WHOA!! ( o.o ) +> ^ < > ^ < +/ \ MOEEW! / \ +/______\ /______\ +``` + +## Table of Contents + +* ⇢ Random Weird Things - Part Ⅱ +* ⇢ ⇢ 11. The SQLite codebase is a gem +* ⇢ ⇢ Go Programming +* ⇢ ⇢ ⇢ 12. Official Go font +* ⇢ ⇢ ⇢ 13. Go functions can have methods +* ⇢ ⇢ macOS +* ⇢ ⇢ ⇢ 14. ß and ss are treated the same +* ⇢ ⇢ ⇢ 15. Colon as file path separator +* ⇢ ⇢ 16. Polyglots - programs written in multiple languages +* ⇢ ⇢ 17. Languages, where indices start at 1 +* ⇢ ⇢ 18. Perl Poetry +* ⇢ ⇢ 19. CSS3 is turing complete +* ⇢ ⇢ 20. The biggest shell programs + +## 11. The SQLite codebase is a gem + +Check this out: + +=> ./random-weird-things-ii/sqlite-gem.png 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: + +=> ./random-weird-things-ii/go-font-code.png 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: + +```go +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: + +```sh +❯ 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: + +```sh +❯ 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: + +=> ./2014-03-24-the-fibonacci.pl.c-polyglot.gmi 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: + +```lua +arr = {10, 20, 30, 40, 50} +print(arr[1]) -- Accessing the first element +```` + +```sh +❯ 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: + +```perl +# (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 +``` + +=> ./2008-06-26-perl-poetry.gmi 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. + +=> https://stackoverflow.com/questions/2497146/is-css-turing-complete 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: + +=> ./random-weird-things-ii/css-conway.png + +=> https://github.com/propjockey/css-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! + +=> https://github.com/oils-for-unix/oils/wiki/The-Biggest-Shell-Programs-in-the-World The Biggest Sell Programs in the World + +My Gemtexter (bash) is only 1329 LOC as of now. So it's tiny. + +=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 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 diff --git a/gemfeed/2025-02-08-random-weird-things-ii.gmi.tpl b/gemfeed/2025-02-08-random-weird-things-ii.gmi.tpl new file mode 100644 index 00000000..e0d3b954 --- /dev/null +++ b/gemfeed/2025-02-08-random-weird-things-ii.gmi.tpl @@ -0,0 +1,236 @@ +# 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. + +<< template::inline::index random-weird-things + +``` +/\_/\ /\_/\ +( o.o ) WHOA!! ( o.o ) +> ^ < > ^ < +/ \ MOEEW! / \ +/______\ /______\ +``` + +<< template::inline::toc + +## 11. The SQLite codebase is a gem + +Check this out: + +=> ./random-weird-things-ii/sqlite-gem.png 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: + +=> ./random-weird-things-ii/go-font-code.png 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: + +```go +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: + +```sh +❯ 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: + +```sh +❯ 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: + +=> ./2014-03-24-the-fibonacci.pl.c-polyglot.gmi 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: + +```lua +arr = {10, 20, 30, 40, 50} +print(arr[1]) -- Accessing the first element +```` + +```sh +❯ 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: + +```perl +# (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 +``` + +=> ./2008-06-26-perl-poetry.gmi 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. + +=> https://stackoverflow.com/questions/2497146/is-css-turing-complete 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: + +=> ./random-weird-things-ii/css-conway.png + +=> https://github.com/propjockey/css-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! + +=> https://github.com/oils-for-unix/oils/wiki/The-Biggest-Shell-Programs-in-the-World The Biggest Sell Programs in the World + +My Gemtexter (bash) is only 1329 LOC as of now. So it's tiny. + +=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 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 diff --git a/gemfeed/4 b/gemfeed/4 new file mode 100644 index 00000000..f4c59789 --- /dev/null +++ b/gemfeed/4 @@ -0,0 +1,239 @@ +# f3s: Kubernetes with FreeBSD - Rocky Linux Bhyve VMs - Part 3 + +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. + +<< template::inline::index f3s-kubernetes-with-freebsd-part + +=> ./f3s-kubernetes-with-frhyveeebsd-part-1/f3slogo.png f3s logo + +<< template::inline::toc + +## Introduction + +In this blog post, we are going to install the Bhyve hypervisor. + +The FreeBSD Bhyve hypervisor is a lightweight, modern hypervisor that enables virtualization on FreeBSD systems. Bhyve's strengths include its minimal overhead, which allows it to achieve near-native performance for virtual machines. It is designed to be efficient and lightweight, leveraging the capabilities of the FreeBSD operating system for performance and network management. + +Bhyve supports running a variety of guest operating systems, including FreeBSD, Linux, and Windows, on hardware platforms that support hardware virtualization extensions (such as Intel VT-x or AMD-V). In our case, we are going to virtualize Rocky Linux, which later on in this series will be used to run k3s. + +## Basic Bhyve setup + +For the management of the Bhyve VMs, we are using `vm-bhyve`, a tool not part of the FreeBSD operating system but available as a ready-to-use package. It eases VM management and reduces a lot of the overhead. We also install the required package to make Bhyve work with the UEFI firmware. + +=> https://github.com/churchers/vm-bhyve + +The following commands are executed on all three hosts `f0`, `f1`, and `f2`, where `re0` is the name of the Ethernet interface (which may need to be adjusted if your hardware is different): + +```sh +paul@f0:~ % doas pkg install vm-bhyve bhyve-firmware +paul@f0:~ % doas sysrc vm_enable=YES +vm_enable: -> YES +paul@f0:~ % doas sysrc vm_dir=zfs:zroot/bhyve +vm_dir: -> zfs:zroot/bhyve +paul@f0:~ % doas zfs create zroot/bhyve +paul@f0:~ % doas vm init +paul@f0:~ % doas vm switch create public +paul@f0:~ % doas vm switch add public re0 +``` + +Bhyve stores all it's data in the `/bhyve` of the `zroot` ZFS pool: + +```sh +paul@f0:~ % zfs list | grep bhyve +zroot/bhyve 1.74M 453G 1.74M /zroot/bhyve +``` + +For convenience, we also create this symlink: + +```sh +paul@f0:~ % doas ln -s /zroot/bhyve/ /bhyve + +``` + +Now, Bhyve is ready to rumble, but no VMs are there yet: + +```sh +paul@f0:~ % doas vm list +NAME DATASTORE LOADER CPU MEMORY VNC AUTO STATE +``` + +## Rocky Linux VMs + +### ISO download + +We're going to install the Rocky Linux from the latest minimal iso: + +```sh +paul@f0:~ % doas vm iso \ + https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9.5-x86_64-minimal.iso +/zroot/bhyve/.iso/Rocky-9.5-x86_64-minimal.iso 1808 MB 4780 kBps 06m28s +paul@f0:/bhyve % doas vm create rocky +``` +### VM configuration + +The default configuration looks like this now: + +```sh +paul@f0:/bhyve/rocky % cat rocky.conf +loader="bhyveload" +cpu=1 +memory=256M +network0_type="virtio-net" +network0_switch="public" +disk0_type="virtio-blk" +disk0_name="disk0.img" +uuid="1c4655ac-c828-11ef-a920-e8ff1ed71ca0" +network0_mac="58:9c:fc:0d:13:3f" +``` + +Whereas the `uuid` and the `network0_mac` differ on each of the 3 hosts. + +but in order to make Rocky Linux boot it (plus some other adjustments, e.g. as I am intending to run the majority of the workload in the k3s cluster running on those linux VMs, I give them beefy specs like 4 CPU cores and 14GB RAM), I run `doas vm configure rocky` and modified it to: + +``` +guest="linux" +loader="uefi" +uefi_vars="yes" +cpu=4 +memory=14G +network0_type="virtio-net" +network0_switch="public" +disk0_type="virtio-blk" +disk0_name="disk0.img" +graphics="yes" +graphics_vga=io +uuid="1c45400b-c828-11ef-8871-e8ff1ed71cac" +network0_mac="58:9c:fc:0d:13:3f" +``` + +### VM installation + +To start the installer from the downloaded ISO, I run: + +```sh +paul@f0:~ % doas vm install rocky Rocky-9.5-x86_64-minimal.iso +Starting rocky + * found guest in /zroot/bhyve/rocky + * booting... + +paul@f0:/bhyve/rocky % doas vm list +NAME DATASTORE LOADER CPU MEMORY VNC AUTO STATE +rocky default uefi 4 14G 0.0.0.0:5900 No Locked (f0.lan.buetow.org) + +paul@f0:/bhyve/rocky % doas sockstat -4 | grep 5900 +root bhyve 6079 8 tcp4 *:5900 *:* +``` + +Port 5900 now also opened for VNC connections, so I connected to it with a VNC client and run through the installation dialogs. I'm sure this could be done unattended or more automated, there are only 3 VMs to install, and the automation doesn't seem worth it as we are doing it only once in a year or less often. + +### Increase of the disk image + +By default the VMs disk image is only 20G, which is a bit small for my purposes, so I stopped the VMs again and run `truncate` on the image file to enlarge them to 100G, and re-started the installation: + +```sh +paul@f0:/bhyve/rocky % doas vm stop rocky +paul@f0:/bhyve/rocky % doas truncate -s 100G disk0.img +paul@f0:/bhyve/rocky % doas vm install rocky Rocky-9.5-x86_64-minimal.iso +``` + +### Connect to VPN + +For the installation, I opened the VPN client on my Fedora laptop (GNOME comes with a simple VPN client) and ran through the base installation for each of the VMs manually. Again, I am sure this could have been automated a bit more, but there were just 3 VMs, and it wasn't worth the effort. The three VNC addresses of the VMs were: `vnc://f0:5900`, `vnc://f1:5900`, and `vnc://f0:5900`. + +I mostly selected the default settings (auto partitioning on the 100GB drive and a root user password). After the installation, the VMs were rebooted. + +## After install + +I performed the following steps for all 3 VMs. In the following, the examples are all executed on `f0` (bzw the VM `r0` running on `f0`): + +### VM auto-start after host reboot + +To automatically start the VM on the servers I added the following to the `rc.conf` on the FreeBSD hosts: + +```sh + +paul@f0:/bhyve/rocky % cat <<END | doas tee -a /etc/rc.conf +vm_list="rocky" +vm_delay="5" +``` + +The `vm_delay` isn't really required. It is used to wait 5 seconds before starting each VM, but as of now, there is only one VM per host. Maybe later, when there are more, this will be useful to have. After adding, there's now a `Yes` indicator in the `AUTO` column. + +```sh +paul@f0:~ % doas vm list +NAME DATASTORE LOADER CPU MEMORY VNC AUTO STATE +rocky default uefi 4 14G 0.0.0.0:5900 Yes [1] Running (2063) +``` + +### Static IP configuration + +After that, I changed the network configuration of the VMs to be static (from DHCP) here. As per previous post of this series, the 3 FreeBSD hosts were already in my `/etc/hosts` file: + +``` +192.168.1.130 f0 f0.lan f0.lan.buetow.org +192.168.1.131 f1 f1.lan f1.lan.buetow.org +192.168.1.132 f2 f2.lan f2.lan.buetow.org +``` + +For the Rocky VMs I added those to the FreeBSD hosts systems as well: + +```sh +paul@f0:/bhyve/rocky % cat <<END | doas tee -a /etc/hosts +192.168.1.120 r0 r0.lan r0.lan.buetow.org +192.168.1.121 r1 r1.lan r1.lan.buetow.org +192.168.1.122 r2 r2.lan r2.lan.buetow.org +END +``` + +and configured the IPs accordingly on the VMs themselves by opening a root shell via RDP to the VMs and entering the following commands on each of the VMs: + +```sh +[root@r0 ~] % dnmcli connection modify enp0s5 ipv4.address 192.168.1.120/24 +[root@r0 ~] % dnmcli connection modify enp0s5 ipv4.gateway 192.168.1.1 +[root@r0 ~] % dnmcli connection modify enp0s5 ipv4.dns 192.168.1.1 +[root@r0 ~] % dnmcli connection modify enp0s5 ipv4.method manual +[root@r0 ~] % dnmcli connection down enp0s5 +[root@r0 ~] % dnmcli connection up enp0s5 +[root@r0 ~] % hostnamectl set-hostname r0.lan.buetow.org +[root@r0 ~] % cat <<END >>/etc/hosts +192.168.1.120 r0 r0.lan r0.lan.buetow.org +192.168.1.121 r1 r1.lan r1.lan.buetow.org +192.168.1.122 r2 r2.lan r2.lan.buetow.org +END +```` + +Whereas: + +* `192.168.1.120` is the IP of the VM itself (here: `r0.lan.buetow.org`) +* `192.168.1.1` is the address of my home router, which also does DNS. + +### Permitting root login + +As these VMs arent directly reachable via SSH from the internet, I enabled `root` login by adding a line with `PermitRootLogin yes` to `/etc/sshd/sshd_config`. + +Once done, I rebooted the VM by running `reboot` inside of the vm to test whether everything was configured and persisted correctly. + +After reboot, I copied my public key from my Laptop to the 3 VMs: + +```sh +% for i in 0 1 2; do ssh-copy-id root@r$i.lan.buetow.org; done +``` + +And then I edited the `/etc/ssh/sshd_config` file again on all 3 VMs and configured `PasswordAuthentication no`, to only allow SSH key authentication from now on. + +### Install latest updates + +```sh +[root@r0 ~] % dnf update +[root@r0 ~] % dreboot +``` + +CPU STRESS TESTER VM VS NOT VM + +Other *BSD-related posts: + +<< template::inline::index bsd + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/DRAFT-f3s-kubernetes-with-freebsd-part-4.gmi b/gemfeed/DRAFT-f3s-kubernetes-with-freebsd-part-4.gmi new file mode 100644 index 00000000..25167ea2 --- /dev/null +++ b/gemfeed/DRAFT-f3s-kubernetes-with-freebsd-part-4.gmi @@ -0,0 +1,279 @@ +# f3s: Kubernetes with FreeBSD - Rocky Linux Bhyve VMs - Part 4 + +This is the thourth 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.gmi 2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage +=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation +=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts + +=> ./f3s-kubernetes-with-frhyveeebsd-part-1/f3slogo.png f3s logo + +## Table of Contents + +* ⇢ f3s: Kubernetes with FreeBSD - Rocky Linux Bhyve VMs - Part 4 +* ⇢ ⇢ Introduction +* ⇢ ⇢ Check for `POPCNT` CPU support +* ⇢ ⇢ Basic Bhyve setup +* ⇢ ⇢ Rocky Linux VMs +* ⇢ ⇢ ⇢ ISO download +* ⇢ ⇢ ⇢ VM configuration +* ⇢ ⇢ ⇢ VM installation +* ⇢ ⇢ ⇢ Increase of the disk image +* ⇢ ⇢ ⇢ Connect to VPN +* ⇢ ⇢ After install +* ⇢ ⇢ ⇢ VM auto-start after host reboot +* ⇢ ⇢ ⇢ Static IP configuration +* ⇢ ⇢ ⇢ Permitting root login +* ⇢ ⇢ ⇢ Install latest updates + +## Introduction + +In this blog post, we are going to install the Bhyve hypervisor. + +The FreeBSD Bhyve hypervisor is a lightweight, modern hypervisor that enables virtualization on FreeBSD systems. Bhyve's strengths include its minimal overhead, which allows it to achieve near-native performance for virtual machines. It is designed to be efficient and lightweight, leveraging the capabilities of the FreeBSD operating system for performance and network management. + +Bhyve supports running a variety of guest operating systems, including FreeBSD, Linux, and Windows, on hardware platforms that support hardware virtualization extensions (such as Intel VT-x or AMD-V). In our case, we are going to virtualize Rocky Linux, which later on in this series will be used to run k3s. + +## Check for `POPCNT` CPU support + +POPCNT is a CPU instruction that counts the number of set bits (ones) in a binary number. In terms of CPU virtualization and Bhyve support for the POPCNT instruction is important because guest operating systems utilize this instruction to perform various tasks more efficiently. If the host CPU supports POPCNT, Bhyve can pass this capability to virtual machines to for better performance. Without POPCNT support, some applications might not run, or they might perform suboptimally in virtualized environments. + +To check for `POPCNT` support, I run: + +```sh +paul@f0:~ % dmesg | grep 'Features2=.*POPCNT' + Features2=0x7ffafbbf<SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,SDBG, + FMA,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,TSCDLT,AESNI,XSAVE, + OSXSAVE,AVX,F16C,RDRAND> +``` + +So it's there! All good. + +## Basic Bhyve setup + +For the management of the Bhyve VMs, we are using `vm-bhyve`, a tool not part of the FreeBSD operating system but available as a ready-to-use package. It eases VM management and reduces a lot of the overhead. We also install the required package to make Bhyve work with the UEFI firmware. + +=> https://github.com/churchers/vm-bhyve + +The following commands are executed on all three hosts `f0`, `f1`, and `f2`, where `re0` is the name of the Ethernet interface (which may need to be adjusted if your hardware is different): + +```sh +paul@f0:~ % doas pkg install vm-bhyve bhyve-firmware +paul@f0:~ % doas sysrc vm_enable=YES +vm_enable: -> YES +paul@f0:~ % doas sysrc vm_dir=zfs:zroot/bhyve +vm_dir: -> zfs:zroot/bhyve +paul@f0:~ % doas zfs create zroot/bhyve +paul@f0:~ % doas vm init +paul@f0:~ % doas vm switch create public +paul@f0:~ % doas vm switch add public re0 +``` + +Bhyve stores all it's data in the `/bhyve` of the `zroot` ZFS pool: + +```sh +paul@f0:~ % zfs list | grep bhyve +zroot/bhyve 1.74M 453G 1.74M /zroot/bhyve +``` + +For convenience, we also create this symlink: + +```sh +paul@f0:~ % doas ln -s /zroot/bhyve/ /bhyve + +``` + +Now, Bhyve is ready to rumble, but no VMs are there yet: + +```sh +paul@f0:~ % doas vm list +NAME DATASTORE LOADER CPU MEMORY VNC AUTO STATE +``` + +## Rocky Linux VMs + +### ISO download + +We're going to install the Rocky Linux from the latest minimal iso: + +```sh +paul@f0:~ % doas vm iso \ + https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9.5-x86_64-minimal.iso +/zroot/bhyve/.iso/Rocky-9.5-x86_64-minimal.iso 1808 MB 4780 kBps 06m28s +paul@f0:/bhyve % doas vm create rocky +``` +### VM configuration + +The default configuration looks like this now: + +```sh +paul@f0:/bhyve/rocky % cat rocky.conf +loader="bhyveload" +cpu=1 +memory=256M +network0_type="virtio-net" +network0_switch="public" +disk0_type="virtio-blk" +disk0_name="disk0.img" +uuid="1c4655ac-c828-11ef-a920-e8ff1ed71ca0" +network0_mac="58:9c:fc:0d:13:3f" +``` + +Whereas the `uuid` and the `network0_mac` differ on each of the 3 hosts. + +but in order to make Rocky Linux boot it (plus some other adjustments, e.g. as I am intending to run the majority of the workload in the k3s cluster running on those linux VMs, I give them beefy specs like 4 CPU cores and 14GB RAM), I run `doas vm configure rocky` and modified it to: + +``` +guest="linux" +loader="uefi" +uefi_vars="yes" +cpu=4 +memory=14G +network0_type="virtio-net" +network0_switch="public" +disk0_type="virtio-blk" +disk0_name="disk0.img" +graphics="yes" +graphics_vga=io +uuid="1c45400b-c828-11ef-8871-e8ff1ed71cac" +network0_mac="58:9c:fc:0d:13:3f" +``` + +### VM installation + +To start the installer from the downloaded ISO, I run: + +```sh +paul@f0:~ % doas vm install rocky Rocky-9.5-x86_64-minimal.iso +Starting rocky + * found guest in /zroot/bhyve/rocky + * booting... + +paul@f0:/bhyve/rocky % doas vm list +NAME DATASTORE LOADER CPU MEMORY VNC AUTO STATE +rocky default uefi 4 14G 0.0.0.0:5900 No Locked (f0.lan.buetow.org) + +paul@f0:/bhyve/rocky % doas sockstat -4 | grep 5900 +root bhyve 6079 8 tcp4 *:5900 *:* +``` + +Port 5900 now also opened for VNC connections, so I connected to it with a VNC client and run through the installation dialogs. I'm sure this could be done unattended or more automated, there are only 3 VMs to install, and the automation doesn't seem worth it as we are doing it only once in a year or less often. + +### Increase of the disk image + +By default the VMs disk image is only 20G, which is a bit small for my purposes, so I stopped the VMs again and run `truncate` on the image file to enlarge them to 100G, and re-started the installation: + +```sh +paul@f0:/bhyve/rocky % doas vm stop rocky +paul@f0:/bhyve/rocky % doas truncate -s 100G disk0.img +paul@f0:/bhyve/rocky % doas vm install rocky Rocky-9.5-x86_64-minimal.iso +``` + +### Connect to VPN + +For the installation, I opened the VPN client on my Fedora laptop (GNOME comes with a simple VPN client) and ran through the base installation for each of the VMs manually. Again, I am sure this could have been automated a bit more, but there were just 3 VMs, and it wasn't worth the effort. The three VNC addresses of the VMs were: `vnc://f0:5900`, `vnc://f1:5900`, and `vnc://f0:5900`. + +I mostly selected the default settings (auto partitioning on the 100GB drive and a root user password). After the installation, the VMs were rebooted. + +## After install + +I performed the following steps for all 3 VMs. In the following, the examples are all executed on `f0` (bzw the VM `r0` running on `f0`): + +### VM auto-start after host reboot + +To automatically start the VM on the servers I added the following to the `rc.conf` on the FreeBSD hosts: + +```sh + +paul@f0:/bhyve/rocky % cat <<END | doas tee -a /etc/rc.conf +vm_list="rocky" +vm_delay="5" +``` + +The `vm_delay` isn't really required. It is used to wait 5 seconds before starting each VM, but as of now, there is only one VM per host. Maybe later, when there are more, this will be useful to have. After adding, there's now a `Yes` indicator in the `AUTO` column. + +```sh +paul@f0:~ % doas vm list +NAME DATASTORE LOADER CPU MEMORY VNC AUTO STATE +rocky default uefi 4 14G 0.0.0.0:5900 Yes [1] Running (2063) +``` + +### Static IP configuration + +After that, I changed the network configuration of the VMs to be static (from DHCP) here. As per previous post of this series, the 3 FreeBSD hosts were already in my `/etc/hosts` file: + +``` +192.168.1.130 f0 f0.lan f0.lan.buetow.org +192.168.1.131 f1 f1.lan f1.lan.buetow.org +192.168.1.132 f2 f2.lan f2.lan.buetow.org +``` + +For the Rocky VMs I added those to the FreeBSD hosts systems as well: + +```sh +paul@f0:/bhyve/rocky % cat <<END | doas tee -a /etc/hosts +192.168.1.120 r0 r0.lan r0.lan.buetow.org +192.168.1.121 r1 r1.lan r1.lan.buetow.org +192.168.1.122 r2 r2.lan r2.lan.buetow.org +END +``` + +and configured the IPs accordingly on the VMs themselves by opening a root shell via RDP to the VMs and entering the following commands on each of the VMs: + +```sh +[root@r0 ~] % dnmcli connection modify enp0s5 ipv4.address 192.168.1.120/24 +[root@r0 ~] % dnmcli connection modify enp0s5 ipv4.gateway 192.168.1.1 +[root@r0 ~] % dnmcli connection modify enp0s5 ipv4.dns 192.168.1.1 +[root@r0 ~] % dnmcli connection modify enp0s5 ipv4.method manual +[root@r0 ~] % dnmcli connection down enp0s5 +[root@r0 ~] % dnmcli connection up enp0s5 +[root@r0 ~] % hostnamectl set-hostname r0.lan.buetow.org +[root@r0 ~] % cat <<END >>/etc/hosts +192.168.1.120 r0 r0.lan r0.lan.buetow.org +192.168.1.121 r1 r1.lan r1.lan.buetow.org +192.168.1.122 r2 r2.lan r2.lan.buetow.org +END +```` + +Whereas: + +* `192.168.1.120` is the IP of the VM itself (here: `r0.lan.buetow.org`) +* `192.168.1.1` is the address of my home router, which also does DNS. + +### Permitting root login + +As these VMs arent directly reachable via SSH from the internet, I enabled `root` login by adding a line with `PermitRootLogin yes` to `/etc/sshd/sshd_config`. + +Once done, I rebooted the VM by running `reboot` inside of the vm to test whether everything was configured and persisted correctly. + +After reboot, I copied my public key from my Laptop to the 3 VMs: + +```sh +% for i in 0 1 2; do ssh-copy-id root@r$i.lan.buetow.org; done +``` + +And then I edited the `/etc/ssh/sshd_config` file again on all 3 VMs and configured `PasswordAuthentication no`, to only allow SSH key authentication from now on. + +### Install latest updates + +```sh +[root@r0 ~] % dnf update +[root@r0 ~] % dreboot +``` + +CPU STRESS TESTER VM VS NOT VM + +Other *BSD-related posts: + +=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts +=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation +=> ./2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi 2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage +=> ./2024-04-01-KISS-high-availability-with-OpenBSD.gmi 2024-04-01 KISS high-availability with OpenBSD +=> ./2024-01-13-one-reason-why-i-love-openbsd.gmi 2024-01-13 One reason why I love OpenBSD +=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD +=> ./2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi 2022-07-30 Let's Encrypt with OpenBSD and Rex +=> ./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi 2016-04-09 Jails and ZFS with Puppet on FreeBSD + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/DRAFT-f3s-kubernetes-with-freebsd-part-4.gmi.tpl b/gemfeed/DRAFT-f3s-kubernetes-with-freebsd-part-4.gmi.tpl new file mode 100644 index 00000000..1e0aef5f --- /dev/null +++ b/gemfeed/DRAFT-f3s-kubernetes-with-freebsd-part-4.gmi.tpl @@ -0,0 +1,254 @@ +# f3s: Kubernetes with FreeBSD - Rocky Linux Bhyve VMs - Part 4 + +This is the thourth 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. + +<< template::inline::index f3s-kubernetes-with-freebsd-part + +=> ./f3s-kubernetes-with-frhyveeebsd-part-1/f3slogo.png f3s logo + +<< template::inline::toc + +## Introduction + +In this blog post, we are going to install the Bhyve hypervisor. + +The FreeBSD Bhyve hypervisor is a lightweight, modern hypervisor that enables virtualization on FreeBSD systems. Bhyve's strengths include its minimal overhead, which allows it to achieve near-native performance for virtual machines. It is designed to be efficient and lightweight, leveraging the capabilities of the FreeBSD operating system for performance and network management. + +Bhyve supports running a variety of guest operating systems, including FreeBSD, Linux, and Windows, on hardware platforms that support hardware virtualization extensions (such as Intel VT-x or AMD-V). In our case, we are going to virtualize Rocky Linux, which later on in this series will be used to run k3s. + +## Check for `POPCNT` CPU support + +POPCNT is a CPU instruction that counts the number of set bits (ones) in a binary number. In terms of CPU virtualization and Bhyve support for the POPCNT instruction is important because guest operating systems utilize this instruction to perform various tasks more efficiently. If the host CPU supports POPCNT, Bhyve can pass this capability to virtual machines to for better performance. Without POPCNT support, some applications might not run, or they might perform suboptimally in virtualized environments. + +To check for `POPCNT` support, I run: + +```sh +paul@f0:~ % dmesg | grep 'Features2=.*POPCNT' + Features2=0x7ffafbbf<SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,SDBG, + FMA,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,TSCDLT,AESNI,XSAVE, + OSXSAVE,AVX,F16C,RDRAND> +``` + +So it's there! All good. + +## Basic Bhyve setup + +For the management of the Bhyve VMs, we are using `vm-bhyve`, a tool not part of the FreeBSD operating system but available as a ready-to-use package. It eases VM management and reduces a lot of the overhead. We also install the required package to make Bhyve work with the UEFI firmware. + +=> https://github.com/churchers/vm-bhyve + +The following commands are executed on all three hosts `f0`, `f1`, and `f2`, where `re0` is the name of the Ethernet interface (which may need to be adjusted if your hardware is different): + +```sh +paul@f0:~ % doas pkg install vm-bhyve bhyve-firmware +paul@f0:~ % doas sysrc vm_enable=YES +vm_enable: -> YES +paul@f0:~ % doas sysrc vm_dir=zfs:zroot/bhyve +vm_dir: -> zfs:zroot/bhyve +paul@f0:~ % doas zfs create zroot/bhyve +paul@f0:~ % doas vm init +paul@f0:~ % doas vm switch create public +paul@f0:~ % doas vm switch add public re0 +``` + +Bhyve stores all it's data in the `/bhyve` of the `zroot` ZFS pool: + +```sh +paul@f0:~ % zfs list | grep bhyve +zroot/bhyve 1.74M 453G 1.74M /zroot/bhyve +``` + +For convenience, we also create this symlink: + +```sh +paul@f0:~ % doas ln -s /zroot/bhyve/ /bhyve + +``` + +Now, Bhyve is ready to rumble, but no VMs are there yet: + +```sh +paul@f0:~ % doas vm list +NAME DATASTORE LOADER CPU MEMORY VNC AUTO STATE +``` + +## Rocky Linux VMs + +### ISO download + +We're going to install the Rocky Linux from the latest minimal iso: + +```sh +paul@f0:~ % doas vm iso \ + https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9.5-x86_64-minimal.iso +/zroot/bhyve/.iso/Rocky-9.5-x86_64-minimal.iso 1808 MB 4780 kBps 06m28s +paul@f0:/bhyve % doas vm create rocky +``` +### VM configuration + +The default configuration looks like this now: + +```sh +paul@f0:/bhyve/rocky % cat rocky.conf +loader="bhyveload" +cpu=1 +memory=256M +network0_type="virtio-net" +network0_switch="public" +disk0_type="virtio-blk" +disk0_name="disk0.img" +uuid="1c4655ac-c828-11ef-a920-e8ff1ed71ca0" +network0_mac="58:9c:fc:0d:13:3f" +``` + +Whereas the `uuid` and the `network0_mac` differ on each of the 3 hosts. + +but in order to make Rocky Linux boot it (plus some other adjustments, e.g. as I am intending to run the majority of the workload in the k3s cluster running on those linux VMs, I give them beefy specs like 4 CPU cores and 14GB RAM), I run `doas vm configure rocky` and modified it to: + +``` +guest="linux" +loader="uefi" +uefi_vars="yes" +cpu=4 +memory=14G +network0_type="virtio-net" +network0_switch="public" +disk0_type="virtio-blk" +disk0_name="disk0.img" +graphics="yes" +graphics_vga=io +uuid="1c45400b-c828-11ef-8871-e8ff1ed71cac" +network0_mac="58:9c:fc:0d:13:3f" +``` + +### VM installation + +To start the installer from the downloaded ISO, I run: + +```sh +paul@f0:~ % doas vm install rocky Rocky-9.5-x86_64-minimal.iso +Starting rocky + * found guest in /zroot/bhyve/rocky + * booting... + +paul@f0:/bhyve/rocky % doas vm list +NAME DATASTORE LOADER CPU MEMORY VNC AUTO STATE +rocky default uefi 4 14G 0.0.0.0:5900 No Locked (f0.lan.buetow.org) + +paul@f0:/bhyve/rocky % doas sockstat -4 | grep 5900 +root bhyve 6079 8 tcp4 *:5900 *:* +``` + +Port 5900 now also opened for VNC connections, so I connected to it with a VNC client and run through the installation dialogs. I'm sure this could be done unattended or more automated, there are only 3 VMs to install, and the automation doesn't seem worth it as we are doing it only once in a year or less often. + +### Increase of the disk image + +By default the VMs disk image is only 20G, which is a bit small for my purposes, so I stopped the VMs again and run `truncate` on the image file to enlarge them to 100G, and re-started the installation: + +```sh +paul@f0:/bhyve/rocky % doas vm stop rocky +paul@f0:/bhyve/rocky % doas truncate -s 100G disk0.img +paul@f0:/bhyve/rocky % doas vm install rocky Rocky-9.5-x86_64-minimal.iso +``` + +### Connect to VPN + +For the installation, I opened the VPN client on my Fedora laptop (GNOME comes with a simple VPN client) and ran through the base installation for each of the VMs manually. Again, I am sure this could have been automated a bit more, but there were just 3 VMs, and it wasn't worth the effort. The three VNC addresses of the VMs were: `vnc://f0:5900`, `vnc://f1:5900`, and `vnc://f0:5900`. + +I mostly selected the default settings (auto partitioning on the 100GB drive and a root user password). After the installation, the VMs were rebooted. + +## After install + +I performed the following steps for all 3 VMs. In the following, the examples are all executed on `f0` (bzw the VM `r0` running on `f0`): + +### VM auto-start after host reboot + +To automatically start the VM on the servers I added the following to the `rc.conf` on the FreeBSD hosts: + +```sh + +paul@f0:/bhyve/rocky % cat <<END | doas tee -a /etc/rc.conf +vm_list="rocky" +vm_delay="5" +``` + +The `vm_delay` isn't really required. It is used to wait 5 seconds before starting each VM, but as of now, there is only one VM per host. Maybe later, when there are more, this will be useful to have. After adding, there's now a `Yes` indicator in the `AUTO` column. + +```sh +paul@f0:~ % doas vm list +NAME DATASTORE LOADER CPU MEMORY VNC AUTO STATE +rocky default uefi 4 14G 0.0.0.0:5900 Yes [1] Running (2063) +``` + +### Static IP configuration + +After that, I changed the network configuration of the VMs to be static (from DHCP) here. As per previous post of this series, the 3 FreeBSD hosts were already in my `/etc/hosts` file: + +``` +192.168.1.130 f0 f0.lan f0.lan.buetow.org +192.168.1.131 f1 f1.lan f1.lan.buetow.org +192.168.1.132 f2 f2.lan f2.lan.buetow.org +``` + +For the Rocky VMs I added those to the FreeBSD hosts systems as well: + +```sh +paul@f0:/bhyve/rocky % cat <<END | doas tee -a /etc/hosts +192.168.1.120 r0 r0.lan r0.lan.buetow.org +192.168.1.121 r1 r1.lan r1.lan.buetow.org +192.168.1.122 r2 r2.lan r2.lan.buetow.org +END +``` + +and configured the IPs accordingly on the VMs themselves by opening a root shell via RDP to the VMs and entering the following commands on each of the VMs: + +```sh +[root@r0 ~] % dnmcli connection modify enp0s5 ipv4.address 192.168.1.120/24 +[root@r0 ~] % dnmcli connection modify enp0s5 ipv4.gateway 192.168.1.1 +[root@r0 ~] % dnmcli connection modify enp0s5 ipv4.dns 192.168.1.1 +[root@r0 ~] % dnmcli connection modify enp0s5 ipv4.method manual +[root@r0 ~] % dnmcli connection down enp0s5 +[root@r0 ~] % dnmcli connection up enp0s5 +[root@r0 ~] % hostnamectl set-hostname r0.lan.buetow.org +[root@r0 ~] % cat <<END >>/etc/hosts +192.168.1.120 r0 r0.lan r0.lan.buetow.org +192.168.1.121 r1 r1.lan r1.lan.buetow.org +192.168.1.122 r2 r2.lan r2.lan.buetow.org +END +```` + +Whereas: + +* `192.168.1.120` is the IP of the VM itself (here: `r0.lan.buetow.org`) +* `192.168.1.1` is the address of my home router, which also does DNS. + +### Permitting root login + +As these VMs arent directly reachable via SSH from the internet, I enabled `root` login by adding a line with `PermitRootLogin yes` to `/etc/sshd/sshd_config`. + +Once done, I rebooted the VM by running `reboot` inside of the vm to test whether everything was configured and persisted correctly. + +After reboot, I copied my public key from my Laptop to the 3 VMs: + +```sh +% for i in 0 1 2; do ssh-copy-id root@r$i.lan.buetow.org; done +``` + +And then I edited the `/etc/ssh/sshd_config` file again on all 3 VMs and configured `PasswordAuthentication no`, to only allow SSH key authentication from now on. + +### Install latest updates + +```sh +[root@r0 ~] % dnf update +[root@r0 ~] % dreboot +``` + +CPU STRESS TESTER VM VS NOT VM + +Other *BSD-related posts: + +<< template::inline::rindex bsd + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/DRAFT-site-reliability-engineering.gmi.tpl b/gemfeed/DRAFT-site-reliability-engineering.gmi.tpl new file mode 100644 index 00000000..be26119e --- /dev/null +++ b/gemfeed/DRAFT-site-reliability-engineering.gmi.tpl @@ -0,0 +1,152 @@ +## System Design and Incident Analysis: Building Resilience in the SRE Landscape + +A significant portion of the work revolves around system design and incident analysis. + +The first axiom is the acceptance of a bitter truth: things will always break. No matter the precision of which a system is crafted, the inevitability of failures looms large. However, what distinguishes a well-designed system from a mediocre one is its ability to minimise and contain cascading failures. These failures, if left unchecked, can spiral into global outages with come with consequences. + +There's a growing emphasis on building resilient systems to avoid such cascading failures to circumvent this. Such resilience requires foresight in system design, wherein potential weakpoints are identified and addressed before deployed to production. Prevention is better than cure. The primary objective is ensuring that services remain uninterrupted and dependable. + +Yet, despite these preventative measures, when incidents do arise, their analysis becomes a goldmine of learning. Every incident exposes gaps within the system. Instead of attributing these incidents to nebulous concepts like "human error," the onus is on dissecting them to uncover underlying systemic issues. Whether it's a tooling gap where operational tools prove insufficient or an operational expertise gap where engineers lack critical skills, incident analysis shines a light on these deficiencies. + +In doing so, incident analysis is about rectifying the immediate issue and learning and evolving the system design. Every incident offers an opportunity, a feedback loop, to refine the system further. Through rigorous postmortems focusing on customer impact, organisations can distil valuable lessons. These lessons, when incorporated, make the system more robust and less susceptible to similar failures in the future. + +Moreover, as systems grow more complex, the importance of observability tools cannot be overstated. These tools, designed to query against high cardinality data, provide granular insights into system operations. They enable engineers to diagnose problems rapidly, especially in the chaotic aftermath of an incident, giving clarity amidst the turmoil. + +In conclusion, the symbiotic relationship between system design and incident analysis underscores the evolving ethos of SRE. While impeccable system design lays the foundation for reliable operations, incident analysis ensures that this foundation remains robust and dynamic, adapting to challenges. Together, they form the pillars of a resilient, customer-centric service environment that stands the test of time. + +Add paragraph about product wants features, but observability is often an afterthought. So often, during an incident, people start agreeing, and then it was already too late. + +=> add 6 minutes to wt. + +## The Heroic Facade and Team Dynamics: Rethinking Success in SRE + +The realm of Site Reliability Engineering is punctuated by the constant ebb and flow of system challenges. While individual excellence is commendable, the overarching belief in the SRE culture should be that true success lies in cohesive teamwork and not in individual heroics. + +he SRE Hero is an anti-pattern that can occur when a few individuals consistently step in to save the day during incidents or emergencies, earning themselves the status of heroes. While this might seem positive at first, it can lead to several negative outcomes and should be addressed to ensure the reliability and sustainability of the SRE team's operations. These individuals might possess specialized knowledge, quick problem-solving skills, or simply a willingness to work long hours. As a result, they become the go-to people whenever something goes wrong. + +This culture can emerge for various reasons: + +- Immediate Problem Solving: Heroes are praised for their ability to solve issues quickly. However, this may lead to bypassing proper post-incident analysis and learning, as the focus is on getting systems up and running as fast as possible. + +- Burnout and Fatigue: Heroes are often overworked and stressed, leading to burnout and high turnover rates. + +- Skill Asymmetry: If only a few team members possess specific knowledge or skills, others may not have the chance to learn, grow, and take on more responsibilities. + +- Dependency: Teams become dependent on heroes, leading to a lack of collaboration and shared ownership of systems. + +How can you fix it? + +- Incident Reviews and Post-Mortems: Conduct thorough post-incident reviews to understand the root causes of issues. Focus on learning and prevention rather than just quick fixes. + +- Distribute Knowledge: Encourage knowledge sharing by documenting incidents, solutions, and best practices. Consider implementing a knowledge-sharing platform or wiki. + +- Rotating Responsibilities: Rotate on-call and incident response responsibilities among team members. This prevents burnout and ensures that everyone gains experience. + +- Automation and Tooling: Develop automation and tools that enable the entire team to handle incidents more effectively, reducing the reliance on individual heroics. + +- Training and Skill Development: Provide training and resources to help all team members enhance their skills. This levels the playing field and reduces skill asymmetry. + +- Recognize Collaborative Efforts: Shift the focus from individual heroics to collaborative efforts. Recognize and reward team members who contribute to preventive measures, incident response improvements, and system stability. + +- Leadership Support: Management should actively support efforts to address the hero culture. This might involve setting expectations for collaboration, learning, and shared responsibility. + +- Celebrate Learning: Emphasize that learning from failures is a positive outcome. This encourages a culture of continuous improvement rather than blame. + +By addressing the hero culture and fostering a collaborative, learning-oriented environment, SRE teams can enhance their overall effectiveness, prevent burnout, and ensure the long-term stability of the systems they manage. + + + + +The allure of the "hero" is undeniable. There's a certain appeal in being the one who swoops in, fixes critical incidents, and saves the day. However, this hero culture, while often romanticised, has its pitfalls. Heroes are necessary, no doubt, but a hero culture can often obscure the collaborative essence of SRE. Recognising that heroes do their best work as part of a team is a profound acknowledgement that true heroes don't need a hero culture to excel. + +The danger of a hero-driven approach is that it can lead to an over-reliance on specific individuals. The assumption that certain team members will always be there to address and mitigate issues can be a dangerous precedent. It fosters a reactive culture rather than a proactive one. Instead of developing inherently more resilient and reliable systems, the organisation starts relying on these heroes as a Band-Aid® solution, masking deeper systemic problems. + +A further dimension to this issue is the impact on team morale. Continually being in the spotlight, heroes might be inadvertently sidelining other team members, leading to feelings of underappreciation or undervaluation. Such a dynamic can hinder sharing knowledge, collaboration, and preparation – the pillars that successful SRE teams are built on. + +However, this isn't to say that individual excellence should be curbed. Instead, it's about shifting the narrative. Building a team culture based on collaboration ensures that knowledge sharing becomes second nature. Such an environment propels teams towards a dynamic where preparation and proactive measures are valued over-reactive heroics. When success stories are shared as a collective win, it boosts team morale and fosters a sense of shared responsibility. + +In the broader spectrum of SRE, it's also crucial to recognise the silent work – the preventive measures, the well-thought-out systems, the meticulous planning – that ensures incidents don't occur. This proactive approach often goes unnoticed because, in a well-functioning system, the absence of issues is the norm. But this 'silence' is a testament to a team working harmoniously, with every member contributing towards system reliability. + +To conclude, while the heroics in SRE can often be the stuff of legends, it's vital to see beyond this facade. The countless hours of teamwork, collaboration, and shared responsibility lie in the shadows of these heroic acts. The future of SRE lies not in individual heroics but in teams that operate like well-oiled machines, with every cog, big or small, playing its part to perfection. + +## Monitoring, Observability, and the SRE Arsenal: Navigating the Nuances of System Reliability + +Site Reliability Engineering is characterised by a relentless quest for reliability, uptime, and seamless user experiences. Within this universe, the notions of monitoring and observability emerge not as mere tools but as critical lifelines that guide decision-making, error diagnosis, and preventive strategies. + +At its core, monitoring is vigilantly monitoring system health, alerting engineers to potential anomalies that might adversely impact system performance or availability. Every alert is treated as an exceptional circumstance warranting immediate attention. However, it's worth noting that only some alerts translate into genuine threats. As such, if an alert merely adds noise without substance, the onus is on refining the monitoring system to filter out such distractions. This process of continuous refinement underscores the dynamism inherent in effective monitoring. + +In tandem with monitoring is the concept of observability. Beyond just knowing that something went wrong, observability equips engineers with the 'why.' It offers a deep dive into the system's intricate operations, allowing for a granular understanding of its behaviours. Observability tools designed to query against high cardinality data become the SRE's best allies in this endeavour. They help comprehensively diagnose problems, especially when conventional monitoring alerts might not capture the nuanced layers of an issue. + +However, monitoring and observability aren't standalone entities; they feed into the broader ambit of error budgets, service level objectives (SLOs), and service level indicators (SLIs). These metrics and frameworks collectively serve as a mirror, reflecting the true health of services. While SLIs define quantitative measures about the reliability of services, SLOs set targets for these measures. On the other hand, error budgets provide a tangible metric of 'how wrong things can go' before the service quality deteriorates below acceptable levels. + +Yet, the human element remains paramount amidst this arsenal of tools and methodologies. No matter how sophisticated, observational tools are only as valuable as the engineers wielding them. It demands a spirit of curiosity, a relentless quest for knowledge, and a willingness to delve deep into data-driven narratives. SREs, therefore, need to be both technically adept and intrinsically motivated to leverage these tools to their fullest potential. + +To sum it up, monitoring and observability play pivotal roles in the intricate dance of system reliability. They are the compass and map, guiding SREs through the labyrinthine challenges of modern systems. By leveraging them effectively and in conjunction with other SRE methodologies, organisations can achieve the zenith of reliability, ensuring that their services remain robust, resilient, and remarkably user-centric. + +## The Ever-evolving Landscape of SRE + +To begin, the very fabric of SRE is interwoven with organisational culture. Successful SRE adoption transcends the mere automation of software operations—it is deeply cultural. It demands a seismic shift in how organisations perceive failures, value preventative work, and prioritise communication. In such an environment, writing is not just a skill but a critical tool for reliability. Precise communication enhances clarity, mitigates risks, and facilitates collaboration. + +Central to SRE's operational philosophy is the balance between innovation and stability. Every system has its error budget, representing the acceptable threshold of issues before service quality falls below expectations. These error budgets are more than mere metrics—they guide decisions, helping organisations balance pushing new features and ensuring system reliability. Such operational nuances remind us that while things will inevitably break in the engineering world, the informed response, driven by data and proactive work, sets SRE apart. + +However, the brilliance of SRE is not merely in the systems but the people powering it. The human element in SRE is both its strength and vulnerability. On the one hand, SREs must be ceaselessly curious, ready to adopt new learnings, and willing to iterate rapidly. On the other, the high-stakes environment and demanding on-call rotations place them at risk of burnout. It's a stark reminder that while systems need monitoring, the well-being of those who maintain them is equally crucial. Organisations must ensure that on-call schedules are sustainable, mentorship is available, and continuous learning is encouraged. + +The SRE world is also marked by its vast arsenal of monitoring systems, observability tools, postmortems, and more. These tools, designed for high cardinality data querying, are pivotal in diagnosing problems, especially when traditional monitoring might miss the subtleties. Yet, tools alone aren't the panacea. The SRE's mindset, the ability to discern tooling gaps, operational expertise voids, and resource inadequacies truly elevates the discipline. + +In conclusion, as a discipline, SRE is a beacon of continuous evolution. As systems grow more complex and user expectations rise, the SRE landscape will inevitably shift, demanding adaptability, resilience, and foresight from its practitioners. But in this ever-changing terrain, the core tenets remain—balancing innovation with reliability, valuing human well-being, and leveraging tools and data for informed decision-making. In the grand tapestry of engineering, SRE stands out as a dynamic, challenging, yet immensely rewarding realm, ever-responsive to the rhythms of technology and human ingenuity. + +## Effective Communication and Collaboration in SRE + +Site Reliability Engineering is not merely a technical discipline. At its core, SRE underscores the importance of effective communication and collaboration as critical tenets of a resilient and efficient system. + +The dynamics of modern organisations, especially those heavily reliant on technology, present systems of such complexity that no single individual possesses a complete understanding. As highlighted from the insights, "Each person inside an organisation has only a partial understanding of how the overall system works." Such compartmentalisation necessitates a culture of open communication and collaboration to ensure that different components, managed by other teams, work in harmony. + +The importance of communication is not just limited to the intra-team dynamics but extends to how teams convey the value of their work, especially the preventive work that pre-empts potential incidents. As many SREs might attest, we live in a data-driven world, but capturing the metrics on incidents that didn't occur due to preventive measures is a challenge. This highlights the need for SREs to be adept at articulating the significance of their roles and their actions to ensure system reliability. It's about making the invisible work visible, ensuring stakeholders understand the value delivered. + +Further emphasising the role of communication, the insights suggest, "Writing is good for reliability; the more precise, the better." Precise communication, whether in documentation, runbooks, or postmortems, is essential for ensuring that every team member, whether an SRE or from an allied discipline, is on the same page. It mitigates the risk of misunderstandings that could compromise system reliability. + +On the other side of the coin is collaboration. An SRE's role frequently involves liaising with various teams, be it developers, back-end teams, or dedicated incident response teams. Effective collaboration with these teams is crucial in a crisis. When cascading failures occur and overload symptoms present simultaneously, this culture of collaboration can make the difference between swift mitigation and a full-blown global outage. + +Furthermore, the insights provide a perspective against fostering a hero culture. "Recognise that heroes do their best work as part of a team, and true heroes don't need a hero culture to do good." Such a sentiment emphasises the collective over the individual. It's a call to ensure team dynamics are built on mutual respect, trust, and a shared understanding of goals rather than relying on individual brilliance. + +In conclusion, while SRE is deeply technical, its efficacy is intertwined with the soft skills of communication and collaboration. As systems grow more intricate and the stakes rise, the ability to communicate clearly and collaborate effectively will distinguish successful SRE teams from the rest. It's a reminder that there are people at the heart of every machine, every line of code, and nurturing human connections is paramount to ensuring machine efficiency. + +## Inherent Curiosity and Continual Learning in SRE + +The realm of Site Reliability Engineering is expansive, dynamic, and deeply integrated with the ever-evolving technological landscape. It's evident that an essential trait underpinning successful SRE practice combines inherent curiosity and an unwavering commitment to continual learning. + +Within modern organisations, technology infrastructures have burgeoned into complex ecosystems. It's been highlighted that "each person inside an organisation has only a partial understanding of how the overall system works." In such an environment, an SRE cannot afford to be siloed or static in their knowledge. The intricacies of systems and the myriad of potential issues necessitate that SREs possess an innate curiosity. It's this curiosity that drives them to explore beyond their immediate purview, to question why systems behave the way they do, and to unravel the intricacies that lie beneath surface-level observations. + +Yet, curiosity alone isn't enough. The pace at which technology evolves is staggering. New tools emerge architectural paradigms shift, and what was once a best practice might become obsolete in a short span. To keep up with this dynamism, SREs need to be invested in continual learning. Whether mastering a new observability tool designed for high cardinality data or understanding the nuances of error budgets and their implications, SREs must be lifelong learners. + +This commitment to learning is about more than just keeping up-to-date with tools and practices. It's about broadening one's horizon and developing a holistic understanding of systems. As cascading failures emerge and system outages threaten, an SRE with a comprehensive knowledge base built on continual learning is better equipped to identify root causes, devise mitigation strategies, and ensure system resilience. + +Furthermore, as we glean from the insights, there's a marked shift in the perception of SRE as a discipline. We're transitioning into an era where "an SRE mindset will be an important hiring requirement for every engineering role." Such a shift implies that the principles of SRE are becoming fundamental to the broader engineering domain. And at the heart of this mindset is the thirst for knowledge and the spirit of exploration. + +In conclusion, the world of Site Reliability Engineering is not for the complacent. It's a domain that rewards the curious, the seekers, and those with an insatiable appetite for knowledge. As systems grow in complexity and the stakes become higher, this inherent curiosity and dedication to continual learning will define the success and resilience of SRE endeavours. The journey of an SRE, thus, is one of perpetual exploration, driven by the quest to know more and do better. + +## The Iterative Spirit of SRE + +Site Reliability Engineering is more than just a technical discipline; it embodies a mindset that embraces iteration, proactive problem-solving, and continuous enhancement. + +At the core of the SRE ethos lies the principle that prevention trumps cure. To build systems resilient to cascading failures and ensure that user impact is minimised, SREs work diligently to improve system designs. However, a crucial component of this prevention strategy is recognising that system designs will never be perfect. Instead, they are continually refined based on real-world performance, learnings from incidents, and shifting user needs. By leveraging tools like error budgets and performance metrics, SREs can gauge the effectiveness of their systems, identify areas of concern, and make informed decisions about where to allocate resources for improvements. + +Moreover, the SRE approach to incident analysis further underscores this iterative spirit. No matter how minor, every incident is viewed as an opportunity to learn. Incidents expose gaps, areas where the system's design or execution fell short. Through postmortems focusing on customer impact and detailed investigations, these gaps become learning avenues, leading to system refinements. The emphasis isn't on apportioning blame but on extracting insights that can fuel the next iteration of the system. + +In conjunction with system design, the tools and practices employed by SREs are also subject to this iterative refinement. Observability tools designed for high cardinality data, rollback automation, and failover tooling are all components of the SRE arsenal, but their effectiveness isn't taken for granted. SREs are consistently evaluating the efficacy of their tools, ensuring that they align with the current system demands and making enhancements as required. The idea is not to find the 'perfect' tool but to recognise that as systems evolve, the tools to manage them must evolve in tandem. + +Finally, the SRE's iterative spirit extends to collaboration and communication. The continual drive to enhance and refine is not a solitary endeavour. SREs actively collaborate with developers, back-end teams, and dedicated incident response units. This collaborative approach ensures that diverse perspectives contribute to the iterative process and collective wisdom is harnessed. + +In summary, the essence of Site Reliability Engineering is characterised by an iterative spirit, a recognition that perfection is a journey, not a destination. Whether refining system designs, enhancing tooling or fostering collaborative dialogues, SREs are always looking for the next improvement, refinement, and iteration. It's this spirit that ensures systems are reliable and continually evolving to meet the ever-changing demands of the digital age. + +## The role of simplicity Simplicity + +## Book tips + +* 97 Things Every SRE Should Know: Collective Wisdom from the Experts by Emily Stolarsky and Jaime Woo +* Site Reliability Engineering: How Google runs Production Systems by by Jennifer Petoff, Niall Murphy, Betsy Beyer and Chris Jones +* Implementing Service Level Objectives by Alex Hidalgo + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/gemfeed/atom.xml b/gemfeed/atom.xml index e17c38f6..7f86085a 100644 --- a/gemfeed/atom.xml +++ b/gemfeed/atom.xml @@ -1,12 +1,2413 @@ <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> - <updated>2024-08-05T22:08:22+03:00</updated> + <updated>2025-02-13T10:21:17+02:00</updated> <title>foo.zone feed</title> <subtitle>To be in the .zone!</subtitle> <link href="gemini://foo.zone/gemfeed/atom.xml" rel="self" /> <link href="gemini://foo.zone/" /> <id>gemini://foo.zone/</id> <entry> + <title>Random Weird Things - Part Ⅱ</title> + <link href="gemini://foo.zone/gemfeed/2025-02-08-random-weird-things-ii.gmi" /> + <id>gemini://foo.zone/gemfeed/2025-02-08-random-weird-things-ii.gmi</id> + <updated>2025-02-08T11:06:16+02:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>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.</summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='random-weird-things---part-'>Random Weird Things - Part Ⅱ</h1><br /> +<br /> +<span class='quote'>Published at 2025-02-08T11:06:16+02:00</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<a class='textlink' href='./2024-07-05-random-weird-things.html'>2024-07-05 Random Weird Things - Part Ⅰ</a><br /> +<a class='textlink' href='./2025-02-08-random-weird-things-ii.html'>2025-02-08 Random Weird Things - Part Ⅱ (You are currently reading this)</a><br /> +<br /> +<pre> +/\_/\ /\_/\ +( o.o ) WHOA!! ( o.o ) +> ^ < > ^ < +/ \ MOEEW! / \ +/______\ /______\ +</pre> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#random-weird-things---part-'>Random Weird Things - Part Ⅱ</a></li> +<li>⇢ <a href='#11-the-sqlite-codebase-is-a-gem'>11. The SQLite codebase is a gem</a></li> +<li>⇢ <a href='#go-programming'>Go Programming</a></li> +<li>⇢ ⇢ <a href='#12-official-go-font'>12. Official Go font</a></li> +<li>⇢ ⇢ <a href='#13-go-functions-can-have-methods'>13. Go functions can have methods</a></li> +<li>⇢ <a href='#macos'>macOS</a></li> +<li>⇢ ⇢ <a href='#14--and-ss-are-treated-the-same'>14. ß and ss are treated the same</a></li> +<li>⇢ ⇢ <a href='#15-colon-as-file-path-separator'>15. Colon as file path separator</a></li> +<li>⇢ <a href='#16-polyglots---programs-written-in-multiple-languages'>16. Polyglots - programs written in multiple languages</a></li> +<li>⇢ <a href='#17-languages-where-indices-start-at-1'>17. Languages, where indices start at 1</a></li> +<li>⇢ <a href='#18-perl-poetry'>18. Perl Poetry</a></li> +<li>⇢ <a href='#19-css3-is-turing-complete'>19. CSS3 is turing complete</a></li> +<li>⇢ <a href='#20-the-biggest-shell-programs-'>20. The biggest shell programs </a></li> +</ul><br /> +<h2 style='display: inline' id='11-the-sqlite-codebase-is-a-gem'>11. The SQLite codebase is a gem</h2><br /> +<br /> +<span>Check this out:</span><br /> +<br /> +<a href='./random-weird-things-ii/sqlite-gem.png'><img alt='SQLite Gem' title='SQLite Gem' src='./random-weird-things-ii/sqlite-gem.png' /></a><br /> +<br /> +<span>Source:</span><br /> +<br /> +<a class='textlink' href='https://wetdry.world/@memes/112717700557038278'>https://wetdry.world/@memes/112717700557038278</a><br /> +<br /> +<h2 style='display: inline' id='go-programming'>Go Programming</h2><br /> +<br /> +<h3 style='display: inline' id='12-official-go-font'>12. Official Go font</h3><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>Check out some Go code displayed using the Go font:</span><br /> +<br /> +<a href='./random-weird-things-ii/go-font-code.png'><img alt='Go font code' title='Go font code' src='./random-weird-things-ii/go-font-code.png' /></a><br /> +<br /> +<a class='textlink' href='https://go.dev/blog/go-fonts'>https://go.dev/blog/go-fonts</a><br /> +<br /> +<span>The design emphasizes simplicity and readability, reflecting Go's philosophy of clarity and efficiency.</span><br /> +<br /> +<span>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 :-) </span><br /> +<br /> +<h3 style='display: inline' id='13-go-functions-can-have-methods'>13. Go functions can have methods</h3><br /> +<br /> +<span>Functions on struct types? Well, know. Functions on types like <span class='inlinecode'>int</span> and <span class='inlinecode'>string</span>? 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:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><b><u><font color="#000000">package</font></u></b> main + +<b><u><font color="#000000">import</font></u></b> <font color="#808080">"log"</font> + +<b><u><font color="#000000">type</font></u></b> fun <b><u><font color="#000000">func</font></u></b>() <b><font color="#000000">string</font></b> + +<b><u><font color="#000000">func</font></u></b> (f fun) Bar() <b><font color="#000000">string</font></b> { + <b><u><font color="#000000">return</font></u></b> <font color="#808080">"Bar"</font> +} + +<b><u><font color="#000000">func</font></u></b> main() { + <b><u><font color="#000000">var</font></u></b> f fun = <b><u><font color="#000000">func</font></u></b>() <b><font color="#000000">string</font></b> { + <b><u><font color="#000000">return</font></u></b> <font color="#808080">"Foo"</font> + } + log.Println(<font color="#808080">"Example 1: "</font>, f()) + log.Println(<font color="#808080">"Example 2: "</font>, f.Bar()) + log.Println(<font color="#808080">"Example 3: "</font>, fun(f.Bar).Bar()) + log.Println(<font color="#808080">"Example 4: "</font>, fun(fun(f.Bar).Bar).Bar()) +} +</pre> +<br /> +<span>It runs just fine:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>❯ go run main.go +<font color="#000000">2025</font>/<font color="#000000">02</font>/<font color="#000000">07</font> <font color="#000000">22</font>:<font color="#000000">56</font>:<font color="#000000">14</font> Example <font color="#000000">1</font>: Foo +<font color="#000000">2025</font>/<font color="#000000">02</font>/<font color="#000000">07</font> <font color="#000000">22</font>:<font color="#000000">56</font>:<font color="#000000">14</font> Example <font color="#000000">2</font>: Bar +<font color="#000000">2025</font>/<font color="#000000">02</font>/<font color="#000000">07</font> <font color="#000000">22</font>:<font color="#000000">56</font>:<font color="#000000">14</font> Example <font color="#000000">3</font>: Bar +<font color="#000000">2025</font>/<font color="#000000">02</font>/<font color="#000000">07</font> <font color="#000000">22</font>:<font color="#000000">56</font>:<font color="#000000">14</font> Example <font color="#000000">4</font>: Bar +</pre> +<br /> +<h2 style='display: inline' id='macos'>macOS</h2><br /> +<br /> +<span>For personal computing, I don't use Apple, but I have to use it for work. </span><br /> +<br /> +<h3 style='display: inline' id='14--and-ss-are-treated-the-same'>14. ß and ss are treated the same</h3><br /> +<br /> +<span>Know German? In German, the letter "sarp s" is written as ß. ß is treated the same as ss on macOS.</span><br /> +<br /> +<span>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").</span><br /> +<br /> +<span>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:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>❯ touch Maß +❯ ls -l +-rw-r--r--@ <font color="#000000">1</font> paul wheel <font color="#000000">0</font> Feb <font color="#000000">7</font> <font color="#000000">23</font>:<font color="#000000">02</font> Maß +❯ touch Mass +❯ ls -l +-rw-r--r--@ <font color="#000000">1</font> paul wheel <font color="#000000">0</font> Feb <font color="#000000">7</font> <font color="#000000">23</font>:<font color="#000000">02</font> Maß +❯ rm Mass +❯ ls -l + +❯ touch Mass +❯ ls -ltr +-rw-r--r--@ <font color="#000000">1</font> paul wheel <font color="#000000">0</font> Feb <font color="#000000">7</font> <font color="#000000">23</font>:<font color="#000000">02</font> Mass +❯ rm Maß +❯ ls -l + +</pre> +<br /> +<h3 style='display: inline' id='15-colon-as-file-path-separator'>15. Colon as file path separator</h3><br /> +<br /> +<span>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:</span><br /> +<br /> +<pre> +ADFS::4.$.Documents.Techwriter.Myfile +</pre> +<br /> +<span>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.</span><br /> +<br /> +<a class='textlink' href='https://social.jvns.ca/@b0rk/113041293527832730'>https://social.jvns.ca/@b0rk/113041293527832730</a><br /> +<br /> +<h2 style='display: inline' id='16-polyglots---programs-written-in-multiple-languages'>16. Polyglots - programs written in multiple languages</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>Check out my very own polyglot:</span><br /> +<br /> +<a class='textlink' href='./2014-03-24-the-fibonacci.pl.c-polyglot.html'>The <span class='inlinecode'>fibonatti.pl.c</span> Polyglot</a><br /> +<br /> +<h2 style='display: inline' id='17-languages-where-indices-start-at-1'>17. Languages, where indices start at 1</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>Languages with One-Based Indexing:</span><br /> +<br /> +<ul> +<li>Fortran</li> +<li>MATLAB</li> +<li>Lua</li> +<li>R (for vectors and lists)</li> +<li>Smalltalk</li> +<li>Julia (by default, although zero-based indexing is also possible)</li> +</ul><br /> +<span><span class='inlinecode'>foo.lua</span> example:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>arr = {<font color="#000000">10</font>, <font color="#000000">20</font>, <font color="#000000">30</font>, <font color="#000000">40</font>, <font color="#000000">50</font>} +print(arr[<font color="#000000">1</font>]) <i><font color="silver">-- Accessing the first element</font></i> +</pre> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>❯ lua foo.lua +<font color="#000000">10</font> +</pre> +<br /> +<span>One-based indexing is more natural for human-readable, mathematical, and theoretical contexts, where counting traditionally starts from one.</span><br /> +<br /> +<h2 style='display: inline' id='18-perl-poetry'>18. Perl Poetry</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><i><font color="silver"># (C) 2006 by Paul C. Buetow</font></i> + +Christmas:{time;<i><font color="silver">#!!!</font></i> + +Children: <b><u><font color="#000000">do</font></u></b> <b><u><font color="#000000">tell</font></u></b> $wishes; + +Santa: <b><u><font color="#000000">for</font></u></b> $each (@children) { +BEGIN { <b><u><font color="#000000">read</font></u></b> $each, $their, wishes <b><u><font color="#000000">and</font></u></b> study them; <b><u><font color="#000000">use</font></u></b> Memoize<i><font color="silver">#ing</font></i> + +} <b><u><font color="#000000">use</font></u></b> constant gift, <font color="#808080">'wrapping'</font>; +<b><u><font color="#000000">package</font></u></b> Gifts; <b><u><font color="#000000">pack</font></u></b> $each, gift <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">bless</font></u></b> $each <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">goto</font></u></b> deliver +or <b><u><font color="#000000">do</font></u></b> <b><u><font color="#000000">import</font></u></b> <b><u><font color="#000000">if</font></u></b> not <b><u><font color="#000000">local</font></u></b> $available,!!! HO, HO, HO; + +<b><u><font color="#000000">redo</font></u></b> Santa, <b><u><font color="#000000">pipe</font></u></b> $gifts, to_childs; +<b><u><font color="#000000">redo</font></u></b> Santa <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">do</font></u></b> <b><u><font color="#000000">return</font></u></b> <b><u><font color="#000000">if</font></u></b> <b><u><font color="#000000">last</font></u></b> one, is, delivered; + +deliver: gift <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">require</font></u></b> diagnostics <b><u><font color="#000000">if</font></u></b> <b><u><font color="#000000">our</font></u></b> $gifts ,not break; +<b><u><font color="#000000">do</font></u></b>{ <b><u><font color="#000000">use</font></u></b> NEXT; time; <b><u><font color="#000000">tied</font></u></b> $gifts} <b><u><font color="#000000">if</font></u></b> broken <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">dump</font></u></b> the, broken, ones; +The_children: <b><u><font color="#000000">sleep</font></u></b> <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">wait</font></u></b> <b><u><font color="#000000">for</font></u></b> (<b><u><font color="#000000">each</font></u></b> %gift) <b><u><font color="#000000">and</font></u></b> try { to => <b><u><font color="#000000">untie</font></u></b> $gifts }; + +<b><u><font color="#000000">redo</font></u></b> Santa, <b><u><font color="#000000">pipe</font></u></b> $gifts, to_childs; +<b><u><font color="#000000">redo</font></u></b> Santa <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">do</font></u></b> <b><u><font color="#000000">return</font></u></b> <b><u><font color="#000000">if</font></u></b> <b><u><font color="#000000">last</font></u></b> one, is, delivered; + +The_christmas_tree: formline <b><u><font color="#000000">s</font></u></b><font color="#808080">/ /childrens/</font>, $gifts; +<b><u><font color="#000000">alarm</font></u></b> <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">warn</font></u></b> <b><u><font color="#000000">if</font></u></b> not <b><u><font color="#000000">exists</font></u></b> $Christmas{ tree}, @t, $ENV{HOME}; +<b><u><font color="#000000">write</font></u></b> <<EMail + to the parents to buy a new christmas tree!!!!<font color="#000000">111</font> + <b><u><font color="#000000">and</font></u></b> send the +EMail +;<b><u><font color="#000000">wait</font></u></b> <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">redo</font></u></b> deliver until <b><u><font color="#000000">defined</font></u></b> <b><u><font color="#000000">local</font></u></b> $tree; + +<b><u><font color="#000000">redo</font></u></b> Santa, <b><u><font color="#000000">pipe</font></u></b> $gifts, to_childs; +<b><u><font color="#000000">redo</font></u></b> Santa <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">do</font></u></b> <b><u><font color="#000000">return</font></u></b> <b><u><font color="#000000">if</font></u></b> <b><u><font color="#000000">last</font></u></b> one, is, delivered ;} + +END {} <b><u><font color="#000000">our</font></u></b> $mission <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">do</font></u></b> <b><u><font color="#000000">sleep</font></u></b> until <b><u><font color="#000000">next</font></u></b> Christmas ;} + +__END__ + +This is perl, v5.<font color="#000000">8.8</font> built <b><u><font color="#000000">for</font></u></b> i386-freebsd-64int +</pre> +<br /> +<a class='textlink' href='./2008-06-26-perl-poetry.html'>More Perl Poetry of mine</a><br /> +<br /> +<h2 style='display: inline' id='19-css3-is-turing-complete'>19. CSS3 is turing complete</h2><br /> +<br /> +<span>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. </span><br /> +<br /> +<a class='textlink' href='https://stackoverflow.com/questions/2497146/is-css-turing-complete'>Is CSS turing complete?</a><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>Check out this 100% CSS implementation of the Conways Game of Life:</span><br /> +<br /> +<a href='./random-weird-things-ii/css-conway.png'><img src='./random-weird-things-ii/css-conway.png' /></a><br /> +<br /> +<a class='textlink' href='https://github.com/propjockey/css-conways-game-of-life'>CSS Conways Game of Life</a><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='20-the-biggest-shell-programs-'>20. The biggest shell programs </h2><br /> +<br /> +<span>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!</span><br /> +<br /> +<a class='textlink' href='https://github.com/oils-for-unix/oils/wiki/The-Biggest-Shell-Programs-in-the-World'>The Biggest Sell Programs in the World</a><br /> +<br /> +<span>My Gemtexter (bash) is only 1329 LOC as of now. So it's tiny.</span><br /> +<br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>Gemtexter - One Bash script to rule it all</a><br /> +<br /> +<span>I hope you had some fun. E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</title> + <link href="gemini://foo.zone/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi" /> + <id>gemini://foo.zone/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi</id> + <updated>2025-01-30T09:22:06+02:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>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.</summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='f3s-kubernetes-with-freebsd---part-3-protecting-from-power-cuts'>f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</h1><br /> +<br /> +<span class='quote'>Published at 2025-01-30T09:22:06+02:00</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<a class='textlink' href='./2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</a><br /> +<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br /> +<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts (You are currently reading this)</a><br /> +<br /> +<a href='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png'><img alt='f3s logo' title='f3s logo' src='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png' /></a><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#f3s-kubernetes-with-freebsd---part-3-protecting-from-power-cuts'>f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a></li> +<li>⇢ <a href='#introduction'>Introduction</a></li> +<li>⇢ <a href='#changes-since-last-time'>Changes since last time</a></li> +<li>⇢ ⇢ <a href='#freebsd-upgrade-from-141-to-142'>FreeBSD upgrade from 14.1 to 14.2</a></li> +<li>⇢ ⇢ <a href='#a-new-home-behind-the-tv'>A new home (behind the TV)</a></li> +<li>⇢ <a href='#the-ups-hardware'>The UPS hardware</a></li> +<li>⇢ <a href='#configuring-freebsd-to-work-with-the-ups'>Configuring FreeBSD to Work with the UPS</a></li> +<li>⇢ ⇢ <a href='#usb-device-detection'>USB Device Detection</a></li> +<li>⇢ ⇢ <a href='#apcupsd-installation'><span class='inlinecode'>apcupsd</span> Installation</a></li> +<li>⇢ ⇢ <a href='#ups-connectivity-test'>UPS Connectivity Test</a></li> +<li>⇢ <a href='#apc-info-on-partner-nodes'>APC Info on Partner Nodes:</a></li> +<li>⇢ ⇢ <a href='#installation-on-partners'>Installation on partners</a></li> +<li>⇢ <a href='#power-outage-simulation'>Power outage simulation</a></li> +<li>⇢ ⇢ <a href='#pulling-the-plug'>Pulling the plug</a></li> +<li>⇢ ⇢ <a href='#restoring-power'>Restoring power</a></li> +</ul><br /> +<h2 style='display: inline' id='introduction'>Introduction</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='changes-since-last-time'>Changes since last time</h2><br /> +<br /> +<h3 style='display: inline' id='freebsd-upgrade-from-141-to-142'>FreeBSD upgrade from 14.1 to 14.2</h3><br /> +<br /> +<span>There has been a new release since the last blog post in this series. The upgrade from 14.1 was as easy as:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0: ~ % doas freebsd-update fetch +paul@f0: ~ % doas freebsd-update install +paul@f0: ~ % doas freebsd-update -r <font color="#000000">14.2</font>-RELEASE upgrade +paul@f0: ~ % doas freebsd-update install +paul@f0: ~ % doas shutdown -r now +</pre> +<br /> +<span>And after rebooting, I ran:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0: ~ % doas freebsd-update install +paul@f0: ~ % doas pkg update +paul@f0: ~ % doas pkg upgrade +paul@f0: ~ % doas shutdown -r now +</pre> +<br /> +<span>And after another reboot, I was on 14.2:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0:~ % uname -a +FreeBSD f0.lan.buetow.org <font color="#000000">14.2</font>-RELEASE FreeBSD <font color="#000000">14.2</font>-RELEASE + releng/<font color="#000000">14.2</font>-n<font color="#000000">269506</font>-c8918d6c7412 GENERIC amd64 +</pre> +<br /> +<span>And, of course, I ran this on all 3 nodes!</span><br /> +<br /> +<h3 style='display: inline' id='a-new-home-behind-the-tv'>A new home (behind the TV)</h3><br /> +<br /> +<span>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).</span><br /> +<br /> +<a href='./f3s-kubernetes-with-freebsd-part-3/f3s-changes.jpg'><img alt='New hardware placement arrangement' title='New hardware placement arrangement' src='./f3s-kubernetes-with-freebsd-part-3/f3s-changes.jpg' /></a><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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).</span><br /> +<br /> +<span>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, <span class='inlinecode'>f0</span>. </span><br /> +<br /> +<span>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!</span><br /> +<br /> +<h2 style='display: inline' id='the-ups-hardware'>The UPS hardware</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>I decided on the APC Back-UPS BX750MI model because:</span><br /> +<br /> +<ul> +<li>Zero noise level when there is no power cut (some light noise when the battery is in operation during a power cut).</li> +<li>Cost: It is relatively affordable (not costing thousands).</li> +<li>USB connectivity: Can be connected via USB to one of the FreeBSD hosts to read the UPS status.</li> +<li>A power output of 750VA (or 410 watts), suitable for an hour of runtime for my f3s nodes (plus the Wi-Fi router).</li> +<li>Multiple power outlets: Can connect all 3 f3s nodes directly.</li> +<li>User-replaceable batteries: I can replace the batteries myself after two years or more (depending on usage).</li> +<li>Its compact design. Overall, I like how it looks.</li> +</ul><br /> +<a href='./f3s-kubernetes-with-freebsd-part-3/apc-back-ups.jpg'><img alt='The APC Back-UPS BX750MI in operation.' title='The APC Back-UPS BX750MI in operation.' src='./f3s-kubernetes-with-freebsd-part-3/apc-back-ups.jpg' /></a><br /> +<br /> +<h2 style='display: inline' id='configuring-freebsd-to-work-with-the-ups'>Configuring FreeBSD to Work with the UPS</h2><br /> +<br /> +<h3 style='display: inline' id='usb-device-detection'>USB Device Detection</h3><br /> +<br /> +<span>Once plugged in via USB on FreeBSD, I could see the following in the kernel messages:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0: ~ % doas dmesg | grep UPS +ugen0.<font color="#000000">2</font>: <American Power Conversion Back-UPS BX750MI> at usbus0 +</pre> +<br /> +<h3 style='display: inline' id='apcupsd-installation'><span class='inlinecode'>apcupsd</span> Installation</h3><br /> +<br /> +<span>To make use of the USB connection, the <span class='inlinecode'>apcupsd</span> package had to be installed:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0: ~ % doas install apcupsd +</pre> +<br /> +<span>I have made the following modifications to the configuration file so that the UPS can be used via the USB interface:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0:/usr/local/etc/apcupsd % diff -u apcupsd.conf.sample apcupsd.conf +--- apcupsd.conf.sample <font color="#000000">2024</font>-<font color="#000000">11</font>-<font color="#000000">01</font> <font color="#000000">16</font>:<font color="#000000">40</font>:<font color="#000000">42.000000000</font> +<font color="#000000">0200</font> ++++ apcupsd.conf <font color="#000000">2024</font>-<font color="#000000">12</font>-<font color="#000000">03</font> <font color="#000000">10</font>:<font color="#000000">58</font>:<font color="#000000">24.009501000</font> +<font color="#000000">0200</font> +@@ -<font color="#000000">31</font>,<font color="#000000">7</font> +<font color="#000000">31</font>,<font color="#000000">7</font> @@ + <i><font color="silver"># 940-1524C, 940-0024G, 940-0095A, 940-0095B,</font></i> + <i><font color="silver"># 940-0095C, 940-0625A, M-04-02-2000</font></i> + <i><font color="silver">#</font></i> +-UPSCABLE smart ++UPSCABLE usb + + <i><font color="silver"># To get apcupsd to work, in addition to defining the cable</font></i> + <i><font color="silver"># above, you must also define a UPSTYPE, which corresponds to</font></i> +@@ -<font color="#000000">88</font>,<font color="#000000">8</font> +<font color="#000000">88</font>,<font color="#000000">10</font> @@ + <i><font color="silver"># that apcupsd binds to that particular unit</font></i> + <i><font color="silver"># (helpful if you have more than one USB UPS).</font></i> + <i><font color="silver">#</font></i> +-UPSTYPE apcsmart +-DEVICE /dev/usv ++UPSTYPE usb ++DEVICE + + <i><font color="silver"># POLLTIME <int></font></i> + <i><font color="silver"># Interval (in seconds) at which apcupsd polls the UPS for status. This</font></i> +</pre> +<br /> +<span>I left the remaining settings as the default ones; for example, the following are of main interest:</span><br /> +<br /> +<pre> +# 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 +</pre> +<br /> +<span>I then enabled and started the daemon:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>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. +</pre> +<br /> +<h3 style='display: inline' id='ups-connectivity-test'>UPS Connectivity Test</h3><br /> +<br /> +<span>And voila, I could now access the UPS information via the <span class='inlinecode'>apcaccess</span> command; how convenient :-) (I also read through the manual page, which provides a good understanding of what else can be done with it!).</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0:~ % apcaccess +APC : <font color="#000000">001</font>,<font color="#000000">035</font>,<font color="#000000">0857</font> +DATE : <font color="#000000">2025</font>-<font color="#000000">01</font>-<font color="#000000">26</font> <font color="#000000">14</font>:<font color="#000000">43</font>:<font color="#000000">27</font> +<font color="#000000">0200</font> +HOSTNAME : f0.lan.buetow.org +VERSION : <font color="#000000">3.14</font>.<font color="#000000">14</font> (<font color="#000000">31</font> May <font color="#000000">2016</font>) freebsd +UPSNAME : f0.lan.buetow.org +CABLE : USB Cable +DRIVER : USB UPS Driver +UPSMODE : Stand Alone +STARTTIME: <font color="#000000">2025</font>-<font color="#000000">01</font>-<font color="#000000">26</font> <font color="#000000">14</font>:<font color="#000000">43</font>:<font color="#000000">25</font> +<font color="#000000">0200</font> +MODEL : Back-UPS BX750MI +STATUS : ONLINE +LINEV : <font color="#000000">230.0</font> Volts +LOADPCT : <font color="#000000">4.0</font> Percent +BCHARGE : <font color="#000000">100.0</font> Percent +TIMELEFT : <font color="#000000">65.3</font> Minutes +MBATTCHG : <font color="#000000">5</font> Percent +MINTIMEL : <font color="#000000">3</font> Minutes +MAXTIME : <font color="#000000">0</font> Seconds +SENSE : Medium +LOTRANS : <font color="#000000">145.0</font> Volts +HITRANS : <font color="#000000">295.0</font> Volts +ALARMDEL : No alarm +BATTV : <font color="#000000">13.6</font> Volts +LASTXFER : Automatic or explicit self <b><u><font color="#000000">test</font></u></b> +NUMXFERS : <font color="#000000">0</font> +TONBATT : <font color="#000000">0</font> Seconds +CUMONBATT: <font color="#000000">0</font> Seconds +XOFFBATT : N/A +SELFTEST : NG +STATFLAG : <font color="#000000">0x05000008</font> +SERIALNO : 9B2414A03599 +BATTDATE : <font color="#000000">2001</font>-<font color="#000000">01</font>-<font color="#000000">01</font> +NOMINV : <font color="#000000">230</font> Volts +NOMBATTV : <font color="#000000">12.0</font> Volts +NOMPOWER : <font color="#000000">410</font> Watts +END APC : <font color="#000000">2025</font>-<font color="#000000">01</font>-<font color="#000000">26</font> <font color="#000000">14</font>:<font color="#000000">44</font>:<font color="#000000">06</font> +<font color="#000000">0200</font> +</pre> +<br /> +<h2 style='display: inline' id='apc-info-on-partner-nodes'>APC Info on Partner Nodes:</h2><br /> +<br /> +<span>So far, so good. Host <span class='inlinecode'>f0</span> would shut down itself when short on power. But what about the <span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span> 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, <span class='inlinecode'>apcupsd</span> running on the <span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span> nodes can be configured to retrieve UPS information via the network from the <span class='inlinecode'>apcupsd</span> server running on the <span class='inlinecode'>f0</span> node, which is connected directly to the APC via USB.</span><br /> +<br /> +<span>Of course, this won't work when <span class='inlinecode'>f0</span> 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 <span class='inlinecode'>f0</span> 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.</span><br /> +<br /> +<span>And if <span class='inlinecode'>f0</span> is down and <span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span> 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).</span><br /> +<br /> +<h3 style='display: inline' id='installation-on-partners'>Installation on partners</h3><br /> +<br /> +<span>To do this, I installed <span class='inlinecode'>apcupsd</span> via <span class='inlinecode'>doas pkg install apcupsd</span> on <span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span>, and then I could connect to it this way:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f1:~ % apcaccess -h f0.lan.buetow.org | grep Percent +LOADPCT : <font color="#000000">12.0</font> Percent +BCHARGE : <font color="#000000">94.0</font> Percent +MBATTCHG : <font color="#000000">5</font> Percent +</pre> +<br /> +<span>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, <span class='inlinecode'>apcupsd</span> itself needs to be aware of the UPS status.</span><br /> +<br /> +<span>On <span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span>, I changed the configuration to use <span class='inlinecode'>f0</span> (where <span class='inlinecode'>apcupsd</span> is listening) as a remote device. I also changed the <span class='inlinecode'>MINUTES</span> setting from 3 to 6 and the <span class='inlinecode'>BATTERYLEVEL</span> setting from 5 to 10 to ensure that the <span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span> nodes could still connect to the <span class='inlinecode'>f0</span> node for UPS information before <span class='inlinecode'>f0</span> decides to shut down itself. So <span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span> must shut down earlier than <span class='inlinecode'>f0</span>:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f2:/usr/local/etc/apcupsd % diff -u apcupsd.conf.sample apcupsd.conf +--- apcupsd.conf.sample <font color="#000000">2024</font>-<font color="#000000">11</font>-<font color="#000000">01</font> <font color="#000000">16</font>:<font color="#000000">40</font>:<font color="#000000">42.000000000</font> +<font color="#000000">0200</font> ++++ apcupsd.conf <font color="#000000">2025</font>-<font color="#000000">01</font>-<font color="#000000">26</font> <font color="#000000">15</font>:<font color="#000000">52</font>:<font color="#000000">45.108469000</font> +<font color="#000000">0200</font> +@@ -<font color="#000000">31</font>,<font color="#000000">7</font> +<font color="#000000">31</font>,<font color="#000000">7</font> @@ + <i><font color="silver"># 940-1524C, 940-0024G, 940-0095A, 940-0095B,</font></i> + <i><font color="silver"># 940-0095C, 940-0625A, M-04-02-2000</font></i> + <i><font color="silver">#</font></i> +-UPSCABLE smart ++UPSCABLE ether + + <i><font color="silver"># To get apcupsd to work, in addition to defining the cable</font></i> + <i><font color="silver"># above, you must also define a UPSTYPE, which corresponds to</font></i> +@@ -<font color="#000000">52</font>,<font color="#000000">7</font> +<font color="#000000">52</font>,<font color="#000000">6</font> @@ + <i><font color="silver"># Network Information Server. This is used if the</font></i> + <i><font color="silver"># UPS powering your computer is connected to a</font></i> + <i><font color="silver"># different computer for monitoring.</font></i> +-<i><font color="silver">#</font></i> + <i><font color="silver"># snmp hostname:port:vendor:community</font></i> + <i><font color="silver"># SNMP network link to an SNMP-enabled UPS device.</font></i> + <i><font color="silver"># Hostname is the ip address or hostname of the UPS</font></i> +@@ -<font color="#000000">88</font>,<font color="#000000">8</font> +<font color="#000000">87</font>,<font color="#000000">8</font> @@ + <i><font color="silver"># that apcupsd binds to that particular unit</font></i> + <i><font color="silver"># (helpful if you have more than one USB UPS).</font></i> + <i><font color="silver">#</font></i> +-UPSTYPE apcsmart +-DEVICE /dev/usv ++UPSTYPE net ++DEVICE f0.lan.buetow.org:<font color="#000000">3551</font> + + <i><font color="silver"># POLLTIME <int></font></i> + <i><font color="silver"># Interval (in seconds) at which apcupsd polls the UPS for status. This</font></i> +@@ -<font color="#000000">147</font>,<font color="#000000">12</font> +<font color="#000000">146</font>,<font color="#000000">12</font> @@ + <i><font color="silver"># If during a power failure, the remaining battery percentage</font></i> + <i><font color="silver"># (as reported by the UPS) is below or equal to BATTERYLEVEL,</font></i> + <i><font color="silver"># apcupsd will initiate a system shutdown.</font></i> +-BATTERYLEVEL <font color="#000000">5</font> ++BATTERYLEVEL <font color="#000000">10</font> + + <i><font color="silver"># If during a power failure, the remaining runtime in minutes</font></i> + <i><font color="silver"># (as calculated internally by the UPS) is below or equal to MINUTES,</font></i> + <i><font color="silver"># apcupsd, will initiate a system shutdown.</font></i> +-MINUTES <font color="#000000">3</font> ++MINUTES <font color="#000000">6</font> + + <i><font color="silver"># If during a power failure, the UPS has run on batteries for TIMEOUT</font></i> + <i><font color="silver"># many seconds or longer, apcupsd will initiate a system shutdown.</font></i> + +</pre> +<span>So I also ran the following commands on <span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span>:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>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. +</pre> +<br /> +<span>And then I was able to connect to localhost via the <span class='inlinecode'>apcaccess</span> command:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f1:~ % doas apcaccess | grep Percent +LOADPCT : <font color="#000000">5.0</font> Percent +BCHARGE : <font color="#000000">95.0</font> Percent +MBATTCHG : <font color="#000000">5</font> Percent +</pre> +<br /> +<h2 style='display: inline' id='power-outage-simulation'>Power outage simulation</h2><br /> +<br /> +<h3 style='display: inline' id='pulling-the-plug'>Pulling the plug</h3><br /> +<br /> +<span>I simulated a power outage by removing the power input from the APC. Immediately, the following message appeared on all the nodes:</span><br /> +<br /> +<pre> +Broadcast Message from root@f0.lan.buetow.org + (no tty) at 15:03 EET... + +Power failure. Running on UPS batteries. +</pre> +<br /> +<span>I ran the following command to confirm the available battery time:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0:/usr/local/etc/apcupsd % apcaccess -p TIMELEFT +<font color="#000000">63.9</font> Minutes +</pre> +<br /> +<span>And after around one hour (<span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span> a bit earlier, <span class='inlinecode'>f0</span> a bit later due to the different <span class='inlinecode'>BATTERYLEVEL</span> and <span class='inlinecode'>MINUTES</span> settings outlined earlier), the following broadcast was sent out:</span><br /> +<br /> +<pre> +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 +</pre> +<br /> +<span>And all the nodes shut down safely before the UPS ran out of battery!</span><br /> +<br /> +<h3 style='display: inline' id='restoring-power'>Restoring power</h3><br /> +<br /> +<span>After restoring power, I checked the logs in <span class='inlinecode'>/var/log/daemon.log</span> and found the following on all 3 nodes:</span><br /> +<br /> +<pre> +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 +</pre> +<br /> +<span>All good :-) See you in the next post of this series!</span><br /> +<br /> +<span>Other BSD related posts are:</span><br /> +<br /> +<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br /> +<a class='textlink' href='./2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</a><br /> +<a class='textlink' href='./2024-04-01-KISS-high-availability-with-OpenBSD.html'>2024-04-01 KISS high-availability with OpenBSD</a><br /> +<a class='textlink' href='./2024-01-13-one-reason-why-i-love-openbsd.html'>2024-01-13 One reason why I love OpenBSD</a><br /> +<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> +<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>2022-07-30 Let's Encrypt with OpenBSD and Rex</a><br /> +<a class='textlink' href='./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html'>2016-04-09 Jails and ZFS with Puppet on FreeBSD</a><br /> +<br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>Working with an SRE Interview</title> + <link href="gemini://foo.zone/gemfeed/2025-01-15-working-with-an-sre-interview.gmi" /> + <id>gemini://foo.zone/gemfeed/2025-01-15-working-with-an-sre-interview.gmi</id> + <updated>2025-01-15T00:16:04+02:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>I have been interviewed by Florian Buetow on `cracking-ai-engineering.com` about what it's like working with a Site Reliability Engineer from the point of view of a Software Engineer, Data Scientist, and AI Engineer.</summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='working-with-an-sre-interview'>Working with an SRE Interview</h1><br /> +<br /> +<span class='quote'>Published at 2025-01-15T00:16:04+02:00</span><br /> +<br /> +<span>I have been interviewed by Florian Buetow on <span class='inlinecode'>cracking-ai-engineering.com</span> about what it's like working with a Site Reliability Engineer from the point of view of a Software Engineer, Data Scientist, and AI Engineer.</span><br /> +<br /> +<a class='textlink' href='https://www.cracking-ai-engineering.com/writing/2025/01/12/working-with-an-sre-interview/'>See original interview here</a><br /> +<a class='textlink' href='https://www.cracking-ai-engineering.com'>Cracking AI Engineering</a><br /> +<br /> +<span>Below, I am posting the interview here on my blog as well.</span><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#working-with-an-sre-interview'>Working with an SRE Interview</a></li> +<li>⇢ <a href='#preamble-'>Preamble </a></li> +<li>⇢ <a href='#introducing-paul'>Introducing Paul</a></li> +<li>⇢ <a href='#how-did-you-get-started'>How did you get started?</a></li> +<li>⇢ <a href='#roles-and-career-progression'>Roles and Career Progression</a></li> +<li>⇢ <a href='#anecdotes-and-best-practices'>Anecdotes and Best Practices</a></li> +<li>⇢ <a href='#working-with-different-teams'>Working with Different Teams</a></li> +<li>⇢ <a href='#using-ai-tools'>Using AI Tools</a></li> +<li>⇢ <a href='#sre-learning-resources'>SRE Learning Resources</a></li> +<li>⇢ <a href='#blogging'>Blogging</a></li> +<li>⇢ <a href='#wrap-up'>Wrap-up</a></li> +<li>⇢ <a href='#closing-comments'>Closing comments</a></li> +</ul><br /> +<h2 style='display: inline' id='preamble-'>Preamble </h2><br /> +<br /> +<span>In this insightful interview, Paul Bütow, a Principal Site Reliability Engineer at Mimecast, shares over a decade of experience in the field. Paul highlights the role of an Embedded SRE, emphasizing the importance of automation, observability, and effective incident management. We also focused on the key question of how you can work effectively with an SRE weather you are an individual contributor or a manager, a software engineer or data scientist. And how you can learn more about site reliability engineering.</span><br /> +<br /> +<h2 style='display: inline' id='introducing-paul'>Introducing Paul</h2><br /> +<br /> +<span>Hi Paul, please introduce yourself briefly to the audience. Who are you, what do you do for a living, and where do you work?</span><br /> +<br /> +<span class='quote'>My name is Paul Bütow, I work at Mimecast, and I’m a Principal Site Reliability Engineer there. I’ve been with Mimecast for almost ten years now. The company specializes in email security, including things like archiving, phishing detection, malware protection, and spam filtering.</span><br /> +<br /> +<span>You mentioned that you’re an ‘Embedded SRE.’ What does that mean exactly?</span><br /> +<br /> +<span class='quote'>It means that I’m directly part of the software engineering team, not in a separate Ops department. I ensure that nothing is deployed manually, and everything runs through automation. I also set up monitoring and observability. These are two distinct aspects: monitoring alerts us when something breaks, while observability helps us identify trends. I also create runbooks so we know what to do when specific incidents occur frequently.</span><br /> +<br /> +<span class='quote'>Infrastructure SREs on the other hand handle the foundational setup, like providing the Kubernetes cluster itself or ensuring the operating systems are installed. They don't work on the application directly but ensure the base infrastructure is there for others to use. This works well when a company has multiple teams that need shared infrastructure.</span><br /> +<br /> +<h2 style='display: inline' id='how-did-you-get-started'>How did you get started?</h2><br /> +<br /> +<span>How did your interest in Linux or FreeBSD start?</span><br /> +<br /> +<span class='quote'>It began during my school days. We had a PC with DOS at home, and I eventually bought Suse Linux 5.3. Shortly after, I discovered FreeBSD because I liked its handbook so much. I wanted to understand exactly how everything worked, so I also tried Linux from Scratch. That involves installing every package manually to gain a better understanding of operating systems.</span><br /> +<br /> +<a class='textlink' href='https://www.FreeBSD.org'>https://www.FreeBSD.org</a><br /> +<a class='textlink' href='https://linuxfromscratch.org/'>https://linuxfromscratch.org/</a><br /> +<br /> +<span>And after school, you pursued computer science, correct?</span><br /> +<br /> +<span class='quote'>Exactly. I wasn’t sure at first whether I wanted to be a software developer or a system administrator. I applied for both and eventually accepted an offer as a Linux system administrator. This was before 'SRE' became a buzzword, but much of what I did back then-automation, infrastructure as code, monitoring-is now considered part of the typical SRE role.</span><br /> +<br /> +<h2 style='display: inline' id='roles-and-career-progression'>Roles and Career Progression</h2><br /> +<br /> +<span>Tell us about how you joined Mimecast. When did you fully embrace the SRE role?</span><br /> +<br /> +<span class='quote'>I started as a Linux sysadmin at 1&1. I managed an ad server farm with hundreds of systems and later handled load balancers. Together with an architect, we managed F5 load balancers distributing around 2,000 services, including for portals like web.de and GMX. I also led the operations team technically for a while before moving to London to join Mimecast.</span><br /> +<br /> +<span class='quote'>At Mimecast, the job title was explicitly 'Site Reliability Engineer.' The biggest difference was that I was no longer in a separate Ops department but embedded directly within the storage and search backend team. I loved that because we could plan features together-from automation to measurability and observability. Mimecast also operates thousands of physical servers for email archiving, which was fascinating since I already had experience with large distributed systems at 1&1. It was the right step for me because it allowed me to work close to the code while remaining hands-on with infrastructure.</span><br /> +<br /> +<span>What are the differences between SRE, DevOps, SysAdmin, and Architects?</span><br /> +<br /> +<span class='quote'>SREs are like the next step after SysAdmins. A SysAdmin might manually install servers, replace disks, or use simple scripts for automation, while SREs use infrastructure as code and focus on reliability through SLIs, SLOs, and automation. DevOps isn’t really a job-it’s more of a way of working, where developers are involved in operations tasks like setting up CI/CD pipelines or on-call shifts. Architects focus on designing systems and infrastructures, such as load balancers or distributed systems, working alongside SREs to ensure the systems meet the reliability and scalability requirements. The specific responsibilities of each role depend on the company, and there is often overlap. </span><br /> +<br /> +<span>What are the most important reliability lessons you’ve learned so far?</span><br /> +<br /> +<ul> +<li>Don’t leave SRE aspects as an afterthought. It’s much better to discuss automation, monitoring, SLIs, and SLOs early on. Traditional sysadmins often installed systems manually, but today, we do everything via infrastructure as code-using tools like Terraform or Puppet.</li> +<li>I also distinguish between monitoring and observability. Monitoring tells us, 'The server is down, alarm!' Observability dives deeper, showing trends like increasing latency so we can act proactively.</li> +<li>SLI, SLO, and SLA are core elements. We focus on what users actually experience-for example, how quickly an email is sent-and set our goals accordingly.</li> +<li>Runbooks are also crucial. When something goes wrong at night, you don’t want to start from scratch. A runbook outlines how to debug and resolve specific problems, saving time and reducing downtime.</li> +</ul><br /> +<h2 style='display: inline' id='anecdotes-and-best-practices'>Anecdotes and Best Practices</h2><br /> +<br /> +<span>Runbooks sound very practical. Can you explain how they’re used day-to-day?</span><br /> +<br /> +<span class='quote'>Runbooks are essentially guides for handling specific incidents. For instance, if a service won’t start, the runbook will specify where the logs are and which commands to use. Observability takes it a step further, helping us spot changes early-like rising error rates or latency-so we can address issues before they escalate.</span><br /> +<br /> +<span>When should you decide to put something into a runbook, and when is it unnecessary?</span><br /> +<br /> +<span class='quote'>If an issue happens frequently, it should be documented in a runbook so that anyone, even someone new, can follow the steps to fix it. The idea is that 90% of the common incidents should be covered. For example, if a service is down, the runbook would specify where to find logs, which commands to check, and what actions to take. On the other hand, rare or complex issues, where the resolution depends heavily on context or varies each time, don’t make sense to include in detail. For those, it’s better to focus on general troubleshooting steps. </span><br /> +<br /> +<span>How do you search for and find the correct runbooks?</span><br /> +<br /> +<span class='quote'>Runbooks should be linked directly in the alert you receive. For example, if you get an alert about a service not running, the alert will have a link to the runbook that tells you what to check, like logs or commands to run. Runbooks are best stored in an internal wiki, so if you don’t find the link in the alert, you know where to search. The important thing is that runbooks are easy to find and up to date because that’s what makes them useful during incidents. </span><br /> +<br /> +<span>Do you have an interesting war story you can share with us?</span><br /> +<br /> +<span class='quote'>Sure. At 1&1, we had a proprietary ad server software that ran a SQL query during startup. The query got slower over time, eventually timing out and preventing the server from starting. Since we couldn’t access the source code, we searched the binary for the SQL and patched it. By pinpointing the issue, a developer was able to adjust the SQL. This collaboration between sysadmin and developer perspectives highlights the value of SRE work.</span><br /> +<br /> +<h2 style='display: inline' id='working-with-different-teams'>Working with Different Teams</h2><br /> +<br /> +<span>You’re embedded in a team-how does collaboration with developers work practically?</span><br /> +<br /> +<span class='quote'>We plan everything together from the start. If there’s a new feature, we discuss infrastructure, automated deployments, and monitoring right away. Developers are experts in the code, and I bring the infrastructure expertise. This avoids unpleasant surprises before going live.</span><br /> +<br /> +<span>How about working with data scientists or ML engineers? Are there differences?</span><br /> +<br /> +<span class='quote'>The principles are the same. ML models also need to be deployed and monitored. You deal with monitoring, resource allocation, and identifying performance drops. Whether it’s a microservice or an ML job, at the end of the day, it’s all running on servers or clusters that must remain stable.</span><br /> +<br /> +<span>What about working with managers or the FinOps team?</span><br /> +<br /> +<span class='quote'>We often discuss costs, especially in the cloud, where scaling up resources is easy. It’s crucial to know our metrics: do we have enough capacity? Do we need all instances? Or is the CPU only at 5% utilization? This data helps managers decide whether the budget is sufficient or if optimizations are needed.</span><br /> +<br /> +<span>Do you have practical tips for working with SREs?</span><br /> +<br /> +<span class='quote'>Yes, I have a few:</span><br /> +<br /> +<ul> +<li>Early involvement: Include SREs from the beginning in your project.</li> +<li>Runbooks & documentation: Document recurring errors.</li> +<li>Try first: Try to understand the issue yourself before immediately asking the SRE.</li> +<li>Basic infra knowledge: Kubernetes and Terraform aren’t magic. Some basic understanding helps every developer.</li> +</ul><br /> +<h2 style='display: inline' id='using-ai-tools'>Using AI Tools</h2><br /> +<br /> +<span>Let’s talk about AI. How do you use it in your daily work?</span><br /> +<br /> +<span class='quote'>For boilerplate code, like Terraform snippets, I often use ChatGPT. It saves time, although I always review and adjust the output. Log analysis is another exciting application. Instead of manually going through millions of lines, AI can summarize key outliers or errors.</span><br /> +<br /> +<span>Do you think AI could largely replace SREs or significantly change the role?</span><br /> +<br /> +<span class='quote'>I see AI as an additional tool. SRE requires a deep understanding of how distributed systems work internally. While AI can assist with routine tasks or quickly detect anomalies, human expertise is indispensable for complex issues.</span><br /> +<br /> +<h2 style='display: inline' id='sre-learning-resources'>SRE Learning Resources</h2><br /> +<br /> +<span>What resources would you recommend for learning about SRE?</span><br /> +<br /> +<span class='quote'>The Google SRE book is a classic, though a bit dry. I really like 'Seeking SRE,' as it offers various perspectives on SRE, with many practical stories from different companies.</span><br /> +<br /> +<a class='textlink' href='https://sre.google/books/'>https://sre.google/books/</a><br /> +<a class='textlink' href='https://www.oreilly.com/library/view/seeking-sre/9781491978856'>Seeking SRE</a><br /> +<br /> +<span>Do you have a podcast recommendation?</span><br /> +<br /> +<span class='quote'>The Google SRE prodcast is quite interesting. It offers insights into how Google approaches SRE, along with perspectives from external guests.</span><br /> +<br /> +<a class='textlink' href='https://sre.google/prodcast/'>https://sre.google/prodcast/</a><br /> +<br /> +<h2 style='display: inline' id='blogging'>Blogging</h2><br /> +<br /> +<span>You also have a blog. What motivates you to write regularly?</span><br /> +<br /> +<span class='quote'>Writing helps me learn the most. It also serves as a personal reference. Sometimes I look up how I solved a problem a year ago. And of course, others tackling similar projects might find inspiration in my posts.</span><br /> +<br /> +<span>What do you blog about?</span><br /> +<br /> +<span class='quote'>Mostly technical topics I find exciting, like homelab projects, Kubernetes, or book summaries on IT and productivity. It’s a personal blog, so I write about what I enjoy.</span><br /> +<br /> +<h2 style='display: inline' id='wrap-up'>Wrap-up</h2><br /> +<br /> +<span>To wrap up, what are three things every team should keep in mind for stability?</span><br /> +<br /> +<span class='quote'>First, maintain runbooks and documentation to avoid chaos at night. Second, automate everything-manual installs in production are risky. Third, define SLIs, SLOs, and SLAs early so everyone knows what we’re monitoring and guaranteeing.</span><br /> +<br /> +<span>Is there a motto or mindset that particularly inspires you as an SRE?</span><br /> +<br /> +<span class='quote'>"Keep it simple and stupid"-KISS. Not everything has to be overly complex. And always stay curious. I’m still fascinated by how systems work under the hood.</span><br /> +<br /> +<span>Where can people find you online?</span><br /> +<br /> +<span class='quote'>You can find links to my socials on my website paul.buetow.org</span><br /> +<span class='quote'>I regularly post articles and link to everything else I’m working on outside of work.</span><br /> +<br /> +<a class='textlink' href='https://paul.buetow.org'>https://paul.buetow.org</a><br /> +<br /> +<span>Thank you very much for your time and this insightful interview into the world of site reliability engineering</span><br /> +<br /> +<span class='quote'>My pleasure, this was fun.</span><br /> +<br /> +<h2 style='display: inline' id='closing-comments'>Closing comments</h2><br /> +<br /> +<span>Dear reader, I hope this conversation with Paul Bütow provided an exciting peak into the world of Site Reliability Engineering. Whether you’re a software developer, data scientist, ML engineer, or manager, reliable systems are always a team effort. Hopefully, you’ve taken some insights or tips from Paul’s experiences for your own team or next project. Thanks for joining us, and best of luck refining your own SRE practices!</span><br /> +<br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> or contact Florian via the Cracking AI Engineering :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>Posts from October to December 2024</title> + <link href="gemini://foo.zone/gemfeed/2025-01-01-posts-from-october-to-december-2024.gmi" /> + <id>gemini://foo.zone/gemfeed/2025-01-01-posts-from-october-to-december-2024.gmi</id> + <updated>2024-12-31T18:09:58+02:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>Happy new year!</summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='posts-from-october-to-december-2024'>Posts from October to December 2024</h1><br /> +<br /> +<span class='quote'>Published at 2024-12-31T18:09:58+02:00</span><br /> +<br /> +<span>Happy new year!</span><br /> +<br /> +<span>These are my social media posts from the last three months. I keep them here to reflect on them and also to not lose them. Social media networks come and go and are not under my control, but my domain is here to stay. </span><br /> +<br /> +<span>These are from Mastodon and LinkedIn. Have a look at my about page for my social media profiles. This list is generated with Gos, my social media platform sharing tool.</span><br /> +<br /> +<a class='textlink' href='../about/index.html'>My about page</a><br /> +<a class='textlink' href='https://codeberg.org/snonux/gos'>https://codeberg.org/snonux/gos</a><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#posts-from-october-to-december-2024'>Posts from October to December 2024</a></li> +<li><a href='#posts-for-202410-202411-202412'>Posts for 202410 202411 202412</a></li> +<li>⇢ <a href='#october-2024'>October 2024</a></li> +<li>⇢ ⇢ <a href='#first-on-call-experience-in-a-startup-doesn-t-'>First on-call experience in a startup. Doesn't ...</a></li> +<li>⇢ ⇢ <a href='#reviewing-your-own-pr-or-mr-before-asking-'>Reviewing your own PR or MR before asking ...</a></li> +<li>⇢ ⇢ <a href='#fun-with-defer-in-golang-i-did-t-know-that-'>Fun with defer in <span class='inlinecode'>#golang</span>, I did't know, that ...</a></li> +<li>⇢ ⇢ <a href='#i-have-been-in-incidents-understandably-'>I have been in incidents. Understandably, ...</a></li> +<li>⇢ ⇢ <a href='#little-tips-using-strings-in-golang-and-i-'>Little tips using strings in <span class='inlinecode'>#golang</span> and I ...</a></li> +<li>⇢ ⇢ <a href='#reading-this-post-about-rust-especially-the-'>Reading this post about <span class='inlinecode'>#rust</span> (especially the ...</a></li> +<li>⇢ ⇢ <a href='#the-opposite-of-chaosmonkey--'>The opposite of <span class='inlinecode'>#ChaosMonkey</span> ... ...</a></li> +<li>⇢ <a href='#november-2024'>November 2024</a></li> +<li>⇢ ⇢ <a href='#i-just-became-a-silver-patreon-for-osnews-what-'>I just became a Silver Patreon for OSnews. What ...</a></li> +<li>⇢ ⇢ <a href='#until-now-i-wasn-t-aware-that-go-is-under-a-'>Until now, I wasn't aware, that Go is under a ...</a></li> +<li>⇢ ⇢ <a href='#these-are-some-book-notes-from-staff-engineer-'>These are some book notes from "Staff Engineer" ...</a></li> +<li>⇢ ⇢ <a href='#looking-at-kubernetes-it-s-pretty-much-'>Looking at <span class='inlinecode'>#Kubernetes</span>, it's pretty much ...</a></li> +<li>⇢ ⇢ <a href='#there-has-been-an-outage-at-the-upstream-'>There has been an outage at the upstream ...</a></li> +<li>⇢ ⇢ <a href='#one-of-the-more-confusing-parts-in-go-nil-'>One of the more confusing parts in Go, nil ...</a></li> +<li>⇢ ⇢ <a href='#agreeably-writing-down-with-diagrams-helps-you-'>Agreeably, writing down with Diagrams helps you ...</a></li> +<li>⇢ ⇢ <a href='#i-like-the-idea-of-types-in-ruby-raku-is-'>I like the idea of types in Ruby. Raku is ...</a></li> +<li>⇢ ⇢ <a href='#so-haskell-is-better-suited-for-general-'>So, <span class='inlinecode'>#Haskell</span> is better suited for general ...</a></li> +<li>⇢ ⇢ <a href='#at-first-functional-options-add-a-bit-of-'>At first, functional options add a bit of ...</a></li> +<li>⇢ ⇢ <a href='#revamping-my-home-lab-a-little-bit-freebsd-'>Revamping my home lab a little bit. <span class='inlinecode'>#freebsd</span> ...</a></li> +<li>⇢ ⇢ <a href='#wondering-to-which-web-browser-i-should-'>Wondering to which <span class='inlinecode'>#web</span> <span class='inlinecode'>#browser</span> I should ...</a></li> +<li>⇢ ⇢ <a href='#eks-node-viewer-is-a-nifty-tool-showing-the-'>eks-node-viewer is a nifty tool, showing the ...</a></li> +<li>⇢ ⇢ <a href='#have-put-more-photos-on---on-my-static-photo-'>Have put more Photos on - On my static photo ...</a></li> +<li>⇢ ⇢ <a href='#in-go-passing-pointers-are-not-automatically-'>In Go, passing pointers are not automatically ...</a></li> +<li>⇢ ⇢ <a href='#myself-being-part-of-an-on-call-rotations-over-'>Myself being part of an on-call rotations over ...</a></li> +<li>⇢ ⇢ <a href='#feels-good-to-code-in-my-old-love-perl-again-'>Feels good to code in my old love <span class='inlinecode'>#Perl</span> again ...</a></li> +<li>⇢ ⇢ <a href='#this-is-an-interactive-summary-of-the-go-'>This is an interactive summary of the Go ...</a></li> +<li>⇢ <a href='#december-2024'>December 2024</a></li> +<li>⇢ ⇢ <a href='#thats-unexpected-you-cant-remove-a-nan-key-'>Thats unexpected, you cant remove a NaN key ...</a></li> +<li>⇢ ⇢ <a href='#my-second-blog-post-about-revamping-my-home-lab-'>My second blog post about revamping my home lab ...</a></li> +<li>⇢ ⇢ <a href='#very-insightful-article-about-tech-hiring-in-'>Very insightful article about tech hiring in ...</a></li> +<li>⇢ ⇢ <a href='#for-bpf-ebpf-performance-debugging-have-'>for <span class='inlinecode'>#bpf</span> <span class='inlinecode'>#ebpf</span> performance debugging, have ...</a></li> +<li>⇢ ⇢ <a href='#89-things-heshe-knows-about-git-commits-is-a-'>89 things he/she knows about Git commits is a ...</a></li> +<li>⇢ ⇢ <a href='#i-found-that-working-on-multiple-side-projects-'>I found that working on multiple side projects ...</a></li> +<li>⇢ ⇢ <a href='#agreed-agreed-besides-ruby-i-would-also-'>Agreed? Agreed. Besides <span class='inlinecode'>#Ruby</span>, I would also ...</a></li> +<li>⇢ ⇢ <a href='#plan9-assembly-format-in-go-but-wait-it-s-not-'>Plan9 assembly format in Go, but wait, it's not ...</a></li> +<li>⇢ ⇢ <a href='#this-is-a-neat-blog-post-about-the-helix-text-'>This is a neat blog post about the Helix text ...</a></li> +<li>⇢ ⇢ <a href='#this-blog-post-is-basically-a-rant-against-'>This blog post is basically a rant against ...</a></li> +<li>⇢ ⇢ <a href='#quick-trick-to-get-helix-themes-selected-'>Quick trick to get Helix themes selected ...</a></li> +<li>⇢ ⇢ <a href='#example-where-complexity-attacks-you-from-'>Example where complexity attacks you from ...</a></li> +<li>⇢ ⇢ <a href='#llms-for-ops-summaries-of-logs-probabilities-'>LLMs for Ops? Summaries of logs, probabilities ...</a></li> +<li>⇢ ⇢ <a href='#excellent-article-about-your-dream-product-'>Excellent article about your dream Product ...</a></li> +<li>⇢ ⇢ <a href='#i-just-finished-reading-all-chapters-of-cpu-'>I just finished reading all chapters of CPU ...</a></li> +<li>⇢ ⇢ <a href='#indeed-useful-to-know-this-stuff-sre-'>Indeed, useful to know this stuff! <span class='inlinecode'>#sre</span> ...</a></li> +<li>⇢ ⇢ <a href='#it-s-the-small-things-which-make-unix-like-'>It's the small things, which make Unix like ...</a></li> +<li>⇢ ⇢ <a href='#my-new-year-s-resolution-is-not-to-start-any-'>My New Year's resolution is not to start any ...</a></li> +</ul><br /> +<h1 style='display: inline' id='posts-for-202410-202411-202412'>Posts for 202410 202411 202412</h1><br /> +<br /> +<h2 style='display: inline' id='october-2024'>October 2024</h2><br /> +<br /> +<h3 style='display: inline' id='first-on-call-experience-in-a-startup-doesn-t-'>First on-call experience in a startup. Doesn't ...</h3><br /> +<br /> +<span>First on-call experience in a startup. Doesn't sound a lot of fun! But the lessons were learned! <span class='inlinecode'>#sre</span></span><br /> +<br /> +<a class='textlink' href='https://ntietz.com/blog/lessons-from-my-first-on-call/'>ntietz.com/blog/lessons-from-my-first-on-call/</a><br /> +<br /> +<h3 style='display: inline' id='reviewing-your-own-pr-or-mr-before-asking-'>Reviewing your own PR or MR before asking ...</h3><br /> +<br /> +<span>Reviewing your own PR or MR before asking others to review it makes a lot of sense. Have seen so many silly mistakes which would have been avoided. Saving time for the real reviewer.</span><br /> +<br /> +<a class='textlink' href='https://www.jvt.me/posts/2019/01/12/self-code-review/'>www.jvt.me/posts/2019/01/12/self-code-review/</a><br /> +<br /> +<h3 style='display: inline' id='fun-with-defer-in-golang-i-did-t-know-that-'>Fun with defer in <span class='inlinecode'>#golang</span>, I did't know, that ...</h3><br /> +<br /> +<span>Fun with defer in <span class='inlinecode'>#golang</span>, I did't know, that a defer object can either be heap or stack allocated. And there are some rules for inlining, too.</span><br /> +<br /> +<a class='textlink' href='https://victoriametrics.com/blog/defer-in-go/'>victoriametrics.com/blog/defer-in-go/</a><br /> +<br /> +<h3 style='display: inline' id='i-have-been-in-incidents-understandably-'>I have been in incidents. Understandably, ...</h3><br /> +<br /> +<span>I have been in incidents. Understandably, everyone wants the issue to be resolved as quickly and others want to know how long TTR will be. IMHO, providing no estimates at all is no solution either. So maybe give a rough estimate but clearly communicate that the estimate is rough and that X, Y, and Z can interfere, meaning there is a chance it will take longer to resolve the incident. Just my thought. What's yours?</span><br /> +<br /> +<a class='textlink' href='https://firehydrant.com/blog/hot-take-dont-provide-incident-resolution-estimates/'>firehydrant.com/blog/hot-take-dont-provide-incident-resolution-estimates/</a><br /> +<br /> +<h3 style='display: inline' id='little-tips-using-strings-in-golang-and-i-'>Little tips using strings in <span class='inlinecode'>#golang</span> and I ...</h3><br /> +<br /> +<span>Little tips using strings in <span class='inlinecode'>#golang</span> and I personally think one must look more into the std lib (not just for strings, also for slices, maps,...), there are tons of useful helper functions.</span><br /> +<br /> +<a class='textlink' href='https://www.calhoun.io/6-tips-for-using-strings-in-go/'>www.calhoun.io/6-tips-for-using-strings-in-go/</a><br /> +<br /> +<h3 style='display: inline' id='reading-this-post-about-rust-especially-the-'>Reading this post about <span class='inlinecode'>#rust</span> (especially the ...</h3><br /> +<br /> +<span>Reading this post about <span class='inlinecode'>#rust</span> (especially the first part), I think I made a good choice in deciding to dive into <span class='inlinecode'>#golang</span> instead. There was a point where I wanted to learn a new programming language, and Rust was on my list of choices. I think the Go project does a much better job of deciding what goes into the language and how. What are your thoughts?</span><br /> +<br /> +<a class='textlink' href='https://josephg.com/blog/rewriting-rust/'>josephg.com/blog/rewriting-rust/</a><br /> +<br /> +<h3 style='display: inline' id='the-opposite-of-chaosmonkey--'>The opposite of <span class='inlinecode'>#ChaosMonkey</span> ... ...</h3><br /> +<br /> +<span>The opposite of <span class='inlinecode'>#ChaosMonkey</span> ... automatically repairing and healing services helping to reduce manual toil work. Runbooks and scripts are only the first step, followed by a fully blown service written in Go. Could be useful, but IMHO why not rather address the root causes of the manual toil work? <span class='inlinecode'>#sre</span></span><br /> +<br /> +<a class='textlink' href='https://blog.cloudflare.com/nl-nl/improving-platform-resilience-at-cloudflare/'>blog.cloudflare.com/nl-nl/improving-platform-resilience-at-cloudflare/</a><br /> +<br /> +<h2 style='display: inline' id='november-2024'>November 2024</h2><br /> +<br /> +<h3 style='display: inline' id='i-just-became-a-silver-patreon-for-osnews-what-'>I just became a Silver Patreon for OSnews. What ...</h3><br /> +<br /> +<span>I just became a Silver Patreon for OSnews. What is OSnews? It is an independent news site about IT. It is slightly independent and, at times, alternative. I have enjoyed it since my early student days. This one and other projects I financially support are listed here:</span><br /> +<br /> +<a class='textlink' href='gemini://foo.zone/gemfeed/2024-09-07-projects-i-support.gmi'>foo.zone/gemfeed/2024-09-07-projects-i-support.gmi (Gemini)</a><br /> +<a class='textlink' href='https://foo.zone/gemfeed/2024-09-07-projects-i-support.html'>foo.zone/gemfeed/2024-09-07-projects-i-support.html</a><br /> +<br /> +<h3 style='display: inline' id='until-now-i-wasn-t-aware-that-go-is-under-a-'>Until now, I wasn't aware, that Go is under a ...</h3><br /> +<br /> +<span>Until now, I wasn't aware, that Go is under a BSD-style license (3-clause as it seems). Neat. I don't know why, but I always was under the impression it would be MIT. <span class='inlinecode'>#bsd</span> <span class='inlinecode'>#golang</span></span><br /> +<br /> +<a class='textlink' href='https://go.dev/LICENSE'>go.dev/LICENSE</a><br /> +<br /> +<h3 style='display: inline' id='these-are-some-book-notes-from-staff-engineer-'>These are some book notes from "Staff Engineer" ...</h3><br /> +<br /> +<span>These are some book notes from "Staff Engineer" – there is some really good insight into what is expected from a Staff Engineer and beyond in the industry. I wish I had read the book earlier.</span><br /> +<br /> +<a class='textlink' href='gemini://foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.gmi'>foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.gmi (Gemini)</a><br /> +<a class='textlink' href='https://foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.html'>foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.html</a><br /> +<br /> +<h3 style='display: inline' id='looking-at-kubernetes-it-s-pretty-much-'>Looking at <span class='inlinecode'>#Kubernetes</span>, it's pretty much ...</h3><br /> +<br /> +<span>Looking at <span class='inlinecode'>#Kubernetes</span>, it's pretty much following the Unix way of doing things. It has many tools, but each tool has its own single purpose: DNS, scheduling, container runtime, various controllers, networking, observability, alerting, and more services in the control plane. Everything is managed by different services or plugins, mostly running in their dedicated pods. They don't communicate through pipes, but network sockets, though. <span class='inlinecode'>#k8s</span></span><br /> +<br /> +<h3 style='display: inline' id='there-has-been-an-outage-at-the-upstream-'>There has been an outage at the upstream ...</h3><br /> +<br /> +<span>There has been an outage at the upstream network provider for OpenBSD.Amsterdam (hoster, I am using). This was the first real-world test for my KISS HA setup, and it worked flawlessly! All my sites and services failed over automatically to my other <span class='inlinecode'>#OpenBSD</span> VM!</span><br /> +<br /> +<a class='textlink' href='gemini://foo.zone/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi'>foo.zone/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi (Gemini)</a><br /> +<a class='textlink' href='https://foo.zone/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.html'>foo.zone/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.html</a><br /> +<a class='textlink' href='https://openbsd.amsterdam/'>openbsd.amsterdam/</a><br /> +<br /> +<h3 style='display: inline' id='one-of-the-more-confusing-parts-in-go-nil-'>One of the more confusing parts in Go, nil ...</h3><br /> +<br /> +<span>One of the more confusing parts in Go, nil values vs nil errors: <span class='inlinecode'>#golang</span></span><br /> +<br /> +<a class='textlink' href='https://unexpected-go.com/nil-errors-that-are-non-nil-errors.html'>unexpected-go.com/nil-errors-that-are-non-nil-errors.html</a><br /> +<br /> +<h3 style='display: inline' id='agreeably-writing-down-with-diagrams-helps-you-'>Agreeably, writing down with Diagrams helps you ...</h3><br /> +<br /> +<span>Agreeably, writing down with Diagrams helps you to think things more through. And keeps others on the same page. Only worth for projects from a certain size, IMHO.</span><br /> +<br /> +<a class='textlink' href='https://ntietz.com/blog/reasons-to-write-design-docs/'>ntietz.com/blog/reasons-to-write-design-docs/</a><br /> +<br /> +<h3 style='display: inline' id='i-like-the-idea-of-types-in-ruby-raku-is-'>I like the idea of types in Ruby. Raku is ...</h3><br /> +<br /> +<span>I like the idea of types in Ruby. Raku is supports that already, but in Ruby, you must specify the types in a separate .rbs file, which is, in my opinion, cumbersome and is a reason not to use it extensively for now. I believe there are efforts to embed the type information in the standard .rb files, and that the .rbs is just an experiment to see how types could work out without introducing changes into the core Ruby language itself right now? <span class='inlinecode'>#Ruby</span> <span class='inlinecode'>#RakuLang</span></span><br /> +<br /> +<a class='textlink' href='https://github.com/ruby/rbs'>github.com/ruby/rbs</a><br /> +<br /> +<h3 style='display: inline' id='so-haskell-is-better-suited-for-general-'>So, <span class='inlinecode'>#Haskell</span> is better suited for general ...</h3><br /> +<br /> +<span>So, <span class='inlinecode'>#Haskell</span> is better suited for general purpose than <span class='inlinecode'>#Rust</span>? I thought deploying something in Haskell means publishing an academic paper :-) Interesting rant about Rust, though:</span><br /> +<br /> +<a class='textlink' href='https://chrisdone.com/posts/rust/'>chrisdone.com/posts/rust/</a><br /> +<br /> +<h3 style='display: inline' id='at-first-functional-options-add-a-bit-of-'>At first, functional options add a bit of ...</h3><br /> +<br /> +<span>At first, functional options add a bit of boilerplate, but they turn out to be quite neat, especially when you have very long parameter lists that need to be made neat and tidy. <span class='inlinecode'>#golang</span></span><br /> +<br /> +<a class='textlink' href='https://www.calhoun.io/using-functional-options-instead-of-method-chaining-in-go/'>www.calhoun.io/using-functional-options-instead-of-method-chaining-in-go/</a><br /> +<br /> +<h3 style='display: inline' id='revamping-my-home-lab-a-little-bit-freebsd-'>Revamping my home lab a little bit. <span class='inlinecode'>#freebsd</span> ...</h3><br /> +<br /> +<span>Revamping my home lab a little bit. <span class='inlinecode'>#freebsd</span> <span class='inlinecode'>#bhyve</span> <span class='inlinecode'>#rocky</span> <span class='inlinecode'>#linux</span> <span class='inlinecode'>#vm</span> <span class='inlinecode'>#k3s</span> <span class='inlinecode'>#kubernetes</span> <span class='inlinecode'>#wireguard</span> <span class='inlinecode'>#zfs</span> <span class='inlinecode'>#nfs</span> <span class='inlinecode'>#ha</span> <span class='inlinecode'>#relayd</span> <span class='inlinecode'>#k8s</span> <span class='inlinecode'>#selfhosting</span> <span class='inlinecode'>#homelab</span></span><br /> +<br /> +<a class='textlink' href='gemini://foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi'>foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi (Gemini)</a><br /> +<a class='textlink' href='https://foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.html</a><br /> +<br /> +<h3 style='display: inline' id='wondering-to-which-web-browser-i-should-'>Wondering to which <span class='inlinecode'>#web</span> <span class='inlinecode'>#browser</span> I should ...</h3><br /> +<br /> +<span>Wondering to which <span class='inlinecode'>#web</span> <span class='inlinecode'>#browser</span> I should switch now personally ...</span><br /> +<br /> +<a class='textlink' href='https://www.osnews.com/story/141100/mozilla-foundation-lays-off-30-of-its-employees-ends-advocacy-for-open-web-privacy-and-more/'>www.osnews.com/story/141100/mozilla-fo..-..dvocacy-for-open-web-privacy-and-more/</a><br /> +<br /> +<h3 style='display: inline' id='eks-node-viewer-is-a-nifty-tool-showing-the-'>eks-node-viewer is a nifty tool, showing the ...</h3><br /> +<br /> +<span>eks-node-viewer is a nifty tool, showing the compute nodes currently in use in the <span class='inlinecode'>#EKS</span> cluster. especially useful when dynamically allocating nodes with <span class='inlinecode'>#karpenter</span> or auto scaling groups.</span><br /> +<br /> +<a class='textlink' href='https://github.com/awslabs/eks-node-viewer'>github.com/awslabs/eks-node-viewer</a><br /> +<br /> +<h3 style='display: inline' id='have-put-more-photos-on---on-my-static-photo-'>Have put more Photos on - On my static photo ...</h3><br /> +<br /> +<span>Have put more Photos on - On my static photo sites - Generated with a <span class='inlinecode'>#bash</span> script</span><br /> +<br /> +<a class='textlink' href='https://irregular.ninja'>irregular.ninja</a><br /> +<br /> +<h3 style='display: inline' id='in-go-passing-pointers-are-not-automatically-'>In Go, passing pointers are not automatically ...</h3><br /> +<br /> +<span>In Go, passing pointers are not automatically faster than values. Pointers often force the memory to be allocated on the heap, adding GC overhad. With values, Go can determine whether to put the memory on the stack instead. But with large structs/objects (how you want to call them) or if you want to modify state, then pointers are the semantic to use. <span class='inlinecode'>#golang</span></span><br /> +<br /> +<a class='textlink' href='https://blog.boot.dev/golang/pointers-faster-than-values/'>blog.boot.dev/golang/pointers-faster-than-values/</a><br /> +<br /> +<h3 style='display: inline' id='myself-being-part-of-an-on-call-rotations-over-'>Myself being part of an on-call rotations over ...</h3><br /> +<br /> +<span>Myself being part of an on-call rotations over my whole professional life, just have learned this lesson "Tell people who are new to on-call: Just have fun" :-) This is a neat blog post to read:</span><br /> +<br /> +<a class='textlink' href='https://ntietz.com/blog/what-i-tell-people-new-to-oncall/'>ntietz.com/blog/what-i-tell-people-new-to-oncall/</a><br /> +<br /> +<h3 style='display: inline' id='feels-good-to-code-in-my-old-love-perl-again-'>Feels good to code in my old love <span class='inlinecode'>#Perl</span> again ...</h3><br /> +<br /> +<span>Feels good to code in my old love <span class='inlinecode'>#Perl</span> again after a while. I am implementing a log parser for generating site stats of my personal homepage! :-) @Perl</span><br /> +<br /> +<h3 style='display: inline' id='this-is-an-interactive-summary-of-the-go-'>This is an interactive summary of the Go ...</h3><br /> +<br /> +<span>This is an interactive summary of the Go release, with a lot of examples utilising iterators in the slices and map packages. Love it! <span class='inlinecode'>#golang</span></span><br /> +<br /> +<a class='textlink' href='https://antonz.org/go-1-23/'>antonz.org/go-1-23/</a><br /> +<br /> +<h2 style='display: inline' id='december-2024'>December 2024</h2><br /> +<br /> +<h3 style='display: inline' id='thats-unexpected-you-cant-remove-a-nan-key-'>Thats unexpected, you cant remove a NaN key ...</h3><br /> +<br /> +<span>Thats unexpected, you cant remove a NaN key from a map without clearing it! <span class='inlinecode'>#golang</span></span><br /> +<br /> +<a class='textlink' href='https://unexpected-go.com/you-cant-remove-a-nan-key-from-a-map-without-clearing-it.html'>unexpected-go.com/you-cant-remove-a-nan-key-from-a-map-without-clearing-it.html</a><br /> +<br /> +<h3 style='display: inline' id='my-second-blog-post-about-revamping-my-home-lab-'>My second blog post about revamping my home lab ...</h3><br /> +<br /> +<span>My second blog post about revamping my home lab a little bit just hit the net. <span class='inlinecode'>#FreeBSD</span> <span class='inlinecode'>#ZFS</span> <span class='inlinecode'>#n100</span> <span class='inlinecode'>#k8s</span> <span class='inlinecode'>#k3s</span> <span class='inlinecode'>#kubernetes</span></span><br /> +<br /> +<a class='textlink' href='gemini://foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi'>foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi (Gemini)</a><br /> +<a class='textlink' href='https://foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.html</a><br /> +<br /> +<h3 style='display: inline' id='very-insightful-article-about-tech-hiring-in-'>Very insightful article about tech hiring in ...</h3><br /> +<br /> +<span>Very insightful article about tech hiring in the age of LLMs. As an interviewer, I have experienced some of the scrnarios already first hand...</span><br /> +<br /> +<a class='textlink' href='https://newsletter.pragmaticengineer.com/p/how-genai-changes-tech-hiring'>newsletter.pragmaticengineer.com/p/how-genai-changes-tech-hiring</a><br /> +<br /> +<h3 style='display: inline' id='for-bpf-ebpf-performance-debugging-have-'>for <span class='inlinecode'>#bpf</span> <span class='inlinecode'>#ebpf</span> performance debugging, have ...</h3><br /> +<br /> +<span>for <span class='inlinecode'>#bpf</span> <span class='inlinecode'>#ebpf</span> performance debugging, have a look at bpftop from Netflix. A neat tool showing you the estimated CPU time and other performance statistics for all the BPF programs currently loaded into the <span class='inlinecode'>#linux</span> kernel. Highly recommend!</span><br /> +<br /> +<a class='textlink' href='https://github.com/Netflix/bpftop'>github.com/Netflix/bpftop</a><br /> +<br /> +<h3 style='display: inline' id='89-things-heshe-knows-about-git-commits-is-a-'>89 things he/she knows about Git commits is a ...</h3><br /> +<br /> +<span>89 things he/she knows about Git commits is a neat list of <span class='inlinecode'>#Git</span> wisdoms</span><br /> +<br /> +<a class='textlink' href='https://www.jvt.me/posts/2024/07/12/things-know-commits/'>www.jvt.me/posts/2024/07/12/things-know-commits/</a><br /> +<br /> +<h3 style='display: inline' id='i-found-that-working-on-multiple-side-projects-'>I found that working on multiple side projects ...</h3><br /> +<br /> +<span>I found that working on multiple side projects concurrently is better than concentrating on just one. This seems inefficient at first, but whenever you tend to lose motivation, you can temporarily switch to another one with full élan. However, remember to stop starting and start finishing. This doesn't mean you should be working on 10+ (and a growing list of) side projects concurrently! Select your projects and commit to finishing them before starting the next thing. For example, my current limit of concurrent side projects is around five.</span><br /> +<br /> +<h3 style='display: inline' id='agreed-agreed-besides-ruby-i-would-also-'>Agreed? Agreed. Besides <span class='inlinecode'>#Ruby</span>, I would also ...</h3><br /> +<br /> +<span>Agreed? Agreed. Besides <span class='inlinecode'>#Ruby</span>, I would also add <span class='inlinecode'>#RakuLang</span> and <span class='inlinecode'>#Perl</span> @Perl to the list of languages that are great for shell scripts - "Making Easy Things Easy and Hard Things Possible"</span><br /> +<br /> +<a class='textlink' href='https://lucasoshiro.github.io/posts-en/2024-06-17-ruby-shellscript/'>lucasoshiro.github.io/posts-en/2024-06-17-ruby-shellscript/</a><br /> +<br /> +<h3 style='display: inline' id='plan9-assembly-format-in-go-but-wait-it-s-not-'>Plan9 assembly format in Go, but wait, it's not ...</h3><br /> +<br /> +<span>Plan9 assembly format in Go, but wait, it's not the Operating System Plan9! <span class='inlinecode'>#golang</span> <span class='inlinecode'>#rabbithole</span></span><br /> +<br /> +<a class='textlink' href='https://www.osnews.com/story/140941/go-plan9-memo-speeding-up-calculations-450/'>www.osnews.com/story/140941/go-plan9-memo-speeding-up-calculations-450/</a><br /> +<br /> +<h3 style='display: inline' id='this-is-a-neat-blog-post-about-the-helix-text-'>This is a neat blog post about the Helix text ...</h3><br /> +<br /> +<span>This is a neat blog post about the Helix text editor, to which I personally switched around a year ago (from NeoVim). I should blog about my experience as well. To summarize: I am using it together with the terminal multiplexer <span class='inlinecode'>#tmux</span>. It doesn't bother me that Helix is purely terminal-based and therefore everything has to be in the same font. <span class='inlinecode'>#HelixEditor</span></span><br /> +<br /> +<a class='textlink' href='https://jonathan-frere.com/posts/helix/'>jonathan-frere.com/posts/helix/</a><br /> +<br /> +<h3 style='display: inline' id='this-blog-post-is-basically-a-rant-against-'>This blog post is basically a rant against ...</h3><br /> +<br /> +<span>This blog post is basically a rant against DataDog... Personally, I don't have much experience with DataDog (actually, I have never used it), but one reason to work with logs at my day job (with over 2,000 physical server machines) and to be cost-effective is by using dtail! <span class='inlinecode'>#dtail</span> <span class='inlinecode'>#logs</span> <span class='inlinecode'>#logmanagement</span></span><br /> +<br /> +<a class='textlink' href='https://crys.site/blog/2024/reinventint-the-weel/'>crys.site/blog/2024/reinventint-the-weel/</a><br /> +<a class='textlink' href='https://dtail.dev'>dtail.dev</a><br /> +<br /> +<h3 style='display: inline' id='quick-trick-to-get-helix-themes-selected-'>Quick trick to get Helix themes selected ...</h3><br /> +<br /> +<span>Quick trick to get Helix themes selected randomly <span class='inlinecode'>#HelixEditor</span></span><br /> +<br /> +<a class='textlink' href='gemini://foo.zone/gemfeed/2024-12-15-random-helix-themes.gmi'>foo.zone/gemfeed/2024-12-15-random-helix-themes.gmi (Gemini)</a><br /> +<a class='textlink' href='https://foo.zone/gemfeed/2024-12-15-random-helix-themes.html'>foo.zone/gemfeed/2024-12-15-random-helix-themes.html</a><br /> +<br /> +<h3 style='display: inline' id='example-where-complexity-attacks-you-from-'>Example where complexity attacks you from ...</h3><br /> +<br /> +<span>Example where complexity attacks you from behind <span class='inlinecode'>#k8s</span> <span class='inlinecode'>#kubernetes</span> <span class='inlinecode'>#OpenAI</span></span><br /> +<br /> +<a class='textlink' href='https://surfingcomplexity.blog/2024/12/14/quick-takes-on-the-recent-openai-public-incident-write-up/'>surfingcomplexity.blog/2024/12/14/quic..-..ecent-openai-public-incident-write-up/</a><br /> +<br /> +<h3 style='display: inline' id='llms-for-ops-summaries-of-logs-probabilities-'>LLMs for Ops? Summaries of logs, probabilities ...</h3><br /> +<br /> +<span>LLMs for Ops? Summaries of logs, probabilities about correctness, auto-generating Ansible, some uses cases are there. Wouldn't trust it fully, though.</span><br /> +<br /> +<a class='textlink' href='https://youtu.be/WodaffxVq-E?si=noY0egrfl5izCSQI'>youtu.be/WodaffxVq-E?si=noY0egrfl5izCSQI</a><br /> +<br /> +<h3 style='display: inline' id='excellent-article-about-your-dream-product-'>Excellent article about your dream Product ...</h3><br /> +<br /> +<span>Excellent article about your dream Product Manager: Why every software team needs a product manager to thrive via @wallabagapp</span><br /> +<br /> +<a class='textlink' href='https://testdouble.com/insights/why-product-managers-accelerate-improve-software-delivery'>testdouble.com/insights/why-product-ma..-..s-accelerate-improve-software-delivery</a><br /> +<br /> +<h3 style='display: inline' id='i-just-finished-reading-all-chapters-of-cpu-'>I just finished reading all chapters of CPU ...</h3><br /> +<br /> +<span>I just finished reading all chapters of CPU land: ... not claiming to remember every detail, but it is a great refresher how CPUs and operating systems actually work under the hood when you execute a program, which we tend to forget in our higher abstraction world. I liked the "story" and some of the jokes along the way! Size wise, it is pretty digestable (not talking about books, but only 7 web articles/chapters)! <span class='inlinecode'>#cpu</span> <span class='inlinecode'>#linux</span> <span class='inlinecode'>#unix</span> <span class='inlinecode'>#kernel</span> <span class='inlinecode'>#macOS</span></span><br /> +<br /> +<a class='textlink' href='https://cpu.land/'>cpu.land/</a><br /> +<br /> +<h3 style='display: inline' id='indeed-useful-to-know-this-stuff-sre-'>Indeed, useful to know this stuff! <span class='inlinecode'>#sre</span> ...</h3><br /> +<br /> +<span>Indeed, useful to know this stuff! <span class='inlinecode'>#sre</span></span><br /> +<br /> +<a class='textlink' href='https://biriukov.dev/docs/resolver-dual-stack-application/0-sre-should-know-about-gnu-linux-resolvers-and-dual-stack-applications/'>biriukov.dev/docs/resolver-dual-stack-..-..resolvers-and-dual-stack-applications/</a><br /> +<br /> +<h3 style='display: inline' id='it-s-the-small-things-which-make-unix-like-'>It's the small things, which make Unix like ...</h3><br /> +<br /> +<span>It's the small things, which make Unix like systems, like GNU/Linux, interesting. Didn't know about this <span class='inlinecode'>#GNU</span> <span class='inlinecode'>#Tar</span> behaviour yet:</span><br /> +<br /> +<a class='textlink' href='https://xeiaso.net/notes/2024/pop-quiz-tar/'>xeiaso.net/notes/2024/pop-quiz-tar/</a><br /> +<br /> +<h3 style='display: inline' id='my-new-year-s-resolution-is-not-to-start-any-'>My New Year's resolution is not to start any ...</h3><br /> +<br /> +<span>My New Year's resolution is not to start any new non-fiction books (or only very few) but to re-read and listen to my favorites, which I read to reflect on and see things from different perspectives. Every time you re-read a book, you gain new insights.<nil>17491</span><br /> +<br /> +<span>Other related posts:</span><br /> +<br /> +<a class='textlink' href='./2025-01-01-posts-from-october-to-december-2024.html'>2025-01-01 Posts from October to December 2024 (You are currently reading this)</a><br /> +<br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>Random Helix Themes</title> + <link href="gemini://foo.zone/gemfeed/2024-12-15-random-helix-themes.gmi" /> + <id>gemini://foo.zone/gemfeed/2024-12-15-random-helix-themes.gmi</id> + <updated>2024-12-15T13:55:05+02:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>I thought it would be fun to have a random Helix theme every time I open a new shell. Helix is the text editor I use.</summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='random-helix-themes'>Random Helix Themes</h1><br /> +<br /> +<span class='quote'>Published at 2024-12-15T13:55:05+02:00; Last updated 2024-12-18</span><br /> +<br /> +<span>I thought it would be fun to have a random Helix theme every time I open a new shell. Helix is the text editor I use.</span><br /> +<br /> +<a class='textlink' href='https://helix-editor.com/'>https://helix-editor.com/</a><br /> +<br /> +<span>So I put this into my <span class='inlinecode'>zsh</span> dotfiles (in some <span class='inlinecode'>editor.zsh.source</span> in my <span class='inlinecode'>~</span> directory):</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><b><font color="#ffffff">export</font></b><font color="#ff0000"> </font><font color="#ff0000">EDITOR</font><font color="#F3E651">=</font><font color="#ff0000">hx</font> +<b><font color="#ffffff">export</font></b><font color="#ff0000"> </font><font color="#ff0000">VISUAL</font><font color="#F3E651">=</font><font color="#ff0000">$EDITOR</font> +<b><font color="#ffffff">export</font></b><font color="#ff0000"> </font><font color="#ff0000">GIT_EDITOR</font><font color="#F3E651">=</font><font color="#ff0000">$EDITOR</font> +<b><font color="#ffffff">export</font></b><font color="#ff0000"> </font><font color="#ff0000">HELIX_CONFIG_DIR</font><font color="#F3E651">=</font><font color="#ff0000">$HOME</font><font color="#F3E651">/.</font><font color="#ff0000">config/helix</font> + +<font color="#ff0000">editor</font><font color="#F3E651">::</font><font color="#ff0000">helix</font><font color="#F3E651">::</font><font color="#7bc710">random_theme ()</font><font color="#ff0000"> {</font> +<font color="#ff0000"> </font><i><font color="#ababab"># May add more theme search paths based on OS. This one is</font></i> +<font color="#ff0000"> </font><i><font color="#ababab"># for Fedora Linux, but there is also MacOS, etc.</font></i> +<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">theme_dir</font><font color="#F3E651">=</font><font color="#ff0000">/usr/share/helix/runtime/themes</font> +<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#F3E651">!</font><font color="#ff0000"> -d </font><font color="#ff0000">$theme_dir</font><font color="#ff0000"> </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> +<font color="#ff0000"> echo </font><font color="#bb00ff">"Helix theme dir $theme_dir doesnt exist"</font> +<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> </font><font color="#bb00ff">1</font> +<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> + +<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">config_file</font><font color="#F3E651">=</font><font color="#ff0000">$HELIX_CONFIG_DIR</font><font color="#ff0000">/config</font><font color="#F3E651">.</font><font color="#ff0000">toml</font> +<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">random_theme</font><font color="#F3E651">=</font><font color="#bb00ff">"$(basename "</font><font color="#ff0000">$(</font><font color="#ff0000">ls </font><font color="#ff0000">$theme_dir</font><font color="#ff0000"> </font><font color="#F3E651">\</font> +<font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> grep -v random</font><font color="#F3E651">.</font><font color="#ff0000">toml </font><font color="#F3E651">|</font><font color="#ff0000"> grep </font><font color="#F3E651">.</font><font color="#ff0000">toml </font><font color="#F3E651">|</font><font color="#ff0000"> sort -R </font><font color="#F3E651">\</font> +<font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> head -n </font><font color="#bb00ff">1</font><font color="#F3E651">)</font><font color="#bb00ff">" | cut -d. -f1)"</font> + +<font color="#ff0000"> sed </font><font color="#bb00ff">"/^theme =/ { s/.*/theme = </font><font color="#ffffff">\"</font><font color="#bb00ff">$random_theme</font><font color="#ffffff">\"</font><font color="#bb00ff">/; }"</font><font color="#ff0000"> </font><font color="#F3E651">\</font> +<font color="#ff0000"> </font><font color="#ff0000">$config_file</font><font color="#ff0000"> </font><font color="#F3E651">></font><font color="#ff0000"> </font><font color="#ff0000">$config_file</font><font color="#F3E651">.</font><font color="#ff0000">tmp </font><font color="#F3E651">&&</font><font color="#ff0000"> </font> +<font color="#ff0000"> mv </font><font color="#ff0000">$config_file</font><font color="#F3E651">.</font><font color="#ff0000">tmp </font><font color="#ff0000">$config_file</font> +<font color="#ff0000">}</font> + +<b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> -f </font><font color="#ff0000">$HELIX_CONFIG_DIR</font><font color="#ff0000">/config</font><font color="#F3E651">.</font><font color="#ff0000">toml </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> +<font color="#ff0000"> editor</font><font color="#F3E651">::</font><font color="#ff0000">helix</font><font color="#F3E651">::</font><font color="#ff0000">random_theme</font> +<b><font color="#ffffff">fi</font></b> +</pre> +<br /> +<span>So every time I open a new terminal or shell, <span class='inlinecode'>editor::helix::random_theme</span> gets called, which randomly selects a theme from all installed ones and updates the helix config accordingly.</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><font color="#F3E651">[</font><font color="#ff0000">paul@earth</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">~</font><font color="#ff0000"> </font><font color="#F3E651">%</font><font color="#ff0000"> editor</font><font color="#F3E651">::</font><font color="#ff0000">helix</font><font color="#F3E651">::</font><font color="#ff0000">random_theme</font> +<font color="#F3E651">[</font><font color="#ff0000">paul@earth</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">~</font><font color="#ff0000"> </font><font color="#F3E651">%</font><font color="#ff0000"> head -n </font><font color="#bb00ff">1</font><font color="#ff0000"> </font><font color="#F3E651">~/.</font><font color="#ff0000">config/helix/config</font><font color="#F3E651">.</font><font color="#ff0000">toml</font> +<font color="#ff0000">theme </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#bb00ff">"jellybeans"</font> +<font color="#F3E651">[</font><font color="#ff0000">paul@earth</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">~</font><font color="#ff0000"> </font><font color="#F3E651">%</font><font color="#ff0000"> editor</font><font color="#F3E651">::</font><font color="#ff0000">helix</font><font color="#F3E651">::</font><font color="#ff0000">random_theme</font> +<font color="#F3E651">[</font><font color="#ff0000">paul@earth</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">~</font><font color="#ff0000"> </font><font color="#F3E651">%</font><font color="#ff0000"> head -n </font><font color="#bb00ff">1</font><font color="#ff0000"> </font><font color="#F3E651">~/.</font><font color="#ff0000">config/helix/config</font><font color="#F3E651">.</font><font color="#ff0000">toml</font> +<font color="#ff0000">theme </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#bb00ff">"rose_pine"</font> +<font color="#F3E651">[</font><font color="#ff0000">paul@earth</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">~</font><font color="#ff0000"> </font><font color="#F3E651">%</font><font color="#ff0000"> editor</font><font color="#F3E651">::</font><font color="#ff0000">helix</font><font color="#F3E651">::</font><font color="#ff0000">random_theme</font> +<font color="#F3E651">[</font><font color="#ff0000">paul@earth</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">~</font><font color="#ff0000"> </font><font color="#F3E651">%</font><font color="#ff0000"> head -n </font><font color="#bb00ff">1</font><font color="#ff0000"> </font><font color="#F3E651">~/.</font><font color="#ff0000">config/helix/config</font><font color="#F3E651">.</font><font color="#ff0000">toml</font> +<font color="#ff0000">theme </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#bb00ff">"noctis"</font> +<font color="#F3E651">[</font><font color="#ff0000">paul@earth</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">~</font><font color="#ff0000"> </font><font color="#F3E651">%</font> +</pre> +<br /> +<h2 style='display: inline' id='a-better-version'>A better version</h2><br /> +<br /> +<span class='quote'>Update 2024-12-18: This is an improved version, which works cross platform (e.g., also on MacOS) and multiple theme directories:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><b><font color="#ffffff">export</font></b><font color="#ff0000"> </font><font color="#ff0000">EDITOR</font><font color="#F3E651">=</font><font color="#ff0000">hx</font> +<b><font color="#ffffff">export</font></b><font color="#ff0000"> </font><font color="#ff0000">VISUAL</font><font color="#F3E651">=</font><font color="#ff0000">$EDITOR</font> +<b><font color="#ffffff">export</font></b><font color="#ff0000"> </font><font color="#ff0000">GIT_EDITOR</font><font color="#F3E651">=</font><font color="#ff0000">$EDITOR</font> +<b><font color="#ffffff">export</font></b><font color="#ff0000"> </font><font color="#ff0000">HELIX_CONFIG_DIR</font><font color="#F3E651">=</font><font color="#ff0000">$HOME</font><font color="#F3E651">/.</font><font color="#ff0000">config/helix</font> + +<font color="#ff0000">editor</font><font color="#F3E651">::</font><font color="#ff0000">helix</font><font color="#F3E651">::</font><font color="#ff0000">theme</font><font color="#F3E651">::</font><font color="#7bc710">get_random ()</font><font color="#ff0000"> {</font> +<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> dir </font><b><font color="#ffffff">in</font></b><font color="#ff0000"> </font><font color="#ff0000">$(</font><font color="#ff0000">hx --health </font><font color="#F3E651">\</font> +<font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> awk </font><font color="#bb00ff">'/^Runtime directories/ { print $3 }'</font><font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> tr </font><font color="#bb00ff">';'</font><font color="#ff0000"> </font><font color="#bb00ff">' '</font><font color="#F3E651">);</font><font color="#ff0000"> </font><b><font color="#ffffff">do</font></b> +<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> -d </font><font color="#ff0000">$dir</font><font color="#ff0000">/themes </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> +<font color="#ff0000"> ls </font><font color="#ff0000">$dir</font><font color="#ff0000">/themes</font> +<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> +<font color="#ff0000"> </font><b><font color="#ffffff">done</font></b><font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> grep -F </font><font color="#F3E651">.</font><font color="#ff0000">toml </font><font color="#F3E651">|</font><font color="#ff0000"> sort -R </font><font color="#F3E651">|</font><font color="#ff0000"> head -n </font><font color="#bb00ff">1</font><font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> cut -d</font><font color="#F3E651">.</font><font color="#ff0000"> -f</font><font color="#bb00ff">1</font> +<font color="#ff0000">}</font> + +<font color="#ff0000">editor</font><font color="#F3E651">::</font><font color="#ff0000">helix</font><font color="#F3E651">::</font><font color="#ff0000">theme</font><font color="#F3E651">::</font><font color="#7bc710">set ()</font><font color="#ff0000"> {</font> +<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">theme</font><font color="#F3E651">=</font><font color="#bb00ff">"$1"</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">shift</font></b> + +<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">config_file</font><font color="#F3E651">=</font><font color="#ff0000">$HELIX_CONFIG_DIR</font><font color="#ff0000">/config</font><font color="#F3E651">.</font><font color="#ff0000">toml</font> + +<font color="#ff0000"> sed </font><font color="#bb00ff">"/^theme =/ { s/.*/theme = </font><font color="#ffffff">\"</font><font color="#bb00ff">$theme</font><font color="#ffffff">\"</font><font color="#bb00ff">/; }"</font><font color="#ff0000"> </font><font color="#F3E651">\</font> +<font color="#ff0000"> </font><font color="#ff0000">$config_file</font><font color="#ff0000"> </font><font color="#F3E651">></font><font color="#ff0000"> </font><font color="#ff0000">$config_file</font><font color="#F3E651">.</font><font color="#ff0000">tmp </font><font color="#F3E651">&&</font><font color="#ff0000"> </font> +<font color="#ff0000"> mv </font><font color="#ff0000">$config_file</font><font color="#F3E651">.</font><font color="#ff0000">tmp </font><font color="#ff0000">$config_file</font> +<font color="#ff0000">}</font> + +<b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> -f </font><font color="#ff0000">$HELIX_CONFIG_DIR</font><font color="#ff0000">/config</font><font color="#F3E651">.</font><font color="#ff0000">toml </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> +<font color="#ff0000"> editor</font><font color="#F3E651">::</font><font color="#ff0000">helix</font><font color="#F3E651">::</font><font color="#ff0000">theme</font><font color="#F3E651">::</font><b><font color="#ffffff">set</font></b><font color="#ff0000"> </font><font color="#ff0000">$(editor::helix::theme::get_random)</font> +<b><font color="#ffffff">fi</font></b> +</pre> +<br /> +<span>I hope you had some fun. E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</title> + <link href="gemini://foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi" /> + <id>gemini://foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi</id> + <updated>2024-12-02T23:48:21+02:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>This is the second 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 I will use on FreeBSD-based physical machines.</summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='f3s-kubernetes-with-freebsd---part-2-hardware-and-base-installation'>f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</h1><br /> +<br /> +<span class='quote'>Published at 2024-12-02T23:48:21+02:00</span><br /> +<br /> +<span>This is the second 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 I will use on FreeBSD-based physical machines.</span><br /> +<br /> +<span>We set the stage last time; this time, we will set up the hardware for this project. </span><br /> +<br /> +<span>These are all the posts so far:</span><br /> +<br /> +<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br /> +<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</a><br /> +<br /> +<a href='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png'><img alt='f3s logo' title='f3s logo' src='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png' /></a><br /> +<br /> +<span class='quote'>Logo was generated by ChatGPT.</span><br /> +<br /> +<span>Let's continue...</span><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#f3s-kubernetes-with-freebsd---part-2-hardware-and-base-installation'>f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a></li> +<li><a href='#deciding-on-the-hardware'>Deciding on the hardware</a></li> +<li>⇢ <a href='#not-arm-but-intel-n100-'>Not ARM but Intel N100 </a></li> +<li>⇢ <a href='#beelink-unboxing'>Beelink unboxing</a></li> +<li>⇢ <a href='#network-switch'>Network switch</a></li> +<li><a href='#installing-freebsd'>Installing FreeBSD</a></li> +<li>⇢ <a href='#base-install'>Base install</a></li> +<li>⇢ <a href='#latest-patch-level-and-customizing-etchosts'>Latest patch level and customizing <span class='inlinecode'>/etc/hosts</span></a></li> +<li>⇢ <a href='#after-install'>After install</a></li> +<li>⇢ ⇢ <a href='#helix-editor'>Helix editor</a></li> +<li>⇢ ⇢ <a href='#doas'><span class='inlinecode'>doas</span></a></li> +<li>⇢ ⇢ <a href='#periodic-zfs-snapshotting'>Periodic ZFS snapshotting</a></li> +<li>⇢ ⇢ <a href='#uptime-tracking'>Uptime tracking</a></li> +<li><a href='#hardware-check'>Hardware check</a></li> +<li>⇢ <a href='#ethernet'>Ethernet</a></li> +<li>⇢ <a href='#ram'>RAM</a></li> +<li>⇢ <a href='#cpus'>CPUs</a></li> +<li>⇢ <a href='#cpu-throttling'>CPU throttling</a></li> +<li><a href='#conclusion'>Conclusion</a></li> +</ul><br /> +<h1 style='display: inline' id='deciding-on-the-hardware'>Deciding on the hardware</h1><br /> +<br /> +<span>Note that the OpenBSD VMs included in the f3s setup (which will be used later in this blog series for internet ingress - as you know from the first part of this blog series) are already there. These are virtual machines that I rent at OpenBSD Amsterdam and Hetzner.</span><br /> +<br /> +<a class='textlink' href='https://openbsd.amsterdam'>https://openbsd.amsterdam</a><br /> +<a class='textlink' href='https://hetzner.cloud'>https://hetzner.cloud</a><br /> +<br /> +<span>This means that the FreeBSD boxes need to be covered, which will later be running k3s in Linux VMs via bhyve hypervisor.</span><br /> +<br /> +<span>I've been considering whether to use Raspberry Pis or look for alternatives. It turns out that complete N100-based mini-computers aren't much more expensive than Raspberry Pi 5s, and they don't require assembly. Furthermore, I like that they are AMD64 and not ARM-based, which increases compatibility with some applications (e.g., I might want to virtualize Windows (via bhyve) on one of those, though that's out of scope for this blog series).</span><br /> +<br /> +<h2 style='display: inline' id='not-arm-but-intel-n100-'>Not ARM but Intel N100 </h2><br /> +<br /> +<span>I needed something compact, efficient, and capable enough to handle the demands of a small-scale Kubernetes cluster and preferably something I don't have to assemble a lot. After researching, I decided on the Beelink S12 Pro with Intel N100 CPUs.</span><br /> +<br /> +<a class='textlink' href='https://www.bee-link.com/products/beelink-mini-s12-pro-n100'>Beelink Mini S12 Pro N100 official page</a><br /> +<br /> +<span>The Intel N100 CPUs are built on the "Alder Lake-N" architecture. These chips are designed to balance performance and energy efficiency well. With four cores, they're more than capable of running multiple containers, even with moderate workloads. Plus, they consume only around 8W of power (ok, that's more than the Pis...), keeping the electricity bill low enough and the setup quiet - perfect for 24/7 operation.</span><br /> +<br /> +<a href='./f3s-kubernetes-with-freebsd-part-2/f3s-collage1.jpg'><img alt='Beelink preparation' title='Beelink preparation' src='./f3s-kubernetes-with-freebsd-part-2/f3s-collage1.jpg' /></a><br /> +<br /> +<span>The Beelink comes with the following specs:</span><br /> +<br /> +<ul> +<li>12th Gen Intel N100 processor, with four cores and four threads, and a maximum frequency of up to 3.4 GHz.</li> +<li>16 GB of DDR4 RAM, with a maximum (official) size of 16 GB (but people could install 32 GB on it).</li> +<li>500 GB M.2 SSD, with the option to install a 2nd 2.5 SSD drive (which I want to make use of later in this blog series).</li> +<li>GBit ethernet</li> +<li>Four USB 3.2 Gen2 ports (maybe I want to mount something externally at some point)</li> +<li>Dimensions and weight: 115*102*39mm, 280g</li> +<li>Silent cooling system.</li> +<li>HDMI output (needed only for the initial installation and maybe for troubleshooting later)</li> +<li>Auto power on via WoL (may make use of it)</li> +<li>Wi-Fi (not going to use it)</li> +</ul><br /> +<span>I bought three (3) of them for the cluster I intend to build.</span><br /> +<br /> +<h2 style='display: inline' id='beelink-unboxing'>Beelink unboxing</h2><br /> +<br /> +<span>Unboxing was uneventful. Every Beelink PC came with: </span><br /> +<br /> +<ul> +<li>An AC power adapter</li> +<li>An HDMI cable</li> +<li>A VESA mount with screws (not using it as of now)</li> +<li>Some manuals</li> +<li>The pre-assembled Beelink PC itself.</li> +<li>A "Hello" post card (??)</li> +</ul><br /> +<span>Overall, I love the small form factor.</span><br /> +<br /> +<h2 style='display: inline' id='network-switch'>Network switch</h2><br /> +<br /> +<span>I went with the tp-link mini 5-port switch, as I had a spare one available. That switch will be plugged into my wall ethernet port, which connects directly to my fiber internet router with 100 Mbit/s down and 50 Mbit/s upload speed.</span><br /> +<br /> +<a href='./f3s-kubernetes-with-freebsd-part-2/switch.jpg'><img alt='Switch' title='Switch' src='./f3s-kubernetes-with-freebsd-part-2/switch.jpg' /></a><br /> +<br /> +<h1 style='display: inline' id='installing-freebsd'>Installing FreeBSD</h1><br /> +<br /> +<h2 style='display: inline' id='base-install'>Base install</h2><br /> +<br /> +<span>First, I downloaded the boot-only ISO of the latest FreeBSD release and dumped it on a USB stick via my Fedora laptop:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>[paul@earth]~/Downloads% sudo dd \ + <b><u><font color="#000000">if</font></u></b>=FreeBSD-<font color="#000000">14.1</font>-RELEASE-amd<font color="#000000">64</font>-bootonly.iso \ + of=/dev/sda conv=sync +</pre> +<br /> +<span>Next, I plugged the Beelinks (one after another) into my monitor via HDMI (the resolution of the FreeBSD text console seems strangely stretched, as I am using the LG Dual Up monitor), connected Ethernet, an external USB keyboard, and the FreeBSD USB stick, and booted the devices up. With F7, I entered the boot menu and selected the USB stick for the FreeBSD installation.</span><br /> +<br /> +<span>The installation was uneventful. I selected:</span><br /> +<br /> +<ul> +<li>Guided ZFS on root (pool <span class='inlinecode'>zroot</span>)</li> +<li>Unencrypted ZFS (I will encrypt separate datasets later; I want it to be able to boot without manual interaction)</li> +<li>Static IP configuration (to ensure that the boxes always have the same IPs, even after switching the router/DHCP server)</li> +<li>I decided to enable the SSH daemon, NTP server, and NTP time synchronization at boot, and I also enabled <span class='inlinecode'>powerd</span> for automatic CPU frequency scaling.</li> +<li>In addition to <span class='inlinecode'>root,</span> I added a personal user, <span class='inlinecode'>paul,</span> whom I placed in the <span class='inlinecode'>wheel</span> group.</li> +</ul><br /> +<span>After doing all that three times (once for each Beelink PC), I had three ready-to-use FreeBSD boxes! Their hostnames are <span class='inlinecode'>f0</span>, <span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span>!</span><br /> +<br /> +<a href='./f3s-kubernetes-with-freebsd-part-2/f3s-collage2.jpg'><img alt='Beelink installation' title='Beelink installation' src='./f3s-kubernetes-with-freebsd-part-2/f3s-collage2.jpg' /></a><br /> +<br /> +<h2 style='display: inline' id='latest-patch-level-and-customizing-etchosts'>Latest patch level and customizing <span class='inlinecode'>/etc/hosts</span></h2><br /> +<br /> +<span>After the first boot, I upgraded to the latest FreeBSD patch level as follows:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>root@f0:~ <i><font color="silver"># freebsd-update fetch</font></i> +root@f0:~ <i><font color="silver"># freebsd-update install</font></i> +root@f0:~ <i><font color="silver"># freebsd-update reboot</font></i> +</pre> +<br /> +<span>I also added the following entries for the three FreeBSD boxes to the <span class='inlinecode'>/etc/hosts</span> file:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>root@f0:~ <i><font color="silver"># cat <<END >>/etc/hosts</font></i> +<font color="#000000">192.168</font>.<font color="#000000">1.130</font> f0 f0.lan f0.lan.buetow.org +<font color="#000000">192.168</font>.<font color="#000000">1.131</font> f1 f1.lan f1.lan.buetow.org +<font color="#000000">192.168</font>.<font color="#000000">1.132</font> f2 f2.lan f2.lan.buetow.org +END +</pre> +<br /> +<span>You might wonder why bother using the hosts file? Why not use DNS properly? The reason is simplicity. I don't manage 100 hosts, only a few here and there. Having an OpenWRT router in my home, I could also configure everything there, but maybe I'll do that later. For now, keep it simple and straightforward.</span><br /> +<br /> +<h2 style='display: inline' id='after-install'>After install</h2><br /> +<br /> +<span>After that, I installed the following additional packages:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>root@f0:~ <i><font color="silver"># pkg install helix doas zfs-periodic uptimed</font></i> +</pre> +<br /> +<h3 style='display: inline' id='helix-editor'>Helix editor</h3><br /> +<br /> +<span>Helix? It's my favourite text editor. I have nothing against <span class='inlinecode'>vi</span> but like <span class='inlinecode'>hx</span> (Helix) more!</span><br /> +<br /> +<a class='textlink' href='https://helix-editor.com/'>https://helix-editor.com/</a><br /> +<br /> +<h3 style='display: inline' id='doas'><span class='inlinecode'>doas</span></h3><br /> +<br /> +<span><span class='inlinecode'>doas</span>? It's a pretty neat (and KISS) replacement for <span class='inlinecode'>sudo</span>. It has far fewer features than <span class='inlinecode'>sudo</span>, which is supposed to make it more secure. Its origin is the OpenBSD project. For <span class='inlinecode'>doas</span>, I accepted the default configuration (where users in the <span class='inlinecode'>wheel</span> group are allowed to run commands as <span class='inlinecode'>root</span>):</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>root@f0:~ <i><font color="silver"># cp /usr/local/etc/doas.conf.sample /usr/local/etc/doas.conf</font></i> +</pre> +<br /> +<a class='textlink' href='https://man.openbsd.org/doas'>https://man.openbsd.org/doas</a><br /> +<br /> +<h3 style='display: inline' id='periodic-zfs-snapshotting'>Periodic ZFS snapshotting</h3><br /> +<br /> +<span><span class='inlinecode'>zfs-periodic</span> is a nifty tool for automatically creating ZFS snapshots. I decided to go with the following configuration here:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>root@f0:~ <i><font color="silver"># cat <<END >>/etc/periodic.conf</font></i> +daily_zfs_snapshot_enable=<font color="#808080">"YES"</font> +daily_zfs_snapshot_pools=<font color="#808080">"zroot"</font> +daily_zfs_snapshot_keep=<font color="#808080">"7"</font> +weekly_zfs_snapshot_enable=<font color="#808080">"YES"</font> +weekly_zfs_snapshot_pools=<font color="#808080">"zroot"</font> +weekly_zfs_snapshot_keep=<font color="#808080">"5"</font> +monthly_zfs_snapshot_enable=<font color="#808080">"YES"</font> +monthly_zfs_snapshot_pools=<font color="#808080">"zroot"</font> +monthly_zfs_snapshot_keep=<font color="#808080">"6"</font> +END +</pre> +<br /> +<a class='textlink' href='https://github.com/ross/zfs-periodic'>https://github.com/ross/zfs-periodic</a><br /> +<br /> +<h3 style='display: inline' id='uptime-tracking'>Uptime tracking</h3><br /> +<br /> +<span><span class='inlinecode'>uptimed</span>? I like to track my uptimes. This is how I configured the daemon:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>root@f0:~ <i><font color="silver"># cp /usr/local/mimecast/etc/uptimed.conf-dist \</font></i> + /usr/local/mimecast/etc/uptimed.conf +root@f0:~ <i><font color="silver"># hx /usr/local/mimecast/etc/uptimed.conf</font></i> +</pre> +<br /> +<span>In the Helix editor session, I changed <span class='inlinecode'>LOG_MAXIMUM_ENTRIES</span> to <span class='inlinecode'>0</span> to keep all uptime entries forever and not cut off at 50 (the default config). After that, I enabled and started <span class='inlinecode'>uptimed</span>:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>root@f0:~ <i><font color="silver"># service uptimed enable</font></i> +root@f0:~ <i><font color="silver"># service uptimed start</font></i> +</pre> +<br /> +<span>To check the current uptime stats, I can now run <span class='inlinecode'>uprecords</span>:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre> root@f0:~ <i><font color="silver"># uprecords</font></i> + <i><font color="silver"># Uptime | System Boot up</font></i> +----------------------------+--------------------------------------------------- +-> <font color="#000000">1</font> <font color="#000000">0</font> days, <font color="#000000">00</font>:<font color="#000000">07</font>:<font color="#000000">34</font> | FreeBSD <font color="#000000">14.1</font>-RELEASE Mon Dec <font color="#000000">2</font> <font color="#000000">12</font>:<font color="#000000">21</font>:<font color="#000000">44</font> <font color="#000000">2024</font> +----------------------------+--------------------------------------------------- +NewRec <font color="#000000">0</font> days, <font color="#000000">00</font>:<font color="#000000">07</font>:<font color="#000000">33</font> | since Mon Dec <font color="#000000">2</font> <font color="#000000">12</font>:<font color="#000000">21</font>:<font color="#000000">44</font> <font color="#000000">2024</font> + up <font color="#000000">0</font> days, <font color="#000000">00</font>:<font color="#000000">07</font>:<font color="#000000">34</font> | since Mon Dec <font color="#000000">2</font> <font color="#000000">12</font>:<font color="#000000">21</font>:<font color="#000000">44</font> <font color="#000000">2024</font> + down <font color="#000000">0</font> days, <font color="#000000">00</font>:<font color="#000000">00</font>:<font color="#000000">00</font> | since Mon Dec <font color="#000000">2</font> <font color="#000000">12</font>:<font color="#000000">21</font>:<font color="#000000">44</font> <font color="#000000">2024</font> + %up <font color="#000000">100.000</font> | since Mon Dec <font color="#000000">2</font> <font color="#000000">12</font>:<font color="#000000">21</font>:<font color="#000000">44</font> <font color="#000000">2024</font> +</pre> +<br /> +<span>This is how I track the uptimes for all of my host:</span><br /> +<br /> +<a class='textlink' href='./2023-05-01-unveiling-guprecords:-uptime-records-with-raku.html'>Unveiling <span class='inlinecode'>guprecords.raku</span>: Global Uptime Records with Raku-</a><br /> +<a class='textlink' href='https://github.com/rpodgorny/uptimed'>https://github.com/rpodgorny/uptimed</a><br /> +<br /> +<h1 style='display: inline' id='hardware-check'>Hardware check</h1><br /> +<br /> +<h2 style='display: inline' id='ethernet'>Ethernet</h2><br /> +<br /> +<span>Works. Nothing eventful, really. It's a cheap Realtek chip, but it will do what it is supposed to do.</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0:~ % ifconfig re0 +re0: flags=<font color="#000000">1008843</font><UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric <font color="#000000">0</font> mtu <font color="#000000">1500</font> + options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE> + ether e8:ff:1e:d7:1c:ac + inet <font color="#000000">192.168</font>.<font color="#000000">1.130</font> netmask <font color="#000000">0xffffff00</font> broadcast <font color="#000000">192.168</font>.<font color="#000000">1.255</font> + inet6 fe80::eaff:1eff:fed7:1cac%re0 prefixlen <font color="#000000">64</font> scopeid <font color="#000000">0x1</font> + inet6 fd22:c702:acb7:<font color="#000000">0</font>:eaff:1eff:fed7:1cac prefixlen <font color="#000000">64</font> detached autoconf + inet6 2a01:5a8:<font color="#000000">304</font>:1d5c:eaff:1eff:fed7:1cac prefixlen <font color="#000000">64</font> autoconf pltime <font color="#000000">10800</font> vltime <font color="#000000">14400</font> + media: Ethernet autoselect (1000baseT <full-duplex>) + status: active + nd6 options=<font color="#000000">23</font><PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL> +</pre> +<br /> +<h2 style='display: inline' id='ram'>RAM</h2><br /> +<br /> +<span>All there:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0:~ % sysctl hw.physmem +hw.physmem: <font color="#000000">16902905856</font> + +</pre> +<br /> +<h2 style='display: inline' id='cpus'>CPUs</h2><br /> +<br /> +<span>They work:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0:~ % sysctl dev.cpu | grep freq: +dev.cpu.<font color="#000000">3</font>.freq: <font color="#000000">705</font> +dev.cpu.<font color="#000000">2</font>.freq: <font color="#000000">705</font> +dev.cpu.<font color="#000000">1</font>.freq: <font color="#000000">604</font> +dev.cpu.<font color="#000000">0</font>.freq: <font color="#000000">604</font> +</pre> +<br /> +<h2 style='display: inline' id='cpu-throttling'>CPU throttling</h2><br /> +<br /> +<span>With <span class='inlinecode'>powerd</span> running, CPU freq is dowthrottled when the box isn't jam-packed. To stress it a bit, I run <span class='inlinecode'>ubench</span> to see the frequencies being unthrottled again:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0:~ % doas pkg install ubench +paul@f0:~ % rehash <i><font color="silver"># For tcsh to find the newly installed command</font></i> +paul@f0:~ % ubench & +paul@f0:~ % sysctl dev.cpu | grep freq: +dev.cpu.<font color="#000000">3</font>.freq: <font color="#000000">2922</font> +dev.cpu.<font color="#000000">2</font>.freq: <font color="#000000">2922</font> +dev.cpu.<font color="#000000">1</font>.freq: <font color="#000000">2923</font> +dev.cpu.<font color="#000000">0</font>.freq: <font color="#000000">2922</font> +</pre> +<br /> +<span>Idle, all three Beelinks plus the switch consumed 26.2W. But with <span class='inlinecode'>ubench</span> stressing all the CPUs, it went up to 38.8W.</span><br /> +<br /> +<a href='./f3s-kubernetes-with-freebsd-part-2/watt.jpg'><img alt='Idle consumption.' title='Idle consumption.' src='./f3s-kubernetes-with-freebsd-part-2/watt.jpg' /></a><br /> +<br /> +<h1 style='display: inline' id='conclusion'>Conclusion</h1><br /> +<br /> +<span>The Beelink S12 Pro with Intel N100 CPUs checks all the boxes for a k3s project: Compact, efficient, expandable, and affordable. Its compatibility with both Linux and FreeBSD makes it versatile for other use cases, whether as part of your cluster or as a standalone system. If you’re looking for hardware that punches above its weight for Kubernetes, this little device deserves a spot on your shortlist.</span><br /> +<br /> +<a href='./f3s-kubernetes-with-freebsd-part-2/3beelinks.jpg'><img alt='Beelinks stacked' title='Beelinks stacked' src='./f3s-kubernetes-with-freebsd-part-2/3beelinks.jpg' /></a><br /> +<br /> +<span>To ease cable management, I need to get shorter ethernet cables. I will place the tower on my shelf, where most of the cables will be hidden (together with a UPS, which will also be added to the setup).</span><br /> +<br /> +<span>Read the next post of this series:</span><br /> +<br /> +<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br /> +<br /> +<span>Other *BSD-related posts:</span><br /> +<br /> +<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br /> +<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</a><br /> +<a class='textlink' href='./2024-04-01-KISS-high-availability-with-OpenBSD.html'>2024-04-01 KISS high-availability with OpenBSD</a><br /> +<a class='textlink' href='./2024-01-13-one-reason-why-i-love-openbsd.html'>2024-01-13 One reason why I love OpenBSD</a><br /> +<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> +<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>2022-07-30 Let's Encrypt with OpenBSD and Rex</a><br /> +<a class='textlink' href='./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html'>2016-04-09 Jails and ZFS with Puppet on FreeBSD</a><br /> +<br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</title> + <link href="gemini://foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi" /> + <id>gemini://foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi</id> + <updated>2024-11-16T23:20:14+02:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>This is the first 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 I will use on FreeBSD-based physical machines.</summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='f3s-kubernetes-with-freebsd---part-1-setting-the-stage'>f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</h1><br /> +<br /> +<span class='quote'>Published at 2024-11-16T23:20:14+02:00</span><br /> +<br /> +<span>This is the first 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 I will use on FreeBSD-based physical machines.</span><br /> +<br /> +<span>I will post a new entry every month or so (there are too many other side projects for more frequent updates—I bet you can understand).</span><br /> +<br /> +<span>These are all the posts so far:</span><br /> +<br /> +<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br /> +<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br /> +<a class='textlink' href='./2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage (You are currently reading this)</a><br /> +<br /> +<a href='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png'><img alt='f3s logo' title='f3s logo' src='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png' /></a><br /> +<br /> +<span class='quote'>Logo was generated by ChatGPT.</span><br /> +<br /> +<span>Let's begin...</span><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#f3s-kubernetes-with-freebsd---part-1-setting-the-stage'>f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</a></li> +<li>⇢ <a href='#why-this-setup'>Why this setup?</a></li> +<li>⇢ <a href='#the-infrastructure'>The infrastructure</a></li> +<li>⇢ ⇢ <a href='#physical-freebsd-nodes-and-linux-vms'>Physical FreeBSD nodes and Linux VMs</a></li> +<li>⇢ ⇢ <a href='#kubernetes-with-k3s-'>Kubernetes with k3s </a></li> +<li>⇢ ⇢ <a href='#ha-volumes-for-k3s-with-hastzfs-and-nfs'>HA volumes for k3s with HAST/ZFS and NFS</a></li> +<li>⇢ ⇢ <a href='#openbsdrelayd-to-the-rescue-for-external-connectivity'>OpenBSD/<span class='inlinecode'>relayd</span> to the rescue for external connectivity</a></li> +<li>⇢ <a href='#data-integrity'>Data integrity</a></li> +<li>⇢ ⇢ <a href='#periodic-backups'>Periodic backups</a></li> +<li>⇢ ⇢ <a href='#power-protection'>Power protection</a></li> +<li>⇢ <a href='#monitoring-keeping-an-eye-on-everything'>Monitoring: Keeping an eye on everything</a></li> +<li>⇢ ⇢ <a href='#prometheus-and-grafana'>Prometheus and Grafana</a></li> +<li>⇢ ⇢ <a href='#gogios-my-custom-alerting-system'>Gogios: My custom alerting system</a></li> +<li>⇢ <a href='#what-s-after-this-all'>What's after this all?</a></li> +</ul><br /> +<h2 style='display: inline' id='why-this-setup'>Why this setup?</h2><br /> +<br /> +<span>My previous setup was great for learning Terraform and AWS, but it is too expensive. Costs are under control there, but only because I am shutting down all containers after use (so they are offline ninety percent of the time and still cost around $20 monthly). With the new setup, I could run all containers 24/7 at home, which would still be cheaper in terms of electricity consumption. I have a 50 MBit/s uplink (I could have more if I wanted, but it is plenty for my use case already).</span><br /> +<br /> +<a class='textlink' href='./2024-02-04-from-babylon5.buetow.org-to-.cloud.html'>From <span class='inlinecode'>babylon5.buetow.org</span> to <span class='inlinecode'>.cloud</span></a><br /> +<br /> +<span>Migrating off all my containers from AWS ECS means I need a reliable and scalable environment to host my workloads. I wanted something:</span><br /> +<br /> +<ul> +<li>To self-host all my open-source apps (Docker containers).</li> +<li>Fully under my control (goodbye cloud vendor lock-in).</li> +<li>Secure and redundant.</li> +<li>Cost-efficient (after the initial hardware investment).</li> +<li>Something I can poke around with and also pick up new skills.</li> +</ul><br /> +<h2 style='display: inline' id='the-infrastructure'>The infrastructure</h2><br /> +<br /> +<span>This is still in progress, and I need to own the hardware. But in this first part of the blog series, I will outline what I intend to do.</span><br /> +<br /> +<a href='./f3s-kubernetes-with-freebsd-part-1/diagram.png'><img alt='Diagram' title='Diagram' src='./f3s-kubernetes-with-freebsd-part-1/diagram.png' /></a><br /> +<br /> +<h3 style='display: inline' id='physical-freebsd-nodes-and-linux-vms'>Physical FreeBSD nodes and Linux VMs</h3><br /> +<br /> +<span>The setup starts with three physical FreeBSD nodes deployed into my home LAN. On these, I'm going to run Rocky Linux virtual machines with bhyve. Why Linux VMs in FreeBSD and not Linux directly? I want to leverage the great ZFS integration in FreeBSD (among other features), and I have been using FreeBSD for a while in my home lab. And with bhyve, there is a very performant hypervisor available which makes the Linux VMs de-facto run at native speed (another use case of mine would be maybe running a Windows bhyve VM on one of the nodes - but out of scope for this blog series).</span><br /> +<br /> +<a class='textlink' href='https://www.freebsd.org/'>https://www.freebsd.org/</a><br /> +<a class='textlink' href='https://wiki.freebsd.org/bhyve'>https://wiki.freebsd.org/bhyve</a><br /> +<br /> +<span>I selected Rocky Linux because it comes with long-term support (I don't want to upgrade the VMs every 6 months). Rocky Linux 9 will reach its end of life in 2032, which is plenty of time! Of course, there will be minor upgrades, but nothing will significantly break my setup.</span><br /> +<br /> +<a class='textlink' href='https://rockylinux.org/'>https://rockylinux.org/</a><br /> +<a class='textlink' href='https://wiki.rockylinux.org/rocky/version/'>https://wiki.rockylinux.org/rocky/version/</a><br /> +<br /> +<span>Furthermore, I am already using "RHEL-family" related distros at work and Fedora on my main personal laptop. Rocky Linux belongs to the same type of Linux distribution family, so I already feel at home here. I also used Rocky 9 before I switched to AWS ECS. Now, I am switching back in one sense or another ;-)</span><br /> +<br /> +<h3 style='display: inline' id='kubernetes-with-k3s-'>Kubernetes with k3s </h3><br /> +<br /> +<span>These Linux VMs form a three-node k3s Kubernetes cluster, where my containers will reside moving forward. The 3-node k3s cluster will be highly available (in <span class='inlinecode'>etcd</span> mode), and all apps will probably be deployed with Helm. Prometheus will also be running in k3s, collecting time-series metrics and handling monitoring. Additionally, a private Docker registry will be deployed into the k3s cluster, where I will store some of my self-created Docker images. k3s is the perfect distribution of Kubernetes for homelabbers due to its simplicity and the inclusion of the most useful features out of the box!</span><br /> +<br /> +<a class='textlink' href='https://k3s.io/'>https://k3s.io/</a><br /> +<br /> +<h3 style='display: inline' id='ha-volumes-for-k3s-with-hastzfs-and-nfs'>HA volumes for k3s with HAST/ZFS and NFS</h3><br /> +<br /> +<span>Persistent storage for the k3s cluster will be handled by highly available (HA) NFS shares backed by ZFS on the FreeBSD hosts. </span><br /> +<br /> +<span>On two of the three physical FreeBSD nodes, I will add a second SSD drive to each and dedicate it to a <span class='inlinecode'>zhast</span> ZFS pool. With HAST (FreeBSD's solution for highly available storage), this <span class='inlinecode'>pool</span> will be replicated at the byte level to a standby node.</span><br /> +<br /> +<span>A virtual IP (VIP) will point to the master node. When the master node goes down, the VIP will failover to the standby node, where the ZFS pool will be mounted. An NFS server will listen to both nodes. k3s will use the VIP to access the NFS shares.</span><br /> +<br /> +<a class='textlink' href='https://wiki.freebsd.org/HighlyAvailableStorage'>FreeBSD Wiki: Highly Available Storage</a><br /> +<br /> +<span>You can think of DRBD being the Linux equivalent to FreeBSD's HAST.</span><br /> +<br /> +<h3 style='display: inline' id='openbsdrelayd-to-the-rescue-for-external-connectivity'>OpenBSD/<span class='inlinecode'>relayd</span> to the rescue for external connectivity</h3><br /> +<br /> +<span>All apps should be reachable through the internet (e.g., from my phone or computer when travelling). For external connectivity and TLS management, I've got two OpenBSD VMs (one hosted by OpenBSD Amsterdam and another hosted by Hetzner) handling public-facing services like DNS, relaying traffic, and automating Let's Encrypt certificates. </span><br /> +<br /> +<span>All of this (every Linux VM to every OpenBSD box) will be connected via WireGuard tunnels, keeping everything private and secure. There will be 6 WireGuard tunnels (3 k3s nodes times two OpenBSD VMs).</span><br /> +<br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/WireGuard'>https://en.wikipedia.org/wiki/WireGuard</a><br /> +<br /> +<span>So, when I want to access a service running in k3s, I will hit an external DNS endpoint (with the authoritative DNS servers being the OpenBSD boxes). The DNS will resolve to the master OpenBSD VM (see my KISS highly-available with OpenBSD blog post), and from there, the <span class='inlinecode'>relayd</span> process (with a Let's Encrypt certificate—see my Let's Encrypt with OpenBSD and Rex blog post) will accept the TCP connection and forward it through the WireGuard tunnel to a reachable node port of one of the k3s nodes, thus serving the traffic.</span><br /> +<br /> +<a class='textlink' href='./2024-04-01-KISS-high-availability-with-OpenBSD.html'>KISS high-availability with OpenBSD</a><br /> +<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>Let's Encrypt with OpenBSD and Rex</a><br /> +<br /> +<span>The OpenBSD setup described here already exists and is ready to use. The only thing that does not yet exist is the configuration of <span class='inlinecode'>relayd</span> to forward requests to k3s through the WireGuard tunnel(s).</span><br /> +<br /> +<h2 style='display: inline' id='data-integrity'>Data integrity</h2><br /> +<br /> +<h3 style='display: inline' id='periodic-backups'>Periodic backups</h3><br /> +<br /> +<span>Let's face it, backups are non-negotiable. </span><br /> +<br /> +<span>On the HAST master node, incremental and encrypted ZFS snapshots are created daily and automatically backed up to AWS S3 Glacier Deep Archive via CRON. I have a bunch of scripts already available, which I currently use for a similar purpose on my FreeBSD Home NAS server (an old ThinkPad T440 with an external USB drive enclosure, which I will eventually retire when the HAST setup is ready). I will copy them and slightly modify them to fit the purpose.</span><br /> +<br /> +<span>There's also <span class='inlinecode'>zfstools</span> in the ports, which helps set up an automatic snapshot regime:</span><br /> +<br /> +<a class='textlink' href='https://www.freshports.org/sysutils/zfstools'>https://www.freshports.org/sysutils/zfstools</a><br /> +<br /> +<span>The backup scripts also perform some zpool scrubbing now and then. A scrub once in a while keeps the trouble away.</span><br /> +<br /> +<h3 style='display: inline' id='power-protection'>Power protection</h3><br /> +<br /> +<span>Power outages are regularly in my area, so a UPS keeps the infrastructure running during short outages and protects the hardware. I'm still trying to decide which hardware to get, and I still need one, as my previous NAS is simply an older laptop that already has a battery for power outages. However, there are plenty of options to choose from. My main criterion is that the UPS should be silent, as the whole setup will be installed in an upper shelf unit in my daughter's room. ;-)</span><br /> +<br /> +<h2 style='display: inline' id='monitoring-keeping-an-eye-on-everything'>Monitoring: Keeping an eye on everything</h2><br /> +<br /> +<span>Robust monitoring is vital to any infrastructure, especially one as distributed as mine. I've thought about a setup that ensures I'll always be aware of what's happening in my environment.</span><br /> +<br /> +<h3 style='display: inline' id='prometheus-and-grafana'>Prometheus and Grafana</h3><br /> +<br /> +<span>Inside the k3s cluster, Prometheus will be deployed to handle metrics collection. It will be configured to scrape data from my Kubernetes workloads, nodes, and any services I monitor. Prometheus also integrates with Alertmanager to generate alerts based on predefined thresholds or conditions.</span><br /> +<br /> +<a class='textlink' href='https://prometheus.io'>https://prometheus.io</a><br /> +<br /> +<span>For visualization, Grafana will be deployed alongside Prometheus. Grafana lets me build dynamic, customizable dashboards that provide a real-time view of everything from resource utilization to application performance. Whether it's keeping track of CPU load, memory usage, or the health of Kubernetes pods, Grafana has it covered. This will also make troubleshooting easier, as I can quickly pinpoint where issues are arising.</span><br /> +<br /> +<a class='textlink' href='https://grafana.com'>https://grafana.com</a><br /> +<br /> +<h3 style='display: inline' id='gogios-my-custom-alerting-system'>Gogios: My custom alerting system</h3><br /> +<br /> +<span>Alerts generated by Prometheus are forwarded to Alertmanager, which I will configure to work with Gogios, a lightweight monitoring and alerting system I wrote myself. Gogios runs on one of my OpenBSD VMs. At regular intervals, Gogios scrapes the alerts generated in the k3s cluster and notifies me via Email.</span><br /> +<br /> +<a class='textlink' href='./2023-06-01-kiss-server-monitoring-with-gogios.html'>KISS server monitoring with Gogios</a><br /> +<br /> +<span>Ironically, I implemented Gogios to avoid using more complex alerting systems like Prometheus, but here we go—it integrates well now.</span><br /> +<br /> +<h2 style='display: inline' id='what-s-after-this-all'>What's after this all?</h2><br /> +<br /> +<span>This setup may be just the beginning. Some ideas I'm thinking about for the future:</span><br /> +<br /> +<ul> +<li>Adding more FreeBSD nodes (in different physical locations, maybe at my wider family's places? WireGuard would make it possible!) for better redundancy. (HA storage then might be trickier)</li> +<li>Deploying more Docker apps (data-intensive ones, like a picture gallery, my entire audiobook catalogue, or even a music server) to k3s.</li> +</ul><br /> +<span>For now, though, I'm focused on completing the migration from AWS ECS and getting all my Docker containers running smoothly in k3s.</span><br /> +<br /> +<span>What's your take on self-hosting? Are you planning to move away from managed cloud services? Stay tuned for the second part of this series, where I will likely write about the hardware and the OS setups.</span><br /> +<br /> +<span>Read the next post of this series:</span><br /> +<br /> +<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br /> +<br /> +<span>Other *BSD-related posts:</span><br /> +<br /> +<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br /> +<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br /> +<a class='textlink' href='./2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-04-01-KISS-high-availability-with-OpenBSD.html'>2024-04-01 KISS high-availability with OpenBSD</a><br /> +<a class='textlink' href='./2024-01-13-one-reason-why-i-love-openbsd.html'>2024-01-13 One reason why I love OpenBSD</a><br /> +<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> +<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>2022-07-30 Let's Encrypt with OpenBSD and Rex</a><br /> +<a class='textlink' href='./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html'>2016-04-09 Jails and ZFS with Puppet on FreeBSD</a><br /> +<br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>'Staff Engineer' book notes</title> + <link href="gemini://foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.gmi" /> + <id>gemini://foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.gmi</id> + <updated>2024-10-24T20:57:44+03:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>These are my personal takeaways after reading 'Staff Engineer' by Will Larson. Note that the book contains much more knowledge wisdom and that these notes only contain points I personally found worth writing down. This is mainly for my own use, but you might find it helpful too.</summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='staff-engineer-book-notes'>"Staff Engineer" book notes</h1><br /> +<br /> +<span class='quote'>Published at 2024-10-24T20:57:44+03:00</span><br /> +<br /> +<span>These are my personal takeaways after reading "Staff Engineer" by Will Larson. Note that the book contains much more knowledge wisdom and that these notes only contain points I personally found worth writing down. This is mainly for my own use, but you might find it helpful too.</span><br /> +<br /> +<pre> + ,.......... .........., + ,..,' '.' ',.., + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,'............., : ,.............', ', +,' '............ '.' ............' ', + '''''''''''''''''';''';'''''''''''''''''' + ''' +</pre> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#staff-engineer-book-notes'>"Staff Engineer" book notes</a></li> +<li>⇢ <a href='#the-four-archetypes-of-a-staff-engineer'>The Four Archetypes of a Staff Engineer</a></li> +<li>⇢ <a href='#influence-and-impact-over-authority'>Influence and Impact over Authority</a></li> +<li>⇢ <a href='#breadth-and-depth-of-knowledge'>Breadth and Depth of Knowledge</a></li> +<li>⇢ <a href='#mentorship-and-sponsorship'>Mentorship and Sponsorship</a></li> +<li>⇢ <a href='#managing-up-and-across'>Managing Up and Across</a></li> +<li>⇢ <a href='#strategic-thinking'>Strategic Thinking</a></li> +<li>⇢ <a href='#emotional-intelligence'>Emotional Intelligence</a></li> +<li>⇢ <a href='#navigating-ambiguity'>Navigating Ambiguity</a></li> +<li>⇢ <a href='#visible-and-invisible-work'>Visible and Invisible Work</a></li> +<li>⇢ <a href='#scaling-yourself'>Scaling Yourself</a></li> +<li>⇢ <a href='#career-progression-and-title-inflation'>Career Progression and Title Inflation</a></li> +<li>⇢ <a href='#not-a-faster-senior-engineer'>Not a faster Senior Engineer</a></li> +<li>⇢ <a href='#the-balance'>The Balance</a></li> +<li>⇢ <a href='#more-things'>More things</a></li> +</ul><br /> +<h2 style='display: inline' id='the-four-archetypes-of-a-staff-engineer'>The Four Archetypes of a Staff Engineer</h2><br /> +<br /> +<span>Larson breaks down the role of a Staff Engineer into four main archetypes, which can help frame how you approach the role:</span><br /> +<br /> +<ul> +<li>Tech Lead: Focuses on the technical direction of a team, ensuring high-quality execution, architecture, and aligning the team around shared goals.</li> +<li>Solver: Gets pulled into complex, high-impact problems that often involve many teams or systems, operating as a fixer or troubleshooter.</li> +<li>Architect: Works on the long-term technical vision for an organization, setting standards and designing systems that will scale and last over time.</li> +<li>Right Hand: Functions as a trusted technical advisor to leadership, providing input on strategy, long-term decisions, and navigating organizational politics.</li> +</ul><br /> +<h2 style='display: inline' id='influence-and-impact-over-authority'>Influence and Impact over Authority</h2><br /> +<br /> +<span>As a Staff Engineer, influence is often more important than formal authority. You’ll rarely have direct control over teams or projects but will need to drive outcomes by influencing peers, other teams, and leadership. It’s about understanding how to persuade, align, and mentor others to achieve technical outcomes.</span><br /> +<br /> +<h2 style='display: inline' id='breadth-and-depth-of-knowledge'>Breadth and Depth of Knowledge</h2><br /> +<br /> +<span>Staff Engineers often need to maintain a breadth of knowledge across various areas while maintaining depth in a few. This can mean keeping a high-level understanding of several domains (e.g., infrastructure, security, product development) but being able to dive deep when needed in certain core areas.</span><br /> +<br /> +<h2 style='display: inline' id='mentorship-and-sponsorship'>Mentorship and Sponsorship</h2><br /> +<br /> +<span>An important part of a Staff Engineer’s role is mentoring others, not just in technical matters but in career development as well. Sponsorship goes a step beyond mentorship, where you actively advocate for others, create opportunities for them, and push them toward growth.</span><br /> +<br /> +<h2 style='display: inline' id='managing-up-and-across'>Managing Up and Across</h2><br /> +<br /> +<span>Success as a Staff Engineer often depends on managing up (influencing leadership and setting expectations) and managing across (working effectively with peers and other teams). This is often tied to communication skills, the ability to advocate for technical needs, and fostering alignment across departments or organizations.</span><br /> +<br /> +<h2 style='display: inline' id='strategic-thinking'>Strategic Thinking</h2><br /> +<br /> +<span>While Senior Engineers may focus on execution, Staff Engineers are expected to think strategically, making decisions that will affect the company or product months or years down the line. This means balancing short-term execution needs with long-term architectural decisions, which may require challenging short-term pressures.</span><br /> +<br /> +<h2 style='display: inline' id='emotional-intelligence'>Emotional Intelligence</h2><br /> +<br /> +<span>The higher you go in engineering roles, the more soft skills, particularly emotional intelligence (EQ), come into play. Building relationships, resolving conflicts, and understanding the broader emotional dynamics of the team and organization become key parts of your role.</span><br /> +<br /> +<h2 style='display: inline' id='navigating-ambiguity'>Navigating Ambiguity</h2><br /> +<br /> +<span>Staff Engineers are often placed in situations with high ambiguity—whether in defining the problem space, coming up with a solution, or aligning stakeholders. The ability to operate effectively in these unclear areas is critical to success.</span><br /> +<br /> +<h2 style='display: inline' id='visible-and-invisible-work'>Visible and Invisible Work</h2><br /> +<br /> +<span>Much of the work done by Staff Engineers is invisible. Solving complex problems, creating alignment, or influencing decisions doesn’t always result in tangible code, but it can have a massive impact. Larson emphasizes that part of the role is being comfortable with this type of invisible contribution.</span><br /> +<br /> +<h2 style='display: inline' id='scaling-yourself'>Scaling Yourself</h2><br /> +<br /> +<span>At the Staff Engineer level, you must scale your impact beyond direct contribution. This can involve improving documentation, developing repeatable processes, mentoring others, or automating parts of the workflow. The idea is to enable teams and individuals to be more effective, even when you’re not directly involved.</span><br /> +<br /> +<h2 style='display: inline' id='career-progression-and-title-inflation'>Career Progression and Title Inflation</h2><br /> +<br /> +<span>Larson touches on how different companies have varying definitions of "Staff Engineer," and titles don’t always correlate directly with responsibility or skill. He emphasizes the importance of focusing more on the work you're doing and the impact you're having, rather than the title itself.</span><br /> +<br /> +<span>These additional points reflect more of the strategic, interpersonal, and leadership aspects that go beyond the technical expertise expected at this level. The role of a Staff Engineer is often about balancing high-level strategy with technical execution, while influencing teams and projects in a sustainable, long-term way.</span><br /> +<br /> +<h2 style='display: inline' id='not-a-faster-senior-engineer'>Not a faster Senior Engineer</h2><br /> +<br /> +<ul> +<li>A Staff engineer is more than just a faster Senior.</li> +<li>A staff engineer is not a senior engineer but a bit better.</li> +</ul><br /> +<span>It's important to know what work or which role most energizes you. A Staff engineer is not a more senior engineer. A Staff engineer also fits into another archetype.</span><br /> +<br /> +<span>As a staff engineer, you are always expected to go beyond your comfort zone and learn new things.</span><br /> +<br /> +<span>Your job sometimes will feel like an SEM and sometimes strangely similar to your senior roles.</span><br /> +<br /> +<span>A Staff engineer is, like a Manager, a leader. However, being a Manager is a specific job. Leaders can apply to any job, especially to Staff engineers.</span><br /> +<br /> +<h2 style='display: inline' id='the-balance'>The Balance</h2><br /> +<br /> +<span>The more senior you become, the more responsibility you will have to cope with them in less time. Balance your speed of progress with your personal life, don't work late hours and don't skip these personal care events.</span><br /> +<br /> +<span>Do fewer things but do them better. Everything done will accelerate the organization. Everything else will drag it down—quality over quantity.</span><br /> +<br /> +<span>Don't work at ten things and progress slowly; focus on one thing and finish it.</span><br /> +<br /> +<span>Only spend some of the time firefighting. Have time for deep thinking. Only deep think some of the time. Otherwise, you lose touch with reality.</span><br /> +<br /> +<span>Sebactical: Take at least six months. Otherwise, it won't be as restored.</span><br /> +<br /> +<h2 style='display: inline' id='more-things'>More things</h2><br /> +<br /> +<ul> +<li>Provide simple but widely used tools. Complex and powerful tools will have power users but only a very few. All others will not use the tool.</li> +<li>In meetings, when someone is inactive, try to pull him in. Pull in max one person at a time. Don't open the discussion to multiple people.</li> +<li>Get used to writing things down and repeating yourself. You will scale yourself much more.</li> +<li>Title inflation: skills correspond to work, but the titles don't.</li> +</ul><br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<span>Other book notes of mine are:</span><br /> +<br /> +<a class='textlink' href='./2024-10-24-staff-engineer-book-notes.html'>2024-10-24 "Staff Engineer" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-07-07-the-stoic-challenge-book-notes.html'>2024-07-07 "The Stoic Challenge" book notes</a><br /> +<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> +<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> +<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> +<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>Gemtexter 3.0.0 - Let's Gemtext again⁴</title> + <link href="gemini://foo.zone/gemfeed/2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.gmi" /> + <id>gemini://foo.zone/gemfeed/2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.gmi</id> + <updated>2024-10-01T21:46:26+03:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>I proudly announce that I've released Gemtexter version `3.0.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown, written in GNU Bash.</summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='gemtexter-300---let-s-gemtext-again'>Gemtexter 3.0.0 - Let's Gemtext again⁴</h1><br /> +<br /> +<span class='quote'>Published at 2024-10-01T21:46:26+03:00</span><br /> +<br /> +<span>I proudly announce that I've released Gemtexter version <span class='inlinecode'>3.0.0</span>. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown, written in GNU Bash.</span><br /> +<br /> +<a class='textlink' href='https://codeberg.org/snonux/gemtexter'>https://codeberg.org/snonux/gemtexter</a><br /> +<br /> +<pre> +-=[ typewriters ]=- 1/98 + .-------. + .-------. _|~~ ~~ |_ + _|~~ ~~ |_ .-------. =(_|_______|_) + =(_|_______|_)= _|~~ ~~ |_ |:::::::::| .-------. + |:::::::::| =(_|_______|_) |:::::::[]| _|~~ ~~ |_ + |:::::::[]| |:::::::::| |o=======.| =(_|_______|_) + |o=======.| |:::::::[]| `"""""""""` |:::::::::| + jgs `"""""""""` |o=======.| |:::::::[]| + mod. by Paul Buetow `"""""""""` |o=======.| + `"""""""""` +</pre> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#gemtexter-300---let-s-gemtext-again'>Gemtexter 3.0.0 - Let's Gemtext again⁴</a></li> +<li>⇢ <a href='#why-bash'>Why Bash?</a></li> +<li>⇢ <a href='#html-exact-variant-is-the-only-variant'>HTML exact variant is the only variant</a></li> +<li>⇢ <a href='#table-of-contents-auto-generation'>Table of Contents auto-generation</a></li> +<li>⇢ <a href='#configurable-themes'>Configurable themes</a></li> +<li>⇢ <a href='#no-use-of-webfonts-by-default'>No use of webfonts by default</a></li> +<li>⇢ <a href='#more'>More</a></li> +</ul><br /> +<h2 style='display: inline' id='why-bash'>Why Bash?</h2><br /> +<br /> +<span>This project is too complex for a Bash script. Writing it in Bash was to try out how maintainable a "larger" Bash script could be. It's still pretty maintainable and helps me try new Bash tricks here and then!</span><br /> +<br /> +<span>Let's list what's new!</span><br /> +<br /> +<h2 style='display: inline' id='html-exact-variant-is-the-only-variant'>HTML exact variant is the only variant</h2><br /> +<br /> +<span>The last version of Gemtexter introduced the HTML exact variant, which wasn't enabled by default. This version of Gemtexter removes the previous (inexact) variant and makes the exact variant the default. This is a breaking change, which is why there is a major version bump of Gemtexter. Here is a reminder of what the exact variant was:</span><br /> +<br /> +<span class='quote'>Gemtexter is there to convert your Gemini Capsule into other formats, such as HTML and Markdown. An HTML exact variant can now be enabled in the <span class='inlinecode'>gemtexter.conf</span> by adding the line <span class='inlinecode'>declare -rx HTML_VARIANT=exact</span>. The HTML/CSS output changed to reflect a more exact Gemtext appearance and to respect the same spacing as you would see in the Geminispace. </span><br /> +<br /> +<h2 style='display: inline' id='table-of-contents-auto-generation'>Table of Contents auto-generation</h2><br /> +<br /> +<span>Just add...</span><br /> +<br /> +<pre> + << template::inline::toc +</pre> +<br /> +<span>...into a Gemtexter template file and Gemtexter will automatically generate a table of contents for the page based on the headings (see this page's ToC for example). The ToC will also have links to the relevant sections in HTML and Markdown output. The Gemtext format does not support links, so the ToC will simply be displayed as a bullet list. </span><br /> +<br /> +<h2 style='display: inline' id='configurable-themes'>Configurable themes</h2><br /> +<br /> +<span>It was always possible to customize the style of a Gemtexter's resulting HTML page, but all the config options were scattered across multiple files. Now, the CSS style, web fonts, etc., are all configurable via themes.</span><br /> +<br /> +<span>Simply configure <span class='inlinecode'>HTML_THEME_DIR</span> in the <span class='inlinecode'>gemtexter.conf</span> file to the corresponding directory. For example:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><b><u><font color="#000000">declare</font></u></b> -xr HTML_THEME_DIR=./extras/html/themes/simple +</pre> +<br /> +<span>To customize the theme or create your own, simply copy the theme directory and modify it as needed. This makes it also much easier to switch between layouts.</span><br /> +<br /> +<h2 style='display: inline' id='no-use-of-webfonts-by-default'>No use of webfonts by default</h2><br /> +<br /> +<span>The default theme is now "back to the basics" and does not utilize any web fonts. The previous themes are still part of the release and can be easily configured. These are currently the <span class='inlinecode'>future</span> and <span class='inlinecode'>business</span> themes. You can check them out from the themes directory.</span><br /> +<br /> +<h2 style='display: inline' id='more'>More</h2><br /> +<br /> +<span>Additionally, there were a couple of bug fixes, refactorings and overall improvements in the documentation made. </span><br /> +<br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<span>Other related posts are:</span><br /> +<br /> +<a class='textlink' href='./2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.html'>2024-10-02 Gemtexter 3.0.0 - Let's Gemtext again⁴ (You are currently reading this)</a><br /> +<a class='textlink' href='./2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.html'>2023-07-21 Gemtexter 2.1.0 - Let's Gemtext again³</a><br /> +<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again²</a><br /> +<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> +<a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace</a><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers</title> + <link href="gemini://foo.zone/gemfeed/2024-09-07-site-reliability-engineering-part-4.gmi" /> + <id>gemini://foo.zone/gemfeed/2024-09-07-site-reliability-engineering-part-4.gmi</id> + <updated>2024-09-07T16:27:58+03:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>Welcome to Part 4 of my Site Reliability Engineering (SRE) series. I'm currently working as a Site Reliability Engineer, and I’m here to share what SRE is all about in this blog series.</summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='site-reliability-engineering---part-4-onboarding-for-on-call-engineers'>Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers</h1><br /> +<br /> +<span class='quote'>Published at 2024-09-07T16:27:58+03:00</span><br /> +<br /> +<span>Welcome to Part 4 of my Site Reliability Engineering (SRE) series. I'm currently working as a Site Reliability Engineer, and I’m here to share what SRE is all about in this blog series.</span><br /> +<br /> +<a class='textlink' href='./2023-08-18-site-reliability-engineering-part-1.html'>2023-08-18 Site Reliability Engineering - Part 1: SRE and Organizational Culture</a><br /> +<a class='textlink' href='./2023-11-19-site-reliability-engineering-part-2.html'>2023-11-19 Site Reliability Engineering - Part 2: Operational Balance</a><br /> +<a class='textlink' href='./2024-01-09-site-reliability-engineering-part-3.html'>2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture</a><br /> +<a class='textlink' href='./2024-09-07-site-reliability-engineering-part-4.html'>2024-09-07 Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers (You are currently reading this)</a><br /> +<br /> +<pre> + __..._ _...__ + _..-" `Y` "-._ + \ Once upon | / + \\ a time..| // + \\\ | /// + \\\ _..---.|.---.._ /// +jgs \\`_..---.Y.---.._`// +</pre> +<br /> +<span>This time, I want to share some tips on how to onboard software engineers, QA engineers, and Site Reliability Engineers (SREs) to the primary on-call rotation. Traditionally, onboarding might take half a year (depending on the complexity of the infrastructure), but with a bit of strategy and structured sessions, we've managed to reduce it to just six weeks per person. Let's dive in!</span><br /> +<br /> +<h2 style='display: inline' id='setting-the-scene-tier-1-on-call-rotation'>Setting the Scene: Tier-1 On-Call Rotation</h2><br /> +<br /> +<span>First things first, let's talk about Tier-1. This is where the magic begins. Tier-1 covers over 80% of the common on-call cases and is the perfect breeding ground for new on-call engineers to get their feet wet. It's designed to be manageable training ground.</span><br /> +<br /> +<h3 style='display: inline' id='why-tier-1'>Why Tier-1?</h3><br /> +<br /> +<ul> +<li>Easy to Understand: Every on-call engineer should be familiar with Tier-1 tasks. </li> +<li>Training Ground: This is where engineers start their on-call career. It's purposefully kept simple so that it's not overwhelming right off the bat.</li> +<li>Runbook/recipe driven: Every alert is attached to a comprehensive runbook, making it easy for every engineer to follow.</li> +</ul><br /> +<h2 style='display: inline' id='onboarding-process-from-6-months-to-6-weeks'>Onboarding Process: From 6 Months to 6 Weeks</h2><br /> +<br /> +<span>So how did we cut down the onboarding time so drastically? Here’s the breakdown of our process:</span><br /> +<br /> +<span>Knowledge Transfer (KT) Sessions: We kicked things off with more than 10 KT sessions, complete with video recordings. These sessions are comprehensive and cover everything from the basics to some more advanced topics. The recorded sessions mean that new engineers can revisit them anytime they need a refresher.</span><br /> +<br /> +<span>Shadowing Sessions: Each new engineer undergoes two on-call week shadowing sessions. This hands-on experience is invaluable. They get to see real-time incident handling and resolution, gaining practical knowledge that's hard to get from just reading docs.</span><br /> +<br /> +<span>Comprehensive Runbooks: We created 64 runbooks (by the time writing this probably more than 100) that are composable like Lego bricks. Each runbook covers a specific scenario and guides the engineer step-by-step to resolution. Pairing these with monitoring alerts linked directly to Confluence docs, and from there to the respective runbooks, ensures every alert can be navigated with ease (well, there are always exceptions to the rule...).</span><br /> +<br /> +<span>Self-Sufficiency & Confidence Building: With all these resources at their fingertips, our on-call engineers become self-sufficient for most of the common issues they'll face (new starters can now handle around 80% of the most common issue after 6 weeks they had joined the company). This boosts their confidence and ensures they can handle Tier-1 incidents independently.</span><br /> +<br /> +<span>Documentation and Feedback Loop: Continuous improvement is key. We regularly update our documentation based on feedback from the engineers. This makes our process even more robust and user-friendly.</span><br /> +<br /> +<h2 style='display: inline' id='it-s-all-about-the-tiers'>It's All About the Tiers</h2><br /> +<br /> +<span>Let’s briefly touch on the Tier levels:</span><br /> +<br /> +<ul> +<li>Tier 1: Easy and foundational tasks. Perfect for getting new engineers started. This covers around 80% of all on-call cases we face. This is what we trained on.</li> +<li>Tier 2: Slightly more complex, requiring more background knowledge. We trained on some of the topics but not all.</li> +<li>Tier 3: Requires a good understanding of the platform/architecture. Likely needs KT sessions with domain experts.</li> +<li>Tier DE (Domain Expert): The heavy hitters. Domain experts are required for these tasks. </li> +</ul><br /> +<h3 style='display: inline' id='growing-into-higher-tiers'>Growing into Higher Tiers</h3><br /> +<br /> +<span>From Tier-1, engineers naturally grow into Tier-2 and beyond. The structured training and gradual increase in complexity help ensure a smooth transition as they gain experience and confidence. The key here is that engineers stay curous and engaged in the on-call, so that they always keep learning.</span><br /> +<br /> +<h2 style='display: inline' id='keeping-runbooks-up-to-date'>Keeping Runbooks Up to Date</h2><br /> +<br /> +<span>It is important that runbooks are not a "project to be finished"; runbooks have to be maintained and updated over time. Sections may change, new runbooks need to be added, and old ones can be deleted. So the acceptance criteria of an on-call shift would not just be reacting to alerts and incidents, but also reviewing and updating the current runbooks.</span><br /> +<br /> +<h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> +<br /> +<span>By structuring the onboarding process with KT sessions, shadowing, comprehensive runbooks, and a feedback loop, we've been able to fast-track the process from six months to just six weeks. This not only prepares our engineers for the on-call rotation quicker but also ensures they're confident and capable when handling incidents.</span><br /> +<br /> +<span>If you're looking to optimize your on-call onboarding process, these strategies could be your ticket to a more efficient and effective transition. Happy on-calling!</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>Projects I financially support</title> + <link href="gemini://foo.zone/gemfeed/2024-09-07-projects-i-support.gmi" /> + <id>gemini://foo.zone/gemfeed/2024-09-07-projects-i-support.gmi</id> + <updated>2024-09-07T16:04:19+03:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>This is the list of projects and initiatives I support/sponsor. </summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='projects-i-financially-support'>Projects I financially support</h1><br /> +<br /> +<span class='quote'>Published at 2024-09-07T16:04:19+03:00</span><br /> +<br /> +<span>This is the list of projects and initiatives I support/sponsor. </span><br /> +<br /> +<pre> +||====================================================================|| +||//$\\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\//$\\|| +||(100)==================| FEDERAL SPONSOR NOTE |================(100)|| +||\\$// ~ '------========--------' \\$//|| +||<< / /$\ // ____ \\ \ >>|| +||>>| 12 //L\\ // ///..) \\ L38036133B 12 |<<|| +||<<| \\ // || <|| >\ || |>>|| +||>>| \$/ || $$ --/ || One Hundred |<<|| +||<<| L38036133B *\\ |\_/ //* series |>>|| +||>>| 12 *\\/___\_//* 1989 |<<|| +||<<\ Open Source ______/Franklin\________ Supporting />>|| +||//$\ ~| SPONSORING AND FUNDING |~ /$\\|| +||(100)=================== AWESOME OPEN SOURCE =================(100)|| +||\\$//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\$//|| +||====================================================================|| + +</pre> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#projects-i-financially-support'>Projects I financially support</a></li> +<li>⇢ <a href='#motivation'>Motivation</a></li> +<li>⇢ <a href='#osnews'>OSnews</a></li> +<li>⇢ <a href='#cup-o--go-podcast'>Cup o' Go Podcast</a></li> +<li>⇢ <a href='#codeberg'>Codeberg</a></li> +<li>⇢ <a href='#grapheneos'>GrapheneOS</a></li> +<li>⇢ <a href='#ankidroid'>AnkiDroid</a></li> +<li>⇢ <a href='#openbsd-through-openbsdamsterdam'>OpenBSD through OpenBSD.Amsterdam</a></li> +<li>⇢ <a href='#protonmail'>ProtonMail</a></li> +<li>⇢ <a href='#librofm'><span class='inlinecode'>Libro.fm</span></a></li> +</ul><br /> +<h2 style='display: inline' id='motivation'>Motivation</h2><br /> +<br /> +<span>Sponsoring free and open-source projects, even for personal use, is important to ensure the sustainability, security, and continuous improvement of the software. It supports developers who often maintain these projects without compensation, helping them provide updates, new features, and security patches. By contributing, you recognize their efforts, foster a culture of innovation, and benefit from perks like early access or support, all while ensuring the long-term viability of the tools you rely on.</span><br /> +<br /> +<span>Albeit I am not putting a lot of money into my sponsoring efforts, it still helps the open-source maintainers because the more little sponsors there are, the higher the total sum.</span><br /> +<br /> +<h2 style='display: inline' id='osnews'>OSnews</h2><br /> +<br /> +<span>I am a silver Patreon member of OSnews. I have been following this site since my student years. It's always been a great source of independent and slightly alternative IT news.</span><br /> +<br /> +<a class='textlink' href='https://osnews.com'>https://osnews.com</a><br /> +<br /> +<h2 style='display: inline' id='cup-o--go-podcast'>Cup o' Go Podcast</h2><br /> +<br /> +<span>I am a Patreon of the Cup o' Go Podcast. The podcast helps me stay updated with the Go community for around 15 minutes per week. I am not a full-time software developer, but my long-term ambition is to become better in Go every week by working on personal projects and tools for work.</span><br /> +<br /> +<a class='textlink' href='https://cupogo.dev'>https://cupogo.dev</a><br /> +<br /> +<h2 style='display: inline' id='codeberg'>Codeberg</h2><br /> +<br /> +<span>Codeberg e.V. is a nonprofit organization that provides online resources for software development and collaboration. I am a user and a supporting member, paying an annual membership of €24. I didn't have to pay that membership fee, as Codeberg offers all the services I use for free.</span><br /> +<br /> +<a class='textlink' href='https://codeberg.org'>https://codeberg.org</a><br /> +<a class='textlink' href='https://codeberg.org/snonux'>https://codeberg.org/snonux - My Codeberg page</a><br /> +<br /> +<h2 style='display: inline' id='grapheneos'>GrapheneOS</h2><br /> +<br /> +<span>GrapheneOS is an open-source project that improves Android's privacy and security with sandboxing, exploit mitigations, and a permission model. It does not include Google apps or services but offers a sandboxed Google Play compatibility layer and its own apps and services. </span><br /> +<br /> +<span>I've made a one-off €100 donation because I really like this, and I run GrapheneOS on my personal Phone as my main daily driver.</span><br /> +<br /> +<a class='textlink' href='https://grapheneos.org/'>https://grapheneos.org/</a><br /> +<a class='textlink' href='https://foo.zone/gemfeed/2023-01-23-why-grapheneos-rox.html'>Why GrapheneOS Rox</a><br /> +<br /> +<h2 style='display: inline' id='ankidroid'>AnkiDroid</h2><br /> +<br /> +<span>AnkiDroid is an app that lets you learn flashcards efficiently with spaced repetition. It is compatible with Anki software and supports various flashcard content, syncing, statistics, and more.</span><br /> +<br /> +<span>I've been learning vocabulary with this free app, and it is, in my opinion, the best flashcard app I know. I've made a 20$ one-off donation to this project.</span><br /> +<br /> +<a class='textlink' href='https://opencollective.com/ankidroid'>https://opencollective.com/ankidroid</a><br /> +<br /> +<h2 style='display: inline' id='openbsd-through-openbsdamsterdam'>OpenBSD through OpenBSD.Amsterdam</h2><br /> +<br /> +<span> The OpenBSD project produces a FREE, multi-platform 4.4BSD-based UNIX-like operating system. Our efforts emphasize portability, standardization, correctness, proactive security and integrated cryptography. As an example of the effect OpenBSD has, the popular OpenSSH software comes from OpenBSD. OpenBSD is freely available from their download sites.</span><br /> +<br /> +<span>I implicitly support the OpenBSD project through a VM I have rented at OpenBSD Amsterdam. They donate €10 per VM and €15 per VM for every renewal to the OpenBSD Foundation, with dedicated servers running vmm(4)/vmd(8) to host opinionated VMs.</span><br /> +<br /> +<a class='textlink' href='https://www.OpenBSD.org'>https://www.OpenBSD.org</a><br /> +<a class='textlink' href='https://OpenBSD.Amsterdam'>https://OpenBSD.Amsterdam</a><br /> +<br /> +<h2 style='display: inline' id='protonmail'>ProtonMail</h2><br /> +<br /> +<span>I am not directly funding this project, but I am a very happy paying customer, and I am listing it here as an alternative to big tech if you don't want to run your own mail infrastructure. I am listing ProtonMail here as it is a non-profit organization, and I want to emphasize the importance of considering alternatives to big tech.</span><br /> +<br /> +<a class='textlink' href='https://proton.me/'>https://proton.me/</a><br /> +<br /> +<h2 style='display: inline' id='librofm'><span class='inlinecode'>Libro.fm</span></h2><br /> +<br /> +<span>This is the alternative to Audible if you are into audiobooks (like I am). For every book or every month of membership, I am also supporting a local bookstore I selected. Their catalog is not as large as Audible's, but it's still pretty decent.</span><br /> +<br /> +<span>Libro.fm began as a conversation among friends at Third Place Books, a local bookstore in Seattle, Washington, about the growing popularity of audiobooks and the lack of a way for readers to purchase them from independent bookstores. Flash forward, and Libro.fm was founded in 2014.</span><br /> +<br /> +<a class='textlink' href='https://libro.fm'>https://libro.fm</a><br /> +<br /> +<span>E-mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> <title>Typing `127.1` words per minute (`>100wpm average`)</title> <link href="gemini://foo.zone/gemfeed/2024-08-05-typing-127.1-words-per-minute.gmi" /> <id>gemini://foo.zone/gemfeed/2024-08-05-typing-127.1-words-per-minute.gmi</id> @@ -18,7 +2419,7 @@ <summary>After work one day, I noticed some discomfort in my right wrist. Upon research, it appeared to be a mild case of Repetitive Strain Injury (RSI). Initially, I thought that this would go away after a while, but after a week it became even worse. This led me to consider potential causes such as poor posture or keyboard use habits. As an enthusiast of keyboards, I experimented with ergonomic concave ortholinear split keyboards. Wait, what?...</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Typing1271wordsperminute100wpmaverage'>Typing <span class='inlinecode'>127.1</span> words per minute (<span class='inlinecode'>>100wpm average</span>)</h1><br /> + <h1 style='display: inline' id='typing-1271-words-per-minute-100wpm-average'>Typing <span class='inlinecode'>127.1</span> words per minute (<span class='inlinecode'>>100wpm average</span>)</h1><br /> <br /> <span class='quote'>Published at 2024-08-05T17:39:30+03:00</span><br /> <br /> @@ -37,6 +2438,38 @@ Nieminen Mika </pre> <br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#typing-1271-words-per-minute-100wpm-average'>Typing <span class='inlinecode'>127.1</span> words per minute (<span class='inlinecode'>>100wpm average</span>)</a></li> +<li>⇢ <a href='#introduction'>Introduction</a></li> +<li>⇢ <a href='#kinesis-review'>Kinesis review</a></li> +<li>⇢ ⇢ <a href='#top-build-quality'>Top build quality</a></li> +<li>⇢ ⇢ <a href='#bluetooth-connectivity'>Bluetooth connectivity</a></li> +<li>⇢ ⇢ <a href='#gateron-brown-key-switches'>Gateron Brown key switches</a></li> +<li>⇢ ⇢ <a href='#keycaps'>Keycaps</a></li> +<li>⇢ ⇢ <a href='#keymap-editor'>Keymap editor</a></li> +<li>⇢ <a href='#first-steps'>First steps</a></li> +<li>⇢ <a href='#considering-alternate-layouts'>Considering alternate layouts</a></li> +<li>⇢ <a href='#training-how-to-type'>Training how to type</a></li> +<li>⇢ ⇢ <a href='#tools'>Tools</a></li> +<li>⇢ <a href='#my-keybrcom-statistics'>My <span class='inlinecode'>keybr.com</span> statistics</a></li> +<li>⇢ <a href='#tips-and-tricks'>Tips and tricks</a></li> +<li>⇢ ⇢ <a href='#relax'>Relax</a></li> +<li>⇢ ⇢ <a href='#focus-on-accuracy-first'>Focus on accuracy first</a></li> +<li>⇢ ⇢ <a href='#chording'>Chording</a></li> +<li>⇢ ⇢ <a href='#punctuation-and-capitalization'>Punctuation and Capitalization</a></li> +<li>⇢ ⇢ <a href='#reverse-shifting'>Reverse shifting</a></li> +<li>⇢ ⇢ <a href='#enter-the-flow-state'>Enter the flow state</a></li> +<li>⇢ ⇢ <a href='#repeat-every-word'>Repeat every word</a></li> +<li>⇢ ⇢ <a href='#don-t-use-the-same-finger-for-two-consecutive-keystrokes'>Don't use the same finger for two consecutive keystrokes</a></li> +<li>⇢ ⇢ <a href='#warm-up'>Warm-up</a></li> +<li>⇢ <a href='#travel-keyboard'>Travel keyboard</a></li> +<li>⇢ <a href='#upcoming-custom-kinesis-build'>Upcoming custom Kinesis build</a></li> +<li>⇢ <a href='#conclusion'>Conclusion</a></li> +</ul><br /> +<h2 style='display: inline' id='introduction'>Introduction</h2><br /> +<br /> <span>After work one day, I noticed some discomfort in my right wrist. Upon research, it appeared to be a mild case of Repetitive Strain Injury (RSI). Initially, I thought that this would go away after a while, but after a week it became even worse. This led me to consider potential causes such as poor posture or keyboard use habits. As an enthusiast of keyboards, I experimented with ergonomic concave ortholinear split keyboards. Wait, what?...</span><br /> <br /> <ul> @@ -46,23 +2479,23 @@ </ul><br /> <span>After discovering ThePrimagen (I found him long ago, but I never bothered buying the same keyboard he is on) on YouTube and reading/watching a couple of reviews, I thought that as a computer professional, the equipment could be expensive anyway (laptop, adjustable desk, comfortable chair), so why not invest a bit more into the keyboard? I purchased myself the Kinesis Advantage360 Professional keyboard. </span><br /> <br /> -<h2 style='display: inline' id='Kinesisreview'>Kinesis review</h2><br /> +<h2 style='display: inline' id='kinesis-review'>Kinesis review</h2><br /> <br /> <span>For an in-depth review, have a look at this great article:</span><br /> <br /> <a class='textlink' href='https://arslan.io/2022/10/22/review-of-the-kinesis-advantage360-professional'>Review of the Kinesis Advantage360 Professional keyboard</a><br /> <br /> -<h3 style='display: inline' id='Topbuildquality'>Top build quality</h3><br /> +<h3 style='display: inline' id='top-build-quality'>Top build quality</h3><br /> <br /> <span>Overall, the keyboard feels excellent quality and robust. It has got some weight to it. Because of that, it is not ideally suited for travel, though. But I have a different keyboard to solve this (see later in this post). Overall, I love how it is built and how it feels.</span><br /> <br /> <a href='./typing-127.1-words-per-minute/kinesis2.jpg'><img alt='Kinesis Adv.360 Pro at home' title='Kinesis Adv.360 Pro at home' src='./typing-127.1-words-per-minute/kinesis2.jpg' /></a><br /> <br /> -<h3 style='display: inline' id='Bluetoothconnectivity'>Bluetooth connectivity</h3><br /> +<h3 style='display: inline' id='bluetooth-connectivity'>Bluetooth connectivity</h3><br /> <br /> <span>Despite encountering concerns about Bluetooth connectivity issues with the Kinesis keyboard during my research, I purchased one anyway as I intended to use it only via USB. However, I discovered that the firmware updates available afterwards had addressed these reported Bluetooth issues, and as a result, I did not experience any difficulties with the Bluetooth functionality. This positive outcome allowed me to enjoy using the keyboard also wirelessly.</span><br /> <br /> -<h3 style='display: inline' id='GateronBrowmkeyswitches'>Gateron Browm key switches</h3><br /> +<h3 style='display: inline' id='gateron-brown-key-switches'>Gateron Brown key switches</h3><br /> <br /> <span>Many voices on the internet seem to dislike the Gateron Brown switches, the only official choice for non-clicky tactile switches in the Kinesis, so I was also a bit concerned. I almost went with Cherry MX Browns for my Kinesis (a custom build from a 3rd party provider that is partnershipping with Kinesis). Still, I decided on Gateron Browns to try different switches than the Cherry MX Browns I already have on my ZSA Moonlander keyboard (another ortho-linear split keyboard, but without a concave keycap layout). </span><br /> <br /> @@ -70,7 +2503,7 @@ <br /> <span>So, the Cherry MX feel sharper but are more tiring in the long run, and the Gaterons are easier to write on and the tactile Feedback is slightly less pronounced. </span><br /> <br /> -<h3 style='display: inline' id='Keycaps'>Keycaps</h3><br /> +<h3 style='display: inline' id='keycaps'>Keycaps</h3><br /> <br /> <span>If you ever purchase a Kinesis keyboard, go with the PCB keycaps. They upgrade the typing experience a lot. The only thing you will lose is that the backlighting won't shine through them. But that is a reasonable tradeoff. When do I need backlighting? I am supposed to look at the screen and not the keyboard while typing. </span><br /> <br /> @@ -78,7 +2511,7 @@ <br /> <a href='./typing-127.1-words-per-minute/kinesis1.jpg'><img alt='Kinesis Adv.360 Pro at home' title='Kinesis Adv.360 Pro at home' src='./typing-127.1-words-per-minute/kinesis1.jpg' /></a><br /> <br /> -<h3 style='display: inline' id='Keymapeditor'>Keymap editor</h3><br /> +<h3 style='display: inline' id='keymap-editor'>Keymap editor</h3><br /> <br /> <span>There is no official keymap editor. You have to edit a configuration file manually, build the firmware from scratch, and upload the firmware with the new keymap to both keyboard halves. The Professional version of his keyboard, by the way, runs on the ZMK open-source firmware.</span><br /> <br /> @@ -86,7 +2519,7 @@ <br /> <span>There is a 3rd party solution which is supposed to configure the keymap for the Professional model as bliss, but I have never used it. As a part-time programmer and full-time Site Reliability Engineer, I am okay configuring the keymap in my text editor and building it in a local docker container. This is one of the standard ways of doing it here. You could also use a GitHub pipeline for the firmware build, but I prefer building it locally on my machine. This all seems natural to me, but this may be an issue for "the average Joe" user.</span><br /> <br /> -<h2 style='display: inline' id='Firststeps'>First steps</h2><br /> +<h2 style='display: inline' id='first-steps'>First steps</h2><br /> <br /> <span>I didn't measure the usual words per minute (wpm) on my previous keyboard, the ZSA Moonlander, but I guess that it was around 40-50wpm. Once the Kinesis arrived, I started practising. The experience was quite different due to the concave keycaps, so I barely managed 10wpm on the first day.</span><br /> <br /> @@ -98,7 +2531,7 @@ <br /> <span>I also had a problem with the left pinky finger, where I could not comfortably reach the <span class='inlinecode'>p</span> key. This involved moving the whole hand. An easy fix was to swap <span class='inlinecode'>p</span> with <span class='inlinecode'>;</span> on the keyboard layout.</span><br /> <br /> -<h2 style='display: inline' id='Consideringalternatelayouts'>Considering alternate layouts</h2><br /> +<h2 style='display: inline' id='considering-alternate-layouts'>Considering alternate layouts</h2><br /> <br /> <span>As I was going to learn 10-finger touch typing from scratch, I also played with the thought of switching from the Qwerty to the Dvorak or Colemak keymap, but after reading some comments on the internet, I decided against it: </span><br /> <br /> @@ -108,9 +2541,9 @@ <li>There are also many applications and websites with keyboard shortcuts and are Qwerty-optimized.</li> <li>You won't be able to use someone else's computer as there will be likely Qwerty. Some report that after using an alternative layout for a while, they forget how to use Qwerty.</li> </ul><br /> -<h2 style='display: inline' id='Traininghowtotype'>Training how to type</h2><br /> +<h2 style='display: inline' id='training-how-to-type'>Training how to type</h2><br /> <br /> -<h3 style='display: inline' id='Tools'>Tools</h3><br /> +<h3 style='display: inline' id='tools'>Tools</h3><br /> <br /> <span>One of the most influential tools in my touch typing journey has been <span class='inlinecode'>keybr.com</span>. This site/app helped me learn 10-finger touch typing, and I practice daily for 30 minutes (in the first two weeks, up to an hour every day). The key is persistence and focus on technique rather than speed; the latter naturally improves with regular practice. Precision matters, too, so I always correct my errors using the backspace key.</span><br /> <br /> @@ -122,38 +2555,39 @@ <br /> <span>I wrote myself a small Ruby script that would randomly select a paragraph from one of my eBooks or book notes and pipe it to <span class='inlinecode'>tt</span>. This helped me remember some of the books I read and also practice touch typing.</span><br /> <br /> -<h2 style='display: inline' id='Mykeybrcomstatistics'>My <span class='inlinecode'>keybr.com</span> statistics</h2><br /> +<h2 style='display: inline' id='my-keybrcom-statistics'>My <span class='inlinecode'>keybr.com</span> statistics</h2><br /> <br /> <span>Overall, I trained for around 4 months in more than 5,000 sessions. My top speed in a session was 127.1wpm (up from barely 10wpm at the beginning).</span><br /> <br /> -<a href='./typing-127.1-words-per-minute/all-time-stats.png'><img src='./typing-127.1-words-per-minute/all-time-stats.png' /></a><br /> +<a href='./typing-127.1-words-per-minute/all-time-stats.png'><img alt='All time stats' title='All time stats' src='./typing-127.1-words-per-minute/all-time-stats.png' /></a><br /> <br /> <span>My overall average speed over those 5,000 sessions was 80wpm. The average speed over the last week was over 100wpm. The green line represents the wpm average (increasing trend), the purple line represents the number of keys in the practices (not much movement there, as all keys are unlocked), and the red line represents the average typing accuracy.</span><br /> <br /> -<a href='./typing-127.1-words-per-minute/typing-speed-over-lessons.png'><img src='./typing-127.1-words-per-minute/typing-speed-over-lessons.png' /></a><br /> +<a href='./typing-127.1-words-per-minute/typing-speed-over-lessons.png'><img alt='Typing speed over leson' title='Typing speed over leson' src='./typing-127.1-words-per-minute/typing-speed-over-lessons.png' /></a><br /> <br /> <span>Around the middle, you see a break-in of the wpm average value. This was where I swapped the <span class='inlinecode'>p</span> and <span class='inlinecode'>;</span> keys, but after some retraining, I came back to the previous level and beyond.</span><br /> <br /> -<h2 style='display: inline' id='Tipsandtricks'>Tips and tricks</h2><br /> +<h2 style='display: inline' id='tips-and-tricks'>Tips and tricks</h2><br /> <br /> <span>These are some tips and tricks I learned along the way to improve my typing speed:</span><br /> <br /> -<h3 style='display: inline' id='Relax'>Relax</h3><br /> +<h3 style='display: inline' id='relax'>Relax</h3><br /> <br /> <span>It's easy to get cramped when trying to hit this new wpm mark, but this is just holding you back. Relax and type at a natural pace. Now I also understand why my Katate Sensei back in London kept screaming "RELAAAX" at me during practice.... It didn't help much back then, though, as it is difficult to relax while someone screams at you! </span><br /> -<h3 style='display: inline' id='Focusonaccuracyfirst'>Focus on accuracy first</h3><br /> +<br /> +<h3 style='display: inline' id='focus-on-accuracy-first'>Focus on accuracy first</h3><br /> <br /> <span>This goes with the previous point. Instead of trying to speed through sessions as quickly as possible, slow down and try to type the words correctly—so don't rush it. If you aren't fast yet, the reason is that your brain hasn't trained enough. It will come over time, and you will be faster.</span><br /> <br /> -<h3 style='display: inline' id='Chording'>Chording</h3><br /> +<h3 style='display: inline' id='chording'>Chording</h3><br /> <br /> <span>A trick to getting faster is to type by word and pause between each word so you learn the words by chords. From 80wpm and beyond, this makes a real difference. </span><br /> <br /> -<h3 style='display: inline' id='PunctuationandCapitalization'>Punctuation and Capitalization</h3><br /> +<h3 style='display: inline' id='punctuation-and-capitalization'>Punctuation and Capitalization</h3><br /> <br /> <span>I included 10% punctuation and 20% capital letters in my <span class='inlinecode'>keybr.com</span> practice sessions to simulate real typing conditions, which improved my overall working efficiency. I guess I would have gone to 120wpm in average if I didn't include this options...</span><br /> <br /> -<h3 style='display: inline' id='Reverseshifting'>Reverse shifting</h3><br /> +<h3 style='display: inline' id='reverse-shifting'>Reverse shifting</h3><br /> <br /> <span>Reverse shifting aka left-right shifting is to... </span><br /> <br /> @@ -163,24 +2597,24 @@ </ul><br /> <span>This makes using the shift key a blaze.</span><br /> <br /> -<h3 style='display: inline' id='Entertheflowstate'>Enter the flow state</h3><br /> +<h3 style='display: inline' id='enter-the-flow-state'>Enter the flow state</h3><br /> <br /> <span>Listening to music helps me enter a flow state during practice sessions, which makes typing training a bit addictive (which is good, or isn't it?).</span><br /> <br /> -<h3 style='display: inline' id='Repeateveryword'>Repeat every word</h3><br /> +<h3 style='display: inline' id='repeat-every-word'>Repeat every word</h3><br /> <br /> <span>There's a setting on <span class='inlinecode'>keybr.com</span> that makes it so that every word is always repeated, having you type every word twice in a row. I liked this feature very much, and I think it also helped to improve my practice.</span><br /> <br /> -<h3 style='display: inline' id='Dontusethesamefingerfortwoconsecutivekeystrokes'>Don't use the same finger for two consecutive keystrokes</h3><br /> +<h3 style='display: inline' id='don-t-use-the-same-finger-for-two-consecutive-keystrokes'>Don't use the same finger for two consecutive keystrokes</h3><br /> <br /> <span>Apparently, if you want to type fast, avoid using the same finger for two consecutive keystrokes. This means you don't always need to use the same finger for the same keys. </span><br /> <span>However, there are no hard and fast rules. Thus, everyone develops their system for typing word combinations. An exception would be if you are typing the very same letter in a row (e.g., t in letter)—here, you are using the same finger for both ts.</span><br /> <br /> -<h3 style='display: inline' id='Warmup'>Warm-up</h3><br /> +<h3 style='display: inline' id='warm-up'>Warm-up</h3><br /> <br /> <span>You can't reach your average typing speed first ting the morning. It would help if you warmed up before the exercise or practice later during the day. Also, some days are good, others not so, e.g., after a bad night's sleep. What matters is the mid- and long-term trend, not the fluctuations here, though.</span><br /> <br /> -<h2 style='display: inline' id='Travelkeyboard'>Travel keyboard</h2><br /> +<h2 style='display: inline' id='travel-keyboard'>Travel keyboard</h2><br /> <br /> <span>As mentioned, the Kinesis is a great keyboard, but it is not meant for travel.</span><br /> <br /> @@ -200,11 +2634,11 @@ <br /> <a class='textlink' href='https://arslan.io/2024/04/22/review-of-the-moergo-glove80-keyboard/'>Review of the Glove80 keyboard</a><br /> <br /> -<h2 style='display: inline' id='UpcomingcustomKinesisbuild'>Upcoming custom Kinesis build</h2><br /> +<h2 style='display: inline' id='upcoming-custom-kinesis-build'>Upcoming custom Kinesis build</h2><br /> <br /> <span>As I mentioned, keyboards will remain an expensive hobby of mine. I don't regret anything here, though. After all, I use keyboards at my day job. I've ordered a Kinesis custom build with the Gateron Kangaroo switches, and I'm excited to see how that compares to my current setup. I'm still deciding whether to keep my Gateron Brown-equipped Kinesis as a secondary keyboard or possibly leave it at my in-laws for use when visiting or to sell it.</span><br /> <br /> -<h2 style='display: inline' id='Conclusion'>Conclusion</h2><br /> +<h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> <br /> <span>When I traveled with the Glove80 for work to the London office, a colleague stared at my keyboard and made jokes that it might be broken (split into two halves). But other than that... </span><br /> <br /> @@ -234,7 +2668,7 @@ <summary>These are my personal takeaways after reading 'The Stoic Challenge: A Philosopher's Guide to Becoming Tougher, Calmer, and More Resilient' by William B. Irvine. </summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='TheStoicChallengebooknotes'>"The Stoic Challenge" book notes</h1><br /> + <h1 style='display: inline' id='the-stoic-challenge-book-notes'>"The Stoic Challenge" book notes</h1><br /> <br /> <span class='quote'>Published at 2024-07-07T12:46:55+03:00</span><br /> <br /> @@ -252,6 +2686,16 @@ ''' </pre> <br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#the-stoic-challenge-book-notes'>"The Stoic Challenge" book notes</a></li> +<li>⇢ <a href='#god-sets-you-up-for-a-challenge'>God sets you up for a challenge</a></li> +<li>⇢ <a href='#negative-visualization'>Negative visualization</a></li> +<li>⇢ <a href='#oh-nice-trick-you-stoic-god--'>Oh, nice trick, you stoic "god"! ;-)</a></li> +</ul><br /> +<h2 style='display: inline' id='god-sets-you-up-for-a-challenge'>God sets you up for a challenge</h2><br /> +<br /> <span>Gods set you up for a challenge to see how resilient you are. Is getting angry worth the price? If you stay calm then you can find the optimal workaround for the obstacle. Stay calm even with big setbacks. Practice minimalism of negative emotions.</span><br /> <br /> <span>Put a positive spin on everything. What should you do if someone wrong you? Don't get angry, there is no point in that, it just makes you suffer. Do the best what you got now and keep calm and carry on. A resilient person will refuse to play the role of a victim. You can develop the setback response skills. Turn a setback. e.g. a handycap, into a personal triumph.</span><br /> @@ -262,7 +2706,7 @@ <br /> <span>Stoics are thankful that they are mortal. As then you can get reminded of how great it is to be alive at all. In dying we are more alive we have ever been as every thing you do could be the last time you do it. Rather than fighting your death you should embrace it if there are no workarounds. Embrace a good death.</span><br /> <br /> -<h2 style='display: inline' id='Negativevisualization'>Negative visualization</h2><br /> +<h2 style='display: inline' id='negative-visualization'>Negative visualization</h2><br /> <br /> <span>It is easy what we have to take for granted.</span><br /> <br /> @@ -272,7 +2716,7 @@ <li>Now close your eyes for a minute and imagine you would be blind, so that you will never be able to experience the world again and let it sink in. When you open your eyes again you will feel a lot of gratefulness.</li> <li>Last time meditation. Lets you appreciate the life as it is now. Life gets vitalised again.</li> </ul><br /> -<h2 style='display: inline' id='Ohnicetrickyoustoicgod'>Oh, nice trick, you stoic "god"! ;-)</h2><br /> +<h2 style='display: inline' id='oh-nice-trick-you-stoic-god--'>Oh, nice trick, you stoic "god"! ;-)</h2><br /> <br /> <span>Take setbacks as a challenge. Also take it with some humor.</span><br /> <br /> @@ -286,21 +2730,21 @@ <br /> <span>Other book notes of mine are:</span><br /> <br /> -<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> -<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> -<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> -<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> -<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> -<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2024-10-24-staff-engineer-book-notes.html'>2024-10-24 "Staff Engineer" book notes</a><br /> <a class='textlink' href='./2024-07-07-the-stoic-challenge-book-notes.html'>2024-07-07 "The Stoic Challenge" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> +<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> +<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> +<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> <br /> -<a class='textlink' href='../resources.html'>More books and other resources I found useful.</a><br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> </entry> <entry> - <title>Random Weird Things</title> + <title>Random Weird Things - Part Ⅰ</title> <link href="gemini://foo.zone/gemfeed/2024-07-05-random-weird-things.gmi" /> <id>gemini://foo.zone/gemfeed/2024-07-05-random-weird-things.gmi</id> <updated>2024-07-05T10:59:59+03:00</updated> @@ -311,12 +2755,15 @@ <summary>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. As a start, here are ten of them.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='RandomWeirdThings'>Random Weird Things</h1><br /> + <h1 style='display: inline' id='random-weird-things---part-'>Random Weird Things - Part Ⅰ</h1><br /> <br /> -<span class='quote'>Published at 2024-07-05T10:59:59+03:00</span><br /> +<span class='quote'>Published at 2024-07-05T10:59:59+03:00; Updated at 2025-02-08</span><br /> <br /> <span>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. As a start, here are ten of them.</span><br /> <br /> +<a class='textlink' href='./2024-07-05-random-weird-things.html'>2024-07-05 Random Weird Things - Part Ⅰ (You are currently reading this)</a><br /> +<a class='textlink' href='./2025-02-08-random-weird-things-ii.html'>2025-02-08 Random Weird Things - Part Ⅱ</a><br /> +<br /> <pre> /\_/\ WHOA!! ( o.o ) @@ -326,55 +2773,87 @@ WHOA!! ( o.o ) /______\ \ </pre> <br /> -<h2 style='display: inline' id='1badhorsetraceroute'>1. <span class='inlinecode'>bad.horse</span> traceroute</h2><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#random-weird-things---part-'>Random Weird Things - Part Ⅰ</a></li> +<li>⇢ <a href='#1-badhorse-traceroute'>1. <span class='inlinecode'>bad.horse</span> traceroute</a></li> +<li>⇢ <a href='#2-ascii-cinema'>2. ASCII cinema</a></li> +<li>⇢ <a href='#3-netflix-s-hello-world-application'>3. Netflix's Hello World application</a></li> +<li>⇢ <a href='#c-programming'>C programming</a></li> +<li>⇢ ⇢ <a href='#4-indexing-an-array'>4. Indexing an array</a></li> +<li>⇢ ⇢ <a href='#5-variables-with-prefix-'>5. Variables with prefix <span class='inlinecode'>$</span></a></li> +<li>⇢ <a href='#6-object-oriented-shell-scripts-using-ksh'>6. Object oriented shell scripts using <span class='inlinecode'>ksh</span></a></li> +<li>⇢ <a href='#7-this-works-in-go'>7. This works in Go</a></li> +<li>⇢ <a href='#8-i-am-a-teapot-http-response-code'>8. "I am a Teapot" HTTP response code</a></li> +<li>⇢ <a href='#9-jq-is-a-functional-programming-language'>9. <span class='inlinecode'>jq</span> is a functional programming language</a></li> +<li>⇢ <a href='#10-regular-expression-to-verify-email-addresses'>10. Regular expression to verify email addresses</a></li> +</ul><br /> +<h2 style='display: inline' id='1-badhorse-traceroute'>1. <span class='inlinecode'>bad.horse</span> traceroute</h2><br /> <br /> <span>Run traceroute to get the poem (or song).</span><br /> <br /> +<span class='quote'>Update: A reader hinted that by specifying <span class='inlinecode'>-n 60</span>, there will be even more output!</span><br /> +<br /> <!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> traceroute bad</font><font color="#F3E651">.</font><font color="#ff0000">horse</font> -<font color="#ff0000">traceroute to bad</font><font color="#F3E651">.</font><font color="#ff0000">horse </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.157</font><font color="#F3E651">),</font><font color="#ff0000"> </font><font color="#bb00ff">30</font><font color="#ff0000"> hops max</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">60</font><font color="#ff0000"> byte packets</font> -<font color="#ff0000"> </font><font color="#bb00ff">1</font><font color="#ff0000"> dsldevice</font><font color="#F3E651">.</font><font color="#ff0000">lan </font><font color="#F3E651">(</font><font color="#bb00ff">192.168</font><font color="#F3E651">.</font><font color="#bb00ff">1.1</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">5.712</font><font color="#ff0000"> ms </font><font color="#bb00ff">5.800</font><font color="#ff0000"> ms </font><font color="#bb00ff">6.466</font><font color="#ff0000"> ms</font> -<font color="#ff0000"> </font><font color="#bb00ff">2</font><font color="#ff0000"> </font><font color="#bb00ff">87</font><font color="#ff0000">-</font><font color="#bb00ff">243</font><font color="#ff0000">-</font><font color="#bb00ff">116</font><font color="#ff0000">-</font><font color="#bb00ff">2</font><font color="#F3E651">.</font><font color="#ff0000">ip</font><font color="#F3E651">.</font><font color="#ff0000">btc-net</font><font color="#F3E651">.</font><b><font color="#ffffff">bg</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><font color="#bb00ff">87.243</font><font color="#F3E651">.</font><font color="#bb00ff">116.2</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">8.017</font><font color="#ff0000"> ms </font><font color="#bb00ff">7.506</font><font color="#ff0000"> ms </font><font color="#bb00ff">8.432</font><font color="#ff0000"> ms</font> -<font color="#ff0000"> </font><font color="#bb00ff">3</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font> -<font color="#ff0000"> </font><font color="#bb00ff">4</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font> -<font color="#ff0000"> </font><font color="#bb00ff">5</font><font color="#ff0000"> xe-</font><font color="#bb00ff">1</font><font color="#ff0000">-</font><font color="#bb00ff">2</font><font color="#ff0000">-</font><font color="#bb00ff">0</font><font color="#F3E651">.</font><font color="#ff0000">mpr1</font><font color="#F3E651">.</font><font color="#ff0000">fra4</font><font color="#F3E651">.</font><font color="#ff0000">de</font><font color="#F3E651">.</font><font color="#ff0000">above</font><font color="#F3E651">.</font><font color="#ff0000">net </font><font color="#F3E651">(</font><font color="#bb00ff">80.81</font><font color="#F3E651">.</font><font color="#bb00ff">194.26</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">39.952</font><font color="#ff0000"> ms </font><font color="#bb00ff">40.155</font><font color="#ff0000"> ms </font><font color="#bb00ff">40.139</font><font color="#ff0000"> ms</font> -<font color="#ff0000"> </font><font color="#bb00ff">6</font><font color="#ff0000"> ae12</font><font color="#F3E651">.</font><font color="#ff0000">cs1</font><font color="#F3E651">.</font><font color="#ff0000">fra6</font><font color="#F3E651">.</font><font color="#ff0000">de</font><font color="#F3E651">.</font><font color="#ff0000">eth</font><font color="#F3E651">.</font><font color="#ff0000">zayo</font><font color="#F3E651">.</font><font color="#ff0000">com </font><font color="#F3E651">(</font><font color="#bb00ff">64.125</font><font color="#F3E651">.</font><font color="#bb00ff">26.172</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">128.014</font><font color="#ff0000"> ms </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font> -<font color="#ff0000"> </font><font color="#bb00ff">7</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font> -<font color="#ff0000"> </font><font color="#bb00ff">8</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font> -<font color="#ff0000"> </font><font color="#bb00ff">9</font><font color="#ff0000"> ae10</font><font color="#F3E651">.</font><font color="#ff0000">cs1</font><font color="#F3E651">.</font><font color="#ff0000">lhr15</font><font color="#F3E651">.</font><font color="#ff0000">uk</font><font color="#F3E651">.</font><font color="#ff0000">eth</font><font color="#F3E651">.</font><font color="#ff0000">zayo</font><font color="#F3E651">.</font><font color="#ff0000">com </font><font color="#F3E651">(</font><font color="#bb00ff">64.125</font><font color="#F3E651">.</font><font color="#bb00ff">29.17</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">120.625</font><font color="#ff0000"> ms </font><font color="#bb00ff">121.117</font><font color="#ff0000"> ms </font><font color="#bb00ff">121.050</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">10</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font> -<font color="#bb00ff">11</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font> -<font color="#bb00ff">12</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font> -<font color="#bb00ff">13</font><font color="#ff0000"> ae5</font><font color="#F3E651">.</font><font color="#ff0000">mpr1</font><font color="#F3E651">.</font><font color="#ff0000">tor3</font><font color="#F3E651">.</font><font color="#ff0000">ca</font><font color="#F3E651">.</font><font color="#ff0000">zip</font><font color="#F3E651">.</font><font color="#ff0000">zayo</font><font color="#F3E651">.</font><font color="#ff0000">com </font><font color="#F3E651">(</font><font color="#bb00ff">64.125</font><font color="#F3E651">.</font><font color="#bb00ff">23.118</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">192.605</font><font color="#ff0000"> ms </font><font color="#bb00ff">205.741</font><font color="#ff0000"> ms </font><font color="#bb00ff">203.607</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">14</font><font color="#ff0000"> </font><font color="#bb00ff">64.124</font><font color="#F3E651">.</font><font color="#bb00ff">217.237</font><font color="#F3E651">.</font><font color="#ff0000">IDIA-</font><font color="#bb00ff">265104</font><font color="#ff0000">-ZYO</font><font color="#F3E651">.</font><font color="#ff0000">zip</font><font color="#F3E651">.</font><font color="#ff0000">zayo</font><font color="#F3E651">.</font><font color="#ff0000">com </font><font color="#F3E651">(</font><font color="#bb00ff">64.124</font><font color="#F3E651">.</font><font color="#bb00ff">217.237</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">204.673</font><font color="#ff0000"> ms </font><font color="#bb00ff">134.674</font><font color="#ff0000"> ms </font><font color="#bb00ff">131.442</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">15</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font> -<font color="#bb00ff">16</font><font color="#ff0000"> </font><font color="#bb00ff">67.223</font><font color="#F3E651">.</font><font color="#bb00ff">96.90</font><font color="#ff0000"> </font><font color="#F3E651">(</font><font color="#bb00ff">67.223</font><font color="#F3E651">.</font><font color="#bb00ff">96.90</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">128.245</font><font color="#ff0000"> ms </font><font color="#bb00ff">127.844</font><font color="#ff0000"> ms </font><font color="#bb00ff">127.843</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">17</font><font color="#ff0000"> bad</font><font color="#F3E651">.</font><font color="#ff0000">horse </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.130</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">128.194</font><font color="#ff0000"> ms </font><font color="#bb00ff">122.854</font><font color="#ff0000"> ms </font><font color="#bb00ff">121.786</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">18</font><font color="#ff0000"> bad</font><font color="#F3E651">.</font><font color="#ff0000">horse </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.131</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">128.831</font><font color="#ff0000"> ms </font><font color="#bb00ff">128.341</font><font color="#ff0000"> ms </font><font color="#bb00ff">186.559</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">19</font><font color="#ff0000"> bad</font><font color="#F3E651">.</font><font color="#ff0000">horse </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.132</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">185.716</font><font color="#ff0000"> ms </font><font color="#bb00ff">180.121</font><font color="#ff0000"> ms </font><font color="#bb00ff">180.042</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">20</font><font color="#ff0000"> bad</font><font color="#F3E651">.</font><font color="#ff0000">horse </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.133</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">203.170</font><font color="#ff0000"> ms </font><font color="#bb00ff">203.076</font><font color="#ff0000"> ms </font><font color="#bb00ff">203.168</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">21</font><font color="#ff0000"> he</font><font color="#F3E651">.</font><font color="#ff0000">rides</font><font color="#F3E651">.</font><font color="#ff0000">across</font><font color="#F3E651">.</font><font color="#ff0000">the</font><font color="#F3E651">.</font><font color="#ff0000">nation </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.134</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">203.115</font><font color="#ff0000"> ms </font><font color="#bb00ff">141.830</font><font color="#ff0000"> ms </font><font color="#bb00ff">141.799</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">22</font><font color="#ff0000"> the</font><font color="#F3E651">.</font><font color="#ff0000">thoroughbred</font><font color="#F3E651">.</font><font color="#ff0000">of</font><font color="#F3E651">.</font><font color="#ff0000">sin </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.135</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">147.965</font><font color="#ff0000"> ms </font><font color="#bb00ff">148.230</font><font color="#ff0000"> ms </font><font color="#bb00ff">170.478</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">23</font><font color="#ff0000"> he</font><font color="#F3E651">.</font><font color="#ff0000">got</font><font color="#F3E651">.</font><font color="#ff0000">the</font><font color="#F3E651">.</font><font color="#ff0000">application </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.136</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">165.161</font><font color="#ff0000"> ms </font><font color="#bb00ff">164.939</font><font color="#ff0000"> ms </font><font color="#bb00ff">159.085</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">24</font><font color="#ff0000"> that</font><font color="#F3E651">.</font><font color="#ff0000">you</font><font color="#F3E651">.</font><font color="#ff0000">just</font><font color="#F3E651">.</font><font color="#ff0000">sent</font><font color="#F3E651">.</font><b><font color="#ffffff">in</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.137</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">162.310</font><font color="#ff0000"> ms </font><font color="#bb00ff">158.569</font><font color="#ff0000"> ms </font><font color="#bb00ff">158.896</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">25</font><font color="#ff0000"> it</font><font color="#F3E651">.</font><font color="#ff0000">needs</font><font color="#F3E651">.</font><font color="#ff0000">evaluation </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.138</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">162.927</font><font color="#ff0000"> ms </font><font color="#bb00ff">163.046</font><font color="#ff0000"> ms </font><font color="#bb00ff">163.085</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">26</font><font color="#ff0000"> so</font><font color="#F3E651">.</font><b><font color="#ffffff">let</font></b><font color="#F3E651">.</font><font color="#ff0000">the</font><font color="#F3E651">.</font><font color="#ff0000">games</font><font color="#F3E651">.</font><font color="#ff0000">begin </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.139</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">233.363</font><font color="#ff0000"> ms </font><font color="#bb00ff">233.545</font><font color="#ff0000"> ms </font><font color="#bb00ff">233.317</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">27</font><font color="#ff0000"> a</font><font color="#F3E651">.</font><font color="#ff0000">heinous</font><font color="#F3E651">.</font><font color="#ff0000">crime </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.140</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">237.745</font><font color="#ff0000"> ms </font><font color="#bb00ff">233.614</font><font color="#ff0000"> ms </font><font color="#bb00ff">233.740</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">28</font><font color="#ff0000"> a</font><font color="#F3E651">.</font><font color="#ff0000">show</font><font color="#F3E651">.</font><font color="#ff0000">of</font><font color="#F3E651">.</font><font color="#ff0000">force </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.141</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">237.974</font><font color="#ff0000"> ms </font><font color="#bb00ff">176.085</font><font color="#ff0000"> ms </font><font color="#bb00ff">175.927</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">29</font><font color="#ff0000"> a</font><font color="#F3E651">.</font><font color="#ff0000">murder</font><font color="#F3E651">.</font><font color="#ff0000">would</font><font color="#F3E651">.</font><font color="#ff0000">be</font><font color="#F3E651">.</font><font color="#ff0000">nice</font><font color="#F3E651">.</font><font color="#ff0000">of</font><font color="#F3E651">.</font><font color="#ff0000">course </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.142</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">181.838</font><font color="#ff0000"> ms </font><font color="#bb00ff">181.858</font><font color="#ff0000"> ms </font><font color="#bb00ff">182.059</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">30</font><font color="#ff0000"> bad</font><font color="#F3E651">.</font><font color="#ff0000">horse </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.143</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">187.731</font><font color="#ff0000"> ms </font><font color="#bb00ff">187.416</font><font color="#ff0000"> ms </font><font color="#bb00ff">187.532</font><font color="#ff0000"> ms</font> -</pre> -<br /> -<h2 style='display: inline' id='2ASCIIcinema'>2. ASCII cinema</h2><br /> +<pre>❯ traceroute -m <font color="#000000">60</font> bad.horse +traceroute to bad.horse (<font color="#000000">162.252</font>.<font color="#000000">205.157</font>), <font color="#000000">60</font> hops max, <font color="#000000">60</font> byte packets + <font color="#000000">1</font> _gateway (<font color="#000000">192.168</font>.<font color="#000000">1.1</font>) <font color="#000000">5.237</font> ms <font color="#000000">5.264</font> ms <font color="#000000">6.009</font> ms + <font color="#000000">2</font> <font color="#000000">77</font>-<font color="#000000">85</font>-<font color="#000000">0</font>-<font color="#000000">2</font>.ip.btc-net.<b><u><font color="#000000">bg</font></u></b> (<font color="#000000">77.85</font>.<font color="#000000">0.2</font>) <font color="#000000">8.753</font> ms <font color="#000000">7.112</font> ms <font color="#000000">8.336</font> ms + <font color="#000000">3</font> <font color="#000000">212</font>-<font color="#000000">39</font>-<font color="#000000">69</font>-<font color="#000000">103</font>.ip.btc-net.<b><u><font color="#000000">bg</font></u></b> (<font color="#000000">212.39</font>.<font color="#000000">69.103</font>) <font color="#000000">9.434</font> ms <font color="#000000">9.268</font> ms <font color="#000000">9.986</font> ms + <font color="#000000">4</font> * * * + <font color="#000000">5</font> xe-<font color="#000000">1</font>-<font color="#000000">2</font>-<font color="#000000">0</font>.mpr1.fra4.de.above.net (<font color="#000000">80.81</font>.<font color="#000000">194.26</font>) <font color="#000000">39.812</font> ms <font color="#000000">39.030</font> ms <font color="#000000">39.772</font> ms + <font color="#000000">6</font> * ae12.cs1.fra6.de.eth.zayo.com (<font color="#000000">64.125</font>.<font color="#000000">26.172</font>) <font color="#000000">123.576</font> ms * + <font color="#000000">7</font> * * * + <font color="#000000">8</font> * * * + <font color="#000000">9</font> ae10.cr1.lhr15.uk.eth.zayo.com (<font color="#000000">64.125</font>.<font color="#000000">29.17</font>) <font color="#000000">119.097</font> ms <font color="#000000">119.478</font> ms <font color="#000000">120.767</font> ms +<font color="#000000">10</font> ae2.cr1.lhr11.uk.zip.zayo.com (<font color="#000000">64.125</font>.<font color="#000000">24.140</font>) <font color="#000000">120.398</font> ms <font color="#000000">121.147</font> ms <font color="#000000">120.948</font> ms +<font color="#000000">11</font> * * * +<font color="#000000">12</font> ae25.mpr1.yyz1.ca.zip.zayo.com (<font color="#000000">64.125</font>.<font color="#000000">23.117</font>) <font color="#000000">145.072</font> ms * <font color="#000000">181.773</font> ms +<font color="#000000">13</font> ae5.mpr1.tor3.ca.zip.zayo.com (<font color="#000000">64.125</font>.<font color="#000000">23.118</font>) <font color="#000000">168.239</font> ms <font color="#000000">168.158</font> ms <font color="#000000">168.137</font> ms +<font color="#000000">14</font> <font color="#000000">64.124</font>.<font color="#000000">217.237</font>.IDIA-<font color="#000000">265104</font>-ZYO.zip.zayo.com (<font color="#000000">64.124</font>.<font color="#000000">217.237</font>) <font color="#000000">168.026</font> ms <font color="#000000">167.999</font> ms <font color="#000000">165.451</font> ms +<font color="#000000">15</font> * * * +<font color="#000000">16</font> t00.toroc1.on.ca.sn11.net (<font color="#000000">162.252</font>.<font color="#000000">204.2</font>) <font color="#000000">131.598</font> ms <font color="#000000">131.308</font> ms <font color="#000000">131.482</font> ms +<font color="#000000">17</font> bad.horse (<font color="#000000">162.252</font>.<font color="#000000">205.130</font>) <font color="#000000">131.430</font> ms <font color="#000000">145.914</font> ms <font color="#000000">130.514</font> ms +<font color="#000000">18</font> bad.horse (<font color="#000000">162.252</font>.<font color="#000000">205.131</font>) <font color="#000000">136.634</font> ms <font color="#000000">145.295</font> ms <font color="#000000">135.631</font> ms +<font color="#000000">19</font> bad.horse (<font color="#000000">162.252</font>.<font color="#000000">205.132</font>) <font color="#000000">139.158</font> ms <font color="#000000">148.363</font> ms <font color="#000000">138.934</font> ms +<font color="#000000">20</font> bad.horse (<font color="#000000">162.252</font>.<font color="#000000">205.133</font>) <font color="#000000">145.395</font> ms <font color="#000000">148.054</font> ms <font color="#000000">147.140</font> ms +<font color="#000000">21</font> he.rides.across.the.nation (<font color="#000000">162.252</font>.<font color="#000000">205.134</font>) <font color="#000000">149.687</font> ms <font color="#000000">147.731</font> ms <font color="#000000">150.135</font> ms +<font color="#000000">22</font> the.thoroughbred.of.sin (<font color="#000000">162.252</font>.<font color="#000000">205.135</font>) <font color="#000000">156.644</font> ms <font color="#000000">155.155</font> ms <font color="#000000">156.447</font> ms +<font color="#000000">23</font> he.got.the.application (<font color="#000000">162.252</font>.<font color="#000000">205.136</font>) <font color="#000000">161.187</font> ms <font color="#000000">162.318</font> ms <font color="#000000">162.674</font> ms +<font color="#000000">24</font> that.you.just.sent.<b><u><font color="#000000">in</font></u></b> (<font color="#000000">162.252</font>.<font color="#000000">205.137</font>) <font color="#000000">166.763</font> ms <font color="#000000">166.675</font> ms <font color="#000000">164.243</font> ms +<font color="#000000">25</font> it.needs.evaluation (<font color="#000000">162.252</font>.<font color="#000000">205.138</font>) <font color="#000000">172.073</font> ms <font color="#000000">171.919</font> ms <font color="#000000">171.390</font> ms +<font color="#000000">26</font> so.<b><u><font color="#000000">let</font></u></b>.the.games.begin (<font color="#000000">162.252</font>.<font color="#000000">205.139</font>) <font color="#000000">175.386</font> ms <font color="#000000">174.180</font> ms <font color="#000000">175.965</font> ms +<font color="#000000">27</font> a.heinous.crime (<font color="#000000">162.252</font>.<font color="#000000">205.140</font>) <font color="#000000">180.857</font> ms <font color="#000000">180.766</font> ms <font color="#000000">180.192</font> ms +<font color="#000000">28</font> a.show.of.force (<font color="#000000">162.252</font>.<font color="#000000">205.141</font>) <font color="#000000">187.942</font> ms <font color="#000000">186.669</font> ms <font color="#000000">186.986</font> ms +<font color="#000000">29</font> a.murder.would.be.nice.of.course (<font color="#000000">162.252</font>.<font color="#000000">205.142</font>) <font color="#000000">191.349</font> ms <font color="#000000">191.939</font> ms <font color="#000000">190.740</font> ms +<font color="#000000">30</font> bad.horse (<font color="#000000">162.252</font>.<font color="#000000">205.143</font>) <font color="#000000">195.425</font> ms <font color="#000000">195.716</font> ms <font color="#000000">196.186</font> ms +<font color="#000000">31</font> bad.horse (<font color="#000000">162.252</font>.<font color="#000000">205.144</font>) <font color="#000000">199.238</font> ms <font color="#000000">200.620</font> ms <font color="#000000">200.318</font> ms +<font color="#000000">32</font> bad.horse (<font color="#000000">162.252</font>.<font color="#000000">205.145</font>) <font color="#000000">207.554</font> ms <font color="#000000">206.729</font> ms <font color="#000000">205.201</font> ms +<font color="#000000">33</font> he-s.bad (<font color="#000000">162.252</font>.<font color="#000000">205.146</font>) <font color="#000000">211.087</font> ms <font color="#000000">211.649</font> ms <font color="#000000">211.712</font> ms +<font color="#000000">34</font> the.evil.league.of.evil (<font color="#000000">162.252</font>.<font color="#000000">205.147</font>) <font color="#000000">212.657</font> ms <font color="#000000">216.777</font> ms <font color="#000000">216.589</font> ms +<font color="#000000">35</font> is.watching.so.beware (<font color="#000000">162.252</font>.<font color="#000000">205.148</font>) <font color="#000000">220.911</font> ms <font color="#000000">220.326</font> ms <font color="#000000">221.961</font> ms +<font color="#000000">36</font> the.grade.that.you.receive (<font color="#000000">162.252</font>.<font color="#000000">205.149</font>) <font color="#000000">225.384</font> ms <font color="#000000">225.696</font> ms <font color="#000000">225.640</font> ms +<font color="#000000">37</font> will.be.your.last.we.swear (<font color="#000000">162.252</font>.<font color="#000000">205.150</font>) <font color="#000000">232.312</font> ms <font color="#000000">230.989</font> ms <font color="#000000">230.919</font> ms +<font color="#000000">38</font> so.make.the.bad.horse.gleeful (<font color="#000000">162.252</font>.<font color="#000000">205.151</font>) <font color="#000000">235.761</font> ms <font color="#000000">235.291</font> ms <font color="#000000">235.585</font> ms +<font color="#000000">39</font> or.he-ll.make.you.his.mare (<font color="#000000">162.252</font>.<font color="#000000">205.152</font>) <font color="#000000">241.350</font> ms <font color="#000000">239.407</font> ms <font color="#000000">238.394</font> ms +<font color="#000000">40</font> o_o (<font color="#000000">162.252</font>.<font color="#000000">205.153</font>) <font color="#000000">246.154</font> ms <font color="#000000">247.650</font> ms <font color="#000000">247.110</font> ms +<font color="#000000">41</font> you-re.saddled.up (<font color="#000000">162.252</font>.<font color="#000000">205.154</font>) <font color="#000000">250.925</font> ms <font color="#000000">250.401</font> ms <font color="#000000">250.619</font> ms +<font color="#000000">42</font> there-s.no.recourse (<font color="#000000">162.252</font>.<font color="#000000">205.155</font>) <font color="#000000">256.071</font> ms <font color="#000000">251.154</font> ms <font color="#000000">255.340</font> ms +<font color="#000000">43</font> it-s.hi-ho.silver (<font color="#000000">162.252</font>.<font color="#000000">205.156</font>) <font color="#000000">260.152</font> ms <font color="#000000">261.775</font> ms <font color="#000000">261.544</font> ms +<font color="#000000">44</font> signed.bad.horse (<font color="#000000">162.252</font>.<font color="#000000">205.157</font>) <font color="#000000">262.430</font> ms <font color="#000000">261.410</font> ms <font color="#000000">261.365</font> ms +</pre> +<br /> +<h2 style='display: inline' id='2-ascii-cinema'>2. ASCII cinema</h2><br /> <br /> <span>Fancy watching Star Wars Episode IV in ASCII? Head to the ASCII cinema:</span><br /> <br /> <a class='textlink' href='https://asciinema.org/a/569727'>https://asciinema.org/a/569727</a><br /> <br /> -<h2 style='display: inline' id='3NetflixsHelloWorldapplication'>3. Netflix's Hello World application</h2><br /> +<h2 style='display: inline' id='3-netflix-s-hello-world-application'>3. Netflix's Hello World application</h2><br /> <br /> <span>Netflix has got the Hello World application run in production 😱</span><br /> <br /> @@ -383,9 +2862,9 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span class='quote'>By the time this is posted, it seems that Netflix has taken it offline... I should have created a screenshot!</span><br /> <br /> -<h2 style='display: inline' id='Cprogramming'>C programming</h2><br /> +<h2 style='display: inline' id='c-programming'>C programming</h2><br /> <br /> -<h3 style='display: inline' id='4Indexinganarray'>4. Indexing an array</h3><br /> +<h3 style='display: inline' id='4-indexing-an-array'>4. Indexing an array</h3><br /> <br /> <span>In C, you can index an array like this: <span class='inlinecode'>array[i]</span> (not surprising). But this works as well and is valid C code: <span class='inlinecode'>i[array]</span>, 🤯 It's because after the spec <span class='inlinecode'>A[B]</span> is equivalent to <span class='inlinecode'>*(A + B)</span> and the ordering doesn't matter for the <span class='inlinecode'>+</span> operator. All 3 loops are producing the same output. Would be funny to use <span class='inlinecode'>i[array]</span> in a merge request of some code base on April Fool's day!</span><br /> <br /> @@ -393,23 +2872,23 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ababab">#include</font><font color="#ff0000"> </font><font color="#bb00ff"><stdio.h></font> +<pre><b><u><font color="#000000">#include</font></u></b> <font color="#808080"><stdio.h></font> -<b><font color="#F35E1E">int</font></b><font color="#ff0000"> </font><font color="#7bc710">main</font><font color="#F3E651">(</font><b><font color="#F35E1E">void</font></b><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#F35E1E">int</font></b><font color="#ff0000"> array</font><font color="#F3E651">[</font><font color="#bb00ff">5</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#F3E651">{</font><font color="#ff0000"> </font><font color="#bb00ff">1</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">2</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">3</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">4</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">5</font><font color="#ff0000"> </font><font color="#F3E651">}</font><font color="#F3E651">;</font> +<b><font color="#000000">int</font></b> main(<b><font color="#000000">void</font></b>) { + <b><font color="#000000">int</font></b> array[<font color="#000000">5</font>] = { <font color="#000000">1</font>, <font color="#000000">2</font>, <font color="#000000">3</font>, <font color="#000000">4</font>, <font color="#000000">5</font> }; -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><b><font color="#F35E1E">int</font></b><font color="#ff0000"> i </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> i </font><font color="#F3E651"><</font><font color="#ff0000"> </font><font color="#bb00ff">5</font><font color="#F3E651">;</font><font color="#ff0000"> i</font><font color="#F3E651">++)</font> -<font color="#ff0000"> </font><font color="#7bc710">printf</font><font color="#F3E651">(</font><font color="#bb00ff">"%d</font><font color="#ffffff">\n</font><font color="#bb00ff">"</font><font color="#F3E651">,</font><font color="#ff0000"> array</font><font color="#F3E651">[</font><font color="#ff0000">i</font><font color="#F3E651">]);</font> + <b><u><font color="#000000">for</font></u></b> (<b><font color="#000000">int</font></b> i = <font color="#000000">0</font>; i < <font color="#000000">5</font>; i++) + printf(<font color="#808080">"%d</font>\n<font color="#808080">"</font>, array[i]); -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><b><font color="#F35E1E">int</font></b><font color="#ff0000"> i </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> i </font><font color="#F3E651"><</font><font color="#ff0000"> </font><font color="#bb00ff">5</font><font color="#F3E651">;</font><font color="#ff0000"> i</font><font color="#F3E651">++)</font> -<font color="#ff0000"> </font><font color="#7bc710">printf</font><font color="#F3E651">(</font><font color="#bb00ff">"%d</font><font color="#ffffff">\n</font><font color="#bb00ff">"</font><font color="#F3E651">,</font><font color="#ff0000"> i</font><font color="#F3E651">[</font><font color="#ff0000">array</font><font color="#F3E651">]);</font> + <b><u><font color="#000000">for</font></u></b> (<b><font color="#000000">int</font></b> i = <font color="#000000">0</font>; i < <font color="#000000">5</font>; i++) + printf(<font color="#808080">"%d</font>\n<font color="#808080">"</font>, i[array]); -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><b><font color="#F35E1E">int</font></b><font color="#ff0000"> i </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> i </font><font color="#F3E651"><</font><font color="#ff0000"> </font><font color="#bb00ff">5</font><font color="#F3E651">;</font><font color="#ff0000"> i</font><font color="#F3E651">++)</font> -<font color="#ff0000"> </font><font color="#7bc710">printf</font><font color="#F3E651">(</font><font color="#bb00ff">"%d</font><font color="#ffffff">\n</font><font color="#bb00ff">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#F3E651">*(</font><font color="#ff0000">i </font><font color="#F3E651">+</font><font color="#ff0000"> array</font><font color="#F3E651">));</font> -<font color="#F3E651">}</font> + <b><u><font color="#000000">for</font></u></b> (<b><font color="#000000">int</font></b> i = <font color="#000000">0</font>; i < <font color="#000000">5</font>; i++) + printf(<font color="#808080">"%d</font>\n<font color="#808080">"</font>, *(i + array)); +} </pre> <br /> -<h3 style='display: inline' id='5Variableswithprefix'>5. Variables with prefix <span class='inlinecode'>$</span></h3><br /> +<h3 style='display: inline' id='5-variables-with-prefix-'>5. Variables with prefix <span class='inlinecode'>$</span></h3><br /> <br /> <span>In C you can prefix variables with <span class='inlinecode'>$</span>! E.g. the following is valid C code 🫠:</span><br /> <br /> @@ -417,23 +2896,23 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ababab">#include</font><font color="#ff0000"> </font><font color="#bb00ff"><stdio.h></font> +<pre><b><u><font color="#000000">#include</font></u></b> <font color="#808080"><stdio.h></font> -<b><font color="#F35E1E">int</font></b><font color="#ff0000"> </font><font color="#7bc710">main</font><font color="#F3E651">(</font><b><font color="#F35E1E">void</font></b><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#F35E1E">int</font></b><font color="#ff0000"> $array</font><font color="#F3E651">[</font><font color="#bb00ff">5</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#F3E651">{</font><font color="#ff0000"> </font><font color="#bb00ff">1</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">2</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">3</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">4</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">5</font><font color="#ff0000"> </font><font color="#F3E651">}</font><font color="#F3E651">;</font> +<b><font color="#000000">int</font></b> main(<b><font color="#000000">void</font></b>) { + <b><font color="#000000">int</font></b> $array[<font color="#000000">5</font>] = { <font color="#000000">1</font>, <font color="#000000">2</font>, <font color="#000000">3</font>, <font color="#000000">4</font>, <font color="#000000">5</font> }; -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><b><font color="#F35E1E">int</font></b><font color="#ff0000"> $i </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> $i </font><font color="#F3E651"><</font><font color="#ff0000"> </font><font color="#bb00ff">5</font><font color="#F3E651">;</font><font color="#ff0000"> $i</font><font color="#F3E651">++)</font> -<font color="#ff0000"> </font><font color="#7bc710">printf</font><font color="#F3E651">(</font><font color="#bb00ff">"%d</font><font color="#ffffff">\n</font><font color="#bb00ff">"</font><font color="#F3E651">,</font><font color="#ff0000"> $array</font><font color="#F3E651">[</font><font color="#ff0000">$i</font><font color="#F3E651">]);</font> + <b><u><font color="#000000">for</font></u></b> (<b><font color="#000000">int</font></b> $i = <font color="#000000">0</font>; $i < <font color="#000000">5</font>; $i++) + printf(<font color="#808080">"%d</font>\n<font color="#808080">"</font>, $array[$i]); -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><b><font color="#F35E1E">int</font></b><font color="#ff0000"> $i </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> $i </font><font color="#F3E651"><</font><font color="#ff0000"> </font><font color="#bb00ff">5</font><font color="#F3E651">;</font><font color="#ff0000"> $i</font><font color="#F3E651">++)</font> -<font color="#ff0000"> </font><font color="#7bc710">printf</font><font color="#F3E651">(</font><font color="#bb00ff">"%d</font><font color="#ffffff">\n</font><font color="#bb00ff">"</font><font color="#F3E651">,</font><font color="#ff0000"> $i</font><font color="#F3E651">[</font><font color="#ff0000">$array</font><font color="#F3E651">]);</font> + <b><u><font color="#000000">for</font></u></b> (<b><font color="#000000">int</font></b> $i = <font color="#000000">0</font>; $i < <font color="#000000">5</font>; $i++) + printf(<font color="#808080">"%d</font>\n<font color="#808080">"</font>, $i[$array]); -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><b><font color="#F35E1E">int</font></b><font color="#ff0000"> $i </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> $i </font><font color="#F3E651"><</font><font color="#ff0000"> </font><font color="#bb00ff">5</font><font color="#F3E651">;</font><font color="#ff0000"> $i</font><font color="#F3E651">++)</font> -<font color="#ff0000"> </font><font color="#7bc710">printf</font><font color="#F3E651">(</font><font color="#bb00ff">"%d</font><font color="#ffffff">\n</font><font color="#bb00ff">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#F3E651">*(</font><font color="#ff0000">$i </font><font color="#F3E651">+</font><font color="#ff0000"> $array</font><font color="#F3E651">));</font> -<font color="#F3E651">}</font> + <b><u><font color="#000000">for</font></u></b> (<b><font color="#000000">int</font></b> $i = <font color="#000000">0</font>; $i < <font color="#000000">5</font>; $i++) + printf(<font color="#808080">"%d</font>\n<font color="#808080">"</font>, *($i + $array)); +} </pre> <br /> -<h2 style='display: inline' id='6Objectorientedshellscriptsusingksh'>6. Object oriented shell scripts using <span class='inlinecode'>ksh</span></h2><br /> +<h2 style='display: inline' id='6-object-oriented-shell-scripts-using-ksh'>6. Object oriented shell scripts using <span class='inlinecode'>ksh</span></h2><br /> <br /> <span>Experienced software developers are aware that scripting languages like Python, Perl, Ruby, and JavaScript support object-oriented programming (OOP) concepts such as classes and inheritance. However, many might be surprised to learn that the latest version of the Korn shell (Version 93t+) also supports OOP. In ksh93, OOP is implemented using user-defined types:</span><br /> <br /> @@ -441,45 +2920,45 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/ksh93</font></i> -<font color="#ff0000"> </font> -<b><font color="#ffffff">typeset</font></b><font color="#ff0000"> -T </font><font color="#ff0000">Point_t</font><font color="#F3E651">=(</font> -<font color="#ff0000"> integer -h </font><font color="#bb00ff">'x coordinate'</font><font color="#ff0000"> </font><font color="#ff0000">x</font><font color="#F3E651">=</font><font color="#bb00ff">0</font> -<font color="#ff0000"> integer -h </font><font color="#bb00ff">'y coordinate'</font><font color="#ff0000"> </font><font color="#ff0000">y</font><font color="#F3E651">=</font><font color="#bb00ff">0</font> -<font color="#ff0000"> </font><b><font color="#ffffff">typeset</font></b><font color="#ff0000"> -h </font><font color="#bb00ff">'point color'</font><font color="#ff0000"> </font><font color="#ff0000">color</font><font color="#F3E651">=</font><font color="#bb00ff">"red"</font> - -<font color="#ff0000"> </font><font color="#7bc710">function getcolor </font><font color="#ff0000">{</font> -<font color="#ff0000"> print -r </font><font color="#ff0000">${_.color}</font> -<font color="#ff0000"> }</font> - -<font color="#ff0000"> </font><font color="#7bc710">function setcolor </font><font color="#ff0000">{</font> -<font color="#ff0000"> _</font><font color="#F3E651">.</font><font color="#ff0000">color</font><font color="#F3E651">=</font><font color="#ff0000">$1</font> -<font color="#ff0000"> }</font> - -<font color="#ff0000"> </font><font color="#7bc710">setxy()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> _</font><font color="#F3E651">.</font><font color="#ff0000">x</font><font color="#F3E651">=</font><font color="#ff0000">$1</font><font color="#F3E651">;</font><font color="#ff0000"> _</font><font color="#F3E651">.</font><font color="#ff0000">y</font><font color="#F3E651">=</font><font color="#ff0000">$2</font> -<font color="#ff0000"> }</font> - -<font color="#ff0000"> </font><font color="#7bc710">getxy()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> print -r </font><font color="#bb00ff">"(${_.x},${_.y})"</font> -<font color="#ff0000"> }</font> -<font color="#F3E651">)</font> -<font color="#ff0000"> </font> -<font color="#ff0000">Point_t point</font> -<font color="#ff0000"> </font> -<font color="#ff0000">echo </font><font color="#bb00ff">"Initial coordinates are (${point.x},${point.y}). Color is ${point.color}"</font> -<font color="#ff0000"> </font> -<font color="#ff0000">point</font><font color="#F3E651">.</font><font color="#ff0000">setxy </font><font color="#bb00ff">5</font><font color="#ff0000"> </font><font color="#bb00ff">6</font> -<font color="#ff0000">point</font><font color="#F3E651">.</font><font color="#ff0000">setcolor blue</font> -<font color="#ff0000"> </font> -<font color="#ff0000">echo </font><font color="#bb00ff">"New coordinates are ${point.getxy}. Color is ${point.getcolor}"</font> -<font color="#ff0000"> </font> -<b><font color="#ffffff">exit</font></b><font color="#ff0000"> </font><font color="#bb00ff">0</font> +<pre><i><font color="silver">#!/usr/bin/ksh93</font></i> + +<b><u><font color="#000000">typeset</font></u></b> -T Point_t=( + integer -h <font color="#808080">'x coordinate'</font> x=<font color="#000000">0</font> + integer -h <font color="#808080">'y coordinate'</font> y=<font color="#000000">0</font> + <b><u><font color="#000000">typeset</font></u></b> -h <font color="#808080">'point color'</font> color=<font color="#808080">"red"</font> + + function getcolor { + print -r ${_.color} + } + + function setcolor { + _.color=$1 + } + + setxy() { + _.x=$1; _.y=$2 + } + + getxy() { + print -r <font color="#808080">"(${_.x},${_.y})"</font> + } +) + +Point_t point + +echo <font color="#808080">"Initial coordinates are (${point.x},${point.y}). Color is ${point.color}"</font> + +point.setxy <font color="#000000">5</font> <font color="#000000">6</font> +point.setcolor blue + +echo <font color="#808080">"New coordinates are ${point.getxy}. Color is ${point.getcolor}"</font> + +<b><u><font color="#000000">exit</font></u></b> <font color="#000000">0</font> </pre> <br /> <a class='textlink' href='https://blog.fpmurphy.com/2010/05/ksh93-using-types-to-create-object-orientated-scripts.html'>Using types to create object oriented Korn shell 93 scripts</a><br /> <br /> -<h2 style='display: inline' id='7ThisworksinGo'>7. This works in Go</h2><br /> +<h2 style='display: inline' id='7-this-works-in-go'>7. This works in Go</h2><br /> <br /> <span>There is no pointer arithmetic in Go like in C, but it is still possible to do some brain teasers with pointers 😧:</span><br /> <br /> @@ -487,29 +2966,29 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">package</font></b><font color="#ff0000"> main</font> +<pre><b><u><font color="#000000">package</font></u></b> main -<b><font color="#ffffff">import</font></b><font color="#ff0000"> </font><font color="#bb00ff">"fmt"</font> +<b><u><font color="#000000">import</font></u></b> <font color="#808080">"fmt"</font> -<b><font color="#ffffff">func</font></b><font color="#ff0000"> </font><font color="#7bc710">main</font><font color="#F3E651">()</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#ffffff">var</font></b><font color="#ff0000"> i int</font> -<font color="#ff0000"> f </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><b><font color="#ffffff">func</font></b><font color="#F3E651">()</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000">int </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> </font><font color="#F3E651">&</font><font color="#ff0000">i</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#7bc710">f</font><font color="#F3E651">()++</font> -<font color="#ff0000"> fmt</font><font color="#F3E651">.</font><font color="#7bc710">Println</font><font color="#F3E651">(</font><font color="#ff0000">i</font><font color="#F3E651">)</font> -<font color="#F3E651">}</font> +<b><u><font color="#000000">func</font></u></b> main() { + <b><u><font color="#000000">var</font></u></b> i int + f := <b><u><font color="#000000">func</font></u></b>() *int { + <b><u><font color="#000000">return</font></u></b> &i + } + *f()++ + fmt.Println(i) +} </pre> <br /> <a class='textlink' href='https://go.dev/play/p/sPRdyDvXefK?__s=mk8u899owb9yurl256gw'>Go playground</a><br /> <br /> -<h2 style='display: inline' id='8IamaTeapotHTTPresponsecode'>8. "I am a Teapot" HTTP response code</h2><br /> +<h2 style='display: inline' id='8-i-am-a-teapot-http-response-code'>8. "I am a Teapot" HTTP response code</h2><br /> <br /> <span>Defined in 1998 as one of the IETF's traditional April Fools' jokes (RFC 2324), the Hyper Text Coffee Pot Control Protocol specifies an HTTP status code that is not intended for actual HTTP server implementation. According to the RFC, this code should be returned by teapots when asked to brew coffee. This status code also serves as an Easter egg on some websites, such as Google.com's "I'm a teapot" feature. Occasionally, it is used to respond to a blocked request, even though the more appropriate response would be the 403 Forbidden status code.</span><br /> <br /> <a class='textlink' href='https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#418'>https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#418</a><br /> <br /> -<h2 style='display: inline' id='9jqisafunctionalprogramminglanguage'>9. <span class='inlinecode'>jq</span> is a functional programming language</h2><br /> +<h2 style='display: inline' id='9-jq-is-a-functional-programming-language'>9. <span class='inlinecode'>jq</span> is a functional programming language</h2><br /> <br /> <span>Many know of <span class='inlinecode'>jq</span>, the handy small tool and swiss army knife for JSON parsing. </span><br /> <br /> @@ -563,7 +3042,7 @@ def _token: . </pre> <br /> -<h2 style='display: inline' id='10Regularexpressiontoverifyemailaddresses'>10. Regular expression to verify email addresses</h2><br /> +<h2 style='display: inline' id='10-regular-expression-to-verify-email-addresses'>10. Regular expression to verify email addresses</h2><br /> <br /> <span>This is a pretty old meme, but still worth posting here (as some may be unaware). The RFC822 Perl regex to validate email addresses is 😱:</span><br /> <br /> @@ -574,7 +3053,7 @@ def _token: ?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\0 31]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\ -](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+ +>(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+ (?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?: (?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z |(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n) @@ -590,8 +3069,8 @@ r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\ |\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r \n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?: \r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t -]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031 -]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\]( +>))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031 +>+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\]( ?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(? :(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(? :\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(? @@ -610,7 +3089,7 @@ r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\ :\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([ ^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\" .\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\ -]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\ +>\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\ [\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\ r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\] @@ -622,17 +3101,17 @@ r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\ (?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\". \[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[ ^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\] -]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)(?:,\s*( +>))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)(?:,\s*( ?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\ ".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:( ?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[ \["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t -])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t -])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(? +>)*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t +>)+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(? :\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+| \Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?: [^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\ -]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n) +>]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n) ?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[" ()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n) ?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<> @@ -671,13 +3150,23 @@ r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\ <name>Paul Buetow aka snonux</name> <email>paul@dev.buetow.org</email> </author> - <summary>Table of contents</summary> + <summary>Tmux (Terminal Multiplexer) is a powerful, terminal-based tool that manages multiple terminal sessions within a single window. Here are some of its primary features and functionalities:</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Terminalmultiplexingwithtmux'>Terminal multiplexing with <span class='inlinecode'>tmux</span></h1><br /> + <h1 style='display: inline' id='terminal-multiplexing-with-tmux'>Terminal multiplexing with <span class='inlinecode'>tmux</span></h1><br /> <br /> <span class='quote'>Published at 2024-06-23T22:41:59+03:00</span><br /> <br /> +<span>Tmux (Terminal Multiplexer) is a powerful, terminal-based tool that manages multiple terminal sessions within a single window. Here are some of its primary features and functionalities:</span><br /> +<br /> +<ul> +<li>Session management</li> +<li>Window and Pane management</li> +<li>Persistent Workspace</li> +<li>Customization</li> +</ul><br /> +<a class='textlink' href='https://github.com/tmux/tmux/wiki'>https://github.com/tmux/tmux/wiki</a><br /> +<br /> <pre> _______ |.-----.| @@ -690,40 +3179,28 @@ jgs `-=========-`() mod. by Paul B. </pre> <br /> -<pre> -Table of contents -================= - -Terminal multiplexing with `tmux` - Introduction - Shell aliases - The `tn` alias - Creating a new session - Cleaning up default sessions automatically - Renaming sessions - The `ta` alias - Attaching to a session - The `tr` alias - For a nested remote session - Change of the Tmux prefix for better nesting - The `ts` alias - Searching sessions with fuzzy finder - The `tssh` alias - Cluster SSH replacement - The `tmux::tssh_from_argument` helper - The `tmux::tssh_from_file` helper - `tssh` examples - Common Tmux commands I use in `tssh` - Copy and paste workflow - Tmux configurations -</pre> -<br /> -<h2 style='display: inline' id='Introduction'>Introduction</h2><br /> -<br /> -<span>Tmux (Terminal Multiplexer) is a powerful, terminal-based tool that manages multiple terminal sessions within a single window. Here are some of its primary features and functionalities:</span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> <ul> -<li>Session management</li> -<li>Window and Pane management</li> -<li>Persistent Workspace</li> -<li>Customization</li> +<li><a href='#terminal-multiplexing-with-tmux'>Terminal multiplexing with <span class='inlinecode'>tmux</span></a></li> +<li>⇢ <a href='#before-continuing'>Before continuing...</a></li> +<li>⇢ <a href='#shell-aliases'>Shell aliases</a></li> +<li>⇢ <a href='#the-tn-alias---creating-a-new-session'>The <span class='inlinecode'>tn</span> alias - Creating a new session</a></li> +<li>⇢ ⇢ <a href='#cleaning-up-default-sessions-automatically'>Cleaning up default sessions automatically</a></li> +<li>⇢ ⇢ <a href='#renaming-sessions'>Renaming sessions</a></li> +<li>⇢ <a href='#the-ta-alias---attaching-to-a-session'>The <span class='inlinecode'>ta</span> alias - Attaching to a session</a></li> +<li>⇢ <a href='#the-tr-alias---for-a-nested-remote-session'>The <span class='inlinecode'>tr</span> alias - For a nested remote session</a></li> +<li>⇢ ⇢ <a href='#change-of-the-tmux-prefix-for-better-nesting'>Change of the Tmux prefix for better nesting</a></li> +<li>⇢ <a href='#the-ts-alias---searching-sessions-with-fuzzy-finder'>The <span class='inlinecode'>ts</span> alias - Searching sessions with fuzzy finder</a></li> +<li>⇢ <a href='#the-tssh-alias---cluster-ssh-replacement'>The <span class='inlinecode'>tssh</span> alias - Cluster SSH replacement</a></li> +<li>⇢ ⇢ <a href='#the-tmuxtsshfromargument-helper'>The <span class='inlinecode'>tmux::tssh_from_argument</span> helper</a></li> +<li>⇢ ⇢ <a href='#the-tmuxtsshfromfile-helper'>The <span class='inlinecode'>tmux::tssh_from_file</span> helper</a></li> +<li>⇢ ⇢ <a href='#tssh-examples'><span class='inlinecode'>tssh</span> examples</a></li> +<li>⇢ ⇢ <a href='#common-tmux-commands-i-use-in-tssh'>Common Tmux commands I use in <span class='inlinecode'>tssh</span></a></li> +<li>⇢ <a href='#copy-and-paste-workflow'>Copy and paste workflow</a></li> +<li>⇢ <a href='#tmux-configurations'>Tmux configurations</a></li> </ul><br /> -<a class='textlink' href='https://github.com/tmux/tmux/wiki'>https://github.com/tmux/tmux/wiki</a><br /> +<h2 style='display: inline' id='before-continuing'>Before continuing...</h2><br /> <br /> <span>Before continuing to read this post, I encourage you to get familiar with Tmux first (unless you already know the basics). You can go through the official getting started guide:</span><br /> <br /> @@ -739,7 +3216,7 @@ Terminal multiplexing with `tmux` <br /> <span>Tmux is highly configurable, and I think I am only scratching the surface of what is possible with it. Nevertheless, it may still be useful for you. I also love that Tmux is part of the OpenBSD base system!</span><br /> <br /> -<h2 style='display: inline' id='Shellaliases'>Shell aliases</h2><br /> +<h2 style='display: inline' id='shell-aliases'>Shell aliases</h2><br /> <br /> <span>I am a user of the Z-Shell (<span class='inlinecode'>zsh</span>), but I believe all the snippets mentioned in this blog post also work with Bash. </span><br /> <br /> @@ -751,20 +3228,20 @@ Terminal multiplexing with `tmux` by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">tm</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">tl</font><font color="#F3E651">=</font><font color="#bb00ff">'tmux list-sessions'</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">tn</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#ff0000">new</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">ta</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#ff0000">attach</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">tx</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#ff0000">remote</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">ts</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#ff0000">search</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">tssh</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#ff0000">cluster_ssh</font> +<pre><b><u><font color="#000000">alias</font></u></b> tm=tmux +<b><u><font color="#000000">alias</font></u></b> tl=<font color="#808080">'tmux list-sessions'</font> +<b><u><font color="#000000">alias</font></u></b> tn=tmux::new +<b><u><font color="#000000">alias</font></u></b> ta=tmux::attach +<b><u><font color="#000000">alias</font></u></b> tx=tmux::remote +<b><u><font color="#000000">alias</font></u></b> ts=tmux::search +<b><u><font color="#000000">alias</font></u></b> tssh=tmux::cluster_ssh </pre> <br /> <span>Note all <span class='inlinecode'>tmux::...</span>; those are custom shell functions doing certain things, and they aren't part of the Tmux distribution. But let's run through every aliases one by one. </span><br /> <br /> <span>The first two are pretty straightforward. <span class='inlinecode'>tm</span> is simply a shorthand for <span class='inlinecode'>tmux</span>, so I have to type less, and <span class='inlinecode'>tl</span> lists all Tmux sessions that are currently open. No magic here.</span><br /> <br /> -<h2 style='display: inline' id='ThetnaliasCreatinganewsession'>The <span class='inlinecode'>tn</span> alias - Creating a new session</h2><br /> +<h2 style='display: inline' id='the-tn-alias---creating-a-new-session'>The <span class='inlinecode'>tn</span> alias - Creating a new session</h2><br /> <br /> <span>The <span class='inlinecode'>tn</span> alias is referencing this function:</span><br /> <br /> @@ -772,30 +3249,30 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab"># Create new session and if alread exists attach to it</font></i> -<font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#7bc710">new ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">readonly</font></b><font color="#ff0000"> </font><font color="#ff0000">session</font><font color="#F3E651">=</font><font color="#ff0000">$1</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> </font><font color="#ff0000">date</font><font color="#F3E651">=</font><font color="#ff0000">date</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> where gdate </font><font color="#F3E651">&></font><font color="#ff0000">/dev/null</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> </font><font color="#ff0000">date</font><font color="#F3E651">=</font><font color="#ff0000">gdate</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> - -<font color="#ff0000"> tmux</font><font color="#F3E651">::</font><font color="#ff0000">cleanup_default</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> -z </font><font color="#bb00ff">"$session"</font><font color="#ff0000"> </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> tmux</font><font color="#F3E651">::</font><font color="#ff0000">new T</font><font color="#ff0000">$($date</font><font color="#ff0000"> </font><font color="#F3E651">+%</font><font color="#ff0000">s</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><b><font color="#ffffff">else</font></b> -<font color="#ff0000"> tmux new-session -d -s </font><font color="#ff0000">$session</font> -<font color="#ff0000"> tmux -</font><font color="#bb00ff">2</font><font color="#ff0000"> attach-session -t </font><font color="#ff0000">$session</font><font color="#ff0000"> </font><font color="#F3E651">||</font><font color="#ff0000"> tmux -</font><font color="#bb00ff">2</font><font color="#ff0000"> switch-client -t </font><font color="#ff0000">$session</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> -<font color="#ff0000">}</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">tn</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#ff0000">new</font> +<pre><i><font color="silver"># Create new session and if alread exists attach to it</font></i> +tmux::new () { + <b><u><font color="#000000">readonly</font></u></b> session=$1 + <b><u><font color="#000000">local</font></u></b> date=date + <b><u><font color="#000000">if</font></u></b> where gdate &>/dev/null; <b><u><font color="#000000">then</font></u></b> + date=gdate + <b><u><font color="#000000">fi</font></u></b> + + tmux::cleanup_default + <b><u><font color="#000000">if</font></u></b> [ -z <font color="#808080">"$session"</font> ]; <b><u><font color="#000000">then</font></u></b> + tmux::new T$($date +%s) + <b><u><font color="#000000">else</font></u></b> + tmux new-session -d -s $session + tmux -<font color="#000000">2</font> attach-session -t $session || tmux -<font color="#000000">2</font> switch-client -t $session + <b><u><font color="#000000">fi</font></u></b> +} +<b><u><font color="#000000">alias</font></u></b> tn=tmux::new </pre> <br /> <span>There is a lot going on here. Let's have a detailed look at what it is doing. As a note, the function relies on GNU Date, so MacOS is looking for the <span class='inlinecode'>gdate</span> commands to be available. Otherwise, it will fall back to <span class='inlinecode'>date</span>. You need to install GNU Date for Mac, as it isn't installed by default there. As I use Fedora Linux on my personal Laptop and a MacBook for work, I have to make it work for both.</span><br /> <br /> <span>First, a Tmux session name can be passed to the function as a first argument. That session name is only optional. Without it, Tmux will select a session named <span class='inlinecode'>T$($date +%s)</span> as a default. Which is T followed by the UNIX epoch, e.g. <span class='inlinecode'>T1717133796</span>.</span><br /> <br /> -<h3 style='display: inline' id='Cleaningupdefaultsessionsautomatically'>Cleaning up default sessions automatically</h3><br /> +<h3 style='display: inline' id='cleaning-up-default-sessions-automatically'>Cleaning up default sessions automatically</h3><br /> <br /> <span>Note also the call to <span class='inlinecode'>tmux::cleanup_default</span>; it would clean up all already opened default sessions if they aren't attached. Those sessions were only temporary, and I had too many flying around after a while. So, I decided to auto-delete the sessions if they weren't attached. If I want to keep sessions around, I will rename them with the Tmux command <span class='inlinecode'>prefix-key $</span>. This is the cleanup function:</span><br /> <br /> @@ -803,23 +3280,23 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#7bc710">cleanup_default ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> s</font> -<font color="#ff0000"> tmux list-sessions </font><font color="#F3E651">|</font><font color="#ff0000"> grep </font><font color="#bb00ff">'^T.*: '</font><font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> grep -F -v attached </font><font color="#F3E651">|</font> -<font color="#ff0000"> cut -d</font><font color="#F3E651">:</font><font color="#ff0000"> -f</font><font color="#bb00ff">1</font><font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> </font><b><font color="#ffffff">while</font></b><font color="#ff0000"> </font><b><font color="#ffffff">read</font></b><font color="#ff0000"> -r s</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">do</font></b> -<font color="#ff0000"> echo </font><font color="#bb00ff">"Killing $s"</font> -<font color="#ff0000"> tmux kill-session -t </font><font color="#bb00ff">"$s"</font> -<font color="#ff0000"> </font><b><font color="#ffffff">done</font></b> -<font color="#ff0000">}</font> +<pre>tmux::cleanup_default () { + <b><u><font color="#000000">local</font></u></b> s + tmux list-sessions | grep <font color="#808080">'^T.*: '</font> | grep -F -v attached | + cut -d: -f<font color="#000000">1</font> | <b><u><font color="#000000">while</font></u></b> <b><u><font color="#000000">read</font></u></b> -r s; <b><u><font color="#000000">do</font></u></b> + echo <font color="#808080">"Killing $s"</font> + tmux kill-session -t <font color="#808080">"$s"</font> + <b><u><font color="#000000">done</font></u></b> +} </pre> <br /> <span>The cleanup function kills all open Tmux sessions that haven't been renamed properly yet—but only if they aren't attached (e.g., don't run in the foreground in any terminal). Cleaning them up automatically keeps my Tmux sessions as neat and tidy as possible. </span><br /> <br /> -<h3 style='display: inline' id='Renamingsessions'>Renaming sessions</h3><br /> +<h3 style='display: inline' id='renaming-sessions'>Renaming sessions</h3><br /> <br /> <span>Whenever I am in a temporary session (named <span class='inlinecode'>T....</span>), I may decide that I want to keep this session around. I have to rename the session to prevent the cleanup function from doing its thing. That's, as mentioned already, easily accomplished with the standard <span class='inlinecode'>prefix-key $</span> Tmux command.</span><br /> <br /> -<h2 style='display: inline' id='ThetaaliasAttachingtoasession'>The <span class='inlinecode'>ta</span> alias - Attaching to a session</h2><br /> +<h2 style='display: inline' id='the-ta-alias---attaching-to-a-session'>The <span class='inlinecode'>ta</span> alias - Attaching to a session</h2><br /> <br /> <span>This alias refers to the following function, which tries to attach to an already-running Tmux session.</span><br /> <br /> @@ -827,21 +3304,21 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#7bc710">attach ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">readonly</font></b><font color="#ff0000"> </font><font color="#ff0000">session</font><font color="#F3E651">=</font><font color="#ff0000">$1</font> - -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> -z </font><font color="#bb00ff">"$session"</font><font color="#ff0000"> </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> tmux attach-session </font><font color="#F3E651">||</font><font color="#ff0000"> tmux</font><font color="#F3E651">::</font><font color="#ff0000">new</font> -<font color="#ff0000"> </font><b><font color="#ffffff">else</font></b> -<font color="#ff0000"> tmux attach-session -t </font><font color="#ff0000">$session</font><font color="#ff0000"> </font><font color="#F3E651">||</font><font color="#ff0000"> tmux</font><font color="#F3E651">::</font><font color="#ff0000">new </font><font color="#ff0000">$session</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> -<font color="#ff0000">}</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">ta</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#ff0000">attach</font> +<pre>tmux::attach () { + <b><u><font color="#000000">readonly</font></u></b> session=$1 + + <b><u><font color="#000000">if</font></u></b> [ -z <font color="#808080">"$session"</font> ]; <b><u><font color="#000000">then</font></u></b> + tmux attach-session || tmux::new + <b><u><font color="#000000">else</font></u></b> + tmux attach-session -t $session || tmux::new $session + <b><u><font color="#000000">fi</font></u></b> +} +<b><u><font color="#000000">alias</font></u></b> ta=tmux::attach </pre> <br /> <span>If no session is specified (as the argument of the function), it will try to attach to the first open session. If no Tmux server is running, it will create a new one with <span class='inlinecode'>tmux::new</span>. Otherwise, with a session name given as the argument, it will attach to it. If unsuccessful (e.g., the session doesn't exist), it will be created and attached to.</span><br /> <br /> -<h2 style='display: inline' id='ThetraliasForanestedremotesession'>The <span class='inlinecode'>tr</span> alias - For a nested remote session</h2><br /> +<h2 style='display: inline' id='the-tr-alias---for-a-nested-remote-session'>The <span class='inlinecode'>tr</span> alias - For a nested remote session</h2><br /> <br /> <span>This SSHs into the remote server specified and then, remotely on the server itself, starts a nested Tmux session. So we have one Tmux session on the local computer and, inside of it, an SSH connection to a remote server with a Tmux session running again. The benefit of this is that, in case my network connection breaks down, the next time I connect, I can continue my work on the remote server exactly where I left off. The session name is the name of the server being SSHed into. If a session like this already exists, it simply attaches to it.</span><br /> <br /> @@ -849,15 +3326,15 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#7bc710">remote ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">readonly</font></b><font color="#ff0000"> </font><font color="#ff0000">server</font><font color="#F3E651">=</font><font color="#ff0000">$1</font> -<font color="#ff0000"> tmux new -s </font><font color="#ff0000">$server</font><font color="#ff0000"> </font><font color="#bb00ff">"ssh -t $server 'tmux attach-session || tmux'"</font><font color="#ff0000"> </font><font color="#F3E651">||</font><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> tmux attach-session -d -t </font><font color="#ff0000">$server</font> -<font color="#ff0000">}</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">tr</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#ff0000">remote</font> +<pre>tmux::remote () { + <b><u><font color="#000000">readonly</font></u></b> server=$1 + tmux new -s $server <font color="#808080">"ssh -t $server 'tmux attach-session || tmux'"</font> || \ + tmux attach-session -d -t $server +} +<b><u><font color="#000000">alias</font></u></b> tr=tmux::remote </pre> <br /> -<h3 style='display: inline' id='ChangeoftheTmuxprefixforbetternesting'>Change of the Tmux prefix for better nesting</h3><br /> +<h3 style='display: inline' id='change-of-the-tmux-prefix-for-better-nesting'>Change of the Tmux prefix for better nesting</h3><br /> <br /> <span>To make nested Tmux sessions work smoothly, one must change the Tmux prefix key locally or remotely. By default, the Tmux prefix key is <span class='inlinecode'>Ctrl-b</span>, so <span class='inlinecode'>Ctrl-b $</span>, for example, renames the current session. To change the prefix key from the standard <span class='inlinecode'>Ctrl-b</span> to, for example, <span class='inlinecode'>Ctrl-g</span>, you must add this to the <span class='inlinecode'>tmux.conf</span>:</span><br /> <br /> @@ -869,7 +3346,7 @@ set-option -g prefix C-g <br /> <span>There might also be another way around this (without reconfiguring the prefix key), but that is cumbersome to use, as far as I remember. </span><br /> <br /> -<h2 style='display: inline' id='ThetsaliasSearchingsessionswithfuzzyfinder'>The <span class='inlinecode'>ts</span> alias - Searching sessions with fuzzy finder</h2><br /> +<h2 style='display: inline' id='the-ts-alias---searching-sessions-with-fuzzy-finder'>The <span class='inlinecode'>ts</span> alias - Searching sessions with fuzzy finder</h2><br /> <br /> <span>Despite the fact that with <span class='inlinecode'>tmux::cleanup_default</span>, I don't leave a huge mess with trillions of Tmux sessions flying around all the time, at times, it can become challenging to find exactly the session I am currently interested in. After a busy workday, I often end up with around twenty sessions on my laptop. This is where fuzzy searching for session names comes in handy, as I often don't remember the exact session names.</span><br /> <br /> @@ -877,15 +3354,15 @@ set-option -g prefix C-g by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#7bc710">search ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">session</font><font color="#F3E651">=</font><font color="#ff0000">$(</font><font color="#ff0000">tmux list-sessions </font><font color="#F3E651">|</font><font color="#ff0000"> fzf </font><font color="#F3E651">|</font><font color="#ff0000"> cut -d</font><font color="#F3E651">:</font><font color="#ff0000"> -f</font><font color="#bb00ff">1</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> -z </font><font color="#bb00ff">"$TMUX"</font><font color="#ff0000"> </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> tmux attach-session -t </font><font color="#ff0000">$session</font> -<font color="#ff0000"> </font><b><font color="#ffffff">else</font></b> -<font color="#ff0000"> tmux switch -t </font><font color="#ff0000">$session</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> -<font color="#ff0000">}</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">ts</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#ff0000">search</font> +<pre>tmux::search () { + <b><u><font color="#000000">local</font></u></b> -r session=$(tmux list-sessions | fzf | cut -d: -f<font color="#000000">1</font>) + <b><u><font color="#000000">if</font></u></b> [ -z <font color="#808080">"$TMUX"</font> ]; <b><u><font color="#000000">then</font></u></b> + tmux attach-session -t $session + <b><u><font color="#000000">else</font></u></b> + tmux switch -t $session + <b><u><font color="#000000">fi</font></u></b> +} +<b><u><font color="#000000">alias</font></u></b> ts=tmux::search </pre> <br /> <span>All it does is list all currently open sessions in <span class='inlinecode'>fzf</span>, where one of them can be searched and selected through fuzzy find, and then either switch (if already inside a session) to the other session or attach to the other session (if not yet in Tmux).</span><br /> @@ -894,7 +3371,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <a href='./terminal-multiplexing-with-tmux/tmux-session-fzf.png'><img alt='Tmux session fuzzy finder' title='Tmux session fuzzy finder' src='./terminal-multiplexing-with-tmux/tmux-session-fzf.png' /></a><br /> <br /> -<h2 style='display: inline' id='ThetsshaliasClusterSSHreplacement'>The <span class='inlinecode'>tssh</span> alias - Cluster SSH replacement</h2><br /> +<h2 style='display: inline' id='the-tssh-alias---cluster-ssh-replacement'>The <span class='inlinecode'>tssh</span> alias - Cluster SSH replacement</h2><br /> <br /> <span>Before I used Tmux, I was a heavy user of ClusterSSH, which allowed me to log in to multiple servers at once in a single terminal window and type and run commands on all of them in parallel.</span><br /> <br /> @@ -912,20 +3389,20 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#7bc710">cluster_ssh ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> -f </font><font color="#bb00ff">"$1"</font><font color="#ff0000"> </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> tmux</font><font color="#F3E651">::</font><font color="#ff0000">tssh_from_file </font><font color="#ff0000">$1</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> +<pre>tmux::cluster_ssh () { + <b><u><font color="#000000">if</font></u></b> [ -f <font color="#808080">"$1"</font> ]; <b><u><font color="#000000">then</font></u></b> + tmux::tssh_from_file $1 + <b><u><font color="#000000">return</font></u></b> + <b><u><font color="#000000">fi</font></u></b> -<font color="#ff0000"> tmux</font><font color="#F3E651">::</font><font color="#ff0000">tssh_from_argument </font><font color="#ff0000">$@</font> -<font color="#ff0000">}</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">tssh</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#ff0000">cluster_ssh</font> + tmux::tssh_from_argument $@ +} +<b><u><font color="#000000">alias</font></u></b> tssh=tmux::cluster_ssh </pre> <br /> <span>This function is just a wrapper around the more complex <span class='inlinecode'>tmux::tssh_from_file</span> and <span class='inlinecode'>tmux::tssh_from_argument</span> functions, as you have learned already. Most of the magic happens there.</span><br /> <br /> -<h3 style='display: inline' id='Thetmuxtsshfromargumenthelper'>The <span class='inlinecode'>tmux::tssh_from_argument</span> helper</h3><br /> +<h3 style='display: inline' id='the-tmuxtsshfromargument-helper'>The <span class='inlinecode'>tmux::tssh_from_argument</span> helper</h3><br /> <br /> <span>This is the most magic helper function we will cover in this post. It looks like this:</span><br /> <br /> @@ -933,23 +3410,23 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#7bc710">tssh_from_argument ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">session</font><font color="#F3E651">=</font><font color="#ff0000">$1</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">shift</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> </font><font color="#ff0000">first_server</font><font color="#F3E651">=</font><font color="#ff0000">$1</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">shift</font></b> - -<font color="#ff0000"> tmux new-session -d -s </font><font color="#ff0000">$session</font><font color="#ff0000"> </font><font color="#bb00ff">"ssh -t $first_server"</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">!</font><font color="#ff0000"> tmux list-session </font><font color="#F3E651">|</font><font color="#ff0000"> grep </font><font color="#bb00ff">"^$session:"</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> echo </font><font color="#bb00ff">"Could not create session $session"</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> </font><font color="#bb00ff">2</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> - -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> server </font><b><font color="#ffffff">in</font></b><font color="#ff0000"> </font><font color="#bb00ff">"${@[@]}"</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">do</font></b> -<font color="#ff0000"> tmux split-window -t </font><font color="#ff0000">$session</font><font color="#ff0000"> </font><font color="#bb00ff">"tmux select-layout tiled; ssh -t $server"</font> -<font color="#ff0000"> </font><b><font color="#ffffff">done</font></b> - -<font color="#ff0000"> tmux setw -t </font><font color="#ff0000">$session</font><font color="#ff0000"> synchronize-panes on</font> -<font color="#ff0000"> tmux -</font><font color="#bb00ff">2</font><font color="#ff0000"> attach-session -t </font><font color="#ff0000">$session</font><font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> tmux -</font><font color="#bb00ff">2</font><font color="#ff0000"> switch-client -t </font><font color="#ff0000">$session</font> -<font color="#ff0000">}</font> +<pre>tmux::tssh_from_argument () { + <b><u><font color="#000000">local</font></u></b> -r session=$1; <b><u><font color="#000000">shift</font></u></b> + <b><u><font color="#000000">local</font></u></b> first_server=$1; <b><u><font color="#000000">shift</font></u></b> + + tmux new-session -d -s $session <font color="#808080">"ssh -t $first_server"</font> + <b><u><font color="#000000">if</font></u></b> ! tmux list-session | grep <font color="#808080">"^$session:"</font>; <b><u><font color="#000000">then</font></u></b> + echo <font color="#808080">"Could not create session $session"</font> + <b><u><font color="#000000">return</font></u></b> <font color="#000000">2</font> + <b><u><font color="#000000">fi</font></u></b> + + <b><u><font color="#000000">for</font></u></b> server <b><u><font color="#000000">in</font></u></b> <font color="#808080">"${@[@]}"</font>; <b><u><font color="#000000">do</font></u></b> + tmux split-window -t $session <font color="#808080">"tmux select-layout tiled; ssh -t $server"</font> + <b><u><font color="#000000">done</font></u></b> + + tmux setw -t $session synchronize-panes on + tmux -<font color="#000000">2</font> attach-session -t $session | tmux -<font color="#000000">2</font> switch-client -t $session +} </pre> <br /> <span>It expects at least two arguments. The first argument is the session name to create for the clustered SSH session. All other arguments are server hostnames or FQDNs to which to connect. The first one is used to make the initial session. All remaining ones are added to that session with <span class='inlinecode'>tmux split-window -t $session...</span>. At the end, we enable synchronized panes by default, so whenever you type, the commands will be sent to every SSH connection, thus allowing the neat ClusterSSH feature to run commands on multiple servers simultaneously. Once done, we attach (or switch, if already in Tmux) to it.</span><br /> @@ -961,7 +3438,7 @@ bind-key p setw synchronize-panes off bind-key P setw synchronize-panes on </pre> <br /> -<h3 style='display: inline' id='Thetmuxtsshfromfilehelper'>The <span class='inlinecode'>tmux::tssh_from_file</span> helper</h3><br /> +<h3 style='display: inline' id='the-tmuxtsshfromfile-helper'>The <span class='inlinecode'>tmux::tssh_from_file</span> helper</h3><br /> <br /> <span>This one sets the session name to the file name and then reads a list of servers from that file, passing the list of servers to <span class='inlinecode'>tmux::tssh_from_argument</span> as the arguments. So, this is a neat little wrapper that also enables me to open clustered SSH sessions from an input file.</span><br /> <br /> @@ -969,15 +3446,15 @@ bind-key P setw synchronize-panes on by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#7bc710">tssh_from_file ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">serverlist</font><font color="#F3E651">=</font><font color="#ff0000">$1</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">shift</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">session</font><font color="#F3E651">=</font><font color="#ff0000">$(</font><font color="#ff0000">basename </font><font color="#ff0000">$serverlist</font><font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> cut -d</font><font color="#F3E651">.</font><font color="#ff0000"> -f</font><font color="#bb00ff">1</font><font color="#F3E651">)</font> +<pre>tmux::tssh_from_file () { + <b><u><font color="#000000">local</font></u></b> -r serverlist=$1; <b><u><font color="#000000">shift</font></u></b> + <b><u><font color="#000000">local</font></u></b> -r session=$(basename $serverlist | cut -d. -f<font color="#000000">1</font>) -<font color="#ff0000"> tmux</font><font color="#F3E651">::</font><font color="#ff0000">tssh_from_argument </font><font color="#ff0000">$session</font><font color="#ff0000"> </font><font color="#ff0000">$(</font><font color="#ff0000">awk </font><font color="#bb00ff">'{ print $1} '</font><font color="#ff0000"> </font><font color="#ff0000">$serverlist</font><font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> sed </font><font color="#bb00ff">'s/.lan./.lan/g'</font><font color="#F3E651">)</font> -<font color="#ff0000">}</font> + tmux::tssh_from_argument $session $(awk <font color="#808080">'{ print $1} '</font> $serverlist | sed <font color="#808080">'s/.lan./.lan/g'</font>) +} </pre> <br /> -<h3 style='display: inline' id='tsshexamples'><span class='inlinecode'>tssh</span> examples</h3><br /> +<h3 style='display: inline' id='tssh-examples'><span class='inlinecode'>tssh</span> examples</h3><br /> <br /> <span>To open a new session named <span class='inlinecode'>fish</span> and log in to 4 remote hosts, run this command (Note that it is also possible to specify the remote user):</span><br /> <br /> @@ -992,7 +3469,7 @@ $ tssh fish blowfish.buetow.org fishfinger.buetow.org \ $ tssh manyservers.txt </pre> <br /> -<h3 style='display: inline' id='CommonTmuxcommandsIuseintssh'>Common Tmux commands I use in <span class='inlinecode'>tssh</span></h3><br /> +<h3 style='display: inline' id='common-tmux-commands-i-use-in-tssh'>Common Tmux commands I use in <span class='inlinecode'>tssh</span></h3><br /> <br /> <span>These are default Tmux commands that I make heavy use of in a <span class='inlinecode'>tssh</span> session:</span><br /> <br /> @@ -1001,7 +3478,7 @@ $ tssh manyservers.txt <li>Press <span class='inlinecode'>prefix-key <space></span> to change the pane layout (can be pressed multiple times to cycle through them).</li> <li>Press <span class='inlinecode'>prefix-key z</span> to zoom in and out of the current active pane.</li> </ul><br /> -<h2 style='display: inline' id='Copyandpasteworkflow'>Copy and paste workflow</h2><br /> +<h2 style='display: inline' id='copy-and-paste-workflow'>Copy and paste workflow</h2><br /> <br /> <span>As you will see later in this blog post, I have configured a history limit of 1 million items in Tmux so that I can scroll back quite far. One main workflow of mine is to search for text in the Tmux history, select and copy it, and then switch to another window or session and paste it there (e.g., into my text editor to do something with it).</span><br /> <br /> @@ -1020,7 +3497,7 @@ bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel <br /> <span>Once the text is yanked, I switch to another Tmux window or session where, for example, a text editor is running and paste the yanked text from Tmux into the editor with <span class='inlinecode'>prefix-key ]</span>. Note that when pasting into a modal text editor like Vi or Helix, you would first need to enter insert mode before <span class='inlinecode'>prefix-key ]</span> would paste anything.</span><br /> <br /> -<h2 style='display: inline' id='Tmuxconfigurations'>Tmux configurations</h2><br /> +<h2 style='display: inline' id='tmux-configurations'>Tmux configurations</h2><br /> <br /> <span>Some features I have configured directly in Tmux don't require an external shell alias to function correctly. Let's walk line by line through my local <span class='inlinecode'>~/.config/tmux/tmux.conf</span>:</span><br /> <br /> @@ -1110,13 +3587,15 @@ bind-key r source-file ~/.config/tmux/tmux.conf \; display-message "tmux.conf re <name>Paul Buetow aka snonux</name> <email>paul@dev.buetow.org</email> </author> - <summary>Art by Laura Brown</summary> + <summary>Over the years, I have collected many ideas for my personal projects and noted them down. I am currently in the process of cleaning up all my notes and reviewing those ideas. I don’t have time for the ones listed here and won’t have any soon due to other commitments and personal projects. So, in order to 'get rid of them' from my notes folder, I decided to simply put them in this blog post so that those ideas don't get lost. Maybe I will pick up one or another idea someday in the future, but for now, they are all put on ice in favor of other personal projects or family time.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='ProjectsIcurrentlydonthavetimefor'>Projects I currently don't have time for</h1><br /> + <h1 style='display: inline' id='projects-i-currently-don-t-have-time-for'>Projects I currently don't have time for</h1><br /> <br /> <span class='quote'>Published at 2024-05-03T16:23:03+03:00</span><br /> <br /> +<span>Over the years, I have collected many ideas for my personal projects and noted them down. I am currently in the process of cleaning up all my notes and reviewing those ideas. I don’t have time for the ones listed here and won’t have any soon due to other commitments and personal projects. So, in order to "get rid of them" from my notes folder, I decided to simply put them in this blog post so that those ideas don't get lost. Maybe I will pick up one or another idea someday in the future, but for now, they are all put on ice in favor of other personal projects or family time.</span><br /> +<br /> <pre> Art by Laura Brown @@ -1130,58 +3609,51 @@ Art by Laura Brown </pre> <br /> -<h2 style='display: inline' id='Introduction'>Introduction</h2><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<span>Over the years, I have collected many ideas for my personal projects and noted them down. I am currently in the process of cleaning up all my notes and reviewing those ideas. I don’t have time for the ones listed here and won’t have any soon due to other commitments and personal projects. So, in order to "get rid of them" from my notes folder, I decided to simply put them in this blog post so that those ideas don't get lost. Maybe I will pick up one or another idea someday in the future, but for now, they are all put on ice in favor of other personal projects or family time.</span><br /> +<ul> +<li><a href='#projects-i-currently-don-t-have-time-for'>Projects I currently don't have time for</a></li> +<li>⇢ <a href='#hardware-projects-i-don-t-have-time-for'>Hardware projects I don't have time for</a></li> +<li>⇢ ⇢ <a href='#i-use-arch-btw'>I use Arch, btw!</a></li> +<li>⇢ ⇢ <a href='#openbsd-home-router'>OpenBSD home router</a></li> +<li>⇢ ⇢ <a href='#pi-hole-server'>Pi-Hole server</a></li> +<li>⇢ ⇢ <a href='#infodash'>Infodash</a></li> +<li>⇢ ⇢ <a href='#reading-station'>Reading station</a></li> +<li>⇢ ⇢ <a href='#retro-station'>Retro station</a></li> +<li>⇢ ⇢ <a href='#sound-server'>Sound server</a></li> +<li>⇢ ⇢ <a href='#project-freekat'>Project Freekat</a></li> +<li>⇢ <a href='#programming-projects-i-don-t-have-time-for'>Programming projects I don't have time for</a></li> +<li>⇢ ⇢ <a href='#cli-hive'>CLI-HIVE</a></li> +<li>⇢ ⇢ <a href='#enhanced-kiss-home-photo-albums'>Enhanced KISS home photo albums</a></li> +<li>⇢ ⇢ <a href='#kiss-file-sync-server-with-end-to-end-encryption'>KISS file sync server with end-to-end encryption</a></li> +<li>⇢ ⇢ <a href='#a-language-that-compiles-to-bash'>A language that compiles to <span class='inlinecode'>bash</span></a></li> +<li>⇢ ⇢ <a href='#a-language-that-compiles-to-sed'>A language that compiles to <span class='inlinecode'>sed</span></a></li> +<li>⇢ ⇢ <a href='#renovate-vs-sim'>Renovate VS-Sim</a></li> +<li>⇢ ⇢ <a href='#kiss-ticketing-system'>KISS ticketing system</a></li> +<li>⇢ ⇢ <a href='#a-domain-specific-language-dsl-for-work'>A domain-specific language (DSL) for work</a></li> +<li>⇢ <a href='#self-hosting-projects-i-don-t-have-time-for'>Self-hosting projects I don't have time for</a></li> +<li>⇢ ⇢ <a href='#my-own-matrix-server'>My own Matrix server</a></li> +<li>⇢ ⇢ <a href='#ampache-music-server'>Ampache music server</a></li> +<li>⇢ ⇢ <a href='#librum-ebook-reader'>Librum eBook reader</a></li> +<li>⇢ ⇢ <a href='#memos---note-taking-service'>Memos - Note-taking service</a></li> +<li>⇢ ⇢ <a href='#bepasty-server'>Bepasty server</a></li> +<li>⇢ <a href='#books-i-don-t-have-time-to-read'>Books I don't have time to read</a></li> +<li>⇢ ⇢ <a href='#fluent-python'>Fluent Python</a></li> +<li>⇢ ⇢ <a href='#programming-ruby'>Programming Ruby</a></li> +<li>⇢ ⇢ <a href='#peter-f-hamilton-science-fiction-books'>Peter F. Hamilton science fiction books</a></li> +<li>⇢ <a href='#new-websites-i-don-t-have-time-for'>New websites I don't have time for</a></li> +<li>⇢ ⇢ <a href='#create-a-why-raku-rox-site'>Create a "Why Raku Rox" site</a></li> +<li>⇢ <a href='#research-projects-i-don-t-have-time-for'>Research projects I don't have time for</a></li> +<li>⇢ ⇢ <a href='#project-secure'>Project secure</a></li> +<li>⇢ ⇢ <a href='#cpu-utilisation-is-all-wrong'>CPU utilisation is all wrong</a></li> +</ul><br /> +<h2 style='display: inline' id='hardware-projects-i-don-t-have-time-for'>Hardware projects I don't have time for</h2><br /> <br /> -<pre> -Table of contents -================= - -Projects I currently don't have time for - Introduction - Hardware projects I don't have time for - I use Arch, btw! - OpenBSD home router - Pi-Hole server - Infodash - Reading station - Retro station - Sound server - Project Freekat - Programming projects I don't have time for - CLI-HIVE - Enhanced KISS home photo albums - KISS file sync server with end-to-end encryption - A language that compiles to `bash` - A language that compiles to `sed` - Renovate VS-Sim - KISS ticketing system - A domain-specific language (DSL) for work - Self-hosting projects I don't have time for - My own Matrix server - Ampache music server - Librum eBook reader - Memos - Note-taking service - Bepasty server - Books I don't have time to read - Fluent Python - Programming Ruby - Peter F. Hamilton science fiction books - New websites I don't have time for - Create a "Why Raku Rox" site - Research projects I don't have time for - Project secure - CPU utilisation is all wrong -</pre> -<br /> -<h2 style='display: inline' id='HardwareprojectsIdonthavetimefor'>Hardware projects I don't have time for</h2><br /> -<br /> -<h3 style='display: inline' id='IuseArchbtw'>I use Arch, btw!</h3><br /> +<h3 style='display: inline' id='i-use-arch-btw'>I use Arch, btw!</h3><br /> <br /> <span>The idea was to build the ultimate Arch Linux setup on an old ThinkPad X200 booting with the open-source LibreBoot firmware, complete with a tiling window manager, dmenu, and all the elite tools. This is mainly for fun, as I am pretty happy (and productive) with my Fedora Linux setup. I ran EndeavourOS (close enough to Arch) on an old ThinkPad for a while, but then I switched back to Fedora because the rolling releases were annoying (there were too many updates).</span><br /> <br /> -<h3 style='display: inline' id='OpenBSDhomerouter'>OpenBSD home router</h3><br /> +<h3 style='display: inline' id='openbsd-home-router'>OpenBSD home router</h3><br /> <br /> <span>In my student days, I operated a 486DX PC with OpenBSD as my home DSL internet router. I bought the setup from my brother back then. The router's hostname was <span class='inlinecode'>fishbone</span>, and it performed very well until it became too slow for larger broadband bandwidth after a few years of use.</span><br /> <br /> @@ -1196,23 +3668,23 @@ Projects I currently don't have time for <br /> <a class='textlink' href='https://OpenWRT.org/'>https://OpenWRT.org/</a><br /> <br /> -<h3 style='display: inline' id='PiHoleserver'>Pi-Hole server</h3><br /> +<h3 style='display: inline' id='pi-hole-server'>Pi-Hole server</h3><br /> <br /> <span>Install Pi-hole on one of my Pis or run it in a container on Freekat. For now, I am putting this on hold as the primary use for this would be ad-blocking, and I am avoiding surfing ad-heavy sites anyway. So there's no significant use for me personally at the moment.</span><br /> <br /> <a class='textlink' href='https://pi-hole.net/'>https://pi-hole.net/</a><br /> <br /> -<h3 style='display: inline' id='Infodash'>Infodash</h3><br /> +<h3 style='display: inline' id='infodash'>Infodash</h3><br /> <br /> <span>The idea was to implement my smart info screen using purely open-source software. It would display information such as the health status of my personal infrastructure, my current work tracker balance (I track how much I work to prevent overworking), and my sports balance (I track my workouts to stay within my quotas for general health). The information would be displayed on a small screen in my home office, on my Pine watch, or remotely from any terminal window.</span><br /> <br /> <span>I don't have this, and I haven't missed having it, so I guess it would have been nice to have it but not provide any value other than the "fun of tinkering."</span><br /> <br /> -<h3 style='display: inline' id='Readingstation'>Reading station</h3><br /> +<h3 style='display: inline' id='reading-station'>Reading station</h3><br /> <br /> <span>I wanted to create the most comfortable setup possible for reading digital notes, articles, and books. This would include a comfy armchair, a silent barebone PC or Raspberry Pi computer running either Linux or *BSD, and an e-Ink display mounted on a flexible arm/stand. There would also be a small table for my paper journal for occasional note-taking. There are a bunch of open-source software available for PDF and ePub reading. It would have been neat, but I am currently using the most straightforward solution: a Kobo Elipsa 2E, which I can use on my sofa.</span><br /> <br /> -<h3 style='display: inline' id='Retrostation'>Retro station</h3><br /> +<h3 style='display: inline' id='retro-station'>Retro station</h3><br /> <br /> <span>I had an idea to build a computer infused with retro elements. It wouldn't use actual retro hardware but would look and feel like a retro machine. I would call this machine HAL or Retron.</span><br /> <br /> @@ -1224,14 +3696,14 @@ Projects I currently don't have time for <br /> <span>The computer would occasionally be used to surf the Gemini space, take notes, blog, or do light coding. However, I have abandoned the project for now because there isn't enough space in my apartment, as my daughter will have a room for herself.</span><br /> <br /> -<h3 style='display: inline' id='Soundserver'>Sound server</h3><br /> +<h3 style='display: inline' id='sound-server'>Sound server</h3><br /> <br /> <span>My idea involved using a barebone mini PC running FreeBSD with the Navidrome sound server software. I could remotely connect to it from my phone, workstation/laptop to listen to my music collection. The storage would be based on ZFS with at least two drives for redundancy. The app would run in a Linux Docker container under FreeBSD via Bhyve.</span><br /> <br /> <a class='textlink' href='https://github.com/navidrome/navidrome'>https://github.com/navidrome/navidrome</a><br /> <a class='textlink' href='https://wiki.freebsd.org/bhyve'>https://wiki.freebsd.org/bhyve</a><br /> <br /> -<h3 style='display: inline' id='ProjectFreekat'>Project Freekat</h3><br /> +<h3 style='display: inline' id='project-freekat'>Project Freekat</h3><br /> <br /> <span>My idea involved purchasing the Meerkat mini PC from System76 and installing FreeBSD. Like the sound-server idea (see previous idea), it would run Linux Docker through Bhyve. I would self-host a bunch of applications on it:</span><br /> <br /> @@ -1255,15 +3727,15 @@ Projects I currently don't have time for <br /> <a class='textlink' href='./2024-02-04-from-babylon5.buetow.org-to-.cloud.html'>My personal AWS setup</a><br /> <br /> -<h2 style='display: inline' id='ProgrammingprojectsIdonthavetimefor'>Programming projects I don't have time for</h2><br /> +<h2 style='display: inline' id='programming-projects-i-don-t-have-time-for'>Programming projects I don't have time for</h2><br /> <br /> -<h3 style='display: inline' id='CLIHIVE'>CLI-HIVE</h3><br /> +<h3 style='display: inline' id='cli-hive'>CLI-HIVE</h3><br /> <br /> <span>This was a pet project idea that my brother and I had. The concept was to collect all shell history of all servers at work in a central place, apply ML/AI, and return suggestions for commands to type or allow a fuzzy search on all the commands in the history. The recommendations for the commands on a server could be context-based (e.g., past occurrences on the same server type). </span><br /> <br /> <span>You could decide whether to share your command history with others so they would receive better suggestions depending on which server they are on, or you could keep all the history private and secure. The plan was to add hooks into zsh and bash shells so that all commands typed would be pushed to the central location for data mining.</span><br /> <br /> -<h3 style='display: inline' id='EnhancedKISShomephotoalbums'>Enhanced KISS home photo albums</h3><br /> +<h3 style='display: inline' id='enhanced-kiss-home-photo-albums'>Enhanced KISS home photo albums</h3><br /> <br /> <span>I don't use third-party cloud providers such as Google Photos to store/archive my photos. Instead, they are all on a ZFS volume on my home NAS, with regular offsite backups taken. Thus, my project would involve implementing the features I miss most or finding a solution simple enough to host on my LAN:</span><br /> <br /> @@ -1275,7 +3747,7 @@ Projects I currently don't have time for </ul><br /> <a class='textlink' href='./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.html'>KISS static web photo albums with <span class='inlinecode'>photoalbum.sh</span></a><br /> <br /> -<h3 style='display: inline' id='KISSfilesyncserverwithendtoendencryption'>KISS file sync server with end-to-end encryption</h3><br /> +<h3 style='display: inline' id='kiss-file-sync-server-with-end-to-end-encryption'>KISS file sync server with end-to-end encryption</h3><br /> <br /> <span>I aimed to have a simple server to which I could sync notes and other documents, ensuring that the data is fully end-to-end encrypted. This way, only the clients could decrypt the data, while an encrypted copy of all the data would be stored on the server side. There are a few solutions (e.g., NextCloud), but they are bloated or complex to set up. </span><br /> <br /> @@ -1285,7 +3757,7 @@ Projects I currently don't have time for <br /> <span>I also had the idea of using this as a pet project for work and naming it <span class='inlinecode'>Cryptolake</span>, utilizing post-quantum-safe encryption algorithms and a distributed data store.</span><br /> <br /> -<h3 style='display: inline' id='Alanguagethatcompilestobash'>A language that compiles to <span class='inlinecode'>bash</span></h3><br /> +<h3 style='display: inline' id='a-language-that-compiles-to-bash'>A language that compiles to <span class='inlinecode'>bash</span></h3><br /> <br /> <span>I had an idea to implement a higher-level language with strong typing that could be compiled into native Bash code. This would make all resulting Bash scripts more robust and secure by default. The project would involve developing a parser, lexer, and a Bash code generator. I planned to implement this in Go.</span><br /> <br /> @@ -1293,11 +3765,11 @@ Projects I currently don't have time for <br /> <a class='textlink' href='./2010-05-09-the-fype-programming-language.html'>The Fype Programming Language</a><br /> <br /> -<h3 style='display: inline' id='Alanguagethatcompilestosed'>A language that compiles to <span class='inlinecode'>sed</span></h3><br /> +<h3 style='display: inline' id='a-language-that-compiles-to-sed'>A language that compiles to <span class='inlinecode'>sed</span></h3><br /> <br /> <span>This is similar to the previous idea, but the difference is that the language would compile into a sed script. Sed has many features, but the brief syntax makes scripts challenging to read. The higher-level language would mimic sed but in a form that is easier for humans to read.</span><br /> <br /> -<h3 style='display: inline' id='RenovateVSSim'>Renovate VS-Sim</h3><br /> +<h3 style='display: inline' id='renovate-vs-sim'>Renovate VS-Sim</h3><br /> <br /> <span>VS-Sim is an open-source simulator programmed in Java for distributed systems. VS-Sim stands for "Verteilte Systeme Simulator," the German translation for "Distributed Systems Simulator." The VS-Sim project was my diploma thesis at Aachen University of Applied Sciences.</span><br /> <br /> @@ -1313,13 +3785,13 @@ Projects I currently don't have time for </ul><br /> <span>I have put this project on hold for now, as I want to do more things in Go and fewer in Java in my personal time.</span><br /> <br /> -<h3 style='display: inline' id='KISSticketingsystem'>KISS ticketing system</h3><br /> +<h3 style='display: inline' id='kiss-ticketing-system'>KISS ticketing system</h3><br /> <br /> <span>My idea was to program a KISS (Keep It Simple, Stupid) ticketing system for my personal use. However, I am abandoning this project because I now use the excellent Taskwarrior software. You can learn more about it at:</span><br /> <br /> <a class='textlink' href='https://taskwarrior.org/'>https://taskwarrior.org/</a><br /> <br /> -<h3 style='display: inline' id='AdomainspecificlanguageDSLforwork'>A domain-specific language (DSL) for work</h3><br /> +<h3 style='display: inline' id='a-domain-specific-language-dsl-for-work'>A domain-specific language (DSL) for work</h3><br /> <br /> <span>At work, an internal service allocates storage space for our customers on our storage clusters. It automates many tasks, but many tweaks are accessible through APIs. I had the idea to implement a Ruby-based DSL that would make using all those APIs for ad-hoc changes effortless, e.g.:</span><br /> <br /> @@ -1327,31 +3799,31 @@ Projects I currently don't have time for by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">Cluster </font><font color="#F3E651">:</font><font color="#ff0000">UK</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#F3E651">:</font><font color="#ff0000">uk01 </font><b><font color="#ffffff">do</font></b> -<font color="#ff0000"> Customer</font><font color="#F3E651">.</font><font color="#ff0000">C1A1</font><font color="#F3E651">.</font><font color="#ff0000">segments</font><font color="#F3E651">.</font><font color="#ff0000">volumes</font><font color="#F3E651">.</font><font color="#ff0000">each </font><b><font color="#ffffff">do</font></b><font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000">volume</font><font color="#F3E651">|</font> -<font color="#ff0000"> puts volume</font><font color="#F3E651">.</font><font color="#ff0000">usage_stats</font> -<font color="#ff0000"> volume</font><font color="#F3E651">.</font><font color="#ff0000">move_off! </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> volume</font><font color="#F3E651">.</font><font color="#ff0000">over_subscribed?</font> -<font color="#ff0000"> </font><b><font color="#ffffff">end</font></b> -<b><font color="#ffffff">end</font></b> +<pre>Cluster :UK, :uk01 <b><u><font color="#000000">do</font></u></b> + Customer.C1A1.segments.volumes.each <b><u><font color="#000000">do</font></u></b> |volume| + puts volume.usage_stats + volume.move_off! <b><u><font color="#000000">if</font></u></b> volume.over_subscribed? + <b><u><font color="#000000">end</font></u></b> +<b><u><font color="#000000">end</font></u></b> </pre> <br /> <span>I am abandoning this project because my workplace has stopped the annual pet project competition, and I have other more important projects to work on at the moment.</span><br /> <br /> <a class='textlink' href='./2022-04-10-creative-universe.html'>Creative universe (Work pet project contests)</a><br /> <br /> -<h2 style='display: inline' id='SelfhostingprojectsIdonthavetimefor'>Self-hosting projects I don't have time for</h2><br /> +<h2 style='display: inline' id='self-hosting-projects-i-don-t-have-time-for'>Self-hosting projects I don't have time for</h2><br /> <br /> -<h3 style='display: inline' id='MyownMatrixserver'>My own Matrix server</h3><br /> +<h3 style='display: inline' id='my-own-matrix-server'>My own Matrix server</h3><br /> <br /> <span>I value privacy. It would be great to run my own Matrix server for communication within my family. I have yet to have time to look into this more closely.</span><br /> <br /> <a class='textlink' href='https://matrix.org'>https://matrix.org</a><br /> <br /> -<h3 style='display: inline' id='Ampachemusicserver'>Ampache music server</h3><br /> +<h3 style='display: inline' id='ampache-music-server'>Ampache music server</h3><br /> <br /> <span>Ampache is an open-source music streaming server that allows you to host and manage your music collection online, accessible via a web interface. Setting it up involves configuring a web server, installing Ampache, and organising your music files, which can be time-consuming. </span><br /> <br /> -<h3 style='display: inline' id='LibrumeBookreader'>Librum eBook reader</h3><br /> +<h3 style='display: inline' id='librum-ebook-reader'>Librum eBook reader</h3><br /> <br /> <span>Librum is a self-hostable e-book reader that allows users to manage and read their e-book collection from a web interface. Designed to be a self-contained platform where users can upload, organise, and access their e-books, Librum emphasises privacy and control over one's digital library.</span><br /> <br /> @@ -1359,7 +3831,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>I am using my Kobo devices or my laptop to read these kinds of things for now.</span><br /> <br /> -<h3 style='display: inline' id='MemosNotetakingservice'>Memos - Note-taking service</h3><br /> +<h3 style='display: inline' id='memos---note-taking-service'>Memos - Note-taking service</h3><br /> <br /> <span>Memos is a note-taking service that simplifies and streamlines information capture and organisation. It focuses on providing users with a minimalistic and intuitive interface, aiming to enhance productivity without the clutter commonly associated with more complex note-taking apps.</span><br /> <br /> @@ -1367,27 +3839,27 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>I am abandoning this idea for now, as I am currently using plain Markdown files for notes and syncing them with Syncthing across my devices.</span><br /> <br /> -<h3 style='display: inline' id='Bepastyserver'>Bepasty server</h3><br /> +<h3 style='display: inline' id='bepasty-server'>Bepasty server</h3><br /> <br /> <span>Bepasty is like a Pastebin for all kinds of files (text, image, audio, video, documents, binary, etc.). It seems very neat, but I only share a little nowadays. When I do, I upload files via SCP to one of my OpenBSD VMs and serve them via vanilla httpd there, keeping it KISS.</span><br /> <br /> <a class='textlink' href='https://github.com/bepasty/bepasty-server'>https://github.com/bepasty/bepasty-server</a><br /> <br /> -<h2 style='display: inline' id='BooksIdonthavetimetoread'>Books I don't have time to read</h2><br /> +<h2 style='display: inline' id='books-i-don-t-have-time-to-read'>Books I don't have time to read</h2><br /> <br /> -<h3 style='display: inline' id='FluentPython'>Fluent Python</h3><br /> +<h3 style='display: inline' id='fluent-python'>Fluent Python</h3><br /> <br /> <span>I consider myself an advanced programmer in Ruby, Bash, and Perl. However, Python seems to be ubiquitous nowadays, and most of my colleagues prefer Python over any other languages. Thus, it makes sense for me to also learn and use Python. After conducting some research, "Fluent Python" appears to be the best book for this purpose.</span><br /> <br /> <span>I don't have time to read this book at the moment, as I am focusing more on Go (Golang) and I know just enough Python to get by (e.g., for code reviews). Additionally, there are still enough colleagues around who can review my Ruby or Bash code.</span><br /> <br /> -<h3 style='display: inline' id='ProgrammingRuby'>Programming Ruby</h3><br /> +<h3 style='display: inline' id='programming-ruby'>Programming Ruby</h3><br /> <br /> <span>I've read a couple of Ruby books already, but "Programming Ruby," which covers up to Ruby 3.2, was just recently released. I would like to read this to deepen my Ruby knowledge further and to revisit some concepts that I may have forgotten.</span><br /> <br /> <span>As stated in this blog post, I am currently more eager to focus on Go, so I've put the Ruby book on hold. Additionally, there wouldn't be enough colleagues who could "understand" my advanced Ruby skills anyway, as most of them are either Java developers or SREs who don't code a lot.</span><br /> <br /> -<h3 style='display: inline' id='PeterFHamiltonsciencefictionbooks'>Peter F. Hamilton science fiction books</h3><br /> +<h3 style='display: inline' id='peter-f-hamilton-science-fiction-books'>Peter F. Hamilton science fiction books</h3><br /> <br /> <span>I am a big fan of science fiction, but my reading list is currently too long anyway. So, I've put the Hamilton books on the back burner for now. You can see all the novels I've read here:</span><br /> <br /> @@ -1395,9 +3867,9 @@ http://www.gnu.org/software/src-highlite --> <a class='textlink' href='gemini://paul.buetow.org/novels.gmi'>gemini://paul.buetow.org/novels.gmi</a><br /> <br /> <br /> -<h2 style='display: inline' id='NewwebsitesIdonthavetimefor'>New websites I don't have time for</h2><br /> +<h2 style='display: inline' id='new-websites-i-don-t-have-time-for'>New websites I don't have time for</h2><br /> <br /> -<h3 style='display: inline' id='CreateaWhyRakuRoxsite'>Create a "Why Raku Rox" site</h3><br /> +<h3 style='display: inline' id='create-a-why-raku-rox-site'>Create a "Why Raku Rox" site</h3><br /> <br /> <span>The website "Why Raku Rox" would showcase the unique features and benefits of the Raku programming language and highlight why it is an exceptional choice for developers. Raku, originally known as Perl 6, is a dynamic, expressive language designed for flexible and powerful software development.</span><br /> <br /> @@ -1408,9 +3880,9 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>I am not working on this for now, as I currently don’t even have time to program in Raku.</span><br /> <br /> -<h2 style='display: inline' id='ResearchprojectsIdonthavetimefor'>Research projects I don't have time for</h2><br /> +<h2 style='display: inline' id='research-projects-i-don-t-have-time-for'>Research projects I don't have time for</h2><br /> <br /> -<h3 style='display: inline' id='Projectsecure'>Project secure</h3><br /> +<h3 style='display: inline' id='project-secure'>Project secure</h3><br /> <br /> <span>For work: Implement a PoC that dumps Java heaps to extract secrets from memory. Based on the findings, write a Java program that encrypts secrets in the kernel using the <span class='inlinecode'>memfd_secret()</span> syscall to make it even more secure.</span><br /> <br /> @@ -1418,7 +3890,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Due to other priorities, I am putting this on hold for now. The software we have built is pretty damn secure already!</span><br /> <br /> -<h3 style='display: inline' id='CPUutilisationisallwrong'>CPU utilisation is all wrong</h3><br /> +<h3 style='display: inline' id='cpu-utilisation-is-all-wrong'>CPU utilisation is all wrong</h3><br /> <br /> <span>This research project, based on Brendan Gregg's blog post, could potentially significantly impact my work.</span><br /> <br /> @@ -1448,7 +3920,7 @@ http://www.gnu.org/software/src-highlite --> <summary>These are my personal takeaways after reading 'Slow Productivity - The lost Art of Accomplishment Without Burnout' by Cal Newport.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='SlowProductivitybooknotes'>"Slow Productivity" book notes</h1><br /> + <h1 style='display: inline' id='slow-productivity-book-notes'>"Slow Productivity" book notes</h1><br /> <br /> <span class='quote'>Published at 2024-04-27T14:18:51+03:00</span><br /> <br /> @@ -1470,9 +3942,22 @@ http://www.gnu.org/software/src-highlite --> ''' </pre> <br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#slow-productivity-book-notes'>"Slow Productivity" book notes</a></li> +<li>⇢ <a href='#it-s-not-slow-productivity'>It's not "slow productivity"</a></li> +<li>⇢ <a href='#pseudo-productivity-and-shallow-work'>Pseudo-productivity and Shallow work</a></li> +<li>⇢ <a href='#accomplishments-without-burnout'>Accomplishments without burnout</a></li> +<li>⇢ <a href='#do-fewer-things'>Do fewer things</a></li> +<li>⇢ <a href='#work-at-a-natural-pace'>Work at a natural pace</a></li> +<li>⇢ <a href='#obsess-over-quality-'>Obsess over quality </a></li> +</ul><br /> +<h2 style='display: inline' id='it-s-not-slow-productivity'>It's not "slow productivity"</h2><br /> +<br /> <span>"Slow productivity" does not mean being less productive. Cal Newport wants to point out that you can be much more productive with "slow productivity" than you would be without it. It is a different way of working than most of us are used to in the modern workplace, which is hyper-connected and always online.</span><br /> <br /> -<h2 style='display: inline' id='PseudoproductivityandShallowwork'>Pseudo-productivity and Shallow work</h2><br /> +<h2 style='display: inline' id='pseudo-productivity-and-shallow-work'>Pseudo-productivity and Shallow work</h2><br /> <br /> <span>People use visible activity instead of real productivity because it's easier to measure. This is called pseudo-productivity.</span><br /> <span>Pseudo-productivity is used as a proxy for real productivity. If you don't look busy, you are dismissed as lazy or lacking a work ethic.</span><br /> @@ -1481,7 +3966,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Shallow work usually doesn't help you to accomplish big things. Always have the big picture in mind. Shallow work can't be entirely eliminated, but it can be managed—for example, plan dedicated time slots for certain types of shallow work.</span><br /> <br /> -<h2 style='display: inline' id='Accomplishmentswithoutburnout'>Accomplishments without burnout</h2><br /> +<h2 style='display: inline' id='accomplishments-without-burnout'>Accomplishments without burnout</h2><br /> <br /> <span>The overall perception is that if you want to accomplish something, you must put yourself on the verge of burnout. Cal Newport writes about "The lost Art of Accomplishments without Burnouts", where you can accomplish big things without all the stress usually involved.</span><br /> <br /> @@ -1492,7 +3977,7 @@ http://www.gnu.org/software/src-highlite --> <li>Work at a natural pace</li> <li>Obsess over quality</li> </ul><br /> -<h2 style='display: inline' id='Dofewerthings'>Do fewer things</h2><br /> +<h2 style='display: inline' id='do-fewer-things'>Do fewer things</h2><br /> <br /> <span>There will always be more work. The faster you finish it, the quicker you will have something new on your plate.</span><br /> <br /> @@ -1526,7 +4011,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Put tasks on autopilot (regular recurring tasks).</span><br /> <br /> -<h2 style='display: inline' id='Workatanaturalpace'>Work at a natural pace</h2><br /> +<h2 style='display: inline' id='work-at-a-natural-pace'>Work at a natural pace</h2><br /> <br /> <span>We suffer from overambitious timelines, task lists, and business. Focus on what matters. Don't rush your most important work to achieve better results.</span><br /> <br /> @@ -1542,7 +4027,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Schedule slow seasons (e.g., when on vacation). Disconnect in the slow season. Doing nothing will not satisfy your mind, though. You could read a book on your subject matter to counteract that.</span><br /> <br /> -<h2 style='display: inline' id='Obsessoverquality'>Obsess over quality </h2><br /> +<h2 style='display: inline' id='obsess-over-quality-'>Obsess over quality </h2><br /> <br /> <span>Obsess over quality even if you lose short-term opportunities by rejecting other projects. Quality demands you slow down. The two previous two principles (do fewer things and work at a natural pace) are mandatory for this principle to work:</span><br /> <br /> @@ -1581,15 +4066,15 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other book notes of mine are:</span><br /> <br /> -<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> -<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> -<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> -<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> -<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> -<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-10-24-staff-engineer-book-notes.html'>2024-10-24 "Staff Engineer" book notes</a><br /> <a class='textlink' href='./2024-07-07-the-stoic-challenge-book-notes.html'>2024-07-07 "The Stoic Challenge" book notes</a><br /> +<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> +<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> +<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> +<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> <br /> -<a class='textlink' href='../resources.html'>More books and other resources I found useful.</a><br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> @@ -1603,13 +4088,21 @@ http://www.gnu.org/software/src-highlite --> <name>Paul Buetow aka snonux</name> <email>paul@dev.buetow.org</email> </author> - <summary>Art by Michael J. Penick (mod. by Paul B.)</summary> + <summary>I have always wanted a highly available setup for my personal websites. I could have used off-the-shelf hosting solutions or hosted my sites in an AWS S3 bucket. I have used technologies like (in unsorted and slightly unrelated order) BGP, LVS/IPVS, ldirectord, Pacemaker, STONITH, scripted VIP failover via ARP, heartbeat, heartbeat2, Corosync, keepalived, DRBD, and commercial F5 Load Balancers for high availability at work. </summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='KISShighavailabilitywithOpenBSD'>KISS high-availability with OpenBSD</h1><br /> + <h1 style='display: inline' id='kiss-high-availability-with-openbsd'>KISS high-availability with OpenBSD</h1><br /> <br /> <span class='quote'>Published at 2024-03-30T22:12:56+02:00</span><br /> <br /> +<span>I have always wanted a highly available setup for my personal websites. I could have used off-the-shelf hosting solutions or hosted my sites in an AWS S3 bucket. I have used technologies like (in unsorted and slightly unrelated order) BGP, LVS/IPVS, ldirectord, Pacemaker, STONITH, scripted VIP failover via ARP, heartbeat, heartbeat2, Corosync, keepalived, DRBD, and commercial F5 Load Balancers for high availability at work. </span><br /> +<br /> +<span>But still, my personal sites were never highly available. All those technologies are great for professional use, but I was looking for something much more straightforward for my personal space - something as KISS (keep it simple and stupid) as possible.</span><br /> +<br /> +<span>It would be fine if my personal website wasn't highly available, but the geek in me wants it anyway.</span><br /> +<br /> +<span class='quote'>PS: ASCII-art below reflects an OpenBSD under-water world with all the tools available in the base system.</span><br /> +<br /> <pre> Art by Michael J. Penick (mod. by Paul B.) ACME-sky @@ -1635,32 +4128,22 @@ _____|_:_:_| (o)-(o) |_:_:_|--'`-. ,--. ksh under-water (((\'/ </pre> <br /> -<pre> -Table of contents -================= - -KISS high-availability with OpenBSD - My auto-failover requirements - My HA solution - Only OpenBSD base installation required - Fairly cheap and geo-redundant - Failover time and split-brain - Failover support for multiple protocols - Let's encrypt TLS certificates - Monitoring - Rex automation - More HA -</pre> -<br /> -<span>I have always wanted a highly available setup for my personal websites. I could have used off-the-shelf hosting solutions or hosted my sites in an AWS S3 bucket. I have used technologies like (in unsorted and slightly unrelated order) BGP, LVS/IPVS, ldirectord, Pacemaker, STONITH, scripted VIP failover via ARP, heartbeat, heartbeat2, Corosync, keepalived, DRBD, and commercial F5 Load Balancers for high availability at work. </span><br /> -<br /> -<span>But still, my personal sites were never highly available. All those technologies are great for professional use, but I was looking for something much more straightforward for my personal space - something as KISS (keep it simple and stupid) as possible.</span><br /> -<br /> -<span>It would be fine if my personal website wasn't highly available, but the geek in me wants it anyway.</span><br /> -<br /> -<span class='quote'>PS: ASCII-art reflects an OpenBSD under-water world with all the tools available in the base system.</span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline' id='Myautofailoverrequirements'>My auto-failover requirements</h2><br /> +<ul> +<li><a href='#kiss-high-availability-with-openbsd'>KISS high-availability with OpenBSD</a></li> +<li>⇢ <a href='#my-auto-failover-requirements'>My auto-failover requirements</a></li> +<li>⇢ <a href='#my-ha-solution'>My HA solution</a></li> +<li>⇢ ⇢ <a href='#only-openbsd-base-installation-required'>Only OpenBSD base installation required</a></li> +<li>⇢ ⇢ <a href='#fairly-cheap-and-geo-redundant'>Fairly cheap and geo-redundant</a></li> +<li>⇢ ⇢ <a href='#failover-time-and-split-brain'>Failover time and split-brain</a></li> +<li>⇢ ⇢ <a href='#failover-support-for-multiple-protocols'>Failover support for multiple protocols</a></li> +<li>⇢ ⇢ <a href='#let-s-encrypt-tls-certificates'>Let's encrypt TLS certificates</a></li> +<li>⇢ ⇢ <a href='#monitoring'>Monitoring</a></li> +<li>⇢ ⇢ <a href='#rex-automation'>Rex automation</a></li> +<li>⇢ <a href='#more-ha'>More HA</a></li> +</ul><br /> +<h2 style='display: inline' id='my-auto-failover-requirements'>My auto-failover requirements</h2><br /> <br /> <ul> <li>Be OpenBSD-based (I prefer OpenBSD because of the cleanliness and good documentation) and rely on as few external packages as possible. </li> @@ -1673,9 +4156,9 @@ KISS high-availability with OpenBSD <li>Have good monitoring in place so I know when a failover was performed and when something went wrong with the failover.</li> <li>Don't configure everything manually. The configuration should be automated and reproducible.</li> </ul><br /> -<h2 style='display: inline' id='MyHAsolution'>My HA solution</h2><br /> +<h2 style='display: inline' id='my-ha-solution'>My HA solution</h2><br /> <br /> -<h3 style='display: inline' id='OnlyOpenBSDbaseinstallationrequired'>Only OpenBSD base installation required</h3><br /> +<h3 style='display: inline' id='only-openbsd-base-installation-required'>Only OpenBSD base installation required</h3><br /> <br /> <span>My HA solution for Web and Gemini is based on DNS (OpenBSD's <span class='inlinecode'>nsd</span>) and a simple shell script (OpenBSD's <span class='inlinecode'>ksh</span> and some little <span class='inlinecode'>sed</span> and <span class='inlinecode'>awk</span> and <span class='inlinecode'>grep</span>). All software used here is part of the OpenBSD base system and no external package needs to be installed - OpenBSD is a complete operating system.</span><br /> <br /> @@ -1695,38 +4178,38 @@ KISS high-availability with OpenBSD by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/bin/ksh</font></i> - -<font color="#ff0000">ZONES_DIR</font><font color="#F3E651">=</font><font color="#ff0000">/var/nsd/zones/master</font><font color="#F3E651">/</font> -<font color="#ff0000">DEFAULT_MASTER</font><font color="#F3E651">=</font><font color="#ff0000">fishfinger</font><font color="#F3E651">.</font><font color="#ff0000">buetow</font><font color="#F3E651">.</font><font color="#ff0000">org</font> -<font color="#ff0000">DEFAULT_STANDBY</font><font color="#F3E651">=</font><font color="#ff0000">blowfish</font><font color="#F3E651">.</font><font color="#ff0000">buetow</font><font color="#F3E651">.</font><font color="#ff0000">org</font> - -<font color="#7bc710">determine_master_and_standby ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> </font><font color="#ff0000">master</font><font color="#F3E651">=</font><font color="#ff0000">$DEFAULT_MASTER</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> </font><font color="#ff0000">standby</font><font color="#F3E651">=</font><font color="#ff0000">$DEFAULT_STANDBY</font> - -<font color="#ff0000"> </font><font color="#F3E651">.</font> -<font color="#ff0000"> </font><font color="#F3E651">.</font> -<font color="#ff0000"> </font><font color="#F3E651">.</font> -<font color="#ff0000"> </font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -i </font><font color="#ff0000">health_ok</font><font color="#F3E651">=</font><font color="#bb00ff">1</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">!</font><font color="#ff0000"> ftp -</font><font color="#bb00ff">4</font><font color="#ff0000"> -o - https</font><font color="#F3E651">://</font><font color="#ff0000">$master</font><font color="#ff0000">/index</font><font color="#F3E651">.</font><font color="#ff0000">txt </font><font color="#F3E651">|</font><font color="#ff0000"> grep -q </font><font color="#bb00ff">"Welcome to $master"</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> echo </font><font color="#bb00ff">"https://$master/index.txt IPv4 health check failed"</font> -<font color="#ff0000"> </font><font color="#ff0000">health_ok</font><font color="#F3E651">=</font><font color="#bb00ff">0</font> -<font color="#ff0000"> </font><b><font color="#ffffff">elif</font></b><font color="#ff0000"> </font><font color="#F3E651">!</font><font color="#ff0000"> ftp -</font><font color="#bb00ff">6</font><font color="#ff0000"> -o - https</font><font color="#F3E651">://</font><font color="#ff0000">$master</font><font color="#ff0000">/index</font><font color="#F3E651">.</font><font color="#ff0000">txt </font><font color="#F3E651">|</font><font color="#ff0000"> grep -q </font><font color="#bb00ff">"Welcome to $master"</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> echo </font><font color="#bb00ff">"https://$master/index.txt IPv6 health check failed"</font> -<font color="#ff0000"> </font><font color="#ff0000">health_ok</font><font color="#F3E651">=</font><font color="#bb00ff">0</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#ff0000">$health_ok</font><font color="#ff0000"> -eq </font><font color="#bb00ff">0</font><font color="#ff0000"> </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> </font><font color="#ff0000">tmp</font><font color="#F3E651">=</font><font color="#ff0000">$master</font> -<font color="#ff0000"> </font><font color="#ff0000">master</font><font color="#F3E651">=</font><font color="#ff0000">$standby</font> -<font color="#ff0000"> </font><font color="#ff0000">standby</font><font color="#F3E651">=</font><font color="#ff0000">$tmp</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> - -<font color="#ff0000"> </font><font color="#F3E651">.</font> -<font color="#ff0000"> </font><font color="#F3E651">.</font> -<font color="#ff0000"> </font><font color="#F3E651">.</font> -<font color="#ff0000">}</font> +<pre><i><font color="silver">#!/bin/ksh</font></i> + +ZONES_DIR=/var/nsd/zones/master/ +DEFAULT_MASTER=fishfinger.buetow.org +DEFAULT_STANDBY=blowfish.buetow.org + +determine_master_and_standby () { + <b><u><font color="#000000">local</font></u></b> master=$DEFAULT_MASTER + <b><u><font color="#000000">local</font></u></b> standby=$DEFAULT_STANDBY + + . + . + . + + <b><u><font color="#000000">local</font></u></b> -i health_ok=<font color="#000000">1</font> + <b><u><font color="#000000">if</font></u></b> ! ftp -<font color="#000000">4</font> -o - https://$master/index.txt | grep -q <font color="#808080">"Welcome to $master"</font>; <b><u><font color="#000000">then</font></u></b> + echo <font color="#808080">"https://$master/index.txt IPv4 health check failed"</font> + health_ok=<font color="#000000">0</font> + <b><u><font color="#000000">elif</font></u></b> ! ftp -<font color="#000000">6</font> -o - https://$master/index.txt | grep -q <font color="#808080">"Welcome to $master"</font>; <b><u><font color="#000000">then</font></u></b> + echo <font color="#808080">"https://$master/index.txt IPv6 health check failed"</font> + health_ok=<font color="#000000">0</font> + <b><u><font color="#000000">fi</font></u></b> + <b><u><font color="#000000">if</font></u></b> [ $health_ok -eq <font color="#000000">0</font> ]; <b><u><font color="#000000">then</font></u></b> + <b><u><font color="#000000">local</font></u></b> tmp=$master + master=$standby + standby=$tmp + <b><u><font color="#000000">fi</font></u></b> + + . + . + . +} </pre> <br /> <span>The failover scripts looks for the <span class='inlinecode'> ; Enable failover</span> string in the DNS zone files and swaps the <span class='inlinecode'>A</span> and <span class='inlinecode'>AAAA</span> records of the DNS entries accordingly:</span><br /> @@ -1735,42 +4218,42 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">fishfinger$ grep failover /var/nsd/zones/master/foo</font><font color="#F3E651">.</font><font color="#ff0000">zone</font><font color="#F3E651">.</font><font color="#ff0000">zone</font> -<font color="#ff0000"> </font><font color="#bb00ff">300</font><font color="#ff0000"> IN A </font><font color="#bb00ff">46.23</font><font color="#F3E651">.</font><font color="#bb00ff">94.99</font><font color="#ff0000"> </font><font color="#F3E651">;</font><font color="#ff0000"> Enable failover</font> -<font color="#ff0000"> </font><font color="#bb00ff">300</font><font color="#ff0000"> IN AAAA 2a03</font><font color="#F3E651">:</font><font color="#bb00ff">6000</font><font color="#F3E651">:</font><font color="#ff0000">6f67</font><font color="#F3E651">:</font><font color="#bb00ff">624</font><font color="#F3E651">::</font><font color="#bb00ff">99</font><font color="#ff0000"> </font><font color="#F3E651">;</font><font color="#ff0000"> Enable failover</font> -<font color="#ff0000">www </font><font color="#bb00ff">300</font><font color="#ff0000"> IN A </font><font color="#bb00ff">46.23</font><font color="#F3E651">.</font><font color="#bb00ff">94.99</font><font color="#ff0000"> </font><font color="#F3E651">;</font><font color="#ff0000"> Enable failover</font> -<font color="#ff0000">www </font><font color="#bb00ff">300</font><font color="#ff0000"> IN AAAA 2a03</font><font color="#F3E651">:</font><font color="#bb00ff">6000</font><font color="#F3E651">:</font><font color="#ff0000">6f67</font><font color="#F3E651">:</font><font color="#bb00ff">624</font><font color="#F3E651">::</font><font color="#bb00ff">99</font><font color="#ff0000"> </font><font color="#F3E651">;</font><font color="#ff0000"> Enable failover</font> -<font color="#ff0000">standby </font><font color="#bb00ff">300</font><font color="#ff0000"> IN A </font><font color="#bb00ff">23.88</font><font color="#F3E651">.</font><font color="#bb00ff">35.144</font><font color="#ff0000"> </font><font color="#F3E651">;</font><font color="#ff0000"> Enable failover</font> -<font color="#ff0000">standby </font><font color="#bb00ff">300</font><font color="#ff0000"> IN AAAA 2a01</font><font color="#F3E651">:</font><font color="#ff0000">4f8</font><font color="#F3E651">:</font><font color="#ff0000">c17</font><font color="#F3E651">:</font><font color="#ff0000">20f1</font><font color="#F3E651">::</font><font color="#bb00ff">42</font><font color="#ff0000"> </font><font color="#F3E651">;</font><font color="#ff0000"> Enable failover</font> +<pre>fishfinger$ grep failover /var/nsd/zones/master/foo.zone.zone + <font color="#000000">300</font> IN A <font color="#000000">46.23</font>.<font color="#000000">94.99</font> ; Enable failover + <font color="#000000">300</font> IN AAAA 2a03:<font color="#000000">6000</font>:6f67:<font color="#000000">624</font>::<font color="#000000">99</font> ; Enable failover +www <font color="#000000">300</font> IN A <font color="#000000">46.23</font>.<font color="#000000">94.99</font> ; Enable failover +www <font color="#000000">300</font> IN AAAA 2a03:<font color="#000000">6000</font>:6f67:<font color="#000000">624</font>::<font color="#000000">99</font> ; Enable failover +standby <font color="#000000">300</font> IN A <font color="#000000">23.88</font>.<font color="#000000">35.144</font> ; Enable failover +standby <font color="#000000">300</font> IN AAAA 2a01:4f8:c17:20f1::<font color="#000000">42</font> ; Enable failover </pre> <br /> <!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#7bc710">transform ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> sed -E </font><font color="#bb00ff">'</font> -<font color="#bb00ff"> /IN A .*; Enable failover/ {</font> -<font color="#bb00ff"> /^standby/! {</font> -<font color="#bb00ff"> s/^(.*) 300 IN A (.*) ; (.*)/</font><font color="#ffffff">\1</font><font color="#bb00ff"> 300 IN A '</font><font color="#ff0000">$(</font><font color="#ff0000">cat /var/nsd/run/master_a</font><font color="#F3E651">)</font><font color="#bb00ff">' ; </font><font color="#ffffff">\3</font><font color="#bb00ff">/;</font> -<font color="#bb00ff"> }</font> -<font color="#bb00ff"> /^standby/ {</font> -<font color="#bb00ff"> s/^(.*) 300 IN A (.*) ; (.*)/</font><font color="#ffffff">\1</font><font color="#bb00ff"> 300 IN A '</font><font color="#ff0000">$(</font><font color="#ff0000">cat /var/nsd/run/standby_a</font><font color="#F3E651">)</font><font color="#bb00ff">' ; </font><font color="#ffffff">\3</font><font color="#bb00ff">/;</font> -<font color="#bb00ff"> }</font> -<font color="#bb00ff"> }</font> -<font color="#bb00ff"> /IN AAAA .*; Enable failover/ {</font> -<font color="#bb00ff"> /^standby/! {</font> -<font color="#bb00ff"> s/^(.*) 300 IN AAAA (.*) ; (.*)/</font><font color="#ffffff">\1</font><font color="#bb00ff"> 300 IN AAAA '</font><font color="#ff0000">$(</font><font color="#ff0000">cat /var/nsd/run/master_aaaa</font><font color="#F3E651">)</font><font color="#bb00ff">' ; </font><font color="#ffffff">\3</font><font color="#bb00ff">/;</font> -<font color="#bb00ff"> }</font> -<font color="#bb00ff"> /^standby/ {</font> -<font color="#bb00ff"> s/^(.*) 300 IN AAAA (.*) ; (.*)/</font><font color="#ffffff">\1</font><font color="#bb00ff"> 300 IN AAAA '</font><font color="#ff0000">$(</font><font color="#ff0000">cat /var/nsd/run/standby_aaaa</font><font color="#F3E651">)</font><font color="#bb00ff">' ; </font><font color="#ffffff">\3</font><font color="#bb00ff">/;</font> -<font color="#bb00ff"> }</font> -<font color="#bb00ff"> }</font> -<font color="#bb00ff"> / ; serial/ {</font> -<font color="#bb00ff"> s/^( +) ([0-9]+) .*; (.*)/</font><font color="#ffffff">\1</font><font color="#bb00ff"> '</font><font color="#ff0000">$(</font><font color="#ff0000">date </font><font color="#F3E651">+%</font><font color="#ff0000">s</font><font color="#F3E651">)</font><font color="#bb00ff">' ; </font><font color="#ffffff">\3</font><font color="#bb00ff">/;</font> -<font color="#bb00ff"> }</font> -<font color="#bb00ff"> '</font> -<font color="#ff0000">}</font> +<pre>transform () { + sed -E <font color="#808080">'</font> +<font color="#808080"> /IN A .*; Enable failover/ {</font> +<font color="#808080"> /^standby/! {</font> +<font color="#808080"> s/^(.*) 300 IN A (.*) ; (.*)/</font>\1<font color="#808080"> 300 IN A '</font>$(cat /var/nsd/run/master_a)<font color="#808080">' ; </font>\3<font color="#808080">/;</font> +<font color="#808080"> }</font> +<font color="#808080"> /^standby/ {</font> +<font color="#808080"> s/^(.*) 300 IN A (.*) ; (.*)/</font>\1<font color="#808080"> 300 IN A '</font>$(cat /var/nsd/run/standby_a)<font color="#808080">' ; </font>\3<font color="#808080">/;</font> +<font color="#808080"> }</font> +<font color="#808080"> }</font> +<font color="#808080"> /IN AAAA .*; Enable failover/ {</font> +<font color="#808080"> /^standby/! {</font> +<font color="#808080"> s/^(.*) 300 IN AAAA (.*) ; (.*)/</font>\1<font color="#808080"> 300 IN AAAA '</font>$(cat /var/nsd/run/master_aaaa)<font color="#808080">' ; </font>\3<font color="#808080">/;</font> +<font color="#808080"> }</font> +<font color="#808080"> /^standby/ {</font> +<font color="#808080"> s/^(.*) 300 IN AAAA (.*) ; (.*)/</font>\1<font color="#808080"> 300 IN AAAA '</font>$(cat /var/nsd/run/standby_aaaa)<font color="#808080">' ; </font>\3<font color="#808080">/;</font> +<font color="#808080"> }</font> +<font color="#808080"> }</font> +<font color="#808080"> / ; serial/ {</font> +<font color="#808080"> s/^( +) ([0-9]+) .*; (.*)/</font>\1<font color="#808080"> '</font>$(date +%s)<font color="#808080">' ; </font>\3<font color="#808080">/;</font> +<font color="#808080"> }</font> +<font color="#808080"> '</font> +} </pre> <br /> <span>After the failover, the script reloads <span class='inlinecode'>nsd</span> and performs a sanity check to see if DNS still works. If not, a rollback will be performed:</span><br /> @@ -1779,48 +4262,48 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#! Race condition !#</font></i> -<font color="#ff0000"> </font> -<b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> -f </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">bak </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> mv </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">bak </font><font color="#ff0000">$zone_file</font> -<b><font color="#ffffff">fi</font></b> - -<font color="#ff0000">cat </font><font color="#ff0000">$zone_file</font><font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> transform </font><font color="#F3E651">></font><font color="#ff0000"> </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">new</font><font color="#F3E651">.</font><font color="#ff0000">tmp </font> - -<font color="#ff0000">grep -v </font><font color="#bb00ff">' ; serial'</font><font color="#ff0000"> </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">new</font><font color="#F3E651">.</font><font color="#ff0000">tmp </font><font color="#F3E651">></font><font color="#ff0000"> </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">new</font><font color="#F3E651">.</font><font color="#ff0000">noserial</font><font color="#F3E651">.</font><font color="#ff0000">tmp</font> -<font color="#ff0000">grep -v </font><font color="#bb00ff">' ; serial'</font><font color="#ff0000"> </font><font color="#ff0000">$zone_file</font><font color="#ff0000"> </font><font color="#F3E651">></font><font color="#ff0000"> </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">old</font><font color="#F3E651">.</font><font color="#ff0000">noserial</font><font color="#F3E651">.</font><font color="#ff0000">tmp</font> - -<font color="#ff0000">echo </font><font color="#bb00ff">"Has zone $zone_file changed?"</font> -<b><font color="#ffffff">if</font></b><font color="#ff0000"> diff -u </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">old</font><font color="#F3E651">.</font><font color="#ff0000">noserial</font><font color="#F3E651">.</font><font color="#ff0000">tmp </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">new</font><font color="#F3E651">.</font><font color="#ff0000">noserial</font><font color="#F3E651">.</font><font color="#ff0000">tmp</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> echo </font><font color="#bb00ff">"The zone $zone_file hasn't changed"</font> -<font color="#ff0000"> rm </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.*.</font><font color="#ff0000">tmp</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> </font><font color="#bb00ff">0</font> -<b><font color="#ffffff">fi</font></b> - -<font color="#ff0000">cp </font><font color="#ff0000">$zone_file</font><font color="#ff0000"> </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">bak</font> -<font color="#ff0000">mv </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">new</font><font color="#F3E651">.</font><font color="#ff0000">tmp </font><font color="#ff0000">$zone_file</font> -<font color="#ff0000">rm </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.*.</font><font color="#ff0000">tmp</font> -<font color="#ff0000">echo </font><font color="#bb00ff">"Reloading nsd"</font> -<font color="#ff0000">nsd-control reload</font> - -<b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">!</font><font color="#ff0000"> zone_is_ok </font><font color="#ff0000">$zone</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> echo </font><font color="#bb00ff">"Rolling back $zone_file changes"</font> -<font color="#ff0000"> cp </font><font color="#ff0000">$zone_file</font><font color="#ff0000"> </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">invalid</font> -<font color="#ff0000"> mv </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">bak </font><font color="#ff0000">$zone_file</font> -<font color="#ff0000"> echo </font><font color="#bb00ff">"Reloading nsd"</font> -<font color="#ff0000"> nsd-control reload</font> -<font color="#ff0000"> zone_is_ok </font><font color="#ff0000">$zone</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> </font><font color="#bb00ff">3</font> -<b><font color="#ffffff">fi</font></b> - -<b><font color="#ffffff">for</font></b><font color="#ff0000"> cleanup </font><b><font color="#ffffff">in</font></b><font color="#ff0000"> invalid bak</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">do</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> -f </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">$cleanup</font><font color="#ff0000"> </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> rm </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">$cleanup</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> -<b><font color="#ffffff">done</font></b> - -<font color="#ff0000">echo </font><font color="#bb00ff">"Failover of zone $zone to $MASTER completed"</font> -<b><font color="#ffffff">return</font></b><font color="#ff0000"> </font><font color="#bb00ff">1</font> +<pre><i><font color="silver">#! Race condition !#</font></i> + +<b><u><font color="#000000">if</font></u></b> [ -f $zone_file.bak ]; <b><u><font color="#000000">then</font></u></b> + mv $zone_file.bak $zone_file +<b><u><font color="#000000">fi</font></u></b> + +cat $zone_file | transform > $zone_file.new.tmp + +grep -v <font color="#808080">' ; serial'</font> $zone_file.new.tmp > $zone_file.new.noserial.tmp +grep -v <font color="#808080">' ; serial'</font> $zone_file > $zone_file.old.noserial.tmp + +echo <font color="#808080">"Has zone $zone_file changed?"</font> +<b><u><font color="#000000">if</font></u></b> diff -u $zone_file.old.noserial.tmp $zone_file.new.noserial.tmp; <b><u><font color="#000000">then</font></u></b> + echo <font color="#808080">"The zone $zone_file hasn't changed"</font> + rm $zone_file.*.tmp + <b><u><font color="#000000">return</font></u></b> <font color="#000000">0</font> +<b><u><font color="#000000">fi</font></u></b> + +cp $zone_file $zone_file.bak +mv $zone_file.new.tmp $zone_file +rm $zone_file.*.tmp +echo <font color="#808080">"Reloading nsd"</font> +nsd-control reload + +<b><u><font color="#000000">if</font></u></b> ! zone_is_ok $zone; <b><u><font color="#000000">then</font></u></b> + echo <font color="#808080">"Rolling back $zone_file changes"</font> + cp $zone_file $zone_file.invalid + mv $zone_file.bak $zone_file + echo <font color="#808080">"Reloading nsd"</font> + nsd-control reload + zone_is_ok $zone + <b><u><font color="#000000">return</font></u></b> <font color="#000000">3</font> +<b><u><font color="#000000">fi</font></u></b> + +<b><u><font color="#000000">for</font></u></b> cleanup <b><u><font color="#000000">in</font></u></b> invalid bak; <b><u><font color="#000000">do</font></u></b> + <b><u><font color="#000000">if</font></u></b> [ -f $zone_file.$cleanup ]; <b><u><font color="#000000">then</font></u></b> + rm $zone_file.$cleanup + <b><u><font color="#000000">fi</font></u></b> +<b><u><font color="#000000">done</font></u></b> + +echo <font color="#808080">"Failover of zone $zone to $MASTER completed"</font> +<b><u><font color="#000000">return</font></u></b> <font color="#000000">1</font> </pre> <br /> <span>A non-zero return code (here, 3 when a rollback and 1 when a DNS failover was performed) will cause CRON to send an E-Mail with the whole script output.</span><br /> @@ -1831,7 +4314,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <a class='textlink' href='https://codeberg.org/snonux/rexfiles/src/branch/master/frontends/scripts/dns-failover.ksh'>dns-failover.ksh</a><br /> <br /> -<h3 style='display: inline' id='Fairlycheapandgeoredundant'>Fairly cheap and geo-redundant</h3><br /> +<h3 style='display: inline' id='fairly-cheap-and-geo-redundant'>Fairly cheap and geo-redundant</h3><br /> <br /> <span>I am renting two small OpenBSD VMs: One at OpenBSD Amsterdam and the other at Hetzner Cloud. So, both VMs are hosted at another provider, in different IP subnets, and in different countries (the Netherlands and Germany).</span><br /> <br /> @@ -1842,13 +4325,13 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>A DNS-based failover is cheap, as there isn't any BGP or fancy load balancer to pay for. Small VMs also cost less than millions.</span><br /> <br /> -<h3 style='display: inline' id='Failovertimeandsplitbrain'>Failover time and split-brain</h3><br /> +<h3 style='display: inline' id='failover-time-and-split-brain'>Failover time and split-brain</h3><br /> <br /> <span>A DNS failover doesn't happen immediately. I've configured a DNS TTL of <span class='inlinecode'>300</span> seconds, and the failover script checks once per minute whether to perform a failover or not. So, in total, a failover can take six minutes (not including other DNS caching servers somewhere in the interweb, but that's fine - eventually, all requests will resolve to the new master after a failover).</span><br /> <br /> <span>A split-brain scenario between the old master and the new master might happen. That's OK, as my sites are static, and there's no database to synchronise other than HTML, CSS, and images when the site is updated.</span><br /> <br /> -<h3 style='display: inline' id='Failoversupportformultipleprotocols'>Failover support for multiple protocols</h3><br /> +<h3 style='display: inline' id='failover-support-for-multiple-protocols'>Failover support for multiple protocols</h3><br /> <br /> <span>With the DNS failover, HTTP, HTTPS, and Gemini protocols are failovered. This works because all domain virtual hosts are configured on either VM's <span class='inlinecode'>httpd</span> (OpenBSD's HTTP server) and <span class='inlinecode'>relayd</span> (it's also part of OpenBSD and I use it to TLS offload the Gemini protocol). So, both VMs accept requests for all the hosts. It's just a matter of the DNS entries, which VM receives the requests.</span><br /> <br /> @@ -1859,7 +4342,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>On DNS failover, master and standby swap roles without config changes other than the DNS entries. That's KISS (keep it simple and stupid)!</span><br /> <br /> -<h3 style='display: inline' id='LetsencryptTLScertificates'>Let's encrypt TLS certificates</h3><br /> +<h3 style='display: inline' id='let-s-encrypt-tls-certificates'>Let's encrypt TLS certificates</h3><br /> <br /> <span>All my hosts use TLS certificates from Let's Encrypt. The ACME automation for requesting and keeping the certificates valid (up to date) requires that the host requesting a certificate from Let's Encrypt is also the host using that certificate.</span><br /> <br /> @@ -1877,13 +4360,13 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab"># Weekly auto-failover for Let's Encrypt automation</font></i> -<b><font color="#ffffff">local</font></b><font color="#ff0000"> -i -r </font><font color="#ff0000">week_of_the_year</font><font color="#F3E651">=</font><font color="#ff0000">$(</font><font color="#ff0000">date </font><font color="#F3E651">+%</font><font color="#ff0000">U</font><font color="#F3E651">)</font> -<b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#ff0000">$(</font><font color="#F3E651">(</font><font color="#ff0000"> week_of_the_year </font><font color="#F3E651">%</font><font color="#ff0000"> </font><font color="#bb00ff">2</font><font color="#ff0000"> </font><font color="#F3E651">))</font><font color="#ff0000"> -eq </font><font color="#bb00ff">0</font><font color="#ff0000"> </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> </font><font color="#ff0000">tmp</font><font color="#F3E651">=</font><font color="#ff0000">$master</font> -<font color="#ff0000"> </font><font color="#ff0000">master</font><font color="#F3E651">=</font><font color="#ff0000">$standby</font> -<font color="#ff0000"> </font><font color="#ff0000">standby</font><font color="#F3E651">=</font><font color="#ff0000">$tmp</font> -<b><font color="#ffffff">fi</font></b> +<pre><i><font color="silver"># Weekly auto-failover for Let's Encrypt automation</font></i> +<b><u><font color="#000000">local</font></u></b> -i -r week_of_the_year=$(date +%U) +<b><u><font color="#000000">if</font></u></b> [ $(( week_of_the_year % <font color="#000000">2</font> )) -eq <font color="#000000">0</font> ]; <b><u><font color="#000000">then</font></u></b> + <b><u><font color="#000000">local</font></u></b> tmp=$master + master=$standby + standby=$tmp +<b><u><font color="#000000">fi</font></u></b> </pre> <br /> <span>This way, a DNS failover is performed weekly so that the ACME automation can update the Let's Encrypt certificates (for master and standby) before they expire on each VM.</span><br /> @@ -1896,7 +4379,7 @@ http://www.gnu.org/software/src-highlite --> <a class='textlink' href='https://man.OpenBSD.org/acme-client.1'>https://man.OpenBSD.org/acme-client.1</a><br /> <a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>Let's Encrypt with OpenBSD and Rex</a><br /> <br /> -<h3 style='display: inline' id='Monitoring'>Monitoring</h3><br /> +<h3 style='display: inline' id='monitoring'>Monitoring</h3><br /> <br /> <span>CRON is sending me an E-Mail whenever a failover is performed (or whenever a failover failed). Furthermore, I am monitoring my DNS servers and hosts through Gogios, the monitoring system I have developed. </span><br /> <br /> @@ -1905,7 +4388,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Gogios, as I developed it by myself, isn't part of the OpenBSD base system. </span><br /> <br /> -<h3 style='display: inline' id='Rexautomation'>Rex automation</h3><br /> +<h3 style='display: inline' id='rex-automation'>Rex automation</h3><br /> <br /> <span>I use Rexify, a friendly configuration management system that allows automatic deployment and configuration.</span><br /> <br /> @@ -1914,7 +4397,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Rex isn't part of the OpenBSD base system, but I didn't need to install any external software on OpenBSD either as Rex is invoked from my Laptop!</span><br /> <br /> -<h2 style='display: inline' id='MoreHA'>More HA</h2><br /> +<h2 style='display: inline' id='more-ha'>More HA</h2><br /> <br /> <span>Other high-available services running on my OpenBSD VMs are my MTAs for mail forwarding (OpenSMTPD - also part of the OpenBSD base system) and the authoritative DNS servers (<span class='inlinecode'>nsd</span>) for all my domains. No particular HA setup is required, though, as the protocols (SMTP and DNS) already take care of the failover to the next available host! </span><br /> <br /> @@ -1928,13 +4411,16 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other *BSD and KISS related posts are:</span><br /> <br /> -<a class='textlink' href='./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html'>2016-04-09 Jails and ZFS with Puppet on FreeBSD</a><br /> -<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>2022-07-30 Let's Encrypt with OpenBSD and Rex</a><br /> -<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> -<a class='textlink' href='./2023-06-01-kiss-server-monitoring-with-gogios.html'>2023-06-01 KISS server monitoring with Gogios</a><br /> -<a class='textlink' href='./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.html'>2023-10-29 KISS static web photo albums with <span class='inlinecode'>photoalbum.sh</span></a><br /> -<a class='textlink' href='./2024-01-13-one-reason-why-i-love-openbsd.html'>2024-01-13 One reason why I love OpenBSD</a><br /> +<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br /> +<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br /> +<a class='textlink' href='./2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</a><br /> <a class='textlink' href='./2024-04-01-KISS-high-availability-with-OpenBSD.html'>2024-04-01 KISS high-availability with OpenBSD (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-01-13-one-reason-why-i-love-openbsd.html'>2024-01-13 One reason why I love OpenBSD</a><br /> +<a class='textlink' href='./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.html'>2023-10-29 KISS static web photo albums with <span class='inlinecode'>photoalbum.sh</span></a><br /> +<a class='textlink' href='./2023-06-01-kiss-server-monitoring-with-gogios.html'>2023-06-01 KISS server monitoring with Gogios</a><br /> +<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> +<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>2022-07-30 Let's Encrypt with OpenBSD and Rex</a><br /> +<a class='textlink' href='./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html'>2016-04-09 Jails and ZFS with Puppet on FreeBSD</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> @@ -1952,7 +4438,7 @@ http://www.gnu.org/software/src-highlite --> <summary>I am an ideas person. I find myself frequently somewhere on the streets with an idea in my head but no paper journal noting it down. </summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='AfineFyneAndroidappforquicklyloggingideasprogrammedinGo'>A fine Fyne Android app for quickly logging ideas programmed in Go</h1><br /> + <h1 style='display: inline' id='a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-go'>A fine Fyne Android app for quickly logging ideas programmed in Go</h1><br /> <br /> <span class='quote'>Published at 2024-03-03T00:07:21+02:00</span><br /> <br /> @@ -1962,6 +4448,15 @@ http://www.gnu.org/software/src-highlite --> <br /> <a href='a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang/logo-small.png'><img alt='Quick logger Logo' title='Quick logger Logo' src='a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang/logo-small.png' /></a><br /> <br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-go'>A fine Fyne Android app for quickly logging ideas programmed in Go</a></li> +<li>⇢ <a href='#enter-quick-logger'>Enter Quick logger</a></li> +<li>⇢ <a href='#all-easy-peasy'>All easy-peasy?</a></li> +</ul><br /> +<h2 style='display: inline' id='enter-quick-logger'>Enter Quick logger</h2><br /> +<br /> <span>Enter Quick logger – a compact GUI Android (well, cross-platform due to Fyne) app I've crafted using Go and the nifty Fyne framework. With Fyne, the app can be compiled easily into an Android APK. As of this writing, this app's whole Go source code is only 75 lines short!! This little tool is designed for spontaneous moments, allowing me to quickly log my thoughts as plain text files on my Android phone. There are no fancy file formats. Just plain text!</span><br /> <br /> <a class='textlink' href='https://codeberg.org/snonux/quicklogger'>https://codeberg.org/snonux/quicklogger</a><br /> @@ -1984,7 +4479,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>My Android apps will never be polished, but they will get the job done, and this is precisely how I want them to be. Minimalistic but functional. I could spend more time polishing Quick logger, but my Quick logger app then may be the same as any other notes app out there (complicated or bloated).</span><br /> <br /> -<h2 style='display: inline' id='Alleasypeasy'>All easy-peasy?</h2><br /> +<h2 style='display: inline' id='all-easy-peasy'>All easy-peasy?</h2><br /> <br /> <span>I did have some issues with the app logo for Android, though. Android always showed the default app icon and not my custom icon whenever I used a custom <span class='inlinecode'>AndroidManifest.xml</span> for custom app storage permissions. Without a custom <span class='inlinecode'>AndroidAmnifest.xml</span> the app icon would be displayed under Android, but then the app would not have the <span class='inlinecode'>MANAGE_EXTERNAL_STORAGE</span> permission, which is required for Quick logger to write to a custom directory. I found a workaround, which I commented on here at Github:</span><br /> <br /> @@ -2000,7 +4495,6 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other Go related posts are:</span><br /> <br /> -<a class='textlink' href='./2023-04-09-algorithms-and-data-structures-in-golang-part-1.html'>2023-04-09 Algorithms and Data Structures in Go - Part 1</a><br /> <a class='textlink' href='./2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.html'>2024-03-03 A fine Fyne Android app for quickly logging ideas programmed in Go (You are currently reading this)</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> @@ -2019,7 +4513,7 @@ http://www.gnu.org/software/src-highlite --> <summary>Recently, my employer sent me to a week-long AWS course. After the course, there wasn't any hands-on project I could dive into immediately, so I moved parts of my personal infrastructure to AWS to level up a bit through practical hands-on.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Frombabylon5buetoworgtobuetowcloud'>From <span class='inlinecode'>babylon5.buetow.org</span> to <span class='inlinecode'>*.buetow.cloud</span></h1><br /> + <h1 style='display: inline' id='from-babylon5buetoworg-to-buetowcloud'>From <span class='inlinecode'>babylon5.buetow.org</span> to <span class='inlinecode'>*.buetow.cloud</span></h1><br /> <br /> <span class='quote'>Published at 2024-02-04T00:50:50+02:00</span><br /> <br /> @@ -2029,7 +4523,25 @@ http://www.gnu.org/software/src-highlite --> <br /> <a href='./from-.org-to-.cloud/old-man-yells-at-cloud.jpg'><img alt='Old man yells at cloud' title='Old man yells at cloud' src='./from-.org-to-.cloud/old-man-yells-at-cloud.jpg' /></a><br /> <br /> -<h2 style='display: inline' id='Theoldbuetoworgway'>The old <span class='inlinecode'>*.buetow.org</span> way</h2><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#from-babylon5buetoworg-to-buetowcloud'>From <span class='inlinecode'>babylon5.buetow.org</span> to <span class='inlinecode'>*.buetow.cloud</span></a></li> +<li>⇢ <a href='#the-old-buetoworg-way'>The old <span class='inlinecode'>*.buetow.org</span> way</a></li> +<li>⇢ <a href='#i-kept-my-buetoworg-openbsd-boxes-alive'>I kept my <span class='inlinecode'>buetow.org</span> OpenBSD boxes alive</a></li> +<li>⇢ <a href='#the-new-buetowcloud-way'>The new <span class='inlinecode'>*.buetow.cloud</span> way</a></li> +<li>⇢ <a href='#the-container-apps'>The container apps</a></li> +<li>⇢ ⇢ <a href='#fluxbuetowcloud'><span class='inlinecode'>flux.buetow.cloud</span></a></li> +<li>⇢ ⇢ <a href='#audiobookshelfbuetowcloud'><span class='inlinecode'>audiobookshelf.buetow.cloud</span></a></li> +<li>⇢ ⇢ <a href='#syncthingbuetowcloud'><span class='inlinecode'>syncthing.buetow.cloud</span></a></li> +<li>⇢ ⇢ <a href='#radicalebuetowcloud'><span class='inlinecode'>radicale.buetow.cloud</span></a></li> +<li>⇢ ⇢ <a href='#bagbuetowcloud'><span class='inlinecode'>bag.buetow.cloud</span></a></li> +<li>⇢ ⇢ <a href='#ankibuetowcloud'><span class='inlinecode'>anki.buetow.cloud</span></a></li> +<li>⇢ ⇢ <a href='#vaultbuetowcloud'><span class='inlinecode'>vault.buetow.cloud</span></a></li> +<li>⇢ ⇢ <a href='#bastionbuetowcloud'><span class='inlinecode'>bastion.buetow.cloud</span></a></li> +<li>⇢ <a href='#conclusion'>Conclusion</a></li> +</ul><br /> +<h2 style='display: inline' id='the-old-buetoworg-way'>The old <span class='inlinecode'>*.buetow.org</span> way</h2><br /> <br /> <span>Before the migration, all those services were reachable through <span class='inlinecode'>buetow.org</span>-subdomains (Buetow is my last name) and ran on Docker containers on a single Rocky Linux 9 VM at Hetzner. And there was a Nginx reverse proxy with TLS offloading (with Let's Encrypt certificates). The Rocky Linux 9's hostname was <span class='inlinecode'>babylon5.buetow.org</span> (based on the Science Fiction series). </span><br /> <br /> @@ -2049,7 +4561,7 @@ http://www.gnu.org/software/src-highlite --> <li>KISS (Keep it Simple Stupid)</li> <li>Cheap</li> </ul><br /> -<h2 style='display: inline' id='IkeptmybuetoworgOpenBSDboxesalive'>I kept my <span class='inlinecode'>buetow.org</span> OpenBSD boxes alive</h2><br /> +<h2 style='display: inline' id='i-kept-my-buetoworg-openbsd-boxes-alive'>I kept my <span class='inlinecode'>buetow.org</span> OpenBSD boxes alive</h2><br /> <br /> <span>As pointed out, I only migrated the Docker-based self-hosted services (which run on the Babylon 5 Rocky Linux box) to AWS. Many self-hostable apps come with ready-to-use container images, making deploying them easy.</span><br /> <br /> @@ -2070,7 +4582,7 @@ http://www.gnu.org/software/src-highlite --> <a class='textlink' href='./2023-06-01-kiss-server-monitoring-with-gogios.html'>KISS server monitoring with Gogios</a><br /> <a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>Let's encrypt with OpenBSD and Rex</a><br /> <br /> -<h2 style='display: inline' id='Thenewbuetowcloudway'>The new <span class='inlinecode'>*.buetow.cloud</span> way</h2><br /> +<h2 style='display: inline' id='the-new-buetowcloud-way'>The new <span class='inlinecode'>*.buetow.cloud</span> way</h2><br /> <br /> <span>With AWS, I decided to get myself a new domain name, as I could fully separate my AWS setup from my conventional setup and give Route 53 as an authoritative DNS a spin.</span><br /> <br /> @@ -2100,7 +4612,7 @@ http://www.gnu.org/software/src-highlite --> <li><span class='inlinecode'>org-buetow-elb</span> sets up the Elastic Load Balancer, a prerequisite for any service running in ECS Fargate.</li> <li><span class='inlinecode'>org-buetow-ecs</span> finally sets up and deploys all the Docker apps mentioned above. Any apps can be turned on or off via the <span class='inlinecode'>variables.tf</span> file.</li> </ul><br /> -<h2 style='display: inline' id='Thecontainerapps'>The container apps</h2><br /> +<h2 style='display: inline' id='the-container-apps'>The container apps</h2><br /> <br /> <span>And here, finally, is the list of all the container apps my Terraform manifests deploy. The FQDNs here may not be reachable. I spin them up only on demand (for cost reasons). All services are fully dual-stacked (IPv4 & IPv6). </span><br /> <br /> @@ -2171,7 +4683,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>This is a tiny ARM-based Amazon Linux EC2 instance, which I sometimes spin up for investigation or manual work on my EFS file system in AWS.</span><br /> <br /> -<h2 style='display: inline' id='Conclusion'>Conclusion</h2><br /> +<h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> <br /> <span>I have learned a lot about AWS and Terraform during this migration. This was actually my first AWS hands-on project with practical use.</span><br /> <br /> @@ -2201,7 +4713,7 @@ http://www.gnu.org/software/src-highlite --> <summary>HKISSFISHKISSFISHKISSFISHKISSFISH KISS</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='OnereasonwhyIloveOpenBSD'>One reason why I love OpenBSD</h1><br /> + <h1 style='display: inline' id='one-reason-why-i-love-openbsd'>One reason why I love OpenBSD</h1><br /> <br /> <span class='quote'>Published at 2024-01-13T22:55:33+02:00</span><br /> <br /> @@ -2229,8 +4741,8 @@ SSFISHKISSFISHKISSFISHKISSFISHKIS SFIS by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">$ doas installboot sd0 </font><i><font color="#ababab"># Update the bootloader (not for every upgrade required)</font></i> -<font color="#ff0000">$ doas sysupgrade </font><i><font color="#ababab"># Update all binaries (including Kernel)</font></i> +<pre>$ doas installboot sd0 <i><font color="silver"># Update the bootloader (not for every upgrade required)</font></i> +$ doas sysupgrade <i><font color="silver"># Update all binaries (including Kernel)</font></i> </pre> <br /> <span><span class='inlinecode'>sysupgrade</span> downloaded and upgraded to the next release and rebooted the system. After the reboot, I run:</span><br /> @@ -2239,9 +4751,9 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">$ doas sysmerge </font><i><font color="#ababab"># Update system configuration files</font></i> -<font color="#ff0000">$ doas pkg_add -u </font><i><font color="#ababab"># Update all packages</font></i> -<font color="#ff0000">$ doas reboot </font><i><font color="#ababab"># Just in case, reboot one more time</font></i> +<pre>$ doas sysmerge <i><font color="silver"># Update system configuration files</font></i> +$ doas pkg_add -u <i><font color="silver"># Update all packages</font></i> +$ doas reboot <i><font color="silver"># Just in case, reboot one more time</font></i> </pre> <br /> <span>That's it! Took me around 5 minutes in total! No issues, only these few comands, only 5 minutes! It just works! No problems, no conflicts, no tons (actually none) config file merge conflicts.</span><br /> @@ -2260,18 +4772,21 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other *BSD related posts are:</span><br /> <br /> -<a class='textlink' href='./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html'>2016-04-09 Jails and ZFS with Puppet on FreeBSD</a><br /> -<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>2022-07-30 Let's Encrypt with OpenBSD and Rex</a><br /> -<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> -<a class='textlink' href='./2024-01-13-one-reason-why-i-love-openbsd.html'>2024-01-13 One reason why I love OpenBSD (You are currently reading this)</a><br /> +<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br /> +<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br /> +<a class='textlink' href='./2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</a><br /> <a class='textlink' href='./2024-04-01-KISS-high-availability-with-OpenBSD.html'>2024-04-01 KISS high-availability with OpenBSD</a><br /> +<a class='textlink' href='./2024-01-13-one-reason-why-i-love-openbsd.html'>2024-01-13 One reason why I love OpenBSD (You are currently reading this)</a><br /> +<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> +<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>2022-07-30 Let's Encrypt with OpenBSD and Rex</a><br /> +<a class='textlink' href='./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html'>2016-04-09 Jails and ZFS with Puppet on FreeBSD</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> </entry> <entry> - <title>Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect</title> + <title>Site Reliability Engineering - Part 3: On-Call Culture</title> <link href="gemini://foo.zone/gemfeed/2024-01-09-site-reliability-engineering-part-3.gmi" /> <id>gemini://foo.zone/gemfeed/2024-01-09-site-reliability-engineering-part-3.gmi</id> <updated>2024-01-09T18:35:48+02:00</updated> @@ -2279,18 +4794,19 @@ http://www.gnu.org/software/src-highlite --> <name>Paul Buetow aka snonux</name> <email>paul@dev.buetow.org</email> </author> - <summary>This is the third part of my Site Reliability Engineering (SRE) series. I am currently employed as a Site Reliability Engineer and will try to share what SRE is about in this blog series.</summary> + <summary>Welcome to Part 3 of my Site Reliability Engineering (SRE) series. I'm currently working as a Site Reliability Engineer, and I’m here to share what SRE is all about in this blog series.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='SiteReliabilityEngineeringPart3OnCallCultureandtheHumanAspect'>Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect</h1><br /> + <h1 style='display: inline' id='site-reliability-engineering---part-3-on-call-culture'>Site Reliability Engineering - Part 3: On-Call Culture</h1><br /> <br /> <span class='quote'>Published at 2024-01-09T18:35:48+02:00</span><br /> <br /> -<span>This is the third part of my Site Reliability Engineering (SRE) series. I am currently employed as a Site Reliability Engineer and will try to share what SRE is about in this blog series.</span><br /> +<span>Welcome to Part 3 of my Site Reliability Engineering (SRE) series. I'm currently working as a Site Reliability Engineer, and I’m here to share what SRE is all about in this blog series.</span><br /> <br /> <a class='textlink' href='./2023-08-18-site-reliability-engineering-part-1.html'>2023-08-18 Site Reliability Engineering - Part 1: SRE and Organizational Culture</a><br /> -<a class='textlink' href='./2023-11-19-site-reliability-engineering-part-2.html'>2023-11-19 Site Reliability Engineering - Part 2: Operational Balance in SRE</a><br /> -<a class='textlink' href='./2024-01-09-site-reliability-engineering-part-3.html'>2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect (You are currently reading this)</a><br /> +<a class='textlink' href='./2023-11-19-site-reliability-engineering-part-2.html'>2023-11-19 Site Reliability Engineering - Part 2: Operational Balance</a><br /> +<a class='textlink' href='./2024-01-09-site-reliability-engineering-part-3.html'>2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-09-07-site-reliability-engineering-part-4.html'>2024-09-07 Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers</a><br /> <br /> <pre> ..--""""----.. @@ -2318,23 +4834,29 @@ http://www.gnu.org/software/src-highlite --> </pre> <br /> -<h2 style='display: inline' id='OnCallCultureandtheHumanAspectPrioritisingWellbeingintheRealmofReliability'>On-Call Culture and the Human Aspect: Prioritising Well-being in the Realm of Reliability</h2><br /> +<h2 style='display: inline' id='putting-well-being-first'>Putting Well-being First</h2><br /> +<br /> +<span>Site Reliability Engineering is all about keeping systems reliable, but we often forget how important the human side is. A healthy on-call culture is just as crucial as any technical fix. The well-being of the engineers really matters.</span><br /> +<br /> +<span>First off, a healthy on-call rotation is about more than just handling incidents. It's about creating a supportive ecosystem. This means cutting down on pain points, offering mentorship, quickly iterating on processes, and making sure engineers have the right tools. But there's a catch—engineers need to be willing to learn. Especially in on-call rotations where SREs work with Software Engineers or QA Engineers, it can be tough to get everyone motivated. QA Engineers want to test, Software Engineers want to build new features; they don’t want to deal with production issues. This can be really frustrating for the SREs trying to mentor them.</span><br /> <br /> -<span>Site Reliability Engineering is synonymous with ensuring system reliability, but the human factor is an often-underestimated part of this discipline. Ensuring an healthy on-call culture is as critical as any technical solution. The well-being of the engineers is an important factor.</span><br /> +<span>Plus, measuring a good on-call experience isn't always clear-cut. You might think fewer pages mean a better on-call setup—and yeah, no one wants to get paged after hours—but it's not just about the number of pages. Trust, ownership, accountability, and solid communication are what really matter.</span><br /> <br /> -<span>Firstly, a healthy on-call rotation is about more than just managing and responding to incidents. It's about the entire ecosystem that supports this practice. This involves reducing pain points, offering mentorship, rapid iteration, and ensuring that engineers have the right tools and processes. One ceavat is, that engineers should be willing to learn. Especially in on-call rotation embedding SREs with other engineers (for example Software Engineers or QA Engineers), it's difficult to motivate everyone to engage. QA Engineers want to test the software, Software Engineers want to implement new features; they don't want to troubleshoot and debug production incidents. It can be depressing for the mentoring SRE.</span><br /> +<span>A key part is giving feedback about the on-call experience to keep learning and improving. If alerts are mostly noise, they need to be tweaked or even ditched. If alerts are helpful, can we automate the repetitive tasks? If there are knowledge gaps, is the documentation lacking? Regular retrospectives ensure that the systems get better over time and the on-call experience improves for the engineers.</span><br /> <br /> -<span>Furthermore, the metrics that measure the success of an on-call experience are only sometimes straightforward. While one might assume that fewer pages translate to better on-call expertise (which is true to a degree, as who wants to receive a page out of office hours?), it's not always the volume of pages that matters most. Trust, ownership, accountability, and effective communication play the important roles.</span><br /> +<span>Getting new team members ready for on-call duties is super important for keeping systems reliable and efficient. This means giving them the knowledge, tools, and support they need to handle incidents with confidence. It starts with a rundown of the system architecture and common issues, then training on monitoring tools, alerting systems, and incident response protocols. Watching experienced on-call engineers in action can provide some hands-on learning. Too often, though, new engineers get thrown into the deep end without proper onboarding because the more experienced engineers are too busy dealing with ongoing production issues.</span><br /> <br /> -<span>An important part is giving feedback about the on-call experience to ensure continuous learning. If alerts are mostly noise, they should be tuned or even eliminated. If alerts are actionable, can recurring tasks be automated? If there are knowledge gaps, is the documentation not good enough? Continuous retrospection ensures that not only do systems evolve, but the experience for the on-call engineers becomes progressively better.</span><br /> +<span>A culture where everyone's always on and alert can cause burnout. Engineers need to know their limits, take breaks, and ask for help when they need it. This isn't just about personal health; a burnt-out engineer can drag down the whole team and the systems they manage. A good on-call culture keeps systems running while making sure engineers are happy, healthy, and supported. Experienced engineers should take the time to mentor juniors, but junior engineers should also stay engaged, investigate issues, and learn new things on their own.</span><br /> <br /> -<span>Onboarding for on-call duties is a crucial aspect of ensuring the reliability and efficiency of systems. This process involves equipping new team members with the knowledge, tools, and support to handle incidents confidently. It begins with an overview of the system architecture and common challenges, followed by training on monitoring tools, alerting mechanisms, and incident response protocols. Shadowing experienced on-call engineers can offer practical exposure. Too often, new engineers are thrown into the cold water without proper onboarding and training because the more experienced engineers are too busy fire-fighting production issues in the first place.</span><br /> +<span>For junior engineers, it's tempting to always ask the experts for help whenever something goes wrong. While that might seem reasonable, constantly handing out solutions doesn't scale—there are endless ways for production systems to break. So, every engineer needs to learn how to debug, troubleshoot, and resolve incidents on their own. The experts should be there for guidance and can step in when a junior gets really stuck, but they also need to give space for less experienced engineers to grow and learn.</span><br /> <br /> -<span>An always-on, always-alert culture can lead to burnout. Engineers should be encouraged to recognise their limits, take breaks, and seek support when needed. This isn't just about individual health; a burnt-out engineer can have cascading effects on the entire team and the systems they manage. A successful on-call culture ensures that while systems are kept running, the engineers are kept happy, healthy, and supported. The more experienced engineers should take time to mentor the junior engineers, but the junior engineers should also be fully engaged, try to investigate and learn new things by themselves.</span><br /> +<span>A blameless on-call culture is essential for creating a safe and collaborative environment where engineers can handle incidents without worrying about getting blamed. It recognizes that mistakes are just part of learning and innovating. When people know they won’t be punished for errors, they’re more likely to talk openly about what went wrong, which helps the whole team learn and improve. Plus, a blameless culture boosts psychological safety, job satisfaction, and reduces burnout, keeping everyone committed and engaged.</span><br /> <br /> -<span>For the junior engineer, it's too easy to fall back and ask the experts in the team every time an issue arises. This seems reasonable, but serving recipes for solving production issues on a silver tablet won't scale forever, as there are infinite scenarios of how production systems can break. So every engineer should learn to debug, troubleshoot and resolve production incidents independently. The experts will still be there for guidance and step in when the junior gets stuck after trying, but the experts should also learn to step down so that lesser experienced engineers can step up and learn. But mistakes can always happen here; that's why having a blameless on-call culture is essential.</span><br /> +<span>Mistakes are gonna happen, which is why having a blameless on-call culture is so important.</span><br /> <br /> -<span>A blameless on-call culture is a must for a safe and collaborative environment where engineers can effectively respond to incidents without fear of retribution. This approach acknowledges that mistakes are a natural part of the learning and innovation process. When individuals are assured they won't be punished for errors, they're more likely to openly discuss mistakes, allowing the entire team to learn and grow from each incident. Furthermore, a blameless culture promotes psychological safety, enhances job satisfaction, reduces burnout, and ensures that talent remains committed and engaged.</span><br /> +<span>Continue with the fourth part of this series:</span><br /> +<br /> +<a class='textlink' href='./2024-09-07-site-reliability-engineering-part-4.html'>2024-09-07 Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers</a><br /> <br /> <span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> <br /> @@ -2354,10 +4876,16 @@ http://www.gnu.org/software/src-highlite --> <summary>This is the third blog post about my Bash Golf series. This series is random Bash tips, tricks, and weirdnesses I have encountered over time. </summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='BashGolfPart3'>Bash Golf Part 3</h1><br /> + <h1 style='display: inline' id='bash-golf-part-3'>Bash Golf Part 3</h1><br /> <br /> <span class='quote'>Published at 2023-12-10T11:35:54+02:00</span><br /> <br /> +<span>This is the third blog post about my Bash Golf series. This series is random Bash tips, tricks, and weirdnesses I have encountered over time. </span><br /> +<br /> +<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> +<a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2</a><br /> +<a class='textlink' href='./2023-12-10-bash-golf-part-3.html'>2023-12-10 Bash Golf Part 3 (You are currently reading this)</a><br /> +<br /> <pre> '\ '\ '\ . . |>18>> \ \ \ . ' . | @@ -2369,13 +4897,20 @@ jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Art by Joan Stark, mod. by Paul Buetow </pre> <br /> -<span>This is the third blog post about my Bash Golf series. This series is random Bash tips, tricks, and weirdnesses I have encountered over time. </span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> -<a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2</a><br /> -<a class='textlink' href='./2023-12-10-bash-golf-part-3.html'>2023-12-10 Bash Golf Part 3 (You are currently reading this)</a><br /> -<br /> -<h2 style='display: inline' id='FUNCNAME'><span class='inlinecode'>FUNCNAME</span></h2><br /> +<ul> +<li><a href='#bash-golf-part-3'>Bash Golf Part 3</a></li> +<li>⇢ <a href='#funcname'><span class='inlinecode'>FUNCNAME</span></a></li> +<li>⇢ <a href='#--'><span class='inlinecode'>:(){ :|:& };:</span></a></li> +<li>⇢ <a href='#inner-functions'>Inner functions</a></li> +<li>⇢ <a href='#exporting-functions'>Exporting functions</a></li> +<li>⇢ <a href='#dynamic-variables-with-local'>Dynamic variables with <span class='inlinecode'>local</span></a></li> +<li>⇢ <a href='#if-conditionals'><span class='inlinecode'>if</span> conditionals</a></li> +<li>⇢ <a href='#multi-line-comments'>Multi-line comments</a></li> +<li>⇢ <a href='#don-t-change-it-while-it-s-executed'>Don't change it while it's executed</a></li> +</ul><br /> +<h2 style='display: inline' id='funcname'><span class='inlinecode'>FUNCNAME</span></h2><br /> <br /> <span><span class='inlinecode'>FUNCNAME</span> is an array you are looking for a way to dynamically determine the name of the current function (which could be considered the callee in the context of its own execution), you can use the special variable <span class='inlinecode'>FUNCNAME</span>. This is an array variable that contains the names of all shell functions currently in the execution call stack. The element <span class='inlinecode'>FUNCNAME[0]</span> holds the name of the currently executing function, <span class='inlinecode'>FUNCNAME[1]</span> the name of the function that called that, and so on.</span><br /> <br /> @@ -2385,24 +4920,24 @@ jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/env bash</font></i> +<pre><i><font color="silver">#!/usr/bin/env bash</font></i> -<font color="#7bc710">log ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">level</font><font color="#F3E651">=</font><font color="#bb00ff">"$1"</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">shift</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">message</font><font color="#F3E651">=</font><font color="#bb00ff">"$1"</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">shift</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -i </font><font color="#ff0000">pid</font><font color="#F3E651">=</font><font color="#bb00ff">"$$"</font> +log () { + <b><u><font color="#000000">local</font></u></b> -r level=<font color="#808080">"$1"</font>; <b><u><font color="#000000">shift</font></u></b> + <b><u><font color="#000000">local</font></u></b> -r message=<font color="#808080">"$1"</font>; <b><u><font color="#000000">shift</font></u></b> + <b><u><font color="#000000">local</font></u></b> -i pid=<font color="#808080">"$$"</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">callee</font><font color="#F3E651">=</font><font color="#ff0000">${FUNCNAME[1]}</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">stamp</font><font color="#F3E651">=</font><font color="#ff0000">$(</font><font color="#ff0000">date </font><font color="#F3E651">+%</font><font color="#ff0000">Y</font><font color="#F3E651">%</font><font color="#ff0000">m</font><font color="#F3E651">%</font><font color="#ff0000">d-</font><font color="#F3E651">%</font><font color="#ff0000">H</font><font color="#F3E651">%</font><font color="#ff0000">M</font><font color="#F3E651">%</font><font color="#ff0000">S</font><font color="#F3E651">)</font> + <b><u><font color="#000000">local</font></u></b> -r callee=${FUNCNAME[1]} + <b><u><font color="#000000">local</font></u></b> -r stamp=$(date +%Y%m%d-%H%M%S) -<font color="#ff0000"> echo </font><font color="#bb00ff">"$level|$stamp|$pid|$callee|$message"</font><font color="#ff0000"> </font><font color="#F3E651">>&</font><font color="#bb00ff">2</font> -<font color="#ff0000">}</font> + echo <font color="#808080">"$level|$stamp|$pid|$callee|$message"</font> >&<font color="#000000">2</font> +} -<font color="#7bc710">at_home_friday_evening ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> log INFO </font><font color="#bb00ff">'One Peperoni Pizza, please'</font> -<font color="#ff0000">}</font> +at_home_friday_evening () { + log INFO <font color="#808080">'One Peperoni Pizza, please'</font> +} -<font color="#ff0000">at_home_friday_evening</font> +at_home_friday_evening </pre> <br /> <span>The output is as follows:</span><br /> @@ -2411,11 +4946,11 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">❯ </font><font color="#F3E651">.</font><font color="#ff0000">/logexample</font><font color="#F3E651">.</font><font color="#ff0000">sh</font> -<font color="#ff0000">INFO</font><font color="#F3E651">|</font><font color="#bb00ff">20231210</font><font color="#ff0000">-</font><font color="#bb00ff">082732</font><font color="#F3E651">|</font><font color="#bb00ff">123002</font><font color="#F3E651">|</font><font color="#ff0000">at_home_friday_evening</font><font color="#F3E651">|</font><font color="#ff0000">One Peperoni Pizza</font><font color="#F3E651">,</font><font color="#ff0000"> please</font> +<pre>❯ ./logexample.sh +INFO|<font color="#000000">20231210</font>-<font color="#000000">082732</font>|<font color="#000000">123002</font>|at_home_friday_evening|One Peperoni Pizza, please </pre> <br /> -<h2 style='display: inline' id=''><span class='inlinecode'>:(){ :|:& };:</span></h2><br /> +<h2 style='display: inline' id='--'><span class='inlinecode'>:(){ :|:& };:</span></h2><br /> <br /> <span>This one may be widely known already, but I am including it here as I found a cute image illustrating it. But to break <span class='inlinecode'>:(){ :|:& };:</span> down:</span><br /> <br /> @@ -2438,7 +4973,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <a href='./bash-golf-part-3/bash-fork-bomb.jpg'><img alt='Bash fork bomb' title='Bash fork bomb' src='./bash-golf-part-3/bash-fork-bomb.jpg' /></a><br /> <br /> -<h2 style='display: inline' id='Innerfunctions'>Inner functions</h2><br /> +<h2 style='display: inline' id='inner-functions'>Inner functions</h2><br /> <br /> <span>Bash defines variables as it is interpreting the code. The same applies to function declarations. Let's consider this code:</span><br /> <br /> @@ -2446,18 +4981,18 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/env bash</font></i> +<pre><i><font color="silver">#!/usr/bin/env bash</font></i> -<font color="#7bc710">outer()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><font color="#7bc710">inner()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> echo </font><font color="#bb00ff">'Intel inside!'</font> -<font color="#ff0000"> }</font> -<font color="#ff0000"> inner</font> -<font color="#ff0000">}</font> +outer() { + inner() { + echo <font color="#808080">'Intel inside!'</font> + } + inner +} -<font color="#ff0000">inner</font> -<font color="#ff0000">outer</font> -<font color="#ff0000">inner</font> +inner +outer +inner </pre> <br /> <span>And let's execute it:</span><br /> @@ -2475,26 +5010,26 @@ Intel inside! by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/env bash</font></i> +<pre><i><font color="silver">#!/usr/bin/env bash</font></i> -<font color="#7bc710">outer1()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><font color="#7bc710">inner()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> echo </font><font color="#bb00ff">'Intel inside!'</font> -<font color="#ff0000"> }</font> -<font color="#ff0000"> inner</font> -<font color="#ff0000">}</font> +outer1() { + inner() { + echo <font color="#808080">'Intel inside!'</font> + } + inner +} -<font color="#7bc710">outer2()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><font color="#7bc710">inner()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> echo </font><font color="#bb00ff">'Wintel inside!'</font> -<font color="#ff0000"> }</font> -<font color="#ff0000"> inner</font> -<font color="#ff0000">}</font> +outer2() { + inner() { + echo <font color="#808080">'Wintel inside!'</font> + } + inner +} -<font color="#ff0000">outer1</font> -<font color="#ff0000">inner</font> -<font color="#ff0000">outer2</font> -<font color="#ff0000">inner</font> +outer1 +inner +outer2 +inner </pre> <br /> <span>And let's run it:</span><br /> @@ -2507,7 +5042,7 @@ Wintel inside! Wintel inside! </pre> <br /> -<h2 style='display: inline' id='Exportingfunctions'>Exporting functions</h2><br /> +<h2 style='display: inline' id='exporting-functions'>Exporting functions</h2><br /> <br /> <span>Have you ever wondered how to execute a shell function in parallel through <span class='inlinecode'>xargs</span>? The problem is that this won't work:</span><br /> <br /> @@ -2515,14 +5050,14 @@ Wintel inside! by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/env bash</font></i> +<pre><i><font color="silver">#!/usr/bin/env bash</font></i> -<font color="#7bc710">some_expensive_operations()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> echo </font><font color="#bb00ff">"Doing expensive operations with '$1' from pid $$"</font> -<font color="#ff0000">}</font> +some_expensive_operations() { + echo <font color="#808080">"Doing expensive operations with '$1' from pid $$"</font> +} -<b><font color="#ffffff">for</font></b><font color="#ff0000"> i </font><b><font color="#ffffff">in</font></b><font color="#ff0000"> {</font><font color="#bb00ff">0</font><font color="#F3E651">..</font><font color="#bb00ff">9</font><font color="#ff0000">}</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">do</font></b><font color="#ff0000"> echo </font><font color="#ff0000">$i</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">done</font></b><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> xargs -P</font><font color="#bb00ff">10</font><font color="#ff0000"> -I{} bash -c </font><font color="#bb00ff">'some_expensive_operations "{}"'</font> +<b><u><font color="#000000">for</font></u></b> i <b><u><font color="#000000">in</font></u></b> {<font color="#000000">0</font>..<font color="#000000">9</font>}; <b><u><font color="#000000">do</font></u></b> echo $i; <b><u><font color="#000000">done</font></u></b> \ + | xargs -P<font color="#000000">10</font> -I{} bash -c <font color="#808080">'some_expensive_operations "{}"'</font> </pre> <br /> <span>We try here to run ten parallel processes; each of them should run the <span class='inlinecode'>some_expensive_operations</span> function with a different argument. The arguments are provided to <span class='inlinecode'>xargs</span> through <span class='inlinecode'>STDIN</span> one per line. When executed, we get this:</span><br /> @@ -2547,15 +5082,15 @@ bash: line 1: some_expensive_operations: command not found by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/env bash</font></i> +<pre><i><font color="silver">#!/usr/bin/env bash</font></i> -<font color="#7bc710">some_expensive_operations()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> echo </font><font color="#bb00ff">"Doing expensive operations with '$1' from pid $$"</font> -<font color="#ff0000">}</font> -<b><font color="#ffffff">export</font></b><font color="#ff0000"> -f some_expensive_operations</font> +some_expensive_operations() { + echo <font color="#808080">"Doing expensive operations with '$1' from pid $$"</font> +} +<b><u><font color="#000000">export</font></u></b> -f some_expensive_operations -<b><font color="#ffffff">for</font></b><font color="#ff0000"> i </font><b><font color="#ffffff">in</font></b><font color="#ff0000"> {</font><font color="#bb00ff">0</font><font color="#F3E651">..</font><font color="#bb00ff">9</font><font color="#ff0000">}</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">do</font></b><font color="#ff0000"> echo </font><font color="#ff0000">$i</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">done</font></b><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> xargs -P</font><font color="#bb00ff">10</font><font color="#ff0000"> -I{} bash -c </font><font color="#bb00ff">'some_expensive_operations "{}"'</font> +<b><u><font color="#000000">for</font></u></b> i <b><u><font color="#000000">in</font></u></b> {<font color="#000000">0</font>..<font color="#000000">9</font>}; <b><u><font color="#000000">do</font></u></b> echo $i; <b><u><font color="#000000">done</font></u></b> \ + | xargs -P<font color="#000000">10</font> -I{} bash -c <font color="#808080">'some_expensive_operations "{}"'</font> </pre> <br /> <span>When we run this now, we get:</span><br /> @@ -2580,24 +5115,24 @@ Doing expensive operations with '9' from pid 132840 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/env bash</font></i> +<pre><i><font color="silver">#!/usr/bin/env bash</font></i> -<font color="#7bc710">some_other_function()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> echo </font><font color="#bb00ff">"$1"</font> -<font color="#ff0000">}</font> +some_other_function() { + echo <font color="#808080">"$1"</font> +} -<font color="#7bc710">some_expensive_operations()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> some_other_function </font><font color="#bb00ff">"Doing expensive operations with '$1' from pid $$"</font> -<font color="#ff0000">}</font> -<b><font color="#ffffff">export</font></b><font color="#ff0000"> -f some_expensive_operations</font> +some_expensive_operations() { + some_other_function <font color="#808080">"Doing expensive operations with '$1' from pid $$"</font> +} +<b><u><font color="#000000">export</font></u></b> -f some_expensive_operations -<b><font color="#ffffff">for</font></b><font color="#ff0000"> i </font><b><font color="#ffffff">in</font></b><font color="#ff0000"> {</font><font color="#bb00ff">0</font><font color="#F3E651">..</font><font color="#bb00ff">9</font><font color="#ff0000">}</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">do</font></b><font color="#ff0000"> echo </font><font color="#ff0000">$i</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">done</font></b><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> xargs -P</font><font color="#bb00ff">10</font><font color="#ff0000"> -I{} bash -c </font><font color="#bb00ff">'some_expensive_operations "{}"'</font> +<b><u><font color="#000000">for</font></u></b> i <b><u><font color="#000000">in</font></u></b> {<font color="#000000">0</font>..<font color="#000000">9</font>}; <b><u><font color="#000000">do</font></u></b> echo $i; <b><u><font color="#000000">done</font></u></b> \ + | xargs -P<font color="#000000">10</font> -I{} bash -c <font color="#808080">'some_expensive_operations "{}"'</font> </pre> <br /> <span>... because <span class='inlinecode'>some_other_function</span> isn't exported! You will also need to add an <span class='inlinecode'>export -f some_other_function</span>!</span><br /> <br /> -<h2 style='display: inline' id='Dynamicvariableswithlocal'>Dynamic variables with <span class='inlinecode'>local</span></h2><br /> +<h2 style='display: inline' id='dynamic-variables-with-local'>Dynamic variables with <span class='inlinecode'>local</span></h2><br /> <br /> <span>You may know that <span class='inlinecode'>local</span> is how to declare local variables in a function. Most don't know that those variables actually have dynamic scope. Let's consider the following example:</span><br /> <br /> @@ -2605,22 +5140,22 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/env bash</font></i> +<pre><i><font color="silver">#!/usr/bin/env bash</font></i> -<font color="#7bc710">foo()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> </font><font color="#ff0000">foo</font><font color="#F3E651">=</font><font color="#ff0000">bar </font><i><font color="#ababab"># Declare local/dynamic variable</font></i> -<font color="#ff0000"> bar</font> -<font color="#ff0000"> echo </font><font color="#bb00ff">"$foo"</font> -<font color="#ff0000">}</font> +foo() { + <b><u><font color="#000000">local</font></u></b> foo=bar <i><font color="silver"># Declare local/dynamic variable</font></i> + bar + echo <font color="#808080">"$foo"</font> +} -<font color="#7bc710">bar()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> echo </font><font color="#bb00ff">"$foo"</font> -<font color="#ff0000"> </font><font color="#ff0000">foo</font><font color="#F3E651">=</font><font color="#ff0000">baz</font> -<font color="#ff0000">}</font> +bar() { + echo <font color="#808080">"$foo"</font> + foo=baz +} -<font color="#ff0000">foo</font><font color="#F3E651">=</font><font color="#ff0000">foo </font><i><font color="#ababab"># Declare global variable</font></i> -<font color="#ff0000">foo </font><i><font color="#ababab"># Call function foo</font></i> -<font color="#ff0000">echo </font><font color="#bb00ff">"$foo"</font> +foo=foo <i><font color="silver"># Declare global variable</font></i> +foo <i><font color="silver"># Call function foo</font></i> +echo <font color="#808080">"$foo"</font> </pre> <br /> <span>Let's pause a minute. What do you think the output would be?</span><br /> @@ -2637,7 +5172,7 @@ foo <span>What happened? The variable <span class='inlinecode'>foo</span> (declared with <span class='inlinecode'>local</span>) is available in the function it was declared in and in all other functions down the call stack! We can even modify the value of <span class='inlinecode'>foo</span>, and the change will be visible up the call stack. It's not a global variable; on the last line, <span class='inlinecode'>echo "$foo"</span> echoes the global variable content.</span><br /> <br /> <br /> -<h2 style='display: inline' id='ifconditionals'><span class='inlinecode'>if</span> conditionals</h2><br /> +<h2 style='display: inline' id='if-conditionals'><span class='inlinecode'>if</span> conditionals</h2><br /> <br /> <span>Consider all variants here more or less equivalent:</span><br /> <br /> @@ -2645,34 +5180,34 @@ foo by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/env bash</font></i> +<pre><i><font color="silver">#!/usr/bin/env bash</font></i> -<b><font color="#ffffff">declare</font></b><font color="#ff0000"> -r </font><font color="#ff0000">foo</font><font color="#F3E651">=</font><font color="#ff0000">foo</font> -<b><font color="#ffffff">declare</font></b><font color="#ff0000"> -r </font><font color="#ff0000">bar</font><font color="#F3E651">=</font><font color="#ff0000">bar</font> +<b><u><font color="#000000">declare</font></u></b> -r foo=foo +<b><u><font color="#000000">declare</font></u></b> -r bar=bar -<b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#bb00ff">"$foo"</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> foo </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#bb00ff">"$bar"</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> bar </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> echo ok1</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> -<b><font color="#ffffff">fi</font></b> +<b><u><font color="#000000">if</font></u></b> [ <font color="#808080">"$foo"</font> = foo ]; <b><u><font color="#000000">then</font></u></b> + <b><u><font color="#000000">if</font></u></b> [ <font color="#808080">"$bar"</font> = bar ]; <b><u><font color="#000000">then</font></u></b> + echo ok1 + <b><u><font color="#000000">fi</font></u></b> +<b><u><font color="#000000">fi</font></u></b> -<b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#bb00ff">"$foo"</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> foo </font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">&&</font><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#bb00ff">"$bar"</font><font color="#ff0000"> </font><font color="#F3E651">==</font><font color="#ff0000"> bar </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> echo ok2a</font> -<b><font color="#ffffff">fi</font></b> +<b><u><font color="#000000">if</font></u></b> [ <font color="#808080">"$foo"</font> = foo ] && [ <font color="#808080">"$bar"</font> == bar ]; <b><u><font color="#000000">then</font></u></b> + echo ok2a +<b><u><font color="#000000">fi</font></u></b> -<font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#bb00ff">"$foo"</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> foo </font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">&&</font><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#bb00ff">"$bar"</font><font color="#ff0000"> </font><font color="#F3E651">==</font><font color="#ff0000"> bar </font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">&&</font><font color="#ff0000"> echo ok2b</font> +[ <font color="#808080">"$foo"</font> = foo ] && [ <font color="#808080">"$bar"</font> == bar ] && echo ok2b -<b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[[</font><font color="#ff0000"> </font><font color="#bb00ff">"$foo"</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> foo </font><font color="#F3E651">&&</font><font color="#ff0000"> </font><font color="#bb00ff">"$bar"</font><font color="#ff0000"> </font><font color="#F3E651">==</font><font color="#ff0000"> bar </font><font color="#F3E651">]];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> echo ok3a</font> -<b><font color="#ffffff">fi</font></b> +<b><u><font color="#000000">if</font></u></b> [[ <font color="#808080">"$foo"</font> = foo && <font color="#808080">"$bar"</font> == bar ]]; <b><u><font color="#000000">then</font></u></b> + echo ok3a +<b><u><font color="#000000">fi</font></u></b> -<font color="#ff0000"> </font><font color="#F3E651">[[</font><font color="#ff0000"> </font><font color="#bb00ff">"$foo"</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> foo </font><font color="#F3E651">&&</font><font color="#ff0000"> </font><font color="#bb00ff">"$bar"</font><font color="#ff0000"> </font><font color="#F3E651">==</font><font color="#ff0000"> bar </font><font color="#F3E651">]]</font><font color="#ff0000"> </font><font color="#F3E651">&&</font><font color="#ff0000"> echo ok3b</font> + [[ <font color="#808080">"$foo"</font> = foo && <font color="#808080">"$bar"</font> == bar ]] && echo ok3b -<b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><b><font color="#ffffff">test</font></b><font color="#ff0000"> </font><font color="#bb00ff">"$foo"</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> foo </font><font color="#F3E651">&&</font><font color="#ff0000"> </font><b><font color="#ffffff">test</font></b><font color="#ff0000"> </font><font color="#bb00ff">"$bar"</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> bar</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> echo ok4a</font> -<b><font color="#ffffff">fi</font></b> +<b><u><font color="#000000">if</font></u></b> <b><u><font color="#000000">test</font></u></b> <font color="#808080">"$foo"</font> = foo && <b><u><font color="#000000">test</font></u></b> <font color="#808080">"$bar"</font> = bar; <b><u><font color="#000000">then</font></u></b> + echo ok4a +<b><u><font color="#000000">fi</font></u></b> -<b><font color="#ffffff">test</font></b><font color="#ff0000"> </font><font color="#bb00ff">"$foo"</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> foo </font><font color="#F3E651">&&</font><font color="#ff0000"> </font><b><font color="#ffffff">test</font></b><font color="#ff0000"> </font><font color="#bb00ff">"$bar"</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> bar </font><font color="#F3E651">&&</font><font color="#ff0000"> echo ok4b</font> +<b><u><font color="#000000">test</font></u></b> <font color="#808080">"$foo"</font> = foo && <b><u><font color="#000000">test</font></u></b> <font color="#808080">"$bar"</font> = bar && echo ok4b </pre> <br /> <span>The output we get is:</span><br /> @@ -2688,7 +5223,7 @@ ok4a ok4b </pre> <br /> -<h2 style='display: inline' id='Multilinecomments'>Multi-line comments</h2><br /> +<h2 style='display: inline' id='multi-line-comments'>Multi-line comments</h2><br /> <br /> <span>You all know how to comment. Put a <span class='inlinecode'>#</span> in front of it. You could use multiple single-line comments or abuse heredocs and redirect it to the <span class='inlinecode'>:</span> no-op command to emulate multi-line comments. </span><br /> <br /> @@ -2696,23 +5231,23 @@ ok4b by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/env bash</font></i> +<pre><i><font color="silver">#!/usr/bin/env bash</font></i> -<i><font color="#ababab"># Single line comment</font></i> +<i><font color="silver"># Single line comment</font></i> -<i><font color="#ababab"># These are two single line</font></i> -<i><font color="#ababab"># comments one after another</font></i> +<i><font color="silver"># These are two single line</font></i> +<i><font color="silver"># comments one after another</font></i> -<font color="#F3E651">:</font><font color="#ff0000"> </font><font color="#F3E651"><<</font><font color="#ff0000">COMMENT</font> -<font color="#ff0000">This is another way a</font> -<font color="#ff0000">multi line comment</font> -<font color="#ff0000">could be written</font><font color="#F3E651">!</font> -<font color="#ff0000">COMMENT</font> +: <<COMMENT +This is another way a +multi line comment +could be written! +COMMENT </pre> <br /> <span>I will not demonstrate the execution of this script, as it won't print anything! It's obviously not the most pretty way of commenting on your code, but it could sometimes be handy!</span><br /> <br /> -<h2 style='display: inline' id='Dontchangeitwhileitsexecuted'>Don't change it while it's executed</h2><br /> +<h2 style='display: inline' id='don-t-change-it-while-it-s-executed'>Don't change it while it's executed</h2><br /> <br /> <span>Consider this script:</span><br /> <br /> @@ -2720,11 +5255,11 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/env bash</font></i> +<pre><i><font color="silver">#!/usr/bin/env bash</font></i> -<font color="#ff0000">echo foo</font> -<font color="#ff0000">echo echo baz </font><font color="#F3E651">>></font><font color="#ff0000"> </font><font color="#ff0000">$0</font> -<font color="#ff0000">echo bar</font> +echo foo +echo echo baz >> $0 +echo bar </pre> <br /> <span>When it is run, it will do:</span><br /> @@ -2749,18 +5284,18 @@ echo baz <br /> <span>Other related posts are:</span><br /> <br /> -<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>2021-05-16 Personal Bash coding style guide</a><br /> -<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> -<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> -<a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2</a><br /> <a class='textlink' href='./2023-12-10-bash-golf-part-3.html'>2023-12-10 Bash Golf Part 3 (You are currently reading this)</a><br /> +<a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2</a><br /> +<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> +<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>2021-05-16 Personal Bash coding style guide</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> </entry> <entry> - <title>Site Reliability Engineering - Part 2: Operational Balance in SRE</title> + <title>Site Reliability Engineering - Part 2: Operational Balance</title> <link href="gemini://foo.zone/gemfeed/2023-11-19-site-reliability-engineering-part-2.gmi" /> <id>gemini://foo.zone/gemfeed/2023-11-19-site-reliability-engineering-part-2.gmi</id> <updated>2023-11-19T00:18:18+03:00</updated> @@ -2771,15 +5306,16 @@ echo baz <summary>This is the second part of my Site Reliability Engineering (SRE) series. I am currently employed as a Site Reliability Engineer and will try to share what SRE is about in this blog series.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='SiteReliabilityEngineeringPart2OperationalBalanceinSRE'>Site Reliability Engineering - Part 2: Operational Balance in SRE</h1><br /> + <h1 style='display: inline' id='site-reliability-engineering---part-2-operational-balance'>Site Reliability Engineering - Part 2: Operational Balance</h1><br /> <br /> <span class='quote'>Published at 2023-11-19T00:18:18+03:00</span><br /> <br /> <span>This is the second part of my Site Reliability Engineering (SRE) series. I am currently employed as a Site Reliability Engineer and will try to share what SRE is about in this blog series.</span><br /> <br /> <a class='textlink' href='./2023-08-18-site-reliability-engineering-part-1.html'>2023-08-18 Site Reliability Engineering - Part 1: SRE and Organizational Culture</a><br /> -<a class='textlink' href='./2023-11-19-site-reliability-engineering-part-2.html'>2023-11-19 Site Reliability Engineering - Part 2: Operational Balance in SRE (You are currently reading this)</a><br /> -<a class='textlink' href='./2024-01-09-site-reliability-engineering-part-3.html'>2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect</a><br /> +<a class='textlink' href='./2023-11-19-site-reliability-engineering-part-2.html'>2023-11-19 Site Reliability Engineering - Part 2: Operational Balance (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-01-09-site-reliability-engineering-part-3.html'>2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture</a><br /> +<a class='textlink' href='./2024-09-07-site-reliability-engineering-part-4.html'>2024-09-07 Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers</a><br /> <br /> <pre> ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⣷⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ @@ -2796,27 +5332,26 @@ echo baz ⠀⠀⠀⠀⠀⠀⠴⠶⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠶⠦⠀⠀ </pre> <br /> -<h2 style='display: inline' id='OperationalBalanceinSREFindingtheEquilibriuminReliabilityandVelocity'>Operational Balance in SRE: Finding the Equilibrium in Reliability and Velocity</h2><br /> -<br /> -<span>Site Reliability Engineering has established itself as more than just a set of best practices or methodologies. Instead, it stands as a beacon of operational excellence, which guides engineering teams through the turbulent waters of modern software development and system management.</span><br /> +<h2 style='display: inline' id='striking-the-right-balance-between-reliability-and-speed'>Striking the Right Balance Between Reliability and Speed</h2><br /> <br /> -<span>In the universe of software production, two fundamental forces are often at odds: The drive for rapid feature release (velocity) and the need for system reliability. Traditionally, the faster teams moved, the more risk was introduced into systems. SRE offers a approach to mitigate these conflicting drives through concepts like error budgets and SLIs/SLOs. These mechanisms offer a tangible metric, allowing teams to quantify how much they can push changes while ensuring they don't compromise system health. Thus, the error budget becomes a balancing act, where teams weigh the trade-offs between innovation and reliability.</span><br /> +<span>Site Reliability Engineering is more than just a bunch of best practices or methods. It's a guiding light for engineering teams, helping them navigate the tricky waters of modern software development and system management.</span><br /> +<span>In the world of software production, there are two big forces that often clash: the push for fast feature releases (velocity) and the need for reliable systems. Traditionally, moving faster meant more risk. SRE helps balance these opposing goals with things like error budgets and SLIs/SLOs. These tools give teams a clear way to measure how much they can push changes without hurting system health. So, the error budget becomes a balancing act, helping teams trade off between innovation and reliability.</span><br /> <br /> -<span>An important part of this balance is the dichotomy between operations and coding. According to SRE principles, an engineer should ideally spend an equal amount of time on operations work and coding - 50% on each. This isn't just a random metric; it's a reflection of the value SRE places on both maintaining operational excellence and progressing forward with innovations. This balance ensures that while SREs are solving today's problems, they are also preparing for tomorrow's challenges. </span><br /> +<span>Finding the right balance in SRE means juggling operations and coding. Ideally, engineers should split their time 50/50 between these tasks. This isn't just a random rule; it highlights how much SRE values both maintaining smooth operations and driving innovation. This way, SREs not only handle today's problems but also prepare for tomorrow's challenges.</span><br /> <br /> -<span>However, not all operational tasks are equal. SRE differentiates between "ops work" and "toil". While ops work is integral to system maintenance and can provide value, toil represents repetitive, mundane tasks which offer little value in the long run. Recognising and minimising toil is crucial. A culture that allows engineers to drown in toil stifles innovation and growth. Hence, an organisation's approach to toil indicates its operational health and commitment to balance.</span><br /> +<span>But not all operations tasks are the same. SRE makes a clear distinction between "ops work" and "toil." Ops work is essential for maintaining systems and adds value, while toil is the repetitive, boring stuff that doesn’t. It's super important to recognize and minimize toil because a culture that lets engineers get bogged down in it will kill innovation and growth. The way an organization handles toil says a lot about its operational health and commitment to balance.</span><br /> <br /> -<span>A cornerstone of achieving operational balance lies in the tools and processes SREs use. Effective monitoring, observability tools, and ensuring that tools can handle high cardinality data are foundational. These aren't just technical requisites but reflective of an organisational culture prioritising proactive problem-solving. By having systems that effectively flag potential issues before they escalate, SREs can maintain the balance between system stability and forward momentum.</span><br /> +<span>A key part of finding operational balance is the tools and processes that SREs use. Great monitoring and observability tools, especially those that can handle lots of complex data, are essential. This isn’t just about having the right tech—it shows that the organization values proactive problem-solving. With systems that can spot potential issues early, SREs can keep things stable while still pushing forward.</span><br /> <br /> -<span>Moreover, operational balance isn't just a technological or process challenge; it's a human one. The health of on-call engineers is as crucial as the health of the services they manage. On-call postmortems, continuous feedback loops, and recognising gaps (be it tooling, operational expertise, or resources) ensure that the human elements of operations are noticed. </span><br /> +<span>Operational balance isn't just about tech or processes; it's also about people. The well-being of on-call engineers is just as important as the health of the services they manage. Doing postmortems after incidents, having continuous feedback loops, and identifying gaps in tools, skills, or resources all help make sure the human side of operations gets the attention it deserves.</span><br /> <br /> -<span>In conclusion, operational balance in SRE isn't static thing but an ongoing journey. It requires organisations to constantly evaluate their practices, tools, and, most importantly, their culture. By achieving this balance, organisations can ensure that they have time for innovation while maintaining the robustness and reliability of their systems, resulting in sustainable long-term success.</span><br /> +<span>In the end, finding operational balance in SRE is an ongoing journey, not a one-time thing. Companies need to keep reassessing their practices, tools, and especially their culture. When they get this balance right, they can keep innovating without sacrificing the reliability of their systems, leading to long-term success.</span><br /> <br /> -<span>That all sounds very romantic. The truth is, it's brutal to archive the perfect balance. No system will ever be perfect. But at least we should aim for it!</span><br /> +<span>That all sounds pretty idealistic. The reality is that getting the perfect balance is really tough. No system is ever going to be perfect. But hey, we should still strive for it!</span><br /> <br /> <span>Continue with the third part of this series:</span><br /> <br /> -<a class='textlink' href='./2024-01-09-site-reliability-engineering-part-3.html'>2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect</a><br /> +<a class='textlink' href='./2024-01-09-site-reliability-engineering-part-3.html'>2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture</a><br /> <br /> <span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> <br /> @@ -2836,7 +5371,7 @@ echo baz <summary>These are my personal takeaways after reading 'Mind Management' by David Kadavy. Note that the book contains much more knowledge wisdom and that these notes only contain points I personally found worth writing down. This is mainly for my own use, but you might find it helpful too.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='MindManagementbooknotes'>"Mind Management" book notes</h1><br /> + <h1 style='display: inline' id='mind-management-book-notes'>"Mind Management" book notes</h1><br /> <br /> <span class='quote'>Published at 2023-11-11T22:21:47+02:00</span><br /> <br /> @@ -2854,17 +5389,33 @@ echo baz ''' </pre> <br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#mind-management-book-notes'>"Mind Management" book notes</a></li> +<li>⇢ <a href='#it-s-not-about-time-management'>It's not about time management</a></li> +<li>⇢ <a href='#empty-slots-in-the-calendar'>Empty slots in the calendar</a></li> +<li>⇢ <a href='#when-you-safe-time'>When you safe time...</a></li> +<li>⇢ <a href='#follow-your-mood'>Follow your mood</a></li> +<li>⇢ <a href='#boosting-creativity'>Boosting creativity</a></li> +<li>⇢ <a href='#the-right-mood-for-the-task-at-hand'>The right mood for the task at hand</a></li> +<li>⇢ <a href='#creativity-hacks'>Creativity hacks</a></li> +<li>⇢ <a href='#planning-and-strategizing'>Planning and strategizing</a></li> +<li>⇢ <a href='#fake-it-until-you-make-it-'>Fake it until you make it. </a></li> +</ul><br /> +<h2 style='display: inline' id='it-s-not-about-time-management'>It's not about time management</h2><br /> +<br /> <span>Productivity isn't about time management - it's about mind management. When you put a lot of effort into something, there are:</span><br /> <br /> <ul> <li>The point of diminishing returns</li> <li>The point of negative return</li> </ul><br /> -<h2 style='display: inline' id='Emptyslotsinthecalendar'>Empty slots in the calendar</h2><br /> +<h2 style='display: inline' id='empty-slots-in-the-calendar'>Empty slots in the calendar</h2><br /> <br /> <span>If we do more things in less time and use all possible slots, speed read, etc., we are more productive. But in reality, that's not the entire truth. You also exchange one thing against everything else.... You cut out too much from your actual life.</span><br /> <br /> -<h2 style='display: inline' id='Whenyousafetime'>When you safe time...</h2><br /> +<h2 style='display: inline' id='when-you-safe-time'>When you safe time...</h2><br /> <br /> <span>...keep it.</span><br /> <br /> @@ -2873,7 +5424,7 @@ echo baz <li>Creative thinking needs space. It will pay dividends tomorrow.</li> <li>You will be rewarded with the "Eureka effect" - a sudden new insight.</li> </ul><br /> -<h2 style='display: inline' id='Followyourmood'>Follow your mood</h2><br /> +<h2 style='display: inline' id='follow-your-mood'>Follow your mood</h2><br /> <br /> <span>Ask yourself: what is my mood now? We never have the energy to do anything, so the better strategy is to follow your current mode and energy. E.g.:</span><br /> <br /> @@ -2881,7 +5432,7 @@ echo baz <li>Didn't sleep enough today? Then, do simple, non-demanding tasks at work</li> <li>Had a great sleep, and there is even time before work starts? Pull in a workout...</li> </ul><br /> -<h2 style='display: inline' id='Boostingcreativity'>Boosting creativity</h2><br /> +<h2 style='display: inline' id='boosting-creativity'>Boosting creativity</h2><br /> <br /> <span>The morning without coffee is a gift for creativity, but you often get distracted. Minimize distractions, too. I have no window to stare out but a plain blank wall.</span><br /> <br /> @@ -2891,7 +5442,7 @@ echo baz <li>Don't race with time but walk alongside it as rough time lines.</li> <li>Don't judge every day after the harvest, but the seed you lay</li> </ul><br /> -<h2 style='display: inline' id='Therightmoodforthetaskathand'>The right mood for the task at hand</h2><br /> +<h2 style='display: inline' id='the-right-mood-for-the-task-at-hand'>The right mood for the task at hand</h2><br /> <br /> <span>We need to try many different combinations. Limiting ourselves and trying too hard makes us frustrated and burn out. Creativity requires many iterations.</span><br /> <br /> @@ -2905,7 +5456,7 @@ echo baz <br /> <span>It gives you pleasure and is in a good mood. This increases creativity if you do what you want to do.</span><br /> <br /> -<h2 style='display: inline' id='Creativityhacks'>Creativity hacks</h2><br /> +<h2 style='display: inline' id='creativity-hacks'>Creativity hacks</h2><br /> <br /> <ul> <li>Coffee can cause anxiety.</li> @@ -2916,7 +5467,7 @@ echo baz <li>Go to open spaces for creativity.</li> <li>Go to closed spaces for polishing.</li> </ul><br /> -<h2 style='display: inline' id='Planningandstrategizing'>Planning and strategizing</h2><br /> +<h2 style='display: inline' id='planning-and-strategizing'>Planning and strategizing</h2><br /> <br /> <span>Minds work better in sprints and not in marathons. Have a weekly plan, not a daily one.</span><br /> <br /> @@ -2929,7 +5480,7 @@ echo baz <br /> <span>You could schedule exploratory tasks when you are under grief. Sound systems should create slack for creativity. Plan only for a few minutes.</span><br /> <br /> -<h2 style='display: inline' id='Fakeituntilyoumakeit'>Fake it until you make it. </h2><br /> +<h2 style='display: inline' id='fake-it-until-you-make-it-'>Fake it until you make it. </h2><br /> <br /> <ul> <li>E.g. act calm if you want to be calm.</li> @@ -2940,15 +5491,15 @@ echo baz <br /> <span>Other book notes of mine are:</span><br /> <br /> -<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> -<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> -<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> -<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> -<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes (You are currently reading this)</a><br /> -<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2024-10-24-staff-engineer-book-notes.html'>2024-10-24 "Staff Engineer" book notes</a><br /> <a class='textlink' href='./2024-07-07-the-stoic-challenge-book-notes.html'>2024-07-07 "The Stoic Challenge" book notes</a><br /> +<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> +<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> +<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> <br /> -<a class='textlink' href='../resources.html'>More books and other resources I found useful.</a><br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> @@ -2965,10 +5516,16 @@ echo baz <summary>Once in a while, I share photos on the inter-web with either family and friends or on my The Irregular Ninja photo site. One hobby of mine is photography (even though I don't have enough time for it - so I am primarily a point-and-shoot photographer).</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='KISSstaticwebphotoalbumswithphotoalbumsh'>KISS static web photo albums with <span class='inlinecode'>photoalbum.sh</span></h1><br /> + <h1 style='display: inline' id='kiss-static-web-photo-albums-with-photoalbumsh'>KISS static web photo albums with <span class='inlinecode'>photoalbum.sh</span></h1><br /> <br /> <span class='quote'>Published at 2023-10-29T22:25:04+02:00</span><br /> <br /> +<span>Once in a while, I share photos on the inter-web with either family and friends or on my The Irregular Ninja photo site. One hobby of mine is photography (even though I don't have enough time for it - so I am primarily a point-and-shoot photographer).</span><br /> +<br /> +<span>I'm not particularly eager to use any photo social sharing platforms such as Flickr, 500px (I used them regularly in the past), etc., anymore. I value self-hosting, DIY and privacy (nobody should data mine my photos), and no third party should have any rights to my pictures. </span><br /> +<br /> +<span>I value KISS (keep it simple and stupid) and simplicity. All that's required for a web photo album is some simple HTML and spice it up with CSS. No need for JavaScript, no need for a complex dynamic website. </span><br /> +<br /> <pre> ___ .---------.._ ______!fsc!_....-' .g8888888p. '-------....._ @@ -2986,19 +5543,23 @@ echo baz '._____________________________________________.' </pre> <br /> -<h2 style='display: inline' id='Motivation'>Motivation</h2><br /> -<br /> -<span>Once in a while, I share photos on the inter-web with either family and friends or on my The Irregular Ninja photo site. One hobby of mine is photography (even though I don't have enough time for it - so I am primarily a point-and-shoot photographer).</span><br /> -<br /> -<span>I'm not particularly eager to use any photo social sharing platforms such as Flickr, 500px (I used them regularly in the past), etc., anymore. I value self-hosting, DIY and privacy (nobody should data mine my photos), and no third party should have any rights to my pictures. </span><br /> -<br /> -<span>I value KISS (keep it simple and stupid) and simplicity. All that's required for a web photo album is some simple HTML and spice it up with CSS. No need for JavaScript, no need for a complex dynamic website. </span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline' id='Introducingphotoalbumsh'>Introducing <span class='inlinecode'>photoalbum.sh</span></h2><br /> +<ul> +<li><a href='#kiss-static-web-photo-albums-with-photoalbumsh'>KISS static web photo albums with <span class='inlinecode'>photoalbum.sh</span></a></li> +<li>⇢ <a href='#introducing-photoalbumsh'>Introducing <span class='inlinecode'>photoalbum.sh</span></a></li> +<li>⇢ <a href='#installation'>Installation</a></li> +<li>⇢ <a href='#setting-it-up'>Setting it up</a></li> +<li>⇢ <a href='#generating-the-static-photo-album'>Generating the static photo album</a></li> +<li>⇢ <a href='#cleaning-it-up'>Cleaning it up</a></li> +<li>⇢ <a href='#html-templates'>HTML templates</a></li> +<li>⇢ <a href='#conclusion'>Conclusion</a></li> +</ul><br /> +<h2 style='display: inline' id='introducing-photoalbumsh'>Introducing <span class='inlinecode'>photoalbum.sh</span></h2><br /> <br /> <span><span class='inlinecode'>photoalbum.sh</span> is a minimal Bash (Bourne Again Shell) script for Unix-like operating systems (such as Linux) to generate static web photo albums. The resulting static photo album is pure HTML+CSS (without any JavaScript!). It is specially designed to be as simple as possible.</span><br /> <br /> -<h2 style='display: inline' id='Installation'>Installation</h2><br /> +<h2 style='display: inline' id='installation'>Installation</h2><br /> <br /> <span>Installation is straightforward. All required is a recent version of GNU Bash, GNU Make, Git and ImageMagick. On Fedora, the dependencies are installed with:</span><br /> <br /> @@ -3041,7 +5602,7 @@ cp ./src/photoalbum.default.conf /etc/default/photoalbum This is Photoalbum Version 0.5.1 </pre> <br /> -<h2 style='display: inline' id='Settingitup'>Setting it up</h2><br /> +<h2 style='display: inline' id='setting-it-up'>Setting it up</h2><br /> <br /> <span>Now, it's time to set up the Irregular Ninja static web photo album (or any other web photo album you may be setting up!)! Create a directory (here: <span class='inlinecode'>irregular.ninja</span> for the Irregular Ninja Photo site - or any oter sub-directory reflecting your album's name), and inside of that directory, create an <span class='inlinecode'>incoming</span> directory. The <span class='inlinecode'>incoming</span> directory. Copy all photos to be part of the album there.</span><br /> <br /> @@ -3074,42 +5635,42 @@ photoalbum makemake by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> photoalbum makemake</font> -<font color="#ff0000">You may now customize </font><font color="#F3E651">.</font><font color="#ff0000">/photoalbumrc and run make</font> - -<font color="#F3E651">%</font><font color="#ff0000"> cat Makefile</font> -<font color="#ff0000">all</font><font color="#F3E651">:</font> -<font color="#ff0000"> photoalbum generate photoalbumrc</font> -<font color="#ff0000">clean</font><font color="#F3E651">:</font> -<font color="#ff0000"> photoalbum clean photoalbumrc</font> - -<font color="#F3E651">%</font><font color="#ff0000"> cat photoalbumrc</font> -<i><font color="#ababab"># The title of the photoalbum</font></i> -<font color="#ff0000">TITLE</font><font color="#F3E651">=</font><font color="#bb00ff">'A simple Photoalbum'</font> - -<i><font color="#ababab"># Thumbnail height geometry</font></i> -<font color="#ff0000">THUMBHEIGHT</font><font color="#F3E651">=</font><font color="#bb00ff">300</font> -<i><font color="#ababab"># Normal geometry height (when viewing photo). Uncomment, to keep original size.</font></i> -<font color="#ff0000">HEIGHT</font><font color="#F3E651">=</font><font color="#bb00ff">1200</font> -<i><font color="#ababab"># Max previews per page.</font></i> -<font color="#ff0000">MAXPREVIEWS</font><font color="#F3E651">=</font><font color="#bb00ff">40</font> -<i><font color="#ababab"># Randomly shuffle all previews.</font></i> -<i><font color="#ababab"># SHUFFLE=yes</font></i> - -<i><font color="#ababab"># Diverse directories, need to be full paths, not relative!</font></i> -<font color="#ff0000">INCOMING_DIR</font><font color="#F3E651">=</font><font color="#ff0000">$(pwd)</font><font color="#ff0000">/incoming</font> -<font color="#ff0000">DIST_DIR</font><font color="#F3E651">=</font><font color="#ff0000">$(pwd)</font><font color="#ff0000">/dist</font> -<font color="#ff0000">TEMPLATE_DIR</font><font color="#F3E651">=</font><font color="#ff0000">/usr/share/photoalbum/templates/default</font> -<i><font color="#ababab">#TEMPLATE_DIR=/usr/share/photoalbum/templates/minimal</font></i> - -<i><font color="#ababab"># Includes a .tar of the incoming dir in the dist, can be yes or no</font></i> -<font color="#ff0000">TARBALL_INCLUDE</font><font color="#F3E651">=</font><font color="#ff0000">yes</font> -<font color="#ff0000">TARBALL_SUFFIX</font><font color="#F3E651">=.</font><font color="#ff0000">tar</font> -<font color="#ff0000">TAR_OPTS</font><font color="#F3E651">=</font><font color="#bb00ff">'-c'</font> - -<i><font color="#ababab"># Some debugging options</font></i> -<i><font color="#ababab">#set -e</font></i> -<i><font color="#ababab">#set -x</font></i> +<pre>% photoalbum makemake +You may now customize ./photoalbumrc and run make + +% cat Makefile +all: + photoalbum generate photoalbumrc +clean: + photoalbum clean photoalbumrc + +% cat photoalbumrc +<i><font color="silver"># The title of the photoalbum</font></i> +TITLE=<font color="#808080">'A simple Photoalbum'</font> + +<i><font color="silver"># Thumbnail height geometry</font></i> +THUMBHEIGHT=<font color="#000000">300</font> +<i><font color="silver"># Normal geometry height (when viewing photo). Uncomment, to keep original size.</font></i> +HEIGHT=<font color="#000000">1200</font> +<i><font color="silver"># Max previews per page.</font></i> +MAXPREVIEWS=<font color="#000000">40</font> +<i><font color="silver"># Randomly shuffle all previews.</font></i> +<i><font color="silver"># SHUFFLE=yes</font></i> + +<i><font color="silver"># Diverse directories, need to be full paths, not relative!</font></i> +INCOMING_DIR=$(pwd)/incoming +DIST_DIR=$(pwd)/dist +TEMPLATE_DIR=/usr/share/photoalbum/templates/default +<i><font color="silver">#TEMPLATE_DIR=/usr/share/photoalbum/templates/minimal</font></i> + +<i><font color="silver"># Includes a .tar of the incoming dir in the dist, can be yes or no</font></i> +TARBALL_INCLUDE=yes +TARBALL_SUFFIX=.tar +TAR_OPTS=<font color="#808080">'-c'</font> + +<i><font color="silver"># Some debugging options</font></i> +<i><font color="silver">#set -e</font></i> +<i><font color="silver">#set -x</font></i> </pre> <br /> <span>In the case for <span class='inlinecode'>irregular.ninja</span>, I changed the defaults to the following:</span><br /> @@ -3118,43 +5679,43 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">--- photoalbumrc 2023-10-29 21:42:00.894202045 +0200</font> -<font color="#ff0000">+++ photoalbumrc.new 2023-06-04 10:40:08.030994440 +0300</font> -<font color="#ff0000">@@ -1,23 +1,24 @@</font> -<font color="#ff0000"> # The title of the photoalbum</font> -<font color="#ff0000">-TITLE='A simple Photoalbum'</font> -<font color="#ff0000">+TITLE='Irregular.Ninja'</font> - -<font color="#ff0000"> # Thumbnail height geometry</font> -<font color="#ff0000">-THUMBHEIGHT=300</font> -<font color="#ff0000">+THUMBHEIGHT=400</font> -<font color="#ff0000"> # Normal geometry height (when viewing photo). Uncomment, to keep original size.</font> -<font color="#ff0000">-HEIGHT=1200</font> -<font color="#ff0000">+HEIGHT=1800</font> -<font color="#ff0000"> # Max previews per page.</font> -<font color="#ff0000"> MAXPREVIEWS=40</font> -<font color="#ff0000">-# Randomly shuffle all previews.</font> -<font color="#ff0000">-# SHUFFLE=yes</font> -<font color="#ff0000">+# Randomly shuffle</font> -<font color="#ff0000">+SHUFFLE=yes</font> - -<font color="#ff0000"> # Diverse directories, need to be full paths, not relative!</font> -<font color="#ff0000">-INCOMING_DIR=$(pwd)/incoming</font> -<font color="#ff0000">+INCOMING_DIR=~/Nextcloud/Photos/irregular.ninja</font> -<font color="#ff0000"> DIST_DIR=$(pwd)/dist</font> -<font color="#ff0000"> TEMPLATE_DIR=/usr/share/photoalbum/templates/default</font> -<font color="#ff0000"> #TEMPLATE_DIR=/usr/share/photoalbum/templates/minimal</font> - -<font color="#ff0000"> # Includes a .tar of the incoming dir in the dist, can be yes or no</font> -<font color="#ff0000">-TARBALL_INCLUDE=yes</font> -<font color="#ff0000">+TARBALL_INCLUDE=no</font> -<font color="#ff0000"> TARBALL_SUFFIX=.tar</font> -<font color="#ff0000"> TAR_OPTS='-c'</font> +<pre>--- photoalbumrc 2023-10-29 21:42:00.894202045 +0200 ++++ photoalbumrc.new 2023-06-04 10:40:08.030994440 +0300 +@@ -1,23 +1,24 @@ + # The title of the photoalbum +-TITLE='A simple Photoalbum' ++TITLE='Irregular.Ninja' + + # Thumbnail height geometry +-THUMBHEIGHT=300 ++THUMBHEIGHT=400 + # Normal geometry height (when viewing photo). Uncomment, to keep original size. +-HEIGHT=1200 ++HEIGHT=1800 + # Max previews per page. + MAXPREVIEWS=40 +-# Randomly shuffle all previews. +-# SHUFFLE=yes ++# Randomly shuffle ++SHUFFLE=yes + + # Diverse directories, need to be full paths, not relative! +-INCOMING_DIR=$(pwd)/incoming ++INCOMING_DIR=~/Nextcloud/Photos/irregular.ninja + DIST_DIR=$(pwd)/dist + TEMPLATE_DIR=/usr/share/photoalbum/templates/default + #TEMPLATE_DIR=/usr/share/photoalbum/templates/minimal + + # Includes a .tar of the incoming dir in the dist, can be yes or no +-TARBALL_INCLUDE=yes ++TARBALL_INCLUDE=no + TARBALL_SUFFIX=.tar + TAR_OPTS='-c' </pre> <br /> <span>So I changed the album title, adjusted some image and thumbnail dimensions, and I want all images to be randomly shuffled every time the album is generated! I also have all my photos in my Nextcloud Photo directory and don't want to copy them to the local <span class='inlinecode'>incoming</span> directory. Also, a tarball containing the whole album as a download isn't provided.</span><br /> <br /> -<h2 style='display: inline' id='Generatingthestaticphotoalbum'>Generating the static photo album</h2><br /> +<h2 style='display: inline' id='generating-the-static-photo-album'>Generating the static photo album</h2><br /> <br /> <span>Let's generate it. Depending on the image sizes and count, the following step may take a while. </span><br /> <br /> @@ -3217,15 +5778,15 @@ blurs html index.html photos thumbs <br /> <span class='quote'>PS: There's also a server-side synchronisation script mirroring the same content to another server for high availability reasons (out of scope for this blog post).</span><br /> <br /> -<h2 style='display: inline' id='Cleaningitup'>Cleaning it up</h2><br /> +<h2 style='display: inline' id='cleaning-it-up'>Cleaning it up</h2><br /> <br /> <span>A simple <span class='inlinecode'>make clean</span> will clean up the <span class='inlinecode'>./dist</span> directory and all other (if any) temp files created.</span><br /> <br /> -<h2 style='display: inline' id='HTMLtemplates'>HTML templates</h2><br /> +<h2 style='display: inline' id='html-templates'>HTML templates</h2><br /> <br /> <span>Poke around in this source directory. You will find a bunch of Bash-HTML template files. You could tweak them to your liking. </span><br /> <br /> -<h2 style='display: inline' id='Conclusion'>Conclusion</h2><br /> +<h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> <br /> <span>A decent looking (in my opinion, at least) in less than 500 (273 as of this writing, to be precise) lines of Bash code and with minimal dependencies; what more do you want? How many LOCs would this be in Raku with the same functionality (can it be sub-100?). </span><br /> <br /> @@ -3237,15 +5798,15 @@ blurs html index.html photos thumbs <br /> <span>Other Bash and KISS-related posts are:</span><br /> <br /> -<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>2021-05-16 Personal Bash coding style guide</a><br /> -<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> -<a class='textlink' href='./2021-09-12-keep-it-simple-and-stupid.html'>2021-09-12 Keep it simple and stupid</a><br /> -<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> -<a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2</a><br /> -<a class='textlink' href='./2023-06-01-kiss-server-monitoring-with-gogios.html'>2023-06-01 KISS server monitoring with Gogios</a><br /> -<a class='textlink' href='./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.html'>2023-10-29 KISS static web photo albums with <span class='inlinecode'>photoalbum.sh</span> (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-12-10-bash-golf-part-3.html'>2023-12-10 Bash Golf Part 3</a><br /> <a class='textlink' href='./2024-04-01-KISS-high-availability-with-OpenBSD.html'>2024-04-01 KISS high-availability with OpenBSD</a><br /> +<a class='textlink' href='./2023-12-10-bash-golf-part-3.html'>2023-12-10 Bash Golf Part 3</a><br /> +<a class='textlink' href='./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.html'>2023-10-29 KISS static web photo albums with <span class='inlinecode'>photoalbum.sh</span> (You are currently reading this)</a><br /> +<a class='textlink' href='./2023-06-01-kiss-server-monitoring-with-gogios.html'>2023-06-01 KISS server monitoring with Gogios</a><br /> +<a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2</a><br /> +<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> +<a class='textlink' href='./2021-09-12-keep-it-simple-and-stupid.html'>2021-09-12 Keep it simple and stupid</a><br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> +<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>2021-05-16 Personal Bash coding style guide</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> @@ -3263,7 +5824,7 @@ blurs html index.html photos thumbs <summary>Hey there. As I am pretty busy this month personally (I am now on Paternity Leave) and as I still want to post once monthly, the blog post of this month will only be some DTail usage examples. They're from the DTail documentation, but not all readers of my blog may be aware of those!</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='DTailusageexamples'>DTail usage examples</h1><br /> + <h1 style='display: inline' id='dtail-usage-examples'>DTail usage examples</h1><br /> <br /> <span class='quote'>Published at 2023-09-25T14:57:42+03:00</span><br /> <br /> @@ -3287,6 +5848,23 @@ blurs html index.html photos thumbs | | </pre> <br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#dtail-usage-examples'>DTail usage examples</a></li> +<li>⇢ <a href='#commands'>Commands</a></li> +<li>⇢ <a href='#following-logs'>Following logs</a></li> +<li>⇢ <a href='#aggregating-logs'>Aggregating logs</a></li> +<li>⇢ <a href='#how-to-use-dcat'>How to use <span class='inlinecode'>dcat</span></a></li> +<li>⇢ <a href='#how-to-use-dgrep'>How to use <span class='inlinecode'>dgrep</span></a></li> +<li>⇢ <a href='#how-to-use-dmap'>How to use <span class='inlinecode'>dmap</span></a></li> +<li>⇢ <a href='#how-to-use-the-dtail-serverless-mode'>How to use the DTail serverless mode</a></li> +<li>⇢ ⇢ <a href='#serverless-map-reduce-query'>Serverless map-reduce query</a></li> +<li>⇢ ⇢ <a href='#aggregating-csv-files'>Aggregating CSV files</a></li> +<li>⇢ ⇢ <a href='#other-serverless-commands'>Other serverless commands</a></li> +</ul><br /> +<h2 style='display: inline' id='commands'>Commands</h2><br /> +<br /> <span>DTail consists out of a server and several client binaries. In this post, I am showcasing their use!</span><br /> <br /> <ul> @@ -3297,7 +5875,7 @@ blurs html index.html photos thumbs <li>Use <span class='inlinecode'>dmap</span> to aggregate logs and other text files already written</li> <li><span class='inlinecode'>dserver</span> is the DTail server, where all the clients can connect to</li> </ul><br /> -<h2 style='display: inline' id='Followinglogs'>Following logs</h2><br /> +<h2 style='display: inline' id='following-logs'>Following logs</h2><br /> <br /> <span>The following example demonstrates how to follow logs of several servers at once. The server list is provided as a flat text file. The example filters all records containing the string <span class='inlinecode'>INFO</span>. Any other Go compatible regular expression can also be used instead of <span class='inlinecode'>INFO</span>.</span><br /> <br /> @@ -3305,7 +5883,7 @@ blurs html index.html photos thumbs by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dtail --servers serverlist</font><font color="#F3E651">.</font><font color="#ff0000">txt --grep INFO --files </font><font color="#bb00ff">"/var/log/dserver/*.log"</font> +<pre>% dtail --servers serverlist.txt --grep INFO --files <font color="#808080">"/var/log/dserver/*.log"</font> </pre> <br /> <span>Hint: you can also provide a comma separated server list, e.g.: <span class='inlinecode'>servers server1.example.org,server2.example.org:PORT,...</span></span><br /> @@ -3318,10 +5896,10 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dtail --servers serverlist</font><font color="#F3E651">.</font><font color="#ff0000">txt --grep INFO </font><font color="#bb00ff">"/var/log/dserver/*.log"</font> +<pre>% dtail --servers serverlist.txt --grep INFO <font color="#808080">"/var/log/dserver/*.log"</font> </pre> <br /> -<h2 style='display: inline' id='Aggregatinglogs'>Aggregating logs</h2><br /> +<h2 style='display: inline' id='aggregating-logs'>Aggregating logs</h2><br /> <br /> <span>To run ad-hoc map-reduce aggregations on newly written log lines you must add a query. The following example follows all remote log lines and prints out every few seconds the result to standard output.</span><br /> <br /> @@ -3331,10 +5909,10 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dtail --servers serverlist</font><font color="#F3E651">.</font><font color="#ff0000">txt </font><font color="#F3E651">\</font> -<font color="#ff0000"> --files </font><font color="#bb00ff">'/var/log/dserver/*.log'</font><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> --query </font><font color="#bb00ff">'from STATS select sum($goroutines),sum($cgocalls),</font> -<font color="#bb00ff"> last($time),max(lifetimeConnections)'</font> +<pre>% dtail --servers serverlist.txt \ + --files <font color="#808080">'/var/log/dserver/*.log'</font> \ + --query <font color="#808080">'from STATS select sum($goroutines),sum($cgocalls),</font> +<font color="#808080"> last($time),max(lifetimeConnections)'</font> </pre> <br /> <span>Beware: For map-reduce queries to work, you have to ensure that DTail supports your log format. Check out the documentaiton of the DTail query language and the DTail log formats on the DTail homepage for more information.</span><br /> @@ -3347,10 +5925,10 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dtail --servers serverlist</font><font color="#F3E651">.</font><font color="#ff0000">txt </font><font color="#F3E651">\</font> -<font color="#ff0000"> --files </font><font color="#bb00ff">'/var/log/dserver/*.log'</font><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> </font><font color="#bb00ff">'from STATS select sum($goroutines),sum($cgocalls),</font> -<font color="#bb00ff"> last($time),max(lifetimeConnections)'</font> +<pre>% dtail --servers serverlist.txt \ + --files <font color="#808080">'/var/log/dserver/*.log'</font> \ + <font color="#808080">'from STATS select sum($goroutines),sum($cgocalls),</font> +<font color="#808080"> last($time),max(lifetimeConnections)'</font> </pre> <br /> <span>Here is another example:</span><br /> @@ -3359,10 +5937,10 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dtail --servers serverlist</font><font color="#F3E651">.</font><font color="#ff0000">txt </font><font color="#F3E651">\</font> -<font color="#ff0000"> --files </font><font color="#bb00ff">'/var/log/dserver/*.log'</font><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> --query </font><font color="#bb00ff">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> -<font color="#bb00ff"> lifetimeConnections group by $hostname order by max($cgocalls)'</font> +<pre>% dtail --servers serverlist.txt \ + --files <font color="#808080">'/var/log/dserver/*.log'</font> \ + --query <font color="#808080">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> +<font color="#808080"> lifetimeConnections group by $hostname order by max($cgocalls)'</font> </pre> <br /> <a href='./dtail-usage-examples/dtail-map2.gif'><img alt='Tail map-reduce example 2' title='Tail map-reduce example 2' src='./dtail-usage-examples/dtail-map2.gif' /></a><br /> @@ -3373,12 +5951,12 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dtail --servers serverlist</font><font color="#F3E651">.</font><font color="#ff0000">txt </font><font color="#F3E651">\</font> -<font color="#ff0000"> --files </font><font color="#bb00ff">'/var/log/dserver/*.log'</font><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> --query </font><font color="#bb00ff">'from STATS select ... outfile append result.csv'</font> +<pre>% dtail --servers serverlist.txt \ + --files <font color="#808080">'/var/log/dserver/*.log'</font> \ + --query <font color="#808080">'from STATS select ... outfile append result.csv'</font> </pre> <br /> -<h2 style='display: inline' id='Howtousedcat'>How to use <span class='inlinecode'>dcat</span></h2><br /> +<h2 style='display: inline' id='how-to-use-dcat'>How to use <span class='inlinecode'>dcat</span></h2><br /> <br /> <span>The following example demonstrates how to cat files (display the full content of the files) on several servers at once.</span><br /> <br /> @@ -3388,7 +5966,7 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dcat --servers serverlist</font><font color="#F3E651">.</font><font color="#ff0000">txt --files /etc/hostname</font> +<pre>% dcat --servers serverlist.txt --files /etc/hostname </pre> <br /> <a href='./dtail-usage-examples/dcat.gif'><img alt='Cat example' title='Cat example' src='./dtail-usage-examples/dcat.gif' /></a><br /> @@ -3399,10 +5977,10 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dcat --servers serverlist</font><font color="#F3E651">.</font><font color="#ff0000">txt /etc/hostname</font> +<pre>% dcat --servers serverlist.txt /etc/hostname </pre> <br /> -<h2 style='display: inline' id='Howtousedgrep'>How to use <span class='inlinecode'>dgrep</span></h2><br /> +<h2 style='display: inline' id='how-to-use-dgrep'>How to use <span class='inlinecode'>dgrep</span></h2><br /> <br /> <span>The following example demonstrates how to grep files (display only the lines which match a given regular expression) of multiple servers at once. In this example, we look after some entries in <span class='inlinecode'>/etc/passwd</span>. This time, we don't provide the server list via an file but rather via a comma separated list directly on the command line. We also explore the <span class='inlinecode'>-before</span>, <span class='inlinecode'>-after</span> and <span class='inlinecode'>-max</span> flags (see animation).</span><br /> <br /> @@ -3410,9 +5988,9 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dgrep --servers server1</font><font color="#F3E651">.</font><font color="#ff0000">example</font><font color="#F3E651">.</font><font color="#ff0000">org</font><font color="#F3E651">:</font><font color="#bb00ff">2223</font><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> --files /etc/passwd </font><font color="#F3E651">\</font> -<font color="#ff0000"> --regex nologin</font> +<pre>% dgrep --servers server1.example.org:<font color="#000000">2223</font> \ + --files /etc/passwd \ + --regex nologin </pre> <br /> <span>Generally, <span class='inlinecode'>dgrep</span> is also a very useful way to search historic application logs for certain content.</span><br /> @@ -3421,7 +5999,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span class='quote'>Hint: <span class='inlinecode'>-regex</span> is an alias for <span class='inlinecode'>-grep</span>.</span><br /> <br /> -<h2 style='display: inline' id='Howtousedmap'>How to use <span class='inlinecode'>dmap</span></h2><br /> +<h2 style='display: inline' id='how-to-use-dmap'>How to use <span class='inlinecode'>dmap</span></h2><br /> <br /> <span>To run a map-reduce aggregation over logs written in the past, the <span class='inlinecode'>dmap</span> command can be used. The following example aggregates all map-reduce fields <span class='inlinecode'>dmap</span> will print interim results every few seconds. You can also write the result to an CSV file by adding <span class='inlinecode'>outfile result.csv</span> to the query.</span><br /> <br /> @@ -3429,17 +6007,17 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dmap --servers serverlist</font><font color="#F3E651">.</font><font color="#ff0000">txt </font><font color="#F3E651">\</font> -<font color="#ff0000"> --files </font><font color="#bb00ff">'/var/log/dserver/*.log'</font><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> --query </font><font color="#bb00ff">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> -<font color="#bb00ff"> lifetimeConnections group by $hostname order by max($cgocalls)'</font> +<pre>% dmap --servers serverlist.txt \ + --files <font color="#808080">'/var/log/dserver/*.log'</font> \ + --query <font color="#808080">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> +<font color="#808080"> lifetimeConnections group by $hostname order by max($cgocalls)'</font> </pre> <br /> <span>Remember: For that to work, you have to make sure that DTail supports your log format. You can either use the ones already defined in <span class='inlinecode'>internal/mapr/logformat</span> or add an extension to support a custom log format. The example here works out of the box though, as DTail understands its own log format already. </span><br /> <br /> <a href='./dtail-usage-examples/dmap.gif'><img alt='DMap example' title='DMap example' src='./dtail-usage-examples/dmap.gif' /></a><br /> <br /> -<h2 style='display: inline' id='HowtousetheDTailserverlessmode'>How to use the DTail serverless mode</h2><br /> +<h2 style='display: inline' id='how-to-use-the-dtail-serverless-mode'>How to use the DTail serverless mode</h2><br /> <br /> <span>Until now, all examples so far required to have remote server(s) to connect to. That makes sense, as after all DTail is a *distributed* tool. However, there are circumstances where you don't really need to connect to a server remotely. For example, you already have a login shell open to the server an all what you want is to run some queries directly on local log files.</span><br /> <br /> @@ -3447,7 +6025,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>All commands shown so far also work in a serverless mode. All what needs to be done is to omit a server list. The DTail client then starts in serverless mode.</span><br /> <br /> -<h3 style='display: inline' id='Serverlessmapreducequery'>Serverless map-reduce query</h3><br /> +<h3 style='display: inline' id='serverless-map-reduce-query'>Serverless map-reduce query</h3><br /> <br /> <span>The following <span class='inlinecode'>dmap</span> example is the same as the previously shown one, but the difference is that it operates on a local log file directly:</span><br /> <br /> @@ -3455,9 +6033,9 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dmap --files /var/log/dserver/dserver</font><font color="#F3E651">.</font><font color="#ff0000">log</font> -<font color="#ff0000"> --query </font><font color="#bb00ff">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> -<font color="#bb00ff"> lifetimeConnections group by $hostname order by max($cgocalls)'</font> +<pre>% dmap --files /var/log/dserver/dserver.log + --query <font color="#808080">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> +<font color="#808080"> lifetimeConnections group by $hostname order by max($cgocalls)'</font> </pre> <br /> <span>As a shorthand version the following command can be used:</span><br /> @@ -3466,9 +6044,9 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dmap </font><font color="#bb00ff">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> -<font color="#bb00ff"> lifetimeConnections group by $hostname order by max($cgocalls)'</font><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> /var/log/dsever/dserver</font><font color="#F3E651">.</font><font color="#ff0000">log</font> +<pre>% dmap <font color="#808080">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> +<font color="#808080"> lifetimeConnections group by $hostname order by max($cgocalls)'</font> \ + /var/log/dsever/dserver.log </pre> <br /> <span>You can also use a file input pipe as follows:</span><br /> @@ -3477,12 +6055,12 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> cat /var/log/dserver/dserver</font><font color="#F3E651">.</font><font color="#ff0000">log </font><font color="#F3E651">|</font><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> dmap </font><font color="#bb00ff">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> -<font color="#bb00ff"> lifetimeConnections group by $hostname order by max($cgocalls)'</font> +<pre>% cat /var/log/dserver/dserver.log | \ + dmap <font color="#808080">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> +<font color="#808080"> lifetimeConnections group by $hostname order by max($cgocalls)'</font> </pre> <br /> -<h3 style='display: inline' id='AggregatingCSVfiles'>Aggregating CSV files</h3><br /> +<h3 style='display: inline' id='aggregating-csv-files'>Aggregating CSV files</h3><br /> <br /> <span>In essence, this works exactly like aggregating logs. All files operated on must be valid CSV files and the first line of the CSV must be the header. E.g.:</span><br /> <br /> @@ -3490,21 +6068,21 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> cat example</font><font color="#F3E651">.</font><font color="#ff0000">csv</font> -<font color="#ff0000">name</font><font color="#F3E651">,</font><font color="#ff0000">lastname</font><font color="#F3E651">,</font><font color="#ff0000">age</font><font color="#F3E651">,</font><font color="#ff0000">profession</font> -<font color="#ff0000">Michael</font><font color="#F3E651">,</font><font color="#ff0000">Jordan</font><font color="#F3E651">,</font><font color="#bb00ff">40</font><font color="#F3E651">,</font><font color="#ff0000">Basketball player</font> -<font color="#ff0000">Michael</font><font color="#F3E651">,</font><font color="#ff0000">Jackson</font><font color="#F3E651">,</font><font color="#bb00ff">100</font><font color="#F3E651">,</font><font color="#ff0000">Singer</font> -<font color="#ff0000">Albert</font><font color="#F3E651">,</font><font color="#ff0000">Einstein</font><font color="#F3E651">,</font><font color="#bb00ff">200</font><font color="#F3E651">,</font><font color="#ff0000">Physician</font> -<font color="#F3E651">%</font><font color="#ff0000"> dmap --query </font><font color="#bb00ff">'select lastname,name where age > 40 logformat csv outfile result.csv'</font><font color="#ff0000"> example</font><font color="#F3E651">.</font><font color="#ff0000">csv</font> -<font color="#F3E651">%</font><font color="#ff0000"> cat result</font><font color="#F3E651">.</font><font color="#ff0000">csv</font> -<font color="#ff0000">lastname</font><font color="#F3E651">,</font><font color="#ff0000">name</font> -<font color="#ff0000">Jackson</font><font color="#F3E651">,</font><font color="#ff0000">Michael</font> -<font color="#ff0000">Einstein</font><font color="#F3E651">,</font><font color="#ff0000">Albert</font> +<pre>% cat example.csv +name,lastname,age,profession +Michael,Jordan,<font color="#000000">40</font>,Basketball player +Michael,Jackson,<font color="#000000">100</font>,Singer +Albert,Einstein,<font color="#000000">200</font>,Physician +% dmap --query <font color="#808080">'select lastname,name where age > 40 logformat csv outfile result.csv'</font> example.csv +% cat result.csv +lastname,name +Jackson,Michael +Einstein,Albert </pre> <br /> <span>DMap can also be used to query and aggregate CSV files from remote servers.</span><br /> <br /> -<h3 style='display: inline' id='Otherserverlesscommands'>Other serverless commands</h3><br /> +<h3 style='display: inline' id='other-serverless-commands'>Other serverless commands</h3><br /> <br /> <span>The serverless mode works transparently with all other DTail commands. Here are some examples:</span><br /> <br /> @@ -3512,44 +6090,44 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dtail /var/log/dserver/dserver</font><font color="#F3E651">.</font><font color="#ff0000">log</font> +<pre>% dtail /var/log/dserver/dserver.log </pre> <br /> <!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dtail --logLevel trace /var/log/dserver/dserver</font><font color="#F3E651">.</font><font color="#ff0000">log</font> +<pre>% dtail --logLevel trace /var/log/dserver/dserver.log </pre> <br /> <!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dcat /etc/passwd</font> +<pre>% dcat /etc/passwd </pre> <br /> <!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dcat --plain /etc/passwd </font><font color="#F3E651">></font><font color="#ff0000"> /etc/test</font> -<i><font color="#ababab"># Should show no differences.</font></i> -<font color="#ff0000">diff /etc/test /etc/passwd </font> +<pre>% dcat --plain /etc/passwd > /etc/test +<i><font color="silver"># Should show no differences.</font></i> +diff /etc/test /etc/passwd </pre> <br /> <!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dgrep --regex ERROR --files /var/log/dserver/dsever</font><font color="#F3E651">.</font><font color="#ff0000">log</font> +<pre>% dgrep --regex ERROR --files /var/log/dserver/dsever.log </pre> <br /> <!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dgrep --before </font><font color="#bb00ff">10</font><font color="#ff0000"> --after </font><font color="#bb00ff">10</font><font color="#ff0000"> --max </font><font color="#bb00ff">10</font><font color="#ff0000"> --grep ERROR /var/log/dserver/dsever</font><font color="#F3E651">.</font><font color="#ff0000">log</font> +<pre>% dgrep --before <font color="#000000">10</font> --after <font color="#000000">10</font> --max <font color="#000000">10</font> --grep ERROR /var/log/dserver/dsever.log </pre> <br /> <span>Use <span class='inlinecode'>--help</span> for more available options. Or go to the DTail page for more information! Hope you find DTail useful!</span><br /> @@ -3558,10 +6136,10 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other related posts are:</span><br /> <br /> -<a class='textlink' href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>2021-04-22 DTail - The distributed log tail program</a><br /> -<a class='textlink' href='./2022-03-06-the-release-of-dtail-4.0.0.html'>2022-03-06 The release of DTail 4.0.0</a><br /> -<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> <a class='textlink' href='./2023-09-25-dtail-usage-examples.html'>2023-09-25 DTail usage examples (You are currently reading this)</a><br /> +<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> +<a class='textlink' href='./2022-03-06-the-release-of-dtail-4.0.0.html'>2022-03-06 The release of DTail 4.0.0</a><br /> +<a class='textlink' href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>2021-04-22 DTail - The distributed log tail program</a><br /> <br /> <span>I hope you find the tools presented in this post useful!</span><br /> <br /> @@ -3580,18 +6158,19 @@ http://www.gnu.org/software/src-highlite --> <name>Paul Buetow aka snonux</name> <email>paul@dev.buetow.org</email> </author> - <summary>The universe of Site Reliability Engineering (SRE) is like an intricate tapestry woven with diverse technology, culture, and personal grit threads. Site Reliability Engineering is one of the most demanding jobs. With all the facets, it's impossible to get bored. There is always a new challenge to master, and there is always a new technology to tinker with. It's not just technical; it's also about communication, collaboration and teamwork. I am currently employed as a Site Reliability Engineer and will try to share what SRE is about in this blog series.</summary> + <summary>Being a Site Reliability Engineer (SRE) is like stepping into a lively, ever-evolving universe. The world of SRE mixes together different tech, a unique culture, and a whole lot of determination. It’s one of the toughest but most exciting jobs out there. There's zero chance of getting bored because there's always a fresh challenge to tackle and new technology to play around with. It's not just about the tech side of things either; it's heavily rooted in communication, collaboration, and teamwork. As someone currently working as an SRE, I’m here to break it all down for you in this blog series. Let's dive into what SRE is really all about!</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='SiteReliabilityEngineeringPart1SREandOrganizationalCulture'>Site Reliability Engineering - Part 1: SRE and Organizational Culture</h1><br /> + <h1 style='display: inline' id='site-reliability-engineering---part-1-sre-and-organizational-culture'>Site Reliability Engineering - Part 1: SRE and Organizational Culture</h1><br /> <br /> <span class='quote'>Published at 2023-08-18T22:43:47+03:00</span><br /> <br /> -<span>The universe of Site Reliability Engineering (SRE) is like an intricate tapestry woven with diverse technology, culture, and personal grit threads. Site Reliability Engineering is one of the most demanding jobs. With all the facets, it's impossible to get bored. There is always a new challenge to master, and there is always a new technology to tinker with. It's not just technical; it's also about communication, collaboration and teamwork. I am currently employed as a Site Reliability Engineer and will try to share what SRE is about in this blog series.</span><br /> +<span>Being a Site Reliability Engineer (SRE) is like stepping into a lively, ever-evolving universe. The world of SRE mixes together different tech, a unique culture, and a whole lot of determination. It’s one of the toughest but most exciting jobs out there. There's zero chance of getting bored because there's always a fresh challenge to tackle and new technology to play around with. It's not just about the tech side of things either; it's heavily rooted in communication, collaboration, and teamwork. As someone currently working as an SRE, I’m here to break it all down for you in this blog series. Let's dive into what SRE is really all about!</span><br /> <br /> <a class='textlink' href='./2023-08-18-site-reliability-engineering-part-1.html'>2023-08-18 Site Reliability Engineering - Part 1: SRE and Organizational Culture (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-11-19-site-reliability-engineering-part-2.html'>2023-11-19 Site Reliability Engineering - Part 2: Operational Balance in SRE</a><br /> -<a class='textlink' href='./2024-01-09-site-reliability-engineering-part-3.html'>2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect</a><br /> +<a class='textlink' href='./2023-11-19-site-reliability-engineering-part-2.html'>2023-11-19 Site Reliability Engineering - Part 2: Operational Balance</a><br /> +<a class='textlink' href='./2024-01-09-site-reliability-engineering-part-3.html'>2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture</a><br /> +<a class='textlink' href='./2024-09-07-site-reliability-engineering-part-4.html'>2024-09-07 Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers</a><br /> <br /> <pre> ▓▓▓▓░░ @@ -3615,29 +6194,29 @@ DC on fire: ░░░░░░░░░░▒▒░░░░░░░░░░░░░░░░░░░░░░░░▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒░░░░░░░░░░░░░░░░░░ </pre> <br /> -<h2 style='display: inline' id='SREandOrganizationalCultureNavigatingtheNexus'>SRE and Organizational Culture: Navigating the Nexus</h2><br /> +<h2 style='display: inline' id='sre-and-organizational-culture-navigating-the-nexus'>SRE and Organizational Culture: Navigating the Nexus</h2><br /> <br /> -<span>At the heart of SRE lies the proactive mindset of "prevention over cure." Traditional IT models focused predominantly on reactive solutions, but SRE mandates a shift towards foresight. By adopting Service Level Indicators (SLIs) and Service Level Objectives (SLOs), teams are equipped with clear metrics and goals that guide them toward ensuring reliability and user satisfaction. They reflect an organisational culture prioritising user experience and constant system alignment with user needs. </span><br /> +<span>At the core of SRE is the principle of "prevention over cure." Unlike traditional IT setups that mostly react to problems, SRE focuses on spotting issues before they happen. This proactive approach involves using Service Level Indicators (SLIs) and Service Level Objectives (SLOs). These tools give teams specific metrics and targets to aim for, helping them keep systems reliable and users happy. It's all about creating a culture that prioritizes user experience and makes sure everything runs smoothly to meet their needs.</span><br /> <br /> -<span>Another defining SRE idea concept the "error budget." This ingenious framework accepts that no system is flawless. Failures are inevitable. However, instead of being punitive, the culture here is to accept, learn, and iterate. By providing teams with a "budget" for errors, organisations create an environment where innovation is encouraged, and failures are viewed as learning opportunities.</span><br /> +<span>Another key concept in SRE is the "error budget." It’s a clever approach that recognizes no system is perfect and that failures will happen. Instead of punishing mistakes, SRE culture embraces them as chances to learn and improve. The idea is to give teams a "budget" for errors, creating a space where innovation can thrive and failures are simply seen as lessons learned.</span><br /> <br /> -<span>But SRE isn't just about technology and metrics; it's also human. It challenges the "hero culture" that plagues many IT teams. While individual heroics might occasionally save the day, a sustainable model requires collective expertise. An SRE culture recognises that heroes achieve their best within teams, negating the need for a hero-centric environment. This philosophy promotes a balanced on-call experience, emphasising the importance of trust, ownership, effective communication, and collaboration as cornerstones of team success. I personally have fallen into the hero trap, and know it's unsustainable to be the only go-to person for every arising problem.</span><br /> +<span>SRE isn't just about tech and metrics; it's also about people. It tackles the "hero culture" that often ends up burning out IT teams. Sure, having a hero swoop in to save the day can be great, but relying on that all the time just isn’t sustainable. Instead, SRE focuses on collective expertise and teamwork. It recognizes that heroes are at their best within a solid team, making the need for constant heroics unnecessary. This way of thinking promotes a balanced on-call experience and highlights trust, ownership, good communication, and collaboration as key to success. I've been there myself, falling into the hero trap, and I know firsthand that it's just not feasible to be the go-to person for every problem that comes up.</span><br /> <br /> -<span>Additionally, the SRE model requires good documentation. However, it's essential ensuring that this documentation undergoes the same quality checks as code, reinforcing effective onboarding, training and communication.</span><br /> +<span>Also, the SRE model puts a big emphasis on good documentation. It's not enough to just have docs; they need to be top-notch and go through the same quality checks as code. This really helps with onboarding new team members, training, and keeping everyone on the same page.</span><br /> <br /> -<span>Organisations might face a significant challenge when adopting SRE. Some might feel SRE principles counter their goals. They might prioritise feature rollouts over reliability or view SRE practices as cumbersome. Hence, creating an SRE culture often demands patient explanations and showcasing benefits, such as increased release velocity and improved user experience.</span><br /> +<span>Adopting SRE can be a big challenge for some organizations. They might think the SRE approach goes against their goals, like preferring to roll out new features quickly rather than focusing on reliability, or seeing SRE practices as too much hassle. Building an SRE culture often means taking the time to explain things patiently and showing the benefits, like faster release cycles and a better user experience.</span><br /> <br /> -<span>Monitoring and observability form another SRE aspect, emphasising the need for high-quality tools to query and analyse data. This ties back to the cultural emphasis on continuous learning and adaptability. SREs, by nature, need to be curious, ready to delve into anomalies, and keen on adopting new tools and practices. </span><br /> +<span>Monitoring and observability are also big parts of SRE, highlighting the need for top-notch tools to query and analyze data. This aligns with the SRE focus on continuous learning and being adaptable. SREs naturally need to be curious, ready to dive into any strange issues, and always open to picking up new tools and practices.</span><br /> <br /> -<span>The success of SRE within any organisation depends on the broader acceptance of its principles. It demands a move away from siloed operations, where SRE acts as a bandage on flawed systems, to a model where reliability is everyone's responsibility.</span><br /> +<span>For SRE to really work in any organization, everyone needs to buy into its principles. It's about moving away from working in isolated silos and relying on SRE to just patch things up. Instead, it’s about making reliability a shared responsibility across the whole team.</span><br /> <br /> -<span>In essence, the integration of SRE principles transcends technical practices. It paves the way for a shift in organisational culture that values proactive prevention, continuous learning, collaboration, and transparent communication. The successful melding of SRE and corporate culture promises not just reliable systems but also a robust, resilient, and progressive work environment.</span><br /> +<span>In short, bringing SRE principles into the mix goes beyond just the technical stuff. It helps shift the whole organizational culture to value things like preventing issues before they happen, always learning, working together, and being open with communication. When SRE and corporate culture blend well, you end up with not just reliable systems but also a strong, resilient, and forward-thinking workplace.</span><br /> <br /> -<span>Organisations with the implementation of SLIs, SLOs and error budgets are already advanced in their SRE journey. It takes a lot of communication, convincing, and patience until that point is reached.</span><br /> +<span>Organizations that have SLIs, SLOs, and error budgets in place are already pretty far along in their SRE journey. Getting there takes a lot of communication, convincing people, and patience.</span><br /> <br /> <span>Continue with the second part of this series:</span><br /> <br /> -<a class='textlink' href='./2023-11-19-site-reliability-engineering-part-2.html'>2023-11-19 Site Reliability Engineering - Part 2: Operational Balance in SRE</a><br /> +<a class='textlink' href='./2023-11-19-site-reliability-engineering-part-2.html'>2023-11-19 Site Reliability Engineering - Part 2: Operational Balance</a><br /> <br /> <span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> <br /> @@ -3657,10 +6236,14 @@ DC on fire: <summary>I proudly announce that I've released Gemtexter version `2.1.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown, written in GNU Bash.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Gemtexter210LetsGemtextagain'>Gemtexter 2.1.0 - Let's Gemtext again³</h1><br /> + <h1 style='display: inline' id='gemtexter-210---let-s-gemtext-again'>Gemtexter 2.1.0 - Let's Gemtext again³</h1><br /> <br /> <span class='quote'>Published at 2023-07-21T10:19:31+03:00</span><br /> <br /> +<span>I proudly announce that I've released Gemtexter version <span class='inlinecode'>2.1.0</span>. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown, written in GNU Bash.</span><br /> +<br /> +<a class='textlink' href='https://codeberg.org/snonux/gemtexter'>https://codeberg.org/snonux/gemtexter</a><br /> +<br /> <pre> -=[ typewriters ]=- 1/98 .-------. @@ -3674,21 +6257,29 @@ DC on fire: mod. by Paul Buetow `"""""""""` </pre> <br /> -<span>I proudly announce that I've released Gemtexter version <span class='inlinecode'>2.1.0</span>. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown, written in GNU Bash.</span><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/gemtexter'>https://codeberg.org/snonux/gemtexter</a><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline' id='WhyBash'>Why Bash?</h2><br /> +<ul> +<li><a href='#gemtexter-210---let-s-gemtext-again'>Gemtexter 2.1.0 - Let's Gemtext again³</a></li> +<li>⇢ <a href='#why-bash'>Why Bash?</a></li> +<li>⇢ <a href='#switch-to-gpl3-license'>Switch to GPL3 license</a></li> +<li>⇢ <a href='#source-code-highlighting-support'>Source code highlighting support</a></li> +<li>⇢ <a href='#html-exact-variant'>HTML exact variant</a></li> +<li>⇢ <a href='#use-of-hack-webfont-by-default'>Use of Hack webfont by default</a></li> +<li>⇢ <a href='#html-mastodon-verification-support'>HTML Mastodon verification support</a></li> +<li>⇢ <a href='#more'>More</a></li> +</ul><br /> +<h2 style='display: inline' id='why-bash'>Why Bash?</h2><br /> <br /> <span>This project is too complex for a Bash script. Writing it in Bash was to try out how maintainable a "larger" Bash script could be. It's still pretty maintainable and helps me try new Bash tricks here and then!</span><br /> <br /> <span>Let's list what's new!</span><br /> <br /> -<h2 style='display: inline' id='SwitchtoGPL3license'>Switch to GPL3 license</h2><br /> +<h2 style='display: inline' id='switch-to-gpl3-license'>Switch to GPL3 license</h2><br /> <br /> <span>Many (almost all) of the tools and commands (GNU Bash, GMU Sed, GNU Date, GNU Grep, GNU Source Highlight) used by <span class='inlinecode'>Gemtexter</span> are licensed under the GPL anyway. So why not use the same? This was an easy switch, as I was the only code contributor so far!</span><br /> <br /> -<h2 style='display: inline' id='Sourcecodehighlightingsupport'>Source code highlighting support</h2><br /> +<h2 style='display: inline' id='source-code-highlighting-support'>Source code highlighting support</h2><br /> <br /> <span>The HTML output now supports source code highlighting, which is pretty neat if your site is about programming. The requirement is to have the <span class='inlinecode'>source-highlight</span> command, which is GNU Source Highlight, to be installed. Once done, you can annotate a bare block with the language to be highlighted. E.g.:</span><br /> <br /> @@ -3706,18 +6297,18 @@ DC on fire: by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> -n </font><font color="#bb00ff">"$foo"</font><font color="#ff0000"> </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> echo </font><font color="#bb00ff">"$foo"</font> -<b><font color="#ffffff">fi</font></b> +<pre><b><u><font color="#000000">if</font></u></b> [ -n <font color="#808080">"$foo"</font> ]; <b><u><font color="#000000">then</font></u></b> + echo <font color="#808080">"$foo"</font> +<b><u><font color="#000000">fi</font></u></b> </pre> <br /> <span>Please run <span class='inlinecode'>source-highlight --lang-list</span> for a list of all supported languages.</span><br /> <br /> -<h2 style='display: inline' id='HTMLexactvariant'>HTML exact variant</h2><br /> +<h2 style='display: inline' id='html-exact-variant'>HTML exact variant</h2><br /> <br /> <span>Gemtexter is there to convert your Gemini Capsule into other formats, such as HTML and Markdown. An HTML exact variant can now be enabled in the <span class='inlinecode'>gemtexter.conf</span> by adding the line <span class='inlinecode'>declare -rx HTML_VARIANT=exact</span>. The HTML/CSS output changed to reflect a more exact Gemtext appearance and to respect the same spacing as you would see in the Geminispace. </span><br /> <br /> -<h2 style='display: inline' id='UseofHackwebfontbydefault'>Use of Hack webfont by default</h2><br /> +<h2 style='display: inline' id='use-of-hack-webfont-by-default'>Use of Hack webfont by default</h2><br /> <br /> <span>The Hack web font is a typeface designed explicitly for source code. It's a derivative of the Bitstream Vera and DejaVu Mono lineage, but it features many improvements and refinements that make it better suited to reading and writing code.</span><br /> <br /> @@ -3725,7 +6316,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Hack is open-source and freely available for use and modification under the MIT License.</span><br /> <br /> -<h2 style='display: inline' id='HTMLMastodonverificationsupport'>HTML Mastodon verification support</h2><br /> +<h2 style='display: inline' id='html-mastodon-verification-support'>HTML Mastodon verification support</h2><br /> <br /> <span>The following link explains how URL verification works in Mastodon:</span><br /> <br /> @@ -3737,7 +6328,7 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">declare</font></b><font color="#ff0000"> -xr </font><font color="#ff0000">MASTODON_URI</font><font color="#F3E651">=</font><font color="#bb00ff">'https://fosstodon.org/@snonux'</font> +<pre><b><u><font color="#000000">declare</font></u></b> -xr MASTODON_URI=<font color="#808080">'https://fosstodon.org/@snonux'</font> </pre> <br /> <span>and add the following into your <span class='inlinecode'>index.gmi</span>:</span><br /> @@ -3752,10 +6343,10 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff"><a</font></b><font color="#ff0000"> </font><b><font color="#F35E1E">href</font></b><font color="#F3E651">=</font><font color="#bb00ff">'https://fosstodon.org/@snonux'</font><font color="#ff0000"> </font><b><font color="#F35E1E">rel</font></b><font color="#F3E651">=</font><font color="#bb00ff">'me'</font><b><font color="#ffffff">></font></b><font color="#ff0000">Me at Mastodon</font><b><font color="#ffffff"></a></font></b> +<pre><b><u><font color="#000000"><a</font></u></b> <b><font color="#000000">href</font></b>=<font color="#808080">'https://fosstodon.org/@snonux'</font> <b><font color="#000000">rel</font></b>=<font color="#808080">'me'</font><b><u><font color="#000000">></font></u></b>Me at Mastodon<b><u><font color="#000000"></a></font></u></b> </pre> <br /> -<h2 style='display: inline' id='More'>More</h2><br /> +<h2 style='display: inline' id='more'>More</h2><br /> <br /> <span>Additionally, there were a couple of bug fixes, refactorings and overall improvements in the documentation made. </span><br /> <br /> @@ -3763,11 +6354,12 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other related posts are:</span><br /> <br /> -<a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace</a><br /> -<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> -<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> -<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again²</a><br /> +<a class='textlink' href='./2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.html'>2024-10-02 Gemtexter 3.0.0 - Let's Gemtext again⁴</a><br /> <a class='textlink' href='./2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.html'>2023-07-21 Gemtexter 2.1.0 - Let's Gemtext again³ (You are currently reading this)</a><br /> +<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again²</a><br /> +<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> +<a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> @@ -3785,7 +6377,7 @@ http://www.gnu.org/software/src-highlite --> <summary>These notes are of two books by 'John Sommez' I found helpful. I also added some of my own keypoints to it. These notes are mainly for my own use, but you might find them helpful, too.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='SoftwareDevelopmersCareerGuideandSoftSkillsbooknotes'>"Software Developmers Career Guide and Soft Skills" book notes</h1><br /> + <h1 style='display: inline' id='software-developmers-career-guide-and-soft-skills-book-notes'>"Software Developmers Career Guide and Soft Skills" book notes</h1><br /> <br /> <span class='quote'>Published at 2023-07-17T04:56:20+03:00</span><br /> <br /> @@ -3803,9 +6395,42 @@ http://www.gnu.org/software/src-highlite --> ''' </pre> <br /> -<h1 style='display: inline' id='Improve'>Improve</h1><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline' id='Alwayslearnnewthings'>Always learn new things</h2><br /> +<ul> +<li><a href='#software-developmers-career-guide-and-soft-skills-book-notes'>"Software Developmers Career Guide and Soft Skills" book notes</a></li> +<li>⇢ <a href='#improve'>Improve</a></li> +<li>⇢ ⇢ <a href='#always-learn-new-things'>Always learn new things</a></li> +<li>⇢ ⇢ <a href='#set-goals'>Set goals</a></li> +<li>⇢ ⇢ <a href='#ratings'>Ratings</a></li> +<li>⇢ ⇢ <a href='#promotions'>Promotions</a></li> +<li>⇢ ⇢ <a href='#finish-things'>Finish things</a></li> +<li>⇢ <a href='#expand-the-empire'>Expand the empire</a></li> +<li>⇢ <a href='#be-pragmatic-and-also-manage-your-time'>Be pragmatic and also manage your time</a></li> +<li>⇢ ⇢ <a href='#the-quota-system'>The quota system</a></li> +<li>⇢ ⇢ <a href='#don-t-waste-time'>Don't waste time</a></li> +<li>⇢ ⇢ <a href='#habits'>Habits</a></li> +<li><a href='#work-life-balance'>Work-life balance</a></li> +<li>⇢ <a href='#mental-health'>Mental health</a></li> +<li>⇢ <a href='#physical-health'>Physical health</a></li> +<li>⇢ <a href='#no-drama'>No drama</a></li> +<li><a href='#personal-brand'>Personal brand</a></li> +<li>⇢ <a href='#market-yourself'>Market yourself</a></li> +<li>⇢ <a href='#networking'>Networking</a></li> +<li>⇢ <a href='#public-speaking'>Public speaking</a></li> +<li><a href='#new-job'>New job</a></li> +<li>⇢ <a href='#for-the-interview'>For the interview</a></li> +<li>⇢ <a href='#find-the-right-type-of-company'>Find the right type of company</a></li> +<li>⇢ <a href='#apply-for-the-new-job'>Apply for the new job</a></li> +<li>⇢ <a href='#negotiation'>Negotiation</a></li> +<li>⇢ <a href='#leaving-the-old-job'>Leaving the old job</a></li> +<li><a href='#other-things'>Other things</a></li> +<li>⇢ <a href='#testing'>Testing</a></li> +<li>⇢ <a href='#books-to-read'>Books to read</a></li> +</ul><br /> +<h2 style='display: inline' id='improve'>Improve</h2><br /> +<br /> +<h3 style='display: inline' id='always-learn-new-things'>Always learn new things</h3><br /> <br /> <span>When you learn something new, e.g. a programming language, first gather an overview, learn from multiple sources, play around and learn by doing and not consuming and form your own questions. Don't read too much upfront. A large amount of time is spent in learning technical skills which were never use. You want to have a practical set of skills you are actually using. You need to know 20 percent to get out 80 percent of the results.</span><br /> <br /> @@ -3823,11 +6448,11 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Boot camps: The advantage of a boot camp is to pragmatically learn things fast. We almost always overestimate what we can do in a day. Especially during boot camps. Connect to others during the boot camps</span><br /> <br /> -<h2 style='display: inline' id='Setgoals'>Set goals</h2><br /> +<h3 style='display: inline' id='set-goals'>Set goals</h3><br /> <br /> <span>Your own goals are important but the manager also looks at how the team performs and how someone can help the team perform better. Check whether you are on track with your goals every 2 weeks in order to avoid surprises for the annual review. Make concrete goals for next review. Track and document your progress. Invest in your education. Make your goals known. If you want something, then ask for it. Nobody but you knows what you want.</span><br /> <br /> -<h2 style='display: inline' id='Ratings'>Ratings</h2><br /> +<h3 style='display: inline' id='ratings'>Ratings</h3><br /> <br /> <span>That's a trap: If you have to rate yourself, that's a trap. That never works in an unbiased way. Rate yourself always the best way but rate your weakest part as high as possible minus one point. Rate yourself as good as you can otherwise. Nobody is putting for fun a gun on his own head. </span><br /> <br /> @@ -3835,7 +6460,7 @@ http://www.gnu.org/software/src-highlite --> <li>Don't do peer rating, it can fire back on you. What if the colleague becomes your new boss?</li> <li>Cooperate rankings are unfortunately HR guidelines and politics and only mirror a little your actual performance.</li> </ul><br /> -<h2 style='display: inline' id='Promotions'>Promotions</h2><br /> +<h3 style='display: inline' id='promotions'>Promotions</h3><br /> <br /> <span>The most valuable employees are the ones who make themselves obsolete and automate all away. Keep a safety net of 3 to 6 months of finances. Safe at least 10 percent of your earnings. Also, if you make money it does not mean that you have to spent more money. Is a new car better than a used car which both can bring you from A to B? Liability vs assets.</span><br /> <br /> @@ -3848,7 +6473,7 @@ http://www.gnu.org/software/src-highlite --> <li>If you want a raise be specific how much and know to back your demands. Don't make a thread and no ultimatums.</li> <li>Best way for a promotion is to switch jobs. You can even switch back with a better salary.</li> </ul><br /> -<h2 style='display: inline' id='Finishthings'>Finish things</h2><br /> +<h3 style='display: inline' id='finish-things'>Finish things</h3><br /> <br /> <span>Hard work is necessary for accomplish results. However, work smarter not harder. Furthermore, working smart is not a substitute for working hard. Work both, hard and smart.</span><br /> <br /> @@ -3863,7 +6488,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Defeat is finally give up. Failure is the road to success, embrace it. Failure does not define you but how you respond to it. Events don't make your unhappy, but how you react to events do.</span><br /> <br /> -<h2 style='display: inline' id='Expandtheempire'>Expand the empire</h2><br /> +<h2 style='display: inline' id='expand-the-empire'>Expand the empire</h2><br /> <br /> <span>The larger your empire is, the larger your circle of influence is. The larger the circle of influence is, the more opportunities you have.</span><br /> <br /> @@ -3874,7 +6499,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Become visible, keep track that you accomplishments. E.g. write a weekly summary. Do presentations, be seen. Learn new things and share your learnings. Be the problem solver and not the blamer.</span><br /> <br /> -<h2 style='display: inline' id='Bepragmaticandalsomanageyourtime'>Be pragmatic and also manage your time</h2><br /> +<h2 style='display: inline' id='be-pragmatic-and-also-manage-your-time'>Be pragmatic and also manage your time</h2><br /> <br /> <span>Make use of time boxing via the Pomodoro technique: Set a target of rounds and track the rounds. That give you exact focused work time. That's really the trick. For example set a goal of 6 daily pomodores.</span><br /> <br /> @@ -3884,7 +6509,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>You should feel good of the work done even if you don't finished the task. You will feel good about pomodoro wise even you don't finish the task on hand yet. Helps you to enjoy time off more. Working longer may not sell anything.</span><br /> <br /> -<h3 style='display: inline' id='Thequotasystem'>The quota system</h3><br /> +<h3 style='display: inline' id='the-quota-system'>The quota system</h3><br /> <br /> <span>Defined quota of things done. E.g. N runs per week or M Blog posts per month or O pomodoros per week. This helps with consistency. Truly commit to these quotas. Failure is not an option. Start with small commitments. Don't commit to something you can't fulfill otherwise you set yourself up for failure.</span><br /> <br /> @@ -3893,7 +6518,7 @@ http://www.gnu.org/software/src-highlite --> <li>Internal motivation is more important over external motivation. Check out Daniels book drive.</li> <li>Multitasking: Batching is effective. E.g. emails twice daily at pre-set times..</li> </ul><br /> -<h3 style='display: inline' id='Dontwastetime'>Don't waste time</h3><br /> +<h3 style='display: inline' id='don-t-waste-time'>Don't waste time</h3><br /> <br /> <span>The biggest time waster is TV watching. The TV is programming you. It's insane that Americans watch so much TV as they work full time. Schedule one show at a time and watch it when you want to watch it. Most movies are crap anyways. The good movies will come to you as people will talk about them.</span><br /> <br /> @@ -3902,7 +6527,7 @@ http://www.gnu.org/software/src-highlite --> <li>Meetings can waste time as well. Simply don't go to them. Try to cancel meeting if it can be dealt with via email.</li> <li>Enjoying things is not a waste of time. E.g. you could still play a game once in a while. It is important not to cut away all you enjoy from your life.</li> </ul><br /> -<h3 style='display: inline' id='Habits'>Habits</h3><br /> +<h3 style='display: inline' id='habits'>Habits</h3><br /> <br /> <span>Try to have as many good habits as possible. Start with easy habits, and make them a little bit more challenging over time. Set ankers and rewards. Over time the routines will become habits naturally.</span><br /> <br /> @@ -3912,7 +6537,7 @@ http://www.gnu.org/software/src-highlite --> <li>We don't have control over our habits but our own routines.</li> <li>Routines help to form the habits, though.</li> </ul><br /> -<h1 style='display: inline' id='Worklifebalance'>Work-life balance</h1><br /> +<h1 style='display: inline' id='work-life-balance'>Work-life balance</h1><br /> <br /> <span>Avoid overwork hours. That's not as beneficial as you might think and comes only with very small rewards. Invest rather in yourself and not in your employer.</span><br /> <br /> @@ -3924,7 +6549,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Use your most productive hours to work on you. Make that your priority. Take care of yourself a priority (E.g. do workouts or learn a new language). You can always workout 2 or 1 hour per day, but will you pay the price?</span><br /> <br /> -<h2 style='display: inline' id='Mentalhealth'>Mental health</h2><br /> +<h2 style='display: inline' id='mental-health'>Mental health</h2><br /> <br /> <ul> <li>Friendships and positive thinking help to have and maintain better health, longer Life, better productivity and increased happiness.</li> @@ -3935,7 +6560,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>In most cases burnout is just an illusion. If you don't have motivation push through the wall. People usually don't pass the wall as they feel they are burned out. After pushing through the wall you will have the most fun, for example you will be able playing the guitar greatly.</span><br /> <br /> -<h2 style='display: inline' id='Physicalhealth'>Physical health</h2><br /> +<h2 style='display: inline' id='physical-health'>Physical health</h2><br /> <br /> <span>Utilise a standing desk and treadmill (you could walk and type at the same time). Increase the incline in order to burn more calories. Even on the standing desk you burn more calories than sitting. When you use pomodoro then you can use the small breaks for push-ups (maybe won't do as good when you are in a fasted state).</span><br /> <br /> @@ -3947,7 +6572,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Intermittent fasting is an effective method to maintain weight and health. But it does not mean that you can only eat junk food in the feeding windows. Also, diet and nutrition is the most important for health and fitness. They make it also easier to stay focused and positive.</span><br /> <br /> -<h2 style='display: inline' id='Nodrama'>No drama</h2><br /> +<h2 style='display: inline' id='no-drama'>No drama</h2><br /> <br /> <span>Avoid drama at work. Where are humans there is drama. You can decide where to spent your energy in. But don't avoid conflict. Conflict is healthy in any kind of relationship. Be tactful and state your opinion. The goal is to find the best solution to the problem.</span><br /> <br /> @@ -3963,13 +6588,13 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>You have to learn how to work in a team. Be honest but tactful. It's not too be the loudest but about selling your ideas. Don't argue otherwise you won't sell anything. Be persuasive by finding the common ground. Or lead the colleagues to your idea and don't sell it upfront. Communicate clearly.</span><br /> <br /> -<h1 style='display: inline' id='Personalbrand'>Personal brand</h1><br /> +<h1 style='display: inline' id='personal-brand'>Personal brand</h1><br /> <br /> <ul> <li>Invest your value outside the company. Build your personal brand. Show how valuable you are, also to other companies. Become an asset.</li> <li>Invest in your education. Make your goals known. If you want something ask for it (see also the sections about goals in this document).</li> </ul><br /> -<h2 style='display: inline' id='Marketyourself'>Market yourself</h2><br /> +<h2 style='display: inline' id='market-yourself'>Market yourself</h2><br /> <br /> <ul> <li>The best way to market yourself is to make you usable.</li> @@ -3982,11 +6607,11 @@ http://www.gnu.org/software/src-highlite --> <li>Have an elevator pitch: "buetow.org - Having fun with computers!"</li> <li>Have social media accounts, especially the ones which are more tech related.</li> </ul><br /> -<h2 style='display: inline' id='Networking'>Networking</h2><br /> +<h2 style='display: inline' id='networking'>Networking</h2><br /> <br /> <span>Ask people so they talk about themselves. They are not really interested in you. Use meetup.com to find groups you are interested and build up the network over time. Don't drink on social networking events even when others do. Talking to other people at events only has upsides. Just saying "hi" and introducing yourself is enough. What worse can happen? If the person rejects you so what, life goes on. Ask open questions and no "yes" and "no" questions. E.g.: "What is your story, why are you here?".</span><br /> <br /> -<h2 style='display: inline' id='Publicspeaking'>Public speaking</h2><br /> +<h2 style='display: inline' id='public-speaking'>Public speaking</h2><br /> <br /> <span>Before your talk go on stage 10 minutes in advance. Introduce yourself to the front row people. During the talk they will smile at you and encourage you during your talk.</span><br /> <br /> @@ -3996,9 +6621,9 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Just do it. Just go to conferences. Even if you are not speaking. Sell your boss what you would learn and "this and that" and you would present the learnings to the team afterwards.</span><br /> <br /> -<h1 style='display: inline' id='Newjob'>New job</h1><br /> +<h1 style='display: inline' id='new-job'>New job</h1><br /> <br /> -<h2 style='display: inline' id='Fortheinterview'>For the interview</h2><br /> +<h2 style='display: inline' id='for-the-interview'>For the interview</h2><br /> <br /> <ul> <li>Build up a network before the interview. E.g., follow and comment blogs. Or go to meet-ups and conferences. Join user groups.</li> @@ -4007,7 +6632,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>If you are specialized then there is a better chance to get a fitting job. No one will hire a general lawyer if there are specialized lawyers available. Even if you are specialized, you will have a wide range of skills (T-shape knowledge).</span><br /> <br /> -<h2 style='display: inline' id='Findtherighttypeofcompany'>Find the right type of company</h2><br /> +<h2 style='display: inline' id='find-the-right-type-of-company'>Find the right type of company</h2><br /> <br /> <span>Not all companies are equal. They have individual cultures and guidelines.</span><br /> <br /> @@ -4019,7 +6644,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Work in a tech. company if you want to work on/with cutting edge technologies.</span><br /> <br /> -<h2 style='display: inline' id='Applyforthenewjob'>Apply for the new job</h2><br /> +<h2 style='display: inline' id='apply-for-the-new-job'>Apply for the new job</h2><br /> <br /> <span>Get a professional resume writer. Get referrals of writers and get samples from there. Get sufficient with algorithm and data structures interview questions. Cracking the coding interview book and blog </span><br /> <br /> @@ -4032,7 +6657,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Invest in your dress code as appearance masters. It does make sense to invest in your style. You could even hire a professional stylist (not my personal way though).</span><br /> <br /> -<h2 style='display: inline' id='Negotiation'>Negotiation</h2><br /> +<h2 style='display: inline' id='negotiation'>Negotiation</h2><br /> <br /> <ul> <li>Whoever names the number first loses. You don't know what someone else is expecting unless told. Low ball number may be an issue but you have to know the market.</li> @@ -4050,21 +6675,21 @@ http://www.gnu.org/software/src-highlite --> <ul> <li>Never spilt the difference is the best book for learning negotiation techniques..</li> </ul><br /> -<h2 style='display: inline' id='Leavingtheoldjob'>Leaving the old job</h2><br /> +<h2 style='display: inline' id='leaving-the-old-job'>Leaving the old job</h2><br /> <br /> <span>When leaving a job make a clean and non personal as possible. Never complain and never explain. Don't worry about abandonment of the team. Everybody is replacement and you make a business decision. Don't threaten to quit as you are replaceable.</span><br /> <br /> -<h1 style='display: inline' id='Otherthings'>Other things</h1><br /> +<h1 style='display: inline' id='other-things'>Other things</h1><br /> <br /> <ul> <li>As a leader lead by example and don't lead from the Eiffel tower.</li> <li>As a leader you are responsible for the team. If the team fails then it's your fault only.</li> </ul><br /> -<h2 style='display: inline' id='Testing'>Testing</h2><br /> +<h2 style='display: inline' id='testing'>Testing</h2><br /> <br /> <span>Unit testing Vs regression testing: Unit tests test the smallest possible unit and get rewritten if the unit gets changed. It's like programming against a specification n. Regression tests test whether the software still works after the change. Now you know more than most software engineers.</span><br /> <br /> -<h2 style='display: inline' id='Bookstoread'>Books to read</h2><br /> +<h2 style='display: inline' id='books-to-read'>Books to read</h2><br /> <br /> <ul> <li>Clean Code</li> @@ -4087,15 +6712,15 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other book notes of mine are:</span><br /> <br /> -<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> -<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> -<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> -<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> -<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2024-10-24-staff-engineer-book-notes.html'>2024-10-24 "Staff Engineer" book notes</a><br /> <a class='textlink' href='./2024-07-07-the-stoic-challenge-book-notes.html'>2024-07-07 "The Stoic Challenge" book notes</a><br /> +<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> +<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> +<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> <br /> -<a class='textlink' href='../resources.html'>More books and other resources I found useful.</a><br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> @@ -4112,20 +6737,36 @@ http://www.gnu.org/software/src-highlite --> <summary>Gogios is a minimalistic and easy-to-use monitoring tool I programmed in Google Go designed specifically for small-scale self-hosted servers and virtual machines. The primary purpose of Gogios is to monitor my personal server infrastructure for `foo.zone`, my MTAs, my authoritative DNS servers, my NextCloud, Wallabag and Anki sync server installations, etc.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='KISSservermonitoringwithGogios'>KISS server monitoring with Gogios</h1><br /> + <h1 style='display: inline' id='kiss-server-monitoring-with-gogios'>KISS server monitoring with Gogios</h1><br /> <br /> <span class='quote'>Published at 2023-06-01T21:10:17+03:00</span><br /> <br /> -<a href='./kiss-server-monitoring-with-gogios/gogios-small.png'><img alt='Gogios logo' title='Gogios logo' src='./kiss-server-monitoring-with-gogios/gogios-small.png' /></a><br /> -<br /> -<h2 style='display: inline' id='Introduction'>Introduction</h2><br /> -<br /> <span>Gogios is a minimalistic and easy-to-use monitoring tool I programmed in Google Go designed specifically for small-scale self-hosted servers and virtual machines. The primary purpose of Gogios is to monitor my personal server infrastructure for <span class='inlinecode'>foo.zone</span>, my MTAs, my authoritative DNS servers, my NextCloud, Wallabag and Anki sync server installations, etc.</span><br /> <br /> <span>With compatibility with the Nagios Check API, Gogios offers a simple yet effective solution to monitor a limited number of resources. In theory, Gogios scales to a couple of thousand checks, though. You can clone it from Codeberg here:</span><br /> <br /> <a class='textlink' href='https://codeberg.org/snonux/gogios'>https://codeberg.org/snonux/gogios</a><br /> <br /> +<a href='./kiss-server-monitoring-with-gogios/gogios-small.png'><img alt='Gogios logo' title='Gogios logo' src='./kiss-server-monitoring-with-gogios/gogios-small.png' /></a><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#kiss-server-monitoring-with-gogios'>KISS server monitoring with Gogios</a></li> +<li>⇢ <a href='#motivation'>Motivation</a></li> +<li>⇢ <a href='#features'>Features</a></li> +<li>⇢ <a href='#example-alert'>Example alert</a></li> +<li>⇢ <a href='#installation'>Installation</a></li> +<li>⇢ ⇢ <a href='#compiling-and-installing-gogios'>Compiling and installing Gogios</a></li> +<li>⇢ ⇢ <a href='#setting-up-user-group-and-directories'>Setting up user, group and directories</a></li> +<li>⇢ ⇢ <a href='#installing-monitoring-plugins'>Installing monitoring plugins</a></li> +<li>⇢ <a href='#configuration'>Configuration</a></li> +<li>⇢ ⇢ <a href='#mta'>MTA</a></li> +<li>⇢ ⇢ <a href='#configuring-gogios'>Configuring Gogios</a></li> +<li>⇢ <a href='#running-gogios'>Running Gogios</a></li> +<li>⇢ ⇢ <a href='#high-availability'>High-availability</a></li> +<li>⇢ <a href='#conclusion'>Conclusion:</a></li> +</ul><br /> <pre> _____________________________ ____________________________ / \ / \ @@ -4149,7 +6790,7 @@ The original can be found at https://asciiart.website/index.php?art=objects/computers </pre> <br /> -<h2 style='display: inline' id='Motivation'>Motivation</h2><br /> +<h2 style='display: inline' id='motivation'>Motivation</h2><br /> <br /> <span>With experience in monitoring solutions like Nagios, Icinga, Prometheus and OpsGenie, these tools often came with many features that I didn't necessarily need for personal use. Contact groups, host groups, check clustering, and the requirement of operating a DBMS and a WebUI added complexity and bloat to my monitoring setup.</span><br /> <br /> @@ -4157,7 +6798,7 @@ https://asciiart.website/index.php?art=objects/computers <br /> <span>This led me to create Gogios, a lightweight monitoring tool tailored to my specific needs. I chose the Go programming language for this project as it comes, in my opinion, with the best balance of ease to use and performance.</span><br /> <br /> -<h2 style='display: inline' id='Features'>Features</h2><br /> +<h2 style='display: inline' id='features'>Features</h2><br /> <br /> <ul> <li>Compatible with Nagios Check scripts: Gogios leverages the widely-used Nagios Check API, allowing to use existing Nagios plugins.</li> @@ -4168,7 +6809,7 @@ https://asciiart.website/index.php?art=objects/computers <li>Email Notifications: Gogios can send email notifications regarding the status of monitored services, ensuring you stay informed about potential issues.</li> <li>CRON-based Execution: Gogios can be quickly scheduled to run periodically via CRON, allowing you to automate monitoring without needing a complex setup.</li> </ul><br /> -<h2 style='display: inline' id='Examplealert'>Example alert</h2><br /> +<h2 style='display: inline' id='example-alert'>Example alert</h2><br /> <br /> <span>This is an example alert report received via E-Mail. Whereas, <span class='inlinecode'>[C:2 W:0 U:0 OK:51]</span> means that we've got two alerts in status critical, 0 warnings, 0 unknowns and 51 OKs.</span><br /> <br /> @@ -4190,9 +6831,9 @@ CRITICAL: Check ICMP6 vulcan.buetow.org: Check command timed out Have a nice day! </pre> <br /> -<h2 style='display: inline' id='Installation'>Installation</h2><br /> +<h2 style='display: inline' id='installation'>Installation</h2><br /> <br /> -<h3 style='display: inline' id='CompilingandinstallingGogios'>Compiling and installing Gogios</h3><br /> +<h3 style='display: inline' id='compiling-and-installing-gogios'>Compiling and installing Gogios</h3><br /> <br /> <span>This document is primarily written for OpenBSD, but applying the corresponding steps to any Unix-like (e.g. Linux-based) operating system should be easy. On systems other than OpenBSD, you may always have to replace <span class='inlinecode'>does</span> with the <span class='inlinecode'>sudo</span> command and replace the <span class='inlinecode'>/usr/local/bin</span> path with <span class='inlinecode'>/usr/bin</span>.</span><br /> <br /> @@ -4202,11 +6843,11 @@ Have a nice day! by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">git clone https</font><font color="#F3E651">:</font><font color="#ff0000">//codeberg</font><font color="#F3E651">.</font><font color="#ff0000">org/snonux/gogios</font><font color="#F3E651">.</font><font color="#ff0000">git</font> -<font color="#ff0000">cd gogios</font> -<font color="#ff0000">go build -o gogios cmd/gogios/main</font><font color="#F3E651">.</font><font color="#ff0000">go</font> -<font color="#ff0000">doas cp gogios /usr/local/bin/gogios</font> -<font color="#ff0000">doas chmod </font><font color="#bb00ff">755</font><font color="#ff0000"> /usr/local/bin/gogios</font> +<pre>git clone https://codeberg.org/snonux/gogios.git +cd gogios +go build -o gogios cmd/gogios/main.go +doas cp gogios /usr/local/bin/gogios +doas chmod <font color="#000000">755</font> /usr/local/bin/gogios </pre> <br /> <span>You can use cross-compilation if you want to compile Gogios for OpenBSD on a Linux system without installing the Go compiler on OpenBSD. Follow these steps:</span><br /> @@ -4215,16 +6856,16 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">export</font></b><font color="#ff0000"> </font><font color="#ff0000">GOOS</font><font color="#F3E651">=</font><font color="#ff0000">openbsd</font> -<b><font color="#ffffff">export</font></b><font color="#ff0000"> </font><font color="#ff0000">GOARCH</font><font color="#F3E651">=</font><font color="#ff0000">amd64</font> -<font color="#ff0000">go build -o gogios cmd/gogios/main</font><font color="#F3E651">.</font><font color="#ff0000">go</font> +<pre><b><u><font color="#000000">export</font></u></b> GOOS=openbsd +<b><u><font color="#000000">export</font></u></b> GOARCH=amd64 +go build -o gogios cmd/gogios/main.go </pre> <br /> <span>On your OpenBSD system, copy the binary to <span class='inlinecode'>/usr/local/bin/gogios</span> and set the correct permissions as described in the previous section. All steps described here you could automate with your configuration management system of choice. I use Rexify, the friendly configuration management system, to automate the installation, but that is out of the scope of this document.</span><br /> <br /> <a class='textlink' href='https://www.rexify.org'>https://www.rexify.org</a><br /> <br /> -<h3 style='display: inline' id='Settingupusergroupanddirectories'>Setting up user, group and directories</h3><br /> +<h3 style='display: inline' id='setting-up-user-group-and-directories'>Setting up user, group and directories</h3><br /> <br /> <span>It is best to create a dedicated system user and group for Gogios to ensure proper isolation and security. Here are the steps to create the <span class='inlinecode'>_gogios</span> user and group under OpenBSD:</span><br /> <br /> @@ -4232,16 +6873,16 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">doas adduser -group _gogios -batch _gogios</font> -<font color="#ff0000">doas usermod -d /var/run/gogios _gogios</font> -<font color="#ff0000">doas mkdir -p /var/run/gogios</font> -<font color="#ff0000">doas chown _gogios</font><font color="#F3E651">:</font><font color="#ff0000">_gogios /var/run/gogios</font> -<font color="#ff0000">doas chmod </font><font color="#bb00ff">750</font><font color="#ff0000"> /var/run/gogios</font> +<pre>doas adduser -group _gogios -batch _gogios +doas usermod -d /var/run/gogios _gogios +doas mkdir -p /var/run/gogios +doas chown _gogios:_gogios /var/run/gogios +doas chmod <font color="#000000">750</font> /var/run/gogios </pre> <br /> <span>Please note that creating a user and group might differ depending on your operating system. For other operating systems, consult their documentation for creating system users and groups.</span><br /> <br /> -<h3 style='display: inline' id='Installingmonitoringplugins'>Installing monitoring plugins</h3><br /> +<h3 style='display: inline' id='installing-monitoring-plugins'>Installing monitoring plugins</h3><br /> <br /> <span>Gogios relies on external Nagios or Icinga monitoring plugin scripts. On OpenBSD, you can install the <span class='inlinecode'>monitoring-plugins</span> package with Gogios. The monitoring-plugins package is a collection of monitoring plugins, similar to Nagios plugins, that can be used to monitor various services and resources:</span><br /> <br /> @@ -4249,15 +6890,15 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">doas pkg_add monitoring-plugins</font> -<font color="#ff0000">doas pkg_add nrpe </font><i><font color="#ababab"># If you want to execute checks remotely via NRPE.</font></i> +<pre>doas pkg_add monitoring-plugins +doas pkg_add nrpe <i><font color="silver"># If you want to execute checks remotely via NRPE.</font></i> </pre> <br /> <span>Once the installation is complete, you can find the monitoring plugins in the <span class='inlinecode'>/usr/local/libexec/nagios</span> directory, which then can be configured to be used in <span class='inlinecode'>gogios.json</span>.</span><br /> <br /> -<h2 style='display: inline' id='Configuration'>Configuration</h2><br /> +<h2 style='display: inline' id='configuration'>Configuration</h2><br /> <br /> -<h3 style='display: inline' id='MTA'>MTA</h3><br /> +<h3 style='display: inline' id='mta'>MTA</h3><br /> <br /> <span>Gogios requires a local Mail Transfer Agent (MTA) such as Postfix or OpenBSD SMTPD running on the same server where the CRON job (see about the CRON job further below) is executed. The local MTA handles email delivery, allowing Gogios to send email notifications to monitor status changes. Before using Gogios, ensure that you have a properly configured MTA installed and running on your server to facilitate the sending of emails. Once the MTA is set up and functioning correctly, Gogios can leverage it to send email notifications.</span><br /> <br /> @@ -4269,7 +6910,7 @@ echo 'This is a test email from OpenBSD.' | mail -s 'Test Email' <br /> <span>Check the recipient's inbox to confirm the delivery of the test email. If the email is delivered successfully, it indicates that your email server is configured correctly and functioning. Please check your MTA logs in case of issues.</span><br /> <br /> -<h3 style='display: inline' id='ConfiguringGogios'>Configuring Gogios</h3><br /> +<h3 style='display: inline' id='configuring-gogios'>Configuring Gogios</h3><br /> <br /> <span>To configure Gogios, create a JSON configuration file (e.g., <span class='inlinecode'>/etc/gogios.json</span>). Here's an example configuration:</span><br /> <br /> @@ -4277,41 +6918,41 @@ echo 'This is a test email from OpenBSD.' | mail -s 'Test Email' by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">{</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">EmailTo</font><font color="#ff0000">"</font><font color="#ff0000">:</font><font color="#ff0000"> "</font><font color="#bb00ff">paul@dev.buetow.org</font><font color="#ff0000">"</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">EmailFrom</font><font color="#ff0000">"</font><font color="#ff0000">:</font><font color="#ff0000"> "</font><font color="#bb00ff">gogios@buetow.org</font><font color="#ff0000">"</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">CheckTimeoutS</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#bb00ff">10</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">CheckConcurrency</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#bb00ff">2</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">StateDir</font><font color="#ff0000">"</font><font color="#ff0000">:</font><font color="#ff0000"> "</font><font color="#bb00ff">/var/run/gogios</font><font color="#ff0000">"</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Checks</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Check ICMP4 www.foo.zone</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Plugin</font><font color="#ff0000">"</font><font color="#ff0000">:</font><font color="#ff0000"> "</font><font color="#bb00ff">/usr/local/libexec/nagios/check_ping</font><font color="#ff0000">"</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Args</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-H</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">www.foo.zone</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-4</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-w</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">50,10%</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-c</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">100,15%</font><font color="#ff0000">"</font><font color="#ff0000"> </font><font color="#F3E651">],</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Retries</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#bb00ff">3</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">RetryInterval</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#bb00ff">10</font> -<font color="#ff0000"> </font><font color="#F3E651">},</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Check ICMP6 www.foo.zone</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Plugin</font><font color="#ff0000">"</font><font color="#ff0000">:</font><font color="#ff0000"> "</font><font color="#bb00ff">/usr/local/libexec/nagios/check_ping</font><font color="#ff0000">"</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Args</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-H</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">www.foo.zone</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-6</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-w</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">50,10%</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-c</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">100,15%</font><font color="#ff0000">"</font><font color="#ff0000"> </font><font color="#F3E651">],</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Retries</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#bb00ff">3</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">RetryInterval</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#bb00ff">10</font> -<font color="#ff0000"> </font><font color="#F3E651">},</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">www.foo.zone HTTP IPv4</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Plugin</font><font color="#ff0000">"</font><font color="#ff0000">:</font><font color="#ff0000"> "</font><font color="#bb00ff">/usr/local/libexec/nagios/check_http</font><font color="#ff0000">"</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Args</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">[</font><font color="#ff0000">"</font><font color="#ff0000">www.foo.zone</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-4</font><font color="#ff0000">"</font><font color="#F3E651">],</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">DependsOn</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">[</font><font color="#ff0000">"</font><font color="#ff0000">Check ICMP4 www.foo.zone</font><font color="#ff0000">"</font><font color="#F3E651">]</font> -<font color="#ff0000"> </font><font color="#F3E651">},</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">www.foo.zone HTTP IPv6</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Plugin</font><font color="#ff0000">"</font><font color="#ff0000">:</font><font color="#ff0000"> "</font><font color="#bb00ff">/usr/local/libexec/nagios/check_http</font><font color="#ff0000">"</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Args</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">[</font><font color="#ff0000">"</font><font color="#ff0000">www.foo.zone</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-6</font><font color="#ff0000">"</font><font color="#F3E651">],</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">DependsOn</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">[</font><font color="#ff0000">"</font><font color="#ff0000">Check ICMP6 www.foo.zone</font><font color="#ff0000">"</font><font color="#F3E651">]</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Check NRPE Disk Usage foo.zone</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Plugin</font><font color="#ff0000">"</font><font color="#ff0000">:</font><font color="#ff0000"> "</font><font color="#bb00ff">/usr/local/libexec/nagios/check_nrpe</font><font color="#ff0000">"</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Args</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">[</font><font color="#ff0000">"</font><font color="#ff0000">-H</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">foo.zone</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-c</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">check_disk</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-p</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">5666</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-4</font><font color="#ff0000">"</font><font color="#F3E651">]</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#F3E651">}</font> +<pre>{ + "EmailTo": "<font color="#808080">paul@dev.buetow.org</font>", + "EmailFrom": "<font color="#808080">gogios@buetow.org</font>", + "CheckTimeoutS": <font color="#000000">10</font>, + "CheckConcurrency": <font color="#000000">2</font>, + "StateDir": "<font color="#808080">/var/run/gogios</font>", + "Checks": { + "Check ICMP4 www.foo.zone": { + "Plugin": "<font color="#808080">/usr/local/libexec/nagios/check_ping</font>", + "Args": [ "-H", "www.foo.zone", "-4", "-w", "50,10%", "-c", "100,15%" ], + "Retries": <font color="#000000">3</font>, + "RetryInterval": <font color="#000000">10</font> + }, + "Check ICMP6 www.foo.zone": { + "Plugin": "<font color="#808080">/usr/local/libexec/nagios/check_ping</font>", + "Args": [ "-H", "www.foo.zone", "-6", "-w", "50,10%", "-c", "100,15%" ], + "Retries": <font color="#000000">3</font>, + "RetryInterval": <font color="#000000">10</font> + }, + "www.foo.zone HTTP IPv4": { + "Plugin": "<font color="#808080">/usr/local/libexec/nagios/check_http</font>", + "Args": ["www.foo.zone", "-4"], + "DependsOn": ["Check ICMP4 www.foo.zone"] + }, + "www.foo.zone HTTP IPv6": { + "Plugin": "<font color="#808080">/usr/local/libexec/nagios/check_http</font>", + "Args": ["www.foo.zone", "-6"], + "DependsOn": ["Check ICMP6 www.foo.zone"] + } + "Check NRPE Disk Usage foo.zone": { + "Plugin": "<font color="#808080">/usr/local/libexec/nagios/check_nrpe</font>", + "Args": ["-H", "foo.zone", "-c", "check_disk", "-p", "5666", "-4"] + } + } +} </pre> <br /> <ul> @@ -4332,7 +6973,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>The <span class='inlinecode'>state.json</span> file mentioned above keeps track of the monitoring state and check results between Gogios runs, enabling Gogios only to send email notifications when there are changes in the check status.</span><br /> <br /> -<h2 style='display: inline' id='RunningGogios'>Running Gogios</h2><br /> +<h2 style='display: inline' id='running-gogios'>Running Gogios</h2><br /> <br /> <span>Now it is time to give it a first run. On OpenBSD, do:</span><br /> <br /> @@ -4340,7 +6981,7 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">doas -u _gogios /usr/local/bin/gogios -cfg /etc/gogios</font><font color="#F3E651">.</font><font color="#ff0000">json</font> +<pre>doas -u _gogios /usr/local/bin/gogios -cfg /etc/gogios.json </pre> <br /> <span>To run Gogios via CRON on OpenBSD as the <span class='inlinecode'>gogios</span> user and check all services once per minute, follow these steps:</span><br /> @@ -4354,7 +6995,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Gogios is now configured to run every five minutes from 8 am to 10 pm via CRON as the <span class='inlinecode'>_gogios</span> user. It will execute the checks and send monitoring status whenever a check status changes via email according to your configuration. Also, Gogios will run once at 7 am every morning and re-notify all unhandled alerts as a reminder.</span><br /> <br /> -<h3 style='display: inline' id='Highavailability'>High-availability</h3><br /> +<h3 style='display: inline' id='high-availability'>High-availability</h3><br /> <br /> <span>To create a high-availability Gogios setup, you can install Gogios on two servers that will monitor each other using the NRPE (Nagios Remote Plugin Executor) plugin. By running Gogios in alternate CRON intervals on both servers, you can ensure that even if one server goes down, the other will continue monitoring your infrastructure and sending notifications.</span><br /> <br /> @@ -4367,7 +7008,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>There are plans to make it possible to execute certain checks only on certain nodes (e.g. on elected leader or master nodes). This is still in progress (check out my Gorum Git project).</span><br /> <br /> -<h2 style='display: inline' id='Conclusion'>Conclusion:</h2><br /> +<h2 style='display: inline' id='conclusion'>Conclusion:</h2><br /> <br /> <span>Gogios is a lightweight and straightforward monitoring tool that is perfect for small-scale environments. With its compatibility with the Nagios Check API, email notifications, and CRON-based scheduling, Gogios offers an easy-to-use solution for those looking to monitor a limited number of resources. I personally use it to execute around 500 checks on my personal server infrastructure. I am very happy with this solution.</span><br /> <br /> @@ -4375,10 +7016,10 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other KISS-related posts are:</span><br /> <br /> -<a class='textlink' href='./2021-09-12-keep-it-simple-and-stupid.html'>2021-09-12 Keep it simple and stupid</a><br /> -<a class='textlink' href='./2023-06-01-kiss-server-monitoring-with-gogios.html'>2023-06-01 KISS server monitoring with Gogios (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.html'>2023-10-29 KISS static web photo albums with <span class='inlinecode'>photoalbum.sh</span></a><br /> <a class='textlink' href='./2024-04-01-KISS-high-availability-with-OpenBSD.html'>2024-04-01 KISS high-availability with OpenBSD</a><br /> +<a class='textlink' href='./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.html'>2023-10-29 KISS static web photo albums with <span class='inlinecode'>photoalbum.sh</span></a><br /> +<a class='textlink' href='./2023-06-01-kiss-server-monitoring-with-gogios.html'>2023-06-01 KISS server monitoring with Gogios (You are currently reading this)</a><br /> +<a class='textlink' href='./2021-09-12-keep-it-simple-and-stupid.html'>2021-09-12 Keep it simple and stupid</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> @@ -4396,13 +7037,12 @@ http://www.gnu.org/software/src-highlite --> <summary>These are my personal takeaways after reading 'The Obstacle Is the Way' by Ryan Holiday. This is mainly for my own use, but you might find it helpful too.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='TheObstacleistheWaybooknotes'>"The Obstacle is the Way" book notes</h1><br /> + <h1 style='display: inline' id='the-obstacle-is-the-way-book-notes'>"The Obstacle is the Way" book notes</h1><br /> <br /> <span class='quote'>Published at 2023-05-06T17:23:16+03:00</span><br /> <br /> <span>These are my personal takeaways after reading "The Obstacle Is the Way" by Ryan Holiday. This is mainly for my own use, but you might find it helpful too.</span><br /> <br /> -<br /> <pre> ,.......... .........., ,..,' '.' ',.., @@ -4415,9 +7055,26 @@ http://www.gnu.org/software/src-highlite --> ''' </pre> <br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#the-obstacle-is-the-way-book-notes'>"The Obstacle is the Way" book notes</a></li> +<li>⇢ <a href='#reframe-your-perspective'>Reframe your perspective</a></li> +<li>⇢ <a href='#embrace-rationality'>Embrace rationality</a></li> +<li>⇢ <a href='#control-your-response'>Control your response</a></li> +<li>⇢ <a href='#practice-emotional-and-physical-resilience'>Practice emotional and physical resilience</a></li> +<li>⇢ <a href='#persistence-and-patience'>Persistence and patience</a></li> +<li>⇢ <a href='#embrace-failure'>Embrace failure</a></li> +<li>⇢ <a href='#be-adaptable'>Be adaptable</a></li> +<li>⇢ <a href='#embrace-non-action'>Embrace non-action</a></li> +<li>⇢ <a href='#leverage-crisis'>Leverage crisis</a></li> +<li>⇢ <a href='#build-your-inner-citadel'>Build your inner citadel</a></li> +<li>⇢ <a href='#love-everything-that-happens'>Love everything that happens</a></li> +<li>⇢ <a href='#conclusion'>Conclusion</a></li> +</ul><br /> <span>"The obstacle is the way" is a powerful statement that encapsulates the wisdom of turning challenges into opportunities for growth and success. We will explore using obstacles as fuel, transforming weaknesses into strengths, and adopting a mindset that allows us to be creative and persistent in the face of adversity.</span><br /> <br /> -<h2 style='display: inline' id='Reframeyourperspective'>Reframe your perspective</h2><br /> +<h2 style='display: inline' id='reframe-your-perspective'>Reframe your perspective</h2><br /> <br /> <span>The obstacle in your path can become your path to success. Instead of being paralyzed by challenges, see them as opportunities to learn and grow. Remember, the things that hurt us often instruct us. </span><br /> <br /> @@ -4425,38 +7082,37 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Don't always try to use the front door; a backdoor could open. It's nonsense. Don't fight the judo master with judo. Non-action can be action, exposing the weaknesses of others.</span><br /> <br /> -<br /> -<h2 style='display: inline' id='Embracerationality'>Embrace rationality</h2><br /> +<h2 style='display: inline' id='embrace-rationality'>Embrace rationality</h2><br /> <br /> <span>It is a superpower to see things rationally when others are fearful. Focus on the reality of the situation without letting emotions, such as anger, cloud your judgment. This ability will enable you to make better decisions in adversity. Ability to see things what they really are. E.g. wine is old fermented grapes, or other people behaving like animals during a fight. Show the middle finger if someone persists on the stupid rules occasionally.</span><br /> <br /> -<h2 style='display: inline' id='Controlyourresponse'>Control your response</h2><br /> +<h2 style='display: inline' id='control-your-response'>Control your response</h2><br /> <br /> <span>You can choose how you respond to obstacles. Focus on what you can control, and don't let yourself feel harmed by external circumstances. Remember, you decide how things affect you; nobody else does. Choose to feel good in response to any situation. Embrace the challenges and obstacles that come your way, as they are opportunities for growth and learning.</span><br /> <br /> -<h2 style='display: inline' id='Practiceemotionalandphysicalresilience'>Practice emotional and physical resilience</h2><br /> +<h2 style='display: inline' id='practice-emotional-and-physical-resilience'>Practice emotional and physical resilience</h2><br /> <br /> <span>Martial artists know the importance of developing physical and emotional strength. Cultivate the art of not panicking; it will help you avoid making mistakes during high-pressure situations.</span><br /> <br /> <span>Focus on what you can control. Don't choose to feel harmed, and then you won't be harmed. I decide things that affect me; nobody else does. E.g., in prison, your mind stays your own. Don't ignore fear but explain it away, have a different view.</span><br /> <br /> -<h2 style='display: inline' id='Persistenceandpatience'>Persistence and patience</h2><br /> +<h2 style='display: inline' id='persistence-and-patience'>Persistence and patience</h2><br /> <br /> <span>Practice persistence and patience in your pursuits. Focus on the process rather than the prize and take one step at a time. Remember, the journey is about finishing tasks, projects, or workouts to the best of your ability. Never be in a hurry and never be desperate. There is no reason to be rushed; there are all in the long haul. Follow the process and not the price. Take it one step at a time. The process is about finishing (workout, task, project, etc.).</span><br /> <br /> -<h2 style='display: inline' id='Embracefailure'>Embrace failure</h2><br /> +<h2 style='display: inline' id='embrace-failure'>Embrace failure</h2><br /> <br /> <span>Failure is a natural part of life and can make us stronger. Treat defeat as a stepping stone to success and education. What is defeat? The first step to education. Failure makes you stronger. If we do our best, we can be proud of it, regardless of the result. Do your job, but do it right. Only an asshole thinks he is too good at the things he does. Also, asking for forgiveness is easier than asking for permission. </span><br /> <br /> -<h2 style='display: inline' id='Beadaptable'>Be adaptable</h2><br /> +<h2 style='display: inline' id='be-adaptable'>Be adaptable</h2><br /> <br /> <span>There are many ways to achieve your goals; sometimes, unconventional methods are necessary. Feel free to break the rules or go off the beaten path if it will lead to better results. Transform weaknesses into strengths. We have a choice of how to respond to things. It's not about being positive but to be creative. Aim high, but stuff will happen; E.g., surprises will always happen.</span><br /> <br /> -<h2 style='display: inline' id='Embracenonaction'>Embrace non-action</h2><br /> +<h2 style='display: inline' id='embrace-non-action'>Embrace non-action</h2><br /> <br /> <span>We constantly push to the next thing. Sometimes the best course of action is standing still or even going backwards. Obstacles might resolve by themselves. Or going sideways. Sometimes, the best action is to stand still, go sideways, or even go backwards. Obstacles may resolve themselves or present new opportunities if you're patient and observant. People always want your input before you have all the facts. They want you to play after their rules. The question is, do you let them? The English call it the cool head. Being in control of Stress; requires practice. Appear, the absence of fear (Greek). When all others do it one way, it does not mean it is the correct or best practice.</span><br /> <br /> -<h2 style='display: inline' id='Leveragecrisis'>Leverage crisis</h2><br /> +<h2 style='display: inline' id='leverage-crisis'>Leverage crisis</h2><br /> <br /> <span>In times of crisis, seize the chance to do things never done before. Great people use negative situations to their advantage and become the most effective in challenging circumstances.</span><br /> <br /> @@ -4464,19 +7120,19 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Be prepared for nothing to work. Problems are an opportunity to do your best, not to do miracles. Always manage your expectations. It will suck, but it will be ok. Be prepared to begin from the beginning. Be cheerful and eagerly work on the next obstacle. Each time you become better. Life is not a sprint but a marathon. After each obstacle lies another obstacle, there won't be anything without obstacles. Passing one means you are ready for the next.</span><br /> <br /> -<h2 style='display: inline' id='Buildyourinnercitadel'>Build your inner citadel</h2><br /> +<h2 style='display: inline' id='build-your-inner-citadel'>Build your inner citadel</h2><br /> <br /> <span>Develop your inner strength during good times so you can rely on it in bad times. Always prepare for adversity and face it with calmness and resilience. Be humble enough that things which happen will happen. Build your inner citadel. In good times strengthen it. In bad times rely on it.</span><br /> <br /> <span>We should always prepare for things to get tough. Your house burns down: no worries, we eliminated much rubbish. Imagine what can go wrong before things go wrong. We are prepared for adversity; it's other people who aren't. Phil Jackson's hip problem example. To receive unexpected benefits, you must first accept the unexpected obstacles. Meditate on death. It's a universal obstacle. Use it as a reminder to do your best.</span><br /> <br /> -<h2 style='display: inline' id='Loveeverythingthathappens'>Love everything that happens</h2><br /> +<h2 style='display: inline' id='love-everything-that-happens'>Love everything that happens</h2><br /> <br /> <span>Turn an obstacle the other way around for your benefit. Use it at fuel. It's simple but challenging. Most are paralyzed instead. The obstacle in the path becomes the path. Obstacles are neither good nor bad. The things which hurt, instruct.</span><br /> <br /> <span>Should I hate people who hate me? That's their problem and not mine. Be always calm and relaxed during the fight. The story of the battle is the story of the smile. Cheerfulness in all situations, especially the bad ones. Love for everything that happens; if it happens, it was meant to happen. We can choose how we react to things, so why not choose to feel good? I love everything that happens. You must never lower yourself to the person you don't like.</span><br /> <br /> -<h2 style='display: inline' id='Conclusion'>Conclusion</h2><br /> +<h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> <br /> <span>Life is a marathon, not a sprint. Each obstacle we overcome prepares us for the next one. Remember, the obstacle is not just a barrier to be turned upside down; it can also be used as a catapult to propel us forward. By embracing challenges and using them as opportunities for growth, we become stronger, more adaptable, and, ultimately, more successful.</span><br /> <br /> @@ -4484,15 +7140,15 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other book notes of mine are:</span><br /> <br /> -<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> -<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> -<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> -<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> -<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2024-10-24-staff-engineer-book-notes.html'>2024-10-24 "Staff Engineer" book notes</a><br /> <a class='textlink' href='./2024-07-07-the-stoic-challenge-book-notes.html'>2024-07-07 "The Stoic Challenge" book notes</a><br /> +<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> +<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> +<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> <br /> -<a class='textlink' href='../resources.html'>More books and other resources I found useful.</a><br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> @@ -4509,7 +7165,7 @@ http://www.gnu.org/software/src-highlite --> <summary>For fun, I am tracking the uptime of various personal machines (servers, laptops, workstations...). I have been doing this for over ten years now, so I have a lot of statistics collected.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='UnveilingguprecordsrakuGlobalUptimeRecordswithRaku'>Unveiling <span class='inlinecode'>guprecords.raku</span>: Global Uptime Records with Raku</h1><br /> + <h1 style='display: inline' id='unveiling-guprecordsraku-global-uptime-records-with-raku'>Unveiling <span class='inlinecode'>guprecords.raku</span>: Global Uptime Records with Raku</h1><br /> <br /> <span class='quote'>Published at 2023-04-30T13:10:26+03:00</span><br /> <br /> @@ -4530,7 +7186,16 @@ http://www.gnu.org/software/src-highlite --> +-----+-----------------+-----------------------------+ </pre> <br /> -<h1 style='display: inline' id='Introduction'>Introduction</h1><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#unveiling-guprecordsraku-global-uptime-records-with-raku'>Unveiling <span class='inlinecode'>guprecords.raku</span>: Global Uptime Records with Raku</a></li> +<li>⇢ <a href='#introduction'>Introduction</a></li> +<li>⇢ <a href='#how-guprecords-works'>How Guprecords works</a></li> +<li>⇢ <a href='#example'>Example</a></li> +<li>⇢ <a href='#conclusion'>Conclusion</a></li> +</ul><br /> +<h2 style='display: inline' id='introduction'>Introduction</h2><br /> <br /> <span>For fun, I am tracking the uptime of various personal machines (servers, laptops, workstations...). I have been doing this for over ten years now, so I have a lot of statistics collected.</span><br /> <br /> @@ -4553,7 +7218,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>And I have been following the Raku newsletter, and sometimes I have been lurking around in the IRC channels, too. Watching Raku coding challenges on YouTube was pretty fun, too. However, nothing beats actually using Raku to learn the language. After reading all of these resources, I may have a good idea about the features and paradigms, but I am by far not an expert.</span><br /> <br /> -<h2 style='display: inline' id='HowGuprecordsworks'>How Guprecords works</h2><br /> +<h2 style='display: inline' id='how-guprecords-works'>How Guprecords works</h2><br /> <br /> <span>Guprecords works in three stages:</span><br /> <br /> @@ -4566,7 +7231,7 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">$ raku guprecords</font><font color="#F3E651">.</font><font color="#ff0000">raku --stats</font><font color="#F3E651">=</font><font color="#ff0000">dir</font><font color="#F3E651">=</font><font color="#ff0000">$HOME</font><font color="#ff0000">/git/uprecords/stats --all</font> +<pre>$ raku guprecords.raku --stats=dir=$HOME/git/uprecords/stats --all </pre> <br /> <span>This command will generate a comprehensive uptime report from the collected statistics, making it easy to review and enjoy the data.</span><br /> @@ -4579,7 +7244,7 @@ http://www.gnu.org/software/src-highlite --> <li>Output formats available: Plaintext, Markdown, and Gemtext</li> <li>Provides top entries based on the specified limit</li> </ul><br /> -<h2 style='display: inline' id='Example'>Example</h2><br /> +<h2 style='display: inline' id='example'>Example</h2><br /> <br /> <span>You have already seen an example at the very top of this post, where the hosts were grouped by their total lifespans (uptime+downtime). Here's an example of what the global uptime report (grouped by total host uptimes) might look like:</span><br /> <br /> @@ -4650,7 +7315,7 @@ no1 in 455 days, 18:52:44 | at Sun Jul 21 07:37:51 2024 %up 99.997 | since Tue Dec 18 10:16:08 2018 </pre> <br /> -<h2 style='display: inline' id='Conclusion'>Conclusion</h2><br /> +<h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> <br /> <span>Guprecords is a small, yet powerful tool for analyzing uptime statistics. While developing Guprecords, I have come to truly appreciate and love Raku's expressiveness. The language is designed to be both powerful and flexible, allowing developers to express their intentions and logic more clearly and concisely.</span><br /> <br /> @@ -4669,284 +7334,11 @@ no1 in 455 days, 18:52:44 | at Sun Jul 21 07:37:51 2024 <br /> <span>Other related posts are:</span><br /> <br /> -<a class='textlink' href='./2008-06-26-perl-poetry.html'>2008-06-26 Perl Poetry</a><br /> -<a class='textlink' href='./2011-05-07-perl-daemon-service-framework.html'>2011-05-07 Perl Daemon (Service Framework)</a><br /> -<a class='textlink' href='./2022-05-27-perl-is-still-a-great-choice.html'>2022-05-27 Perl is still a great choice</a><br /> -<a class='textlink' href='./2022-06-15-sweating-the-small-stuff.html'>2022-06-15 Sweating the small stuff - Tiny projects of mine</a><br /> <a class='textlink' href='./2023-05-01-unveiling-guprecords:-uptime-records-with-raku.html'>2023-05-01 Unveiling <span class='inlinecode'>guprecords.raku</span>: Global Uptime Records with Raku (You are currently reading this)</a><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>Algorithms and Data Structures in Go - Part 1</title> - <link href="gemini://foo.zone/gemfeed/2023-04-09-algorithms-and-data-structures-in-golang-part-1.gmi" /> - <id>gemini://foo.zone/gemfeed/2023-04-09-algorithms-and-data-structures-in-golang-part-1.gmi</id> - <updated>2023-04-09T22:31:42+03:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>This is the first blog post about my Algorithms and Data Structures in Go series. I am not a Software Developer in my day job. In my current role, programming and scripting skills are desirable but not mandatory. I have been learning about Data Structures and Algorithms many years ago at University. I thought it would be fun to revisit/refresh my knowledge here and implement many of the algorithms in Go.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='AlgorithmsandDataStructuresinGoPart1'>Algorithms and Data Structures in Go - Part 1</h1><br /> -<br /> -<span class='quote'>Published at 2023-04-09T22:31:42+03:00</span><br /> -<br /> -<pre> - ,_---~~~~~----._ - _,,_,*^____ _____``*g*\"*, - / __/ /' ^. / \ ^@q f -[ @f | @)) | | @)) l 0 _/ - \`/ \~____ / __ \_____/ \ - | _l__l_ I - } [______] I - ] | | | | - ] ~ ~ | - | | - | | -</pre> -<br /> -<span>This is the first blog post about my Algorithms and Data Structures in Go series. I am not a Software Developer in my day job. In my current role, programming and scripting skills are desirable but not mandatory. I have been learning about Data Structures and Algorithms many years ago at University. I thought it would be fun to revisit/refresh my knowledge here and implement many of the algorithms in Go.</span><br /> -<br /> -<a class='textlink' href='./2023-04-09-algorithms-and-data-structures-in-golang-part-1.html'>2023-04-09 Algorithms and Data Structures in Go - Part 1 (You are currently reading this)</a><br /> -<br /> -<span>This post is about setting up some basic data structures and methods for this blog series. I promise, everything will be easy to follow in this post. It will become more interesting later in this series.</span><br /> -<br /> -<h2 style='display: inline' id='Typeconstraints'>Type constraints</h2><br /> -<br /> -<span>First, the package <span class='inlinecode'>ds</span> (data structures) defines the <span class='inlinecode'>types.go</span>. All examples will either operate on the <span class='inlinecode'>Integer</span> or <span class='inlinecode'>Number</span> type:</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">package</font></b><font color="#ff0000"> ds</font> - -<b><font color="#ffffff">import</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font> -<font color="#ff0000"> </font><font color="#bb00ff">"golang.org/x/exp/constraints"</font> -<font color="#F3E651">)</font> - -<b><font color="#ffffff">type</font></b><font color="#ff0000"> Integer </font><b><font color="#ffffff">interface</font></b><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> constraints</font><font color="#F3E651">.</font><font color="#ff0000">Integer</font> -<font color="#F3E651">}</font> - -<b><font color="#ffffff">type</font></b><font color="#ff0000"> Number </font><b><font color="#ffffff">interface</font></b><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> constraints</font><font color="#F3E651">.</font><font color="#ff0000">Integer </font><font color="#F3E651">|</font><font color="#ff0000"> constraints</font><font color="#F3E651">.</font><font color="#ff0000">Float</font> -<font color="#F3E651">}</font> - -</pre> -<br /> -<h2 style='display: inline' id='ArrayList'>ArrayList</h2><br /> -<br /> -<span>Next comes the <span class='inlinecode'>arraylist.go</span>, which defines the underlying data structure all the algorithms of this series will use. <span class='inlinecode'>ArrayList</span> is just a type alias of a Go array (or slice) with custom methods on it:</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">package</font></b><font color="#ff0000"> ds</font> - -<b><font color="#ffffff">import</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font> -<font color="#ff0000"> </font><font color="#bb00ff">"fmt"</font> -<font color="#ff0000"> </font><font color="#bb00ff">"math/rand"</font> -<font color="#ff0000"> </font><font color="#bb00ff">"strings"</font> -<font color="#F3E651">)</font> - -<b><font color="#ffffff">type</font></b><font color="#ff0000"> ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V Number</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">[]</font><font color="#ff0000">V</font> - -<b><font color="#ffffff">func</font></b><font color="#ff0000"> NewArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V Number</font><font color="#F3E651">](</font><font color="#ff0000">l int</font><font color="#F3E651">)</font><font color="#ff0000"> ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> </font><font color="#7bc710">make</font><font color="#F3E651">(</font><font color="#ff0000">ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">],</font><font color="#ff0000"> l</font><font color="#F3E651">)</font> -<font color="#F3E651">}</font> -</pre> -<br /> -<span>As you can see, the code uses Go generics, which I refactored recently. Besides the default constructor (which only returns an empty <span class='inlinecode'>ArrayList</span> with a given capacity), there are also a bunch of special constructors. <span class='inlinecode'>NewRandomArrayList</span> is returning an <span class='inlinecode'>ArrayList</span> with random numbers, <span class='inlinecode'>NewAscendingArrayList</span> and <span class='inlinecode'>NewDescendingArrayList</span> are returning <span class='inlinecode'>ArrayList</span>s in either ascending or descending order. They all will be used later on for testing and benchmarking the algorithms.</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">func</font></b><font color="#ff0000"> NewRandomArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V Number</font><font color="#F3E651">](</font><font color="#ff0000">l</font><font color="#F3E651">,</font><font color="#ff0000"> max int</font><font color="#F3E651">)</font><font color="#ff0000"> ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> a </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><font color="#7bc710">make</font><font color="#F3E651">(</font><font color="#ff0000">ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">],</font><font color="#ff0000"> l</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> i </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> i </font><font color="#F3E651"><</font><font color="#ff0000"> l</font><font color="#F3E651">;</font><font color="#ff0000"> i</font><font color="#F3E651">++</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> max </font><font color="#F3E651">></font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">i</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#7bc710">V</font><font color="#F3E651">(</font><font color="#ff0000">rand</font><font color="#F3E651">.</font><font color="#7bc710">Intn</font><font color="#F3E651">(</font><font color="#ff0000">max</font><font color="#F3E651">))</font> -<font color="#ff0000"> </font><b><font color="#ffffff">continue</font></b> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">i</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#7bc710">V</font><font color="#F3E651">(</font><font color="#ff0000">rand</font><font color="#F3E651">.</font><font color="#7bc710">Int</font><font color="#F3E651">())</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> a</font> -<font color="#F3E651">}</font> - -<b><font color="#ffffff">func</font></b><font color="#ff0000"> NewAscendingArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V Number</font><font color="#F3E651">](</font><font color="#ff0000">l int</font><font color="#F3E651">)</font><font color="#ff0000"> ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> a </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><font color="#7bc710">make</font><font color="#F3E651">(</font><font color="#ff0000">ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">],</font><font color="#ff0000"> l</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> i </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> i </font><font color="#F3E651"><</font><font color="#ff0000"> l</font><font color="#F3E651">;</font><font color="#ff0000"> i</font><font color="#F3E651">++</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">i</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#7bc710">V</font><font color="#F3E651">(</font><font color="#ff0000">i</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> a</font> -<font color="#F3E651">}</font> - -<b><font color="#ffffff">func</font></b><font color="#ff0000"> NewDescendingArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V Number</font><font color="#F3E651">](</font><font color="#ff0000">l int</font><font color="#F3E651">)</font><font color="#ff0000"> ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> a </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><font color="#7bc710">make</font><font color="#F3E651">(</font><font color="#ff0000">ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">],</font><font color="#ff0000"> l</font><font color="#F3E651">)</font> -<font color="#ff0000"> j </font><font color="#F3E651">:=</font><font color="#ff0000"> l </font><font color="#F3E651">-</font><font color="#ff0000"> </font><font color="#bb00ff">1</font> -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> i </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> i </font><font color="#F3E651"><</font><font color="#ff0000"> l</font><font color="#F3E651">;</font><font color="#ff0000"> i</font><font color="#F3E651">++</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">i</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#7bc710">V</font><font color="#F3E651">(</font><font color="#ff0000">j</font><font color="#F3E651">)</font> -<font color="#ff0000"> j</font><font color="#F3E651">--</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> a</font> -<font color="#F3E651">}</font> -</pre> -<br /> -<h2 style='display: inline' id='Helpermethods'>Helper methods</h2><br /> -<br /> -<span>The <span class='inlinecode'>FirstN</span> method only returns the first N elements of the <span class='inlinecode'>ArrayList</span>. This is useful for printing out only parts of the data structure:</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">func</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><font color="#ff0000">a ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">])</font><font color="#ff0000"> </font><font color="#7bc710">FirstN</font><font color="#F3E651">(</font><font color="#ff0000">n int</font><font color="#F3E651">)</font><font color="#ff0000"> </font><b><font color="#F35E1E">string</font></b><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#ffffff">var</font></b><font color="#ff0000"> sb strings</font><font color="#F3E651">.</font><font color="#ff0000">Builder</font> -<font color="#ff0000"> j </font><font color="#F3E651">:=</font><font color="#ff0000"> n</font> - -<font color="#ff0000"> l </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><font color="#7bc710">len</font><font color="#F3E651">(</font><font color="#ff0000">a</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> j </font><font color="#F3E651">></font><font color="#ff0000"> l </font><font color="#F3E651">{</font> -<font color="#ff0000"> j </font><font color="#F3E651">=</font><font color="#ff0000"> l</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> - -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> i </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> i </font><font color="#F3E651"><</font><font color="#ff0000"> j</font><font color="#F3E651">;</font><font color="#ff0000"> i</font><font color="#F3E651">++</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> fmt</font><font color="#F3E651">.</font><font color="#7bc710">Fprintf</font><font color="#F3E651">(&</font><font color="#ff0000">sb</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">"%v "</font><font color="#F3E651">,</font><font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">i</font><font color="#F3E651">])</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> - -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> j </font><font color="#F3E651"><</font><font color="#ff0000"> l </font><font color="#F3E651">{</font> -<font color="#ff0000"> fmt</font><font color="#F3E651">.</font><font color="#7bc710">Fprintf</font><font color="#F3E651">(&</font><font color="#ff0000">sb</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">"... "</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> - -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> sb</font><font color="#F3E651">.</font><font color="#7bc710">String</font><font color="#F3E651">()</font> -<font color="#F3E651">}</font> -</pre> -<br /> -<span>The <span class='inlinecode'>Sorted</span> method checks whether the <span class='inlinecode'>ArrayList</span> is sorted. This will be used by the unit tests later on:</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">func</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><font color="#ff0000">a ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">])</font><font color="#ff0000"> </font><font color="#7bc710">Sorted</font><font color="#F3E651">()</font><font color="#ff0000"> </font><b><font color="#F35E1E">bool</font></b><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> i </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><font color="#7bc710">len</font><font color="#F3E651">(</font><font color="#ff0000">a</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#F3E651">-</font><font color="#ff0000"> </font><font color="#bb00ff">1</font><font color="#F3E651">;</font><font color="#ff0000"> i </font><font color="#F3E651">></font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> i</font><font color="#F3E651">--</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">i</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651"><</font><font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">i</font><font color="#F3E651">-</font><font color="#bb00ff">1</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> false</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> true</font> -<font color="#F3E651">}</font> -</pre> -<br /> -<span>And the last utility method used is <span class='inlinecode'>Swap</span>, which allows swapping the values of two indices in the <span class='inlinecode'>ArrayList</span>:</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">func</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><font color="#ff0000">a ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">])</font><font color="#ff0000"> </font><font color="#7bc710">Swap</font><font color="#F3E651">(</font><font color="#ff0000">i</font><font color="#F3E651">,</font><font color="#ff0000"> j int</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> aux </font><font color="#F3E651">:=</font><font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">i</font><font color="#F3E651">]</font> -<font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">i</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">j</font><font color="#F3E651">]</font> -<font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">j</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> aux</font> -<font color="#F3E651">}</font> - -</pre> -<br /> -<h2 style='display: inline' id='Sleepsort'>Sleep sort</h2><br /> -<br /> -<span>Let's implement our first algorithm, sleep sort. Sleep sort is a non-traditional and unconventional sorting algorithm based on the idea of waiting a certain amount of time corresponding to the value of each element in the input <span class='inlinecode'>ArrayList</span>. It's more of a fun, creative concept rather than an efficient or practical sorting technique. This is not a sorting algorithm you would use in any production code. As you can imagine, it is quite an inefficient sorting algorithm (it's only listed here as a warm-up exercise). This sorting method may also return false results depending on how the Goroutines are scheduled by the Go runtime. </span><br /> -<br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">package</font></b><font color="#ff0000"> sort</font> - -<b><font color="#ffffff">import</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font> -<font color="#ff0000"> </font><font color="#bb00ff">"codeberg.org/snonux/algorithms/ds"</font> -<font color="#ff0000"> </font><font color="#bb00ff">"sync"</font> -<font color="#ff0000"> </font><font color="#bb00ff">"time"</font> -<font color="#F3E651">)</font> - -<b><font color="#ffffff">func</font></b><font color="#ff0000"> Sleep</font><font color="#F3E651">[</font><font color="#ff0000">V ds</font><font color="#F3E651">.</font><font color="#ff0000">Integer</font><font color="#F3E651">](</font><font color="#ff0000">a ds</font><font color="#F3E651">.</font><font color="#ff0000">ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">])</font><font color="#ff0000"> ds</font><font color="#F3E651">.</font><font color="#ff0000">ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> sorted </font><font color="#F3E651">:=</font><font color="#ff0000"> ds</font><font color="#F3E651">.</font><font color="#ff0000">NewArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">](</font><font color="#7bc710">len</font><font color="#F3E651">(</font><font color="#ff0000">a</font><font color="#F3E651">))</font> - -<font color="#ff0000"> numCh </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><font color="#7bc710">make</font><font color="#F3E651">(</font><b><font color="#ffffff">chan</font></b><font color="#ff0000"> V</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><b><font color="#ffffff">var</font></b><font color="#ff0000"> wg sync</font><font color="#F3E651">.</font><font color="#ff0000">WaitGroup</font> -<font color="#ff0000"> wg</font><font color="#F3E651">.</font><font color="#7bc710">Add</font><font color="#F3E651">(</font><font color="#7bc710">len</font><font color="#F3E651">(</font><font color="#ff0000">a</font><font color="#F3E651">))</font> - -<font color="#ff0000"> </font><b><font color="#ffffff">go</font></b><font color="#ff0000"> </font><b><font color="#ffffff">func</font></b><font color="#F3E651">()</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> wg</font><font color="#F3E651">.</font><font color="#7bc710">Wait</font><font color="#F3E651">()</font> -<font color="#ff0000"> </font><font color="#7bc710">close</font><font color="#F3E651">(</font><font color="#ff0000">numCh</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font><font color="#F3E651">()</font> - -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> _</font><font color="#F3E651">,</font><font color="#ff0000"> num </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><b><font color="#ffffff">range</font></b><font color="#ff0000"> a </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#ffffff">go</font></b><font color="#ff0000"> </font><b><font color="#ffffff">func</font></b><font color="#F3E651">(</font><font color="#ff0000">num V</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#ffffff">defer</font></b><font color="#ff0000"> wg</font><font color="#F3E651">.</font><font color="#7bc710">Done</font><font color="#F3E651">()</font> -<font color="#ff0000"> time</font><font color="#F3E651">.</font><font color="#7bc710">Sleep</font><font color="#F3E651">(</font><font color="#ff0000">time</font><font color="#F3E651">.</font><font color="#7bc710">Duration</font><font color="#F3E651">(</font><font color="#ff0000">num</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> time</font><font color="#F3E651">.</font><font color="#ff0000">Second</font><font color="#F3E651">)</font> -<font color="#ff0000"> numCh </font><font color="#F3E651"><-</font><font color="#ff0000"> num</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font><font color="#F3E651">(</font><font color="#ff0000">num</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> - -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> num </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><b><font color="#ffffff">range</font></b><font color="#ff0000"> numCh </font><font color="#F3E651">{</font> -<font color="#ff0000"> sorted </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#7bc710">append</font><font color="#F3E651">(</font><font color="#ff0000">sorted</font><font color="#F3E651">,</font><font color="#ff0000"> num</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> - -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> sorted</font> -<font color="#F3E651">}</font> -</pre> -<br /> -<span>This Go code implements the sleep sort algorithm using generics and goroutines. The main function <span class='inlinecode'>Sleep[V ds.Integer](a ds.ArrayList[V]) ds.ArrayList[V]</span> takes a generic <span class='inlinecode'>ArrayList</span> as input and returns a sorted <span class='inlinecode'>ArrayList</span>. The code creates a separate goroutine for each element in the input array, sleeps for a duration proportional to the element's value, and then sends the element to a channel. Another goroutine waits for all the sleeping goroutines to finish and then closes the channel. The sorted result <span class='inlinecode'>ArrayList</span> is constructed by appending the elements received from the channel in the order they arrive. The <span class='inlinecode'>sync.WaitGroup</span> is used to synchronize goroutines and ensure that all of them have completed before closing the channel.</span><br /> -<br /> -<h3 style='display: inline' id='Testing'>Testing</h3><br /> -<br /> -<span>For testing, we only allow values up to 10, as otherwise, it would take too long to finish:</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">package</font></b><font color="#ff0000"> sort</font> - -<b><font color="#ffffff">import</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font> -<font color="#ff0000"> </font><font color="#bb00ff">"fmt"</font> -<font color="#ff0000"> </font><font color="#bb00ff">"testing"</font> - -<font color="#ff0000"> </font><font color="#bb00ff">"codeberg.org/snonux/algorithms/ds"</font> -<font color="#F3E651">)</font> - -<b><font color="#ffffff">func</font></b><font color="#ff0000"> </font><font color="#7bc710">TestSleepSort</font><font color="#F3E651">(</font><font color="#ff0000">t </font><font color="#F3E651">*</font><font color="#ff0000">testing</font><font color="#F3E651">.</font><font color="#ff0000">T</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> a </font><font color="#F3E651">:=</font><font color="#ff0000"> ds</font><font color="#F3E651">.</font><font color="#ff0000">NewRandomArrayList</font><font color="#F3E651">[</font><font color="#ff0000">int</font><font color="#F3E651">](</font><font color="#bb00ff">10</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">10</font><font color="#F3E651">)</font> -<font color="#ff0000"> a </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#7bc710">Sleep</font><font color="#F3E651">(</font><font color="#ff0000">a</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">!</font><font color="#ff0000">a</font><font color="#F3E651">.</font><font color="#7bc710">Sorted</font><font color="#F3E651">()</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> t</font><font color="#F3E651">.</font><font color="#7bc710">Errorf</font><font color="#F3E651">(</font><font color="#bb00ff">"Array not sorted: %v"</font><font color="#F3E651">,</font><font color="#ff0000"> a</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#F3E651">}</font> -</pre> -<br /> -<span>As you can see, it takes <span class='inlinecode'>9s</span> here for the algorithm to finish (which is the highest value in the <span class='inlinecode'>ArrayList</span>):</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">❯ go </font><b><font color="#ffffff">test</font></b><font color="#ff0000"> </font><font color="#F3E651">.</font><font color="#ff0000">/sort -v -run SleepSort</font> -<font color="#F3E651">===</font><font color="#ff0000"> RUN TestSleepSort</font> -<font color="#ff0000">--- PASS</font><font color="#F3E651">:</font><font color="#ff0000"> TestSleepSort </font><font color="#F3E651">(</font><font color="#bb00ff">9</font><font color="#F3E651">.</font><font color="#ff0000">00s</font><font color="#F3E651">)</font> -<font color="#ff0000">PASS</font> -<font color="#ff0000">ok codeberg</font><font color="#F3E651">.</font><font color="#ff0000">org/snonux/algorithms/sort </font><font color="#bb00ff">9</font><font color="#F3E651">.</font><font color="#ff0000">002s</font> -</pre> -<br /> -<span>I won't write any benchmark for sleep sort; that will be done for the algorithms to come in this series :-).</span><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<a class='textlink' href='./2022-06-15-sweating-the-small-stuff.html'>2022-06-15 Sweating the small stuff - Tiny projects of mine</a><br /> +<a class='textlink' href='./2022-05-27-perl-is-still-a-great-choice.html'>2022-05-27 Perl is still a great choice</a><br /> +<a class='textlink' href='./2011-05-07-perl-daemon-service-framework.html'>2011-05-07 Perl Daemon (Service Framework)</a><br /> +<a class='textlink' href='./2008-06-26-perl-poetry.html'>2008-06-26 Perl Poetry</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> @@ -4964,7 +7356,7 @@ http://www.gnu.org/software/src-highlite --> <summary>These are my personal takeaways after reading 'Never split the difference' by Chris Voss. Note that the book contains much more knowledge wisdom and that these notes only contain points I personally found worth writing down. This is mainly for my own use, but you might find it helpful too.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Neversplitthedifferencebooknotes'>"Never split the difference" book notes</h1><br /> + <h1 style='display: inline' id='never-split-the-difference-book-notes'>"Never split the difference" book notes</h1><br /> <br /> <span class='quote'>Published at 2023-04-01T20:00:17+03:00</span><br /> <br /> @@ -4982,7 +7374,23 @@ http://www.gnu.org/software/src-highlite --> ''' </pre> <br /> -<h2 style='display: inline' id='Tacticallisteningspreadingempathy'>Tactical listening, spreading empathy</h2><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#never-split-the-difference-book-notes'>"Never split the difference" book notes</a></li> +<li>⇢ <a href='#tactical-listening-spreading-empathy'>Tactical listening, spreading empathy</a></li> +<li>⇢ <a href='#mindset-of-discovery'>Mindset of discovery</a></li> +<li>⇢ ⇢ <a href='#more-tips-'>More tips </a></li> +<li>⇢ <a href='#no-starts-the-conversation'>"No" starts the conversation</a></li> +<li>⇢ <a href='#win-win'>Win-win</a></li> +<li>⇢ <a href='#on-deadlines'>On Deadlines</a></li> +<li>⇢ <a href='#analyse-the-opponent'>Analyse the opponent</a></li> +<li>⇢ <a href='#use-different-ways-of-saying-no'>Use different ways of saying "no."</a></li> +<li>⇢ <a href='#calibrated-question'>Calibrated question</a></li> +<li>⇢ <a href='#the-black-swan-'>The black swan </a></li> +<li>⇢ <a href='#more'>More</a></li> +</ul><br /> +<h2 style='display: inline' id='tactical-listening-spreading-empathy'>Tactical listening, spreading empathy</h2><br /> <br /> <span>Be a mirror, copy each other to be comfy with each other to build up trust. Mirroring is mainly body language. A mirror is to repeat the words the other just said. Simple but effective.</span><br /> <br /> @@ -4993,7 +7401,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Mirror training is like Jedi training. Simple but effective. A mirror needs space. Be silent after "you want this?" </span><br /> <br /> -<h2 style='display: inline' id='Mindsetofdiscovery'>Mindset of discovery</h2><br /> +<h2 style='display: inline' id='mindset-of-discovery'>Mindset of discovery</h2><br /> <br /> <span>Try to have multiple realities in your mind and use facts to distinguish between real and false.</span><br /> <br /> @@ -5005,7 +7413,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Try: to put a label on someone's emotion and then be silent. Wait for the other to reveal himself. "You seem unhappy about this?"</span><br /> <br /> -<h3 style='display: inline' id='Moretips'>More tips </h3><br /> +<h3 style='display: inline' id='more-tips-'>More tips </h3><br /> <br /> <ul> <li>Put on a poker face and don't show emotions.</li> @@ -5014,7 +7422,7 @@ http://www.gnu.org/software/src-highlite --> <li>Being right is not the key to successful negotiation; being mindful is.</li> <li>Be in the safe zone of empathy and acknowledge bad news.</li> </ul><br /> -<h2 style='display: inline' id='Nostartstheconversation'>"No" starts the conversation</h2><br /> +<h2 style='display: inline' id='no-starts-the-conversation'>"No" starts the conversation</h2><br /> <br /> <span>When the opponent starts with a "no", he feels in control and comfortable. That's why he has to start with "no".</span><br /> <br /> @@ -5027,11 +7435,11 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Get a "That's right" when negotiating. Don't get a "you're right". You can summarise the opponent to get a "that's right".</span><br /> <br /> -<h2 style='display: inline' id='Winwin'>Win-win</h2><br /> +<h2 style='display: inline' id='win-win'>Win-win</h2><br /> <br /> <span>Win-win is a naive approach when encountering the win-lose counterpart, but always cooperate. Don't compromise, and don't split the difference. We don't compromise because it's right; we do it because it is easy. You must embrace the hard stuff; that's where the great deals are.</span><br /> <br /> -<h2 style='display: inline' id='OnDeadlines'>On Deadlines</h2><br /> +<h2 style='display: inline' id='on-deadlines'>On Deadlines</h2><br /> <br /> <ul> <li>All deadlines are imaginary.</li> @@ -5039,7 +7447,7 @@ http://www.gnu.org/software/src-highlite --> <li>They push a deal to a conclusion.</li> <li>They rush the counterpart to cause pressure and anxiety.</li> </ul><br /> -<h2 style='display: inline' id='Analysetheopponent'>Analyse the opponent</h2><br /> +<h2 style='display: inline' id='analyse-the-opponent'>Analyse the opponent</h2><br /> <br /> <ul> <li>Understand the motivation of people behind the table as well.</li> @@ -5049,7 +7457,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>The person on the other side is never the issue; the problem is the issue. Keep this in mind to avoid emotional issues with the person and focus on the problem, not the person. The bond is essential; never create an enemy.</span><br /> <br /> -<h2 style='display: inline' id='Usedifferentwaysofsayingno'>Use different ways of saying "no."</h2><br /> +<h2 style='display: inline' id='use-different-ways-of-saying-no'>Use different ways of saying "no."</h2><br /> <br /> <span class='quote'>I had paid my rent always in time. I had positive experiences with the building and would be sad for the landlord to lose a good tenant. I am looking for a win-win agreement between us. Pulling out the research, other neighbours offer much lower prices even if your building is a better location and services. How can I effort 200 more.... </span><br /> <br /> @@ -5057,7 +7465,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>You always have to embrace thoughtful confrontation for good negotiation and life. Don't avoid honest, clear conflict. It will give you the best deals. Compromises are mostly bad deals for both sides. Most people don't negotiate a win-win but a win-lose. Know the best and worst outcomes and what is acceptable for you.</span><br /> <br /> -<h2 style='display: inline' id='Calibratedquestion'>Calibrated question</h2><br /> +<h2 style='display: inline' id='calibrated-question'>Calibrated question</h2><br /> <br /> <span>Calibrated questions. Give the opponent a sense of power. Ask open-how questions to get the opponent to solve your problem and move him in your direction. Calibrated questions are the best tools. Summarise everything, and then ask, "how I am supposed to do that?". Asking for help this way with a calibrated question is a powerful tool for joint problem solving</span><br /> <br /> @@ -5073,11 +7481,11 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Prepare 3 to 5 calibrated questions for your counterpart. Be curious what is really motivating the other side. You can get out the "Black Swan".</span><br /> <br /> -<h2 style='display: inline' id='Theblackswan'>The black swan </h2><br /> +<h2 style='display: inline' id='the-black-swan-'>The black swan </h2><br /> <br /> <span>What we don't know can break our deal. Uncovering it can bring us unexpected success. You get what you ask for in this world, but you must learn to ask correctly. Reveal the black swan by asking questions.</span><br /> <br /> -<h2 style='display: inline' id='More'>More</h2><br /> +<h2 style='display: inline' id='more'>More</h2><br /> <br /> <span>Establish a range at top places like corp. I get... (e.g. remote London on a project basis). Set a high salary range and not a number. Also, check on LinkedIn premium for the salaries.</span><br /> <br /> @@ -5098,13 +7506,14 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other book notes of mine are:</span><br /> <br /> -<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> -<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> -<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> -<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> -<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2024-10-24-staff-engineer-book-notes.html'>2024-10-24 "Staff Engineer" book notes</a><br /> <a class='textlink' href='./2024-07-07-the-stoic-challenge-book-notes.html'>2024-07-07 "The Stoic Challenge" book notes</a><br /> +<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> +<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> +<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> +<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> @@ -5122,10 +7531,18 @@ http://www.gnu.org/software/src-highlite --> <summary>I proudly announce that I've released Gemtexter version `2.0.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Gemtexter200LetsGemtextagain'>Gemtexter 2.0.0 - Let's Gemtext again²</h1><br /> + <h1 style='display: inline' id='gemtexter-200---let-s-gemtext-again'>Gemtexter 2.0.0 - Let's Gemtext again²</h1><br /> <br /> <span class='quote'>Published at 2023-03-25T17:50:32+02:00</span><br /> <br /> +<span>I proudly announce that I've released Gemtexter version <span class='inlinecode'>2.0.0</span>. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash.</span><br /> +<br /> +<a class='textlink' href='https://codeberg.org/snonux/gemtexter'>https://codeberg.org/snonux/gemtexter</a><br /> +<br /> +<span>This is a new major release, so it contains a breaking change (see "Meta cache made obsolete").</span><br /> +<br /> +<span>Let's list what's new!</span><br /> +<br /> <pre> -=[ typewriters ]=- 1/98 @@ -5139,15 +7556,18 @@ http://www.gnu.org/software/src-highlite --> mod. by Paul Buetow `"""""""""` </pre> <br /> -<span>I proudly announce that I've released Gemtexter version <span class='inlinecode'>2.0.0</span>. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash.</span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<a class='textlink' href='https://codeberg.org/snonux/gemtexter'>https://codeberg.org/snonux/gemtexter</a><br /> -<br /> -<span>This is a new major release, so it contains a breaking change (see "Meta cache made obsolete").</span><br /> -<br /> -<span>Let's list what's new!</span><br /> -<br /> -<h2 style='display: inline' id='Minimaltemplateengine'>Minimal template engine</h2><br /> +<ul> +<li><a href='#gemtexter-200---let-s-gemtext-again'>Gemtexter 2.0.0 - Let's Gemtext again²</a></li> +<li>⇢ <a href='#minimal-template-engine'>Minimal template engine</a></li> +<li>⇢ <a href='#added-hooks'>Added hooks</a></li> +<li>⇢ <a href='#use-of-safer-bash-options'>Use of safer Bash options</a></li> +<li>⇢ <a href='#meta-cache-made-obsolete'>Meta cache made obsolete</a></li> +<li>⇢ <a href='#xmllint-support'>XMLLint support</a></li> +<li>⇢ <a href='#more'>More</a></li> +</ul><br /> +<h2 style='display: inline' id='minimal-template-engine'>Minimal template engine</h2><br /> <br /> <span>Gemtexter now supports templating, enabling dynamically generated content to <span class='inlinecode'>.gmi</span> files before converting anything to any output format like HTML and Markdown.</span><br /> <br /> @@ -5195,7 +7615,7 @@ Multiline template line 10 <pre> See more entries about DTail and Golang: -<< template::inline::index dtail golang +<< template::inline::rindex dtail golang Blablabla... </pre> @@ -5213,7 +7633,7 @@ See more entries about DTail and Golang: Blablabla... </pre> <br /> -<h2 style='display: inline' id='Addedhooks'>Added hooks</h2><br /> +<h2 style='display: inline' id='added-hooks'>Added hooks</h2><br /> <br /> <span>You can configure <span class='inlinecode'>PRE_GENERATE_HOOK</span> and <span class='inlinecode'>POST_PUBLISH_HOOK</span> to point to scripts to be executed before running <span class='inlinecode'>--generate</span>, or after running <span class='inlinecode'>--publish</span>. E.g. you could populate some of the content by an external script before letting Gemtexter do its thing or you could automatically deploy the site after running <span class='inlinecode'>--publish</span>.</span><br /> <br /> @@ -5223,15 +7643,15 @@ Blablabla... by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">declare</font></b><font color="#ff0000"> -xr </font><font color="#ff0000">PRE_GENERATE_HOOK</font><font color="#F3E651">=.</font><font color="#ff0000">/pre_generate_hook</font><font color="#F3E651">.</font><font color="#ff0000">sh</font> -<b><font color="#ffffff">declare</font></b><font color="#ff0000"> -xr </font><font color="#ff0000">POST_PUBLISH_HOOK</font><font color="#F3E651">=.</font><font color="#ff0000">/post_publish_hook</font><font color="#F3E651">.</font><font color="#ff0000">sh</font> +<pre><b><u><font color="#000000">declare</font></u></b> -xr PRE_GENERATE_HOOK=./pre_generate_hook.sh +<b><u><font color="#000000">declare</font></u></b> -xr POST_PUBLISH_HOOK=./post_publish_hook.sh </pre> <br /> -<h2 style='display: inline' id='UseofsaferBashoptions'>Use of safer Bash options</h2><br /> +<h2 style='display: inline' id='use-of-safer-bash-options'>Use of safer Bash options</h2><br /> <br /> <span>Gemtexter now does <span class='inlinecode'>set -euf -o pipefile</span>, which helps to eliminate bugs and to catch scripting errors sooner. Previous versions only <span class='inlinecode'>set -e</span>.</span><br /> <br /> -<h2 style='display: inline' id='Metacachemadeobsolete'>Meta cache made obsolete</h2><br /> +<h2 style='display: inline' id='meta-cache-made-obsolete'>Meta cache made obsolete</h2><br /> <br /> <span>Here is the breaking change to older versions of Gemtexter. The <span class='inlinecode'>$BASE_CONTENT_DIR/meta</span> directory was made obsolete. <span class='inlinecode'>meta</span> was used to store various information about all the blog post entries to make generating an Atom feed in Bash easier. Especially the publishing dates of each post were stored there. Instead, the publishing date is now encoded in the <span class='inlinecode'>.gmi</span> file. And if it is missing, Gemtexter will set it to the current date and time at first run.</span><br /> <br /> @@ -5241,10 +7661,10 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> cat gemfeed</font><font color="#F3E651">/</font><font color="#bb00ff">2023</font><font color="#ff0000">-</font><font color="#bb00ff">02</font><font color="#ff0000">-</font><font color="#bb00ff">26</font><font color="#ff0000">-title-here</font><font color="#F3E651">.</font><font color="#ff0000">gmi</font> -<i><font color="#ababab"># Title here</font></i> +<pre>% cat gemfeed/<font color="#000000">2023</font>-<font color="#000000">02</font>-<font color="#000000">26</font>-title-here.gmi +<i><font color="silver"># Title here</font></i> -<font color="#ff0000">The remaining content of the Gemtext file</font><font color="#F3E651">...</font> +The remaining content of the Gemtext file... </pre> <br /> <span>Gemtexter will add a line starting with <span class='inlinecode'>> Published at ...</span> now. Any subsequent Atom feed generation will then use that date.</span><br /> @@ -5253,19 +7673,19 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> cat gemfeed</font><font color="#F3E651">/</font><font color="#bb00ff">2023</font><font color="#ff0000">-</font><font color="#bb00ff">02</font><font color="#ff0000">-</font><font color="#bb00ff">26</font><font color="#ff0000">-title-here</font><font color="#F3E651">.</font><font color="#ff0000">gmi</font> -<i><font color="#ababab"># Title here</font></i> +<pre>% cat gemfeed/<font color="#000000">2023</font>-<font color="#000000">02</font>-<font color="#000000">26</font>-title-here.gmi +<i><font color="silver"># Title here</font></i> -<font color="#F3E651">></font><font color="#ff0000"> Published at </font><font color="#bb00ff">2023</font><font color="#ff0000">-</font><font color="#bb00ff">02</font><font color="#ff0000">-26T21</font><font color="#F3E651">:</font><font color="#bb00ff">43</font><font color="#F3E651">:</font><font color="#bb00ff">51</font><font color="#F3E651">+</font><font color="#bb00ff">01</font><font color="#F3E651">:</font><font color="#bb00ff">00</font> +> Published at <font color="#000000">2023</font>-<font color="#000000">02</font>-26T21:<font color="#000000">43</font>:<font color="#000000">51</font>+<font color="#000000">01</font>:<font color="#000000">00</font> -<font color="#ff0000">The remaining content of the Gemtext file</font><font color="#F3E651">...</font> +The remaining content of the Gemtext file... </pre> <br /> -<h2 style='display: inline' id='XMLLintsupport'>XMLLint support</h2><br /> +<h2 style='display: inline' id='xmllint-support'>XMLLint support</h2><br /> <br /> <span>Optionally, when the <span class='inlinecode'>xmllint</span> binary is installed, Gemtexter will perform a simple XML lint check against the Atom feed generated. This is a double-check of whether the Atom feed is a valid XML.</span><br /> <br /> -<h2 style='display: inline' id='More'>More</h2><br /> +<h2 style='display: inline' id='more'>More</h2><br /> <br /> <span>Additionally, there were a couple of bug fixes, refactorings and overall improvements in the documentation made. </span><br /> <br /> @@ -5273,11 +7693,12 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other related posts are:</span><br /> <br /> -<a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace</a><br /> -<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> -<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> -<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again² (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.html'>2024-10-02 Gemtexter 3.0.0 - Let's Gemtext again⁴</a><br /> <a class='textlink' href='./2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.html'>2023-07-21 Gemtexter 2.1.0 - Let's Gemtext again³</a><br /> +<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again² (You are currently reading this)</a><br /> +<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> +<a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> @@ -5295,7 +7716,7 @@ http://www.gnu.org/software/src-highlite --> <summary>These are my personal takeaways after reading 'The Pragmatic Programmer' by David Thomas and Andrew Hunt. Note that the book contains much more knowledge wisdom and that these notes only contain points I personally found worth writing down. This is mainly for my own use, but you might find it helpful too.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='ThePragmaticProgrammerbooknotes'>"The Pragmatic Programmer" book notes</h1><br /> + <h1 style='display: inline' id='the-pragmatic-programmer-book-notes'>"The Pragmatic Programmer" book notes</h1><br /> <br /> <span class='quote'>Published at 2023-03-16T00:55:20+02:00</span><br /> <br /> @@ -5346,7 +7767,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Do what works and not what's fashionable. E.g. does SCRUM make sense? The goal is to deliver deliverables and not to "become" agile.</span><br /> <br /> -<h2 style='display: inline' id='Continuouslearning'>Continuous learning</h2><br /> +<h2 style='display: inline' id='continuous-learning'>Continuous learning</h2><br /> <br /> <span>Add new tools to your repertoire every day and keep the momentum up. Learning new things is your most crucial aspect. Invest regularly in your knowledge portfolio. The learning process extends your thinking. It does not matter if you will never use it.</span><br /> <br /> @@ -5357,7 +7778,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Think critically about everything you learn. Use paper for your notes. There is something special about it.</span><br /> <br /> -<h2 style='display: inline' id='Stayconnected'>Stay connected</h2><br /> +<h2 style='display: inline' id='stay-connected'>Stay connected</h2><br /> <br /> <span>It's your life, and you own it. Bruce Lee once said: </span><br /> <br /> @@ -5370,7 +7791,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>It's your life. Share it, celebrate it, be proud and have fun.</span><br /> <br /> -<h2 style='display: inline' id='Thestoryofstonesoup'>The story of stone soup</h2><br /> +<h2 style='display: inline' id='the-story-of-stone-soup'>The story of stone soup</h2><br /> <br /> <span>How to motivate others to contribute something (e.g. ideas to a startup):</span><br /> <br /> @@ -5382,15 +7803,15 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other book notes of mine are:</span><br /> <br /> -<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> -<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> -<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> -<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> -<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2024-10-24-staff-engineer-book-notes.html'>2024-10-24 "Staff Engineer" book notes</a><br /> <a class='textlink' href='./2024-07-07-the-stoic-challenge-book-notes.html'>2024-07-07 "The Stoic Challenge" book notes</a><br /> +<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> +<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> +<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> +<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes (You are currently reading this)</a><br /> <br /> -<a class='textlink' href='../resources.html'>More books and other resources I found useful.</a><br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> @@ -5407,10 +7828,12 @@ http://www.gnu.org/software/src-highlite --> <summary>Do you need help fully discharging from work in the evenings or for the weekend? Shutting down from work won't just improve your work-life balance; it will also significantly improve the quality of your personal life and work. After a restful weekend, you will be much more energized and productive the next working day. So it should not just be in your own, but also your employers' interest that you fully relax and shut down after work. </summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Howtoshutdownafterwork'>How to shut down after work</h1><br /> + <h1 style='display: inline' id='how-to-shut-down-after-work'>How to shut down after work</h1><br /> <br /> <span class='quote'>Published at 2023-02-26T23:48:01+02:00</span><br /> <br /> +<span>Do you need help fully discharging from work in the evenings or for the weekend? Shutting down from work won't just improve your work-life balance; it will also significantly improve the quality of your personal life and work. After a restful weekend, you will be much more energized and productive the next working day. So it should not just be in your own, but also your employers' interest that you fully relax and shut down after work. </span><br /> +<br /> <pre> |\ "Music should be heard not only with the ears, but also the soul." |---|--\-----------------------|-----------------------------------------| @@ -5426,15 +7849,25 @@ http://www.gnu.org/software/src-highlite --> -@- [kom...@uwec.edu] </pre> <br /> -<span>Do you need help fully discharging from work in the evenings or for the weekend? Shutting down from work won't just improve your work-life balance; it will also significantly improve the quality of your personal life and work. After a restful weekend, you will be much more energized and productive the next working day. So it should not just be in your own, but also your employers' interest that you fully relax and shut down after work. </span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline' id='Haveashutdownroutine'>Have a shutdown routine</h2><br /> +<ul> +<li><a href='#how-to-shut-down-after-work'>How to shut down after work</a></li> +<li>⇢ <a href='#have-a-shutdown-routine'>Have a shutdown routine</a></li> +<li>⇢ <a href='#don-t-work-when-you-officially-don-t-work'>Don't work when you officially don't work</a></li> +<li>⇢ <a href='#distract-your-mind'>Distract your mind</a></li> +<li>⇢ <a href='#get-a-pet'>Get a pet</a></li> +<li>⇢ <a href='#journal-your-day'>Journal your day</a></li> +<li>⇢ <a href='#don-t-stress-about-what-your-employer-expects-from-you'>Don't stress about what your employer expects from you</a></li> +<li>⇢ <a href='#call-it-a-day'>Call it a day</a></li> +</ul><br /> +<h2 style='display: inline' id='have-a-shutdown-routine'>Have a shutdown routine</h2><br /> <br /> <span>Have a routine. Try to finish work around the same time every day. Write any outstanding tasks down for the next day, so you are sure you will remember them. Writing them down brings wonders as you can remove them from your mind for the remainder of the day (or the upcoming weekend) as you know you will surely pick them up the next working day. Tidying up your workplace could also count toward your daily shutdown routine. </span><br /> <br /> <span>A commute home from the office also greatly helps, as it disconnects your work from your personal life. Don't work on your commute home, though! If you don't commute but work from home, then it helps to walk around the block or in a nearby park to disconnect from work. </span><br /> <br /> -<h2 style='display: inline' id='Dontworkwhenyouofficiallydontwork'>Don't work when you officially don't work</h2><br /> +<h2 style='display: inline' id='don-t-work-when-you-officially-don-t-work'>Don't work when you officially don't work</h2><br /> <br /> <span>Unless you are self-employed, you have likely signed an N-hour per week contract with your employer, and your regular working times are from X o'clock in the morning to Y o'clock in the evening (with M minutes lunch break in the middle). And there might be some flexibility in your working times, too. But that kind of flexibility (e.g. extending the lunch break so that there is time to pick up a family member from the airport) will be agreed upon, and you will counteract it, for example, by starting working earlier the next day or working late, that one exception. But overall, your weekly working time will stay N hours. </span><br /> <br /> @@ -5448,7 +7881,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Checking for your messages constantly outside of regular office times makes it impossible to shut down and relax from work altogether. </span><br /> <br /> -<h2 style='display: inline' id='Distractyourmind'>Distract your mind</h2><br /> +<h2 style='display: inline' id='distract-your-mind'>Distract your mind</h2><br /> <br /> <span>Often, your mind goes back to work-related stuff even after work. That's normal as you concentrated highly on your work throughout the day. The brain unconsciously continues to work and will automatically present you with random work-related thoughts. You can counteract this by focusing on non-work stuff, which may include:</span><br /> <br /> @@ -5461,23 +7894,23 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Some of these can be habit-stacked: Exercise could be combined with watching videos about your passion project (e.g. watching lectures about that new programming language you are currently learning for fun). With walking, for example, you could combine listening to an Audiobook or music, or you could also think about your passion project during that walk. </span><br /> <br /> -<h2 style='display: inline' id='Getapet'>Get a pet</h2><br /> +<h2 style='display: inline' id='get-a-pet'>Get a pet</h2><br /> <br /> <span>Even if you have children, it helps wonders to get a pet. My cat, for example, will remind me a few times daily to take a few minute's breaks to pet, play or give food. So my cat not only helps me after work but throughout the day.</span><br /> <br /> <span>My neighbour also works from home, and he has dogs, which he regularly has to take out to the park.</span><br /> <br /> -<h2 style='display: inline' id='Journalyourday'>Journal your day</h2><br /> +<h2 style='display: inline' id='journal-your-day'>Journal your day</h2><br /> <br /> <span>If you are upset about something, making it impossible to shut down from work, write down everything (e.g., with a pen in a paper journal). Writing things down helps you to "get rid" of the negative. Especially after conflicts with colleagues or company decisions, you don't agree on. This kind of self-therapy is excellent. Brainstorm all your emotions and (even if opinionated) opinions so you have everything on paper. Once done, you don't think about it so much anymore, as you know you can access that information if required. But stopping ruminating about it will be much easier now. You will likely never access that information again, though. But at least writing the thoughts down saved your day. </span><br /> <br /> <span>Write down three things which went well for the day. This helps you to appreciate the day. </span><br /> <br /> -<h2 style='display: inline' id='Dontstressaboutwhatyouremployerexpectsfromyou'>Don't stress about what your employer expects from you</h2><br /> +<h2 style='display: inline' id='don-t-stress-about-what-your-employer-expects-from-you'>Don't stress about what your employer expects from you</h2><br /> <br /> <span>Think about what's fun and motivates you. Maybe the next promotion to Principal or a Manager role isn't for you. Many fall into the trap of stressing themselves out to satisfy the employer so that the next upgrade will happen and think about it constantly, even after work. But it is more important that you enjoy your craftsmanship. Work on what you expect from yourself. Ideally, your goals should be aligned with your employer. I am not saying you should abandon everything what your manager is asking you to do, but it is, after all, your life. And you have to decide where and on what you want to work. But don't sell yourself short. Keep track of your accomplishments.</span><br /> <br /> -<h2 style='display: inline' id='Callitaday'>Call it a day</h2><br /> +<h2 style='display: inline' id='call-it-a-day'>Call it a day</h2><br /> <br /> <span>Every day you gave your best was good; the day's outcome doesn't matter. What matters is that you know you gave your best and are closer to your goals than the previous day. This gives you a sense of progress and accomplishment.</span><br /> <br /> @@ -5498,13 +7931,26 @@ http://www.gnu.org/software/src-highlite --> <name>Paul Buetow aka snonux</name> <email>paul@dev.buetow.org</email> </author> - <summary>Art by Joan Stark</summary> + <summary>In 2021 I wrote 'On Being Pedantic about Open-Source', and there was a section 'What about mobile?' where I expressed the dilemma about the necessity of using proprietary mobile operating systems. With GrapheneOS, I found my perfect solution for personal mobile phone use. </summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='WhyGrapheneOSrox'>Why GrapheneOS rox</h1><br /> + <h1 style='display: inline' id='why-grapheneos-rox'>Why GrapheneOS rox</h1><br /> <br /> <span class='quote'>Published at 2023-01-23T15:31:52+02:00</span><br /> <br /> +<span>In 2021 I wrote "On Being Pedantic about Open-Source", and there was a section "What about mobile?" where I expressed the dilemma about the necessity of using proprietary mobile operating systems. With GrapheneOS, I found my perfect solution for personal mobile phone use. </span><br /> +<br /> +<a class='textlink' href='./2021-08-01-on-being-pedantic-about-open-source.html'>On Being Pedantic about Open-Source</a><br /> +<br /> +<span>What is GrapheneOS?</span><br /> +<br /> +<span class='quote'>GrapheneOS is a privacy and security-focused mobile OS with Android app compatibility developed as a non-profit open-source project. It's focused on the research and development of privacy and security technologies, including substantial improvements to sandboxing, exploits mitigations and the permission model.</span><br /> +<br /> +<span>GrapheneOS is an independent Android distribution based on the Android Open Source Project (AOSP) but hardened in multiple ways. Other independent Android distributions, like LineageOS, are also based on AOSP, but GrapheneOS takes it further so that it can be my daily driver on my phone.</span><br /> +<br /> +<a class='textlink' href='https://GrapheneOS.org'>https://GrapheneOS.org</a><br /> +<a class='textlink' href='https://LineageOS.org'>https://LineageOS.org</a><br /> +<br /> <pre> Art by Joan Stark _.===========================._ @@ -5528,20 +7974,20 @@ Art by Joan Stark '-'-'-'--' </pre> <br /> -<span>In 2021 I wrote "On Being Pedantic about Open-Source", and there was a section "What about mobile?" where I expressed the dilemma about the necessity of using proprietary mobile operating systems. With GrapheneOS, I found my perfect solution for personal mobile phone use. </span><br /> -<br /> -<a class='textlink' href='./2021-08-01-on-being-pedantic-about-open-source.html'>On Being Pedantic about Open-Source</a><br /> -<br /> -<span>What is GrapheneOS?</span><br /> -<br /> -<span class='quote'>GrapheneOS is a privacy and security-focused mobile OS with Android app compatibility developed as a non-profit open-source project. It's focused on the research and development of privacy and security technologies, including substantial improvements to sandboxing, exploits mitigations and the permission model.</span><br /> -<br /> -<span>GrapheneOS is an independent Android distribution based on the Android Open Source Project (AOSP) but hardened in multiple ways. Other independent Android distributions, like LineageOS, are also based on AOSP, but GrapheneOS takes it further so that it can be my daily driver on my phone.</span><br /> -<br /> -<a class='textlink' href='https://GrapheneOS.org'>https://GrapheneOS.org</a><br /> -<a class='textlink' href='https://LineageOS.org'>https://LineageOS.org</a><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline' id='UserProfiles'>User Profiles</h2><br /> +<ul> +<li><a href='#why-grapheneos-rox'>Why GrapheneOS rox</a></li> +<li>⇢ <a href='#user-profiles'>User Profiles</a></li> +<li>⇢ <a href='#proxying-some-of-the-google-offerings-'>Proxying some of the Google offerings </a></li> +<li>⇢ <a href='#google-play-sandboxing-'>Google Play Sandboxing </a></li> +<li>⇢ <a href='#the-camera-and-the-cloud-'>The camera and the cloud </a></li> +<li>⇢ <a href='#fine-granular-permissions'>Fine granular permissions</a></li> +<li>⇢ <a href='#termux'>Termux</a></li> +<li>⇢ <a href='#so-why-not-use-a-pure-linux-phone'>So, why not use a pure Linux phone?</a></li> +<li>⇢ <a href='#small-grapheneos-downsides-'>Small GrapheneOS downsides </a></li> +</ul><br /> +<h2 style='display: inline' id='user-profiles'>User Profiles</h2><br /> <br /> <span>GrapheneOS allows configuring up to 32 user profiles (including a guest profile) on a single phone. A profile is a completely different environment within the phone, and it is possible to switch between them instantly. Sessions of a profile can continue running in the background or be fully terminated. Each profile can have completely different settings and different applications installed.</span><br /> <br /> @@ -5551,7 +7997,7 @@ Art by Joan Stark <br /> <span>You notice how much longer (multiple days) your phone can be on a single charge when Google Play Services isn't running in the background. This tells a lot about the background activities and indicates that using Google Play shouldn't be the norm.</span><br /> <br /> -<h2 style='display: inline' id='ProxyingsomeoftheGoogleofferings'>Proxying some of the Google offerings </h2><br /> +<h2 style='display: inline' id='proxying-some-of-the-google-offerings-'>Proxying some of the Google offerings </h2><br /> <br /> <span>There's also the case that I am using an app from the Google Play store (as the app isn't available from F-Droid), which doesn't require Google Play Services to run in the background. Here's where I use the Aurora Android store. The Aurora store can be installed through F-Droid. Aurora acts as an anonymous proxy from your phone to the Google Play Store and lets you install apps from there. No Google credentials are required for that!</span><br /> <br /> @@ -5559,7 +8005,7 @@ Art by Joan Stark <br /> <span>There's a similar solution for watching videos on YouTube. You can use the NewPipe app (also from F-Droid), which acts as an anonymous proxy for watching videos from YouTube. So there isn't any need to install the official YouTube app, and there isn't any need to login to your Google account. What's so bad about the official app? You don't know which data it is sending about you to Google, so it is a privacy concern. </span><br /> <br /> -<h2 style='display: inline' id='GooglePlaySandboxing'>Google Play Sandboxing </h2><br /> +<h2 style='display: inline' id='google-play-sandboxing-'>Google Play Sandboxing </h2><br /> <br /> <span>Before switching to GrapheneOS, I had been using LineageOS on one of my phones for a couple of years. Still, I always had to have a secondary personal phone with all of these proprietary apps which (partially) only work with Google Play on the phone (e.g. Banking, Navigation, various travel apps from various Airlines, etc.) somewhere around as I didn't install Google Play on my LineageOS phone due to privacy concerns and only installed apps from the F-Droid store on it. When travelling, I always had to carry around a second phone with Google Play on it, as without it; life would become inconvenient pretty soon. </span><br /> <br /> @@ -5577,7 +8023,7 @@ Art by Joan Stark <br /> <span>It is great to have the flexibility to use any proprietary Android app when needed. That only applies to around 1% of my phone usage time, but you often don't always know when you need "that one app now". So it's perfect that it's covered with the phone you always have with you. </span><br /> <br /> -<h2 style='display: inline' id='Thecameraandthecloud'>The camera and the cloud </h2><br /> +<h2 style='display: inline' id='the-camera-and-the-cloud-'>The camera and the cloud </h2><br /> <br /> <span>I really want my phone to shoot good looking pictures, so that I can later upload them to the Irregular Ninja:</span><br /> <br /> @@ -5597,7 +8043,7 @@ Art by Joan Stark <br /> <span>I also use NextCloud to synchronize my notes (NextCloud Notes), my RSS news feeds (NextCloud News) and contacts (DAVx5). All apps required are available in the F-Droid store.</span><br /> <br /> -<h2 style='display: inline' id='Finegranularpermissions'>Fine granular permissions</h2><br /> +<h2 style='display: inline' id='fine-granular-permissions'>Fine granular permissions</h2><br /> <br /> <span>Another great thing about GrapheneOS is that, besides putting your apps into different profiles, you can also restrict network access and configure storage scopes per app individually.</span><br /> <br /> @@ -5605,7 +8051,7 @@ Art by Joan Stark <br /> <span>The app also wants to store and read some data from your phone (e.g. it could be a proprietary app for enhancing photos, and therefore storage access to a photo folder would be required). In GrapheneOS, you can configure a storage scope for that particular app, e.g. only read and write from one folder but still forbid access to all other folders on your phone.</span><br /> <br /> -<h2 style='display: inline' id='Termux'>Termux</h2><br /> +<h2 style='display: inline' id='termux'>Termux</h2><br /> <br /> <span>Termux can be installed on any Android phone through F-Droid, so it doesn't need to be a GrapheneOS phone. But I have to mention Termux here as it significantly adds value to my phone experience. </span><br /> <br /> @@ -5617,7 +8063,7 @@ Art by Joan Stark <br /> <span>There are Pixel phones with a screen size of 6", and that's decent enough for occasional use like that, and everything (the phone, the BT keyboard, maybe an external battery pack) all fit nicely in a small travel pocket.</span><br /> <br /> -<h2 style='display: inline' id='SowhynotuseapureLinuxphone'>So, why not use a pure Linux phone?</h2><br /> +<h2 style='display: inline' id='so-why-not-use-a-pure-linux-phone'>So, why not use a pure Linux phone?</h2><br /> <br /> <span>Strictly speaking, an Android phone is a Linux phone, but it's heavily modified and customized. For me, a "pure" Linux phone is a more streamlined Linux kernel running in a distribution like Ubuntu Touch or Mobian. </span><br /> <br /> @@ -5632,7 +8078,7 @@ Art by Joan Stark <br /> <a class='textlink' href='https://sailfishos.org'>SailfishOS</a><br /> <br /> -<h2 style='display: inline' id='SmallGrapheneOSdownsides'>Small GrapheneOS downsides </h2><br /> +<h2 style='display: inline' id='small-grapheneos-downsides-'>Small GrapheneOS downsides </h2><br /> <br /> <span>Sometimes, switching a profile to use a different app is annoying, and you can't copy and paste from the system clipboard from one profile to another. But that's a small price I am willing to pay!</span><br /> <br /> @@ -5658,12 +8104,10 @@ Art by Joan Stark <summary>As a regular participant in the annual Pet Project competition at work, I always try to find a project where I can learn something new. In this post, I would like to share my takeaways after revisiting Java. You can read about my motivations in my 'Creative universe' post:</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='RelearningJavaMytakeaways'>(Re)learning Java - My takeaways</h1><br /> + <h1 style='display: inline' id='relearning-java---my-takeaways'>(Re)learning Java - My takeaways</h1><br /> <br /> <span class='quote'>Published at 2022-12-24T23:18:40+02:00</span><br /> <br /> -<a href='./ultrarelearning-java-my-takeaways/learnjava.jpg'><img src='./ultrarelearning-java-my-takeaways/learnjava.jpg' /></a><br /> -<br /> <span>As a regular participant in the annual Pet Project competition at work, I always try to find a project where I can learn something new. In this post, I would like to share my takeaways after revisiting Java. You can read about my motivations in my "Creative universe" post:</span><br /> <br /> <a class='textlink' href='./2022-04-10-creative-universe.html'>Creative universe</a><br /> @@ -5676,13 +8120,31 @@ Art by Joan Stark <br /> <span>At my workplace, as an SRE, I don't do Java a lot. I have been reading Java code to understand the software better so I can apply and suggest workarounds or fixes to existing issues and bugs. However, most of our stack is in Java, and our Software Engineers use Java as their primary programming language.</span><br /> <br /> -<h2 style='display: inline' id='StuckatJava14'>Stuck at Java 1.4</h2><br /> +<a href='./ultrarelearning-java-my-takeaways/learnjava.jpg'><img src='./ultrarelearning-java-my-takeaways/learnjava.jpg' /></a><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#relearning-java---my-takeaways'>(Re)learning Java - My takeaways</a></li> +<li>⇢ <a href='#stuck-at-java-14'>Stuck at Java 1.4</a></li> +<li>⇢ <a href='#relearning--upskilling-to-java-18'>(Re)learning & upskilling to Java 18</a></li> +<li>⇢ ⇢ <a href='#effective-java'>Effective Java</a></li> +<li>⇢ ⇢ <a href='#java-pub-house'>Java Pub House</a></li> +<li>⇢ ⇢ <a href='#java-concurrency-course'>Java Concurrency course</a></li> +<li>⇢ ⇢ <a href='#read-a-lot-of-java-code'>Read a lot of Java code</a></li> +<li>⇢ ⇢ <a href='#observed-java-code-reviews'>Observed Java code reviews</a></li> +<li>⇢ ⇢ <a href='#took-ownership-of-a-roadmap-java-project'>Took ownership of a roadmap-Java project</a></li> +<li>⇢ <a href='#the-good'>The good</a></li> +<li>⇢ <a href='#the-bad-and-the-ugly'>The bad and the ugly</a></li> +<li>⇢ <a href='#conclusion'>Conclusion</a></li> +</ul><br /> +<h2 style='display: inline' id='stuck-at-java-14'>Stuck at Java 1.4</h2><br /> <br /> <span>Over time, I had been missing out on many new features that were added to the language since Java 1.4, so I decided to implement my next Pet Project in Java and learn every further aspect of the language as my main goal. Of course, I still liked the idea of winning a Pet Project Prize, but my main objective was to level up my Java skills.</span><br /> <br /> -<h2 style='display: inline' id='RelearningupskillingtoJava18'>(Re)learning & upskilling to Java 18</h2><br /> +<h2 style='display: inline' id='relearning--upskilling-to-java-18'>(Re)learning & upskilling to Java 18</h2><br /> <br /> -<h3 style='display: inline' id='EffectiveJava'>Effective Java</h3><br /> +<h3 style='display: inline' id='effective-java'>Effective Java</h3><br /> <br /> <span>This book was recommended by my brother and also by at least another colleague at work to be one of the best, if not the best, book about Java programming. I read the whole book from the beginning to the end and immersed myself in it. I fully agree; this is a great book. Every Java developer or Java software engineer should read it!</span><br /> <br /> @@ -5692,30 +8154,30 @@ Art by Joan Stark <br /> <a class='textlink' href='https://dev.to/kylec32/series/2292'>Kyle Carter's 90-part Effective Java Series </a><br /> <br /> -<h3 style='display: inline' id='JavaPubHouse'>Java Pub House</h3><br /> +<h3 style='display: inline' id='java-pub-house'>Java Pub House</h3><br /> <br /> <span>During my lunch breaks, I usually have a walk around the block or in a nearby park. I used that time to listen to the Java Pub House podcast. I listened to *every* episode and learned tons of new stuff. I can highly recommend this podcast. Especially GraalVM, a high-performance JDK distribution written for Java and other JVM languages, captured my attention. GraalVM can compile Java code into native binaries, improving performance and easing the distribution of Java programs. Because of the latter, I should release a VS-Sim GraalVM edition one day through a Linux AppImage ;-).</span><br /> <br /> <a class='textlink' href='https://www.javapubhouse.com'>https://www.javapubhouse.com</a><br /> <a class='textlink' href='https://www.graalvm.org'>https://www.graalvm.org</a><br /> <br /> -<h3 style='display: inline' id='JavaConcurrencycourse'>Java Concurrency course</h3><br /> +<h3 style='display: inline' id='java-concurrency-course'>Java Concurrency course</h3><br /> <br /> <span>I also watched a course on O'Reilly Safari Books online about Java Concurrency. That gave an excellent refresher on how the Java thread pools work and what were the concurrency primitives available in the standard library.</span><br /> <br /> -<h3 style='display: inline' id='ReadalotofJavacode'>Read a lot of Java code</h3><br /> +<h3 style='display: inline' id='read-a-lot-of-java-code'>Read a lot of Java code</h3><br /> <br /> <span>First, the source code is often the best documentation (if programmed nicely), and second, it helps to get the hang of the language and standard practices. I started to read more and more Java code at work. I did that whenever I had to understand how something, in particular, worked (e.g. while troubleshooting and debugging an issue). </span><br /> <br /> -<h3 style='display: inline' id='ObservedJavacodereviews'>Observed Java code reviews</h3><br /> +<h3 style='display: inline' id='observed-java-code-reviews'>Observed Java code reviews</h3><br /> <br /> <span>Another great way to get the hang of Java again was to sneak into the code reviews of the Software Engineer colleagues. They are the expert on the matter and are a great source to copy knowledge. It's OK to stay passive and only follow the reviews. Sometimes, it's OK to step up and take ownership of the review. The developers will also always be happy to answer any naive questions which come up.</span><br /> <br /> -<h3 style='display: inline' id='TookownershipofaroadmapJavaproject'>Took ownership of a roadmap-Java project</h3><br /> +<h3 style='display: inline' id='took-ownership-of-a-roadmap-java-project'>Took ownership of a roadmap-Java project</h3><br /> <br /> <span>Besides my Pet Project, I also took ownership of a regular roadmap Java project at work, making an internal Java service capable of running in Kubernetes. This was a bunch of minor changes and adding a bunch of classes and unit tests dealing with the statelessness and a persistent job queue in Redis. The job also involved reading and understanding a lot of already existing Java code. It wasn't part of my job description, but it was fun, and I learned a lot. The service runs smoothly in production now. Of course, all of my code got reviewed by my Software Engineering colleagues.</span><br /> <br /> -<h2 style='display: inline' id='Thegood'>The good</h2><br /> +<h2 style='display: inline' id='the-good'>The good</h2><br /> <br /> <span>From the new language features and syntaxes, there are many personal takeaways, and I can't possibly list them all, but here are some of my personal highlights:</span><br /> <br /> @@ -5736,7 +8198,7 @@ Art by Joan Stark <li>Lambdas are much cleaner, shorter and easier to read than anonymous classes. Many Java libraries require passing instances of (anonymous) classes (e.g. in Swing) to other objects. Lambdas are so lovely because they are primarily compatible with the passing of anonymous classes, so they are a 1:1 replacement in many instances. Lambdas also play very nicely together with the Java functional interfaces, as each Lambda got a type, and the type can be an already existing functional interface (or, if you got a particular case, you could define your custom functional interface for your own set of Lambdas, of course).</li> <li>I love the concept of Java records. You can think of a record as an immutable object holding some data (as members). They are ideal for pipe and stream processing. They are much easier to define (with much less boilerplate) and come with write protection out of the box.</li> </ul><br /> -<h2 style='display: inline' id='Thebadandtheugly'>The bad and the ugly</h2><br /> +<h2 style='display: inline' id='the-bad-and-the-ugly'>The bad and the ugly</h2><br /> <br /> <span>There are also many ugly corners in Java. Many are doomed to stay there forever due to historical decisions and ensuring backward compatibility with older versions of the Java language and the Java standard library. </span><br /> <br /> @@ -5750,7 +8212,7 @@ Art by Joan Stark <li>Being a bit spoiled by Golang's Goroutines, I was shocked about the limitations of the Java threads. They are resource hungry, and you can't just spin up millions of them as you would with Goroutines. I knew this limitation of threads already (as it's not a problem of the language but of how threads work in the OS), but still, I was pretty shocked when I got reminded of them again. Of course, there's a workaround: Use asynchronous sockets so that you don't waste a whole thread on a single I/O operation (in my case, waiting for a network response). Golang's runtime does that automatically for you: An OS thread will be re-used for other tasks until the network socket unblocks. Every modern programming language should support lightweight threads or Coroutines like Go's Goroutines. </li> </ul><br /> <br /> -<h2 style='display: inline' id='Conclusion'>Conclusion</h2><br /> +<h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> <br /> <span>While (re)learning Java, I felt like a student again and was quite enthusiastic about it initially. I invested around half a year, immersing myself intensively in Java (again). The last time I did that was many years ago as a university student. I even won a Silver Prize at work, implementing a project this year (2022 as of writing this). I feel confident now with understanding, debugging and patching Java code at work, which boosted my debugging and troubleshooting skills. </span><br /> <br /> @@ -5779,13 +8241,25 @@ Art by Joan Stark <name>Paul Buetow aka snonux</name> <email>paul@dev.buetow.org</email> </author> - <summary>Art by \ \_! / __!</summary> + <summary>As a long-lasting user of Vim (and NeoVim), I always wondered what GNU Emacs is really about, so I decided to try it. I didn't try vanilla GNU Emacs, but Doom Emacs. I chose Doom Emacs as it is a neat distribution of Emacs with Evil mode enabled by default. Evil mode allows Vi(m) key bindings (so to speak, it's emulating Vim within Emacs), and I am pretty sure I won't be ready to give up all the muscle memory I have built over more than a decade.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='ItriedDoomEmacsbutIswitchedbacktoNeoVim'>I tried (Doom) Emacs, but I switched back to (Neo)Vim</h1><br /> + <h1 style='display: inline' id='i-tried-doom-emacs-but-i-switched-back-to-neovim'>I tried (Doom) Emacs, but I switched back to (Neo)Vim</h1><br /> <br /> <span class='quote'>Published at 2022-11-24T11:17:15+02:00; Updated at 2022-11-26</span><br /> <br /> +<span>As a long-lasting user of Vim (and NeoVim), I always wondered what GNU Emacs is really about, so I decided to try it. I didn't try vanilla GNU Emacs, but Doom Emacs. I chose Doom Emacs as it is a neat distribution of Emacs with Evil mode enabled by default. Evil mode allows Vi(m) key bindings (so to speak, it's emulating Vim within Emacs), and I am pretty sure I won't be ready to give up all the muscle memory I have built over more than a decade.</span><br /> +<br /> +<a class='textlink' href='https://www.gnu.org/software/emacs/'>GNU Emacs</a><br /> +<a class='textlink' href='https://github.com/doomemacs/'>Doom Emacs</a><br /> +<br /> +<span>I used Doom Emacs for around two months. Still, ultimately I decided to switch back to NeoVim as my primary editor and IDE and Vim (usually pre-installed on Linux-based systems) and Nvi (usually pre-installed on *BSD systems) as my "always available editor" for quick edits. (It is worth mentioning that I don't have a high opinion on whether Vim or NeoVim is the better editor, I prefer NeoVim as it comes with better defaults out of the box, but there is no real blocker to use Vim instead).</span><br /> +<br /> +<a class='textlink' href='https://www.vim.org'>Vim</a><br /> +<a class='textlink' href='https://neovim.io'>NeoVim</a><br /> +<br /> +<span>So why did I switch back to the Vi-family?</span><br /> +<br /> <pre> _/ \ _(\(o / \ / _ ^^^o @@ -5799,25 +8273,25 @@ Art by \ \_! / __! ^^----^^ "^--v' </pre> <br /> -<span>As a long-lasting user of Vim (and NeoVim), I always wondered what GNU Emacs is really about, so I decided to try it. I didn't try vanilla GNU Emacs, but Doom Emacs. I chose Doom Emacs as it is a neat distribution of Emacs with Evil mode enabled by default. Evil mode allows Vi(m) key bindings (so to speak, it's emulating Vim within Emacs), and I am pretty sure I won't be ready to give up all the muscle memory I have built over more than a decade.</span><br /> -<br /> -<a class='textlink' href='https://www.gnu.org/software/emacs/'>GNU Emacs</a><br /> -<a class='textlink' href='https://github.com/doomemacs/'>Doom Emacs</a><br /> -<br /> -<span>I used Doom Emacs for around two months. Still, ultimately I decided to switch back to NeoVim as my primary editor and IDE and Vim (usually pre-installed on Linux-based systems) and Nvi (usually pre-installed on *BSD systems) as my "always available editor" for quick edits. (It is worth mentioning that I don't have a high opinion on whether Vim or NeoVim is the better editor, I prefer NeoVim as it comes with better defaults out of the box, but there is no real blocker to use Vim instead).</span><br /> -<br /> -<a class='textlink' href='https://www.vim.org'>Vim</a><br /> -<a class='textlink' href='https://neovim.io'>NeoVim</a><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<span>So why did I switch back to the Vi-family?</span><br /> -<br /> -<h2 style='display: inline' id='Emacsisagiantdragon'>Emacs is a giant dragon</h2><br /> +<ul> +<li><a href='#i-tried-doom-emacs-but-i-switched-back-to-neovim'>I tried (Doom) Emacs, but I switched back to (Neo)Vim</a></li> +<li>⇢ <a href='#emacs-is-a-giant-dragon'>Emacs is a giant dragon</a></li> +<li>⇢ <a href='#magit-love'>Magit love</a></li> +<li>⇢ <a href='#graphical-ui'>Graphical UI</a></li> +<li>⇢ <a href='#scripting-it'>Scripting it</a></li> +<li>⇢ <a href='#the-famous-emacs-org-mode'>The famous Emacs Org mode</a></li> +<li>⇢ <a href='#seeking-simplicity'>Seeking simplicity</a></li> +<li>⇢ <a href='#conclusion'>Conclusion</a></li> +</ul><br /> +<h2 style='display: inline' id='emacs-is-a-giant-dragon'>Emacs is a giant dragon</h2><br /> <br /> <span>Emacs feels like a giant dragon as it is much more than an editor or an integrated development environment. Emacs is a whole platform on its own. There's an E-Mail client, an IRC client, or even games you can run within Emacs. And you can also change Emacs within Emacs using its own Lisp dialect, Emacs Lisp (Emacs is programmed in Emacs Lisp). Therefore, Emacs is also its own programming language. You can change every aspect of Emacs within Emacs itself. People jokingly state Emacs is an operating system and that you should directly use it as the <span class='inlinecode'>init 1</span> process (if you don't know what the <span class='inlinecode'>init 1</span> process is: Under UNIX and similar operating systems, it's the very first userland processed launched. That's usually <span class='inlinecode'>systemd</span> on Linux-based systems, <span class='inlinecode'>launchd</span> on macOS, or any other init script or init system used by the OS)!</span><br /> <br /> <span>In many aspects, Emacs is like shooting at everything with a bazooka! However, I prefer it simple. I only wanted Emacs to be a good editor (which it is, too), but there's too much other stuff in Emacs that I don't need to care about! Vim and NeoVim do one thing excellent: Being great text editors and, when loaded with plugins, decent IDEs, too. </span><br /> <br /> -<h2 style='display: inline' id='Magitlove'>Magit love</h2><br /> +<h2 style='display: inline' id='magit-love'>Magit love</h2><br /> <br /> <span>I almost fell in love with Magit, an integrated Git client for Emacs. But I think the best way to interact with Git is to use the <span class='inlinecode'>git</span> command line directly. I don't worry about typing out all the commands, as the most commonly used commands are in my shell history. Other useful Git programs I use frequently are <span class='inlinecode'>bit</span> and <span class='inlinecode'>tig</span>. Also, get a mechanical keyboard that makes hammering whole commands into the terminal even more enjoyable.</span><br /> <br /> @@ -5826,13 +8300,13 @@ Art by \ \_! / __! <br /> <span>Magit is pretty neat for basic Git operations, but I found myself searching the internet for the correct sub-commands to do the things I wanted to do in Git. Mainly, the way how branches are managed is confusing. Often, I fell back to the command line to fix up the mess I produced with Magit (e.g. accidentally pushing to the wrong remote branch, so I found myself fixing things manually on the terminal with the <span class='inlinecode'>git</span> command with forced pushes....). Magit is hotkey driven, and common commands are quickly explorable through built-in hotkey menus. Still, I found it challenging to navigate to more advanced Git sub-commands that way which was much easier accomplished by using the <span class='inlinecode'>git</span> command directly.</span><br /> <br /> -<h2 style='display: inline' id='GraphicalUI'>Graphical UI</h2><br /> +<h2 style='display: inline' id='graphical-ui'>Graphical UI</h2><br /> <br /> <span>If there is one thing I envy about Emacs is that it's a graphical program, whereas the Vi-family of editors are purely terminal-based. I see the benefits of being a graphical program as this enables the use of multiple fonts simultaneously to embed pictures and graphs (that would be neat as a Markdown preview, for example). There's also GVim (Vim with GTK UI), but that's more of an afterthought.</span><br /> <br /> <span>There are now graphical front-end clients for NeoVim, but I still need to dig into them. Let me know your experience if you have one. Luckily, I don't rely on something graphical in my text editor, but it would improve how the editor looks and feels. UTF8 can already do a lot in the terminal, and terminal emulators also allow you to use TrueType fonts. Still, you will always be limited to one TTF font for the whole terminal, and it isn't possible to have, for example, a different font for headings, paragraphs, etc... you get the idea. TTF+UTF8 can't beat authentic graphics. </span><br /> <br /> -<h2 style='display: inline' id='Scriptingit'>Scripting it</h2><br /> +<h2 style='display: inline' id='scripting-it'>Scripting it</h2><br /> <br /> <span>It is possible to customize every aspect of Emacs through Emacs Lisp. I have done some Elk Scheme programming in the past (a dialect of Lisp), but that was a long time ago, and I am not willing to dive here again to customize my environment. I would instead take the pragmatic approach and script what I need in VimScript (a terrible language, but it gets the job done!). I watched Damian Conway's VimScript course on O'Reilly Safari Books Online, which I greatly recommend. Yes, VimScript feels clunky, funky and weird and is far less elegant than Lisp, but it gets its job done - in most cases! (That reminds me that the Vim team has announced a new major version of VimScript with improvements and language changes made - I haven't gotten to it yet - but I assume that VimScript will always stay VimScript).</span><br /> <br /> @@ -5853,15 +8327,15 @@ Art by \ \_! / __! by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">" Clipboard</font></i> -<font color="#ff0000">vnoremap ,</font><b><font color="#ffffff">y</font></b><font color="#ff0000"> !pbcopy</font><font color="#ff0000"><CR></font><font color="#ff0000">ugv</font> -<font color="#ff0000">vnoremap ,</font><b><font color="#ffffff">i</font></b><font color="#ff0000"> !pbpaste</font><font color="#ff0000"><CR></font> -<font color="#ff0000">nmap ,</font><b><font color="#ffffff">i</font></b><font color="#ff0000"> !wpbpaste</font><font color="#ff0000"><CR></font> +<pre><i><font color="silver">" Clipboard</font></i> +vnoremap ,<b><u><font color="#000000">y</font></u></b> !pbcopy<CR>ugv +vnoremap ,<b><u><font color="#000000">i</font></u></b> !pbpaste<CR> +nmap ,<b><u><font color="#000000">i</font></u></b> !wpbpaste<CR> </pre> <br /> <span>That's only a very few lines and does precisely what I want. It's quick and dirty but get's the job done! If VimScript becomes too cumbersome, I can use Lua for NeoVim scripting.</span><br /> <br /> -<h2 style='display: inline' id='ThefamousEmacsOrgmode'>The famous Emacs Org mode</h2><br /> +<h2 style='display: inline' id='the-famous-emacs-org-mode'>The famous Emacs Org mode</h2><br /> <br /> <span>Org-mode is an Emacs mode for keeping notes, authoring documents, computational notebooks, literate programming, maintaining to-do lists, planning projects, and more — in a fast and effective plain-text system. There's even a dedicated website for it:</span><br /> <br /> @@ -5881,13 +8355,13 @@ http://www.gnu.org/software/src-highlite --> <a class='textlink' href='https://zsh.sourceforge.io/'>Z shell</a><br /> <a class='textlink' href='https://github.com/tmux/tmux'>tmux terminal multiplexer</a><br /> <br /> -<h2 style='display: inline' id='Seekingsimplicity'>Seeking simplicity</h2><br /> +<h2 style='display: inline' id='seeking-simplicity'>Seeking simplicity</h2><br /> <br /> <span>I am not ready to dive deep into the whole world of Emacs. I prefer small and simple tools as opposed to complex tools. Emacs comes with many features out of the box, whereas in Vim/NeoVim, you would need to install many plugins to replicate some of the behaviour. Yes, I need to invest time managing all the Vim/NeoVim plugins I use, but I feel more in control compared to Doom Emacs, where a framework around vanilla Emacs manages all the plugins. I could use vanilla Emacs and manage all my plugins the vanilla way, but for me, it's not worth the effort to learn and dive into that as all that I want to do I can already do with Vim/NeoVim.</span><br /> <br /> <span>I am not saying that Vim/NeoVim are simple programs, but they are much simpler than Emacs with much smaller footprints; furthermore, they appear to be more straightforward as I am used to them. I only need Vim/NeoVim to be an editor, an IDE (through some plugins), and nothing more.</span><br /> <br /> -<h2 style='display: inline' id='Conclusion'>Conclusion</h2><br /> +<h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> <br /> <span>I understand the Emacs users now. Emacs is an incredibly powerful platform for almost everything, not just text editing. With Emacs, you can do nearly everything (Writing, editing, programming, calendar scheduling and note taking, Jira integration, playing games, listening to music, reading/writing emails, browsing the web, using as a calculator, generating HTML pages, configuring interactive menus, jumping around between every feature and every file within one single session, chat on IRC, surf the Gopherspace, ... the options are endless....). If you want to have one piece of software which rules it all and you are happy to invest a large part of your time in your platform: Pick Emacs, and over time Emacs will become "your" Emacs, customized to your own needs and change the way it works, which makes the Emacs users stick even more to it.</span><br /> <br /> @@ -5915,10 +8389,22 @@ http://www.gnu.org/software/src-highlite --> <summary>This will be a quick blog post, as I am busy with my personal life now. I have relocated to a different country and am still busy arranging things. So bear with me :-)</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='InstallingDTailonOpenBSD'>Installing DTail on OpenBSD</h1><br /> + <h1 style='display: inline' id='installing-dtail-on-openbsd'>Installing DTail on OpenBSD</h1><br /> <br /> <span class='quote'>Published at 2022-10-30T11:03:19+02:00</span><br /> <br /> +<span>This will be a quick blog post, as I am busy with my personal life now. I have relocated to a different country and am still busy arranging things. So bear with me :-)</span><br /> +<br /> +<span> In this post, I want to give a quick overview (or how-to) about installing DTail on OpenBSD, as the official documentation only covers Red Hat and Fedora Linux! And this blog post will also be used as my reference!</span><br /> +<br /> +<a class='textlink' href='https://dtail.dev'>https://dtail.dev</a><br /> +<br /> +<span>I am using Rexify for my OpenBSD automation. Check out the following article covering my Rex setup in a little bit more detail:</span><br /> +<br /> +<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>Let's Encrypt with OpenBSD and Rex</a><br /> +<br /> +<span>I will also mention some relevant <span class='inlinecode'>Rexfile</span> snippets in this post!</span><br /> +<br /> <pre> ,_---~~~~~----._ _,,_,*^____ _____``*g*\"*, @@ -5956,19 +8442,22 @@ http://www.gnu.org/software/src-highlite --> ' ' </pre> <br /> -<span>This will be a quick blog post, as I am busy with my personal life now. I have relocated to a different country and am still busy arranging things. So bear with me :-)</span><br /> -<br /> -<span> In this post, I want to give a quick overview (or how-to) about installing DTail on OpenBSD, as the official documentation only covers Red Hat and Fedora Linux! And this blog post will also be used as my reference!</span><br /> -<br /> -<a class='textlink' href='https://dtail.dev'>https://dtail.dev</a><br /> -<br /> -<span>I am using Rexify for my OpenBSD automation. Check out the following article covering my Rex setup in a little bit more detail:</span><br /> -<br /> -<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>Let's Encrypt with OpenBSD and Rex</a><br /> -<br /> -<span>I will also mention some relevant <span class='inlinecode'>Rexfile</span> snippets in this post!</span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline' id='Compileit'>Compile it</h2><br /> +<ul> +<li><a href='#installing-dtail-on-openbsd'>Installing DTail on OpenBSD</a></li> +<li>⇢ <a href='#compile-it'>Compile it</a></li> +<li>⇢ <a href='#install-it'>Install it</a></li> +<li>⇢ ⇢ <a href='#rexification'>Rexification</a></li> +<li>⇢ <a href='#configure-it'>Configure it</a></li> +<li>⇢ ⇢ <a href='#rexification'>Rexification</a></li> +<li>⇢ <a href='#update-the-key-cache-for-it'>Update the key cache for it</a></li> +<li>⇢ ⇢ <a href='#rexification'>Rexification</a></li> +<li>⇢ <a href='#start-it'>Start it</a></li> +<li>⇢ <a href='#use-it'>Use it</a></li> +<li>⇢ <a href='#conclusions'>Conclusions</a></li> +</ul><br /> +<h2 style='display: inline' id='compile-it'>Compile it</h2><br /> <br /> <span>First of all, DTail needs to be downloaded and compiled. For that, <span class='inlinecode'>git</span>, <span class='inlinecode'>go</span>, and <span class='inlinecode'>gmake</span> are required:</span><br /> <br /> @@ -6003,7 +8492,7 @@ $ doas pkg_delete git go gmake <br /> <span>One day I shall create an official OpenBSD port for DTail.</span><br /> <br /> -<h2 style='display: inline' id='Installit'>Install it</h2><br /> +<h2 style='display: inline' id='install-it'>Install it</h2><br /> <br /> <span>Installing the binaries is now just a matter of copying them to <span class='inlinecode'>/usr/local/bin</span> as follows:</span><br /> <br /> @@ -6045,7 +8534,7 @@ END $ doas chmod 755 /etc/rc.d/dserver </pre> <br /> -<h3 style='display: inline' id='Rexification'>Rexification</h3><br /> +<h3 style='display: inline' id='rexification'>Rexification</h3><br /> <br /> <span>This is the task for setting it up via Rex. Note the <span class='inlinecode'>. . . .</span>, that's a placeholder which we will fill up more and more during this blog post:</span><br /> <br /> @@ -6072,7 +8561,7 @@ task 'dtail', group => 'frontends', }; </pre> <br /> -<h2 style='display: inline' id='Configureit'>Configure it</h2><br /> +<h2 style='display: inline' id='configure-it'>Configure it</h2><br /> <br /> <span>Now, DTail is fully installed but still needs to be configured. Grab the default config file from GitHub ...</span><br /> <br /> @@ -6095,7 +8584,7 @@ $ curl https://raw.githubusercontent.com/mimecast/dtail/master/examples/dtail.js } </pre> <br /> -<h3 style='display: inline' id='Rexification'>Rexification</h3><br /> +<h3 style='display: inline' id='rexification'>Rexification</h3><br /> <br /> <span>That's as simple as adding the following to the Rex task:</span><br /> <br /> @@ -6111,7 +8600,7 @@ file '/etc/dserver/dtail.json', on_change => sub { $restart = TRUE }; </pre> <br /> -<h2 style='display: inline' id='Updatethekeycacheforit'>Update the key cache for it</h2><br /> +<h2 style='display: inline' id='update-the-key-cache-for-it'>Update the key cache for it</h2><br /> <br /> <span>DTail relies on SSH for secure authentication and communication. However, the system user <span class='inlinecode'>_dserver</span> has no permission to read the SSH public keys from the user's home directories, so the DTail server also checks for available public keys in an alternative path <span class='inlinecode'>/var/run/dserver/cache</span>. </span><br /> <br /> @@ -6164,7 +8653,7 @@ $ echo /usr/local/bin/dserver-update-key-cache.sh | doas tee -a /etc/daily.local /usr/local/bin/dserver-update-key-cache.sh </pre> <br /> -<h3 style='display: inline' id='Rexification'>Rexification</h3><br /> +<h3 style='display: inline' id='rexification'>Rexification</h3><br /> <br /> <span>That's done by adding ...</span><br /> <br /> @@ -6180,7 +8669,7 @@ append_if_no_such_line '/etc/daily.local', '/usr/local/bin/dserver-u <br /> <span>... to the Rex task!</span><br /> <br /> -<h2 style='display: inline' id='Startit'>Start it</h2><br /> +<h2 style='display: inline' id='start-it'>Start it</h2><br /> <br /> <span>Now, it's time to enable and start the DTail server:</span><br /> <br /> @@ -6220,7 +8709,7 @@ Caching /home/rex/.ssh/authorized_keys -> /var/cache/dserver/rex.authorized_k All set... </pre> <br /> -<h2 style='display: inline' id='Useit'>Use it</h2><br /> +<h2 style='display: inline' id='use-it'>Use it</h2><br /> <br /> <span>The DTail server is now ready to serve connections. You can use any DTail commands, such as <span class='inlinecode'>dtail</span>, <span class='inlinecode'>dgrep</span>, <span class='inlinecode'>dmap</span>, <span class='inlinecode'>dcat</span>, <span class='inlinecode'>dtailhealth</span>, to do so. Checkout out all the usage examples on the official DTail page.</span><br /> <br /> @@ -6246,7 +8735,7 @@ REMOTE|blowfish|100|7|fstab|31bfd9d9a6788844.h /usr/local ffs rw,wxallowed,nodev REMOTE|fishfinger|100|7|fstab|093f510ec5c0f512.h /usr/local ffs rw,wxallowed,nodev 1 2 </pre> <br /> -<h2 style='display: inline' id='Conclusions'>Conclusions</h2><br /> +<h2 style='display: inline' id='conclusions'>Conclusions</h2><br /> <br /> <span>It's a bit of manual work, but it's ok on this small scale! I shall invest time in creating an official OpenBSD port, though. That would render most of the manual steps obsolete, as outlined in this post!</span><br /> <br /> @@ -6260,10 +8749,10 @@ REMOTE|fishfinger|100|7|fstab|093f510ec5c0f512.h /usr/local ffs rw,wxallowed,nod <br /> <span>Other related posts are:</span><br /> <br /> -<a class='textlink' href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>2021-04-22 DTail - The distributed log tail program</a><br /> -<a class='textlink' href='./2022-03-06-the-release-of-dtail-4.0.0.html'>2022-03-06 The release of DTail 4.0.0</a><br /> -<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD (You are currently reading this)</a><br /> <a class='textlink' href='./2023-09-25-dtail-usage-examples.html'>2023-09-25 DTail usage examples</a><br /> +<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD (You are currently reading this)</a><br /> +<a class='textlink' href='./2022-03-06-the-release-of-dtail-4.0.0.html'>2022-03-06 The release of DTail 4.0.0</a><br /> +<a class='textlink' href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>2021-04-22 DTail - The distributed log tail program</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> @@ -6281,10 +8770,12 @@ REMOTE|fishfinger|100|7|fstab|093f510ec5c0f512.h /usr/local ffs rw,wxallowed,nod <summary>Everyone has it once in a while: A bad night's sleep. Here I attempt to list valuable tips on how to deal with it.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Afterabadnightssleep'>After a bad night's sleep</h1><br /> + <h1 style='display: inline' id='after-a-bad-night-s-sleep'>After a bad night's sleep</h1><br /> <br /> <span class='quote'>Published at 2022-09-30T09:53:23+03:00; Updated at 2022-10-12</span><br /> <br /> +<span>Everyone has it once in a while: A bad night's sleep. Here I attempt to list valuable tips on how to deal with it.</span><br /> +<br /> <pre> z z @@ -6299,17 +8790,35 @@ jgs (________\ \ '-' </pre> <br /> -<span>Everyone has it once in a while: A bad night's sleep. Here I attempt to list valuable tips on how to deal with it.</span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline' id='Donttakethedayoff'>Don't take the day off.</h2><br /> +<ul> +<li><a href='#after-a-bad-night-s-sleep'>After a bad night's sleep</a></li> +<li>⇢ <a href='#don-t-take-the-day-off'>Don't take the day off.</a></li> +<li>⇢ <a href='#start-work-early'>Start work early</a></li> +<li>⇢ <a href='#sweat-the-small-stuff'>Sweat the small stuff</a></li> +<li>⇢ <a href='#enter-the-flow-state'>Enter the flow state</a></li> +<li>⇢ <a href='#reschedule-meetings'>Reschedule meetings</a></li> +<li>⇢ <a href='#invent'>Invent</a></li> +<li>⇢ <a href='#fast'>Fast</a></li> +<li>⇢ <a href='#stretch'>Stretch</a></li> +<li>⇢ <a href='#walk'>Walk</a></li> +<li>⇢ <a href='#red-bull'>Red Bull</a></li> +<li>⇢ <a href='#power-nap'>Power nap</a></li> +<li>⇢ <a href='#don-t-take-anything-personally'>Don't take anything personally.</a></li> +<li>⇢ <a href='#meditate'>Meditate</a></li> +<li>⇢ <a href='#write-things-down'>Write things down</a></li> +<li>⇢ <a href='#social-media'>Social media</a></li> +</ul><br /> +<h2 style='display: inline' id='don-t-take-the-day-off'>Don't take the day off.</h2><br /> <br /> <span>Don't take a day off after not sleeping enough the previous night. That would be wasting the holiday allowance. It wouldn't be possible to enjoy my free time anyway, so why not just work? There's still a way for an IT Engineer to be productive (sometimes even more) with half or less of the concentration power available!</span><br /> <br /> -<h2 style='display: inline' id='Startworkearly'>Start work early</h2><br /> +<h2 style='display: inline' id='start-work-early'>Start work early</h2><br /> <br /> <span>Probably I am already awake early and am unable to fall asleep again. My strategy here is to "attack" the day: Start work early and finish early. The early bird will also encounter fewer distractions from colleagues.</span><br /> <br /> -<h2 style='display: inline' id='Sweatthesmallstuff'>Sweat the small stuff</h2><br /> +<h2 style='display: inline' id='sweat-the-small-stuff'>Sweat the small stuff</h2><br /> <br /> <span>There's never a shortage of small items to hook off my list. Most of these items don't require my full concentration power, and I will be happy to get them off my list so that the next day, after a good night's sleep, I can immerse myself again in focused, deep work with all concentration powers at hand.</span><br /> <br /> @@ -6323,57 +8832,57 @@ jgs (________\ \ <li>Going through any tedious paperwork.</li> <li>Catch up with the journal and mark off all trivial action items.</li> </ul><br /> -<h2 style='display: inline' id='Entertheflowstate'>Enter the flow state</h2><br /> +<h2 style='display: inline' id='enter-the-flow-state'>Enter the flow state</h2><br /> <br /> <span>I find it easy to enter the "flow state" after a bad night's sleep. All I need to do is to put on some ambient music (preferably instrumental chill house) and start to work on a not-too-difficult ticket.</span><br /> <br /> <span>Usually, the "flow state" is associated with deep-focused work, but deep-focused work isn't easily possible under sleep deprivation. It's still possible to be in the flow by working on more manageable tasks and leaving the difficult ones for the next day.</span><br /> <br /> -<h2 style='display: inline' id='Reschedulemeetings'>Reschedule meetings</h2><br /> +<h2 style='display: inline' id='reschedule-meetings'>Reschedule meetings</h2><br /> <br /> <span>I find engaging in discussions and demanding meetings challenging after a lousy night's sleep. I still attend the sessions I am invited to as "only" a participant, but I prefer to reschedule all meetings I am the primary driver of.</span><br /> <br /> <span>This, unfortunately, also includes interviews. Interviews require full concentration power. So for interviews, I would find a colleague to step in for me or ask to reschedule the interview altogether. Everything else wouldn't make it justice and would waste everyone's time!</span><br /> <br /> -<h2 style='display: inline' id='Invent'>Invent</h2><br /> +<h2 style='display: inline' id='invent'>Invent</h2><br /> <br /> <span>The mind works differently under sleep deprivation: It's easier to invent new stuff as it's easier to have a look at things from different perspectives. Until an hour ago, I didn't know yet what I would be blogging about for this month, and then I just started writing this, and it took me only half an hour to write the first draft of this blog post!</span><br /> <br /> -<h2 style='display: inline' id='Fast'>Fast</h2><br /> +<h2 style='display: inline' id='fast'>Fast</h2><br /> <br /> <span>I don't eat breakfast, and I don't eat lunch on these days. I only have dinner. Not eating means my mind doesn't get foggy, and I keep up the work momentum. This is called intermittent fasting, which not only generally helps to keep the weight under control and boosts the concentration power. Furthermore, intermittent fasting is healthy. You should include it in your routine, even after a good night's sleep.</span><br /> <br /> -<h2 style='display: inline' id='Stretch'>Stretch</h2><br /> +<h2 style='display: inline' id='stretch'>Stretch</h2><br /> <br /> <span>I won't have enough energy for strenuous physical exercise on those days, but a 30 to a 60-minute stretching session can make the day. Stretching will even hurt less under sleep deprivation! The stretching could also be substituted with a light Yoga session.</span><br /> <br /> -<h2 style='display: inline' id='Walk'>Walk</h2><br /> +<h2 style='display: inline' id='walk'>Walk</h2><br /> <br /> <span>Walking is healthy, and the time can be used to listen to interesting podcasts. The available concentration power might not be enough for more sophisticated audio literature. I will have enough energy for one or two daily walks (~10k steps for the day in total). Sometimes, I listen to music during walks. I also try to catch the bright sunlight.</span><br /> <br /> -<h2 style='display: inline' id='RedBull'>Red Bull</h2><br /> +<h2 style='display: inline' id='red-bull'>Red Bull</h2><br /> <br /> <span>I don't think that Red Bull is a healthy drink. But once in a while, a can in the early afternoon brings wonders, and productivity will skyrocket. Other than Red Bull, drink a lot of water throughout the day. Don't forget to drink the sugar-free version; otherwise, your intermittent fast will be broken.</span><br /> <br /> -<h2 style='display: inline' id='Powernap'>Power nap</h2><br /> +<h2 style='display: inline' id='power-nap'>Power nap</h2><br /> <br /> <span>I don't know how to "enforce" a nap, but sometimes I manage to power nap, and it helps wonders. A 30-minute nap sometimes brings me back to normal. If you don't tend to fast as you are too hungry, it helps to try to nap approximately 30 minutes after eating something.</span><br /> <br /> -<h2 style='display: inline' id='Donttakeanythingpersonally'>Don't take anything personally.</h2><br /> +<h2 style='display: inline' id='don-t-take-anything-personally'>Don't take anything personally.</h2><br /> <br /> <span>It's much more challenging to keep the mind "under control" in this state. Every annoyance can potentially upset, which could reflect on the work colleagues. It is wise to attempt to go with a positive attitude into the day, always smile and be polite to the family and colleagues at work. Don't let anything drop out to the people next; they don't deserve it as they didn't do anything wrong! Also, remember, it can't be controlled at all. It's time to let go of the annoyances for the day.</span><br /> <br /> -<h2 style='display: inline' id='Meditate'>Meditate</h2><br /> +<h2 style='display: inline' id='meditate'>Meditate</h2><br /> <br /> <span>To keep the good vibe, it helps to meditate for 10 minutes. Meditation must nothing be fancy. It can be just lying on the sofa and observing your thoughts as they come and go. Don't judge your thoughts, as that could put you in a negative mood. It's not necessary to sit in an uncomfortable Yoga pose, and it is not required to chant "Ohhmmmmm".</span><br /> <br /> -<h2 style='display: inline' id='Writethingsdown'>Write things down</h2><br /> +<h2 style='display: inline' id='write-things-down'>Write things down</h2><br /> <br /> <span>Sometimes something requiring more concentration power demands time. This is where it helps to write a note in a journal and return to it another day. This doesn't mean slacking off but managing the rarely available concentration power for the day. I might repeat myself: Today, sweat all the small stuff. Tomorrow, do the deep-focused work on that crucial project again.</span><br /> <br /> <span>It's easier to forget things on those days, so everything should be written down so that it can be worked off later. Things written down will not be overlooked!</span><br /> <br /> -<h2 style='display: inline' id='Socialmedia'>Social media</h2><br /> +<h2 style='display: inline' id='social-media'>Social media</h2><br /> <br /> <span>I wouldn't say I like checking social media, as it can consume a lot of time and can become addictive. But once in a while, I want to catch up with my "networks". After a bad night's sleep, it's the perfect time to check your social media. Once done, you don't have to do it anymore for the next couple of days!</span><br /> <br /> @@ -6383,2767 +8892,4 @@ jgs (________\ \ </div> </content> </entry> - <entry> - <title>Gemtexter 1.1.0 - Let's Gemtext again</title> - <link href="gemini://foo.zone/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi" /> - <id>gemini://foo.zone/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi</id> - <updated>2022-08-27T18:25:57+01:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>I proudly announce that I've released Gemtexter version `1.1.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Gemtexter110LetsGemtextagain'>Gemtexter 1.1.0 - Let's Gemtext again</h1><br /> -<br /> -<span class='quote'>Published at 2022-08-27T18:25:57+01:00</span><br /> -<br /> -<pre> --=[ typewriter ]=- 1/98 - - .-------. - _|~~ ~~ |_ - =(_|_______|_)= - |:::::::::| - |:::::::[]| - |o=======.| - jgs `"""""""""` -</pre> -<br /> -<span>I proudly announce that I've released Gemtexter version <span class='inlinecode'>1.1.0</span>. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash.</span><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/gemtexter'>https://codeberg.org/snonux/gemtexter</a><br /> -<br /> -<span>It has been around a year since I released the first version <span class='inlinecode'>1.0.0</span>. Although, there aren't any groundbreaking changes, there have been a couple of smaller commits and adjustments. I was quite surprised that I received a bunch of feedback and requests about Gemtexter so it means that I am not the only person in the universe actually using it.</span><br /> -<br /> -<h2 style='display: inline' id='Whatsnew'>What's new?</h2><br /> -<br /> -<h3 style='display: inline' id='AutomaticcheckforGNUversionrequirements'>Automatic check for GNU version requirements</h3><br /> -<br /> -<span>Gemtexter relies on the GNU versions of the tools <span class='inlinecode'>grep</span>, <span class='inlinecode'>sed</span> and <span class='inlinecode'>date</span> and it also requires the Bash shell in version 5 at least. That's now done in the <span class='inlinecode'>check_dependencies()</span> function:</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><font color="#7bc710">check_dependencies ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><i><font color="#ababab"># At least, Bash 5 is required</font></i> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -i </font><font color="#ff0000">required_version</font><font color="#F3E651">=</font><font color="#bb00ff">5</font> -<font color="#ff0000"> </font><font color="#ff0000">IFS</font><font color="#F3E651">=.</font><font color="#ff0000"> </font><b><font color="#ffffff">read</font></b><font color="#ff0000"> -ra version </font><font color="#F3E651"><<<</font><font color="#ff0000"> </font><font color="#bb00ff">"$BASH_VERSION"</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#bb00ff">"${version[0]}"</font><font color="#ff0000"> -lt </font><font color="#ff0000">$required_version</font><font color="#ff0000"> </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> log ERROR </font><font color="#bb00ff">"ERROR, </font><font color="#ffffff">\"</font><font color="#bb00ff">bash</font><font color="#ffffff">\"</font><font color="#bb00ff"> must be at least at major version $required_version!"</font> -<font color="#ff0000"> </font><b><font color="#ffffff">exit</font></b><font color="#ff0000"> </font><font color="#bb00ff">2</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> - -<font color="#ff0000"> </font><i><font color="#ababab"># These must be the GNU versions of the commands</font></i> -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> tool </font><b><font color="#ffffff">in</font></b><font color="#ff0000"> </font><font color="#ff0000">$DATE</font><font color="#ff0000"> </font><font color="#ff0000">$SED</font><font color="#ff0000"> </font><font color="#ff0000">$GREP</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">do</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">!</font><font color="#ff0000"> </font><font color="#ff0000">$tool</font><font color="#ff0000"> --version </font><font color="#F3E651">|</font><font color="#ff0000"> grep -q GNU</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> log ERROR </font><font color="#bb00ff">"ERROR, </font><font color="#ffffff">\"</font><font color="#bb00ff">$tool</font><font color="#ffffff">\"</font><font color="#bb00ff"> command is not the GNU version, please install!"</font> -<font color="#ff0000"> </font><b><font color="#ffffff">exit</font></b><font color="#ff0000"> </font><font color="#bb00ff">2</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">done</font></b> -<font color="#ff0000">}</font> -</pre> -<br /> -<span>Especially macOS users didn't read the <span class='inlinecode'>README</span> carefully enough to install GNU Grep, GNU Sed and GNU Date before using Gemtexter.</span><br /> -<br /> -<h3 style='display: inline' id='BackticksnowproduceinlinecodeblocksintheHTMLoutput'>Backticks now produce <span class='inlinecode'>inline code blocks</span> in the HTML output</h3><br /> -<br /> -<span>The Gemtext format doesn't support inline code blocks, but Gemtexter now produces <span class='inlinecode'>inline code blocks</span> (means, small code fragments can be placed in the middle of a paragraph) in the HTML output when the code block is enclosed with Backticks. There were no adjustments required for the Markdown output format, because Markdown supports it already out of the box.</span><br /> -<br /> -<h3 style='display: inline' id='CacheforAtomfeedgeneration'>Cache for Atom feed generation</h3><br /> -<br /> -<span>The Bash is not the most performant language. Gemtexter already takes a couple of seconds only to generate the Atom feed for around two hand full of articles on my slightly underpowered Surface Go 2 Linux tablet. Therefore, I introduced a cache, so that subsequent Atom feed generation runs finish much quicker. The cache uses a checksum of the Gemtext <span class='inlinecode'>.gmi</span> file to decide whether anything of the content has changed or not.</span><br /> -<br /> -<h3 style='display: inline' id='Inputfiltersupport'>Input filter support</h3><br /> -<br /> -<span>Once your capsule reaches a certain size, it can become annoying to re-generate everything if you only want to preview the HTML or Markdown output of one single content file. The following will add a filter to only generate the files matching a regular expression:</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">.</font><font color="#ff0000">/gemtexter --generate </font><font color="#bb00ff">'.*hello.*'</font> -</pre> -<br /> -<h3 style='display: inline' id='Revampedgitsupport'>Revamped <span class='inlinecode'>git</span> support</h3><br /> -<br /> -<span>The Git support has been completely rewritten. It's now more reliable and faster too. Have a look at the <span class='inlinecode'>README</span> for more information.</span><br /> -<br /> -<h3 style='display: inline' id='Additionofhtmlextrasandwebfontsupport'>Addition of <span class='inlinecode'>htmlextras</span> and web font support</h3><br /> -<br /> -<span>The <span class='inlinecode'>htmlextras</span> folder now contains all extra files required for the HTML output format such as cascading style sheet (CSS) files and web fonts.</span><br /> -<br /> -<h3 style='display: inline' id='Subsectionsupport'>Sub-section support</h3><br /> -<br /> -<span>It's now possible to define sub-sections within a Gemtexter capsule. For the HTML output, each sub-section can use its own CSS and web font definitions. E.g.:</span><br /> -<br /> -<a class='textlink' href='https://foo.zone'>The foo.zone main site</a><br /> -<a class='textlink' href='https://foo.zone/notes'>The notes sub-section (with different fonts)</a><br /> -<br /> -<h3 style='display: inline' id='More'>More</h3><br /> -<br /> -<span>Additionally, there were a couple of bug fixes, refactorings and overall improvements in the documentation made. </span><br /> -<br /> -<span>Overall I think it's a pretty solid <span class='inlinecode'>1.1.0</span> release without anything groundbreaking (therefore no major version jump). But I am happy about it.</span><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<span>Other related posts are:</span><br /> -<br /> -<a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace</a><br /> -<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> -<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again²</a><br /> -<a class='textlink' href='./2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.html'>2023-07-21 Gemtexter 2.1.0 - Let's Gemtext again³</a><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>Let's Encrypt with OpenBSD and Rex</title> - <link href="gemini://foo.zone/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi" /> - <id>gemini://foo.zone/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi</id> - <updated>2022-07-30T12:14:31+01:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>I was amazed at how easy it is to automatically generate and update Let's Encrypt certificates with OpenBSD.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='LetsEncryptwithOpenBSDandRex'>Let's Encrypt with OpenBSD and Rex</h1><br /> -<br /> -<span class='quote'>Published at 2022-07-30T12:14:31+01:00</span><br /> -<br /> -<pre> - / _ \ - The Hebern Machine \ ." ". / - ___ / \ - .."" "".. | O | - / \ | | - / \ | | - --------------------------------- - _/ o (O) o _ | - _/ ." ". | - I/ _________________/ \ | - _/I ." | | - ===== / I / / | - ===== | | | \ | _________________." | -===== | | | | | / \ / _|_|__|_|_ __ | - | | | | | | | \ "._." / o o \ ." ". | - | --| --| -| / \ _/ / \ | - \____\____\__| \ ______ | / | | | - -------- --- / | | | - ( ) (O) / \ / | - ----------------------- ".__." | - _|__________________________________________|_ - / \ - /________________________________________________\ - ASCII Art by John Savard -</pre> -<br /> -<span>I was amazed at how easy it is to automatically generate and update Let's Encrypt certificates with OpenBSD.</span><br /> -<br /> -<h2 style='display: inline' id='WhatsLetsEncrypt'>What's Let's Encrypt?</h2><br /> -<br /> -<span class='quote'>Let's Encrypt is a non-profit certificate authority run by Internet Security Research Group that provides X.509 certificates for Transport Layer Security (TLS) encryption at no charge. It is the world's largest certificate authority, used by more than 265 million websites, with the goal of all websites being secure and using HTTPS.</span><br /> -<br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Let's_Encrypt'>Source: Wikipedia</a><br /> -<br /> -<span>In short, it gives away TLS certificates for your website - for free! The catch is, that the certificates are only valid for three months. So it is better to automate certificate generation and renewals.</span><br /> -<br /> -<h2 style='display: inline' id='Meetacmeclient'>Meet <span class='inlinecode'>acme-client</span></h2><br /> -<br /> -<span><span class='inlinecode'>acme-client</span> is the default Automatic Certifcate Management Environment (ACME) client on OpenBSD and part of the OpenBSD base system. </span><br /> -<br /> -<span>When invoked, the client first checks whether certificates actually require to be generated.</span><br /> -<br /> -<ul> -<li>It first checks whether a certificate already exists; if not, it will attempt to generate a new one.</li> -<li>If the certificate already exists but expires within the next 30 days, it will renew it.</li> -<li>Otherwise, <span class='inlinecode'>acme-client</span> won't do anything.</li> -</ul><br /> -<span>Oversimplified, the following steps are undertaken by <span class='inlinecode'>acme-client</span> for generating a new certificate:</span><br /> -<br /> -<ul> -<li>Reading its config file <span class='inlinecode'>/etc/acme-client.conf</span> for a list of hosts (and their alternative names) to generate certificates. So it means you can also have certificates for arbitrary subdomains!</li> -<li>Automatic generation of the private certificate part (the certificate key) and the certificate signing request (CSR) to <span class='inlinecode'>/etc/ssl/...</span>.</li> -<li>Requesting Let's Encrypt to sign the certificate. This also includes providing a set of temporary files requested by Let's Encrypt in the next step for verification.</li> -<li>Let's Encrypt then will contact the hostname for the certificate through a particular URL (e.g. <span class='inlinecode'>http://foo.zone/.well-known/acme-challenge/...</span>) to verify that the requester is the valid owner of the host.</li> -<li>Let's Encrypt generates a certificate, which then is downloaded to <span class='inlinecode'>/etc/ssl/...</span>.</li> -</ul><br /> -<h2 style='display: inline' id='Configuration'>Configuration</h2><br /> -<br /> -<span>There is some (but easy) configuration required to make that all work on OpenBSD.</span><br /> -<br /> -<h3 style='display: inline' id='acmeclientconf'>acme-client.conf</h3><br /> -<br /> -<span>This is how my <span class='inlinecode'>/etc/acme-client.conf</span> looks like (I copied a template from <span class='inlinecode'>/etc/examples/acme-client.conf</span> to <span class='inlinecode'>/etc/acme-client.conf</span> and added my domains to the bottom:</span><br /> -<br /> -<pre> -# -# $OpenBSD: acme-client.conf,v 1.4 2020/09/17 09:13:06 florian Exp $ -# -authority letsencrypt { - api url "https://acme-v02.api.letsencrypt.org/directory" - account key "/etc/acme/letsencrypt-privkey.pem" -} - -authority letsencrypt-staging { - api url "https://acme-staging-v02.api.letsencrypt.org/directory" - account key "/etc/acme/letsencrypt-staging-privkey.pem" -} - -authority buypass { - api url "https://api.buypass.com/acme/directory" - account key "/etc/acme/buypass-privkey.pem" - contact "mailto:me@example.com" -} - -authority buypass-test { - api url "https://api.test4.buypass.no/acme/directory" - account key "/etc/acme/buypass-test-privkey.pem" - contact "mailto:me@example.com" -} - -domain buetow.org { - alternative names { www.buetow.org paul.buetow.org } - domain key "/etc/ssl/private/buetow.org.key" - domain full chain certificate "/etc/ssl/buetow.org.fullchain.pem" - sign with letsencrypt -} - -domain dtail.dev { - alternative names { www.dtail.dev } - domain key "/etc/ssl/private/dtail.dev.key" - domain full chain certificate "/etc/ssl/dtail.dev.fullchain.pem" - sign with letsencrypt -} - -domain foo.zone { - alternative names { www.foo.zone } - domain key "/etc/ssl/private/foo.zone.key" - domain full chain certificate "/etc/ssl/foo.zone.fullchain.pem" - sign with letsencrypt -} - -domain irregular.ninja { - alternative names { www.irregular.ninja } - domain key "/etc/ssl/private/irregular.ninja.key" - domain full chain certificate "/etc/ssl/irregular.ninja.fullchain.pem" - sign with letsencrypt -} - -domain snonux.land { - alternative names { www.snonux.land } - domain key "/etc/ssl/private/snonux.land.key" - domain full chain certificate "/etc/ssl/snonux.land.fullchain.pem" - sign with letsencrypt -} -</pre> -<br /> -<h3 style='display: inline' id='httpdconf'>httpd.conf</h3><br /> -<br /> -<span>For ACME to work, you will need to configure the HTTP daemon so that the "special" ACME requests from Let's Encrypt are served correctly. I am using the standard OpenBSD <span class='inlinecode'>httpd</span> here. These are the snippets I use for the <span class='inlinecode'>foo.zone</span> host in <span class='inlinecode'>/etc/httpd.conf</span> (of course, you need a similar setup for all other hosts as well):</span><br /> -<br /> -<pre> -server "foo.zone" { - listen on * port 80 - location "/.well-known/acme-challenge/*" { - root "/acme" - request strip 2 - } - location * { - block return 302 "https://$HTTP_HOST$REQUEST_URI" - } -} - -server "foo.zone" { - listen on * tls port 443 - tls { - certificate "/etc/ssl/foo.zone.fullchain.pem" - key "/etc/ssl/private/foo.zone.key" - } - location * { - root "/htdocs/gemtexter/foo.zone" - directory auto index - } -} -</pre> -<br /> -<span>As you see, plain HTTP only serves the ACME challenge path. Otherwise, it redirects the requests to TLS. The TLS section then attempts to use the Let's Encrypt certificates.</span><br /> -<br /> -<span>It is worth noticing that <span class='inlinecode'>httpd</span> will start without the certificates being present. This will cause a certificate error when you try to reach the HTTPS endpoint, but it helps to bootstrap Let's Encrypt. As you saw in the config snippet above, Let's Encrypt only requests the plain HTTP endpoint for the verification process, so HTTPS doesn't need to be operational yet at this stage. But once the certificates are generated, you will have to reload or restart <span class='inlinecode'>httpd</span> to use any new certificate.</span><br /> -<br /> -<h3 style='display: inline' id='CRONjob'>CRON job</h3><br /> -<br /> -<span>You could now run <span class='inlinecode'>doas acme-client foo.zone</span> to generate the certificate or to renew it. Or you could automate it with CRON.</span><br /> -<br /> -<span>I have created a script <span class='inlinecode'>/usr/local/bin/acme.sh</span> for that for all of my domains:</span><br /> -<br /> -<pre> -#!/bin/sh - -function handle_cert { - host=$1 - # Create symlink, so that relayd also can read it. - crt_path=/etc/ssl/$host - if [ -e $crt_path.crt ]; then - rm $crt_path.crt - fi - ln -s $crt_path.fullchain.pem $crt_path.crt - # Requesting and renewing certificate. - /usr/sbin/acme-client -v $host -} - -has_update=no -handle_cert www.buetow.org -if [ $? -eq 0 ]; then - has_update=yes -fi -handle_cert www.paul.buetow.org -if [ $? -eq 0 ]; then - has_update=yes -fi -handle_cert www.tmp.buetow.org -if [ $? -eq 0 ]; then - has_update=yes -fi -handle_cert www.dtail.dev -if [ $? -eq 0 ]; then - has_update=yes -fi -handle_cert www.foo.zone -if [ $? -eq 0 ]; then - has_update=yes -fi -handle_cert www.irregular.ninja -if [ $? -eq 0 ]; then - has_update=yes -fi -handle_cert www.snonux.land -if [ $? -eq 0 ]; then - has_update=yes -fi - -# Pick up the new certs. -if [ $has_update = yes ]; then - /usr/sbin/rcctl reload httpd - /usr/sbin/rcctl reload relayd - /usr/sbin/rcctl restart smtpd -fi -</pre> -<br /> -<span>And added the following line to <span class='inlinecode'>/etc/daily.local</span> to run the script once daily so that certificates will be renewed fully automatically:</span><br /> -<br /> -<pre> -/usr/local/bin/acme.sh -</pre> -<br /> -<span>I am receiving a daily output via E-Mail like this now:</span><br /> -<br /> -<pre> -Running daily.local: -acme-client: /etc/ssl/buetow.org.fullchain.pem: certificate valid: 80 days left -acme-client: /etc/ssl/paul.buetow.org.fullchain.pem: certificate valid: 80 days left -acme-client: /etc/ssl/tmp.buetow.org.fullchain.pem: certificate valid: 80 days left -acme-client: /etc/ssl/dtail.dev.fullchain.pem: certificate valid: 80 days left -acme-client: /etc/ssl/foo.zone.fullchain.pem: certificate valid: 80 days left -acme-client: /etc/ssl/irregular.ninja.fullchain.pem: certificate valid: 80 days left -acme-client: /etc/ssl/snonux.land.fullchain.pem: certificate valid: 79 days left -</pre> -<br /> -<h2 style='display: inline' id='relaydconfandsmtpdconf'>relayd.conf and smtpd.conf</h2><br /> -<br /> -<span>Besides <span class='inlinecode'>httpd</span>, <span class='inlinecode'>relayd</span> (mainly for Gemini) and <span class='inlinecode'>smtpd</span> (for mail, of course) also use TLS certificates. And as you can see in <span class='inlinecode'>acme.sh</span>, the services are reloaded or restarted (<span class='inlinecode'>smtpd</span> doesn't support reload) whenever a certificate is generated or updated.</span><br /> -<br /> -<h2 style='display: inline' id='Rexification'>Rexification</h2><br /> -<br /> -<span>I didn't write all these configuration files by hand. As a matter of fact, everything is automated with the Rex configuration management system.</span><br /> -<br /> -<a class='textlink' href='https://www.rexify.org'>https://www.rexify.org</a><br /> -<br /> -<span>At the top of the <span class='inlinecode'>Rexfile</span> I define all my hosts:</span><br /> -<br /> -<pre> -our @acme_hosts = qw/buetow.org paul.buetow.org tmp.buetow.org dtail.dev foo.zone irregular.ninja snonux.land/; -</pre> -<br /> -<h3 style='display: inline' id='GeneralACMEclientconfiguration'>General ACME client configuration</h3><br /> -<br /> -<span>ACME will be installed into the frontend group of hosts. Here, blowfish is the primary, and twofish is the secondary OpenBSD box.</span><br /> -<br /> -<pre> -group frontends => 'blowfish.buetow.org', 'twofish.buetow.org'; -</pre> -<br /> -<span>This is my Rex task for the general ACME configuration:</span><br /> -<br /> -<pre> -desc 'Configure ACME client'; -task 'acme', group => 'frontends', - sub { - file '/etc/acme-client.conf', - content => template('./etc/acme-client.conf.tpl', - acme_hosts => \@acme_hosts, - is_primary => $is_primary), - owner => 'root', - group => 'wheel', - mode => '644'; - - file '/usr/local/bin/acme.sh', - content => template('./scripts/acme.sh.tpl', - acme_hosts => \@acme_hosts, - is_primary => $is_primary), - owner => 'root', - group => 'wheel', - mode => '744'; - - file '/etc/daily.local', - ensure => 'present', - owner => 'root', - group => 'wheel', - mode => '644'; - - append_if_no_such_line '/etc/daily.local', '/usr/local/bin/acme.sh'; - }; -</pre> -<br /> -<span>And there is also a Rex task just to run the ACME script remotely:</span><br /> -<br /> -<pre> -desc 'Invoke ACME client'; -task 'acme_invoke', group => 'frontends', - sub { - say run '/usr/local/bin/acme.sh'; - }; - -</pre> -<br /> -<span>Furthermore, this snippet (also at the top of the Rexfile) helps to determine whether the current server is the primary server (all hosts will be without the <span class='inlinecode'>www.</span> prefix) or the secondary server (all hosts will be with the <span class='inlinecode'>www.</span> prefix):</span><br /> -<br /> -<pre> -# Bootstrapping the FQDN based on the server IP as the hostname and domain -# facts aren't set yet due to the myname file in the first place. -our $fqdns = sub { - my $ipv4 = shift; - return 'blowfish.buetow.org' if $ipv4 eq '23.88.35.144'; - return 'twofish.buetow.org' if $ipv4 eq '108.160.134.135'; - Rex::Logger::info("Unable to determine hostname for $ipv4", 'error'); - return 'HOSTNAME-UNKNOWN.buetow.org'; -}; - -# To determine whether the server is the primary or the secondary. -our $is_primary = sub { - my $ipv4 = shift; - $fqdns->($ipv4) eq 'blowfish.buetow.org'; -}; -</pre> -<br /> -<span>The following is the <span class='inlinecode'>acme-client.conf.tpl</span> Rex template file used for the automation. You see that the <span class='inlinecode'>www.</span> prefix isn't sent for the primary server. E.g. <span class='inlinecode'>foo.zone</span> will be served by the primary server (in my case, a server located in Germany) and <span class='inlinecode'>www.foo.zone</span> by the secondary server (in my case, a server located in Japan):</span><br /> -<br /> -<pre> -# -# $OpenBSD: acme-client.conf,v 1.4 2020/09/17 09:13:06 florian Exp $ -# -authority letsencrypt { - api url "https://acme-v02.api.letsencrypt.org/directory" - account key "/etc/acme/letsencrypt-privkey.pem" -} - -authority letsencrypt-staging { - api url "https://acme-staging-v02.api.letsencrypt.org/directory" - account key "/etc/acme/letsencrypt-staging-privkey.pem" -} - -authority buypass { - api url "https://api.buypass.com/acme/directory" - account key "/etc/acme/buypass-privkey.pem" - contact "mailto:me@example.com" -} - -authority buypass-test { - api url "https://api.test4.buypass.no/acme/directory" - account key "/etc/acme/buypass-test-privkey.pem" - contact "mailto:me@example.com" -} - -<% - our $primary = $is_primary->($vio0_ip); - our $prefix = $primary ? '' : 'www.'; -%> - -<% for my $host (@$acme_hosts) { %> -domain <%= $prefix.$host %> { - domain key "/etc/ssl/private/<%= $prefix.$host %>.key" - domain full chain certificate "/etc/ssl/<%= $prefix.$host %>.fullchain.pem" - sign with letsencrypt -} -<% } %> - -</pre> -<br /> -<span>And this is the <span class='inlinecode'>acme.sh.tpl</span>:</span><br /> -<br /> -<pre> -#!/bin/sh - -<% - our $primary = $is_primary->($vio0_ip); - our $prefix = $primary ? '' : 'www.'; --%> - -function handle_cert { - host=$1 - # Create symlink, so that relayd also can read it. - crt_path=/etc/ssl/$host - if [ -e $crt_path.crt ]; then - rm $crt_path.crt - fi - ln -s $crt_path.fullchain.pem $crt_path.crt - # Requesting and renewing certificate. - /usr/sbin/acme-client -v $host -} - -has_update=no -<% for my $host (@$acme_hosts) { -%> -handle_cert <%= $prefix.$host %> -if [ $? -eq 0 ]; then - has_update=yes -fi -<% } -%> - -# Pick up the new certs. -if [ $has_update = yes ]; then - /usr/sbin/rcctl reload httpd - /usr/sbin/rcctl reload relayd - /usr/sbin/rcctl restart smtpd -fi -</pre> -<br /> -<h3 style='display: inline' id='Servicerexification'>Service rexification </h3><br /> -<br /> -<span>These are the Rex tasks setting up <span class='inlinecode'>httpd</span>, <span class='inlinecode'>relayd</span> and <span class='inlinecode'>smtpd</span> services:</span><br /> -<br /> -<pre> -desc 'Setup httpd'; -task 'httpd', group => 'frontends', - sub { - append_if_no_such_line '/etc/rc.conf.local', 'httpd_flags='; - - file '/etc/httpd.conf', - content => template('./etc/httpd.conf.tpl', - acme_hosts => \@acme_hosts, - is_primary => $is_primary), - owner => 'root', - group => 'wheel', - mode => '644', - on_change => sub { service 'httpd' => 'restart' }; - - service 'httpd', ensure => 'started'; - }; - -desc 'Setup relayd'; -task 'relayd', group => 'frontends', - sub { - append_if_no_such_line '/etc/rc.conf.local', 'relayd_flags='; - - file '/etc/relayd.conf', - content => template('./etc/relayd.conf.tpl', - ipv6address => $ipv6address, - is_primary => $is_primary), - owner => 'root', - group => 'wheel', - mode => '600', - on_change => sub { service 'relayd' => 'restart' }; - - service 'relayd', ensure => 'started'; - }; - -desc 'Setup OpenSMTPD'; -task 'smtpd', group => 'frontends', - sub { - Rex::Logger::info('Dealing with mail aliases'); - file '/etc/mail/aliases', - source => './etc/mail/aliases', - owner => 'root', - group => 'wheel', - mode => '644', - on_change => sub { say run 'newaliases' }; - - Rex::Logger::info('Dealing with mail virtual domains'); - file '/etc/mail/virtualdomains', - source => './etc/mail/virtualdomains', - owner => 'root', - group => 'wheel', - mode => '644', - on_change => sub { service 'smtpd' => 'restart' }; - - Rex::Logger::info('Dealing with mail virtual users'); - file '/etc/mail/virtualusers', - source => './etc/mail/virtualusers', - owner => 'root', - group => 'wheel', - mode => '644', - on_change => sub { service 'smtpd' => 'restart' }; - - Rex::Logger::info('Dealing with smtpd.conf'); - file '/etc/mail/smtpd.conf', - content => template('./etc/mail/smtpd.conf.tpl', - is_primary => $is_primary), - owner => 'root', - group => 'wheel', - mode => '644', - on_change => sub { service 'smtpd' => 'restart' }; - - service 'smtpd', ensure => 'started'; - }; - -</pre> -<br /> -<span>This is the <span class='inlinecode'>httpd.conf.tpl</span>:</span><br /> -<br /> -<pre> -<% - our $primary = $is_primary->($vio0_ip); - our $prefix = $primary ? '' : 'www.'; -%> - -# Plain HTTP for ACME and HTTPS redirect -<% for my $host (@$acme_hosts) { %> -server "<%= $prefix.$host %>" { - listen on * port 80 - location "/.well-known/acme-challenge/*" { - root "/acme" - request strip 2 - } - location * { - block return 302 "https://$HTTP_HOST$REQUEST_URI" - } -} -<% } %> - -# Gemtexter hosts -<% for my $host (qw/foo.zone snonux.land/) { %> -server "<%= $prefix.$host %>" { - listen on * tls port 443 - tls { - certificate "/etc/ssl/<%= $prefix.$host %>.fullchain.pem" - key "/etc/ssl/private/<%= $prefix.$host %>.key" - } - location * { - root "/htdocs/gemtexter/<%= $host %>" - directory auto index - } -} -<% } %> - -# DTail special host -server "<%= $prefix %>dtail.dev" { - listen on * tls port 443 - tls { - certificate "/etc/ssl/<%= $prefix %>dtail.dev.fullchain.pem" - key "/etc/ssl/private/<%= $prefix %>dtail.dev.key" - } - location * { - block return 302 "https://github.dtail.dev$REQUEST_URI" - } -} - -# Irregular Ninja special host -server "<%= $prefix %>irregular.ninja" { - listen on * tls port 443 - tls { - certificate "/etc/ssl/<%= $prefix %>irregular.ninja.fullchain.pem" - key "/etc/ssl/private/<%= $prefix %>irregular.ninja.key" - } - location * { - root "/htdocs/irregular.ninja" - directory auto index - } -} - -# buetow.org special host. -server "<%= $prefix %>buetow.org" { - listen on * tls port 443 - tls { - certificate "/etc/ssl/<%= $prefix %>buetow.org.fullchain.pem" - key "/etc/ssl/private/<%= $prefix %>buetow.org.key" - } - block return 302 "https://paul.buetow.org" -} - -server "<%= $prefix %>paul.buetow.org" { - listen on * tls port 443 - tls { - certificate "/etc/ssl/<%= $prefix %>paul.buetow.org.fullchain.pem" - key "/etc/ssl/private/<%= $prefix %>paul.buetow.org.key" - } - block return 302 "https://foo.zone/contact-information.html" -} - -server "<%= $prefix %>tmp.buetow.org" { - listen on * tls port 443 - tls { - certificate "/etc/ssl/<%= $prefix %>tmp.buetow.org.fullchain.pem" - key "/etc/ssl/private/<%= $prefix %>tmp.buetow.org.key" - } - root "/htdocs/buetow.org/tmp" - directory auto index -} -</pre> -<br /> -<span>and this the <span class='inlinecode'>relayd.conf.tpl</span>:</span><br /> -<br /> -<pre> -<% - our $primary = $is_primary->($vio0_ip); - our $prefix = $primary ? '' : 'www.'; -%> - -log connection - -tcp protocol "gemini" { - tls keypair <%= $prefix %>foo.zone - tls keypair <%= $prefix %>buetow.org -} - -relay "gemini4" { - listen on <%= $vio0_ip %> port 1965 tls - protocol "gemini" - forward to 127.0.0.1 port 11965 -} - -relay "gemini6" { - listen on <%= $ipv6address->($hostname) %> port 1965 tls - protocol "gemini" - forward to 127.0.0.1 port 11965 -} -</pre> -<br /> -<span>And last but not least, this is the <span class='inlinecode'>smtpd.conf.tpl</span>:</span><br /> -<br /> -<pre> -<% - our $primary = $is_primary->($vio0_ip); - our $prefix = $primary ? '' : 'www.'; -%> - -pki "buetow_org_tls" cert "/etc/ssl/<%= $prefix %>buetow.org.fullchain.pem" -pki "buetow_org_tls" key "/etc/ssl/private/<%= $prefix %>buetow.org.key" - -table aliases file:/etc/mail/aliases -table virtualdomains file:/etc/mail/virtualdomains -table virtualusers file:/etc/mail/virtualusers - -listen on socket -listen on all tls pki "buetow_org_tls" hostname "<%= $prefix %>buetow.org" -#listen on all - -action localmail mbox alias <aliases> -action receive mbox virtual <virtualusers> -action outbound relay - -match from any for domain <virtualdomains> action receive -match from local for local action localmail -match from local for any action outbound -</pre> -<br /> -<h2 style='display: inline' id='Allpiecestogether'>All pieces together</h2><br /> -<br /> -<span>For the complete <span class='inlinecode'>Rexfile</span> example and all the templates, please look at the Git repository:</span><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/rexfiles'>https://codeberg.org/snonux/rexfiles</a><br /> -<br /> -<span>Besides ACME, other things, such as DNS servers, are also rexified. The following command will run all the Rex tasks and configure everything on my frontend machines automatically:</span><br /> -<br /> -<pre> -rex commons -</pre> -<br /> -<span>The <span class='inlinecode'>commons</span> is a group of tasks I specified which combines a set of common tasks I always want to execute on all frontend machines. This also includes the ACME tasks mentioned in this article!</span><br /> -<br /> -<h2 style='display: inline' id='Conclusion'>Conclusion</h2><br /> -<br /> -<span>ACME and Let's Encrypt greatly help reduce recurring manual maintenance work (creating and renewing certificates). Furthermore, all the certificates are free of cost! I love to use OpenBSD and Rex to automate all of this.</span><br /> -<br /> -<span>OpenBSD suits perfectly here as all the tools are already part of the base installation. But I like underdogs. Rex is not as powerful and popular as other configuration management systems (e.g. Puppet, Chef, SALT or even Ansible). It is more of an underdog, and the community is small.</span><br /> -<br /> -<span>Why re-inventing the wheel? I love that a <span class='inlinecode'>Rexfile</span> is just a Perl DSL. Also, OpenBSD comes with Perl in the base system. So no new programming language had to be added to my mix for the configuration management system. Also, the <span class='inlinecode'>acme.sh</span> shell script is not a Bash but a standard Bourne shell script, so I didn't have to install an additional shell as OpenBSD does not come with the Bash pre-installed.</span><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<span>Other *BSD related posts are:</span><br /> -<br /> -<a class='textlink' href='./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html'>2016-04-09 Jails and ZFS with Puppet on FreeBSD</a><br /> -<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>2022-07-30 Let's Encrypt with OpenBSD and Rex (You are currently reading this)</a><br /> -<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> -<a class='textlink' href='./2024-01-13-one-reason-why-i-love-openbsd.html'>2024-01-13 One reason why I love OpenBSD</a><br /> -<a class='textlink' href='./2024-04-01-KISS-high-availability-with-OpenBSD.html'>2024-04-01 KISS high-availability with OpenBSD</a><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>Sweating the small stuff - Tiny projects of mine</title> - <link href="gemini://foo.zone/gemfeed/2022-06-15-sweating-the-small-stuff.gmi" /> - <id>gemini://foo.zone/gemfeed/2022-06-15-sweating-the-small-stuff.gmi</id> - <updated>2022-06-15T08:47:44+01:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>This blog post is a bit different from the others. It consists of multiple but smaller projects worth mentioning. I got inspired by Julia Evan's 'Tiny programs' blog post and the side projects of The Sephist, so I thought I would also write a blog posts listing a couple of small projects of mine:</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='SweatingthesmallstuffTinyprojectsofmine'>Sweating the small stuff - Tiny projects of mine</h1><br /> -<br /> -<span class='quote'>Published at 2022-06-15T08:47:44+01:00; Updated at 2022-06-18</span><br /> -<br /> -<pre> - _ - /_/_ .'''. - =O(_)))) ...' `. - jgs \_\ `. .''' - `..' -</pre> -<br /> -<span>This blog post is a bit different from the others. It consists of multiple but smaller projects worth mentioning. I got inspired by Julia Evan's "Tiny programs" blog post and the side projects of The Sephist, so I thought I would also write a blog posts listing a couple of small projects of mine:</span><br /> -<br /> -<a class='textlink' href='https://jvns.ca/blog/2022/03/08/tiny-programs/'>Tiny programs</a><br /> -<a class='textlink' href='https://thesephist.com/projects/'>The Sephist's project list</a><br /> -<br /> -<span>Working on tiny projects is a lot of fun as you don't need to worry about any standards or code reviews and you decide how and when you work on it. There aren't restrictions regarding technologies used. You are likely the only person working on these tiny projects and that means that there is no conflict with any other developers. This is complete freedom :-).</span><br /> -<br /> -<span>But before going through the tiny projects let's take a paragraph for the <span class='inlinecode'>1y</span> anniversary retrospective.</span><br /> -<br /> -<h2 style='display: inline' id='1yanniversary'><span class='inlinecode'>1y</span> anniversary</h2><br /> -<br /> -<span>It has been one year since I started posting regularly (at least once monthly) on this blog again. It has been a lot of fun (and work) doing so for various reasons:</span><br /> -<br /> -<ul> -<li>I practice English writing (I am not a native speaker). I am far from being a novelist, but this blog helps improves my writing skills. I also tried out tools like Grammarly.com and Languagetool.org and also worked with <span class='inlinecode'>:spell</span> in Vim or the LibreOffice checker. This post was checked with the <span class='inlinecode'>write-better</span> Node application. </li> -<li>I force myself to "finish" some kind of project worth writing about every month. If its not a project, then its still a topic which requires research and deep thinking. Producing 2k words of text can actually be challenging.</li> -<li>It's fun to rely on KISS (keep it simple & stupid) tools. E.g. use of Gemtexter and not WordPress, use of Vim instead of an office suite or a rich web editor.</li> -</ul><br /> -<span>Retrospectively, these have been the most popular blog posts of mine over the last year:</span><br /> -<br /> -<a class='textlink' href='./2021-09-12-keep-it-simple-and-stupid.html'>Keep it simple and stupid</a><br /> -<a class='textlink' href='./2022-04-10-creative-universe.html'>Creative universe</a><br /> -<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>Bash Golf series</a><br /> -<a class='textlink' href='./2021-12-26-how-to-stay-sane-as-a-devops-person.html'>How to stay sane as a DevOps person</a><br /> -<a class='textlink' href='./2022-05-27-perl-is-still-a-great-choice.html'>Perl is still a great choice</a><br /> -<br /> -<span>But now, let's continue with the small projects worth mentioning :-)</span><br /> -<br /> -<h2 style='display: inline' id='Staticphotoalbumgenerator'>Static photo album generator</h2><br /> -<br /> -<span><span class='inlinecode'>photoalbum.sh</span> is a minimal static HTML photo album generator. I use it to drive "The Irregular Ninja" site and for some ad-hoc (personal) albums to share photos with the family and friends.</span><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/photoalbum'>https://codeberg.org/snonux/photoalbum</a><br /> -<br /> -<h3 style='display: inline' id='TheIrregularNinja'>The Irregular Ninja</h3><br /> -<br /> -<span>Photography is one of my casual hobbies. I love to capture interesting perspectives and motifs. I love to walk new streets and neighbourhoods I never walked before so I can capture those unexpected motifs, colours and moments. Unfortunately, because of time constraints (and sometime weather constraints), I do that on a pretty infrequent basis.</span><br /> -<br /> -<a href='./sweating-the-small-stuff/ninja.jpg'><img src='./sweating-the-small-stuff/ninja.jpg' /></a><br /> -<br /> -<span>More than 10 years ago I wrote the bespoke small static photo album generator in Bash <span class='inlinecode'>photoalbum.sh</span> which I recently refactored to a modern Bash coding style and also freshened up the Cascading Style Sheets. Last but not least, the new domain name <span class='inlinecode'>irregular.ninja</span> has been registered.</span><br /> -<br /> -<span>The thumbnails are presented in a random order and there are also random CSS effects for each preview. There's also a simple background blur for each page generated. And that's all in less than 300 lines of Bash code! The script requires ImageMagick (available for all common Linux and *BSD distributions) to be installed.</span><br /> -<br /> -<span>As you can see, there is a lot of randomization and irregularity going on. Thus, the name "Irregular Ninja" was born.</span><br /> -<br /> -<a class='textlink' href='https://irregular.ninja'>https://irregular.ninja</a><br /> -<br /> -<span>I only use a digital compact camera or a smartphone to take the photos. I don't like the idea of carrying around a big camera with me "just in case" so I keep it small and simple. The best camera is the camera you have with you. :-)</span><br /> -<br /> -<span>I hope you like this photo site. It's worth checking it out again around once every other month!</span><br /> -<br /> -<h2 style='display: inline' id='Randomjournalpageextractor'>Random journal page extractor</h2><br /> -<br /> -<span>I bullet journal. I write my notes into a Leuchtturm paper notebook. Once full, I am scanning it to a PDF file and archive it. As of writing this, I am at journal #7 (each from 123 up to 251 pages in A5). It means that there is a lot of material already.</span><br /> -<br /> -<span>Once in a while I want to revisit older notes and ideas. For that I have written a simple Bash script <span class='inlinecode'>randomjournalpage.sh</span> which randomly picks a PDF file from a folder and extracts 42 pages from it at a random page offset and opens them in a PDF viewer (Evince in this case, as I am a GNOME user). </span><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/randomjournalpage'>https://codeberg.org/snonux/randomjournalpage</a><br /> -<br /> -<span>There's also a weekly <span class='inlinecode'>CRON</span> job on my servers to send me a reminder that I might want to read in my old journals again. My laptop also runs this script each time it boots and saves the output to a NextCloud folder. From there, it's synchronized to the NextCloud server so I can pick it up from there with my smartphone later when I am "on the road".</span><br /> -<br /> -<h2 style='display: inline' id='Globaluptimerecordsstatisticgenerator'>Global uptime records statistic generator</h2><br /> -<br /> -<span><span class='inlinecode'>guprecords</span> is a Perl script which reads multiple <span class='inlinecode'>uprecord</span> files (produced by <span class='inlinecode'>uptimed</span> - a widely available daemon for recording server uptimes) and generates uptime statistics of multiple hosts combined. I keep all the record files of all my personal computers in a Git repository (I even keep the records of the boxes I don't own or use anymore) and there's already quite a collection of it. It looks like this:</span><br /> -<br /> -<pre> -❯ perl ~/git/guprecords/src/guprecords --indir=./stats/ --count=20 --all -Pos | System | Kernel | Uptime | Boot time - 1 | sun | FreeBSD 10.1-RELEA.. | 502d 03:29:19 | Sun Aug 16 15:56:40 2015 - 2 | vulcan | Linux 3.10.0-1160... | 313d 13:19:39 | Sun Jul 25 18:32:25 2021 - 3 | uugrn | FreeBSD 10.2-RELEASE | 303d 15:19:35 | Tue Dec 22 21:33:07 2015 - 4 | uugrn | FreeBSD 11.0-RELEA.. | 281d 14:38:04 | Fri Oct 21 15:22:02 2016 - 5 | deltavega | Linux 3.10.0-957.2.. | 279d 11:15:00 | Sun Jun 30 11:42:38 2019 - 6 | vulcan | Linux 3.10.0-957.2.. | 279d 11:12:14 | Sun Jun 30 11:43:41 2019 - 7 | deltavega | Linux 3.10.0-1160... | 253d 04:42:22 | Sat Apr 24 13:34:34 2021 - 8 | host0 | FreeBSD 6.2-RELEAS.. | 240d 02:23:23 | Wed Jan 31 20:34:46 2007 - 9 | uugrn | FreeBSD 11.1-RELEA.. | 202d 21:12:41 | Sun May 6 18:06:17 2018 - 10 | tauceti | Linux 3.2.0-4-amd64 | 197d 18:45:40 | Mon Dec 16 19:47:54 2013 - 11 | pluto | Linux 2.6.32-5-amd64 | 185d 11:53:04 | Wed Aug 1 07:34:10 2012 - 12 | sun | FreeBSD 10.3-RELEA.. | 164d 22:31:55 | Sat Jul 22 18:47:21 2017 - 13 | vulcan | Linux 3.10.0-1160... | 161d 07:08:43 | Sun Feb 14 10:05:38 2021 - 14 | sun | FreeBSD 10.3-RELEA.. | 158d 21:18:36 | Sat Jan 27 10:18:57 2018 - 15 | uugrn | FreeBSD 11.1-RELEA.. | 157d 20:57:24 | Fri Nov 3 05:02:54 2017 - 16 | tauceti-f | Linux 3.2.0-3-amd64 | 150d 04:12:38 | Mon Sep 16 09:02:58 2013 - 17 | tauceti | Linux 3.2.0-4-amd64 | 149d 09:21:43 | Mon Aug 11 09:47:50 2014 - 18 | pluto | Linux 3.2.0-4-amd64 | 142d 02:57:31 | Mon Sep 8 01:59:02 2014 - 19 | tauceti-f | Linux 3.2.0-3-amd64 | 132d 22:46:26 | Mon May 6 11:11:35 2013 - 20 | keppler-16b | Darwin 13.4.0 | 131d 08:17:12 | Thu Jun 11 10:44:25 2015 -</pre> -<br /> -<span>It can also sum up all uptimes for each host to generate a total per host uptime top list:</span><br /> -<br /> -<pre> -❯ perl ~/git/guprecords/src/guprecords --indir=./stats/ --count=20 --total -Pos | System | Kernel | Uptime | - 1 | uranus | Linux 5.4.17-200.f.. | 1419d 19:05:39 | - 2 | sun | FreeBSD 10.1-RELEA.. | 1363d 11:41:14 | - 3 | vulcan | Linux 3.10.0-1160... | 1262d 20:27:48 | - 4 | uugrn | FreeBSD 10.2-RELEASE | 1219d 15:10:16 | - 5 | deltavega | Linux 3.10.0-957.2.. | 1115d 06:33:55 | - 6 | pluto | Linux 2.6.32-5-amd64 | 1086d 10:44:05 | - 7 | tauceti | Linux 3.2.0-4-amd64 | 846d 12:58:21 | - 8 | tauceti-f | Linux 3.2.0-3-amd64 | 625d 07:16:39 | - 9 | host0 | FreeBSD 6.2-RELEAS.. | 534d 19:50:13 | - 10 | keppler-16b | Darwin 13.4.0 | 448d 06:15:00 | - 11 | tauceti-e | Linux 3.2.0-4-amd64 | 415d 18:14:13 | - 12 | moon | Darwin 18.7.0 | 326d 11:21:42 | - 13 | callisto | Linux 4.0.4-303.fc.. | 303d 12:18:24 | - 14 | alphacentauri | FreeBSD 10.1-RELEA.. | 300d 20:15:00 | - 15 | earth | Linux 5.13.14-200... | 289d 08:05:05 | - 16 | makemake | Linux 5.11.9-200.f.. | 286d 21:53:03 | - 17 | london | Linux 3.2.0-4-amd64 | 258d 15:10:38 | - 18 | fishbone | OpenBSD 4.1 .. | 223d 05:55:26 | - 19 | sagittarius | Darwin 15.6.0 | 198d 23:53:59 | - 20 | mars | Linux 3.2.0-4-amd64 | 190d 05:44:21 | -</pre> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/guprecords'>https://codeberg.org/snonux/guprecords</a><br /> -<br /> -<span>This all is of no real practical use but fun!</span><br /> -<br /> -<h2 style='display: inline' id='Serverconfigurationmanagement'>Server configuration management</h2><br /> -<br /> -<span>The <span class='inlinecode'>rexfiles</span> project contains all Rex files for my (personal) server setup automation. A <span class='inlinecode'>Rexfile</span> is written in a Perl DSL run by the Rex configuration management system. It's pretty much KISS and that's why I love it. It suits my personal needs perfectly. </span><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/rexfiles'>https://codeberg.org/snonux/rexfiles</a><br /> -<a class='textlink' href='https://www.rexify.org'>https://www.rexify.org</a><br /> -<br /> -<span>This is an E-Mail I posted to the Rex mailing list:</span><br /> -<br /> -<span class='quote'>Hi there! I was searching for a simple way to automate my personal OpenBSD setup. I found that configuration management systems like Puppet, Salt, Chef, etc.. were too bloated for my personal needs. So for a while I was configuring everything by hand. At one point I got fed up and started writing Shell scripts. But that was not the holy grail so that I looked at Ansible. I found that Ansible had some dependencies on Python on the target machine when you want to use all the features. Furthermore, I am not really familiar with Python. But then I remembered that there was also Rex. It's written in my beloved Perl. Also, OpenBSD comes with Perl in the base system out of the box which makes it integrate better than all my scripts (automation and also scripts deployed via the automation to the system) are all in the same language. Rex may not have all the features like other configuration management systems, but its easy to work-around or extend when you know Perl. Thanks!</span><br /> -<br /> -<h2 style='display: inline' id='FancySSHexecutionloop'>Fancy SSH execution loop</h2><br /> -<br /> -<span><span class='inlinecode'>rubyfy</span> is a fancy SSH loop wrapper written in Ruby for running shell commands on multiple remote servers at once. I also forked this project for work (under a different name) where I added even more features such as automatic server discovery. It's used by many colleagues on a frequent basis. Here are some examples:</span><br /> -<br /> -<pre> -# Run command 'hostname' on server foo.example.com -./rubyfy.rb -c 'hostname' <<< foo.example.com - -# Run command 'id' as root (via sudo) on all servers listed in the list file -# Do it on 10 servers in parallel -./rubyfy.rb --parallel 10 --root --command 'id' < serverlist.txt - -# Run a fancy script in background on 50 servers in parallel -./rubyfy.rb -p 50 -r -b -c '/usr/local/scripts/fancy.zsh' < serverlist.txt - -# Grep for specific process on both servers and write output to ./out/grep.txt -echo {foo,bar}.example.com | ./rubyfy.rb -p 10 -c 'pgrep -lf httpd' -n grep.txt - -# Reboot server only if file /var/run/maintenance.lock does NOT exist! -echo foo.example.com | -./rubyfy.rb --root --command reboot --precondition /var/run/maintenance.lock -</pre> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/rubyfy'>https://codeberg.org/snonux/rubyfy</a><br /> -<br /> -<h2 style='display: inline' id='AKISSdynamicDNSsolution'>A KISS dynamic DNS solution</h2><br /> -<br /> -<span><span class='inlinecode'>dyndns</span> is a tiny shell script which implements "your" own DynDNS service. It relies on SSH access to the authoritative DNS server and the <span class='inlinecode'>nsupdate</span> command. There is really no need to use any of the "other" free DynDNS services out there.</span><br /> -<br /> -<span>Syntax (this must run from the client connecting to the DNS server through SSH): </span><br /> -<br /> -<pre> -ssh dyndns@dyndnsserver /path/to/dyndns-update \ - your.host.name. TYPE new-entry TIMEOUT -</pre> -<br /> -<span>This is a real world example: </span><br /> -<br /> -<pre> -ssh dyndns@dyndnsserver /path/to/dyndns-update \ - local.buetow.org. A 137.226.50.91 30 -</pre> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/dyndns'>https://codeberg.org/snonux/dyndns</a><br /> -<br /> -<h2 style='display: inline' id='CPUinformationgathererforLinux'>CPU information gatherer for Linux</h2><br /> -<br /> -<span>This is a tiny GNU Awk script for Linux which displays information about the CPU. All what it does is presenting <span class='inlinecode'>/proc/cpuinfo</span> in an easier to read way. The output is somewhat more compact than the standard <span class='inlinecode'>lscpu</span> command you find commonly on Linux distributions.</span><br /> -<br /> -<pre> -❯ ./cpuinfo -cpuinfo (c) 1.0.2 Paul Buetow - - 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz GenuineIntel 12288 KB cache - -p = 001 Physical processors -c = 004 Cores -s = 008 Siblings (Hyper-Threading enabled if s != c) -v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs - Hyper-Threading is enabled - -0003000 MHz each core -0012000 MHz total -0005990 Bogomips each processor (including virtual) -0023961 Bogomips total -</pre> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/cpuinfo'>https://codeberg.org/snonux/cpuinfo</a><br /> -<br /> -<h2 style='display: inline' id='Showdifferencesoftwofilesoverthenetwork'>Show differences of two files over the network</h2><br /> -<br /> -<span>This is a shell wrapper to use the standard diff tool over the network to compare a file between two computers. It uses NetCat for the network part and also encrypts all traffic using OpenSSL. This is how its used:</span><br /> -<br /> -<span>1. Open two terminal windows and login to two different hosts (you could use ClusterSSH or <span class='inlinecode'>tmux</span> here). 2. Run on the first host <span class='inlinecode'>netdiff otherhost.example.org /file/to/diff.txt</span> and run on the second host <span class='inlinecode'>netdiff firsthost.example.org /file/to/diff.txt</span>. 3. You then will see the file differences.</span><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/netdiff'>https://codeberg.org/snonux/netdiff</a><br /> -<br /> -<h2 style='display: inline' id='DelaysendingoutEMailswithMutt'>Delay sending out E-Mails with Mutt</h2><br /> -<br /> -<span>This is a shell script for the Mutt email client for delaying sending out E-Mails. For example, you want to write an email on Saturday but don't want to bother the recipient earlier than Monday. It relies on CRON.</span><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/muttdelay'>https://codeberg.org/snonux/muttdelay</a><br /> -<br /> -<h2 style='display: inline' id='GraphicalUIforsendingtextmessages'>Graphical UI for sending text messages</h2><br /> -<br /> -<span><span class='inlinecode'>jsmstrade</span> is a minimalistic graphical Java swing client for sending SMS messages over the SMStrade service.</span><br /> -<br /> -<a href='./sweating-the-small-stuff/jsmstrade.png'><img src='./sweating-the-small-stuff/jsmstrade.png' /></a><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/jsmstrade'>https://codeberg.org/snonux/jsmstrade</a><br /> -<a class='textlink' href='https://smstrade.de'>https://smstrade.de</a><br /> -<br /> -<h2 style='display: inline' id='IPv6andIPv4connectivitytestingsite'>IPv6 and IPv4 connectivity testing site</h2><br /> -<br /> -<span><span class='inlinecode'>ipv6test</span> is a quick and dirty Perl CGI script for testing whether your browser connects via IPv4 or IPv6. It requires you to setup three sub-domains: One reachable only via IPv4 (e.g. <span class='inlinecode'>test4.ipv6.buetow.org</span>), another reachable only via IPv6 (e.g. <span class='inlinecode'>test6.ipv6.buetow.org</span>) and the main one reachable through both protocols (e.g. <span class='inlinecode'>ipv6.buetow.org</span>).</span><br /> -<br /> -<span>I don't have it running on any of my servers at the moment. This means that there is no demo to show now. Sorry!</span><br /> -<br /> -<h2 style='display: inline' id='ListopenJiraticketsintheterminal'>List open Jira tickets in the terminal</h2><br /> -<br /> -<span><span class='inlinecode'>japi</span> s a small Perl script for listing open Jira issues. It might be broken by now as the Jira APIs may have changed. Sorry! But feel free to fork and modernize it. :-)</span><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/jsmstrade'>https://codeberg.org/snonux/jsmstrade</a><br /> -<span> </span><br /> -<h2 style='display: inline' id='DebianrunningonyourAndroidphone'>Debian running on "your" Android phone</h2><br /> -<br /> -<span>Debroid is a tutorial and a set of scripts to install and to run a Debian <span class='inlinecode'>chroot</span> on an Android phone.</span><br /> -<br /> -<a class='textlink' href='./2015-12-05-run-debian-on-your-phone-with-debroid.html'>Check out my previous post about it</a><br /> -<br /> -<span>I am not using Debroid anymore as I have switched to Termux now.</span><br /> -<br /> -<a class='textlink' href='https://termux.com'>https://termux.com</a><br /> -<br /> -<h2 style='display: inline' id='Perlserviceframework'>Perl service framework</h2><br /> -<br /> -<span>PerlDaemon is a minimal daemon for Linux and other Unix like operating systems programmed in Perl. It is a minimal but pretty functional and fairly generic service framework. This means that it does not do anything useful other than providing a framework for starting, stopping, configuring and logging. To do something useful, a module (written in Perl) must be provided.</span><br /> -<br /> -<a class='textlink' href='./2011-05-07-perl-daemon-service-framework.html'>Checkout my previous post about it</a><br /> -<br /> -<h2 style='display: inline' id='More'>More</h2><br /> -<br /> -<span>There are more projects on my Codeberg page but they aren't as tiny as the ones mentioned in this post or aren't finished yet so I won't bother listing them here. However, there also a few more scripts used frequently by me (not publicly accessible (yet?)) which I would like to mention here:</span><br /> -<br /> -<h3 style='display: inline' id='Worktimetracker'>Work time tracker</h3><br /> -<br /> -<span><span class='inlinecode'>worktime.rb</span>, for example, is a command line Ruby script I use to track my time spent working. This is to make sure that I don't overwork (in particular useful when working from home). It also generates some daily and weekly stats and carries over work time (surpluses or minuses) to the next work day, week or even year.</span><br /> -<br /> -<span>It has some special features such as tracking time for self-improvement/development, days off and time spent at the lunch break and time spent on Pet Projects.</span><br /> -<br /> -<span>An example weekly report looks like this (I often don't track my lunch time but what I do instead I stop the work timer when I go out for lunch and start the work timer once back at the desk):</span><br /> -<br /> -<pre> - Mon 20211213 50: work:5.92h - Tue 20211214 50: work:7.47h lunch:0.50h pet:0.42h - Wed 20211215 50: work:8.86h pet:0.50h - Thu 20211216 50: work:8.02h pet:0.50h - Fri 20211217 50: work:9.81h - * Sat 20211218 50: work:0.00h selfdevelopment:1.00h - * Sun 20211219 50: work:2.08h pet:1.00h selfdevelopment:-2.08h -================================================ - balance:0.06h work:42.15h lunch:0.50h pet:2.42h selfdevelopment:-1.08h buffer:8.38h -</pre> -<br /> -<span>All I do when I start work is to run the <span class='inlinecode'>wtlogin</span> command and after finishing work to run the <span class='inlinecode'>wtlogout</span> command. My shell will remind me when I work without having logged in. It uses a simple JSON database which is editable with <span class='inlinecode'>wtedit</span> (this opens the JSON in Vim). The report shown above can be generated with <span class='inlinecode'>wtreport</span>. Any out-of-bounds reporting can be added with the <span class='inlinecode'>wtadd</span> command.</span><br /> -<br /> -<h3 style='display: inline' id='Passwordanddocumentstore'>Password and document store</h3><br /> -<br /> -<span><span class='inlinecode'>geheim.rb</span> is my personal password and document store ("geheim" is the German word for secret). It's written in Ruby and heavily relies on Git, FZF (for search), Vim and standard encryption algorithms. Other than the standard <span class='inlinecode'>pass</span> Unix password manager, <span class='inlinecode'>geheim</span> also encrypts the file names and password titles.</span><br /> -<br /> -<span>The tool is command line driven but also provides an interactive shell when invoked with <span class='inlinecode'>geheim shell</span>. It also works on my Android phone via Termux so I have all my documents and passwords always with me. </span><br /> -<br /> -<h3 style='display: inline' id='Backupprocedure'>Backup procedure</h3><br /> -<br /> -<span><span class='inlinecode'>backup</span> is a Bash script which does run once daily (or every time on boot) on my home FreeBSD NAS server and performs backup related tasks such as creating a local backup of my remote NextCloud instance, creating encrypted (incremental) ZFS snapshots of everything what's stored on the NAS and synchronizes (via <span class='inlinecode'>rsync</span>) backups to a remote cloud storage. It also can synchronize backups to a local external USB drive.</span><br /> -<br /> -<a class='textlink' href='./2016-04-03-offsite-backup-with-zfs.html'>Check out my offsite backup series</a><br /> -<br /> -<h2 style='display: inline' id='konpeitomedia'>konpeito.media</h2><br /> -<br /> -<span>Here's a bonus...</span><br /> -<br /> -<pre> - ▄ █ ▄ ▄ █ ▄ ▄ █ ▄ - ▄▀█▀▄ ▄▀█▀▄ ▄▀█▀▄ - ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▀ ▀ ▀ - █ ▄▄ ▄▄ █ - █ █ █▀▀▀█ █ █ █ ▄▀ ▄▀▀▀▀▄ █▄ █ █▀▀▀▀▀▄ ▄▀▀▀▀▄ █ ▀▀▀█▀▀▀ ▄▀▀▀▀▄ - █ ▀▀▀▀▀▀▀▀▀ █ █ ▄█ █ █ █ ▀▄ █ █▄▄▄▄▄▀ █▄▄▄▄▄▄█ █ █ █ █ - █ ▄▀▀▀▀▀▀▀▀▀▀▀▄ █ █▀ ▀▄ ▀▄ ▄▀ █ ▀▄█ █ ▀▄ ▄ █ █ ▀▄ ▄▀ - ▀▄█▄█▄▄▄▄▄▄▄█▄█▄▀ ▀ ▀ ▀▀▀▀ ▀ ▀ ▀ ▀▀▀▀ ▀ ▀ ▀▀▀ -</pre> -<br /> -<span>*THIS ISN'T MY PROJECT* but I found KONPEITO an interesting Gemini capsule. It's a quarterly released Low-Fi music mix tape distributed only through Gemini (and not the web). </span><br /> -<br /> -<a class='textlink' href='gemini://konpeito.media'>gemini://konpeito.media</a><br /> -<br /> -<span>If you wonder what Gemini is:</span><br /> -<br /> -<a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>Welcome to the Geminispae</a><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>Perl is still a great choice</title> - <link href="gemini://foo.zone/gemfeed/2022-05-27-perl-is-still-a-great-choice.gmi" /> - <id>gemini://foo.zone/gemfeed/2022-05-27-perl-is-still-a-great-choice.gmi</id> - <updated>2022-05-27T07:50:12+01:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>Perl (the Practical Extraction and Report Language) is a battle-tested, mature, multi-paradigm dynamic programming language. Note that it's not called PERL, neither P.E.R.L. nor Pearl. 'Perl' is the name of the language and `perl` the name of the interpreter or the interpreter command.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Perlisstillagreatchoice'>Perl is still a great choice</h1><br /> -<br /> -<span class='quote'>Published at 2022-05-27T07:50:12+01:00; Updated at 2023-01-28</span><br /> -<br /> -<a href='./perl-is-still-a-great-choice/regular_expressions.png'><img alt='Comic source: XKCD' title='Comic source: XKCD' src='./perl-is-still-a-great-choice/regular_expressions.png' /></a><br /> -<br /> -<span>Perl (the Practical Extraction and Report Language) is a battle-tested, mature, multi-paradigm dynamic programming language. Note that it's not called PERL, neither P.E.R.L. nor Pearl. "Perl" is the name of the language and <span class='inlinecode'>perl</span> the name of the interpreter or the interpreter command.</span><br /> -<br /> -<span>Unfortunately (it makes me sad), Perl's popularity has been declining over the last years as Google trends shows:</span><br /> -<br /> -<a href='./perl-is-still-a-great-choice/googletrendsperl.jpg'><img src='./perl-is-still-a-great-choice/googletrendsperl.jpg' /></a><br /> -<br /> -<span>So why is that? Once the de-facto standard super-glue language for the web nowadays seems to have a bad reputation. Often, people state:</span><br /> -<br /> -<ul> -<li>Perl is a write-only language. Nobody can read Perl code.</li> -<li>Perl? Isn't it abandoned? It's still at version 5!</li> -<li>Why use Perl as there are better alternatives?</li> -<li>Why all the sigils? It looks like an exploding ASCII factory!!</li> -</ul><br /> -<h2 style='display: inline' id='Writeonlylanguage'>Write-only language</h2><br /> -<br /> -<span>Is Perl really a write-only language? You have to understand that Perl 5 was released in 1994 (28 years ago as of this writing) and when we refer to Perl we usually mean Perl 5. That's many years, and there are many old scripts not following the modern Perl best practices (as they didn't exist yet). So yes, legacy scripts may be difficult to read. Japanese may be difficult to read too if you don't know Japanese, though.</span><br /> -<br /> -<span>To come back to the question: Is Perl a write-only language? I don't think so. Like in any other language, you have to apply best practices in order to keep your code maintainable. Some other programming languages enforce best practices, but that makes these languages less expressive. Perl follows the principles "there is more than one way to do it" (aka TIMTOWDI) and "making easy things easy and hard things possible".</span><br /> -<br /> -<span>Perl gives the programmer more flexibility in how to do things, and this results in a stronger learning curve than for lesser expressive languages like for example Go or Python. But, like in everything in life, common sense has to be applied. You should not take TIMTOWDI to the extreme in a production piece of code. In my personal opinion, it is also more satisfying to program in an expressive language.</span><br /> -<br /> -<span>Some good books on "good" Perl I can recommend are:</span><br /> -<br /> -<a class='textlink' href='http://modernperlbooks.com'>Modern Perl</a><br /> -<a class='textlink' href='https://hop.perl.plover.com'>Higher Order Perl</a><br /> -<br /> -<span>Due to Perl's expressiveness you will find a lot of obscure code in the interweb in form of obfuscation, fancy email signatures (JAPHs), art, polyglots and even poetry in Perl syntax. But that's not what you will find in production code. That's only people having fun with the language which is different to "getting things done". The expressiveness is a bonus. It makes the Perl programmers love Perl.</span><br /> -<br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Just_another_Perl_hacker'>JAPH</a><br /> -<a class='textlink' href='http://www.cpan.org/misc/japh'>http://www.cpan.org/misc/japh</a><br /> -<a class='textlink' href='https://www.perlmonks.org/index.pl?next=20;node_id=1590'>Perl Poetry</a><br /> -<br /> -<span>Even I personally have written some poetry in Perl and experimented with a polyglot script:</span><br /> -<br /> -<a class='textlink' href='./2008-06-26-perl-poetry.html'>My very own Perl Poetry</a><br /> -<a class='textlink' href='./2014-03-24-the-fibonacci.pl.c-polyglot.html'>A Perl-Raku-C polyglot generating the Fibonacci sequence</a><br /> -<br /> -<span>This all doesn't mean that you can't "get things done" with Perl. Quite the opposite is the case. Perl is a very pragmatic programming language and is suitable very well for rapid prototyping and any kind of small to medium-sized scripts and programs. You can write large enterprise scale application in Perl too, but that wasn't the original intend of why Perl was invented (more on that later).</span><br /> -<br /> -<h2 style='display: inline' id='IsPerlabandoned'>Is Perl abandoned?</h2><br /> -<br /> -<span>As I pointed out in the previous section, Perl 5 is around for quite some time without any new major version released. This can lead to the impression that development is not progressing and that the project is abandoned. Nothing can be further from the truth. Perl 5.000 was released in 1994 and the latest version (as of this writing) Perl 5.34.1 was released two months ago in 2022. You can check the version history on Wikipedia. You will notice releases being made regularly:</span><br /> -<br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Perl_5_version_history'>Perl 5 version history</a><br /> -<br /> -<span>As you can see, Perl 5 is under active development. I can also recommend to have a look at the following book, it summarizes all new Perl features which showed up after Perl v5.10:</span><br /> -<br /> -<a class='textlink' href='https://perlschool.com/books/perl-new-features/'>Perl New Features by Joshua McAdams and brian d foy</a><br /> -<br /> -<span>Actually, Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it also referred to its redesigned "sister language", Perl 6, before the latter's name was officially changed to Raku in October 2019 as the differences between Perl 5 and Perl 6 were too groundbreaking. Raku would be a different topic (mostly out of scope of this blog article) but I at least wanted it to mention here. In my opinion, Raku is the "most powerful" programming language out there (I recently started learning it and intend to use it for some of my future personal programming projects):</span><br /> -<br /> -<a class='textlink' href='https://raku.org'>The Raku Programming Language</a><br /> -<br /> -<span>So it means that Perl and Raku now exist in parallel. They influence each other, but are different programming languages now. So why not just all use Raku instead of Perl? There are still a couple of reasons of why to choose Perl over Raku:</span><br /> -<br /> -<ul> -<li>Many programmers already know Perl and many scripts are already written in Perl. It's possible to call Perl code from Raku (either inline or as a library) and it is also possible to auto-convert Perl code into Raku code, but that's either a workaround or involves some kind of additional work.</li> -<li>Perl 5 comes with a great backwards compatibility. Perl scripts from 5.000 will generally still work on a recent version of Perl. New features usually have to be enabled via a so-called "use pragmas". For example, in order to enable sub signatures, <span class='inlinecode'>use signatures;</span> has to be specified.</li> -<li>Perl is pre-installed almost everywhere. Fancy running a quick one-off script? In almost all cases, there's no need to install Perl first - it's already there on almost any Linux or *BSD or Unix or other Unix like operating system!</li> -<li>Perl has been ported to "zillions" of platforms. One day I found myself on a VMS box. Perl doesn't come installed by default on VMS, but the admin installed Perl there already. The whole operating system was very strange to me, but I was able to write "shell scripts" in Perl and became productive pretty quickly on VMS without knowing almost anything about VMS :-).</li> -<li>Perl is reliable. It has been proven itself "millions" of times, over and over again. Large enterprises, such as booking.com, heavily rely on Perl. Did you know that the package manager of the OpenBSD operating system is programmed in Perl, too?</li> -<li>Perl is a great language to program in (given that you follow the modern best practices). Don't get confused when Perl is doing some things differently than other programming languages.</li> -</ul><br /> -<a class='textlink' href='https://perldoc.perl.org/feature'>Perl feature pragmas</a><br /> -<a class='textlink' href='https://www.OpenBSD.org'>The OpenBSD Operating System</a><br /> -<a class='textlink' href='https://news.ycombinator.com/item?id=23360338'>Why does OpenBSD still include Perl in its base installation?</a><br /> -<br /> -<span>The renaming of Perl 6 to Raku has now opened the door for a future Perl 7. As far as I understand, Perl 7 will be Perl 5 but with modern features enabled by default (e.g. pragmas <span class='inlinecode'>use strict;</span>, <span class='inlinecode'>use warnings;</span>, <span class='inlinecode'>use signatures;</span> and so on. Also, the hope is that a Perl 7 with modern standards will attract more beginners. There aren't many Perl jobs out there nowadays. That's mostly due to Perl's bad (bad for no real reasons) reputation.</span><br /> -<br /> -<span class='quote'>Update 2022-12-10: A reader pointed out, that <span class='inlinecode'>use v5.36;</span> already turns strict, warnings and signatures pragmas automatically on! </span><br /> -<br /> -<a class='textlink' href='https://www.perl.com/article/announcing-perl-7/'>Announcing Perl 7</a><br /> -<a class='textlink' href='http://blogs.perl.org/users/psc/2022/05/what-happened-to-perl-7.html'>What happened to Perl 7? (maybe have to use <span class='inlinecode'>use v7;</span>)</a><br /> -<br /> -<span class='quote'>Update 2022-12-10: A reader pointed out, that Perl 7 needs to provide a big improvement to earn and keep the attention for a major version bump.</span><br /> -<br /> -<span class='quote'>Update 2023-01-28: Meanwhile, I was also reading brian d foy's Perl New Feature book. It nicely presents all new features added to Perl since <span class='inlinecode'>v5.10</span>.</span><br /> -<br /> -<a class='textlink' href='https://www.leanpub.com/perl_new_features'>Perl New Features</a><br /> -<br /> -<h2 style='display: inline' id='WhyusePerlastherearebetteralternatives'>Why use Perl as there are better alternatives?</h2><br /> -<br /> -<span>Here, common sense must be applied. I don't believe there is anything like "the perfect" programming language. Everyone has got his preferred (or a set of preferred) programming language to chose from. All programming languages come with their own set of strengths and weaknesses. These are the strengths making Perl shine, and you (technically) don't need to bother to look for "better" alternatives:</span><br /> -<br /> -<ul> -<li>Perl is better than Shell/AWK/SED scripts. There's a point where shell scripts become fairly complex. The next step-up is to switch to Perl. There are many different versions of shells and AWK and SED interpreters. Do you always know which versions (<span class='inlinecode'>mawk</span>, <span class='inlinecode'>nawk</span>, <span class='inlinecode'>gawk</span>, <span class='inlinecode'>sed</span>, <span class='inlinecode'>gsed</span>, <span class='inlinecode'>grep</span>, <span class='inlinecode'>ggrep</span>...) are currently installed? These commands aren't fully compatible to each other. However, there is only one Perl 5. Simply: Perl is faster, more powerful, more expressive than any shell script can ever be, and it is also extendible through CPAN. Perl can directly talk to databases, which shell scripts can't.</li> -<li>Perl code tends to be compact so that it's much better suitable for "shell scripting" and quick "one-liners" than other languages. In my own experience: Ruby and Python code tends to blow up quickly. It doesn't mean that Ruby and Python are not suitable for this task, but I think Perl does much better.</li> -<li>Perl 5 has proven itself for decades and is a very stable/robust language. It is a battle-tested and mature as something can ever become.</li> -<li>Perl is the reference standard for regular expressions. Even so much that there is a PCRE library (Perl Compatible Regular Expressions) used by many other languages now. Perl fully integrates regular expression syntax into the language, which doesn't feel like an odd add-on like in most other languages.</li> -<li>Perl 5 is the master of text processing (well, maybe after Raku now. But you might not have the latest Raku available everywhere). The chief objective of developing the language was for text processing, and this is where Perl (Practical extraction and report language) really shines.</li> -<li>Perl is a "deep" language. That means Perl got a lot of features and syntactic sugar and magic. Depending on the perspective, this could be interpreted as a downside too. But IMHO mastery of a "deep" language brings big rewards. The code can be very compact, and it is fun to code in it.</li> -<li>Perl is the only language I know which can do "taint checking". Running a script in taint mode makes Perl sanitize all external input and that's a great security feature. Ruby used to have this feature too, but it got removed (as I understand there were some problems with the implementation not completely safe and it was easier just to remove it from the language than to fix it).</li> -</ul><br /> -<span>About the first point, using Perl for better "shell" scripts was actually the original intend of why Perl was invented in the first place.</span><br /> -<br /> -<a class='textlink' href='https://nostarch.com/perloneliners'>Perl one-liners</a><br /> -<a class='textlink' href='http://regex.info/book.html'>Mastering Regular Expressions</a><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Taint_checking'>Taint checking</a><br /> -<br /> -<span>Here are some reasons why not to chose Perl and look for "better" alternatives:</span><br /> -<br /> -<ul> -<li>If performance is your main objectives, then Perl might not be the language to use. Perl is a dynamic interpreted language, and it will generally never be as fast as statically typed languages compiled to native binaries (e.g. C/C++/Rust/Haskell) or statically typed languages run in a VM with JIT (e.g. Java) or languages like Golang (statically typed, compiled to a binary but still with a runtime in the binary). Perl might be still faster than the other language listed here in certain circumstances (e.g. faster startup time than Java or faster regular expressions engine), but usually it's not. It's not a problem of Perl, it's a problem of all dynamic scripting languages including Python, Ruby, ....</li> -<li>Don't use Perl (just yet) if you want to code object-oriented. Perl supports OOP, but it feels clunky and odd to use (blessed references to any data types are objects) and doesn't support real encapsulation out of the box. There are many (many) extensions available on CPAN to make OOP better, but that's totally fragmented. The most popular extension, Moose, comes with a huge dependency tree. But wait for Perl 7. It will maybe come with a new object system (an object system inspired by Raku).</li> -<li>It's possible to write large programs in Perl (make difficult things possible), but it might not be the best choice here. This also leads back to the clunky object system Perl has. You could write your projects in a procedural or functional style (Perl perfectly fits here), but OOP seems to be the gold standard for large projects nowadays. Functional programming requires a different mindset, and pure procedural programming lacks abstractions.</li> -<li>Apply common sense. What is the skill set your team has? What's already widely used and supported at work? Which languages comes with the best modules for the things you want to work on? Maybe Python is the answer (better machine learning modules). Maybe Perl is the better choice (better Bioinformatic modules). Perhaps Ruby is already the de-facto standard at work and everyone knows at least a little Ruby (as it happened to be at my workplace) and Ruby is "good enough" for all the tasks already. But that's not a hindrance to throw in a Perl one-liner once in a while :P.</li> -</ul><br /> -<a class='textlink' href='https://github.com/Ovid/Cor'>Cor - Bringing modern OOP to the Perl Core</a><br /> -<br /> -<h2 style='display: inline' id='WhyallthesigilsItlookslikeanexplodingASCIIfactory'>Why all the sigils? It looks like an exploding ASCII factory!!</h2><br /> -<br /> -<span>The sigils <span class='inlinecode'>$ @ % &</span> (where Perl is famously known for) serve a purpose. They seem confusing at first, but they actually make the code better readable. <span class='inlinecode'>$scalar</span> is a scalar variable (holding a single value), <span class='inlinecode'>@array</span> is an array (holding a list of values), <span class='inlinecode'>%hash</span> holds a list of key-value pairs and <span class='inlinecode'>&sub</span> is for subroutines. A given variable <span class='inlinecode'>$ref</span> can also hold reference to something. <span class='inlinecode'>@$arrayref</span> dereferences a reference to an array, <span class='inlinecode'>%$hashref</span> to a hash, <span class='inlinecode'>$$scalarref</span> to a scalar, <span class='inlinecode'>&$subref</span> dereferences a referene to a subroutine, etc. That can be encapsulated as deep as you want. (This paragraph only scratched the surface here of what Perl can do, and there is a lot of syntactic sugar not mentioned here).</span><br /> -<br /> -<span>In most other programming languages, you won't know instantly what's the "basic type" of a given variable without looking at the variable declaration or the variable name (If named intelligently, e.g. a variable name containing a list of cats is <span class='inlinecode'>cat_list</span>). Even Ruby makes some use of sigils (<span class='inlinecode'>@</span>, <span class='inlinecode'>@@</span> and <span class='inlinecode'>$</span>), but that's for a different purpose than in Perl (in Ruby it is about object scope, class scope and global scope). Raku uses all the sigils Perl uses plus an additional bunch of twigils, e.g. <span class='inlinecode'>$.foo</span> for a scalar object variable with public accessors, <span class='inlinecode'>$!foo</span> for a private scalar object variable, <span class='inlinecode'>@.foo</span>, <span class='inlinecode'>@!foo</span>, <span class='inlinecode'>%.foo</span>, <span class='inlinecode'>%!foo</span> and so on. Sigils (and twigils) are very convenient once you get used to them. Don't let them scare you off - they are there to help you!</span><br /> -<br /> -<a class='textlink' href='https://www.perl.com/article/on-sigils/'>https://www.perl.com/article/on-sigils/</a><br /> -<br /> -<h2 style='display: inline' id='WheredoIpersonallystilluseperl'>Where do I personally still use perl?</h2><br /> -<br /> -<ul> -<li>I use Rexify for my OpenBSD server automation. Rexify is a configuration management system developed in Perl with similar features to Ansible but less bloated. It suits my personal needs perfectly.</li> -<li>I have written a couple of smaller to medium-sized Perl scripts which I (mostly) still use regularly. You can find them on my Codeberg page.</li> -<li>My day-to-day workflow heavily relies on "ack-grep". Ack is a tool developed in Perl aimed at programmers and can be used for quick searches on source code at the command line.</li> -<li>I aim to leave my OpenBSD servers as "vanilla" as possible (trying to rely only on the standard/base installation without installing additional software from the packaging system or ports tree). All my scripts are written either Bourne shell or in Perl here. So there is no need to install additional interpreters.</li> -<li>Here and there, I drop a Perl one-liner in order to get stuff done (work and personally). A wise Perl Monk would say: "One one-liner a day keeps the troubles away".</li> -</ul><br /> -<span>Btw.: Did you know that the first version of PHP was a set of Perl snippets? Only later, PHP became an independent programming language.</span><br /> -<br /> -<a class='textlink' href='https://www.perl.org'>https://www.perl.org</a><br /> -<br /> -<span class='quote'>Update 2022-12-17: The following is another related post. I don't agree to the statement made there, that Python code tends to be shorter than Perl code, though!</span><br /> -<br /> -<a class='textlink' href='https://stackoverflow.blog/2022/07/06/why-perl-is-still-relevant-in-2022/'>Why Perl is still relevant in 2022</a><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<span>Other related posts are:</span><br /> -<br /> -<a class='textlink' href='./2008-06-26-perl-poetry.html'>2008-06-26 Perl Poetry</a><br /> -<a class='textlink' href='./2011-05-07-perl-daemon-service-framework.html'>2011-05-07 Perl Daemon (Service Framework)</a><br /> -<a class='textlink' href='./2022-05-27-perl-is-still-a-great-choice.html'>2022-05-27 Perl is still a great choice (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-05-01-unveiling-guprecords:-uptime-records-with-raku.html'>2023-05-01 Unveiling <span class='inlinecode'>guprecords.raku</span>: Global Uptime Records with Raku</a><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>Creative universe</title> - <link href="gemini://foo.zone/gemfeed/2022-04-10-creative-universe.gmi" /> - <id>gemini://foo.zone/gemfeed/2022-04-10-creative-universe.gmi</id> - <updated>2022-04-10T10:09:11+01:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>I have been participating in an annual work-internal project contest (we call it Pet Project contest) since I moved to London and switched jobs to my current employer. I am very happy to say that I won a 'silver' prize last week here 🎆. Over the last couple of years I have been a finalist in this contest six times and won some kind of prize five times. Some of my projects were also released as open source software. One had a magazine article published, and for another one I wrote an article on my employer's engineering blog. If you have followed all my posts on this blog (the one you are currently reading), then you have probably figured out what these projects were:</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Creativeuniverse'>Creative universe</h1><br /> -<br /> -<span class='quote'>Published at 2022-04-10T10:09:11+01:00; Updated at 2022-04-18</span><br /> -<br /> -<pre> - . + . . . . . . - . . . * - . * . . . . . . + . - "You Are Here" . . + . . . -. | . . . . . . - | . . . +. + . - \|/ . . . . - . . V . * . . . . + . - + . . . + - . . + .+. . - . . . + . . . . . - . . . . . . . . ! / - * . . . + . . - O - - . . . + . . * . . / | - . + . . . .. + . -. . . . * . * . +.. . * - . . . . . . . . + . . + - - the universe -</pre> -<br /> -<h2 style='display: inline' id='Prelude'>Prelude</h2><br /> -<br /> -<span>I have been participating in an annual work-internal project contest (we call it Pet Project contest) since I moved to London and switched jobs to my current employer. I am very happy to say that I won a "silver" prize last week here 🎆. Over the last couple of years I have been a finalist in this contest six times and won some kind of prize five times. Some of my projects were also released as open source software. One had a magazine article published, and for another one I wrote an article on my employer's engineering blog. If you have followed all my posts on this blog (the one you are currently reading), then you have probably figured out what these projects were:</span><br /> -<br /> -<a class='textlink' href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>DTail - The distributed log tail program</a><br /> -<a class='textlink' href='./2018-06-01-realistic-load-testing-with-ioriot-for-linux.html'>Realistic load testing with I/O Riot for linux</a><br /> -<br /> -<span>Note that my latest silver prize project isn't open source software and because of that there is no public material I can refer to. Maybe the next one again?</span><br /> -<br /> -<span>I want to point out that I never won the "gold" prize and it's the first time I won "silver", though. I believe, looking at the company's contest history, I am the employee with the most consecutive successful project submissions (my streak broke as I didn't participate last year) and am also the one with the highest successful project count in total. Sorry if this all sounds a bit self-promotional, but I think it is something to be proud of. Consistency beats a one-off success.</span><br /> -<br /> -<span>I often put endless hours and sometimes sleepless nights into such projects and all of that in my own time. I, an engineer whose native tongue is not English, also have to present such a project in front of the CEO, CTO and CPO, the Chief Scientist, the founders of the company, and, if it is not enough, to all other staff of the company too. I usually also demonstrate a working prototype live on a production grid during the presentation. 😓</span><br /> -<br /> -<span>So why would I sign up myself for such side projects? Isn't it a lot of stress and extra work? Besides the prize in form of money (you can not count on that, you may win or you may not win something) and recognition, there are also other motivational points:</span><br /> -<br /> -<ul> -<li>I want to learn new technologies or to deepen my knowledge of a given technology. I want to have a personal benefit from the project, even when I don't win any prize. So when the company is offering a contest, why not use it as a motivational trampoline? It's good to have a hard deadline for a project. And the project will also benefit the company in some way. So it's a win-win.</li> -<li>I love the idea of combining several old things into a new thing. You can call this creativity. At work, we call this sometimes Lego: Building new things from given blocks. But I also love to add something new and unique to the mix, something that didn't exist as a Lego block before and could not be built by using only the already existing blocks.</li> -</ul><br /> -<h2 style='display: inline' id='Howtobecreative'>How to be creative</h2><br /> -<br /> -<span>How did I manage to be creative with all these Pet Projects? Unfortunately, there is no step-by-step guide I could point you to. But what I want to do in this blog post is share my personal experience so far.</span><br /> -<br /> -<h3 style='display: inline' id='Knowwhichproblemyouwanttosolve'>Know which problem you want to solve</h3><br /> -<br /> -<span>There must be a problem to be solved or a thing to be improved. It makes no sense to have a project without a goal. A problem might be obvious to you, and you don't even need to think about it. In that case, you are all set, and you can immerse yourself with the problem.</span><br /> -<br /> -<span>If, however, you don't know what problem you want to solve: Do you really need to be creative? All problems are solved anyway, correct? In that case, just go on with your work. As you immerse yourself with your daily work, you will find a project naturally after a while. I don't believe you should artificially find a project. It should come naturally to you. You should have an interest in the problem domain and a strong desire to find a proper solution for the problem. Artificially created projects come with the catch that you might give up on it rather sooner than later due to lack of motivation and desire.</span><br /> -<br /> -<h3 style='display: inline' id='Immersedeepdive'>Immerse / deep dive</h3><br /> -<br /> -<span>If you want to be creative in a field, you must know a lot about it. The more you know about it, the more dots you can connect. When you are learning a new technology or if you are thinking about a tough problem, do it thoroughly. Don't let anything distract you. Read books, watch lectures, listen to podcasts or audiobooks about the topic, talk to other people working on similar topics. Immerse yourself for multiple hours per day, multiple days per week, multiple weeks and maybe even months. Create your own inner universe.</span><br /> -<br /> -<span>But once a day is over, shut your thoughts down. Hit the off-switch. Stop thinking about this problem for the remainder of the day. This can be difficult, as you didn't solve the problem- or didn't understand everything of the new technology yet, and you really want to get to the point. But be strict to yourself and stop thinking about it for a while.</span><br /> -<br /> -<span>You must understand that you are more than just your conscious thoughts. Your brain does a lot of work in the background that you aren't aware of consciously. What happens when you stop consciously thinking about a problem is that your brain continues processing it. You might have experienced the "AHA"-effect, where suddenly you had an idea out of nowhere (e.g. during a walk, in the shower, or in the morning when you woke up)? This is your conscious self downloading a result from the background thread of your brain. You can elevate this effect by immersing with the problem immensely before giving your conscious self a break.</span><br /> -<br /> -<span>Sometimes, depending on how deeply you were immersed, you may need to let the problem go for a couple of days (e.g. over a weekend) before you can download a new insight.</span><br /> -<br /> -<h3 style='display: inline' id='Alwayshaveanotebookwithyou'>Always have a notebook with you</h3><br /> -<br /> -<span>Wherever you go, ensure that you always have something to take notes with you. Once you have an idea from nowhere (or from your unconscious but volatile brain), you really want to write it down to persistent storage. It doesn't matter what kind of note-taking device you use here. It can be a paper journal, or it can be your smartphone. </span><br /> -<br /> -<span>My advice is to have a separate section where you put your notes of all of your ideas. At home or in the office, I write everything in my paper journal. When I am not at home, I use a digital note-taking app on my phone. Later, I copy the digital notes from it into a project-specific section of my paper journal.</span><br /> -<br /> -<span>I prefer taking notes on paper, as it gives you more freedom of how to structure it. You can use any colour, and you can also quickly create diagrams without the use of any complex computer program.</span><br /> -<br /> -<h3 style='display: inline' id='Whenyoudidntsleepenough'>When you didn't sleep enough</h3><br /> -<br /> -<span>I noticed while being sleep-deprived I am (obviously) unable to concentrate so much, and it is difficult to be immersed in a focused way. But on the other hand, I am a lot more creative compared to when I am not sleep-deprived. Then, my brain suddenly presents me with connections I have not thought of before. Here, I usually write any idea I have down on a sheet of paper or in my journal, so I can pick it up later. I then often continue to philosophise about a possible solution. Sometimes to the absurd, and sometimes to something pretty useful.</span><br /> -<br /> -<span>I am not saying that you should skip sleep. By all means, if you can sleep, then sleep. But there are some days when you don't manage to sleep (e.g. think too much about a project and didn't manage to hit the off switch). This is, where you can take advantage of your current state of mind. Disclaimer: Skipping sleep damages your health. So, please don't try this out on purpose. But in case you had a bad night, remember this trick.</span><br /> -<br /> -<h3 style='display: inline' id='Haveregularbreaksandrelax'>Have regular breaks and relax</h3><br /> -<br /> -<span>Have regular breaks. Don't skip your lunch break. Best, have a walk during lunchtime. And after work, do some kind of workout or visit a sports class. Do something completely unrelated to work before going to sleep (e.g. visit a parallel universe and read a Science Fiction novel). In short: Totally hit the off-switch after your work for the day is finished. You will be much more energised and motivated the next time you open your work laptop.</span><br /> -<br /> -<a class='textlink' href='../other-resources.html'>I personally love to read Science Fiction novels</a><br /> -<br /> -<span>I skip breakfast and lunch during the week. This means that on average, I intermittent fast on average 18-20 hours daily. It may sound odd to most people (who don't intermittent fast), but in a fasted state, I can be even more focused, thus helping me immerse myself in something even more. Not having breakfast and lunch also gives me back some time for other things (e.g. a nice walk, where I listen to podcasts or audiobooks or practise using my camera (street photography)). I relax my routine during the week ends, where I may enjoy a meal at any given time of the day.</span><br /> -<br /> -<span>It also helps a lot eat healthy. Healthy food makes your brain work more efficiently. But I won't go into more details here, as nothing is as contradictory as the health and food industry. Conduct your own research. Your opinion may be different from mine anyway, and everyone's body reacts to certain foods differently. What for one person works may not work for another person. But be aware that you will find a lot of wrong and also conflicting information on the internet. So always use multiple resources for your research.</span><br /> -<br /> -<h3 style='display: inline' id='Upsidedownapproach'>Upside-down approach</h3><br /> -<br /> -<span>It's easy to fall into the habit of "boxed" thinking, but creativity is exactly the opposite. Once in a while, make yourself think "Is A really required to do B?". Many assumptions are believed to be true. But are they really? A concrete example: "At work we only use the programming language L and framework F" and therefore, it is the standard we must use.</span><br /> -<br /> -<span>Another way to think about it is "Is there an alternative way to accomplish the desired result? What if there were no programming language L and framework F? What would I do instead?". Maybe you would use programming language X to implement your own domain-specific language, which does what framework F would have done but in exactly the way you want to + much more flexible than F! And maybe language X would be much better suitable than L to implement a DSL anyway. Conclusion: It never hurts to verify your assumptions.</span><br /> -<br /> -<span>Often, you will also find solutions to problems you never intended to solve and find new problems you never imagined to actually exist. That might not be a bad thing, but it might sidetrack you on your path to finding a solution for a particular problem. So be careful not to get sidetracked too much. In this case, just save a note for later reference (maybe your next Pet Project?) somewhere and go on with your actual problem.</span><br /> -<br /> -<span>Don't be afraid to think about weird and unconventional solutions. Sometimes, the most unconventional solution is the best solution to a problem. Also, try to keep to the basics. The best solutions are KISS.</span><br /> -<br /> -<a class='textlink' href='./2021-09-12-keep-it-simple-and-stupid.html'>Keep it simple and stupid</a><br /> -<br /> -<span>A small additional trick: you can train yourself to generate new and unconventional ideas. Just write down 20 random ideas every day. It doesn't matter what the ideas are about and whether they are useful or not. The purpose of this exercise is to make your brain think about something new and unconventional. These can be absurd ideas such as "Jump out of the window naked in the morning in order to wake up faster". Of course, you would never do that, but at least you had an idea and made your brain generate something.</span><br /> -<br /> -<h3 style='display: inline' id='Dontbebusyallthetime'>Don't be busy all the time</h3><br /> -<br /> -<span>Especially as a DevOps Engineer, you could be busy all the time with small, but frequent, ad hoc tasks. Don't lose yourself here. Yes, you should pay attention to your job and those tasks, but you should also make some room for creativity. Don't schedule meeting after ad hoc work after meeting after Jira ticket work after another Jira ticket. There should also be some "free" space in your calendar.</span><br /> -<br /> -<span>Use the "free" time to play around with your tech stack. Try out new options, explore the system metrics, explore new tools, etc. Dividends will pay off with new ideas, which you would have never come up with if you were "just busy" like a machine.</span><br /> -<br /> -<span>Sometimes, I pick a Unix manual page of a random command and start reading it. I have a bash helper function which will pick one for me:</span><br /> -<br /> -<pre> -❯ where learn -learn () { - man $(ls /bin /sbin /usr/bin /usr/sbin 2>/dev/null | shuf -n 1) | - sed -n "/^NAME/ { n;p;q }" -} -❯ learn - perltidy - a perl script indenter and reformatter -❯ learn - timedatectl - Control the system time and date -</pre> -<br /> -<h2 style='display: inline' id='Conclusion'>Conclusion</h2><br /> -<br /> -<span>This all summarises advice I have, really. I hope this was interesting and helpful for you.</span><br /> -<br /> -<span>I have one more small tip: I never published a blog post the same day I wrote it. After finishing writing it, I always wait for a couple of days. In all cases so far, I had an additional idea to add or to fine tune the blog post.</span><br /> -<br /> -<span>Another article I found interesting and relevant is</span><br /> -<br /> -<a class='textlink' href='https://thesephist.com/posts/paradise/'>Creative Paradise by The Sephist</a><br /> -<br /> -<span>Relevant books I can recommend are:</span><br /> -<br /> -<ul> -<li>Consciousness: A Very Short Introduction; Susan Blackmore; Oxford Uiversity Press</li> -<li>Deep Work; Cal Newport; Piatkus</li> -<li>So Good They Can't Ignore You; Cal Newport; Business Plus</li> -<li>The Off Switch; Mark Cropley; Virgin Books</li> -<li>Ultralearning; Scott Young; Thorsons</li> -</ul><br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>The release of DTail 4.0.0</title> - <link href="gemini://foo.zone/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.gmi" /> - <id>gemini://foo.zone/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.gmi</id> - <updated>2022-03-06T18:11:39+00:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>I have recently released DTail 4.0.0 and this blog post goes through all the new goodies. If you want to jump directly to DTail, do it here (there are nice animated gifs which demonstrates the usage pretty well):</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='ThereleaseofDTail400'>The release of DTail 4.0.0</h1><br /> -<br /> -<span class='quote'>Published at 2022-03-06T18:11:39+00:00</span><br /> -<br /> -<pre> - ,_---~~~~~----._ - _,,_,*^____ _____``*g*\"*, - ____ _____ _ _ / __/ /' ^. / \ ^@q f - | _ \_ _|_ _(_) | @f | @)) | | @)) l 0 _/ - | | | || |/ _` | | | \`/ \~____ / __ \_____/ \ - | |_| || | (_| | | | | _l__l_ I - |____/ |_|\__,_|_|_| } [______] I - ] | | | | - ] ~ ~ | - | | - | | -</pre> -<br /> -<span>I have recently released DTail 4.0.0 and this blog post goes through all the new goodies. If you want to jump directly to DTail, do it here (there are nice animated gifs which demonstrates the usage pretty well):</span><br /> -<br /> -<a class='textlink' href='https://dtail.dev'>https://dtail.dev</a><br /> -<br /> -<h2 style='display: inline' id='Sowhatsnewin400'>So, what's new in 4.0.0?</h2><br /> -<br /> -<h3 style='display: inline' id='Rewrittenlogging'>Rewritten logging</h3><br /> -<br /> -<span>For DTail 4, logging has been completely rewritten. The new package name is "internal/io/dlog". I rewrote the logging because DTail is a special case here: There are logs processed by DTail, there are logs produced by the DTail server itself, there are logs produced by a DTail client itself, there are logs only logged by a DTail client, there are logs only logged by the DTail server, and there are logs logged by both, server and client. There are also different logging levels and outputs involved.</span><br /> -<br /> -<span>As you can imagine, it becomes fairly complex. There is no ready Go off-shelf logging library which suits my needs and the logging code in DTail 3 was just one big source code file with global variables and it wasn't sustainable to maintain anymore. So why not rewrite it for profit and fun? </span><br /> -<br /> -<span>There's a are new log level structure now (The log level now can be specified with the "-logLevel" command line flag):</span><br /> -<br /> -<pre> -// Available log levels. -const ( - None level = iota - Fatal level = iota - Error level = iota - Warn level = iota - Info level = iota - Default level = iota - Verbose level = iota - Debug level = iota - Devel level = iota - Trace level = iota - All level = iota -) -</pre> -<br /> -<span>DTail also supports multiple log outputs (e.g. to file or to stdout). More are now easily pluggable with the new logging package. The output can also be "enriched" (default) or "plain" (read more about that further below).</span><br /> -<br /> -<h3 style='display: inline' id='Configurableterminalcolorcodes'>Configurable terminal color codes</h3><br /> -<br /> -<span>A complaint I received from the users of DTail 3 were the terminal colors used for the output. Under some circumstances (terminal configuration) it made the output difficult to read so that users defaulted to "--noColor" (disabling colored output completely). I toke it by heart and also rewrote the color handling. It's now possible to configure the foreground and background colors and an attribute (e.g. dim, bold, ...).</span><br /> -<br /> -<span>The example "dtail.json" configuration file represents the default (now, more reasonable default) color codes used, and it is free to the user to customize them:</span><br /> -<br /> -<pre> -{ - "Client": { - "TermColorsEnable": true, - "TermColors": { - "Remote": { - "DelimiterAttr": "Dim", - "DelimiterBg": "Blue", - "DelimiterFg": "Cyan", - "RemoteAttr": "Dim", - "RemoteBg": "Blue", - "RemoteFg": "White", - "CountAttr": "Dim", - "CountBg": "Blue", - "CountFg": "White", - "HostnameAttr": "Bold", - "HostnameBg": "Blue", - "HostnameFg": "White", - "IDAttr": "Dim", - "IDBg": "Blue", - "IDFg": "White", - "StatsOkAttr": "None", - "StatsOkBg": "Green", - "StatsOkFg": "Black", - "StatsWarnAttr": "None", - "StatsWarnBg": "Red", - "StatsWarnFg": "White", - "TextAttr": "None", - "TextBg": "Black", - "TextFg": "White" - }, - "Client": { - "DelimiterAttr": "Dim", - "DelimiterBg": "Yellow", - "DelimiterFg": "Black", - "ClientAttr": "Dim", - "ClientBg": "Yellow", - "ClientFg": "Black", - "HostnameAttr": "Dim", - "HostnameBg": "Yellow", - "HostnameFg": "Black", - "TextAttr": "None", - "TextBg": "Black", - "TextFg": "White" - }, - "Server": { - "DelimiterAttr": "AttrDim", - "DelimiterBg": "BgCyan", - "DelimiterFg": "FgBlack", - "ServerAttr": "AttrDim", - "ServerBg": "BgCyan", - "ServerFg": "FgBlack", - "HostnameAttr": "AttrBold", - "HostnameBg": "BgCyan", - "HostnameFg": "FgBlack", - "TextAttr": "AttrNone", - "TextBg": "BgBlack", - "TextFg": "FgWhite" - }, - "Common": { - "SeverityErrorAttr": "AttrBold", - "SeverityErrorBg": "BgRed", - "SeverityErrorFg": "FgWhite", - "SeverityFatalAttr": "AttrBold", - "SeverityFatalBg": "BgMagenta", - "SeverityFatalFg": "FgWhite", - "SeverityWarnAttr": "AttrBold", - "SeverityWarnBg": "BgBlack", - "SeverityWarnFg": "FgWhite" - }, - "MaprTable": { - "DataAttr": "AttrNone", - "DataBg": "BgBlue", - "DataFg": "FgWhite", - "DelimiterAttr": "AttrDim", - "DelimiterBg": "BgBlue", - "DelimiterFg": "FgWhite", - "HeaderAttr": "AttrBold", - "HeaderBg": "BgBlue", - "HeaderFg": "FgWhite", - "HeaderDelimiterAttr": "AttrDim", - "HeaderDelimiterBg": "BgBlue", - "HeaderDelimiterFg": "FgWhite", - "HeaderSortKeyAttr": "AttrUnderline", - "HeaderGroupKeyAttr": "AttrReverse", - "RawQueryAttr": "AttrDim", - "RawQueryBg": "BgBlack", - "RawQueryFg": "FgCyan" - } - } - }, - ... -} -</pre> -<br /> -<span>You notice the different sections - these are different contexts:</span><br /> -<br /> -<ul> -<li>Remote: Color configuration for all log lines sent remotely from the server to the client. </li> -<li>Client: Color configuration for all lines produced by a DTail client by itself (e.g. status information).</li> -<li>Server: Color configuration for all lines produced by the DTail server by itself and sent to the client (e.g. server warnings or errors)</li> -<li>MaprTable: Color configuration for the map-reduce table output.</li> -<li>Common: Common color configuration used in various places (e.g. when it's not clear what's the current context of a line).</li> -</ul><br /> -<span>When you do so, make sure that you check your "dtail.json" against the JSON schema file. This is to ensure that you don't configure an invalid color accidentally (requires "jsonschema" to be installed on your computer). Furthermore, the schema file is also a good reference for all possible colors available:</span><br /> -<br /> -<pre> -jsonschema -i dtail.json schemas/dtail.schema.json -</pre> -<br /> -<h3 style='display: inline' id='Serverlessmode'>Serverless mode</h3><br /> -<br /> -<span>All DTail commands can now operate on log files (and other text files) directly without any DTail server running. So there isn't a need anymore to install a DTail server when you are on the target server already anyway, like the following example shows:</span><br /> -<br /> -<pre> -% dtail --files /var/log/foo.log -</pre> -<br /> -<span>or</span><br /> -<br /> -<pre> -% dmap --files /var/log/foo.log --query 'from TABLE select .... outfile result.csv' -</pre> -<br /> -<span>The way it works in Go code is that a connection to a server is managed through an interface and in serverless mode DTail calls through that interface to the server code directly without any TCP/IP and SSH connection made in the background. This means, that the binaries are a bit larger (also ship with the code which normally would be executed by the server) but the increase of binary size is not much.</span><br /> -<br /> -<h3 style='display: inline' id='Shorthandflags'>Shorthand flags</h3><br /> -<br /> -<span>The "--files" from the previous example is now redundant. As a shorthand, It is now possible to do the following instead:</span><br /> -<br /> -<pre> -% dtail /var/log/foo.log -</pre> -<br /> -<span>Of course, this also works with all other DTail client commands (dgrep, dcat, ... etc).</span><br /> -<br /> -<h3 style='display: inline' id='Spartanakaplainmode'>Spartan (aka plain) mode</h3><br /> -<br /> -<span>There's a plain mode, which makes DTail only print out the "plain" text of the files operated on (without any DTail specific enriched output). E.g.:</span><br /> -<br /> -<pre> -% dcat --plain /etc/passwd > /etc/test -% diff /etc/test /etc/passwd # Same content, no diff -</pre> -<br /> -<span>This might be useful if you wanted to post-process the output. </span><br /> -<br /> -<h3 style='display: inline' id='Standardinputpipe'>Standard input pipe</h3><br /> -<br /> -<span>In serverless mode, you might want to process your data in a pipeline. You can do that now too through an input pipe:</span><br /> -<br /> -<pre> -% dgrep --plain --regex 'somethingspecial' /var/log/foo.log | - dmap --query 'from TABLE select .... outfile result.csv' -</pre> -<br /> -<span>Or, use any other "standard" tool:</span><br /> -<br /> -<pre> -% awk '.....' < /some/file | dtail .... -</pre> -<br /> -<h3 style='display: inline' id='Newcommanddtailhealth'>New command dtailhealth</h3><br /> -<br /> -<span>Prior to DTail 4, there was a flag for the "dtail" command to check the health of a remote DTail server (for use with monitoring system such as Nagios). That has been moved out to a separate binary to reduce complexity of the "dtail" command. The following checks whether DTail is operational on the current machine (you could also check a remote instance of DTail server, just adjust the server address).</span><br /> -<br /> -<pre> -% cat check_dtail.sh -#!/bin/sh - -exec /usr/local/bin/dtailhealth --server localhost:2222 -</pre> -<br /> -<h3 style='display: inline' id='Improveddocumentation'>Improved documentation</h3><br /> -<br /> -<span>Some features, such as custom log formats and the map-reduce query language, are now documented. Also, the examples have been updated to reflect the new features added. This also includes the new animated example Gifs (plus documentation how they were created).</span><br /> -<br /> -<span>I must admit that not all features are documented yet:</span><br /> -<br /> -<ul> -<li>Server side scheduled map-reduce queries</li> -<li>Server side continuous map-reduce queries</li> -<li>Some more docs about terminal color customization</li> -<li>Some more docs about log levels</li> -</ul><br /> -<span>That will be added in one of the future releases. </span><br /> -<br /> -<h3 style='display: inline' id='Integrationtestingsuite'>Integration testing suite</h3><br /> -<br /> -<span>DTail comes already with some unit tests, but what's new is a full integration testing suite which covers all common use cases of all the commands (dtail, dcat, dgrep, dmap) with a server backend and also in serverless mode.</span><br /> -<br /> -<span>How are the tests implemented? All integration tests are simply unit tests in the "./integrationtests" folder. They must be explicitly activated with:</span><br /> -<br /> -<pre> -% export DTAIL_INTEGRATION_TEST_RUN_MODE=yes -</pre> -<br /> -<span>Once done, first compile all commands, and then run the integration tests:</span><br /> -<br /> -<pre> -% make -. -. -. -% go clean -testcache -% go test -race -v ./integrationtests -</pre> -<br /> -<h3 style='display: inline' id='Improvedcode'>Improved code</h3><br /> -<br /> -<span>Not that the code quality of DTail has been bad (I have been using Go vet and Go lint for previous releases and will keep using these), but this time I had new tools (such as SonarQube and BlackDuck) in my arsenal to:</span><br /> -<br /> -<ul> -<li>Reduce the complexity of a couple of functions (splitting code up into several smaller functions)</li> -<li>Avoid repeating code (this version of DTail doesn't use Go generics yet, though).</li> -</ul><br /> -<span>Other than that, a lot of other code has been refactored as I saw fit.</span><br /> -<br /> -<h3 style='display: inline' id='Useofmemorypools'>Use of memory pools</h3><br /> -<br /> -<span>DTail makes excessive use of string builder and byte buffer objects. For performance reasons, those are now re-used from memory pools.</span><br /> -<br /> -<h2 style='display: inline' id='Whatsnext'>What's next</h2><br /> -<br /> -<span>DTail 5 won't be released any time soon I guess, but some 4.x.y releases will follow this year fore sure. I can think of:</span><br /> -<br /> -<ul> -<li>New (but backwards compatible) features which don't require a new major version bump (some features have been requested at work internally).</li> -<li>Even more improved documentation.</li> -<li>Dependency updates.</li> -</ul><br /> -<span>I use usually DTail at work, but I have recently installed it on my personal OpenBSD machines too. I might write a small tutorial here (and I might also add the rc scripts as examples to one of the next DTail releases).</span><br /> -<br /> -<span>I am a bit busy at the moment with two other pet projects of mine (one internal work-project, and one personal one, the latter you will read about in the next couple of months). If you have ideas (or even a patch), then please don't hesitate to contact me (either via E-Mail or a request at GitHub).</span><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<span>Other related posts are:</span><br /> -<br /> -<a class='textlink' href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>2021-04-22 DTail - The distributed log tail program</a><br /> -<a class='textlink' href='./2022-03-06-the-release-of-dtail-4.0.0.html'>2022-03-06 The release of DTail 4.0.0 (You are currently reading this)</a><br /> -<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> -<a class='textlink' href='./2023-09-25-dtail-usage-examples.html'>2023-09-25 DTail usage examples</a><br /> -<br /> -<span>Thanks!</span><br /> -<br /> -<span>Paul</span><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>Computer operating systems I use(d)</title> - <link href="gemini://foo.zone/gemfeed/2022-02-04-computer-operating-systems-i-use.gmi" /> - <id>gemini://foo.zone/gemfeed/2022-02-04-computer-operating-systems-i-use.gmi</id> - <updated>2022-02-04T09:58:22+00:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>This is a list of Operating Systems I currently use. This list is in no particular order and also will be updated over time. The very first operating system I used was MS-DOS (mainly for games) and the very first Unix like operating system I used was SuSE Linux 5.3. My first smartphone OS was Symbian on a clunky Sony Ericsson device.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='ComputeroperatingsystemsIused'>Computer operating systems I use(d)</h1><br /> -<br /> -<span class='quote'>Published at 2022-02-04T09:58:22+00:00; Updated at 2022-02-18</span><br /> -<br /> -<pre> - /( )` - \ \___ / | - /- _ `-/ ' - (/\/ \ \ /\ - / / | ` \ - O O ) / | - `-^--'`< ' - (_.) _ ) / - `.___/` / - `-----' / - <----. __ / __ \ - <----|====O)))==) \) /==== - <----' `--' `.__,' \ - | | - \ / - ______( (_ / \______ - (FL) ,' ,-----' | \ - `--{__________) \/ "Berkeley Unix Daemon" -</pre> -<br /> -<span>This is a list of Operating Systems I currently use. This list is in no particular order and also will be updated over time. The very first operating system I used was MS-DOS (mainly for games) and the very first Unix like operating system I used was SuSE Linux 5.3. My first smartphone OS was Symbian on a clunky Sony Ericsson device.</span><br /> -<br /> -<h2 style='display: inline' id='FedoraLinux'>Fedora Linux</h2><br /> -<br /> -<span>Fedora Linux is the operating system I use on my primary (personal) laptop. It's a ThinkPad X1 Carbon Gen. 9. Lenovo which comes along with official Lenovo Linux support. I already noticed hardware firmware updates being installed directly through Fedora from Lenovo. Fedora is a real powerhouse, cutting-edge and reasonably stable at the same time. It's baked by Red Hat.</span><br /> -<br /> -<span>I also use Fedora on my Microsoft Surface Go 2 convertible tablet. Fedora works quite OK (and much better than Windows) on this device. It's also the perfect travel companion.</span><br /> -<br /> -<span>I use the GNOME Desktop on my Fedora boxes. I have memorized and customized a bunch of keyboard shortcuts. But the fact that I mostly work in the terminal (with tmux) makes the Desktop environment I use only secondary.</span><br /> -<br /> -<h2 style='display: inline' id='EndeavourOS'>EndeavourOS</h2><br /> -<br /> -<span>I installed EndeavourOS on my (older) ThinkPad X240 to try out an Arch based Linux distribution. I also could have installed plain Arch, but I don't see the point when there is EndeavourOS. EndeavourOS is as close as you can get to the plain Arch experience but with an easy installer. I am not saying that it's difficult to install plain Arch but it's, unless you are new to Linux and want to learn about the installation procedure, just waste of time in my humble opinion. Give Linux From Scratch a shot instead if you really want to learn about Linux.</span><br /> -<br /> -<a class='textlink' href='https://www.linuxfromscratch.org/'>https://www.linuxfromscratch.org/</a><br /> -<br /> -<span>On EndeavourOS, I use the Xfce desktop environment which feels very snappy and fast on the X240 (which I purchased back in 2014). Usually, I have my X240 standing right next to my work laptop and use it for playing music (mainly online radio streams), for personal note taking and occasional emailing and instant messaging.</span><br /> -<br /> -<span>As this is a rolling Linux distribution there are a lot of software updates coming through every day. Sometimes, it only takes a minute until the next version of a package is available. Honestly, I find that a bit annoying to constantly catch up with all the updates. As for now I will live with it and/or automate it a bit more. It'll be OK if it breaks occasionally, as this is not my primary laptop anyway. </span><br /> -<br /> -<span>Arch Linux and EndeavourOS are community distributions. This means, that there is no big corporation in the backyard lurking around. They won't give you the firmware updates for cutting edge hardware out of the box, though, but they are still a very good choice for hobbyist and also for older hardware where future firmware updates are less likely to happen.</span><br /> -<br /> -<span>I am very happy with the package availability through the official repository and AUR.</span><br /> -<br /> -<a class='textlink' href='https://endeavouros.com/'>https://endeavouros.com/</a><br /> -<br /> -<h2 style='display: inline' id='FreeBSD'>FreeBSD</h2><br /> -<br /> -<span>I have run FreeBSD in many occasions. Right after SuSE Linux, FreeBSD (around 4.x) was the second open source system I used in my life on regular basis. I didn't even go to university yet then I started using it :-). Also, a former employer of mine even allowed me to install FreeBSD on my main workstation (which I actually did and used it for a couple of years). </span><br /> -<br /> -<span>I remember it used to be a pain bootstrapping Java for FreeBSD due to the lack of pre-compiled binary packages. You had first to enable the Linux compatibility layer, then install Linux Java, and then compile FreeBSD Java with the bootstrapped Linux Java (yes, Java is mainly programmed in C++, but for some reason compiling Java for FreeBSD also required an installation of Java). Nowadays, there are ready OpenJDK binary packages you could install. So things have improved a lot since.</span><br /> -<br /> -<span>FreeBSD always had a place somewhere in my life:</span><br /> -<br /> -<ul> -<li>On a Desktop PC (personal and work)</li> -<li>On a Laptop</li> -<li>On a webserver, FTP server, DNS server, mail server</li> -<li>On a server offering FreeBSD jails to customers for rent</li> -<li>As an experiment running Debian GNU/kFreeBSD inside of jails</li> -</ul><br /> -<span>Debian GNU/kFreeBSD is now dead (same is my experiment)...</span><br /> -<br /> -<a class='textlink' href='https://www.debian.org/ports/kfreebsd-gnu/'>https://www.debian.org/ports/kfreebsd-gnu/</a><br /> -<br /> -<span>...but I still have saved and old uname output :-):</span><br /> -<br /> -<pre> -[root@saturn /usr/jail/serv14/etc] # jexec 21 bash -root@rhea:/ # uname -a -GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 27 13:10:09 CET - 2010 root@saturn.buetow.org:/usr/obj/usr/srcs/freebsd.src8/src/sys/SERV10 x86 64 amd64 Intel(R) - Core(TM) i7 CPU 920 @ 2.67GHz GNU/kFreeBSD -</pre> -<br /> -<span>Currently, I use FreeBSD on my personal NAS server. The server is a regular PC with a bunch of hard drives and a ZFS RAIDZ (with 4x2TB drives) + a couple of external backup drives.</span><br /> -<br /> -<a class='textlink' href='https://www.FreeBSD.org'>https://www.FreeBSD.org</a><br /> -<br /> -<h2 style='display: inline' id='CentOS7'>CentOS 7</h2><br /> -<br /> -<span>While CentOS 8 is already out of support, I still use CentOS 7 (which will receive security updates until 2024). CentOS 7 runs in a cloud VM and is the home to my personal NextCloud and Wallabag installations. You probably know already NextCloud. About Wallabag: It is a great free and open source alternative to Pocket (for reading articles from the web offline later). Yes, you can pay for a Wallabag subscription, but you can also host it for free on your own server.</span><br /> -<br /> -<a class='textlink' href='https://nextcloud.com'>NextCloud</a><br /> -<a class='textlink' href='https://www.wallabag.it/en'>Wallabag</a><br /> -<br /> -<span>The reason I use Linux and not *BSD at the moment for these services is Docker. With Docker, it's so easy-peasy to get these up and running. I will have to switch to another OS before CentOS 7 runs out of support, though. It might be CentOS Stream, Rocky Linux, or, more likely, I will use FreeBSD. On FreeBSD there isn't Docker, but what can be done is to create a self-contained Jail for each of the web-apps. </span><br /> -<br /> -<span>I have been using FreeBSD Jails for LAMP stacks before I started using CentOS. The reason why I switched to CentOS (it was still CentOS 6 at that time) in the first place was, that I wanted to try out something new.</span><br /> -<br /> -<a class='textlink' href='https://www.centos.org'>https://www.centos.org</a><br /> -<br /> -<h2 style='display: inline' id='OpenBSD'>OpenBSD</h2><br /> -<br /> -<span>I use two small OpenBSD "cloud" boxes for my "public facing internet front-ends". The services I run here are:</span><br /> -<br /> -<ul> -<li>HTTP server (serving this site via https://foo.zone)</li> -<li>Gemini server (serving this site via gemini://foo.zone)</li> -<li>MTA server (for receiving E-Mails to my hosts)</li> -<li>Authorative DNS server (for all of my "domains")</li> -<li>Some personal/private git repositories (accessible only via SSH)</li> -</ul><br /> -<span>OpenBSD is a complete operating system. I love it due to it's "simplicity" and "correctness" and the good documentation (I love the manual pages in particular). OpenBSD is also known for its innovations in security. I must admin, though, that most Unix like operating system would be secure enough for my personal needs and that I don't really need to use OpenBSD here. But nevertheless, I think it's the ideal operating system for what I am using it for.</span><br /> -<br /> -<span>The only softwares which were not part of the base system and I had to install additionally were the Gemini server (vger) and Git, which both were available as pre-compiled OpenBSD binary packages. So, besides of these two packages, it is indeed a pretty complete operating system for my use case.</span><br /> -<br /> -<a class='textlink' href='https://www.openbsd.org'>https://www.openbsd.org</a><br /> -<br /> -<h2 style='display: inline' id='macOSproprietary'>macOS (proprietary)</h2><br /> -<br /> -<span>I have to use a MacBook Pro with macOS for work. What else can I say but that this would have never been my personal choice. At least macOS is a UNIX under the hood and comes with a decent terminal and there are plenty of terminal apps available via Brew. Some of the inner workings of macOS were actually forked from the FreeBSD project. </span><br /> -<br /> -<a class='textlink' href='https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/BSD/BSD.html'>developer.apple.com: BSD in macOS/Darwin</a><br /> -<br /> -<span>I find the macOS UI rather confusing.</span><br /> -<br /> -<h2 style='display: inline' id='LineageOSmobile'>LineageOS (mobile)</h2><br /> -<br /> -<span>At some point I got fed up with big tech, like Google and Samsung (or Apple, but personally I don't use Apple), spying on me. So I purchased a Google phone (a midrange Pixel phone) and installed LineageOS, a free and open source distribution of Android, on it. I don't have anything from Google installed on it (not even the play store, I install my apps from F-Droid). It's my daily driver since mid 2021 now. </span><br /> -<br /> -<span>So far the experience is not great but good. The main culprits are not having Google Maps, Google Gboard and the camera app. The latter lacks some features on LineageOS (e.g. No wide angle lens support). Also, I can't use my banking apps anymore. Sometimes apps crash for no apparent reason(s) but I get around it so far. I shouldn't spend so much time on my smartphone anyway! And the whole point of switching to LineageOS was to get away of big tech and therefore I should not complain :-). What I do like is that 95% the things I used to do on a proprietary mobile phone also can be done with LineageOS.</span><br /> -<br /> -<a class='textlink' href='./2021-08-01-on-being-pedantic-about-open-source.html'>Read also "The Midle Way" section of this blog post regarding smartphones.</a><br /> -<br /> -<span>There's also the excellent Termux app in the F-Droid store, which transforms the phone into a small Linux handheld device. I am able to run all of my Linux/Unix terminal apps with it.</span><br /> -<br /> -<a class='textlink' href='https://lineageos.org/'>https://lineageos.org/</a><br /> -<a class='textlink' href='https://termux.com/'>https://termux.com/</a><br /> -<br /> -<h2 style='display: inline' id='SamsungsStockAndroidmobileproprietary'>Samsung's Stock Android (mobile proprietary)</h2><br /> -<br /> -<span>Unfortunatley, I still have to keep my proprietary Android phone around. Sometimes, I really need to use some proprietary apps which are only available form the Google play store and also require the Google services installed on the phone. I don't carry this phone around all the time and I only use it intentionally for very specific use cases. I think this is the best compromise I can make.</span><br /> -<br /> -<h2 style='display: inline' id='iOSmobileproprietary'>iOS (mobile proprietary)</h2><br /> -<br /> -<span>I have to use an iPhone for work. I like the hardware but I hate the OS (you can also call it spyOS), but it's the necessarries evil, unfortunately. Apple is even worse than Google here (despite claiming for themselves to produce the most secure phone(s)). I don't have it with me all the time or switched off when I don't need it. I also find iOS quite unintuitive to use.</span><br /> -<br /> -<span>Being on-call for work means to to be reachable 24/7. This implies that the phone is carried around all the time (in an switched-on state). 1984 is now.</span><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Nineteen_Eighty-Four'>https://en.wikipedia.org/wiki/Nineteen_Eighty-Four</a><br /> -<br /> -<h2 style='display: inline' id='OtherOSes'>Other OSes</h2><br /> -<br /> -<h3 style='display: inline' id='InfinyTimesmartwatch'>InfinyTime (smartwatch)</h3><br /> -<br /> -<span>I use it on my PineTime smartwatch. Other than checking the time and my step count, I really don't do anything else fancy with it (yet). </span><br /> -<br /> -<a class='textlink' href='https://www.pine64.org/pinetime/'>https://www.pine64.org/pinetime/</a><br /> -<a class='textlink' href='https://infinitime.io/'>https://infinitime.io/</a><br /> -<br /> -<h3 style='display: inline' id='motionEyeOS'>motionEyeOS</h3><br /> -<br /> -<span>I usually install an army of RaspberryPi 3's in my house before I travel for a prolonged amount of time. All Pi's are equipped with an camera and have motionEyeOS (Linux based video surveillance system) installed. There's a neat Android app in the F-Droid store which let's me keep an eye on everything. I make the Pi's accessible from the internet via reverse SSH tunnels through one of my frontend servers.</span><br /> -<br /> -<a class='textlink' href='https://github.com/ccrisan/motioneyeos'>https://github.com/ccrisan/motioneyeos</a><br /> -<br /> -<h3 style='display: inline' id='KoboOSproprietary'>Kobo OS (proprietary)</h3><br /> -<br /> -<span>I use a Kobo Forma as my e-reader device. I have started to switch off the Wifi and to only sideload DRM free ePubs on it. Even offline, it's a fully capable reader device. I wouldn't like the Kobo to call home to Rakuten. I would love to replace it one day with an open source e-reader alternative like the PineNote. There are also some interesting attempts installing postmarketOS Linux on Kobo devices. The latter boots already, but is far from being usable as a normal e-reader.</span><br /> -<br /> -<a class='textlink' href='https://www.pine64.org/pinenote/'>The PineNote</a><br /> -<a class='textlink' href='https://liliputing.com/2021/07/kobo-clara-hd-becomes-an-e-ink-linux-tablet-with-the-help-of-postmarketos.html'>Kobo Clara HD becomes an e-ink Linux tablet</a><br /> -<br /> -<span>But as a fall-back, someone could still use the good old dead tree format!</span><br /> -<br /> -<h3 style='display: inline' id='AndroidTVproprietary'>Android TV (proprietary)</h3><br /> -<br /> -<span>An Android TV box is used for watching movies and series on Netflix and Amazon Prime video (yes, I am human too and rely once in a while on big tech streaming services). The Android TV box is currently in the process of being replaced by OSMC, though. Most services seem to work fine with OSMC, but didn't get around tinkering with Netflix and Amazon there yet.</span><br /> -<br /> -<a class='textlink' href='https://osmc.tv/'>https://osmc.tv/</a><br /> -<br /> -<h2 style='display: inline' id='OtherOSes'>Other OSes..</h2><br /> -<br /> -<span>This section is just for the sake of having a complete list of all OSes I used for some significant amount of time. I might not use all of them any more...</span><br /> -<br /> -<h3 style='display: inline' id='NetBSD'>NetBSD</h3><br /> -<br /> -<span>I have been using NetBSD on an old Sun Sparcstation 10 as a student. I also have run NetBSD on a very old ThinkPad with 96MB!!! of RAM (even with X/evilWM). I also installed (but never really used) NetBSD on an HP Jornada 680. But that's all more than 10 years ago. I haven't looked at NetBSD for long time. I want to revive it on an "old" ThinkPad T450 of mine which I currently don't use.</span><br /> -<br /> -<a class='textlink' href='https://netbsd.org'>https://netbsd.org</a><br /> -<br /> -<h3 style='display: inline' id='OtherOSesinuse'>Other OSes in use...</h3><br /> -<br /> -<a class='textlink' href='https://sailfish.org'>SailfishOS - Nice mobile OS, but unfortunately includes proprietary components</a><br /> -<a class='textlink' href='https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux'>Red Hat Enterprise Linux - Only for some work stuff</a><br /> -<br /> -<h3 style='display: inline' id='OtherOSesnotusedanymore'>Other OSes not used any more...</h3><br /> -<br /> -<a class='textlink' href='https://en.opensuse.org/Archive:S.u.S.E._Linux_5.3'>SuSE Linux 5.3 - The first Linux OS I used</a><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/IRIX'>SGI's IRIX - On a SGI Onyx 3200</a><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/MeeGo'>MeeGo - On a Nokia N9</a><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Microsoft_Windows'>Microsoft Windows</a><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/MS-DOS'>Microsoft DOS - With and without Windows 3.x</a><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Symbian'>Symbian - The first smartphone OS I used </a><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Wear_OS'>WearOS - On a Google smartwatch</a><br /> -<a class='textlink' href='https://www.debian.org'>Debian GNU/Linux - Rock solid, but atm. I prefer Fedora/EndeavourOS</a><br /> -<a class='textlink' href='https://www.ubuntu.com'>Ubuntu Linux (based on Debian)</a><br /> -<a class='textlink' href='https://www.linuxfromscratch.org/'>Linux from scratch - The best way to learn Linux</a><br /> -<a class='textlink' href='https://www.suse.com/products/server/'>SUSE Linux Enterprise - Only for some work stuff</a><br /> -<br /> -<h3 style='display: inline' id='OtherOSesIonlyhadaglanceat'>Other OSes I only had a glance at...</h3><br /> -<br /> -<a class='textlink' href='https://archiveos.org/opensolaris/'>OpenSolaris - Continuation of the open source version of Solaris</a><br /> -<a class='textlink' href='https://archlinuxarm.org/'>Arch Linux ARM</a><br /> -<a class='textlink' href='https://ecomstation.com/'>eComStation - Continuation of IBM OS/2</a><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Minix'>MINIX</a><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/OpenVMS'>OpenVMS</a><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/OS/2'>IBM OS/2 Warp</a><br /> -<a class='textlink' href='https://freedos.org'>FreeDOS - Open source alternative to DOS</a><br /> -<a class='textlink' href='https://plan9.io/plan9/'>Plan9 </a><br /> -<a class='textlink' href='https://reactos.org/'>ReactOS - A Microsoft Windows open source clone</a><br /> -<a class='textlink' href='https://www.debian.org/ports/hurd/'>Debian GNU/Hurd - Debian on the GNU kernel</a><br /> -<a class='textlink' href='https://www.debian.org/ports/kfreebsd-gnu/'>Debian GNU/kFreeBSD - Debian on the FreeBSD kernel</a><br /> -<a class='textlink' href='https://www.gentoo.org'>Gentoo Linux</a><br /> -<a class='textlink' href='https://www.haiku-os.org/'>Haiku - A BeOS open source clone</a><br /> -<a class='textlink' href='https://www.oracle.com/solaris/solaris11/'>Sun Solaris (now owned by Oracle)</a><br /> -<a class='textlink' href='https://www.puredarwin.org/'>OpenDarwin ("now" PureDarwin) - Open source operating system based on the open parts of macOS</a><br /> -<br /> -<h3 style='display: inline' id='OtherOSeswhichseeminteresting'>Other OSes which seem interesting...</h3><br /> -<br /> -<a class='textlink' href='https://asteroidos.org/'>Asteroids OS - Open source smartphone OS</a><br /> -<a class='textlink' href='https://www.dragonflybsd.org/'>DragonFly BSD - Fork of FreeBSD 4</a><br /> -<a class='textlink' href='http://wiki.postmarketos.org/wiki/Phosh'>Phosh (on postmarketOS) - A true Linux shell for the smartphone</a><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>Welcome to the foo.zone</title> - <link href="gemini://foo.zone/gemfeed/2022-01-23-welcome-to-the-foo.zone.gmi" /> - <id>gemini://foo.zone/gemfeed/2022-01-23-welcome-to-the-foo.zone.gmi</id> - <updated>2022-01-23T16:42:04+00:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>I don't count this as a real blog post, but more of an announcement (I aim to write one real post once monthly). From now on, 'foo.zone' is the new address of this site. All other addresses will still forward to it and eventually (based on the traffic still going through) will be deactivated.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Welcometothefoozone'>Welcome to the foo.zone</h1><br /> -<br /> -<span class='quote'>Published at 2022-01-23T16:42:04+00:00</span><br /> -<br /> -<pre> - __ - / _| ___ ___ _______ _ __ ___ -| |_ / _ \ / _ \ |_ / _ \| '_ \ / _ \ -| _| (_) | (_) | / / (_) | | | | __/ -|_| \___/ \___(_)___\___/|_| |_|\___| - -</pre> -<br /> -<span>I don't count this as a real blog post, but more of an announcement (I aim to write one real post once monthly). From now on, "foo.zone" is the new address of this site. All other addresses will still forward to it and eventually (based on the traffic still going through) will be deactivated.</span><br /> -<br /> -<span>As you can read on Wikipedia, "foo" is, alongside to "bar" and "baz", a metasyntactic variable (you know what I mean if you are a programmer or IT person):</span><br /> -<br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Metasyntactic_variable'>https://en.wikipedia.org/wiki/Metasyntactic_variable</a><br /> -<br /> -<h2 style='display: inline' id='Whatisthefoozone'>What is the foo zone?</h2><br /> -<br /> -<span>It's my personal internet site and blog. Everything you read on this site is my personal opinion and experience. It's not intended to be anything professional. If you want my professional background, then go to my LinkedIn profile.</span><br /> -<br /> -<span>Since I re-booted this blog last year, I struggled to find a good host name for it. I started off with "buetow.org", and later I switched halfway to "snonux.de". Buetow is my last name, and snonux relates to some of my internet nicknames and personal IT projects. I also have a "SnonuxBSD" ASCII-art banner in the motd of my FreeBSD based home-NAS.</span><br /> -<br /> -<span>For a while, I was thinking about a better host name for this site, meeting the following criteria:</span><br /> -<br /> -<ul> -<li>Isn't directly linked to my name or my internet nicknames.</li> -<li>Reflects the "nature" of this site.</li> -<li>Is still pretty generic.</li> -<li>Is "cool".</li> -<li>Is short and easy to remember. </li> -<li>Doesn't cost millions.</li> -</ul><br /> -<span>So I think that foo.zone is the perfect match. It's a bit geeky, but so is this site. The meta-syntactic variable relates to computer science and programming, so does this site. Other than that, staying in this sphere, it's a pretty generic name.</span><br /> -<br /> -<h2 style='display: inline' id='Tobeinthezoneandnotinasurfclub'>To be in the .zone and not in a .surf club</h2><br /> -<br /> -<span>I was pretty happy finding out that foo.zone was still available for registration. I stumbled across it just yesterday while I was playing around with my new authoritative DNS servers. I was actually quite surprised as usually such short SLDs (second level domains), especially "foo", are all taken already.</span><br /> -<br /> -<span>As a funny bit, I almost chose "foo.surf" over "foo.zone" as in "surfing this site", but then decided against it as I would have to tell everyone that I am not into water sports so much. Well, on the other hand, I now may have to explain to non-programmers that I am not a fan of the rock band "Foo Fighters". But that will be acceptable, as I don't expect "normal" people visiting the foo zone as much anyway. If you reached as far, I have to congratulate you. You are not a normal person.</span><br /> -<br /> -<h2 style='display: inline' id='Whataboutmyoldhosts'>What about my old hosts</h2><br /> -<br /> -<span>The host buetow.org will stay. However, not as the primary address for this site. I will keep using it for my personal internet infrastructure as well as for most of my E-Mail addresses. I used buetow.org for that over the past 10 years already anyway and that won't change any time soon. I don't know what I am going to do with snonux.de in the long run. A .de SLD (for Germany) is pretty cheap, so I might just keep it for now. </span><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>Bash Golf Part 2</title> - <link href="gemini://foo.zone/gemfeed/2022-01-01-bash-golf-part-2.gmi" /> - <id>gemini://foo.zone/gemfeed/2022-01-01-bash-golf-part-2.gmi</id> - <updated>2022-01-01T23:36:15+00:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>This is the second blog post about my Bash Golf series. This series is random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='BashGolfPart2'>Bash Golf Part 2</h1><br /> -<br /> -<span class='quote'>Published at 2022-01-01T23:36:15+00:00; Updated at 2022-01-05</span><br /> -<br /> -<pre> - '\ '\ . . |>18>> - \ \ . ' . | - O>> O>> . 'o | - \ .\. .. . | - /\ . /\ . . | - / / . / / .' . | -jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Art by Joan Stark, mod. by Paul Buetow -</pre> -<br /> -<span>This is the second blog post about my Bash Golf series. This series is random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content.</span><br /> -<br /> -<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> -<a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2 (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-12-10-bash-golf-part-3.html'>2023-12-10 Bash Golf Part 3</a><br /> -<br /> -<h2 style='display: inline' id='Redirection'>Redirection</h2><br /> -<br /> -<span>Let's have a closer look at Bash redirection. As you might already know that there are 3 standard file descriptors:</span><br /> -<br /> -<ul> -<li>0 aka stdin (standard input)</li> -<li>1 aka stdout (standard output)</li> -<li>2 aka stderr (standard error output)</li> -</ul><br /> -<span>These are most certainly the ones you are using on regular basis. "/proc/self/fd" lists all file descriptors which are open by the current process (in this case: the current Bash shell itself):</span><br /> -<br /> -<pre> -❯ ls -l /proc/self/fd/ -total 0 -lrwx------. 1 paul paul 64 Nov 23 09:46 0 -> /dev/pts/9 -lrwx------. 1 paul paul 64 Nov 23 09:46 1 -> /dev/pts/9 -lrwx------. 1 paul paul 64 Nov 23 09:46 2 -> /dev/pts/9 -lr-x------. 1 paul paul 64 Nov 23 09:46 3 -> /proc/162912/fd -</pre> -<br /> -<span>The following examples demonstrate two different ways to accomplish the same thing. The difference is that the first command is directly printing out "Foo" to stdout and the second command is explicitly redirecting stdout to its own stdout file descriptor:</span><br /> -<br /> -<pre> -❯ echo Foo -Foo -❯ echo Foo > /proc/self/fd/0 -Foo -</pre> -<br /> -<span class='quote'>Update: A reader pointed out, that the redirection should actually go to <span class='inlinecode'>/proc/self/fd/1</span> and not <span class='inlinecode'>0</span>. But apparently, either way works for this particular example. Do you know why? </span><br /> -<br /> -<span>Other useful redirections are:</span><br /> -<br /> -<ul> -<li>Redirect stderr to stdin: "echo foo 2>&1"</li> -<li>Redirect stdin to stderr: "echo foo >&2"</li> -</ul><br /> -<span>It is, however, not possible to redirect multiple times within the same command. E.g. the following won't work. You would expect stdin to be redirected to stderr and then stderr to be redirected to /dev/null. But as the example shows, Foo is still printed out:</span><br /> -<br /> -<pre> -❯ echo Foo 1>&2 2>/dev/null -Foo -</pre> -<br /> -<span class='quote'>Update: A reader sent me an email and pointed out that the order of the redirections is important. </span><br /> -<br /> -<span>As you can see, the following will not print out anything:</span><br /> -<br /> -<pre> -❯ echo Foo 2>/dev/null 1>&2 -❯ -</pre> -<br /> -<span>A good description (also pointed out by the reader) can be found here:</span><br /> -<br /> -<a class='textlink' href='https://wiki.bash-hackers.org/howto/redirection_tutorial#order_of_redirection_ie_file_2_1_vs_2_1_file'>Order of redirection</a><br /> -<br /> -<span>Ok, back to the original blog post. You can also use grouping here (neither of these commands will print out anything to stdout):</span><br /> -<br /> -<pre> -❯ { echo Foo 1>&2; } 2>/dev/null -❯ ( echo Foo 1>&2; ) 2>/dev/null -❯ { { { echo Foo 1>&2; } 2>&1; } 1>&2; } 2>/dev/null -❯ ( ( ( echo Foo 1>&2; ) 2>&1; ) 1>&2; ) 2>/dev/null -❯ -</pre> -<br /> -<span>A handy way to list all open file descriptors is to use the "lsof" command (that's not a Bash built-in), whereas $$ is the process id (pid) of the current shell process:</span><br /> -<br /> -<pre> -❯ lsof -a -p $$ -d0,1,2 -COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME -bash 62676 paul 0u CHR 136,9 0t0 12 /dev/pts/9 -bash 62676 paul 1u CHR 136,9 0t0 12 /dev/pts/9 -bash 62676 paul 2u CHR 136,9 0t0 12 /dev/pts/9 -</pre> -<br /> -<span>Let's create our own descriptor "3" for redirection to a file named "foo":</span><br /> -<br /> -<pre> -❯ touch foo -❯ exec 3>foo # This opens fd 3 and binds it to file foo. -❯ ls -l /proc/self/fd/3 -l-wx------. 1 paul paul 64 Nov 23 10:10 \ - /proc/self/fd/3 -> /home/paul/foo -❯ cat foo -❯ echo Bratwurst >&3 -❯ cat foo -Bratwurst -❯ exec 3>&- # This closes fd 3. -❯ echo Steak >&3 --bash: 3: Bad file descriptor -</pre> -<br /> -<span>You can also override the default file descriptors, as the following example script demonstrates:</span><br /> -<br /> -<pre> -❯ cat grandmaster.sh -#!/usr/bin/env bash - -# Write a file data-file containing two lines -echo Learn You a Haskell > data-file -echo for Great Good >> data-file - -# Link fd with fd 6 (saves default stdin) -exec 6<&0 - -# Overwrite stdin with data-file -exec < data-file - -# Read the first two lines from it -declare LINE1 LINE2 -read LINE1 -read LINE2 - -# Print them -echo First line: $LINE1 -echo Second line: $LINE2 - -# Restore default stdin and delete fd 6 -exec 0<&6 6<&- -</pre> -<br /> -<span>Let's execute it:</span><br /> -<br /> -<pre> -❯ chmod 750 ./grandmaster.sh -❯ ./grandmaster.sh -First line: Learn You a Haskell -Second line: for Great Good -</pre> -<br /> -<h2 style='display: inline' id='HERE'>HERE</h2><br /> -<br /> -<span>I have mentioned HERE-documents and HERE-strings already in this post. Let's do some more examples. The following "cat" receives a multi line string from stdin. In this case, the input multi line string is a HERE-document. As you can see, it also interpolates variables (in this case the output of "date" running in a subshell).</span><br /> -<br /> -<pre> -❯ cat <<END -> Hello World -> It’s $(date) -> END -Hello World -It's Fri 26 Nov 08:46:52 GMT 2021 -</pre> -<br /> -<span>You can also write it the following way, but that's less readable (it's good for an obfuscation contest):</span><br /> -<br /> -<pre> -❯ <<END cat -> Hello Universe -> It’s $(date) -> END -Hello Universe -It's Fri 26 Nov 08:47:32 GMT 2021 -</pre> -<br /> -<span>Besides of an HERE-document, there is also a so-called HERE-string. Besides of...</span><br /> -<br /> -<pre> -❯ declare VAR=foo -❯ if echo "$VAR" | grep -q foo; then -> echo '$VAR ontains foo' -> fi -$VAR ontains foo -</pre> -<br /> -<span>...you can use a HERE-string like that:</span><br /> -<br /> -<pre> -❯ if grep -q foo <<< "$VAR"; then -> echo '$VAR contains foo' -> fi -$VAR contains foo -</pre> -<br /> -<span>Or even shorter, you can do:</span><br /> -<br /> -<pre> -❯ grep -q foo <<< "$VAR" && echo '$VAR contains foo' -$VAR contains foo -</pre> -<br /> -<span>You can also use a Bash regex to accomplish the same thing, but the points of the examples so far were to demonstrate HERE-{documents,strings} and not Bash regular expressions:</span><br /> -<br /> -<pre> -❯ if [[ "$VAR" =~ foo ]]; then echo yay; fi -yay -</pre> -<br /> -<span>You can also use it with "read":</span><br /> -<br /> -<pre> -❯ read a <<< ja -❯ echo $a -ja -❯ read b <<< 'NEIN!!!' -❯ echo $b -NEIN!!! -❯ dumdidumstring='Learn you a Golang for Great Good' -❯ read -a words <<< "$dumdidumstring" -❯ echo ${words[0]} -Learn -❯ echo ${words[3]} -Golang -</pre> -<br /> -<span>The following is good for an obfuscation contest too:</span><br /> -<br /> -<pre> -❯ echo 'I like Perl too' > perllove.txt -❯ cat - perllove.txt <<< "$dumdidumstring" -Learn you a Golang for Great Good -I like Perl too -</pre> -<br /> -<h2 style='display: inline' id='RANDOM'>RANDOM</h2><br /> -<br /> -<span>Random is a special built-in variable containing a different pseudo random number each time it's used.</span><br /> -<br /> -<pre> -❯ echo $RANDOM -11811 -❯ echo $RANDOM -14997 -❯ echo $RANDOM -9104 -</pre> -<br /> -<span>That's very useful if you want to randomly delay the execution of your scripts when you run it on many servers concurrently, just to spread the server load (which might be caused by the script run) better.</span><br /> -<br /> -<span>Let's say you want to introduce a random delay of 1 minute. You can accomplish it with:</span><br /> -<br /> -<pre> -❯ cat ./calc_answer_to_ultimate_question_in_life.sh -#!/usr/bin/env bash - -declare -i MAX_DELAY=60 - -random_delay () { - local -i sleep_for=$((RANDOM % MAX_DELAY)) - echo "Delaying script execution for $sleep_for seconds..." - sleep $sleep_for - echo 'Continuing script execution...' -} - -main () { - random_delay - # From here, do the real work. Calculating the answer to - # the ultimate question can take billions of years.... - : .... -} - -main - -❯ -❯ ./calc_answer_to_ultimate_question_in_life.sh -Delaying script execution for 42 seconds... -Continuing script execution... -</pre> -<br /> -<h2 style='display: inline' id='setxandseteandpipefile'>set -x and set -e and pipefile</h2><br /> -<br /> -<span>In my opinion, -x and -e and pipefile are the most useful Bash options. Let's have a look at them one after another.</span><br /> -<br /> -<h3 style='display: inline' id='x'>-x</h3><br /> -<br /> -<span>-x prints commands and their arguments as they are executed. This helps to develop and debug your Bash code:</span><br /> -<br /> -<pre> -❯ set -x -❯ square () { local -i num=$1; echo $((num*num)); } -❯ num=11; echo "Square of $num is $(square $num)" -+ num=11 -++ square 11 -++ local -i num=11 -++ echo 121 -+ echo 'Square of 11 is 121' -Square of 11 is 121 -</pre> -<br /> -<span>You can also set it when calling an external script without modifying the script itself:</span><br /> -<br /> -<pre> -❯ bash -x ./half_broken_script_to_be_debugged.sh -</pre> -<br /> -<span>Let's do that on one of the example scripts we covered earlier:</span><br /> -<br /> -<pre> -❯ bash -x ./grandmaster.sh -+ bash -x ./grandmaster.sh -+ echo Learn You a Haskell -+ echo for Great Good -+ exec -+ exec -+ declare LINE1 LINE2 -+ read LINE1 -+ read LINE2 -+ echo First line: Learn You a Haskell -First line: Learn You a Haskell -+ echo Second line: for Great Good -Second line: for Great Good -+ exec -❯ -</pre> -<br /> -<h3 style='display: inline' id='e'>-e</h3><br /> -<br /> -<span>This is a very important option you want to use when you are paranoid. This means, you should always "set -e" in your scripts when you need to make absolutely sure that your script runs successfully (with that I mean that no command should exit with an unexpected status code).</span><br /> -<br /> -<span>Ok, let's dig deeper:</span><br /> -<br /> -<pre> -❯ help set | grep -- -e - -e Exit immediately if a command exits with a non-zero status. -</pre> -<br /> -<span>As you can see in the following example, the Bash terminates after the execution of "grep" as "foo" is not matching "bar". Therefore, grep exits with 1 (unsuccessfully) and the shell aborts. And therefore, "bar" will not be printed out anymore:</span><br /> -<br /> -<pre> -❯ bash -c 'set -e; echo hello; grep -q bar <<< foo; echo bar' -hello -❯ echo $? -1 -</pre> -<br /> -<span>Whereas the outcome changes when the regex matches:</span><br /> -<br /> -<pre> -❯ bash -c 'set -e; echo hello; grep -q bar <<< barman; echo bar' -hello -bar -❯ echo $? -0 -</pre> -<br /> -<span>So does it mean that grep will always make the shell terminate whenever its exit code isn't 0? This will render "set -e" quite unusable. Frankly, there are other commands where an exit status other than 0 should not terminate the whole script abruptly. Usually, what you want is to branch your code based on the outcome (exit code) of a command:</span><br /> -<br /> -<pre> -❯ bash -c 'set -e -> grep -q bar <<< foo -> if [ $? -eq 0 ]; then -> echo "matching" -> else -> echo "not matching" -> fi' -❯ echo $? -1 -</pre> -<br /> -<span>...but the example above won't reach any of the branches and won't print out anything, as the script terminates right after grep.</span><br /> -<br /> -<span>The proper solution is to use grep as an expression in a conditional (e.g. in an if-else statement):</span><br /> -<br /> -<pre> -❯ bash -c 'set -e -> if grep -q bar <<< foo; then -> echo "matching" -> else -> echo "not matching" -> fi' -not matching -❯ echo $? -0 -❯ bash -c 'set -e -> if grep -q bar <<< barman; then -> echo "matching" -> else -> echo "not matching" -> fi' -matching -❯ echo $? -0 -</pre> -<br /> -<span>You can also temporally undo "set -e" if there is no other way:</span><br /> -<br /> -<pre> -❯ cat ./e.sh -#!/usr/bin/env bash - -set -e - -foo () { - local arg="$1"; shift - - if [ -z "$arg" ]; then - arg='You!' - fi - echo "Hello $arg" -} - -bar () { - # Temporally disable e - set +e - local arg="$1"; shift - # Enable e again. - set -e - - if [ -z "$arg" ]; then - arg='You!' - fi - echo "Hello $arg" -} - -# Will succeed -bar World -foo Universe -bar - -# Will terminate the script -foo - -❯ ./e.sh -Hello World -Hello Universe -Hello You! -</pre> -<br /> -<span>Why does calling "foo" with no arguments make the script terminate? Because as no argument was given, the "shift" won't have anything to do as the argument list $@ is empty, and therefore "shift" fails with a non-zero status.</span><br /> -<br /> -<span>Why would you want to use "shift" after function-local variable assignments? Have a look at my personal Bash coding style guide for an explanation :-):</span><br /> -<br /> -<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>./2021-05-16-personal-bash-coding-style-guide.html</a><br /> -<br /> -<h3 style='display: inline' id='pipefail'>pipefail</h3><br /> -<br /> -<span>The pipefail option makes it so that not only the exit code of the last command of the pipe counts regards its exit code but any command of the pipe:</span><br /> -<br /> -<pre> -❯ help set | grep pipefail -A 2 - pipefail the return value of a pipeline is the status of - the last command to exit with a non-zero status, - or zero if no command exited with a non-zero status -</pre> -<br /> -<span>The following greps for paul in passwd and converts all lowercase letters to uppercase letters. The exit code of the pipe is 0, as the last command of the pipe (converting from lowercase to uppercase) succeeded:</span><br /> -<br /> -<pre> -❯ grep paul /etc/passwd | tr '[a-z]' '[A-Z]' -PAUL:X:1000:1000:PAUL BUETOW:/HOME/PAUL:/BIN/BASH -❯ echo $? -0 -</pre> -<br /> -<span>Let's look at another example, where "TheRock" doesn't exist in the passwd file. However, the pipes exit status is still 0 (success). This is so because the last command ("tr" in this case) still succeeded. It is just that it didn't get any input on stdin to process:</span><br /> -<br /> -<pre> -❯ grep TheRock /etc/passwd -❯ echo $? -1 -❯ grep TheRock /etc/passwd | tr '[a-z]' '[A-Z]' -❯ echo $? -0 -</pre> -<br /> -<span>To change this behaviour, pipefile can be used. Now, the pipes exit status is 1 (fail), because the pipe contains at least one command (in this case grep) which exited with status 1:</span><br /> -<br /> -<pre> -❯ set -o pipefail -❯ grep TheRock /etc/passwd | tr '[a-z]' '[A-Z]' -❯ echo $? -1 -</pre> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<span>Other related posts are:</span><br /> -<br /> -<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>2021-05-16 Personal Bash coding style guide</a><br /> -<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> -<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> -<a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2 (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-12-10-bash-golf-part-3.html'>2023-12-10 Bash Golf Part 3</a><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>How to stay sane as a DevOps person </title> - <link href="gemini://foo.zone/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.gmi" /> - <id>gemini://foo.zone/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.gmi</id> - <updated>2021-12-26T12:02:02+00:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>Log4shell (CVE-2021-44228) made it clear, once again, that working in information technology is not an easy job (especially when you are a DevOps person). I thought it would be interesting to summarize a few techniques to help you to relax.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='HowtostaysaneasaDevOpsperson'>How to stay sane as a DevOps person </h1><br /> -<br /> -<span class='quote'>Published at 2021-12-26T12:02:02+00:00; Updated at 2022-01-12</span><br /> -<br /> -<pre> - ) - ) (( ( - ( )) ) - ) ) // ( - _ ( __ ( ~->> - ,-----' |__,_~~___<'__`)-~__--__-~->> < - | // : | -__ ~__ o)____)),__ - '> >- > - | // : |- \_ \ -\_\ -\ \ \ ~\_ \ ->> - , >> - | // : |_~_\ -\__\ \~'\ \ \, \__ . -<- >> - `-----._| ` -__`-- - ~~ -- ` --~> > - _/___\_ //)_`// | ||] - _____[_______]_[~~-_ (.L_/ || - [____________________]' `\_,/'/ - ||| / ||| ,___,'./ - ||| \ |||,'______| - ||| / /|| I==|| - ||| \ __/_|| __||__ ------||-/------`-._/||-o--o---o--- - ~~~~~' -</pre> -<br /> -<span>Log4shell (CVE-2021-44228) made it clear, once again, that working in information technology is not an easy job (especially when you are a DevOps person). I thought it would be interesting to summarize a few techniques to help you to relax.</span><br /> -<br /> -<span>(PS: When I mean DevOps, I also mean Site Reliability Engineers and Sysadmins. I believe SRE, DevOps Engineer and Sysadmin are just synonym titles for the same job).</span><br /> -<br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Log4Shell'>https://en.wikipedia.org/wiki/Log4Shell</a><br /> -<br /> -<h2 style='display: inline' id='Setclearexpectations'>Set clear expectations</h2><br /> -<br /> -<span>It's important to set clear expectations. It can be difficult to guess what others expect or don't expect from you. If you know exactly what you are supposed to do, you can work towards a specific goal and don't worry about all the other noise so much.</span><br /> -<br /> -<span>However, if you are in a more senior position, it is expected from you to plan your tasks by yourself to a large degree and also be flexible, so you can react quickly to new situations (e.g. resolving incidents). Also, to a large degree, you have to prioritise your work by yourself. This can overthrow all of your plans. In extreme cases, it can help to share your plans with your team so that everyone is on the same page. Afterwards, be the execution machine. People are happy when they see that stuff gets done. Communicate clearly all critical work you do. This will capture all the technical debt there might be. It does not help in the long run if things are fixed in the background without any visibility. </span><br /> -<br /> -<span>Due to politeness, many people are not setting clear expectations. I personally may sound sometimes "too German" when setting expectations, but so far nobody complained, and I have even received positive feedback about it.</span><br /> -<br /> -<h2 style='display: inline' id='Alwaysrespondtorequestsbutsetexpectationsandboundaries'>Always respond to requests but set expectations and boundaries</h2><br /> -<br /> -<span>There are many temptations to get side-tracked by other projects and/or issues. It is important to set boundaries here. But always answer to all requests as nothing is more frustrating than asking a person and never getting any answer back. This is especially the case when everyone is working form home where people are using tools such as Slack and E-Mail for most of their communications.</span><br /> -<br /> -<h3 style='display: inline' id='Dealingwithrequests'>Dealing with requests</h3><br /> -<br /> -<span>If the request is urgent, and you have the capacity to help, probably you should help. If it's not urgent, maybe ask to pospone the request (e.g. ask to create a ticket, so that someone from your team can work on it later).</span><br /> -<br /> -<span>If the request is urgent, but you don't have the knowledge or the capacity to help, try to defer to a colleague who might be able to help. You could also provide some quick tips and hints, so that the requester can resolve the issue by himself. Make it transparent why you might not have the time right now, as this can help the person to review his own priorities or to escalate. </span><br /> -<br /> -<h3 style='display: inline' id='Escalationisonlyatool'>Escalation is only a tool</h3><br /> -<br /> -<span>Never make or take an escalation personally. The only forms of escalation should be due to technical issues or lack of resources. An escalation then becomes like a math equation and does not need human resources involved. So de-facto, an escalation is nothing negative, but just a process people can follow to form decision-making. In a good company escalations tend to be an exception, though. Staff knows how to deal with the things by themselves without bothering management too much. </span><br /> -<br /> -<h2 style='display: inline' id='Thinkpositively'>Think positively</h2><br /> -<br /> -<span>If times are very stressful, think that it could always be worse:</span><br /> -<br /> -<ul> -<li>Nobody is dying, we are only doing some IT stuff.</li> -<li>Your time after work is your own time, look forward to time with your family or a nice dinner or your favourite sports class.</li> -<li>You probably will never run out of work in the IT sector. So you will always be able to make a living.</li> -<li>Your IT job and life is actually pretty good (compared to a homeless person for example). You are probably part of the world's top 1% regarding life standard.</li> -</ul><br /> -<h2 style='display: inline' id='Goslowerevenifyoucouldgofaster'>Go slower even if you could go faster</h2><br /> -<br /> -<span>When working in a team, you may feel that you could get done things faster when you just did everything by yourself. This can be a bit frustrating at times, as you might need to work late hours and also might need to explain things over and over again to others. Also, you could be the one who needs to get things explained over and over again as you are not so familiar with the topic (yet). You will appreciate it if the other person is slowing down for you a bit.</span><br /> -<br /> -<h3 style='display: inline' id='Youworkinateam'>You work in a team</h3><br /> -<br /> -<span>Security is a team sport. So slow down and make sure that everyone is on track with the goals. You can go full-speed with your very own subtasks, though. Not everyone knows how to use all the tools so well like a full-time DevOps person. As a DevOps person, you are not a security expert, though. Security experts are different people in your company, but DevOps will be the main tribe deploying mitigations (following the security recommendations) and management will be the main tribe coordinating all the efforts. </span><br /> -<br /> -<span>So even if you think that you can do everything faster by your own, can you really? You probably don't know what you don't know about IT security. The more you know about it, the more you know about what you don't know.</span><br /> -<br /> -<h3 style='display: inline' id='Dontrush'>Don't rush</h3><br /> -<br /> -<span>Slowing down also helps to prevent errors. Don't rush your tasks, even if they are urgent. Try to be quick, but don't rush them. Maybe you are writing a script to mitigate a production issue. You could others peer review that script, for example. Their primary programming language may not be the same (e.g. Golang vs Perl), but they would understand the logic. Or ask another DevOps person from your company with good scripting skills review your mitigation, but he then may lack the domain knowledge of the software you are patching. So in either case, the review will take a bit longer as the reviewer might not be an expert in everything.</span><br /> -<br /> -<span>So relax, don't always expect immediate results. Set clear and reasonable timelines for the management about the mitigations. You are not a superhero who has to do everything by yourself. Sometimes, you will miss a deadline. But that will have good reasons. Don't rush to complete just to meet a deadline. </span><br /> -<br /> -<a class='textlink' href='./2021-10-22-defensive-devops.html'>Read also "Defensive DevOps" about deploying mitigation scripts.</a><br /> -<br /> -<h2 style='display: inline' id='Youarenotasuperhero'>You are not a superhero</h2><br /> -<br /> -<span>Always keep that in mind. You can't solve all problems by your own. Maybe you could, but that would be a lot of additional stress (and this will reflect to your personal life). Also, Superman and Wonder Woman receive much higher salaries than you will ever do ;-).</span><br /> -<br /> -<span>I have been a superhero multiple times mitigating critical incidents, and I was proud about it in those moments. But actually, I am not proud looking at those retrospectively as for everything there should be other people around who should be able to resolve an incident. No company should rely on a single person, there must always be a substitute. You are not a superhero and as harsh as it sounds, everyone is replaceable. Every superhero can be replaced with another superhero. The only thing it takes to become a superhero is time to get to know the infrastructure and tools very well, paired with work dedication.</span><br /> -<br /> -<span>This doesn't mean, that you shouldn't try your best. But you don't need to try to be the superhero. Maybe someone else will be the superhero, but that's OK as long as it's not always the same person every time. Everyone can have a good day after all. If I could choose between being a superhero or having a good night sleep, I would probably prefer the sleep. </span><br /> -<br /> -<h3 style='display: inline' id='Giveawaysomeofyoursuperpowers'>Give away some of your superpowers</h3><br /> -<br /> -<span>If you are a superhero, try to give away some of your superpowers, so that you can relax in the evening knowing that others (e.g. the current on-call engineers) know how to tackle things. Every member of the team needs to do DevOps (even the team managers, in my humble opinion). Some may be less experienced than others or have other expertises, but to counteract this you could document the recurring tasks so that they are easy to follow (which then later could be either automated away or, even better, fully fixed).</span><br /> -<br /> -<span>On the other side, if you are a DevOps person, try to sneak into other people's shoes too. For example, you might not be an expert in Java programming, but a lot of the infrastructure is programmed in Java. This is where usually the Software Developers and Engineers shine. But if you know how to read, debug and even extend Java code too (by learning from the Software Developer superheroes), then your will only benefit from it. </span><br /> -<br /> -<span>So you are not a superhero. Or, if you are a superhero, then all colleagues should be superheroes too.</span><br /> -<br /> -<h2 style='display: inline' id='Dontjumponallproblemsimmediately'>Don't jump on all problems immediately</h2><br /> -<br /> -<span>In a perfect world, every member of a team comes along with the same strengths and skills. But in reality, everyone is different. </span><br /> -<br /> -<span>In order to distribute the troubleshooting skills across the team, you should not jump on every problem immediately. Leave some space for others to resolve the issue. This is where the best learning happens. Nobody will learn from you when you solve all problems. People might learn something after you explained what you did, but the takeaways will be minimal compared to when people try to resolve issues by themselves. Always be available for questions which will help your colleagues to steer into the right direction and if you think it helps, give them some tips resolving the issue, even if they didn't ask for it. Sometimes, engineers are too proud to ask. </span><br /> -<br /> -<span>The whole paragraph changes when there is an issue you don't know how to resolve. Jump on it, so you can learn from it. But also ask for advice if you are unsure about it.</span><br /> -<br /> -<span>If the issue is a very critical one, then you might better off trying to resolve it as fast as possible with your full powers in order to avoid any major damage to the company. This, of course, only works if you know how to resolve it quickly. So, don't leave others with not much experience yet looking at it. If possible, work with the team to resolve the issue. Unfortunately, solving it with the team is not always the fastest way. So in this particular circumstance, the company may be better off being saved by a single superhero. Make sure that the problem will not occur again or, at least, that others can fix it the next time without Superman flying by.</span><br /> -<br /> -<h2 style='display: inline' id='Forcebreaksandshutdownnow'>Force breaks; and shutdown now</h2><br /> -<br /> -<span>Be strict about your time off. Nowadays, tech workers check their messages also out of office hours and are reachable 24/7. This really should only be the case when you are on-call, to be honest (or if you work for a startup). All other out-of-office time is owned by you and not your employer. You have signed an 40 hour/week and not 7 days/week contract. Of course, there will be always some sort of flexibility and exceptions. You might need to work over the weekend to get a migration done or a problem solved. But to balance it out, you should have other days off as substitutes.</span><br /> -<br /> -<span>It's important to shut down your brain from work during your breaks (be strict with your breaks, leave your desk for lunch or for a walk early afternoon and if you aren't on-call also don't take your work-phone with you). You will be happier and also much more energized and productive in the afternoon. Also, when you are reachable 24/7, your colleagues will start thinking that you don't have anything more important to do than work.</span><br /> -<br /> -<h2 style='display: inline' id='Blocktimeeverydayforpersonaladvance'>Block time every day for personal advance</h2><br /> -<br /> -<span>It does not matter how many tasks are in your backlog or how many issues are to be tackled. *Always* find time for personal advance. The most issues aren't critical anyway and can wait a bit. At the end of the day, you will have a nice feeling that you have accomplished something meaningful. This can be an interesting project or learning a new technology you are interested in. Of course, there must be consensus with your manager (unless you do that kind of thing in your personal time of course). </span><br /> -<br /> -<span>If you are too busy at work and just can't block time, then maybe it's time to think about alternatives. But before you do that, probably there is something else you can do. Perhaps you just think you can't block time, but you would be positively surprised to hear from your manager that he will fully support you. Of course, he won't agree to you working full-time on your pet projects. But a certain portion of your time should be allocated for personal advance. After all, your employer also want's you to stay happy so that you don't look for alternatives. It's of everyone's interest that you like your job and stay motivated. The more you are motivated, the more productive you are. The more productive you are, the more valuable you are for the company.</span><br /> -<br /> -<h2 style='display: inline' id='More'>More</h2><br /> -<br /> -<span>Another blog post worth reading:</span><br /> -<br /> -<a class='textlink' href='https://unixsheikh.com/articles/how-to-stay-sane-in-todays-world-of-tech.html'>https://unixsheikh.com/articles/how-to-stay-sane-in-todays-world-of-tech.html</a><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> </feed> diff --git a/gemfeed/f3s-kubernetes-with-freebsd-part-1/diagram.png b/gemfeed/f3s-kubernetes-with-freebsd-part-1/diagram.png Binary files differnew file mode 100644 index 00000000..fa6b655a --- /dev/null +++ b/gemfeed/f3s-kubernetes-with-freebsd-part-1/diagram.png diff --git a/gemfeed/f3s-kubernetes-with-freebsd-part-1/f3slogo.png b/gemfeed/f3s-kubernetes-with-freebsd-part-1/f3slogo.png Binary files differnew file mode 100644 index 00000000..cc45b40e --- /dev/null +++ b/gemfeed/f3s-kubernetes-with-freebsd-part-1/f3slogo.png diff --git a/gemfeed/f3s-kubernetes-with-freebsd-part-2/3beelinks.jpg b/gemfeed/f3s-kubernetes-with-freebsd-part-2/3beelinks.jpg Binary files differnew file mode 100644 index 00000000..7da37da7 --- /dev/null +++ b/gemfeed/f3s-kubernetes-with-freebsd-part-2/3beelinks.jpg diff --git a/gemfeed/f3s-kubernetes-with-freebsd-part-2/f3s-collage1.jpg b/gemfeed/f3s-kubernetes-with-freebsd-part-2/f3s-collage1.jpg Binary files differnew file mode 100644 index 00000000..294eb37d --- /dev/null +++ b/gemfeed/f3s-kubernetes-with-freebsd-part-2/f3s-collage1.jpg diff --git a/gemfeed/f3s-kubernetes-with-freebsd-part-2/f3s-collage2.jpg b/gemfeed/f3s-kubernetes-with-freebsd-part-2/f3s-collage2.jpg Binary files differnew file mode 100644 index 00000000..77c4c0bc --- /dev/null +++ b/gemfeed/f3s-kubernetes-with-freebsd-part-2/f3s-collage2.jpg diff --git a/gemfeed/f3s-kubernetes-with-freebsd-part-2/switch.jpg b/gemfeed/f3s-kubernetes-with-freebsd-part-2/switch.jpg Binary files differnew file mode 100644 index 00000000..8fe0edeb --- /dev/null +++ b/gemfeed/f3s-kubernetes-with-freebsd-part-2/switch.jpg diff --git a/gemfeed/f3s-kubernetes-with-freebsd-part-2/watt.jpg b/gemfeed/f3s-kubernetes-with-freebsd-part-2/watt.jpg Binary files differnew file mode 100644 index 00000000..e79fe68c --- /dev/null +++ b/gemfeed/f3s-kubernetes-with-freebsd-part-2/watt.jpg diff --git a/gemfeed/f3s-kubernetes-with-freebsd-part-3/apc-back-ups.jpg b/gemfeed/f3s-kubernetes-with-freebsd-part-3/apc-back-ups.jpg Binary files differnew file mode 100644 index 00000000..15b1ca78 --- /dev/null +++ b/gemfeed/f3s-kubernetes-with-freebsd-part-3/apc-back-ups.jpg diff --git a/gemfeed/f3s-kubernetes-with-freebsd-part-3/f3s-changes.jpg b/gemfeed/f3s-kubernetes-with-freebsd-part-3/f3s-changes.jpg Binary files differnew file mode 100644 index 00000000..5752f2fc --- /dev/null +++ b/gemfeed/f3s-kubernetes-with-freebsd-part-3/f3s-changes.jpg diff --git a/gemfeed/index.gmi b/gemfeed/index.gmi index 202f2449..81d253c9 100644 --- a/gemfeed/index.gmi +++ b/gemfeed/index.gmi @@ -2,9 +2,20 @@ ## To be in the .zone! +=> ./2025-02-08-random-weird-things-ii.gmi 2025-02-08 - Random Weird Things - Part Ⅱ +=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 - f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts +=> ./2025-01-15-working-with-an-sre-interview.gmi 2025-01-15 - Working with an SRE Interview +=> ./2025-01-01-posts-from-october-to-december-2024.gmi 2025-01-01 - Posts from October to December 2024 +=> ./2024-12-15-random-helix-themes.gmi 2024-12-15 - Random Helix Themes +=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 - f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation +=> ./2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi 2024-11-17 - f3s: Kubernetes with FreeBSD - Part 1: Setting the stage +=> ./2024-10-24-staff-engineer-book-notes.gmi 2024-10-24 - 'Staff Engineer' book notes +=> ./2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.gmi 2024-10-02 - Gemtexter 3.0.0 - Let's Gemtext again⁴ +=> ./2024-09-07-site-reliability-engineering-part-4.gmi 2024-09-07 - Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers +=> ./2024-09-07-projects-i-support.gmi 2024-09-07 - Projects I financially support => ./2024-08-05-typing-127.1-words-per-minute.gmi 2024-08-05 - Typing `127.1` words per minute (`>100wpm average`) => ./2024-07-07-the-stoic-challenge-book-notes.gmi 2024-07-07 - 'The Stoic Challenge' book notes -=> ./2024-07-05-random-weird-things.gmi 2024-07-05 - Random Weird Things +=> ./2024-07-05-random-weird-things.gmi 2024-07-05 - Random Weird Things - Part Ⅰ => ./2024-06-23-terminal-multiplexing-with-tmux.gmi 2024-06-23 - Terminal multiplexing with `tmux` => ./2024-05-03-projects-i-currently-dont-have-time-for.gmi 2024-05-03 - Projects I currently don't have time for => ./2024-05-01-slow-productivity-book-notes.gmi 2024-05-01 - 'Slow Productivity' book notes @@ -12,9 +23,9 @@ => ./2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.gmi 2024-03-03 - A fine Fyne Android app for quickly logging ideas programmed in Go => ./2024-02-04-from-babylon5.buetow.org-to-.cloud.gmi 2024-02-04 - From `babylon5.buetow.org` to `*.buetow.cloud` => ./2024-01-13-one-reason-why-i-love-openbsd.gmi 2024-01-13 - One reason why I love OpenBSD -=> ./2024-01-09-site-reliability-engineering-part-3.gmi 2024-01-09 - Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect +=> ./2024-01-09-site-reliability-engineering-part-3.gmi 2024-01-09 - Site Reliability Engineering - Part 3: On-Call Culture => ./2023-12-10-bash-golf-part-3.gmi 2023-12-10 - Bash Golf Part 3 -=> ./2023-11-19-site-reliability-engineering-part-2.gmi 2023-11-19 - Site Reliability Engineering - Part 2: Operational Balance in SRE +=> ./2023-11-19-site-reliability-engineering-part-2.gmi 2023-11-19 - Site Reliability Engineering - Part 2: Operational Balance => ./2023-11-11-mind-management-book-notes.gmi 2023-11-11 - 'Mind Management' book notes => ./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.gmi 2023-10-29 - KISS static web photo albums with `photoalbum.sh` => ./2023-09-25-dtail-usage-examples.gmi 2023-09-25 - DTail usage examples @@ -24,7 +35,6 @@ => ./2023-06-01-kiss-server-monitoring-with-gogios.gmi 2023-06-01 - KISS server monitoring with Gogios => ./2023-05-06-the-obstacle-is-the-way-book-notes.gmi 2023-05-06 - 'The Obstacle is the Way' book notes => ./2023-05-01-unveiling-guprecords:-uptime-records-with-raku.gmi 2023-05-01 - Unveiling `guprecords.raku`: Global Uptime Records with Raku -=> ./2023-04-09-algorithms-and-data-structures-in-golang-part-1.gmi 2023-04-09 - Algorithms and Data Structures in Go - Part 1 => ./2023-04-01-never-split-the-difference-book-notes.gmi 2023-04-01 - 'Never split the difference' book notes => ./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi 2023-03-25 - Gemtexter 2.0.0 - Let's Gemtext again² => ./2023-03-16-the-pragmatic-programmer-book-notes.gmi 2023-03-16 - 'The Pragmatic Programmer' book notes @@ -65,5 +75,6 @@ => ./2010-05-09-the-fype-programming-language.gmi 2010-05-09 - The Fype Programming Language => ./2010-05-07-lazy-evaluation-with-standarn-ml.gmi 2010-05-07 - Lazy Evaluation with Standard ML => ./2010-04-09-standard-ml-and-haskell.gmi 2010-04-09 - Standard ML and Haskell +=> ./2009-02-13-sgi-onyx-3200.gmi 2009-02-13 - SGI Onyx 3200 => ./2008-12-29-using-my-nokia-n95-for-fixing-my-mta.gmi 2008-12-29 - Using my Nokia N95 for fixing my MTA => ./2008-06-26-perl-poetry.gmi 2008-06-26 - Perl Poetry diff --git a/gemfeed/random-weird-things-ii/css-conway.png b/gemfeed/random-weird-things-ii/css-conway.png Binary files differnew file mode 100644 index 00000000..c29d1d8b --- /dev/null +++ b/gemfeed/random-weird-things-ii/css-conway.png diff --git a/gemfeed/random-weird-things-ii/go-font-code.png b/gemfeed/random-weird-things-ii/go-font-code.png Binary files differnew file mode 100644 index 00000000..630cccfe --- /dev/null +++ b/gemfeed/random-weird-things-ii/go-font-code.png diff --git a/gemfeed/random-weird-things-ii/sqlite-gem.png b/gemfeed/random-weird-things-ii/sqlite-gem.png Binary files differnew file mode 100644 index 00000000..f3c3ceb6 --- /dev/null +++ b/gemfeed/random-weird-things-ii/sqlite-gem.png diff --git a/gemfeed/sgi-onyx-3200/collage.webp b/gemfeed/sgi-onyx-3200/collage.webp Binary files differnew file mode 100644 index 00000000..e33ea1c8 --- /dev/null +++ b/gemfeed/sgi-onyx-3200/collage.webp diff --git a/gemfeed/sgi-onyx-3200/collage2.webp b/gemfeed/sgi-onyx-3200/collage2.webp Binary files differnew file mode 100644 index 00000000..21ccbc44 --- /dev/null +++ b/gemfeed/sgi-onyx-3200/collage2.webp diff --git a/gemfeed/sgi-onyx-3200/desk.webp b/gemfeed/sgi-onyx-3200/desk.webp Binary files differnew file mode 100644 index 00000000..d82681e5 --- /dev/null +++ b/gemfeed/sgi-onyx-3200/desk.webp @@ -1,6 +1,8 @@ # foo.zone -> This site was generated at 2024-08-05T22:08:22+03:00 by `Gemtexter` +> This site was generated at 2025-02-16T11:18:30+02:00 by `Gemtexter` + +Welcome to the foo.zone. Everything you read on this site is my personal opinion and experience. You can call me a Linux/*BSD enthusiast and hobbyist. I mainly write about tech, IT, programming and sometimes also about self-improvement here. And I also like coding. ``` |\---/| @@ -11,30 +13,35 @@ (_,...'(_,.`__)/'.....+ ``` -## Introduction - -Welcome to the foo.zone. Everything you read on this site is my personal opinion and experience. You can call me a Linux/*BSD enthusiast and hobbyist. I mainly write about tech, IT, programming and sometimes also about self-improvement here. Note that this blog usually does not overlap with what I do at my day job as a Site Reliability Engineer. +## Some links -=> https://paul.buetow.org My contact information and resources (via HTTP) -=> gemini://paul.buetow.org My contact information and resources (via Gemini) +=> ./about/index.gmi About me => ./uptime-stats.gmi My machine uptime statistics - -If you reach this site via the modern web, please read this: - => ./gemfeed/2021-04-24-welcome-to-the-geminispace.gmi Welcome to the Geminispace -## Personal blog +## Blog -### Stay updated +### Atom and Gemfeeds => ./gemfeed/atom.xml Subscribe to this blog's Atom feed => ./gemfeed/index.gmi Subscribe to this blog's Gemfeed ### Posts +=> ./gemfeed/2025-02-08-random-weird-things-ii.gmi 2025-02-08 - Random Weird Things - Part Ⅱ +=> ./gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 - f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts +=> ./gemfeed/2025-01-15-working-with-an-sre-interview.gmi 2025-01-15 - Working with an SRE Interview +=> ./gemfeed/2025-01-01-posts-from-october-to-december-2024.gmi 2025-01-01 - Posts from October to December 2024 +=> ./gemfeed/2024-12-15-random-helix-themes.gmi 2024-12-15 - Random Helix Themes +=> ./gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 - f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation +=> ./gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi 2024-11-17 - f3s: Kubernetes with FreeBSD - Part 1: Setting the stage +=> ./gemfeed/2024-10-24-staff-engineer-book-notes.gmi 2024-10-24 - 'Staff Engineer' book notes +=> ./gemfeed/2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.gmi 2024-10-02 - Gemtexter 3.0.0 - Let's Gemtext again⁴ +=> ./gemfeed/2024-09-07-site-reliability-engineering-part-4.gmi 2024-09-07 - Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers +=> ./gemfeed/2024-09-07-projects-i-support.gmi 2024-09-07 - Projects I financially support => ./gemfeed/2024-08-05-typing-127.1-words-per-minute.gmi 2024-08-05 - Typing `127.1` words per minute (`>100wpm average`) => ./gemfeed/2024-07-07-the-stoic-challenge-book-notes.gmi 2024-07-07 - 'The Stoic Challenge' book notes -=> ./gemfeed/2024-07-05-random-weird-things.gmi 2024-07-05 - Random Weird Things +=> ./gemfeed/2024-07-05-random-weird-things.gmi 2024-07-05 - Random Weird Things - Part Ⅰ => ./gemfeed/2024-06-23-terminal-multiplexing-with-tmux.gmi 2024-06-23 - Terminal multiplexing with `tmux` => ./gemfeed/2024-05-03-projects-i-currently-dont-have-time-for.gmi 2024-05-03 - Projects I currently don't have time for => ./gemfeed/2024-05-01-slow-productivity-book-notes.gmi 2024-05-01 - 'Slow Productivity' book notes @@ -42,9 +49,9 @@ If you reach this site via the modern web, please read this: => ./gemfeed/2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.gmi 2024-03-03 - A fine Fyne Android app for quickly logging ideas programmed in Go => ./gemfeed/2024-02-04-from-babylon5.buetow.org-to-.cloud.gmi 2024-02-04 - From `babylon5.buetow.org` to `*.buetow.cloud` => ./gemfeed/2024-01-13-one-reason-why-i-love-openbsd.gmi 2024-01-13 - One reason why I love OpenBSD -=> ./gemfeed/2024-01-09-site-reliability-engineering-part-3.gmi 2024-01-09 - Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect +=> ./gemfeed/2024-01-09-site-reliability-engineering-part-3.gmi 2024-01-09 - Site Reliability Engineering - Part 3: On-Call Culture => ./gemfeed/2023-12-10-bash-golf-part-3.gmi 2023-12-10 - Bash Golf Part 3 -=> ./gemfeed/2023-11-19-site-reliability-engineering-part-2.gmi 2023-11-19 - Site Reliability Engineering - Part 2: Operational Balance in SRE +=> ./gemfeed/2023-11-19-site-reliability-engineering-part-2.gmi 2023-11-19 - Site Reliability Engineering - Part 2: Operational Balance => ./gemfeed/2023-11-11-mind-management-book-notes.gmi 2023-11-11 - 'Mind Management' book notes => ./gemfeed/2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.gmi 2023-10-29 - KISS static web photo albums with `photoalbum.sh` => ./gemfeed/2023-09-25-dtail-usage-examples.gmi 2023-09-25 - DTail usage examples @@ -54,7 +61,6 @@ If you reach this site via the modern web, please read this: => ./gemfeed/2023-06-01-kiss-server-monitoring-with-gogios.gmi 2023-06-01 - KISS server monitoring with Gogios => ./gemfeed/2023-05-06-the-obstacle-is-the-way-book-notes.gmi 2023-05-06 - 'The Obstacle is the Way' book notes => ./gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.gmi 2023-05-01 - Unveiling `guprecords.raku`: Global Uptime Records with Raku -=> ./gemfeed/2023-04-09-algorithms-and-data-structures-in-golang-part-1.gmi 2023-04-09 - Algorithms and Data Structures in Go - Part 1 => ./gemfeed/2023-04-01-never-split-the-difference-book-notes.gmi 2023-04-01 - 'Never split the difference' book notes => ./gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi 2023-03-25 - Gemtexter 2.0.0 - Let's Gemtext again² => ./gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.gmi 2023-03-16 - 'The Pragmatic Programmer' book notes @@ -95,5 +101,6 @@ If you reach this site via the modern web, please read this: => ./gemfeed/2010-05-09-the-fype-programming-language.gmi 2010-05-09 - The Fype Programming Language => ./gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.gmi 2010-05-07 - Lazy Evaluation with Standard ML => ./gemfeed/2010-04-09-standard-ml-and-haskell.gmi 2010-04-09 - Standard ML and Haskell +=> ./gemfeed/2009-02-13-sgi-onyx-3200.gmi 2009-02-13 - SGI Onyx 3200 => ./gemfeed/2008-12-29-using-my-nokia-n95-for-fixing-my-mta.gmi 2008-12-29 - Using my Nokia N95 for fixing my MTA => ./gemfeed/2008-06-26-perl-poetry.gmi 2008-06-26 - Perl Poetry diff --git a/index.gmi.tpl b/index.gmi.tpl index beb3e42c..36986616 100644 --- a/index.gmi.tpl +++ b/index.gmi.tpl @@ -2,6 +2,8 @@ << echo "> This site was generated at $($DATE $DATE_FORMAT) by \`Gemtexter\`" +Welcome to the foo.zone. Everything you read on this site is my personal opinion and experience. You can call me a Linux/*BSD enthusiast and hobbyist. I mainly write about tech, IT, programming and sometimes also about self-improvement here. And I also like coding. + ``` |\---/| | ,_, | @@ -11,21 +13,15 @@ (_,...'(_,.`__)/'.....+ ``` -## Introduction - -Welcome to the foo.zone. Everything you read on this site is my personal opinion and experience. You can call me a Linux/*BSD enthusiast and hobbyist. I mainly write about tech, IT, programming and sometimes also about self-improvement here. Note that this blog usually does not overlap with what I do at my day job as a Site Reliability Engineer. +## Some links -=> https://paul.buetow.org My contact information and resources (via HTTP) -=> gemini://paul.buetow.org My contact information and resources (via Gemini) +=> ./about/index.gmi About me => ./uptime-stats.gmi My machine uptime statistics - -If you reach this site via the modern web, please read this: - => ./gemfeed/2021-04-24-welcome-to-the-geminispace.gmi Welcome to the Geminispace -## Personal blog +## Blog -### Stay updated +### Atom and Gemfeeds => ./gemfeed/atom.xml Subscribe to this blog's Atom feed => ./gemfeed/index.gmi Subscribe to this blog's Gemfeed diff --git a/notes/a-monks-guide-to-happiness.gmi b/notes/a-monks-guide-to-happiness.gmi index 03d6f6be..280270f5 100644 --- a/notes/a-monks-guide-to-happiness.gmi +++ b/notes/a-monks-guide-to-happiness.gmi @@ -2,6 +2,17 @@ > Last updated 21.5.2023 +## Table of Contents + +* ⇢ "A Monk's Guide to Happiness" book notes +* ⇢ ⇢ Understanding Happiness +* ⇢ ⇢ The Role of Meditation +* ⇢ ⇢ Managing Thoughts and Emotions +* ⇢ ⇢ Practice and Discipline +* ⇢ ⇢ Perspectives on Relationships and Interactions +* ⇢ ⇢ Reflective Questions +* ⇢ ⇢ Miscellaneous Guidelines + ## Understanding Happiness * Happiness is a skill we can train. diff --git a/notes/a-monks-guide-to-happiness.gmi.tpl b/notes/a-monks-guide-to-happiness.gmi.tpl new file mode 100644 index 00000000..d9c74e0d --- /dev/null +++ b/notes/a-monks-guide-to-happiness.gmi.tpl @@ -0,0 +1,69 @@ +# "A Monk's Guide to Happiness" book notes + +> Last updated 21.5.2023 + +<< template::inline::toc + +## Understanding Happiness + +* Happiness is a skill we can train. +* Happiness is not about accomplishing goals, as that would be in the future. +* Feel free now. No urge about past and future. +* We can learn to produce our own happiness independently of physical needs. When we walk in a park, how do we feel? We can train to reproduce that feeling independently. + +## The Role of Meditation + +* Meditation is not about clearing your mind. A busy mind has nothing to do with interfering with your meditation. +* Our problem is that we need to detect that awareness. Meditation connects us with awareness. Awareness is freedom. +* We can let the mind be and don't care about the thoughts. It will have benefits for your life. It will protect you from all kinds of stress. +* Better meditate with open eyes so you don't associate it with the dark. You will also be able to be in a meditation state of mind outside of the meditation session. +* Have a baseline for time to build up discipline. +* We don't need to do anything about stress, just take a step back. + +## Managing Thoughts and Emotions + +* Our flow of emotions is really just habits. That can be changed through training, e.g., meditation training. +* A part of the mind recognises that we are sad or angry. That part is not sad or angry by itself, obviously. So we can escape to that part of the mind, be the observer, and not draw in the constant flow of emotions and thoughts. +* Let the front and back doors of your house open, and let the thoughts come in and leave. Just don't serve them tea. This once said, a great Zen master. +* Thoughts are friends and not enemies. +* Thoughts help the meditation as they make us notice that we wandered off, and therefore, we strengthen the reflection. + +## Practice and Discipline + +* The importance of habits to practice mindfulness. Bring mindfulness into the daily practice. +* Integrating short moments of mindfulness during the day is the fast track to happiness. Start off with small tasks, e.g. while washing your hands. +* Have many small doses of mindfulness and don't prolong as otherwise, your mind will revolt. +* Have a small moment of mindfulness when you wake up and go to sleep. +* Practice staying fully present in an uncomfortable situation and without judgement. +* Don't become two persons who never meet: the meditator and the not meditator. So integrate mindfulness during the day too. + +## Perspectives on Relationships and Interactions + +* Who is the opponent? The other person. The things he said or our reactions to things? Forgiveness is a high form of compassion. +* Understand the suffering of the person who "hurt" us. Where is the aggressor really coming from? +* People who are stressed or unhappy do and say things they wouldn't have said have done otherwise. Acting under anger is like being influenced by alcohol. +* People don't have a masterplan to destroy others, even if it seems so. They are under strong bad influence by themselves. Something terrible happened to them. Revenge makes no sense. +* Be grateful for people "trying" to hurt you as they help you to practice your path. + +## Reflective Questions + +* Why do I do all the things I do? What do I try to achieve? +* What am I doing about that? +* Is it working? +* What are the real causes of happiness and suffering? +* What about meditation? How does that address the situation? + +## Miscellaneous Guidelines + +* Posture is important as the mind and body are connected. +* Don't use music, so you don't rely on music to change your state of mind. Similar regular guided meditation. Guided meditation is good for learning a technique, but you should not rely on another voice. +* You are not trying to relax. Relaxing and trying are two different things. +* When you love everything, even the bad things happening to you, then you are invincible. +* Happiness is all in your mind. As if you flip a switch there. +* Digging for answers will never end. It will always cause more material to dig. + +If happiness is a mental issue. Clearly, the best time is spent training your mind in your free time and don't always be busy with other things. E.g. meditation, or think about the benefits of meditation. All that we do in our free time is search for happiness. Are the things we do actually working? There is always something around the corner... + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/notes/career-guide-and-soft-skills.gmi b/notes/career-guide-and-soft-skills.gmi index 7a37da5a..85795e7e 100644 --- a/notes/career-guide-and-soft-skills.gmi +++ b/notes/career-guide-and-soft-skills.gmi @@ -16,9 +16,41 @@ These notes are of two books by "John Sommez" I found helpful. I also added some ''' ``` -# Improve - -## Always learn new things +## Table of Contents + +* ⇢ "Software Developmers Career Guide and Soft Skills" book notes +* ⇢ ⇢ Improve +* ⇢ ⇢ ⇢ Always learn new things +* ⇢ ⇢ ⇢ Set goals +* ⇢ ⇢ ⇢ Ratings +* ⇢ ⇢ ⇢ Promotions +* ⇢ ⇢ ⇢ Finish things +* ⇢ ⇢ Expand the empire +* ⇢ ⇢ Be pragmatic and also manage your time +* ⇢ ⇢ ⇢ The quota system +* ⇢ ⇢ ⇢ Don't waste time +* ⇢ ⇢ ⇢ Habits +* ⇢ Work-life balance +* ⇢ ⇢ Mental health +* ⇢ ⇢ Physical health +* ⇢ ⇢ No drama +* ⇢ Personal brand +* ⇢ ⇢ Market yourself +* ⇢ ⇢ Networking +* ⇢ ⇢ Public speaking +* ⇢ New job +* ⇢ ⇢ For the interview +* ⇢ ⇢ Find the right type of company +* ⇢ ⇢ Apply for the new job +* ⇢ ⇢ Negotiation +* ⇢ ⇢ Leaving the old job +* ⇢ Other things +* ⇢ ⇢ Testing +* ⇢ ⇢ Books to read + +## Improve + +### Always learn new things When you learn something new, e.g. a programming language, first gather an overview, learn from multiple sources, play around and learn by doing and not consuming and form your own questions. Don't read too much upfront. A large amount of time is spent in learning technical skills which were never use. You want to have a practical set of skills you are actually using. You need to know 20 percent to get out 80 percent of the results. @@ -35,18 +67,18 @@ Fake it until you make it. But be honest about your abilities or lack of. There Boot camps: The advantage of a boot camp is to pragmatically learn things fast. We almost always overestimate what we can do in a day. Especially during boot camps. Connect to others during the boot camps -## Set goals +### Set goals Your own goals are important but the manager also looks at how the team performs and how someone can help the team perform better. Check whether you are on track with your goals every 2 weeks in order to avoid surprises for the annual review. Make concrete goals for next review. Track and document your progress. Invest in your education. Make your goals known. If you want something, then ask for it. Nobody but you knows what you want. -## Ratings +### Ratings That's a trap: If you have to rate yourself, that's a trap. That never works in an unbiased way. Rate yourself always the best way but rate your weakest part as high as possible minus one point. Rate yourself as good as you can otherwise. Nobody is putting for fun a gun on his own head. * Don't do peer rating, it can fire back on you. What if the colleague becomes your new boss? * Cooperate rankings are unfortunately HR guidelines and politics and only mirror a little your actual performance. -## Promotions +### Promotions The most valuable employees are the ones who make themselves obsolete and automate all away. Keep a safety net of 3 to 6 months of finances. Safe at least 10 percent of your earnings. Also, if you make money it does not mean that you have to spent more money. Is a new car better than a used car which both can bring you from A to B? Liability vs assets. @@ -58,7 +90,7 @@ The most valuable employees are the ones who make themselves obsolete and automa * If you want a raise be specific how much and know to back your demands. Don't make a thread and no ultimatums. * Best way for a promotion is to switch jobs. You can even switch back with a better salary. -## Finish things +### Finish things Hard work is necessary for accomplish results. However, work smarter not harder. Furthermore, working smart is not a substitute for working hard. Work both, hard and smart. @@ -276,13 +308,13 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other book notes of mine are: -=> ./the-pragmatic-programmer.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ./never-split-the-difference.gmi 2023-04-01 "Never split the difference" book notes -=> ./the-obstacle-is-the-way.gmi 2023-05-06 "The Obstacle is the Way" book notes -=> ./career-guide-and-soft-skills.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes (You are currently reading this) -=> ./mind-management.gmi 2023-11-11 "Mind Management" book notes -=> ./slow-productivity.gmi 2024-05-01 "Slow Productivity" book notes +=> ./staff-engineer.gmi 2024-10-24 "Staff Engineer" book notes => ./the-stoic-challenge.gmi 2024-07-07 "The Stoic Challenge" book notes +=> ./slow-productivity.gmi 2024-05-01 "Slow Productivity" book notes +=> ./mind-management.gmi 2023-11-11 "Mind Management" book notes +=> ./career-guide-and-soft-skills.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes (You are currently reading this) +=> ./the-obstacle-is-the-way.gmi 2023-05-06 "The Obstacle is the Way" book notes +=> ./never-split-the-difference.gmi 2023-04-01 "Never split the difference" book notes +=> ./the-pragmatic-programmer.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ../resources.gmi More books and other resources I found useful. => ../ Back to the main site diff --git a/notes/eat-that-frog.gmi b/notes/eat-that-frog.gmi new file mode 100644 index 00000000..49bc2d8a --- /dev/null +++ b/notes/eat-that-frog.gmi @@ -0,0 +1,102 @@ +# "Eat That Frog" book notes + +These are my personal book notes from Brian Tracy's "Eat That Frog!" They are for myself, but I hope they might be useful to you too. + +## Table of Contents + +* ⇢ "Eat That Frog" book notes +* ⇢ ⇢ Time and Task Management +* ⇢ ⇢ Prioritizing Tasks +* ⇢ ⇢ Goal Setting and Planning +* ⇢ ⇢ Efficiency and Procrastination +* ⇢ ⇢ Project Management and Prioritization +* ⇢ ⇢ Effective Work Strategies +* ⇢ ⇢ Maintaining Productivity +* ⇢ ⇢ Attitude and Technology Management + +## Time and Task Management + +There's never enough time to complete all tasks; it’s a never-ending river of responsibilities. Focus on what matters most instead. There is never enough time to finish everything, but there's always time to finish the most important things. Focus on one single, most important task until it's finished. Single-tasking is the most important practice in life. The key to success is action. You will always be behind on some tasks. The key is to be selective. + +## Prioritizing Tasks + +Eat the Frog: Tackle the most terrible tasks of the day, the ones you procrastinate on the most. Start with the most difficult and ugliest task first. Resist the urge to start with the easiest task. + +Three qualities necessary but learnable to form a habit of getting things done: + +* 1. Decision +* 2. Discipline +* 3. Determination + +Visualize yourself as the person who gets important stuff done on time and consistently. Definiteness of purpose and desire to achieve are crucial. Clarity is likely the most important concept in productivity. The more clarity, the more determination, and the easier it is to eat the frog. Strive for clarity. Think on paper and write out exactly what you want. Unwritten goals are merely wishes or fantasies. + +## Goal Setting and Planning + +* Set deadlines or sub-deadlines. No deadline means no urgency, leading to procrastination. +* Written goals drive achievement. The more you write, the more you think about them, and the stronger the desire to accomplish them. +* An average plan with tasks done is better than a perfect plan without action. Always get something done; never miss a day, always push forward. +* Write down the ten most important goals. Pick the one with the most impact on your life and work towards it every day to change your life. +* Plan every day in advance. Bring the future into the now so you can act immediately. + +## Efficiency and Procrastination + +With a plan, overcoming procrastination becomes easier. Ten minutes of planning can save two hours of work. It's amazing how few people actually plan their work. The subconscious mind works on items from your list overnight, providing insights when you start working. + + Create lists a day before: + +* Monthly list +* Weekly list (updated as the week progresses) +* Daily list the night before + +Plan every week and month in advance. Always work from the list. Add new items back to the list. + +## Project Management and Prioritization + +Each project should have a list of items to complete, ordered by priority. Ten percent planning can make the remaining ninety percent more efficient. Most people procrastinate on the least valuable eighty percent of items. The most valuable twenty percent of items provide eighty percent of the benefits but are also the hardest. + +Resist the habit of handling low-value tasks first, as you may never finish them. Focus on the long-term factor—it’s significant for success. + +Think in five, ten, or twenty years into the future. What you do now will have long-term impacts. Consider long-term consequences, not short-term gains. Unsuccessful people often focus on short-term goals and pleasures. + +Whatever task you undertake, add twenty percent to the planned time—then you may finish early and feel relaxed. Regularly ask, "What is the current task with the highest value at this moment?" to maintain focus. + +## Effective Work Strategies + +* Do first things first and second things never. Set clear priorities. +* Use creative procrastination by putting off less critical "ugly frogs." +* Only by controlling what you say "no" to can you control your life and time. +* Early and often, reject anything not of high value to your life. +* No spare time means new priorities replace old activities (e.g., spend more time with family, reading, or sport). +* Poor performance causes procrastination; people avoid areas where they aren't proficient. Everyone has strengths and weaknesses. +* Set goals to improve in areas that need development. +* Identify and develop skills that have the biggest positive impact on your life. +* Continual improvement transforms your life. +* Effective work leads to a decent work-life balance, enhancing life quality at home. + +## Maintaining Productivity + +Start with the highest value task of the day by just getting started—often the hardest part. A tidy desk makes starting easier. +Prepare ahead to get eighty percent right and correct the rest later. Don’t be a perfectionist. Be ready to fail; you miss one hundred percent of the shots you don't take. Focus on one thing at a time to enhance efficiency. Divide "big frogs" into many small tasks to tackle procrastination. + +Continuous learning is essential for success. When you know how to do something, procrastination decreases. Learn what you need—prioritize learning. Utilize commute times effectively (e.g., listening to educational audio). Identify key skills and limiters; prioritize improvement in these areas. Decide to excel in your chosen field and enjoy it. + +Take responsibility—don’t wait for others to motivate you. Leaders work without supervision. Develop the habit of putting pressure on yourself and choosing your own "frog." + +## Attitude and Technology Management + +The reputation you build with yourself comes with meeting self-imposed deadlines. Regardless of your mood, always appear cheerful and tell others you're feeling terrific; optimists find positives in setbacks and seek solutions. Reserve energy for achieving goals, rather than criticizing others. + +Technology can be a best friend or worst enemy. Unplug regularly (e.g., one day per week) and treat technology as a tool, not a master. + +Avoid task switching and context shifting. Minimize message checking in the mornings. Only check messages briefly if needed, and limit to twice per day. Cultivate a habit of focused work every morning (e.g., two to three hours). + +The "Salami Slice" or "Swiss Cheese" method facilitates tackling daunting projects by breaking them into smaller pieces. Urgency triggers high performance. Aim to accomplish three to five things in a workday to achieve ninety percent focus. + +Improve specific key skills to increase productivity and enter "the zone." + +Other book notes of mine are: + + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/notes/eat-that-frog.gmi.tpl b/notes/eat-that-frog.gmi.tpl new file mode 100644 index 00000000..92eaa8e2 --- /dev/null +++ b/notes/eat-that-frog.gmi.tpl @@ -0,0 +1,93 @@ +# "Eat That Frog" book notes + +These are my personal book notes from Brian Tracy's "Eat That Frog!" They are for myself, but I hope they might be useful to you too. + +<< template::inline::toc + +## Time and Task Management + +There's never enough time to complete all tasks; it’s a never-ending river of responsibilities. Focus on what matters most instead. There is never enough time to finish everything, but there's always time to finish the most important things. Focus on one single, most important task until it's finished. Single-tasking is the most important practice in life. The key to success is action. You will always be behind on some tasks. The key is to be selective. + +## Prioritizing Tasks + +Eat the Frog: Tackle the most terrible tasks of the day, the ones you procrastinate on the most. Start with the most difficult and ugliest task first. Resist the urge to start with the easiest task. + +Three qualities necessary but learnable to form a habit of getting things done: + +* 1. Decision +* 2. Discipline +* 3. Determination + +Visualize yourself as the person who gets important stuff done on time and consistently. Definiteness of purpose and desire to achieve are crucial. Clarity is likely the most important concept in productivity. The more clarity, the more determination, and the easier it is to eat the frog. Strive for clarity. Think on paper and write out exactly what you want. Unwritten goals are merely wishes or fantasies. + +## Goal Setting and Planning + +* Set deadlines or sub-deadlines. No deadline means no urgency, leading to procrastination. +* Written goals drive achievement. The more you write, the more you think about them, and the stronger the desire to accomplish them. +* An average plan with tasks done is better than a perfect plan without action. Always get something done; never miss a day, always push forward. +* Write down the ten most important goals. Pick the one with the most impact on your life and work towards it every day to change your life. +* Plan every day in advance. Bring the future into the now so you can act immediately. + +## Efficiency and Procrastination + +With a plan, overcoming procrastination becomes easier. Ten minutes of planning can save two hours of work. It's amazing how few people actually plan their work. The subconscious mind works on items from your list overnight, providing insights when you start working. + + Create lists a day before: + +* Monthly list +* Weekly list (updated as the week progresses) +* Daily list the night before + +Plan every week and month in advance. Always work from the list. Add new items back to the list. + +## Project Management and Prioritization + +Each project should have a list of items to complete, ordered by priority. Ten percent planning can make the remaining ninety percent more efficient. Most people procrastinate on the least valuable eighty percent of items. The most valuable twenty percent of items provide eighty percent of the benefits but are also the hardest. + +Resist the habit of handling low-value tasks first, as you may never finish them. Focus on the long-term factor—it’s significant for success. + +Think in five, ten, or twenty years into the future. What you do now will have long-term impacts. Consider long-term consequences, not short-term gains. Unsuccessful people often focus on short-term goals and pleasures. + +Whatever task you undertake, add twenty percent to the planned time—then you may finish early and feel relaxed. Regularly ask, "What is the current task with the highest value at this moment?" to maintain focus. + +## Effective Work Strategies + +* Do first things first and second things never. Set clear priorities. +* Use creative procrastination by putting off less critical "ugly frogs." +* Only by controlling what you say "no" to can you control your life and time. +* Early and often, reject anything not of high value to your life. +* No spare time means new priorities replace old activities (e.g., spend more time with family, reading, or sport). +* Poor performance causes procrastination; people avoid areas where they aren't proficient. Everyone has strengths and weaknesses. +* Set goals to improve in areas that need development. +* Identify and develop skills that have the biggest positive impact on your life. +* Continual improvement transforms your life. +* Effective work leads to a decent work-life balance, enhancing life quality at home. + +## Maintaining Productivity + +Start with the highest value task of the day by just getting started—often the hardest part. A tidy desk makes starting easier. +Prepare ahead to get eighty percent right and correct the rest later. Don’t be a perfectionist. Be ready to fail; you miss one hundred percent of the shots you don't take. Focus on one thing at a time to enhance efficiency. Divide "big frogs" into many small tasks to tackle procrastination. + +Continuous learning is essential for success. When you know how to do something, procrastination decreases. Learn what you need—prioritize learning. Utilize commute times effectively (e.g., listening to educational audio). Identify key skills and limiters; prioritize improvement in these areas. Decide to excel in your chosen field and enjoy it. + +Take responsibility—don’t wait for others to motivate you. Leaders work without supervision. Develop the habit of putting pressure on yourself and choosing your own "frog." + +## Attitude and Technology Management + +The reputation you build with yourself comes with meeting self-imposed deadlines. Regardless of your mood, always appear cheerful and tell others you're feeling terrific; optimists find positives in setbacks and seek solutions. Reserve energy for achieving goals, rather than criticizing others. + +Technology can be a best friend or worst enemy. Unplug regularly (e.g., one day per week) and treat technology as a tool, not a master. + +Avoid task switching and context shifting. Minimize message checking in the mornings. Only check messages briefly if needed, and limit to twice per day. Cultivate a habit of focused work every morning (e.g., two to three hours). + +The "Salami Slice" or "Swiss Cheese" method facilitates tackling daunting projects by breaking them into smaller pieces. Urgency triggers high performance. Aim to accomplish three to five things in a workday to achieve ninety percent focus. + +Improve specific key skills to increase productivity and enter "the zone." + +Other book notes of mine are: + +<< template::inline::rindex book-notes + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/notes/index.gmi b/notes/index.gmi index c2ee33e6..d6666d2c 100644 --- a/notes/index.gmi +++ b/notes/index.gmi @@ -2,6 +2,7 @@ ## To be in the .zone! +=> ./when.gmi 'When: The Scientific Secrets of Perfect Timing' book notes => ./the-stoic-challenge.gmi 'The Stoic Challenge' book notes => ./the-pragmatic-programmer.gmi 'The Pragmatic Programmer' book notes => ./the-power-of-neuroplasticity.gmi 'The Power of Neuroplasticity' book notes @@ -12,7 +13,9 @@ => ./never-split-the-difference.gmi 'Never split the difference' book notes => ./mind-management.gmi 'Mind Management' book notes => ./mental-combat.gmi 'Mental Combat' book notes +=> ./joy-on-demand.gmi 'Joy On Domand' book notes => ./influence-wihout-authority.gmi 'Influence without Authority' book notes +=> ./eat-that-frog.gmi 'Eat That Frog' book notes => ./career-guide-and-soft-skills.gmi 'Software Developmers Career Guide and Soft Skills' book notes => ./a-monks-guide-to-happiness.gmi 'A Monk's Guide to Happiness' book notes diff --git a/notes/influence-wihout-authority.gmi b/notes/influence-wihout-authority.gmi index 769a6116..269f1000 100644 --- a/notes/influence-wihout-authority.gmi +++ b/notes/influence-wihout-authority.gmi @@ -6,6 +6,16 @@ These notes capture key strategies from "Influence Without Authority" by Allan R These are my personal notes, but maybe you will find them usefull too. +## Table of Contents + +* ⇢ "Influence without Authority" book notes +* ⇢ ⇢ Building Relationships and Communication +* ⇢ ⇢ Managing Emotions and Conflicts +* ⇢ ⇢ Strategic Influence and Reciprocity +* ⇢ ⇢ Working with Management +* ⇢ ⇢ Adapting to Workplace Culture +* ⇢ ⇢ Diplomacy and Discretion + ## Building Relationships and Communication * Make relationships before they are needed. A good reputation acts as a reserve for difficult times. diff --git a/notes/influence-wihout-authority.gmi.tpl b/notes/influence-wihout-authority.gmi.tpl index 769a6116..725c2bcd 100644 --- a/notes/influence-wihout-authority.gmi.tpl +++ b/notes/influence-wihout-authority.gmi.tpl @@ -6,6 +6,8 @@ These notes capture key strategies from "Influence Without Authority" by Allan R These are my personal notes, but maybe you will find them usefull too. +<< template::inline::toc + ## Building Relationships and Communication * Make relationships before they are needed. A good reputation acts as a reserve for difficult times. diff --git a/notes/joy-on-demand.gmi b/notes/joy-on-demand.gmi new file mode 100644 index 00000000..0bdef434 --- /dev/null +++ b/notes/joy-on-demand.gmi @@ -0,0 +1,202 @@ +# "Joy On Domand" book notes + +## Table of Contents + +* ⇢ "Joy On Domand" book notes +* ⇢ ⇢ Mindfulness and Joy +* ⇢ ⇢ Joy and Happiness +* ⇢ ⇢ Training Joy: Easing, Inclining, and Uplifting +* ⇢ ⇢ Joy and Pain +* ⇢ ⇢ Path to Happiness +* ⇢ ⇢ Difference Between Joy and Happiness +* ⇢ ⇢ The Spiral of Joy and Practice +* ⇢ ⇢ Inner Peace and Pain +* ⇢ ⇢ Benefits of Mind Training +* ⇢ ⇢ Practicing Mind Training +* ⇢ ⇢ Creativity and Mindfulness +* ⇢ ⇢ The Joyful Mind and Creativity +* ⇢ ⇢ Confidence and Equanimity +* ⇢ ⇢ Resilience and Growth +* ⇢ ⇢ Experiencing Joy +* ⇢ ⇢ Compassion and Joy +* ⇢ ⇢ Meditation and Mindfulness +* ⇢ ⇢ The Joy of Exercise +* ⇢ ⇢ Kick-Starting Joy +* ⇢ ⇢ Benefits of Meditation +* ⇢ ⇢ Meditation Habits +* ⇢ ⇢ Amplifying Joy +* ⇢ ⇢ Gratitude and Perspective +* ⇢ ⇢ Awareness of Absence +* ⇢ ⇢ Compassion and Loving-Kindness +* ⇢ ⇢ Path to Compassion +* ⇢ ⇢ Practicing Loving-Kindness +* ⇢ ⇢ Understanding Suffering +* ⇢ ⇢ Letting Go + +## Mindfulness and Joy + +Happiness is highly trainable in the same way that physical qualities such as strength and agility are. People who won a lot of money in the lottery or who were paralyzed in accidents eventually returned to their average level of happiness. With physical health and fitness, every single aspect of your life improves. You have more energy, suffer fewer sick days, and become more successful at your work. You look better in the mirror, you are confident, and you feel great. Meditation is, if you will, bicep curls for the mind. We can develop major mental skills like the ability to access joy on demand and, in doing so, improve every single aspect of our lives. + +The mental equivalent of physical exercise is meditation. To practice meditation is to practice with your mind, to get better at doing certain things with it, such as experiencing joy. So mindfulness is a specific way of paying attention, and mindfulness meditation means practicing this way of paying attention. When the author heard the sentence, "It is all about cultivating the mind," in an instant, everything in his life suddenly made sense. There is now no doubt in my mind whatsoever that meditation can lead to happiness in real life. + +## Joy and Happiness + +The authors baseline happiness was once quite low, often bordering on misery. Many believe that one's baseline happiness is static and unchangeable, yet he is evidence to the contrary, having elevated his mind from a significantly low point to a much higher level through just a few years of dedicated practice. This transformation echoes the experiences of others who, inspired by spiritual teachers and through lifelong training, have attained enduring inner peace and joy, as well as what they might humbly describe as some degree of inner freedom and compassion. + +Notably, individuals who participated in meditation classes, with little or no prior experience, reported substantial increases in happiness after only a few days or weeks of meditation practice. This aligns with findings from a 2003 study, which demonstrated that a mere eight weeks of mindfulness training can lead to significant, happiness-related changes in brain structure. + +Joy and happiness are highly trainable. When we are eating chocolate, we experience joy, and when we are just sitting there not eating chocolate, we still experience joy. In order to do this, we train the mind to access joy even when it is free from stimulation. This is also the secret to raising your happiness set point. To train the mind to access stimulus-free joy, we need to understand how joy arises independent of sensual stimulation and then cultivate those skills. + +## Training Joy: Easing, Inclining, and Uplifting + +There are three main skills: easing, inclining, and uplifting. + +* Easing into Joy: Resting the mind puts it into a state of ease. When the mind is at ease, joy becomes more accessible. Be joyful at rest—no ego stroking or sensual pleasure required. +* Inclining the Mind Toward Joy: We learn to notice joy and give it our full attention. We learn where to look in order to see and appreciate joy that is already available to us in moments that we hadn't noticed before, in the pleasures of ordinary activities. Inviting and noticing joy become part of our meditation practice as well as habits in everyday life. The more the mind becomes familiar with joy, the more it perceives joy. +* Uplifting the Mind: Especially joy arising from goodness, generosity, loving-kindness, and compassion. With training in easing, inclining, and uplifting the mind comes the increasing ability to access joy on demand in most normal life circumstances (i.e., in the absence of overwhelming difficulties such as losing a livelihood or a loved one). + +Someone told one, "I have found that I can at any moment take a conscious breath and access joy. In fact, this has been so helpful that I use my watch's chronometer to remind me to take at least one breath per hour when I am fully present to it." After practicing attending to the joy of loving-kindness for two minutes, she slept better than she had in years. + +## Joy and Pain + +The same mental equipment we use to train in uplifting our minds, inclining toward joy, and easing into joy gives us the strength and skills we need to deal with difficulties and emotional pain. These three things—easing, inclining, and uplifting—make what appears to be painful less painful, and what is neutral more joyful. Your happiness set point can be upgraded. + +Most people aren't aware that joy independent of sensual or ego stimulation is even possible. Some believe you need a lot of money to experience joy, while others think happiness can only be found by giving up everything and living in a hut in the woods. You might believe you need to meditate for many years to access joy, but as you will see, you can begin to experience benefits in one breath. + +Joy that comes from within—such as from a peaceful mind as a result of taking a few breaths, joy from being kind toward others (which involves other people but does not depend on them), joy from our generosity, joy from doing the right thing—all this joy is ours to have, independent of circumstances. If we do accidentally lose our joy, or something really bad happens and overwhelms us, there's still joy in knowing we can get it back. Joy isn't elusive when you know where and how to look. + +## Path to Happiness + +Life can be strange. Sometimes you find something only when you stop looking for it—like searching for keys for an hour and then seeing them sitting on a shelf three feet in front of you. When the author of this book started to become skillful at accessing joy independent of sensual or ego pleasures, he became much happier, and his desperate desire for worldly success also began to wane. Without "proving himself," he found success. The opposite happened, and he became even more successful. Joy leads to happiness, and happiness leads to success. + +## Difference Between Joy and Happiness + +What is the difference between joy and happiness? Happiness is an optimal state of being. Joy, in contrast, is a pleasurable feeling. It is an emotion. It is in the moment, while happiness is more of a net effect, over time, of mental health and fitness and personal flourishing. Joy is a building block of happiness. A happy life is made up of many moments of joy. While happiness doesn't mean every moment is pure joy, there is no such thing as a joyless path to happiness. + +The ability to access joy on demand enables to build a happy life. In this sense, joy leads to happiness. When we think, "When I am successful, I will be happy," the opposite is true. Success does not lead to happiness. Instead, happiness leads to success. Joy and happiness are trainable. If you want to be successful, it is highly recommended to learn to be happy first. + +Since wealth is a personality multiplier, it is also an experience multiplier. If you are miserable when you are middle class, you will likely be even more miserable when you are wealthy. Similarly, if you're happy when you are middle class, you're likely to be even happier wealthy, for the same reason. The key is joyful practice. + +## The Spiral of Joy and Practice + +Perform an activity that requires some level of skill that reinforces you to do more of this. The same is true for joyful practice. You may find yourself doing it frequently and getting better at it. As you get better at it, you may derive even more enjoyment from it. When you enjoy it more, you do it even more and get even better at it, and so on. + +Joy and meditation are another pair of really nice things that form a virtuous cycle with each other. Meditation is training of the mind. Joy becomes highly accessible in a trained mind. With training, the mind learns to access inner joy with increasing ease and frequency. At the same time, the joyful mind is at peace, a peaceful mind is easily focused, and a focused mind becomes more trainable, thereby making meditation practice even more effective. Thus, a virtuous and joyful cycle forms. + +## Inner Peace and Pain + +Not every moment will be joyful, but knowing that you can count on joy to happen again, and in increasing amounts, tends to improve your overall mood. Inner joy relies on inner peace, so that is our practical starting point. Joy makes you a kinder, more compassionate person, and kindness and compassion bring you more joy. With inner peace, inner joy, and compassion, you gain confidence, charisma, creativity, self-awareness, well-being, emotional resilience, happiness, humor, popularity, courage, and success in every arena, plus personal freedom. + +Joy and pain can coexist. Just because you are in pain doesn't mean you can't also access joy. This is the silver lining of pain: whatever else it is, it's an opportunity to practice getting better. Joy can improve every aspect of life. It resets happiness set points, turning miserable people into jolly ones. With practice, joy can become your personality and your whole life. + +## Benefits of Mind Training + +The first, most basic and possibly most important benefit of mind training is the ability to calm the mind on demand. The ability to calm the mind on demand also has profound implications for leadership. Imagine you're in a meeting room with your coworkers in the middle of a crisis. A key part of leadership is the ability to think calmly and clearly under pressure. By training yourself to calm the mind, you become a more effective leader. + +The second basic benefit of mind training is clarity of mind. The third basic benefit of mind training is emotional resilience, especially in response to emotional pain. In the affective step, we manage the emotionality involved. Here, we mindfully and objectively perceive the emotions as they happen in the body. After a while, we may recognize that even these afflictive emotions are merely sensations in the body and that they are constantly changing, arising, and ceasing over time. + +## Practicing Mind Training + +Mind training enables emotional resilience. In mind training, we practice calming the mind in difficult situations, perceiving the process of emotion at a high resolution, and cultivating compassion and objectivity, thereby strengthening our ability to take all three steps when we're faced with emotional pain. With increasing calmness, clarity, and resilience, we become increasingly capable of overcoming the suffering in the life. Creativity also improves with mind training. + +The author initially made this discovery in an unexpected way: a lot of good ideas and insights came to him while he was meditating. The mind that is alert and relaxed sometimes gets creative, and when that happens, it became creative during meditation. The two most difficult engineering problems he had to solve both came to him during mindfulness practice, and because of that, he got promoted. When the mind is alert and relaxed at the same time, relaxation gives random ideas space to arise and play, and alertness lets us see them and their connections. + +## Creativity and Mindfulness + +Beyond his own first-person experience, he later learned that the relationship between relaxed attention and creativity is well-known among people who rely on creativity for a living. Steve Jobs, for example, famously said: "If you just sit and observe, you will see how restless your mind is. If you try to calm it, it only makes it worse, but over time it does calm, and when it does, there's room to hear more subtle things - that's when your intuition starts to blossom and you start to see things more clearly and be in the present more. Your mind just slows down, and you see a tremendous expanse in the moment. You see so much more than you could see before." + +It's a discipline; you have to practice. At first, his ability to focus worked against him, and he couldn't solve any puzzles. Then, he figured out how to use his extraordinary powers of cognitive control to unfocus, to let go and let his brain make what Kounios believes were necessary associations in the right hemisphere of the brain for the solution to occur. After that, he was unstoppable, solving all the puzzles the experimenters gave him. + +## The Joyful Mind and Creativity + +Not only is the alert and relaxed mind highly conducive to creativity, but studies have shown that a joyful mind is also highly conducive to creativity. One study even shows that a joyful mind's influence on creativity lasts up to two days after the positive mood was felt. In other words, if you are happy today, you are more creative today, tomorrow, and the day after, regardless of how you feel tomorrow and the day after. A joyful mind is a relaxed mind (and vice versa). + +One of the biggest surprise discoveries of his life is that self-confidence can be trained by putting the butt onto a meditation cushion. Confidence is highly sustainable because it is independent of success or failure. With enough self-awareness, you know how to play to your strengths, you know how to compensate for your weaknesses. Navigate skillfully in most situations. Occasionally you discover things about yourself that surprise you, but by and large, they are not surprising enough to floor you. + +## Confidence and Equanimity + +There is an additional aspect of confidence that arises from knowing: knowing that you can know. In other words, whatever you need to know, you are fully capable of learning. The second source of confidence is confidence arising from equanimity. This comes in part from the ability to calm the mind on demand. + +Another aspect of confidence arising from equanimity is the ability to hold your ego very lightly. The author was there entirely to serve this group of people, so his own ego and needs were totally irrelevant. At the same time, in order to serve in a way that this audience deserved, he needed to believe that he deserved to be standing in front of them, speaking to them as if he knew something that they didn't. Based on that, he allowed his ego to be (almost embarrassingly) big enough to fill the whole room. + +## Resilience and Growth + +Confidence arising from resilience is the ability to recover: knowing that when things fail, we can always eventually recover. He knows that even if he loses his cool, he can recover it in five to ten seconds under most circumstances. He decided he never wants to be the smartest person in the room. If you are the smartest person in the room, you won't learn anything. Hence, to maximize the personal growth, chose to work in a company where people seemed to be much smarter than you. + +Doing so takes two things: the self-confidence to put yourself in very uncomfortable situations, and the self-awareness to clearly know your values, priorities, and purpose in life. In life, opportunities come fairly often, but if you are unprepared for it or unwilling to jump at it, then it will pass you. People around you will wonder why you are so frequently in the right place at the right time. In fact, you probably don't get any more opportunities than they do—the difference is you can and do take advantage of the ones you get. + +## Experiencing Joy + +When the mind is at ease, it is easier to experience joy without external stimulus. Give joy your full attention to train to incline towards joy. Uplift the mind with goodness (compassion, helping others, etc.). Experience joy on demand with one breath. Joy must not depend on external factors. Joy and happiness are trainable. Train to be happy before trying to be successful. The better you get at something, the more joy you experience. The more you note joy, the better you get. That also applies to meditation. A focused mind is better at training. Every moment is the best moment of life, as we can have joy on demand. Not every moment will be joyful, but knowing that there will be joy will improve the overall mood. So incline towards joy so it becomes a habit. + +## Compassion and Joy + +Compassion is a multiplier of joy. Kindness and compassion are drivers for joy. Joy and pain can coexist. Joy can improve any aspect of your life. Calm the mind on demand, apply it in real life outside of meditation. Temporarily redirect the focus on the breath to calm the mind. Then mindfully observe the emotions happening in the body. Notice emotions are just physical feelings in the body. Restlessness and crankiness can be caused by minor issues. Meditation helps to uncover this. Answers and solutions to problems can be found through meditation. That is highly reproducible. During or after meditation, unexpected associations come. The mind then is alert and relaxed at the same time. + +## Meditation and Mindfulness + +"If I lose my cool, I know I can recover in most cases within 10 seconds." This gives confidence when walking into a room. Meditation increases charisma. It's good to work with colleagues. Treat the person you are interacting with as the most important person in the world. If you say, "I am so happy to see you," it makes you smile and sends out warmth. It makes you charismatic. + +Take on new tasks only when there is an opportunity for personal growth. Doing hard and unpleasant work can be improved by the exercises of the mind from this book. However, mind training is difficult to start and difficult to sustain long-term. Those problems are highly solvable—for example, taking one breath per day with nothing more expected from you. Once this becomes a habit, more will follow anyway. + +## The Joy of Exercise + +There is an analogy between mind training and physical training. Just as you're not sore after a time with physical training, likewise mental training can become smoother. However, both exercise and training can become boring. Joy can help to sustain both mental and physical exercise. Ease into it. The more advanced, the more joy. A virtuous cycle begins. Make exercise not too difficult but still beneficial, so it becomes easy and effective. Skillful application of ease and fun. There’s a reason for playing sports like basketball or tennis because it makes exercise joyful. + +There's the joy point in meditation, where the meditator reaches inner joy during meditation (reproducible). A certain depth enables joy on demand. Peace or joy: one of them is stronger at the joy point. + +## Kick-Starting Joy + +Introduce joy from the beginning of the exercise, whether physical or mental. Kick-start the virtuous circle by easing into the practice. Meditation must not be hard. Easing is the first step to establishing joy in meditation. + +## Benefits of Meditation + +How long to practice meditation before seeing benefits? Many assume it takes a long time, but it can be life-changing after 50 to 100 hours. Also, 100 minutes are sufficient to see some benefits (10 minutes a day for some weeks). Or just take 3 breaths in less than a minute. To calm the mind 95 percent of the time and in difficult situations, half the cases take around 1000 hours of meditation training. Meditation takes a long time to master, but it is easy to learn and brings benefits after a short time. Easy to learn and difficult to master. + +One single slow mindful breath can already make you calmer and more relaxed. If you focus on the breath, you are in the present and free from regret (past) and worry (future). So you are freed from burdens during that breath. Tennis players win grand slams because after each point, within 10 to 15 seconds, they can calm down in the present. At the professional level, tennis is a mental game more than a physical one. + +## Meditation Habits + +Create a habit loop to incorporate mindful breathing into your daily routine. For instance, take a deep breath as the first action of your day or use lying down in bed as a cue. Whenever you find yourself waiting, take a moment to breathe mindfully. Embrace meditation as a remedy for boredom—boredom can evolve into an opportunity for meditation, effectively eliminating the feeling of boredom. + +Allow the mind to settle naturally without forcing it. Use the analogy of clear water: when you throw a stone into it, the water becomes turbulent, but given time, it naturally returns to clarity. Similarly, allow your mind the time and space for things to happen on their own. In Tibetan, meditation means "to become familiar," suggesting that through meditation, you become familiar with your mind. + +Effort can sometimes hinder relaxation, so learn to apply less effort initially to encourage relaxation—don't let the desire to achieve stress you. Focus on achieving relaxation first, despite any instincts of the overachiever's ego. Once you're sufficiently relaxed, you can gradually reapply effort. + +Adopt the mindset of easing, inclining, and uplifting the mind toward joy. Instead of forcing joy, gently incline your mind so that it naturally defaults to a joyful state. This inclination toward joy comes through the familiarization process. In Tibetan, meditation translates to familiarity (if I'm not mistaken). The key is to notice joy whenever it appears. While we usually overlook it, by noticing, we realize joy is constantly present. Make a point to recognize joy, such as during a third breath in a mindfulness practice. + +## Amplifying Joy + +The next step attends joy. Pay intense attention to joy. Hold the 3rd breath of joy and amplify it. Amplify it by smiling. Emotions are encoded in facial muscles. And it goes bidirectional. Just by smiling, you can invite/experience joy. Even a half-smile works. Only loving-kindness and compassion are stronger than that joy. Attend fully to the joy of the first bite of a meal. It is subtle, but it is there. Amplify it with a smile as well. That joy is there. Attend to any pleasant experiences in the beginning (meeting someone, feeling the water in a shower...). The next thing that happens is a significant increase in happiness. As you become more and more grateful for all of those joys. + +## Gratitude and Perspective + +Habituation: Joy will go away as time passes and we take things for granted. Zen mind beginner's mind: down-regulate habituation. By noticing nice things and being grateful for it. But strongest: One day I will die, and everyone I love will die. Remind yourself you and everyone I love will die; it will put us in proper perspective and make us even more grateful for what we have now. Once daily!! The less time someone notices he still has to live, the more joy he will have from the things in life. The joy of not being in pain. When in pain, wish not to be in pain. Oh, when I would not be in pain, I would be so happy. But when you are not in pain, you aren't happy as you forgot to be happy. + +## Awareness of Absence + +Noticing the absence of something does not come naturally to us. The only way to become aware of the absence is to pay attention to it. It is trainable to get reminded. Just note "gone" is a powerful way to notice something previously experienced is no more. Watch thoughts and notice them going away and say "gone." This is especially important for seasoned meditators. The more you practice meditation, the more joy it will bring. But it will not always bring joy due to the imperfect variance of the day-to-day mood. Even for monks, but it is important to continue practices. + +## Compassion and Loving-Kindness + +If you smile more, then it is a good sign that meditation practice is helping. E.g., smile without apparent reasons. Reflexive smile when nervous. Thinking another person to be happy makes me happy (loving kindness). This is another key insight of this book. All to be happy instantly is wishing someone else to be happy. It can also be a complete stranger. After ten seconds of secretly doing that, go back to work. Familiarize with the joy of loving kindness. Concentrate fully on the joy arising. E.g. for a minute. Loving kindness: Wishing self or others to be happy. Compassion: wishing to be without suffering, e.g., compulsion to help someone not to drown. Compassion is the most joyful. Why can it be the greatest source of joy if it involves suffering? Suffering makes it so that courage arrives. Confidence arises because of courage. With courage and confidence, clarity arises. The feeling of interconnectedness arises and a selfless love. + +## Path to Compassion + +It takes thousands of hours to practice this unparalleled level of joy (compassion). Loving-kindness is the gateway drug to compassion. Just practice easily loving kindness a lot and then you become a hardcore compassionist. Always thinking you don't deserve the successes because you were just lucky? Well, still owning the attentions for success. The Four Sublime States Contemplations on Love (loving-kindness), Compassion, Sympathetic Joy, and Equanimity (mind doesn't change when things are given or taken). Equanimity: Stay calm in 8/worldly conditions 1. Gain and loss 2. Honor and dishonor 3. Praise and blame 4. Pleasure and pain. + +## Practicing Loving-Kindness + +One hour of weekly loving-kindness meditation greatly improves interactions with others towards positive emotions. If you are strong in loving-kindness people tend to love you. Loving-kindness paves the way to the remaining 3 sublime states. If you are good in loving-kindness, the remaining ones require only a little extra effort. To experience peace and joy under adversity, there must be nothing done but to let go of the pain. Joy and pain can coexist. If the joy is much stronger, then the pain will be displaced. The other way does not work. If the pain is much stronger, joy can still be there. Can be without suffering. E.g. when in pain, you have aversion. + +## Understanding Suffering + +If you have aversion, you suffer. The anger monster feeds on anger. Emotions are simply sensations in the body. They are not you. "Sitting in the fire": When there is pain, it can do what it wants. Simply watch and observe it. It's not you. Working the emotional pain: Go back and see the bigger picture, why is there the pain? Our local perception is often flawed. Need to step back for the bigger picture. Aversion is the proxy to suffering. When you master meditation, it won't resolve all the suffering. E.g., then you juggle 3 balls, it does not automatically mean that you can juggle 4 or more balls. + +## Letting Go + +When suffering, don't think, just feel. The direct causes for suffering are clinging: wanting something and aversion: not wanting something. And not the sensation or the thought. Practicing loving-kindness and compassion will greatly improve your life in the long run. It will not help in every small occasion, though. But overall in the long run. Strive to let go. + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/notes/joy-on-demand.gmi.tpl b/notes/joy-on-demand.gmi.tpl new file mode 100644 index 00000000..3b538964 --- /dev/null +++ b/notes/joy-on-demand.gmi.tpl @@ -0,0 +1,171 @@ +# "Joy On Domand" book notes + +<< template::inline::toc + +## Mindfulness and Joy + +Happiness is highly trainable in the same way that physical qualities such as strength and agility are. People who won a lot of money in the lottery or who were paralyzed in accidents eventually returned to their average level of happiness. With physical health and fitness, every single aspect of your life improves. You have more energy, suffer fewer sick days, and become more successful at your work. You look better in the mirror, you are confident, and you feel great. Meditation is, if you will, bicep curls for the mind. We can develop major mental skills like the ability to access joy on demand and, in doing so, improve every single aspect of our lives. + +The mental equivalent of physical exercise is meditation. To practice meditation is to practice with your mind, to get better at doing certain things with it, such as experiencing joy. So mindfulness is a specific way of paying attention, and mindfulness meditation means practicing this way of paying attention. When the author heard the sentence, "It is all about cultivating the mind," in an instant, everything in his life suddenly made sense. There is now no doubt in my mind whatsoever that meditation can lead to happiness in real life. + +## Joy and Happiness + +The authors baseline happiness was once quite low, often bordering on misery. Many believe that one's baseline happiness is static and unchangeable, yet he is evidence to the contrary, having elevated his mind from a significantly low point to a much higher level through just a few years of dedicated practice. This transformation echoes the experiences of others who, inspired by spiritual teachers and through lifelong training, have attained enduring inner peace and joy, as well as what they might humbly describe as some degree of inner freedom and compassion. + +Notably, individuals who participated in meditation classes, with little or no prior experience, reported substantial increases in happiness after only a few days or weeks of meditation practice. This aligns with findings from a 2003 study, which demonstrated that a mere eight weeks of mindfulness training can lead to significant, happiness-related changes in brain structure. + +Joy and happiness are highly trainable. When we are eating chocolate, we experience joy, and when we are just sitting there not eating chocolate, we still experience joy. In order to do this, we train the mind to access joy even when it is free from stimulation. This is also the secret to raising your happiness set point. To train the mind to access stimulus-free joy, we need to understand how joy arises independent of sensual stimulation and then cultivate those skills. + +## Training Joy: Easing, Inclining, and Uplifting + +There are three main skills: easing, inclining, and uplifting. + +* Easing into Joy: Resting the mind puts it into a state of ease. When the mind is at ease, joy becomes more accessible. Be joyful at rest—no ego stroking or sensual pleasure required. +* Inclining the Mind Toward Joy: We learn to notice joy and give it our full attention. We learn where to look in order to see and appreciate joy that is already available to us in moments that we hadn't noticed before, in the pleasures of ordinary activities. Inviting and noticing joy become part of our meditation practice as well as habits in everyday life. The more the mind becomes familiar with joy, the more it perceives joy. +* Uplifting the Mind: Especially joy arising from goodness, generosity, loving-kindness, and compassion. With training in easing, inclining, and uplifting the mind comes the increasing ability to access joy on demand in most normal life circumstances (i.e., in the absence of overwhelming difficulties such as losing a livelihood or a loved one). + +Someone told one, "I have found that I can at any moment take a conscious breath and access joy. In fact, this has been so helpful that I use my watch's chronometer to remind me to take at least one breath per hour when I am fully present to it." After practicing attending to the joy of loving-kindness for two minutes, she slept better than she had in years. + +## Joy and Pain + +The same mental equipment we use to train in uplifting our minds, inclining toward joy, and easing into joy gives us the strength and skills we need to deal with difficulties and emotional pain. These three things—easing, inclining, and uplifting—make what appears to be painful less painful, and what is neutral more joyful. Your happiness set point can be upgraded. + +Most people aren't aware that joy independent of sensual or ego stimulation is even possible. Some believe you need a lot of money to experience joy, while others think happiness can only be found by giving up everything and living in a hut in the woods. You might believe you need to meditate for many years to access joy, but as you will see, you can begin to experience benefits in one breath. + +Joy that comes from within—such as from a peaceful mind as a result of taking a few breaths, joy from being kind toward others (which involves other people but does not depend on them), joy from our generosity, joy from doing the right thing—all this joy is ours to have, independent of circumstances. If we do accidentally lose our joy, or something really bad happens and overwhelms us, there's still joy in knowing we can get it back. Joy isn't elusive when you know where and how to look. + +## Path to Happiness + +Life can be strange. Sometimes you find something only when you stop looking for it—like searching for keys for an hour and then seeing them sitting on a shelf three feet in front of you. When the author of this book started to become skillful at accessing joy independent of sensual or ego pleasures, he became much happier, and his desperate desire for worldly success also began to wane. Without "proving himself," he found success. The opposite happened, and he became even more successful. Joy leads to happiness, and happiness leads to success. + +## Difference Between Joy and Happiness + +What is the difference between joy and happiness? Happiness is an optimal state of being. Joy, in contrast, is a pleasurable feeling. It is an emotion. It is in the moment, while happiness is more of a net effect, over time, of mental health and fitness and personal flourishing. Joy is a building block of happiness. A happy life is made up of many moments of joy. While happiness doesn't mean every moment is pure joy, there is no such thing as a joyless path to happiness. + +The ability to access joy on demand enables to build a happy life. In this sense, joy leads to happiness. When we think, "When I am successful, I will be happy," the opposite is true. Success does not lead to happiness. Instead, happiness leads to success. Joy and happiness are trainable. If you want to be successful, it is highly recommended to learn to be happy first. + +Since wealth is a personality multiplier, it is also an experience multiplier. If you are miserable when you are middle class, you will likely be even more miserable when you are wealthy. Similarly, if you're happy when you are middle class, you're likely to be even happier wealthy, for the same reason. The key is joyful practice. + +## The Spiral of Joy and Practice + +Perform an activity that requires some level of skill that reinforces you to do more of this. The same is true for joyful practice. You may find yourself doing it frequently and getting better at it. As you get better at it, you may derive even more enjoyment from it. When you enjoy it more, you do it even more and get even better at it, and so on. + +Joy and meditation are another pair of really nice things that form a virtuous cycle with each other. Meditation is training of the mind. Joy becomes highly accessible in a trained mind. With training, the mind learns to access inner joy with increasing ease and frequency. At the same time, the joyful mind is at peace, a peaceful mind is easily focused, and a focused mind becomes more trainable, thereby making meditation practice even more effective. Thus, a virtuous and joyful cycle forms. + +## Inner Peace and Pain + +Not every moment will be joyful, but knowing that you can count on joy to happen again, and in increasing amounts, tends to improve your overall mood. Inner joy relies on inner peace, so that is our practical starting point. Joy makes you a kinder, more compassionate person, and kindness and compassion bring you more joy. With inner peace, inner joy, and compassion, you gain confidence, charisma, creativity, self-awareness, well-being, emotional resilience, happiness, humor, popularity, courage, and success in every arena, plus personal freedom. + +Joy and pain can coexist. Just because you are in pain doesn't mean you can't also access joy. This is the silver lining of pain: whatever else it is, it's an opportunity to practice getting better. Joy can improve every aspect of life. It resets happiness set points, turning miserable people into jolly ones. With practice, joy can become your personality and your whole life. + +## Benefits of Mind Training + +The first, most basic and possibly most important benefit of mind training is the ability to calm the mind on demand. The ability to calm the mind on demand also has profound implications for leadership. Imagine you're in a meeting room with your coworkers in the middle of a crisis. A key part of leadership is the ability to think calmly and clearly under pressure. By training yourself to calm the mind, you become a more effective leader. + +The second basic benefit of mind training is clarity of mind. The third basic benefit of mind training is emotional resilience, especially in response to emotional pain. In the affective step, we manage the emotionality involved. Here, we mindfully and objectively perceive the emotions as they happen in the body. After a while, we may recognize that even these afflictive emotions are merely sensations in the body and that they are constantly changing, arising, and ceasing over time. + +## Practicing Mind Training + +Mind training enables emotional resilience. In mind training, we practice calming the mind in difficult situations, perceiving the process of emotion at a high resolution, and cultivating compassion and objectivity, thereby strengthening our ability to take all three steps when we're faced with emotional pain. With increasing calmness, clarity, and resilience, we become increasingly capable of overcoming the suffering in the life. Creativity also improves with mind training. + +The author initially made this discovery in an unexpected way: a lot of good ideas and insights came to him while he was meditating. The mind that is alert and relaxed sometimes gets creative, and when that happens, it became creative during meditation. The two most difficult engineering problems he had to solve both came to him during mindfulness practice, and because of that, he got promoted. When the mind is alert and relaxed at the same time, relaxation gives random ideas space to arise and play, and alertness lets us see them and their connections. + +## Creativity and Mindfulness + +Beyond his own first-person experience, he later learned that the relationship between relaxed attention and creativity is well-known among people who rely on creativity for a living. Steve Jobs, for example, famously said: "If you just sit and observe, you will see how restless your mind is. If you try to calm it, it only makes it worse, but over time it does calm, and when it does, there's room to hear more subtle things - that's when your intuition starts to blossom and you start to see things more clearly and be in the present more. Your mind just slows down, and you see a tremendous expanse in the moment. You see so much more than you could see before." + +It's a discipline; you have to practice. At first, his ability to focus worked against him, and he couldn't solve any puzzles. Then, he figured out how to use his extraordinary powers of cognitive control to unfocus, to let go and let his brain make what Kounios believes were necessary associations in the right hemisphere of the brain for the solution to occur. After that, he was unstoppable, solving all the puzzles the experimenters gave him. + +## The Joyful Mind and Creativity + +Not only is the alert and relaxed mind highly conducive to creativity, but studies have shown that a joyful mind is also highly conducive to creativity. One study even shows that a joyful mind's influence on creativity lasts up to two days after the positive mood was felt. In other words, if you are happy today, you are more creative today, tomorrow, and the day after, regardless of how you feel tomorrow and the day after. A joyful mind is a relaxed mind (and vice versa). + +One of the biggest surprise discoveries of his life is that self-confidence can be trained by putting the butt onto a meditation cushion. Confidence is highly sustainable because it is independent of success or failure. With enough self-awareness, you know how to play to your strengths, you know how to compensate for your weaknesses. Navigate skillfully in most situations. Occasionally you discover things about yourself that surprise you, but by and large, they are not surprising enough to floor you. + +## Confidence and Equanimity + +There is an additional aspect of confidence that arises from knowing: knowing that you can know. In other words, whatever you need to know, you are fully capable of learning. The second source of confidence is confidence arising from equanimity. This comes in part from the ability to calm the mind on demand. + +Another aspect of confidence arising from equanimity is the ability to hold your ego very lightly. The author was there entirely to serve this group of people, so his own ego and needs were totally irrelevant. At the same time, in order to serve in a way that this audience deserved, he needed to believe that he deserved to be standing in front of them, speaking to them as if he knew something that they didn't. Based on that, he allowed his ego to be (almost embarrassingly) big enough to fill the whole room. + +## Resilience and Growth + +Confidence arising from resilience is the ability to recover: knowing that when things fail, we can always eventually recover. He knows that even if he loses his cool, he can recover it in five to ten seconds under most circumstances. He decided he never wants to be the smartest person in the room. If you are the smartest person in the room, you won't learn anything. Hence, to maximize the personal growth, chose to work in a company where people seemed to be much smarter than you. + +Doing so takes two things: the self-confidence to put yourself in very uncomfortable situations, and the self-awareness to clearly know your values, priorities, and purpose in life. In life, opportunities come fairly often, but if you are unprepared for it or unwilling to jump at it, then it will pass you. People around you will wonder why you are so frequently in the right place at the right time. In fact, you probably don't get any more opportunities than they do—the difference is you can and do take advantage of the ones you get. + +## Experiencing Joy + +When the mind is at ease, it is easier to experience joy without external stimulus. Give joy your full attention to train to incline towards joy. Uplift the mind with goodness (compassion, helping others, etc.). Experience joy on demand with one breath. Joy must not depend on external factors. Joy and happiness are trainable. Train to be happy before trying to be successful. The better you get at something, the more joy you experience. The more you note joy, the better you get. That also applies to meditation. A focused mind is better at training. Every moment is the best moment of life, as we can have joy on demand. Not every moment will be joyful, but knowing that there will be joy will improve the overall mood. So incline towards joy so it becomes a habit. + +## Compassion and Joy + +Compassion is a multiplier of joy. Kindness and compassion are drivers for joy. Joy and pain can coexist. Joy can improve any aspect of your life. Calm the mind on demand, apply it in real life outside of meditation. Temporarily redirect the focus on the breath to calm the mind. Then mindfully observe the emotions happening in the body. Notice emotions are just physical feelings in the body. Restlessness and crankiness can be caused by minor issues. Meditation helps to uncover this. Answers and solutions to problems can be found through meditation. That is highly reproducible. During or after meditation, unexpected associations come. The mind then is alert and relaxed at the same time. + +## Meditation and Mindfulness + +"If I lose my cool, I know I can recover in most cases within 10 seconds." This gives confidence when walking into a room. Meditation increases charisma. It's good to work with colleagues. Treat the person you are interacting with as the most important person in the world. If you say, "I am so happy to see you," it makes you smile and sends out warmth. It makes you charismatic. + +Take on new tasks only when there is an opportunity for personal growth. Doing hard and unpleasant work can be improved by the exercises of the mind from this book. However, mind training is difficult to start and difficult to sustain long-term. Those problems are highly solvable—for example, taking one breath per day with nothing more expected from you. Once this becomes a habit, more will follow anyway. + +## The Joy of Exercise + +There is an analogy between mind training and physical training. Just as you're not sore after a time with physical training, likewise mental training can become smoother. However, both exercise and training can become boring. Joy can help to sustain both mental and physical exercise. Ease into it. The more advanced, the more joy. A virtuous cycle begins. Make exercise not too difficult but still beneficial, so it becomes easy and effective. Skillful application of ease and fun. There’s a reason for playing sports like basketball or tennis because it makes exercise joyful. + +There's the joy point in meditation, where the meditator reaches inner joy during meditation (reproducible). A certain depth enables joy on demand. Peace or joy: one of them is stronger at the joy point. + +## Kick-Starting Joy + +Introduce joy from the beginning of the exercise, whether physical or mental. Kick-start the virtuous circle by easing into the practice. Meditation must not be hard. Easing is the first step to establishing joy in meditation. + +## Benefits of Meditation + +How long to practice meditation before seeing benefits? Many assume it takes a long time, but it can be life-changing after 50 to 100 hours. Also, 100 minutes are sufficient to see some benefits (10 minutes a day for some weeks). Or just take 3 breaths in less than a minute. To calm the mind 95 percent of the time and in difficult situations, half the cases take around 1000 hours of meditation training. Meditation takes a long time to master, but it is easy to learn and brings benefits after a short time. Easy to learn and difficult to master. + +One single slow mindful breath can already make you calmer and more relaxed. If you focus on the breath, you are in the present and free from regret (past) and worry (future). So you are freed from burdens during that breath. Tennis players win grand slams because after each point, within 10 to 15 seconds, they can calm down in the present. At the professional level, tennis is a mental game more than a physical one. + +## Meditation Habits + +Create a habit loop to incorporate mindful breathing into your daily routine. For instance, take a deep breath as the first action of your day or use lying down in bed as a cue. Whenever you find yourself waiting, take a moment to breathe mindfully. Embrace meditation as a remedy for boredom—boredom can evolve into an opportunity for meditation, effectively eliminating the feeling of boredom. + +Allow the mind to settle naturally without forcing it. Use the analogy of clear water: when you throw a stone into it, the water becomes turbulent, but given time, it naturally returns to clarity. Similarly, allow your mind the time and space for things to happen on their own. In Tibetan, meditation means "to become familiar," suggesting that through meditation, you become familiar with your mind. + +Effort can sometimes hinder relaxation, so learn to apply less effort initially to encourage relaxation—don't let the desire to achieve stress you. Focus on achieving relaxation first, despite any instincts of the overachiever's ego. Once you're sufficiently relaxed, you can gradually reapply effort. + +Adopt the mindset of easing, inclining, and uplifting the mind toward joy. Instead of forcing joy, gently incline your mind so that it naturally defaults to a joyful state. This inclination toward joy comes through the familiarization process. In Tibetan, meditation translates to familiarity (if I'm not mistaken). The key is to notice joy whenever it appears. While we usually overlook it, by noticing, we realize joy is constantly present. Make a point to recognize joy, such as during a third breath in a mindfulness practice. + +## Amplifying Joy + +The next step attends joy. Pay intense attention to joy. Hold the 3rd breath of joy and amplify it. Amplify it by smiling. Emotions are encoded in facial muscles. And it goes bidirectional. Just by smiling, you can invite/experience joy. Even a half-smile works. Only loving-kindness and compassion are stronger than that joy. Attend fully to the joy of the first bite of a meal. It is subtle, but it is there. Amplify it with a smile as well. That joy is there. Attend to any pleasant experiences in the beginning (meeting someone, feeling the water in a shower...). The next thing that happens is a significant increase in happiness. As you become more and more grateful for all of those joys. + +## Gratitude and Perspective + +Habituation: Joy will go away as time passes and we take things for granted. Zen mind beginner's mind: down-regulate habituation. By noticing nice things and being grateful for it. But strongest: One day I will die, and everyone I love will die. Remind yourself you and everyone I love will die; it will put us in proper perspective and make us even more grateful for what we have now. Once daily!! The less time someone notices he still has to live, the more joy he will have from the things in life. The joy of not being in pain. When in pain, wish not to be in pain. Oh, when I would not be in pain, I would be so happy. But when you are not in pain, you aren't happy as you forgot to be happy. + +## Awareness of Absence + +Noticing the absence of something does not come naturally to us. The only way to become aware of the absence is to pay attention to it. It is trainable to get reminded. Just note "gone" is a powerful way to notice something previously experienced is no more. Watch thoughts and notice them going away and say "gone." This is especially important for seasoned meditators. The more you practice meditation, the more joy it will bring. But it will not always bring joy due to the imperfect variance of the day-to-day mood. Even for monks, but it is important to continue practices. + +## Compassion and Loving-Kindness + +If you smile more, then it is a good sign that meditation practice is helping. E.g., smile without apparent reasons. Reflexive smile when nervous. Thinking another person to be happy makes me happy (loving kindness). This is another key insight of this book. All to be happy instantly is wishing someone else to be happy. It can also be a complete stranger. After ten seconds of secretly doing that, go back to work. Familiarize with the joy of loving kindness. Concentrate fully on the joy arising. E.g. for a minute. Loving kindness: Wishing self or others to be happy. Compassion: wishing to be without suffering, e.g., compulsion to help someone not to drown. Compassion is the most joyful. Why can it be the greatest source of joy if it involves suffering? Suffering makes it so that courage arrives. Confidence arises because of courage. With courage and confidence, clarity arises. The feeling of interconnectedness arises and a selfless love. + +## Path to Compassion + +It takes thousands of hours to practice this unparalleled level of joy (compassion). Loving-kindness is the gateway drug to compassion. Just practice easily loving kindness a lot and then you become a hardcore compassionist. Always thinking you don't deserve the successes because you were just lucky? Well, still owning the attentions for success. The Four Sublime States Contemplations on Love (loving-kindness), Compassion, Sympathetic Joy, and Equanimity (mind doesn't change when things are given or taken). Equanimity: Stay calm in 8/worldly conditions 1. Gain and loss 2. Honor and dishonor 3. Praise and blame 4. Pleasure and pain. + +## Practicing Loving-Kindness + +One hour of weekly loving-kindness meditation greatly improves interactions with others towards positive emotions. If you are strong in loving-kindness people tend to love you. Loving-kindness paves the way to the remaining 3 sublime states. If you are good in loving-kindness, the remaining ones require only a little extra effort. To experience peace and joy under adversity, there must be nothing done but to let go of the pain. Joy and pain can coexist. If the joy is much stronger, then the pain will be displaced. The other way does not work. If the pain is much stronger, joy can still be there. Can be without suffering. E.g. when in pain, you have aversion. + +## Understanding Suffering + +If you have aversion, you suffer. The anger monster feeds on anger. Emotions are simply sensations in the body. They are not you. "Sitting in the fire": When there is pain, it can do what it wants. Simply watch and observe it. It's not you. Working the emotional pain: Go back and see the bigger picture, why is there the pain? Our local perception is often flawed. Need to step back for the bigger picture. Aversion is the proxy to suffering. When you master meditation, it won't resolve all the suffering. E.g., then you juggle 3 balls, it does not automatically mean that you can juggle 4 or more balls. + +## Letting Go + +When suffering, don't think, just feel. The direct causes for suffering are clinging: wanting something and aversion: not wanting something. And not the sensation or the thought. Practicing loving-kindness and compassion will greatly improve your life in the long run. It will not help in every small occasion, though. But overall in the long run. Strive to let go. + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/notes/mind-management.gmi b/notes/mind-management.gmi index 78f5b505..773c8a03 100644 --- a/notes/mind-management.gmi +++ b/notes/mind-management.gmi @@ -16,6 +16,21 @@ These are my personal takeaways after reading "Mind Management" by David Kadavy. ''' ``` +## Table of Contents + +* ⇢ "Mind Management" book notes +* ⇢ ⇢ It's not about time management +* ⇢ ⇢ Empty slots in the calendar +* ⇢ ⇢ When you safe time... +* ⇢ ⇢ Follow your mood +* ⇢ ⇢ Boosting creativity +* ⇢ ⇢ The right mood for the task at hand +* ⇢ ⇢ Creativity hacks +* ⇢ ⇢ Planning and strategizing +* ⇢ ⇢ Fake it until you make it. + +## It's not about time management + Productivity isn't about time management - it's about mind management. When you put a lot of effort into something, there are: * The point of diminishing returns @@ -95,14 +110,14 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other book notes of mine are: -=> ./the-pragmatic-programmer.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ./never-split-the-difference.gmi 2023-04-01 "Never split the difference" book notes -=> ./the-obstacle-is-the-way.gmi 2023-05-06 "The Obstacle is the Way" book notes -=> ./career-guide-and-soft-skills.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes -=> ./mind-management.gmi 2023-11-11 "Mind Management" book notes (You are currently reading this) -=> ./slow-productivity.gmi 2024-05-01 "Slow Productivity" book notes +=> ./staff-engineer.gmi 2024-10-24 "Staff Engineer" book notes => ./the-stoic-challenge.gmi 2024-07-07 "The Stoic Challenge" book notes +=> ./slow-productivity.gmi 2024-05-01 "Slow Productivity" book notes +=> ./mind-management.gmi 2023-11-11 "Mind Management" book notes (You are currently reading this) +=> ./career-guide-and-soft-skills.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes +=> ./the-obstacle-is-the-way.gmi 2023-05-06 "The Obstacle is the Way" book notes +=> ./never-split-the-difference.gmi 2023-04-01 "Never split the difference" book notes +=> ./the-pragmatic-programmer.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ../resources.gmi More books and other resources I found useful. => ../ Back to the main site diff --git a/notes/never-split-the-difference.gmi b/notes/never-split-the-difference.gmi index 7dbb9fc4..3e422377 100644 --- a/notes/never-split-the-difference.gmi +++ b/notes/never-split-the-difference.gmi @@ -16,6 +16,21 @@ These are my personal takeaways after reading "Never split the difference" by Ch ''' ``` +## Table of Contents + +* ⇢ "Never split the difference" book notes +* ⇢ ⇢ Tactical listening, spreading empathy +* ⇢ ⇢ Mindset of discovery +* ⇢ ⇢ ⇢ More tips +* ⇢ ⇢ "No" starts the conversation +* ⇢ ⇢ Win-win +* ⇢ ⇢ On Deadlines +* ⇢ ⇢ Analyse the opponent +* ⇢ ⇢ Use different ways of saying "no." +* ⇢ ⇢ Calibrated question +* ⇢ ⇢ The black swan +* ⇢ ⇢ More + ## Tactical listening, spreading empathy Be a mirror, copy each other to be comfy with each other to build up trust. Mirroring is mainly body language. A mirror is to repeat the words the other just said. Simple but effective. @@ -124,12 +139,13 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other book notes of mine are: -=> ./the-pragmatic-programmer.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ./never-split-the-difference.gmi 2023-04-01 "Never split the difference" book notes (You are currently reading this) -=> ./the-obstacle-is-the-way.gmi 2023-05-06 "The Obstacle is the Way" book notes -=> ./career-guide-and-soft-skills.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes -=> ./mind-management.gmi 2023-11-11 "Mind Management" book notes -=> ./slow-productivity.gmi 2024-05-01 "Slow Productivity" book notes +=> ./staff-engineer.gmi 2024-10-24 "Staff Engineer" book notes => ./the-stoic-challenge.gmi 2024-07-07 "The Stoic Challenge" book notes +=> ./slow-productivity.gmi 2024-05-01 "Slow Productivity" book notes +=> ./mind-management.gmi 2023-11-11 "Mind Management" book notes +=> ./career-guide-and-soft-skills.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes +=> ./the-obstacle-is-the-way.gmi 2023-05-06 "The Obstacle is the Way" book notes +=> ./never-split-the-difference.gmi 2023-04-01 "Never split the difference" book notes (You are currently reading this) +=> ./the-pragmatic-programmer.gmi 2023-03-16 "The Pragmatic Programmer" book notes => ../ Back to the main site diff --git a/notes/search-inside-yourself.gmi b/notes/search-inside-yourself.gmi index 796d5aa7..96944909 100644 --- a/notes/search-inside-yourself.gmi +++ b/notes/search-inside-yourself.gmi @@ -2,6 +2,95 @@ > Last updated 23.7.2024 +## Table of Contents + +* ⇢ "Search Inside Yourself" book notes +* ⇢ ⇢ How to Master Your Mind in 100 Minutes +* ⇢ ⇢ Mindfulness and Personal Development +* ⇢ ⇢ Three Steps of "Search Inside Yourself" +* ⇢ ⇢ Even an Engineer Can Thrive on Emotional Intelligence +* ⇢ ⇢ Emotional Intelligence Enables Three Important Skills +* ⇢ ⇢ ⇢ 1. Stellar Work Performance +* ⇢ ⇢ ⇢ 2. Outstanding Leadership +* ⇢ ⇢ ⇢ 3. The Ability to Create the Conditions for Happiness +* ⇢ ⇢ Attention Training +* ⇢ ⇢ ⇢ Train Attention +* ⇢ ⇢ Self-Knowledge and Self-Mastery +* ⇢ ⇢ Creating Useful Mental Habits +* ⇢ ⇢ Optimize Thyself +* ⇢ ⇢ Train at the Level of Physiology +* ⇢ ⇢ ⇢ High-Resolution Perception +* ⇢ ⇢ Mindfulness in Two Minutes +* ⇢ ⇢ ⇢ Meditation is Exercise +* ⇢ ⇢ ⇢ Sustaining Your Practice +* ⇢ ⇢ Breathing as if Your Life Depends on It +* ⇢ ⇢ Happiness is the Default State of Mind +* ⇢ ⇢ Experience, Without Judging or Reacting +* ⇢ ⇢ Attention and Mindful Meditation is like MacGyver's Swiss Army Knife +* ⇢ ⇢ Meditation techniques +* ⇢ ⇢ ⇢ Expensive Food Meditation +* ⇢ ⇢ ⇢ Walking Meditation +* ⇢ ⇢ Mindful Listening +* ⇢ ⇢ Lightness and Joy in Meditation +* ⇢ ⇢ Mastering Both Focused and Open Attention +* ⇢ ⇢ ⇢ Meditation Circuit Training +* ⇢ ⇢ Zen and a Walking Baby +* ⇢ ⇢ Clarity +* ⇢ ⇢ About Self-Awareness +* ⇢ ⇢ ⇢ 1. Emotional Awareness +* ⇢ ⇢ ⇢ 2. Accurate Self-Assessment +* ⇢ ⇢ ⇢ 3. Self-Confidence +* ⇢ ⇢ Developing Self-Awareness +* ⇢ ⇢ ⇢ Body Scan +* ⇢ ⇢ ⇢ Scan for Emotion +* ⇢ ⇢ ⇢ Journaling +* ⇢ ⇢ My Emotions Are Not Me +* ⇢ ⇢ Riding Your Emotions Like a Horse +* ⇢ ⇢ Self-Regulation +* ⇢ ⇢ ⇢ Practice of Letting Go +* ⇢ ⇢ ⇢ Know When You Are Not in Pain +* ⇢ ⇢ Dealing with Triggers +* ⇢ ⇢ ⇢ Siberian North Railroad +* ⇢ ⇢ ⇢ Siberian North Railroad Practice +* ⇢ ⇢ ⇢ When You Get Triggered: +* ⇢ ⇢ ⇢ Creating Willingness to Experience and Accept the Emotions: +* ⇢ ⇢ Making Friends with Emotions +* ⇢ ⇢ Pleasure, Passion, and Higher Purpose +* ⇢ ⇢ Motivation in Three Easy Steps +* ⇢ ⇢ ⇢ Alignment: Having Fun for a Living +* ⇢ ⇢ ⇢ Flow +* ⇢ ⇢ ⇢ Autonomy, Mastery, Purpose +* ⇢ ⇢ Envisioning +* ⇢ ⇢ ⇢ Discovering My Ideal Future +* ⇢ ⇢ Resilience +* ⇢ ⇢ ⇢ Meditation on Resilience +* ⇢ ⇢ Cognitive Resilience +* ⇢ ⇢ Empathy +* ⇢ ⇢ Creating Mental Habits +* ⇢ ⇢ ⇢ Just Like Me / Loving Kindness Practice +* ⇢ ⇢ Establishing Trust is Good for Work +* ⇢ ⇢ ⇢ Three Assumptions +* ⇢ ⇢ ⇢ Empathic Listening +* ⇢ ⇢ Political Awareness +* ⇢ ⇢ Mental Habits of Highly Empathic People +* ⇢ ⇢ ⇢ Being Effective and Loved at the Same Time +* ⇢ ⇢ ⇢ Using Kindness to Grow Friendship from an Ugly Situation +* ⇢ ⇢ Leading with Compassion +* ⇢ ⇢ ⇢ Difficult Conversations +* ⇢ ⇢ Mindful E-Mailing +* ⇢ ⇢ ⇢ Practice of Mindful E-Mailing +* ⇢ ⇢ Three Easy Steps to World Peace +* ⇢ ⇢ ⇢ Align Meditation with Real Life +* ⇢ ⇢ MacGyver's Swiss Army knife +* ⇢ ⇢ Other +* ⇢ ⇢ Audio Book notes +* ⇢ ⇢ ⇢ Books to Check Out +* ⇢ ⇢ ⇢ Videos + +## How to Master Your Mind in 100 Minutes + +If you are thinking of reading the book "Search Inside Yourself," you can also check out a very short summary of it in a book called "How To Master Your Mind in 100 Minutes: Increase Productivity, Creativity and Happiness (Collins Shorts, Book 8)." However, it is not the whole story! + ## Mindfulness and Personal Development Mindfulness is not about reaching a different destination; it's about fully inhabiting your current state and recognizing the power of your complete presence and awareness at this moment. This book is about the potential everyone has to develop an extraordinarily capable mind that is profoundly peaceful, happy, and compassionate. It emphasizes the importance of deeper emotional awareness—the ability to detect an emotion as it arises, observe it as it subsides, and notice all the subtle changes in between. @@ -93,6 +182,8 @@ The aim of developing emotional intelligence is to help you optimize yourself an It is possible to train the brain to overcome even serious emotional disorders; just imagine the possibility of using it to greatly improve the quality of our emotional lives. This also works with physical pain. Suffering can be trained "away." Brain. Trainable. Good. +Social skills are highly trainable and can also help others love you, by the way. + ## Train at the Level of Physiology Every emotion has a correlate in the body. Emotional experiences are not just psychological; they are also physiological. We can usually experience emotions more vividly in the body than in the mind. Therefore, when trying to perceive an emotion, it is often more effective to bring our attention to the body rather than the mind. @@ -639,6 +730,14 @@ With that combination of relaxation and alertness, three wonderful qualities of I want to create a world where meditation is widely treated like exercise for the mind. +## MacGyver's Swiss Army knife + +There was a study which tested the development of antibodies (flu shots). One control group meditated, the other didn't before they were given flu shots. Those in the meditation group developed more antibodies to the influenza vaccine than the ones who didn't. Another study revealed, that mindfulness can greatly accelerate the healing of a skin condition known as psoriasis. + +It's also about the ability to pay attention to information for a prolonged period of time where meditation is beneficial. + +Mindfulness feels almost like MagGyver's Swiss Army knife - it is sueful in every situation. + ## Other I see great people. Walking around like regular people. They don't even know they are great. @@ -695,10 +794,6 @@ Uncertainty can occupy your mind, preventing you from doing other things. => http://siybook.com/v/ted_dpink Dan Pink on the surprising science of motivation => http://siybook.com/v/tdd_jbt Jill Bolte Taylor on her "stroke of insight" -For more resources, including those you can use to bring Search Inside Yourself to your own company, visit: - -=> http://www.siybook.com - E-Mail your comments to `paul@nospam.buetow.org` :-) => ../ Back to the main site diff --git a/notes/search-inside-yourself.gmi.tpl b/notes/search-inside-yourself.gmi.tpl new file mode 100644 index 00000000..423534aa --- /dev/null +++ b/notes/search-inside-yourself.gmi.tpl @@ -0,0 +1,716 @@ +# "Search Inside Yourself" book notes + +> Last updated 23.7.2024 + +<< template::inline::toc + +## How to Master Your Mind in 100 Minutes + +If you are thinking of reading the book "Search Inside Yourself," you can also check out a very short summary of it in a book called "How To Master Your Mind in 100 Minutes: Increase Productivity, Creativity and Happiness (Collins Shorts, Book 8)." However, it is not the whole story! + +## Mindfulness and Personal Development + +Mindfulness is not about reaching a different destination; it's about fully inhabiting your current state and recognizing the power of your complete presence and awareness at this moment. This book is about the potential everyone has to develop an extraordinarily capable mind that is profoundly peaceful, happy, and compassionate. It emphasizes the importance of deeper emotional awareness—the ability to detect an emotion as it arises, observe it as it subsides, and notice all the subtle changes in between. + +The book also highlights the significance of giving yourself quality time, such as by reducing work hours. By prioritizing self-care, you can discover ways to achieve more while doing less. + +Additionally, it teaches you to distinguish between stories and reality. Following the exercises in this book, you will learn how to calm your mind on demand and perceive your mental and emotional processes with increasing clarity. + +## Three Steps of "Search Inside Yourself" + +1. **Attention Training** +2. **Self-Knowledge and Self-Mastery** +3. **Creating Useful Mental Habits** + +Train your attention to cultivate a mind that is both calm and clear. This quality of mind forms the foundation for emotional intelligence. + +Develop the ability to observe your thought stream and emotional processes with high clarity and from an objective, third-person perspective. This deep self-awareness eventually leads to self-mastery. + +Imagine thinking, "I wish for this person to be happy," whenever you meet anyone. This habit transforms interactions at work, as sincere goodwill is unconsciously picked up by others, fostering trust and leading to highly productive collaborations. + +## Even an Engineer Can Thrive on Emotional Intelligence + +Emotional intelligence is a strong predictor of success at work and fulfillment in life, and it is trainable for everyone. Emotional competencies are not innate talents; they are learned skills that you can acquire with practice. + +Goleman classifies emotional intelligence into five domains: + +* 1. Self-awareness: Knowledge of one's internal states, preferences, resources, and intuitions. +* 2. Self-regulation: Management of one's internal states, impulses, and resources. +* 3. Motivation: Emotional tendencies that guide or facilitate reaching goals. +* 4. Empathy: Awareness of others' feelings, needs, and concerns. +* 5. Social skills: Adeptness at inducing desirable responses in others. + +## Emotional Intelligence Enables Three Important Skills + +* 1. Stellar Work Performance +* 2. Outstanding Leadership +* 3. Creating Conditions for Happiness + +### 1. Stellar Work Performance + +Top six competencies that distinguish star performers from the average in the tech sector are: + +* 1. Strong achievement drive and high achievement standards. +* 2. Ability to focus. +* 3. Conceptual thinking (intellectual competency). +* 4. Analytical ability (intellectual competency). +* 5. Initiative in taking on challenges. +* 6. Self-confidence. + +From these, only two (conceptual thinking and analytical ability) are purely intellectual competencies. The other four are emotional competencies. So the conclusion is, that training your emotional intelligence can help everyone become outstanding at work, even engineers. + +### 2. Outstanding Leadership + +Effective U.S. Navy commanders are "more positive and outgoing, more emotionally expressive and dramatic, warmer and more sociable (including smiling more), friendlier and more democratic, more cooperative, more likable and 'fun to be with', more appreciative and trustful, and even gentler than those who are merely average." "Nice guys finish first." + +### 3. The Ability to Create the Conditions for Happiness + +Happiness is a skill that can be practiced through deliberate training. The other side effects may include resilience, optimism, and kindness. + +## Attention Training + +Train your attention to cultivate a mind that is both calm and clear. This quality of mind forms the foundation for emotional intelligence. + +### Train Attention + +How to begin training emotional intelligence? Begin by training attention. A strong, stable, and perceptive attention that offers calmness and clarity is the foundation upon which emotional intelligence is built. + +To see ourselves objectively, we need the ability to examine our thoughts and emotions from a third-person perspective. The attention should be stable, clear, and non-judgmental. "Response flexibility" refers to the ability to pause before you act, allowing a moment to consider how to react in an emotional situation. + +Between stimulus and response, there is a space. In that space lies our freedom and power to choose our response. In our response lies our growth and happiness. Attention is trained with "mindfulness meditation." + +Mindfulness is a quality of mind that we all experience and enjoy from time to time, but it can be greatly strengthened with practice. Once it becomes sufficiently strong, it leads directly to the attentional calmness and clarity that forms the basis of emotional intelligence. + +There is scientific evidence showing that improving our ability to regulate our attention can significantly impact how we respond to emotions. Simply with attention training, someone can become good at regulating a part of the brain as primitive and important as the amygdala (the part of the brain dealing with emotions). + +"Affect labeling" is a self-regulation technique, which simply means labeling feelings with words. When you label an emotion you are experiencing (for example, "I feel anger"), it helps to manage that emotion. + +## Self-Knowledge and Self-Mastery + +Develop the ability to observe your thought stream and emotional processes with high clarity and from an objective, third-person perspective. This deep self-awareness eventually leads to self-mastery. + +## Creating Useful Mental Habits + +Imagine thinking, "I wish for this person to be happy," whenever you meet anyone. This habit transforms interactions at work, as sincere goodwill is unconsciously picked up by others, fostering trust and leading to highly productive collaborations. + +## Optimize Thyself + +The aim of developing emotional intelligence is to help you optimize yourself and function at an even higher level than what you are already capable of. Emotional skillfulness frees us from emotional compulsion. Neuroplasticity tells us that we can intentionally change our brains with training. + +It is possible to train the brain to overcome even serious emotional disorders; just imagine the possibility of using it to greatly improve the quality of our emotional lives. This also works with physical pain. Suffering can be trained "away." Brain. Trainable. Good. + +Social skills are highly trainable and can also help others love you, by the way. + +## Train at the Level of Physiology + +Every emotion has a correlate in the body. Emotional experiences are not just psychological; they are also physiological. We can usually experience emotions more vividly in the body than in the mind. Therefore, when trying to perceive an emotion, it is often more effective to bring our attention to the body rather than the mind. + +### High-Resolution Perception + +Your perception can become so refined across both time and space that you can observe an emotion the moment it arises, perceive its subtle changes, and watch it in the moment it ceases. The way to develop high-resolution perception of emotion is to apply mindfulness to the body. + +Because emotions have such a strong physiological component, developing emotional intelligence necessitates operating at the level of physiology. Much of our intuition comes from our body, and learning to listen to it can be very fruitful. Our approach to cultivating emotional intelligence begins with mindfulness. + +## Mindfulness in Two Minutes + +In the evenings, sit together in mindfulness for two minutes. For two minutes a day, quietly enjoy being alive and being together. More fundamentally, for two minutes a day, enjoy just being. The good news is that mindfulness is embarrassingly easy. The hard part in mindfulness is deepening, strengthening, and sustaining it, especially in times of difficulty. + +The creatively named *Easy Way* is to simply bring gentle and consistent attention to your breath for two minutes. That's it. The *Easier Way* is, as its name may subtly suggest, even easier: All you have to do is sit without an agenda for two minutes. + +### Meditation is Exercise + +There is no such thing as bad meditation. After a few weeks or months of starting a regular meditation regime, you have more energy; your mind becomes calmer, clearer, and more joyful; you get sick less; you smile more; your social life improves (because you smile more); and you feel great about yourself. +The best meditation posture is one that helps you remain alert and relaxed at the same time for long periods of time. Use this as a guideline, and find whatever posture is comfortable for you. Keeping eyes closed during meditation is good because it helps you stay calm and keeps away distractions. However, the problem is that you may fall asleep. + +The idea is to open your eyes slightly, look slightly downward, and gaze at nothing in particular. Whether eyes are closed or opened, try out what works best for you. + +### Sustaining Your Practice + +The keyword is practice. Mindfulness is like exercise - it is not sufficient to just understand the topic; you can only benefit from it with practice. The bad news is that after the first few days, many people find it hard to sustain the practice. Happily, the difficulty of sustaining a mindfulness practice often lasts only a few months. + +It is like starting an exercise regime. The first few months are usually really hard - you probably have to discipline yourself into exercising regularly, but after a few months, you find your quality of life changing dramatically. You become happier, calmer, more emotionally resilient, more energetic, and people like you more because your positivity emanates onto them. + +* *Do less than you can:* Keep the practice from becoming a burden. If mindfulness practice feels like a chore, it's not sustainable. +* *Take one breath a day:* I may be the laziest mindfulness instructor in the world because I tell my students all they need to commit to is one mindful breath a day. Just one. Breathe in and breathe out mindfully, and your commitment for the day is fulfilled; everything else is a bonus. If you commit to one breath a day, you can easily fulfill this commitment and can then preserve the momentum of your practice. + +Also, creating the intention to meditate is itself meditation. + +## Breathing as if Your Life Depends on It + +There is nothing mysterious about meditation; it's really just mental training. Meta-attention, the attention of attention, is the ability to pay attention to attention itself. Simply put, meta-attention is the ability to know that your attention has wandered away. + +When your meta-attention becomes strong, you will be able to recover a wandering attention quickly and often. If you recover attention quickly and often enough, you create the effect of continuous attention, which is concentration. When the mind becomes highly relaxed and alert at the same time, three wonderful qualities of mind naturally emerge: calmness, clarity, and happiness. + +## Happiness is the Default State of Mind + +Happiness is not something you pursue; it is something you allow. Happiness is just being. That insight changed my life. The biggest joke is that after all that has been done in the history of the world in the pursuit of happiness, it turns out that sustainable happiness is achievable simply by bringing attention to one's breath. Life is funny. + +Mindfulness can increase happiness without changing anything else. We take for granted many of the neutral things in life, such as not being in pain, having three meals a day, and being able to walk from point A to point B. In mindfulness, these become causes of joy because we no longer take them for granted. Pleasant experiences become even more pleasant because our attention is there to fully experience them. + +## Experience, Without Judging or Reacting + +Whatever it is that you are experiencing, just experience it. Do not judge it to be good or bad. Let it be. If possible, try not to react to it. If you have to react (for example, if you really have to scratch), try to take five breaths before reacting. + +The reason for this is to practice creating space between stimulus and reaction. The more we are able to create space between stimulus and reaction, the more control we will have over our emotional lives. This skill that you develop here during sitting can be generalized to daily life. + +## Attention and Mindful Meditation is like MacGyver's Swiss Army Knife + +The reason we create a powerful quality of attention is to develop insights into the mind. Just eight weeks of mindfulness meditation made subjects measurably happier and showed an increase in immunity. Upgrading the operating efficiency of our brains with mindfulness meditation is akin to pumping iron: if you work out a lot, you will have bulging muscles even when you are not working out in the gym. Similarly, with extensive meditation training, you will have strong mental "muscles" for calmness, clarity, and joy even when you are just hanging out. + +It is remarkable that mindfulness helps improve everything from attention and brain function to immunity and skin disease. Mindfulness feels almost like MacGyver's Swiss Army knife - it is useful in every situation. Your attention naturally gravitates towards things that are either very pleasant or very unpleasant, so if you can train yourself to keep your attention on something as neutral as your breath, then you can maintain your attention on anything. + +## Meditation techniques + +### Expensive Food Meditation + +Imagine if every meal was rare and expensive. Call it "expensive food meditation." In this case, every meal becomes superb. Accelerate this by purposefully bringing mindfulness to daily activities. Bring full moment-to-moment attention to every task with a nonjudgmental mind, and every time your attention wanders away, just gently bring it back. + +It is just like sitting meditation, except the object of meditation is the task at hand rather than just the breath. + +### Walking Meditation + +Practice walking meditation every time you walk from the office to the restroom and back. Mindful walking is restful for the mind, and a relaxed mind is conducive to creative thinking. Problems often get solved in the mind during restroom breaks. + +## Mindful Listening + +When a friend or loved one is speaking to you, adopt a generous attitude by giving the person the gift of your attention and airtime. The most precious gift we can offer others is our presence. When mindfulness embraces those we love, they will bloom like flowers. If there are people in your life you care about, be sure to give them a few minutes of your full attention every day. They will bloom like flowers. + +The main reason we do not listen to others is that we get distracted by our own feelings and internal chatter. The best way to respond to these internal distractions is to notice and acknowledge them. Listening means giving the gift of attention to the speaker. Looping means closing the loop of communication by demonstrating that you have heard what the person is saying. Dipping means checking in with yourself, knowing how you are feeling about what you hear. + +You can practice mindful conversation during any interaction, but it is most useful when communication is at an impasse, such as in a conflict situation. After the speaker offers their input, repeat their remarks in your own words to ensure you understood them correctly. + +## Lightness and Joy in Meditation + +When I was new to meditation, I struggled with the simplest and silliest of all problems: I could not breathe. I tried too hard. Once I stopped trying so hard, I caught myself breathing normally. That was the first time I was able to pay attention to my breath properly. Only by not trying did I finally succeed. + + In a humorous way, meditation is like trying to fall asleep. The more relaxed you are, the less you are fixated on the goal, the easier it becomes, and the better the outcome. The better you are at letting go, the better you become at both meditating and falling asleep. Relaxation is the foundation of deep concentration. + +A similar mechanism works in the practice of mindfulness. I found lightness to be highly conducive to mindfulness. Lightness gives rise to ease of mind. When the mind is at ease, it becomes more open, perceptive, and nonjudgmental. + +A good way to practice mindfulness is by using joy as an object of meditation, especially the type of joy with a gentle quality that doesn't overwhelm the senses. For example, taking a nice walk, holding hands with a loved one, enjoying a good meal, carrying a sleeping baby, or sitting with your child while she is reading a good book are great opportunities to practice mindfulness by bringing full moment-to-moment attention to the joyful experience, to the mind, and to the body. I call it Joyful Mindfulness. + +The first effect of bringing mindfulness to joyful experiences is that they become even more enjoyable, simply because you are more present to enjoy them - extra enjoyment at no additional cost. Joyful Mindfulness is not a replacement for formal sitting practice but a complement to it. Formal practice requires you to bring mindfulness to neutral experiences like your breath. + +* Formal mindfulness: Gives you better mindfulness gains but also requires discipline. +* Joyful Mindfulness: Gives you fewer mindfulness gains but is far more sustainable. + +Doing both practices every day is like making use of the full set of gears in your car: You can start the car moving smoothly and get it to a good speed. After a while, formal meditation may be infused with a powerful quality known in Sanskrit as sukhā. The most common translations for sukhā are "bliss," "ease," and "happiness." + +Sukhā is the quality of joy that does not require energy. It is almost like white noise in the background, something that is always there but seldom noticed. It is highly sustainable and so subtle that it takes a very quiet mind to access. You need to learn to quiet the mind to reach it. Once skillful at doing that, you have a highly sustainable source of happiness that does not require sensual input. Talk about life-changing. + +## Mastering Both Focused and Open Attention + +Strength and stamina. To be a well-rounded athlete, it is good to have both. Focused attention and open attention. To be an accomplished meditator, it is good to be strong in both. Focused attention is an intense focus on a chosen object. Open attention is a quality of attention willing to meet any object that arrives at the mind or the senses. + +There are a few important features common to both focused and open attention: + +* Strong meta-attention (attention of attention) +* Clarity and vividness of attention +* Both meditations require a balance of effort and relaxation. + +Regarding the last point: Too much effort makes it tiring and unsustainable, while too little effort causes you to lose your grip on your attention. One fun way of maintaining this balance is to play it like a video game: Just difficult enough to be challenging but not so difficult that you will lose every time. In either meditation, it is possible to get into a very good state of ease and flow. Very cool. + +### Meditation Circuit Training + +* 1. Sit comfortably in a position that enables both relaxation and alertness at the same time. +* 2. Shift into focused attention. Focus on the breath or any other object of meditation you choose. Do this for 3 minutes. +* 3. Shift into open attention. Bring your attention to whatever you experience and whatever comes to mind. Do this for 3 minutes. +* 4. Repeat focused attention for 3 minutes and open attention for 3 minutes. +* 5. End by resting the mind. If you like, you can again visualize the breath to be a resting place, or a cushion, or a mattress, and let the mind rest on it. (Long pause). + +## Zen and a Walking Baby + +There seem to be two stages in one's meditation progress, which I call "initial access" and "consolidation." + +* Initial Access Stage: In this stage, you find yourself able to access a certain state of mind, but you cannot maintain that mind for very long. +* Consolidation Stage: This is when you become able to bring up a state of mind on demand, at a desired intensity and duration. Progress in this stage seems to be an exponential function. + +This means you may go for a frustratingly long time without any apparent progress, and then suddenly—boom—within a very short period, you make huge strides and arrive at full consolidation. The lesson here is to avoid feeling discouraged when your meditation does not seem to be progressing. It will come suddenly, and every moment of effort brings you closer to that point. In Zen, we call it gradual effort and sudden enlightenment. + +## Clarity + +Compare two versions of a picture: one with higher resolution and vividness than the other. The combination of resolution and vividness makes the image more useful to us. We can also make meditation more useful in two ways: + +* Increase the Resolution: Enhance the precision at which we perceive our emotions, so we can see emotions the moments they arise and cease, and notice subtle changes in between. +* Increase the Brightness and Contrast: Make our perceptions more vivid. + +This combination provides us with very useful high-definition information about our emotional life. + +## About Self-Awareness + +"I cannot scream at that guy; he is the CEO!" Our engagement of the neocortex in every experience of emotion is a necessary step in gaining control over our emotional lives. The moment you can see a raging river, it means you are already rising above it. Similarly, the moment you can see an emotion, you are no longer fully engulfed in it. + +Daniel Goleman defines emotional competence as a "learned capability based on emotional intelligence that results in outstanding performance at work." He suggests three emotional competencies under the domain of self-awareness: + +### 1. Emotional Awareness + +Recognizing one's emotions and their effects. It asks questions like: What are my strengths and weaknesses? What are my resources and limitations? What matters to me? Accurate self-assessment builds on emotional awareness. + +### 2. Accurate Self-Assessment + +Knowing one's strengths and limits. This is also referred to as "self-objectivity." On competence assessments, average performers typically overestimate their strengths, whereas star performers rarely do; if anything, the stars tend to underestimate their abilities, an indicator of high internal standards. + +### 3. Self-Confidence + +A strong sense of one's self-worth and capabilities. One is able to project confidence not because they make an effort to look confident, but because there's a sense of humor about their own ego or sense of self-importance. + +Remember to treat the ego with humor and let it be small enough that the "self" doesn't matter, but big enough that you feel perfectly comfortable speaking to a Nobel Peace Laureate at a peace conference as an equal. Understand the most immediate failure mode (e.g., stumbling on English words while speaking) and the recovery mode strategy (e.g., breathing deeply, smiling, maintaining mindfulness) and not letting occasional faltering bother you. + +The type of deep self-knowledge and blatant self-honesty needed for sustainable self-confidence means having nothing to hide from oneself. We learn about our deepest priorities in life, what is important to us, and what is not important that we can let go. With that clarity, we create space that allows us to view our own emotional lives as if seeing it as an objective third party. In other words, we gain objectivity, and we begin to perceive each emotional experience clearly and objectively as it is. + +## Developing Self-Awareness + +Self-awareness is a neutral mode that maintains self-reflectiveness even in the midst of turbulent emotions. Mindfulness means paying attention in a particular way: on purpose, in the present moment. Both mindfulness and self-awareness are trainable in similar ways. + +### Body Scan + +Emotion is a physical experience; therefore, the best way to create high-resolution awareness of emotion is by applying mindfulness to the body. The simplest way to do it is to bring mindfulness to your body all the time. The body scan is one of the core practices in stress reduction. + +### Scan for Emotion + +Did you find any emotion in your body? If there is any, just notice its presence in the body. If not, just notice the absence of emotions and catch one if it arises in the next two minutes. Notice that we only invite you to bring a positive emotion in this exercise, not a negative one. Attention drives neurological change. By bringing attention to the body, we help it relax. Very often, bodily tension builds up because we are not paying attention to the body. + +### Journaling + +Journaling is the practice of self-discovery by writing to yourself. It is an important exercise to help you discover what is in your mind that is not in clear, conscious view. You are trying to let your thoughts flow onto paper so you can see what comes up. + +The purpose is an open-ended sentence such as "What I am feeling is..." For those three minutes, write down whatever comes to mind. Try not to think about what you're going to write—just write. There is only one rule: Do not stop writing until your time is up. If you run out of things to write, just write, "I ran out of things to write. I have nothing to write. I still have nothing to write..." until you have something to write about again. + +You can think of journaling as mindfulness of thoughts and emotions: paying moment-to-moment, non-judging attention to thoughts and emotions as they arise. Researchers asked 49 college students to take two minutes on two consecutive days and write about something they found to be emotionally significant. The participants registered improvements in mood and performed better on standardized measures of physiological well-being. Four minutes can make a measurable difference. Pick out one or two prompts each day. Here are some suggested prompts: + +* What I am feeling now is... +* I am aware that... +* What motivates me is... +* I am inspired by... +* Today, I aspire to... +* What hurts me is... +* I wish... +* Others are... +* I made a happy mistake... +* Love is... + +## My Emotions Are Not Me + +As we deepen our self-awareness, we eventually arrive at a very important key insight: we are not our emotions. With enough mindfulness practice, you may eventually notice a subtle but important shift—you may begin to feel that emotions are simply what you feel, not who you are. You may begin to see emotions simply as physiological phenomena. Emotions become what we experience in the body, so we go from "I am angry" to "I experience anger in my body." + +This subtle shift is extremely important because it suggests the possibility of mastery over our emotions. If emotions are simply what I experience in my body, then feeling angry becomes a lot like feeling pain in my shoulders after an extreme workout; both are just physiological experiences over which I have influence. Possessing this insight, one creates the possibility of change within oneself. + +## Riding Your Emotions Like a Horse + +> "One can have no smaller or greater mastery than mastery of oneself." —Leonardo da Vinci + +"Rider, where are you going?" The man on the horse answered, "I don't know. Ask the horse." This story provides a metaphor for our emotional lives. The horse represents our emotions. We usually feel compelled by our emotions. We feel we have no control over the horse, and we let it take us wherever it wants to. Fortunately, it turns out that we can tame and guide the horse. It begins with understanding the horse and observing its preferences, tendencies, and behaviors. Once we understand the horse, we learn to communicate and work with it skillfully. + +## Self-Regulation + +Self-regulation is not about avoiding emotions. Self-regulation is not about never having certain emotions. It is about becoming very skillful with them. The question is if it is possible to stop an unwholesome thought or emotion from arising in the first place. + +Based on my own experience, I think it is impossible. It is impossible to stop a thought or emotion from arising. While we cannot stop such a thought or emotion from arising, we have the power to let it go. The highly trained mind can let it go the moment it arises. This is like "writing on water"—the moment it is written, it disappears. + +### Practice of Letting Go + +Pain and suffering are qualitatively distinct, and one does not necessarily follow the other. Letting go is an extremely important skill and one of the essential foundations of meditation practice. Is it possible to let go and still appreciate and fully experience the ups and downs of life? Yes. The key is to let go of two things: grasping and aversion. Grasping and aversion together account for a huge percentage of the suffering we experience—perhaps 90 percent, maybe even 100 percent. The first important opportunity is the possibility of experiencing pain without suffering. + +The theory is that aversion, not the pain itself, is the actual cause of suffering; the pain is just a sensation that creates that aversion. + +> "If you are distressed by anything external, the pain is not due to the thing itself, but to your estimate of it; and this you have the power to revoke at any moment." —Marcus Aurelius + +The second important opportunity is the possibility of experiencing pleasure without the aftertaste of unsatisfactoriness. The biggest problem with pleasant experiences is that they all eventually cease. We can fully enjoy flowers even though they eventually wilt. + +By letting go of grasping and aversion, we can fully adopt the letting-go mind and also fully experience life in its glorious Technicolor detail. In fact, we may be able to experience life more vividly with the letting-go mind because it frees us from the noisy interferences of grasping, aversion, and suffering. + +### Know When You Are Not in Pain + +When we are suffering from pain, we often tell ourselves, "I'll be so happy if I am free from this pain," but when we are free from the pain, we forget to enjoy the freedom from pain. The lack of distress encourages us to enjoy the sweetness of that freedom, thereby helping us to be happier. + +* Do not feel bad about feeling bad. +* Do not feed the monsters. We cannot stop monsters from arising or force them to leave, but we have the power to stop feeding them (take anger, for example). +* Start every thought with kindness and humor. It is all very funny. So every time I fail, it is a comedy. + +## Dealing with Triggers + +In the context of a threat, real or imagined, our emotional state can rapidly shift into fear or anxiety. Mindfulness helps our thinking brain and our emotional brain communicate more clearly, so they work better together. One common situation in which self-regulation skills really come in handy is when we get triggered. The first step in learning to deal with triggers is identifying when you have been triggered. + +* Body: Shallow breathing, rapid heartbeat, and feeling sick to the stomach +* Emotions: Experiencing a fight-or-flight response +* Thoughts: Feeling like a victim, thoughts of blame and judgment, difficulty paying attention. + +Triggers almost always have long histories behind them. When we get triggered, it is very often because it brings back something from the past, that "she's-doing-that-again" feeling. Triggers are also very often connected to a perceived inadequacy about ourselves that is a source of pain to us, sort of like a raw nerve. + +### Siberian North Railroad + +This practice helps to deal with triggers: + +* Stop +* Breathe +* Notice +* Reflect +* Respond + +SBNRR: SiBerian North RailRoad + +The first and most important step is to stop. Whenever you feel triggered, just stop. Do not react for just one moment. This moment is known as the sacred pause. It enables all other steps. Taking conscious breaths, especially deep ones, calms the body. After breathing, notice. Experience your emotion by bringing attention to your body. + +What does this feel like in the body? In the face, neck, shoulder, chest, back? Notice changes in tension and temperature. Apply mindfulness by experiencing it moment to moment without judging. Try to experience emotional difficulty simply as a physiological phenomenon. If it is anger you are experiencing, for example, your observation is not "I am angry"; it is "I experience anger in my body." + +Now we reflect. Where is the emotion coming from? Is there a history behind it? Is there a self-perceived inadequacy involved? Let's just bring this perspective into the situation. Think about these statements: + +* Everybody wants to be happy +* This person thinks acting this way will make them happy in some way. + +Finally, we respond. Bring to mind ways in which you might respond to this situation that would have a positive outcome. You do not actually have to do it - just imagine the kindest, most positive response. What would that look like? + +### Siberian North Railroad Practice + +* 1. Settling Attention: Start with three breaths. +* 2. Negative Emotion: Let's now shift gears into negative emotion for two minutes. Bring to mind a memory of an unhappy event, an experience of frustration, anger, or hurt, or an experience in which you were triggered. See if you can relive the moment and the associated emotions in your mind. +* 3. Managing Negative Emotion: The first two steps are to stop and breathe. Focus the mind on the breath and not reacting to the emotion. Slow, deep breaths can help. Stay in this state for half a minute. Next, notice. Notice the experience in your body. What does an afflictive emotion feel like in the body? Changes in tension or temperature? Experience the emotion without judging and only as a physiological phenomenon. Take a minute to experience the emotion in the body. +* 4. After that, reflect. Where are the emotions coming from? Is there a history behind it? Is there maybe another person involved? Think about "Everybody wants to be happy. This person thinks acting this way will make them happy in some way." Don't judge it as right or wrong. After 30 more seconds, respond. Bring to mind ways in which you might respond to bring a positive outcome. Take a minute to create that response. +* 5. Return to the present for two minutes. Awareness is back to the breath. In this artificial setting, the process takes only a few minutes. In real life, the whole process may be over in seconds, which may not give you a lot of time to do it right if you do not have sufficient practice. One way to practice this process is to do it retroactively. That means practicing the reflection and response steps after a triggering event is over. + +Given how quickly each episode moves, it's hard to train in real-time, but it's just as effective to do it "offline" retroactively. The more time you spend practicing the reflect-and-respond process offline, the better you will be able to do it in real-time situations. The next time you are triggered, remember to take the SBNRR. It can become a general framework on which we can add other ways of handling triggers. + +### When You Get Triggered: + +A standard practice is to count to ten, which is a more deliberate way of invoking a sacred pause. This practice also has the benefit of giving your mind something else to do, temporarily distracting it from emotions until it is capable of handling the situation. Another practice is to take slow, deep breaths. Taking deep breaths induces a calming effect. Attentional control is good and necessary, but often insufficient. Even if your mind is so highly trained that you can let go of the distress and return to calm very quickly, the issue behind the trigger will remain unresolved, and you will still be similarly triggered in the future. + +Hence, cognitive work is also necessary. Cognitive work here means reframing and reinterpreting the meaning of the situation—seeing things more objectively and with more compassion toward self and others. You can also try seeing positives in the triggers. For example, if you blew up in front of your new boyfriend and are surprised at the level of emotion, this is a perfect time to let things calm down and create space so you can both talk about it, using the situation as an opportunity to help him know you more deeply as a person. + +### Creating Willingness to Experience and Accept the Emotions: + +We suggest two practices. The first is something called "meshing," or visualizing yourself as a mesh screen. As you encounter strong feelings welling up (for example, anger, resentment, fear), let these feelings pass through your body. Observe these intense feelings moving through you, not sticking to you, and see that they are separate from you. The second practice is to pretend your life is a sitcom and appreciate the humor in every absurd situation. By knowing exactly how a system recovers after failure, you can be confident in it even when it fails because you know the conditions under which the system can come back quickly enough that failure is inconsequential. + +We can think of the practices in this chapter as upgrading our recovery mode. Experience the unpleasantness by "riding things out" and "letting your body reset" for fifteen to thirty minutes, and then the "view would open again," and the mind would be clear enough to think properly once more. It was also discovered that someone could gradually shrink the time it takes to "reset" with mindful training. Consequently, we gained confidence in ourselves. + +## Making Friends with Emotions + +Mingyur decided to look deep into his panic. He realized there are two ways to make his panic bigger and stronger: treating it like a boss and obeying its every order, or treating it like an enemy and wishing it to go away. Mingyur decided he would, instead, learn to make friends with panic, neither taking orders from it, nor wishing it to go away, but just allowing it to come and go at will and treating it with kindness. In just three days, his panic went away, permanently. "Panic became my best friend." + +"For three days I stayed in my room meditating. Gradually, I began to recognize how feeble and transitory the thoughts and emotions that had troubled me for years actually were, and how fixating on small problems had turned them into big ones. Just by sitting quietly and observing how rapidly, and in many ways illogically, my thoughts and emotions came and went, I began to recognize in a direct way that they weren't nearly as solid or real as they appeared to be." + +## Pleasure, Passion, and Higher Purpose + +There are three types of happiness: pleasure, passion, and higher purpose. + +* The happiness that arises from pleasure is highly unsustainable. +* Happiness that arises from flow is much more sustainable. +* Happiness arising from higher purpose, in contrast, is highly sustainable. This form of happiness is very resilient and can last for a very long time. + +Interestingly, we instinctively chase after pleasure believing it to be the source of sustainable happiness. This insight also suggests the best way to find motivation at work is to find our own higher purpose. When that happens, our work can become a source of sustainable happiness for us. We can then become very good at our work because we are happy doing it, which in turn allows us to enjoy the happiness of flow with increasing frequency. + +## Motivation in Three Easy Steps + +### Alignment: Having Fun for a Living + +Think of alignment as finding a way to never have to work again for the rest of your life and still get paid. The secret is to create a situation in which your work is something you do for fun, so you are doing it for your own entertainment anyway, and somebody just happens to pay for it. + +Most of the best engineers I have worked with write code as a hobby, so they really just come to the office to hobby away and get paid. Work of this nature has at least one of these two qualities, very often both: + +* The work is deeply meaningful for you +* It generates a state of flow in you + +### Flow + +Flow is a state of peak performance and can be described as "being completely involved in an activity for its own sake. The ego falls away. Time flies. Every action, movement, and thought flows inevitably from the previous one, like playing jazz." + +Flow occurs when the task at hand matches the skill level of the practitioner, such that it is difficult enough to provide a challenge but not so difficult that it overwhelms the practitioner. Flow occurs when difficulty is just right. Flow is a state of focused attention, so people skillful in focusing their attention, such as meditators or martial arts experts, are more likely to find themselves in flow. + +### Autonomy, Mastery, Purpose + +The best motivators are what he calls "intrinsic motivators"—motivation we find within ourselves. + +* Autonomy: The urge to direct our own lives +* Mastery: The desire to get better and better at something that matters +* Purpose: The yearning to do what we do in service of something larger than ourselves + +Monetary incentives do not work well; they can even be counterproductive. The only motivators that work really well are the intrinsic ones: autonomy, mastery, and purpose. "Delivering happiness" infuses autonomy, mastery, and purpose into jobs. + +You will be able to work in ways that offer you autonomy, mastery, and purpose. With that, your work will become a source of happiness. The cornerstone of knowing and aligning thyself is mindfulness. Another way is to journal. Once again, a similar mechanism is at work—the act of verbalizing abstract thoughts makes them clear and tangible. + +## Envisioning + +Envisioning is based on a very simple idea: it's much easier to achieve something if you can visualize yourself already achieving it. As Michael Jordan says: + +> "You have to expect things of yourself before you can do them." + +The basic idea is to envision, discover, and consolidate our ideal future in the mind by writing about it as if it were already true. This is a very powerful practice. + +### Discovering My Ideal Future + +This exercise takes over seven minutes. The prompt is: If everything in my life, starting from today, meets or exceeds my most optimistic expectations, what will my life be like in five years? Consider these questions before writing: + +* Who are you and what are you doing? +* How do you feel? +* What do people say about you? + +Let's spend a minute in silent contemplation before writing. After a minute, start writing. Another variation is to pretend you are already living your ideal future five years from now and to write diary entries from the future. + +Talk About Your Ideal Future a Lot: The more you talk about it, the more real it becomes to you. The second benefit is that the more you talk to people about your ideal future, the more likely you can find people to help you. + +## Resilience + +Resilience is the ability to overcome obstacles along the way. Alignment and envisioning help you find out where you want to go, and resilience helps you get there. We can train resilience on three levels: + +* Inner calm: Just do a lot of mindfulness meditation, and this aspect will be "automagically" taken care of. +* Emotional resilience: Like all emotional experiences, success and failure manifest most strongly in our bodies. The idea is to become comfortable with experiencing these emotions in our bodies. +* Cognitive resilience + +### Meditation on Resilience + +* Calming the mind: Start with 3 deep breaths. Bring gentle awareness to the breath, becoming aware of the in and out breaths, and the spaces in between. +* Failure: Let's now shift gears into an experience of failure for 4 minutes. Observe all the associated emotions and see how they manifest in the body for 2 minutes. After that, let us see if we can create the ability to experience all those emotions without aversion for 2 minutes. +* Success: Let's now have more fun and shift gears into an experience of success for 4 minutes. Let us see if we can create the ability to experience all those emotions without grasping. +* Returning to calm: Let us now return to the present for 3 minutes. Check in with your body and how it feels now. + +## Cognitive Resilience + +What distinguishes successful people is their attitude toward failure, and specifically, how they explain their own failures to themselves. When an optimist suffers a major disappointment, he responds by figuring out how he can do it better next time. In contrast, a pessimist assumes there is nothing he can do about the problem and gives up. + +We naturally pay much more attention to negative than positive occurrences in our lives. For a moment, assume you live a life in which you have twice as many happy moments as unhappy ones. It is like some rich uncle gives you two dollars for every dollar somebody else takes from you. Dude, you win! Objectively, it would look as if you are very lucky and have a very good life. Subjectively, however, since your 2:1 ratio is still well below Fredrickson's 3:1 ratio, you might think, "My life sucks." + +This insight hit me like three Zen sticks hitting my head. It is entirely possible, even likely, that we have much more success than failure in our lives, yet it does not seem that way. Just understanding this can change how you see yourself. + +The second step is mindfulness. Learning optimism requires us to be objective about our own experiences and mindfulness is the best way to create that objectivity. Whenever you experience success or failure, first bring mindfulness to your body. + +The final step is transformation. When experiencing success, take conscious note of it and accept credit for it. This creates a mental habit of paying due attention to your successes. When experiencing failure, focus on realistic evidence suggesting that this setback may be temporary. + +## Empathy + +If you are strong in self-awareness, you are very likely to be strong in empathy. The brain seems to use the same equipment for both tasks. Empathy does not necessarily mean agreeing. It is possible to understand another person at both an intellectual and visceral level with kindness, and still respectfully disagree. + +It is the mark of a developed mind to be able to understand and accept another's feelings without agreeing to them. That insight suggests that it is possible to make tough decisions while still being empathetic. + +Empathy increases with kindness. Kindness is the engine of empathy; it motivates you to care, and it makes you more receptive to others and them to you. The more kindness you offer to people, the better you can empathize with them. + +## Creating Mental Habits + +"Whatever one frequently thinks and ponders upon, that will become the inclination of his mind." In other words, what we think, we become. The method itself is simple: invite a thought to arise in your mind often enough, and it will become a mental habit. For example, if every time you see another person, you wish for that person to be happy, then eventually, it will become your mental habit, and whenever you meet another person, your instinctive first thought is to wish that person to be happy. After a while, you develop an instinct for kindness. + +### Just Like Me / Loving Kindness Practice + +When angry about another person or unhappy generally, meditate about him and think, "He is just like me, all he wants is to be happy and/or accomplish a goal." He also has a normal life just like me and has got issues there as well. Given how social we are and how social we need to be to survive, it makes sense for kindness toward other people to be intrinsically rewarding to ourselves; it is probably an important part of our survival mechanism. One study even suggests that performing one kind act a day over just ten days can measurably increase your happiness. In other words, kindness is a sustainable source of happiness — a simple yet profound insight that can change lives. + +Whenever I have a fight with my wife or a co-worker, I go to another room to calm down, and after a few minutes of calming down, I do this exercise in stealth. A large part of my anger dissipates immediately. The next time you get into conflict with someone you care about or someone you work with, I suggest doing this practice. It may do wonders for your relationships. + +## Establishing Trust is Good for Work + +Empathy is nice, but it is not just nice; it is also essential for helping you succeed at your work, especially if your work involves building a team or coaching, mentoring, and caring for others. There is one basic ability that enables you to be highly effective in all those activities, and that is your ability to establish trust. + +The coaching/mentoring cycle involves these steps: + +* Establish trust +* Listen (by "looping" and "dipping") +* Ask probing and open-ended questions +* Provide feedback +* Partner to create options and practices + +Trust has to begin with sincerity, kindness, and openness, so it is optimally productive to start every relationship that way, both at work and in life. Whenever possible, begin by assuming that the other person is a good person and deserves to be treated as such until proven otherwise. It is useful to always engage the other person as a human being. + +When establishing trust, I find that my cognitive brain is usually easy to deal with—the hard part is placating my emotional brain. To placate the emotional brain, I must recognize that the other person is a human being just like me. The other person is not just a negotiating opponent or a customer or a co-worker; he is also a human being, just like me. When your mind can operate at that level in every situation, especially in difficult situations, you create strong conditions for mutual trust. + +Most people do what they do because it feels like the right thing at the time, based on what they want to accomplish and the information they have. Their reasons make sense to them, even if their actions do not make sense to us. Assume that they are making the right choice, even if we do not understand it or might make a different choice ourselves. + +One way I can build trust with you is to assume that you are trustworthy and to treat you that way. When you feel that someone trusts you, it makes it easier to trust them back, and vice versa. + +### Three Assumptions + +* Assume that everybody in this room is here to serve the greater good, until proven otherwise. +* Given the above assumption, we therefore assume that none of us has any hidden agenda, until proven otherwise. +* Given the above assumption, we therefore assume that we are all reasonable even when we disagree, until proven otherwise. + +### Empathic Listening + +Empathic listening is a very powerful skill. As part of an exercise, I listened for my exercise partner's feelings as she spoke, and then I told her what I thought she felt. After I was done, she started to cry. We never explain to the class how to do empathic listening. They discover for themselves that empathic listening is an ability we are born with. + +Begin the conversation by thinking to yourself, "I want this person to be happy." When listening, practice mindful listening. Remind yourself to listen for the other person's feelings. Be curious about what he or she may be feeling. + +Besides listening to people empathically, something else you can do to bring out their best is to praise them. Always praise authentically (or never praise falsely). If your praise is not genuine, it will be sniffed out, and you will lose credibility. Those praised for being smart performed significantly worse than other groups, while those praised for their effort significantly outperformed other groups. Being praised for being smart is bad for you. + +The explanation offered by researchers in these and related studies is that when a person is given person praise, it reinforces a "fixed mindset," or the belief that our success is due to fixed traits that are given. When a person is given process praise, in contrast, it reinforces a "growth mindset," or the belief that our qualities can be developed through dedication and effort. + +It is better to structure feedback around effort and growth than by labeling the person as "being smart." Simply put, it's better to praise people for working hard than for being smart. + +## Political Awareness + +Political awareness is empathy++. Political awareness is one of the most useful skills you can equip yourself with in any organization. In political awareness, you understand the feelings, needs, and concerns of individual people and how those feelings, needs, and concerns interact with those of others and weave into the emotional fabric of the organization as a whole. + +There are a lot more variables to understand in political awareness, but the basic skill required is the same. If you understand people and you understand the interactions between them, you will understand the whole organization. That is political awareness. + +During a conflict, it is entirely possible for both sides to be 100 percent correct and 100 percent reasonable and still have conflict. One common reason is that people implicitly value different priorities. Unless each is able to understand and internalize the other's implicit priorities, there will be a conflict. Another common reason is that we have incomplete data and implicit assumptions. + +This reminds me of a joke: + +> "Two guys had a major disagreement they could not resolve, so they decided to consult a wise guru. The first guy presented his argument to the guru, and the guru nodded his head and said, 'Yes, you are right.' The second guy presented his diametrically opposing argument to the guru, and again the guru nodded his head and said, 'Yes, you are right.' A third guy watching the entire exchange got a little bit annoyed and asked the guru, 'Wait, something is wrong. They cannot possibly both be right at the same time.' And the guru nodded his head and said, 'Yes, you are right.'" + +## Mental Habits of Highly Empathic People + +Empathy comes pre-installed in your brain; we are all hardwired to be empathic. However, the main takeaway of this chapter is that empathy is something you can improve with practice, and most of that practice involves mindfulness and creating mental habits that are conducive to empathy. + +Chief among those mental habits is kindness. Having the mental habit of kindness means that every time you interact with a human being, the habitual and effortless thoughts that arise in your mind are, "This person is a human being just like me. I want him or her to be happy." + +Another mental habit is being open to understanding how other people can seem reasonable, at least from their own points of view, even when you disagree with them. This mental habit enables you to view social interactions with more clarity and objectivity. + +### Being Effective and Loved at the Same Time + +> You can make more friends in two months by becoming really interested in other people than you can in two years by trying to get other people interested in you. Which is just another way of saying that the way to make a friend is to be one — Dale Carnegie. + +Being Loved is Good for Your Career. They get closer to people and are significantly more open in sharing thoughts and feelings than their low-performing counterparts. We will work harder and more effectively for people we like. In fact, being liked may be the most effective way to get things done in the long term. The most effective naval commanders are also the ones with higher emotional intelligence and who are most liked. + +### Using Kindness to Grow Friendship from an Ugly Situation + +Even in difficult situations, it is sometimes possible to make important things happen while still creating happy friendships. The best place to sharpen your emotional skills is the real world. The real world is both your dojo and your zendo, from which you will get your mojo. + +## Leading with Compassion + +Compassion is the cause for the highest level of happiness ever measured, and it's a necessary condition for the most effective form of leadership known. This must be mind-blowing to many people because many of us consider compassion to be an unpleasant mental state, but here is scientific data showing precisely the reverse—that compassion is a state of extreme happiness. + +What is the second happiest state ever? It is "open awareness," a state in which the mind is extremely open, calm, and clear. Even if you perfect that practice, the most you can achieve is the second happiest state. The happiest state can only be achieved with compassion, which requires engagement in real life with real people. If you are a deep meditator, remember to open your door and go out once in a while. + +Compassionate leadership is the most effective leadership. Compassion is a mental state endowed with a sense of concern for the suffering of others and the aspiration to see that suffering relieved. Specifically, compassion has three components: + +* A cognitive component: "I understand you" +* An affective component: "I feel you" +* A motivational component: "I want to help you" + +The most compelling benefit of compassion in the context of work is that it creates highly effective leaders. Transformation from "I" to "We" is the most important process leaders go through in becoming authentic. + +I recommend you read "Good to Great." The first and perhaps the most important finding in the book is the role of leadership. It takes a very special type of leader to bring a company from goodness to greatness. Collins calls them "Level 5" leaders. These leaders are highly ambitious, but their ambition is not self-focused; instead, they are ambitious for the greater good. Because their attention is focused on the greater good, they feel no need to inflate their own egos, making them highly effective and inspiring. + +The three components of compassion can be used to train the two distinguishing qualities of Level 5 leadership: + +* Affective (I feel for you) +* Cognitive (I understand you) +* Motivational (I want to help you) + +The Ambition is for the greater good. + +And to stay humble. We can train compassion similarly to the way we train loving-kindness by creating mental habits. We increase the ability of the mind to perceive and increase goodness, both within ourselves and toward others. + +The key is not to acquire influence but to expand the influence we already have and use it for the good of all. The most important first step to expanding our influence is to understand the social brain well enough to skillfully navigate it. Our brains respond far more strongly to negative experiences than comparable positive ones. How many positive experiences does it take to balance out a comparable negative experience? It depends, but around a 3-to-1 ratio. + +A marriage to succeed must have at least five times as many positive interactions in the relationship as negative ones, a 5:1 ratio known as the "magic ratio." + +* Autonomy: The degree of control that an organism can exert over something that creates stress determines whether the stressor alters the organism's functioning. In other words, it's not the stress itself that gets to you; it's the feeling of helplessness in the face of that stress. + +* Relatedness: The only experience in life that makes people sustainably happy over time is the quality and quantity of social connections. + +* Fairness: Never underestimate a person's sense of fairness; it is overwhelming enough that one often may sacrifice their own self-interest for its sake. If you want to influence people, there is no greater power than goodness. + +### Difficult Conversations + +Difficult conversations are conversations that are hard to have. They are often important, but because they are hard, we usually prefer to avoid them. Two classic examples of difficult conversations in the workplace are asking for a raise and giving a valued employee critical feedback. Conducting difficult conversations is a skill— an extremely useful one, indeed. + +There are five steps to conducting a difficult conversation: + +* Prepare by walking through the "three conversations." +* Decide whether to raise the issue. +* Start from the objective "third story." +* Explore their story and yours. +* Problem solve. + +Sometimes, the right thing to do is not to raise the issue at all. If you decide to raise the issue, try shifting into a mode that supports learning and problem-solving. The "Third Story" is the way things happened from the perspective of a disinterested third party who is aware of the whole situation. The third story is the best one with which to start a difficult conversation. It is the most objective and the one with which you are most likely to form common ground with the other party. + +Explore their story and yours. Listen to their story. Empathize. Share your story. Explore how you each perceive the same situation differently. Reframe the stories from one of blame and accusation to one of learning. + +Problem-solve: Invent solutions that meet each side's most important concerns and interests. Find ways to continue keeping communications open and taking care of each other's interests. Happily, if you have been working hard on all the practices in Search Inside Yourself, you have already acquired most of the skills you need to conduct difficult conversations. The only thing you need is to acquire two key insights. + +The first key insight is that impact is not the same as intention. For example, if we feel hurt by something somebody said, we may automatically assume that the person intended to hurt us. In many situations, however, the impact is not the intention. For example, when Henry's wife told him to stop and ask for directions, he felt belittled, but she honestly did not set out intending to belittle his sense of manhood; she merely intended to arrive at the party on time. Her impact was not her intention. + +The second key insight is that beyond the content and emotions in every difficult conversation, there are, more importantly, issues of identity. For example, if my manager wants to talk to me about the slow progress of my project, the thing that will bother me most is not the content of that conversation or my feelings of anxiety, but my self-doubt concerning my own competence. In other words, the thing that will most bother me is the identity issue of "Am I incompetent?" + +The best way to prepare for difficult conversations is to talk to other people. If you prefer to work alone, you may do it as a writing exercise instead. + +## Mindful E-Mailing + +The biggest problem with e-mail is that the emotional context is often miscommunicated, sometimes with disastrous results. When we talk to another person face-to-face, most of the emotions we communicate with each other are done nonverbally, usually with our facial expressions, tone of voice, postures, and gestures. Most of that communication happens unconsciously. + +When we communicate via e-mail, however, we lose that entire mechanism for communicating feelings. But wait, it gets worse. When the brain receives insufficient data about others' feelings, it just makes stuff up. The brain makes assumptions about the emotional context of the message and then fabricates the missing information accordingly. It does not just fabricate information, however. It also automatically believes those fabrications to be true. Worse still, those fabrications usually have a strong negative bias - we usually assume people to have more negative intentions than they actually do. +That is why there is so much miscommunication over e-mail. We frequently get offended or frightened by e-mails that were never intended to offend or frighten. Fortunately, mindfulness can help vastly improve the quality of your e-mail communications. The first thing we recollect is that there is a human being on the other end, a human being just like me. The second thing we recollect is this insight that people who receive e-mails unconsciously fabricate missing information about the emotional context of the sender, so we apply the appropriate care and caution. + +### Practice of Mindful E-Mailing + +* Begin by taking one conscious breath. If this is a particularly sensitive situation, calm your mind with a few minutes of Mindfulness Meditation or Walking Meditation. +* Mindfully reflect that on the receiving end, there are one or more human beings. Human beings just like me. If this is a particularly difficult situation, it may be useful to visualize the receiver or receivers in your mind and to engage in a few minutes of Just Like Me / Loving Kindness exercise. +* Write your e-mail +* Before sending, mindfully reflect on the insight that if the emotional context of your message is unclear, the receiver's brain will just make something up that is likely more negative than you intended. Put yourself in the receiver's shoes, pretend you know nothing about the sender's (your) emotional context, pretend also that you have a negative bias, and read your e-mail. Revise your e-mail if necessary. +* Take one conscious breath before pressing Send. If this is a particularly delicate situation - for example, if you are writing an angry e-mail to your boss or your subordinate - take three slow, conscious breaths before pressing Send. Feel free to change your mind about pressing Send. + +## Three Easy Steps to World Peace + +With that combination of relaxation and alertness, three wonderful qualities of mind naturally emerge: calmness, clarity, and happiness. Here's an analogy: Think of the mind as a snow globe that is shaken constantly. When you stop shaking the snow globe, the white "snow" particles within it eventually settle, and the fluid in the snow globe becomes calm and clear at the same time. Similarly, the mind is normally in a constant state of agitation. With deep mental relaxation and alertness, the mind settles into calmness and clarity. In this state of mind, the third quality, inner happiness, naturally emerges. + +### Align Meditation with Real Life + +* Everybody knows that "Exercise is good for me." There is no more debate. While it is true that not everybody takes the trouble to work out, even those who don't work out know that they should and that it would be good for them. +* Anyone who wants to exercise can learn how to do it. The information is widely available, trainers are readily accessible if you want one, and many people have friends who work out who can show them how to exercise. 3. Companies understand that healthy and physically fit workers are good for business. Many companies even have gyms or provide subsidies for gym memberships. +* Exercise is taken for granted. Exercise is so taken for granted today that when you tell your friends you are going to the gym to work out, nobody looks at you funny and thinks you are some New Age crank from San Francisco. In fact, it is now the reverse. If you, for example, argue that a pious American should never exercise, people look at you funny. + +I want to create a world where meditation is widely treated like exercise for the mind. + +## MacGyver's Swiss Army knife + +There was a study which tested the development of antibodies (flu shots). One control group meditated, the other didn't before they were given flu shots. Those in the meditation group developed more antibodies to the influenza vaccine than the ones who didn't. Another study revealed, that mindfulness can greatly accelerate the healing of a skin condition known as psoriasis. + +It's also about the ability to pay attention to information for a prolonged period of time where meditation is beneficial. + +Mindfulness feels almost like MagGyver's Swiss Army knife - it is sueful in every situation. + +## Other + +I see great people. Walking around like regular people. They don't even know they are great. + +## Audio Book notes + +Understanding emotional intelligence starts with self-awareness. Mindfulness plays a crucial role in this process. Like a Swiss army knife, mindfulness is versatile and beneficial in any situation. + +A life filled with self-awareness, happiness, and kindness is enriched by meditation. Meditation has no specific goal; it simply provides time to disconnect from goals and other distractions. + +You will learn to calm your mind on demand. Response flexibility involves pausing before reacting. + +Happiness is an optimal state of being, not just a stream of positive emotions. It is a skill that can be trained and sustained over time. Our default level of happiness, or happiness setpoint, can be moved through training. + +Labeling your emotions, such as saying "I feel anger," can make it easier to manage them. You can consciously capture anger before it fully arises by noticing changes in breath or tension. + +Meta-attention is the awareness of your attention. If your mind wanders and you notice it, you can regain your focus. The stronger your meta-attention, the more continuous and robust your attention becomes. + +Mindfulness is especially useful when you can call upon it in daily life. To keep meditation sustainable, practice less than you think you can handle. For instance, meditating for just 5 minutes or taking a deep breath can be effective. Sit frequently, but for short durations. + +Ease and flow are best achieved through meditation. Simply rest for 10 minutes. Self-confidence stems from self-knowledge. + +Paying attention to the body helps it relax, leading to overall increased relaxation. Most people are stressed because their bodies are not relaxed. + +Daily journaling about emotionally impactful events, such as for 10 minutes a day, leads to improvement. + +Self-control is not about suppressing emotions but about skillfully managing them. While it is impossible to prevent a thought or emotion from arising, we have the power to let it go. + +Counting to ten is a deliberate practice to avoid reacting to emotions or triggers. Taking a restroom break can also help. Allow feelings to pass through you like a mesh. + +Uncertainty can occupy your mind, preventing you from doing other things. + +### Books to Check Out + +* *Emotional Intelligence: Why It Can Matter More Than IQ* by Daniel Goleman +* *Working with Emotional Intelligence* by Daniel Goleman +* *Difficult Conversations* - It is useful and thin, can be read during a single flight. +* *The Miracle of Mindfulness* by Thich Nhat Hanh - Short and sweet +* *Wherever You Go, There You Are* by Jon Kabat-Zinn +* *The Joy of Living* by Mingyur Rinpoche +* *Destructive Emotions: How Can We Overcome Them?* by Daniel Goleman +* *Your Brain at Work* by David Rock + +### Videos + +=> http://siybook.com/v/ted_meng Chade-Meng Tan on how compassion can be practiced in a corporate setting +=> http://siybook.com/v/gtalk_dgoleman Daniel Goleman on emotional intelligence +=> http://siybook.com/v/gtalk_jkz Jon Kabat-Zinn on mindfulness +=> http://siybook.com/v/gtalk_rdavidson Richie Davidson on contemplative neuroscience +=> http://siybook.com/v/gtalk_pgolding Philippe Goldin on the neuroscience of emotions +=> http://siybook.com/v/gtalk_tlewis Thomas Lewis on the neuroscience of empathy +=> http://siybook.com/v/gtalk_drock David Rock on your brain at work +=> http://siybook.com/v/gtalk_shinzen Shinzen Young on the science and practice of mindfulness meditation +=> http://siybook.com/v/ted_dpink Dan Pink on the surprising science of motivation +=> http://siybook.com/v/tdd_jbt Jill Bolte Taylor on her "stroke of insight" + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/notes/slow-productivity.gmi b/notes/slow-productivity.gmi index f8a8b6d3..257409ab 100644 --- a/notes/slow-productivity.gmi +++ b/notes/slow-productivity.gmi @@ -20,6 +20,18 @@ These notes are mainly for my own use, but you may find them helpful. ''' ``` +## Table of Contents + +* ⇢ "Slow Productivity" book notes +* ⇢ ⇢ It's not "slow productivity" +* ⇢ ⇢ Pseudo-productivity and Shallow work +* ⇢ ⇢ Accomplishments without burnout +* ⇢ ⇢ Do fewer things +* ⇢ ⇢ Work at a natural pace +* ⇢ ⇢ Obsess over quality + +## It's not "slow productivity" + "Slow productivity" does not mean being less productive. Cal Newport wants to point out that you can be much more productive with "slow productivity" than you would be without it. It is a different way of working than most of us are used to in the modern workplace, which is hyper-connected and always online. ## Pseudo-productivity and Shallow work @@ -126,14 +138,14 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other book notes of mine are: -=> ./the-pragmatic-programmer.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ./never-split-the-difference.gmi 2023-04-01 "Never split the difference" book notes -=> ./the-obstacle-is-the-way.gmi 2023-05-06 "The Obstacle is the Way" book notes -=> ./career-guide-and-soft-skills.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes -=> ./mind-management.gmi 2023-11-11 "Mind Management" book notes -=> ./slow-productivity.gmi 2024-05-01 "Slow Productivity" book notes (You are currently reading this) +=> ./staff-engineer.gmi 2024-10-24 "Staff Engineer" book notes => ./the-stoic-challenge.gmi 2024-07-07 "The Stoic Challenge" book notes +=> ./slow-productivity.gmi 2024-05-01 "Slow Productivity" book notes (You are currently reading this) +=> ./mind-management.gmi 2023-11-11 "Mind Management" book notes +=> ./career-guide-and-soft-skills.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes +=> ./the-obstacle-is-the-way.gmi 2023-05-06 "The Obstacle is the Way" book notes +=> ./never-split-the-difference.gmi 2023-04-01 "Never split the difference" book notes +=> ./the-pragmatic-programmer.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ../resources.gmi More books and other resources I found useful. => ../ Back to the main site diff --git a/notes/staff-engineer.gmi b/notes/staff-engineer.gmi index 6c184ee0..3d497f5d 100644 --- a/notes/staff-engineer.gmi +++ b/notes/staff-engineer.gmi @@ -1,11 +1,94 @@ # "Staff Engineer" book notes -> Last updated 10.8.2023 +> Published at 2024-10-24T20:57:44+03:00 + +These are my personal takeaways after reading "Staff Engineer" by Will Larson. Note that the book contains much more knowledge wisdom and that these notes only contain points I personally found worth writing down. This is mainly for my own use, but you might find it helpful too. + +``` + ,.......... .........., + ,..,' '.' ',.., + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,'............., : ,.............', ', +,' '............ '.' ............' ', + '''''''''''''''''';''';'''''''''''''''''' + ''' +``` + +## Table of Contents + +* ⇢ "Staff Engineer" book notes +* ⇢ ⇢ The Four Archetypes of a Staff Engineer +* ⇢ ⇢ Influence and Impact over Authority +* ⇢ ⇢ Breadth and Depth of Knowledge +* ⇢ ⇢ Mentorship and Sponsorship +* ⇢ ⇢ Managing Up and Across +* ⇢ ⇢ Strategic Thinking +* ⇢ ⇢ Emotional Intelligence +* ⇢ ⇢ Navigating Ambiguity +* ⇢ ⇢ Visible and Invisible Work +* ⇢ ⇢ Scaling Yourself +* ⇢ ⇢ Career Progression and Title Inflation +* ⇢ ⇢ Not a faster Senior Engineer +* ⇢ ⇢ The Balance +* ⇢ ⇢ More things + +## The Four Archetypes of a Staff Engineer + +Larson breaks down the role of a Staff Engineer into four main archetypes, which can help frame how you approach the role: + +* Tech Lead: Focuses on the technical direction of a team, ensuring high-quality execution, architecture, and aligning the team around shared goals. +* Solver: Gets pulled into complex, high-impact problems that often involve many teams or systems, operating as a fixer or troubleshooter. +* Architect: Works on the long-term technical vision for an organization, setting standards and designing systems that will scale and last over time. +* Right Hand: Functions as a trusted technical advisor to leadership, providing input on strategy, long-term decisions, and navigating organizational politics. + +## Influence and Impact over Authority + +As a Staff Engineer, influence is often more important than formal authority. You’ll rarely have direct control over teams or projects but will need to drive outcomes by influencing peers, other teams, and leadership. It’s about understanding how to persuade, align, and mentor others to achieve technical outcomes. + +## Breadth and Depth of Knowledge + +Staff Engineers often need to maintain a breadth of knowledge across various areas while maintaining depth in a few. This can mean keeping a high-level understanding of several domains (e.g., infrastructure, security, product development) but being able to dive deep when needed in certain core areas. + +## Mentorship and Sponsorship + +An important part of a Staff Engineer’s role is mentoring others, not just in technical matters but in career development as well. Sponsorship goes a step beyond mentorship, where you actively advocate for others, create opportunities for them, and push them toward growth. + +## Managing Up and Across + +Success as a Staff Engineer often depends on managing up (influencing leadership and setting expectations) and managing across (working effectively with peers and other teams). This is often tied to communication skills, the ability to advocate for technical needs, and fostering alignment across departments or organizations. + +## Strategic Thinking + +While Senior Engineers may focus on execution, Staff Engineers are expected to think strategically, making decisions that will affect the company or product months or years down the line. This means balancing short-term execution needs with long-term architectural decisions, which may require challenging short-term pressures. + +## Emotional Intelligence + +The higher you go in engineering roles, the more soft skills, particularly emotional intelligence (EQ), come into play. Building relationships, resolving conflicts, and understanding the broader emotional dynamics of the team and organization become key parts of your role. + +## Navigating Ambiguity + +Staff Engineers are often placed in situations with high ambiguity—whether in defining the problem space, coming up with a solution, or aligning stakeholders. The ability to operate effectively in these unclear areas is critical to success. + +## Visible and Invisible Work + +Much of the work done by Staff Engineers is invisible. Solving complex problems, creating alignment, or influencing decisions doesn’t always result in tangible code, but it can have a massive impact. Larson emphasizes that part of the role is being comfortable with this type of invisible contribution. + +## Scaling Yourself + +At the Staff Engineer level, you must scale your impact beyond direct contribution. This can involve improving documentation, developing repeatable processes, mentoring others, or automating parts of the workflow. The idea is to enable teams and individuals to be more effective, even when you’re not directly involved. + +## Career Progression and Title Inflation + +Larson touches on how different companies have varying definitions of "Staff Engineer," and titles don’t always correlate directly with responsibility or skill. He emphasizes the importance of focusing more on the work you're doing and the impact you're having, rather than the title itself. + +These additional points reflect more of the strategic, interpersonal, and leadership aspects that go beyond the technical expertise expected at this level. The role of a Staff Engineer is often about balancing high-level strategy with technical execution, while influencing teams and projects in a sustainable, long-term way. ## Not a faster Senior Engineer * A Staff engineer is more than just a faster Senior. -* A staff engineer is not a senior engineer but a bit better. (But I want to be a senior engineer but a bit better). +* A staff engineer is not a senior engineer but a bit better. It's important to know what work or which role most energizes you. A Staff engineer is not a more senior engineer. A Staff engineer also fits into another archetype. @@ -36,4 +119,16 @@ Sebactical: Take at least six months. Otherwise, it won't be as restored. E-Mail your comments to `paul@nospam.buetow.org` :-) +Other book notes of mine are: + +=> ./staff-engineer.gmi 2024-10-24 "Staff Engineer" book notes (You are currently reading this) +=> ./the-stoic-challenge.gmi 2024-07-07 "The Stoic Challenge" book notes +=> ./slow-productivity.gmi 2024-05-01 "Slow Productivity" book notes +=> ./mind-management.gmi 2023-11-11 "Mind Management" book notes +=> ./career-guide-and-soft-skills.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes +=> ./the-obstacle-is-the-way.gmi 2023-05-06 "The Obstacle is the Way" book notes +=> ./never-split-the-difference.gmi 2023-04-01 "Never split the difference" book notes +=> ./the-pragmatic-programmer.gmi 2023-03-16 "The Pragmatic Programmer" book notes + => ../ Back to the main site + diff --git a/notes/staff-engineer.gmi.tpl b/notes/staff-engineer.gmi.tpl new file mode 100644 index 00000000..17d29324 --- /dev/null +++ b/notes/staff-engineer.gmi.tpl @@ -0,0 +1,2 @@ +<< cat ../gemfeed/2024-10-24-staff-engineer-book-notes.gmi | sed 's/....-..-..-//; s/-book-notes//;' + diff --git a/notes/the-obstacle-is-the-way.gmi b/notes/the-obstacle-is-the-way.gmi index 426f36d7..b6868663 100644 --- a/notes/the-obstacle-is-the-way.gmi +++ b/notes/the-obstacle-is-the-way.gmi @@ -4,7 +4,6 @@ These are my personal takeaways after reading "The Obstacle Is the Way" by Ryan Holiday. This is mainly for my own use, but you might find it helpful too. - ``` ,.......... .........., ,..,' '.' ',.., @@ -17,6 +16,22 @@ These are my personal takeaways after reading "The Obstacle Is the Way" by Ryan ''' ``` +## Table of Contents + +* ⇢ "The Obstacle is the Way" book notes +* ⇢ ⇢ Reframe your perspective +* ⇢ ⇢ Embrace rationality +* ⇢ ⇢ Control your response +* ⇢ ⇢ Practice emotional and physical resilience +* ⇢ ⇢ Persistence and patience +* ⇢ ⇢ Embrace failure +* ⇢ ⇢ Be adaptable +* ⇢ ⇢ Embrace non-action +* ⇢ ⇢ Leverage crisis +* ⇢ ⇢ Build your inner citadel +* ⇢ ⇢ Love everything that happens +* ⇢ ⇢ Conclusion + "The obstacle is the way" is a powerful statement that encapsulates the wisdom of turning challenges into opportunities for growth and success. We will explore using obstacles as fuel, transforming weaknesses into strengths, and adopting a mindset that allows us to be creative and persistent in the face of adversity. ## Reframe your perspective @@ -27,7 +42,6 @@ We spend a lot of time trying to get things perfect and look at the rules, but w Don't always try to use the front door; a backdoor could open. It's nonsense. Don't fight the judo master with judo. Non-action can be action, exposing the weaknesses of others. - ## Embrace rationality It is a superpower to see things rationally when others are fearful. Focus on the reality of the situation without letting emotions, such as anger, cloud your judgment. This ability will enable you to make better decisions in adversity. Ability to see things what they really are. E.g. wine is old fermented grapes, or other people behaving like animals during a fight. Show the middle finger if someone persists on the stupid rules occasionally. @@ -86,13 +100,13 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other book notes of mine are: -=> ./the-pragmatic-programmer.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ./never-split-the-difference.gmi 2023-04-01 "Never split the difference" book notes -=> ./the-obstacle-is-the-way.gmi 2023-05-06 "The Obstacle is the Way" book notes (You are currently reading this) -=> ./career-guide-and-soft-skills.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes -=> ./mind-management.gmi 2023-11-11 "Mind Management" book notes -=> ./slow-productivity.gmi 2024-05-01 "Slow Productivity" book notes +=> ./staff-engineer.gmi 2024-10-24 "Staff Engineer" book notes => ./the-stoic-challenge.gmi 2024-07-07 "The Stoic Challenge" book notes +=> ./slow-productivity.gmi 2024-05-01 "Slow Productivity" book notes +=> ./mind-management.gmi 2023-11-11 "Mind Management" book notes +=> ./career-guide-and-soft-skills.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes +=> ./the-obstacle-is-the-way.gmi 2023-05-06 "The Obstacle is the Way" book notes (You are currently reading this) +=> ./never-split-the-difference.gmi 2023-04-01 "Never split the difference" book notes +=> ./the-pragmatic-programmer.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ../resources.gmi More books and other resources I found useful. => ../ Back to the main site diff --git a/notes/the-power-of-neuroplasticity.gmi b/notes/the-power-of-neuroplasticity.gmi index 8476dcdc..7607462b 100644 --- a/notes/the-power-of-neuroplasticity.gmi +++ b/notes/the-power-of-neuroplasticity.gmi @@ -2,6 +2,19 @@ These notes capture key points from "The Power of Neuroplasticity" by Shad Helmstetter. These are for my personal use, but you might find them useful, too. +## Table of Contents + +* ⇢ "The Power of Neuroplasticity" book notes +* ⇢ ⇢ Your thoughts can influence changes in your brain +* ⇢ ⇢ Wire on what we can do and not what we can't +* ⇢ ⇢ Choose the friends you spend time woth carefully +* ⇢ ⇢ Beware of the brain's autopilot +* ⇢ ⇢ Cultiate a positive mindset +* ⇢ ⇢ The monkey mind +* ⇢ ⇢ Wiring good attitudes +* ⇢ ⇢ Techniques to train the brain +* ⇢ ⇢ Meditation + ## Your thoughts can influence changes in your brain Your thoughts can influence changes in your brain, a concept derived from the field of neuroscience. It's observed that your brain can rewire itself based on your thoughts and it doesn't remain fixed once you reach adulthood. Its plasticity allows it to adapt even in old age - yes, you can teach an old dog new tricks. If you want to change your life, you need to rewire your brain. This rewiring is a continuous feedback loop. You can program your future self by focusing on your desired outcomes, and your brain will then unconsciously guide you toward them. For instance, if you ruminate negatively about an upcoming presentation, you're likely to perform poorly. You would perform significantly better if you had approached it with a positive mindset. Ultimately, you become what you think about most. diff --git a/notes/the-power-of-neuroplasticity.gmi.tpl b/notes/the-power-of-neuroplasticity.gmi.tpl index 8476dcdc..e911345f 100644 --- a/notes/the-power-of-neuroplasticity.gmi.tpl +++ b/notes/the-power-of-neuroplasticity.gmi.tpl @@ -2,6 +2,8 @@ These notes capture key points from "The Power of Neuroplasticity" by Shad Helmstetter. These are for my personal use, but you might find them useful, too. +<< template::inline::toc + ## Your thoughts can influence changes in your brain Your thoughts can influence changes in your brain, a concept derived from the field of neuroscience. It's observed that your brain can rewire itself based on your thoughts and it doesn't remain fixed once you reach adulthood. Its plasticity allows it to adapt even in old age - yes, you can teach an old dog new tricks. If you want to change your life, you need to rewire your brain. This rewiring is a continuous feedback loop. You can program your future self by focusing on your desired outcomes, and your brain will then unconsciously guide you toward them. For instance, if you ruminate negatively about an upcoming presentation, you're likely to perform poorly. You would perform significantly better if you had approached it with a positive mindset. Ultimately, you become what you think about most. diff --git a/notes/the-pragmatic-programmer.gmi b/notes/the-pragmatic-programmer.gmi index b24f89cb..2ec8798e 100644 --- a/notes/the-pragmatic-programmer.gmi +++ b/notes/the-pragmatic-programmer.gmi @@ -80,13 +80,13 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other book notes of mine are: -=> ./the-pragmatic-programmer.gmi 2023-03-16 "The Pragmatic Programmer" book notes (You are currently reading this) -=> ./never-split-the-difference.gmi 2023-04-01 "Never split the difference" book notes -=> ./the-obstacle-is-the-way.gmi 2023-05-06 "The Obstacle is the Way" book notes -=> ./career-guide-and-soft-skills.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes -=> ./mind-management.gmi 2023-11-11 "Mind Management" book notes -=> ./slow-productivity.gmi 2024-05-01 "Slow Productivity" book notes +=> ./staff-engineer.gmi 2024-10-24 "Staff Engineer" book notes => ./the-stoic-challenge.gmi 2024-07-07 "The Stoic Challenge" book notes +=> ./slow-productivity.gmi 2024-05-01 "Slow Productivity" book notes +=> ./mind-management.gmi 2023-11-11 "Mind Management" book notes +=> ./career-guide-and-soft-skills.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes +=> ./the-obstacle-is-the-way.gmi 2023-05-06 "The Obstacle is the Way" book notes +=> ./never-split-the-difference.gmi 2023-04-01 "Never split the difference" book notes +=> ./the-pragmatic-programmer.gmi 2023-03-16 "The Pragmatic Programmer" book notes (You are currently reading this) -=> ../resources.gmi More books and other resources I found useful. => ../ Back to the main site diff --git a/notes/the-stoic-challenge.gmi b/notes/the-stoic-challenge.gmi index 120d7fd6..16f87152 100644 --- a/notes/the-stoic-challenge.gmi +++ b/notes/the-stoic-challenge.gmi @@ -16,6 +16,15 @@ These are my personal takeaways after reading "The Stoic Challenge: A Philosoph ''' ``` +## Table of Contents + +* ⇢ "The Stoic Challenge" book notes +* ⇢ ⇢ God sets you up for a challenge +* ⇢ ⇢ Negative visualization +* ⇢ ⇢ Oh, nice trick, you stoic "god"! ;-) + +## God sets you up for a challenge + Gods set you up for a challenge to see how resilient you are. Is getting angry worth the price? If you stay calm then you can find the optimal workaround for the obstacle. Stay calm even with big setbacks. Practice minimalism of negative emotions. Put a positive spin on everything. What should you do if someone wrong you? Don't get angry, there is no point in that, it just makes you suffer. Do the best what you got now and keep calm and carry on. A resilient person will refuse to play the role of a victim. You can develop the setback response skills. Turn a setback. e.g. a handycap, into a personal triumph. @@ -48,13 +57,13 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other book notes of mine are: -=> ./the-pragmatic-programmer.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ./never-split-the-difference.gmi 2023-04-01 "Never split the difference" book notes -=> ./the-obstacle-is-the-way.gmi 2023-05-06 "The Obstacle is the Way" book notes -=> ./career-guide-and-soft-skills.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes -=> ./mind-management.gmi 2023-11-11 "Mind Management" book notes -=> ./slow-productivity.gmi 2024-05-01 "Slow Productivity" book notes +=> ./staff-engineer.gmi 2024-10-24 "Staff Engineer" book notes => ./the-stoic-challenge.gmi 2024-07-07 "The Stoic Challenge" book notes (You are currently reading this) +=> ./slow-productivity.gmi 2024-05-01 "Slow Productivity" book notes +=> ./mind-management.gmi 2023-11-11 "Mind Management" book notes +=> ./career-guide-and-soft-skills.gmi 2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes +=> ./the-obstacle-is-the-way.gmi 2023-05-06 "The Obstacle is the Way" book notes +=> ./never-split-the-difference.gmi 2023-04-01 "Never split the difference" book notes +=> ./the-pragmatic-programmer.gmi 2023-03-16 "The Pragmatic Programmer" book notes -=> ../resources.gmi More books and other resources I found useful. => ../ Back to the main site diff --git a/notes/when.gmi b/notes/when.gmi new file mode 100644 index 00000000..3bfad7b4 --- /dev/null +++ b/notes/when.gmi @@ -0,0 +1,86 @@ +# "When: The Scientific Secrets of Perfect Timing" book notes + +These are my personal book notes from Daniel Pink's "When: The Scientific Secrets of Perfect Timing." They are for myself, but I hope they might be useful to you too. + +## Table of Contents + +* ⇢ "When: The Scientific Secrets of Perfect Timing" book notes +* ⇢ ⇢ Daily Rhythms +* ⇢ ⇢ Optimal Task Timing +* ⇢ ⇢ Exercise Timing +* ⇢ ⇢ Drinking Habits +* ⇢ ⇢ Afternoon Challenges ("Bermuda Triangle") +* ⇢ ⇢ Breaks and Productivity +* ⇢ ⇢ Napping +* ⇢ ⇢ Scheduling Breaks +* ⇢ ⇢ Final Impressions +* ⇢ ⇢ The Midlife U Curve +* ⇢ ⇢ Project Management Tips + +You are a different kind of organism based on the time of day. For example, school tests show worse results later in the day, especially if there are fewer computers than students available. Every person has a chronotype, such as a late or early peaker, or somewhere in the middle (like most people). You can assess your chronotype here: + +=> https://www.danpink.com/mctq/ Chronotype Assessment + +Following your chronotype can lead to more happiness and higher job satisfaction. + +## Daily Rhythms + +Peak, Trough, Rebound (Recovery): Most people experience these periods throughout the day. It's best to "eat the frog" or tackle daunting tasks during the peak. A twin peak exists every day, with mornings and early evenings being optimal for most people. Negative moods follow the opposite pattern, peaking in the afternoon. Light helps adjust but isn't the main driver of our internal clock. Like plants, humans have intrinsic rhythms. + +## Optimal Task Timing + +* Analytical work requiring sharpness and focus is best at the peak. +* Creative work is more effective during non-peak times. +* Biorhythms can sway performance by up to twenty percent. + +## Exercise Timing + +Exercise in the morning to lose weight; you burn up to twenty percent more fat if you exercise before eating. Exercising after eating aids muscle gain, using the energy from the food. Morning exercises elevate mood, with the effect lasting all day. They also make forming a habit easier. The late afternoon is best for athletic performance due to optimal body temperature, reducing injury risk. + +## Drinking Habits + +* Drink water in the morning to counter mild dehydration upon waking. +* Delay coffee consumption until cortisol production peaks an hour or 90 minutes after waking. This helps avoid caffeine resistance. +* For an afternoon boost, have coffee once cortisol levels drop. + +## Afternoon Challenges ("Bermuda Triangle") + +* Mistakes are more common in hospitals during this period, like incorrect antibiotic subscriptions or missed handwashing. +* Traffic accidents and unfavorable judge decisions occur more frequently in the afternoon. +* 2:55 pm is the least productive time of the day. + +## Breaks and Productivity + +Short, restorative breaks enhance performance. Student exam results improved with a half-hour break beforehand. Even micro-breaks can be beneficial—hourly five-minute walking breaks can increase productivity as much as 30-minute walks. Nature-based breaks are more effective than indoor ones, and full detachment in breaks is essential for restoration. Physical activity during breaks boosts concentration and productivity more than long walks do. Complete detachment from work during breaks is critical. + +## Napping + +Short naps (10-20 minutes) significantly enhance mood, alertness, and cognitive performance, improving learning and problem-solving abilities. Napping increases with age, benefiting mood, flow, and overall health. A "nappuccino," or napping after coffee, offers a double boost, as caffeine takes around 25 minutes to kick in. + +## Scheduling Breaks + +* Track breaks just as you do with tasks—aim for three breaks a day. +* Every 25 minutes, look away and daydream for 20 seconds, or engage in short exercises. +* Meditating for even three minutes is a highly effective restorative activity. +* The "Fresh Start Effect" (e.g., beginning a diet on January 1st or a new week) impacts motivation, as does recognizing progress. At the end of each day, spends two minutes to write down accomplishments. + +## Final Impressions + +- The concluding experience of a vacation significantly influences overall memories. +- Restaurant reviews often hinge on the end of the visit, highlighting extras like wrong bills or additional desserts. +- Considering one's older future self can motivate improvements in the present. + +## The Midlife U Curve + +Life satisfaction tends to dip in midlife, around the forties, but increases around age 54. + +## Project Management Tips + +* Halfway through a project, there's a concentrated work effort ("Oh Oh Effect"), similar to an alarm when slightly behind schedule. +* Recognizing daily accomplishments can elevate motivation and satisfaction. + +These insights from "When" can guide actions to optimize performance, well-being, and satisfaction across various aspects of life. + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/notes/when.gmi.tpl b/notes/when.gmi.tpl new file mode 100644 index 00000000..381cd7da --- /dev/null +++ b/notes/when.gmi.tpl @@ -0,0 +1,77 @@ +# "When: The Scientific Secrets of Perfect Timing" book notes + +These are my personal book notes from Daniel Pink's "When: The Scientific Secrets of Perfect Timing." They are for myself, but I hope they might be useful to you too. + +<< template::inline::toc + +You are a different kind of organism based on the time of day. For example, school tests show worse results later in the day, especially if there are fewer computers than students available. Every person has a chronotype, such as a late or early peaker, or somewhere in the middle (like most people). You can assess your chronotype here: + +=> https://www.danpink.com/mctq/ Chronotype Assessment + +Following your chronotype can lead to more happiness and higher job satisfaction. + +## Daily Rhythms + +Peak, Trough, Rebound (Recovery): Most people experience these periods throughout the day. It's best to "eat the frog" or tackle daunting tasks during the peak. A twin peak exists every day, with mornings and early evenings being optimal for most people. Negative moods follow the opposite pattern, peaking in the afternoon. Light helps adjust but isn't the main driver of our internal clock. Like plants, humans have intrinsic rhythms. + +## Optimal Task Timing + +* Analytical work requiring sharpness and focus is best at the peak. +* Creative work is more effective during non-peak times. +* Biorhythms can sway performance by up to twenty percent. + +## Exercise Timing + +Exercise in the morning to lose weight; you burn up to twenty percent more fat if you exercise before eating. Exercising after eating aids muscle gain, using the energy from the food. Morning exercises elevate mood, with the effect lasting all day. They also make forming a habit easier. The late afternoon is best for athletic performance due to optimal body temperature, reducing injury risk. + +## Drinking Habits + +* Drink water in the morning to counter mild dehydration upon waking. +* Delay coffee consumption until cortisol production peaks an hour or 90 minutes after waking. This helps avoid caffeine resistance. +* For an afternoon boost, have coffee once cortisol levels drop. + +## Afternoon Challenges ("Bermuda Triangle") + +* Mistakes are more common in hospitals during this period, like incorrect antibiotic subscriptions or missed handwashing. +* Traffic accidents and unfavorable judge decisions occur more frequently in the afternoon. +* 2:55 pm is the least productive time of the day. + +## Breaks and Productivity + +Short, restorative breaks enhance performance. Student exam results improved with a half-hour break beforehand. Even micro-breaks can be beneficial—hourly five-minute walking breaks can increase productivity as much as 30-minute walks. Nature-based breaks are more effective than indoor ones, and full detachment in breaks is essential for restoration. Physical activity during breaks boosts concentration and productivity more than long walks do. Complete detachment from work during breaks is critical. + +## Napping + +Short naps (10-20 minutes) significantly enhance mood, alertness, and cognitive performance, improving learning and problem-solving abilities. Napping increases with age, benefiting mood, flow, and overall health. A "nappuccino," or napping after coffee, offers a double boost, as caffeine takes around 25 minutes to kick in. + +## Scheduling Breaks + +* Track breaks just as you do with tasks—aim for three breaks a day. +* Every 25 minutes, look away and daydream for 20 seconds, or engage in short exercises. +* Meditating for even three minutes is a highly effective restorative activity. +* The "Fresh Start Effect" (e.g., beginning a diet on January 1st or a new week) impacts motivation, as does recognizing progress. At the end of each day, spends two minutes to write down accomplishments. + +## Final Impressions + +- The concluding experience of a vacation significantly influences overall memories. +- Restaurant reviews often hinge on the end of the visit, highlighting extras like wrong bills or additional desserts. +- Considering one's older future self can motivate improvements in the present. + +## The Midlife U Curve + +Life satisfaction tends to dip in midlife, around the forties, but increases around age 54. + +## Project Management Tips + +* Halfway through a project, there's a concentrated work effort ("Oh Oh Effect"), similar to an alarm when slightly behind schedule. +* Recognizing daily accomplishments can elevate motivation and satisfaction. + +These insights from "When" can guide actions to optimize performance, well-being, and satisfaction across various aspects of life. + +Other book notes of mine are: + +<< template::inline::rindex book-notes + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +=> ../ Back to the main site diff --git a/other-resources.gmi b/other-resources.gmi deleted file mode 100644 index 904cc8c8..00000000 --- a/other-resources.gmi +++ /dev/null @@ -1,6 +0,0 @@ -# Other resources - -Please go to: - -=> https://paul.buetow.org/other-resources.html -=> gemini://paul.buetow.org/other-resources.gmi diff --git a/resources.gmi b/resources.gmi deleted file mode 100644 index 14a70be4..00000000 --- a/resources.gmi +++ /dev/null @@ -1,6 +0,0 @@ -# Resources - -Please go to: - -=> https://paul.buetow.org/resources.html -=> gemini://paul.buetow.org/resources.gmi diff --git a/site-mirrors.gmi b/site-mirrors.gmi index 5cb192d4..361d7aa5 100644 --- a/site-mirrors.gmi +++ b/site-mirrors.gmi @@ -2,17 +2,16 @@ This page summarizes all the mirrors of this site. Agreeably, that's all a bit overkill (given the importance of this internet presence), but I did it for fun. -All sites listed below are reachable via IPv4 as well as via IPv6. Depending on the current master node, standby or master may be located in Amsterdam, Netherlands (OpenBSD.Amsterdam) or Falkenstein, Germany (Hetzner Cloud). +All sites listed below are reachable via IPv4 as well as via IPv6. Depending on the current master node, standby or master may be located in Amsterdam, Netherlands (OpenBSD.Amsterdam) or Falkenstein, Germany (Hetzner Cloud). -## Gemini protocol +=> ./gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi Wondering how's decided what's the master and what's the standby host? +## Gemini protocol => gemini://foo.zone => gemini://standby.foo.zone -Wondering what's the Gemini protocol about? Read: - -=> ./gemfeed/2021-04-24-welcome-to-the-geminispace.gmi Welcome to the Geminispace +=> ./gemfeed/2021-04-24-welcome-to-the-geminispace.gmi Wondering what's the Gemini protocol about? ## HTTP protocol diff --git a/uptime-stats.gmi b/uptime-stats.gmi index fb767333..3461981d 100644 --- a/uptime-stats.gmi +++ b/uptime-stats.gmi @@ -1,6 +1,6 @@ # My machine uptime stats -> This site was last updated at 2024-08-05T22:08:22+03:00 +> This site was last updated at 2025-02-16T11:18:30+02:00 The following stats were collected via `uptimed` on all of my personal computers over many years and the output was generated by `guprecords`, the global uptime records stats analyser of mine. @@ -23,24 +23,24 @@ Boots is the total number of host boots over the entire lifespan. +-----+----------------+-------+ | 1. | alphacentauri | 671 | | 2. | mars | 207 | -| 3. | callisto | 153 | -| 4. | *earth | 141 | +| 3. | *earth | 168 | +| 4. | callisto | 153 | | 5. | dionysus | 136 | | 6. | tauceti-e | 120 | -| 7. | *uranus | 52 | -| 8. | pluto | 51 | -| 9. | makemake | 50 | -| 10. | *mega15289 | 50 | -| 11. | mega8477 | 40 | -| 12. | phobos | 40 | -| 13. | *t450 | 39 | -| 14. | *fishfinger | 33 | +| 7. | *makemake | 61 | +| 8. | *uranus | 59 | +| 9. | pluto | 51 | +| 10. | mega15289 | 50 | +| 11. | *t450 | 43 | +| 12. | *fishfinger | 42 | +| 13. | mega8477 | 40 | +| 14. | phobos | 40 | | 15. | sun | 33 | -| 16. | *blowfish | 25 | -| 17. | moon | 20 | -| 18. | vulcan | 19 | -| 19. | tauceti | 16 | -| 20. | sagittarius | 15 | +| 16. | *blowfish | 33 | +| 17. | *mega-m3-pro | 29 | +| 18. | moon | 20 | +| 19. | vulcan | 19 | +| 20. | tauceti | 16 | +-----+----------------+-------+ ``` @@ -56,22 +56,22 @@ Uptime is the total uptime of a host over the entire lifespan. | 2. | sun | 3 years, 9 months, 26 days | | 3. | *uranus | 3 years, 9 months, 5 days | | 4. | uugrn | 3 years, 5 months, 5 days | -| 5. | deltavega | 3 years, 1 months, 21 days | -| 6. | pluto | 2 years, 10 months, 29 days | -| 7. | *earth | 2 years, 7 months, 10 days | -| 8. | *blowfish | 2 years, 7 months, 8 days | -| 9. | tauceti | 2 years, 3 months, 19 days | -| 10. | *mega15289 | 1 years, 12 months, 17 days | -| 11. | *fishfinger | 1 years, 11 months, 5 days | +| 5. | *blowfish | 3 years, 2 months, 4 days | +| 6. | *earth | 3 years, 1 months, 26 days | +| 7. | deltavega | 3 years, 1 months, 21 days | +| 8. | pluto | 2 years, 10 months, 29 days | +| 9. | *fishfinger | 2 years, 6 months, 2 days | +| 10. | tauceti | 2 years, 3 months, 19 days | +| 11. | mega15289 | 1 years, 12 months, 17 days | | 12. | tauceti-f | 1 years, 9 months, 18 days | | 13. | mega8477 | 1 years, 3 months, 25 days | | 14. | host0 | 1 years, 3 months, 9 days | -| 15. | tauceti-e | 1 years, 2 months, 20 days | -| 16. | makemake | 1 years, 1 months, 31 days | -| 17. | callisto | 0 years, 10 months, 31 days | -| 18. | alphacentauri | 0 years, 10 months, 28 days | -| 19. | babylon5 | 0 years, 9 months, 25 days | -| 20. | london | 0 years, 9 months, 16 days | +| 15. | *makemake | 1 years, 2 months, 23 days | +| 16. | tauceti-e | 1 years, 2 months, 20 days | +| 17. | *t450 | 1 years, 1 months, 17 days | +| 18. | callisto | 0 years, 10 months, 31 days | +| 19. | alphacentauri | 0 years, 10 months, 28 days | +| 20. | babylon5 | 0 years, 9 months, 25 days | +-----+----------------+-----------------------------+ ``` @@ -83,26 +83,26 @@ Score is calculated by combining all other metrics. +-----+----------------+-------+ | Pos | Host | Score | +-----+----------------+-------+ -| 1. | *uranus | 326 | +| 1. | *uranus | 338 | | 2. | vulcan | 275 | | 3. | sun | 238 | -| 4. | uugrn | 211 | -| 5. | alphacentauri | 201 | -| 6. | deltavega | 193 | -| 7. | pluto | 182 | -| 8. | *earth | 180 | -| 9. | *blowfish | 163 | -| 10. | dionysus | 156 | -| 11. | *mega15289 | 150 | -| 12. | tauceti | 141 | -| 13. | *fishfinger | 121 | -| 14. | tauceti-f | 108 | -| 15. | makemake | 100 | +| 4. | *earth | 217 | +| 5. | uugrn | 211 | +| 6. | alphacentauri | 201 | +| 7. | *blowfish | 200 | +| 8. | deltavega | 193 | +| 9. | pluto | 182 | +| 10. | *fishfinger | 158 | +| 11. | dionysus | 156 | +| 12. | mega15289 | 147 | +| 13. | tauceti | 141 | +| 14. | *makemake | 122 | +| 15. | tauceti-f | 108 | | 16. | tauceti-e | 96 | -| 17. | callisto | 86 | -| 18. | mega8477 | 80 | -| 19. | host0 | 76 | -| 20. | mars | 67 | +| 17. | *t450 | 89 | +| 18. | callisto | 86 | +| 19. | mega8477 | 80 | +| 20. | host0 | 76 | +-----+----------------+-------+ ``` @@ -115,25 +115,25 @@ Downtime is the total downtime of a host over the entire lifespan. | Pos | Host | Downtime | +-----+----------------+-----------------------------+ | 1. | dionysus | 8 years, 3 months, 16 days | -| 2. | alphacentauri | 5 years, 11 months, 18 days | -| 3. | *uranus | 5 years, 7 months, 18 days | -| 4. | moon | 2 years, 1 months, 1 days | -| 5. | makemake | 1 years, 10 months, 15 days | +| 2. | *uranus | 6 years, 4 months, 15 days | +| 3. | alphacentauri | 5 years, 11 months, 18 days | +| 4. | *makemake | 2 years, 9 months, 6 days | +| 5. | moon | 2 years, 1 months, 1 days | | 6. | callisto | 1 years, 5 months, 15 days | -| 7. | *mega15289 | 1 years, 4 months, 24 days | -| 8. | *t450 | 1 years, 2 months, 12 days | +| 7. | mega15289 | 1 years, 4 months, 24 days | +| 8. | *t450 | 1 years, 2 months, 13 days | | 9. | mars | 1 years, 2 months, 10 days | | 10. | tauceti-e | 0 years, 12 months, 9 days | | 11. | sirius | 0 years, 8 months, 20 days | -| 12. | *earth | 0 years, 6 months, 1 days | +| 12. | *earth | 0 years, 6 months, 14 days | | 13. | deimos | 0 years, 5 months, 15 days | -| 14. | joghurt | 0 years, 2 months, 9 days | -| 15. | host0 | 0 years, 2 months, 1 days | -| 16. | fibonacci | 0 years, 1 months, 11 days | -| 17. | cobol | 0 years, 1 months, 8 days | -| 18. | mega8477 | 0 years, 1 months, 8 days | -| 19. | sun | 0 years, 1 months, 7 days | -| 20. | sentax | 0 years, 1 months, 6 days | +| 14. | *f2 | 0 years, 2 months, 9 days | +| 15. | joghurt | 0 years, 2 months, 9 days | +| 16. | *f0 | 0 years, 2 months, 8 days | +| 17. | *f1 | 0 years, 2 months, 8 days | +| 18. | host0 | 0 years, 2 months, 1 days | +| 19. | fibonacci | 0 years, 1 months, 11 days | +| 20. | cobol | 0 years, 1 months, 8 days | +-----+----------------+-----------------------------+ ``` @@ -145,26 +145,26 @@ Lifespan is the total uptime + the total downtime of a host. +-----+----------------+-----------------------------+ | Pos | Host | Lifespan | +-----+----------------+-----------------------------+ -| 1. | *uranus | 9 years, 3 months, 23 days | +| 1. | *uranus | 9 years, 12 months, 20 days | | 2. | dionysus | 8 years, 6 months, 17 days | | 3. | alphacentauri | 6 years, 9 months, 13 days | | 4. | vulcan | 4 years, 5 months, 6 days | -| 5. | sun | 3 years, 10 months, 2 days | -| 6. | uugrn | 3 years, 5 months, 5 days | -| 7. | *mega15289 | 3 years, 4 months, 9 days | -| 8. | deltavega | 3 years, 1 months, 21 days | -| 9. | *earth | 2 years, 12 months, 8 days | -| 10. | makemake | 2 years, 11 months, 14 days | -| 11. | pluto | 2 years, 10 months, 30 days | -| 12. | *blowfish | 2 years, 7 months, 9 days | -| 13. | moon | 2 years, 4 months, 25 days | -| 14. | tauceti | 2 years, 3 months, 22 days | -| 15. | callisto | 2 years, 3 months, 13 days | -| 16. | tauceti-e | 2 years, 1 months, 29 days | -| 17. | *fishfinger | 1 years, 11 months, 6 days | -| 18. | tauceti-f | 1 years, 9 months, 20 days | -| 19. | mars | 1 years, 8 months, 19 days | -| 20. | *t450 | 1 years, 8 months, 2 days | +| 5. | *makemake | 3 years, 10 months, 30 days | +| 6. | sun | 3 years, 10 months, 2 days | +| 7. | *earth | 3 years, 7 months, 10 days | +| 8. | uugrn | 3 years, 5 months, 5 days | +| 9. | mega15289 | 3 years, 4 months, 9 days | +| 10. | *blowfish | 3 years, 2 months, 5 days | +| 11. | deltavega | 3 years, 1 months, 21 days | +| 12. | pluto | 2 years, 10 months, 30 days | +| 13. | *fishfinger | 2 years, 6 months, 4 days | +| 14. | moon | 2 years, 4 months, 25 days | +| 15. | tauceti | 2 years, 3 months, 22 days | +| 16. | callisto | 2 years, 3 months, 13 days | +| 17. | *t450 | 2 years, 2 months, 29 days | +| 18. | tauceti-e | 2 years, 1 months, 29 days | +| 19. | tauceti-f | 1 years, 9 months, 20 days | +| 20. | mars | 1 years, 8 months, 19 days | +-----+----------------+-----------------------------+ ``` @@ -181,21 +181,21 @@ Boots is the total number of host boots over the entire lifespan. | 3. | Linux 5... | 162 | | 4. | Linux 4... | 161 | | 5. | FreeBSD 11... | 153 | -| 6. | FreeBSD 13... | 116 | -| 7. | *Linux 6... | 89 | -| 8. | *OpenBSD 7... | 68 | +| 6. | *Linux 6... | 134 | +| 7. | FreeBSD 13... | 116 | +| 8. | *OpenBSD 7... | 85 | | 9. | Darwin 13... | 40 | -| 10. | FreeBSD 5... | 25 | -| 11. | Linux 2... | 22 | -| 12. | Darwin 21... | 17 | -| 13. | Darwin 15... | 15 | -| 14. | *FreeBSD 14... | 13 | -| 15. | Darwin 22... | 12 | -| 16. | *Darwin 23... | 11 | +| 10. | *FreeBSD 14... | 38 | +| 11. | *Darwin 23... | 33 | +| 12. | FreeBSD 5... | 25 | +| 13. | Linux 2... | 22 | +| 14. | Darwin 21... | 17 | +| 15. | Darwin 15... | 15 | +| 16. | Darwin 22... | 12 | | 17. | Darwin 18... | 11 | -| 18. | FreeBSD 6... | 10 | -| 19. | OpenBSD 4... | 10 | -| 20. | FreeBSD 7... | 10 | +| 18. | OpenBSD 4... | 10 | +| 19. | FreeBSD 7... | 10 | +| 20. | FreeBSD 6... | 10 | +-----+----------------+-------+ ``` @@ -208,23 +208,23 @@ Uptime is the total uptime of a host over the entire lifespan. | Pos | KernelMajor | Uptime | +-----+----------------+------------------------------+ | 1. | Linux 3... | 15 years, 10 months, 25 days | -| 2. | FreeBSD 10... | 5 years, 9 months, 9 days | -| 3. | *OpenBSD 7... | 5 years, 1 months, 10 days | +| 2. | *OpenBSD 7... | 6 years, 3 months, 6 days | +| 3. | FreeBSD 10... | 5 years, 9 months, 9 days | | 4. | Linux 5... | 4 years, 10 months, 21 days | | 5. | Linux 4... | 2 years, 7 months, 22 days | | 6. | FreeBSD 11... | 2 years, 4 months, 28 days | -| 7. | Linux 2... | 1 years, 11 months, 21 days | -| 8. | *Linux 6... | 1 years, 9 months, 4 days | +| 7. | *Linux 6... | 2 years, 4 months, 15 days | +| 8. | Linux 2... | 1 years, 11 months, 21 days | | 9. | Darwin 13... | 1 years, 3 months, 25 days | | 10. | FreeBSD 6... | 1 years, 3 months, 9 days | -| 11. | OpenBSD 4... | 0 years, 8 months, 12 days | -| 12. | Darwin 21... | 0 years, 8 months, 2 days | -| 13. | Darwin 18... | 0 years, 7 months, 5 days | -| 14. | Darwin 22... | 0 years, 6 months, 22 days | -| 15. | Darwin 15... | 0 years, 6 months, 15 days | -| 16. | *FreeBSD 14... | 0 years, 6 months, 5 days | -| 17. | FreeBSD 5... | 0 years, 5 months, 18 days | -| 18. | *Darwin 23... | 0 years, 4 months, 17 days | +| 11. | *FreeBSD 14... | 1 years, 1 months, 17 days | +| 12. | *Darwin 23... | 0 years, 11 months, 9 days | +| 13. | OpenBSD 4... | 0 years, 8 months, 12 days | +| 14. | Darwin 21... | 0 years, 8 months, 2 days | +| 15. | Darwin 18... | 0 years, 7 months, 5 days | +| 16. | Darwin 22... | 0 years, 6 months, 22 days | +| 17. | Darwin 15... | 0 years, 6 months, 15 days | +| 18. | FreeBSD 5... | 0 years, 5 months, 18 days | | 19. | FreeBSD 13... | 0 years, 4 months, 2 days | | 20. | Darwin 20... | 0 years, 3 months, 7 days | +-----+----------------+------------------------------+ @@ -240,23 +240,23 @@ Score is calculated by combining all other metrics. +-----+----------------+-------+ | 1. | Linux 3... | 1045 | | 2. | FreeBSD 10... | 406 | -| 3. | *OpenBSD 7... | 325 | +| 3. | *OpenBSD 7... | 399 | | 4. | Linux 5... | 317 | | 5. | Linux 4... | 175 | | 6. | FreeBSD 11... | 159 | -| 7. | Linux 2... | 121 | -| 8. | *Linux 6... | 115 | +| 7. | *Linux 6... | 158 | +| 8. | Linux 2... | 121 | | 9. | Darwin 13... | 80 | | 10. | FreeBSD 6... | 75 | -| 11. | OpenBSD 4... | 39 | -| 12. | Darwin 21... | 38 | -| 13. | Darwin 18... | 32 | -| 14. | *FreeBSD 14... | 30 | -| 15. | Darwin 22... | 30 | -| 16. | Darwin 15... | 29 | -| 17. | FreeBSD 13... | 25 | -| 18. | FreeBSD 5... | 25 | -| 19. | *Darwin 23... | 21 | +| 11. | *FreeBSD 14... | 71 | +| 12. | *Darwin 23... | 59 | +| 13. | OpenBSD 4... | 39 | +| 14. | Darwin 21... | 38 | +| 15. | Darwin 18... | 32 | +| 16. | Darwin 22... | 30 | +| 17. | Darwin 15... | 29 | +| 18. | FreeBSD 13... | 25 | +| 19. | FreeBSD 5... | 25 | | 20. | Darwin 20... | 11 | +-----+----------------+-------+ ``` @@ -269,10 +269,10 @@ Boots is the total number of host boots over the entire lifespan. +-----+------------+-------+ | Pos | KernelName | Boots | +-----+------------+-------+ -| 1. | *Linux | 984 | -| 2. | *FreeBSD | 878 | -| 3. | *Darwin | 111 | -| 4. | *OpenBSD | 78 | +| 1. | *Linux | 1029 | +| 2. | *FreeBSD | 903 | +| 3. | *Darwin | 134 | +| 4. | *OpenBSD | 95 | +-----+------------+-------+ ``` @@ -281,14 +281,14 @@ Boots is the total number of host boots over the entire lifespan. Uptime is the total uptime of a host over the entire lifespan. ``` -+-----+------------+-----------------------------+ -| Pos | KernelName | Uptime | -+-----+------------+-----------------------------+ -| 1. | *Linux | 26 years, 9 months, 26 days | -| 2. | *FreeBSD | 10 years, 5 months, 7 days | -| 3. | *OpenBSD | 5 years, 8 months, 21 days | -| 4. | *Darwin | 3 years, 9 months, 27 days | -+-----+------------+-----------------------------+ ++-----+------------+------------------------------+ +| Pos | KernelName | Uptime | ++-----+------------+------------------------------+ +| 1. | *Linux | 27 years, 5 months, 8 days | +| 2. | *FreeBSD | 10 years, 12 months, 19 days | +| 3. | *OpenBSD | 6 years, 10 months, 15 days | +| 4. | *Darwin | 4 years, 4 months, 20 days | ++-----+------------+------------------------------+ ``` ## Top 20 Score's by KernelName @@ -299,10 +299,10 @@ Score is calculated by combining all other metrics. +-----+------------+-------+ | Pos | KernelName | Score | +-----+------------+-------+ -| 1. | *Linux | 1775 | -| 2. | *FreeBSD | 731 | -| 3. | *OpenBSD | 365 | -| 4. | *Darwin | 248 | +| 1. | *Linux | 1817 | +| 2. | *FreeBSD | 772 | +| 3. | *OpenBSD | 439 | +| 4. | *Darwin | 285 | +-----+------------+-------+ ``` |
