diff options
| author | Paul Buetow <paul@buetow.org> | 2025-02-21 11:09:28 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-02-21 11:09:28 +0200 |
| commit | 76f252524871b203ac11279511ea0adcf8b1386c (patch) | |
| tree | 0a5b64e8737186430471d673240faddb6124cd33 | |
| parent | 6b266a4b626056bae0e3c0e660fd3c472584950f (diff) | |
Update content for html
180 files changed, 18163 insertions, 8729 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.html b/about/index.html new file mode 100644 index 00000000..e60a899b --- /dev/null +++ b/about/index.html @@ -0,0 +1,51 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>About</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/about/index.md">Markdown</a> | <a href="gemini://foo.zone/about/index.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='about'>About</h1><br /> +<br /> +<ul> +<li>Name: Paul Buetow</li> +<li>Father, Husband, Computer tinkerer, Yogi, Science fiction lover, cat owner</li> +<li>Born in: Germany, currently living in: Sofia, Bulgaria</li> +<li>Profession: Computerist - Solving problems with computers that we wouldn't have without them</li> +<li>Current job: Site Reliability Engineer</li> +<li>Education: Diplom-Informatiker (FH) (Diploma from a German University of Applied Sciences, before hey had international Bachelor and Masters programs)</li> +<li>E-Mail: <span class='inlinecode'>paul@nospam.buetow.org</span></li> +</ul><br /> +<a href='./paul.jpg'><img alt='Paul Buetow' title='Paul Buetow' src='./paul.jpg' /></a><br /> +<br /> +<h2 style='display: inline' id='my-sites'>My sites</h2><br /> +<br /> +<a class='textlink' href='../'>My blog here at foo.zone</a><br /> +<a class='textlink' href='https://codeberg.org/snonux'>codeberg.org/snonux - My Codeberg page</a><br /> +<a class='textlink' href='https://dtail.dev'>dtail.dev - DTail at Mimecast</a><br /> +<a class='textlink' href='https://irregular.ninja'>irregular.ninja - My street photography site (warn: multiple MBs, it's photos after all)</a><br /> +<a class='textlink' href='./resources.html'>Books, Podcasts, Courses and Guides I recommend</a><br /> +<a class='textlink' href='./novels.html'>Novels I've read</a><br /> +<br /> +<h2 style='display: inline' id='social-media-and-communities'>Social Media and Communities</h2><br /> +<br /> +<a class='textlink' href='https://fosstodon.org/@snonux'>@snonux@fosstodon.org - Me at Mastodon</a><br /> +<a class='textlink' href='https://www.linkedin.com/in/paul-buetow-b4857270/'>My LinkedIn profile</a><br /> +<a class='textlink' href='https://gophers.slack.com'>Gophers Slack - Under my real name</a><br /> +<br /> +<span>That's all for now...</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> 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.html b/about/novels.html new file mode 100644 index 00000000..9d5e2805 --- /dev/null +++ b/about/novels.html @@ -0,0 +1,171 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Novels</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/about/novels.md">Markdown</a> | <a href="gemini://foo.zone/about/novels.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='novels'>Novels</h1><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#novels'>Novels</a></li> +<li>⇢ <a href='#introduction'>Introduction</a></li> +<li>⇢ <a href='#read'>Read</a></li> +<li>⇢ ⇢ <a href='#alastair-reynolds'>Alastair Reynolds</a></li> +<li>⇢ ⇢ <a href='#arthur-c-clarke'>Arthur C. Clarke</a></li> +<li>⇢ ⇢ <a href='#andreas-brandhorst-german'>Andreas Brandhorst (german)</a></li> +<li>⇢ ⇢ <a href='#david-reimer-german'>David Reimer (german)</a></li> +<li>⇢ ⇢ <a href='#ian-banks'>Ian Banks</a></li> +<li>⇢ ⇢ <a href='#dan-simmons'>Dan Simmons</a></li> +<li>⇢ ⇢ <a href='#other-authors'>Other authors</a></li> +<li>⇢ <a href='#currently-reading'>Currently reading</a></li> +<li>⇢ ⇢ <a href='#andreas-brandhorst'>Andreas Brandhorst</a></li> +<li>⇢ <a href='#unread-books-already-in-my-shelf'>Unread books already in my shelf</a></li> +<li>⇢ ⇢ <a href='#alastair-reynolds'>Alastair Reynolds</a></li> +<li>⇢ ⇢ <a href='#andreas-brandhorst'>Andreas Brandhorst</a></li> +</ul><br /> +<h2 style='display: inline' id='introduction'>Introduction</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>Some were read as paperback, others as eBooks, and some were listened to (Audiobook).</span><br /> +<br /> +<pre> + . . ' . + ' . . ' . + + ` ' . ' + . ,'`. . + . .." _.-;' `. . + _.-"`.##%"_.--" ,' `. "#" ___,,od000 + ,'"-_ _.-.--"\ ,' `-_ '%#%',,/////00000HH + ,' |_.' )`/- __..--""`-_`-._ J L/////00000HHHHM + . + ,' _.-" / / _-"" `-._`-_/___\///0000HHHHMMM + .'_.-"" ' :_/_.-' _,`-/__V__\0000HHHHHMMMM + . _-"" . ' _,////\ | /000HHHHHMMMMM +_-" . ' + . . ,//////0\ | /00HHHHHHHMMMMM + ` ,//////000\|/00HHHHHHHMMMMMM +. ' . ' . . ' ,//////00000|00HHHHHHHHMMMMMM + . . . ' ,//////000000|00HHHHHHHMMMMMMM + . ' . . ,///////000000|0HHHHHHHHMMMMMMM + ' ' . ' ///////000000000HHHHHHHHMMMMMMM + + . . ' . ,///////000000000HHHHHHHMMMMMMMM + ' . ' . ///////000000000HHHHHHHHMMMMMMMM + ' . ' ///////000000000HHHHHHHHMMMMMMMM + . ' ,///////000000000HHHHHHHHMMMMMMMM +</pre> +<br /> +<h2 style='display: inline' id='read'>Read</h2><br /> +<br /> +<h3 style='display: inline' id='alastair-reynolds'>Alastair Reynolds</h3><br /> +<br /> +<ul> +<li>2000 - Revelation Space (english) / Unendlichkeit (german) - Revelation Space Universe</li> +<li>2001 - Chasm City - Revelation Space Universe</li> +<li>2002 - Redemption Ark (english) / Die Arche (german) - Revelation Space Universe</li> +<li>2003 - Absolution Gap (english) / Offenbarung (german) - Revelation Space Universe</li> +</ul><br /> +<h3 style='display: inline' id='arthur-c-clarke'>Arthur C. Clarke</h3><br /> +<br /> +<ul> +<li>1973 - Rendezvous with Rama (english), Audiobook</li> +<li>1989 - Rama II (english), Audiobook</li> +<li>1991 - The Garden of Rama (english), Audiobook</li> +<li>1993 - Rama Revealed (english), Audiobook</li> +</ul><br /> +<h3 style='display: inline' id='andreas-brandhorst-german'>Andreas Brandhorst (german)</h3><br /> +<br /> +<ul> +<li>2004 - Diamant (german) - Diamant-Trilogie</li> +<li>2004 - Der Metamorph (german) - Diamant-Trilogie</li> +<li>2005 - Der Zeitkrieg (german) - Diamant-Trilogie</li> +<li>2006 - Feuervögel (german) - Graken-Trilogie</li> +<li>2007 - Feuerstürme (german) - Graken-Trilogie</li> +<li>2008 - Feuerträume (german) - Graken-Trilogie</li> +<li>2010 - Kinder der Ewigkeit (german)</li> +<li>2012 - Das Artefakt (german)</li> +<li>2013 - Der letzte Regent (german)</li> +<li>2014 - Das Kosmotop (german)</li> +<li>2015 - Ikarus (german)</li> +<li>2015 - Das Schiff (german)</li> +<li>2016 - Omni (german) - Omniversum</li> +<li>2017 - Das Arkonadia-Rätsel (german) - Omniversum</li> +<li>2017 - Das Erwachen (german) - Maschinenintelligenz-Trilogie</li> +<li>2018 - Ewiges Leben (german), Andreas Brandhorst</li> +<li>2019 - Das Netz der Sterne (german), Audiobook</li> +<li>2019 - Seelenfänger (german), Andreas Brandhorst, Audiobook</li> +<li>2020 - Die Eskalation (german) - Maschinenintelligenz-Trilogie</li> +<li>2021 - Mars Discovery (german) - Maschinenintelligenz-Trilogie</li> +<li>2022 - Eklipse (german)</li> +<li>2022 - Ruf der Unendlichkeit (german), Audiobook</li> +<li>2024 - Infinitia (german), Audiobook</li> +<li>2024 - Zeta (german), Andreas Brandhorst, Audiobook</li> +</ul><br /> +<h3 style='display: inline' id='david-reimer-german'>David Reimer (german)</h3><br /> +<br /> +<ul> +<li>2022 - Die Anomalie in der Finsternis - Die Wächter des Wissens - Band 1 (german), (Audiobook)</li> +<li>2022 - Der dunkle Reisende - Die Wächter des Wissens - Band 2 (german), (Audiobook)</li> +<li>2022 - Das Signal der Schöpfer - Die Wächter des Wissens - Band 3 (german), (Audiobook)</li> +<li>2022 - Das Ende des Universums - Die Wächter des Wissens - Band 4 (german), (Audiobook)</li> +</ul><br /> +<h3 style='display: inline' id='ian-banks'>Ian Banks</h3><br /> +<br /> +<ul> +<li>1987 - Consider Pheblas (english) / Bedenke Pheblas (german) - Culture Book 1</li> +<li>1988 - The Player of Games (english) - Culture Book 2, Audiobook</li> +</ul><br /> +<h3 style='display: inline' id='dan-simmons'>Dan Simmons</h3><br /> +<br /> +<ul> +<li>1989 - Hyperion, Audiobook</li> +<li>1990 - The fall of Hyperion, Audiobook</li> +</ul><br /> +<h3 style='display: inline' id='other-authors'>Other authors</h3><br /> +<br /> +<ul> +<li>1949 - 1984, George Orwell, Audiobook</li> +<li>1979 - The Hitchhikers Guide to the Galaxy (english) / Per Anhalter durch die Galaxis (german), Adam Douglas - All books of the series</li> +<li>2009 - Quest, Andreas Eschbach</li> +<li>2010 - The Icarus Hunt (english) / Jagt auf Ikarus (german), Timothy Zahn</li> +<li>2010 - Der Astronaut (german), Andy Weir, Audiobook</li> +<li>2019 - Die Unvollkommenen (german), Theresa Hannig, Audiobook</li> +<li>2022 - Mickey 7 - Der letzte Klon (german), Edward Ashton, Audiobook</li> +</ul><br /> +<h2 style='display: inline' id='currently-reading'>Currently reading</h2><br /> +<br /> +<h3 style='display: inline' id='andreas-brandhorst'>Andreas Brandhorst</h3><br /> +<br /> +<ul> +<li>2023 - Oxygen: Welt ohne Sauerstoff, Audiobook (german)</li> +<li>2024 - Der Riss (german)</li> +</ul><br /> +<h2 style='display: inline' id='unread-books-already-in-my-shelf'>Unread books already in my shelf</h2><br /> +<br /> +<h3 style='display: inline' id='alastair-reynolds'>Alastair Reynolds</h3><br /> +<br /> +<ul> +<li>2004 - Träume von Unendlichkeit (german)</li> +</ul><br /> +<h3 style='display: inline' id='andreas-brandhorst'>Andreas Brandhorst</h3><br /> +<br /> +<ul> +<li>2021 - Die Tiefe der Zeit (german)</li> +</ul><br /> +<span>Do you recommend a good Science Fiction Novel? E-Mail at paul at buetow dot org! :-)</span><br /> +<br /> +<a class='textlink' href='./'>Go back</a><br /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> 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.html b/about/resources.html new file mode 100644 index 00000000..b6c781a5 --- /dev/null +++ b/about/resources.html @@ -0,0 +1,261 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Resources</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/about/resources.md">Markdown</a> | <a href="gemini://foo.zone/about/resources.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='resources'>Resources</h1><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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...</span><br /> +<br /> +<pre> + .--. .---. .-. + .---|--| .-. | A | .---. |~| .--. +.--|===|Go|---|_|--.__| S |--|:::| |~|-==-|==|---. +|%%|Lin|la|===| |~~|%%| C |--| |_|~|Perl| |___|-. +| |ux |ng|===| |==| | I | |k8s|=| | 7 |Ra|---|=| +| | | | |_|__| | I |__| | | | |ku|___| | +|~~|===|--|===|~|~~|%%|~~~|--|:::|=|~|----|==|---|=| +^--^---'--^---^-^--^--^---'--^---^-^-^-==-^--^---^-'hjw +</pre> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#resources'>Resources</a></li> +<li>⇢ <a href='#technical-books'>Technical books</a></li> +<li>⇢ <a href='#technical-references'>Technical references</a></li> +<li>⇢ <a href='#self-development-and-soft-skills-books'>Self-development and soft-skills books</a></li> +<li>⇢ <a href='#technical-video-lectures-and-courses'>Technical video lectures and courses</a></li> +<li>⇢ <a href='#technical-guides'>Technical guides</a></li> +<li>⇢ <a href='#podcasts'>Podcasts</a></li> +<li>⇢ ⇢ <a href='#podcasts-i-like'>Podcasts I like</a></li> +<li>⇢ ⇢ <a href='#podcasts-i-liked'>Podcasts I liked</a></li> +<li>⇢ <a href='#newsletters-i-like'>Newsletters I like</a></li> +<li><a href='#formal-education'>Formal education</a></li> +</ul><br /> +<h2 style='display: inline' id='technical-books'>Technical books</h2><br /> +<br /> +<span>In random order:</span><br /> +<br /> +<ul> +<li>100 Go Mistakes and How to Avoid Them; Teiva Harsanyi; Manning Publications</li> +<li>The Docker Book; James Turnbull; Kindle</li> +<li>Systemprogrammierung in Go; Frank Müller; dpunkt</li> +<li>The Kubernetes Book; Nigel Poulton; Unabridged Audiobook</li> +<li>Developing Games in Java; David Brackeen and others...; New Riders</li> +<li>Perl New Features; Joshua McAdams, brian d foy; Perl School</li> +<li>Object-Oriented Programming with ANSI-C; Axel-Tobias Schreiner</li> +<li>DNS and BIND; Cricket Liu; O'Reilly</li> +<li>Distributed Systems: Principles and Paradigms; Andrew S. Tanenbaum; Pearson</li> +<li>Raku Recipes; J.J. Merelo; Apress</li> +<li>Go Brain Teasers - Exercise Your Mind; Miki Tebeka; The Pragmatic Programmers</li> +<li>Funktionale Programmierung; Peter Pepper; Springer</li> +<li>Java ist auch eine Insel; Christian Ullenboom; </li> +<li>The Go Programming Language; Alan A. A. Donovan; Addison-Wesley Professional</li> +<li>The DevOps Handbook; Gene Kim, Jez Humble, Patrick Debois, John Willis; Audible</li> +<li>Programming Perl aka "The Camel Book"; Tom Christiansen, brian d foy, Larry Wall & Jon Orwant; O'Reilly</li> +<li>Systems Performance Tuning; Gian-Paolo D. Musumeci and others...; O'Reilly</li> +<li>Higher Order Perl; Mark Dominus; Morgan Kaufmann</li> +<li>97 things every SRE should know; Emil Stolarsky, Jaime Woo; O'Reilly</li> +<li>Site Reliability Engineering; How Google runs production systems; O'Reilly</li> +<li>Effective Java; Joshua Bloch; Addison-Wesley Professional</li> +<li>Leanring eBPF; Liz Rice; O'Reilly</li> +<li>Learn You Some Erlang for Great Good; Fred Herbert; No Starch Press</li> +<li>Raku Fundamentals; Moritz Lenz; Apress</li> +<li>DevOps And Site Reliability Engineering Handbook; Stephen Fleming; Audible</li> +<li>The Pragmatic Programmer; David Thomas; Addison-Wesley</li> +<li>Ultimate Go Notebook; Bill Kennedy</li> +<li>The KCNA (Kubernetes and Cloud Native Associate) Book; Nigel Poulton</li> +<li>Clusterbau mit Linux-HA; Michael Schwartzkopff; O'Reilly</li> +<li>Modern Perl; Chromatic ; Onyx Neon Press</li> +<li>C++ Programming Language; Bjarne Stroustrup;</li> +<li>Concurrency in Go; Katherine Cox-Buday; O'Reilly</li> +<li>Terraform Cookbook; Mikael Krief; Packt Publishing</li> +<li>Tmux 2: Productive Mouse-free Development; Brain P. Hogan; The Pragmatic Programmers </li> +<li>Effective awk programming; Arnold Robbins; O'Reilly</li> +<li>21st Century C: C Tips from the New School; Ben Klemens; O'Reilly</li> +<li>Pro Puppet; James Turnbull, Jeffrey McCune; Apress</li> +<li>Think Raku (aka Think Perl 6); Laurent Rosenfeld, Allen B. Downey; O'Reilly</li> +<li>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</li> +<li>Hands-on Infrastructure Monitoring with Prometheus; Joel Bastos, Pedro Araujo; Packt </li> +<li>Data Science at the Command Line; Jeroen Janssens; O'Reilly</li> +<li>Learn You a Haskell for Great Good!; Miran Lipovaca; No Starch Press</li> +<li>Kubernetes Cookbook; Sameer Naik, Sébastien Goasguen, Jonathan Michaux; O'Reilly</li> +<li>Polished Ruby Programming; Jeremy Evans; Packt Publishing</li> +<li>Amazon Web Services in Action; Michael Wittig and Andreas Wittig; Manning Publications</li> +</ul><br /> +<h2 style='display: inline' id='technical-references'>Technical references</h2><br /> +<br /> +<span>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:</span><br /> +<br /> +<ul> +<li>BPF Performance Tools - Linux System and Application Observability, Brendan Gregg; Addison Wesley</li> +<li>Understanding the Linux Kernel; Daniel P. Bovet, Marco Cesati; O'Reilly</li> +<li>The Linux Programming Interface; Michael Kerrisk; No Starch Press </li> +<li>Implementing Service Level Objectives; Alex Hidalgo; O'Reilly</li> +<li>Relayd and Httpd Mastery; Michael W Lucas</li> +<li>Groovy Kurz & Gut; Joerg Staudemeier; O'Reilly</li> +<li>Algorithms; Robert Sedgewick, Kevin Wayne; Addison Wesley</li> +</ul><br /> +<h2 style='display: inline' id='self-development-and-soft-skills-books'>Self-development and soft-skills books</h2><br /> +<br /> +<span>In random order:</span><br /> +<br /> +<ul> +<li>Psycho-Cybernetics; Maxwell Maltz; Perigee Books</li> +<li>The Bullet Journal Method; Ryder Carroll; Fourth Estate</li> +<li>The Power of Now; Eckhard Tolle; Yellow Kite</li> +<li>101 Essays that change the way you think; Brianna Wiest; Audible</li> +<li>The Off Switch; Mark Cropley; Virgin Books</li> +<li>Eat That Frog!; Brian Tracy; Hodder Paperbacks</li> +<li>Influence without Authority; A. Cohen, D. Bradford; Wiley</li> +<li>Search Inside Yourself - The Unexpected path to Achieving Success, Happiness (and World Peace); Chade-Meng Tan, Daniel Goleman, Jon Kabat-Zinn; HarperOne</li> +<li>The Joy of Missing Out; Christina Crook; New Society Publishers</li> +<li>Who Moved My Cheese?; Dr. Spencer Johnson; Vermilion </li> +<li>The Good Enough Job; Simone Stolzoff; Ebury Edge</li> +<li>The Daily Stoic; Ryan Holiday, Stephen Hanselman; Profile Books</li> +<li>Ultralearning; Scott Young; Thorsons</li> +<li>Staff Engineer: Leadership beyond the management track; Will Larson; Audible</li> +<li>Solve for Happy; Mo Gawdat</li> +<li>Soft Skills; John Sommez; Manning Publications</li> +<li>The 7 Habits Of Highly Effective People; Stephen R. Covey; Simon & Schuster UK</li> +<li>Time Management for System Administrators; Thomas A. Limoncelli; O'Reilly</li> +<li>Eat That Frog; Brian Tracy</li> +<li>The Obstacle Is The Way; Ryan Holiday; Profile Books Ltd</li> +<li>Atomic Habits; James Clear; Random House Business</li> +<li>The Phoenix Project - A Novel About IT, DevOps, and Helping your Business Win; Gene Kim and Kevin Behr; Trade Select</li> +<li>Never Split the Difference; Chris Voss, Tahl Raz; Random House Business</li> +<li>Getting Things Done; David Allen</li> +<li>The Complete Software Developer's Career Guide; John Sonmez; Unabridged Audiobook</li> +<li>Digital Minimalism; Cal Newport; Portofolio Penguin</li> +<li>Consciousness: A Very Short Introduction; Susan Blackmore; Oxford Uiversity Press</li> +<li>Deep Work; Cal Newport; Piatkus</li> +<li>Buddah and Einstein walk into a Bar; Guy Joseph Ale, Claire Bloom; Blackstone Publishing</li> +<li>Stop starting, start finishing; Arne Roock; Lean-Kanban University </li> +<li>Ultralearning; Anna Laurent; Self-published via Amazon</li> +<li>Slow Productivity; Cal Newport; Penguin Random House</li> +<li>So Good They Can't Ignore You; Cal Newport; Business Plus</li> +</ul><br /> +<a class='textlink' href='../notes/index.html'>Here are notes of mine for some of the books</a><br /> +<br /> +<h2 style='display: inline' id='technical-video-lectures-and-courses'>Technical video lectures and courses</h2><br /> +<br /> +<span>Some of these were in-person with exams; others were online learning lectures only. In random order:</span><br /> +<br /> +<ul> +<li>Ultimate Go Programming; Bill Kennedy; O'Reilly Online</li> +<li>Developing IaC with Terraform (with Live Lessons); O'Reilly Online</li> +<li>Apache Tomcat Best Practises; 3-day on-site training</li> +<li>F5 Loadbalancers Training; 2-day on-site training; F5, Inc. </li> +<li>Structure and Interpretation of Computer Programs; Harold Abelson and more...; </li> +<li>MySQL Deep Dive Workshop; 2-day on-site training</li> +<li>Scripting Vim; Damian Conway; O'Reilly Online</li> +<li>Algorithms Video Lectures; Robert Sedgewick; O'Reilly Online</li> +<li>Cloud Operations on AWS - Learn how to configure, deploy, maintain, and troubleshoot your AWS environments; 3-day online live training with labs; Amazon</li> +<li>The Well-Grounded Rubyist Video Edition; David. A. Black; O'Reilly Online</li> +<li>Linux Security and Isolation APIs Training; Michael Kerrisk; 3-day on-site training</li> +<li>Protocol buffers; O'Reilly Online</li> +<li>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)</li> +<li>Functional programming lecture; Remote University of Hagen</li> +<li>The Ultimate Kubernetes Bootcamp; School of Devops; O'Reilly Online</li> +<li>AWS Immersion Day; Amazon; 1-day interactive online training </li> +</ul><br /> +<h2 style='display: inline' id='technical-guides'>Technical guides</h2><br /> +<br /> +<span>These are not whole books, but guides (smaller or larger) which I found very useful. in random order:</span><br /> +<br /> +<ul> +<li>Raku Guide at https://raku.guide </li> +<li>Advanced Bash-Scripting Guide </li> +<li>How CPUs work at https://cpu.land</li> +</ul><br /> +<h2 style='display: inline' id='podcasts'>Podcasts</h2><br /> +<br /> +<h3 style='display: inline' id='podcasts-i-like'>Podcasts I like</h3><br /> +<br /> +<span>In random order:</span><br /> +<br /> +<ul> +<li>Hidden Brain</li> +<li>BSD Now</li> +<li>Fork Around And Find Out</li> +<li>Backend Banter</li> +<li>Dev Interrupted</li> +<li>The Pragmatic Engineer Podcast</li> +<li>The ProdCast (Google SRE Podcast)</li> +<li>Cup o' Go [Golang]</li> +<li>Deep Questions with Cal Newport</li> +<li>Fallthrough [Golang]</li> +<li>The Changelog Podcast(s)</li> +<li>Maintainable</li> +</ul><br /> +<h3 style='display: inline' id='podcasts-i-liked'>Podcasts I liked</h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<ul> +<li>FLOSS weekly</li> +<li>CRE: Chaosradio Express [german]</li> +<li>Ship It (predecessor of Fork Around And Find Out)</li> +<li>Modern Mentor</li> +<li>Java Pub House</li> +<li>Go Time (predecessor of fallthrough)</li> +</ul><br /> +<h2 style='display: inline' id='newsletters-i-like'>Newsletters I like</h2><br /> +<br /> +<span>This is a mix of tech and non-tech newsletters I am subscribed to. In random order:</span><br /> +<br /> +<ul> +<li>Andreas Brandhorst Newsletter (Sci-Fi author)</li> +<li>Applied Go Weekly Newsletter</li> +<li>byteSizeGo</li> +<li>Register Spill</li> +<li>The Pragmatic Engineer</li> +<li>Ruby Weekly</li> +<li>Golang Weekly</li> +<li>VK Newsletter</li> +<li>The Valuable Dev</li> +<li>Changelog News</li> +<li>Monospace Mentor</li> +<li>The Imperfectionist</li> +</ul><br /> +<h1 style='display: inline' id='formal-education'>Formal education</h1><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<ul> +<li>One year Student exchange program in OH, USA</li> +<li>German School Majors (Abitur), focus areas: German and Mathematics</li> +<li>Half-year internship as a C/C++ programmer in Sofia, Bulgaria</li> +<li>Graduated from University as Diplom-Inform. (FH) at the Aachen University of Applied Sciences, Germany</li> +</ul><br /> +<span>My diploma thesis, "Object-oriented development of a GUI based tool for event-based simulation of distributed systems," can be found at:</span><br /> +<br /> +<a class='textlink' href='https://codeberg.org/snonux/vs-sim'>https://codeberg.org/snonux/vs-sim</a><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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!)</span><br /> +<br /> +<a class='textlink' href='./'>Go back</a><br /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> 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/style-override.css b/about/style-override.css new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/about/style-override.css 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.html b/gemfeed/2008-06-26-perl-poetry.html index fd8f4af1..dafdc671 100644 --- a/gemfeed/2008-06-26-perl-poetry.html +++ b/gemfeed/2008-06-26-perl-poetry.html @@ -8,10 +8,19 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Perl Poetry</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2008-06-26-perl-poetry.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2008-06-26-perl-poetry.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='perl-poetry'>Perl Poetry</h1><br /> <br /> <span class='quote'>Published at 2008-06-26T21:43:51+01:00; Updated at 2021-05-04</span><br /> <br /> +<span>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.</span><br /> +<br /> +<span>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."</span><br /> +<br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/Perl'>https://en.wikipedia.org/wiki/Perl</a><br /> +<br /> <pre> '\|/' * -- * ----- @@ -35,164 +44,167 @@ _~~|~/_|_|__/|~~~~~~~ | / ~~~~~ | | ~~~~~~~~ (__) (____) </pre> <br /> -<span>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.</span><br /> -<br /> -<span>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."</span><br /> -<br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Perl'>https://en.wikipedia.org/wiki/Perl</a><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline'>math.pl</h2><br /> +<ul> +<li><a href='#perl-poetry'>Perl Poetry</a></li> +<li>⇢ <a href='#mathpl'>math.pl</a></li> +<li>⇢ <a href='#christmaspl'>christmas.pl</a></li> +<li>⇢ <a href='#shoppingpl'>shopping.pl</a></li> +<li>⇢ <a href='#more'>More...</a></li> +</ul><br /> +<h2 style='display: inline' id='mathpl'>math.pl</h2><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="#9A1900">#!/usr/bin/perl</font></i> +<pre><i><font color="silver">#!/usr/bin/perl</font></i> -<i><font color="#9A1900"># (C) 2006 by Paul C. Buetow</font></i> +<i><font color="silver"># (C) 2006 by Paul C. Buetow</font></i> -<b><font color="#0000FF">goto</font></b> library <b><font color="#0000FF">for</font></b> study <font color="#009900">$math</font><font color="#990000">;</font> -BEGIN <font color="#FF0000">{</font> <b><font color="#0000FF">s</font></b><font color="#FF0000">/earching/ books/</font> -<b><font color="#0000FF">and</font></b> <b><font color="#0000FF">read</font></b> <font color="#009900">$them</font><font color="#990000">,</font> <font color="#009900">$at</font><font color="#990000">,</font> <font color="#009900">$the</font> <font color="#FF0000">}</font> library<font color="#990000">:</font> +<b><u><font color="#000000">goto</font></u></b> library <b><u><font color="#000000">for</font></u></b> study $math; +BEGIN { <b><u><font color="#000000">s</font></u></b><font color="#808080">/earching/ books/</font> +<b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">read</font></u></b> $them, $at, $the } library: -<b><font color="#0000FF">our</font></b> <font color="#009900">$topics</font><font color="#990000">,</font> <b><font color="#0000FF">cos</font></b> <b><font color="#0000FF">and</font></b> tan<font color="#990000">,</font> -<b><font color="#0000FF">require</font></b> strict<font color="#990000">;</font> <b><font color="#000080">import</font></b> <font color="#FF0000">{</font> of<font color="#990000">,</font> <b><font color="#0000FF">tied</font></b> <font color="#009900">$patience</font> <font color="#FF0000">}</font><font color="#990000">;</font> +<b><u><font color="#000000">our</font></u></b> $topics, <b><u><font color="#000000">cos</font></u></b> <b><u><font color="#000000">and</font></u></b> tan, +<b><u><font color="#000000">require</font></u></b> strict; <b><u><font color="#000000">import</font></u></b> { of, <b><u><font color="#000000">tied</font></u></b> $patience }; -<b><font color="#0000FF">do</font></b> <font color="#FF0000">{</font> <b><font color="#0000FF">int</font></b><font color="#FF0000">'egrate'</font><font color="#990000">;</font> <b><font color="#0000FF">sub</font></b> trade<font color="#990000">;</font> <font color="#FF0000">}</font><font color="#990000">;</font> -<b><font color="#0000FF">do</font></b> <font color="#FF0000">{</font> <b><font color="#0000FF">exp</font></b><font color="#FF0000">'onentize'</font> <b><font color="#0000FF">and</font></b> <b><font color="#0000FF">abs</font></b><font color="#FF0000">'olutize'</font> <font color="#FF0000">}</font><font color="#990000">;</font> -study <b><font color="#0000FF">and</font></b> study <b><font color="#0000FF">and</font></b> study <b><font color="#0000FF">and</font></b> study<font color="#990000">;</font> +<b><u><font color="#000000">do</font></u></b> { <b><u><font color="#000000">int</font></u></b><font color="#808080">'egrate'</font>; <b><u><font color="#000000">sub</font></u></b> trade; }; +<b><u><font color="#000000">do</font></u></b> { <b><u><font color="#000000">exp</font></u></b><font color="#808080">'onentize'</font> <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">abs</font></u></b><font color="#808080">'olutize'</font> }; +study <b><u><font color="#000000">and</font></u></b> study <b><u><font color="#000000">and</font></u></b> study <b><u><font color="#000000">and</font></u></b> study; -<b><font color="#0000FF">foreach</font></b> <font color="#009900">$topic</font> <font color="#990000">(</font><font color="#FF0000">{</font>of<font color="#990000">,</font> math<font color="#FF0000">}</font><font color="#990000">)</font> <font color="#FF0000">{</font> -you<font color="#990000">,</font> <b><font color="#0000FF">m</font></b><font color="#FF6600">/ay /</font>go<font color="#990000">,</font> to<font color="#990000">,</font> limits <font color="#FF0000">}</font> +<b><u><font color="#000000">foreach</font></u></b> $topic ({of, math}) { +you, <b><u><font color="#000000">m</font></u></b>/ay /go, to, limits } -<b><font color="#0000FF">do</font></b> <font color="#FF0000">{</font> not <b><font color="#0000FF">qw</font></b><font color="#FF0000">/erk /</font> <b><font color="#0000FF">unless</font></b> <font color="#009900">$success</font> -<b><font color="#0000FF">and</font></b> <b><font color="#0000FF">m</font></b><font color="#FF6600">/ove /</font>o<font color="#990000">;</font><font color="#009900">$n</font> <b><font color="#0000FF">and</font></b> study <font color="#FF0000">}</font><font color="#990000">;</font> +<b><u><font color="#000000">do</font></u></b> { not <b><u><font color="#000000">qw</font></u></b><font color="#808080">/erk /</font> <b><u><font color="#000000">unless</font></u></b> $success +<b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">m</font></u></b>/ove /o;$n <b><u><font color="#000000">and</font></u></b> study }; -<b><font color="#0000FF">do</font></b> <font color="#FF0000">{</font> <b><font color="#0000FF">int</font></b><font color="#FF0000">'egrate'</font><font color="#990000">;</font> <b><font color="#0000FF">sub</font></b> trade<font color="#990000">;</font> <font color="#FF0000">}</font><font color="#990000">;</font> -<b><font color="#0000FF">do</font></b> <font color="#FF0000">{</font> <b><font color="#0000FF">exp</font></b><font color="#FF0000">'onentize'</font> <b><font color="#0000FF">and</font></b> <b><font color="#0000FF">abs</font></b><font color="#FF0000">'olutize'</font> <font color="#FF0000">}</font><font color="#990000">;</font> -study <b><font color="#0000FF">and</font></b> study <b><font color="#0000FF">and</font></b> study <b><font color="#0000FF">and</font></b> study<font color="#990000">;</font> +<b><u><font color="#000000">do</font></u></b> { <b><u><font color="#000000">int</font></u></b><font color="#808080">'egrate'</font>; <b><u><font color="#000000">sub</font></u></b> trade; }; +<b><u><font color="#000000">do</font></u></b> { <b><u><font color="#000000">exp</font></u></b><font color="#808080">'onentize'</font> <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">abs</font></u></b><font color="#808080">'olutize'</font> }; +study <b><u><font color="#000000">and</font></u></b> study <b><u><font color="#000000">and</font></u></b> study <b><u><font color="#000000">and</font></u></b> study; -<b><font color="#0000FF">grep</font></b> <font color="#FF0000">/all/</font><font color="#990000">,</font> <b><font color="#0000FF">exp</font></b><font color="#FF0000">'onents'</font> <b><font color="#0000FF">and</font></b> <b><font color="#0000FF">cos</font></b><font color="#FF0000">'inuses'</font><font color="#990000">;</font> -<font color="#FF0000">/seek results/</font> <b><font color="#0000FF">for</font></b> <font color="#009900">@all</font><font color="#990000">,</font> <b><font color="#0000FF">log</font></b><font color="#FF0000">'4rithms'</font><font color="#990000">;</font> +<b><u><font color="#000000">grep</font></u></b> <font color="#808080">/all/</font>, <b><u><font color="#000000">exp</font></u></b><font color="#808080">'onents'</font> <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">cos</font></u></b><font color="#808080">'inuses'</font>; +<font color="#808080">/seek results/</font> <b><u><font color="#000000">for</font></u></b> @all, <b><u><font color="#000000">log</font></u></b><font color="#808080">'4rithms'</font>; -<font color="#FF0000">'you'</font> <font color="#990000">=~</font> <b><font color="#0000FF">m</font></b><font color="#FF6600">/ay /</font>go<font color="#990000">,</font> not home -<b><font color="#0000FF">unless</font></b> <b><font color="#0000FF">each</font></b> <font color="#009900">%book</font> ne<i><font color="#9A1900">#ars</font></i> -<font color="#009900">$completion</font><font color="#990000">;</font> +<font color="#808080">'you'</font> =~ <b><u><font color="#000000">m</font></u></b>/ay /go, not home +<b><u><font color="#000000">unless</font></u></b> <b><u><font color="#000000">each</font></u></b> %book ne<i><font color="silver">#ars</font></i> +$completion; -<b><font color="#0000FF">do</font></b> <font color="#FF0000">{</font> <b><font color="#0000FF">int</font></b><font color="#FF0000">'egrate'</font><font color="#990000">;</font> <b><font color="#0000FF">sub</font></b> trade<font color="#990000">;</font> <font color="#FF0000">}</font><font color="#990000">;</font> -<b><font color="#0000FF">do</font></b> <font color="#FF0000">{</font> <b><font color="#0000FF">exp</font></b><font color="#FF0000">'onentize'</font> <b><font color="#0000FF">and</font></b> <b><font color="#0000FF">abs</font></b><font color="#FF0000">'olutize'</font> <font color="#FF0000">}</font><font color="#990000">;</font> +<b><u><font color="#000000">do</font></u></b> { <b><u><font color="#000000">int</font></u></b><font color="#808080">'egrate'</font>; <b><u><font color="#000000">sub</font></u></b> trade; }; +<b><u><font color="#000000">do</font></u></b> { <b><u><font color="#000000">exp</font></u></b><font color="#808080">'onentize'</font> <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">abs</font></u></b><font color="#808080">'olutize'</font> }; -<i><font color="#9A1900">#at</font></i> -home<font color="#990000">:</font> <font color="#FF0000">//ig,'nore', time and sleep $very =~ s/tr/on/</font><b><font color="#0000FF">g</font></b><font color="#990000">;</font> +<i><font color="silver">#at</font></i> +home: <font color="#808080">//ig,'nore', time and sleep $very =~ s/tr/on/</font><b><u><font color="#000000">g</font></u></b>; __END__ </pre> <br /> -<h2 style='display: inline'>christmas.pl</h2><br /> +<h2 style='display: inline' id='christmaspl'>christmas.pl</h2><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="#9A1900">#!/usr/bin/perl</font></i> +<pre><i><font color="silver">#!/usr/bin/perl</font></i> -<i><font color="#9A1900"># (C) 2006 by Paul C. Buetow</font></i> +<i><font color="silver"># (C) 2006 by Paul C. Buetow</font></i> -Christmas<font color="#990000">:</font><font color="#FF0000">{</font>time<font color="#990000">;</font><i><font color="#9A1900">#!!!</font></i> +Christmas:{time;<i><font color="silver">#!!!</font></i> -Children<font color="#990000">:</font> <b><font color="#0000FF">do</font></b> <b><font color="#0000FF">tell</font></b> <font color="#009900">$wishes</font><font color="#990000">;</font> +Children: <b><u><font color="#000000">do</font></u></b> <b><u><font color="#000000">tell</font></u></b> $wishes; -Santa<font color="#990000">:</font> <b><font color="#0000FF">for</font></b> <font color="#009900">$each</font> <font color="#990000">(</font><font color="#009900">@children</font><font color="#990000">)</font> <font color="#FF0000">{</font> -BEGIN <font color="#FF0000">{</font> <b><font color="#0000FF">read</font></b> <font color="#009900">$each</font><font color="#990000">,</font> <font color="#009900">$their</font><font color="#990000">,</font> wishes <b><font color="#0000FF">and</font></b> study them<font color="#990000">;</font> <b><font color="#0000FF">use</font></b> Memoize<i><font color="#9A1900">#ing</font></i> +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> -<font color="#FF0000">}</font> <b><font color="#0000FF">use</font></b> constant gift<font color="#990000">,</font> <font color="#FF0000">'wrapping'</font><font color="#990000">;</font> -<b><font color="#0000FF">package</font></b> Gifts<font color="#990000">;</font> <b><font color="#0000FF">pack</font></b> <font color="#009900">$each</font><font color="#990000">,</font> gift <b><font color="#0000FF">and</font></b> <b><font color="#0000FF">bless</font></b> <font color="#009900">$each</font> <b><font color="#0000FF">and</font></b> <b><font color="#0000FF">goto</font></b> deliver -or <b><font color="#0000FF">do</font></b> <b><font color="#000080">import</font></b> <b><font color="#0000FF">if</font></b> not <b><font color="#0000FF">local</font></b> <font color="#009900">$available</font><font color="#990000">,!!!</font> HO<font color="#990000">,</font> HO<font color="#990000">,</font> HO<font color="#990000">;</font> +} <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><font color="#0000FF">redo</font></b> Santa<font color="#990000">,</font> <b><font color="#0000FF">pipe</font></b> <font color="#009900">$gifts</font><font color="#990000">,</font> to_childs<font color="#990000">;</font> -<b><font color="#0000FF">redo</font></b> Santa <b><font color="#0000FF">and</font></b> <b><font color="#0000FF">do</font></b> <b><font color="#0000FF">return</font></b> <b><font color="#0000FF">if</font></b> <b><font color="#0000FF">last</font></b> one<font color="#990000">,</font> is<font color="#990000">,</font> delivered<font color="#990000">;</font> +<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<font color="#990000">:</font> gift <b><font color="#0000FF">and</font></b> <b><font color="#0000FF">require</font></b> diagnostics <b><font color="#0000FF">if</font></b> <b><font color="#0000FF">our</font></b> <font color="#009900">$gifts</font> <font color="#990000">,</font>not break<font color="#990000">;</font> -<b><font color="#0000FF">do</font></b><font color="#FF0000">{</font> <b><font color="#0000FF">use</font></b> NEXT<font color="#990000">;</font> time<font color="#990000">;</font> <b><font color="#0000FF">tied</font></b> <font color="#009900">$gifts</font><font color="#FF0000">}</font> <b><font color="#0000FF">if</font></b> broken <b><font color="#0000FF">and</font></b> <b><font color="#0000FF">dump</font></b> the<font color="#990000">,</font> broken<font color="#990000">,</font> ones<font color="#990000">;</font> -The_children<font color="#990000">:</font> <b><font color="#0000FF">sleep</font></b> <b><font color="#0000FF">and</font></b> <b><font color="#0000FF">wait</font></b> <b><font color="#0000FF">for</font></b> <font color="#990000">(</font><b><font color="#0000FF">each</font></b> <font color="#009900">%gift</font><font color="#990000">)</font> <b><font color="#0000FF">and</font></b> try <font color="#FF0000">{</font> to <font color="#990000">=></font> <b><font color="#0000FF">untie</font></b> <font color="#009900">$gifts</font> <font color="#FF0000">}</font><font color="#990000">;</font> +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><font color="#0000FF">redo</font></b> Santa<font color="#990000">,</font> <b><font color="#0000FF">pipe</font></b> <font color="#009900">$gifts</font><font color="#990000">,</font> to_childs<font color="#990000">;</font> -<b><font color="#0000FF">redo</font></b> Santa <b><font color="#0000FF">and</font></b> <b><font color="#0000FF">do</font></b> <b><font color="#0000FF">return</font></b> <b><font color="#0000FF">if</font></b> <b><font color="#0000FF">last</font></b> one<font color="#990000">,</font> is<font color="#990000">,</font> delivered<font color="#990000">;</font> +<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<font color="#990000">:</font> formline <b><font color="#0000FF">s</font></b><font color="#FF0000">/ /childrens/</font><font color="#990000">,</font> <font color="#009900">$gifts</font><font color="#990000">;</font> -<b><font color="#0000FF">alarm</font></b> <b><font color="#0000FF">and</font></b> <b><font color="#0000FF">warn</font></b> <b><font color="#0000FF">if</font></b> not <b><font color="#0000FF">exists</font></b> <font color="#009900">$Christmas</font><font color="#FF0000">{</font> tree<font color="#FF0000">}</font><font color="#990000">,</font> <font color="#009900">@t</font><font color="#990000">,</font> <font color="#009900">$ENV</font><font color="#FF0000">{</font>HOME<font color="#FF0000">}</font><font color="#990000">;</font> -<b><font color="#0000FF">write</font></b> <font color="#990000"><<</font>EMail - to the parents to buy a new christmas tree<font color="#990000">!!!!</font><font color="#993399">111</font> - <b><font color="#0000FF">and</font></b> send the +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 -<font color="#990000">;</font><b><font color="#0000FF">wait</font></b> <b><font color="#0000FF">and</font></b> <b><font color="#0000FF">redo</font></b> deliver until <b><font color="#0000FF">defined</font></b> <b><font color="#0000FF">local</font></b> <font color="#009900">$tree</font><font color="#990000">;</font> +;<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><font color="#0000FF">redo</font></b> Santa<font color="#990000">,</font> <b><font color="#0000FF">pipe</font></b> <font color="#009900">$gifts</font><font color="#990000">,</font> to_childs<font color="#990000">;</font> -<b><font color="#0000FF">redo</font></b> Santa <b><font color="#0000FF">and</font></b> <b><font color="#0000FF">do</font></b> <b><font color="#0000FF">return</font></b> <b><font color="#0000FF">if</font></b> <b><font color="#0000FF">last</font></b> one<font color="#990000">,</font> is<font color="#990000">,</font> delivered <font color="#990000">;</font><font color="#FF0000">}</font> +<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 <font color="#FF0000">{}</font> <b><font color="#0000FF">our</font></b> <font color="#009900">$mission</font> <b><font color="#0000FF">and</font></b> <b><font color="#0000FF">do</font></b> <b><font color="#0000FF">sleep</font></b> until <b><font color="#0000FF">next</font></b> Christmas <font color="#990000">;</font><font color="#FF0000">}</font> +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<font color="#990000">,</font> v5<font color="#990000">.</font><font color="#993399">8.8</font> built <b><font color="#0000FF">for</font></b> i386<font color="#990000">-</font>freebsd<font color="#990000">-</font>64int +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 /> -<h2 style='display: inline'>shopping.pl</h2><br /> +<h2 style='display: inline' id='shoppingpl'>shopping.pl</h2><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="#9A1900">#!/usr/bin/perl</font></i> +<pre><i><font color="silver">#!/usr/bin/perl</font></i> -<i><font color="#9A1900"># (C) 2007 by Paul C. Buetow</font></i> +<i><font color="silver"># (C) 2007 by Paul C. Buetow</font></i> -BEGIN<font color="#FF0000">{}</font> <b><font color="#0000FF">goto</font></b> mall <b><font color="#0000FF">for</font></b> <font color="#009900">$shopping</font><font color="#990000">;</font> +BEGIN{} <b><u><font color="#000000">goto</font></u></b> mall <b><u><font color="#000000">for</font></u></b> $shopping; -<b><font color="#0000FF">m</font></b><font color="#FF6600">/y/</font><font color="#990000">;</font> mall<font color="#990000">:</font> <b><font color="#0000FF">seek</font></b><font color="#009900">$s</font><font color="#990000">,</font> cool <b><font color="#000000">products</font></b><font color="#990000">(),</font> <font color="#FF0000">{</font> to <font color="#990000">=></font> <font color="#009900">$sell</font> <font color="#FF0000">}</font><font color="#990000">;</font> -<b><font color="#0000FF">for</font></b> <font color="#009900">$their</font> <font color="#990000">(</font><font color="#009900">@business</font><font color="#990000">)</font> <font color="#FF0000">{</font> to<font color="#990000">:;</font> earn<font color="#990000">:;</font> a<font color="#990000">:;</font> lot<font color="#990000">:;</font> of<font color="#990000">:;</font> money<font color="#990000">:</font> <font color="#FF0000">}</font> +<b><u><font color="#000000">m</font></u></b>/y/; mall: <b><u><font color="#000000">seek</font></u></b>$s, cool products(), { to => $sell }; +<b><u><font color="#000000">for</font></u></b> $their (@business) { to:; earn:; a:; lot:; of:; money: } -<b><font color="#0000FF">do</font></b> not <b><font color="#0000FF">goto</font></b> home <b><font color="#0000FF">and</font></b> <b><font color="#0000FF">exit</font></b> mall <b><font color="#0000FF">if</font></b> <b><font color="#0000FF">exists</font></b> <font color="#009900">$new</font><font color="#FF0000">{</font>product<font color="#FF0000">}</font><font color="#990000">;</font> -<b><font color="#0000FF">foreach</font></b> <font color="#009900">$of</font> <font color="#990000">(</font><b><font color="#0000FF">q</font></b><font color="#FF0000">(uality rich products)</font><font color="#990000">)</font><font color="#FF0000">{}</font> <b><font color="#0000FF">package</font></b> products<font color="#990000">;</font> +<b><u><font color="#000000">do</font></u></b> not <b><u><font color="#000000">goto</font></u></b> home <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">exit</font></u></b> mall <b><u><font color="#000000">if</font></u></b> <b><u><font color="#000000">exists</font></u></b> $new{product}; +<b><u><font color="#000000">foreach</font></u></b> $of (<b><u><font color="#000000">q</font></u></b><font color="#808080">(uality rich products)</font>){} <b><u><font color="#000000">package</font></u></b> products; -<b><font color="#0000FF">our</font></b> <font color="#009900">$news</font><font color="#990000">;</font> <b><font color="#0000FF">do</font></b> <b><font color="#0000FF">tell</font></b> cool <b><font color="#000000">products</font></b><font color="#990000">()</font> <b><font color="#0000FF">and</font></b> <b><font color="#0000FF">do</font></b><font color="#FF0000">{</font> <b><font color="#0000FF">sub</font></b><i><font color="#9A1900">#tract</font></i> -cool<font color="#FF0000">{</font> <font color="#009900">$products</font> <b><font color="#0000FF">and</font></b> <b><font color="#0000FF">shift</font></b> <font color="#009900">@the</font><font color="#990000">,</font> <font color="#009900">@bad</font><font color="#990000">,</font> <font color="#009900">@ones</font><font color="#990000">;</font> +<b><u><font color="#000000">our</font></u></b> $news; <b><u><font color="#000000">do</font></u></b> <b><u><font color="#000000">tell</font></u></b> cool products() <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">do</font></u></b>{ <b><u><font color="#000000">sub</font></u></b><i><font color="silver">#tract</font></i> +cool{ $products <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">shift</font></u></b> @the, @bad, @ones; -<b><font color="#0000FF">do</font></b> <b><font color="#0000FF">bless</font></b> <font color="#990000">[</font><b><font color="#0000FF">q</font></b><font color="#FF0000">(uality)</font><font color="#990000">],</font> <font color="#009900">$products</font> -<b><font color="#0000FF">and</font></b> <b><font color="#0000FF">return</font></b> not <b><font color="#0000FF">undef</font></b> <font color="#009900">$stuff</font> <b><font color="#0000FF">if</font></b> <b><font color="#000000">not</font></b> <font color="#990000">(</font><b><font color="#0000FF">local</font></b> <font color="#009900">$available</font><font color="#990000">)</font> <font color="#FF0000">}}</font><font color="#990000">;</font> +<b><u><font color="#000000">do</font></u></b> <b><u><font color="#000000">bless</font></u></b> [<b><u><font color="#000000">q</font></u></b><font color="#808080">(uality)</font>], $products +<b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">return</font></u></b> not <b><u><font color="#000000">undef</font></u></b> $stuff <b><u><font color="#000000">if</font></u></b> not (<b><u><font color="#000000">local</font></u></b> $available) }}; -<b><font color="#0000FF">do</font></b> <font color="#FF0000">{</font> study <b><font color="#0000FF">and</font></b> study <b><font color="#0000FF">and</font></b> study <b><font color="#0000FF">for</font></b> cool <b><font color="#000000">products</font></b><font color="#990000">()</font> <font color="#FF0000">}</font> -<b><font color="#0000FF">and</font></b> <b><font color="#0000FF">do</font></b> <font color="#FF0000">{</font> <b><font color="#0000FF">seek</font></b> <font color="#009900">$all</font><font color="#990000">,</font> cool <b><font color="#000000">products</font></b><font color="#990000">(),</font> <font color="#FF0000">{</font> to <font color="#990000">=></font> <font color="#009900">$buy</font> <font color="#FF0000">}</font> <font color="#FF0000">}</font><font color="#990000">;</font> +<b><u><font color="#000000">do</font></u></b> { study <b><u><font color="#000000">and</font></u></b> study <b><u><font color="#000000">and</font></u></b> study <b><u><font color="#000000">for</font></u></b> cool products() } +<b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">do</font></u></b> { <b><u><font color="#000000">seek</font></u></b> $all, cool products(), { to => $buy } }; -<b><font color="#0000FF">do</font></b> <font color="#FF0000">{</font> <b><font color="#0000FF">write</font></b> <font color="#009900">$them</font><font color="#990000">,</font> <font color="#009900">$down</font> <font color="#FF0000">}</font> <b><font color="#0000FF">and</font></b> <b><font color="#0000FF">do</font></b> <font color="#FF0000">{</font> order<font color="#990000">:</font> <b><font color="#0000FF">foreach</font></b> <font color="#990000">(</font><font color="#009900">@case</font><font color="#990000">)</font> <font color="#FF0000">{</font> <b><font color="#0000FF">package</font></b> <b><font color="#0000FF">s</font></b> <font color="#FF0000">}</font> <font color="#FF0000">}</font><font color="#990000">;</font> -<b><font color="#0000FF">goto</font></b> home <b><font color="#0000FF">if</font></b> not <b><font color="#0000FF">exists</font></b> <font color="#009900">$more</font><font color="#FF0000">{</font>money<font color="#FF0000">}</font> or <b><font color="#0000FF">die</font></b> <b><font color="#0000FF">q</font></b><font color="#FF0000">(uerying)</font> <font color="#990000">;</font><b><font color="#0000FF">for</font></b><font color="#990000">(</font> <font color="#009900">@money</font><font color="#990000">)</font><font color="#FF0000">{}</font><font color="#990000">;</font> +<b><u><font color="#000000">do</font></u></b> { <b><u><font color="#000000">write</font></u></b> $them, $down } <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">do</font></u></b> { order: <b><u><font color="#000000">foreach</font></u></b> (@case) { <b><u><font color="#000000">package</font></u></b> <b><u><font color="#000000">s</font></u></b> } }; +<b><u><font color="#000000">goto</font></u></b> home <b><u><font color="#000000">if</font></u></b> not <b><u><font color="#000000">exists</font></u></b> $more{money} or <b><u><font color="#000000">die</font></u></b> <b><u><font color="#000000">q</font></u></b><font color="#808080">(uerying)</font> ;<b><u><font color="#000000">for</font></u></b>( @money){}; -at<font color="#990000">:;</font>home<font color="#990000">:</font> <b><font color="#0000FF">do</font></b> <font color="#FF0000">{</font> END<font color="#FF0000">{}</font> <b><font color="#0000FF">and</font></b><font color="#990000">:;</font> rest<font color="#990000">:;</font> a<font color="#990000">:;</font> bit<font color="#990000">:</font> <b><font color="#0000FF">exit</font></b> <font color="#009900">$shopping</font> <font color="#FF0000">}</font> -<b><font color="#0000FF">and</font></b> <b><font color="#0000FF">sleep</font></b> until <b><font color="#0000FF">unpack</font></b><font color="#009900">$ing</font><font color="#990000">,</font> cool <b><font color="#000000">products</font></b><font color="#990000">();</font> +at:;home: <b><u><font color="#000000">do</font></u></b> { END{} <b><u><font color="#000000">and</font></u></b>:; rest:; a:; bit: <b><u><font color="#000000">exit</font></u></b> $shopping } +<b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">sleep</font></u></b> until <b><u><font color="#000000">unpack</font></u></b>$ing, cool products(); __END__ -This is perl<font color="#990000">,</font> v5<font color="#990000">.</font><font color="#993399">8.8</font> built <b><font color="#0000FF">for</font></b> i386<font color="#990000">-</font>freebsd<font color="#990000">-</font>64int +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 /> -<h2 style='display: inline'>More...</h2><br /> +<h2 style='display: inline' id='more'>More...</h2><br /> <br /> <span>Did you like what you saw? Have a look at Codeberg to see my other poems too:</span><br /> <br /> <a class='textlink' href='https://codeberg.org/snonux/perl-poetry'>https://codeberg.org/snonux/perl-poetry</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 (You are currently reading this)</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 /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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 (You are currently reading this)</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2008-12-29-using-my-nokia-n95-for-fixing-my-mta.html b/gemfeed/2008-12-29-using-my-nokia-n95-for-fixing-my-mta.html index 2e586e6b..7fb67c20 100644 --- a/gemfeed/2008-12-29-using-my-nokia-n95-for-fixing-my-mta.html +++ b/gemfeed/2008-12-29-using-my-nokia-n95-for-fixing-my-mta.html @@ -8,7 +8,10 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Using my Nokia N95 for fixing my MTA</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2008-12-29-using-my-nokia-n95-for-fixing-my-mta.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2008-12-29-using-my-nokia-n95-for-fixing-my-mta.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='using-my-nokia-n95-for-fixing-my-mta'>Using my Nokia N95 for fixing my MTA</h1><br /> <br /> <span class='quote'>Published at 2008-12-29T09:10:41+00:00; Updated at 2021-12-01</span><br /> <br /> @@ -32,7 +35,7 @@ _jgs_\|//_\\|///_\V/_\|//__ <br /> <span>My first attempt to find an internet café, which was working during Christmastime, failed. However, I found with my N95 phone lots of free WLAN hotspots. The hotspots refused me logging into my server using SSH as I have configured a non-standard port for SSH for security reasons. Without knowing the costs, I used the GPRS internet access of my German phone provider (yes, I had to pay roaming fees). </span><br /> <br /> -<a href='./2008-12-29-using-my-nokia-n95-for-fixing-my-mta/nokia-n95.jpg'><img alt='Picture of a Nokia N95' title='Picture of a Nokia N95' src='./2008-12-29-using-my-nokia-n95-for-fixing-my-mta/nokia-n95.jpg' /></a><br /> +<a href='./using-my-nokia-n95-for-fixing-my-mta/nokia-n95.jpg'><img alt='Picture of a Nokia N95' title='Picture of a Nokia N95' src='./using-my-nokia-n95-for-fixing-my-mta/nokia-n95.jpg' /></a><br /> <br /> <span>With Putty for N95 and configuring Postfix with Vim and the T9 input mechanism, I managed to fix the problem. But it took half of an hour:</span><br /> <br /> @@ -50,9 +53,9 @@ _jgs_\|//_\\|///_\V/_\|//__ <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2009-02-13-sgi-onyx-3200.html b/gemfeed/2009-02-13-sgi-onyx-3200.html new file mode 100644 index 00000000..b8a894a2 --- /dev/null +++ b/gemfeed/2009-02-13-sgi-onyx-3200.html @@ -0,0 +1,89 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>SGI Onyx 3200</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2009-02-13-sgi-onyx-3200.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2009-02-13-sgi-onyx-3200.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='sgi-onyx-3200'>SGI Onyx 3200</h1><br /> +<br /> +<span class='quote'>Published at 2025-02-13T21:17:16+02:00</span><br /> +<br /> +<span>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:</span><br /> +<br /> +<ul> +<li>4 x 400 MHz IP35 MIPS CPUs</li> +<li>4GB of RAM</li> +</ul><br /> +<a class='textlink' href='./sgi-onyx-3200/desk.webp'>./sgi-onyx-3200/desk.webp</a><br /> +<br /> +<span>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.</span><br /> +<br /> +<pre> +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 +</pre> +<br /> +<a class='textlink' href='./sgi-onyx-3200/collage.webp'>./sgi-onyx-3200/collage.webp</a><br /> +<br /> +<span>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.</span><br /> +<br /> +<a class='textlink' href='./sgi-onyx-3200/collage2.webp'>./sgi-onyx-3200/collage2.webp</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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2010-04-09-standard-ml-and-haskell.html b/gemfeed/2010-04-09-standard-ml-and-haskell.html index b7272b73..fb72b09b 100644 --- a/gemfeed/2010-04-09-standard-ml-and-haskell.html +++ b/gemfeed/2010-04-09-standard-ml-and-haskell.html @@ -8,7 +8,10 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Standard ML and Haskell</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2010-04-09-standard-ml-and-haskell.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2010-04-09-standard-ml-and-haskell.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='standard-ml-and-haskell'>Standard ML and Haskell</h1><br /> <br /> <span class='quote'>Published at 2010-04-09T22:57:36+01:00</span><br /> <br /> @@ -18,7 +21,18 @@ <br /> <span>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:</span><br /> <br /> -<h2 style='display: inline'>Defining a multi-data type</h2><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#standard-ml-and-haskell'>Standard ML and Haskell</a></li> +<li>⇢ <a href='#defining-a-multi-data-type'>Defining a multi-data type</a></li> +<li>⇢ <a href='#processing-a-multi'>Processing a multi</a></li> +<li>⇢ <a href='#simplify-function'>Simplify function</a></li> +<li>⇢ <a href='#delete-all'>Delete all</a></li> +<li>⇢ <a href='#delete-one'>Delete one</a></li> +<li>⇢ <a href='#higher-order-functions'>Higher-order functions</a></li> +</ul><br /> +<h2 style='display: inline' id='defining-a-multi-data-type'>Defining a multi-data type</h2><br /> <br /> <span>Standard ML:</span><br /> <br /> @@ -26,10 +40,10 @@ by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#0000FF">datatype</font></b> ’a multi - <font color="#990000">=</font> EMPTY - <font color="#990000">|</font> ELEM <b><font color="#0000FF">of</font></b> ’a - <font color="#990000">|</font> UNION <b><font color="#0000FF">of</font></b> ’a multi <font color="#990000">*</font> ’a multi +<pre><b><u><font color="#000000">datatype</font></u></b> ’a multi + = EMPTY + | ELEM <b><u><font color="#000000">of</font></u></b> ’a + | UNION <b><u><font color="#000000">of</font></u></b> ’a multi * ’a multi </pre> <br /> <span>Haskell:</span><br /> @@ -38,14 +52,14 @@ 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="#0000FF">data</font></b> <font color="#990000">(</font><font color="#009900">Eq</font> a<font color="#990000">)</font> <font color="#990000">=></font> <font color="#009900">Multi</font> a - <font color="#990000">=</font> <font color="#009900">Empty</font> - <font color="#990000">|</font> <font color="#009900">Elem</font> a - <font color="#990000">|</font> <font color="#009900">Union</font> <font color="#990000">(</font><font color="#009900">Multi</font> a<font color="#990000">)</font> <font color="#990000">(</font><font color="#009900">Multi</font> a<font color="#990000">)</font> - <b><font color="#0000FF">deriving</font></b> <font color="#009900">Show</font> +<pre><b><u><font color="#000000">data</font></u></b> (<b><font color="#000000">Eq</font></b> a) => <b><font color="#000000">Multi</font></b> a + = <b><font color="#000000">Empty</font></b> + | <b><font color="#000000">Elem</font></b> a + | <b><font color="#000000">Union</font></b> (<b><font color="#000000">Multi</font></b> a) (<b><font color="#000000">Multi</font></b> a) + <b><u><font color="#000000">deriving</font></u></b> <b><font color="#000000">Show</font></b> </pre> <br /> -<h2 style='display: inline'>Processing a multi</h2><br /> +<h2 style='display: inline' id='processing-a-multi'>Processing a multi</h2><br /> <br /> <span>Standard ML:</span><br /> <br /> @@ -53,12 +67,12 @@ 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="#0000FF">fun</font></b> number <font color="#990000">(</font>EMPTY<font color="#990000">)</font> _ <font color="#990000">=</font> <font color="#993399">0</font> - <font color="#990000">|</font> number <font color="#990000">(</font>ELEM x<font color="#990000">)</font> w <font color="#990000">=</font> <b><font color="#0000FF">if</font></b> x <font color="#990000">=</font> w <b><font color="#0000FF">then</font></b> <font color="#993399">1</font> <b><font color="#0000FF">else</font></b> <font color="#993399">0</font> - <font color="#990000">|</font> number <font color="#990000">(</font>UNION <font color="#990000">(</font>x<font color="#990000">,</font>y<font color="#990000">))</font> w <font color="#990000">=</font> <font color="#990000">(</font>number x w<font color="#990000">)</font> <font color="#990000">+</font> <font color="#990000">(</font>number y w<font color="#990000">)</font> -<b><font color="#0000FF">fun</font></b> test_number w <font color="#990000">=</font> number <font color="#990000">(</font>UNION <font color="#990000">(</font>EMPTY<font color="#990000">,</font> <font color="#990000">\</font> - UNION <font color="#990000">(</font>ELEM <font color="#993399">4</font><font color="#990000">,</font> UNION <font color="#990000">(</font>ELEM <font color="#993399">6</font><font color="#990000">,</font> <font color="#990000">\</font> - UNION <font color="#990000">(</font>UNION <font color="#990000">(</font>ELEM <font color="#993399">4</font><font color="#990000">,</font> ELEM <font color="#993399">4</font><font color="#990000">),</font> EMPTY<font color="#990000">)))))</font> w +<pre><b><u><font color="#000000">fun</font></u></b> number (EMPTY) _ = <font color="#000000">0</font> + | number (ELEM x) w = <b><u><font color="#000000">if</font></u></b> x = w <b><u><font color="#000000">then</font></u></b> <font color="#000000">1</font> <b><u><font color="#000000">else</font></u></b> <font color="#000000">0</font> + | number (UNION (x,y)) w = (number x w) + (number y w) +<b><u><font color="#000000">fun</font></u></b> test_number w = number (UNION (EMPTY, \ + UNION (ELEM <font color="#000000">4</font>, UNION (ELEM <font color="#000000">6</font>, \ + UNION (UNION (ELEM <font color="#000000">4</font>, ELEM <font color="#000000">4</font>), EMPTY))))) w </pre> <br /> <span>Haskell:</span><br /> @@ -67,14 +81,14 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>number <font color="#009900">Empty</font> <b><font color="#0000FF">_</font></b> <font color="#990000">=</font> <font color="#993399">0</font> -number <font color="#990000">(</font><font color="#009900">Elem</font> x<font color="#990000">)</font> w <font color="#990000">=</font> <b><font color="#0000FF">if</font></b> x <font color="#990000">==</font> w <b><font color="#0000FF">then</font></b> <font color="#993399">1</font> <b><font color="#0000FF">else</font></b> <font color="#993399">0</font> -test_number w <font color="#990000">=</font> number <font color="#990000">(</font><font color="#009900">Union</font> <font color="#009900">Empty</font> <font color="#990000">\</font> - <font color="#990000">(</font><font color="#009900">Union</font> <font color="#990000">(</font><font color="#009900">Elem</font> <font color="#993399">4</font><font color="#990000">)</font> <font color="#990000">(</font><font color="#009900">Union</font> <font color="#990000">(</font><font color="#009900">Elem</font> <font color="#993399">6</font><font color="#990000">)</font> <font color="#990000">\</font> - <font color="#990000">(</font><font color="#009900">Union</font> <font color="#990000">(</font><font color="#009900">Union</font> <font color="#990000">(</font><font color="#009900">Elem</font> <font color="#993399">4</font><font color="#990000">)</font> <font color="#990000">(</font><font color="#009900">Elem</font> <font color="#993399">4</font><font color="#990000">))</font> <font color="#009900">Empty</font><font color="#990000">))))</font> w +<pre>number <b><font color="#000000">Empty</font></b> <b><u><font color="#000000">_</font></u></b> = <font color="#000000">0</font> +number (<b><font color="#000000">Elem</font></b> x) w = <b><u><font color="#000000">if</font></u></b> x == w <b><u><font color="#000000">then</font></u></b> <font color="#000000">1</font> <b><u><font color="#000000">else</font></u></b> <font color="#000000">0</font> +test_number w = number (<b><font color="#000000">Union</font></b> <b><font color="#000000">Empty</font></b> \ + (<b><font color="#000000">Union</font></b> (<b><font color="#000000">Elem</font></b> <font color="#000000">4</font>) (<b><font color="#000000">Union</font></b> (<b><font color="#000000">Elem</font></b> <font color="#000000">6</font>) \ + (<b><font color="#000000">Union</font></b> (<b><font color="#000000">Union</font></b> (<b><font color="#000000">Elem</font></b> <font color="#000000">4</font>) (<b><font color="#000000">Elem</font></b> <font color="#000000">4</font>)) <b><font color="#000000">Empty</font></b>)))) w </pre> <br /> -<h2 style='display: inline'>Simplify function</h2><br /> +<h2 style='display: inline' id='simplify-function'>Simplify function</h2><br /> <br /> <span>Standard ML:</span><br /> <br /> @@ -82,19 +96,19 @@ test_number w <font color="#990000">=</font> number <font color="#990000">(</fon by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#0000FF">fun</font></b> simplify <font color="#990000">(</font>UNION <font color="#990000">(</font>x<font color="#990000">,</font>y<font color="#990000">))</font> <font color="#990000">=</font> - <b><font color="#0000FF">let</font></b> <b><font color="#0000FF">fun</font></b> is_empty <font color="#990000">(</font>EMPTY<font color="#990000">)</font> <font color="#990000">=</font> true <font color="#990000">|</font> is_empty _ <font color="#990000">=</font> false - <b><font color="#0000FF">val</font></b> x’ <font color="#990000">=</font> simplify x - <b><font color="#0000FF">val</font></b> y’ <font color="#990000">=</font> simplify y - <b><font color="#0000FF">in</font></b> <b><font color="#0000FF">if</font></b> <font color="#990000">(</font>is_empty x’<font color="#990000">)</font> <b><font color="#0000FF">andalso</font></b> <font color="#990000">(</font>is_empty y’<font color="#990000">)</font> - <b><font color="#0000FF">then</font></b> EMPTY - <b><font color="#0000FF">else</font></b> <b><font color="#0000FF">if</font></b> <font color="#990000">(</font>is_empty x’<font color="#990000">)</font> - <b><font color="#0000FF">then</font></b> y’ - <b><font color="#0000FF">else</font></b> <b><font color="#0000FF">if</font></b> <font color="#990000">(</font>is_empty y’<font color="#990000">)</font> - <b><font color="#0000FF">then</font></b> x’ - <b><font color="#0000FF">else</font></b> UNION <font color="#990000">(</font>x’<font color="#990000">,</font> y’<font color="#990000">)</font> - <b><font color="#0000FF">end</font></b> - <font color="#990000">|</font> simplify x <font color="#990000">=</font> x +<pre><b><u><font color="#000000">fun</font></u></b> simplify (UNION (x,y)) = + <b><u><font color="#000000">let</font></u></b> <b><u><font color="#000000">fun</font></u></b> is_empty (EMPTY) = true | is_empty _ = false + <b><u><font color="#000000">val</font></u></b> x’ = simplify x + <b><u><font color="#000000">val</font></u></b> y’ = simplify y + <b><u><font color="#000000">in</font></u></b> <b><u><font color="#000000">if</font></u></b> (is_empty x’) <b><u><font color="#000000">andalso</font></u></b> (is_empty y’) + <b><u><font color="#000000">then</font></u></b> EMPTY + <b><u><font color="#000000">else</font></u></b> <b><u><font color="#000000">if</font></u></b> (is_empty x’) + <b><u><font color="#000000">then</font></u></b> y’ + <b><u><font color="#000000">else</font></u></b> <b><u><font color="#000000">if</font></u></b> (is_empty y’) + <b><u><font color="#000000">then</font></u></b> x’ + <b><u><font color="#000000">else</font></u></b> UNION (x’, y’) + <b><u><font color="#000000">end</font></u></b> + | simplify x = x </pre> <br /> <span>Haskell:</span><br /> @@ -103,20 +117,20 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>simplify <font color="#990000">(</font><font color="#009900">Union</font> x y<font color="#990000">)</font> - <font color="#990000">|</font> <font color="#990000">(</font>isEmpty x’<font color="#990000">)</font> <font color="#990000">&&</font> <font color="#990000">(</font>isEmpty y’<font color="#990000">)</font> <font color="#990000">=</font> <font color="#009900">Empty</font> - <font color="#990000">|</font> isEmpty x’ <font color="#990000">=</font> y’ - <font color="#990000">|</font> isEmpty y’ <font color="#990000">=</font> x’ - <font color="#990000">|</font> otherwise <font color="#990000">=</font> <font color="#009900">Union</font> x’ y’ - <b><font color="#0000FF">where</font></b> - isEmpty <font color="#009900">Empty</font> <font color="#990000">=</font> <font color="#009900">True</font> - isEmpty <b><font color="#0000FF">_</font></b> <font color="#990000">=</font> <font color="#009900">False</font> - x’ <font color="#990000">=</font> simplify x - y’ <font color="#990000">=</font> simplify y -simplify x <font color="#990000">=</font> x +<pre>simplify (<b><font color="#000000">Union</font></b> x y) + | (isEmpty x’) && (isEmpty y’) = <b><font color="#000000">Empty</font></b> + | isEmpty x’ = y’ + | isEmpty y’ = x’ + | otherwise = <b><font color="#000000">Union</font></b> x’ y’ + <b><u><font color="#000000">where</font></u></b> + isEmpty <b><font color="#000000">Empty</font></b> = <b><font color="#000000">True</font></b> + isEmpty <b><u><font color="#000000">_</font></u></b> = <b><font color="#000000">False</font></b> + x’ = simplify x + y’ = simplify y +simplify x = x </pre> <br /> -<h2 style='display: inline'>Delete all</h2><br /> +<h2 style='display: inline' id='delete-all'>Delete all</h2><br /> <br /> <span>Standard ML:</span><br /> <br /> @@ -124,12 +138,12 @@ simplify x <font color="#990000">=</font> x by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#0000FF">fun</font></b> delete_all m w <font color="#990000">=</font> - <b><font color="#0000FF">let</font></b> <b><font color="#0000FF">fun</font></b> delete_all’ <font color="#990000">(</font>ELEM x<font color="#990000">)</font> <font color="#990000">=</font> <b><font color="#0000FF">if</font></b> x <font color="#990000">=</font> w <b><font color="#0000FF">then</font></b> EMPTY <b><font color="#0000FF">else</font></b> ELEM x - <font color="#990000">|</font> delete_all’ <font color="#990000">(</font>UNION <font color="#990000">(</font>x<font color="#990000">,</font>y<font color="#990000">))</font> <font color="#990000">=</font> UNION <font color="#990000">(</font>delete_all’ x<font color="#990000">,</font> delete_all’ y<font color="#990000">)</font> - <font color="#990000">|</font> delete_all’ x <font color="#990000">=</font> x - <b><font color="#0000FF">in</font></b> simplify <font color="#990000">(</font>delete_all’ m<font color="#990000">)</font> - <b><font color="#0000FF">end</font></b> +<pre><b><u><font color="#000000">fun</font></u></b> delete_all m w = + <b><u><font color="#000000">let</font></u></b> <b><u><font color="#000000">fun</font></u></b> delete_all’ (ELEM x) = <b><u><font color="#000000">if</font></u></b> x = w <b><u><font color="#000000">then</font></u></b> EMPTY <b><u><font color="#000000">else</font></u></b> ELEM x + | delete_all’ (UNION (x,y)) = UNION (delete_all’ x, delete_all’ y) + | delete_all’ x = x + <b><u><font color="#000000">in</font></u></b> simplify (delete_all’ m) + <b><u><font color="#000000">end</font></u></b> </pre> <br /> <span>Haskell:</span><br /> @@ -138,14 +152,14 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>delete_all m w <font color="#990000">=</font> simplify <font color="#990000">(</font>delete_all’ m<font color="#990000">)</font> - <b><font color="#0000FF">where</font></b> - delete_all’ <font color="#990000">(</font><font color="#009900">Elem</font> x<font color="#990000">)</font> <font color="#990000">=</font> <b><font color="#0000FF">if</font></b> x <font color="#990000">==</font> w <b><font color="#0000FF">then</font></b> <font color="#009900">Empty</font> <b><font color="#0000FF">else</font></b> <font color="#009900">Elem</font> x - delete_all’ <font color="#990000">(</font><font color="#009900">Union</font> x y<font color="#990000">)</font> <font color="#990000">=</font> <font color="#009900">Union</font> <font color="#990000">(</font>delete_all’ x<font color="#990000">)</font> <font color="#990000">(</font>delete_all’ y<font color="#990000">)</font> - delete_all’ x <font color="#990000">=</font> x +<pre>delete_all m w = simplify (delete_all’ m) + <b><u><font color="#000000">where</font></u></b> + delete_all’ (<b><font color="#000000">Elem</font></b> x) = <b><u><font color="#000000">if</font></u></b> x == w <b><u><font color="#000000">then</font></u></b> <b><font color="#000000">Empty</font></b> <b><u><font color="#000000">else</font></u></b> <b><font color="#000000">Elem</font></b> x + delete_all’ (<b><font color="#000000">Union</font></b> x y) = <b><font color="#000000">Union</font></b> (delete_all’ x) (delete_all’ y) + delete_all’ x = x </pre> <br /> -<h2 style='display: inline'>Delete one</h2><br /> +<h2 style='display: inline' id='delete-one'>Delete one</h2><br /> <br /> <span>Standard ML:</span><br /> <br /> @@ -153,21 +167,21 @@ 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="#0000FF">fun</font></b> delete_one m w <font color="#990000">=</font> - <b><font color="#0000FF">let</font></b> <b><font color="#0000FF">fun</font></b> delete_one’ <font color="#990000">(</font>UNION <font color="#990000">(</font>x<font color="#990000">,</font>y<font color="#990000">))</font> <font color="#990000">=</font> - <b><font color="#0000FF">let</font></b> <b><font color="#0000FF">val</font></b> <font color="#990000">(</font>x’<font color="#990000">,</font> deleted<font color="#990000">)</font> <font color="#990000">=</font> delete_one’ x - <b><font color="#0000FF">in</font></b> <b><font color="#0000FF">if</font></b> deleted - <b><font color="#0000FF">then</font></b> <font color="#990000">(</font>UNION <font color="#990000">(</font>x’<font color="#990000">,</font> y<font color="#990000">),</font> deleted<font color="#990000">)</font> - <b><font color="#0000FF">else</font></b> <b><font color="#0000FF">let</font></b> <b><font color="#0000FF">val</font></b> <font color="#990000">(</font>y’<font color="#990000">,</font> deleted<font color="#990000">)</font> <font color="#990000">=</font> delete_one’ y - <b><font color="#0000FF">in</font></b> <font color="#990000">(</font>UNION <font color="#990000">(</font>x<font color="#990000">,</font> y’<font color="#990000">),</font> deleted<font color="#990000">)</font> - <b><font color="#0000FF">end</font></b> - <b><font color="#0000FF">end</font></b> - <font color="#990000">|</font> delete_one’ <font color="#990000">(</font>ELEM x<font color="#990000">)</font> <font color="#990000">=</font> - <b><font color="#0000FF">if</font></b> x <font color="#990000">=</font> w <b><font color="#0000FF">then</font></b> <font color="#990000">(</font>EMPTY<font color="#990000">,</font> true<font color="#990000">)</font> <b><font color="#0000FF">else</font></b> <font color="#990000">(</font>ELEM x<font color="#990000">,</font> false<font color="#990000">)</font> - <font color="#990000">|</font> delete_one’ x <font color="#990000">=</font> <font color="#990000">(</font>x<font color="#990000">,</font> false<font color="#990000">)</font> - <b><font color="#0000FF">val</font></b> <font color="#990000">(</font>m’<font color="#990000">,</font> _<font color="#990000">)</font> <font color="#990000">=</font> delete_one’ m - <b><font color="#0000FF">in</font></b> simplify m’ - <b><font color="#0000FF">end</font></b> +<pre><b><u><font color="#000000">fun</font></u></b> delete_one m w = + <b><u><font color="#000000">let</font></u></b> <b><u><font color="#000000">fun</font></u></b> delete_one’ (UNION (x,y)) = + <b><u><font color="#000000">let</font></u></b> <b><u><font color="#000000">val</font></u></b> (x’, deleted) = delete_one’ x + <b><u><font color="#000000">in</font></u></b> <b><u><font color="#000000">if</font></u></b> deleted + <b><u><font color="#000000">then</font></u></b> (UNION (x’, y), deleted) + <b><u><font color="#000000">else</font></u></b> <b><u><font color="#000000">let</font></u></b> <b><u><font color="#000000">val</font></u></b> (y’, deleted) = delete_one’ y + <b><u><font color="#000000">in</font></u></b> (UNION (x, y’), deleted) + <b><u><font color="#000000">end</font></u></b> + <b><u><font color="#000000">end</font></u></b> + | delete_one’ (ELEM x) = + <b><u><font color="#000000">if</font></u></b> x = w <b><u><font color="#000000">then</font></u></b> (EMPTY, true) <b><u><font color="#000000">else</font></u></b> (ELEM x, false) + | delete_one’ x = (x, false) + <b><u><font color="#000000">val</font></u></b> (m’, _) = delete_one’ m + <b><u><font color="#000000">in</font></u></b> simplify m’ + <b><u><font color="#000000">end</font></u></b> </pre> <br /> <span>Haskell:</span><br /> @@ -176,22 +190,22 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>delete_one m w <font color="#990000">=</font> <b><font color="#0000FF">do</font></b> - <b><font color="#0000FF">let</font></b> <font color="#990000">(</font>m’<font color="#990000">,</font> <b><font color="#0000FF">_</font></b><font color="#990000">)</font> <font color="#990000">=</font> delete_one’ m +<pre>delete_one m w = <b><u><font color="#000000">do</font></u></b> + <b><u><font color="#000000">let</font></u></b> (m’, <b><u><font color="#000000">_</font></u></b>) = delete_one’ m simplify m’ - <b><font color="#0000FF">where</font></b> - delete_one’ <font color="#990000">(</font><font color="#009900">Union</font> x y<font color="#990000">)</font> <font color="#990000">=</font> - <b><font color="#0000FF">let</font></b> <font color="#990000">(</font>x’<font color="#990000">,</font> deleted<font color="#990000">)</font> <font color="#990000">=</font> delete_one’ x - <b><font color="#0000FF">in</font></b> <b><font color="#0000FF">if</font></b> deleted - <b><font color="#0000FF">then</font></b> <font color="#990000">(</font><font color="#009900">Union</font> x’ y<font color="#990000">,</font> deleted<font color="#990000">)</font> - <b><font color="#0000FF">else</font></b> <b><font color="#0000FF">let</font></b> <font color="#990000">(</font>y’<font color="#990000">,</font> deleted<font color="#990000">)</font> <font color="#990000">=</font> delete_one’ y - <b><font color="#0000FF">in</font></b> <font color="#990000">(</font><font color="#009900">Union</font> x y’<font color="#990000">,</font> deleted<font color="#990000">)</font> - delete_one’ <font color="#990000">(</font><font color="#009900">Elem</font> x<font color="#990000">)</font> <font color="#990000">=</font> - <b><font color="#0000FF">if</font></b> x <font color="#990000">==</font> w <b><font color="#0000FF">then</font></b> <font color="#990000">(</font><font color="#009900">Empty</font><font color="#990000">,</font> <font color="#009900">True</font><font color="#990000">)</font> <b><font color="#0000FF">else</font></b> <font color="#990000">(</font><font color="#009900">Elem</font> x<font color="#990000">,</font> <font color="#009900">False</font><font color="#990000">)</font> - delete_one’ x <font color="#990000">=</font> <font color="#990000">(</font>x<font color="#990000">,</font> <font color="#009900">False</font><font color="#990000">)</font> + <b><u><font color="#000000">where</font></u></b> + delete_one’ (<b><font color="#000000">Union</font></b> x y) = + <b><u><font color="#000000">let</font></u></b> (x’, deleted) = delete_one’ x + <b><u><font color="#000000">in</font></u></b> <b><u><font color="#000000">if</font></u></b> deleted + <b><u><font color="#000000">then</font></u></b> (<b><font color="#000000">Union</font></b> x’ y, deleted) + <b><u><font color="#000000">else</font></u></b> <b><u><font color="#000000">let</font></u></b> (y’, deleted) = delete_one’ y + <b><u><font color="#000000">in</font></u></b> (<b><font color="#000000">Union</font></b> x y’, deleted) + delete_one’ (<b><font color="#000000">Elem</font></b> x) = + <b><u><font color="#000000">if</font></u></b> x == w <b><u><font color="#000000">then</font></u></b> (<b><font color="#000000">Empty</font></b>, <b><font color="#000000">True</font></b>) <b><u><font color="#000000">else</font></u></b> (<b><font color="#000000">Elem</font></b> x, <b><font color="#000000">False</font></b>) + delete_one’ x = (x, <b><font color="#000000">False</font></b>) </pre> <br /> -<h2 style='display: inline'>Higher-order functions</h2><br /> +<h2 style='display: inline' id='higher-order-functions'>Higher-order functions</h2><br /> <br /> <span>The first line is always the SML code, the second line the Haskell variant:</span><br /> <br /> @@ -213,9 +227,9 @@ my_filter f l = foldr (make_filter_fn f) [] l <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.html b/gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.html index 534aa6d7..b2f80223 100644 --- a/gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.html +++ b/gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.html @@ -8,7 +8,10 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Lazy Evaluation with Standard ML</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='lazy-evaluation-with-standard-ml'>Lazy Evaluation with Standard ML</h1><br /> <br /> <span class='quote'>Published at 2010-05-07T08:17:59+01:00</span><br /> <br /> @@ -32,7 +35,7 @@ <br /> <span>You can solve specific problems with lazy evaluation easier than with eager evaluation. For example, you might want to list the number Pi or another infinite list of something. With the help of lazy evaluation, each element of the list is calculated when it is accessed first, but not earlier.</span><br /> <br /> -<h2 style='display: inline'>Emulating lazy evaluation in SML</h2><br /> +<h2 style='display: inline' id='emulating-lazy-evaluation-in-sml'>Emulating lazy evaluation in SML</h2><br /> <br /> <span>However, it is possible to emulate lazy evaluation in most eager evaluation languages. This is how it is done with Standard ML (with some play with an infinite list of natural number tuples filtering out 0 elements):</span><br /> <br /> @@ -78,7 +81,7 @@ val test = first 10 (nat_pairs_not_null ()); <br /> <a class='textlink' href='http://smlnj.org/'>http://smlnj.org/</a><br /> <br /> -<h2 style='display: inline'>Real laziness with Haskell </h2><br /> +<h2 style='display: inline' id='real-laziness-with-haskell-'>Real laziness with Haskell </h2><br /> <br /> <span>As Haskell already uses lazy evaluation by default, there is no need to construct a new data type. Lists in Haskell are lazy by default. You will notice that the code is also much shorter and easier to understand than the SML version. </span><br /> <br /> @@ -110,9 +113,9 @@ first 10 nat_pairs_not_null <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2010-05-09-the-fype-programming-language.html b/gemfeed/2010-05-09-the-fype-programming-language.html index d71fcfe1..35a1d906 100644 --- a/gemfeed/2010-05-09-the-fype-programming-language.html +++ b/gemfeed/2010-05-09-the-fype-programming-language.html @@ -8,10 +8,19 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>The Fype Programming Language</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2010-05-09-the-fype-programming-language.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2010-05-09-the-fype-programming-language.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='the-fype-programming-language'>The Fype Programming Language</h1><br /> <br /> <span class='quote'>Published at 2010-05-09T12:48:29+01:00; Updated at 2021-05-05</span><br /> <br /> +<span>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.</span><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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!".</span><br /> +<br /> <pre> ____ _ __ / / _|_ _ _ __ ___ _ _ ___ __ _| |__ / _|_ _ @@ -21,13 +30,36 @@ |___/|_| |___/ |___/ </pre> <br /> -<span>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.</span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<span>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. </span><br /> -<br /> -<span>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!".</span><br /> -<br /> -<h2 style='display: inline'>Object-oriented C style</h2><br /> +<ul> +<li><a href='#the-fype-programming-language'>The Fype Programming Language</a></li> +<li>⇢ <a href='#object-oriented-c-style'>Object-oriented C style</a></li> +<li>⇢ <a href='#data-types'>Data types</a></li> +<li>⇢ <a href='#syntax'>Syntax</a></li> +<li>⇢ ⇢ <a href='#comments'>Comments</a></li> +<li>⇢ ⇢ <a href='#variables'>Variables</a></li> +<li>⇢ ⇢ <a href='#synonyms'>Synonyms</a></li> +<li>⇢ <a href='#statements-and-expressions'>Statements and expressions</a></li> +<li>⇢ ⇢ <a href='#parenthesis'>Parenthesis</a></li> +<li>⇢ ⇢ <a href='#basic-expressions'>Basic expressions</a></li> +<li>⇢ ⇢ <a href='#bitwise-expressions'>Bitwise expressions</a></li> +<li>⇢ ⇢ <a href='#numeric-expressions'>Numeric expressions</a></li> +<li>⇢ <a href='#control-statements'>Control statements</a></li> +<li>⇢ <a href='#scopes'>Scopes</a></li> +<li>⇢ <a href='#definedness-'>Definedness </a></li> +<li>⇢ <a href='#system-'>System </a></li> +<li>⇢ ⇢ <a href='#io-'>I/O </a></li> +<li>⇢ <a href='#procedures-and-functions'>Procedures and functions</a></li> +<li>⇢ ⇢ <a href='#procedures'>Procedures</a></li> +<li>⇢ ⇢ <a href='#nested-procedures'>Nested procedures</a></li> +<li>⇢ ⇢ <a href='#functions'>Functions</a></li> +<li>⇢ ⇢ <a href='#nested-functions'>Nested functions</a></li> +<li>⇢ <a href='#arrays'>Arrays</a></li> +<li>⇢ <a href='#fancy-stuff'>Fancy stuff</a></li> +<li>⇢ <a href='#may-the-source-be-with-you'>May the source be with you</a></li> +</ul><br /> +<h2 style='display: inline' id='object-oriented-c-style'>Object-oriented C style</h2><br /> <br /> <span>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. </span><br /> <br /> @@ -37,12 +69,12 @@ by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#0000FF">typedef</font></b> <b><font color="#0000FF">struct</font></b> <font color="#FF0000">{</font> - <font color="#008080">Tupel</font> <font color="#990000">*</font>p_tupel_argv<font color="#990000">;</font> <i><font color="#9A1900">// Contains command line options</font></i> - <font color="#008080">List</font> <font color="#990000">*</font>p_list_token<font color="#990000">;</font> <i><font color="#9A1900">// Initial list of token</font></i> - <font color="#008080">Hash</font> <font color="#990000">*</font>p_hash_syms<font color="#990000">;</font> <i><font color="#9A1900">// Symbol table</font></i> - <font color="#009900">char</font> <font color="#990000">*</font>c_basename<font color="#990000">;</font> -<font color="#FF0000">}</font> Fype<font color="#990000">;</font> +<pre><b><u><font color="#000000">typedef</font></u></b> <b><u><font color="#000000">struct</font></u></b> { + Tupel *p_tupel_argv; <i><font color="silver">// Contains command line options</font></i> + List *p_list_token; <i><font color="silver">// Initial list of token</font></i> + Hash *p_hash_syms; <i><font color="silver">// Symbol table</font></i> + <b><font color="#000000">char</font></b> *c_basename; +} Fype; </pre> <br /> <span>And here is a snippet from the primary Fype "class implementation":</span><br /> @@ -51,56 +83,56 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>Fype<font color="#990000">*</font> -<b><font color="#000000">fype_new</font></b><font color="#990000">()</font> <font color="#FF0000">{</font> - <font color="#008080">Fype</font> <font color="#990000">*</font>p_fype <font color="#990000">=</font> <b><font color="#000000">malloc</font></b><font color="#990000">(</font><b><font color="#0000FF">sizeof</font></b><font color="#990000">(</font>Fype<font color="#990000">));</font> +<pre>Fype* +fype_new() { + Fype *p_fype = malloc(<b><u><font color="#000000">sizeof</font></u></b>(Fype)); - p_fype<font color="#990000">-></font>p_hash_syms <font color="#990000">=</font> <b><font color="#000000">hash_new</font></b><font color="#990000">(</font><font color="#993399">512</font><font color="#990000">);</font> - p_fype<font color="#990000">-></font>p_list_token <font color="#990000">=</font> <b><font color="#000000">list_new</font></b><font color="#990000">();</font> - p_fype<font color="#990000">-></font>p_tupel_argv <font color="#990000">=</font> <b><font color="#000000">tupel_new</font></b><font color="#990000">();</font> - p_fype<font color="#990000">-></font>c_basename <font color="#990000">=</font> NULL<font color="#990000">;</font> + p_fype->p_hash_syms = hash_new(<font color="#000000">512</font>); + p_fype->p_list_token = list_new(); + p_fype->p_tupel_argv = tupel_new(); + p_fype->c_basename = NULL; - <b><font color="#000000">garbage_init</font></b><font color="#990000">();</font> + garbage_init(); - <b><font color="#0000FF">return</font></b> <font color="#990000">(</font>p_fype<font color="#990000">);</font> -<font color="#FF0000">}</font> + <b><u><font color="#000000">return</font></u></b> (p_fype); +} -<font color="#009900">void</font> -<b><font color="#000000">fype_delete</font></b><font color="#990000">(</font><font color="#008080">Fype</font> <font color="#990000">*</font>p_fype<font color="#990000">)</font> <font color="#FF0000">{</font> - <b><font color="#000000">argv_tupel_delete</font></b><font color="#990000">(</font>p_fype<font color="#990000">-></font>p_tupel_argv<font color="#990000">);</font> +<b><font color="#000000">void</font></b> +fype_delete(Fype *p_fype) { + argv_tupel_delete(p_fype->p_tupel_argv); - <b><font color="#000000">hash_iterate</font></b><font color="#990000">(</font>p_fype<font color="#990000">-></font>p_hash_syms<font color="#990000">,</font> symbol_cleanup_hash_syms_cb<font color="#990000">);</font> - <b><font color="#000000">hash_delete</font></b><font color="#990000">(</font>p_fype<font color="#990000">-></font>p_hash_syms<font color="#990000">);</font> + hash_iterate(p_fype->p_hash_syms, symbol_cleanup_hash_syms_cb); + hash_delete(p_fype->p_hash_syms); - <b><font color="#000000">list_iterate</font></b><font color="#990000">(</font>p_fype<font color="#990000">-></font>p_list_token<font color="#990000">,</font> token_ref_down_cb<font color="#990000">);</font> - <b><font color="#000000">list_delete</font></b><font color="#990000">(</font>p_fype<font color="#990000">-></font>p_list_token<font color="#990000">);</font> + list_iterate(p_fype->p_list_token, token_ref_down_cb); + list_delete(p_fype->p_list_token); - <b><font color="#0000FF">if</font></b> <font color="#990000">(</font>p_fype<font color="#990000">-></font>c_basename<font color="#990000">)</font> - <b><font color="#000000">free</font></b><font color="#990000">(</font>p_fype<font color="#990000">-></font>c_basename<font color="#990000">);</font> + <b><u><font color="#000000">if</font></u></b> (p_fype->c_basename) + free(p_fype->c_basename); - <b><font color="#000000">garbage_destroy</font></b><font color="#990000">();</font> -<font color="#FF0000">}</font> + garbage_destroy(); +} -<font color="#009900">int</font> -<b><font color="#000000">fype_run</font></b><font color="#990000">(</font><font color="#009900">int</font> i_argc<font color="#990000">,</font> <font color="#009900">char</font> <font color="#990000">**</font>pc_argv<font color="#990000">)</font> <font color="#FF0000">{</font> - <font color="#008080">Fype</font> <font color="#990000">*</font>p_fype <font color="#990000">=</font> <b><font color="#000000">fype_new</font></b><font color="#990000">();</font> +<b><font color="#000000">int</font></b> +fype_run(<b><font color="#000000">int</font></b> i_argc, <b><font color="#000000">char</font></b> **pc_argv) { + Fype *p_fype = fype_new(); - <i><font color="#9A1900">// argv: Maintains command line options</font></i> - <b><font color="#000000">argv_run</font></b><font color="#990000">(</font>p_fype<font color="#990000">,</font> i_argc<font color="#990000">,</font> pc_argv<font color="#990000">);</font> + <i><font color="silver">// argv: Maintains command line options</font></i> + argv_run(p_fype, i_argc, pc_argv); - <i><font color="#9A1900">// scanner: Creates a list of token</font></i> - <b><font color="#000000">scanner_run</font></b><font color="#990000">(</font>p_fype<font color="#990000">);</font> + <i><font color="silver">// scanner: Creates a list of token</font></i> + scanner_run(p_fype); - <i><font color="#9A1900">// interpret: Interpret the list of token</font></i> - <b><font color="#000000">interpret_run</font></b><font color="#990000">(</font>p_fype<font color="#990000">);</font> + <i><font color="silver">// interpret: Interpret the list of token</font></i> + interpret_run(p_fype); - <b><font color="#000000">fype_delete</font></b><font color="#990000">(</font>p_fype<font color="#990000">);</font> + fype_delete(p_fype); - <b><font color="#0000FF">return</font></b> <font color="#990000">(</font><font color="#993399">0</font><font color="#990000">);</font> -<font color="#FF0000">}</font> + <b><u><font color="#000000">return</font></u></b> (<font color="#000000">0</font>); +} </pre> <br /> -<h2 style='display: inline'>Data types</h2><br /> +<h2 style='display: inline' id='data-types'>Data types</h2><br /> <br /> <span>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:</span><br /> <ul> @@ -114,13 +146,13 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>Syntax</h2><br /> +<h2 style='display: inline' id='syntax'>Syntax</h2><br /> <br /> -<h3 style='display: inline'>Comments</h3><br /> +<h3 style='display: inline' id='comments'>Comments</h3><br /> <br /> <span>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.</span><br /> <br /> -<h3 style='display: inline'>Variables</h3><br /> +<h3 style='display: inline' id='variables'>Variables</h3><br /> <br /> <span>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:</span><br /> <br /> @@ -151,7 +183,7 @@ if defined foo { } </pre> <br /> -<h3 style='display: inline'>Synonyms</h3><br /> +<h3 style='display: inline' id='synonyms'>Synonyms</h3><br /> <br /> <span>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:</span><br /> <br /> @@ -193,7 +225,7 @@ undef baz; say syms foo; # Prints 1 </pre> <br /> -<h2 style='display: inline'>Statements and expressions</h2><br /> +<h2 style='display: inline' id='statements-and-expressions'>Statements and expressions</h2><br /> <br /> <span>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:</span><br /> <br /> @@ -203,11 +235,11 @@ say foo; exit foo - bar; </pre> <br /> -<h3 style='display: inline'>Parenthesis</h3><br /> +<h3 style='display: inline' id='parenthesis'>Parenthesis</h3><br /> <br /> <span>All parenthesis for function arguments is optional. They help to make the code better readable. They also help to force the precedence of expressions.</span><br /> <br /> -<h3 style='display: inline'>Basic expressions</h3><br /> +<h3 style='display: inline' id='basic-expressions'>Basic expressions</h3><br /> <br /> <span>Any "any" value holding a string will be automatically converted to an integer value.</span><br /> <br /> @@ -225,7 +257,7 @@ exit foo - bar; (integer) not <any> </pre> <br /> -<h3 style='display: inline'>Bitwise expressions</h3><br /> +<h3 style='display: inline' id='bitwise-expressions'>Bitwise expressions</h3><br /> <br /> <pre> (integer) <any> :< <any> @@ -235,7 +267,7 @@ exit foo - bar; (integer) <any> xor <any> </pre> <br /> -<h3 style='display: inline'>Numeric expressions</h3><br /> +<h3 style='display: inline' id='numeric-expressions'>Numeric expressions</h3><br /> <br /> <pre> (number) neg <number> @@ -260,7 +292,7 @@ exit foo - bar; if yes { say no defined foo; } </pre> <br /> -<h2 style='display: inline'>Control statements</h2><br /> +<h2 style='display: inline' id='control-statements'>Control statements</h2><br /> <br /> <span>Control statements available in Fype:</span><br /> <br /> @@ -288,7 +320,7 @@ until <expression> { <statements> } <br /> <span>... runs the statements as long as the expression evaluates to a false value.</span><br /> <br /> -<h2 style='display: inline'>Scopes</h2><br /> +<h2 style='display: inline' id='scopes'>Scopes</h2><br /> <br /> <span>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:</span><br /> <br /> @@ -339,7 +371,7 @@ SYM_VARIABLE: var4 (id=00035, line=-0001, pos=-001, type=TT_INTEGER, dval=0.0000 SYM_FUNCTION: bar </pre> <br /> -<h2 style='display: inline'>Definedness </h2><br /> +<h2 style='display: inline' id='definedness-'>Definedness </h2><br /> <br /> <pre> (integer) defined <identifier> @@ -353,7 +385,7 @@ SYM_FUNCTION: bar <br /> <span>... tries to undefine/delete the "identifier". Returns 1 if it succeeded, otherwise 0 is returned.</span><br /> <br /> -<h2 style='display: inline'>System </h2><br /> +<h2 style='display: inline' id='system-'>System </h2><br /> <br /> <span>These are some system and interpreter specific built-in functions supported:</span><br /> <br /> @@ -395,7 +427,7 @@ if pid { <br /> <span>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!</span><br /> <br /> -<h3 style='display: inline'>I/O </h3><br /> +<h3 style='display: inline' id='io-'>I/O </h3><br /> <br /> <pre> (any) put <any> @@ -415,9 +447,9 @@ if pid { <br /> <span>... just prints a new line.</span><br /> <br /> -<h2 style='display: inline'>Procedures and functions</h2><br /> +<h2 style='display: inline' id='procedures-and-functions'>Procedures and functions</h2><br /> <br /> -<h3 style='display: inline'>Procedures</h3><br /> +<h3 style='display: inline' id='procedures'>Procedures</h3><br /> <br /> <span>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.</span><br /> <br /> @@ -433,7 +465,7 @@ foo; # Run the procedure. Print out "11\n" say c; # Print out "6\n"; </pre> <br /> -<h3 style='display: inline'>Nested procedures</h3><br /> +<h3 style='display: inline' id='nested-procedures'>Nested procedures</h3><br /> <br /> <span>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.</span><br /> <br /> @@ -456,7 +488,7 @@ bar; # Now the procedure bar is defined! foo; # Here the procedure foo will redefine bar again! </pre> <br /> -<h3 style='display: inline'>Functions</h3><br /> +<h3 style='display: inline' id='functions'>Functions</h3><br /> <br /> <span>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). </span><br /> <br /> @@ -472,7 +504,7 @@ foo; # Run the procedure. Print out "11\n" say c; # Will produce an error because c is out of scope! </pre> <br /> -<h3 style='display: inline'>Nested functions</h3><br /> +<h3 style='display: inline' id='nested-functions'>Nested functions</h3><br /> <br /> <span>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!</span><br /> <br /> @@ -489,7 +521,7 @@ foo; bar; # Will produce an error because bar is out of scope! </pre> <br /> -<h2 style='display: inline'>Arrays</h2><br /> +<h2 style='display: inline' id='arrays'>Arrays</h2><br /> <br /> <span>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:</span><br /> <br /> @@ -512,11 +544,11 @@ BA BB </pre> <br /> -<h2 style='display: inline'>Fancy stuff</h2><br /> +<h2 style='display: inline' id='fancy-stuff'>Fancy stuff</h2><br /> <br /> <span>Fancy stuff like OOP or Unicode or threading is not planed. But fancy stuff like function pointers and closures may be considered.:) </span><br /> <br /> -<h2 style='display: inline'>May the source be with you</h2><br /> +<h2 style='display: inline' id='may-the-source-be-with-you'>May the source be with you</h2><br /> <br /> <span>You can find all of this on the GitHub page. There is also an "examples" folders containing some Fype scripts!</span><br /> <br /> @@ -526,9 +558,9 @@ BB <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2011-05-07-perl-daemon-service-framework.html b/gemfeed/2011-05-07-perl-daemon-service-framework.html index 26865c9b..cbf0441c 100644 --- a/gemfeed/2011-05-07-perl-daemon-service-framework.html +++ b/gemfeed/2011-05-07-perl-daemon-service-framework.html @@ -8,10 +8,15 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Perl Daemon (Service Framework)</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2011-05-07-perl-daemon-service-framework.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2011-05-07-perl-daemon-service-framework.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='perl-daemon-service-framework'>Perl Daemon (Service Framework)</h1><br /> <br /> <span class='quote'>Published at 2011-05-07T22:26:02+01:00; Updated at 2021-05-07</span><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 /> <pre> a'! _,,_ a'! _,,_ a'! _,,_ \\_/ \ \\_/ \ \\_/ \.-, @@ -19,9 +24,21 @@ //\ //\\ //\ //\\ //\ //\\jrei </pre> <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 /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline'>Features</h2><br /> +<ul> +<li><a href='#perl-daemon-service-framework'>Perl Daemon (Service Framework)</a></li> +<li>⇢ <a href='#features'>Features</a></li> +<li>⇢ <a href='#quick-guide'>Quick Guide</a></li> +<li>⇢ <a href='#how-to-configure'>How to configure</a></li> +<li>⇢ <a href='#example-'>Example </a></li> +<li>⇢ <a href='#hires-event-loop'>HiRes event loop</a></li> +<li>⇢ <a href='#writing-your-own-modules'>Writing your own modules</a></li> +<li>⇢ ⇢ <a href='#example-module'>Example module</a></li> +<li>⇢ ⇢ <a href='#your-own-module'>Your own module</a></li> +<li>⇢ <a href='#may-the-source-be-with-you'>May the source be with you</a></li> +</ul><br /> +<h2 style='display: inline' id='features'>Features</h2><br /> <br /> <span>PerlDaemon supports:</span><br /> <br /> @@ -35,25 +52,25 @@ <li>Easy to extend</li> <li>Multi-instance support (just use a different directory for each instance).</li> </ul><br /> -<h2 style='display: inline'>Quick Guide</h2><br /> +<h2 style='display: inline' id='quick-guide'>Quick Guide</h2><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="#9A1900"># Starting</font></i> - <font color="#990000">.</font>/bin/perldaemon start <font color="#990000">(</font>or shortcut <font color="#990000">.</font>/control start<font color="#990000">)</font> +<pre><i><font color="silver"># Starting</font></i> + ./bin/perldaemon start (or shortcut ./control start) -<i><font color="#9A1900"># Stopping</font></i> - <font color="#990000">.</font>/bin/perldaemon stop <font color="#990000">(</font>or shortcut <font color="#990000">.</font>/control stop<font color="#990000">)</font> +<i><font color="silver"># Stopping</font></i> + ./bin/perldaemon stop (or shortcut ./control stop) -<i><font color="#9A1900"># Alternatively: Starting in foreground </font></i> -<font color="#990000">.</font>/bin/perldaemon start daemon<font color="#990000">.</font><font color="#009900">daemonize</font><font color="#990000">=</font>no <font color="#990000">(</font>or shortcut <font color="#990000">.</font>/control foreground<font color="#990000">)</font> +<i><font color="silver"># Alternatively: Starting in foreground </font></i> +./bin/perldaemon start daemon.daemonize=no (or shortcut ./control foreground) </pre> <br /> <span>To stop a daemon from running in foreground mode, "Ctrl+C" must be hit. To see more available startup options run "./control" without any argument.</span><br /> <br /> -<h2 style='display: inline'>How to configure</h2><br /> +<h2 style='display: inline' id='how-to-configure'>How to configure</h2><br /> <br /> <span>The daemon instance can be configured in "./conf/perldaemon.conf". If you want to change a property only once, it is also possible to specify it on the command line (which will take precedence over the config file). All available config properties can be displayed via "./control keys":</span><br /> <br /> @@ -61,33 +78,33 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>pb@titania<font color="#990000">:~</font>/svn/utils/perldaemon/trunk$ <font color="#990000">.</font>/control keys -<i><font color="#9A1900"># Path to the logfile</font></i> -daemon<font color="#990000">.</font><font color="#009900">logfile</font><font color="#990000">=.</font>/log/perldaemon<font color="#990000">.</font>log +<pre>pb@titania:~/svn/utils/perldaemon/trunk$ ./control keys +<i><font color="silver"># Path to the logfile</font></i> +daemon.logfile=./log/perldaemon.log -<i><font color="#9A1900"># The amount of seconds until the next event look takes place</font></i> -daemon<font color="#990000">.</font><font color="#009900">loopinterval</font><font color="#990000">=</font><font color="#993399">1</font> +<i><font color="silver"># The amount of seconds until the next event look takes place</font></i> +daemon.loopinterval=<font color="#000000">1</font> -<i><font color="#9A1900"># Path to the modules dir</font></i> -daemon<font color="#990000">.</font>modules<font color="#990000">.</font><font color="#009900">dir</font><font color="#990000">=.</font>/lib/PerlDaemonModules +<i><font color="silver"># Path to the modules dir</font></i> +daemon.modules.dir=./lib/PerlDaemonModules -<i><font color="#9A1900"># Specifies either the daemon should run in daemon or foreground mode</font></i> -daemon<font color="#990000">.</font><font color="#009900">daemonize</font><font color="#990000">=</font>yes +<i><font color="silver"># Specifies either the daemon should run in daemon or foreground mode</font></i> +daemon.daemonize=yes -<i><font color="#9A1900"># Path to the pidfile</font></i> -daemon<font color="#990000">.</font><font color="#009900">pidfile</font><font color="#990000">=.</font>/run/perldaemon<font color="#990000">.</font>pid +<i><font color="silver"># Path to the pidfile</font></i> +daemon.pidfile=./run/perldaemon.pid -<i><font color="#9A1900"># Each module should run every run interval seconds</font></i> -daemon<font color="#990000">.</font>modules<font color="#990000">.</font><font color="#009900">runinterval</font><font color="#990000">=</font><font color="#993399">3</font> +<i><font color="silver"># Each module should run every run interval seconds</font></i> +daemon.modules.runinterval=<font color="#000000">3</font> -<i><font color="#9A1900"># Path to the alive file (is touched every loop interval seconds, usable for monitoring)</font></i> -daemon<font color="#990000">.</font><font color="#009900">alivefile</font><font color="#990000">=.</font>/run/perldaemon<font color="#990000">.</font>alive +<i><font color="silver"># Path to the alive file (is touched every loop interval seconds, usable for monitoring)</font></i> +daemon.alivefile=./run/perldaemon.alive -<i><font color="#9A1900"># Specifies the working directory</font></i> -daemon<font color="#990000">.</font><font color="#009900">wd</font><font color="#990000">=./</font> +<i><font color="silver"># Specifies the working directory</font></i> +daemon.wd=./ </pre> <br /> -<h2 style='display: inline'>Example </h2><br /> +<h2 style='display: inline' id='example-'>Example </h2><br /> <br /> <span>So let's start the daemon with a loop interval of 10 seconds:</span><br /> <br /> @@ -95,17 +112,17 @@ daemon<font color="#990000">.</font><font color="#009900">wd</font><font color=" by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>$ <font color="#990000">.</font>/control keys <font color="#990000">|</font> grep daemon<font color="#990000">.</font>loopinterval -daemon<font color="#990000">.</font><font color="#009900">loopinterval</font><font color="#990000">=</font><font color="#993399">1</font> -$ <font color="#990000">.</font>/control keys daemon<font color="#990000">.</font><font color="#009900">loopinterval</font><font color="#990000">=</font><font color="#993399">10</font> <font color="#990000">|</font> grep daemon<font color="#990000">.</font>loopinterval -daemon<font color="#990000">.</font><font color="#009900">loopinterval</font><font color="#990000">=</font><font color="#993399">10</font> -$ <font color="#990000">.</font>/control start daemon<font color="#990000">.</font><font color="#009900">loopinterval</font><font color="#990000">=</font><font color="#993399">10</font><font color="#990000">;</font> sleep <font color="#993399">10</font><font color="#990000">;</font> tail -n <font color="#993399">2</font> log/perldaemon<font color="#990000">.</font>log -Starting daemon now<font color="#990000">...</font> -Mon Jun <font color="#993399">13</font> <font color="#993399">11</font><font color="#990000">:</font><font color="#993399">29</font><font color="#990000">:</font><font color="#993399">27</font> <font color="#993399">2011</font> <font color="#990000">(</font>PID <font color="#993399">2838</font><font color="#990000">):</font> Triggering PerlDaemonModules<font color="#990000">::</font>ExampleModule -<font color="#990000">(</font>last triggered before <font color="#993399">10</font><font color="#990000">.</font>002106s<font color="#990000">;</font> carry<font color="#990000">:</font> <font color="#993399">7</font><font color="#990000">.</font>002106s<font color="#990000">;</font> wanted interval<font color="#990000">:</font> 3s<font color="#990000">)</font> -Mon Jun <font color="#993399">13</font> <font color="#993399">11</font><font color="#990000">:</font><font color="#993399">29</font><font color="#990000">:</font><font color="#993399">27</font> <font color="#993399">2011</font> <font color="#990000">(</font>PID <font color="#993399">2838</font><font color="#990000">):</font> ExampleModule Test <font color="#993399">2</font> -$ <font color="#990000">.</font>/control stop -Stopping daemon now<font color="#990000">...</font> +<pre>$ ./control keys | grep daemon.loopinterval +daemon.loopinterval=<font color="#000000">1</font> +$ ./control keys daemon.loopinterval=<font color="#000000">10</font> | grep daemon.loopinterval +daemon.loopinterval=<font color="#000000">10</font> +$ ./control start daemon.loopinterval=<font color="#000000">10</font>; sleep <font color="#000000">10</font>; tail -n <font color="#000000">2</font> log/perldaemon.log +Starting daemon now... +Mon Jun <font color="#000000">13</font> <font color="#000000">11</font>:<font color="#000000">29</font>:<font color="#000000">27</font> <font color="#000000">2011</font> (PID <font color="#000000">2838</font>): Triggering PerlDaemonModules::ExampleModule +(last triggered before <font color="#000000">10</font>.002106s; carry: <font color="#000000">7</font>.002106s; wanted interval: 3s) +Mon Jun <font color="#000000">13</font> <font color="#000000">11</font>:<font color="#000000">29</font>:<font color="#000000">27</font> <font color="#000000">2011</font> (PID <font color="#000000">2838</font>): ExampleModule Test <font color="#000000">2</font> +$ ./control stop +Stopping daemon now... </pre> <br /> <span>If you want to change that property forever, either edit perldaemon.conf or do this:</span><br /> @@ -114,16 +131,16 @@ Stopping daemon now<font color="#990000">...</font> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>$ <font color="#990000">.</font>/control keys daemon<font color="#990000">.</font><font color="#009900">loopinterval</font><font color="#990000">=</font><font color="#993399">10</font> <font color="#990000">></font> new<font color="#990000">.</font>conf<font color="#990000">;</font> mv new<font color="#990000">.</font>conf conf/perldaemon<font color="#990000">.</font>conf +<pre>$ ./control keys daemon.loopinterval=<font color="#000000">10</font> > new.conf; mv new.conf conf/perldaemon.conf </pre> <br /> -<h2 style='display: inline'>HiRes event loop</h2><br /> +<h2 style='display: inline' id='hires-event-loop'>HiRes event loop</h2><br /> <br /> <span>PerlDaemon uses <span class='inlinecode'>Time::HiRes</span> to make sure that all the events run incorrect intervals. For each loop run, a time carry value is recorded and added to the next loop run to catch up on lost time.</span><br /> <br /> -<h2 style='display: inline'>Writing your own modules</h2><br /> +<h2 style='display: inline' id='writing-your-own-modules'>Writing your own modules</h2><br /> <br /> -<h3 style='display: inline'>Example module</h3><br /> +<h3 style='display: inline' id='example-module'>Example module</h3><br /> <br /> <span>This is one of the example modules you will find in the source code. It should be pretty self-explanatory if you know Perl :-).</span><br /> <br /> @@ -131,38 +148,38 @@ 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="#0000FF">package</font></b> PerlDaemonModules<font color="#990000">::</font>ExampleModule<font color="#990000">;</font> +<pre><b><u><font color="#000000">package</font></u></b> PerlDaemonModules::ExampleModule; -<b><font color="#0000FF">use</font></b> strict<font color="#990000">;</font> -<b><font color="#0000FF">use</font></b> warnings<font color="#990000">;</font> +<b><u><font color="#000000">use</font></u></b> strict; +<b><u><font color="#000000">use</font></u></b> warnings; -<b><font color="#0000FF">sub</font></b> <b><font color="#000000">new</font></b> <font color="#990000">(</font>$$$<font color="#990000">)</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">my</font></b> <font color="#990000">(</font><font color="#009900">$class</font><font color="#990000">,</font> <font color="#009900">$conf</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#009900">@_</font><font color="#990000">;</font> +<b><u><font color="#000000">sub</font></u></b> new ($$$) { + <b><u><font color="#000000">my</font></u></b> ($class, $conf) = @_; - <b><font color="#0000FF">my</font></b> <font color="#009900">$self</font> <font color="#990000">=</font> <b><font color="#0000FF">bless</font></b> <font color="#FF0000">{</font> conf <font color="#990000">=></font> <font color="#009900">$conf</font> <font color="#FF0000">}</font><font color="#990000">,</font> <font color="#009900">$class</font><font color="#990000">;</font> + <b><u><font color="#000000">my</font></u></b> $self = <b><u><font color="#000000">bless</font></u></b> { conf => $conf }, $class; - <i><font color="#9A1900"># Store some private module stuff</font></i> - <font color="#009900">$self</font><font color="#990000">-></font><font color="#FF0000">{</font>counter<font color="#FF0000">}</font> <font color="#990000">=</font> <font color="#993399">0</font><font color="#990000">;</font> + <i><font color="silver"># Store some private module stuff</font></i> + $self->{counter} = <font color="#000000">0</font>; - <b><font color="#0000FF">return</font></b> <font color="#009900">$self</font><font color="#990000">;</font> -<font color="#FF0000">}</font> + <b><u><font color="#000000">return</font></u></b> $self; +} -<i><font color="#9A1900"># Runs periodically in a loop (set interval in perldaemon.conf)</font></i> -<b><font color="#0000FF">sub</font></b> <b><font color="#0000FF">do</font></b> <font color="#990000">(</font>$<font color="#990000">)</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">my</font></b> <font color="#009900">$self</font> <font color="#990000">=</font> <b><font color="#0000FF">shift</font></b><font color="#990000">;</font> - <b><font color="#0000FF">my</font></b> <font color="#009900">$conf</font> <font color="#990000">=</font> <font color="#009900">$self</font><font color="#990000">-></font><font color="#FF0000">{</font>conf<font color="#FF0000">}</font><font color="#990000">;</font> - <b><font color="#0000FF">my</font></b> <font color="#009900">$logger</font> <font color="#990000">=</font> <font color="#009900">$conf</font><font color="#990000">-></font><font color="#FF0000">{</font>logger<font color="#FF0000">}</font><font color="#990000">;</font> +<i><font color="silver"># Runs periodically in a loop (set interval in perldaemon.conf)</font></i> +<b><u><font color="#000000">sub</font></u></b> <b><u><font color="#000000">do</font></u></b> ($) { + <b><u><font color="#000000">my</font></u></b> $self = <b><u><font color="#000000">shift</font></u></b>; + <b><u><font color="#000000">my</font></u></b> $conf = $self->{conf}; + <b><u><font color="#000000">my</font></u></b> $logger = $conf->{logger}; - <i><font color="#9A1900"># Calculate some private module stuff</font></i> - <b><font color="#0000FF">my</font></b> <font color="#009900">$count</font> <font color="#990000">=</font> <font color="#990000">++</font><font color="#009900">$self</font><font color="#990000">-></font><font color="#FF0000">{</font>counter<font color="#FF0000">}</font><font color="#990000">;</font> + <i><font color="silver"># Calculate some private module stuff</font></i> + <b><u><font color="#000000">my</font></u></b> $count = ++$self->{counter}; - <font color="#009900">$logger</font><font color="#990000">-></font><b><font color="#000000">logmsg</font></b><font color="#990000">(</font><font color="#FF0000">"ExampleModule Test $count"</font><font color="#990000">);</font> -<font color="#FF0000">}</font> + $logger->logmsg(<font color="#808080">"ExampleModule Test $count"</font>); +} -<font color="#993399">1</font><font color="#990000">;</font> +<font color="#000000">1</font>; </pre> <br /> -<h3 style='display: inline'>Your own module</h3><br /> +<h3 style='display: inline' id='your-own-module'>Your own module</h3><br /> <br /> <span>Want to give it some better use? It's just as easy as:</span><br /> <br /> @@ -170,36 +187,36 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre> cd <font color="#990000">.</font>/lib/PerlDaemonModules<font color="#990000">/</font> - cp ExampleModule<font color="#990000">.</font>pm YourModule<font color="#990000">.</font>pm - vi YourModule<font color="#990000">.</font>pm +<pre> cd ./lib/PerlDaemonModules/ + cp ExampleModule.pm YourModule.pm + vi YourModule.pm cd - - <font color="#990000">.</font>/bin/perldaemon restart <font color="#990000">(</font>or shortcurt <font color="#990000">.</font>/control restart<font color="#990000">)</font> + ./bin/perldaemon restart (or shortcurt ./control restart) </pre> <br /> <span>Now watch <span class='inlinecode'>./log/perldaemon.log</span> closely. It is a good practice to test your modules in 'foreground mode' (see above how to do that).</span><br /> <br /> <span>BTW: You can install as many modules within the same instance as desired. But they are run in sequential order (in future, they can also run in parallel using several threads or processes).</span><br /> <br /> -<h2 style='display: inline'>May the source be with you</h2><br /> +<h2 style='display: inline' id='may-the-source-be-with-you'>May the source be with you</h2><br /> <br /> <span>You can find PerlDaemon (including the examples) at:</span><br /> <br /> <a class='textlink' href='https://codeberg.org/snonux/perldaemon'>https://codeberg.org/snonux/perldaemon</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) (You are currently reading this)</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 /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<a class='textlink' href='./2011-05-07-perl-daemon-service-framework.html'>2011-05-07 Perl Daemon (Service Framework) (You are currently reading this)</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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2014-03-24-the-fibonacci.pl.c-polyglot.html b/gemfeed/2014-03-24-the-fibonacci.pl.c-polyglot.html index 993925f3..ef9fe4e6 100644 --- a/gemfeed/2014-03-24-the-fibonacci.pl.c-polyglot.html +++ b/gemfeed/2014-03-24-the-fibonacci.pl.c-polyglot.html @@ -8,7 +8,10 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>The fibonacci.pl.raku.c Polyglot</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2014-03-24-the-fibonacci.pl.c-polyglot.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2014-03-24-the-fibonacci.pl.c-polyglot.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='the-fibonacciplrakuc-polyglot'>The fibonacci.pl.raku.c Polyglot</h1><br /> <br /> <span class='quote'>Published at 2014-03-24T21:32:53+00:00; Updated at 2022-04-23</span><br /> <br /> @@ -16,7 +19,7 @@ <br /> <a class='textlink' href='https://en.wikipedia.org/wiki/Polyglot_(computing)'>https://en.wikipedia.org/wiki/Polyglot_(computing)</a><br /> <br /> -<h2 style='display: inline'>The Fibonacci numbers</h2><br /> +<h2 style='display: inline' id='the-fibonacci-numbers'>The Fibonacci numbers</h2><br /> <br /> <span>For fun, I programmed my own Polyglot, which is both valid Perl, Raku, C and C++ code (I have added C++ and Raku support in 2022). The exciting part about C and C++ is that $ is a valid character to start variable names with:</span><br /> <br /> @@ -24,135 +27,135 @@ by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#9A1900">#include <stdio.h></font></i> +<pre><i><font color="silver">#include <stdio.h></font></i> -<i><font color="#9A1900">#define $arg function_argument</font></i> -<i><font color="#9A1900">#define my int</font></i> -<i><font color="#9A1900">#define sub int</font></i> -<i><font color="#9A1900">#define BEGIN int main(void)</font></i> +<i><font color="silver">#define $arg function_argument</font></i> +<i><font color="silver">#define my int</font></i> +<i><font color="silver">#define sub int</font></i> +<i><font color="silver">#define BEGIN int main(void)</font></i> -<b><font color="#0000FF">my</font></b> <font color="#009900">$arg</font><font color="#990000">;</font> +<b><u><font color="#000000">my</font></u></b> $arg; -<b><font color="#0000FF">sub</font></b> <b><font color="#000000">hello</font></b><font color="#990000">()</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">printf</font></b><font color="#990000">(</font><font color="#FF0000">"Hello, welcome to the Fibonacci Numbers!\n"</font><font color="#990000">);</font> - <b><font color="#0000FF">printf</font></b><font color="#990000">(</font><font color="#FF0000">"This program is all, valid C and C++ and Perl and Raku code!\n"</font><font color="#990000">);</font> - <b><font color="#0000FF">printf</font></b><font color="#990000">(</font><font color="#FF0000">"It calculates all fibonacci numbers from 0 to 9!\n\n"</font><font color="#990000">);</font> - <b><font color="#0000FF">return</font></b> <font color="#993399">0</font><font color="#990000">;</font> -<font color="#FF0000">}</font> +<b><u><font color="#000000">sub</font></u></b> hello() { + <b><u><font color="#000000">printf</font></u></b>(<font color="#808080">"Hello, welcome to the Fibonacci Numbers!\n"</font>); + <b><u><font color="#000000">printf</font></u></b>(<font color="#808080">"This program is all, valid C and C++ and Perl and Raku code!\n"</font>); + <b><u><font color="#000000">printf</font></u></b>(<font color="#808080">"It calculates all fibonacci numbers from 0 to 9!\n\n"</font>); + <b><u><font color="#000000">return</font></u></b> <font color="#000000">0</font>; +} -<b><font color="#0000FF">sub</font></b> <b><font color="#000000">fibonacci</font></b><font color="#990000">()</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">my</font></b> <font color="#009900">$n</font> <font color="#990000">=</font> <font color="#009900">$arg</font><font color="#990000">;</font> +<b><u><font color="#000000">sub</font></u></b> fibonacci() { + <b><u><font color="#000000">my</font></u></b> $n = $arg; - <b><font color="#0000FF">if</font></b> <font color="#990000">(</font><font color="#009900">$n</font> <font color="#990000"><</font> <font color="#993399">2</font><font color="#990000">)</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">return</font></b> <font color="#009900">$n</font><font color="#990000">;</font> - <font color="#FF0000">}</font> + <b><u><font color="#000000">if</font></u></b> ($n < <font color="#000000">2</font>) { + <b><u><font color="#000000">return</font></u></b> $n; + } - <font color="#009900">$arg</font> <font color="#990000">=</font> <font color="#009900">$n</font> <font color="#990000">-</font> <font color="#993399">1</font><font color="#990000">;</font> - <b><font color="#0000FF">my</font></b> <font color="#009900">$fib1</font> <font color="#990000">=</font> <b><font color="#000000">fibonacci</font></b><font color="#990000">();</font> - <font color="#009900">$arg</font> <font color="#990000">=</font> <font color="#009900">$n</font> <font color="#990000">-</font> <font color="#993399">2</font><font color="#990000">;</font> - <b><font color="#0000FF">my</font></b> <font color="#009900">$fib2</font> <font color="#990000">=</font> <b><font color="#000000">fibonacci</font></b><font color="#990000">();</font> + $arg = $n - <font color="#000000">1</font>; + <b><u><font color="#000000">my</font></u></b> $fib1 = fibonacci(); + $arg = $n - <font color="#000000">2</font>; + <b><u><font color="#000000">my</font></u></b> $fib2 = fibonacci(); - <b><font color="#0000FF">return</font></b> <font color="#009900">$fib1</font> <font color="#990000">+</font> <font color="#009900">$fib2</font><font color="#990000">;</font> -<font color="#FF0000">}</font> + <b><u><font color="#000000">return</font></u></b> $fib1 + $fib2; +} -BEGIN <font color="#FF0000">{</font> - <b><font color="#000000">hello</font></b><font color="#990000">();</font> - <b><font color="#0000FF">my</font></b> <font color="#009900">$i</font> <font color="#990000">=</font> <font color="#993399">0</font><font color="#990000">;</font> +BEGIN { + hello(); + <b><u><font color="#000000">my</font></u></b> $i = <font color="#000000">0</font>; - <b><font color="#0000FF">while</font></b> <font color="#990000">(</font><font color="#009900">$i</font> <font color="#990000"><=</font> <font color="#993399">10</font><font color="#990000">)</font> <font color="#FF0000">{</font> - <font color="#009900">$arg</font> <font color="#990000">=</font> <font color="#009900">$i</font><font color="#990000">;</font> - <b><font color="#0000FF">printf</font></b><font color="#990000">(</font><font color="#FF0000">"fib(%d) = %d\n"</font><font color="#990000">,</font> <font color="#009900">$i</font><font color="#990000">,</font> <b><font color="#000000">fibonacci</font></b><font color="#990000">());</font> - <font color="#009900">$i</font><font color="#990000">++;</font> - <font color="#FF0000">}</font> -<font color="#FF0000">}</font> + <b><u><font color="#000000">while</font></u></b> ($i <= <font color="#000000">10</font>) { + $arg = $i; + <b><u><font color="#000000">printf</font></u></b>(<font color="#808080">"fib(%d) = %d\n"</font>, $i, fibonacci()); + $i++; + } +} </pre> <br /> <span>You can find the full source code at GitHub:</span><br /> <br /> <a class='textlink' href='https://codeberg.org/snonux/perl-c-fibonacci'>https://codeberg.org/snonux/perl-c-fibonacci</a><br /> <br /> -<h3 style='display: inline'>Let's run it with C and C++</h3><br /> +<h3 style='display: inline' id='let-s-run-it-with-c-and-c'>Let's run it with C and C++</h3><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="#990000">%</font> gcc fibonacci<font color="#990000">.</font>pl<font color="#990000">.</font>raku<font color="#990000">.</font>c -o fibonacci -<font color="#990000">%</font> <font color="#990000">.</font>/fibonacci -Hello<font color="#990000">,</font> welcome to the Fibonacci Numbers<font color="#990000">!</font> -This program is all<font color="#990000">,</font> valid C and C<font color="#990000">++</font> and Perl and Raku code<font color="#990000">!</font> -It calculates all fibonacci numbers from <font color="#993399">0</font> to <font color="#993399">9</font><font color="#990000">!</font> +<pre>% gcc fibonacci.pl.raku.c -o fibonacci +% ./fibonacci +Hello, welcome to the Fibonacci Numbers! +This program is all, valid C and C++ and Perl and Raku code! +It calculates all fibonacci numbers from <font color="#000000">0</font> to <font color="#000000">9</font>! -fib<font color="#990000">(</font><font color="#993399">0</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">0</font> -fib<font color="#990000">(</font><font color="#993399">1</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">1</font> -fib<font color="#990000">(</font><font color="#993399">2</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">1</font> -fib<font color="#990000">(</font><font color="#993399">3</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">2</font> -fib<font color="#990000">(</font><font color="#993399">4</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">3</font> -fib<font color="#990000">(</font><font color="#993399">5</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">5</font> -fib<font color="#990000">(</font><font color="#993399">6</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">8</font> -fib<font color="#990000">(</font><font color="#993399">7</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">13</font> -fib<font color="#990000">(</font><font color="#993399">8</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">21</font> -fib<font color="#990000">(</font><font color="#993399">9</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">34</font> -fib<font color="#990000">(</font><font color="#993399">10</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">55</font> +fib(<font color="#000000">0</font>) = <font color="#000000">0</font> +fib(<font color="#000000">1</font>) = <font color="#000000">1</font> +fib(<font color="#000000">2</font>) = <font color="#000000">1</font> +fib(<font color="#000000">3</font>) = <font color="#000000">2</font> +fib(<font color="#000000">4</font>) = <font color="#000000">3</font> +fib(<font color="#000000">5</font>) = <font color="#000000">5</font> +fib(<font color="#000000">6</font>) = <font color="#000000">8</font> +fib(<font color="#000000">7</font>) = <font color="#000000">13</font> +fib(<font color="#000000">8</font>) = <font color="#000000">21</font> +fib(<font color="#000000">9</font>) = <font color="#000000">34</font> +fib(<font color="#000000">10</font>) = <font color="#000000">55</font> -<font color="#990000">%</font> g<font color="#990000">++</font> fibonacci<font color="#990000">.</font>pl<font color="#990000">.</font>raku<font color="#990000">.</font>c -o fibonacci -<font color="#990000">%</font> <font color="#990000">.</font>/fibonacci -Hello<font color="#990000">,</font> welcome to the Fibonacci Numbers<font color="#990000">!</font> -This program is all<font color="#990000">,</font> valid C and C<font color="#990000">++</font> and Perl and Raku code<font color="#990000">!</font> -It calculates all fibonacci numbers from <font color="#993399">0</font> to <font color="#993399">9</font><font color="#990000">!</font> +% g++ fibonacci.pl.raku.c -o fibonacci +% ./fibonacci +Hello, welcome to the Fibonacci Numbers! +This program is all, valid C and C++ and Perl and Raku code! +It calculates all fibonacci numbers from <font color="#000000">0</font> to <font color="#000000">9</font>! -fib<font color="#990000">(</font><font color="#993399">0</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">0</font> -fib<font color="#990000">(</font><font color="#993399">1</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">1</font> -fib<font color="#990000">(</font><font color="#993399">2</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">1</font> -fib<font color="#990000">(</font><font color="#993399">3</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">2</font> -fib<font color="#990000">(</font><font color="#993399">4</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">3</font> -fib<font color="#990000">(</font><font color="#993399">5</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">5</font> -fib<font color="#990000">(</font><font color="#993399">6</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">8</font> -fib<font color="#990000">(</font><font color="#993399">7</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">13</font> -fib<font color="#990000">(</font><font color="#993399">8</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">21</font> -fib<font color="#990000">(</font><font color="#993399">9</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">34</font> -fib<font color="#990000">(</font><font color="#993399">10</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">55</font> +fib(<font color="#000000">0</font>) = <font color="#000000">0</font> +fib(<font color="#000000">1</font>) = <font color="#000000">1</font> +fib(<font color="#000000">2</font>) = <font color="#000000">1</font> +fib(<font color="#000000">3</font>) = <font color="#000000">2</font> +fib(<font color="#000000">4</font>) = <font color="#000000">3</font> +fib(<font color="#000000">5</font>) = <font color="#000000">5</font> +fib(<font color="#000000">6</font>) = <font color="#000000">8</font> +fib(<font color="#000000">7</font>) = <font color="#000000">13</font> +fib(<font color="#000000">8</font>) = <font color="#000000">21</font> +fib(<font color="#000000">9</font>) = <font color="#000000">34</font> +fib(<font color="#000000">10</font>) = <font color="#000000">55</font> </pre> <br /> -<h3 style='display: inline'>Let's run it with Perl and Raku</h3><br /> +<h3 style='display: inline' id='let-s-run-it-with-perl-and-raku'>Let's run it with Perl and Raku</h3><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="#990000">%</font> perl fibonacci<font color="#990000">.</font>pl<font color="#990000">.</font>raku<font color="#990000">.</font>c -Hello<font color="#990000">,</font> welcome to the Fibonacci Numbers<font color="#990000">!</font> -This program is all<font color="#990000">,</font> valid C and C<font color="#990000">++</font> and Perl and Raku code<font color="#990000">!</font> -It calculates all fibonacci numbers from <font color="#993399">0</font> to <font color="#993399">9</font><font color="#990000">!</font> +<pre>% perl fibonacci.pl.raku.c +Hello, welcome to the Fibonacci Numbers! +This program is all, valid C and C++ and Perl and Raku code! +It calculates all fibonacci numbers from <font color="#000000">0</font> to <font color="#000000">9</font>! -fib<font color="#990000">(</font><font color="#993399">0</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">0</font> -fib<font color="#990000">(</font><font color="#993399">1</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">1</font> -fib<font color="#990000">(</font><font color="#993399">2</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">1</font> -fib<font color="#990000">(</font><font color="#993399">3</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">2</font> -fib<font color="#990000">(</font><font color="#993399">4</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">3</font> -fib<font color="#990000">(</font><font color="#993399">5</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">5</font> -fib<font color="#990000">(</font><font color="#993399">6</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">8</font> -fib<font color="#990000">(</font><font color="#993399">7</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">13</font> -fib<font color="#990000">(</font><font color="#993399">8</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">21</font> -fib<font color="#990000">(</font><font color="#993399">9</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">34</font> -fib<font color="#990000">(</font><font color="#993399">10</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">55</font> +fib(<font color="#000000">0</font>) = <font color="#000000">0</font> +fib(<font color="#000000">1</font>) = <font color="#000000">1</font> +fib(<font color="#000000">2</font>) = <font color="#000000">1</font> +fib(<font color="#000000">3</font>) = <font color="#000000">2</font> +fib(<font color="#000000">4</font>) = <font color="#000000">3</font> +fib(<font color="#000000">5</font>) = <font color="#000000">5</font> +fib(<font color="#000000">6</font>) = <font color="#000000">8</font> +fib(<font color="#000000">7</font>) = <font color="#000000">13</font> +fib(<font color="#000000">8</font>) = <font color="#000000">21</font> +fib(<font color="#000000">9</font>) = <font color="#000000">34</font> +fib(<font color="#000000">10</font>) = <font color="#000000">55</font> -<font color="#990000">%</font> raku fibonacci<font color="#990000">.</font>pl<font color="#990000">.</font>raku<font color="#990000">.</font>c -Hello<font color="#990000">,</font> welcome to the Fibonacci Numbers<font color="#990000">!</font> -This program is all<font color="#990000">,</font> valid C and C<font color="#990000">++</font> and Perl and Raku code<font color="#990000">!</font> -It calculates all fibonacci numbers from <font color="#993399">0</font> to <font color="#993399">9</font><font color="#990000">!</font> +% raku fibonacci.pl.raku.c +Hello, welcome to the Fibonacci Numbers! +This program is all, valid C and C++ and Perl and Raku code! +It calculates all fibonacci numbers from <font color="#000000">0</font> to <font color="#000000">9</font>! -fib<font color="#990000">(</font><font color="#993399">0</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">0</font> -fib<font color="#990000">(</font><font color="#993399">1</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">1</font> -fib<font color="#990000">(</font><font color="#993399">2</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">1</font> -fib<font color="#990000">(</font><font color="#993399">3</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">2</font> -fib<font color="#990000">(</font><font color="#993399">4</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">3</font> -fib<font color="#990000">(</font><font color="#993399">5</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">5</font> -fib<font color="#990000">(</font><font color="#993399">6</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">8</font> -fib<font color="#990000">(</font><font color="#993399">7</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">13</font> -fib<font color="#990000">(</font><font color="#993399">8</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">21</font> -fib<font color="#990000">(</font><font color="#993399">9</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">34</font> -fib<font color="#990000">(</font><font color="#993399">10</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#993399">55</font> +fib(<font color="#000000">0</font>) = <font color="#000000">0</font> +fib(<font color="#000000">1</font>) = <font color="#000000">1</font> +fib(<font color="#000000">2</font>) = <font color="#000000">1</font> +fib(<font color="#000000">3</font>) = <font color="#000000">2</font> +fib(<font color="#000000">4</font>) = <font color="#000000">3</font> +fib(<font color="#000000">5</font>) = <font color="#000000">5</font> +fib(<font color="#000000">6</font>) = <font color="#000000">8</font> +fib(<font color="#000000">7</font>) = <font color="#000000">13</font> +fib(<font color="#000000">8</font>) = <font color="#000000">21</font> +fib(<font color="#000000">9</font>) = <font color="#000000">34</font> +fib(<font color="#000000">10</font>) = <font color="#000000">55</font> </pre> <br /> <span>It's entertaining to play with :-).</span><br /> @@ -161,9 +164,9 @@ fib<font color="#990000">(</font><font color="#993399">10</font><font color="#99 <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.html b/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.html index 06f011ea..6b581b72 100644 --- a/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.html +++ b/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.html @@ -8,10 +8,19 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Run Debian on your phone with Debroid</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='run-debian-on-your-phone-with-debroid'>Run Debian on your phone with Debroid</h1><br /> <br /> <span class='quote'>Published at 2015-12-05T16:12:57+00:00; Updated at 2021-05-16</span><br /> <br /> +<span>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).</span><br /> +<br /> +<a href='./run-debian-on-your-phone-with-debroid/Deboroid.png'><img src='./run-debian-on-your-phone-with-debroid/Deboroid.png' /></a><br /> +<br /> +<span>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. </span><br /> +<br /> <pre> ____ _ _ _ | _ \ ___| |__ _ __ ___ (_) __| | @@ -21,21 +30,25 @@ </pre> <br /> -<span>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).</span><br /> -<br /> -<a href='./2015-12-05-run-debian-on-your-phone-with-debroid/Deboroid.png'><img src='./2015-12-05-run-debian-on-your-phone-with-debroid/Deboroid.png' /></a><br /> -<br /> -<h2 style='display: inline'>Foreword</h2><br /> -<br /> -<span>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. </span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline'>Step by step guide</h2><br /> +<ul> +<li><a href='#run-debian-on-your-phone-with-debroid'>Run Debian on your phone with Debroid</a></li> +<li>⇢ <a href='#step-by-step-guide'>Step by step guide</a></li> +<li>⇢ ⇢ <a href='#first-debootstrap-stage'>First debootstrap stage</a></li> +<li>⇢ ⇢ <a href='#copy-debian-image-to-the-phone'>Copy Debian image to the phone</a></li> +<li>⇢ ⇢ <a href='#second-debootstrap-stage'>Second debootstrap stage</a></li> +<li>⇢ ⇢ <a href='#setup-of-various-scripts'>Setup of various scripts</a></li> +<li>⇢ ⇢ <a href='#entering-debroid-and-enable-a-service'>Entering Debroid and enable a service</a></li> +<li>⇢ ⇢ <a href='#include-to-android-startup'>Include to Android startup:</a></li> +</ul><br /> +<h2 style='display: inline' id='step-by-step-guide'>Step by step guide</h2><br /> <br /> <span>All scripts mentioned here can be found on GitHub at:</span><br /> <br /> <a class='textlink' href='https://codeberg.org/snonux/debroid'>https://codeberg.org/snonux/debroid</a><br /> <br /> -<h3 style='display: inline'>First debootstrap stage</h3><br /> +<h3 style='display: inline' id='first-debootstrap-stage'>First debootstrap stage</h3><br /> <br /> <span>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.</span><br /> <br /> @@ -44,26 +57,26 @@ by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> <pre>sudo dnf install debootstrap -<i><font color="#9A1900"># 5g</font></i> -dd <b><font color="#0000FF">if</font></b><font color="#990000">=</font>/dev/zero <font color="#009900">of</font><font color="#990000">=</font>jessie<font color="#990000">.</font>img <font color="#009900">bs</font><font color="#990000">=</font><font color="#009900">$[</font> <font color="#993399">1024</font> <font color="#990000">*</font> <font color="#993399">1024</font> <font color="#990000">]</font> <font color="#990000">\</font> - <font color="#009900">count</font><font color="#990000">=</font><font color="#009900">$[</font> <font color="#993399">1024</font> <font color="#990000">*</font> <font color="#993399">5</font> <font color="#990000">]</font> +<i><font color="silver"># 5g</font></i> +dd <b><u><font color="#000000">if</font></u></b>=/dev/zero of=jessie.img bs=$[ <font color="#000000">1024</font> * <font color="#000000">1024</font> ] \ + count=$[ <font color="#000000">1024</font> * <font color="#000000">5</font> ] -<i><font color="#9A1900"># Show used loop devices</font></i> +<i><font color="silver"># Show used loop devices</font></i> sudo losetup -f -<i><font color="#9A1900"># Store the next free one to $loop</font></i> -<font color="#009900">loop</font><font color="#990000">=</font>loopN -sudo losetup /dev<font color="#990000">/</font><font color="#009900">$loop</font> jessie<font color="#990000">.</font>img +<i><font color="silver"># Store the next free one to $loop</font></i> +loop=loopN +sudo losetup /dev/$loop jessie.img mkdir jessie -sudo mkfs<font color="#990000">.</font>ext4 /dev<font color="#990000">/</font><font color="#009900">$loop</font> -sudo mount /dev<font color="#990000">/</font><font color="#009900">$loop</font> jessie -sudo debootstrap --foreign --variant<font color="#990000">=</font>minbase <font color="#990000">\</font> - --arch armel jessie jessie<font color="#990000">/</font> <font color="#990000">\</font> - http<font color="#990000">:</font>//http<font color="#990000">.</font>debian<font color="#990000">.</font>net/debian +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 </pre> <br /> -<h3 style='display: inline'>Copy Debian image to the phone</h3><br /> +<h3 style='display: inline' id='copy-debian-image-to-the-phone'>Copy Debian image to the phone</h3><br /> <br /> <span>Now setup the Debian image on an external SD card on the Phone via Android Debugger as follows:</span><br /> <br /> @@ -71,45 +84,45 @@ sudo umount jessie by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>adb root <font color="#990000">&&</font> adb wait-for-device <font color="#990000">&&</font> adb shell -mkdir -p /storage/sdcard<font color="#993399">1</font>/Linux/jessie -<b><font color="#0000FF">exit</font></b> +<pre>adb root && adb wait-for-device && adb shell +mkdir -p /storage/sdcard<font color="#000000">1</font>/Linux/jessie +<b><u><font color="#000000">exit</font></u></b> -<i><font color="#9A1900"># Sparse image problem, may be too big for copying otherwise</font></i> -gzip jessie<font color="#990000">.</font>img -<i><font color="#9A1900"># Copy over</font></i> -adb push jessie<font color="#990000">.</font>img<font color="#990000">.</font>gz /storage/sdcard<font color="#993399">1</font>/Linux/jessie<font color="#990000">.</font>img<font color="#990000">.</font>gz +<i><font color="silver"># Sparse image problem, may be too big for copying otherwise</font></i> +gzip jessie.img +<i><font color="silver"># Copy over</font></i> +adb push jessie.img.gz /storage/sdcard<font color="#000000">1</font>/Linux/jessie.img.gz adb shell -cd /storage/sdcard<font color="#993399">1</font>/Linux -gunzip jessie<font color="#990000">.</font>img<font color="#990000">.</font>gz +cd /storage/sdcard<font color="#000000">1</font>/Linux +gunzip jessie.img.gz -<i><font color="#9A1900"># Show used loop devices</font></i> +<i><font color="silver"># Show used loop devices</font></i> losetup -f -<i><font color="#9A1900"># Store the next free one to $loop</font></i> -<font color="#009900">loop</font><font color="#990000">=</font>loopN +<i><font color="silver"># Store the next free one to $loop</font></i> +loop=loopN -<i><font color="#9A1900"># Use the next free one (replace the loop number)</font></i> -losetup /dev/block<font color="#990000">/</font><font color="#009900">$loop</font> <font color="#009900">$(pwd)</font>/jessie<font color="#990000">.</font>img -mount -t ext4 /dev/block<font color="#990000">/</font><font color="#009900">$loop</font> <font color="#009900">$(pwd)</font>/jessie +<i><font color="silver"># Use the next free one (replace the loop number)</font></i> +losetup /dev/block/$loop $(pwd)/jessie.img +mount -t ext4 /dev/block/$loop $(pwd)/jessie -<i><font color="#9A1900"># Bind-Mound proc, dev, sys`</font></i> -busybox mount --bind /proc <font color="#009900">$(pwd)</font>/jessie/proc -busybox mount --bind /dev <font color="#009900">$(pwd)</font>/jessie/dev -busybox mount --bind /dev/pts <font color="#009900">$(pwd)</font>/jessie/dev/pts -busybox mount --bind /sys <font color="#009900">$(pwd)</font>/jessie/sys +<i><font color="silver"># Bind-Mound proc, dev, sys`</font></i> +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 -<i><font color="#9A1900"># Bind-Mound the rest of Android</font></i> -mkdir -p <font color="#009900">$(pwd)</font>/jessie/storage/sdcard{<font color="#993399">0</font><font color="#990000">,</font><font color="#993399">1</font>} -busybox mount --bind /storage/emulated <font color="#990000">\</font> - <font color="#009900">$(pwd)</font>/jessie/storage/sdcard<font color="#993399">0</font> -busybox mount --bind /storage/sdcard<font color="#993399">1</font> <font color="#990000">\</font> - <font color="#009900">$(pwd)</font>/jessie/storage/sdcard<font color="#993399">1</font> +<i><font color="silver"># Bind-Mound the rest of Android</font></i> +mkdir -p $(pwd)/jessie/storage/sdcard{<font color="#000000">0</font>,<font color="#000000">1</font>} +busybox mount --bind /storage/emulated \ + $(pwd)/jessie/storage/sdcard<font color="#000000">0</font> +busybox mount --bind /storage/sdcard<font color="#000000">1</font> \ + $(pwd)/jessie/storage/sdcard<font color="#000000">1</font> -<i><font color="#9A1900"># Check mounts</font></i> -mount <font color="#990000">|</font> grep jessie +<i><font color="silver"># Check mounts</font></i> +mount | grep jessie </pre> <br /> -<h3 style='display: inline'>Second debootstrap stage</h3><br /> +<h3 style='display: inline' id='second-debootstrap-stage'>Second debootstrap stage</h3><br /> <br /> <span>This is to be performed on the Android phone itself (inside a Debian chroot):</span><br /> <br /> @@ -117,14 +130,14 @@ mount <font color="#990000">|</font> grep jessie by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>chroot <font color="#009900">$(pwd)</font>/jessie /bin/bash -l -<b><font color="#0000FF">export</font></b> <font color="#009900">PATH</font><font color="#990000">=</font>/bin<font color="#990000">:</font>/usr/bin<font color="#990000">:</font>/usr/local/bin<font color="#990000">:</font>/sbin<font color="#990000">:</font>/usr/sbin<font color="#990000">:</font>/usr/local/sbin +<pre>chroot $(pwd)/jessie /bin/bash -l +<b><u><font color="#000000">export</font></u></b> PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin /debootstrap/debootstrap --second-stage -<b><font color="#0000FF">exit</font></b> <i><font color="#9A1900"># Leave chroot</font></i> -<b><font color="#0000FF">exit</font></b> <i><font color="#9A1900"># Leave adb shell</font></i> +<b><u><font color="#000000">exit</font></u></b> <i><font color="silver"># Leave chroot</font></i> +<b><u><font color="#000000">exit</font></u></b> <i><font color="silver"># Leave adb shell</font></i> </pre> <br /> -<h3 style='display: inline'>Setup of various scripts</h3><br /> +<h3 style='display: inline' id='setup-of-various-scripts'>Setup of various scripts</h3><br /> <br /> <span>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.</span><br /> <br /> @@ -132,39 +145,39 @@ 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="#9A1900"># Install script jessie.sh</font></i> -adb push storage/sdcard<font color="#993399">1</font>/Linux/jessie<font color="#990000">.</font>sh /storage/sdcard/Linux/jessie<font color="#990000">.</font>sh +<pre><i><font color="silver"># Install script jessie.sh</font></i> +adb push storage/sdcard<font color="#000000">1</font>/Linux/jessie.sh /storage/sdcard/Linux/jessie.sh adb shell -cd /storage/sdcard<font color="#993399">1</font>/Linux -sh jessie<font color="#990000">.</font>sh enter +cd /storage/sdcard<font color="#000000">1</font>/Linux +sh jessie.sh enter -<i><font color="#9A1900"># Bashrc</font></i> -cat <font color="#990000"><<</font>END <font color="#990000">>~/.</font>bashrc -<b><font color="#0000FF">export</font></b> <font color="#009900">PATH</font><font color="#990000">=</font>/usr/local/sbin<font color="#990000">:</font>/usr/local/bin<font color="#990000">:</font>/usr/sbin<font color="#990000">:</font>/usr/bin<font color="#990000">:</font>/sbin<font color="#990000">:</font>/bin<font color="#990000">:</font><font color="#009900">$PATH</font> -<b><font color="#0000FF">export</font></b> <font color="#009900">EDITOR</font><font color="#990000">=</font>vim -hostname <font color="#009900">$(</font>cat /etc/hostname<font color="#990000">)</font> +<i><font color="silver"># Bashrc</font></i> +cat <<END >~/.bashrc +<b><u><font color="#000000">export</font></u></b> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH +<b><u><font color="#000000">export</font></u></b> EDITOR=vim +hostname $(cat /etc/hostname) END -<i><font color="#9A1900"># Fixing an error message while loading the profile</font></i> -sed -i s<i><font color="#9A1900">#id#/usr/bin/id# /etc/profile</font></i> +<i><font color="silver"># Fixing an error message while loading the profile</font></i> +sed -i s<i><font color="silver">#id#/usr/bin/id# /etc/profile</font></i> -<i><font color="#9A1900"># Setting the hostname</font></i> -echo phobos <font color="#990000">></font> /etc/hostname -echo <font color="#993399">127.0</font><font color="#990000">.</font><font color="#993399">0.1</font> phobos <font color="#990000">></font> /etc/hosts +<i><font color="silver"># Setting the hostname</font></i> +echo phobos > /etc/hostname +echo <font color="#000000">127.0</font>.<font color="#000000">0.1</font> phobos > /etc/hosts hostname phobos -<i><font color="#9A1900"># Apt-sources</font></i> -cat <font color="#990000"><<</font>END <font color="#990000">></font> sources<font color="#990000">.</font>list -deb http<font color="#990000">:</font>//ftp<font color="#990000">.</font>uk<font color="#990000">.</font>debian<font color="#990000">.</font>org/debian<font color="#990000">/</font> jessie main contrib non-free -deb-src http<font color="#990000">:</font>//ftp<font color="#990000">.</font>uk<font color="#990000">.</font>debian<font color="#990000">.</font>org/debian<font color="#990000">/</font> jessie main contrib non-free +<i><font color="silver"># Apt-sources</font></i> +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 -<b><font color="#0000FF">exit</font></b> <i><font color="#9A1900"># Exit chroot</font></i> +<b><u><font color="#000000">exit</font></u></b> <i><font color="silver"># Exit chroot</font></i> </pre> <br /> -<h3 style='display: inline'>Entering Debroid and enable a service</h3><br /> +<h3 style='display: inline' id='entering-debroid-and-enable-a-service'>Entering Debroid and enable a service</h3><br /> <br /> <span>This enters Debroid on your phone and starts the example service uptimed:</span><br /> <br /> @@ -172,22 +185,22 @@ apt-get dist-upgrade by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>sh jessie<font color="#990000">.</font>sh enter +<pre>sh jessie.sh enter -<i><font color="#9A1900"># Setup example serice uptimed</font></i> +<i><font color="silver"># Setup example serice uptimed</font></i> apt-get install uptimed -cat <font color="#990000"><<</font>END <font color="#990000">></font> /etc/rc<font color="#990000">.</font>debroid -<b><font color="#0000FF">export</font></b> <font color="#009900">PATH</font><font color="#990000">=</font>/usr/local/sbin<font color="#990000">:</font>/usr/local/bin<font color="#990000">:</font>/usr/sbin<font color="#990000">:</font>/usr/bin<font color="#990000">:</font>/sbin<font color="#990000">:</font>/bin<font color="#990000">:</font><font color="#009900">$PATH</font> -service uptimed status <font color="#990000">&></font>/dev/null <font color="#990000">||</font> service uptimed start -<b><font color="#0000FF">exit</font></b> <font color="#993399">0</font> +cat <<END > /etc/rc.debroid +<b><u><font color="#000000">export</font></u></b> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH +service uptimed status &>/dev/null || service uptimed start +<b><u><font color="#000000">exit</font></u></b> <font color="#000000">0</font> END -chmod <font color="#993399">0755</font> /etc/rc<font color="#990000">.</font>debroid -<b><font color="#0000FF">exit</font></b> <i><font color="#9A1900"># Exit chroot</font></i> -<b><font color="#0000FF">exit</font></b> <i><font color="#9A1900"># Exit adb shell</font></i> +chmod <font color="#000000">0755</font> /etc/rc.debroid +<b><u><font color="#000000">exit</font></u></b> <i><font color="silver"># Exit chroot</font></i> +<b><u><font color="#000000">exit</font></u></b> <i><font color="silver"># Exit adb shell</font></i> </pre> <br /> -<h3 style='display: inline'>Include to Android startup:</h3><br /> +<h3 style='display: inline' id='include-to-android-startup'>Include to Android startup:</h3><br /> <br /> <span>If you want to start Debroid automatically whenever your phone starts, then do the following:</span><br /> <br /> @@ -195,10 +208,10 @@ chmod <font color="#993399">0755</font> /etc/rc<font color="#990000">.</font>deb by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>adb push data/local/userinit<font color="#990000">.</font>sh /data/local/userinit<font color="#990000">.</font>sh +<pre>adb push data/local/userinit.sh /data/local/userinit.sh adb shell -chmod <font color="#990000">+</font>x /data/local/userinit<font color="#990000">.</font>sh -<b><font color="#0000FF">exit</font></b> +chmod +x /data/local/userinit.sh +<b><u><font color="#000000">exit</font></u></b> </pre> <br /> <span>Reboot & test! Enjoy!</span><br /> @@ -207,9 +220,9 @@ chmod <font color="#990000">+</font>x /data/local/userinit<font color="#990000"> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2016-04-03-offsite-backup-with-zfs.html b/gemfeed/2016-04-03-offsite-backup-with-zfs.html index 5c5bac1e..a94637db 100644 --- a/gemfeed/2016-04-03-offsite-backup-with-zfs.html +++ b/gemfeed/2016-04-03-offsite-backup-with-zfs.html @@ -8,7 +8,10 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Offsite backup with ZFS</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2016-04-03-offsite-backup-with-zfs.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2016-04-03-offsite-backup-with-zfs.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='offsite-backup-with-zfs'>Offsite backup with ZFS</h1><br /> <br /> <span class='quote'>Published at 2016-04-03T22:43:42+01:00</span><br /> <br /> @@ -28,25 +31,25 @@ <a class='textlink' href='./2016-04-03-offsite-backup-with-zfs.html'>Offsite backup with ZFS Part 1 (you are reading this atm.)</a><br /> <a class='textlink' href='./2016-04-16-offsite-backup-with-zfs-part2.html'>Offsite backup with ZFS Part 2</a><br /> <br /> -<h2 style='display: inline'>Please don't lose all my pictures again!</h2><br /> +<h2 style='display: inline' id='please-don-t-lose-all-my-pictures-again'>Please don't lose all my pictures again!</h2><br /> <br /> <span>When it comes to data storage and potential data loss, I am a paranoid person. It is due to my job and a personal experience I encountered over ten years ago: A single drive failure and loss of all my data (pictures, music, etc.).</span><br /> <br /> <span>A little about my personal infrastructure: I am running my own (mostly FreeBSD based) root servers (across several countries: Two in Germany, one in Canada, one in Bulgaria) which store all my online data (E-Mail and my Git repositories). I am syncing incremental (and encrypted) ZFS snapshots between these servers forth and back so either data can be recovered from the other server.</span><br /> <br /> -<h2 style='display: inline'>Local storage box for offline data</h2><br /> +<h2 style='display: inline' id='local-storage-box-for-offline-data'>Local storage box for offline data</h2><br /> <br /> <span>Also, I am operating a local server (an HP MicroServer) at home in my apartment. Full snapshots of all ZFS volumes are pulled from the "online" servers to the local server every other week and the incremental ZFS snapshots every day. That local server has a ZFS ZMIRROR with three disks configured (local triple redundancy). I keep up to half a year worth of ZFS snapshots of all volumes. That local server also contains all my offline data such as pictures, private documents, videos, books, various other backups, etc.</span><br /> <br /> <span>Once weekly, all the local server data is copied to two external USB drives as a backup (without the historic snapshots). For simplicity, these USB drives are not formatted with ZFS but with good old UFS. This gives me a chance to recover from a (potential) ZFS disaster. ZFS is a complex thing. Sometimes it is good not to trust complicated things!</span><br /> <br /> -<h2 style='display: inline'>Storing it at my apartment is not enough</h2><br /> +<h2 style='display: inline' id='storing-it-at-my-apartment-is-not-enough'>Storing it at my apartment is not enough</h2><br /> <br /> <span>Now I am thinking about an offsite backup of all this local data. The problem is that all the data remains on a single physical location: My local MicroServer. What happens when the house burns or my server, including the internal disks and the attached USB drives, gets stolen? My first thought was to back up everything to the "cloud". However, the significant issue here is the limited amount of available upload bandwidth (only 1MBit/s).</span><br /> <br /> <span>The solution is adding another USB drive (2TB) with an encryption container (GELI) and a ZFS pool. The GELI encryption requires a secret key and a secret passphrase. I am updating the data to that drive once every three months (my calendar is reminding me about it), and afterwards, I keep that drive at a secret location outside of my apartment. All the information needed to decrypt (mounting the GELI container) is stored at another (secure) place. Key and passphrase are kept at different sites, though. Even if someone knew of it, he would not be able to decrypt it as some additional insider knowledge would be required as well.</span><br /> <br /> -<h2 style='display: inline'>Walking one round less</h2><br /> +<h2 style='display: inline' id='walking-one-round-less'>Walking one round less</h2><br /> <br /> <span>I am thinking of buying a second 2TB USB drive and setting it up the same way as the first one. So I could alternate the backups. One drive would be at the secret location, and the other drive would be at home. And these drives would swap place after each cycle. This would give some security about the failure of that drive, and I would have to go to the secret location only once (swapping the drives) instead of twice (picking that drive up to update the data + bringing it back to the remote location).</span><br /> <br /> @@ -54,9 +57,9 @@ <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html b/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html index 8d983cba..e030a2be 100644 --- a/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html +++ b/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html @@ -8,10 +8,15 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Jails and ZFS with Puppet on FreeBSD</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='jails-and-zfs-with-puppet-on-freebsd'>Jails and ZFS with Puppet on FreeBSD</h1><br /> <br /> <span class='quote'>Published at 2016-04-09T18:29:47+01:00</span><br /> <br /> +<span>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.</span><br /> +<br /> <pre> __ __ (( \---/ )) @@ -32,9 +37,16 @@ \ `. </pre> <br /> -<span>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.</span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline'>ZFS</h2><br /> +<ul> +<li><a href='#jails-and-zfs-with-puppet-on-freebsd'>Jails and ZFS with Puppet on FreeBSD</a></li> +<li>⇢ <a href='#zfs'>ZFS</a></li> +<li>⇢ <a href='#jails'>Jails</a></li> +<li>⇢ <a href='#inside-jail-puppet'>Inside-Jail Puppet</a></li> +<li>⇢ <a href='#managing-multiple-jails'>Managing multiple Jails</a></li> +</ul><br /> +<h2 style='display: inline' id='zfs'>ZFS</h2><br /> <br /> <span>The ZFS module is a pretty basic one. It does not manage ZFS pools yet as I am not creating them often enough which would justify implementing an automation. But let's see how we can create a ZFS file system (on an already given ZFS pool named ztank):</span><br /> <br /> @@ -105,7 +117,7 @@ zsh: done df | zsh: exit 1 grep foo </pre> <br /> -<h2 style='display: inline'>Jails</h2><br /> +<h2 style='display: inline' id='jails'>Jails</h2><br /> <br /> <span>Here is an example in how a FreeBSD Jail can be created. The Jail will have its own public IPv6 address. And it will have its own internal IPv4 address with IPv4 NAT to the internet (this is due to the limitation that the host server only got one public IPv4 address which requires sharing between all the Jails).</span><br /> <br /> @@ -242,7 +254,7 @@ lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384 nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> </pre> <br /> -<h2 style='display: inline'>Inside-Jail Puppet</h2><br /> +<h2 style='display: inline' id='inside-jail-puppet'>Inside-Jail Puppet</h2><br /> <br /> <span>To automatically setup the applications running in the Jail I am using Puppet as well. I wrote a few scripts which bootstrap Puppet inside of a newly created Jail. It is doing the following:</span><br /> <br /> @@ -383,7 +395,7 @@ Notice: /Stage[main]/S_user::Root_files/S_user::My_files[root]/File[/root/.task] Notice: Finished catalog run in 206.09 seconds </pre> <br /> -<h2 style='display: inline'>Managing multiple Jails</h2><br /> +<h2 style='display: inline' id='managing-multiple-jails'>Managing multiple Jails</h2><br /> <br /> <span>Of course I am operating multiple Jails on the same host this way with Puppet:</span><br /> <br /> @@ -399,11 +411,22 @@ Notice: Finished catalog run in 206.09 seconds <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='./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</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 (You are currently reading this)</a><br /> +<br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2016-04-16-offsite-backup-with-zfs-part2.html b/gemfeed/2016-04-16-offsite-backup-with-zfs-part2.html index 04225f5e..b2a2e893 100644 --- a/gemfeed/2016-04-16-offsite-backup-with-zfs-part2.html +++ b/gemfeed/2016-04-16-offsite-backup-with-zfs-part2.html @@ -8,7 +8,10 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Offsite backup with ZFS (Part 2)</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2016-04-16-offsite-backup-with-zfs-part2.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2016-04-16-offsite-backup-with-zfs-part2.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='offsite-backup-with-zfs-part-2'>Offsite backup with ZFS (Part 2)</h1><br /> <br /> <span class='quote'>Published at 2016-04-16T22:43:42+01:00</span><br /> <br /> @@ -40,9 +43,9 @@ <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.html b/gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.html index b26f78f8..e7b07bbd 100644 --- a/gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.html +++ b/gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.html @@ -8,17 +8,29 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Spinning up my own authoritative DNS servers</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='spinning-up-my-own-authoritative-dns-servers'>Spinning up my own authoritative DNS servers</h1><br /> <br /> <span class='quote'>Published at 2016-05-22T18:59:01+01:00</span><br /> <br /> -<h2 style='display: inline'>Background</h2><br /> -<br /> <span>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.</span><br /> <br /> <a class='textlink' href='http://www.schlundtech.de'>Schlund Technologies</a><br /> <br /> -<h2 style='display: inline'>All FreeBSD Jails</h2><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#spinning-up-my-own-authoritative-dns-servers'>Spinning up my own authoritative DNS servers</a></li> +<li>⇢ <a href='#all-freebsd-jails'>All FreeBSD Jails</a></li> +<li>⇢ <a href='#pf-firewall'>PF firewall</a></li> +<li>⇢ <a href='#puppet-managed-bind-zone-files'>Puppet managed BIND zone files</a></li> +<li>⇢ <a href='#the-result'>The result</a></li> +<li>⇢ <a href='#monitoring'>Monitoring</a></li> +<li>⇢ <a href='#dns-update-workflow'>DNS update workflow</a></li> +</ul><br /> +<h2 style='display: inline' id='all-freebsd-jails'>All FreeBSD Jails</h2><br /> <br /> <span>To set up my authoritative DNS servers, I installed a FreeBSD Jail dedicated for DNS with Puppet on my root machine as follows:</span><br /> <br /> @@ -55,7 +67,7 @@ class { 'jail': } </pre> <br /> -<h2 style='display: inline'>PF firewall</h2><br /> +<h2 style='display: inline' id='pf-firewall'>PF firewall</h2><br /> <br /> <span>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:</span><br /> <br /> @@ -72,7 +84,7 @@ pass in on re0 inet6 proto udp from any to 2a01:4f8:120:30e8::15 port {53} flags . </pre> <br /> -<h2 style='display: inline'>Puppet managed BIND zone files</h2><br /> +<h2 style='display: inline' id='puppet-managed-bind-zone-files'>Puppet managed BIND zone files</h2><br /> <br /> <span>In "manifests/dns.pp" (the Puppet manifest for the Master DNS Jail itself), I configured the BIND DNS server this way:</span><br /> <br /> @@ -146,7 +158,7 @@ zone "buetow.zone" { }; </pre> <br /> -<h2 style='display: inline'>The result</h2><br /> +<h2 style='display: inline' id='the-result'>The result</h2><br /> <br /> <span>The result looks like this now:</span><br /> <br /> @@ -206,7 +218,7 @@ dns2.buetow.org. 86400 IN AAAA 2a03:2500:1:6:20:: ;; MSG SIZE rcvd: 322 </pre> <br /> -<h2 style='display: inline'>Monitoring</h2><br /> +<h2 style='display: inline' id='monitoring'>Monitoring</h2><br /> <br /> <span>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:</span><br /> <br /> @@ -233,7 +245,7 @@ apply Service "dig6" { } </pre> <br /> -<h2 style='display: inline'>DNS update workflow</h2><br /> +<h2 style='display: inline' id='dns-update-workflow'>DNS update workflow</h2><br /> <br /> <span>Whenever I have to change a DNS entry, all I have to do is:</span><br /> <br /> @@ -249,9 +261,9 @@ apply Service "dig6" { <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2016-11-20-object-oriented-programming-with-ansi-c.html b/gemfeed/2016-11-20-object-oriented-programming-with-ansi-c.html index ccfbeafe..c468f93f 100644 --- a/gemfeed/2016-11-20-object-oriented-programming-with-ansi-c.html +++ b/gemfeed/2016-11-20-object-oriented-programming-with-ansi-c.html @@ -8,7 +8,10 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Object oriented programming with ANSI C</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2016-11-20-object-oriented-programming-with-ansi-c.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2016-11-20-object-oriented-programming-with-ansi-c.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='object-oriented-programming-with-ansi-c'>Object oriented programming with ANSI C</h1><br /> <br /> <span class='quote'>Published at 2016-11-20T22:10:57+00:00; Updated at 2022-01-29</span><br /> <br /> @@ -23,7 +26,7 @@ <br /> <span>You can do a little of object-oriented programming in the C Programming Language. However, that is, in my humble opinion, limited. It's easier to use a different programming language than C for OOP. But still it's an interesting exercise to try using C for this.</span><br /> <br /> -<h2 style='display: inline'>Function pointers</h2><br /> +<h2 style='display: inline' id='function-pointers'>Function pointers</h2><br /> <br /> <span>Let's have a look at the following sample program. All you have to do is to add a function pointer such as "calculate" to the definition of struct "something_s". Later, during the struct initialization, assign a function address to that function pointer:</span><br /> <br /> @@ -31,37 +34,37 @@ by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#000080">#include</font></b> <font color="#FF0000"><stdio.h></font> +<pre><b><u><font color="#000000">#include</font></u></b> <font color="#808080"><stdio.h></font> -<b><font color="#0000FF">typedef</font></b> <b><font color="#0000FF">struct</font></b> <font color="#FF0000">{</font> - <font color="#009900">double</font> <font color="#990000">(*</font>calculate<font color="#990000">)(</font><b><font color="#0000FF">const</font></b> <font color="#009900">double</font><font color="#990000">,</font> <b><font color="#0000FF">const</font></b> <font color="#009900">double</font><font color="#990000">);</font> - <font color="#009900">char</font> <font color="#990000">*</font>name<font color="#990000">;</font> -<font color="#FF0000">}</font> something_s<font color="#990000">;</font> +<b><u><font color="#000000">typedef</font></u></b> <b><u><font color="#000000">struct</font></u></b> { + <b><font color="#000000">double</font></b> (*calculate)(<b><u><font color="#000000">const</font></u></b> <b><font color="#000000">double</font></b>, <b><u><font color="#000000">const</font></u></b> <b><font color="#000000">double</font></b>); + <b><font color="#000000">char</font></b> *name; +} something_s; -<font color="#009900">double</font> <b><font color="#000000">multiplication</font></b><font color="#990000">(</font><b><font color="#0000FF">const</font></b> <font color="#009900">double</font> a<font color="#990000">,</font> <b><font color="#0000FF">const</font></b> <font color="#009900">double</font> b<font color="#990000">)</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">return</font></b> a <font color="#990000">*</font> b<font color="#990000">;</font> -<font color="#FF0000">}</font> +<b><font color="#000000">double</font></b> multiplication(<b><u><font color="#000000">const</font></u></b> <b><font color="#000000">double</font></b> a, <b><u><font color="#000000">const</font></u></b> <b><font color="#000000">double</font></b> b) { + <b><u><font color="#000000">return</font></u></b> a * b; +} -<font color="#009900">double</font> <b><font color="#000000">division</font></b><font color="#990000">(</font><b><font color="#0000FF">const</font></b> <font color="#009900">double</font> a<font color="#990000">,</font> <b><font color="#0000FF">const</font></b> <font color="#009900">double</font> b<font color="#990000">)</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">return</font></b> a <font color="#990000">/</font> b<font color="#990000">;</font> -<font color="#FF0000">}</font> +<b><font color="#000000">double</font></b> division(<b><u><font color="#000000">const</font></u></b> <b><font color="#000000">double</font></b> a, <b><u><font color="#000000">const</font></u></b> <b><font color="#000000">double</font></b> b) { + <b><u><font color="#000000">return</font></u></b> a / b; +} -<font color="#009900">int</font> <b><font color="#000000">main</font></b><font color="#990000">(</font><font color="#009900">void</font><font color="#990000">)</font> <font color="#FF0000">{</font> - <font color="#008080">something_s</font> mult <font color="#990000">=</font> <font color="#990000">(</font>something_s<font color="#990000">)</font> <font color="#FF0000">{</font> - <font color="#990000">.</font>calculate <font color="#990000">=</font> multiplication<font color="#990000">,</font> - <font color="#990000">.</font>name <font color="#990000">=</font> <font color="#FF0000">"Multiplication"</font> - <font color="#FF0000">}</font><font color="#990000">;</font> +<b><font color="#000000">int</font></b> main(<b><font color="#000000">void</font></b>) { + something_s mult = (something_s) { + .calculate = multiplication, + .name = <font color="#808080">"Multiplication"</font> + }; - <font color="#008080">something_s</font> div <font color="#990000">=</font> <font color="#990000">(</font>something_s<font color="#990000">)</font> <font color="#FF0000">{</font> - <font color="#990000">.</font>calculate <font color="#990000">=</font> division<font color="#990000">,</font> - <font color="#990000">.</font>name <font color="#990000">=</font> <font color="#FF0000">"Division"</font> - <font color="#FF0000">}</font><font color="#990000">;</font> + something_s div = (something_s) { + .calculate = division, + .name = <font color="#808080">"Division"</font> + }; - <b><font color="#0000FF">const</font></b> <font color="#009900">double</font> a <font color="#990000">=</font> <font color="#993399">3</font><font color="#990000">,</font> b <font color="#990000">=</font> <font color="#993399">2</font><font color="#990000">;</font> + <b><u><font color="#000000">const</font></u></b> <b><font color="#000000">double</font></b> a = <font color="#000000">3</font>, b = <font color="#000000">2</font>; - <b><font color="#000000">printf</font></b><font color="#990000">(</font><font color="#FF0000">"%s(%f, %f) => %f</font><font color="#CC33CC">\n</font><font color="#FF0000">"</font><font color="#990000">,</font> mult<font color="#990000">.</font>name<font color="#990000">,</font> a<font color="#990000">,</font> b<font color="#990000">,</font> mult<font color="#990000">.</font><b><font color="#000000">calculate</font></b><font color="#990000">(</font>a<font color="#990000">,</font>b<font color="#990000">));</font> - <b><font color="#000000">printf</font></b><font color="#990000">(</font><font color="#FF0000">"%s(%f, %f) => %f</font><font color="#CC33CC">\n</font><font color="#FF0000">"</font><font color="#990000">,</font> div<font color="#990000">.</font>name<font color="#990000">,</font> a<font color="#990000">,</font> b<font color="#990000">,</font> div<font color="#990000">.</font><b><font color="#000000">calculate</font></b><font color="#990000">(</font>a<font color="#990000">,</font>b<font color="#990000">));</font> -<font color="#FF0000">}</font> + printf(<font color="#808080">"%s(%f, %f) => %f</font>\n<font color="#808080">"</font>, mult.name, a, b, mult.calculate(a,b)); + printf(<font color="#808080">"%s(%f, %f) => %f</font>\n<font color="#808080">"</font>, div.name, a, b, div.calculate(a,b)); +} </pre> <br /> <span>As you can see, you can call the function (pointed by the function pointer) with the same syntax as in C++ or Java:</span><br /> @@ -70,8 +73,8 @@ 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="#000000">printf</font></b><font color="#990000">(</font><font color="#FF0000">"%s(%f, %f) => %f</font><font color="#CC33CC">\n</font><font color="#FF0000">"</font><font color="#990000">,</font> mult<font color="#990000">.</font>name<font color="#990000">,</font> a<font color="#990000">,</font> b<font color="#990000">,</font> mult<font color="#990000">.</font><b><font color="#000000">calculate</font></b><font color="#990000">(</font>a<font color="#990000">,</font>b<font color="#990000">));</font> -<b><font color="#000000">printf</font></b><font color="#990000">(</font><font color="#FF0000">"%s(%f, %f) => %f</font><font color="#CC33CC">\n</font><font color="#FF0000">"</font><font color="#990000">,</font> div<font color="#990000">.</font>name<font color="#990000">,</font> a<font color="#990000">,</font> b<font color="#990000">,</font> div<font color="#990000">.</font><b><font color="#000000">calculate</font></b><font color="#990000">(</font>a<font color="#990000">,</font>b<font color="#990000">));</font> +<pre>printf(<font color="#808080">"%s(%f, %f) => %f</font>\n<font color="#808080">"</font>, mult.name, a, b, mult.calculate(a,b)); +printf(<font color="#808080">"%s(%f, %f) => %f</font>\n<font color="#808080">"</font>, div.name, a, b, div.calculate(a,b)); </pre> <br /> <span>However, that's just syntactic sugar for:</span><br /> @@ -80,8 +83,8 @@ 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="#000000">printf</font></b><font color="#990000">(</font><font color="#FF0000">"%s(%f, %f) => %f</font><font color="#CC33CC">\n</font><font color="#FF0000">"</font><font color="#990000">,</font> mult<font color="#990000">.</font>name<font color="#990000">,</font> a<font color="#990000">,</font> b<font color="#990000">,</font> <font color="#990000">(*</font>mult<font color="#990000">.</font>calculate<font color="#990000">)(</font>a<font color="#990000">,</font>b<font color="#990000">));</font> -<b><font color="#000000">printf</font></b><font color="#990000">(</font><font color="#FF0000">"%s(%f, %f) => %f</font><font color="#CC33CC">\n</font><font color="#FF0000">"</font><font color="#990000">,</font> div<font color="#990000">.</font>name<font color="#990000">,</font> a<font color="#990000">,</font> b<font color="#990000">,</font> <font color="#990000">(*</font>div<font color="#990000">.</font>calculate<font color="#990000">)(</font>a<font color="#990000">,</font>b<font color="#990000">));</font> +<pre>printf(<font color="#808080">"%s(%f, %f) => %f</font>\n<font color="#808080">"</font>, mult.name, a, b, (*mult.calculate)(a,b)); +printf(<font color="#808080">"%s(%f, %f) => %f</font>\n<font color="#808080">"</font>, div.name, a, b, (*div.calculate)(a,b)); </pre> <br /> <span>Output:</span><br /> @@ -90,15 +93,15 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>pbuetow <font color="#990000">~</font>/git/blog/source <font color="#990000">[</font><font color="#993399">38268</font><font color="#990000">]%</font> gcc oop-c-example<font color="#990000">.</font>c -o oop-c-example -pbuetow <font color="#990000">~</font>/git/blog/source <font color="#990000">[</font><font color="#993399">38269</font><font color="#990000">]%</font> <font color="#990000">.</font>/oop-c-example -Multiplication<font color="#990000">(</font><font color="#993399">3.000000</font><font color="#990000">,</font> <font color="#993399">2.000000</font><font color="#990000">)</font> <font color="#990000">=></font> <font color="#993399">6.000000</font> -Division<font color="#990000">(</font><font color="#993399">3.000000</font><font color="#990000">,</font> <font color="#993399">2.000000</font><font color="#990000">)</font> <font color="#990000">=></font> <font color="#993399">1.500000</font> +<pre>pbuetow ~/git/blog/source [<font color="#000000">38268</font>]% gcc oop-c-example.c -o oop-c-example +pbuetow ~/git/blog/source [<font color="#000000">38269</font>]% ./oop-c-example +Multiplication(<font color="#000000">3.000000</font>, <font color="#000000">2.000000</font>) => <font color="#000000">6.000000</font> +Division(<font color="#000000">3.000000</font>, <font color="#000000">2.000000</font>) => <font color="#000000">1.500000</font> </pre> <br /> <span>Not complicated at all, but nice to know and helps to make the code easier to read!</span><br /> <br /> -<h2 style='display: inline'>That's not OOP, though</h2><br /> +<h2 style='display: inline' id='that-s-not-oop-though'>That's not OOP, though</h2><br /> <br /> <span>However, that's not really how it works in object-oriented languages such as Java and C++. The method call in this example is not a method call as "mult" and "div" in this example are not "message receivers". I mean that the functions can not access the state of the "mult" and "div" struct objects. In C, you would need to do something like this instead if you wanted to access the state of "mult" from within the calculate function, you would have to pass it as an argument:</span><br /> <br /> @@ -106,16 +109,16 @@ Division<font color="#990000">(</font><font color="#993399">3.000000</font><font by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>mult<font color="#990000">.</font><b><font color="#000000">calculate</font></b><font color="#990000">(</font>mult<font color="#990000">,</font>a<font color="#990000">,</font>b<font color="#990000">));</font> +<pre>mult.calculate(mult,a,b)); </pre> <br /> -<h2 style='display: inline'>Real object oriented programming with C</h2><br /> +<h2 style='display: inline' id='real-object-oriented-programming-with-c'>Real object oriented programming with C</h2><br /> <br /> <span>If you want to take it further, hit "Object-Oriented Programming with ANSI-C" into your favourite internet search engine or follow the link below. It goes as far as writing a C preprocessor in AWK, which takes some object-oriented pseudo-C and transforms it to plain C so that the C compiler can compile it to machine code. This is similar to how the C++ language had its origins.</span><br /> <br /> <a class='textlink' href='https://www.cs.rit.edu/~ats/books/ooc.pdf'>https://www.cs.rit.edu/~ats/books/ooc.pdf</a><br /> <br /> -<h2 style='display: inline'>OOP design patterns in the Linux Kernel</h2><br /> +<h2 style='display: inline' id='oop-design-patterns-in-the-linux-kernel'>OOP design patterns in the Linux Kernel</h2><br /> <br /> <span>Big C software projects, like Linux, also follow some OOP techniques:</span><br /> <br /> @@ -127,9 +130,9 @@ http://www.gnu.org/software/src-highlite --> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux.html b/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux.html index 45761407..2c7df5c2 100644 --- a/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux.html +++ b/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux.html @@ -8,10 +8,23 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Realistic load testing with I/O Riot for Linux</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='realistic-load-testing-with-io-riot-for-linux'>Realistic load testing with I/O Riot for Linux</h1><br /> <br /> <span class='quote'>Published at 2018-06-01T14:50:29+01:00; Updated at 2021-05-08</span><br /> <br /> +<span>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. </span><br /> +<br /> +<a class='textlink' href='https://www.admin-magazin.de/Das-Heft/2018/06/Realistische-Lasttests-mit-I-O-Riot'>https://www.admin-magazin.de/Das-Heft/2018/06/Realistische-Lasttests-mit-I-O-Riot</a><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>Pleace notice that some of the screenshots show the command "ioreplay" instead of "ioriot". That's because the name has changed after taking those.</span><br /> +<br /> <pre> .---. / \ @@ -23,25 +36,30 @@ jgs\__/'---'\__/ </pre> <br /> -<h2 style='display: inline'>Foreword</h2><br /> -<br /> -<span>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. </span><br /> -<br /> -<a class='textlink' href='https://www.admin-magazin.de/Das-Heft/2018/06/Realistische-Lasttests-mit-I-O-Riot'>https://www.admin-magazin.de/Das-Heft/2018/06/Realistische-Lasttests-mit-I-O-Riot</a><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>Pleace notice that some of the screenshots show the command "ioreplay" instead of "ioriot". That's because the name has changed after taking those.</span><br /> -<br /> -<h1 style='display: inline'>The article</h1><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#realistic-load-testing-with-io-riot-for-linux'>Realistic load testing with I/O Riot for Linux</a></li> +<li><a href='#the-article'>The article</a></li> +<li>⇢ <a href='#background-existing-techniques'>Background: Existing Techniques</a></li> +<li>⇢ <a href='#benchmarking-the-email-cloud-at-mimecast'>Benchmarking the Email Cloud at Mimecast</a></li> +<li>⇢ <a href='#using-io-riot'>Using I/O Riot</a></li> +<li>⇢ ⇢ <a href='#installation'>Installation</a></li> +<li>⇢ ⇢ <a href='#recording-of-io-events'>Recording of I/O events</a></li> +<li>⇢ ⇢ <a href='#test-preparation'>Test preparation</a></li> +<li>⇢ ⇢ <a href='#test-initialization'>Test Initialization</a></li> +<li>⇢ ⇢ <a href='#replay'>Replay</a></li> +<li>⇢ <a href='#io-riot-is-open-source'>I/O Riot is Open Source</a></li> +<li>⇢ <a href='#systemtap'>Systemtap</a></li> +<li>⇢ <a href='#more-refereces'>More refereces</a></li> +</ul><br /> +<h1 style='display: inline' id='the-article'>The article</h1><br /> <br /> <span>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. </span><br /> <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>Background: Existing Techniques</h2><br /> +<h2 style='display: inline' id='background-existing-techniques'>Background: Existing Techniques</h2><br /> <br /> <span>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.</span><br /> <br /> @@ -49,17 +67,17 @@ jgs\__/'---'\__/ <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>Benchmarking the Email Cloud at Mimecast</h2><br /> +<h2 style='display: inline' id='benchmarking-the-email-cloud-at-mimecast'>Benchmarking the Email Cloud at Mimecast</h2><br /> <br /> <span>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.</span><br /> <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>Using I/O Riot</h2><br /> +<h2 style='display: inline' id='using-io-riot'>Using I/O Riot</h2><br /> <br /> <span>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.</span><br /> <br /> -<h3 style='display: inline'>Installation</h3><br /> +<h3 style='display: inline' id='installation'>Installation</h3><br /> <br /> <span>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:</span><br /> <br /> @@ -81,7 +99,7 @@ jgs\__/'---'\__/ <br /> <span>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.</span><br /> <br /> -<h3 style='display: inline'>Recording of I/O events</h3><br /> +<h3 style='display: inline' id='recording-of-io-events'>Recording of I/O events</h3><br /> <br /> <span>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.</span><br /> <br /> @@ -91,11 +109,11 @@ jgs\__/'---'\__/ % sudo ioriot -c io.capture </pre> <br /> -<a href='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure1-ioriot-io-recording.png'><img alt='Screenshot I/O recording' title='Screenshot I/O recording' src='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure1-ioriot-io-recording.png' /></a><br /> +<a href='./realistic-load-testing-with-ioriot-for-linux/figure1-ioriot-io-recording.png'><img alt='Screenshot I/O recording' title='Screenshot I/O recording' src='./realistic-load-testing-with-ioriot-for-linux/figure1-ioriot-io-recording.png' /></a><br /> <br /> <span>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.</span><br /> <br /> -<h3 style='display: inline'>Test preparation</h3><br /> +<h3 style='display: inline' id='test-preparation'>Test preparation</h3><br /> <br /> <span>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:</span><br /> <br /> @@ -105,7 +123,7 @@ jgs\__/'---'\__/ <br /> <span>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.</span><br /> <br /> -<h3 style='display: inline'>Test Initialization</h3><br /> +<h3 style='display: inline' id='test-initialization'>Test Initialization</h3><br /> <br /> <span>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:</span><br /> <br /> @@ -115,17 +133,17 @@ jgs\__/'---'\__/ <br /> <span>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.</span><br /> <br /> -<a href='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure2-ioriot-test-preparation.png'><img alt='Screenshot test preparation' title='Screenshot test preparation' src='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure2-ioriot-test-preparation.png' /></a><br /> +<a href='./realistic-load-testing-with-ioriot-for-linux/figure2-ioriot-test-preparation.png'><img alt='Screenshot test preparation' title='Screenshot test preparation' src='./realistic-load-testing-with-ioriot-for-linux/figure2-ioriot-test-preparation.png' /></a><br /> <br /> <span>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".</span><br /> <br /> -<h3 style='display: inline'>Replay</h3><br /> +<h3 style='display: inline' id='replay'>Replay</h3><br /> <br /> <span>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.</span><br /> <br /> <span>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.</span><br /> <br /> -<a href='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure3-ioriot-replay.png'><img alt='Screenshot replaying I/O' title='Screenshot replaying I/O' src='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure3-ioriot-replay.png' /></a><br /> +<a href='./realistic-load-testing-with-ioriot-for-linux/figure3-ioriot-replay.png'><img alt='Screenshot replaying I/O' title='Screenshot replaying I/O' src='./realistic-load-testing-with-ioriot-for-linux/figure3-ioriot-replay.png' /></a><br /> <br /> <span>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:</span><br /> <br /> @@ -167,21 +185,21 @@ Total time: 1213.00s <br /> <span>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.</span><br /> <br /> -<a href='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure4-ioriot-read-latency.png'><img alt='Graphite visualization of the mean read access times in ms with CFQ and Deadline Scheduler.' title='Graphite visualization of the mean read access times in ms with CFQ and Deadline Scheduler.' src='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure4-ioriot-read-latency.png' /></a><br /> +<a href='./realistic-load-testing-with-ioriot-for-linux/figure4-ioriot-read-latency.png'><img alt='Graphite visualization of the mean read access times in ms with CFQ and Deadline Scheduler.' title='Graphite visualization of the mean read access times in ms with CFQ and Deadline Scheduler.' src='./realistic-load-testing-with-ioriot-for-linux/figure4-ioriot-read-latency.png' /></a><br /> <br /> -<a href='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure5-ioriot-write-latency.png'><img alt='Graphite visualization of the average write access times in ms with CFQ and Deadline Scheduler.' title='Graphite visualization of the average write access times in ms with CFQ and Deadline Scheduler.' src='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure5-ioriot-write-latency.png' /></a><br /> +<a href='./realistic-load-testing-with-ioriot-for-linux/figure5-ioriot-write-latency.png'><img alt='Graphite visualization of the average write access times in ms with CFQ and Deadline Scheduler.' title='Graphite visualization of the average write access times in ms with CFQ and Deadline Scheduler.' src='./realistic-load-testing-with-ioriot-for-linux/figure5-ioriot-write-latency.png' /></a><br /> <br /> <span>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.</span><br /> <br /> -<a href='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure6-iostat.png'><img alt='Output of iostat. The block device sdy seems to be almost fully utilized by 99%.' title='Output of iostat. The block device sdy seems to be almost fully utilized by 99%.' src='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure6-iostat.png' /></a><br /> +<a href='./realistic-load-testing-with-ioriot-for-linux/figure6-iostat.png'><img alt='Output of iostat. The block device sdy seems to be almost fully utilized by 99%.' title='Output of iostat. The block device sdy seems to be almost fully utilized by 99%.' src='./realistic-load-testing-with-ioriot-for-linux/figure6-iostat.png' /></a><br /> <br /> -<h2 style='display: inline'>I/O Riot is Open Source</h2><br /> +<h2 style='display: inline' id='io-riot-is-open-source'>I/O Riot is Open Source</h2><br /> <br /> <span>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:</span><br /> <br /> <a class='textlink' href='https://github.com/mimecast/ioriot'>https://github.com/mimecast/ioriot</a><br /> <br /> -<h2 style='display: inline'>Systemtap</h2><br /> +<h2 style='display: inline' id='systemtap'>Systemtap</h2><br /> <br /> <span>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.</span><br /> <br /> @@ -189,7 +207,7 @@ Total time: 1213.00s <br /> <a class='textlink' href='https://sourceware.org/systemtap/'>https://sourceware.org/systemtap/</a><br /> <br /> -<h2 style='display: inline'>More refereces</h2><br /> +<h2 style='display: inline' id='more-refereces'>More refereces</h2><br /> <br /> <a class='textlink' href='http://www.iozone.org/'>IOZone</a><br /> <a class='textlink' href='https://www.coker.com.au/bonnie++/'>Bonnie++</a><br /> @@ -200,9 +218,9 @@ Total time: 1213.00s <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.html b/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.html index 1641ae47..9e90200c 100644 --- a/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.html +++ b/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.html @@ -8,12 +8,13 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>DTail - The distributed log tail program</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='dtail---the-distributed-log-tail-program'>DTail - The distributed log tail program</h1><br /> <br /> <span class='quote'>Published at 2021-04-22T19:28:41+01:00; Updated at 2021-04-26</span><br /> <br /> -<a href='./2021-04-22-dtail-the-distributed-log-tail-program/title.png'><img alt='DTail logo image' title='DTail logo image' src='./2021-04-22-dtail-the-distributed-log-tail-program/title.png' /></a><br /> -<br /> <span>This article first appeared at the Mimecast Engineering Blog but I made it available here in my personal internet site too.</span><br /> <br /> <a class='textlink' href='https://medium.com/mimecast-engineering/dtail-the-distributed-log-tail-program-79b8087904bb'>Original Mimecast Engineering Blog post at Medium</a><br /> @@ -26,7 +27,23 @@ <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>A Mimecast Pet Project</h2><br /> +<a href='./dtail-the-distributed-log-tail-program/title.png'><img alt='DTail logo image' title='DTail logo image' src='./dtail-the-distributed-log-tail-program/title.png' /></a><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#dtail---the-distributed-log-tail-program'>DTail - The distributed log tail program</a></li> +<li>⇢ <a href='#a-mimecast-pet-project'>A Mimecast Pet Project</a></li> +<li>⇢ <a href='#differentiating-from-log-management-systems'>Differentiating from log management systems</a></li> +<li>⇢ <a href='#combining-simplicity-security-and-efficiency'>Combining simplicity, security and efficiency</a></li> +<li>⇢ <a href='#the-dtail-family-of-commands'>The DTail family of commands</a></li> +<li>⇢ <a href='#usage-example'>Usage example</a></li> +<li>⇢ <a href='#fitting-it-in'>Fitting it in</a></li> +<li>⇢ <a href='#advanced-features'>Advanced features</a></li> +<li>⇢ <a href='#for-the-future'>For the future</a></li> +<li>⇢ <a href='#open-source'>Open Source</a></li> +</ul><br /> +<h2 style='display: inline' id='a-mimecast-pet-project'>A Mimecast Pet Project</h2><br /> <br /> <span>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:</span><br /> <br /> @@ -34,17 +51,17 @@ <br /> <span>Try it out — We would love any feedback. But first, read on…</span><br /> <br /> -<h2 style='display: inline'>Differentiating from log management systems</h2><br /> +<h2 style='display: inline' id='differentiating-from-log-management-systems'>Differentiating from log management systems</h2><br /> <br /> <span>Why not just use a full-blown log management system? There are various Open-Source and commercial log management solutions available on the market you could choose from (e.g. the ELK stack). Most of them store the logs in a centralized location and are fairly complex to set up and operate. Possibly they are also pretty expensive to operate if you have to buy dedicated hardware (or pay fees to your cloud provider) and have to hire support staff for it.</span><br /> <br /> <span>DTail does not aim to replace any of the log management tools already available but is rather an additional tool crafted especially for ad-hoc debugging and troubleshooting purposes. DTail is cheap to operate as it does not require any dedicated hardware for log storage as it operates directly on the source of the logs. It means that there is a DTail server installed on all server boxes producing logs. This decentralized comes with the direct advantages that there is no introduced delay because the logs are not shipped to a central log storage device. The reduced complexity also makes it more robust against outages. You won’t be able to troubleshoot your distributed application very well if the log management infrastructure isn’t working either.</span><br /> <br /> -<a href='./2021-04-22-dtail-the-distributed-log-tail-program/dtail.gif'><img alt='DTail sample session animated gif' title='DTail sample session animated gif' src='./2021-04-22-dtail-the-distributed-log-tail-program/dtail.gif' /></a><br /> +<a href='./dtail-the-distributed-log-tail-program/dtail.gif'><img alt='DTail sample session animated gif' title='DTail sample session animated gif' src='./dtail-the-distributed-log-tail-program/dtail.gif' /></a><br /> <br /> <span>As a downside, you won’t be able to access any logs with DTail when the server is down. Furthermore, a server can store logs only up to a certain capacity as disks will fill up. For the purpose of ad-hoc debugging, these are not typically issues. Usually, it’s the application you want to debug and not the server. And disk space is rarely an issue for bare metal and VM-based systems these days, with sufficient space for several weeks’ worth of log storage being available. DTail also supports reading compressed logs. The currently supported compression algorithms are gzip and zstd.</span><br /> <br /> -<h2 style='display: inline'>Combining simplicity, security and efficiency</h2><br /> +<h2 style='display: inline' id='combining-simplicity-security-and-efficiency'>Combining simplicity, security and efficiency</h2><br /> <br /> <span>DTail also has a client component that connects to multiple servers concurrently for log files (or any other text files).</span><br /> <br /> @@ -54,7 +71,7 @@ <br /> <span>Recent log files are very likely still in the file system caches on the servers. Therefore, there tends to be a minimal I/O overhead involved.</span><br /> <br /> -<h2 style='display: inline'>The DTail family of commands</h2><br /> +<h2 style='display: inline' id='the-dtail-family-of-commands'>The DTail family of commands</h2><br /> <br /> <span>Following the UNIX philosophy, DTail includes multiple command-line commands each of them for a different purpose:</span><br /> <br /> @@ -65,9 +82,9 @@ <li>dgrep: The distributed grep client for searching text files for a regular expression pattern.</li> <li>dmap: The distributed map-reduce client for aggregating stats from log files.</li> </ul><br /> -<a href='./2021-04-22-dtail-the-distributed-log-tail-program/dgrep.gif'><img alt='DGrep sample session animated gif' title='DGrep sample session animated gif' src='./2021-04-22-dtail-the-distributed-log-tail-program/dgrep.gif' /></a><br /> +<a href='./dtail-the-distributed-log-tail-program/dgrep.gif'><img alt='DGrep sample session animated gif' title='DGrep sample session animated gif' src='./dtail-the-distributed-log-tail-program/dgrep.gif' /></a><br /> <br /> -<h2 style='display: inline'>Usage example</h2><br /> +<h2 style='display: inline' id='usage-example'>Usage example</h2><br /> <br /> <span>The use of these commands is almost self-explanatory for a person already used to the standard command line in Unix systems. One of the main goals is to make DTail easy to use. A tool that is too complicated to use under high-pressure scenarios (e.g., during an incident) can be quite detrimental.</span><br /> <br /> @@ -85,11 +102,11 @@ dtail –servers serverlist.txt –files ‘/var/log/*.log’ –regex ‘(?i:er <br /> <span>You could also provide a comma-separated list of servers as opposed to a text file. There are many more options you could use. The ones listed here are just the very basic ones. There are more instructions and usage examples on the GitHub page. Also, you can study even more of the available options via the –help switch (some real treasures might be hidden there).</span><br /> <br /> -<h2 style='display: inline'>Fitting it in</h2><br /> +<h2 style='display: inline' id='fitting-it-in'>Fitting it in</h2><br /> <br /> <span>DTail integrates nicely into the user management of existing infrastructure. It follows normal system permissions and does not open new “holes” on the server which helps to keep security departments happy. The user would not have more or less file read permissions than he would have via a regular SSH login shell. There is a full SSH key, traditional UNIX permissions, and Linux ACL support. There is also a very low resource footprint involved. On average for tailing and searching log files less than 100MB RAM and less than a quarter of a CPU core per participating server are required. Complex map-reduce queries on big data sets will require more resources accordingly.</span><br /> <br /> -<h2 style='display: inline'>Advanced features</h2><br /> +<h2 style='display: inline' id='advanced-features'>Advanced features</h2><br /> <br /> <span>The features listed here are out of the scope of this blog post but are worthwhile to mention:</span><br /> <br /> @@ -100,7 +117,7 @@ dtail –servers serverlist.txt –files ‘/var/log/*.log’ –regex ‘(?i:er <li>Server-side stats streaming with continuous map-reduce queries. This for example can be used to periodically generate stats from the logs at a configured interval, e.g., log error counts by the minute. These then can be sent to a time-series database (e.g., Graphite) and then plotted in a Grafana dashboard.</li> <li>Support for custom extensions. E.g., for different server discovery methods (so you don’t have to rely on plain server lists) and log file formats (so that map-reduce queries can parse more stats from the logs).</li> </ul><br /> -<h2 style='display: inline'>For the future</h2><br /> +<h2 style='display: inline' id='for-the-future'>For the future</h2><br /> <br /> <span>There are various features we want to see in the future.</span><br /> <br /> @@ -110,26 +127,26 @@ dtail –servers serverlist.txt –files ‘/var/log/*.log’ –regex ‘(?i:er <li>A more complex change would be the support of federated queries. You can connect to thousands of servers from a single client running on a laptop. But does it scale to 100k of servers? Some of the servers could be used as middleware for connecting to even more servers.</li> <li>Another aspect is to extend the documentation. Especially the advanced features such as map-reduce query language and how to configure the server-side queries currently do require more documentation. For now, you can read the code, sample config files or just ask the author for that! But this will be certainly addressed in the future.</li> </ul><br /> -<h2 style='display: inline'>Open Source</h2><br /> +<h2 style='display: inline' id='open-source'>Open Source</h2><br /> <br /> <span>Mimecast highly encourages you to have a look at DTail and submit an issue for any features you would like to see. Have you found a bug? Maybe you just have a question or comment? If you want to go a step further: We would also love to see pull requests for any features or improvements. Either way, if in doubt just contact us via the DTail GitHub page.</span><br /> <br /> <a class='textlink' href='https://dtail.dev'>https://dtail.dev</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='./2021-04-22-dtail-the-distributed-log-tail-program.html'>2021-04-22 DTail - The distributed log tail program (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='./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>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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 (You are currently reading this)</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2021-04-24-welcome-to-the-geminispace.html b/gemfeed/2021-04-24-welcome-to-the-geminispace.html index 6af17e54..2c2c592f 100644 --- a/gemfeed/2021-04-24-welcome-to-the-geminispace.html +++ b/gemfeed/2021-04-24-welcome-to-the-geminispace.html @@ -8,18 +8,13 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Welcome to the Geminispace</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2021-04-24-welcome-to-the-geminispace.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2021-04-24-welcome-to-the-geminispace.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='welcome-to-the-geminispace'>Welcome to the Geminispace</h1><br /> <br /> <span class='quote'>Published at 2021-04-24T19:28:41+01:00; Updated at 2021-06-18</span><br /> <br /> -<span>ASCII Art by Andy Hood!</span><br /> -<br /> -<span>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:</span><br /> -<br /> -<a class='textlink' href='gemini://foo.zone'>gemini://foo.zone</a><br /> -<br /> -<span>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 :-).</span><br /> -<br /> <pre> /\ / \ @@ -39,30 +34,51 @@ </pre> <br /> -<h2 style='display: inline'>Motivation</h2><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#welcome-to-the-geminispace'>Welcome to the Geminispace</a></li> +<li>⇢ <a href='#introduction'>Introduction</a></li> +<li>⇢ <a href='#motivation'>Motivation</a></li> +<li>⇢ ⇢ <a href='#my-urge-to-revamp-my-personal-website'>My urge to revamp my personal website</a></li> +<li>⇢ ⇢ <a href='#my-still-great-laptop-running-hot'>My still great Laptop running hot</a></li> +<li>⇢ <a href='#discovering-the-gemini-internet-protocol'>Discovering the Gemini internet protocol</a></li> +<li>⇢ <a href='#my-own-gemini-capsule'>My own Gemini capsule</a></li> +<li>⇢ <a href='#gemini-advantages-summarised'>Gemini advantages summarised</a></li> +<li>⇢ <a href='#dive-into-deep-gemini-space'>Dive into deep Gemini space</a></li> +</ul><br /> +<h2 style='display: inline' id='introduction'>Introduction</h2><br /> +<br /> +<span>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:</span><br /> +<br /> +<a class='textlink' href='gemini://foo.zone'>gemini://foo.zone</a><br /> +<br /> +<span>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 :-).</span><br /> +<br /> +<h2 style='display: inline' id='motivation'>Motivation</h2><br /> <br /> -<h3 style='display: inline'>My urge to revamp my personal website</h3><br /> +<h3 style='display: inline' id='my-urge-to-revamp-my-personal-website'>My urge to revamp my personal website</h3><br /> <br /> <span>For some time, I had to urge to revamp my personal website. Not to update the technology and its design but to update all the content (+ keep it current) and start a small tech blog again. So unconsciously, I began to search for an excellent platform to do all of that in a KISS (keep it simple & stupid) way.</span><br /> <br /> -<h3 style='display: inline'>My still great Laptop running hot</h3><br /> +<h3 style='display: inline' id='my-still-great-laptop-running-hot'>My still great Laptop running hot</h3><br /> <br /> <span>Earlier this year (2021), I noticed that my almost seven-year-old but still great Laptop started to become hot and slowed down while surfing the web. Also, the Laptop's fan became quite noisy. This was all due to the additional bloat such as JavaScript, excessive use of CSS, tracking cookies+pixels, ads, and so on there was on the website. </span><br /> <br /> <span>All I wanted was to read an interesting article, but after a big advertising pop-up banner appeared and made everything worse, I gave up and closed the browser tab.</span><br /> <br /> -<h2 style='display: inline'>Discovering the Gemini internet protocol</h2><br /> +<h2 style='display: inline' id='discovering-the-gemini-internet-protocol'>Discovering the Gemini internet protocol</h2><br /> <br /> <span>Around the same time, I discovered a relatively new, more lightweight protocol named Gemini, which does not support all these CPU-intensive features like HTML, JavaScript, and CSS. Also, tracking and ads are unsupported by the Gemini protocol.</span><br /> <br /> <span>The "downside" is that due to the limited capabilities of the Gemini protocol, all sites look very old and spartan. But that is not a downside; that is, in fact, a design choice people made. It is up to the client software how your capsule looks. For example, you could use a graphical client, such as Lagrange, with nice font renderings and colours to improve the appearance. Or you could use a very minimalistic command line black-and-white Gemini client. It's your (the user's) choice.</span><br /> <br /> -<a href='./2021-04-24-welcome-to-the-geminispace/amfora-screenshot.png'><img alt='Screenshot Amfora Gemini terminal client surfing this site' title='Screenshot Amfora Gemini terminal client surfing this site' src='./2021-04-24-welcome-to-the-geminispace/amfora-screenshot.png' /></a><br /> -<a href='./2021-04-24-welcome-to-the-geminispace/lagrange-screenshot.png'><img alt='Screenshot graphical Lagrange Gemini client surfing this site' title='Screenshot graphical Lagrange Gemini client surfing this site' src='./2021-04-24-welcome-to-the-geminispace/lagrange-screenshot.png' /></a><br /> +<a href='./welcome-to-the-geminispace/amfora-screenshot.png'><img alt='Screenshot Amfora Gemini terminal client surfing this site' title='Screenshot Amfora Gemini terminal client surfing this site' src='./welcome-to-the-geminispace/amfora-screenshot.png' /></a><br /> +<a href='./welcome-to-the-geminispace/lagrange-screenshot.png'><img alt='Screenshot graphical Lagrange Gemini client surfing this site' title='Screenshot graphical Lagrange Gemini client surfing this site' src='./welcome-to-the-geminispace/lagrange-screenshot.png' /></a><br /> <br /> <span>Why is there a need for a new protocol? As the modern web is a superset of Gemini, can't we use simple HTML 1.0 instead? That's a good and valid question. It is not a technical problem but a human problem. We tend to abuse the features once they are available. You can ensure that things stay efficient and straightforward as long as you are using the Gemini protocol. On the other hand, you can't force every website on the modern web to only create plain and straightforward-looking HTML pages.</span><br /> <br /> -<h2 style='display: inline'>My own Gemini capsule</h2><br /> +<h2 style='display: inline' id='my-own-gemini-capsule'>My own Gemini capsule</h2><br /> <br /> <span>As it is effortless to set up and maintain your own Gemini capsule (Gemini server + content composed via the Gemtext markup language), I decided to create my own. What I like about Gemini is that I can use my favourite text editor and get typing. I don't need to worry about the style and design of the presence, and I also don't have to test anything in ten different web browsers. I can only focus on the content! As a matter of fact, I am using the Vim editor + its spellchecker + auto word completion functionality to write this. </span><br /> <br /> @@ -70,7 +86,7 @@ <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 /> -<h2 style='display: inline'>Gemini advantages summarised</h2><br /> +<h2 style='display: inline' id='gemini-advantages-summarised'>Gemini advantages summarised</h2><br /> <br /> <ul> <li>Supports an alternative to the modern bloated web</li> @@ -81,28 +97,29 @@ <li>Supports privacy (no cookies, no request header fingerprinting, TLS encryption)</li> <li>Fun to play with (it's a bit geeky, yes, but a lot of fun!)</li> </ul><br /> -<h2 style='display: inline'>Dive into deep Gemini space</h2><br /> +<h2 style='display: inline' id='dive-into-deep-gemini-space'>Dive into deep Gemini space</h2><br /> <br /> <span>Check out one of the following links for more information about Gemini. For example, you will find a FAQ that explains why the protocol is named Gemini. Many Gemini capsules are dual-hosted via Gemini and HTTP(S) so that people new to Gemini can sneak peek at the content with a regular web browser. Some people go as far as tri-hosting all their content via HTTP(S), Gemini and Gopher.</span><br /> <br /> -<a class='textlink' href='gemini://gemini.circumlunar.space'>gemini://gemini.circumlunar.space</a><br /> -<a class='textlink' href='https://gemini.circumlunar.space'>https://gemini.circumlunar.space</a><br /> +<a class='textlink' href='gemini://geminiprotocol.net/'>gemini://geminiprotocol.net/</a><br /> +<a class='textlink' href='https://geminiprotocol.net/'>https://geminiprotocol.net/</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='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace (You are currently reading this)</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³</a><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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 (You are currently reading this)</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2021-05-16-personal-bash-coding-style-guide.html b/gemfeed/2021-05-16-personal-bash-coding-style-guide.html index 72c24941..f34a8170 100644 --- a/gemfeed/2021-05-16-personal-bash-coding-style-guide.html +++ b/gemfeed/2021-05-16-personal-bash-coding-style-guide.html @@ -8,10 +8,17 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Personal Bash coding style guide</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2021-05-16-personal-bash-coding-style-guide.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2021-05-16-personal-bash-coding-style-guide.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='personal-bash-coding-style-guide'>Personal Bash coding style guide</h1><br /> <br /> <span class='quote'>Published at 2021-05-16T14:51:57+01:00</span><br /> <br /> +<span>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. </span><br /> +<br /> +<a class='textlink' href='https://google.github.io/styleguide/shellguide.html'>Google Shell Style Guide</a><br /> +<br /> <pre> .---------------------------. /,--..---..---..---..---..--. `. @@ -25,29 +32,53 @@ "\__/"---------------"\__/"-+---+' </pre> <br /> -<span>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. </span><br /> -<br /> -<a class='textlink' href='https://google.github.io/styleguide/shellguide.html'>Google Shell Style Guide</a><br /> -<br /> -<h2 style='display: inline'>My modifications</h2><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#personal-bash-coding-style-guide'>Personal Bash coding style guide</a></li> +<li>⇢ <a href='#my-modifications'>My modifications</a></li> +<li>⇢ ⇢ <a href='#shebang'>Shebang</a></li> +<li>⇢ ⇢ <a href='#two-space-soft-tabs-indentation'>Two space soft-tabs indentation</a></li> +<li>⇢ ⇢ <a href='#breaking-long-pipes'>Breaking long pipes</a></li> +<li>⇢ ⇢ <a href='#quoting-your-variables'>Quoting your variables</a></li> +<li>⇢ ⇢ <a href='#prefer-built-in-commands-over-external-commands'>Prefer built-in commands over external commands</a></li> +<li>⇢ <a href='#my-additions'>My additions</a></li> +<li>⇢ ⇢ <a href='#use-of--yes--and--no-'>Use of 'yes' and 'no'</a></li> +<li>⇢ ⇢ <a href='#non-evil-alternative-to-variable-assignments-via-eval'>Non-evil alternative to variable assignments via eval</a></li> +<li>⇢ ⇢ <a href='#prefer-pipes-over-arrays-for-list-processing'>Prefer pipes over arrays for list processing</a></li> +<li>⇢ ⇢ <a href='#assign-then-shift'>Assign-then-shift</a></li> +<li>⇢ ⇢ <a href='#paranoid-mode'>Paranoid mode</a></li> +<li>⇢ <a href='#learned'>Learned</a></li> +<li>⇢ ⇢ <a href='#unintended-lexicographical-comparison'>Unintended lexicographical comparison.</a></li> +<li>⇢ ⇢ <a href='#pipestatus'>PIPESTATUS</a></li> +<li>⇢ <a href='#use-common-sense-and-be-consistent'>Use common sense and BE CONSISTENT.</a></li> +<li>⇢ <a href='#advanced-bash-learning-pro-tip'>Advanced Bash learning pro tip</a></li> +</ul><br /> +<h2 style='display: inline' id='my-modifications'>My modifications</h2><br /> <br /> <span>These are my modifications to the Google Guide.</span><br /> <br /> -<h3 style='display: inline'>Shebang</h3><br /> +<h3 style='display: inline' id='shebang'>Shebang</h3><br /> <br /> <span>Google recommends using always...</span><br /> <br /> -<pre> -#!/bin/bash +<!-- 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">#!/bin/bash </font></i> </pre> <br /> <span>... as the shebang line, but that does not work on all Unix and Unix-like operating systems (e.g., the *BSDs don't have Bash installed to /bin/bash). Better is:</span><br /> <br /> -<pre> -#!/usr/bin/env bash +<!-- 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">#!/usr/bin/env bash</font></i> </pre> <br /> -<h3 style='display: inline'>Two space soft-tabs indentation</h3><br /> +<h3 style='display: inline' id='two-space-soft-tabs-indentation'>Two space soft-tabs indentation</h3><br /> <br /> <span>I know there have been many tab- and soft-tab wars on this planet. Google recommends using two space soft-tabs for Bash scripts. </span><br /> <br /> @@ -57,15 +88,18 @@ <br /> <span>I hit the 80 character line length quicker with the four spaces than with two spaces, but that makes me refactor the Bash code more aggressively, which is a good thing. </span><br /> <br /> -<h3 style='display: inline'>Breaking long pipes</h3><br /> +<h3 style='display: inline' id='breaking-long-pipes'>Breaking long pipes</h3><br /> <br /> <span>Google recommends breaking up long pipes like this:</span><br /> <br /> -<pre> -# All fits on one line +<!-- 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"># All fits on one line</font></i> command1 | command2 -# Long commands +<i><font color="silver"># Long commands</font></i> command1 \ | command2 \ | command3 \ @@ -74,58 +108,75 @@ command1 \ <br /> <span>I think there is a better way like the following, which is less noisy. The pipe | already indicates the Bash that another command is expected, thus making the explicit line breaks with \ obsolete:</span><br /> <br /> -<pre> -# Long commands +<!-- 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"># Long commands</font></i> command1 | command2 | command3 | command4 </pre> <br /> -<h3 style='display: inline'>Quoting your variables</h3><br /> +<span class='quote'>Update: It's 2023 now, and I have changed my mind. I think Google's way is the better one. It may be a bit more to type, but the leading <span class='inlinecode'>|</span> are a nice eye catcher, so you know immediately what is going on!</span><br /> +<br /> +<h3 style='display: inline' id='quoting-your-variables'>Quoting your variables</h3><br /> <br /> <span>Google recommends always quote your variables. Generally, it would be best if you did that only for variables where you are unsure about the content/values of the variables (e.g., content is from an external input source and may contain whitespace or other special characters). In my opinion, the code will become quite noisy when you always quote your variables like this:</span><br /> <br /> -<pre> -greet () { - local -r greeting="${1}" - local -r name="${2}" - echo "${greeting} ${name}!" +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>greet () { + <b><u><font color="#000000">local</font></u></b> -r greeting=<font color="#808080">"${1}"</font> + <b><u><font color="#000000">local</font></u></b> -r name=<font color="#808080">"${2}"</font> + echo <font color="#808080">"${greeting} ${name}!"</font> } </pre> <br /> <span>In this particular example, I agree that you should quote them as you don't know the input (are there, for example, whitespace characters?). But if you are sure that you are only using simple bare words, then I think that the code looks much cleaner when you do this instead:</span><br /> <br /> -<pre> -say_hello_to_paul () { - local -r greeting=Hello - local -r name=Paul - echo "$greeting $name!" +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>say_hello_to_paul () { + <b><u><font color="#000000">local</font></u></b> -r greeting=Hello + <b><u><font color="#000000">local</font></u></b> -r name=Paul + echo <font color="#808080">"$greeting $name!"</font> } </pre> <br /> <span>You see, I also omitted the curly braces { } around the variables. I only use the curly braces around variables when it makes the code either easier/clearer to read or if it is necessary to use them:</span><br /> <br /> -<pre> -declare FOO=bar -# Curly braces around FOO are necessary -echo "foo${FOO}baz" +<!-- 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> FOO=bar +<i><font color="silver"># Curly braces around FOO are necessary</font></i> +echo <font color="#808080">"foo${FOO}baz"</font> </pre> <br /> <span>A few more words on always quoting the variables: For the sake of consistency (and for making ShellCheck happy), I am not against quoting everything I encounter. I also think that the larger the Bash script becomes, the more critical it becomes always to quote variables. That's because it will be more likely that you might not remember that some of the functions don't work on values with spaces in them, for example. It's just that I won't quote everything in every small script I write. </span><br /> <br /> -<h3 style='display: inline'>Prefer built-in commands over external commands</h3><br /> +<h3 style='display: inline' id='prefer-built-in-commands-over-external-commands'>Prefer built-in commands over external commands</h3><br /> <br /> <span>Google recommends using the built-in commands over available external commands where possible:</span><br /> <br /> -<pre> -# Prefer this: +<!-- 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"># Prefer this:</font></i> addition=$(( X + Y )) -substitution="${string/#foo/bar}" +substitution=<font color="#808080">"${string/#foo/bar}"</font> -# Instead of this: -addition="$(expr "${X}" + "${Y}")" -substitution="$(echo "${string}" | sed -e 's/^foo/bar/')" +<i><font color="silver"># Instead of this:</font></i> +addition=<font color="#808080">"$(expr "</font>${X}<font color="#808080">" + "</font>${Y}<font color="#808080">")"</font> +substitution=<font color="#808080">"$(echo "</font>${string}<font color="#808080">" | sed -e 's/^foo/bar/')"</font> </pre> <br /> <span>I can't entirely agree here. The external commands (especially sed) are much more sophisticated and powerful than the built-in Bash versions. Sed can do much more than the Bash can ever do by itself when it comes to text manipulation (the name "sed" stands for streaming editor, after all).</span><br /> @@ -136,41 +187,46 @@ substitution="$(echo "${string}" | sed -e 's/^foo/bar/')" <br /> <span>I even didn't get started with what you can do with awk (especially GNU Awk), a fully-fledged programming language. Tiny Awk snippets tend to be used quite often in Shell scripts without honouring the real power of Awk. But if you did everything in Perl or Awk or another scripting language, then it wouldn't be a Bash script anymore, wouldn't it? ;-)</span><br /> <br /> -<h2 style='display: inline'>My additions</h2><br /> +<h2 style='display: inline' id='my-additions'>My additions</h2><br /> <br /> -<h3 style='display: inline'>Use of 'yes' and 'no'</h3><br /> +<h3 style='display: inline' id='use-of--yes--and--no-'>Use of 'yes' and 'no'</h3><br /> <br /> <span>Bash does not support a boolean type. I tend just to use the strings 'yes' and 'no' here. I used 0 for false and 1 for true for some time, but I think that the yes/no strings are easier to read. Yes, the Bash script would need to perform string comparisons on every check, but if performance is crucial to you, you wouldn't want to use a Bash script anyway, correct?</span><br /> <br /> -<pre> -declare -r SUGAR_FREE=yes -declare -r I_NEED_THE_BUZZ=no +<!-- 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> -r SUGAR_FREE=yes +<b><u><font color="#000000">declare</font></u></b> -r I_NEED_THE_BUZZ=no buy_soda () { - local -r sugar_free=$1 + <b><u><font color="#000000">local</font></u></b> -r sugar_free=$1 - if [[ $sugar_free == yes ]]; then - echo 'Diet Dr. Pepper' - else - echo 'Pepsi Coke' - fi + <b><u><font color="#000000">if</font></u></b> [[ $sugar_free == yes ]]; <b><u><font color="#000000">then</font></u></b> + echo <font color="#808080">'Diet Dr. Pepper'</font> + <b><u><font color="#000000">else</font></u></b> + echo <font color="#808080">'Pepsi Coke'</font> + <b><u><font color="#000000">fi</font></u></b> } buy_soda $I_NEED_THE_BUZZ </pre> <br /> -<h3 style='display: inline'>Non-evil alternative to variable assignments via eval</h3><br /> +<h3 style='display: inline' id='non-evil-alternative-to-variable-assignments-via-eval'>Non-evil alternative to variable assignments via eval</h3><br /> <br /> <span>Google is in the opinion that eval should be avoided. I think so too. They list these examples in their guide:</span><br /> <br /> -<pre> -# What does this set? -# Did it succeed? In part or whole? -eval $(set_my_variables) - -# What happens if one of the returned values has a space in it? -variable="$(eval some_function)" +<!-- 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"># What does this set?</font></i> +<i><font color="silver"># Did it succeed? In part or whole?</font></i> +<b><u><font color="#000000">eval</font></u></b> $(set_my_variables) +<i><font color="silver"># What happens if one of the returned values has a space in it?</font></i> +variable=<font color="#808080">"$(eval some_function)"</font> </pre> <br /> <span>However, if I want to read variables from another file, I don't have to use eval here. I only have to source the file:</span><br /> @@ -201,32 +257,35 @@ Hello paul, it is Sat 15 May 19:21:12 BST 2021 <br /> <span>The downside is that ShellCheck won't be able to follow the dynamic sourcing anymore.</span><br /> <br /> -<h3 style='display: inline'>Prefer pipes over arrays for list processing</h3><br /> +<h3 style='display: inline' id='prefer-pipes-over-arrays-for-list-processing'>Prefer pipes over arrays for list processing</h3><br /> <br /> <span>When I do list processing in Bash, I prefer to use pipes. You can chain them through Bash functions as well, which is pretty neat. Usually, my list processing scripts are of a structure like this:</span><br /> <br /> -<pre> -filter_lines () { - echo 'Start filtering lines in a fancy way!' >&2 +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>filter_lines () { + echo <font color="#808080">'Start filtering lines in a fancy way!'</font> >&<font color="#000000">2</font> grep ... | sed .... } process_lines () { - echo 'Start processing line by line!' >&2 - while read -r line; do - ... do something and produce a result... - echo "$result" - done + echo <font color="#808080">'Start processing line by line!'</font> >&<font color="#000000">2</font> + <b><u><font color="#000000">while</font></u></b> <b><u><font color="#000000">read</font></u></b> -r line; <b><u><font color="#000000">do</font></u></b> + ... <b><u><font color="#000000">do</font></u></b> something and produce a result... + echo <font color="#808080">"$result"</font> + <b><u><font color="#000000">done</font></u></b> } -# Do some post-processing of the data +<i><font color="silver"># Do some post-processing of the data</font></i> postprocess_lines () { - echo 'Start removing duplicates!' >&2 + echo <font color="#808080">'Start removing duplicates!'</font> >&<font color="#000000">2</font> sort -u } genreate_report () { - echo 'My boss wants to have a report!' >&2 + echo <font color="#808080">'My boss wants to have a report!'</font> >&<font color="#000000">2</font> tee outfile.txt wc -l outfile.txt } @@ -243,139 +302,172 @@ main <br /> <span>The stdout is always passed as a pipe to the next following stage. The stderr is used for info logging.</span><br /> <br /> -<h3 style='display: inline'>Assign-then-shift</h3><br /> +<h3 style='display: inline' id='assign-then-shift'>Assign-then-shift</h3><br /> <br /> <span>I often refactor existing Bash code. That leads me to add and removing function arguments quite often. It's pretty repetitive work changing the $1, $2.... function argument numbers every time you change the order or add/remove possible arguments.</span><br /> <br /> <span>The solution is to use of the "assign-then-shift"-method, which goes like this: "local -r var1=$1; shift; local -r var2=$1; shift". The idea is that you only use "$1" to assign function arguments to named (better readable) local function variables. You will never have to bother about "$2" or above. That is very useful when you constantly refactor your code and remove or add function arguments. It's something that I picked up from a colleague (a pure Bash wizard) some time ago:</span><br /> <br /> -<pre> -some_function () { - local -r param_foo="$1"; shift - local -r param_baz="$1"; shift - local -r param_bay="$1"; shift - ... +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>some_function () { + <b><u><font color="#000000">local</font></u></b> -r param_foo=<font color="#808080">"$1"</font>; <b><u><font color="#000000">shift</font></u></b> + <b><u><font color="#000000">local</font></u></b> -r param_baz=<font color="#808080">"$1"</font>; <b><u><font color="#000000">shift</font></u></b> + <b><u><font color="#000000">local</font></u></b> -r param_bay=<font color="#808080">"$1"</font>; <b><u><font color="#000000">shift</font></u></b> + + <i><font color="silver"># ...</font></i> } </pre> <br /> <span>Want to add a param_baz? Just do this:</span><br /> <br /> -<pre> -some_function () { - local -r param_foo="$1"; shift - local -r param_bar="$1"; shift - local -r param_baz="$1"; shift - local -r param_bay="$1"; shift - ... +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>some_function () { + <b><u><font color="#000000">local</font></u></b> -r param_foo=<font color="#808080">"$1"</font>; <b><u><font color="#000000">shift</font></u></b> + <b><u><font color="#000000">local</font></u></b> -r param_bar=<font color="#808080">"$1"</font>; <b><u><font color="#000000">shift</font></u></b> + <b><u><font color="#000000">local</font></u></b> -r param_baz=<font color="#808080">"$1"</font>; <b><u><font color="#000000">shift</font></u></b> + <b><u><font color="#000000">local</font></u></b> -r param_bay=<font color="#808080">"$1"</font>; <b><u><font color="#000000">shift</font></u></b> + + <i><font color="silver"># ...</font></i> } </pre> <br /> <span>Want to remove param_foo? Nothing easier than that:</span><br /> <br /> -<pre> -some_function () { - local -r param_bar="$1"; shift - local -r param_baz="$1"; shift - local -r param_bay="$1"; shift - ... +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>some_function () { + <b><u><font color="#000000">local</font></u></b> -r param_bar=<font color="#808080">"$1"</font>; <b><u><font color="#000000">shift</font></u></b> + <b><u><font color="#000000">local</font></u></b> -r param_baz=<font color="#808080">"$1"</font>; <b><u><font color="#000000">shift</font></u></b> + <b><u><font color="#000000">local</font></u></b> -r param_bay=<font color="#808080">"$1"</font>; <b><u><font color="#000000">shift</font></u></b> + + <i><font color="silver"># ...</font></i> } </pre> <br /> <span>As you can see, I didn't need to change any other assignments within the function. Of course, you would also need to change the function argument lists at every occasion where the function is invoked - you would do that within the same refactoring session.</span><br /> <br /> -<h3 style='display: inline'>Paranoid mode</h3><br /> +<h3 style='display: inline' id='paranoid-mode'>Paranoid mode</h3><br /> <br /> <span>I call this the paranoid mode. The Bash will stop executing when a command exits with a status not equal to 0:</span><br /> <br /> -<pre> -set -e +<!-- 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">set</font></u></b> -e grep -q foo <<< bar echo Jo </pre> <br /> <span>Here 'Jo' will never be printed out as the grep didn't find any match. It's unrealistic for most scripts to run in paranoid mode purely, so there must be a way to add exceptions. Critical Bash scripts of mine tend to look like this:</span><br /> <br /> -<pre> -#!/usr/bin/env bash +<!-- 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">#!/usr/bin/env bash</font></i> -set -e +<b><u><font color="#000000">set</font></u></b> -e some_function () { - .. some critical code - ... + <i><font color="silver"># .. some critical code</font></i> + <i><font color="silver"># ...</font></i> - set +e - # Grep might fail, but that's OK now + <b><u><font color="#000000">set</font></u></b> +e + <i><font color="silver"># Grep might fail, but that's OK now</font></i> grep .... - local -i ec=$? - set -e + <b><u><font color="#000000">local</font></u></b> -i ec=$? + <b><u><font color="#000000">set</font></u></b> -e - .. critical code continues ... - if [[ $ec -ne 0 ]]; then - ... - fi - ... + <i><font color="silver"># .. critical code continues ...</font></i> + <b><u><font color="#000000">if</font></u></b> [[ $ec -ne <font color="#000000">0</font> ]]; <b><u><font color="#000000">then</font></u></b> + : <i><font color="silver"># ...</font></i> + <b><u><font color="#000000">fi</font></u></b> + <i><font color="silver"># ...</font></i> } </pre> <br /> -<h2 style='display: inline'>Learned</h2><br /> +<h2 style='display: inline' id='learned'>Learned</h2><br /> <br /> <span>There are also a couple of things I've learned from Google's guide.</span><br /> <br /> -<h3 style='display: inline'>Unintended lexicographical comparison.</h3><br /> +<h3 style='display: inline' id='unintended-lexicographical-comparison'>Unintended lexicographical comparison.</h3><br /> <br /> <span>The following looks like a valid Bash code:</span><br /> <br /> -<pre> -if [[ "${my_var}" > 3 ]]; then - # True for 4, false for 22. +<!-- 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">if</font></u></b> [[ <font color="#808080">"${my_var}"</font> > <font color="#000000">3</font> ]]; <b><u><font color="#000000">then</font></u></b> + <i><font color="silver"># True for 4, false for 22.</font></i> do_something -fi +<b><u><font color="#000000">fi</font></u></b> </pre> <br /> <span>... but it is probably an unintended lexicographical comparison. A correct way would be:</span><br /> <br /> -<pre> -if (( my_var > 3 )); then +<!-- 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">if</font></u></b> (( my_var > <font color="#000000">3</font> )); <b><u><font color="#000000">then</font></u></b> do_something -fi +<b><u><font color="#000000">fi</font></u></b> </pre> <br /> <span>or</span><br /> <br /> -<pre> -if [[ "${my_var}" -gt 3 ]]; then +<!-- 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">if</font></u></b> [[ <font color="#808080">"${my_var}"</font> -gt <font color="#000000">3</font> ]]; <b><u><font color="#000000">then</font></u></b> do_something -fi +<b><u><font color="#000000">fi</font></u></b> </pre> <br /> -<h3 style='display: inline'>PIPESTATUS</h3><br /> +<h3 style='display: inline' id='pipestatus'>PIPESTATUS</h3><br /> <br /> <span>I have never used the PIPESTATUS variable before. I knew that it's there, but I never bothered to understand how it works until now thoroughly.</span><br /> <br /> <span>The PIPESTATUS variable in Bash allows checking of the return code from all parts of a pipe. If it's only necessary to check the success or failure of the whole pipe, then the following is acceptable:</span><br /> <br /> -<pre> -tar -cf - ./* | ( cd "${dir}" && tar -xf - ) -if (( PIPESTATUS[0] != 0 || PIPESTATUS[1] != 0 )); then - echo "Unable to tar files to ${dir}" >&2 -fi +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>tar -cf - ./* | ( cd <font color="#808080">"${dir}"</font> && tar -xf - ) +<b><u><font color="#000000">if</font></u></b> (( PIPESTATUS[<font color="#000000">0</font>] != <font color="#000000">0</font> || PIPESTATUS[<font color="#000000">1</font>] != <font color="#000000">0</font> )); <b><u><font color="#000000">then</font></u></b> + echo <font color="#808080">"Unable to tar files to ${dir}"</font> >&<font color="#000000">2</font> +<b><u><font color="#000000">fi</font></u></b> </pre> <br /> <span>However, as PIPESTATUS will be overwritten as soon as you do any other command, if you need to act differently on errors based on where it happened in the pipe, you'll need to assign PIPESTATUS to another variable immediately after running the command (don't forget that [ is a command and will wipe out PIPESTATUS).</span><br /> <br /> -<pre> -tar -cf - ./* | ( cd "${DIR}" && tar -xf - ) -return_codes=( "${PIPESTATUS[@]}" ) -if (( return_codes[0] != 0 )); then +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>tar -cf - ./* | ( cd <font color="#808080">"${DIR}"</font> && tar -xf - ) +return_codes=( <font color="#808080">"${PIPESTATUS[@]}"</font> ) +<b><u><font color="#000000">if</font></u></b> (( return_codes[<font color="#000000">0</font>] != <font color="#000000">0</font> )); <b><u><font color="#000000">then</font></u></b> do_something -fi -if (( return_codes[1] != 0 )); then +<b><u><font color="#000000">fi</font></u></b> +<b><u><font color="#000000">if</font></u></b> (( return_codes[<font color="#000000">1</font>] != <font color="#000000">0</font> )); <b><u><font color="#000000">then</font></u></b> do_something_else -fi +<b><u><font color="#000000">fi</font></u></b> </pre> <br /> -<h2 style='display: inline'>Use common sense and BE CONSISTENT.</h2><br /> +<h2 style='display: inline' id='use-common-sense-and-be-consistent'>Use common sense and BE CONSISTENT.</h2><br /> <br /> <span>The following two paragraphs are thoroughly quoted from the Google guidelines. But they hit the hammer on the head:</span><br /> <br /> @@ -384,26 +476,27 @@ fi <span class='quote'>The point of having style guidelines is to have a common vocabulary of coding so people can concentrate on what you are saying rather than on how you are saying it. We present global style rules here, so people know the vocabulary. But local style is also important. If the code you add to a file looks drastically different from the existing code around it, the discontinuity throws readers out of their rhythm when they go to read it. Try to avoid this.</span><br /> <br /> <br /> -<h2 style='display: inline'>Advanced Bash learning pro tip</h2><br /> +<h2 style='display: inline' id='advanced-bash-learning-pro-tip'>Advanced Bash learning pro tip</h2><br /> <br /> <span>I also highly recommend having a read through the "Advanced Bash-Scripting Guide" (not from Google). I use it as the universal Bash reference and learn something new every time I look at it.</span><br /> <br /> <a class='textlink' href='https://tldp.org/LDP/abs/html/'>Advanced Bash-Scripting Guide</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='./2021-05-16-personal-bash-coding-style-guide.html'>2021-05-16 Personal Bash coding style guide (You are currently reading this)</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='./2023-12-10-bash-golf-part-3.html'>2023-12-10 Bash Golf Part 3</a><br /> <a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2</a><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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 (You are currently reading this)</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html b/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html index 62bfcceb..89e518d9 100644 --- a/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html +++ b/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html @@ -8,10 +8,17 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Gemtexter - One Bash script to rule it all</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='gemtexter---one-bash-script-to-rule-it-all'>Gemtexter - One Bash script to rule it all</h1><br /> <br /> <span class='quote'>Published at 2021-06-05T19:03:32+01:00</span><br /> <br /> +<span>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.</span><br /> +<br /> +<span>This comes with the benefit that I can write content in my favourite text editor (Vim). </span><br /> +<br /> <pre> o .,<>., o |\/\/\/\/| @@ -53,15 +60,28 @@ `+a:f:......jrei''' </pre> <br /> -<span>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.</span><br /> -<br /> -<span>This comes with the benefit that I can write content in my favourite text editor (Vim). </span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline'>Motivation</h2><br /> +<ul> +<li><a href='#gemtexter---one-bash-script-to-rule-it-all'>Gemtexter - One Bash script to rule it all</a></li> +<li>⇢ <a href='#motivation'>Motivation</a></li> +<li>⇢ <a href='#output-formats'>Output formats</a></li> +<li>⇢ <a href='#taking-it-as-far-as-i-should-but-no-farther'>Taking it as far as I should, but no farther</a></li> +<li>⇢ ⇢ <a href='#modularization-'>Modularization </a></li> +<li>⇢ ⇢ <a href='#bash-best-practises-and-shellcheck'>Bash best practises and ShellCheck</a></li> +<li>⇢ ⇢ <a href='#unit-testing'>Unit testing</a></li> +<li>⇢ ⇢ <a href='#html-unit-test-example'>HTML unit test example</a></li> +<li>⇢ ⇢ <a href='#markdown-unit-test-example'>Markdown unit test example</a></li> +<li>⇢ <a href='#handcrafted-html-styles'>Handcrafted HTML styles</a></li> +<li>⇢ <a href='#configurability'>Configurability</a></li> +<li>⇢ <a href='#future-features'>Future features</a></li> +<li>⇢ <a href='#conclusion'>Conclusion</a></li> +</ul><br /> +<h2 style='display: inline' id='motivation'>Motivation</h2><br /> <br /> <span>Another benefit of using Gemini is that the Gemtext markup language is easy to parse. As my site is dual-hosted (Gemini+HTTP), I could, in theory, just write a shell script to deal with the conversion from Gemtext to HTML; there is no need for a full-featured programming language here. I have done a lot of Bash in the past, but I am also often revisiting old tools and techniques for refreshing and keeping the knowledge up to date here.</span><br /> <br /> -<a href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all/blog-engine.jpg'><img alt='Motivational comic strip' title='Motivational comic strip' src='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all/blog-engine.jpg' /></a><br /> +<a href='./gemtexter-one-bash-script-to-rule-it-all/blog-engine.jpg'><img alt='Motivational comic strip' title='Motivational comic strip' src='./gemtexter-one-bash-script-to-rule-it-all/blog-engine.jpg' /></a><br /> <br /> <span>I have exactly done that - I wrote a Bash script, named Gemtexter, for that:</span><br /> <br /> @@ -69,7 +89,7 @@ <br /> <span>In short, Gemtexter is a static site generator and blogging engine that uses Gemtext as its input format.</span><br /> <br /> -<h2 style='display: inline'>Output formats</h2><br /> +<h2 style='display: inline' id='output-formats'>Output formats</h2><br /> <br /> <span>Gemtexter takes the Gemtext Markup files as the input and generates the following outputs from it (you find examples for each of these output formats on the Gemtexter GitHub page):</span><br /> <br /> @@ -82,11 +102,11 @@ </ul><br /> <span>I could have done all of that with a more robust language than Bash (such as Perl, Ruby, Go...), but I didn't. The purpose of this exercise was to challenge what I can do with a "simple" Bash script and learn new things.</span><br /> <br /> -<h2 style='display: inline'>Taking it as far as I should, but no farther</h2><br /> +<h2 style='display: inline' id='taking-it-as-far-as-i-should-but-no-farther'>Taking it as far as I should, but no farther</h2><br /> <br /> <span>The Bash is suitable very well for small scripts and ad-hoc automation on the command line. But it is for sure not a robust programming language. Writing this blog post, Gemtexter is nearing 1000 lines of code, which is actually a pretty large Bash script.</span><br /> <br /> -<h3 style='display: inline'>Modularization </h3><br /> +<h3 style='display: inline' id='modularization-'>Modularization </h3><br /> <br /> <span>I modularized the code so that each core functionality has its own file in ./lib. All the modules are included from the main Gemtexter script. For example, there is one module for HTML generation, one for Markdown generation, and so on. </span><br /> <br /> @@ -94,23 +114,23 @@ by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>paul <b><font color="#0000FF">in</font></b> uranus <b><font color="#0000FF">in</font></b> gemtexter on 🌱 main -❯ wc -l gemtexter lib<font color="#990000">/*</font> - <font color="#993399">117</font> gemtexter - <font color="#993399">59</font> lib/assert<font color="#990000">.</font><b><font color="#0000FF">source</font></b><font color="#990000">.</font>sh - <font color="#993399">128</font> lib/atomfeed<font color="#990000">.</font><b><font color="#0000FF">source</font></b><font color="#990000">.</font>sh - <font color="#993399">64</font> lib/gemfeed<font color="#990000">.</font><b><font color="#0000FF">source</font></b><font color="#990000">.</font>sh - <font color="#993399">161</font> lib/generate<font color="#990000">.</font><b><font color="#0000FF">source</font></b><font color="#990000">.</font>sh - <font color="#993399">50</font> lib/git<font color="#990000">.</font><b><font color="#0000FF">source</font></b><font color="#990000">.</font>sh - <font color="#993399">162</font> lib/html<font color="#990000">.</font><b><font color="#0000FF">source</font></b><font color="#990000">.</font>sh - <font color="#993399">30</font> lib/log<font color="#990000">.</font><b><font color="#0000FF">source</font></b><font color="#990000">.</font>sh - <font color="#993399">63</font> lib/md<font color="#990000">.</font><b><font color="#0000FF">source</font></b><font color="#990000">.</font>sh - <font color="#993399">834</font> total +<pre>paul <b><u><font color="#000000">in</font></u></b> uranus <b><u><font color="#000000">in</font></u></b> gemtexter on 🌱 main +❯ wc -l gemtexter lib/* + <font color="#000000">117</font> gemtexter + <font color="#000000">59</font> lib/assert.<b><u><font color="#000000">source</font></u></b>.sh + <font color="#000000">128</font> lib/atomfeed.<b><u><font color="#000000">source</font></u></b>.sh + <font color="#000000">64</font> lib/gemfeed.<b><u><font color="#000000">source</font></u></b>.sh + <font color="#000000">161</font> lib/generate.<b><u><font color="#000000">source</font></u></b>.sh + <font color="#000000">50</font> lib/git.<b><u><font color="#000000">source</font></u></b>.sh + <font color="#000000">162</font> lib/html.<b><u><font color="#000000">source</font></u></b>.sh + <font color="#000000">30</font> lib/log.<b><u><font color="#000000">source</font></u></b>.sh + <font color="#000000">63</font> lib/md.<b><u><font color="#000000">source</font></u></b>.sh + <font color="#000000">834</font> total </pre> <br /> <span>This way, the script could grow far beyond 1000 lines of code and still be maintainable. With more features, execution speed may slowly become a problem, though. I already notice that Gemtexter doesn't produce results instantly but requires few seconds of runtime already. That's not a problem yet, though. </span><br /> <br /> -<h3 style='display: inline'>Bash best practises and ShellCheck</h3><br /> +<h3 style='display: inline' id='bash-best-practises-and-shellcheck'>Bash best practises and ShellCheck</h3><br /> <br /> <span>While working on Gemtexter, I also had a look at the Google Shell Style Guide and wrote a blog post on that:</span><br /> <br /> @@ -126,7 +146,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <a class='textlink' href='https://shellcheck.net'>https://shellcheck.net</a><br /> <br /> -<h3 style='display: inline'>Unit testing</h3><br /> +<h3 style='display: inline' id='unit-testing'>Unit testing</h3><br /> <br /> <span>There is a basic unit test module in ./lib/assert.source.sh, which is used for unit testing. I found this to be very beneficial for cross-platform development. For example, I noticed that some unit tests failed on macOS while everything still worked fine on my Fedora Linux laptop. </span><br /> <br /> @@ -134,29 +154,29 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>It has been proven quite helpful to have unit tests in place for the HTML part already when working on the Markdown generator part. To test the Markdown part, I copied the HTML unit tests and changed the expected outcome in the assertions. This way, I could implement the Markdown generator in a test-driven way (writing the test first and afterwards the implementation).</span><br /> <br /> -<h3 style='display: inline'>HTML unit test example</h3><br /> +<h3 style='display: inline' id='html-unit-test-example'>HTML unit test example</h3><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="#009900">gemtext</font><font color="#990000">=</font><font color="#FF0000">'=> http://example.org Description of the link'</font> -assert<font color="#990000">::</font>equals <font color="#FF0000">"$(generate::make_link html "</font><font color="#009900">$gemtext</font><font color="#FF0000">")"</font> <font color="#990000">\</font> - <font color="#FF0000">'<a class="textlink" href="http://example.org">Description of the link</a><br />'</font> +<pre>gemtext=<font color="#808080">'=> http://example.org Description of the link'</font> +assert::equals <font color="#808080">"$(generate::make_link html "</font>$gemtext<font color="#808080">")"</font> \ + <font color="#808080">'<a class="textlink" href="http://example.org">Description of the link</a><br />'</font> </pre> <br /> -<h3 style='display: inline'>Markdown unit test example</h3><br /> +<h3 style='display: inline' id='markdown-unit-test-example'>Markdown unit test example</h3><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="#009900">gemtext</font><font color="#990000">=</font><font color="#FF0000">'=> http://example.org Description of the link'</font> -assert<font color="#990000">::</font>equals <font color="#FF0000">"$(generate::make_link md "</font><font color="#009900">$gemtext</font><font color="#FF0000">")"</font> <font color="#990000">\</font> - <font color="#FF0000">'[Description of the link](http://example.org) '</font> +<pre>gemtext=<font color="#808080">'=> http://example.org Description of the link'</font> +assert::equals <font color="#808080">"$(generate::make_link md "</font>$gemtext<font color="#808080">")"</font> \ + <font color="#808080">'[Description of the link](http://example.org) '</font> </pre> <br /> -<h2 style='display: inline'>Handcrafted HTML styles</h2><br /> +<h2 style='display: inline' id='handcrafted-html-styles'>Handcrafted HTML styles</h2><br /> <br /> <span>I had a look at some ready off the shelf CSS styles, but they all seemed too bloated. There is a whole industry selling CSS styles on the interweb. I preferred an effortless and minimalist style for the HTML site. So I handcrafted the Cascading Style Sheets manually with love and included them in the HTML header template. </span><br /> <br /> @@ -164,11 +184,11 @@ assert<font color="#990000">::</font>equals <font color="#FF0000">"$(generate::m <br /> <span>It's worth mentioning that all generated HTML files and Atom feeds pass the W3C validation tests.</span><br /> <span> </span><br /> -<h2 style='display: inline'>Configurability</h2><br /> +<h2 style='display: inline' id='configurability'>Configurability</h2><br /> <br /> <span>In case someone else than me wants to use Gemtexter for his own site, it is pretty much configurable. It is possible to specify your own configuration file and your own HTML templates. Have a look at the GitHub page for examples.</span><br /> <br /> -<h2 style='display: inline'>Future features</h2><br /> +<h2 style='display: inline' id='future-features'>Future features</h2><br /> <br /> <span>I could think of the following features added to a future version of Gemtexter:</span><br /> <br /> @@ -178,30 +198,32 @@ assert<font color="#990000">::</font>equals <font color="#FF0000">"$(generate::m <li>External CSS file for HTML.</li> <li>Improve speed by introducing parallelism and/or concurrency and/or better caching.</li> </ul><br /> -<h2 style='display: inline'>Conclusion</h2><br /> +<h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> <br /> <span>It was quite a lot of fun writing Gemtexter. It's a relatively small project, but given that I worked on that in my spare time once in a while, it kept me busy for several weeks. </span><br /> <br /> <span>I finally revamped my personal internet site and started to blog again. I wanted the result to be exactly how it is now: A slightly retro-inspired internet site built for fun with unconventional tools. </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-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 (You are currently reading this)</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='./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-12-10-bash-golf-part-3.html'>2023-12-10 Bash Golf Part 3</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 /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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='./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 (You are currently reading this)</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 /> +<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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2021-07-04-the-well-grounded-rubyist.html b/gemfeed/2021-07-04-the-well-grounded-rubyist.html index 745e8d18..6e831de5 100644 --- a/gemfeed/2021-07-04-the-well-grounded-rubyist.html +++ b/gemfeed/2021-07-04-the-well-grounded-rubyist.html @@ -8,7 +8,10 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>The Well-Grounded Rubyist</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2021-07-04-the-well-grounded-rubyist.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2021-07-04-the-well-grounded-rubyist.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='the-well-grounded-rubyist'>The Well-Grounded Rubyist</h1><br /> <br /> <span class='quote'>Published at 2021-07-04T10:51:23+01:00</span><br /> <br /> @@ -16,15 +19,30 @@ <br /> <span>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!</span><br /> <br /> -<a href='./2021-07-04-the-well-grounded-rubyist/book-cover.jpg'><img src='./2021-07-04-the-well-grounded-rubyist/book-cover.jpg' /></a><br /> +<a href='./the-well-grounded-rubyist/book-cover.jpg'><img src='./the-well-grounded-rubyist/book-cover.jpg' /></a><br /> <br /> <span>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.</span><br /> <br /> -<a href='./2021-07-04-the-well-grounded-rubyist/book-backside.jpg'><img src='./2021-07-04-the-well-grounded-rubyist/book-backside.jpg' /></a><br /> +<a href='./the-well-grounded-rubyist/book-backside.jpg'><img src='./the-well-grounded-rubyist/book-backside.jpg' /></a><br /> <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>My Ruby problem domain</h2><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#the-well-grounded-rubyist'>The Well-Grounded Rubyist</a></li> +<li>⇢ <a href='#my-ruby-problem-domain'>My Ruby problem domain</a></li> +<li>⇢ <a href='#being-stuck-in-ruby-mediocrity'>Being stuck in Ruby-mediocrity</a></li> +<li>⇢ <a href='#o-reilly-safari-books-online'>O'Reilly Safari Books Online</a></li> +<li>⇢ <a href='#key-takeaways'>Key takeaways</a></li> +<li>⇢ ⇢ <a href='#everything-is-an-object'>"Everything" is an object</a></li> +<li>⇢ ⇢ <a href='#normal-objects-and-singleton-objects'>"Normal" objects and singleton objects</a></li> +<li>⇢ ⇢ <a href='#domain-specific-languages'>Domain specific languages</a></li> +<li>⇢ ⇢ <a href='#ruby-is-self-ish'>Ruby is "self-ish"</a></li> +<li>⇢ ⇢ <a href='#functional-programming'>Functional programming</a></li> +<li>⇢ <a href='#perl'>Perl</a></li> +</ul><br /> +<h2 style='display: inline' id='my-ruby-problem-domain'>My Ruby problem domain</h2><br /> <br /> <span>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 :-).</span><br /> <br /> @@ -42,7 +60,7 @@ <br /> <span>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).</span><br /> <br /> -<h2 style='display: inline'>Being stuck in Ruby-mediocrity</h2><br /> +<h2 style='display: inline' id='being-stuck-in-ruby-mediocrity'>Being stuck in Ruby-mediocrity</h2><br /> <br /> <span>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.</span><br /> <br /> @@ -50,7 +68,7 @@ <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>O'Reilly Safari Books Online</h2><br /> +<h2 style='display: inline' id='o-reilly-safari-books-online'>O'Reilly Safari Books Online</h2><br /> <br /> <span>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.</span><br /> <br /> @@ -58,25 +76,25 @@ <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>Key takeaways</h2><br /> +<h2 style='display: inline' id='key-takeaways'>Key takeaways</h2><br /> <br /> <span>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.</span><br /> <br /> -<h3 style='display: inline'>"Everything" is an object</h3><br /> +<h3 style='display: inline' id='everything-is-an-object'>"Everything" is an object</h3><br /> <br /> <span>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.</span><br /> <br /> <span>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.</span><br /> <br /> -<h3 style='display: inline'>"Normal" objects and singleton objects</h3><br /> +<h3 style='display: inline' id='normal-objects-and-singleton-objects'>"Normal" objects and singleton objects</h3><br /> <br /> <span>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.</span><br /> <br /> -<h3 style='display: inline'>Domain specific languages</h3><br /> +<h3 style='display: inline' id='domain-specific-languages'>Domain specific languages</h3><br /> <br /> <span>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.</span><br /> <br /> -<h3 style='display: inline'>Ruby is "self-ish"</h3><br /> +<h3 style='display: inline' id='ruby-is-self-ish'>Ruby is "self-ish"</h3><br /> <br /> <span>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". </span><br /> <br /> @@ -101,7 +119,7 @@ Hello World <br /> <span>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.</span><br /> <br /> -<h3 style='display: inline'>Functional programming</h3><br /> +<h3 style='display: inline' id='functional-programming'>Functional programming</h3><br /> <br /> <span>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).</span><br /> <br /> @@ -109,7 +127,7 @@ Hello World <br /> <span>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. :-)</span><br /> <br /> -<h2 style='display: inline'>Perl</h2><br /> +<h2 style='display: inline' id='perl'>Perl</h2><br /> <br /> <span>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".</span><br /> <br /> @@ -117,9 +135,9 @@ Hello World <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2021-08-01-on-being-pedantic-about-open-source.html b/gemfeed/2021-08-01-on-being-pedantic-about-open-source.html index 5ebfd451..4ac4418b 100644 --- a/gemfeed/2021-08-01-on-being-pedantic-about-open-source.html +++ b/gemfeed/2021-08-01-on-being-pedantic-about-open-source.html @@ -8,10 +8,15 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>On being Pedantic about Open-Source</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2021-08-01-on-being-pedantic-about-open-source.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2021-08-01-on-being-pedantic-about-open-source.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='on-being-pedantic-about-open-source'>On being Pedantic about Open-Source</h1><br /> <br /> <span class='quote'>Published at 2021-08-01T10:37:58+03:00; Updated at 2023-01-23</span><br /> <br /> +<span>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. </span><br /> +<br /> <pre> __ _____....--' .' @@ -24,21 +29,38 @@ '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^' LGB - Art by lgbearrd </pre> <br /> -<span>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. </span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline'>The costs of open-source</h2><br /> +<ul> +<li><a href='#on-being-pedantic-about-open-source'>On being Pedantic about Open-Source</a></li> +<li>⇢ <a href='#the-costs-of-open-source'>The costs of open-source</a></li> +<li>⇢ <a href='#commercial-providers'>Commercial providers</a></li> +<li>⇢ <a href='#earning-on-open-source'>Earning on open-source</a></li> +<li>⇢ <a href='#open-source-organizations-and-individual-contributors'>Open-source organizations and individual contributors</a></li> +<li>⇢ <a href='#lesser-known-projects-and-the-charm-of-clunkiness'>Lesser known projects and the charm of clunkiness</a></li> +<li>⇢ <a href='#the-security-aspect'>The security aspect</a></li> +<li>⇢ <a href='#always-watch-out-for-open-source-alternatives'>Always watch out for open-source alternatives</a></li> +<li>⇢ <a href='#what-about-mobile'>What about mobile?</a></li> +<li>⇢ <a href='#know-the-alternatives'>Know the alternatives</a></li> +<li>⇢ <a href='#you-can-t-control-it-all'>You can't control it all</a></li> +<li>⇢ <a href='#the-middle-way'>The middle way</a></li> +<li>⇢ <a href='#the-downside-of-being-a-nobody'>The downside of being a nobody</a></li> +<li>⇢ <a href='#mobile-open-source-oses-are-still-evolving'>Mobile open-source OSes are still evolving</a></li> +<li>⇢ <a href='#conclusion'>Conclusion</a></li> +</ul><br /> +<h2 style='display: inline' id='the-costs-of-open-source'>The costs of open-source</h2><br /> <br /> <span>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. </span><br /> <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>Commercial providers</h2><br /> +<h2 style='display: inline' id='commercial-providers'>Commercial providers</h2><br /> <br /> <span>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.</span><br /> <br /> <span>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. </span><br /> <br /> -<h2 style='display: inline'>Earning on open-source</h2><br /> +<h2 style='display: inline' id='earning-on-open-source'>Earning on open-source</h2><br /> <br /> <span>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. </span><br /> <br /> @@ -46,25 +68,25 @@ <br /> <span>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). </span><br /> <br /> -<h2 style='display: inline'>Open-source organizations and individual contributors</h2><br /> +<h2 style='display: inline' id='open-source-organizations-and-individual-contributors'>Open-source organizations and individual contributors</h2><br /> <br /> <span>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. </span><br /> <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>Lesser known projects and the charm of clunkiness</h2><br /> +<h2 style='display: inline' id='lesser-known-projects-and-the-charm-of-clunkiness'>Lesser known projects and the charm of clunkiness</h2><br /> <br /> <span>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.</span><br /> <br /> <span>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!</span><br /> <br /> -<h2 style='display: inline'>The security aspect</h2><br /> +<h2 style='display: inline' id='the-security-aspect'>The security aspect</h2><br /> <br /> <span>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.</span><br /> <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>Always watch out for open-source alternatives</h2><br /> +<h2 style='display: inline' id='always-watch-out-for-open-source-alternatives'>Always watch out for open-source alternatives</h2><br /> <br /> <span>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....</span><br /> <br /> @@ -72,7 +94,7 @@ <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>What about mobile?</h2><br /> +<h2 style='display: inline' id='what-about-mobile'>What about mobile?</h2><br /> <br /> <span class='quote'>Update 2023-01-21: Check out my newer post about GrapheneOS, which solves some of my dilemmas</span><br /> <br /> @@ -82,19 +104,19 @@ <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>Know the alternatives</h2><br /> +<h2 style='display: inline' id='know-the-alternatives'>Know the alternatives</h2><br /> <br /> <span>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.</span><br /> <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>You can't control it all</h2><br /> +<h2 style='display: inline' id='you-can-t-control-it-all'>You can't control it all</h2><br /> <br /> <span>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: </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 /> -<h2 style='display: inline'>The middle way</h2><br /> +<h2 style='display: inline' id='the-middle-way'>The middle way</h2><br /> <br /> <span>Regarding my personal Smartphone dilemma: I guess the middle way is to use two phones: </span><br /> <br /> @@ -109,17 +131,17 @@ <br /> <span>Anyhow, any gadgets, including your phone, should be a tool you use. Don't let the phone use you!</span><br /> <br /> -<h2 style='display: inline'>The downside of being a nobody</h2><br /> +<h2 style='display: inline' id='the-downside-of-being-a-nobody'>The downside of being a nobody</h2><br /> <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>Mobile open-source OSes are still evolving</h2><br /> +<h2 style='display: inline' id='mobile-open-source-oses-are-still-evolving'>Mobile open-source OSes are still evolving</h2><br /> <br /> <span>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.</span><br /> <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>Conclusion</h2><br /> +<h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> <br /> <span>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.</span><br /> <br /> @@ -129,9 +151,9 @@ <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2021-09-12-keep-it-simple-and-stupid.html b/gemfeed/2021-09-12-keep-it-simple-and-stupid.html index 8ea957bb..e275e922 100644 --- a/gemfeed/2021-09-12-keep-it-simple-and-stupid.html +++ b/gemfeed/2021-09-12-keep-it-simple-and-stupid.html @@ -8,10 +8,15 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Keep it simple and stupid</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2021-09-12-keep-it-simple-and-stupid.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2021-09-12-keep-it-simple-and-stupid.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='keep-it-simple-and-stupid'>Keep it simple and stupid</h1><br /> <br /> <span class='quote'>Published at 2021-09-12T09:39:20+03:00; Updated at 2023-03-23</span><br /> <br /> +<span>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.</span><br /> +<br /> <pre> _______________ |*\_/*|_______ | ___________ | .-. .-. ||_/-\_|______ | @@ -27,25 +32,41 @@ -------------------- -------------------- </pre> <br /> -<span>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.</span><br /> -<br /> -<h1 style='display: inline'>Need faster hardware</h1><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#keep-it-simple-and-stupid'>Keep it simple and stupid</a></li> +<li>⇢ <a href='#need-faster-hardware'>Need faster hardware</a></li> +<li>⇢ <a href='#too-complex-to-be-replaced'>Too complex to be replaced</a></li> +<li>⇢ ⇢ <a href='#on-cobol'>On COBOL</a></li> +<li>⇢ ⇢ <a href='#on-kubernetes'>On Kubernetes</a></li> +<li>⇢ ⇢ <a href='#the-younger-generation-of-it-professionals'>The younger generation of IT professionals</a></li> +<li>⇢ <a href='#the-bloated-web'>The bloated web</a></li> +<li>⇢ <a href='#fancy-log-management-solutions'>Fancy log-management solutions</a></li> +<li>⇢ <a href='#more-kiss'>More KISS</a></li> +<li>⇢ ⇢ <a href='#the-adslowbe-pdf-reader'>The Adslowbe PDF Reader</a></li> +<li>⇢ ⇢ <a href='#the-power-of-plain-text-files'>The power of plain text files</a></li> +<li>⇢ ⇢ <a href='#kiss-for-programmers'>KISS for programmers</a></li> +<li>⇢ <a href='#when-kiss-is-not-kiss-anymore'>When KISS is not KISS anymore</a></li> +<li>⇢ <a href='#other-relevant-readings'>Other relevant readings</a></li> +</ul><br /> +<h2 style='display: inline' id='need-faster-hardware'>Need faster hardware</h2><br /> <br /> <span>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.</span><br /> <br /> -<h1 style='display: inline'>Too complex to be replaced</h1><br /> +<h2 style='display: inline' id='too-complex-to-be-replaced'>Too complex to be replaced</h2><br /> <br /> -<h2 style='display: inline'>On COBOL</h2><br /> +<h3 style='display: inline' id='on-cobol'>On COBOL</h3><br /> <br /> <span>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. </span><br /> <br /> <a class='textlink' href='https://nymag.com/intelligencer/2020/04/what-is-cobol-what-does-it-have-to-do-with-the-coronavirus.html'>https://nymag.com/intelligencer/2020/04/what-is-cobol-what-does-it-have-to-do-with-the-coronavirus.html</a><br /> <br /> -<h2 style='display: inline'>On Kubernetes</h2><br /> +<h3 style='display: inline' id='on-kubernetes'>On Kubernetes</h3><br /> <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>The younger generation of IT professionals</h2><br /> +<h3 style='display: inline' id='the-younger-generation-of-it-professionals'>The younger generation of IT professionals</h3><br /> <br /> <span>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. </span><br /> <br /> @@ -61,7 +82,7 @@ <br /> <a class='textlink' href='https://christine.website/blog/theres-a-node-2021-10-02'>https://christine.website/blog/theres-a-node-2021-10-02</a><br /> <br /> -<h1 style='display: inline'>The bloated web</h1><br /> +<h2 style='display: inline' id='the-bloated-web'>The bloated web</h2><br /> <br /> <span>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:</span><br /> <br /> @@ -69,7 +90,7 @@ <br /> <span>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.</span><br /> <br /> -<h1 style='display: inline'>Fancy log-management solutions</h1><br /> +<h2 style='display: inline' id='fancy-log-management-solutions'>Fancy log-management solutions</h2><br /> <br /> <span>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.</span><br /> <br /> @@ -77,48 +98,49 @@ <br /> <span>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. </span><br /> <br /> -<h1 style='display: inline'>More KISS</h1><br /> +<h2 style='display: inline' id='more-kiss'>More KISS</h2><br /> <br /> -<h2 style='display: inline'>The Adslowbe PDF Reader</h2><br /> +<h3 style='display: inline' id='the-adslowbe-pdf-reader'>The Adslowbe PDF Reader</h3><br /> <br /> <span>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. </span><br /> <br /> -<h2 style='display: inline'>The power of plain text files</h2><br /> +<h3 style='display: inline' id='the-power-of-plain-text-files'>The power of plain text files</h3><br /> <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>KISS for programmers</h2><br /> +<h3 style='display: inline' id='kiss-for-programmers'>KISS for programmers</h3><br /> <br /> <span>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:</span><br /> <br /> <a class='textlink' href='https://thevaluable.dev/kiss-principle-explained/'>https://thevaluable.dev/kiss-principle-explained/</a><br /> <br /> -<h1 style='display: inline'>When KISS is not KISS anymore</h1><br /> +<h2 style='display: inline' id='when-kiss-is-not-kiss-anymore'>When KISS is not KISS anymore</h2><br /> <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>Other relevant readings</h2><br /> +<h2 style='display: inline' id='other-relevant-readings'>Other relevant readings</h2><br /> <br /> <a class='textlink' href='https://unixsheikh.com/articles/is-the-madness-ever-going-to-end.html'>Is the madness ever going to end?</a><br /> <a class='textlink' href='https://sive.rs/plaintext'>Write plain text files</a><br /> <br /> <span>Enough ranted for now!</span><br /> <br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<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 (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='./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 /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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='./2021-09-12-keep-it-simple-and-stupid.html'>2021-09-12 Keep it simple and stupid (You are currently reading this)</a><br /> <br /> <span class='quote'>Controversially, a lack of features is a feature. Enjoy your peace an quiet. - Michael W Lucas </span><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2021-10-22-defensive-devops.html b/gemfeed/2021-10-22-defensive-devops.html index edf1e540..14354f50 100644 --- a/gemfeed/2021-10-22-defensive-devops.html +++ b/gemfeed/2021-10-22-defensive-devops.html @@ -8,10 +8,23 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Defensive DevOps</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2021-10-22-defensive-devops.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2021-10-22-defensive-devops.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='defensive-devops'>Defensive DevOps</h1><br /> <br /> <span class='quote'>Published at 2021-10-22T10:02:46+03:00</span><br /> <br /> +<span>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.</span><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>Over time, I have compiled a list of fire-fighting automation strategies, which I would like to share here. </span><br /> +<br /> <pre> c=====e H @@ -22,17 +35,20 @@ ASCII Art by Clyde Watson </pre> <br /> -<span>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.</span><br /> -<br /> -<span>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. </span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<span>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. </span><br /> -<br /> -<span>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. </span><br /> -<br /> -<span>Over time, I have compiled a list of fire-fighting automation strategies, which I would like to share here. </span><br /> -<br /> -<h2 style='display: inline'>Meet Defensive DevOps</h2><br /> +<ul> +<li><a href='#defensive-devops'>Defensive DevOps</a></li> +<li>⇢ <a href='#meet-defensive-devops'>Meet Defensive DevOps</a></li> +<li>⇢ <a href='#don-t-fully-automate-from-the-beginning'>Don't fully automate from the beginning</a></li> +<li>⇢ <a href='#develop-code-directly-on-production-systems'>Develop code directly on production systems</a></li> +<li>⇢ ⇢ <a href='#don-t-make-it-worse'>Don't make it worse</a></li> +<li>⇢ <a href='#test-your-code'>Test your code</a></li> +<li>⇢ <a href='#automation'>Automation</a></li> +<li>⇢ <a href='#out-of-office-hours'>Out of office hours</a></li> +<li>⇢ <a href='#retrospective'>Retrospective</a></li> +</ul><br /> +<h2 style='display: inline' id='meet-defensive-devops'>Meet Defensive DevOps</h2><br /> <br /> <span>Defensive DevOps is a term I invented by myself. I define it this way:</span><br /> <br /> @@ -45,7 +61,7 @@ </ul><br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>Don't fully automate from the beginning</h2><br /> +<h2 style='display: inline' id='don-t-fully-automate-from-the-beginning'>Don't fully automate from the beginning</h2><br /> <br /> <span>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.</span><br /> <br /> @@ -53,7 +69,7 @@ <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>Develop code directly on production systems</h2><br /> +<h2 style='display: inline' id='develop-code-directly-on-production-systems'>Develop code directly on production systems</h2><br /> <br /> <span>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. </span><br /> <br /> @@ -61,7 +77,7 @@ <br /> <span>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.</span><br /> <br /> -<h3 style='display: inline'>Don't make it worse</h3><br /> +<h3 style='display: inline' id='don-t-make-it-worse'>Don't make it worse</h3><br /> <br /> <span>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:</span><br /> <br /> @@ -75,7 +91,7 @@ </ul><br /> <span>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. </span><br /> <br /> -<h2 style='display: inline'>Test your code</h2><br /> +<h2 style='display: inline' id='test-your-code'>Test your code</h2><br /> <br /> <span>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? </span><br /> <br /> @@ -85,7 +101,7 @@ <br /> <span>By following these principles, you test every line of code while you are developing on it. </span><br /> <br /> -<h2 style='display: inline'>Automation</h2><br /> +<h2 style='display: inline' id='automation'>Automation</h2><br /> <br /> <span>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. </span><br /> <br /> @@ -99,13 +115,13 @@ <br /> <span>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. </span><br /> <br /> -<h2 style='display: inline'>Out of office hours</h2><br /> +<h2 style='display: inline' id='out-of-office-hours'>Out of office hours</h2><br /> <br /> <span>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.</span><br /> <br /> <span>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. </span><br /> <br /> -<h2 style='display: inline'>Retrospective</h2><br /> +<h2 style='display: inline' id='retrospective'>Retrospective</h2><br /> <br /> <span>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.</span><br /> <br /> @@ -115,9 +131,9 @@ <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2021-11-29-bash-golf-part-1.html b/gemfeed/2021-11-29-bash-golf-part-1.html index 4bccd556..529941d3 100644 --- a/gemfeed/2021-11-29-bash-golf-part-1.html +++ b/gemfeed/2021-11-29-bash-golf-part-1.html @@ -8,10 +8,19 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Bash Golf Part 1</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2021-11-29-bash-golf-part-1.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2021-11-29-bash-golf-part-1.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='bash-golf-part-1'>Bash Golf Part 1</h1><br /> <br /> <span class='quote'>Published at 2021-11-29T14:06:14+00:00; Updated at 2022-01-05</span><br /> <br /> +<span>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.</span><br /> +<br /> +<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1 (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='./2023-12-10-bash-golf-part-3.html'>2023-12-10 Bash Golf Part 3</a><br /> +<br /> <pre> '\ . . |>18>> \ . ' . | @@ -23,12 +32,20 @@ jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Art by Joan Stark </pre> <br /> -<span>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.</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 (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 /> -<br /> -<h2 style='display: inline'>TCP/IP networking</h2><br /> +<ul> +<li><a href='#bash-golf-part-1'>Bash Golf Part 1</a></li> +<li>⇢ <a href='#tcpip-networking'>TCP/IP networking</a></li> +<li>⇢ <a href='#process-substitution'>Process substitution</a></li> +<li>⇢ <a href='#grouping'>Grouping</a></li> +<li>⇢ <a href='#expansions'>Expansions</a></li> +<li>⇢ <a href='#--aka-stdin-and-stdout-placeholder'>- aka stdin and stdout placeholder</a></li> +<li>⇢ <a href='#alternative-argument-passing'>Alternative argument passing</a></li> +<li>⇢ <a href='#-aka-the-null-command'>: aka the null command</a></li> +<li>⇢ <a href='#no-floating-point-support'>(No) floating point support</a></li> +</ul><br /> +<h2 style='display: inline' id='tcpip-networking'>TCP/IP networking</h2><br /> <br /> <span>You probably know the Netcat tool, which is a swiss army knife for TCP/IP networking on the command line. But did you know that the Bash natively supports TCP/IP networking?</span><br /> <br /> @@ -62,7 +79,7 @@ X-Frame-Options: SAMEORIGIN <br /> <span>You would assume that this also works with the ZSH, but it doesn't. This is one of the few things which don't work with the ZSH but in the Bash. There might be plugins you could use for ZSH to do something similar, though.</span><br /> <br /> -<h2 style='display: inline'>Process substitution</h2><br /> +<h2 style='display: inline' id='process-substitution'>Process substitution</h2><br /> <br /> <span>The idea here is, that you can read the output (stdout) of a command from a file descriptor:</span><br /> <br /> @@ -142,7 +159,7 @@ foo bar baz <br /> <span>Just think a while and see whether you understand fully what is happening here.</span><br /> <br /> -<h2 style='display: inline'>Grouping</h2><br /> +<h2 style='display: inline' id='grouping'>Grouping</h2><br /> <br /> <span>Command grouping can be quite useful for combining the output of multiple commands:</span><br /> <br /> @@ -209,7 +226,7 @@ $ Expands to the process ID of the shell. In a () subshell, it expands to 1028739 </pre> <br /> -<h2 style='display: inline'>Expansions</h2><br /> +<h2 style='display: inline' id='expansions'>Expansions</h2><br /> <br /> <span>Let's start with simple examples:</span><br /> <br /> @@ -266,7 +283,7 @@ one:A one:B one:C two:A two:B two:C Linux-one:A-FreeBSD Linux-one:B-FreeBSD Linux-one:C-FreeBSD Linux-two:A-FreeBSD Linux-two:B-FreeBSD Linux-two:C-FreeBSD Linux-three:A-FreeBSD Linux-three:B-FreeBSD Linux-three:C-FreeBSD </pre> <br /> -<h2 style='display: inline'>- aka stdin and stdout placeholder</h2><br /> +<h2 style='display: inline' id='--aka-stdin-and-stdout-placeholder'>- aka stdin and stdout placeholder</h2><br /> <br /> <span>Some commands and Bash builtins use "-" as a placeholder for stdin and stdout:</span><br /> <br /> @@ -317,7 +334,7 @@ $ file - /dev/stdin: Perl script text executable </pre> <br /> -<h2 style='display: inline'>Alternative argument passing</h2><br /> +<h2 style='display: inline' id='alternative-argument-passing'>Alternative argument passing</h2><br /> <br /> <span>This is a quite unusual way of passing arguments to a Bash script:</span><br /> <br /> @@ -359,7 +376,7 @@ paul:secret <br /> <span>But the downside of it is that the variables will also be defined in your current shell environment and not just in the scripts sub-process.</span><br /> <br /> -<h2 style='display: inline'>: aka the null command</h2><br /> +<h2 style='display: inline' id='-aka-the-null-command'>: aka the null command</h2><br /> <br /> <span>First, let's use the "help" Bash built-in to see what it says about the null command:</span><br /> <br /> @@ -446,7 +463,7 @@ bash: 1: command not found... 4 </pre> <br /> -<h2 style='display: inline'>(No) floating point support</h2><br /> +<h2 style='display: inline' id='no-floating-point-support'>(No) floating point support</h2><br /> <br /> <span>I have to give a plus-point to the ZSH here. As the ZSH supports floating point calculation, whereas the Bash doesn't:</span><br /> <br /> @@ -473,20 +490,21 @@ bash: line 1: 1/10.0 : syntax error: invalid arithmetic operator (error token is <br /> <span>See you later for the next post of this series.</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-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 (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='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2</a><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1 (You are currently reading this)</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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.html b/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.html index 28eb7eda..2a0ca68c 100644 --- a/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.html +++ b/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.html @@ -8,10 +8,19 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>How to stay sane as a DevOps person </h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='how-to-stay-sane-as-a-devops-person-'>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 /> +<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 /> <pre> ) ) (( ( @@ -34,13 +43,26 @@ ~~~~~' </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 /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><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'>Set clear expectations</h2><br /> +<ul> +<li><a href='#how-to-stay-sane-as-a-devops-person-'>How to stay sane as a DevOps person </a></li> +<li>⇢ <a href='#set-clear-expectations'>Set clear expectations</a></li> +<li>⇢ <a href='#always-respond-to-requests-but-set-expectations-and-boundaries'>Always respond to requests but set expectations and boundaries</a></li> +<li>⇢ ⇢ <a href='#dealing-with-requests'>Dealing with requests</a></li> +<li>⇢ ⇢ <a href='#escalation-is-only-a-tool'>Escalation is only a tool</a></li> +<li>⇢ <a href='#think-positively'>Think positively</a></li> +<li>⇢ <a href='#go-slower-even-if-you-could-go-faster'>Go slower even if you could go faster</a></li> +<li>⇢ ⇢ <a href='#you-work-in-a-team'>You work in a team</a></li> +<li>⇢ ⇢ <a href='#don-t-rush'>Don't rush</a></li> +<li>⇢ <a href='#you-are-not-a-superhero'>You are not a superhero</a></li> +<li>⇢ ⇢ <a href='#give-away-some-of-your-superpowers'>Give away some of your superpowers</a></li> +<li>⇢ <a href='#don-t-jump-on-all-problems-immediately'>Don't jump on all problems immediately</a></li> +<li>⇢ <a href='#force-breaks-and-shutdown-now'>Force breaks; and shutdown now</a></li> +<li>⇢ <a href='#block-time-every-day-for-personal-advance'>Block time every day for personal advance</a></li> +<li>⇢ <a href='#more'>More</a></li> +</ul><br /> +<h2 style='display: inline' id='set-clear-expectations'>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 /> @@ -48,21 +70,21 @@ <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'>Always respond to requests but set expectations and boundaries</h2><br /> +<h2 style='display: inline' id='always-respond-to-requests-but-set-expectations-and-boundaries'>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'>Dealing with requests</h3><br /> +<h3 style='display: inline' id='dealing-with-requests'>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'>Escalation is only a tool</h3><br /> +<h3 style='display: inline' id='escalation-is-only-a-tool'>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'>Think positively</h2><br /> +<h2 style='display: inline' id='think-positively'>Think positively</h2><br /> <br /> <span>If times are very stressful, think that it could always be worse:</span><br /> <br /> @@ -72,17 +94,17 @@ <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'>Go slower even if you could go faster</h2><br /> +<h2 style='display: inline' id='go-slower-even-if-you-could-go-faster'>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'>You work in a team</h3><br /> +<h3 style='display: inline' id='you-work-in-a-team'>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'>Don't rush</h3><br /> +<h3 style='display: inline' id='don-t-rush'>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 /> @@ -90,7 +112,7 @@ <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'>You are not a superhero</h2><br /> +<h2 style='display: inline' id='you-are-not-a-superhero'>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 /> @@ -98,7 +120,7 @@ <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'>Give away some of your superpowers</h3><br /> +<h3 style='display: inline' id='give-away-some-of-your-superpowers'>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 /> @@ -106,7 +128,7 @@ <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'>Don't jump on all problems immediately</h2><br /> +<h2 style='display: inline' id='don-t-jump-on-all-problems-immediately'>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 /> @@ -116,19 +138,19 @@ <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'>Force breaks; and shutdown now</h2><br /> +<h2 style='display: inline' id='force-breaks-and-shutdown-now'>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'>Block time every day for personal advance</h2><br /> +<h2 style='display: inline' id='block-time-every-day-for-personal-advance'>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'>More</h2><br /> +<h2 style='display: inline' id='more'>More</h2><br /> <br /> <span>Another blog post worth reading:</span><br /> <br /> @@ -138,9 +160,9 @@ <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2022-01-01-bash-golf-part-2.html b/gemfeed/2022-01-01-bash-golf-part-2.html index 4106611c..b8d4f5b7 100644 --- a/gemfeed/2022-01-01-bash-golf-part-2.html +++ b/gemfeed/2022-01-01-bash-golf-part-2.html @@ -8,10 +8,19 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Bash Golf Part 2</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2022-01-01-bash-golf-part-2.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2022-01-01-bash-golf-part-2.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='bash-golf-part-2'>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 /> +<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 /> <pre> '\ '\ . . |>18>> \ \ . ' . | @@ -23,12 +32,19 @@ 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 /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline'>Redirection</h2><br /> +<ul> +<li><a href='#bash-golf-part-2'>Bash Golf Part 2</a></li> +<li>⇢ <a href='#redirection'>Redirection</a></li> +<li>⇢ <a href='#here'>HERE</a></li> +<li>⇢ <a href='#random'>RANDOM</a></li> +<li>⇢ <a href='#set--x-and-set--e-and-pipefile'>set -x and set -e and pipefile</a></li> +<li>⇢ ⇢ <a href='#-x'>-x</a></li> +<li>⇢ ⇢ <a href='#-e'>-e</a></li> +<li>⇢ ⇢ <a href='#pipefail'>pipefail</a></li> +</ul><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 /> @@ -57,6 +73,8 @@ Foo 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> @@ -158,7 +176,7 @@ First line: Learn You a Haskell Second line: for Great Good </pre> <br /> -<h2 style='display: inline'>HERE</h2><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 /> @@ -241,7 +259,7 @@ Learn you a Golang for Great Good I like Perl too </pre> <br /> -<h2 style='display: inline'>RANDOM</h2><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 /> @@ -286,11 +304,11 @@ Delaying script execution for 42 seconds... Continuing script execution... </pre> <br /> -<h2 style='display: inline'>set -x and set -e and pipefile</h2><br /> +<h2 style='display: inline' id='set--x-and-set--e-and-pipefile'>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'>-x</h3><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 /> @@ -332,7 +350,7 @@ Second line: for Great Good ❯ </pre> <br /> -<h3 style='display: inline'>-e</h3><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 /> @@ -451,7 +469,7 @@ Hello You! <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'>pipefail</h3><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 /> @@ -491,20 +509,21 @@ PAUL:X:1000:1000:PAUL BUETOW:/HOME/PAUL:/BIN/BASH 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='./2023-12-10-bash-golf-part-3.html'>2023-12-10 Bash Golf Part 3</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 /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2022-01-23-welcome-to-the-foo.zone.html b/gemfeed/2022-01-23-welcome-to-the-foo.zone.html index 68fc4bef..49cf3df2 100644 --- a/gemfeed/2022-01-23-welcome-to-the-foo.zone.html +++ b/gemfeed/2022-01-23-welcome-to-the-foo.zone.html @@ -8,7 +8,10 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Welcome to the foo.zone</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2022-01-23-welcome-to-the-foo.zone.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2022-01-23-welcome-to-the-foo.zone.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='welcome-to-the-foozone'>Welcome to the foo.zone</h1><br /> <br /> <span class='quote'>Published at 2022-01-23T16:42:04+00:00</span><br /> <br /> @@ -27,7 +30,7 @@ <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'>What is the foo zone?</h2><br /> +<h2 style='display: inline' id='what-is-the-foo-zone'>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 /> @@ -45,13 +48,13 @@ </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'>To be in the .zone and not in a .surf club</h2><br /> +<h2 style='display: inline' id='to-be-in-the-zone-and-not-in-a-surf-club'>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'>What about my old hosts</h2><br /> +<h2 style='display: inline' id='what-about-my-old-hosts'>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 /> @@ -59,9 +62,9 @@ <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2022-02-04-computer-operating-systems-i-use.html b/gemfeed/2022-02-04-computer-operating-systems-i-use.html index 43ca9acf..ea0c8332 100644 --- a/gemfeed/2022-02-04-computer-operating-systems-i-use.html +++ b/gemfeed/2022-02-04-computer-operating-systems-i-use.html @@ -8,10 +8,15 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Computer operating systems I use(d)</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2022-02-04-computer-operating-systems-i-use.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2022-02-04-computer-operating-systems-i-use.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='computer-operating-systems-i-used'>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 /> +<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 /> <pre> /( )` \ \___ / | @@ -33,9 +38,32 @@ `--{__________) \/ "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 /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline'>Fedora Linux</h2><br /> +<ul> +<li><a href='#computer-operating-systems-i-used'>Computer operating systems I use(d)</a></li> +<li>⇢ <a href='#fedora-linux'>Fedora Linux</a></li> +<li>⇢ <a href='#endeavouros'>EndeavourOS</a></li> +<li>⇢ <a href='#freebsd'>FreeBSD</a></li> +<li>⇢ <a href='#centos-7'>CentOS 7</a></li> +<li>⇢ <a href='#openbsd'>OpenBSD</a></li> +<li>⇢ <a href='#macos-proprietary'>macOS (proprietary)</a></li> +<li>⇢ <a href='#lineageos-mobile'>LineageOS (mobile)</a></li> +<li>⇢ <a href='#samsung-s-stock-android-mobile-proprietary'>Samsung's Stock Android (mobile proprietary)</a></li> +<li>⇢ <a href='#ios-mobile-proprietary'>iOS (mobile proprietary)</a></li> +<li>⇢ <a href='#other-oses'>Other OSes</a></li> +<li>⇢ ⇢ <a href='#infinytime-smartwatch'>InfinyTime (smartwatch)</a></li> +<li>⇢ ⇢ <a href='#motioneyeos'>motionEyeOS</a></li> +<li>⇢ ⇢ <a href='#kobo-os-proprietary'>Kobo OS (proprietary)</a></li> +<li>⇢ ⇢ <a href='#android-tv-proprietary'>Android TV (proprietary)</a></li> +<li>⇢ <a href='#other-oses'>Other OSes..</a></li> +<li>⇢ ⇢ <a href='#netbsd'>NetBSD</a></li> +<li>⇢ ⇢ <a href='#other-oses-in-use'>Other OSes in use...</a></li> +<li>⇢ ⇢ <a href='#other-oses-not-used-any-more'>Other OSes not used any more...</a></li> +<li>⇢ ⇢ <a href='#other-oses-i-only-had-a-glance-at'>Other OSes I only had a glance at...</a></li> +<li>⇢ ⇢ <a href='#other-oses-which-seem-interesting'>Other OSes which seem interesting...</a></li> +</ul><br /> +<h2 style='display: inline' id='fedora-linux'>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 /> @@ -43,7 +71,7 @@ <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'>EndeavourOS</h2><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 /> @@ -59,7 +87,7 @@ <br /> <a class='textlink' href='https://endeavouros.com/'>https://endeavouros.com/</a><br /> <br /> -<h2 style='display: inline'>FreeBSD</h2><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 /> @@ -92,7 +120,7 @@ GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 2 <br /> <a class='textlink' href='https://www.FreeBSD.org'>https://www.FreeBSD.org</a><br /> <br /> -<h2 style='display: inline'>CentOS 7</h2><br /> +<h2 style='display: inline' id='centos-7'>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 /> @@ -105,7 +133,7 @@ GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 2 <br /> <a class='textlink' href='https://www.centos.org'>https://www.centos.org</a><br /> <br /> -<h2 style='display: inline'>OpenBSD</h2><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 /> @@ -122,7 +150,7 @@ GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 2 <br /> <a class='textlink' href='https://www.openbsd.org'>https://www.openbsd.org</a><br /> <br /> -<h2 style='display: inline'>macOS (proprietary)</h2><br /> +<h2 style='display: inline' id='macos-proprietary'>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 /> @@ -130,7 +158,7 @@ GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 2 <br /> <span>I find the macOS UI rather confusing.</span><br /> <br /> -<h2 style='display: inline'>LineageOS (mobile)</h2><br /> +<h2 style='display: inline' id='lineageos-mobile'>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 /> @@ -143,33 +171,33 @@ GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 2 <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'>Samsung's Stock Android (mobile proprietary)</h2><br /> +<h2 style='display: inline' id='samsung-s-stock-android-mobile-proprietary'>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'>iOS (mobile proprietary)</h2><br /> +<h2 style='display: inline' id='ios-mobile-proprietary'>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'>Other OSes</h2><br /> +<h2 style='display: inline' id='other-oses'>Other OSes</h2><br /> <br /> -<h3 style='display: inline'>InfinyTime (smartwatch)</h3><br /> +<h3 style='display: inline' id='infinytime-smartwatch'>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'>motionEyeOS</h3><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'>Kobo OS (proprietary)</h3><br /> +<h3 style='display: inline' id='kobo-os-proprietary'>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 /> @@ -178,28 +206,28 @@ GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 2 <br /> <span>But as a fall-back, someone could still use the good old dead tree format!</span><br /> <br /> -<h3 style='display: inline'>Android TV (proprietary)</h3><br /> +<h3 style='display: inline' id='android-tv-proprietary'>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'>Other OSes..</h2><br /> +<h2 style='display: inline' id='other-oses'>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'>NetBSD</h3><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'>Other OSes in use...</h3><br /> +<h3 style='display: inline' id='other-oses-in-use'>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'>Other OSes not used any more...</h3><br /> +<h3 style='display: inline' id='other-oses-not-used-any-more'>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 /> @@ -213,7 +241,7 @@ GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 2 <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'>Other OSes I only had a glance at...</h3><br /> +<h3 style='display: inline' id='other-oses-i-only-had-a-glance-at'>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 /> @@ -231,7 +259,7 @@ GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 2 <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'>Other OSes which seem interesting...</h3><br /> +<h3 style='display: inline' id='other-oses-which-seem-interesting'>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 /> @@ -241,9 +269,9 @@ GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 2 <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.html b/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.html index d90636b2..622470f8 100644 --- a/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.html +++ b/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.html @@ -8,10 +8,17 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>The release of DTail 4.0.0</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='the-release-of-dtail-400'>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 /> +<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 /> <pre> ,_---~~~~~----._ _,,_,*^____ _____``*g*\"*, @@ -26,13 +33,27 @@ | | </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 /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline'>So, what's new in 4.0.0?</h2><br /> +<ul> +<li><a href='#the-release-of-dtail-400'>The release of DTail 4.0.0</a></li> +<li>⇢ <a href='#so-what-s-new-in-400'>So, what's new in 4.0.0?</a></li> +<li>⇢ ⇢ <a href='#rewritten-logging'>Rewritten logging</a></li> +<li>⇢ ⇢ <a href='#configurable-terminal-color-codes'>Configurable terminal color codes</a></li> +<li>⇢ ⇢ <a href='#serverless-mode'>Serverless mode</a></li> +<li>⇢ ⇢ <a href='#shorthand-flags'>Shorthand flags</a></li> +<li>⇢ ⇢ <a href='#spartan-aka-plain-mode'>Spartan (aka plain) mode</a></li> +<li>⇢ ⇢ <a href='#standard-input-pipe'>Standard input pipe</a></li> +<li>⇢ ⇢ <a href='#new-command-dtailhealth'>New command dtailhealth</a></li> +<li>⇢ ⇢ <a href='#improved-documentation'>Improved documentation</a></li> +<li>⇢ ⇢ <a href='#integration-testing-suite'>Integration testing suite</a></li> +<li>⇢ ⇢ <a href='#improved-code'>Improved code</a></li> +<li>⇢ ⇢ <a href='#use-of-memory-pools'>Use of memory pools</a></li> +<li>⇢ <a href='#what-s-next'>What's next</a></li> +</ul><br /> +<h2 style='display: inline' id='so-what-s-new-in-400'>So, what's new in 4.0.0?</h2><br /> <br /> -<h3 style='display: inline'>Rewritten logging</h3><br /> +<h3 style='display: inline' id='rewritten-logging'>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 /> @@ -59,7 +80,7 @@ const ( <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'>Configurable terminal color codes</h3><br /> +<h3 style='display: inline' id='configurable-terminal-color-codes'>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 /> @@ -175,7 +196,7 @@ const ( jsonschema -i dtail.json schemas/dtail.schema.json </pre> <br /> -<h3 style='display: inline'>Serverless mode</h3><br /> +<h3 style='display: inline' id='serverless-mode'>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 /> @@ -191,7 +212,7 @@ jsonschema -i dtail.json schemas/dtail.schema.json <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'>Shorthand flags</h3><br /> +<h3 style='display: inline' id='shorthand-flags'>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 /> @@ -201,7 +222,7 @@ jsonschema -i dtail.json schemas/dtail.schema.json <br /> <span>Of course, this also works with all other DTail client commands (dgrep, dcat, ... etc).</span><br /> <br /> -<h3 style='display: inline'>Spartan (aka plain) mode</h3><br /> +<h3 style='display: inline' id='spartan-aka-plain-mode'>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 /> @@ -212,7 +233,7 @@ jsonschema -i dtail.json schemas/dtail.schema.json <br /> <span>This might be useful if you wanted to post-process the output. </span><br /> <br /> -<h3 style='display: inline'>Standard input pipe</h3><br /> +<h3 style='display: inline' id='standard-input-pipe'>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 /> @@ -227,7 +248,7 @@ jsonschema -i dtail.json schemas/dtail.schema.json % awk '.....' < /some/file | dtail .... </pre> <br /> -<h3 style='display: inline'>New command dtailhealth</h3><br /> +<h3 style='display: inline' id='new-command-dtailhealth'>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 /> @@ -238,7 +259,7 @@ jsonschema -i dtail.json schemas/dtail.schema.json exec /usr/local/bin/dtailhealth --server localhost:2222 </pre> <br /> -<h3 style='display: inline'>Improved documentation</h3><br /> +<h3 style='display: inline' id='improved-documentation'>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 /> @@ -252,7 +273,7 @@ exec /usr/local/bin/dtailhealth --server localhost:2222 </ul><br /> <span>That will be added in one of the future releases. </span><br /> <br /> -<h3 style='display: inline'>Integration testing suite</h3><br /> +<h3 style='display: inline' id='integration-testing-suite'>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 /> @@ -273,7 +294,7 @@ exec /usr/local/bin/dtailhealth --server localhost:2222 % go test -race -v ./integrationtests </pre> <br /> -<h3 style='display: inline'>Improved code</h3><br /> +<h3 style='display: inline' id='improved-code'>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 /> @@ -283,11 +304,11 @@ exec /usr/local/bin/dtailhealth --server localhost:2222 </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'>Use of memory pools</h3><br /> +<h3 style='display: inline' id='use-of-memory-pools'>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'>What's next</h2><br /> +<h2 style='display: inline' id='what-s-next'>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 /> @@ -300,24 +321,24 @@ exec /usr/local/bin/dtailhealth --server localhost:2222 <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 /> +<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 (You are currently reading this)</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>Thanks!</span><br /> <br /> <span>Paul</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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2022-04-10-creative-universe.html b/gemfeed/2022-04-10-creative-universe.html index c0b51e09..df7d8711 100644 --- a/gemfeed/2022-04-10-creative-universe.html +++ b/gemfeed/2022-04-10-creative-universe.html @@ -8,10 +8,30 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Creative universe</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2022-04-10-creative-universe.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2022-04-10-creative-universe.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='creative-universe'>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 /> +<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 /> <pre> . + . . . . . . . . . * @@ -33,36 +53,31 @@ - the universe </pre> <br /> -<h2 style='display: inline'>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 /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><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> +<li><a href='#creative-universe'>Creative universe</a></li> +<li>⇢ <a href='#how-to-be-creative'>How to be creative</a></li> +<li>⇢ ⇢ <a href='#know-which-problem-you-want-to-solve'>Know which problem you want to solve</a></li> +<li>⇢ ⇢ <a href='#immerse--deep-dive'>Immerse / deep dive</a></li> +<li>⇢ ⇢ <a href='#always-have-a-notebook-with-you'>Always have a notebook with you</a></li> +<li>⇢ ⇢ <a href='#when-you-didn-t-sleep-enough'>When you didn't sleep enough</a></li> +<li>⇢ ⇢ <a href='#have-regular-breaks-and-relax'>Have regular breaks and relax</a></li> +<li>⇢ ⇢ <a href='#upside-down-approach'>Upside-down approach</a></li> +<li>⇢ ⇢ <a href='#don-t-be-busy-all-the-time'>Don't be busy all the time</a></li> +<li>⇢ <a href='#conclusion'>Conclusion</a></li> </ul><br /> -<h2 style='display: inline'>How to be creative</h2><br /> +<h2 style='display: inline' id='how-to-be-creative'>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'>Know which problem you want to solve</h3><br /> +<h3 style='display: inline' id='know-which-problem-you-want-to-solve'>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'>Immerse / deep dive</h3><br /> +<h3 style='display: inline' id='immerse--deep-dive'>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 /> @@ -72,7 +87,7 @@ <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'>Always have a notebook with you</h3><br /> +<h3 style='display: inline' id='always-have-a-notebook-with-you'>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 /> @@ -80,23 +95,23 @@ <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'>When you didn't sleep enough</h3><br /> +<h3 style='display: inline' id='when-you-didn-t-sleep-enough'>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'>Have regular breaks and relax</h3><br /> +<h3 style='display: inline' id='have-regular-breaks-and-relax'>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 /> +<a class='textlink' href='../about/novels.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'>Upside-down approach</h3><br /> +<h3 style='display: inline' id='upside-down-approach'>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 /> @@ -110,7 +125,7 @@ <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'>Don't be busy all the time</h3><br /> +<h3 style='display: inline' id='don-t-be-busy-all-the-time'>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 /> @@ -130,7 +145,7 @@ learn () { timedatectl - Control the system time and date </pre> <br /> -<h2 style='display: inline'>Conclusion</h2><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 /> @@ -153,9 +168,9 @@ learn () { <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2022-05-27-perl-is-still-a-great-choice.html b/gemfeed/2022-05-27-perl-is-still-a-great-choice.html index 803a3d7d..8c53c83f 100644 --- a/gemfeed/2022-05-27-perl-is-still-a-great-choice.html +++ b/gemfeed/2022-05-27-perl-is-still-a-great-choice.html @@ -8,17 +8,18 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Perl is still a great choice</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2022-05-27-perl-is-still-a-great-choice.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2022-05-27-perl-is-still-a-great-choice.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='perl-is-still-a-great-choice'>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='./2022-05-27-perl-is-still-a-great-choice/regular_expressions.png'><img alt='Comic source: XKCD' title='Comic source: XKCD' src='./2022-05-27-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='./2022-05-27-perl-is-still-a-great-choice/googletrendsperl.jpg'><img src='./2022-05-27-perl-is-still-a-great-choice/googletrendsperl.jpg' /></a><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 /> @@ -28,7 +29,19 @@ <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'>Write-only language</h2><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 /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#perl-is-still-a-great-choice'>Perl is still a great choice</a></li> +<li>⇢ <a href='#write-only-language'>Write-only language</a></li> +<li>⇢ <a href='#is-perl-abandoned'>Is Perl abandoned?</a></li> +<li>⇢ <a href='#why-use-perl-as-there-are-better-alternatives'>Why use Perl as there are better alternatives?</a></li> +<li>⇢ <a href='#why-all-the-sigils-it-looks-like-an-exploding-ascii-factory'>Why all the sigils? It looks like an exploding ASCII factory!!</a></li> +<li>⇢ <a href='#where-do-i-personally-still-use-perl'>Where do I personally still use perl?</a></li> +</ul><br /> +<h2 style='display: inline' id='write-only-language'>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 /> @@ -54,7 +67,7 @@ <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'>Is Perl abandoned?</h2><br /> +<h2 style='display: inline' id='is-perl-abandoned'>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 /> @@ -95,7 +108,7 @@ <br /> <a class='textlink' href='https://www.leanpub.com/perl_new_features'>Perl New Features</a><br /> <br /> -<h2 style='display: inline'>Why use Perl as there are better alternatives?</h2><br /> +<h2 style='display: inline' id='why-use-perl-as-there-are-better-alternatives'>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 /> @@ -124,7 +137,7 @@ </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'>Why all the sigils? It looks like an exploding ASCII factory!!</h2><br /> +<h2 style='display: inline' id='why-all-the-sigils-it-looks-like-an-exploding-ascii-factory'>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 /> @@ -132,7 +145,7 @@ <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'>Where do I personally still use perl?</h2><br /> +<h2 style='display: inline' id='where-do-i-personally-still-use-perl'>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> @@ -149,20 +162,20 @@ <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 /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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='./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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2022-06-15-sweating-the-small-stuff.html b/gemfeed/2022-06-15-sweating-the-small-stuff.html index 5efa9408..61a2ba31 100644 --- a/gemfeed/2022-06-15-sweating-the-small-stuff.html +++ b/gemfeed/2022-06-15-sweating-the-small-stuff.html @@ -8,18 +8,13 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Sweating the small stuff - Tiny projects of mine</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2022-06-15-sweating-the-small-stuff.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2022-06-15-sweating-the-small-stuff.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='sweating-the-small-stuff---tiny-projects-of-mine'>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 /> @@ -29,7 +24,41 @@ <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'><span class='inlinecode'>1y</span> anniversary</h2><br /> +<pre> + _ + /_/_ .'''. + =O(_)))) ...' `. + jgs \_\ `. .''' + `..' +</pre> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#sweating-the-small-stuff---tiny-projects-of-mine'>Sweating the small stuff - Tiny projects of mine</a></li> +<li>⇢ <a href='#1y-anniversary'><span class='inlinecode'>1y</span> anniversary</a></li> +<li>⇢ <a href='#static-photo-album-generator'>Static photo album generator</a></li> +<li>⇢ ⇢ <a href='#the-irregular-ninja'>The Irregular Ninja</a></li> +<li>⇢ <a href='#random-journal-page-extractor'>Random journal page extractor</a></li> +<li>⇢ <a href='#global-uptime-records-statistic-generator'>Global uptime records statistic generator</a></li> +<li>⇢ <a href='#server-configuration-management'>Server configuration management</a></li> +<li>⇢ <a href='#fancy-ssh-execution-loop'>Fancy SSH execution loop</a></li> +<li>⇢ <a href='#a-kiss-dynamic-dns-solution'>A KISS dynamic DNS solution</a></li> +<li>⇢ <a href='#cpu-information-gatherer-for-linux'>CPU information gatherer for Linux</a></li> +<li>⇢ <a href='#show-differences-of-two-files-over-the-network'>Show differences of two files over the network</a></li> +<li>⇢ <a href='#delay-sending-out-e-mails-with-mutt'>Delay sending out E-Mails with Mutt</a></li> +<li>⇢ <a href='#graphical-ui-for-sending-text-messages'>Graphical UI for sending text messages</a></li> +<li>⇢ <a href='#ipv6-and-ipv4-connectivity-testing-site'>IPv6 and IPv4 connectivity testing site</a></li> +<li>⇢ <a href='#list-open-jira-tickets-in-the-terminal'>List open Jira tickets in the terminal</a></li> +<li>⇢ <a href='#debian-running-on-your-android-phone'>Debian running on "your" Android phone</a></li> +<li>⇢ <a href='#perl-service-framework'>Perl service framework</a></li> +<li>⇢ <a href='#more'>More</a></li> +<li>⇢ ⇢ <a href='#work-time-tracker'>Work time tracker</a></li> +<li>⇢ ⇢ <a href='#password-and-document-store'>Password and document store</a></li> +<li>⇢ ⇢ <a href='#backup-procedure'>Backup procedure</a></li> +<li>⇢ <a href='#konpeitomedia'>konpeito.media</a></li> +</ul><br /> +<h2 style='display: inline' id='1y-anniversary'><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 /> @@ -48,17 +77,17 @@ <br /> <span>But now, let's continue with the small projects worth mentioning :-)</span><br /> <br /> -<h2 style='display: inline'>Static photo album generator</h2><br /> +<h2 style='display: inline' id='static-photo-album-generator'>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'>The Irregular Ninja</h3><br /> +<h3 style='display: inline' id='the-irregular-ninja'>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='./2022-06-15-sweating-the-small-stuff/ninja.jpg'><img src='./2022-06-15-sweating-the-small-stuff/ninja.jpg' /></a><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 /> @@ -72,7 +101,7 @@ <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'>Random journal page extractor</h2><br /> +<h2 style='display: inline' id='random-journal-page-extractor'>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 /> @@ -82,7 +111,7 @@ <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'>Global uptime records statistic generator</h2><br /> +<h2 style='display: inline' id='global-uptime-records-statistic-generator'>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 /> @@ -142,7 +171,7 @@ Pos | System | Kernel | Uptime | <br /> <span>This all is of no real practical use but fun!</span><br /> <br /> -<h2 style='display: inline'>Server configuration management</h2><br /> +<h2 style='display: inline' id='server-configuration-management'>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 /> @@ -153,7 +182,7 @@ Pos | System | Kernel | Uptime | <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'>Fancy SSH execution loop</h2><br /> +<h2 style='display: inline' id='fancy-ssh-execution-loop'>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 /> @@ -178,7 +207,7 @@ echo foo.example.com | <br /> <a class='textlink' href='https://codeberg.org/snonux/rubyfy'>https://codeberg.org/snonux/rubyfy</a><br /> <br /> -<h2 style='display: inline'>A KISS dynamic DNS solution</h2><br /> +<h2 style='display: inline' id='a-kiss-dynamic-dns-solution'>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 /> @@ -198,7 +227,7 @@ ssh dyndns@dyndnsserver /path/to/dyndns-update \ <br /> <a class='textlink' href='https://codeberg.org/snonux/dyndns'>https://codeberg.org/snonux/dyndns</a><br /> <br /> -<h2 style='display: inline'>CPU information gatherer for Linux</h2><br /> +<h2 style='display: inline' id='cpu-information-gatherer-for-linux'>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 /> @@ -222,7 +251,7 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <br /> <a class='textlink' href='https://codeberg.org/snonux/cpuinfo'>https://codeberg.org/snonux/cpuinfo</a><br /> <br /> -<h2 style='display: inline'>Show differences of two files over the network</h2><br /> +<h2 style='display: inline' id='show-differences-of-two-files-over-the-network'>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 /> @@ -230,34 +259,34 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <br /> <a class='textlink' href='https://codeberg.org/snonux/netdiff'>https://codeberg.org/snonux/netdiff</a><br /> <br /> -<h2 style='display: inline'>Delay sending out E-Mails with Mutt</h2><br /> +<h2 style='display: inline' id='delay-sending-out-e-mails-with-mutt'>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'>Graphical UI for sending text messages</h2><br /> +<h2 style='display: inline' id='graphical-ui-for-sending-text-messages'>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='./2022-06-15-sweating-the-small-stuff/jsmstrade.png'><img src='./2022-06-15-sweating-the-small-stuff/jsmstrade.png' /></a><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'>IPv6 and IPv4 connectivity testing site</h2><br /> +<h2 style='display: inline' id='ipv6-and-ipv4-connectivity-testing-site'>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'>List open Jira tickets in the terminal</h2><br /> +<h2 style='display: inline' id='list-open-jira-tickets-in-the-terminal'>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'>Debian running on "your" Android phone</h2><br /> +<h2 style='display: inline' id='debian-running-on-your-android-phone'>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 /> @@ -267,17 +296,17 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <br /> <a class='textlink' href='https://termux.com'>https://termux.com</a><br /> <br /> -<h2 style='display: inline'>Perl service framework</h2><br /> +<h2 style='display: inline' id='perl-service-framework'>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'>More</h2><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'>Work time tracker</h3><br /> +<h3 style='display: inline' id='work-time-tracker'>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 /> @@ -299,19 +328,19 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <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'>Password and document store</h3><br /> +<h3 style='display: inline' id='password-and-document-store'>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'>Backup procedure</h3><br /> +<h3 style='display: inline' id='backup-procedure'>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'>konpeito.media</h2><br /> +<h2 style='display: inline' id='konpeitomedia'>konpeito.media</h2><br /> <br /> <span>Here's a bonus...</span><br /> <br /> @@ -338,9 +367,9 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.html b/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.html index fba01a4c..7ad59bf4 100644 --- a/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.html +++ b/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.html @@ -8,10 +8,15 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Let's Encrypt with OpenBSD and Rex</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='let-s-encrypt-with-openbsd-and-rex'>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 /> +<span>I was amazed at how easy it is to automatically generate and update Let's Encrypt certificates with OpenBSD.</span><br /> +<br /> <pre> / _ \ The Hebern Machine \ ." ". / @@ -39,9 +44,24 @@ 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 /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline'>What's Let's Encrypt?</h2><br /> +<ul> +<li><a href='#let-s-encrypt-with-openbsd-and-rex'>Let's Encrypt with OpenBSD and Rex</a></li> +<li>⇢ ⇢ <a href='#what-s-let-s-encrypt'>What's Let's Encrypt?</a></li> +<li>⇢ <a href='#meet-acme-client'>Meet <span class='inlinecode'>acme-client</span></a></li> +<li>⇢ <a href='#configuration'>Configuration</a></li> +<li>⇢ ⇢ <a href='#acme-clientconf'>acme-client.conf</a></li> +<li>⇢ ⇢ <a href='#httpdconf'>httpd.conf</a></li> +<li>⇢ ⇢ <a href='#cron-job'>CRON job</a></li> +<li>⇢ <a href='#relaydconf-and-smtpdconf'>relayd.conf and smtpd.conf</a></li> +<li>⇢ <a href='#rexification'>Rexification</a></li> +<li>⇢ ⇢ <a href='#general-acme-client-configuration'>General ACME client configuration</a></li> +<li>⇢ ⇢ <a href='#service-rexification-'>Service rexification </a></li> +<li>⇢ <a href='#all-pieces-together'>All pieces together</a></li> +<li>⇢ <a href='#conclusion'>Conclusion</a></li> +</ul><br /> +<h3 style='display: inline' id='what-s-let-s-encrypt'>What's Let's Encrypt?</h3><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 /> @@ -49,7 +69,7 @@ <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'>Meet <span class='inlinecode'>acme-client</span></h2><br /> +<h2 style='display: inline' id='meet-acme-client'>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 /> @@ -69,11 +89,11 @@ <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'>Configuration</h2><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'>acme-client.conf</h3><br /> +<h3 style='display: inline' id='acme-clientconf'>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 /> @@ -139,7 +159,7 @@ domain snonux.land { } </pre> <br /> -<h3 style='display: inline'>httpd.conf</h3><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 /> @@ -172,7 +192,7 @@ server "foo.zone" { <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'>CRON job</h3><br /> +<h3 style='display: inline' id='cron-job'>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 /> @@ -250,11 +270,11 @@ acme-client: /etc/ssl/irregular.ninja.fullchain.pem: certificate valid: 80 days acme-client: /etc/ssl/snonux.land.fullchain.pem: certificate valid: 79 days left </pre> <br /> -<h2 style='display: inline'>relayd.conf and smtpd.conf</h2><br /> +<h2 style='display: inline' id='relaydconf-and-smtpdconf'>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'>Rexification</h2><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 /> @@ -266,7 +286,7 @@ acme-client: /etc/ssl/snonux.land.fullchain.pem: certificate valid: 79 days left 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'>General ACME client configuration</h3><br /> +<h3 style='display: inline' id='general-acme-client-configuration'>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 /> @@ -418,7 +438,7 @@ if [ $has_update = yes ]; then fi </pre> <br /> -<h3 style='display: inline'>Service rexification </h3><br /> +<h3 style='display: inline' id='service-rexification-'>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 /> @@ -646,7 +666,7 @@ match from local for local action localmail match from local for any action outbound </pre> <br /> -<h2 style='display: inline'>All pieces together</h2><br /> +<h2 style='display: inline' id='all-pieces-together'>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 /> @@ -660,7 +680,7 @@ rex commons <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'>Conclusion</h2><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 /> @@ -670,11 +690,22 @@ rex commons <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='./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</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 (You are currently reading this)</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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html b/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html index 1c210bfb..31193d7b 100644 --- a/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html +++ b/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html @@ -8,10 +8,19 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Gemtexter 1.1.0 - Let's Gemtext again</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='gemtexter-110---let-s-gemtext-again'>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 /> +<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 /> <pre> -=[ typewriter ]=- 1/98 @@ -24,15 +33,23 @@ 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 /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline'>What's new?</h2><br /> +<ul> +<li><a href='#gemtexter-110---let-s-gemtext-again'>Gemtexter 1.1.0 - Let's Gemtext again</a></li> +<li>⇢ <a href='#what-s-new'>What's new?</a></li> +<li>⇢ ⇢ <a href='#automatic-check-for-gnu-version-requirements'>Automatic check for GNU version requirements</a></li> +<li>⇢ ⇢ <a href='#backticks-now-produce-inline-code-blocks-in-the-html-output'>Backticks now produce <span class='inlinecode'>inline code blocks</span> in the HTML output</a></li> +<li>⇢ ⇢ <a href='#cache-for-atom-feed-generation'>Cache for Atom feed generation</a></li> +<li>⇢ ⇢ <a href='#input-filter-support'>Input filter support</a></li> +<li>⇢ ⇢ <a href='#revamped-git-support'>Revamped <span class='inlinecode'>git</span> support</a></li> +<li>⇢ ⇢ <a href='#addition-of-htmlextras-and-web-font-support'>Addition of <span class='inlinecode'>htmlextras</span> and web font support</a></li> +<li>⇢ ⇢ <a href='#sub-section-support'>Sub-section support</a></li> +<li>⇢ ⇢ <a href='#more'>More</a></li> +</ul><br /> +<h2 style='display: inline' id='what-s-new'>What's new?</h2><br /> <br /> -<h3 style='display: inline'>Automatic check for GNU version requirements</h3><br /> +<h3 style='display: inline' id='automatic-check-for-gnu-version-requirements'>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 /> @@ -40,36 +57,36 @@ by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#000000">check_dependencies ()</font></b> { - <i><font color="#9A1900"># At least, Bash 5 is required</font></i> - <b><font color="#0000FF">local</font></b> -i <font color="#009900">required_version</font><font color="#990000">=</font><font color="#993399">5</font> - <font color="#009900">IFS</font><font color="#990000">=.</font> <b><font color="#0000FF">read</font></b> -ra version <font color="#990000"><<<</font> <font color="#FF0000">"$BASH_VERSION"</font> - <b><font color="#0000FF">if</font></b> <font color="#990000">[</font> <font color="#FF0000">"${version[0]}"</font> -lt <font color="#009900">$required_version</font> <font color="#990000">];</font> <b><font color="#0000FF">then</font></b> - log ERROR <font color="#FF0000">"ERROR, </font><font color="#CC33CC">\"</font><font color="#FF0000">bash</font><font color="#CC33CC">\"</font><font color="#FF0000"> must be at least at major version $required_version!"</font> - <b><font color="#0000FF">exit</font></b> <font color="#993399">2</font> - <b><font color="#0000FF">fi</font></b> +<pre>check_dependencies () { + <i><font color="silver"># At least, Bash 5 is required</font></i> + <b><u><font color="#000000">local</font></u></b> -i required_version=<font color="#000000">5</font> + IFS=. <b><u><font color="#000000">read</font></u></b> -ra version <<< <font color="#808080">"$BASH_VERSION"</font> + <b><u><font color="#000000">if</font></u></b> [ <font color="#808080">"${version[0]}"</font> -lt $required_version ]; <b><u><font color="#000000">then</font></u></b> + log ERROR <font color="#808080">"ERROR, </font>\"<font color="#808080">bash</font>\"<font color="#808080"> must be at least at major version $required_version!"</font> + <b><u><font color="#000000">exit</font></u></b> <font color="#000000">2</font> + <b><u><font color="#000000">fi</font></u></b> - <i><font color="#9A1900"># These must be the GNU versions of the commands</font></i> - <b><font color="#0000FF">for</font></b> tool <b><font color="#0000FF">in</font></b> <font color="#009900">$DATE</font> <font color="#009900">$SED</font> <font color="#009900">$GREP</font><font color="#990000">;</font> <b><font color="#0000FF">do</font></b> - <b><font color="#0000FF">if</font></b> <font color="#990000">!</font> <font color="#009900">$tool</font> --version <font color="#990000">|</font> grep -q GNU<font color="#990000">;</font> <b><font color="#0000FF">then</font></b> - log ERROR <font color="#FF0000">"ERROR, </font><font color="#CC33CC">\"</font><font color="#FF0000">$tool</font><font color="#CC33CC">\"</font><font color="#FF0000"> command is not the GNU version, please install!"</font> - <b><font color="#0000FF">exit</font></b> <font color="#993399">2</font> - <b><font color="#0000FF">fi</font></b> - <b><font color="#0000FF">done</font></b> + <i><font color="silver"># These must be the GNU versions of the commands</font></i> + <b><u><font color="#000000">for</font></u></b> tool <b><u><font color="#000000">in</font></u></b> $DATE $SED $GREP; <b><u><font color="#000000">do</font></u></b> + <b><u><font color="#000000">if</font></u></b> ! $tool --version | grep -q GNU; <b><u><font color="#000000">then</font></u></b> + log ERROR <font color="#808080">"ERROR, </font>\"<font color="#808080">$tool</font>\"<font color="#808080"> command is not the GNU version, please install!"</font> + <b><u><font color="#000000">exit</font></u></b> <font color="#000000">2</font> + <b><u><font color="#000000">fi</font></u></b> + <b><u><font color="#000000">done</font></u></b> } </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'>Backticks now produce <span class='inlinecode'>inline code blocks</span> in the HTML output</h3><br /> +<h3 style='display: inline' id='backticks-now-produce-inline-code-blocks-in-the-html-output'>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'>Cache for Atom feed generation</h3><br /> +<h3 style='display: inline' id='cache-for-atom-feed-generation'>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'>Input filter support</h3><br /> +<h3 style='display: inline' id='input-filter-support'>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 /> @@ -77,45 +94,46 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#990000">.</font>/gemtexter --generate <font color="#FF0000">'.*hello.*'</font> +<pre>./gemtexter --generate <font color="#808080">'.*hello.*'</font> </pre> <br /> -<h3 style='display: inline'>Revamped <span class='inlinecode'>git</span> support</h3><br /> +<h3 style='display: inline' id='revamped-git-support'>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'>Addition of <span class='inlinecode'>htmlextras</span> and web font support</h3><br /> +<h3 style='display: inline' id='addition-of-htmlextras-and-web-font-support'>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'>Sub-section support</h3><br /> +<h3 style='display: inline' id='sub-section-support'>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'>More</h3><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='./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 /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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 (You are currently reading this)</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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2022-09-30-after-a-bad-nights-sleep.html b/gemfeed/2022-09-30-after-a-bad-nights-sleep.html index f552a6f2..4d4e9cb5 100644 --- a/gemfeed/2022-09-30-after-a-bad-nights-sleep.html +++ b/gemfeed/2022-09-30-after-a-bad-nights-sleep.html @@ -8,10 +8,15 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>After a bad night's sleep</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2022-09-30-after-a-bad-nights-sleep.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2022-09-30-after-a-bad-nights-sleep.gmi">Gemini</a> +</p> +<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 @@ -26,17 +31,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'>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'>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'>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 /> @@ -50,57 +73,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'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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 /> @@ -108,9 +131,9 @@ jgs (________\ \ <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2022-10-30-installing-dtail-on-openbsd.html b/gemfeed/2022-10-30-installing-dtail-on-openbsd.html index 0f103cc4..eeb45812 100644 --- a/gemfeed/2022-10-30-installing-dtail-on-openbsd.html +++ b/gemfeed/2022-10-30-installing-dtail-on-openbsd.html @@ -8,10 +8,25 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Installing DTail on OpenBSD</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2022-10-30-installing-dtail-on-openbsd.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2022-10-30-installing-dtail-on-openbsd.gmi">Gemini</a> +</p> +<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*\"*, @@ -49,19 +64,22 @@ ' ' </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 /> -<br /> -<h2 style='display: inline'>Compile it</h2><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<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 /> @@ -96,7 +114,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'>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 /> @@ -138,7 +156,7 @@ END $ doas chmod 755 /etc/rc.d/dserver </pre> <br /> -<h3 style='display: inline'>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 /> @@ -165,7 +183,7 @@ task 'dtail', group => 'frontends', }; </pre> <br /> -<h2 style='display: inline'>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 /> @@ -188,7 +206,7 @@ $ curl https://raw.githubusercontent.com/mimecast/dtail/master/examples/dtail.js } </pre> <br /> -<h3 style='display: inline'>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 /> @@ -204,7 +222,7 @@ file '/etc/dserver/dtail.json', on_change => sub { $restart = TRUE }; </pre> <br /> -<h2 style='display: inline'>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 /> @@ -257,7 +275,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'>Rexification</h3><br /> +<h3 style='display: inline' id='rexification'>Rexification</h3><br /> <br /> <span>That's done by adding ...</span><br /> <br /> @@ -273,7 +291,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'>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 /> @@ -313,7 +331,7 @@ Caching /home/rex/.ssh/authorized_keys -> /var/cache/dserver/rex.authorized_k All set... </pre> <br /> -<h2 style='display: inline'>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 /> @@ -339,7 +357,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'>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 /> @@ -349,20 +367,20 @@ REMOTE|fishfinger|100|7|fstab|093f510ec5c0f512.h /usr/local ffs rw,wxallowed,nod <a class='textlink' href='https://github.com/mimecast/dtail'>https://github.com/mimecast/dtail</a><br /> <a class='textlink' href='https://www.rexify.org'>https://www.rexify.org</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='./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 /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.html b/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.html index d1759547..b5aaa3d9 100644 --- a/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.html +++ b/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.html @@ -8,10 +8,25 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>I tried (Doom) Emacs, but I switched back to (Neo)Vim</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.gmi">Gemini</a> +</p> +<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 @@ -25,25 +40,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 /> -<br /> -<span>So why did I switch back to the Vi-family?</span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline'>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'>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 /> @@ -52,13 +67,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'>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'>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 /> @@ -79,15 +94,15 @@ Art by \ \_! / __! by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#9A1900">" Clipboard</font></i> -vnoremap ,<b><font color="#0000FF">y</font></b> !pbcopy<font color="#FF6600"><CR></font>ugv -vnoremap ,<b><font color="#0000FF">i</font></b> !pbpaste<font color="#FF6600"><CR></font> -nmap ,<b><font color="#0000FF">i</font></b> !wpbpaste<font color="#FF6600"><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'>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 /> @@ -107,13 +122,13 @@ nmap ,<b><font color="#0000FF">i</font></b> !wpbpaste<font color="#FF6600"><C <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'>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'>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 /> @@ -127,9 +142,9 @@ nmap ,<b><font color="#0000FF">i</font></b> !wpbpaste<font color="#FF6600"><C <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2022-12-24-ultrarelearning-java-my-takeaways.html b/gemfeed/2022-12-24-ultrarelearning-java-my-takeaways.html index e3bc3908..3c558741 100644 --- a/gemfeed/2022-12-24-ultrarelearning-java-my-takeaways.html +++ b/gemfeed/2022-12-24-ultrarelearning-java-my-takeaways.html @@ -8,12 +8,13 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>(Re)learning Java - My takeaways</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2022-12-24-ultrarelearning-java-my-takeaways.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2022-12-24-ultrarelearning-java-my-takeaways.gmi">Gemini</a> +</p> +<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='./2022-12-24-ultrarelearning-java-my-takeaways/learnjava.jpg'><img src='./2022-12-24-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 /> @@ -26,46 +27,64 @@ <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'>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'>(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'>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 /> -<a href='./2022-12-24-ultrarelearning-java-my-takeaways/effective-java.jpg'><img src='./2022-12-24-ultrarelearning-java-my-takeaways/effective-java.jpg' /></a><br /> +<a href='./ultrarelearning-java-my-takeaways/effective-java.jpg'><img src='./ultrarelearning-java-my-takeaways/effective-java.jpg' /></a><br /> <br /> <span>I recommend reading the 90-part effective Java Series on <span class='inlinecode'>dev.to</span>. 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.</span><br /> <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'>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'>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'>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'>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'>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'>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 /> @@ -86,7 +105,7 @@ <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'>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 /> @@ -100,7 +119,7 @@ <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'>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 /> @@ -118,9 +137,9 @@ <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2023-01-23-why-grapheneos-rox.html b/gemfeed/2023-01-23-why-grapheneos-rox.html index 55ad0068..18d5ee93 100644 --- a/gemfeed/2023-01-23-why-grapheneos-rox.html +++ b/gemfeed/2023-01-23-why-grapheneos-rox.html @@ -8,10 +8,26 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Why GrapheneOS rox</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2023-01-23-why-grapheneos-rox.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2023-01-23-why-grapheneos-rox.gmi">Gemini</a> +</p> +<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 _.===========================._ @@ -35,20 +51,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 /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><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 /> -<h2 style='display: inline'>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 /> @@ -58,7 +74,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'>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 /> @@ -66,7 +82,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'>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 /> @@ -84,7 +100,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'>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 /> @@ -104,7 +120,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'>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 /> @@ -112,7 +128,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'>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 /> @@ -124,7 +140,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'>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 /> @@ -139,7 +155,7 @@ Art by Joan Stark <br /> <a class='textlink' href='https://sailfishos.org'>SailfishOS</a><br /> <br /> -<h2 style='display: inline'>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 /> @@ -151,9 +167,9 @@ Art by Joan Stark <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2023-02-26-how-to-shut-down-after-work.html b/gemfeed/2023-02-26-how-to-shut-down-after-work.html index a696e0f2..3705bbf6 100644 --- a/gemfeed/2023-02-26-how-to-shut-down-after-work.html +++ b/gemfeed/2023-02-26-how-to-shut-down-after-work.html @@ -8,10 +8,15 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>How to shut down after work</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2023-02-26-how-to-shut-down-after-work.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2023-02-26-how-to-shut-down-after-work.gmi">Gemini</a> +</p> +<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." |---|--\-----------------------|-----------------------------------------| @@ -27,15 +32,25 @@ -@- [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'>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'>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 /> @@ -49,7 +64,7 @@ <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'>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 /> @@ -62,23 +77,23 @@ </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'>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'>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'>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'>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 /> @@ -88,9 +103,9 @@ <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.html b/gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.html index 1ac45d3e..deb3d4d8 100644 --- a/gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.html +++ b/gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.html @@ -8,7 +8,10 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>"The Pragmatic Programmer" book notes</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.gmi">Gemini</a> +</p> +<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 /> @@ -59,7 +62,7 @@ <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'>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 /> @@ -70,7 +73,7 @@ </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'>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 /> @@ -83,7 +86,7 @@ </ul><br /> <span>It's your life. Share it, celebrate it, be proud and have fun.</span><br /> <br /> -<h2 style='display: inline'>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 /> @@ -91,22 +94,24 @@ <br /> <span>By working together, everyone contributes what they can, achieving a greater good together.</span><br /> <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='./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='./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 /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html b/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html index c789d771..0cc81533 100644 --- a/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html +++ b/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html @@ -8,10 +8,21 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Gemtexter 2.0.0 - Let's Gemtext again²</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi">Gemini</a> +</p> +<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 @@ -25,15 +36,18 @@ 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 /> -<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 /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline'>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 /> @@ -81,7 +95,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> @@ -99,7 +113,7 @@ See more entries about DTail and Golang: Blablabla... </pre> <br /> -<h2 style='display: inline'>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 /> @@ -109,15 +123,15 @@ Blablabla... by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#0000FF">declare</font></b> -xr <font color="#009900">PRE_GENERATE_HOOK</font><font color="#990000">=.</font>/pre_generate_hook<font color="#990000">.</font>sh -<b><font color="#0000FF">declare</font></b> -xr <font color="#009900">POST_PUBLISH_HOOK</font><font color="#990000">=.</font>/post_publish_hook<font color="#990000">.</font>sh +<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'>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'>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 /> @@ -127,10 +141,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="#990000">%</font> cat gemfeed<font color="#990000">/</font><font color="#993399">2023</font>-<font color="#993399">02</font>-<font color="#993399">26</font>-title-here<font color="#990000">.</font>gmi -<i><font color="#9A1900"># 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> -The remaining content of the Gemtext file<font color="#990000">...</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 /> @@ -139,37 +153,38 @@ The remaining content of the Gemtext file<font color="#990000">...</font> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#990000">%</font> cat gemfeed<font color="#990000">/</font><font color="#993399">2023</font>-<font color="#993399">02</font>-<font color="#993399">26</font>-title-here<font color="#990000">.</font>gmi -<i><font color="#9A1900"># 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="#990000">></font> Published at <font color="#993399">2023</font>-<font color="#993399">02</font>-26T21<font color="#990000">:</font><font color="#993399">43</font><font color="#990000">:</font><font color="#993399">51</font><font color="#990000">+</font><font color="#993399">01</font><font color="#990000">:</font><font color="#993399">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> -The remaining content of the Gemtext file<font color="#990000">...</font> +The remaining content of the Gemtext file... </pre> <br /> -<h2 style='display: inline'>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'>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 /> +<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</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 /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2023-04-01-never-split-the-difference-book-notes.html b/gemfeed/2023-04-01-never-split-the-difference-book-notes.html index 8dec98ec..c8e8db3d 100644 --- a/gemfeed/2023-04-01-never-split-the-difference-book-notes.html +++ b/gemfeed/2023-04-01-never-split-the-difference-book-notes.html @@ -8,7 +8,10 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>"Never split the difference" book notes</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2023-04-01-never-split-the-difference-book-notes.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2023-04-01-never-split-the-difference-book-notes.gmi">Gemini</a> +</p> +<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 /> @@ -26,7 +29,23 @@ ''' </pre> <br /> -<h2 style='display: inline'>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 /> @@ -37,7 +56,7 @@ </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'>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 /> @@ -49,7 +68,7 @@ </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'>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> @@ -58,7 +77,7 @@ <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'>"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 /> @@ -71,11 +90,11 @@ </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'>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'>On Deadlines</h2><br /> +<h2 style='display: inline' id='on-deadlines'>On Deadlines</h2><br /> <br /> <ul> <li>All deadlines are imaginary.</li> @@ -83,7 +102,7 @@ <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'>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> @@ -93,7 +112,7 @@ </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'>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 /> @@ -101,7 +120,7 @@ <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'>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 /> @@ -117,11 +136,11 @@ </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'>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'>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 /> @@ -138,21 +157,24 @@ </ul><br /> <span>Slow.... it.... down....</span><br /> <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='./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='./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 /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2023-04-09-algorithms-and-data-structures-in-golang-part-1.html b/gemfeed/2023-04-09-algorithms-and-data-structures-in-golang-part-1.html deleted file mode 100644 index 1d6e9981..00000000 --- a/gemfeed/2023-04-09-algorithms-and-data-structures-in-golang-part-1.html +++ /dev/null @@ -1,275 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<title>Algorithms and Data Structures in Go - Part 1</title> -<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> -<link rel="stylesheet" href="../style.css" /> -<link rel="stylesheet" href="style-override.css" /> -</head> -<body> -<h1 style='display: inline'>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'>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="#0000FF">package</font></b> ds - -<b><font color="#0000FF">import</font></b> <font color="#990000">(</font> - <font color="#FF0000">"golang.org/x/exp/constraints"</font> -<font color="#990000">)</font> - -<b><font color="#0000FF">type</font></b> Integer <b><font color="#0000FF">interface</font></b> <font color="#FF0000">{</font> - constraints<font color="#990000">.</font>Integer -<font color="#FF0000">}</font> - -<b><font color="#0000FF">type</font></b> Number <b><font color="#0000FF">interface</font></b> <font color="#FF0000">{</font> - constraints<font color="#990000">.</font>Integer <font color="#990000">|</font> constraints<font color="#990000">.</font>Float -<font color="#FF0000">}</font> - -</pre> -<br /> -<h2 style='display: inline'>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="#0000FF">package</font></b> ds - -<b><font color="#0000FF">import</font></b> <font color="#990000">(</font> - <font color="#FF0000">"fmt"</font> - <font color="#FF0000">"math/rand"</font> - <font color="#FF0000">"strings"</font> -<font color="#990000">)</font> - -<b><font color="#0000FF">type</font></b> ArrayList<font color="#990000">[</font>V Number<font color="#990000">]</font> <font color="#990000">[]</font>V - -<b><font color="#0000FF">func</font></b> NewArrayList<font color="#990000">[</font>V Number<font color="#990000">](</font>l int<font color="#990000">)</font> ArrayList<font color="#990000">[</font>V<font color="#990000">]</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">return</font></b> <b><font color="#000000">make</font></b><font color="#990000">(</font>ArrayList<font color="#990000">[</font>V<font color="#990000">],</font> l<font color="#990000">)</font> -<font color="#FF0000">}</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="#0000FF">func</font></b> NewRandomArrayList<font color="#990000">[</font>V Number<font color="#990000">](</font>l<font color="#990000">,</font> max int<font color="#990000">)</font> ArrayList<font color="#990000">[</font>V<font color="#990000">]</font> <font color="#FF0000">{</font> - a <font color="#990000">:=</font> <b><font color="#000000">make</font></b><font color="#990000">(</font>ArrayList<font color="#990000">[</font>V<font color="#990000">],</font> l<font color="#990000">)</font> - <b><font color="#0000FF">for</font></b> i <font color="#990000">:=</font> <font color="#993399">0</font><font color="#990000">;</font> i <font color="#990000"><</font> l<font color="#990000">;</font> i<font color="#990000">++</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">if</font></b> max <font color="#990000">></font> <font color="#993399">0</font> <font color="#FF0000">{</font> - a<font color="#990000">[</font>i<font color="#990000">]</font> <font color="#990000">=</font> <b><font color="#000000">V</font></b><font color="#990000">(</font>rand<font color="#990000">.</font><b><font color="#000000">Intn</font></b><font color="#990000">(</font>max<font color="#990000">))</font> - <b><font color="#0000FF">continue</font></b> - <font color="#FF0000">}</font> - a<font color="#990000">[</font>i<font color="#990000">]</font> <font color="#990000">=</font> <b><font color="#000000">V</font></b><font color="#990000">(</font>rand<font color="#990000">.</font><b><font color="#000000">Int</font></b><font color="#990000">())</font> - <font color="#FF0000">}</font> - <b><font color="#0000FF">return</font></b> a -<font color="#FF0000">}</font> - -<b><font color="#0000FF">func</font></b> NewAscendingArrayList<font color="#990000">[</font>V Number<font color="#990000">](</font>l int<font color="#990000">)</font> ArrayList<font color="#990000">[</font>V<font color="#990000">]</font> <font color="#FF0000">{</font> - a <font color="#990000">:=</font> <b><font color="#000000">make</font></b><font color="#990000">(</font>ArrayList<font color="#990000">[</font>V<font color="#990000">],</font> l<font color="#990000">)</font> - <b><font color="#0000FF">for</font></b> i <font color="#990000">:=</font> <font color="#993399">0</font><font color="#990000">;</font> i <font color="#990000"><</font> l<font color="#990000">;</font> i<font color="#990000">++</font> <font color="#FF0000">{</font> - a<font color="#990000">[</font>i<font color="#990000">]</font> <font color="#990000">=</font> <b><font color="#000000">V</font></b><font color="#990000">(</font>i<font color="#990000">)</font> - <font color="#FF0000">}</font> - <b><font color="#0000FF">return</font></b> a -<font color="#FF0000">}</font> - -<b><font color="#0000FF">func</font></b> NewDescendingArrayList<font color="#990000">[</font>V Number<font color="#990000">](</font>l int<font color="#990000">)</font> ArrayList<font color="#990000">[</font>V<font color="#990000">]</font> <font color="#FF0000">{</font> - a <font color="#990000">:=</font> <b><font color="#000000">make</font></b><font color="#990000">(</font>ArrayList<font color="#990000">[</font>V<font color="#990000">],</font> l<font color="#990000">)</font> - j <font color="#990000">:=</font> l <font color="#990000">-</font> <font color="#993399">1</font> - <b><font color="#0000FF">for</font></b> i <font color="#990000">:=</font> <font color="#993399">0</font><font color="#990000">;</font> i <font color="#990000"><</font> l<font color="#990000">;</font> i<font color="#990000">++</font> <font color="#FF0000">{</font> - a<font color="#990000">[</font>i<font color="#990000">]</font> <font color="#990000">=</font> <b><font color="#000000">V</font></b><font color="#990000">(</font>j<font color="#990000">)</font> - j<font color="#990000">--</font> - <font color="#FF0000">}</font> - <b><font color="#0000FF">return</font></b> a -<font color="#FF0000">}</font> -</pre> -<br /> -<h2 style='display: inline'>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="#0000FF">func</font></b> <font color="#990000">(</font>a ArrayList<font color="#990000">[</font>V<font color="#990000">])</font> <b><font color="#000000">FirstN</font></b><font color="#990000">(</font>n int<font color="#990000">)</font> <font color="#009900">string</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">var</font></b> sb strings<font color="#990000">.</font>Builder - j <font color="#990000">:=</font> n - - l <font color="#990000">:=</font> <b><font color="#000000">len</font></b><font color="#990000">(</font>a<font color="#990000">)</font> - <b><font color="#0000FF">if</font></b> j <font color="#990000">></font> l <font color="#FF0000">{</font> - j <font color="#990000">=</font> l - <font color="#FF0000">}</font> - - <b><font color="#0000FF">for</font></b> i <font color="#990000">:=</font> <font color="#993399">0</font><font color="#990000">;</font> i <font color="#990000"><</font> j<font color="#990000">;</font> i<font color="#990000">++</font> <font color="#FF0000">{</font> - fmt<font color="#990000">.</font><b><font color="#000000">Fprintf</font></b><font color="#990000">(&</font>sb<font color="#990000">,</font> <font color="#FF0000">"%v "</font><font color="#990000">,</font> a<font color="#990000">[</font>i<font color="#990000">])</font> - <font color="#FF0000">}</font> - - <b><font color="#0000FF">if</font></b> j <font color="#990000"><</font> l <font color="#FF0000">{</font> - fmt<font color="#990000">.</font><b><font color="#000000">Fprintf</font></b><font color="#990000">(&</font>sb<font color="#990000">,</font> <font color="#FF0000">"... "</font><font color="#990000">)</font> - <font color="#FF0000">}</font> - - <b><font color="#0000FF">return</font></b> sb<font color="#990000">.</font><b><font color="#000000">String</font></b><font color="#990000">()</font> -<font color="#FF0000">}</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="#0000FF">func</font></b> <font color="#990000">(</font>a ArrayList<font color="#990000">[</font>V<font color="#990000">])</font> <b><font color="#000000">Sorted</font></b><font color="#990000">()</font> <font color="#009900">bool</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">for</font></b> i <font color="#990000">:=</font> <b><font color="#000000">len</font></b><font color="#990000">(</font>a<font color="#990000">)</font> <font color="#990000">-</font> <font color="#993399">1</font><font color="#990000">;</font> i <font color="#990000">></font> <font color="#993399">0</font><font color="#990000">;</font> i<font color="#990000">--</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">if</font></b> a<font color="#990000">[</font>i<font color="#990000">]</font> <font color="#990000"><</font> a<font color="#990000">[</font>i<font color="#990000">-</font><font color="#993399">1</font><font color="#990000">]</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">return</font></b> false - <font color="#FF0000">}</font> - <font color="#FF0000">}</font> - <b><font color="#0000FF">return</font></b> true -<font color="#FF0000">}</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="#0000FF">func</font></b> <font color="#990000">(</font>a ArrayList<font color="#990000">[</font>V<font color="#990000">])</font> <b><font color="#000000">Swap</font></b><font color="#990000">(</font>i<font color="#990000">,</font> j int<font color="#990000">)</font> <font color="#FF0000">{</font> - aux <font color="#990000">:=</font> a<font color="#990000">[</font>i<font color="#990000">]</font> - a<font color="#990000">[</font>i<font color="#990000">]</font> <font color="#990000">=</font> a<font color="#990000">[</font>j<font color="#990000">]</font> - a<font color="#990000">[</font>j<font color="#990000">]</font> <font color="#990000">=</font> aux -<font color="#FF0000">}</font> - -</pre> -<br /> -<h2 style='display: inline'>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="#0000FF">package</font></b> sort - -<b><font color="#0000FF">import</font></b> <font color="#990000">(</font> - <font color="#FF0000">"codeberg.org/snonux/algorithms/ds"</font> - <font color="#FF0000">"sync"</font> - <font color="#FF0000">"time"</font> -<font color="#990000">)</font> - -<b><font color="#0000FF">func</font></b> Sleep<font color="#990000">[</font>V ds<font color="#990000">.</font>Integer<font color="#990000">](</font>a ds<font color="#990000">.</font>ArrayList<font color="#990000">[</font>V<font color="#990000">])</font> ds<font color="#990000">.</font>ArrayList<font color="#990000">[</font>V<font color="#990000">]</font> <font color="#FF0000">{</font> - sorted <font color="#990000">:=</font> ds<font color="#990000">.</font>NewArrayList<font color="#990000">[</font>V<font color="#990000">](</font><b><font color="#000000">len</font></b><font color="#990000">(</font>a<font color="#990000">))</font> - - numCh <font color="#990000">:=</font> <b><font color="#000000">make</font></b><font color="#990000">(</font><b><font color="#0000FF">chan</font></b> V<font color="#990000">)</font> - <b><font color="#0000FF">var</font></b> wg sync<font color="#990000">.</font>WaitGroup - wg<font color="#990000">.</font><b><font color="#000000">Add</font></b><font color="#990000">(</font><b><font color="#000000">len</font></b><font color="#990000">(</font>a<font color="#990000">))</font> - - <b><font color="#0000FF">go</font></b> <b><font color="#0000FF">func</font></b><font color="#990000">()</font> <font color="#FF0000">{</font> - wg<font color="#990000">.</font><b><font color="#000000">Wait</font></b><font color="#990000">()</font> - <b><font color="#000000">close</font></b><font color="#990000">(</font>numCh<font color="#990000">)</font> - <font color="#FF0000">}</font><font color="#990000">()</font> - - <b><font color="#0000FF">for</font></b> _<font color="#990000">,</font> num <font color="#990000">:=</font> <b><font color="#0000FF">range</font></b> a <font color="#FF0000">{</font> - <b><font color="#0000FF">go</font></b> <b><font color="#0000FF">func</font></b><font color="#990000">(</font>num V<font color="#990000">)</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">defer</font></b> wg<font color="#990000">.</font><b><font color="#000000">Done</font></b><font color="#990000">()</font> - time<font color="#990000">.</font><b><font color="#000000">Sleep</font></b><font color="#990000">(</font>time<font color="#990000">.</font><b><font color="#000000">Duration</font></b><font color="#990000">(</font>num<font color="#990000">)</font> <font color="#990000">*</font> time<font color="#990000">.</font>Second<font color="#990000">)</font> - numCh <font color="#990000"><-</font> num - <font color="#FF0000">}</font><font color="#990000">(</font>num<font color="#990000">)</font> - <font color="#FF0000">}</font> - - <b><font color="#0000FF">for</font></b> num <font color="#990000">:=</font> <b><font color="#0000FF">range</font></b> numCh <font color="#FF0000">{</font> - sorted <font color="#990000">=</font> <b><font color="#000000">append</font></b><font color="#990000">(</font>sorted<font color="#990000">,</font> num<font color="#990000">)</font> - <font color="#FF0000">}</font> - - <b><font color="#0000FF">return</font></b> sorted -<font color="#FF0000">}</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'>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="#0000FF">package</font></b> sort - -<b><font color="#0000FF">import</font></b> <font color="#990000">(</font> - <font color="#FF0000">"fmt"</font> - <font color="#FF0000">"testing"</font> - - <font color="#FF0000">"codeberg.org/snonux/algorithms/ds"</font> -<font color="#990000">)</font> - -<b><font color="#0000FF">func</font></b> <b><font color="#000000">TestSleepSort</font></b><font color="#990000">(</font>t <font color="#990000">*</font>testing<font color="#990000">.</font>T<font color="#990000">)</font> <font color="#FF0000">{</font> - a <font color="#990000">:=</font> ds<font color="#990000">.</font>NewRandomArrayList<font color="#990000">[</font>int<font color="#990000">](</font><font color="#993399">10</font><font color="#990000">,</font> <font color="#993399">10</font><font color="#990000">)</font> - a <font color="#990000">=</font> <b><font color="#000000">Sleep</font></b><font color="#990000">(</font>a<font color="#990000">)</font> - <b><font color="#0000FF">if</font></b> <font color="#990000">!</font>a<font color="#990000">.</font><b><font color="#000000">Sorted</font></b><font color="#990000">()</font> <font color="#FF0000">{</font> - t<font color="#990000">.</font><b><font color="#000000">Errorf</font></b><font color="#990000">(</font><font color="#FF0000">"Array not sorted: %v"</font><font color="#990000">,</font> a<font color="#990000">)</font> - <font color="#FF0000">}</font> -<font color="#FF0000">}</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>❯ go <b><font color="#0000FF">test</font></b> <font color="#990000">.</font>/sort -v -run SleepSort -<font color="#990000">===</font> RUN TestSleepSort ---- PASS<font color="#990000">:</font> TestSleepSort <font color="#990000">(</font><font color="#993399">9</font><font color="#990000">.</font>00s<font color="#990000">)</font> -PASS -ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <font color="#993399">9</font><font color="#990000">.</font>002s -</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 /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> -<p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> -</p> -</body> -</html> diff --git a/gemfeed/2023-05-01-unveiling-guprecords b/gemfeed/2023-05-01-unveiling-guprecords new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/gemfeed/2023-05-01-unveiling-guprecords @@ -0,0 +1 @@ + diff --git a/gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.html b/gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.html index 822b4991..1528ff96 100644 --- a/gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.html +++ b/gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.html @@ -8,7 +8,10 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Unveiling <span class='inlinecode'>guprecords.raku</span>: Global Uptime Records with Raku</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.gmi">Gemini</a> +</p> +<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 /> @@ -29,7 +32,16 @@ +-----+-----------------+-----------------------------+ </pre> <br /> -<h1 style='display: inline'>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 /> @@ -52,7 +64,7 @@ </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'>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 /> @@ -65,7 +77,7 @@ by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>$ raku guprecords<font color="#990000">.</font>raku --stats<font color="#990000">=</font><font color="#009900">dir</font><font color="#990000">=</font><font color="#009900">$HOME</font>/git/uprecords/stats --all +<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 /> @@ -78,7 +90,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'>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 /> @@ -149,7 +161,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'>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 /> @@ -164,21 +176,21 @@ no1 in 455 days, 18:52:44 | at Sun Jul 21 07:37:51 2024 <li>A social media sharing scheduler a la <span class='inlinecode'>buffer.com</span>. I am using Buffer at the moment to share posts on Mastadon, Twitter, Telegram and LinkedIn, but it is proprietary and also it's not really reliable.</li> <li>Rewrite the static photo album generator of <span class='inlinecode'>irregular.ninja</span> in Raku (from Bash).</li> </ul><br /> +<span>E-Mail your comments to hi@foo.zone :-)</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</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 /> -<span>E-Mail your comments to hi@foo.zone :-)</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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2023-05-06-the-obstacle-is-the-way-book-notes.html b/gemfeed/2023-05-06-the-obstacle-is-the-way-book-notes.html index 92be78fc..ac1eb445 100644 --- a/gemfeed/2023-05-06-the-obstacle-is-the-way-book-notes.html +++ b/gemfeed/2023-05-06-the-obstacle-is-the-way-book-notes.html @@ -8,13 +8,15 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>"The Obstacle is the Way" book notes</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2023-05-06-the-obstacle-is-the-way-book-notes.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2023-05-06-the-obstacle-is-the-way-book-notes.gmi">Gemini</a> +</p> +<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> ,.......... .........., ,..,' '.' ',.., @@ -27,9 +29,26 @@ ''' </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'>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 /> @@ -37,38 +56,37 @@ <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'>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'>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'>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'>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'>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'>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'>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'>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 /> @@ -76,38 +94,40 @@ <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'>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'>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'>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 /> +<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='./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='./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 /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2023-06-01-kiss-server-monitoring-with-gogios.html b/gemfeed/2023-06-01-kiss-server-monitoring-with-gogios.html index 0f48933d..57cc96a1 100644 --- a/gemfeed/2023-06-01-kiss-server-monitoring-with-gogios.html +++ b/gemfeed/2023-06-01-kiss-server-monitoring-with-gogios.html @@ -8,20 +8,39 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>KISS server monitoring with Gogios</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2023-06-01-kiss-server-monitoring-with-gogios.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2023-06-01-kiss-server-monitoring-with-gogios.gmi">Gemini</a> +</p> +<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='./2023-06-01-kiss-server-monitoring-with-gogios/gogios-small.png'><img alt='Gogios logo' title='Gogios logo' src='./2023-06-01-kiss-server-monitoring-with-gogios/gogios-small.png' /></a><br /> -<br /> -<h2 style='display: inline'>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> _____________________________ ____________________________ / \ / \ @@ -45,7 +64,7 @@ The original can be found at https://asciiart.website/index.php?art=objects/computers </pre> <br /> -<h2 style='display: inline'>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 /> @@ -53,7 +72,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'>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> @@ -64,7 +83,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'>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 /> @@ -86,9 +105,9 @@ CRITICAL: Check ICMP6 vulcan.buetow.org: Check command timed out Have a nice day! </pre> <br /> -<h2 style='display: inline'>Installation</h2><br /> +<h2 style='display: inline' id='installation'>Installation</h2><br /> <br /> -<h3 style='display: inline'>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 /> @@ -98,11 +117,11 @@ Have a nice day! by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>git clone https<font color="#990000">:</font>//codeberg<font color="#990000">.</font>org/snonux/gogios<font color="#990000">.</font>git +<pre>git clone https://codeberg.org/snonux/gogios.git cd gogios -go build -o gogios cmd/gogios/main<font color="#990000">.</font>go +go build -o gogios cmd/gogios/main.go doas cp gogios /usr/local/bin/gogios -doas chmod <font color="#993399">755</font> /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 /> @@ -111,16 +130,16 @@ doas chmod <font color="#993399">755</font> /usr/local/bin/gogios by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#0000FF">export</font></b> <font color="#009900">GOOS</font><font color="#990000">=</font>openbsd -<b><font color="#0000FF">export</font></b> <font color="#009900">GOARCH</font><font color="#990000">=</font>amd64 -go build -o gogios cmd/gogios/main<font color="#990000">.</font>go +<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'>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 /> @@ -131,13 +150,13 @@ http://www.gnu.org/software/src-highlite --> <pre>doas adduser -group _gogios -batch _gogios doas usermod -d /var/run/gogios _gogios doas mkdir -p /var/run/gogios -doas chown _gogios<font color="#990000">:</font>_gogios /var/run/gogios -doas chmod <font color="#993399">750</font> /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'>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 /> @@ -146,14 +165,14 @@ by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> <pre>doas pkg_add monitoring-plugins -doas pkg_add nrpe <i><font color="#9A1900"># If you want to execute checks remotely via NRPE.</font></i> +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'>Configuration</h2><br /> +<h2 style='display: inline' id='configuration'>Configuration</h2><br /> <br /> -<h3 style='display: inline'>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 /> @@ -165,7 +184,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'>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 /> @@ -173,41 +192,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="#990000">{</font> - "EmailTo": "<font color="#FF0000">paul@dev.buetow.org</font>"<font color="#990000">,</font> - "EmailFrom": "<font color="#FF0000">gogios@buetow.org</font>"<font color="#990000">,</font> - "CheckTimeoutS": <font color="#993399">10</font><font color="#990000">,</font> - "CheckConcurrency": <font color="#993399">2</font><font color="#990000">,</font> - "StateDir": "<font color="#FF0000">/var/run/gogios</font>"<font color="#990000">,</font> - "Checks": <font color="#990000">{</font> - "Check ICMP4 www.foo.zone": <font color="#990000">{</font> - "Plugin": "<font color="#FF0000">/usr/local/libexec/nagios/check_ping</font>"<font color="#990000">,</font> - "Args": <font color="#990000">[</font> "-H"<font color="#990000">,</font> "www.foo.zone"<font color="#990000">,</font> "-4"<font color="#990000">,</font> "-w"<font color="#990000">,</font> "50,10%"<font color="#990000">,</font> "-c"<font color="#990000">,</font> "100,15%" <font color="#990000">],</font> - "Retries": <font color="#993399">3</font><font color="#990000">,</font> - "RetryInterval": <font color="#993399">10</font> - <font color="#990000">},</font> - "Check ICMP6 www.foo.zone": <font color="#990000">{</font> - "Plugin": "<font color="#FF0000">/usr/local/libexec/nagios/check_ping</font>"<font color="#990000">,</font> - "Args": <font color="#990000">[</font> "-H"<font color="#990000">,</font> "www.foo.zone"<font color="#990000">,</font> "-6"<font color="#990000">,</font> "-w"<font color="#990000">,</font> "50,10%"<font color="#990000">,</font> "-c"<font color="#990000">,</font> "100,15%" <font color="#990000">],</font> - "Retries": <font color="#993399">3</font><font color="#990000">,</font> - "RetryInterval": <font color="#993399">10</font> - <font color="#990000">},</font> - "www.foo.zone HTTP IPv4": <font color="#990000">{</font> - "Plugin": "<font color="#FF0000">/usr/local/libexec/nagios/check_http</font>"<font color="#990000">,</font> - "Args": <font color="#990000">[</font>"www.foo.zone"<font color="#990000">,</font> "-4"<font color="#990000">],</font> - "DependsOn": <font color="#990000">[</font>"Check ICMP4 www.foo.zone"<font color="#990000">]</font> - <font color="#990000">},</font> - "www.foo.zone HTTP IPv6": <font color="#990000">{</font> - "Plugin": "<font color="#FF0000">/usr/local/libexec/nagios/check_http</font>"<font color="#990000">,</font> - "Args": <font color="#990000">[</font>"www.foo.zone"<font color="#990000">,</font> "-6"<font color="#990000">],</font> - "DependsOn": <font color="#990000">[</font>"Check ICMP6 www.foo.zone"<font color="#990000">]</font> - <font color="#990000">}</font> - "Check NRPE Disk Usage foo.zone": <font color="#990000">{</font> - "Plugin": "<font color="#FF0000">/usr/local/libexec/nagios/check_nrpe</font>"<font color="#990000">,</font> - "Args": <font color="#990000">[</font>"-H"<font color="#990000">,</font> "foo.zone"<font color="#990000">,</font> "-c"<font color="#990000">,</font> "check_disk"<font color="#990000">,</font> "-p"<font color="#990000">,</font> "5666"<font color="#990000">,</font> "-4"<font color="#990000">]</font> - <font color="#990000">}</font> - <font color="#990000">}</font> -<font color="#990000">}</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> @@ -228,7 +247,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'>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 /> @@ -236,7 +255,7 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>doas -u _gogios /usr/local/bin/gogios -cfg /etc/gogios<font color="#990000">.</font>json +<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 /> @@ -250,7 +269,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'>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 /> @@ -263,23 +282,24 @@ 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'>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 /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<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='./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 /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2023-07-17-career-guide-and-soft-skills-book-notes.html b/gemfeed/2023-07-17-career-guide-and-soft-skills-book-notes.html index f472778d..6e55aa01 100644 --- a/gemfeed/2023-07-17-career-guide-and-soft-skills-book-notes.html +++ b/gemfeed/2023-07-17-career-guide-and-soft-skills-book-notes.html @@ -8,7 +8,10 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>"Software Developmers Career Guide and Soft Skills" book notes</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2023-07-17-career-guide-and-soft-skills-book-notes.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2023-07-17-career-guide-and-soft-skills-book-notes.gmi">Gemini</a> +</p> +<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 /> @@ -26,9 +29,42 @@ ''' </pre> <br /> -<h1 style='display: inline'>Improve</h1><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<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 /> -<h2 style='display: inline'>Always learn new things</h2><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 /> @@ -46,11 +82,11 @@ <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'>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'>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 /> @@ -58,7 +94,7 @@ <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'>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 /> @@ -71,7 +107,7 @@ <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'>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 /> @@ -86,7 +122,7 @@ <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'>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 /> @@ -97,7 +133,7 @@ </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'>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 /> @@ -107,7 +143,7 @@ </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'>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 /> @@ -116,7 +152,7 @@ <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'>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 /> @@ -125,7 +161,7 @@ <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'>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 /> @@ -135,7 +171,7 @@ <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'>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 /> @@ -147,7 +183,7 @@ </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'>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> @@ -158,7 +194,7 @@ <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'>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 /> @@ -170,7 +206,7 @@ </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'>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 /> @@ -186,13 +222,13 @@ </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'>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'>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> @@ -205,11 +241,11 @@ <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'>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'>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 /> @@ -219,9 +255,9 @@ </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'>New job</h1><br /> +<h1 style='display: inline' id='new-job'>New job</h1><br /> <br /> -<h2 style='display: inline'>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> @@ -230,7 +266,7 @@ </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'>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 /> @@ -242,7 +278,7 @@ </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'>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 /> @@ -255,7 +291,7 @@ </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'>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> @@ -273,21 +309,21 @@ <ul> <li>Never spilt the difference is the best book for learning negotiation techniques..</li> </ul><br /> -<h2 style='display: inline'>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'>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'>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'>Books to read</h2><br /> +<h2 style='display: inline' id='books-to-read'>Books to read</h2><br /> <br /> <ul> <li>Clean Code</li> @@ -306,22 +342,24 @@ <li>The war of Art (to combat procrastination)</li> <li>Willpower Instinct</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='./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='./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 /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.html b/gemfeed/2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.html index 4a9efe70..94bfe479 100644 --- a/gemfeed/2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.html +++ b/gemfeed/2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.html @@ -8,10 +8,17 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Gemtexter 2.1.0 - Let's Gemtext again³</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.gmi">Gemini</a> +</p> +<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 .-------. @@ -25,21 +32,29 @@ 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'>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'>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'>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 /> @@ -57,18 +72,18 @@ by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#0000FF">if</font></b> <font color="#990000">[</font> -n <font color="#FF0000">"$foo"</font> <font color="#990000">];</font> <b><font color="#0000FF">then</font></b> - echo <font color="#FF0000">"$foo"</font> -<b><font color="#0000FF">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'>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'>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 /> @@ -76,7 +91,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'>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 /> @@ -88,7 +103,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="#0000FF">declare</font></b> -xr <font color="#009900">MASTODON_URI</font><font color="#990000">=</font><font color="#FF0000">'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 /> @@ -103,28 +118,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="#0000FF"><a</font></b> <font color="#009900">href</font><font color="#990000">=</font><font color="#FF0000">'https://fosstodon.org/@snonux'</font> <font color="#009900">rel</font><font color="#990000">=</font><font color="#FF0000">'me'</font><b><font color="#0000FF">></font></b>Me at Mastodon<b><font color="#0000FF"></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'>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 /> +<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</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 /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2023-08-18-site-reliability-engineering-part-1.html b/gemfeed/2023-08-18-site-reliability-engineering-part-1.html index 940c453d..31e350f7 100644 --- a/gemfeed/2023-08-18-site-reliability-engineering-part-1.html +++ b/gemfeed/2023-08-18-site-reliability-engineering-part-1.html @@ -8,15 +8,19 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Site Reliability Engineering - Part 1: SRE and Organizational Culture</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2023-08-18-site-reliability-engineering-part-1.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2023-08-18-site-reliability-engineering-part-1.gmi">Gemini</a> +</p> +<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 Principal 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-08-19-site-reliability-engineering-part-2.html'>2023-08-19 Site Reliability Engineering - Part 2: Operational Balance in SRE</a><br /> -<a class='textlink' href='./2023-08-20-site-reliability-engineering-part-3.html'>2023-08-20 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> ▓▓▓▓░░ @@ -40,37 +44,37 @@ DC on fire: ░░░░░░░░░░▒▒░░░░░░░░░░░░░░░░░░░░░░░░▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒░░░░░░░░░░░░░░░░░░ </pre> <br /> -<h2 style='display: inline'>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 deeply 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 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-08-19-site-reliability-engineering-part-2.html'>2023-08-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 /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2023-08-19-site-reliability-engineering-part-2.html b/gemfeed/2023-08-19-site-reliability-engineering-part-2.html deleted file mode 100644 index f1ad2b23..00000000 --- a/gemfeed/2023-08-19-site-reliability-engineering-part-2.html +++ /dev/null @@ -1,67 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<title>Site Reliability Engineering - Part 2: Operational Balance in SRE</title> -<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> -<link rel="stylesheet" href="../style.css" /> -<link rel="stylesheet" href="style-override.css" /> -</head> -<body> -<h1 style='display: inline'>Site Reliability Engineering - Part 2: Operational Balance in SRE</h1><br /> -<br /> -<span class='quote'>Published at 2023-08-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 Principal 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-08-19-site-reliability-engineering-part-2.html'>2023-08-19 Site Reliability Engineering - Part 2: Operational Balance in SRE (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-08-20-site-reliability-engineering-part-3.html'>2023-08-20 Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect</a><br /> -<br /> -<pre> -⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⣷⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⠀⠀⠀⣾⠿⠿⠿⠶⠾⠿⠿⣿⣿⣿⣿⣿⣿⠿⠿⠶⠶⠿⠿⠿⣷⠀⠀⠀⠀ -⠀⠀⠀⣸⢿⣆⠀⠀⠀⠀⠀⠀⠀⠙⢿⡿⠉⠀⠀⠀⠀⠀⠀⠀⣸⣿⡆⠀⠀⠀ -⠀⠀⢠⡟⠀⢻⣆⠀⠀⠀⠀⠀⠀⠀⣾⣧⠀⠀⠀⠀⠀⠀⠀⣰⡟⠀⢻⡄⠀⠀ -⠀⢀⣾⠃⠀⠀⢿⡄⠀⠀⠀⠀⠀⢠⣿⣿⡀⠀⠀⠀⠀⠀⢠⡿⠀⠀⠘⣷⡀⠀ -⠀⣼⣏⣀⣀⣀⣈⣿⡀⠀⠀⠀⠀⣸⣿⣿⡇⠀⠀⠀⠀⢀⣿⣃⣀⣀⣀⣸⣧⠀ -⠀⢻⣿⣿⣿⣿⣿⣿⠃⠀⠀⠀⠀⣿⣿⣿⣿⠀⠀⠀⠀⠈⢿⣿⣿⣿⣿⣿⡿⠀ -⠀⠀⠉⠛⠛⠛⠋⠁⠀⠀⠀⠀⢸⣿⣿⣿⣿⡆⠀⠀⠀⠀⠈⠙⠛⠛⠛⠉⠀⠀ -⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣿⣿⣿⣿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⣿⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⠀⠀⠀⠀⠀⠴⠶⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠶⠦⠀⠀ -</pre> -<br /> -<h2 style='display: inline'>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 /> -<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 /> -<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 /> -<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 /> -<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 /> -<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 /> -<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 /> -<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 /> -<br /> -<span>Continue with the third part of this series:</span><br /> -<br /> -<a class='textlink' href='./2023-08-20-site-reliability-engineering-part-3.html'>2023-08-20 Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect</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 /> -<p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> -</p> -</body> -</html> diff --git a/gemfeed/2023-08-20-site-reliability-engineering-part-3.html b/gemfeed/2023-08-20-site-reliability-engineering-part-3.html deleted file mode 100644 index 31bd5d0e..00000000 --- a/gemfeed/2023-08-20-site-reliability-engineering-part-3.html +++ /dev/null @@ -1,76 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<title>Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect</title> -<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> -<link rel="stylesheet" href="../style.css" /> -<link rel="stylesheet" href="style-override.css" /> -</head> -<body> -<h1 style='display: inline'>Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect</h1><br /> -<br /> -<span class='quote'>Published at 2023-08-20T12:17:56+03:00</span><br /> -<br /> -<span>This is the third part of my Site Reliability Engineering (SRE) series. I am currently employed as a Principal 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-08-19-site-reliability-engineering-part-2.html'>2023-08-19 Site Reliability Engineering - Part 2: Operational Balance in SRE</a><br /> -<a class='textlink' href='./2023-08-20-site-reliability-engineering-part-3.html'>2023-08-20 Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect (You are currently reading this)</a><br /> -<br /> -<pre> - ..--""""----.. - .-" ..--""""--.j-. - .-" .-" .--.""--.. - .-" .-" ..--"-. \/ ; - .-" .-"_.--..--"" ..--' "-. : - .' .' / `. \..--"" __ _ \ ; - :.__.-" \ / .' ( )"-. Y - ; ;: ( ) ( ). \ - .': /:: : \ \ - .'.-"\._ _.-" ; ; ( ) .-. ( ) \ - " `.""" .j" : : \ ; ; \ - bug /"""""/ ; ( ) "" :.( ) \ - /\ / : \ \`.: _ \ - : `. / ; `( ) (\/ :" \ \ - \ `. : "-.(_)_.' t-' ; - \ `. ; ..--": - `. `. : ..--"" : - `. "-. ; ..--"" ; - `. "-.:_..--"" ..--" - `. : ..--"" - "-. : ..--"" - "-.;_..--"" - -</pre> -<br /> -<h2 style='display: inline'>On-Call Culture and the Human Aspect: Prioritising Well-being in the Realm of Reliability</h2><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 /> -<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 /> -<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 /> -<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 /> -<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 /> -<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 /> -<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 /> -<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 /> -<br /> -<span>The fourth part of this blog series will be published soon :-)</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 /> -<p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> -</p> -</body> -</html> diff --git a/gemfeed/2023-09-25-dtail-usage-examples.html b/gemfeed/2023-09-25-dtail-usage-examples.html index 220ee174..d210c8a4 100644 --- a/gemfeed/2023-09-25-dtail-usage-examples.html +++ b/gemfeed/2023-09-25-dtail-usage-examples.html @@ -8,7 +8,10 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>DTail usage examples</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2023-09-25-dtail-usage-examples.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2023-09-25-dtail-usage-examples.gmi">Gemini</a> +</p> +<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 /> @@ -32,6 +35,23 @@ | | </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> @@ -42,7 +62,7 @@ <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'>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 /> @@ -50,7 +70,7 @@ by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#990000">%</font> dtail --servers serverlist<font color="#990000">.</font>txt --grep INFO --files <font color="#FF0000">"/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 /> @@ -63,10 +83,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="#990000">%</font> dtail --servers serverlist<font color="#990000">.</font>txt --grep INFO <font color="#FF0000">"/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'>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 /> @@ -76,10 +96,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="#990000">%</font> dtail --servers serverlist<font color="#990000">.</font>txt <font color="#990000">\</font> - --files <font color="#FF0000">'/var/log/dserver/*.log'</font> <font color="#990000">\</font> - --query <font color="#FF0000">'from STATS select sum($goroutines),sum($cgocalls),</font> -<font color="#FF0000"> 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 /> @@ -92,10 +112,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="#990000">%</font> dtail --servers serverlist<font color="#990000">.</font>txt <font color="#990000">\</font> - --files <font color="#FF0000">'/var/log/dserver/*.log'</font> <font color="#990000">\</font> - <font color="#FF0000">'from STATS select sum($goroutines),sum($cgocalls),</font> -<font color="#FF0000"> 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 /> @@ -104,10 +124,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="#990000">%</font> dtail --servers serverlist<font color="#990000">.</font>txt <font color="#990000">\</font> - --files <font color="#FF0000">'/var/log/dserver/*.log'</font> <font color="#990000">\</font> - --query <font color="#FF0000">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> -<font color="#FF0000"> 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 /> @@ -118,12 +138,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="#990000">%</font> dtail --servers serverlist<font color="#990000">.</font>txt <font color="#990000">\</font> - --files <font color="#FF0000">'/var/log/dserver/*.log'</font> <font color="#990000">\</font> - --query <font color="#FF0000">'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'>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 /> @@ -133,7 +153,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="#990000">%</font> dcat --servers serverlist<font color="#990000">.</font>txt --files /etc/hostname +<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 /> @@ -144,10 +164,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="#990000">%</font> dcat --servers serverlist<font color="#990000">.</font>txt /etc/hostname +<pre>% dcat --servers serverlist.txt /etc/hostname </pre> <br /> -<h2 style='display: inline'>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 /> @@ -155,8 +175,8 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#990000">%</font> dgrep --servers server1<font color="#990000">.</font>example<font color="#990000">.</font>org<font color="#990000">:</font><font color="#993399">2223</font> <font color="#990000">\</font> - --files /etc/passwd <font color="#990000">\</font> +<pre>% dgrep --servers server1.example.org:<font color="#000000">2223</font> \ + --files /etc/passwd \ --regex nologin </pre> <br /> @@ -166,7 +186,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'>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 /> @@ -174,17 +194,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="#990000">%</font> dmap --servers serverlist<font color="#990000">.</font>txt <font color="#990000">\</font> - --files <font color="#FF0000">'/var/log/dserver/*.log'</font> <font color="#990000">\</font> - --query <font color="#FF0000">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> -<font color="#FF0000"> 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'>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 /> @@ -192,7 +212,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'>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 /> @@ -200,9 +220,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="#990000">%</font> dmap --files /var/log/dserver/dserver<font color="#990000">.</font>log - --query <font color="#FF0000">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> -<font color="#FF0000"> 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 /> @@ -211,9 +231,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="#990000">%</font> dmap <font color="#FF0000">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> -<font color="#FF0000"> lifetimeConnections group by $hostname order by max($cgocalls)'</font> <font color="#990000">\</font> - /var/log/dsever/dserver<font color="#990000">.</font>log +<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 /> @@ -222,12 +242,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="#990000">%</font> cat /var/log/dserver/dserver<font color="#990000">.</font>log <font color="#990000">|</font> <font color="#990000">\</font> - dmap <font color="#FF0000">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> -<font color="#FF0000"> 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'>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 /> @@ -235,21 +255,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="#990000">%</font> cat example<font color="#990000">.</font>csv -name<font color="#990000">,</font>lastname<font color="#990000">,</font>age<font color="#990000">,</font>profession -Michael<font color="#990000">,</font>Jordan<font color="#990000">,</font><font color="#993399">40</font><font color="#990000">,</font>Basketball player -Michael<font color="#990000">,</font>Jackson<font color="#990000">,</font><font color="#993399">100</font><font color="#990000">,</font>Singer -Albert<font color="#990000">,</font>Einstein<font color="#990000">,</font><font color="#993399">200</font><font color="#990000">,</font>Physician -<font color="#990000">%</font> dmap --query <font color="#FF0000">'select lastname,name where age > 40 logformat csv outfile result.csv'</font> example<font color="#990000">.</font>csv -<font color="#990000">%</font> cat result<font color="#990000">.</font>csv -lastname<font color="#990000">,</font>name -Jackson<font color="#990000">,</font>Michael -Einstein<font color="#990000">,</font>Albert +<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'>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 /> @@ -257,29 +277,29 @@ Einstein<font color="#990000">,</font>Albert by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#990000">%</font> dtail /var/log/dserver/dserver<font color="#990000">.</font>log +<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="#990000">%</font> dtail --logLevel trace /var/log/dserver/dserver<font color="#990000">.</font>log +<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="#990000">%</font> dcat /etc/passwd +<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="#990000">%</font> dcat --plain /etc/passwd <font color="#990000">></font> /etc/test -<i><font color="#9A1900"># Should show no differences.</font></i> +<pre>% dcat --plain /etc/passwd > /etc/test +<i><font color="silver"># Should show no differences.</font></i> diff /etc/test /etc/passwd </pre> <br /> @@ -287,36 +307,36 @@ diff /etc/test /etc/passwd by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#990000">%</font> dgrep --regex ERROR --files /var/log/dserver/dsever<font color="#990000">.</font>log +<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="#990000">%</font> dgrep --before <font color="#993399">10</font> --after <font color="#993399">10</font> --max <font color="#993399">10</font> --grep ERROR /var/log/dserver/dsever<font color="#990000">.</font>log +<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 /> <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</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 /> <span>Paul</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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.html b/gemfeed/2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.html index 8e64a105..a0f4b9a2 100644 --- a/gemfeed/2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.html +++ b/gemfeed/2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.html @@ -8,10 +8,19 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>KISS static web photo albums with <span class='inlinecode'>photoalbum.sh</span></h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.gmi">Gemini</a> +</p> +<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. '-------....._ @@ -29,19 +38,23 @@ '._____________________________________________.' </pre> <br /> -<h2 style='display: inline'>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'>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'>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 /> @@ -84,7 +97,7 @@ cp ./src/photoalbum.default.conf /etc/default/photoalbum This is Photoalbum Version 0.5.1 </pre> <br /> -<h2 style='display: inline'>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 /> @@ -117,42 +130,42 @@ photoalbum makemake by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#990000">%</font> photoalbum makemake -You may now customize <font color="#990000">.</font>/photoalbumrc and run make +<pre>% photoalbum makemake +You may now customize ./photoalbumrc and run make -<font color="#990000">%</font> cat Makefile -all<font color="#990000">:</font> +% cat Makefile +all: photoalbum generate photoalbumrc -clean<font color="#990000">:</font> +clean: photoalbum clean photoalbumrc -<font color="#990000">%</font> cat photoalbumrc -<i><font color="#9A1900"># The title of the photoalbum</font></i> -<font color="#009900">TITLE</font><font color="#990000">=</font><font color="#FF0000">'A simple Photoalbum'</font> +% cat photoalbumrc +<i><font color="silver"># The title of the photoalbum</font></i> +TITLE=<font color="#808080">'A simple Photoalbum'</font> -<i><font color="#9A1900"># Thumbnail height geometry</font></i> -<font color="#009900">THUMBHEIGHT</font><font color="#990000">=</font><font color="#993399">300</font> -<i><font color="#9A1900"># Normal geometry height (when viewing photo). Uncomment, to keep original size.</font></i> -<font color="#009900">HEIGHT</font><font color="#990000">=</font><font color="#993399">1200</font> -<i><font color="#9A1900"># Max previews per page.</font></i> -<font color="#009900">MAXPREVIEWS</font><font color="#990000">=</font><font color="#993399">40</font> -<i><font color="#9A1900"># Randomly shuffle all previews.</font></i> -<i><font color="#9A1900"># SHUFFLE=yes</font></i> +<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="#9A1900"># Diverse directories, need to be full paths, not relative!</font></i> -<font color="#009900">INCOMING_DIR</font><font color="#990000">=</font><font color="#009900">$(pwd)</font>/incoming -<font color="#009900">DIST_DIR</font><font color="#990000">=</font><font color="#009900">$(pwd)</font>/dist -<font color="#009900">TEMPLATE_DIR</font><font color="#990000">=</font>/usr/share/photoalbum/templates/default -<i><font color="#9A1900">#TEMPLATE_DIR=/usr/share/photoalbum/templates/minimal</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="#9A1900"># Includes a .tar of the incoming dir in the dist, can be yes or no</font></i> -<font color="#009900">TARBALL_INCLUDE</font><font color="#990000">=</font>yes -<font color="#009900">TARBALL_SUFFIX</font><font color="#990000">=.</font>tar -<font color="#009900">TAR_OPTS</font><font color="#990000">=</font><font color="#FF0000">'-c'</font> +<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="#9A1900"># Some debugging options</font></i> -<i><font color="#9A1900">#set -e</font></i> -<i><font color="#9A1900">#set -x</font></i> +<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 /> @@ -161,43 +174,43 @@ clean<font color="#990000">:</font> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#FF6600">--- photoalbumrc 2023-10-29 21:42:00.894202045 +0200</font> -<font color="#009900">+++ photoalbumrc.new 2023-06-04 10:40:08.030994440 +0300</font> -<font color="#0000FF">@@ -1,23 +1,24 @@</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 -<font color="#FF6600">-TITLE='A simple Photoalbum'</font> -<font color="#009900">+TITLE='Irregular.Ninja'</font> +-TITLE='A simple Photoalbum' ++TITLE='Irregular.Ninja' # Thumbnail height geometry -<font color="#FF6600">-THUMBHEIGHT=300</font> -<font color="#009900">+THUMBHEIGHT=400</font> +-THUMBHEIGHT=300 ++THUMBHEIGHT=400 # Normal geometry height (when viewing photo). Uncomment, to keep original size. -<font color="#FF6600">-HEIGHT=1200</font> -<font color="#009900">+HEIGHT=1800</font> +-HEIGHT=1200 ++HEIGHT=1800 # Max previews per page. MAXPREVIEWS=40 -<font color="#FF6600">-# Randomly shuffle all previews.</font> -<font color="#FF6600">-# SHUFFLE=yes</font> -<font color="#009900">+# Randomly shuffle</font> -<font color="#009900">+SHUFFLE=yes</font> +-# Randomly shuffle all previews. +-# SHUFFLE=yes ++# Randomly shuffle ++SHUFFLE=yes # Diverse directories, need to be full paths, not relative! -<font color="#FF6600">-INCOMING_DIR=$(pwd)/incoming</font> -<font color="#009900">+INCOMING_DIR=~/Nextcloud/Photos/irregular.ninja</font> +-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 -<font color="#FF6600">-TARBALL_INCLUDE=yes</font> -<font color="#009900">+TARBALL_INCLUDE=no</font> +-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'>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 /> @@ -260,15 +273,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'>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'>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'>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 /> @@ -276,23 +289,25 @@ blurs html index.html photos thumbs <br /> <a class='textlink' href='https://codeberg.org/snonux/photoalbum'><span class='inlinecode'>photoalbum.sh</span> source code on Codeberg.</a><br /> <br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<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='./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 /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2023-11-11-mind-management-book-notes.html b/gemfeed/2023-11-11-mind-management-book-notes.html index 61a97c96..1f1bcdb4 100644 --- a/gemfeed/2023-11-11-mind-management-book-notes.html +++ b/gemfeed/2023-11-11-mind-management-book-notes.html @@ -8,7 +8,10 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>"Mind Management" book notes</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2023-11-11-mind-management-book-notes.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2023-11-11-mind-management-book-notes.gmi">Gemini</a> +</p> +<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 /> @@ -26,17 +29,33 @@ ''' </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'>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'>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 /> @@ -45,7 +64,7 @@ <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'>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 /> @@ -53,7 +72,7 @@ <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'>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 /> @@ -63,7 +82,7 @@ <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'>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 /> @@ -77,7 +96,7 @@ <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'>Creativity hacks</h2><br /> +<h2 style='display: inline' id='creativity-hacks'>Creativity hacks</h2><br /> <br /> <ul> <li>Coffee can cause anxiety.</li> @@ -88,7 +107,7 @@ <li>Go to open spaces for creativity.</li> <li>Go to closed spaces for polishing.</li> </ul><br /> -<h2 style='display: inline'>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 /> @@ -101,29 +120,31 @@ <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'>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> <li>Talk slowly and deepen your voice a bit to appear more confident. You will also become more confident.</li> <li>Also, use power positions for better confidence.</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='./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='./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 /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2023-11-19-site-reliability-engineering-part-2.html b/gemfeed/2023-11-19-site-reliability-engineering-part-2.html new file mode 100644 index 00000000..9b900d76 --- /dev/null +++ b/gemfeed/2023-11-19-site-reliability-engineering-part-2.html @@ -0,0 +1,70 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Site Reliability Engineering - Part 2: Operational Balance</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2023-11-19-site-reliability-engineering-part-2.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2023-11-19-site-reliability-engineering-part-2.gmi">Gemini</a> +</p> +<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 (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> +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⣷⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⣾⠿⠿⠿⠶⠾⠿⠿⣿⣿⣿⣿⣿⣿⠿⠿⠶⠶⠿⠿⠿⣷⠀⠀⠀⠀ +⠀⠀⠀⣸⢿⣆⠀⠀⠀⠀⠀⠀⠀⠙⢿⡿⠉⠀⠀⠀⠀⠀⠀⠀⣸⣿⡆⠀⠀⠀ +⠀⠀⢠⡟⠀⢻⣆⠀⠀⠀⠀⠀⠀⠀⣾⣧⠀⠀⠀⠀⠀⠀⠀⣰⡟⠀⢻⡄⠀⠀ +⠀⢀⣾⠃⠀⠀⢿⡄⠀⠀⠀⠀⠀⢠⣿⣿⡀⠀⠀⠀⠀⠀⢠⡿⠀⠀⠘⣷⡀⠀ +⠀⣼⣏⣀⣀⣀⣈⣿⡀⠀⠀⠀⠀⣸⣿⣿⡇⠀⠀⠀⠀⢀⣿⣃⣀⣀⣀⣸⣧⠀ +⠀⢻⣿⣿⣿⣿⣿⣿⠃⠀⠀⠀⠀⣿⣿⣿⣿⠀⠀⠀⠀⠈⢿⣿⣿⣿⣿⣿⡿⠀ +⠀⠀⠉⠛⠛⠛⠋⠁⠀⠀⠀⠀⢸⣿⣿⣿⣿⡆⠀⠀⠀⠀⠈⠙⠛⠛⠛⠉⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣿⣿⣿⣿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⣿⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠴⠶⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠶⠦⠀⠀ +</pre> +<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>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>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>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 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>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 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 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</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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2023-12-10-bash-golf-part-3.html b/gemfeed/2023-12-10-bash-golf-part-3.html new file mode 100644 index 00000000..c69ef361 --- /dev/null +++ b/gemfeed/2023-12-10-bash-golf-part-3.html @@ -0,0 +1,435 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Bash Golf Part 3</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2023-12-10-bash-golf-part-3.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2023-12-10-bash-golf-part-3.gmi">Gemini</a> +</p> +<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>> + \ \ \ . ' . | + O>> O>> O>> . 'o | + \ .\. .. .\. .. . | + /\ . /\ . /\ . . | + / / . / / .'. / / .' . | +jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + Art by Joan Stark, mod. by Paul Buetow +</pre> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<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 /> +<span>This is particularly useful for logging when you want to include the callee function in the log output. E.g. look at this log helper:</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">#!/usr/bin/env bash</font></i> + +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> + + <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) + + echo <font color="#808080">"$level|$stamp|$pid|$callee|$message"</font> >&<font color="#000000">2</font> +} + +at_home_friday_evening () { + log INFO <font color="#808080">'One Peperoni Pizza, please'</font> +} + +at_home_friday_evening +</pre> +<br /> +<span>The output is 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>❯ ./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 /> +<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 /> +<ul> +<li><span class='inlinecode'>:(){ }</span> is really a declaration of the function <span class='inlinecode'>:</span></li> +<li>The <span class='inlinecode'>;</span> is ending the current statement</li> +<li>The <span class='inlinecode'>:</span> at the end is calling the function <span class='inlinecode'>:</span></li> +<li><span class='inlinecode'>:|:&</span> is the function body</li> +</ul><br /> +<span>Let's break down the function body <span class='inlinecode'>:|:&</span>: </span><br /> +<br /> +<ul> +<li>The first <span class='inlinecode'>:</span> is calling the function recursively</li> +<li>The <span class='inlinecode'>|:</span> is piping the output to the function <span class='inlinecode'>:</span> again (parallel recursion)</li> +<li>The <span class='inlinecode'>&</span> lets it run in the background.</li> +</ul><br /> +<span>So, it's a fork bomb. If you run it, your computer will run out of resources eventually. (Modern Linux distributions could have reasonable limits configured for your login session, so it won't bring down your whole system anymore unless you run it as <span class='inlinecode'>root</span>!)</span><br /> +<br /> +<span>And here is the cute illustration:</span><br /> +<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='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 /> +<!-- 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">#!/usr/bin/env bash</font></i> + +outer() { + inner() { + echo <font color="#808080">'Intel inside!'</font> + } + inner +} + +inner +outer +inner +</pre> +<br /> +<span>And let's execute it:</span><br /> +<br /> +<pre> +❯ ./inner.sh +/tmp/inner.sh: line 10: inner: command not found +Intel inside! +Intel inside! +</pre> +<br /> +<span>What happened? The first time <span class='inlinecode'>inner</span> was called, it wasn't defined yet. That only happens after the <span class='inlinecode'>outer</span> run. Note that <span class='inlinecode'>inner</span> will still be globally defined. But functions can be declared multiple times (the last version wins):</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">#!/usr/bin/env bash</font></i> + +outer1() { + inner() { + echo <font color="#808080">'Intel inside!'</font> + } + inner +} + +outer2() { + inner() { + echo <font color="#808080">'Wintel inside!'</font> + } + inner +} + +outer1 +inner +outer2 +inner +</pre> +<br /> +<span>And let's run it:</span><br /> +<br /> +<pre> +❯ ./inner2.sh +Intel inside! +Intel inside! +Wintel inside! +Wintel inside! +</pre> +<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 /> +<!-- 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">#!/usr/bin/env bash</font></i> + +some_expensive_operations() { + echo <font color="#808080">"Doing expensive operations with '$1' from pid $$"</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 /> +<br /> +<pre> +❯ ./xargs.sh +bash: line 1: some_expensive_operations: command not found +bash: line 1: some_expensive_operations: command not found +bash: line 1: some_expensive_operations: command not found +bash: line 1: some_expensive_operations: command not found +bash: line 1: some_expensive_operations: command not found +bash: line 1: some_expensive_operations: command not found +bash: line 1: some_expensive_operations: command not found +bash: line 1: some_expensive_operations: command not found +bash: line 1: some_expensive_operations: command not found +bash: line 1: some_expensive_operations: command not found +</pre> +<br /> +<span>There's an easy solution for this. Just export the function! It will then be magically available in any sub-shell!</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">#!/usr/bin/env bash</font></i> + +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><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 /> +<br /> +<pre> +❯ ./xargs.sh +Doing expensive operations with '0' from pid 132831 +Doing expensive operations with '1' from pid 132832 +Doing expensive operations with '2' from pid 132833 +Doing expensive operations with '3' from pid 132834 +Doing expensive operations with '4' from pid 132835 +Doing expensive operations with '5' from pid 132836 +Doing expensive operations with '6' from pid 132837 +Doing expensive operations with '7' from pid 132838 +Doing expensive operations with '8' from pid 132839 +Doing expensive operations with '9' from pid 132840 +</pre> +<br /> +<span>If <span class='inlinecode'>some_expensive_function</span> would call another function, the other function must also be exported. Otherwise, there will be a runtime error again. E.g., this won't 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><i><font color="silver">#!/usr/bin/env bash</font></i> + +some_other_function() { + echo <font color="#808080">"$1"</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><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='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 /> +<!-- 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">#!/usr/bin/env bash</font></i> + +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> +} + +bar() { + echo <font color="#808080">"$foo"</font> + foo=baz +} + +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 /> +<br /> +<span>Let's run it:</span><br /> +<br /> +<pre> +❯ ./dynamic.sh +bar +baz +foo +</pre> +<br /> +<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='if-conditionals'><span class='inlinecode'>if</span> conditionals</h2><br /> +<br /> +<span>Consider all variants here more or less equivalent:</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">#!/usr/bin/env bash</font></i> + +<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><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><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="#808080">"$foo"</font> = foo ] && [ <font color="#808080">"$bar"</font> == bar ] && echo ok2b + +<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="#808080">"$foo"</font> = foo && <font color="#808080">"$bar"</font> == bar ]] && echo ok3b + +<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><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 /> +<br /> +<pre> +❯ ./if.sh +ok1 +ok2a +ok2b +ok3a +ok3b +ok4a +ok4b +</pre> +<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 /> +<!-- 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">#!/usr/bin/env bash</font></i> + +<i><font color="silver"># Single line comment</font></i> + +<i><font color="silver"># These are two single line</font></i> +<i><font color="silver"># comments one after another</font></i> + +: <<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='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 /> +<!-- 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">#!/usr/bin/env bash</font></i> + +echo foo +echo echo baz >> $0 +echo bar +</pre> +<br /> +<span>When it is run, it will do:</span><br /> +<br /> +<pre> +❯ ./if.sh +foo +bar +baz +❯ cat if.sh +#!/usr/bin/env bash + +echo foo +echo echo baz >> $0 +echo bar +echo baz +</pre> +<br /> +<span>So what happened? The <span class='inlinecode'>echo baz</span> line was appended to the script while it was still executed! And the interpreter also picked it up! It tells us that Bash evaluates each line as it encounters it. This can lead to nasty side effects when editing the script while it is still being executed! You should always keep this in mind!</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='./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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2024-01-09-site-reliability-engineering-part-3.html b/gemfeed/2024-01-09-site-reliability-engineering-part-3.html new file mode 100644 index 00000000..b93d92a8 --- /dev/null +++ b/gemfeed/2024-01-09-site-reliability-engineering-part-3.html @@ -0,0 +1,84 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Site Reliability Engineering - Part 3: On-Call Culture</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2024-01-09-site-reliability-engineering-part-3.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2024-01-09-site-reliability-engineering-part-3.gmi">Gemini</a> +</p> +<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>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</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> + ..--""""----.. + .-" ..--""""--.j-. + .-" .-" .--.""--.. + .-" .-" ..--"-. \/ ; + .-" .-"_.--..--"" ..--' "-. : + .' .' / `. \..--"" __ _ \ ; + :.__.-" \ / .' ( )"-. Y + ; ;: ( ) ( ). \ + .': /:: : \ \ + .'.-"\._ _.-" ; ; ( ) .-. ( ) \ + " `.""" .j" : : \ ; ; \ + bug /"""""/ ; ( ) "" :.( ) \ + /\ / : \ \`.: _ \ + : `. / ; `( ) (\/ :" \ \ + \ `. : "-.(_)_.' t-' ; + \ `. ; ..--": + `. `. : ..--"" : + `. "-. ; ..--"" ; + `. "-.:_..--"" ..--" + `. : ..--"" + "-. : ..--"" + "-.;_..--"" + +</pre> +<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>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>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>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>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>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>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>Mistakes are gonna happen, which is why having a blameless on-call culture is so important.</span><br /> +<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 /> +<a class='textlink' href='../'>Back to the main site</a><br /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.html b/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.html new file mode 100644 index 00000000..f60200f2 --- /dev/null +++ b/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.html @@ -0,0 +1,89 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>One reason why I love OpenBSD</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.gmi">Gemini</a> +</p> +<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 /> +<pre> + FISHKISSFISHKIS + SFISHKISSFISHKISSFISH F + ISHK ISSFISHKISSFISHKISS FI + SHKISS FISHKISSFISHKISSFISS FIS +HKISSFISHKISSFISHKISSFISHKISSFISH KISS + FISHKISSFISHKISSFISHKISSFISHKISS FISHK + SSFISHKISSFISHKISSFISHKISSFISHKISSF + ISHKISSFISHKISSFISHKISSFISHKISSF ISHKI +SSFISHKISSFISHKISSFISHKISSFISHKIS SFIS + HKISSFISHKISSFISHKISSFISHKISS FIS + HKISSFISHKISSFISHKISSFISHK IS + SFISHKISSFISHKISSFISH K + ISSFISHKISSFISHK +</pre> +<br /> +<span>I just upgraded my OpenBSD's from <span class='inlinecode'>7.3</span> to <span class='inlinecode'>7.4</span> by following the unattended upgrade guide:</span><br /> +<br /> +<a class='textlink' href='https://www.openbsd.org/faq/upgrade74.html'>https://www.openbsd.org/faq/upgrade74.html</a><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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 /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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 /> +<br /> +<span>I followed the same procedure the previous times and never encountered any difficulties with any OpenBSD upgrades.</span><br /> +<br /> +<span>I have seen upgrades of other Operating Systems either take a long time or break the system (which takes manual steps to repair). That's just one of many reasons why I love OpenBSD! There appear never to be any problems. It just gets its job done!</span><br /> +<br /> +<a class='textlink' href='https://www.openbsd.org'>The OpenBSD Project</a><br /> +<br /> +<span>BTW: are you looking for an opinionated OpenBSD VM hoster? OpenBSD Amsterdam may be for you. They rock (I am having a VM there, too)!</span><br /> +<br /> +<a class='textlink' href='https://openbsd.amsterdam'>https://openbsd.amsterdam</a><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='./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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2024-02-04-from-babylon5.buetow.org-to-.cloud.html b/gemfeed/2024-02-04-from-babylon5.buetow.org-to-.cloud.html new file mode 100644 index 00000000..45d5409c --- /dev/null +++ b/gemfeed/2024-02-04-from-babylon5.buetow.org-to-.cloud.html @@ -0,0 +1,205 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>From `babylon5.buetow.org` to `*.buetow.cloud`</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2024-02-04-from-babylon5.buetow.org-to-.cloud.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2024-02-04-from-babylon5.buetow.org-to-.cloud.gmi">Gemini</a> +</p> +<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 /> +<span>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.</span><br /> +<br /> +<span>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</span><br /> +<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='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 /> +<a class='textlink' href='https://en.wikipedia.org/wiki/Babylon_5'>https://en.wikipedia.org/wiki/Babylon_5</a><br /> +<br /> +<span>The downsides of this setup were:</span><br /> +<br /> +<ul> +<li>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. </li> +<li>Manual installation.</li> +</ul><br /> +<span>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.</span><br /> +<br /> +<span>The benefits of this setup were:</span><br /> +<br /> +<ul> +<li>KISS (Keep it Simple Stupid)</li> +<li>Cheap</li> +</ul><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 /> +<span>My other two OpenBSD VMs (<span class='inlinecode'>blowfish.buetow.org</span>, hosted at Hetzner, and <span class='inlinecode'>fishfinger.buetow.org</span>, hosted at OpenBSD Amsterdam) still run (and they will keep running) the following services:</span><br /> +<br /> +<ul> +<li>HTTP server for my websites (e.g. <span class='inlinecode'>https://foo.zone</span>, ...)</li> +<li>ACME for Let's Encrypt TLS certificate auto-renewal.</li> +<li>Gemini server for my capsules (e.g. <span class='inlinecode'>gemini://foo.zone</span>)</li> +<li>Authoritative DNS servers for my domains (but <span class='inlinecode'>buetow.cloud</span>, which is on Route 53 now)</li> +<li>Mail transfer agent (MTA)</li> +<li>My Gogios monitoring system.</li> +<li>My IRC bouncer.</li> +</ul><br /> +<span>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.</span><br /> +<br /> +<a class='textlink' href='https://www.rexify.org'>(R)?ex, the friendly automation framework</a><br /> +<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='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 /> +<span>I decided to automate everything with Terraform, as I wanted to learn to use it as it appears standard now in the job market.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>The authoritative DNS for the <span class='inlinecode'>buetow.cloud</span> 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.</span><br /> +<br /> +<span>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, <span class='inlinecode'>eu-central-1</span>.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>The EFS automatically gets backed up by AWS for me following their standard Backup schedule. The daily backups are kept for 30 days. </span><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>You can find all Terraform manifests here:</span><br /> +<br /> +<a class='textlink' href='https://codeberg.org/snonux/terraform'>https://codeberg.org/snonux/terraform</a><br /> +<br /> +<span>Whereas:</span><br /> +<br /> +<ul> +<li><span class='inlinecode'>org-buetow-base</span> 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.</li> +<li><span class='inlinecode'>org-buetow-bastion</span> sets up a minimal Amazon Linux EC2 instance where I can manually SSH into and look at the EFS file system (if required).</li> +<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='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 /> +<h3 style='display: inline' id='fluxbuetowcloud'><span class='inlinecode'>flux.buetow.cloud</span></h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>Miniflux requires two ECS containers. One is the Miniflux app, and the other is the PostgreSQL DB.</span><br /> +<br /> +<a class='textlink' href='https://miniflux.app/'>https://miniflux.app/</a><br /> +<br /> +<br /> +<h3 style='display: inline' id='audiobookshelfbuetowcloud'><span class='inlinecode'>audiobookshelf.buetow.cloud</span></h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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 :-)</span><br /> +<br /> +<a class='textlink' href='https://www.audiobookshelf.org'>https://www.audiobookshelf.org</a><br /> +<br /> +<h3 style='display: inline' id='syncthingbuetowcloud'><span class='inlinecode'>syncthing.buetow.cloud</span></h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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 <span class='inlinecode'>Notes</span> 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.</span><br /> +<br /> +<span>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).</span><br /> +<br /> +<a class='textlink' href='https://syncthing.net/'>https://syncthing.net/</a><br /> +<br /> +<h3 style='display: inline' id='radicalebuetowcloud'><span class='inlinecode'>radicale.buetow.cloud</span></h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>On Android, it works great together with the DAVx5 client for synchronisation.</span><br /> +<br /> +<a class='textlink' href='https://radicale.org/'>https://radicale.org/</a><br /> +<a class='textlink' href='https://codeberg.org/snonux/docker-radicale-server'>https://codeberg.org/snonux/docker-radicale-server</a><br /> +<a class='textlink' href='https://www.davx5.com/'>https://www.davx5.com/</a><br /> +<br /> +<h3 style='display: inline' id='bagbuetowcloud'><span class='inlinecode'>bag.buetow.cloud</span></h3><br /> +<br /> +<span>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!</span><br /> +<br /> +<a class='textlink' href='https://wallabag.org/'>https://wallabag.org/</a><br /> +<a class='textlink' href='https://github.com/wallabag/wallabag'>https://github.com/wallabag/wallabag</a><br /> +<br /> +<h3 style='display: inline' id='ankibuetowcloud'><span class='inlinecode'>anki.buetow.cloud</span></h3><br /> +<br /> +<span>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 <span class='inlinecode'>anki-sync-server</span>. For some reason (not going into the details here), I had to build my own Docker image for the server.</span><br /> +<br /> +<a class='textlink' href='https://apps.ankiweb.net/'>https://apps.ankiweb.net/</a><br /> +<a class='textlink' href='https://codeberg.org/snonux/docker-anki-sync-server'>https://codeberg.org/snonux/docker-anki-sync-server</a><br /> +<br /> +<h3 style='display: inline' id='vaultbuetowcloud'><span class='inlinecode'>vault.buetow.cloud</span></h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>I currently don't use it, but I may in the future. I made it available in my ECS Fargate setup anyway for now.</span><br /> +<br /> +<a class='textlink' href='https://github.com/dani-garcia/vaultwarden'>https://github.com/dani-garcia/vaultwarden</a><br /> +<br /> +<span>I currently use <span class='inlinecode'>geheim</span>, a Ruby command line tool I wrote, as my current password manager. You can read a little bit about it here under "More":</span><br /> +<br /> +<a class='textlink' href='./2022-06-15-sweating-the-small-stuff.html'>Sweating the small stuff </a><br /> +<br /> +<h3 style='display: inline' id='bastionbuetowcloud'><span class='inlinecode'>bastion.buetow.cloud</span></h3><br /> +<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 /> +<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 /> +<span>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.</span><br /> +<br /> +<span>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! </span><br /> +<br /> +<span>Will I keep it in the cloud? I don't know yet. But maybe I won't renew the <span class='inlinecode'>buetow.cloud</span> domain and instead will use <span class='inlinecode'>*.cloud.buetow.org</span> or <span class='inlinecode'>*.aws.buetow.org</span> subdomains. </span><br /> +<br /> +<span>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.</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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.html b/gemfeed/2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.html new file mode 100644 index 00000000..b48aa9ee --- /dev/null +++ b/gemfeed/2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.html @@ -0,0 +1,80 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>A fine Fyne Android app for quickly logging ideas programmed in Go</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.gmi">Gemini</a> +</p> +<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 /> +<span>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. </span><br /> +<br /> +<span>I have tried many note apps for my Android (I use GrapheneOS) phone. Most of them either don't do what I want, are proprietary software, require Google Play services (I have the main profile on my phone de-googled) or are too bloated. I was never into mobile app development, as I'm not too fond of the complexity of the developer toolchains. I don't want to use Android Studio (as a NeoVim user), and I don't want to use Java or Kotlin. I want to use a language I know (and like) for mobile app development. Go would be one of those languages.</span><br /> +<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 /> +<a class='textlink' href='https://fyne.io'>https://fyne.io</a><br /> +<a class='textlink' href='https://go.dev'>https://go.dev</a><br /> +<br /> +<span>There's no need to navigate complex menus or deal with sync issues. I jot down my Idea, and Quick logger saves it to a plain text file in a designated local folder on my phone. There is one text file per note (timestamp in the file name). Once logged, the file can't be edited anymore (it keeps it simple). If I want to correct or change a note, I simply write a new one. My notes are always small (usually one short sentence each), so there isn't the need for an edit functionality. I can edit them later on my actual computer if I want to.</span><br /> +<br /> +<span>With Syncthing, the note files are then synchronised to my home computer to my <span class='inlinecode'>~/Notes</span> directory. From there, a small glue Raku script adds them to my Taskwarrior DB so that I can process them later (e.g. take action on that one Idea I had). That then will delete the original note files from my computer and also (through Syncthing) from my phone.</span><br /> +<br /> +<a class='textlink' href='https://syncthing.net'>https://syncthing.net</a><br /> +<a class='textlink' href='https://raku.org'>https://raku.org</a><br /> +<a class='textlink' href='https://taskwarrior.org'>https://taskwarrior.org</a><br /> +<br /> +<span>Quick logger's user interface is as minimal as it gets. When I launch Quick logger, I'm greeted with a simple window where I can type plain text. Hit the "Log text" button, and voilà – the input is timestamped and saved as a file in my chosen directory. If I need to change the directory, the "Preferences" button brings up a window where I can set the notes folder and get back to logging.</span><br /> +<br /> +<span>For the code-savvy folks out there, Quick logger is a neat example of what you can achieve with Go and Fyne. It's a testament to building functional, cross-platform apps without getting bogged down in the nitty-gritty of platform-specific details. Thanks to Fyne, I am pleased with how easy it is to make mobile Android apps in Go.</span><br /> +<br /> +<a href='a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang/screenshot-android.png'><img alt='Quick logger running on Android' title='Quick logger running on Android' src='a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang/screenshot-android.png' /></a><br /> +<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='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 /> +<a class='textlink' href='https://github.com/fyne-io/fyne/issues/3077#issuecomment-1912697360'>https://github.com/fyne-io/fyne/issues/3077#issuecomment-1912697360</a><br /> +<br /> +<span class='quote'>What worked however (app icon showing up) was to clone the fyne project, change the occurances of android.permission.INTERNET to android.permission.MANAGE_EXTERNAL_STORAGE (as these are all the changes I want in my custom android manifest) in the source tree, re-compile fyne. Now all works. I know, this is more of an hammer approach!</span><br /> +<br /> +<span>Hopefully, I won't need to use this workaround anymore. But for now, it is a fair tradeoff for what I am getting.</span><br /> +<br /> +<span>I hope this will inspire you to write your own small mobile apps in Go using the awesome Fyne framework! PS: The Quick logger logo was generated by ChatGPT.</span><br /> +<br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<span>Other Go related posts are:</span><br /> +<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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.html b/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.html new file mode 100644 index 00000000..e2a81eeb --- /dev/null +++ b/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.html @@ -0,0 +1,352 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>KISS high-availability with OpenBSD</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi">Gemini</a> +</p> +<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 + __________ + / nsd tower\ ( + /____________\ (\) awk-ward + |:_:_:_:_:_| )) plant + |_:_,--.:_:| dig-bubble (\// ) + |:_:|__|_:_| relayd-castle _ ) )) (( + _ |_ _ :_:| _ _ _ (_) (((( /)\` + | |_| |_| | _| | |_| |_| | o \\)) (( ( + \_:_:_:_:/|_|_|_|\:_:_:_:_/ . (( )))) + |_,-._:_:_:_:_:_:_:_.-,_| )) ((// + |:|_|:_:_:,---,:_:_:|_|:| ,-. )/ + |_:_:_:_,'puffy `,_:_:_:_| _ o ,;'))(( + |:_:_:_/ _ | _ \_:_:_:| (_O (( )) +_____|_:_:_| (o)-(o) |_:_:_|--'`-. ,--. ksh under-water (((\'/ + ', ;|:_:_:| -( .-. )- |:_:_:| ', ; `--._\ /,---.~ goat \`)) +. ` |_:_:_| \`-'/ |_:_:_|. ` . ` /()\.__( ) .,-----'`-\(( sed-root + ', ;|:_:_:| `-' |:_:_:| ', ; ', ; `--'| \ ', ; ', ; ',')).,-- +. ` MJP ` . ` . ` . ` . httpd-soil ` . . ` . ` . ` . ` . ` + ', ; ', ; ', ; ', ; ', ; ', ; ', ; ', ; ', ; ', ; ', ; ', ; ', ; ', ; + +</pre> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<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> +<li>Don't rely on the hottest and newest tech (don't want to migrate everything to a new and fancier technology next month already!).</li> +<li>It should be reasonably cheap. I want to avoid paying a premium for floating IPs or fancy Elastic Load Balancers.</li> +<li>It should be geo-redundant. </li> +<li>It's fine if my sites aren't reachable for five or ten minutes every other month. Due to their static nature, I don't care if there's a split-brain scenario where some requests reach one server and other requests reach another server.</li> +<li>Failover should work for both HTTP/HTTPS and Gemini protocols. My self-hosted MTAs and DNS servers should also be highly available.</li> +<li>Let's Encrypt TLS certificates should always work (before and after a failover).</li> +<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='my-ha-solution'>My HA solution</h2><br /> +<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 /> +<a class='textlink' href='https://man.OpenBSD.org/nsd.8'>https://man.OpenBSD.org/nsd.8</a><br /> +<a class='textlink' href='https://man.OpenBSD.org/ksh'>https://man.OpenBSD.org/ksh</a><br /> +<a class='textlink' href='https://man.OpenBSD.org/awk'>https://man.OpenBSD.org/awk</a><br /> +<a class='textlink' href='https://man.OpenBSD.org/sed'>https://man.OpenBSD.org/sed</a><br /> +<a class='textlink' href='https://man.OpenBSD.org/dig'>https://man.OpenBSD.org/dig</a><br /> +<a class='textlink' href='https://man.OpenBSD.org/ftp'>https://man.OpenBSD.org/ftp</a><br /> +<a class='textlink' href='https://man.OpenBSD.org/cron'>https://man.OpenBSD.org/cron</a><br /> +<br /> +<span>I also used the <span class='inlinecode'>dig</span> (for DNS checks) and <span class='inlinecode'>ftp</span> (for HTTP/HTTPS checks) programs. </span><br /> +<br /> +<span>The DNS failover is performed automatically between the two OpenBSD VMs involved (my setup doesn't require any quorum for a failover, so there isn't a need for a 3rd VM). The <span class='inlinecode'>ksh</span> script, executed once per minute via CRON (on both VMs), performs a health check to determine whether the current master node is available. If the current master isn't available (no HTTP response as expected), a failover is performed to the standby VM: </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">#!/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 /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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>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 /> +<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">#! 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 /> +<br /> +<span>The authorative nameserver for my domains runs on both VMs, and both are configured to be a "master" DNS server so that they have their own individual zone files, which can be changed independently. Otherwise, my setup wouldn't work. The side effect is that under a split-brain scenario (both VMs cannot see each other), both would promote themselves to master via their local DNS entries. More about that later, but that's fine in my use case.</span><br /> +<br /> +<span>Check out the whole script here:</span><br /> +<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='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 /> +<a class='textlink' href='https://OpenBSD.Amsterdam'>https://OpenBSD.Amsterdam</a><br /> +<a class='textlink' href='https://www.Hetzner.cloud'>https://www.Hetzner.cloud</a><br /> +<br /> +<span>I only have a little traffic on my sites. I could always upload the static content to AWS S3 if I suddenly had to. But this will never be required.</span><br /> +<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='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='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 /> +<a class='textlink' href='https://man.OpenBSD.org/httpd.8'>https://man.OpenBSD.org/httpd.8</a><br /> +<a class='textlink' href='https://man.OpenBSD.org/relayd.8'>https://man.OpenBSD.org/relayd.8</a><br /> +<br /> +<span>For example, the master is responsible for the <span class='inlinecode'>https://www.foo.zone</span> and <span class='inlinecode'>https://foo.zone</span> hosts, whereas the standby can be reached via <span class='inlinecode'>https://standby.foo.zone</span> (port 80 for plain HTTP works as well). The same principle is followed with all the other hosts, e.g. <span class='inlinecode'>irregular.ninja</span>, <span class='inlinecode'>paul.buetow.org</span> and so on. The same applies to my Gemini capsules for <span class='inlinecode'>gemini://foo.zone</span>, <span class='inlinecode'>gemini://standby.foo.zone</span>, <span class='inlinecode'>gemini://paul.buetow.org</span> and <span class='inlinecode'>gemini://standby.paul.buetow.org</span>.</span><br /> +<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='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 /> +<span>If the master always serves <span class='inlinecode'>foo.zone</span> and the standby always <span class='inlinecode'>standby.foo.zone</span>, then there would be a problem after the failover, as the new master wouldn't have a valid certificate for <span class='inlinecode'>foo.zone</span> and the new standby wouldn't have a valid certificate for <span class='inlinecode'>standby.foo.zone</span> which would lead to TLS errors on the clients.</span><br /> +<br /> +<span>As a solution, the CRON job responsible for the DNS failover also checks for the current week number of the year so that:</span><br /> +<br /> +<ul> +<li>In an odd week number, the first server is the default master</li> +<li>In an even week number, the second server is the default master.</li> +</ul><br /> +<span>Which translates to:</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"># 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 /> +<br /> +<span>The ACME automation is yet another daily CRON script <span class='inlinecode'>/usr/local/bin/acme.sh</span>. It iterates over all of my Let's Encrypt hosts, checks whether they resolve to the same IP address as the current VM, and only then invokes the ACME client to request or renew the TLS certificates. So, there are always correct requests made to Let's Encrypt. </span><br /> +<br /> +<span>Let's encrypt certificates usually expire after 3 months, so a weekly failover of my VMs is plenty.</span><br /> +<br /> +<a class='textlink' href='https://codeberg.org/snonux/rexfiles/src/branch/master/frontends/scripts/acme.sh.tpl'><span class='inlinecode'>acme.sh.tpl</span> - Rex template for the <span class='inlinecode'>acme.sh</span> script of mine.</a><br /> +<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 /> +<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 /> +<a class='textlink' href='https://codeberg.org/snonux/gogios'>https://codeberg.org/snonux/gogios</a><br /> +<a class='textlink' href='./2023-06-01-kiss-server-monitoring-with-gogios.html'>KISS server monitoring with Gogios</a><br /> +<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='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 /> +<a class='textlink' href='https://www.rexify.org'>https://www.rexify.org</a><br /> +<a class='textlink' href='https://codeberg.org/snonux/rexfiles/src/branch/master/frontends'>codeberg.org/snonux/rexfiles/frontends</a><br /> +<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='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 /> +<a class='textlink' href='https://www.OpenSMTPD.org/'>https://www.OpenSMTPD.org/</a><br /> +<br /> +<span>As a password manager, I use <span class='inlinecode'>geheim</span>, a command-line tool I wrote in Ruby with encrypted files in a git repository (I even have it installed in Termux on my Phone). For HA reasons, I simply updated the client code so that it always synchronises the database with both servers when I run the <span class='inlinecode'>sync</span> command there. </span><br /> +<br /> +<a class='textlink' href='https://codeberg.org/snonux/geheim'>https://codeberg.org/snonux/geheim</a><br /> +<br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<span>Other *BSD and KISS 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</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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2024-05-01-slow-productivity-book-notes.html b/gemfeed/2024-05-01-slow-productivity-book-notes.html new file mode 100644 index 00000000..032fdb19 --- /dev/null +++ b/gemfeed/2024-05-01-slow-productivity-book-notes.html @@ -0,0 +1,176 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>'Slow Productivity' book notes</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2024-05-01-slow-productivity-book-notes.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2024-05-01-slow-productivity-book-notes.gmi">Gemini</a> +</p> +<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 /> +<span>These are my personal takeaways after reading "Slow Productivity - The lost Art of Accomplishment Without Burnout" by Cal Newport.</span><br /> +<br /> +<span>The case studies in this book were a bit long, but they appeared to be well-researched. I will only highlight the interesting, actionable items in the book notes.</span><br /> +<br /> +<span>These notes are mainly for my own use, but you may find them helpful.</span><br /> +<br /> +<pre> + ,.......... .........., + ,..,' '.' ',.., + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,'............., : ,.............', ', +,' '............ '.' ............' ', + '''''''''''''''''';''';'''''''''''''''''' + ''' +</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='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 /> +<br /> +<span>There is a tendency to perform shallow work because people will otherwise dismiss you as lazy. A lot of shallow work can cause burnout, as multiple things are often being worked on in parallel. The more you have on your plate, the more stressed you will be.</span><br /> +<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='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 /> +<span>There are three principles for the maintenance of a sustainable work life:</span><br /> +<br /> +<ul> +<li>Do fewer things</li> +<li>Work at a natural pace</li> +<li>Obsess over quality</li> +</ul><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 /> +<span>Reduce the overhead tax. The overhead tax is all the administrative work to be done. With every additional project, there will also be more administrative stuff to be done on your work plate. So, doing fewer things leads to more and better output and better quality for the projects you are working on.</span><br /> +<br /> +<span>Limit the things on your plate. Limit your missions (personal goals, professional goals). Reduce your main objectives in life. More than five missions are usually not sustainable very easily, so you have to really prioritise what is important to you and your professional life.</span><br /> +<br /> +<span>A mission is an overall objective/goal that can have multiple projects. Limit the projects as well. Some projects need clear endings (e.g., work in support of a never-ending flow of incoming requests). In this case, set limits (e.g., time box your support hours). You can also plan "office hours" for collaborative work with colleagues to avoid ad hoc distractions.</span><br /> +<br /> +<span>The key point is that after making these commitments, you really deliver on them. This builds trust, and people will leave you alone and not ask for progress all the time.</span><br /> +<br /> +<span>Doing fever things is essential for modern knowledge workers. Breathing space in your work also makes you more creative and happier overall.</span><br /> +<br /> +<span>Pushing workers more work can make them less productive, so the better approach is the pull model, where workers pull in new work when the previous task is finished.</span><br /> +<br /> +<span>If you can quantify how busy you are or how many other projects you already work on, then it is easier to say no to new things. For example, show what you are doing, what's in the roadmap, etc. Transparency is the key here. </span><br /> +<br /> +<span>You can have your own simulated pull system if the company doesn't agree to a global one: </span><br /> +<br /> +<ul> +<li>State which additional information you would need.</li> +<li>Create a rough estimate of when you will be able to work on it</li> +<li>Estimate how long the project would take. Double that estimate, as humans are very bad estimators.</li> +<li>Respond to the requester and state that you will let him know when the estimates change.</li> +</ul><br /> +<span>Sometimes, a little friction is all that is needed to combat incoming work, e.g., when your manager starts seeing the reality of your work plate, and you also request additional information for the task. If you already have too much on your plate, then decline the new project or make room for it in your calendar. If you present a large task list, others will struggle to assign more to you.</span><br /> +<br /> +<span>Limit your daily goals. A good measure is to focus on one goal per day. You can time block time for deep work on your daily goal. During that time, you won't be easily available to others.</span><br /> +<br /> +<span>The battle against distractions must be fought to be the master of your time. Nobody will fight this war for you. You have to do it for yourself. (Also, have a look at Cal Newport's "time block planning" method).</span><br /> +<br /> +<span>Put tasks on autopilot (regular recurring tasks).</span><br /> +<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 /> +<span>Don't rush. If you rush or are under pressure, you will be less effective and eventually burn out. Our brains work better then not rushy. The stress heuristic usually indicates too much work, and it is generally too late to reduce workload. That's why we all typically have dangerously too much to do.</span><br /> +<br /> +<span>Have the courage to take longer to do things that are important. For example, plan on a yearly and larger scale, like 2 to 5 years.</span><br /> +<br /> +<span>Find a reasonable time for a project and then double the project timeline against overconfident optimism. Humans are not great at estimating. They gravitate towards best-case estimates. If you have planned more than enough time for your project, then you will fall into a natural work pace. Otherwise, you will struggle with rushing and stress.</span><br /> +<br /> +<span>Some days will still be intense and stressful, but those are exceptional cases. After those exceptions (e.g., finalizing that thing, etc.), calmer periods will follow again.</span><br /> +<br /> +<span>Pace yourself over modest results over time. Simplify and reduce the daily task lists. Meetings: Certain hours are protected for work. For each meeting, add a protected block to your calendar, so you attend meetings only half a day max.</span><br /> +<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='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 /> +<ul> +<li>Focus on the core activities of your work for your obsession - you will only have the time to obsess over some things.</li> +<li>Deliver solid work with good quality.</li> +<li>Sharpen the focus to do the best work possible.</li> +</ul><br /> +<span>Go pro to save time, and don't squeeze everything out that you can from freemium services. Professional software services eliminate administrative work:</span><br /> +<br /> +<ul> +<li>Pay people who know what they are doing and focus on your stuff. </li> +<li>For example, don't repair that car if you know the mechanic can do that much better than you. </li> +<li>Or don't use the free version of the music streaming service if it interrupts you with commercials, hindering your ability to concentrate on your work.</li> +<li>Hire an accountant for your yearly tax returns. He knows much more about that stuff than you do. And in the end, he will even be cheaper as he knows all the tax laws.</li> +<li>...</li> +</ul><br /> +<span>Adjust your workplace to what you want to accomplish. You could have dedicated places in your home for different things, e.g., a place where you read and think (armchair) and a place where you collaborate (your desk or whiteboard). Surround yourself with things that inspire you (e.g., your favourite books on your shelf next to you, etc.).</span><br /> +<br /> +<span>There is the concept of quiet quitting. It doesn't mean quitting your job, but it means that you don't go beyond and above the expectations people have of you. Quiet quitting became popular with modern work, which is often meaningless and full of shallow tasks. If you obsess over quality, you enjoy your craft and want to go beyond and above.</span><br /> +<br /> +<span>Implement rituals and routines which shift you towards your goals:</span><br /> +<br /> +<ul> +<li>For example, if you want to be a good Software Engineer, you also have to put in the work regularly. For instance, progress a bit every day in your project at hand, even if it is only one hour daily. Also, a little quality daily work will be more satisfying over time than many shallow tasks.</li> +<li>Do you want to be lean and/or healthy? Schedule your daily walks and workouts. They will become habits over time.</li> +<li>There's the compounding effect where every small effort made every day will yield significant results in the long run</li> +</ul><br /> +<span>Deciding what not to do is as important as deciding what to do. </span><br /> +<br /> +<span>It appears to be money thrown out of the window, but you get a $50 expensive paper notebook (and also a good pen). Unconsciously, it will make you take notes more seriously. You will think about what to put into the notebooks more profoundly and have thought through the ideas more intensively. If you used very cheap notebooks, you would scribble a lot of rubbish and wouldn't even recognise your handwriting after a while anymore. So choosing a high-quality notebook will help you to take higher-quality notes, too.</span><br /> +<br /> +<span>Slow productivity is actionable and can be applied immediately.</span><br /> +<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</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='../'>Back to the main site</a><br /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2024-05-03-projects-i-currently-dont-have-time-for.html b/gemfeed/2024-05-03-projects-i-currently-dont-have-time-for.html new file mode 100644 index 00000000..b587a791 --- /dev/null +++ b/gemfeed/2024-05-03-projects-i-currently-dont-have-time-for.html @@ -0,0 +1,335 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Projects I currently don't have time for</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2024-05-03-projects-i-currently-dont-have-time-for.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2024-05-03-projects-i-currently-dont-have-time-for.gmi">Gemini</a> +</p> +<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 + +.'`~~~~~~~~~~~`'. +( .'11 12 1'. ) +| :10 \ 2: | +| :9 @-> 3: | +| :8 4; | +'. '..7 6 5..' .' + ~-------------~ ldb + +</pre> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<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 /> +<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='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 /> +<span>I had the idea to revive this concept, implement <span class='inlinecode'>fishbone2</span>, and place it in front of my proprietary ISP router to add an extra layer of security and control in my home LAN. It would serve as the default gateway for all of my devices, including a Wi-Fi access point, would run a DNS server, Pi-hole proxy, VPN client, and DynDNS client. I would also implement high availability using OpenBSD's CARP protocol.</span><br /> +<br /> +<a class='textlink' href='https://openbsdrouterguide.net'>https://openbsdrouterguide.net</a><br /> +<a class='textlink' href='https://pi-hole.net/'>https://pi-hole.net/</a><br /> +<a class='textlink' href='https://www.OpenBSD.org'>https://www.OpenBSD.org</a><br /> +<a class='textlink' href='https://www.OpenBSD.org/faq/pf/carp.html'>https://www.OpenBSD.org/faq/pf/carp.html</a><br /> +<br /> +<span>However, I am putting this on hold as I have opted for an OpenWRT-based solution, which was much quicker to set up and runs well enough.</span><br /> +<br /> +<a class='textlink' href='https://OpenWRT.org/'>https://OpenWRT.org/</a><br /> +<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 /> +<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='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='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 /> +<span>I would use an old ThinkPad laptop placed on a horizontal stand, running NetBSD, and attaching a keyboard from ModelFkeyboards. I use WindowMaker as a window manager and run terminal applications through Retro Term. For the monitor, I would use an older (black) EIZO model with large bezels.</span><br /> +<br /> +<a class='textlink' href='https://www.NetBSD.org'>https://www.NetBSD.org</a><br /> +<a class='textlink' href='https://www.modelfkeyboards.com'>https://www.modelfkeyboards.com</a><br /> +<a class='textlink' href='https://github.com/Swordfish90/cool-retro-term)'>https://github.com/Swordfish90/cool-retro-term)</a><br /> +<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='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='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 /> +<ul> +<li>Wallabag</li> +<li>Ankidroid</li> +<li>Miniflux & Postgres</li> +<li>Audiobookshelf</li> +<li>...</li> +</ul><br /> +<span>All of this would be within my LAN, but the services would also be accessible from the internet through either Wireguard or SSH reverse tunnels to one of my OpenBSD VMs, for example:</span><br /> +<br /> +<ul> +<li><span class='inlinecode'>wallabag.awesome.buetow.org</span></li> +<li><span class='inlinecode'>ankidroid.awesome.buetow.org</span></li> +<li><span class='inlinecode'>miniflux.awesome.buetow.org</span></li> +<li><span class='inlinecode'>audiobookshelf.awesome.buetow.org</span></li> +<li>...</li> +</ul><br /> +<span>I am abandoning this project for now, as I am currently hosting my apps on AWS ECS Fargate under <span class='inlinecode'>*.cool.buetow.org</span>, which is "good enough" for the time being and also offers the benefit of learning to use AWS and Terraform, knowledge that can be applied at work.</span><br /> +<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='programming-projects-i-don-t-have-time-for'>Programming projects I don't have time for</h2><br /> +<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='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 /> +<ul> +<li>A feature I miss presents me with a random day from the past and some photos from that day. This project would randomly select a day and generate a photo album for me to view and reminisce about memories.</li> +<li>Another feature I miss is the ability to automatically deduplicate all the photos, as I am sure there are tons of duplicates on my NAS.</li> +<li>Auto-enhancing the photos (perhaps using ImageMagick?)</li> +<li>I already have a simple <span class='inlinecode'>photoalbum.sh</span> script that generates an album based on an input directory. However, it would be great also to have a timeline feature to enable browsing through different dates.</li> +</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='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 /> +<span>I currently use Syncthing for encrypted file sync across all my devices; however, the data is not end-to-end encrypted. It's a good-enough setup, though, as my Syncthing server is in my home LAN on an encrypted file system.</span><br /> +<br /> +<a class='textlink' href='https://syncthing.net'>https://syncthing.net</a><br /> +<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='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 /> +<span>I had previously implemented a tiny scripting language called Fype (For Your Program Execution), which could have served as inspiration.</span><br /> +<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='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='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 /> +<a class='textlink' href='https://codeberg.org/snonux/vs-sim'>https://codeberg.org/snonux/vs-sim</a><br /> +<br /> +<span>The ideas I had was:</span><br /> +<br /> +<ul> +<li>Translate the project into English.</li> +<li>Modernise the Java codebase to be compatible with the latest JDK.</li> +<li>Make it compile to native binaries using GraalVM.</li> +<li>Distribute the project using AppImages.</li> +</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='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='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 /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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='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='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='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='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 /> +<a class='textlink' href='https://github.com/Librum-Reader/Librum'>https://github.com/Librum-Reader/Librum</a><br /> +<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='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 /> +<a class='textlink' href='https://www.usememos.com'>https://www.usememos.com</a><br /> +<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='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='books-i-don-t-have-time-to-read'>Books I don't have time to read</h2><br /> +<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='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='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 /> +<a class='textlink' href='https://paul.buetow.org/novels.html'>https://paul.buetow.org/novels.html</a><br /> +<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='new-websites-i-don-t-have-time-for'>New websites I don't have time for</h2><br /> +<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 /> +<span>This would be similar to the "Why OpenBSD rocks" site:</span><br /> +<br /> +<a class='textlink' href='https://why-openbsd.rocks'>https://why-openbsd.rocks</a><br /> +<a class='textlink' href='https://raku.org'>https://raku.org</a><br /> +<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='research-projects-i-don-t-have-time-for'>Research projects I don't have time for</h2><br /> +<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 /> +<a class='textlink' href='https://lwn.net/Articles/865256/'>https://lwn.net/Articles/865256/</a><br /> +<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='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 /> +<a class='textlink' href='https://brendangregg.com/blog/2017-05-09/cpu-utilization-is-wrong.html'>https://brendangregg.com/blog/2017-05-09/cpu-utilization-is-wrong.html</a><br /> +<br /> +<span>The research project would involve setting up dashboards that display actual CPU usage and the cycles versus waiting time for memory access.</span><br /> +<br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<span>Related and maybe interesting:</span><br /> +<br /> +<a class='textlink' href='./2022-06-15-sweating-the-small-stuff.html'>Sweating the small stuff - Tiny projects of mine</a><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2024-06-23-terminal-multiplexing-with-tmux.html b/gemfeed/2024-06-23-terminal-multiplexing-with-tmux.html new file mode 100644 index 00000000..e39ce96c --- /dev/null +++ b/gemfeed/2024-06-23-terminal-multiplexing-with-tmux.html @@ -0,0 +1,442 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Terminal multiplexing with `tmux`</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2024-06-23-terminal-multiplexing-with-tmux.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2024-06-23-terminal-multiplexing-with-tmux.gmi">Gemini</a> +</p> +<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> + _______ + |.-----.| + || Tmux|| + ||_.-._|| + `--)-(--` + __[=== o]___ + |:::::::::::|\ +jgs `-=========-`() + mod. by Paul B. +</pre> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<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 /> +<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 /> +<a class='textlink' href='https://github.com/tmux/tmux/wiki/Getting-Started'>https://github.com/tmux/tmux/wiki/Getting-Started</a><br /> +<br /> +<span>I can also recommend this book (this is the book I got started with with Tmux):</span><br /> +<br /> +<a class='textlink' href='https://pragprog.com/titles/bhtmux2/tmux-2/'>https://pragprog.com/titles/bhtmux2/tmux-2/</a><br /> +<br /> +<span>Over the years, I have built a couple of shell helper functions to optimize my workflows. Tmux is extensively integrated into my daily workflows (personal and work). I had colleagues asking me about my Tmux config and helper scripts for Tmux several times. It would be neat to blog about it so that everyone interested in it can make a copy of my configuration and scripts.</span><br /> +<br /> +<span>The configuration and scripts in this blog post are only the non-work-specific parts. There are more helper scripts, which I only use for work (and aren't really useful outside of work due to the way servers and clusters are structured there).</span><br /> +<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='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 /> +<a class='textlink' href='https://www.zsh.org'>https://www.zsh.org</a><br /> +<br /> +<span>For the most common Tmux commands I use, I have created the following shell aliases:</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">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='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 /> +<!-- 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"># 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='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 /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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='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='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 /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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='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 /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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='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 /> +<pre> +set-option -g prefix C-g +</pre> +<br /> +<span>This way, when I want to rename the remote Tmux session, I have to use <span class='inlinecode'>Ctrl-g $</span>, and when I want to rename the local Tmux session, I still have to use <span class='inlinecode'>Ctrl-b $</span>. In my case, I have this deployed to all remote servers through a configuration management system (out of scope for this blog post).</span><br /> +<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='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 /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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 /> +<br /> +<span>You must install the <span class='inlinecode'>fzf</span> command on your computer for this to work. This is how it looks like:</span><br /> +<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='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 /> +<a class='textlink' href='https://github.com/duncs/clusterssh'>https://github.com/duncs/clusterssh</a><br /> +<br /> +<span>However, since I started using Tmux, I retired ClusterSSH, as it came with the benefit that Tmux only needs to be run in the terminal, whereas ClusterSSH spawned terminal windows, which aren't easily portable (e.g., from a Linux desktop to macOS). The <span class='inlinecode'>tmux::cluster_ssh</span> function can have N arguments, where:</span><br /> +<br /> +<ul> +<li>...the first argument will be the session name (see <span class='inlinecode'>tmux::tssh_from_argument</span> helper function), and all remaining arguments will be server hostnames/FQDNs to connect to simultaneously.</li> +<li>...or, the first argument is a file name, and the file contains a list of hostnames/FQDNs (see <span class='inlinecode'>tmux::ssh_from_file</span> helper function)</li> +</ul><br /> +<span>This is the function definition behind the <span class='inlinecode'>tssh</span> alias:</span><br /> +<span> </span><br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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> + + 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='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 /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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 /> +<br /> +<span>Sometimes, I don't want the synchronized panes behavior and want to switch it off temporarily. I can do that with <span class='inlinecode'>prefix-key p</span> and <span class='inlinecode'>prefix-key P</span> after adding the following to my local <span class='inlinecode'>tmux.conf</span>:</span><br /> +<br /> +<pre> +bind-key p setw synchronize-panes off +bind-key P setw synchronize-panes on +</pre> +<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 /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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>) + + 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='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 /> +<pre> +$ tssh fish blowfish.buetow.org fishfinger.buetow.org \ + fishbone.buetow.org user@octopus.buetow.org +</pre> +<br /> +<span>To open a new session named <span class='inlinecode'>manyservers</span>, put many servers (one FQDN per line) into a file called <span class='inlinecode'>manyservers.txt</span> and simply run:</span><br /> +<br /> +<pre> +$ tssh manyservers.txt +</pre> +<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 /> +<ul> +<li>Press <span class='inlinecode'>prefix-key DIRECTION</span> to switch panes. DIRECTION is by default any of the arrow keys, but I also configured Vi keybindings.</li> +<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='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 /> +<span>This works by pressing <span class='inlinecode'>prefix-key [</span> to enter Tmux copy mode. From there, I can browse the Tmux history of the current window using either the arrow keys or vi-like navigation (see vi configuration later in this blog post) and the Pg-Dn and Pg-Up keys.</span><br /> +<br /> +<span>I often search the history backwards with <span class='inlinecode'>prefix-key [</span> followed by a <span class='inlinecode'>?</span>, which opens the Tmux history search prompt.</span><br /> +<br /> +<span>Once I have identified the terminal text to be copied, I enter visual select mode with <span class='inlinecode'>v</span>, highlight all the text to be copied (using arrow keys or Vi motions), and press <span class='inlinecode'>y</span> to yank it (sorry if this all sounds a bit complicated, but Vim/NeoVim users will know this, as it is pretty much how you do it there as well).</span><br /> +<br /> +<span>For <span class='inlinecode'>v</span> and <span class='inlinecode'>y</span> to work, the following has to be added to the Tmux configuration file: </span><br /> +<br /> +<pre> +bind-key -T copy-mode-vi 'v' send -X begin-selection +bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel +</pre> +<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='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 /> +<pre> +source ~/.config/tmux/tmux.local.conf + +set-option -g allow-rename off +set-option -g history-limit 100000 +set-option -g status-bg '#444444' +set-option -g status-fg '#ffa500' +set-option -s escape-time 0 +</pre> +<br /> +<span>There's yet to be much magic happening here. I source a <span class='inlinecode'>tmux.local.conf</span>, which I sometimes use to override the default configuration that comes from the configuration management system. But it is mostly just an empty file, so it doesn't throw any errors on Tmux startup when I don't use it.</span><br /> +<br /> +<span>I work with many terminal outputs, which I also like to search within Tmux. So, I added a large enough <span class='inlinecode'>history-limit</span>, enabling me to search backwards in Tmux for any output up to a million lines of text.</span><br /> +<br /> +<span>Besides changing some colours (personal taste), I also set <span class='inlinecode'>escape-time</span> to <span class='inlinecode'>0</span>, which is just a workaround. Otherwise, my Helix text editor's <span class='inlinecode'>ESC</span> key would take ages to trigger within Tmux. I am trying to remember the gory details. You can leave it out; if everything works fine for you, leave it out.</span><br /> +<br /> +<span>The next lines in the configuration file are:</span><br /> +<br /> +<pre> +set-window-option -g mode-keys vi +bind-key -T copy-mode-vi 'v' send -X begin-selection +bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel +</pre> +<br /> +<span>I navigate within Tmux using Vi keybindings, so the <span class='inlinecode'>mode-keys</span> is set to <span class='inlinecode'>vi</span>. I use the Helix modal text editor, which is close enough to Vi bindings for simple navigation to feel "native" to me. (By the way, I have been a long-time Vim and NeoVim user, but I eventually switched to Helix. It's off-topic here, but it may be worth another blog post once.)</span><br /> +<br /> +<span>The two <span class='inlinecode'>bind-key</span> commands make it so that I can use <span class='inlinecode'>v</span> and <span class='inlinecode'>y</span> in copy mode, which feels more Vi-like (as already discussed earlier in this post).</span><br /> +<br /> +<span>The next set of lines in the configuration file are:</span><br /> +<br /> +<pre> +bind-key h select-pane -L +bind-key j select-pane -D +bind-key k select-pane -U +bind-key l select-pane -R + +bind-key H resize-pane -L 5 +bind-key J resize-pane -D 5 +bind-key K resize-pane -U 5 +bind-key L resize-pane -R 5 +</pre> +<br /> +<span>These allow me to use <span class='inlinecode'>prefix-key h</span>, <span class='inlinecode'>prefix-key j</span>, <span class='inlinecode'>prefix-key k</span>, and <span class='inlinecode'>prefix-key l</span> for switching panes and <span class='inlinecode'>prefix-key H</span>, <span class='inlinecode'>prefix-key J</span>, <span class='inlinecode'>prefix-key K</span>, and <span class='inlinecode'>prefix-key L</span> for resizing the panes. If you don't know Vi/Vim/NeoVim, the letters <span class='inlinecode'>hjkl</span> are commonly used there for left, down, up, and right, which is also the same for Helix, by the way.</span><br /> +<br /> +<span>The next set of lines in the configuration file are:</span><br /> +<br /> +<pre> +bind-key c new-window -c '#{pane_current_path}' +bind-key F new-window -n "session-switcher" "tmux list-sessions | fzf | cut -d: -f1 | xargs tmux switch-client -t" +bind-key T choose-tree +</pre> +<br /> +<span>The first one is that any new window starts in the current directory. The second one is more interesting. I list all open sessions in the fuzzy finder. I rely heavily on this during my daily workflow to switch between various sessions depending on the task. E.g. from a remote cluster SSH session to a local code editor. </span><br /> +<br /> +<span>The third one, <span class='inlinecode'>choose-tree</span>, opens a tree view in Tmux listing all sessions and windows. This one is handy to get a better overview of what is currently running in any local Tmux session. It looks like this (it also allows me to press a hotkey to switch to a particular Tmux window):</span><br /> +<br /> +<a href='./terminal-multiplexing-with-tmux/tmux-tree-view.png'><img alt='Tmux sessiont tree view' title='Tmux sessiont tree view' src='./terminal-multiplexing-with-tmux/tmux-tree-view.png' /></a><br /> +<br /> +<br /> +<span>The last remaining lines in my configuration file are:</span><br /> +<span> </span><br /> +<pre> +bind-key p setw synchronize-panes off +bind-key P setw synchronize-panes on +bind-key r source-file ~/.config/tmux/tmux.conf \; display-message "tmux.conf reloaded" +</pre> +<br /> +<span>We discussed <span class='inlinecode'>synchronized panes</span> earlier. I use it all the time in clustered SSH sessions. When enabled, all panes (remote SSH sessions) receive the same keystrokes. This is very useful when you want to run the same commands on many servers at once, such as navigating to a common directory, restarting a couple of services at once, or running tools like <span class='inlinecode'>htop</span> to quickly monitor system resources.</span><br /> +<br /> +<span>The last one reloads my Tmux configuration on the fly.</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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2024-07-05-random-weird-things.html b/gemfeed/2024-07-05-random-weird-things.html new file mode 100644 index 00000000..128c7552 --- /dev/null +++ b/gemfeed/2024-07-05-random-weird-things.html @@ -0,0 +1,403 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Random Weird Things - Part Ⅰ</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2024-07-05-random-weird-things.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2024-07-05-random-weird-things.gmi">Gemini</a> +</p> +<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; 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 ) + > ^ < + / - \ + / \ + /______\ \ +</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='#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>❯ 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='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 /> +<ul> +<li> https://www.Netflix.com/helloworld</li> +</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='c-programming'>C programming</h2><br /> +<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 /> +<!-- 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">#include</font></u></b> <font color="#808080"><stdio.h></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> }; + + <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]); + + <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]); + + <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='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 /> +<!-- 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">#include</font></u></b> <font color="#808080"><stdio.h></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> }; + + <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]); + + <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]); + + <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='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 /> +<!-- 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">#!/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='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 /> +<!-- 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">"fmt"</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='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='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 /> +<a class='textlink' href='https://github.com/jqlang/jq'>https://github.com/jqlang/jq</a><br /> +<br /> +<span>What many don't know that <span class='inlinecode'>jq</span> is actually a full blown functional programming language <span class='inlinecode'>jqlang</span>, have a look at the language description: </span><br /> +<br /> +<a class='textlink' href='https://github.com/jqlang/jq/wiki/jq-Language-Description'>https://github.com/jqlang/jq/wiki/jq-Language-Description</a><br /> +<br /> +<span>As a matter of fact, the language is so powerful, that there exists an implementation of <span class='inlinecode'>jq</span> in <span class='inlinecode'>jq</span> itself:</span><br /> +<br /> +<a class='textlink' href='https://github.com/wader/jqjq'>https://github.com/wader/jqjq</a><br /> +<br /> +<span>Here some snipped from <span class='inlinecode'>jqjq</span>, to get a feel of <span class='inlinecode'>jqlang</span>:</span><br /> +<br /> +<pre> +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+["\\("])} + ) + ) + . + . + . +</pre> +<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 /> +<pre> +(?:(?:\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*) +</pre> +<br /> +<a class='textlink' href='https://pdw.ex-parrot.com/Mail-RFC822-Address.html'>https://pdw.ex-parrot.com/Mail-RFC822-Address.html</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 /> +<span>other related posts are:</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2024-07-07-the-stoic-challenge-book-notes.html b/gemfeed/2024-07-07-the-stoic-challenge-book-notes.html new file mode 100644 index 00000000..61312da3 --- /dev/null +++ b/gemfeed/2024-07-07-the-stoic-challenge-book-notes.html @@ -0,0 +1,92 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>'The Stoic Challenge' book notes</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2024-07-07-the-stoic-challenge-book-notes.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2024-07-07-the-stoic-challenge-book-notes.gmi">Gemini</a> +</p> +<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 /> +<span>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. </span><br /> +<br /> +<pre> + ,.......... .........., + ,..,' '.' ',.., + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,'............., : ,.............', ', +,' '............ '.' ............' ', + '''''''''''''''''';''';'''''''''''''''''' + ''' +</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 /> +<br /> +<span>It is not the things done to you or happen to you what matters but how you take the things and react to these things.</span><br /> +<br /> +<span>Don't row against the other boats but against your own lazy bill. It doesn't matter if you are first or last, as long as you defeat your lazy self.</span><br /> +<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='negative-visualization'>Negative visualization</h2><br /> +<br /> +<span>It is easy what we have to take for granted.</span><br /> +<br /> +<ul> +<li>Imagine the negative and then think that things are actually much better than they seem to be.</li> +<li>Close your eyes and imagine you are color blind for a minute, then open the eyes again and see all the colours. You will be grateful for being able to see the colours. </li> +<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='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 /> +<ul> +<li>A setback in a setback, how Genius :-)</li> +<li>A setback in a setback in a setback: the stoic god's work overtime, eh? :-)</li> +</ul><br /> +<span>What would the stoic god's do next? This is just a test strategy by them. Don't be frustrated at all but be astonished of what comes next. Thank the stoic gods of testing you. This is comfort zone extension of the stoics aka toughness Training.</span><br /> +<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</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='../'>Back to the main site</a><br /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2024-08-05-typing-127.1-words-per-minute.html b/gemfeed/2024-08-05-typing-127.1-words-per-minute.html new file mode 100644 index 00000000..4daadc6e --- /dev/null +++ b/gemfeed/2024-08-05-typing-127.1-words-per-minute.html @@ -0,0 +1,254 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Typing `127.1` words per minute (`>100wpm average`)</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2024-08-05-typing-127.1-words-per-minute.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2024-08-05-typing-127.1-words-per-minute.gmi">Gemini</a> +</p> +<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 /> +<pre> +,---,---,---,---,---,---,---,---,---,---,---,---,---,-------, +|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 +</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> +<li>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 <span class='inlinecode'>e</span> on a Qwerty layout), and keycaps meant to be pressed by shorter fingers are further up (e.g., right pinky finger for the letter <span class='inlinecode'>p</span>).</li> +<li>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.</li> +<li>Split: The keyboard is split into two halves (left and right), allowing one to place either hand where it is most ergonomic.</li> +</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='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='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='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='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 /> +<span>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.</span><br /> +<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 /> +<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 /> +<span>I went with the blank keycaps, by the way.</span><br /> +<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='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 /> +<span>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).</span><br /> +<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='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 /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<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='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 /> +<ul> +<li>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. </li> +<li>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.</li> +<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='training-how-to-type'>Training how to type</h2><br /> +<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 /> +<a class='textlink' href='https://keybr.com'>https://keybr.com</a><br /> +<br /> +<span>I also used a command-line tool called <span class='inlinecode'>tt</span>, 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.</span><br /> +<br /> +<a class='textlink' href='https://github.com/lemnos/tt'>https://github.com/lemnos/tt</a><br /> +<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='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 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 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='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 /> +<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 /> +<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 /> +<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='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='reverse-shifting'>Reverse shifting</h3><br /> +<br /> +<span>Reverse shifting aka left-right shifting is to... </span><br /> +<br /> +<ul> +<li>...use the left shift key for letters on the right keyboard side.</li> +<li>...use the right shift key for letters on the left keyboard side.</li> +</ul><br /> +<span>This makes using the shift key a blaze.</span><br /> +<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='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='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='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='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 /> +<span>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. </span><br /> +<br /> +<span>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:</span><br /> +<br /> +<a href='./typing-127.1-words-per-minute/glove80.jpg'><img alt='Traveling with the Glove80 using my Surface Go 2' title='Traveling with the Glove80 using my Surface Go 2' src='./typing-127.1-words-per-minute/glove80.jpg' /></a><br /> +<br /> +<span>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).</span><br /> +<br /> +<span>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 <span class='inlinecode'>[]</span> <span class='inlinecode'>{}</span> <span class='inlinecode'>()</span>, which is pretty handy there. However, I like the thumb cluster of the Glove80 more than the one on the Kinesis.</span><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>Interested in the Glove80? I suggest also reading this review:</span><br /> +<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='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 /> +<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 /> +<span>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.</span><br /> +<br /> +<span>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).</span><br /> +<br /> +<span>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)</span><br /> +<br /> +<span>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.</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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2024-09-07-projects-i-support.html b/gemfeed/2024-09-07-projects-i-support.html new file mode 100644 index 00000000..9fd813e5 --- /dev/null +++ b/gemfeed/2024-09-07-projects-i-support.html @@ -0,0 +1,127 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Projects I financially support</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2024-09-07-projects-i-support.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2024-09-07-projects-i-support.gmi">Gemini</a> +</p> +<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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2024-09-07-site-reliability-engineering-part-4.html b/gemfeed/2024-09-07-site-reliability-engineering-part-4.html new file mode 100644 index 00000000..1e727256 --- /dev/null +++ b/gemfeed/2024-09-07-site-reliability-engineering-part-4.html @@ -0,0 +1,93 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2024-09-07-site-reliability-engineering-part-4.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2024-09-07-site-reliability-engineering-part-4.gmi">Gemini</a> +</p> +<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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.html b/gemfeed/2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.html new file mode 100644 index 00000000..f789e22c --- /dev/null +++ b/gemfeed/2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.html @@ -0,0 +1,110 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Gemtexter 3.0.0 - Let's Gemtext again⁴</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.gmi">Gemini</a> +</p> +<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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2024-10-24-staff-engineer-book-notes.html b/gemfeed/2024-10-24-staff-engineer-book-notes.html new file mode 100644 index 00000000..7fc61a59 --- /dev/null +++ b/gemfeed/2024-10-24-staff-engineer-book-notes.html @@ -0,0 +1,157 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>'Staff Engineer' book notes</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2024-10-24-staff-engineer-book-notes.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.gmi">Gemini</a> +</p> +<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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.html b/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.html new file mode 100644 index 00000000..5468cd1d --- /dev/null +++ b/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.html @@ -0,0 +1,196 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi">Gemini</a> +</p> +<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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.html b/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.html new file mode 100644 index 00000000..1ecf2f2c --- /dev/null +++ b/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.html @@ -0,0 +1,375 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi">Gemini</a> +</p> +<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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2024-12-15-random-helix-themes.html b/gemfeed/2024-12-15-random-helix-themes.html new file mode 100644 index 00000000..4f9e7e84 --- /dev/null +++ b/gemfeed/2024-12-15-random-helix-themes.html @@ -0,0 +1,121 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Random Helix Themes</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2024-12-15-random-helix-themes.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2024-12-15-random-helix-themes.gmi">Gemini</a> +</p> +<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><u><font color="#000000">export</font></u></b> EDITOR=hx +<b><u><font color="#000000">export</font></u></b> VISUAL=$EDITOR +<b><u><font color="#000000">export</font></u></b> GIT_EDITOR=$EDITOR +<b><u><font color="#000000">export</font></u></b> HELIX_CONFIG_DIR=$HOME/.config/helix + +editor::helix::random_theme () { + <i><font color="silver"># May add more theme search paths based on OS. This one is</font></i> + <i><font color="silver"># for Fedora Linux, but there is also MacOS, etc.</font></i> + <b><u><font color="#000000">local</font></u></b> -r theme_dir=/usr/share/helix/runtime/themes + <b><u><font color="#000000">if</font></u></b> [ ! -d $theme_dir ]; <b><u><font color="#000000">then</font></u></b> + echo <font color="#808080">"Helix theme dir $theme_dir doesnt exist"</font> + <b><u><font color="#000000">return</font></u></b> <font color="#000000">1</font> + <b><u><font color="#000000">fi</font></u></b> + + <b><u><font color="#000000">local</font></u></b> -r config_file=$HELIX_CONFIG_DIR/config.toml + <b><u><font color="#000000">local</font></u></b> -r random_theme=<font color="#808080">"$(basename "</font>$(ls $theme_dir \ + | grep -v random.toml | grep .toml | sort -R \ + | head -n <font color="#000000">1</font>)<font color="#808080">" | cut -d. -f1)"</font> + + sed <font color="#808080">"/^theme =/ { s/.*/theme = </font>\"<font color="#808080">$random_theme</font>\"<font color="#808080">/; }"</font> \ + $config_file > $config_file.tmp && + mv $config_file.tmp $config_file +} + +<b><u><font color="#000000">if</font></u></b> [ -f $HELIX_CONFIG_DIR/config.toml ]; <b><u><font color="#000000">then</font></u></b> + editor::helix::random_theme +<b><u><font color="#000000">fi</font></u></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>[paul@earth] ~ % editor::helix::random_theme +[paul@earth] ~ % head -n <font color="#000000">1</font> ~/.config/helix/config.toml +theme = <font color="#808080">"jellybeans"</font> +[paul@earth] ~ % editor::helix::random_theme +[paul@earth] ~ % head -n <font color="#000000">1</font> ~/.config/helix/config.toml +theme = <font color="#808080">"rose_pine"</font> +[paul@earth] ~ % editor::helix::random_theme +[paul@earth] ~ % head -n <font color="#000000">1</font> ~/.config/helix/config.toml +theme = <font color="#808080">"noctis"</font> +[paul@earth] ~ % +</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><u><font color="#000000">export</font></u></b> EDITOR=hx +<b><u><font color="#000000">export</font></u></b> VISUAL=$EDITOR +<b><u><font color="#000000">export</font></u></b> GIT_EDITOR=$EDITOR +<b><u><font color="#000000">export</font></u></b> HELIX_CONFIG_DIR=$HOME/.config/helix + +editor::helix::theme::get_random () { + <b><u><font color="#000000">for</font></u></b> dir <b><u><font color="#000000">in</font></u></b> $(hx --health \ + | awk <font color="#808080">'/^Runtime directories/ { print $3 }'</font> | tr <font color="#808080">';'</font> <font color="#808080">' '</font>); <b><u><font color="#000000">do</font></u></b> + <b><u><font color="#000000">if</font></u></b> [ -d $dir/themes ]; <b><u><font color="#000000">then</font></u></b> + ls $dir/themes + <b><u><font color="#000000">fi</font></u></b> + <b><u><font color="#000000">done</font></u></b> | grep -F .toml | sort -R | head -n <font color="#000000">1</font> | cut -d. -f<font color="#000000">1</font> +} + +editor::helix::theme::set () { + <b><u><font color="#000000">local</font></u></b> -r theme=<font color="#808080">"$1"</font>; <b><u><font color="#000000">shift</font></u></b> + + <b><u><font color="#000000">local</font></u></b> -r config_file=$HELIX_CONFIG_DIR/config.toml + + sed <font color="#808080">"/^theme =/ { s/.*/theme = </font>\"<font color="#808080">$theme</font>\"<font color="#808080">/; }"</font> \ + $config_file > $config_file.tmp && + mv $config_file.tmp $config_file +} + +<b><u><font color="#000000">if</font></u></b> [ -f $HELIX_CONFIG_DIR/config.toml ]; <b><u><font color="#000000">then</font></u></b> + editor::helix::theme::<b><u><font color="#000000">set</font></u></b> $(editor::helix::theme::get_random) +<b><u><font color="#000000">fi</font></u></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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2025-01-01-posts-from-october-to-december-2024.html b/gemfeed/2025-01-01-posts-from-october-to-december-2024.html new file mode 100644 index 00000000..e8cf61fc --- /dev/null +++ b/gemfeed/2025-01-01-posts-from-october-to-december-2024.html @@ -0,0 +1,358 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Posts from October to December 2024</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2025-01-01-posts-from-october-to-december-2024.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2025-01-01-posts-from-october-to-december-2024.gmi">Gemini</a> +</p> +<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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2025-01-15-working-with-an-sre-interview.html b/gemfeed/2025-01-15-working-with-an-sre-interview.html new file mode 100644 index 00000000..8956fa9b --- /dev/null +++ b/gemfeed/2025-01-15-working-with-an-sre-interview.html @@ -0,0 +1,201 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Working with an SRE Interview</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2025-01-15-working-with-an-sre-interview.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2025-01-15-working-with-an-sre-interview.gmi">Gemini</a> +</p> +<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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.html b/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.html new file mode 100644 index 00000000..b9116a4d --- /dev/null +++ b/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.html @@ -0,0 +1,427 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi">Gemini</a> +</p> +<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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/2025-02-08-random-weird-things-ii.html b/gemfeed/2025-02-08-random-weird-things-ii.html new file mode 100644 index 00000000..770e287a --- /dev/null +++ b/gemfeed/2025-02-08-random-weird-things-ii.html @@ -0,0 +1,291 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Random Weird Things - Part Ⅱ</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/2025-02-08-random-weird-things-ii.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/2025-02-08-random-weird-things-ii.gmi">Gemini</a> +</p> +<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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> 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.html b/gemfeed/DRAFT-f3s-kubernetes-with-freebsd-part-4.html new file mode 100644 index 00000000..133ba1d6 --- /dev/null +++ b/gemfeed/DRAFT-f3s-kubernetes-with-freebsd-part-4.html @@ -0,0 +1,345 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>f3s: Kubernetes with FreeBSD - Rocky Linux Bhyve VMs - Part 4</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/DRAFT-f3s-kubernetes-with-freebsd-part-4.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/DRAFT-f3s-kubernetes-with-freebsd-part-4.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='f3s-kubernetes-with-freebsd---rocky-linux-bhyve-vms---part-4'>f3s: Kubernetes with FreeBSD - Rocky Linux Bhyve VMs - Part 4</h1><br /> +<br /> +<span>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.</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</a><br /> +<br /> +<a href='./f3s-kubernetes-with-frhyveeebsd-part-1/f3slogo.png'><img alt='f3s logo' title='f3s logo' src='./f3s-kubernetes-with-frhyveeebsd-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---rocky-linux-bhyve-vms---part-4'>f3s: Kubernetes with FreeBSD - Rocky Linux Bhyve VMs - Part 4</a></li> +<li>⇢ <a href='#introduction'>Introduction</a></li> +<li>⇢ <a href='#check-for-popcnt-cpu-support'>Check for <span class='inlinecode'>POPCNT</span> CPU support</a></li> +<li>⇢ <a href='#basic-bhyve-setup'>Basic Bhyve setup</a></li> +<li>⇢ <a href='#rocky-linux-vms'>Rocky Linux VMs</a></li> +<li>⇢ ⇢ <a href='#iso-download'>ISO download</a></li> +<li>⇢ ⇢ <a href='#vm-configuration'>VM configuration</a></li> +<li>⇢ ⇢ <a href='#vm-installation'>VM installation</a></li> +<li>⇢ ⇢ <a href='#increase-of-the-disk-image'>Increase of the disk image</a></li> +<li>⇢ ⇢ <a href='#connect-to-vpn'>Connect to VPN</a></li> +<li>⇢ <a href='#after-install'>After install</a></li> +<li>⇢ ⇢ <a href='#vm-auto-start-after-host-reboot'>VM auto-start after host reboot</a></li> +<li>⇢ ⇢ <a href='#static-ip-configuration'>Static IP configuration</a></li> +<li>⇢ ⇢ <a href='#permitting-root-login'>Permitting root login</a></li> +<li>⇢ ⇢ <a href='#install-latest-updates'>Install latest updates</a></li> +</ul><br /> +<h2 style='display: inline' id='introduction'>Introduction</h2><br /> +<br /> +<span>In this blog post, we are going to install the Bhyve hypervisor.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='check-for-popcnt-cpu-support'>Check for <span class='inlinecode'>POPCNT</span> CPU support</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>To check for <span class='inlinecode'>POPCNT</span> support, I run:</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:~ % dmesg | grep <font color="#808080">'Features2=.*POPCNT'</font> + Features2=<font color="#000000">0x7ffafbbf</font><SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,SDBG, + FMA,CX16,xTPR,PDCM,PCID,SSE4.<font color="#000000">1</font>,SSE4.<font color="#000000">2</font>,x2APIC,MOVBE,POPCNT,TSCDLT,AESNI,XSAVE, + OSXSAVE,AVX,F16C,RDRAND> +</pre> +<br /> +<span>So it's there! All good.</span><br /> +<br /> +<h2 style='display: inline' id='basic-bhyve-setup'>Basic Bhyve setup</h2><br /> +<br /> +<span>For the management of the Bhyve VMs, we are using <span class='inlinecode'>vm-bhyve</span>, 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.</span><br /> +<br /> +<a class='textlink' href='https://github.com/churchers/vm-bhyve'>https://github.com/churchers/vm-bhyve</a><br /> +<br /> +<span>The following commands are executed on all three hosts <span class='inlinecode'>f0</span>, <span class='inlinecode'>f1</span>, and <span class='inlinecode'>f2</span>, where <span class='inlinecode'>re0</span> is the name of the Ethernet interface (which may need to be adjusted if your hardware is different):</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 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 +</pre> +<br /> +<span>Bhyve stores all it's data in the <span class='inlinecode'>/bhyve</span> of the <span class='inlinecode'>zroot</span> ZFS pool:</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:~ % zfs list | grep bhyve +zroot/bhyve <font color="#000000">1</font>.74M 453G <font color="#000000">1</font>.74M /zroot/bhyve +</pre> +<br /> +<span>For convenience, we also create this symlink:</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 ln -s /zroot/bhyve/ /bhyve + +</pre> +<br /> +<span>Now, Bhyve is ready to rumble, but no VMs are there yet:</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 vm list +NAME DATASTORE LOADER CPU MEMORY VNC AUTO STATE +</pre> +<br /> +<h2 style='display: inline' id='rocky-linux-vms'>Rocky Linux VMs</h2><br /> +<br /> +<h3 style='display: inline' id='iso-download'>ISO download</h3><br /> +<br /> +<span>We're going to install the Rocky Linux from the latest minimal iso:</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 vm iso \ + https://download.rockylinux.org/pub/rocky/<font color="#000000">9</font>/isos/x86_64/Rocky-<font color="#000000">9.5</font>-x86_64-minimal.iso +/zroot/bhyve/.iso/Rocky-<font color="#000000">9.5</font>-x86_64-minimal.iso <font color="#000000">1808</font> MB <font color="#000000">4780</font> kBps 06m28s +paul@f0:/bhyve % doas vm create rocky +</pre> +<h3 style='display: inline' id='vm-configuration'>VM configuration</h3><br /> +<br /> +<span>The default configuration looks like this now:</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:/bhyve/rocky % cat rocky.conf +loader=<font color="#808080">"bhyveload"</font> +cpu=<font color="#000000">1</font> +memory=256M +network0_type=<font color="#808080">"virtio-net"</font> +network0_switch=<font color="#808080">"public"</font> +disk0_type=<font color="#808080">"virtio-blk"</font> +disk0_name=<font color="#808080">"disk0.img"</font> +uuid=<font color="#808080">"1c4655ac-c828-11ef-a920-e8ff1ed71ca0"</font> +network0_mac=<font color="#808080">"58:9c:fc:0d:13:3f"</font> +</pre> +<br /> +<span>Whereas the <span class='inlinecode'>uuid</span> and the <span class='inlinecode'>network0_mac</span> differ on each of the 3 hosts.</span><br /> +<br /> +<span>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 <span class='inlinecode'>doas vm configure rocky</span> and modified it to:</span><br /> +<br /> +<pre> +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" +</pre> +<br /> +<h3 style='display: inline' id='vm-installation'>VM installation</h3><br /> +<br /> +<span>To start the installer from the downloaded ISO, I run:</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 vm install rocky Rocky-<font color="#000000">9.5</font>-x86_64-minimal.iso +Starting rocky + * found guest <b><u><font color="#000000">in</font></u></b> /zroot/bhyve/rocky + * booting... + +paul@f0:/bhyve/rocky % doas vm list +NAME DATASTORE LOADER CPU MEMORY VNC AUTO STATE +rocky default uefi <font color="#000000">4</font> 14G <font color="#000000">0.0</font>.<font color="#000000">0.0</font>:<font color="#000000">5900</font> No Locked (f0.lan.buetow.org) + +paul@f0:/bhyve/rocky % doas sockstat -<font color="#000000">4</font> | grep <font color="#000000">5900</font> +root bhyve <font color="#000000">6079</font> <font color="#000000">8</font> tcp4 *:<font color="#000000">5900</font> *:* +</pre> +<br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='increase-of-the-disk-image'>Increase of the disk image</h3><br /> +<br /> +<span>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 <span class='inlinecode'>truncate</span> on the image file to enlarge them to 100G, and re-started the installation:</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:/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-<font color="#000000">9.5</font>-x86_64-minimal.iso +</pre> +<br /> +<h3 style='display: inline' id='connect-to-vpn'>Connect to VPN</h3><br /> +<br /> +<span>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: <span class='inlinecode'>vnc://f0:5900</span>, <span class='inlinecode'>vnc://f1:5900</span>, and <span class='inlinecode'>vnc://f0:5900</span>.</span><br /> +<br /> +<span>I mostly selected the default settings (auto partitioning on the 100GB drive and a root user password). After the installation, the VMs were rebooted.</span><br /> +<br /> +<h2 style='display: inline' id='after-install'>After install</h2><br /> +<br /> +<span>I performed the following steps for all 3 VMs. In the following, the examples are all executed on <span class='inlinecode'>f0</span> (bzw the VM <span class='inlinecode'>r0</span> running on <span class='inlinecode'>f0</span>):</span><br /> +<br /> +<h3 style='display: inline' id='vm-auto-start-after-host-reboot'>VM auto-start after host reboot</h3><br /> +<br /> +<span>To automatically start the VM on the servers I added the following to the <span class='inlinecode'>rc.conf</span> on the FreeBSD hosts:</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:/bhyve/rocky % cat <<END | doas tee -a /etc/rc.conf +vm_list=<font color="#808080">"rocky"</font> +vm_delay=<font color="#808080">"5"</font> +</pre> +<br /> +<span>The <span class='inlinecode'>vm_delay</span> 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 <span class='inlinecode'>Yes</span> indicator in the <span class='inlinecode'>AUTO</span> column.</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 vm list +NAME DATASTORE LOADER CPU MEMORY VNC AUTO STATE +rocky default uefi <font color="#000000">4</font> 14G <font color="#000000">0.0</font>.<font color="#000000">0.0</font>:<font color="#000000">5900</font> Yes [<font color="#000000">1</font>] Running (<font color="#000000">2063</font>) +</pre> +<br /> +<h3 style='display: inline' id='static-ip-configuration'>Static IP configuration</h3><br /> +<br /> +<span>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 <span class='inlinecode'>/etc/hosts</span> file:</span><br /> +<br /> +<pre> +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 +</pre> +<br /> +<span>For the Rocky VMs I added those to the FreeBSD hosts systems as well:</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:/bhyve/rocky % cat <<END | doas tee -a /etc/hosts +<font color="#000000">192.168</font>.<font color="#000000">1.120</font> r0 r0.lan r0.lan.buetow.org +<font color="#000000">192.168</font>.<font color="#000000">1.121</font> r1 r1.lan r1.lan.buetow.org +<font color="#000000">192.168</font>.<font color="#000000">1.122</font> r2 r2.lan r2.lan.buetow.org +END +</pre> +<br /> +<span>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:</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@r0 ~] % dnmcli connection modify enp0s5 ipv4.address <font color="#000000">192.168</font>.<font color="#000000">1.120</font>/<font color="#000000">24</font> +[root@r0 ~] % dnmcli connection modify enp0s5 ipv4.gateway <font color="#000000">192.168</font>.<font color="#000000">1.1</font> +[root@r0 ~] % dnmcli connection modify enp0s5 ipv4.dns <font color="#000000">192.168</font>.<font color="#000000">1.1</font> +[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 +<font color="#000000">192.168</font>.<font color="#000000">1.120</font> r0 r0.lan r0.lan.buetow.org +<font color="#000000">192.168</font>.<font color="#000000">1.121</font> r1 r1.lan r1.lan.buetow.org +<font color="#000000">192.168</font>.<font color="#000000">1.122</font> r2 r2.lan r2.lan.buetow.org +END +</pre> +<br /> +<span>Whereas:</span><br /> +<br /> +<ul> +<li><span class='inlinecode'>192.168.1.120</span> is the IP of the VM itself (here: <span class='inlinecode'>r0.lan.buetow.org</span>)</li> +<li><span class='inlinecode'>192.168.1.1</span> is the address of my home router, which also does DNS.</li> +</ul><br /> +<h3 style='display: inline' id='permitting-root-login'>Permitting root login</h3><br /> +<br /> +<span>As these VMs arent directly reachable via SSH from the internet, I enabled <span class='inlinecode'>root</span> login by adding a line with <span class='inlinecode'>PermitRootLogin yes</span> to <span class='inlinecode'>/etc/sshd/sshd_config</span>.</span><br /> +<br /> +<span>Once done, I rebooted the VM by running <span class='inlinecode'>reboot</span> inside of the vm to test whether everything was configured and persisted correctly.</span><br /> +<br /> +<span>After reboot, I copied my public key from my Laptop to the 3 VMs:</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">for</font></u></b> i <b><u><font color="#000000">in</font></u></b> <font color="#000000">0</font> <font color="#000000">1</font> <font color="#000000">2</font>; <b><u><font color="#000000">do</font></u></b> ssh-copy-id root@r$i.lan.buetow.org; <b><u><font color="#000000">done</font></u></b> +</pre> +<br /> +<span>And then I edited the <span class='inlinecode'>/etc/ssh/sshd_config</span> file again on all 3 VMs and configured <span class='inlinecode'>PasswordAuthentication no</span>, to only allow SSH key authentication from now on.</span><br /> +<br /> +<h3 style='display: inline' id='install-latest-updates'>Install latest updates</h3><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@r0 ~] % dnf update +[root@r0 ~] % dreboot +</pre> +<br /> +<span>CPU STRESS TESTER VM VS NOT VM</span><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</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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/gemfeed/DRAFT-site-reliability-engineering.html b/gemfeed/DRAFT-site-reliability-engineering.html index fc38aa15..8217bf6a 100644 --- a/gemfeed/DRAFT-site-reliability-engineering.html +++ b/gemfeed/DRAFT-site-reliability-engineering.html @@ -8,7 +8,10 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h2 style='display: inline'>System Design and Incident Analysis: Building Resilience in the SRE Landscape</h2><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/DRAFT-site-reliability-engineering.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/DRAFT-site-reliability-engineering.gmi">Gemini</a> +</p> +<h2 style='display: inline' id='system-design-and-incident-analysis-building-resilience-in-the-sre-landscape'>System Design and Incident Analysis: Building Resilience in the SRE Landscape</h2><br /> <br /> <span>A significant portion of the work revolves around system design and incident analysis.</span><br /> <br /> @@ -28,7 +31,7 @@ <br /> <a class='textlink' href='add'>6 minutes to wt.</a><br /> <br /> -<h2 style='display: inline'>The Heroic Facade and Team Dynamics: Rethinking Success in SRE</h2><br /> +<h2 style='display: inline' id='the-heroic-facade-and-team-dynamics-rethinking-success-in-sre'>The Heroic Facade and Team Dynamics: Rethinking Success in SRE</h2><br /> <br /> <span>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.</span><br /> <br /> @@ -79,7 +82,7 @@ <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>Monitoring, Observability, and the SRE Arsenal: Navigating the Nuances of System Reliability</h2><br /> +<h2 style='display: inline' id='monitoring-observability-and-the-sre-arsenal-navigating-the-nuances-of-system-reliability'>Monitoring, Observability, and the SRE Arsenal: Navigating the Nuances of System Reliability</h2><br /> <br /> <span>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.</span><br /> <br /> @@ -93,7 +96,7 @@ <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>The Ever-evolving Landscape of SRE</h2><br /> +<h2 style='display: inline' id='the-ever-evolving-landscape-of-sre'>The Ever-evolving Landscape of SRE</h2><br /> <br /> <span>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.</span><br /> <br /> @@ -105,7 +108,7 @@ <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>Effective Communication and Collaboration in SRE</h2><br /> +<h2 style='display: inline' id='effective-communication-and-collaboration-in-sre'>Effective Communication and Collaboration in SRE</h2><br /> <br /> <span>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. </span><br /> <br /> @@ -121,7 +124,7 @@ <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>Inherent Curiosity and Continual Learning in SRE</h2><br /> +<h2 style='display: inline' id='inherent-curiosity-and-continual-learning-in-sre'>Inherent Curiosity and Continual Learning in SRE</h2><br /> <br /> <span>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.</span><br /> <br /> @@ -135,7 +138,7 @@ <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>The Iterative Spirit of SRE</h2><br /> +<h2 style='display: inline' id='the-iterative-spirit-of-sre'>The Iterative Spirit of SRE</h2><br /> <br /> <span>Site Reliability Engineering is more than just a technical discipline; it embodies a mindset that embraces iteration, proactive problem-solving, and continuous enhancement. </span><br /> <br /> @@ -149,9 +152,9 @@ <br /> <span>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.</span><br /> <br /> -<h2 style='display: inline'>The role of simplicity Simplicity</h2><br /> +<h2 style='display: inline' id='the-role-of-simplicity-simplicity'>The role of simplicity Simplicity</h2><br /> <br /> -<h2 style='display: inline'>Book tips</h2><br /> +<h2 style='display: inline' id='book-tips'>Book tips</h2><br /> <br /> <ul> <li>97 Things Every SRE Should Know: Collective Wisdom from the Experts by Emily Stolarsky and Jaime Woo</li> @@ -162,9 +165,9 @@ <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang/logo-small.png b/gemfeed/a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang/logo-small.png Binary files differnew file mode 100644 index 00000000..dc29011c --- /dev/null +++ b/gemfeed/a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang/logo-small.png diff --git a/gemfeed/a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang/screenshot-android.png b/gemfeed/a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang/screenshot-android.png Binary files differnew file mode 100644 index 00000000..a8a604e3 --- /dev/null +++ b/gemfeed/a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang/screenshot-android.png diff --git a/gemfeed/atom.xml b/gemfeed/atom.xml index 440c911a..e8e585c5 100644 --- a/gemfeed/atom.xml +++ b/gemfeed/atom.xml @@ -1,12 +1,5365 @@ <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> - <updated>2023-11-11T22:22:05+02:00</updated> + <updated>2025-02-21T11:07:08+02:00</updated> <title>foo.zone feed</title> <subtitle>To be in the .zone!</subtitle> <link href="https://foo.zone/gemfeed/atom.xml" rel="self" /> <link href="https://foo.zone/" /> <id>https://foo.zone/</id> <entry> + <title>Random Weird Things - Part Ⅱ</title> + <link href="https://foo.zone/gemfeed/2025-02-08-random-weird-things-ii.html" /> + <id>https://foo.zone/gemfeed/2025-02-08-random-weird-things-ii.html</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="https://foo.zone/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.html" /> + <id>https://foo.zone/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.html</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="https://foo.zone/gemfeed/2025-01-15-working-with-an-sre-interview.html" /> + <id>https://foo.zone/gemfeed/2025-01-15-working-with-an-sre-interview.html</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="https://foo.zone/gemfeed/2025-01-01-posts-from-october-to-december-2024.html" /> + <id>https://foo.zone/gemfeed/2025-01-01-posts-from-october-to-december-2024.html</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='https://foo.zone/gemfeed/2024-09-07-projects-i-support.gmi'>foo.zone/gemfeed/2024-09-07-projects-i-support.html (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='https://foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.gmi'>foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.html (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='https://foo.zone/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi'>foo.zone/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.html (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='https://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.html (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='https://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.html (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='https://foo.zone/gemfeed/2024-12-15-random-helix-themes.gmi'>foo.zone/gemfeed/2024-12-15-random-helix-themes.html (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="https://foo.zone/gemfeed/2024-12-15-random-helix-themes.html" /> + <id>https://foo.zone/gemfeed/2024-12-15-random-helix-themes.html</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><u><font color="#000000">export</font></u></b> EDITOR=hx +<b><u><font color="#000000">export</font></u></b> VISUAL=$EDITOR +<b><u><font color="#000000">export</font></u></b> GIT_EDITOR=$EDITOR +<b><u><font color="#000000">export</font></u></b> HELIX_CONFIG_DIR=$HOME/.config/helix + +editor::helix::random_theme () { + <i><font color="silver"># May add more theme search paths based on OS. This one is</font></i> + <i><font color="silver"># for Fedora Linux, but there is also MacOS, etc.</font></i> + <b><u><font color="#000000">local</font></u></b> -r theme_dir=/usr/share/helix/runtime/themes + <b><u><font color="#000000">if</font></u></b> [ ! -d $theme_dir ]; <b><u><font color="#000000">then</font></u></b> + echo <font color="#808080">"Helix theme dir $theme_dir doesnt exist"</font> + <b><u><font color="#000000">return</font></u></b> <font color="#000000">1</font> + <b><u><font color="#000000">fi</font></u></b> + + <b><u><font color="#000000">local</font></u></b> -r config_file=$HELIX_CONFIG_DIR/config.toml + <b><u><font color="#000000">local</font></u></b> -r random_theme=<font color="#808080">"$(basename "</font>$(ls $theme_dir \ + | grep -v random.toml | grep .toml | sort -R \ + | head -n <font color="#000000">1</font>)<font color="#808080">" | cut -d. -f1)"</font> + + sed <font color="#808080">"/^theme =/ { s/.*/theme = </font>\"<font color="#808080">$random_theme</font>\"<font color="#808080">/; }"</font> \ + $config_file > $config_file.tmp && + mv $config_file.tmp $config_file +} + +<b><u><font color="#000000">if</font></u></b> [ -f $HELIX_CONFIG_DIR/config.toml ]; <b><u><font color="#000000">then</font></u></b> + editor::helix::random_theme +<b><u><font color="#000000">fi</font></u></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>[paul@earth] ~ % editor::helix::random_theme +[paul@earth] ~ % head -n <font color="#000000">1</font> ~/.config/helix/config.toml +theme = <font color="#808080">"jellybeans"</font> +[paul@earth] ~ % editor::helix::random_theme +[paul@earth] ~ % head -n <font color="#000000">1</font> ~/.config/helix/config.toml +theme = <font color="#808080">"rose_pine"</font> +[paul@earth] ~ % editor::helix::random_theme +[paul@earth] ~ % head -n <font color="#000000">1</font> ~/.config/helix/config.toml +theme = <font color="#808080">"noctis"</font> +[paul@earth] ~ % +</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><u><font color="#000000">export</font></u></b> EDITOR=hx +<b><u><font color="#000000">export</font></u></b> VISUAL=$EDITOR +<b><u><font color="#000000">export</font></u></b> GIT_EDITOR=$EDITOR +<b><u><font color="#000000">export</font></u></b> HELIX_CONFIG_DIR=$HOME/.config/helix + +editor::helix::theme::get_random () { + <b><u><font color="#000000">for</font></u></b> dir <b><u><font color="#000000">in</font></u></b> $(hx --health \ + | awk <font color="#808080">'/^Runtime directories/ { print $3 }'</font> | tr <font color="#808080">';'</font> <font color="#808080">' '</font>); <b><u><font color="#000000">do</font></u></b> + <b><u><font color="#000000">if</font></u></b> [ -d $dir/themes ]; <b><u><font color="#000000">then</font></u></b> + ls $dir/themes + <b><u><font color="#000000">fi</font></u></b> + <b><u><font color="#000000">done</font></u></b> | grep -F .toml | sort -R | head -n <font color="#000000">1</font> | cut -d. -f<font color="#000000">1</font> +} + +editor::helix::theme::set () { + <b><u><font color="#000000">local</font></u></b> -r theme=<font color="#808080">"$1"</font>; <b><u><font color="#000000">shift</font></u></b> + + <b><u><font color="#000000">local</font></u></b> -r config_file=$HELIX_CONFIG_DIR/config.toml + + sed <font color="#808080">"/^theme =/ { s/.*/theme = </font>\"<font color="#808080">$theme</font>\"<font color="#808080">/; }"</font> \ + $config_file > $config_file.tmp && + mv $config_file.tmp $config_file +} + +<b><u><font color="#000000">if</font></u></b> [ -f $HELIX_CONFIG_DIR/config.toml ]; <b><u><font color="#000000">then</font></u></b> + editor::helix::theme::<b><u><font color="#000000">set</font></u></b> $(editor::helix::theme::get_random) +<b><u><font color="#000000">fi</font></u></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="https://foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.html" /> + <id>https://foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.html</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="https://foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.html" /> + <id>https://foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.html</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="https://foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.html" /> + <id>https://foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.html</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="https://foo.zone/gemfeed/2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.html" /> + <id>https://foo.zone/gemfeed/2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.html</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="https://foo.zone/gemfeed/2024-09-07-site-reliability-engineering-part-4.html" /> + <id>https://foo.zone/gemfeed/2024-09-07-site-reliability-engineering-part-4.html</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="https://foo.zone/gemfeed/2024-09-07-projects-i-support.html" /> + <id>https://foo.zone/gemfeed/2024-09-07-projects-i-support.html</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="https://foo.zone/gemfeed/2024-08-05-typing-127.1-words-per-minute.html" /> + <id>https://foo.zone/gemfeed/2024-08-05-typing-127.1-words-per-minute.html</id> + <updated>2024-08-05T17:39:30+03:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <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='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 /> +<pre> +,---,---,---,---,---,---,---,---,---,---,---,---,---,-------, +|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 +</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> +<li>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 <span class='inlinecode'>e</span> on a Qwerty layout), and keycaps meant to be pressed by shorter fingers are further up (e.g., right pinky finger for the letter <span class='inlinecode'>p</span>).</li> +<li>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.</li> +<li>Split: The keyboard is split into two halves (left and right), allowing one to place either hand where it is most ergonomic.</li> +</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='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='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='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='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 /> +<span>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.</span><br /> +<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 /> +<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 /> +<span>I went with the blank keycaps, by the way.</span><br /> +<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='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 /> +<span>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).</span><br /> +<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='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 /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<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='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 /> +<ul> +<li>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. </li> +<li>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.</li> +<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='training-how-to-type'>Training how to type</h2><br /> +<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 /> +<a class='textlink' href='https://keybr.com'>https://keybr.com</a><br /> +<br /> +<span>I also used a command-line tool called <span class='inlinecode'>tt</span>, 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.</span><br /> +<br /> +<a class='textlink' href='https://github.com/lemnos/tt'>https://github.com/lemnos/tt</a><br /> +<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='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 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 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='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 /> +<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 /> +<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 /> +<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='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='reverse-shifting'>Reverse shifting</h3><br /> +<br /> +<span>Reverse shifting aka left-right shifting is to... </span><br /> +<br /> +<ul> +<li>...use the left shift key for letters on the right keyboard side.</li> +<li>...use the right shift key for letters on the left keyboard side.</li> +</ul><br /> +<span>This makes using the shift key a blaze.</span><br /> +<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='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='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='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='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 /> +<span>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. </span><br /> +<br /> +<span>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:</span><br /> +<br /> +<a href='./typing-127.1-words-per-minute/glove80.jpg'><img alt='Traveling with the Glove80 using my Surface Go 2' title='Traveling with the Glove80 using my Surface Go 2' src='./typing-127.1-words-per-minute/glove80.jpg' /></a><br /> +<br /> +<span>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).</span><br /> +<br /> +<span>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 <span class='inlinecode'>[]</span> <span class='inlinecode'>{}</span> <span class='inlinecode'>()</span>, which is pretty handy there. However, I like the thumb cluster of the Glove80 more than the one on the Kinesis.</span><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>Interested in the Glove80? I suggest also reading this review:</span><br /> +<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='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 /> +<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 /> +<span>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.</span><br /> +<br /> +<span>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).</span><br /> +<br /> +<span>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)</span><br /> +<br /> +<span>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.</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>'The Stoic Challenge' book notes</title> + <link href="https://foo.zone/gemfeed/2024-07-07-the-stoic-challenge-book-notes.html" /> + <id>https://foo.zone/gemfeed/2024-07-07-the-stoic-challenge-book-notes.html</id> + <updated>2024-07-07T12:46:55+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 '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='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 /> +<span>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. </span><br /> +<br /> +<pre> + ,.......... .........., + ,..,' '.' ',.., + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,'............., : ,.............', ', +,' '............ '.' ............' ', + '''''''''''''''''';''';'''''''''''''''''' + ''' +</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 /> +<br /> +<span>It is not the things done to you or happen to you what matters but how you take the things and react to these things.</span><br /> +<br /> +<span>Don't row against the other boats but against your own lazy bill. It doesn't matter if you are first or last, as long as you defeat your lazy self.</span><br /> +<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='negative-visualization'>Negative visualization</h2><br /> +<br /> +<span>It is easy what we have to take for granted.</span><br /> +<br /> +<ul> +<li>Imagine the negative and then think that things are actually much better than they seem to be.</li> +<li>Close your eyes and imagine you are color blind for a minute, then open the eyes again and see all the colours. You will be grateful for being able to see the colours. </li> +<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='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 /> +<ul> +<li>A setback in a setback, how Genius :-)</li> +<li>A setback in a setback in a setback: the stoic god's work overtime, eh? :-)</li> +</ul><br /> +<span>What would the stoic god's do next? This is just a test strategy by them. Don't be frustrated at all but be astonished of what comes next. Thank the stoic gods of testing you. This is comfort zone extension of the stoics aka toughness Training.</span><br /> +<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</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='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>Random Weird Things - Part Ⅰ</title> + <link href="https://foo.zone/gemfeed/2024-07-05-random-weird-things.html" /> + <id>https://foo.zone/gemfeed/2024-07-05-random-weird-things.html</id> + <updated>2024-07-05T10:59:59+03: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. 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='random-weird-things---part-'>Random Weird Things - Part Ⅰ</h1><br /> +<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 ) + > ^ < + / - \ + / \ + /______\ \ +</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='#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>❯ 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='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 /> +<ul> +<li> https://www.Netflix.com/helloworld</li> +</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='c-programming'>C programming</h2><br /> +<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 /> +<!-- 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">#include</font></u></b> <font color="#808080"><stdio.h></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> }; + + <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]); + + <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]); + + <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='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 /> +<!-- 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">#include</font></u></b> <font color="#808080"><stdio.h></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> }; + + <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]); + + <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]); + + <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='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 /> +<!-- 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">#!/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='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 /> +<!-- 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">"fmt"</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='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='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 /> +<a class='textlink' href='https://github.com/jqlang/jq'>https://github.com/jqlang/jq</a><br /> +<br /> +<span>What many don't know that <span class='inlinecode'>jq</span> is actually a full blown functional programming language <span class='inlinecode'>jqlang</span>, have a look at the language description: </span><br /> +<br /> +<a class='textlink' href='https://github.com/jqlang/jq/wiki/jq-Language-Description'>https://github.com/jqlang/jq/wiki/jq-Language-Description</a><br /> +<br /> +<span>As a matter of fact, the language is so powerful, that there exists an implementation of <span class='inlinecode'>jq</span> in <span class='inlinecode'>jq</span> itself:</span><br /> +<br /> +<a class='textlink' href='https://github.com/wader/jqjq'>https://github.com/wader/jqjq</a><br /> +<br /> +<span>Here some snipped from <span class='inlinecode'>jqjq</span>, to get a feel of <span class='inlinecode'>jqlang</span>:</span><br /> +<br /> +<pre> +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+["\\("])} + ) + ) + . + . + . +</pre> +<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 /> +<pre> +(?:(?:\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*) +</pre> +<br /> +<a class='textlink' href='https://pdw.ex-parrot.com/Mail-RFC822-Address.html'>https://pdw.ex-parrot.com/Mail-RFC822-Address.html</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 /> +<span>other related posts are:</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>Terminal multiplexing with `tmux`</title> + <link href="https://foo.zone/gemfeed/2024-06-23-terminal-multiplexing-with-tmux.html" /> + <id>https://foo.zone/gemfeed/2024-06-23-terminal-multiplexing-with-tmux.html</id> + <updated>2024-06-23T22:41:59+03:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <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='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> + _______ + |.-----.| + || Tmux|| + ||_.-._|| + `--)-(--` + __[=== o]___ + |:::::::::::|\ +jgs `-=========-`() + mod. by Paul B. +</pre> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<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 /> +<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 /> +<a class='textlink' href='https://github.com/tmux/tmux/wiki/Getting-Started'>https://github.com/tmux/tmux/wiki/Getting-Started</a><br /> +<br /> +<span>I can also recommend this book (this is the book I got started with with Tmux):</span><br /> +<br /> +<a class='textlink' href='https://pragprog.com/titles/bhtmux2/tmux-2/'>https://pragprog.com/titles/bhtmux2/tmux-2/</a><br /> +<br /> +<span>Over the years, I have built a couple of shell helper functions to optimize my workflows. Tmux is extensively integrated into my daily workflows (personal and work). I had colleagues asking me about my Tmux config and helper scripts for Tmux several times. It would be neat to blog about it so that everyone interested in it can make a copy of my configuration and scripts.</span><br /> +<br /> +<span>The configuration and scripts in this blog post are only the non-work-specific parts. There are more helper scripts, which I only use for work (and aren't really useful outside of work due to the way servers and clusters are structured there).</span><br /> +<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='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 /> +<a class='textlink' href='https://www.zsh.org'>https://www.zsh.org</a><br /> +<br /> +<span>For the most common Tmux commands I use, I have created the following shell aliases:</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">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='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 /> +<!-- 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"># 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='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 /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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='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='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 /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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='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 /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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='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 /> +<pre> +set-option -g prefix C-g +</pre> +<br /> +<span>This way, when I want to rename the remote Tmux session, I have to use <span class='inlinecode'>Ctrl-g $</span>, and when I want to rename the local Tmux session, I still have to use <span class='inlinecode'>Ctrl-b $</span>. In my case, I have this deployed to all remote servers through a configuration management system (out of scope for this blog post).</span><br /> +<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='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 /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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 /> +<br /> +<span>You must install the <span class='inlinecode'>fzf</span> command on your computer for this to work. This is how it looks like:</span><br /> +<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='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 /> +<a class='textlink' href='https://github.com/duncs/clusterssh'>https://github.com/duncs/clusterssh</a><br /> +<br /> +<span>However, since I started using Tmux, I retired ClusterSSH, as it came with the benefit that Tmux only needs to be run in the terminal, whereas ClusterSSH spawned terminal windows, which aren't easily portable (e.g., from a Linux desktop to macOS). The <span class='inlinecode'>tmux::cluster_ssh</span> function can have N arguments, where:</span><br /> +<br /> +<ul> +<li>...the first argument will be the session name (see <span class='inlinecode'>tmux::tssh_from_argument</span> helper function), and all remaining arguments will be server hostnames/FQDNs to connect to simultaneously.</li> +<li>...or, the first argument is a file name, and the file contains a list of hostnames/FQDNs (see <span class='inlinecode'>tmux::ssh_from_file</span> helper function)</li> +</ul><br /> +<span>This is the function definition behind the <span class='inlinecode'>tssh</span> alias:</span><br /> +<span> </span><br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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> + + 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='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 /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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 /> +<br /> +<span>Sometimes, I don't want the synchronized panes behavior and want to switch it off temporarily. I can do that with <span class='inlinecode'>prefix-key p</span> and <span class='inlinecode'>prefix-key P</span> after adding the following to my local <span class='inlinecode'>tmux.conf</span>:</span><br /> +<br /> +<pre> +bind-key p setw synchronize-panes off +bind-key P setw synchronize-panes on +</pre> +<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 /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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>) + + 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='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 /> +<pre> +$ tssh fish blowfish.buetow.org fishfinger.buetow.org \ + fishbone.buetow.org user@octopus.buetow.org +</pre> +<br /> +<span>To open a new session named <span class='inlinecode'>manyservers</span>, put many servers (one FQDN per line) into a file called <span class='inlinecode'>manyservers.txt</span> and simply run:</span><br /> +<br /> +<pre> +$ tssh manyservers.txt +</pre> +<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 /> +<ul> +<li>Press <span class='inlinecode'>prefix-key DIRECTION</span> to switch panes. DIRECTION is by default any of the arrow keys, but I also configured Vi keybindings.</li> +<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='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 /> +<span>This works by pressing <span class='inlinecode'>prefix-key [</span> to enter Tmux copy mode. From there, I can browse the Tmux history of the current window using either the arrow keys or vi-like navigation (see vi configuration later in this blog post) and the Pg-Dn and Pg-Up keys.</span><br /> +<br /> +<span>I often search the history backwards with <span class='inlinecode'>prefix-key [</span> followed by a <span class='inlinecode'>?</span>, which opens the Tmux history search prompt.</span><br /> +<br /> +<span>Once I have identified the terminal text to be copied, I enter visual select mode with <span class='inlinecode'>v</span>, highlight all the text to be copied (using arrow keys or Vi motions), and press <span class='inlinecode'>y</span> to yank it (sorry if this all sounds a bit complicated, but Vim/NeoVim users will know this, as it is pretty much how you do it there as well).</span><br /> +<br /> +<span>For <span class='inlinecode'>v</span> and <span class='inlinecode'>y</span> to work, the following has to be added to the Tmux configuration file: </span><br /> +<br /> +<pre> +bind-key -T copy-mode-vi 'v' send -X begin-selection +bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel +</pre> +<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='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 /> +<pre> +source ~/.config/tmux/tmux.local.conf + +set-option -g allow-rename off +set-option -g history-limit 100000 +set-option -g status-bg '#444444' +set-option -g status-fg '#ffa500' +set-option -s escape-time 0 +</pre> +<br /> +<span>There's yet to be much magic happening here. I source a <span class='inlinecode'>tmux.local.conf</span>, which I sometimes use to override the default configuration that comes from the configuration management system. But it is mostly just an empty file, so it doesn't throw any errors on Tmux startup when I don't use it.</span><br /> +<br /> +<span>I work with many terminal outputs, which I also like to search within Tmux. So, I added a large enough <span class='inlinecode'>history-limit</span>, enabling me to search backwards in Tmux for any output up to a million lines of text.</span><br /> +<br /> +<span>Besides changing some colours (personal taste), I also set <span class='inlinecode'>escape-time</span> to <span class='inlinecode'>0</span>, which is just a workaround. Otherwise, my Helix text editor's <span class='inlinecode'>ESC</span> key would take ages to trigger within Tmux. I am trying to remember the gory details. You can leave it out; if everything works fine for you, leave it out.</span><br /> +<br /> +<span>The next lines in the configuration file are:</span><br /> +<br /> +<pre> +set-window-option -g mode-keys vi +bind-key -T copy-mode-vi 'v' send -X begin-selection +bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel +</pre> +<br /> +<span>I navigate within Tmux using Vi keybindings, so the <span class='inlinecode'>mode-keys</span> is set to <span class='inlinecode'>vi</span>. I use the Helix modal text editor, which is close enough to Vi bindings for simple navigation to feel "native" to me. (By the way, I have been a long-time Vim and NeoVim user, but I eventually switched to Helix. It's off-topic here, but it may be worth another blog post once.)</span><br /> +<br /> +<span>The two <span class='inlinecode'>bind-key</span> commands make it so that I can use <span class='inlinecode'>v</span> and <span class='inlinecode'>y</span> in copy mode, which feels more Vi-like (as already discussed earlier in this post).</span><br /> +<br /> +<span>The next set of lines in the configuration file are:</span><br /> +<br /> +<pre> +bind-key h select-pane -L +bind-key j select-pane -D +bind-key k select-pane -U +bind-key l select-pane -R + +bind-key H resize-pane -L 5 +bind-key J resize-pane -D 5 +bind-key K resize-pane -U 5 +bind-key L resize-pane -R 5 +</pre> +<br /> +<span>These allow me to use <span class='inlinecode'>prefix-key h</span>, <span class='inlinecode'>prefix-key j</span>, <span class='inlinecode'>prefix-key k</span>, and <span class='inlinecode'>prefix-key l</span> for switching panes and <span class='inlinecode'>prefix-key H</span>, <span class='inlinecode'>prefix-key J</span>, <span class='inlinecode'>prefix-key K</span>, and <span class='inlinecode'>prefix-key L</span> for resizing the panes. If you don't know Vi/Vim/NeoVim, the letters <span class='inlinecode'>hjkl</span> are commonly used there for left, down, up, and right, which is also the same for Helix, by the way.</span><br /> +<br /> +<span>The next set of lines in the configuration file are:</span><br /> +<br /> +<pre> +bind-key c new-window -c '#{pane_current_path}' +bind-key F new-window -n "session-switcher" "tmux list-sessions | fzf | cut -d: -f1 | xargs tmux switch-client -t" +bind-key T choose-tree +</pre> +<br /> +<span>The first one is that any new window starts in the current directory. The second one is more interesting. I list all open sessions in the fuzzy finder. I rely heavily on this during my daily workflow to switch between various sessions depending on the task. E.g. from a remote cluster SSH session to a local code editor. </span><br /> +<br /> +<span>The third one, <span class='inlinecode'>choose-tree</span>, opens a tree view in Tmux listing all sessions and windows. This one is handy to get a better overview of what is currently running in any local Tmux session. It looks like this (it also allows me to press a hotkey to switch to a particular Tmux window):</span><br /> +<br /> +<a href='./terminal-multiplexing-with-tmux/tmux-tree-view.png'><img alt='Tmux sessiont tree view' title='Tmux sessiont tree view' src='./terminal-multiplexing-with-tmux/tmux-tree-view.png' /></a><br /> +<br /> +<br /> +<span>The last remaining lines in my configuration file are:</span><br /> +<span> </span><br /> +<pre> +bind-key p setw synchronize-panes off +bind-key P setw synchronize-panes on +bind-key r source-file ~/.config/tmux/tmux.conf \; display-message "tmux.conf reloaded" +</pre> +<br /> +<span>We discussed <span class='inlinecode'>synchronized panes</span> earlier. I use it all the time in clustered SSH sessions. When enabled, all panes (remote SSH sessions) receive the same keystrokes. This is very useful when you want to run the same commands on many servers at once, such as navigating to a common directory, restarting a couple of services at once, or running tools like <span class='inlinecode'>htop</span> to quickly monitor system resources.</span><br /> +<br /> +<span>The last one reloads my Tmux configuration on the fly.</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>Projects I currently don't have time for</title> + <link href="https://foo.zone/gemfeed/2024-05-03-projects-i-currently-dont-have-time-for.html" /> + <id>https://foo.zone/gemfeed/2024-05-03-projects-i-currently-dont-have-time-for.html</id> + <updated>2024-05-03T16:23:03+03:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <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='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 + +.'`~~~~~~~~~~~`'. +( .'11 12 1'. ) +| :10 \ 2: | +| :9 @-> 3: | +| :8 4; | +'. '..7 6 5..' .' + ~-------------~ ldb + +</pre> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<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 /> +<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='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 /> +<span>I had the idea to revive this concept, implement <span class='inlinecode'>fishbone2</span>, and place it in front of my proprietary ISP router to add an extra layer of security and control in my home LAN. It would serve as the default gateway for all of my devices, including a Wi-Fi access point, would run a DNS server, Pi-hole proxy, VPN client, and DynDNS client. I would also implement high availability using OpenBSD's CARP protocol.</span><br /> +<br /> +<a class='textlink' href='https://openbsdrouterguide.net'>https://openbsdrouterguide.net</a><br /> +<a class='textlink' href='https://pi-hole.net/'>https://pi-hole.net/</a><br /> +<a class='textlink' href='https://www.OpenBSD.org'>https://www.OpenBSD.org</a><br /> +<a class='textlink' href='https://www.OpenBSD.org/faq/pf/carp.html'>https://www.OpenBSD.org/faq/pf/carp.html</a><br /> +<br /> +<span>However, I am putting this on hold as I have opted for an OpenWRT-based solution, which was much quicker to set up and runs well enough.</span><br /> +<br /> +<a class='textlink' href='https://OpenWRT.org/'>https://OpenWRT.org/</a><br /> +<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 /> +<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='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='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 /> +<span>I would use an old ThinkPad laptop placed on a horizontal stand, running NetBSD, and attaching a keyboard from ModelFkeyboards. I use WindowMaker as a window manager and run terminal applications through Retro Term. For the monitor, I would use an older (black) EIZO model with large bezels.</span><br /> +<br /> +<a class='textlink' href='https://www.NetBSD.org'>https://www.NetBSD.org</a><br /> +<a class='textlink' href='https://www.modelfkeyboards.com'>https://www.modelfkeyboards.com</a><br /> +<a class='textlink' href='https://github.com/Swordfish90/cool-retro-term)'>https://github.com/Swordfish90/cool-retro-term)</a><br /> +<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='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='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 /> +<ul> +<li>Wallabag</li> +<li>Ankidroid</li> +<li>Miniflux & Postgres</li> +<li>Audiobookshelf</li> +<li>...</li> +</ul><br /> +<span>All of this would be within my LAN, but the services would also be accessible from the internet through either Wireguard or SSH reverse tunnels to one of my OpenBSD VMs, for example:</span><br /> +<br /> +<ul> +<li><span class='inlinecode'>wallabag.awesome.buetow.org</span></li> +<li><span class='inlinecode'>ankidroid.awesome.buetow.org</span></li> +<li><span class='inlinecode'>miniflux.awesome.buetow.org</span></li> +<li><span class='inlinecode'>audiobookshelf.awesome.buetow.org</span></li> +<li>...</li> +</ul><br /> +<span>I am abandoning this project for now, as I am currently hosting my apps on AWS ECS Fargate under <span class='inlinecode'>*.cool.buetow.org</span>, which is "good enough" for the time being and also offers the benefit of learning to use AWS and Terraform, knowledge that can be applied at work.</span><br /> +<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='programming-projects-i-don-t-have-time-for'>Programming projects I don't have time for</h2><br /> +<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='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 /> +<ul> +<li>A feature I miss presents me with a random day from the past and some photos from that day. This project would randomly select a day and generate a photo album for me to view and reminisce about memories.</li> +<li>Another feature I miss is the ability to automatically deduplicate all the photos, as I am sure there are tons of duplicates on my NAS.</li> +<li>Auto-enhancing the photos (perhaps using ImageMagick?)</li> +<li>I already have a simple <span class='inlinecode'>photoalbum.sh</span> script that generates an album based on an input directory. However, it would be great also to have a timeline feature to enable browsing through different dates.</li> +</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='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 /> +<span>I currently use Syncthing for encrypted file sync across all my devices; however, the data is not end-to-end encrypted. It's a good-enough setup, though, as my Syncthing server is in my home LAN on an encrypted file system.</span><br /> +<br /> +<a class='textlink' href='https://syncthing.net'>https://syncthing.net</a><br /> +<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='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 /> +<span>I had previously implemented a tiny scripting language called Fype (For Your Program Execution), which could have served as inspiration.</span><br /> +<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='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='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 /> +<a class='textlink' href='https://codeberg.org/snonux/vs-sim'>https://codeberg.org/snonux/vs-sim</a><br /> +<br /> +<span>The ideas I had was:</span><br /> +<br /> +<ul> +<li>Translate the project into English.</li> +<li>Modernise the Java codebase to be compatible with the latest JDK.</li> +<li>Make it compile to native binaries using GraalVM.</li> +<li>Distribute the project using AppImages.</li> +</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='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='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 /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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='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='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='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='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 /> +<a class='textlink' href='https://github.com/Librum-Reader/Librum'>https://github.com/Librum-Reader/Librum</a><br /> +<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='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 /> +<a class='textlink' href='https://www.usememos.com'>https://www.usememos.com</a><br /> +<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='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='books-i-don-t-have-time-to-read'>Books I don't have time to read</h2><br /> +<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='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='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 /> +<a class='textlink' href='https://paul.buetow.org/novels.html'>https://paul.buetow.org/novels.html</a><br /> +<a class='textlink' href='https://paul.buetow.org/novels.gmi'>https://paul.buetow.org/novels.gmi</a><br /> +<br /> +<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='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 /> +<span>This would be similar to the "Why OpenBSD rocks" site:</span><br /> +<br /> +<a class='textlink' href='https://why-openbsd.rocks'>https://why-openbsd.rocks</a><br /> +<a class='textlink' href='https://raku.org'>https://raku.org</a><br /> +<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='research-projects-i-don-t-have-time-for'>Research projects I don't have time for</h2><br /> +<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 /> +<a class='textlink' href='https://lwn.net/Articles/865256/'>https://lwn.net/Articles/865256/</a><br /> +<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='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 /> +<a class='textlink' href='https://brendangregg.com/blog/2017-05-09/cpu-utilization-is-wrong.html'>https://brendangregg.com/blog/2017-05-09/cpu-utilization-is-wrong.html</a><br /> +<br /> +<span>The research project would involve setting up dashboards that display actual CPU usage and the cycles versus waiting time for memory access.</span><br /> +<br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<span>Related and maybe interesting:</span><br /> +<br /> +<a class='textlink' href='./2022-06-15-sweating-the-small-stuff.html'>Sweating the small stuff - Tiny projects of mine</a><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>'Slow Productivity' book notes</title> + <link href="https://foo.zone/gemfeed/2024-05-01-slow-productivity-book-notes.html" /> + <id>https://foo.zone/gemfeed/2024-05-01-slow-productivity-book-notes.html</id> + <updated>2024-04-27T14:18:51+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 '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='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 /> +<span>These are my personal takeaways after reading "Slow Productivity - The lost Art of Accomplishment Without Burnout" by Cal Newport.</span><br /> +<br /> +<span>The case studies in this book were a bit long, but they appeared to be well-researched. I will only highlight the interesting, actionable items in the book notes.</span><br /> +<br /> +<span>These notes are mainly for my own use, but you may find them helpful.</span><br /> +<br /> +<pre> + ,.......... .........., + ,..,' '.' ',.., + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,'............., : ,.............', ', +,' '............ '.' ............' ', + '''''''''''''''''';''';'''''''''''''''''' + ''' +</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='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 /> +<br /> +<span>There is a tendency to perform shallow work because people will otherwise dismiss you as lazy. A lot of shallow work can cause burnout, as multiple things are often being worked on in parallel. The more you have on your plate, the more stressed you will be.</span><br /> +<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='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 /> +<span>There are three principles for the maintenance of a sustainable work life:</span><br /> +<br /> +<ul> +<li>Do fewer things</li> +<li>Work at a natural pace</li> +<li>Obsess over quality</li> +</ul><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 /> +<span>Reduce the overhead tax. The overhead tax is all the administrative work to be done. With every additional project, there will also be more administrative stuff to be done on your work plate. So, doing fewer things leads to more and better output and better quality for the projects you are working on.</span><br /> +<br /> +<span>Limit the things on your plate. Limit your missions (personal goals, professional goals). Reduce your main objectives in life. More than five missions are usually not sustainable very easily, so you have to really prioritise what is important to you and your professional life.</span><br /> +<br /> +<span>A mission is an overall objective/goal that can have multiple projects. Limit the projects as well. Some projects need clear endings (e.g., work in support of a never-ending flow of incoming requests). In this case, set limits (e.g., time box your support hours). You can also plan "office hours" for collaborative work with colleagues to avoid ad hoc distractions.</span><br /> +<br /> +<span>The key point is that after making these commitments, you really deliver on them. This builds trust, and people will leave you alone and not ask for progress all the time.</span><br /> +<br /> +<span>Doing fever things is essential for modern knowledge workers. Breathing space in your work also makes you more creative and happier overall.</span><br /> +<br /> +<span>Pushing workers more work can make them less productive, so the better approach is the pull model, where workers pull in new work when the previous task is finished.</span><br /> +<br /> +<span>If you can quantify how busy you are or how many other projects you already work on, then it is easier to say no to new things. For example, show what you are doing, what's in the roadmap, etc. Transparency is the key here. </span><br /> +<br /> +<span>You can have your own simulated pull system if the company doesn't agree to a global one: </span><br /> +<br /> +<ul> +<li>State which additional information you would need.</li> +<li>Create a rough estimate of when you will be able to work on it</li> +<li>Estimate how long the project would take. Double that estimate, as humans are very bad estimators.</li> +<li>Respond to the requester and state that you will let him know when the estimates change.</li> +</ul><br /> +<span>Sometimes, a little friction is all that is needed to combat incoming work, e.g., when your manager starts seeing the reality of your work plate, and you also request additional information for the task. If you already have too much on your plate, then decline the new project or make room for it in your calendar. If you present a large task list, others will struggle to assign more to you.</span><br /> +<br /> +<span>Limit your daily goals. A good measure is to focus on one goal per day. You can time block time for deep work on your daily goal. During that time, you won't be easily available to others.</span><br /> +<br /> +<span>The battle against distractions must be fought to be the master of your time. Nobody will fight this war for you. You have to do it for yourself. (Also, have a look at Cal Newport's "time block planning" method).</span><br /> +<br /> +<span>Put tasks on autopilot (regular recurring tasks).</span><br /> +<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 /> +<span>Don't rush. If you rush or are under pressure, you will be less effective and eventually burn out. Our brains work better then not rushy. The stress heuristic usually indicates too much work, and it is generally too late to reduce workload. That's why we all typically have dangerously too much to do.</span><br /> +<br /> +<span>Have the courage to take longer to do things that are important. For example, plan on a yearly and larger scale, like 2 to 5 years.</span><br /> +<br /> +<span>Find a reasonable time for a project and then double the project timeline against overconfident optimism. Humans are not great at estimating. They gravitate towards best-case estimates. If you have planned more than enough time for your project, then you will fall into a natural work pace. Otherwise, you will struggle with rushing and stress.</span><br /> +<br /> +<span>Some days will still be intense and stressful, but those are exceptional cases. After those exceptions (e.g., finalizing that thing, etc.), calmer periods will follow again.</span><br /> +<br /> +<span>Pace yourself over modest results over time. Simplify and reduce the daily task lists. Meetings: Certain hours are protected for work. For each meeting, add a protected block to your calendar, so you attend meetings only half a day max.</span><br /> +<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='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 /> +<ul> +<li>Focus on the core activities of your work for your obsession - you will only have the time to obsess over some things.</li> +<li>Deliver solid work with good quality.</li> +<li>Sharpen the focus to do the best work possible.</li> +</ul><br /> +<span>Go pro to save time, and don't squeeze everything out that you can from freemium services. Professional software services eliminate administrative work:</span><br /> +<br /> +<ul> +<li>Pay people who know what they are doing and focus on your stuff. </li> +<li>For example, don't repair that car if you know the mechanic can do that much better than you. </li> +<li>Or don't use the free version of the music streaming service if it interrupts you with commercials, hindering your ability to concentrate on your work.</li> +<li>Hire an accountant for your yearly tax returns. He knows much more about that stuff than you do. And in the end, he will even be cheaper as he knows all the tax laws.</li> +<li>...</li> +</ul><br /> +<span>Adjust your workplace to what you want to accomplish. You could have dedicated places in your home for different things, e.g., a place where you read and think (armchair) and a place where you collaborate (your desk or whiteboard). Surround yourself with things that inspire you (e.g., your favourite books on your shelf next to you, etc.).</span><br /> +<br /> +<span>There is the concept of quiet quitting. It doesn't mean quitting your job, but it means that you don't go beyond and above the expectations people have of you. Quiet quitting became popular with modern work, which is often meaningless and full of shallow tasks. If you obsess over quality, you enjoy your craft and want to go beyond and above.</span><br /> +<br /> +<span>Implement rituals and routines which shift you towards your goals:</span><br /> +<br /> +<ul> +<li>For example, if you want to be a good Software Engineer, you also have to put in the work regularly. For instance, progress a bit every day in your project at hand, even if it is only one hour daily. Also, a little quality daily work will be more satisfying over time than many shallow tasks.</li> +<li>Do you want to be lean and/or healthy? Schedule your daily walks and workouts. They will become habits over time.</li> +<li>There's the compounding effect where every small effort made every day will yield significant results in the long run</li> +</ul><br /> +<span>Deciding what not to do is as important as deciding what to do. </span><br /> +<br /> +<span>It appears to be money thrown out of the window, but you get a $50 expensive paper notebook (and also a good pen). Unconsciously, it will make you take notes more seriously. You will think about what to put into the notebooks more profoundly and have thought through the ideas more intensively. If you used very cheap notebooks, you would scribble a lot of rubbish and wouldn't even recognise your handwriting after a while anymore. So choosing a high-quality notebook will help you to take higher-quality notes, too.</span><br /> +<br /> +<span>Slow productivity is actionable and can be applied immediately.</span><br /> +<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</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='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>KISS high-availability with OpenBSD</title> + <link href="https://foo.zone/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.html" /> + <id>https://foo.zone/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.html</id> + <updated>2024-03-30T22:12:56+02:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <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='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 + __________ + / nsd tower\ ( + /____________\ (\) awk-ward + |:_:_:_:_:_| )) plant + |_:_,--.:_:| dig-bubble (\// ) + |:_:|__|_:_| relayd-castle _ ) )) (( + _ |_ _ :_:| _ _ _ (_) (((( /)\` + | |_| |_| | _| | |_| |_| | o \\)) (( ( + \_:_:_:_:/|_|_|_|\:_:_:_:_/ . (( )))) + |_,-._:_:_:_:_:_:_:_.-,_| )) ((// + |:|_|:_:_:,---,:_:_:|_|:| ,-. )/ + |_:_:_:_,'puffy `,_:_:_:_| _ o ,;'))(( + |:_:_:_/ _ | _ \_:_:_:| (_O (( )) +_____|_:_:_| (o)-(o) |_:_:_|--'`-. ,--. ksh under-water (((\'/ + ', ;|:_:_:| -( .-. )- |:_:_:| ', ; `--._\ /,---.~ goat \`)) +. ` |_:_:_| \`-'/ |_:_:_|. ` . ` /()\.__( ) .,-----'`-\(( sed-root + ', ;|:_:_:| `-' |:_:_:| ', ; ', ; `--'| \ ', ; ', ; ',')).,-- +. ` MJP ` . ` . ` . ` . httpd-soil ` . . ` . ` . ` . ` . ` + ', ; ', ; ', ; ', ; ', ; ', ; ', ; ', ; ', ; ', ; ', ; ', ; ', ; ', ; + +</pre> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<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> +<li>Don't rely on the hottest and newest tech (don't want to migrate everything to a new and fancier technology next month already!).</li> +<li>It should be reasonably cheap. I want to avoid paying a premium for floating IPs or fancy Elastic Load Balancers.</li> +<li>It should be geo-redundant. </li> +<li>It's fine if my sites aren't reachable for five or ten minutes every other month. Due to their static nature, I don't care if there's a split-brain scenario where some requests reach one server and other requests reach another server.</li> +<li>Failover should work for both HTTP/HTTPS and Gemini protocols. My self-hosted MTAs and DNS servers should also be highly available.</li> +<li>Let's Encrypt TLS certificates should always work (before and after a failover).</li> +<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='my-ha-solution'>My HA solution</h2><br /> +<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 /> +<a class='textlink' href='https://man.OpenBSD.org/nsd.8'>https://man.OpenBSD.org/nsd.8</a><br /> +<a class='textlink' href='https://man.OpenBSD.org/ksh'>https://man.OpenBSD.org/ksh</a><br /> +<a class='textlink' href='https://man.OpenBSD.org/awk'>https://man.OpenBSD.org/awk</a><br /> +<a class='textlink' href='https://man.OpenBSD.org/sed'>https://man.OpenBSD.org/sed</a><br /> +<a class='textlink' href='https://man.OpenBSD.org/dig'>https://man.OpenBSD.org/dig</a><br /> +<a class='textlink' href='https://man.OpenBSD.org/ftp'>https://man.OpenBSD.org/ftp</a><br /> +<a class='textlink' href='https://man.OpenBSD.org/cron'>https://man.OpenBSD.org/cron</a><br /> +<br /> +<span>I also used the <span class='inlinecode'>dig</span> (for DNS checks) and <span class='inlinecode'>ftp</span> (for HTTP/HTTPS checks) programs. </span><br /> +<br /> +<span>The DNS failover is performed automatically between the two OpenBSD VMs involved (my setup doesn't require any quorum for a failover, so there isn't a need for a 3rd VM). The <span class='inlinecode'>ksh</span> script, executed once per minute via CRON (on both VMs), performs a health check to determine whether the current master node is available. If the current master isn't available (no HTTP response as expected), a failover is performed to the standby VM: </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">#!/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 /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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>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 /> +<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">#! 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 /> +<br /> +<span>The authorative nameserver for my domains runs on both VMs, and both are configured to be a "master" DNS server so that they have their own individual zone files, which can be changed independently. Otherwise, my setup wouldn't work. The side effect is that under a split-brain scenario (both VMs cannot see each other), both would promote themselves to master via their local DNS entries. More about that later, but that's fine in my use case.</span><br /> +<br /> +<span>Check out the whole script here:</span><br /> +<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='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 /> +<a class='textlink' href='https://OpenBSD.Amsterdam'>https://OpenBSD.Amsterdam</a><br /> +<a class='textlink' href='https://www.Hetzner.cloud'>https://www.Hetzner.cloud</a><br /> +<br /> +<span>I only have a little traffic on my sites. I could always upload the static content to AWS S3 if I suddenly had to. But this will never be required.</span><br /> +<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='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='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 /> +<a class='textlink' href='https://man.OpenBSD.org/httpd.8'>https://man.OpenBSD.org/httpd.8</a><br /> +<a class='textlink' href='https://man.OpenBSD.org/relayd.8'>https://man.OpenBSD.org/relayd.8</a><br /> +<br /> +<span>For example, the master is responsible for the <span class='inlinecode'>https://www.foo.zone</span> and <span class='inlinecode'>https://foo.zone</span> hosts, whereas the standby can be reached via <span class='inlinecode'>https://standby.foo.zone</span> (port 80 for plain HTTP works as well). The same principle is followed with all the other hosts, e.g. <span class='inlinecode'>irregular.ninja</span>, <span class='inlinecode'>paul.buetow.org</span> and so on. The same applies to my Gemini capsules for <span class='inlinecode'>https://foo.zone</span>, <span class='inlinecode'>https://standby.foo.zone</span>, <span class='inlinecode'>https://paul.buetow.org</span> and <span class='inlinecode'>https://standby.paul.buetow.org</span>.</span><br /> +<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='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 /> +<span>If the master always serves <span class='inlinecode'>foo.zone</span> and the standby always <span class='inlinecode'>standby.foo.zone</span>, then there would be a problem after the failover, as the new master wouldn't have a valid certificate for <span class='inlinecode'>foo.zone</span> and the new standby wouldn't have a valid certificate for <span class='inlinecode'>standby.foo.zone</span> which would lead to TLS errors on the clients.</span><br /> +<br /> +<span>As a solution, the CRON job responsible for the DNS failover also checks for the current week number of the year so that:</span><br /> +<br /> +<ul> +<li>In an odd week number, the first server is the default master</li> +<li>In an even week number, the second server is the default master.</li> +</ul><br /> +<span>Which translates to:</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"># 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 /> +<br /> +<span>The ACME automation is yet another daily CRON script <span class='inlinecode'>/usr/local/bin/acme.sh</span>. It iterates over all of my Let's Encrypt hosts, checks whether they resolve to the same IP address as the current VM, and only then invokes the ACME client to request or renew the TLS certificates. So, there are always correct requests made to Let's Encrypt. </span><br /> +<br /> +<span>Let's encrypt certificates usually expire after 3 months, so a weekly failover of my VMs is plenty.</span><br /> +<br /> +<a class='textlink' href='https://codeberg.org/snonux/rexfiles/src/branch/master/frontends/scripts/acme.sh.tpl'><span class='inlinecode'>acme.sh.tpl</span> - Rex template for the <span class='inlinecode'>acme.sh</span> script of mine.</a><br /> +<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 /> +<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 /> +<a class='textlink' href='https://codeberg.org/snonux/gogios'>https://codeberg.org/snonux/gogios</a><br /> +<a class='textlink' href='./2023-06-01-kiss-server-monitoring-with-gogios.html'>KISS server monitoring with Gogios</a><br /> +<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='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 /> +<a class='textlink' href='https://www.rexify.org'>https://www.rexify.org</a><br /> +<a class='textlink' href='https://codeberg.org/snonux/rexfiles/src/branch/master/frontends'>codeberg.org/snonux/rexfiles/frontends</a><br /> +<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='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 /> +<a class='textlink' href='https://www.OpenSMTPD.org/'>https://www.OpenSMTPD.org/</a><br /> +<br /> +<span>As a password manager, I use <span class='inlinecode'>geheim</span>, a command-line tool I wrote in Ruby with encrypted files in a git repository (I even have it installed in Termux on my Phone). For HA reasons, I simply updated the client code so that it always synchronises the database with both servers when I run the <span class='inlinecode'>sync</span> command there. </span><br /> +<br /> +<a class='textlink' href='https://codeberg.org/snonux/geheim'>https://codeberg.org/snonux/geheim</a><br /> +<br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<span>Other *BSD and KISS 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</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> + </content> + </entry> + <entry> + <title>A fine Fyne Android app for quickly logging ideas programmed in Go</title> + <link href="https://foo.zone/gemfeed/2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.html" /> + <id>https://foo.zone/gemfeed/2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.html</id> + <updated>2024-03-03T00:07:21+02:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <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='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 /> +<span>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. </span><br /> +<br /> +<span>I have tried many note apps for my Android (I use GrapheneOS) phone. Most of them either don't do what I want, are proprietary software, require Google Play services (I have the main profile on my phone de-googled) or are too bloated. I was never into mobile app development, as I'm not too fond of the complexity of the developer toolchains. I don't want to use Android Studio (as a NeoVim user), and I don't want to use Java or Kotlin. I want to use a language I know (and like) for mobile app development. Go would be one of those languages.</span><br /> +<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 /> +<a class='textlink' href='https://fyne.io'>https://fyne.io</a><br /> +<a class='textlink' href='https://go.dev'>https://go.dev</a><br /> +<br /> +<span>There's no need to navigate complex menus or deal with sync issues. I jot down my Idea, and Quick logger saves it to a plain text file in a designated local folder on my phone. There is one text file per note (timestamp in the file name). Once logged, the file can't be edited anymore (it keeps it simple). If I want to correct or change a note, I simply write a new one. My notes are always small (usually one short sentence each), so there isn't the need for an edit functionality. I can edit them later on my actual computer if I want to.</span><br /> +<br /> +<span>With Syncthing, the note files are then synchronised to my home computer to my <span class='inlinecode'>~/Notes</span> directory. From there, a small glue Raku script adds them to my Taskwarrior DB so that I can process them later (e.g. take action on that one Idea I had). That then will delete the original note files from my computer and also (through Syncthing) from my phone.</span><br /> +<br /> +<a class='textlink' href='https://syncthing.net'>https://syncthing.net</a><br /> +<a class='textlink' href='https://raku.org'>https://raku.org</a><br /> +<a class='textlink' href='https://taskwarrior.org'>https://taskwarrior.org</a><br /> +<br /> +<span>Quick logger's user interface is as minimal as it gets. When I launch Quick logger, I'm greeted with a simple window where I can type plain text. Hit the "Log text" button, and voilà – the input is timestamped and saved as a file in my chosen directory. If I need to change the directory, the "Preferences" button brings up a window where I can set the notes folder and get back to logging.</span><br /> +<br /> +<span>For the code-savvy folks out there, Quick logger is a neat example of what you can achieve with Go and Fyne. It's a testament to building functional, cross-platform apps without getting bogged down in the nitty-gritty of platform-specific details. Thanks to Fyne, I am pleased with how easy it is to make mobile Android apps in Go.</span><br /> +<br /> +<a href='a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang/screenshot-android.png'><img alt='Quick logger running on Android' title='Quick logger running on Android' src='a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang/screenshot-android.png' /></a><br /> +<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='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 /> +<a class='textlink' href='https://github.com/fyne-io/fyne/issues/3077#issuecomment-1912697360'>https://github.com/fyne-io/fyne/issues/3077#issuecomment-1912697360</a><br /> +<br /> +<span class='quote'>What worked however (app icon showing up) was to clone the fyne project, change the occurances of android.permission.INTERNET to android.permission.MANAGE_EXTERNAL_STORAGE (as these are all the changes I want in my custom android manifest) in the source tree, re-compile fyne. Now all works. I know, this is more of an hammer approach!</span><br /> +<br /> +<span>Hopefully, I won't need to use this workaround anymore. But for now, it is a fair tradeoff for what I am getting.</span><br /> +<br /> +<span>I hope this will inspire you to write your own small mobile apps in Go using the awesome Fyne framework! PS: The Quick logger logo was generated by ChatGPT.</span><br /> +<br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<span>Other Go related posts are:</span><br /> +<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 /> + </div> + </content> + </entry> + <entry> + <title>From `babylon5.buetow.org` to `*.buetow.cloud`</title> + <link href="https://foo.zone/gemfeed/2024-02-04-from-babylon5.buetow.org-to-.cloud.html" /> + <id>https://foo.zone/gemfeed/2024-02-04-from-babylon5.buetow.org-to-.cloud.html</id> + <updated>2024-02-04T00:50:50+02:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <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='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 /> +<span>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.</span><br /> +<br /> +<span>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</span><br /> +<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='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 /> +<a class='textlink' href='https://en.wikipedia.org/wiki/Babylon_5'>https://en.wikipedia.org/wiki/Babylon_5</a><br /> +<br /> +<span>The downsides of this setup were:</span><br /> +<br /> +<ul> +<li>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. </li> +<li>Manual installation.</li> +</ul><br /> +<span>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.</span><br /> +<br /> +<span>The benefits of this setup were:</span><br /> +<br /> +<ul> +<li>KISS (Keep it Simple Stupid)</li> +<li>Cheap</li> +</ul><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 /> +<span>My other two OpenBSD VMs (<span class='inlinecode'>blowfish.buetow.org</span>, hosted at Hetzner, and <span class='inlinecode'>fishfinger.buetow.org</span>, hosted at OpenBSD Amsterdam) still run (and they will keep running) the following services:</span><br /> +<br /> +<ul> +<li>HTTP server for my websites (e.g. <span class='inlinecode'>https://foo.zone</span>, ...)</li> +<li>ACME for Let's Encrypt TLS certificate auto-renewal.</li> +<li>Gemini server for my capsules (e.g. <span class='inlinecode'>https://foo.zone</span>)</li> +<li>Authoritative DNS servers for my domains (but <span class='inlinecode'>buetow.cloud</span>, which is on Route 53 now)</li> +<li>Mail transfer agent (MTA)</li> +<li>My Gogios monitoring system.</li> +<li>My IRC bouncer.</li> +</ul><br /> +<span>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.</span><br /> +<br /> +<a class='textlink' href='https://www.rexify.org'>(R)?ex, the friendly automation framework</a><br /> +<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='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 /> +<span>I decided to automate everything with Terraform, as I wanted to learn to use it as it appears standard now in the job market.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>The authoritative DNS for the <span class='inlinecode'>buetow.cloud</span> 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.</span><br /> +<br /> +<span>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, <span class='inlinecode'>eu-central-1</span>.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>The EFS automatically gets backed up by AWS for me following their standard Backup schedule. The daily backups are kept for 30 days. </span><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>You can find all Terraform manifests here:</span><br /> +<br /> +<a class='textlink' href='https://codeberg.org/snonux/terraform'>https://codeberg.org/snonux/terraform</a><br /> +<br /> +<span>Whereas:</span><br /> +<br /> +<ul> +<li><span class='inlinecode'>org-buetow-base</span> 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.</li> +<li><span class='inlinecode'>org-buetow-bastion</span> sets up a minimal Amazon Linux EC2 instance where I can manually SSH into and look at the EFS file system (if required).</li> +<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='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 /> +<h3 style='display: inline' id='fluxbuetowcloud'><span class='inlinecode'>flux.buetow.cloud</span></h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>Miniflux requires two ECS containers. One is the Miniflux app, and the other is the PostgreSQL DB.</span><br /> +<br /> +<a class='textlink' href='https://miniflux.app/'>https://miniflux.app/</a><br /> +<br /> +<br /> +<h3 style='display: inline' id='audiobookshelfbuetowcloud'><span class='inlinecode'>audiobookshelf.buetow.cloud</span></h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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 :-)</span><br /> +<br /> +<a class='textlink' href='https://www.audiobookshelf.org'>https://www.audiobookshelf.org</a><br /> +<br /> +<h3 style='display: inline' id='syncthingbuetowcloud'><span class='inlinecode'>syncthing.buetow.cloud</span></h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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 <span class='inlinecode'>Notes</span> 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.</span><br /> +<br /> +<span>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).</span><br /> +<br /> +<a class='textlink' href='https://syncthing.net/'>https://syncthing.net/</a><br /> +<br /> +<h3 style='display: inline' id='radicalebuetowcloud'><span class='inlinecode'>radicale.buetow.cloud</span></h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>On Android, it works great together with the DAVx5 client for synchronisation.</span><br /> +<br /> +<a class='textlink' href='https://radicale.org/'>https://radicale.org/</a><br /> +<a class='textlink' href='https://codeberg.org/snonux/docker-radicale-server'>https://codeberg.org/snonux/docker-radicale-server</a><br /> +<a class='textlink' href='https://www.davx5.com/'>https://www.davx5.com/</a><br /> +<br /> +<h3 style='display: inline' id='bagbuetowcloud'><span class='inlinecode'>bag.buetow.cloud</span></h3><br /> +<br /> +<span>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!</span><br /> +<br /> +<a class='textlink' href='https://wallabag.org/'>https://wallabag.org/</a><br /> +<a class='textlink' href='https://github.com/wallabag/wallabag'>https://github.com/wallabag/wallabag</a><br /> +<br /> +<h3 style='display: inline' id='ankibuetowcloud'><span class='inlinecode'>anki.buetow.cloud</span></h3><br /> +<br /> +<span>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 <span class='inlinecode'>anki-sync-server</span>. For some reason (not going into the details here), I had to build my own Docker image for the server.</span><br /> +<br /> +<a class='textlink' href='https://apps.ankiweb.net/'>https://apps.ankiweb.net/</a><br /> +<a class='textlink' href='https://codeberg.org/snonux/docker-anki-sync-server'>https://codeberg.org/snonux/docker-anki-sync-server</a><br /> +<br /> +<h3 style='display: inline' id='vaultbuetowcloud'><span class='inlinecode'>vault.buetow.cloud</span></h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>I currently don't use it, but I may in the future. I made it available in my ECS Fargate setup anyway for now.</span><br /> +<br /> +<a class='textlink' href='https://github.com/dani-garcia/vaultwarden'>https://github.com/dani-garcia/vaultwarden</a><br /> +<br /> +<span>I currently use <span class='inlinecode'>geheim</span>, a Ruby command line tool I wrote, as my current password manager. You can read a little bit about it here under "More":</span><br /> +<br /> +<a class='textlink' href='./2022-06-15-sweating-the-small-stuff.html'>Sweating the small stuff </a><br /> +<br /> +<h3 style='display: inline' id='bastionbuetowcloud'><span class='inlinecode'>bastion.buetow.cloud</span></h3><br /> +<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 /> +<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 /> +<span>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.</span><br /> +<br /> +<span>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! </span><br /> +<br /> +<span>Will I keep it in the cloud? I don't know yet. But maybe I won't renew the <span class='inlinecode'>buetow.cloud</span> domain and instead will use <span class='inlinecode'>*.cloud.buetow.org</span> or <span class='inlinecode'>*.aws.buetow.org</span> subdomains. </span><br /> +<br /> +<span>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.</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>One reason why I love OpenBSD</title> + <link href="https://foo.zone/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.html" /> + <id>https://foo.zone/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.html</id> + <updated>2024-01-13T22:55:33+02:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>HKISSFISHKISSFISHKISSFISHKISSFISH KISS</summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <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 /> +<pre> + FISHKISSFISHKIS + SFISHKISSFISHKISSFISH F + ISHK ISSFISHKISSFISHKISS FI + SHKISS FISHKISSFISHKISSFISS FIS +HKISSFISHKISSFISHKISSFISHKISSFISH KISS + FISHKISSFISHKISSFISHKISSFISHKISS FISHK + SSFISHKISSFISHKISSFISHKISSFISHKISSF + ISHKISSFISHKISSFISHKISSFISHKISSF ISHKI +SSFISHKISSFISHKISSFISHKISSFISHKIS SFIS + HKISSFISHKISSFISHKISSFISHKISS FIS + HKISSFISHKISSFISHKISSFISHK IS + SFISHKISSFISHKISSFISH K + ISSFISHKISSFISHK +</pre> +<br /> +<span>I just upgraded my OpenBSD's from <span class='inlinecode'>7.3</span> to <span class='inlinecode'>7.4</span> by following the unattended upgrade guide:</span><br /> +<br /> +<a class='textlink' href='https://www.openbsd.org/faq/upgrade74.html'>https://www.openbsd.org/faq/upgrade74.html</a><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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 /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<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 /> +<br /> +<span>I followed the same procedure the previous times and never encountered any difficulties with any OpenBSD upgrades.</span><br /> +<br /> +<span>I have seen upgrades of other Operating Systems either take a long time or break the system (which takes manual steps to repair). That's just one of many reasons why I love OpenBSD! There appear never to be any problems. It just gets its job done!</span><br /> +<br /> +<a class='textlink' href='https://www.openbsd.org'>The OpenBSD Project</a><br /> +<br /> +<span>BTW: are you looking for an opinionated OpenBSD VM hoster? OpenBSD Amsterdam may be for you. They rock (I am having a VM there, too)!</span><br /> +<br /> +<a class='textlink' href='https://openbsd.amsterdam'>https://openbsd.amsterdam</a><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='./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</title> + <link href="https://foo.zone/gemfeed/2024-01-09-site-reliability-engineering-part-3.html" /> + <id>https://foo.zone/gemfeed/2024-01-09-site-reliability-engineering-part-3.html</id> + <updated>2024-01-09T18:35:48+02:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <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='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>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</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> + ..--""""----.. + .-" ..--""""--.j-. + .-" .-" .--.""--.. + .-" .-" ..--"-. \/ ; + .-" .-"_.--..--"" ..--' "-. : + .' .' / `. \..--"" __ _ \ ; + :.__.-" \ / .' ( )"-. Y + ; ;: ( ) ( ). \ + .': /:: : \ \ + .'.-"\._ _.-" ; ; ( ) .-. ( ) \ + " `.""" .j" : : \ ; ; \ + bug /"""""/ ; ( ) "" :.( ) \ + /\ / : \ \`.: _ \ + : `. / ; `( ) (\/ :" \ \ + \ `. : "-.(_)_.' t-' ; + \ `. ; ..--": + `. `. : ..--"" : + `. "-. ; ..--"" ; + `. "-.:_..--"" ..--" + `. : ..--"" + "-. : ..--"" + "-.;_..--"" + +</pre> +<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>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>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>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>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>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>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>Mistakes are gonna happen, which is why having a blameless on-call culture is so important.</span><br /> +<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 /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>Bash Golf Part 3</title> + <link href="https://foo.zone/gemfeed/2023-12-10-bash-golf-part-3.html" /> + <id>https://foo.zone/gemfeed/2023-12-10-bash-golf-part-3.html</id> + <updated>2023-12-10T11:35:54+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 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='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>> + \ \ \ . ' . | + O>> O>> O>> . 'o | + \ .\. .. .\. .. . | + /\ . /\ . /\ . . | + / / . / / .'. / / .' . | +jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + Art by Joan Stark, mod. by Paul Buetow +</pre> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<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 /> +<span>This is particularly useful for logging when you want to include the callee function in the log output. E.g. look at this log helper:</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">#!/usr/bin/env bash</font></i> + +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> + + <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) + + echo <font color="#808080">"$level|$stamp|$pid|$callee|$message"</font> >&<font color="#000000">2</font> +} + +at_home_friday_evening () { + log INFO <font color="#808080">'One Peperoni Pizza, please'</font> +} + +at_home_friday_evening +</pre> +<br /> +<span>The output is 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>❯ ./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 /> +<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 /> +<ul> +<li><span class='inlinecode'>:(){ }</span> is really a declaration of the function <span class='inlinecode'>:</span></li> +<li>The <span class='inlinecode'>;</span> is ending the current statement</li> +<li>The <span class='inlinecode'>:</span> at the end is calling the function <span class='inlinecode'>:</span></li> +<li><span class='inlinecode'>:|:&</span> is the function body</li> +</ul><br /> +<span>Let's break down the function body <span class='inlinecode'>:|:&</span>: </span><br /> +<br /> +<ul> +<li>The first <span class='inlinecode'>:</span> is calling the function recursively</li> +<li>The <span class='inlinecode'>|:</span> is piping the output to the function <span class='inlinecode'>:</span> again (parallel recursion)</li> +<li>The <span class='inlinecode'>&</span> lets it run in the background.</li> +</ul><br /> +<span>So, it's a fork bomb. If you run it, your computer will run out of resources eventually. (Modern Linux distributions could have reasonable limits configured for your login session, so it won't bring down your whole system anymore unless you run it as <span class='inlinecode'>root</span>!)</span><br /> +<br /> +<span>And here is the cute illustration:</span><br /> +<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='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 /> +<!-- 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">#!/usr/bin/env bash</font></i> + +outer() { + inner() { + echo <font color="#808080">'Intel inside!'</font> + } + inner +} + +inner +outer +inner +</pre> +<br /> +<span>And let's execute it:</span><br /> +<br /> +<pre> +❯ ./inner.sh +/tmp/inner.sh: line 10: inner: command not found +Intel inside! +Intel inside! +</pre> +<br /> +<span>What happened? The first time <span class='inlinecode'>inner</span> was called, it wasn't defined yet. That only happens after the <span class='inlinecode'>outer</span> run. Note that <span class='inlinecode'>inner</span> will still be globally defined. But functions can be declared multiple times (the last version wins):</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">#!/usr/bin/env bash</font></i> + +outer1() { + inner() { + echo <font color="#808080">'Intel inside!'</font> + } + inner +} + +outer2() { + inner() { + echo <font color="#808080">'Wintel inside!'</font> + } + inner +} + +outer1 +inner +outer2 +inner +</pre> +<br /> +<span>And let's run it:</span><br /> +<br /> +<pre> +❯ ./inner2.sh +Intel inside! +Intel inside! +Wintel inside! +Wintel inside! +</pre> +<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 /> +<!-- 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">#!/usr/bin/env bash</font></i> + +some_expensive_operations() { + echo <font color="#808080">"Doing expensive operations with '$1' from pid $$"</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 /> +<br /> +<pre> +❯ ./xargs.sh +bash: line 1: some_expensive_operations: command not found +bash: line 1: some_expensive_operations: command not found +bash: line 1: some_expensive_operations: command not found +bash: line 1: some_expensive_operations: command not found +bash: line 1: some_expensive_operations: command not found +bash: line 1: some_expensive_operations: command not found +bash: line 1: some_expensive_operations: command not found +bash: line 1: some_expensive_operations: command not found +bash: line 1: some_expensive_operations: command not found +bash: line 1: some_expensive_operations: command not found +</pre> +<br /> +<span>There's an easy solution for this. Just export the function! It will then be magically available in any sub-shell!</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">#!/usr/bin/env bash</font></i> + +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><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 /> +<br /> +<pre> +❯ ./xargs.sh +Doing expensive operations with '0' from pid 132831 +Doing expensive operations with '1' from pid 132832 +Doing expensive operations with '2' from pid 132833 +Doing expensive operations with '3' from pid 132834 +Doing expensive operations with '4' from pid 132835 +Doing expensive operations with '5' from pid 132836 +Doing expensive operations with '6' from pid 132837 +Doing expensive operations with '7' from pid 132838 +Doing expensive operations with '8' from pid 132839 +Doing expensive operations with '9' from pid 132840 +</pre> +<br /> +<span>If <span class='inlinecode'>some_expensive_function</span> would call another function, the other function must also be exported. Otherwise, there will be a runtime error again. E.g., this won't 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><i><font color="silver">#!/usr/bin/env bash</font></i> + +some_other_function() { + echo <font color="#808080">"$1"</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><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='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 /> +<!-- 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">#!/usr/bin/env bash</font></i> + +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> +} + +bar() { + echo <font color="#808080">"$foo"</font> + foo=baz +} + +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 /> +<br /> +<span>Let's run it:</span><br /> +<br /> +<pre> +❯ ./dynamic.sh +bar +baz +foo +</pre> +<br /> +<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='if-conditionals'><span class='inlinecode'>if</span> conditionals</h2><br /> +<br /> +<span>Consider all variants here more or less equivalent:</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">#!/usr/bin/env bash</font></i> + +<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><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><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="#808080">"$foo"</font> = foo ] && [ <font color="#808080">"$bar"</font> == bar ] && echo ok2b + +<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="#808080">"$foo"</font> = foo && <font color="#808080">"$bar"</font> == bar ]] && echo ok3b + +<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><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 /> +<br /> +<pre> +❯ ./if.sh +ok1 +ok2a +ok2b +ok3a +ok3b +ok4a +ok4b +</pre> +<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 /> +<!-- 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">#!/usr/bin/env bash</font></i> + +<i><font color="silver"># Single line comment</font></i> + +<i><font color="silver"># These are two single line</font></i> +<i><font color="silver"># comments one after another</font></i> + +: <<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='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 /> +<!-- 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">#!/usr/bin/env bash</font></i> + +echo foo +echo echo baz >> $0 +echo bar +</pre> +<br /> +<span>When it is run, it will do:</span><br /> +<br /> +<pre> +❯ ./if.sh +foo +bar +baz +❯ cat if.sh +#!/usr/bin/env bash + +echo foo +echo echo baz >> $0 +echo bar +echo baz +</pre> +<br /> +<span>So what happened? The <span class='inlinecode'>echo baz</span> line was appended to the script while it was still executed! And the interpreter also picked it up! It tells us that Bash evaluates each line as it encounters it. This can lead to nasty side effects when editing the script while it is still being executed! You should always keep this in mind!</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='./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</title> + <link href="https://foo.zone/gemfeed/2023-11-19-site-reliability-engineering-part-2.html" /> + <id>https://foo.zone/gemfeed/2023-11-19-site-reliability-engineering-part-2.html</id> + <updated>2023-11-19T00:18:18+03:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <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='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 (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> +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⣷⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⣾⠿⠿⠿⠶⠾⠿⠿⣿⣿⣿⣿⣿⣿⠿⠿⠶⠶⠿⠿⠿⣷⠀⠀⠀⠀ +⠀⠀⠀⣸⢿⣆⠀⠀⠀⠀⠀⠀⠀⠙⢿⡿⠉⠀⠀⠀⠀⠀⠀⠀⣸⣿⡆⠀⠀⠀ +⠀⠀⢠⡟⠀⢻⣆⠀⠀⠀⠀⠀⠀⠀⣾⣧⠀⠀⠀⠀⠀⠀⠀⣰⡟⠀⢻⡄⠀⠀ +⠀⢀⣾⠃⠀⠀⢿⡄⠀⠀⠀⠀⠀⢠⣿⣿⡀⠀⠀⠀⠀⠀⢠⡿⠀⠀⠘⣷⡀⠀ +⠀⣼⣏⣀⣀⣀⣈⣿⡀⠀⠀⠀⠀⣸⣿⣿⡇⠀⠀⠀⠀⢀⣿⣃⣀⣀⣀⣸⣧⠀ +⠀⢻⣿⣿⣿⣿⣿⣿⠃⠀⠀⠀⠀⣿⣿⣿⣿⠀⠀⠀⠀⠈⢿⣿⣿⣿⣿⣿⡿⠀ +⠀⠀⠉⠛⠛⠛⠋⠁⠀⠀⠀⠀⢸⣿⣿⣿⣿⡆⠀⠀⠀⠀⠈⠙⠛⠛⠛⠉⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣿⣿⣿⣿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⣿⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠴⠶⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠶⠦⠀⠀ +</pre> +<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>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>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>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 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>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 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 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</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>'Mind Management' book notes</title> <link href="https://foo.zone/gemfeed/2023-11-11-mind-management-book-notes.html" /> <id>https://foo.zone/gemfeed/2023-11-11-mind-management-book-notes.html</id> @@ -18,7 +5371,7 @@ <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'>"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 /> @@ -36,17 +5389,33 @@ ''' </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'>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'>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 /> @@ -55,7 +5424,7 @@ <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'>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 /> @@ -63,7 +5432,7 @@ <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'>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 /> @@ -73,7 +5442,7 @@ <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'>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 /> @@ -87,7 +5456,7 @@ <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'>Creativity hacks</h2><br /> +<h2 style='display: inline' id='creativity-hacks'>Creativity hacks</h2><br /> <br /> <ul> <li>Coffee can cause anxiety.</li> @@ -98,7 +5467,7 @@ <li>Go to open spaces for creativity.</li> <li>Go to closed spaces for polishing.</li> </ul><br /> -<h2 style='display: inline'>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 /> @@ -111,24 +5480,26 @@ <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'>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> <li>Talk slowly and deepen your voice a bit to appear more confident. You will also become more confident.</li> <li>Also, use power positions for better confidence.</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='./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='./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 /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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> @@ -145,10 +5516,16 @@ <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'>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. '-------....._ @@ -166,19 +5543,23 @@ '._____________________________________________.' </pre> <br /> -<h2 style='display: inline'>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'>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'>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 /> @@ -221,7 +5602,7 @@ cp ./src/photoalbum.default.conf /etc/default/photoalbum This is Photoalbum Version 0.5.1 </pre> <br /> -<h2 style='display: inline'>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 /> @@ -254,42 +5635,42 @@ photoalbum makemake by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#990000">%</font> photoalbum makemake -You may now customize <font color="#990000">.</font>/photoalbumrc and run make +<pre>% photoalbum makemake +You may now customize ./photoalbumrc and run make -<font color="#990000">%</font> cat Makefile -all<font color="#990000">:</font> +% cat Makefile +all: photoalbum generate photoalbumrc -clean<font color="#990000">:</font> +clean: photoalbum clean photoalbumrc -<font color="#990000">%</font> cat photoalbumrc -<i><font color="#9A1900"># The title of the photoalbum</font></i> -<font color="#009900">TITLE</font><font color="#990000">=</font><font color="#FF0000">'A simple Photoalbum'</font> +% cat photoalbumrc +<i><font color="silver"># The title of the photoalbum</font></i> +TITLE=<font color="#808080">'A simple Photoalbum'</font> -<i><font color="#9A1900"># Thumbnail height geometry</font></i> -<font color="#009900">THUMBHEIGHT</font><font color="#990000">=</font><font color="#993399">300</font> -<i><font color="#9A1900"># Normal geometry height (when viewing photo). Uncomment, to keep original size.</font></i> -<font color="#009900">HEIGHT</font><font color="#990000">=</font><font color="#993399">1200</font> -<i><font color="#9A1900"># Max previews per page.</font></i> -<font color="#009900">MAXPREVIEWS</font><font color="#990000">=</font><font color="#993399">40</font> -<i><font color="#9A1900"># Randomly shuffle all previews.</font></i> -<i><font color="#9A1900"># SHUFFLE=yes</font></i> +<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="#9A1900"># Diverse directories, need to be full paths, not relative!</font></i> -<font color="#009900">INCOMING_DIR</font><font color="#990000">=</font><font color="#009900">$(pwd)</font>/incoming -<font color="#009900">DIST_DIR</font><font color="#990000">=</font><font color="#009900">$(pwd)</font>/dist -<font color="#009900">TEMPLATE_DIR</font><font color="#990000">=</font>/usr/share/photoalbum/templates/default -<i><font color="#9A1900">#TEMPLATE_DIR=/usr/share/photoalbum/templates/minimal</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="#9A1900"># Includes a .tar of the incoming dir in the dist, can be yes or no</font></i> -<font color="#009900">TARBALL_INCLUDE</font><font color="#990000">=</font>yes -<font color="#009900">TARBALL_SUFFIX</font><font color="#990000">=.</font>tar -<font color="#009900">TAR_OPTS</font><font color="#990000">=</font><font color="#FF0000">'-c'</font> +<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="#9A1900"># Some debugging options</font></i> -<i><font color="#9A1900">#set -e</font></i> -<i><font color="#9A1900">#set -x</font></i> +<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 /> @@ -298,43 +5679,43 @@ clean<font color="#990000">:</font> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#FF6600">--- photoalbumrc 2023-10-29 21:42:00.894202045 +0200</font> -<font color="#009900">+++ photoalbumrc.new 2023-06-04 10:40:08.030994440 +0300</font> -<font color="#0000FF">@@ -1,23 +1,24 @@</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 -<font color="#FF6600">-TITLE='A simple Photoalbum'</font> -<font color="#009900">+TITLE='Irregular.Ninja'</font> +-TITLE='A simple Photoalbum' ++TITLE='Irregular.Ninja' # Thumbnail height geometry -<font color="#FF6600">-THUMBHEIGHT=300</font> -<font color="#009900">+THUMBHEIGHT=400</font> +-THUMBHEIGHT=300 ++THUMBHEIGHT=400 # Normal geometry height (when viewing photo). Uncomment, to keep original size. -<font color="#FF6600">-HEIGHT=1200</font> -<font color="#009900">+HEIGHT=1800</font> +-HEIGHT=1200 ++HEIGHT=1800 # Max previews per page. MAXPREVIEWS=40 -<font color="#FF6600">-# Randomly shuffle all previews.</font> -<font color="#FF6600">-# SHUFFLE=yes</font> -<font color="#009900">+# Randomly shuffle</font> -<font color="#009900">+SHUFFLE=yes</font> +-# Randomly shuffle all previews. +-# SHUFFLE=yes ++# Randomly shuffle ++SHUFFLE=yes # Diverse directories, need to be full paths, not relative! -<font color="#FF6600">-INCOMING_DIR=$(pwd)/incoming</font> -<font color="#009900">+INCOMING_DIR=~/Nextcloud/Photos/irregular.ninja</font> +-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 -<font color="#FF6600">-TARBALL_INCLUDE=yes</font> -<font color="#009900">+TARBALL_INCLUDE=no</font> +-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'>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 /> @@ -397,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'>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'>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'>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 /> @@ -413,17 +5794,19 @@ blurs html index.html photos thumbs <br /> <a class='textlink' href='https://codeberg.org/snonux/photoalbum'><span class='inlinecode'>photoalbum.sh</span> source code on Codeberg.</a><br /> <br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<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='./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 /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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> @@ -441,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'>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 /> @@ -465,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> @@ -475,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'>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 /> @@ -483,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="#990000">%</font> dtail --servers serverlist<font color="#990000">.</font>txt --grep INFO --files <font color="#FF0000">"/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 /> @@ -496,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="#990000">%</font> dtail --servers serverlist<font color="#990000">.</font>txt --grep INFO <font color="#FF0000">"/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'>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 /> @@ -509,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="#990000">%</font> dtail --servers serverlist<font color="#990000">.</font>txt <font color="#990000">\</font> - --files <font color="#FF0000">'/var/log/dserver/*.log'</font> <font color="#990000">\</font> - --query <font color="#FF0000">'from STATS select sum($goroutines),sum($cgocalls),</font> -<font color="#FF0000"> 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 /> @@ -525,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="#990000">%</font> dtail --servers serverlist<font color="#990000">.</font>txt <font color="#990000">\</font> - --files <font color="#FF0000">'/var/log/dserver/*.log'</font> <font color="#990000">\</font> - <font color="#FF0000">'from STATS select sum($goroutines),sum($cgocalls),</font> -<font color="#FF0000"> 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 /> @@ -537,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="#990000">%</font> dtail --servers serverlist<font color="#990000">.</font>txt <font color="#990000">\</font> - --files <font color="#FF0000">'/var/log/dserver/*.log'</font> <font color="#990000">\</font> - --query <font color="#FF0000">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> -<font color="#FF0000"> 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 /> @@ -551,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="#990000">%</font> dtail --servers serverlist<font color="#990000">.</font>txt <font color="#990000">\</font> - --files <font color="#FF0000">'/var/log/dserver/*.log'</font> <font color="#990000">\</font> - --query <font color="#FF0000">'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'>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 /> @@ -566,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="#990000">%</font> dcat --servers serverlist<font color="#990000">.</font>txt --files /etc/hostname +<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 /> @@ -577,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="#990000">%</font> dcat --servers serverlist<font color="#990000">.</font>txt /etc/hostname +<pre>% dcat --servers serverlist.txt /etc/hostname </pre> <br /> -<h2 style='display: inline'>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 /> @@ -588,8 +5988,8 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#990000">%</font> dgrep --servers server1<font color="#990000">.</font>example<font color="#990000">.</font>org<font color="#990000">:</font><font color="#993399">2223</font> <font color="#990000">\</font> - --files /etc/passwd <font color="#990000">\</font> +<pre>% dgrep --servers server1.example.org:<font color="#000000">2223</font> \ + --files /etc/passwd \ --regex nologin </pre> <br /> @@ -599,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'>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 /> @@ -607,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="#990000">%</font> dmap --servers serverlist<font color="#990000">.</font>txt <font color="#990000">\</font> - --files <font color="#FF0000">'/var/log/dserver/*.log'</font> <font color="#990000">\</font> - --query <font color="#FF0000">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> -<font color="#FF0000"> 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'>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 /> @@ -625,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'>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 /> @@ -633,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="#990000">%</font> dmap --files /var/log/dserver/dserver<font color="#990000">.</font>log - --query <font color="#FF0000">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> -<font color="#FF0000"> 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 /> @@ -644,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="#990000">%</font> dmap <font color="#FF0000">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> -<font color="#FF0000"> lifetimeConnections group by $hostname order by max($cgocalls)'</font> <font color="#990000">\</font> - /var/log/dsever/dserver<font color="#990000">.</font>log +<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 /> @@ -655,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="#990000">%</font> cat /var/log/dserver/dserver<font color="#990000">.</font>log <font color="#990000">|</font> <font color="#990000">\</font> - dmap <font color="#FF0000">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> -<font color="#FF0000"> 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'>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 /> @@ -668,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="#990000">%</font> cat example<font color="#990000">.</font>csv -name<font color="#990000">,</font>lastname<font color="#990000">,</font>age<font color="#990000">,</font>profession -Michael<font color="#990000">,</font>Jordan<font color="#990000">,</font><font color="#993399">40</font><font color="#990000">,</font>Basketball player -Michael<font color="#990000">,</font>Jackson<font color="#990000">,</font><font color="#993399">100</font><font color="#990000">,</font>Singer -Albert<font color="#990000">,</font>Einstein<font color="#990000">,</font><font color="#993399">200</font><font color="#990000">,</font>Physician -<font color="#990000">%</font> dmap --query <font color="#FF0000">'select lastname,name where age > 40 logformat csv outfile result.csv'</font> example<font color="#990000">.</font>csv -<font color="#990000">%</font> cat result<font color="#990000">.</font>csv -lastname<font color="#990000">,</font>name -Jackson<font color="#990000">,</font>Michael -Einstein<font color="#990000">,</font>Albert +<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'>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 /> @@ -690,29 +6090,29 @@ Einstein<font color="#990000">,</font>Albert by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#990000">%</font> dtail /var/log/dserver/dserver<font color="#990000">.</font>log +<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="#990000">%</font> dtail --logLevel trace /var/log/dserver/dserver<font color="#990000">.</font>log +<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="#990000">%</font> dcat /etc/passwd +<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="#990000">%</font> dcat --plain /etc/passwd <font color="#990000">></font> /etc/test -<i><font color="#9A1900"># Should show no differences.</font></i> +<pre>% dcat --plain /etc/passwd > /etc/test +<i><font color="silver"># Should show no differences.</font></i> diff /etc/test /etc/passwd </pre> <br /> @@ -720,170 +6120,31 @@ diff /etc/test /etc/passwd by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#990000">%</font> dgrep --regex ERROR --files /var/log/dserver/dsever<font color="#990000">.</font>log +<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="#990000">%</font> dgrep --before <font color="#993399">10</font> --after <font color="#993399">10</font> --max <font color="#993399">10</font> --grep ERROR /var/log/dserver/dsever<font color="#990000">.</font>log +<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 /> <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</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 /> <span>Paul</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>Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect</title> - <link href="https://foo.zone/gemfeed/2023-08-20-site-reliability-engineering-part-3.html" /> - <id>https://foo.zone/gemfeed/2023-08-20-site-reliability-engineering-part-3.html</id> - <updated>2023-08-20T12:17:56+03:00</updated> - <author> - <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 Principal 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'>Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect</h1><br /> -<br /> -<span class='quote'>Published at 2023-08-20T12:17:56+03:00</span><br /> -<br /> -<span>This is the third part of my Site Reliability Engineering (SRE) series. I am currently employed as a Principal 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-08-19-site-reliability-engineering-part-2.html'>2023-08-19 Site Reliability Engineering - Part 2: Operational Balance in SRE</a><br /> -<a class='textlink' href='./2023-08-20-site-reliability-engineering-part-3.html'>2023-08-20 Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect (You are currently reading this)</a><br /> -<br /> -<pre> - ..--""""----.. - .-" ..--""""--.j-. - .-" .-" .--.""--.. - .-" .-" ..--"-. \/ ; - .-" .-"_.--..--"" ..--' "-. : - .' .' / `. \..--"" __ _ \ ; - :.__.-" \ / .' ( )"-. Y - ; ;: ( ) ( ). \ - .': /:: : \ \ - .'.-"\._ _.-" ; ; ( ) .-. ( ) \ - " `.""" .j" : : \ ; ; \ - bug /"""""/ ; ( ) "" :.( ) \ - /\ / : \ \`.: _ \ - : `. / ; `( ) (\/ :" \ \ - \ `. : "-.(_)_.' t-' ; - \ `. ; ..--": - `. `. : ..--"" : - `. "-. ; ..--"" ; - `. "-.:_..--"" ..--" - `. : ..--"" - "-. : ..--"" - "-.;_..--"" - -</pre> -<br /> -<h2 style='display: inline'>On-Call Culture and the Human Aspect: Prioritising Well-being in the Realm of Reliability</h2><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 /> -<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 /> -<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 /> -<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 /> -<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 /> -<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 /> -<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 /> -<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 /> -<br /> -<span>The fourth part of this blog series will be published soon :-)</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>Site Reliability Engineering - Part 2: Operational Balance in SRE</title> - <link href="https://foo.zone/gemfeed/2023-08-19-site-reliability-engineering-part-2.html" /> - <id>https://foo.zone/gemfeed/2023-08-19-site-reliability-engineering-part-2.html</id> - <updated>2023-08-19T00:18:18+03:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>This is the second part of my Site Reliability Engineering (SRE) series. I am currently employed as a Principal 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'>Site Reliability Engineering - Part 2: Operational Balance in SRE</h1><br /> -<br /> -<span class='quote'>Published at 2023-08-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 Principal 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-08-19-site-reliability-engineering-part-2.html'>2023-08-19 Site Reliability Engineering - Part 2: Operational Balance in SRE (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-08-20-site-reliability-engineering-part-3.html'>2023-08-20 Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect</a><br /> -<br /> -<pre> -⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⣷⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⠀⠀⠀⣾⠿⠿⠿⠶⠾⠿⠿⣿⣿⣿⣿⣿⣿⠿⠿⠶⠶⠿⠿⠿⣷⠀⠀⠀⠀ -⠀⠀⠀⣸⢿⣆⠀⠀⠀⠀⠀⠀⠀⠙⢿⡿⠉⠀⠀⠀⠀⠀⠀⠀⣸⣿⡆⠀⠀⠀ -⠀⠀⢠⡟⠀⢻⣆⠀⠀⠀⠀⠀⠀⠀⣾⣧⠀⠀⠀⠀⠀⠀⠀⣰⡟⠀⢻⡄⠀⠀ -⠀⢀⣾⠃⠀⠀⢿⡄⠀⠀⠀⠀⠀⢠⣿⣿⡀⠀⠀⠀⠀⠀⢠⡿⠀⠀⠘⣷⡀⠀ -⠀⣼⣏⣀⣀⣀⣈⣿⡀⠀⠀⠀⠀⣸⣿⣿⡇⠀⠀⠀⠀⢀⣿⣃⣀⣀⣀⣸⣧⠀ -⠀⢻⣿⣿⣿⣿⣿⣿⠃⠀⠀⠀⠀⣿⣿⣿⣿⠀⠀⠀⠀⠈⢿⣿⣿⣿⣿⣿⡿⠀ -⠀⠀⠉⠛⠛⠛⠋⠁⠀⠀⠀⠀⢸⣿⣿⣿⣿⡆⠀⠀⠀⠀⠈⠙⠛⠛⠛⠉⠀⠀ -⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣿⣿⣿⣿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⣿⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -⠀⠀⠀⠀⠀⠀⠴⠶⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠶⠦⠀⠀ -</pre> -<br /> -<h2 style='display: inline'>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 /> -<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 /> -<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 /> -<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 /> -<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 /> -<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 /> -<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 /> -<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 /> -<br /> -<span>Continue with the third part of this series:</span><br /> -<br /> -<a class='textlink' href='./2023-08-20-site-reliability-engineering-part-3.html'>2023-08-20 Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect</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> @@ -897,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 Principal 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'>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 Principal 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-08-19-site-reliability-engineering-part-2.html'>2023-08-19 Site Reliability Engineering - Part 2: Operational Balance in SRE</a><br /> -<a class='textlink' href='./2023-08-20-site-reliability-engineering-part-3.html'>2023-08-20 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> ▓▓▓▓░░ @@ -932,29 +6194,29 @@ DC on fire: ░░░░░░░░░░▒▒░░░░░░░░░░░░░░░░░░░░░░░░▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒░░░░░░░░░░░░░░░░░░ </pre> <br /> -<h2 style='display: inline'>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 deeply 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 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-08-19-site-reliability-engineering-part-2.html'>2023-08-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 /> @@ -974,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'>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 .-------. @@ -991,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'>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'>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'>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 /> @@ -1023,18 +6297,18 @@ DC on fire: by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#0000FF">if</font></b> <font color="#990000">[</font> -n <font color="#FF0000">"$foo"</font> <font color="#990000">];</font> <b><font color="#0000FF">then</font></b> - echo <font color="#FF0000">"$foo"</font> -<b><font color="#0000FF">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'>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'>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 /> @@ -1042,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'>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 /> @@ -1054,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="#0000FF">declare</font></b> -xr <font color="#009900">MASTODON_URI</font><font color="#990000">=</font><font color="#FF0000">'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 /> @@ -1069,22 +6343,23 @@ 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="#0000FF"><a</font></b> <font color="#009900">href</font><font color="#990000">=</font><font color="#FF0000">'https://fosstodon.org/@snonux'</font> <font color="#009900">rel</font><font color="#990000">=</font><font color="#FF0000">'me'</font><b><font color="#0000FF">></font></b>Me at Mastodon<b><font color="#0000FF"></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'>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 /> +<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</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 /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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> @@ -1102,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'>"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 /> @@ -1120,9 +6395,42 @@ http://www.gnu.org/software/src-highlite --> ''' </pre> <br /> -<h1 style='display: inline'>Improve</h1><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline'>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 /> @@ -1140,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'>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'>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 /> @@ -1152,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'>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 /> @@ -1165,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'>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 /> @@ -1180,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'>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 /> @@ -1191,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'>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 /> @@ -1201,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'>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 /> @@ -1210,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'>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 /> @@ -1219,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'>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 /> @@ -1229,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'>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 /> @@ -1241,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'>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> @@ -1252,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'>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 /> @@ -1264,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'>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 /> @@ -1280,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'>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'>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> @@ -1299,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'>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'>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 /> @@ -1313,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'>New job</h1><br /> +<h1 style='display: inline' id='new-job'>New job</h1><br /> <br /> -<h2 style='display: inline'>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> @@ -1324,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'>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 /> @@ -1336,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'>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 /> @@ -1349,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'>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> @@ -1367,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'>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'>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'>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'>Books to read</h2><br /> +<h2 style='display: inline' id='books-to-read'>Books to read</h2><br /> <br /> <ul> <li>Clean Code</li> @@ -1400,17 +6708,19 @@ http://www.gnu.org/software/src-highlite --> <li>The war of Art (to combat procrastination)</li> <li>Willpower Instinct</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='./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='./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 /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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> @@ -1427,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'>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='./2023-06-01-kiss-server-monitoring-with-gogios/gogios-small.png'><img alt='Gogios logo' title='Gogios logo' src='./2023-06-01-kiss-server-monitoring-with-gogios/gogios-small.png' /></a><br /> -<br /> -<h2 style='display: inline'>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> _____________________________ ____________________________ / \ / \ @@ -1464,7 +6790,7 @@ The original can be found at https://asciiart.website/index.php?art=objects/computers </pre> <br /> -<h2 style='display: inline'>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 /> @@ -1472,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'>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> @@ -1483,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'>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 /> @@ -1505,9 +6831,9 @@ CRITICAL: Check ICMP6 vulcan.buetow.org: Check command timed out Have a nice day! </pre> <br /> -<h2 style='display: inline'>Installation</h2><br /> +<h2 style='display: inline' id='installation'>Installation</h2><br /> <br /> -<h3 style='display: inline'>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 /> @@ -1517,11 +6843,11 @@ Have a nice day! by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre>git clone https<font color="#990000">:</font>//codeberg<font color="#990000">.</font>org/snonux/gogios<font color="#990000">.</font>git +<pre>git clone https://codeberg.org/snonux/gogios.git cd gogios -go build -o gogios cmd/gogios/main<font color="#990000">.</font>go +go build -o gogios cmd/gogios/main.go doas cp gogios /usr/local/bin/gogios -doas chmod <font color="#993399">755</font> /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 /> @@ -1530,16 +6856,16 @@ doas chmod <font color="#993399">755</font> /usr/local/bin/gogios by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#0000FF">export</font></b> <font color="#009900">GOOS</font><font color="#990000">=</font>openbsd -<b><font color="#0000FF">export</font></b> <font color="#009900">GOARCH</font><font color="#990000">=</font>amd64 -go build -o gogios cmd/gogios/main<font color="#990000">.</font>go +<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'>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 /> @@ -1550,13 +6876,13 @@ http://www.gnu.org/software/src-highlite --> <pre>doas adduser -group _gogios -batch _gogios doas usermod -d /var/run/gogios _gogios doas mkdir -p /var/run/gogios -doas chown _gogios<font color="#990000">:</font>_gogios /var/run/gogios -doas chmod <font color="#993399">750</font> /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'>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 /> @@ -1565,14 +6891,14 @@ by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> <pre>doas pkg_add monitoring-plugins -doas pkg_add nrpe <i><font color="#9A1900"># If you want to execute checks remotely via NRPE.</font></i> +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'>Configuration</h2><br /> +<h2 style='display: inline' id='configuration'>Configuration</h2><br /> <br /> -<h3 style='display: inline'>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 /> @@ -1584,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'>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 /> @@ -1592,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="#990000">{</font> - "EmailTo": "<font color="#FF0000">paul@dev.buetow.org</font>"<font color="#990000">,</font> - "EmailFrom": "<font color="#FF0000">gogios@buetow.org</font>"<font color="#990000">,</font> - "CheckTimeoutS": <font color="#993399">10</font><font color="#990000">,</font> - "CheckConcurrency": <font color="#993399">2</font><font color="#990000">,</font> - "StateDir": "<font color="#FF0000">/var/run/gogios</font>"<font color="#990000">,</font> - "Checks": <font color="#990000">{</font> - "Check ICMP4 www.foo.zone": <font color="#990000">{</font> - "Plugin": "<font color="#FF0000">/usr/local/libexec/nagios/check_ping</font>"<font color="#990000">,</font> - "Args": <font color="#990000">[</font> "-H"<font color="#990000">,</font> "www.foo.zone"<font color="#990000">,</font> "-4"<font color="#990000">,</font> "-w"<font color="#990000">,</font> "50,10%"<font color="#990000">,</font> "-c"<font color="#990000">,</font> "100,15%" <font color="#990000">],</font> - "Retries": <font color="#993399">3</font><font color="#990000">,</font> - "RetryInterval": <font color="#993399">10</font> - <font color="#990000">},</font> - "Check ICMP6 www.foo.zone": <font color="#990000">{</font> - "Plugin": "<font color="#FF0000">/usr/local/libexec/nagios/check_ping</font>"<font color="#990000">,</font> - "Args": <font color="#990000">[</font> "-H"<font color="#990000">,</font> "www.foo.zone"<font color="#990000">,</font> "-6"<font color="#990000">,</font> "-w"<font color="#990000">,</font> "50,10%"<font color="#990000">,</font> "-c"<font color="#990000">,</font> "100,15%" <font color="#990000">],</font> - "Retries": <font color="#993399">3</font><font color="#990000">,</font> - "RetryInterval": <font color="#993399">10</font> - <font color="#990000">},</font> - "www.foo.zone HTTP IPv4": <font color="#990000">{</font> - "Plugin": "<font color="#FF0000">/usr/local/libexec/nagios/check_http</font>"<font color="#990000">,</font> - "Args": <font color="#990000">[</font>"www.foo.zone"<font color="#990000">,</font> "-4"<font color="#990000">],</font> - "DependsOn": <font color="#990000">[</font>"Check ICMP4 www.foo.zone"<font color="#990000">]</font> - <font color="#990000">},</font> - "www.foo.zone HTTP IPv6": <font color="#990000">{</font> - "Plugin": "<font color="#FF0000">/usr/local/libexec/nagios/check_http</font>"<font color="#990000">,</font> - "Args": <font color="#990000">[</font>"www.foo.zone"<font color="#990000">,</font> "-6"<font color="#990000">],</font> - "DependsOn": <font color="#990000">[</font>"Check ICMP6 www.foo.zone"<font color="#990000">]</font> - <font color="#990000">}</font> - "Check NRPE Disk Usage foo.zone": <font color="#990000">{</font> - "Plugin": "<font color="#FF0000">/usr/local/libexec/nagios/check_nrpe</font>"<font color="#990000">,</font> - "Args": <font color="#990000">[</font>"-H"<font color="#990000">,</font> "foo.zone"<font color="#990000">,</font> "-c"<font color="#990000">,</font> "check_disk"<font color="#990000">,</font> "-p"<font color="#990000">,</font> "5666"<font color="#990000">,</font> "-4"<font color="#990000">]</font> - <font color="#990000">}</font> - <font color="#990000">}</font> -<font color="#990000">}</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> @@ -1647,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'>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 /> @@ -1655,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>doas -u _gogios /usr/local/bin/gogios -cfg /etc/gogios<font color="#990000">.</font>json +<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 /> @@ -1669,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'>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 /> @@ -1682,17 +7008,18 @@ 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'>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 /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<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='./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 /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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> @@ -1710,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'>"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> ,.......... .........., ,..,' '.' ',.., @@ -1729,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'>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 /> @@ -1739,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'>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'>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'>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'>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'>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'>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'>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'>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 /> @@ -1778,33 +7120,35 @@ 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'>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'>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'>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 /> +<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='./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='./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 /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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> @@ -1821,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'>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 /> @@ -1842,7 +7186,16 @@ http://www.gnu.org/software/src-highlite --> +-----+-----------------+-----------------------------+ </pre> <br /> -<h1 style='display: inline'>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 /> @@ -1865,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'>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 /> @@ -1878,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>$ raku guprecords<font color="#990000">.</font>raku --stats<font color="#990000">=</font><font color="#009900">dir</font><font color="#990000">=</font><font color="#009900">$HOME</font>/git/uprecords/stats --all +<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 /> @@ -1891,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'>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 /> @@ -1962,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'>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 /> @@ -1977,288 +7330,15 @@ no1 in 455 days, 18:52:44 | at Sun Jul 21 07:37:51 2024 <li>A social media sharing scheduler a la <span class='inlinecode'>buffer.com</span>. I am using Buffer at the moment to share posts on Mastadon, Twitter, Telegram and LinkedIn, but it is proprietary and also it's not really reliable.</li> <li>Rewrite the static photo album generator of <span class='inlinecode'>irregular.ninja</span> in Raku (from Bash).</li> </ul><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 /> <span>E-Mail your comments to hi@foo.zone :-)</span><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="https://foo.zone/gemfeed/2023-04-09-algorithms-and-data-structures-in-golang-part-1.html" /> - <id>https://foo.zone/gemfeed/2023-04-09-algorithms-and-data-structures-in-golang-part-1.html</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'>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'>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="#0000FF">package</font></b> ds - -<b><font color="#0000FF">import</font></b> <font color="#990000">(</font> - <font color="#FF0000">"golang.org/x/exp/constraints"</font> -<font color="#990000">)</font> - -<b><font color="#0000FF">type</font></b> Integer <b><font color="#0000FF">interface</font></b> <font color="#FF0000">{</font> - constraints<font color="#990000">.</font>Integer -<font color="#FF0000">}</font> - -<b><font color="#0000FF">type</font></b> Number <b><font color="#0000FF">interface</font></b> <font color="#FF0000">{</font> - constraints<font color="#990000">.</font>Integer <font color="#990000">|</font> constraints<font color="#990000">.</font>Float -<font color="#FF0000">}</font> - -</pre> -<br /> -<h2 style='display: inline'>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="#0000FF">package</font></b> ds - -<b><font color="#0000FF">import</font></b> <font color="#990000">(</font> - <font color="#FF0000">"fmt"</font> - <font color="#FF0000">"math/rand"</font> - <font color="#FF0000">"strings"</font> -<font color="#990000">)</font> - -<b><font color="#0000FF">type</font></b> ArrayList<font color="#990000">[</font>V Number<font color="#990000">]</font> <font color="#990000">[]</font>V - -<b><font color="#0000FF">func</font></b> NewArrayList<font color="#990000">[</font>V Number<font color="#990000">](</font>l int<font color="#990000">)</font> ArrayList<font color="#990000">[</font>V<font color="#990000">]</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">return</font></b> <b><font color="#000000">make</font></b><font color="#990000">(</font>ArrayList<font color="#990000">[</font>V<font color="#990000">],</font> l<font color="#990000">)</font> -<font color="#FF0000">}</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="#0000FF">func</font></b> NewRandomArrayList<font color="#990000">[</font>V Number<font color="#990000">](</font>l<font color="#990000">,</font> max int<font color="#990000">)</font> ArrayList<font color="#990000">[</font>V<font color="#990000">]</font> <font color="#FF0000">{</font> - a <font color="#990000">:=</font> <b><font color="#000000">make</font></b><font color="#990000">(</font>ArrayList<font color="#990000">[</font>V<font color="#990000">],</font> l<font color="#990000">)</font> - <b><font color="#0000FF">for</font></b> i <font color="#990000">:=</font> <font color="#993399">0</font><font color="#990000">;</font> i <font color="#990000"><</font> l<font color="#990000">;</font> i<font color="#990000">++</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">if</font></b> max <font color="#990000">></font> <font color="#993399">0</font> <font color="#FF0000">{</font> - a<font color="#990000">[</font>i<font color="#990000">]</font> <font color="#990000">=</font> <b><font color="#000000">V</font></b><font color="#990000">(</font>rand<font color="#990000">.</font><b><font color="#000000">Intn</font></b><font color="#990000">(</font>max<font color="#990000">))</font> - <b><font color="#0000FF">continue</font></b> - <font color="#FF0000">}</font> - a<font color="#990000">[</font>i<font color="#990000">]</font> <font color="#990000">=</font> <b><font color="#000000">V</font></b><font color="#990000">(</font>rand<font color="#990000">.</font><b><font color="#000000">Int</font></b><font color="#990000">())</font> - <font color="#FF0000">}</font> - <b><font color="#0000FF">return</font></b> a -<font color="#FF0000">}</font> - -<b><font color="#0000FF">func</font></b> NewAscendingArrayList<font color="#990000">[</font>V Number<font color="#990000">](</font>l int<font color="#990000">)</font> ArrayList<font color="#990000">[</font>V<font color="#990000">]</font> <font color="#FF0000">{</font> - a <font color="#990000">:=</font> <b><font color="#000000">make</font></b><font color="#990000">(</font>ArrayList<font color="#990000">[</font>V<font color="#990000">],</font> l<font color="#990000">)</font> - <b><font color="#0000FF">for</font></b> i <font color="#990000">:=</font> <font color="#993399">0</font><font color="#990000">;</font> i <font color="#990000"><</font> l<font color="#990000">;</font> i<font color="#990000">++</font> <font color="#FF0000">{</font> - a<font color="#990000">[</font>i<font color="#990000">]</font> <font color="#990000">=</font> <b><font color="#000000">V</font></b><font color="#990000">(</font>i<font color="#990000">)</font> - <font color="#FF0000">}</font> - <b><font color="#0000FF">return</font></b> a -<font color="#FF0000">}</font> - -<b><font color="#0000FF">func</font></b> NewDescendingArrayList<font color="#990000">[</font>V Number<font color="#990000">](</font>l int<font color="#990000">)</font> ArrayList<font color="#990000">[</font>V<font color="#990000">]</font> <font color="#FF0000">{</font> - a <font color="#990000">:=</font> <b><font color="#000000">make</font></b><font color="#990000">(</font>ArrayList<font color="#990000">[</font>V<font color="#990000">],</font> l<font color="#990000">)</font> - j <font color="#990000">:=</font> l <font color="#990000">-</font> <font color="#993399">1</font> - <b><font color="#0000FF">for</font></b> i <font color="#990000">:=</font> <font color="#993399">0</font><font color="#990000">;</font> i <font color="#990000"><</font> l<font color="#990000">;</font> i<font color="#990000">++</font> <font color="#FF0000">{</font> - a<font color="#990000">[</font>i<font color="#990000">]</font> <font color="#990000">=</font> <b><font color="#000000">V</font></b><font color="#990000">(</font>j<font color="#990000">)</font> - j<font color="#990000">--</font> - <font color="#FF0000">}</font> - <b><font color="#0000FF">return</font></b> a -<font color="#FF0000">}</font> -</pre> -<br /> -<h2 style='display: inline'>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="#0000FF">func</font></b> <font color="#990000">(</font>a ArrayList<font color="#990000">[</font>V<font color="#990000">])</font> <b><font color="#000000">FirstN</font></b><font color="#990000">(</font>n int<font color="#990000">)</font> <font color="#009900">string</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">var</font></b> sb strings<font color="#990000">.</font>Builder - j <font color="#990000">:=</font> n - - l <font color="#990000">:=</font> <b><font color="#000000">len</font></b><font color="#990000">(</font>a<font color="#990000">)</font> - <b><font color="#0000FF">if</font></b> j <font color="#990000">></font> l <font color="#FF0000">{</font> - j <font color="#990000">=</font> l - <font color="#FF0000">}</font> - - <b><font color="#0000FF">for</font></b> i <font color="#990000">:=</font> <font color="#993399">0</font><font color="#990000">;</font> i <font color="#990000"><</font> j<font color="#990000">;</font> i<font color="#990000">++</font> <font color="#FF0000">{</font> - fmt<font color="#990000">.</font><b><font color="#000000">Fprintf</font></b><font color="#990000">(&</font>sb<font color="#990000">,</font> <font color="#FF0000">"%v "</font><font color="#990000">,</font> a<font color="#990000">[</font>i<font color="#990000">])</font> - <font color="#FF0000">}</font> - - <b><font color="#0000FF">if</font></b> j <font color="#990000"><</font> l <font color="#FF0000">{</font> - fmt<font color="#990000">.</font><b><font color="#000000">Fprintf</font></b><font color="#990000">(&</font>sb<font color="#990000">,</font> <font color="#FF0000">"... "</font><font color="#990000">)</font> - <font color="#FF0000">}</font> - - <b><font color="#0000FF">return</font></b> sb<font color="#990000">.</font><b><font color="#000000">String</font></b><font color="#990000">()</font> -<font color="#FF0000">}</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="#0000FF">func</font></b> <font color="#990000">(</font>a ArrayList<font color="#990000">[</font>V<font color="#990000">])</font> <b><font color="#000000">Sorted</font></b><font color="#990000">()</font> <font color="#009900">bool</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">for</font></b> i <font color="#990000">:=</font> <b><font color="#000000">len</font></b><font color="#990000">(</font>a<font color="#990000">)</font> <font color="#990000">-</font> <font color="#993399">1</font><font color="#990000">;</font> i <font color="#990000">></font> <font color="#993399">0</font><font color="#990000">;</font> i<font color="#990000">--</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">if</font></b> a<font color="#990000">[</font>i<font color="#990000">]</font> <font color="#990000"><</font> a<font color="#990000">[</font>i<font color="#990000">-</font><font color="#993399">1</font><font color="#990000">]</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">return</font></b> false - <font color="#FF0000">}</font> - <font color="#FF0000">}</font> - <b><font color="#0000FF">return</font></b> true -<font color="#FF0000">}</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="#0000FF">func</font></b> <font color="#990000">(</font>a ArrayList<font color="#990000">[</font>V<font color="#990000">])</font> <b><font color="#000000">Swap</font></b><font color="#990000">(</font>i<font color="#990000">,</font> j int<font color="#990000">)</font> <font color="#FF0000">{</font> - aux <font color="#990000">:=</font> a<font color="#990000">[</font>i<font color="#990000">]</font> - a<font color="#990000">[</font>i<font color="#990000">]</font> <font color="#990000">=</font> a<font color="#990000">[</font>j<font color="#990000">]</font> - a<font color="#990000">[</font>j<font color="#990000">]</font> <font color="#990000">=</font> aux -<font color="#FF0000">}</font> - -</pre> -<br /> -<h2 style='display: inline'>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="#0000FF">package</font></b> sort - -<b><font color="#0000FF">import</font></b> <font color="#990000">(</font> - <font color="#FF0000">"codeberg.org/snonux/algorithms/ds"</font> - <font color="#FF0000">"sync"</font> - <font color="#FF0000">"time"</font> -<font color="#990000">)</font> - -<b><font color="#0000FF">func</font></b> Sleep<font color="#990000">[</font>V ds<font color="#990000">.</font>Integer<font color="#990000">](</font>a ds<font color="#990000">.</font>ArrayList<font color="#990000">[</font>V<font color="#990000">])</font> ds<font color="#990000">.</font>ArrayList<font color="#990000">[</font>V<font color="#990000">]</font> <font color="#FF0000">{</font> - sorted <font color="#990000">:=</font> ds<font color="#990000">.</font>NewArrayList<font color="#990000">[</font>V<font color="#990000">](</font><b><font color="#000000">len</font></b><font color="#990000">(</font>a<font color="#990000">))</font> - - numCh <font color="#990000">:=</font> <b><font color="#000000">make</font></b><font color="#990000">(</font><b><font color="#0000FF">chan</font></b> V<font color="#990000">)</font> - <b><font color="#0000FF">var</font></b> wg sync<font color="#990000">.</font>WaitGroup - wg<font color="#990000">.</font><b><font color="#000000">Add</font></b><font color="#990000">(</font><b><font color="#000000">len</font></b><font color="#990000">(</font>a<font color="#990000">))</font> - - <b><font color="#0000FF">go</font></b> <b><font color="#0000FF">func</font></b><font color="#990000">()</font> <font color="#FF0000">{</font> - wg<font color="#990000">.</font><b><font color="#000000">Wait</font></b><font color="#990000">()</font> - <b><font color="#000000">close</font></b><font color="#990000">(</font>numCh<font color="#990000">)</font> - <font color="#FF0000">}</font><font color="#990000">()</font> - - <b><font color="#0000FF">for</font></b> _<font color="#990000">,</font> num <font color="#990000">:=</font> <b><font color="#0000FF">range</font></b> a <font color="#FF0000">{</font> - <b><font color="#0000FF">go</font></b> <b><font color="#0000FF">func</font></b><font color="#990000">(</font>num V<font color="#990000">)</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">defer</font></b> wg<font color="#990000">.</font><b><font color="#000000">Done</font></b><font color="#990000">()</font> - time<font color="#990000">.</font><b><font color="#000000">Sleep</font></b><font color="#990000">(</font>time<font color="#990000">.</font><b><font color="#000000">Duration</font></b><font color="#990000">(</font>num<font color="#990000">)</font> <font color="#990000">*</font> time<font color="#990000">.</font>Second<font color="#990000">)</font> - numCh <font color="#990000"><-</font> num - <font color="#FF0000">}</font><font color="#990000">(</font>num<font color="#990000">)</font> - <font color="#FF0000">}</font> - - <b><font color="#0000FF">for</font></b> num <font color="#990000">:=</font> <b><font color="#0000FF">range</font></b> numCh <font color="#FF0000">{</font> - sorted <font color="#990000">=</font> <b><font color="#000000">append</font></b><font color="#990000">(</font>sorted<font color="#990000">,</font> num<font color="#990000">)</font> - <font color="#FF0000">}</font> - - <b><font color="#0000FF">return</font></b> sorted -<font color="#FF0000">}</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'>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="#0000FF">package</font></b> sort - -<b><font color="#0000FF">import</font></b> <font color="#990000">(</font> - <font color="#FF0000">"fmt"</font> - <font color="#FF0000">"testing"</font> - - <font color="#FF0000">"codeberg.org/snonux/algorithms/ds"</font> -<font color="#990000">)</font> - -<b><font color="#0000FF">func</font></b> <b><font color="#000000">TestSleepSort</font></b><font color="#990000">(</font>t <font color="#990000">*</font>testing<font color="#990000">.</font>T<font color="#990000">)</font> <font color="#FF0000">{</font> - a <font color="#990000">:=</font> ds<font color="#990000">.</font>NewRandomArrayList<font color="#990000">[</font>int<font color="#990000">](</font><font color="#993399">10</font><font color="#990000">,</font> <font color="#993399">10</font><font color="#990000">)</font> - a <font color="#990000">=</font> <b><font color="#000000">Sleep</font></b><font color="#990000">(</font>a<font color="#990000">)</font> - <b><font color="#0000FF">if</font></b> <font color="#990000">!</font>a<font color="#990000">.</font><b><font color="#000000">Sorted</font></b><font color="#990000">()</font> <font color="#FF0000">{</font> - t<font color="#990000">.</font><b><font color="#000000">Errorf</font></b><font color="#990000">(</font><font color="#FF0000">"Array not sorted: %v"</font><font color="#990000">,</font> a<font color="#990000">)</font> - <font color="#FF0000">}</font> -<font color="#FF0000">}</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>❯ go <b><font color="#0000FF">test</font></b> <font color="#990000">.</font>/sort -v -run SleepSort -<font color="#990000">===</font> RUN TestSleepSort ---- PASS<font color="#990000">:</font> TestSleepSort <font color="#990000">(</font><font color="#993399">9</font><font color="#990000">.</font>00s<font color="#990000">)</font> -PASS -ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <font color="#993399">9</font><font color="#990000">.</font>002s -</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 /> +<span>Other related posts are:</span><br /> <br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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 /> +<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> @@ -2276,7 +7356,7 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo <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'>"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 /> @@ -2294,7 +7374,23 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo ''' </pre> <br /> -<h2 style='display: inline'>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 /> @@ -2305,7 +7401,7 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo </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'>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 /> @@ -2317,7 +7413,7 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo </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'>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> @@ -2326,7 +7422,7 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo <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'>"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 /> @@ -2339,11 +7435,11 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo </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'>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'>On Deadlines</h2><br /> +<h2 style='display: inline' id='on-deadlines'>On Deadlines</h2><br /> <br /> <ul> <li>All deadlines are imaginary.</li> @@ -2351,7 +7447,7 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo <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'>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> @@ -2361,7 +7457,7 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo </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'>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 /> @@ -2369,7 +7465,7 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo <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'>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 /> @@ -2385,11 +7481,11 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo </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'>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'>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 /> @@ -2406,15 +7502,18 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo </ul><br /> <span>Slow.... it.... down....</span><br /> <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='./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='./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 /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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> @@ -2432,10 +7531,18 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo <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'>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 @@ -2449,15 +7556,18 @@ ok codeberg<font color="#990000">.</font>org/snonux/algorithms/sort <fo 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'>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 /> @@ -2505,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> @@ -2523,7 +7633,7 @@ See more entries about DTail and Golang: Blablabla... </pre> <br /> -<h2 style='display: inline'>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 /> @@ -2533,15 +7643,15 @@ Blablabla... by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#0000FF">declare</font></b> -xr <font color="#009900">PRE_GENERATE_HOOK</font><font color="#990000">=.</font>/pre_generate_hook<font color="#990000">.</font>sh -<b><font color="#0000FF">declare</font></b> -xr <font color="#009900">POST_PUBLISH_HOOK</font><font color="#990000">=.</font>/post_publish_hook<font color="#990000">.</font>sh +<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'>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'>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 /> @@ -2551,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="#990000">%</font> cat gemfeed<font color="#990000">/</font><font color="#993399">2023</font>-<font color="#993399">02</font>-<font color="#993399">26</font>-title-here<font color="#990000">.</font>gmi -<i><font color="#9A1900"># 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> -The remaining content of the Gemtext file<font color="#990000">...</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 /> @@ -2563,31 +7673,32 @@ The remaining content of the Gemtext file<font color="#990000">...</font> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#990000">%</font> cat gemfeed<font color="#990000">/</font><font color="#993399">2023</font>-<font color="#993399">02</font>-<font color="#993399">26</font>-title-here<font color="#990000">.</font>gmi -<i><font color="#9A1900"># 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="#990000">></font> Published at <font color="#993399">2023</font>-<font color="#993399">02</font>-26T21<font color="#990000">:</font><font color="#993399">43</font><font color="#990000">:</font><font color="#993399">51</font><font color="#990000">+</font><font color="#993399">01</font><font color="#990000">:</font><font color="#993399">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> -The remaining content of the Gemtext file<font color="#990000">...</font> +The remaining content of the Gemtext file... </pre> <br /> -<h2 style='display: inline'>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'>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 /> +<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</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 /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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> @@ -2605,7 +7716,7 @@ The remaining content of the Gemtext file<font color="#990000">...</font> <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'>"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 /> @@ -2656,7 +7767,7 @@ The remaining content of the Gemtext file<font color="#990000">...</font> <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'>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 /> @@ -2667,7 +7778,7 @@ The remaining content of the Gemtext file<font color="#990000">...</font> </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'>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 /> @@ -2680,7 +7791,7 @@ The remaining content of the Gemtext file<font color="#990000">...</font> </ul><br /> <span>It's your life. Share it, celebrate it, be proud and have fun.</span><br /> <br /> -<h2 style='display: inline'>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 /> @@ -2688,17 +7799,19 @@ The remaining content of the Gemtext file<font color="#990000">...</font> <br /> <span>By working together, everyone contributes what they can, achieving a greater good together.</span><br /> <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='./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='./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 /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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> @@ -2715,10 +7828,12 @@ The remaining content of the Gemtext file<font color="#990000">...</font> <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'>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." |---|--\-----------------------|-----------------------------------------| @@ -2734,15 +7849,25 @@ The remaining content of the Gemtext file<font color="#990000">...</font> -@- [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'>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'>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 /> @@ -2756,7 +7881,7 @@ The remaining content of the Gemtext file<font color="#990000">...</font> <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'>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 /> @@ -2769,23 +7894,23 @@ The remaining content of the Gemtext file<font color="#990000">...</font> </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'>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'>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'>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'>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 /> @@ -2806,13 +7931,26 @@ The remaining content of the Gemtext file<font color="#990000">...</font> <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'>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 _.===========================._ @@ -2836,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'>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 /> @@ -2859,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'>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 /> @@ -2867,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'>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 /> @@ -2885,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'>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 /> @@ -2905,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'>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 /> @@ -2913,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'>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 /> @@ -2925,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'>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 /> @@ -2940,7 +8078,7 @@ Art by Joan Stark <br /> <a class='textlink' href='https://sailfishos.org'>SailfishOS</a><br /> <br /> -<h2 style='display: inline'>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 /> @@ -2966,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'>(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='./2022-12-24-ultrarelearning-java-my-takeaways/learnjava.jpg'><img src='./2022-12-24-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 /> @@ -2984,46 +8120,64 @@ 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'>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'>(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'>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 /> -<a href='./2022-12-24-ultrarelearning-java-my-takeaways/effective-java.jpg'><img src='./2022-12-24-ultrarelearning-java-my-takeaways/effective-java.jpg' /></a><br /> +<a href='./ultrarelearning-java-my-takeaways/effective-java.jpg'><img src='./ultrarelearning-java-my-takeaways/effective-java.jpg' /></a><br /> <br /> <span>I recommend reading the 90-part effective Java Series on <span class='inlinecode'>dev.to</span>. 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.</span><br /> <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'>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'>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'>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'>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'>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'>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 /> @@ -3044,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'>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 /> @@ -3058,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'>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 /> @@ -3087,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'>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 @@ -3107,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 /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><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 /> -<h2 style='display: inline'>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'>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 /> @@ -3134,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'>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'>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 /> @@ -3161,15 +8327,15 @@ Art by \ \_! / __! by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#9A1900">" Clipboard</font></i> -vnoremap ,<b><font color="#0000FF">y</font></b> !pbcopy<font color="#FF6600"><CR></font>ugv -vnoremap ,<b><font color="#0000FF">i</font></b> !pbpaste<font color="#FF6600"><CR></font> -nmap ,<b><font color="#0000FF">i</font></b> !wpbpaste<font color="#FF6600"><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'>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 /> @@ -3189,13 +8355,13 @@ nmap ,<b><font color="#0000FF">i</font></b> !wpbpaste<font color="#FF6600"><C <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'>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'>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 /> @@ -3223,10 +8389,22 @@ nmap ,<b><font color="#0000FF">i</font></b> !wpbpaste<font color="#FF6600"><C <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'>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*\"*, @@ -3264,19 +8442,22 @@ nmap ,<b><font color="#0000FF">i</font></b> !wpbpaste<font color="#FF6600"><C ' ' </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 /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><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 /> -<h2 style='display: inline'>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 /> @@ -3311,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'>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 /> @@ -3353,7 +8534,7 @@ END $ doas chmod 755 /etc/rc.d/dserver </pre> <br /> -<h3 style='display: inline'>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 /> @@ -3380,7 +8561,7 @@ task 'dtail', group => 'frontends', }; </pre> <br /> -<h2 style='display: inline'>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 /> @@ -3403,7 +8584,7 @@ $ curl https://raw.githubusercontent.com/mimecast/dtail/master/examples/dtail.js } </pre> <br /> -<h3 style='display: inline'>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 /> @@ -3419,7 +8600,7 @@ file '/etc/dserver/dtail.json', on_change => sub { $restart = TRUE }; </pre> <br /> -<h2 style='display: inline'>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 /> @@ -3472,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'>Rexification</h3><br /> +<h3 style='display: inline' id='rexification'>Rexification</h3><br /> <br /> <span>That's done by adding ...</span><br /> <br /> @@ -3488,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'>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 /> @@ -3528,7 +8709,7 @@ Caching /home/rex/.ssh/authorized_keys -> /var/cache/dserver/rex.authorized_k All set... </pre> <br /> -<h2 style='display: inline'>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 /> @@ -3554,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'>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 /> @@ -3564,14 +8745,14 @@ REMOTE|fishfinger|100|7|fstab|093f510ec5c0f512.h /usr/local ffs rw,wxallowed,nod <a class='textlink' href='https://github.com/mimecast/dtail'>https://github.com/mimecast/dtail</a><br /> <a class='textlink' href='https://www.rexify.org'>https://www.rexify.org</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='./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 /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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> @@ -3589,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'>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 @@ -3607,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'>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'>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'>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 /> @@ -3631,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'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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 /> @@ -3691,4936 +8892,4 @@ jgs (________\ \ </div> </content> </entry> - <entry> - <title>Gemtexter 1.1.0 - Let's Gemtext again</title> - <link href="https://foo.zone/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html" /> - <id>https://foo.zone/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html</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'>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'>What's new?</h2><br /> -<br /> -<h3 style='display: inline'>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><b><font color="#000000">check_dependencies ()</font></b> { - <i><font color="#9A1900"># At least, Bash 5 is required</font></i> - <b><font color="#0000FF">local</font></b> -i <font color="#009900">required_version</font><font color="#990000">=</font><font color="#993399">5</font> - <font color="#009900">IFS</font><font color="#990000">=.</font> <b><font color="#0000FF">read</font></b> -ra version <font color="#990000"><<<</font> <font color="#FF0000">"$BASH_VERSION"</font> - <b><font color="#0000FF">if</font></b> <font color="#990000">[</font> <font color="#FF0000">"${version[0]}"</font> -lt <font color="#009900">$required_version</font> <font color="#990000">];</font> <b><font color="#0000FF">then</font></b> - log ERROR <font color="#FF0000">"ERROR, </font><font color="#CC33CC">\"</font><font color="#FF0000">bash</font><font color="#CC33CC">\"</font><font color="#FF0000"> must be at least at major version $required_version!"</font> - <b><font color="#0000FF">exit</font></b> <font color="#993399">2</font> - <b><font color="#0000FF">fi</font></b> - - <i><font color="#9A1900"># These must be the GNU versions of the commands</font></i> - <b><font color="#0000FF">for</font></b> tool <b><font color="#0000FF">in</font></b> <font color="#009900">$DATE</font> <font color="#009900">$SED</font> <font color="#009900">$GREP</font><font color="#990000">;</font> <b><font color="#0000FF">do</font></b> - <b><font color="#0000FF">if</font></b> <font color="#990000">!</font> <font color="#009900">$tool</font> --version <font color="#990000">|</font> grep -q GNU<font color="#990000">;</font> <b><font color="#0000FF">then</font></b> - log ERROR <font color="#FF0000">"ERROR, </font><font color="#CC33CC">\"</font><font color="#FF0000">$tool</font><font color="#CC33CC">\"</font><font color="#FF0000"> command is not the GNU version, please install!"</font> - <b><font color="#0000FF">exit</font></b> <font color="#993399">2</font> - <b><font color="#0000FF">fi</font></b> - <b><font color="#0000FF">done</font></b> -} -</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'>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'>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'>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="#990000">.</font>/gemtexter --generate <font color="#FF0000">'.*hello.*'</font> -</pre> -<br /> -<h3 style='display: inline'>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'>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'>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'>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>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 /> -<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>Let's Encrypt with OpenBSD and Rex</title> - <link href="https://foo.zone/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.html" /> - <id>https://foo.zone/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.html</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'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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 /> -<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="https://foo.zone/gemfeed/2022-06-15-sweating-the-small-stuff.html" /> - <id>https://foo.zone/gemfeed/2022-06-15-sweating-the-small-stuff.html</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'>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'><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'>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'>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='./2022-06-15-sweating-the-small-stuff/ninja.jpg'><img src='./2022-06-15-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'>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'>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'>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'>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'>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'>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'>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'>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'>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='./2022-06-15-sweating-the-small-stuff/jsmstrade.png'><img src='./2022-06-15-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'>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'>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'>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'>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'>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'>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'>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'>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'>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='https://konpeito.media'>https://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="https://foo.zone/gemfeed/2022-05-27-perl-is-still-a-great-choice.html" /> - <id>https://foo.zone/gemfeed/2022-05-27-perl-is-still-a-great-choice.html</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'>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='./2022-05-27-perl-is-still-a-great-choice/regular_expressions.png'><img alt='Comic source: XKCD' title='Comic source: XKCD' src='./2022-05-27-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='./2022-05-27-perl-is-still-a-great-choice/googletrendsperl.jpg'><img src='./2022-05-27-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'>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'>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'>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'>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'>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>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 /> -<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>Creative universe</title> - <link href="https://foo.zone/gemfeed/2022-04-10-creative-universe.html" /> - <id>https://foo.zone/gemfeed/2022-04-10-creative-universe.html</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'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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="https://foo.zone/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.html" /> - <id>https://foo.zone/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.html</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'>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'>So, what's new in 4.0.0?</h2><br /> -<br /> -<h3 style='display: inline'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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>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 /> -<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>Computer operating systems I use(d)</title> - <link href="https://foo.zone/gemfeed/2022-02-04-computer-operating-systems-i-use.html" /> - <id>https://foo.zone/gemfeed/2022-02-04-computer-operating-systems-i-use.html</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'>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'>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'>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'>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'>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'>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 https://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'>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'>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'>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'>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'>Other OSes</h2><br /> -<br /> -<h3 style='display: inline'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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="https://foo.zone/gemfeed/2022-01-23-welcome-to-the-foo.zone.html" /> - <id>https://foo.zone/gemfeed/2022-01-23-welcome-to-the-foo.zone.html</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'>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'>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'>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'>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="https://foo.zone/gemfeed/2022-01-01-bash-golf-part-2.html" /> - <id>https://foo.zone/gemfeed/2022-01-01-bash-golf-part-2.html</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'>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 /> -<br /> -<h2 style='display: inline'>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>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'>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'>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'>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'>-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'>-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'>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>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 /> -<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>How to stay sane as a DevOps person </title> - <link href="https://foo.zone/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.html" /> - <id>https://foo.zone/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.html</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'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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'>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> - <entry> - <title>Bash Golf Part 1</title> - <link href="https://foo.zone/gemfeed/2021-11-29-bash-golf-part-1.html" /> - <id>https://foo.zone/gemfeed/2021-11-29-bash-golf-part-1.html</id> - <updated>2021-11-29T14:06:14+00: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 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.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline'>Bash Golf Part 1</h1><br /> -<br /> -<span class='quote'>Published at 2021-11-29T14:06:14+00:00; Updated at 2022-01-05</span><br /> -<br /> -<pre> - '\ . . |>18>> - \ . ' . | - O>> . 'o | - \ . | - /\ . | - / / .' | -jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Art by Joan Stark -</pre> -<br /> -<span>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.</span><br /> -<br /> -<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1 (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 /> -<br /> -<h2 style='display: inline'>TCP/IP networking</h2><br /> -<br /> -<span>You probably know the Netcat tool, which is a swiss army knife for TCP/IP networking on the command line. But did you know that the Bash natively supports TCP/IP networking?</span><br /> -<br /> -<span>Have a look here how that works:</span><br /> -<br /> -<pre> -❯ cat < /dev/tcp/time.nist.gov/13 - -59536 21-11-18 08:09:16 00 0 0 153.6 UTC(NIST) * -</pre> -<br /> -<span>The Bash treats /dev/tcp/HOST/PORT in a special way so that it is actually establishing a TCP connection to HOST:PORT. The example above redirects the TCP output of the time-server to cat and cat is printing it on standard output (stdout).</span><br /> -<br /> -<span>A more sophisticated example is firing up an HTTP request. Let's create a new read-write (rw) file descriptor (fd) 5, redirect the HTTP request string to it, and then read the response back:</span><br /> -<br /> -<pre> -❯ exec 5<>/dev/tcp/google.de/80 -❯ echo -e "GET / HTTP/1.1\nhost: google.de\n\n" >&5 -❯ cat <&5 | head -HTTP/1.1 301 Moved Permanently -Location: http://www.google.de/ -Content-Type: text/html; charset=UTF-8 -Date: Thu, 18 Nov 2021 08:27:18 GMT -Expires: Sat, 18 Dec 2021 08:27:18 GMT -Cache-Control: public, max-age=2592000 -Server: gws -Content-Length: 218 -X-XSS-Protection: 0 -X-Frame-Options: SAMEORIGIN -</pre> -<br /> -<span>You would assume that this also works with the ZSH, but it doesn't. This is one of the few things which don't work with the ZSH but in the Bash. There might be plugins you could use for ZSH to do something similar, though.</span><br /> -<br /> -<h2 style='display: inline'>Process substitution</h2><br /> -<br /> -<span>The idea here is, that you can read the output (stdout) of a command from a file descriptor:</span><br /> -<br /> -<pre> -❯ uptime # Without process substitution - 10:58:03 up 4 days, 22:08, 1 user, load average: 0.16, 0.34, 0.41 - -❯ cat <(uptime) # With process substitution - 10:58:16 up 4 days, 22:08, 1 user, load average: 0.14, 0.33, 0.41 - -❯ stat <(uptime) - File: /dev/fd/63 -> pipe:[468130] - Size: 64 Blocks: 0 IO Block: 1024 symbolic link -Device: 16h/22d Inode: 468137 Links: 1 -Access: (0500/lr-x------) Uid: ( 1001/ paul) Gid: ( 1001/ paul) -Context: unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 -Access: 2021-11-20 10:59:31.482411961 +0000 -Modify: 2021-11-20 10:59:31.482411961 +0000 -Change: 2021-11-20 10:59:31.482411961 +0000 - Birth: - -</pre> -<br /> -<span>This example doesn't make any sense practically speaking, but it clearly demonstrates how process substitution works. The standard output pipe of "uptime" is redirected to an anonymous file descriptor. That fd then is opened by the "cat" command as a regular file.</span><br /> -<br /> -<span>A useful use case is displaying the differences of two sorted files:</span><br /> -<br /> -<pre> -❯ echo a > /tmp/file-a.txt -❯ echo b >> /tmp/file-a.txt -❯ echo c >> /tmp/file-a.txt -❯ echo b > /tmp/file-b.txt -❯ echo a >> /tmp/file-b.txt -❯ echo c >> /tmp/file-b.txt -❯ echo X >> /tmp/file-b.txt -❯ diff -u <(sort /tmp/file-a.txt) <(sort /tmp/file-b.txt) ---- /dev/fd/63 2021-11-20 11:05:03.667713554 +0000 -+++ /dev/fd/62 2021-11-20 11:05:03.667713554 +0000 -@@ -1,3 +1,4 @@ - a - b - c -+X -❯ echo X >> /tmp/file-a.txt # Now, both files have the same content again. -❯ diff -u <(sort /tmp/file-a.txt) <(sort /tmp/file-b.txt) -❯ -</pre> -<br /> -<span>Another example is displaying the differences of two directories:</span><br /> -<br /> -<pre> -❯ diff -u <(ls ./dir1/ | sort) <(ls ./dir2/ | sort) -</pre> -<br /> -<span>More (Bash golfing) examples:</span><br /> -<br /> -<pre> -❯ wc -l <(ls /tmp/) /etc/passwd <(env) - 24 /dev/fd/63 - 49 /etc/passwd - 24 /dev/fd/62 - 97 total -❯ - -❯ while read foo; do -> echo $foo -> done < <(echo foo bar baz) -foo bar baz -❯ -</pre> -<br /> -<span>So far, we only used process substitution for stdout redirection. But it also works for stdin. The following two commands result into the same outcome, but the second one is writing the tar data stream to an anonymous file descriptor which is substituted by the "bzip2" command reading the data stream from stdin and compressing it to its own stdout, which then gets redirected to a file:</span><br /> -<br /> -<pre> -❯ tar cjf file.tar.bz2 foo -❯ tar cjf >(bzip2 -c > file.tar.bz2) foo -</pre> -<br /> -<span>Just think a while and see whether you understand fully what is happening here.</span><br /> -<br /> -<h2 style='display: inline'>Grouping</h2><br /> -<br /> -<span>Command grouping can be quite useful for combining the output of multiple commands:</span><br /> -<br /> -<pre> -❯ { ls /tmp; cat /etc/passwd; env; } | wc -l -97 -❯ ( ls /tmp; cat /etc/passwd; env; ) | wc -l -97 -</pre> -<br /> -<span>But wait, what is the difference between curly braces and normal braces? I assumed that the normal braces create a subprocess whereas the curly ones don't, but I was wrong:</span><br /> -<br /> -<pre> -❯ echo $$ -62676 -❯ { echo $$; } -62676 -❯ ( echo $$; ) -62676 -</pre> -<br /> -<span>One difference is, that the curly braces require you to end the last statement with a semicolon, whereas with the normal braces you can omit the last semicolon:</span><br /> -<br /> -<pre> -❯ ( env; ls ) | wc -l -27 -❯ { env; ls } | wc -l -> -> ^C -</pre> -<br /> -<span>In case you know more (subtle) differences, please write me an E-Mail and let me know.</span><br /> -<br /> -<span class='quote'>Update: A reader sent me an E-Mail and pointed me to the Bash manual page, which explains the difference between () and {} (I should have checked that by myself):</span><br /> -<br /> -<pre> -(list) list is executed in a subshell environment (see COMMAND EXECUTION ENVIRONMENT - below). Variable assignments and builtin commands that affect the shell's - environment do not remain in effect after the command completes. The return - status is the exit status of list. - -{ list; } - list is simply executed in the current shell environment. list must be ter‐ - minated with a newline or semicolon. This is known as a group command. The - return status is the exit status of list. Note that unlike the metacharac‐ - ters ( and ), { and } are reserved words and must occur where a reserved word - is permitted to be recognized. Since they do not cause a word break, they - must be separated from list by whitespace or another shell metacharacter. -</pre> -<br /> -<span>So I was right that () is executed in a subprocess. But why does $$ not show a different PID? Also here (as pointed out by the reader) is the answer in the manual page:</span><br /> -<br /> -<pre> -$ Expands to the process ID of the shell. In a () subshell, it expands to the - process ID of the current shell, not the subshell. -</pre> -<br /> -<span>If we want print the subprocess PID, we can use the BASHPID variable:</span><br /> -<br /> -<pre> -❯ echo $BASHPID; { echo $BASHPID; }; ( echo $BASHPID; ) -1028465 -1028465 -1028739 -</pre> -<br /> -<h2 style='display: inline'>Expansions</h2><br /> -<br /> -<span>Let's start with simple examples:</span><br /> -<br /> -<pre> -❯ echo {0..5} -0 1 2 3 4 5 -❯ for i in {0..5}; do echo $i; done -0 -1 -2 -3 -4 -5 -</pre> -<br /> -<span>You can also add leading 0 or expand to any number range:</span><br /> -<br /> -<pre> -❯ echo {00..05} -00 01 02 03 04 05 -❯ echo {000..005} -000 001 002 003 004 005 -❯ echo {201..205} -201 202 203 204 205 -</pre> -<br /> -<span>It also works with letters:</span><br /> -<br /> -<pre> -❯ echo {a..e} -a b c d e -</pre> -<br /> -<span>Now it gets interesting. The following takes a list of words and expands it so that all words are quoted:</span><br /> -<br /> -<pre> -❯ echo \"{These,words,are,quoted}\" -"These" "words" "are" "quoted" -</pre> -<br /> -<span>Let's also expand to the cross product of two given lists:</span><br /> -<br /> -<pre> -❯ echo {one,two}\:{A,B,C} -one:A one:B one:C two:A two:B two:C -❯ echo \"{one,two}\:{A,B,C}\" -"one:A" "one:B" "one:C" "two:A" "two:B" "two:C" -</pre> -<br /> -<span>Just because we can:</span><br /> -<br /> -<pre> -❯ echo Linux-{one,two,three}\:{A,B,C}-FreeBSD -Linux-one:A-FreeBSD Linux-one:B-FreeBSD Linux-one:C-FreeBSD Linux-two:A-FreeBSD Linux-two:B-FreeBSD Linux-two:C-FreeBSD Linux-three:A-FreeBSD Linux-three:B-FreeBSD Linux-three:C-FreeBSD -</pre> -<br /> -<h2 style='display: inline'>- aka stdin and stdout placeholder</h2><br /> -<br /> -<span>Some commands and Bash builtins use "-" as a placeholder for stdin and stdout:</span><br /> -<br /> -<pre> -❯ echo Hello world -Hello world -❯ echo Hello world | cat - -Hello world -❯ cat - <<ONECHEESEBURGERPLEASE -Hello world -ONECHEESEBURGERPLEASE -Hello world -❯ cat - <<< 'Hello world' -Hello world -</pre> -<br /> -<span>Let's walk through all three examples from the above snippet:</span><br /> -<br /> -<ul> -<li>The first example is obvious (the Bash builtin "echo" prints its arguments to stdout).</li> -<li>The second pipes "Hello world" via stdout to stdin of the "cat" command. As cat's argument is "-" it reads its data from stdin and not from a regular file named "-". So "-" has a special meaning for cat.</li> -<li>The third and fourth examples are interesting as we don't use a pipe as of "|" but a so-called HERE-document and a HERE-string. But the end results are the same.</li> -</ul><br /> -<span>The "tar" command understands "-" too. The following example tars up some local directory and sends the data to stdout (this is what "-f -" commands it to do). stdout then is piped via an SSH session to a remote tar process (running on buetow.org) and reads the data from stdin and extracts all the data coming from stdin (as we told tar with "-f -") on the remote machine:</span><br /> -<br /> -<pre> -❯ tar -czf - /some/dir | ssh hercules@buetow.org tar -xzvf - -</pre> -<br /> -<span>This is yet another example of using "-", but this time using the "file" command:</span><br /> -<br /> -<pre> -$ head -n 1 grandmaster.sh -#!/usr/bin/env bash -$ file - < <(head -n 1 grandmaster.sh) -/dev/stdin: a /usr/bin/env bash script, ASCII text executable -</pre> -<br /> -<span>Some more golfing:</span><br /> -<br /> -<pre> -$ cat - -hello -hello -^C -$ file - -#!/usr/bin/perl -/dev/stdin: Perl script text executable -</pre> -<br /> -<h2 style='display: inline'>Alternative argument passing</h2><br /> -<br /> -<span>This is a quite unusual way of passing arguments to a Bash script:</span><br /> -<br /> -<pre> -❯ cat foo.sh -#/usr/bin/env bash -declare -r USER=${USER:?Missing the username} -declare -r PASS=${PASS:?Missing the secret password for $USER} -echo $USER:$PASS -</pre> -<br /> -<span>So what we are doing here is to pass the arguments via environment variables to the script. The script will abort with an error when there's an undefined argument.</span><br /> -<br /> -<pre> -❯ chmod +x foo.sh -❯ ./foo.sh -./foo.sh: line 3: USER: Missing the username -❯ USER=paul ./foo.sh -./foo.sh: line 4: PASS: Missing the secret password for paul -❯ echo $? -1 -❯ USER=paul PASS=secret ./foo.sh -paul:secret -</pre> -<br /> -<span>You have probably noticed this *strange* syntax:</span><br /> -<br /> -<pre> -❯ VARIABLE1=value1 VARIABLE2=value2 ./script.sh -</pre> -<br /> -<span>That's just another way to pass environment variables to a script. You can write it as well as like this:</span><br /> -<br /> -<pre> -❯ export VARIABLE1=value1 -❯ export VARIABLE2=value2 -❯ ./script.sh -</pre> -<br /> -<span>But the downside of it is that the variables will also be defined in your current shell environment and not just in the scripts sub-process.</span><br /> -<br /> -<h2 style='display: inline'>: aka the null command</h2><br /> -<br /> -<span>First, let's use the "help" Bash built-in to see what it says about the null command:</span><br /> -<br /> -<pre> -❯ help : -:: : - Null command. - - No effect; the command does nothing. - - Exit Status: - Always succeeds. -</pre> -<br /> -<span>PS: IMHO, people should use the Bash help more often. It is a very useful Bash reference. Too many fallbacks to a Google search and then land on Stack Overflow. Sadly, there's no help built-in for the ZSH shell though (so even when I am using the ZSH I make use of the Bash help as most of the built-ins are compatible). </span><br /> -<br /> -<span>OK, back to the null command. What happens when you try to run it? As you can see, absolutely nothing. And its exit status is 0 (success):</span><br /> -<br /> -<pre> -❯ : -❯ echo $? -0 -</pre> -<br /> -<span>Why would that be useful? You can use it as a placeholder in an endless while-loop:</span><br /> -<br /> -<pre> -❯ while : ; do date; sleep 1; done -Sun 21 Nov 12:08:31 GMT 2021 -Sun 21 Nov 12:08:32 GMT 2021 -Sun 21 Nov 12:08:33 GMT 2021 -^C -❯ -</pre> -<br /> -<span>You can also use it as a placeholder for a function body not yet fully implemented, as an empty function ill result in a syntax error:</span><br /> -<br /> -<pre> -❯ foo () { } --bash: syntax error near unexpected token `}' -❯ foo () { :; } -❯ foo -❯ -</pre> -<br /> -<span>Or use it as a placeholder for not yet implemented conditional branches:</span><br /> -<br /> -<pre> -❯ if foo; then :; else echo bar; fi -</pre> -<br /> -<span>Or (not recommended) as a fancy way to comment your Bash code:</span><br /> -<br /> -<pre> -❯ : I am a comment and have no other effect -❯ : I am a comment and result in a syntax error () --bash: syntax error near unexpected token `(' -❯ : "I am a comment and don't result in a syntax error ()" -❯ -</pre> -<br /> -<span>As you can see in the previous example, the Bash still tries to interpret some syntax of all text following after ":". This can be exploited (also not recommended) like this:</span><br /> -<br /> -<pre> -❯ declare i=0 -❯ $[ i = i + 1 ] -bash: 1: command not found... -❯ : $[ i = i + 1 ] -❯ : $[ i = i + 1 ] -❯ : $[ i = i + 1 ] -❯ echo $i -4 -</pre> -<br /> -<span>For these kinds of expressions it's always better to use "let" though. And you should also use $((...expression...)) instead of the old (deprecated) way $[ ...expression... ] like this example demonstrates:</span><br /> -<br /> -<pre> -❯ declare j=0 -❯ let j=$((j + 1)) -❯ let j=$((j + 1)) -❯ let j=$((j + 1)) -❯ let j=$((j + 1)) -❯ echo $j -4 -</pre> -<br /> -<h2 style='display: inline'>(No) floating point support</h2><br /> -<br /> -<span>I have to give a plus-point to the ZSH here. As the ZSH supports floating point calculation, whereas the Bash doesn't:</span><br /> -<br /> -<pre> -❯ bash -c 'echo $(( 1/10 ))' -0 -❯ zsh -c 'echo $(( 1/10 ))' -0 -❯ bash -c 'echo $(( 1/10.0 ))' -bash: line 1: 1/10.0 : syntax error: invalid arithmetic operator (error token is ".0 ") -❯ zsh -c 'echo $(( 1/10.0 ))' -0.10000000000000001 -❯ -</pre> -<br /> -<span>It would be nice to have native floating point support for the Bash too, but you don't want to use the shell for complicated calculations anyway. So it's fine that Bash doesn't have that, I guess. </span><br /> -<br /> -<span>In the Bash you will have to fall back to an external command like "bc" (the arbitrary precision calculator language):</span><br /> -<br /> -<pre> -❯ bc <<< 'scale=2; 1/10' -.10 -</pre> -<br /> -<span>See you later for the next post of this series.</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 (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 /> -<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>Defensive DevOps</title> - <link href="https://foo.zone/gemfeed/2021-10-22-defensive-devops.html" /> - <id>https://foo.zone/gemfeed/2021-10-22-defensive-devops.html</id> - <updated>2021-10-22T10:02:46+03:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>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.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline'>Defensive DevOps</h1><br /> -<br /> -<span class='quote'>Published at 2021-10-22T10:02:46+03:00</span><br /> -<br /> -<pre> - c=====e - H - ____________ _,,_H__ - (__((__((___() //| | - (__((__((___()()_____________________________________// |ACME | - (__((__((___()()()------------------------------------' |_____| - ASCII Art by Clyde Watson -</pre> -<br /> -<span>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.</span><br /> -<br /> -<span>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. </span><br /> -<br /> -<span>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. </span><br /> -<br /> -<span>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. </span><br /> -<br /> -<span>Over time, I have compiled a list of fire-fighting automation strategies, which I would like to share here. </span><br /> -<br /> -<h2 style='display: inline'>Meet Defensive DevOps</h2><br /> -<br /> -<span>Defensive DevOps is a term I invented by myself. I define it this way:</span><br /> -<br /> -<ul> -<li>It is the practice of automating production issues away ASAP as they appear. </li> -<li>For rapid development, ignore most of the CI and QA best practices.</li> -<li>Ignore the SCRUM process (if your team does SCRUM), as it will take too long to implement a solution. </li> -<li>Be extremely careful (defensive) executing any fixing code in production, taking all failure scenarios into consideration and always have a rollback plan at hand. </li> -<li>Still deliver a high-quality solution so that no customer will ever notice that there was an issue in the first place.</li> -</ul><br /> -<span>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.</span><br /> -<br /> -<h2 style='display: inline'>Don't fully automate from the beginning</h2><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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.</span><br /> -<br /> -<h2 style='display: inline'>Develop code directly on production systems</h2><br /> -<br /> -<span>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. </span><br /> -<br /> -<span>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. </span><br /> -<br /> -<span>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.</span><br /> -<br /> -<h3 style='display: inline'>Don't make it worse</h3><br /> -<br /> -<span>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:</span><br /> -<br /> -<ul> -<li>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.</li> -<li>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. </li> -<li>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. </li> -<li>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. </li> -<li>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.</li> -<li>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. </li> -</ul><br /> -<span>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. </span><br /> -<br /> -<h2 style='display: inline'>Test your code</h2><br /> -<br /> -<span>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? </span><br /> -<br /> -<span>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. </span><br /> -<br /> -<span>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).</span><br /> -<br /> -<span>By following these principles, you test every line of code while you are developing on it. </span><br /> -<br /> -<h2 style='display: inline'>Automation</h2><br /> -<br /> -<span>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. </span><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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.</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 /> -<br /> -<span>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.</span><br /> -<br /> -<span>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. </span><br /> -<br /> -<h2 style='display: inline'>Out of office hours</h2><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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. </span><br /> -<br /> -<h2 style='display: inline'>Retrospective</h2><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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.</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>Keep it simple and stupid</title> - <link href="https://foo.zone/gemfeed/2021-09-12-keep-it-simple-and-stupid.html" /> - <id>https://foo.zone/gemfeed/2021-09-12-keep-it-simple-and-stupid.html</id> - <updated>2021-09-12T09:39:20+03:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>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.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline'>Keep it simple and stupid</h1><br /> -<br /> -<span class='quote'>Published at 2021-09-12T09:39:20+03:00; Updated at 2023-03-23</span><br /> -<br /> -<pre> - _______________ |*\_/*|_______ - | ___________ | .-. .-. ||_/-\_|______ | - | | | | .****. .****. | | | | - | | 0 0 | | .*****.*****. | | 0 0 | | - | | - | | .*********. | | - | | - | | \___/ | | .*******. | | \___/ | | - | |___ ___| | .*****. | |___________| | - |_____|\_/|_____| .***. |_______________| - _|__|/ \|_|_.............*.............._|________|_ - / ********** \ / ********** \ - / ************ \ / ************ \ --------------------- -------------------- -</pre> -<br /> -<span>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.</span><br /> -<br /> -<h1 style='display: inline'>Need faster hardware</h1><br /> -<br /> -<span>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.</span><br /> -<br /> -<h1 style='display: inline'>Too complex to be replaced</h1><br /> -<br /> -<h2 style='display: inline'>On COBOL</h2><br /> -<br /> -<span>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. </span><br /> -<br /> -<a class='textlink' href='https://nymag.com/intelligencer/2020/04/what-is-cobol-what-does-it-have-to-do-with-the-coronavirus.html'>https://nymag.com/intelligencer/2020/04/what-is-cobol-what-does-it-have-to-do-with-the-coronavirus.html</a><br /> -<br /> -<h2 style='display: inline'>On Kubernetes</h2><br /> -<br /> -<span>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.</span><br /> -<br /> -<h2 style='display: inline'>The younger generation of IT professionals</h2><br /> -<br /> -<span>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. </span><br /> -<br /> -<span>Coming back to COBOL, k8s is on its way to becoming something similar. One day, k8s might not be the hottest tech stuff everyone wants to use. But there will be still many legacy k8s clusters around but not enough experts available to manage those:</span><br /> -<br /> -<a class='textlink' href='https://www.techrepublic.com/article/why-kubernetes-is-our-modern-day-cobol-says-a-tech-expert/'>https://www.techrepublic.com/article/why-kubernetes-is-our-modern-day-cobol-says-a-tech-expert/</a><br /> -<br /> -<span>Another article which stroke me is:</span><br /> -<br /> -<a class='textlink' href='https://it.slashdot.org/story/21/09/23/163212/todays-students-dont-understand-the-basics-of-computer-operations'>Today's Students Don't Understand the Basics of Computer Operations </a><br /> -<br /> -<span>And here is something to smile about:</span><br /> -<br /> -<a class='textlink' href='https://christine.website/blog/theres-a-node-2021-10-02'>https://christine.website/blog/theres-a-node-2021-10-02</a><br /> -<br /> -<h1 style='display: inline'>The bloated web</h1><br /> -<br /> -<span>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:</span><br /> -<br /> -<a class='textlink' href='2021-04-24-welcome-to-the-geminispace.html'>2021-04-24-welcome-to-the-geminispace.html</a><br /> -<br /> -<span>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.</span><br /> -<br /> -<h1 style='display: inline'>Fancy log-management solutions</h1><br /> -<br /> -<span>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.</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.html</a><br /> -<br /> -<span>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. </span><br /> -<br /> -<h1 style='display: inline'>More KISS</h1><br /> -<br /> -<h2 style='display: inline'>The Adslowbe PDF Reader</h2><br /> -<br /> -<span>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. </span><br /> -<br /> -<h2 style='display: inline'>The power of plain text files</h2><br /> -<br /> -<span>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.</span><br /> -<br /> -<h2 style='display: inline'>KISS for programmers</h2><br /> -<br /> -<span>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:</span><br /> -<br /> -<a class='textlink' href='https://thevaluable.dev/kiss-principle-explained/'>https://thevaluable.dev/kiss-principle-explained/</a><br /> -<br /> -<h1 style='display: inline'>When KISS is not KISS anymore</h1><br /> -<br /> -<span>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.</span><br /> -<br /> -<h2 style='display: inline'>Other relevant readings</h2><br /> -<br /> -<a class='textlink' href='https://unixsheikh.com/articles/is-the-madness-ever-going-to-end.html'>Is the madness ever going to end?</a><br /> -<a class='textlink' href='https://sive.rs/plaintext'>Write plain text files</a><br /> -<br /> -<span>Enough ranted for now!</span><br /> -<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 (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='./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 /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<span class='quote'>Controversially, a lack of features is a feature. Enjoy your peace an quiet. - Michael W Lucas </span><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>On being Pedantic about Open-Source</title> - <link href="https://foo.zone/gemfeed/2021-08-01-on-being-pedantic-about-open-source.html" /> - <id>https://foo.zone/gemfeed/2021-08-01-on-being-pedantic-about-open-source.html</id> - <updated>2021-08-01T10:37:58+03:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>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. </summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline'>On being Pedantic about Open-Source</h1><br /> -<br /> -<span class='quote'>Published at 2021-08-01T10:37:58+03:00; Updated at 2023-01-23</span><br /> -<br /> -<pre> - __ - _____....--' .' - ___...---'._ o -`( - ___...---' \ .--. `\ - ___...---' | \ \ `| -| |o o | | | -| \___'.-`. '. -| | `---' -'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^' LGB - Art by lgbearrd -</pre> -<br /> -<span>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. </span><br /> -<br /> -<h2 style='display: inline'>The costs of open-source</h2><br /> -<br /> -<span>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. </span><br /> -<br /> -<span>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.</span><br /> -<br /> -<h2 style='display: inline'>Commercial providers</h2><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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. </span><br /> -<br /> -<h2 style='display: inline'>Earning on open-source</h2><br /> -<br /> -<span>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. </span><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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). </span><br /> -<br /> -<h2 style='display: inline'>Open-source organizations and individual contributors</h2><br /> -<br /> -<span>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. </span><br /> -<br /> -<span>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.</span><br /> -<br /> -<h2 style='display: inline'>Lesser known projects and the charm of clunkiness</h2><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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!</span><br /> -<br /> -<h2 style='display: inline'>The security aspect</h2><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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.</span><br /> -<br /> -<h2 style='display: inline'>Always watch out for open-source alternatives</h2><br /> -<br /> -<span>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....</span><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<span>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.</span><br /> -<br /> -<h2 style='display: inline'>What about mobile?</h2><br /> -<br /> -<span class='quote'>Update 2023-01-21: Check out my newer post about GrapheneOS, which solves some of my dilemmas</span><br /> -<br /> -<a class='textlink' href='./2023-01-23-why-grapheneos-rox.html'>Why GrapheneOS Rox</a><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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.</span><br /> -<br /> -<h2 style='display: inline'>Know the alternatives</h2><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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.</span><br /> -<br /> -<h2 style='display: inline'>You can't control it all</h2><br /> -<br /> -<span>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: </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 /> -<h2 style='display: inline'>The middle way</h2><br /> -<br /> -<span>Regarding my personal Smartphone dilemma: I guess the middle way is to use two phones: </span><br /> -<br /> -<ul> -<li>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.</li> -<li>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).</li> -<li>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.</li> -</ul><br /> -<span>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:</span><br /> -<br /> -<a class='textlink' href='https://news.slashdot.org/story/21/07/10/0120236/by-2030-you-wont-own-any-gadgets'>https://news.slashdot.org/story/21/07/10/0120236/by-2030-you-wont-own-any-gadgets</a><br /> -<br /> -<span>Anyhow, any gadgets, including your phone, should be a tool you use. Don't let the phone use you!</span><br /> -<br /> -<h2 style='display: inline'>The downside of being a nobody</h2><br /> -<br /> -<span>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.</span><br /> -<br /> -<h2 style='display: inline'>Mobile open-source OSes are still evolving</h2><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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.</span><br /> -<br /> -<h2 style='display: inline'>Conclusion</h2><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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.</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>The Well-Grounded Rubyist</title> - <link href="https://foo.zone/gemfeed/2021-07-04-the-well-grounded-rubyist.html" /> - <id>https://foo.zone/gemfeed/2021-07-04-the-well-grounded-rubyist.html</id> - <updated>2021-07-04T10:51:23+01:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>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.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline'>The Well-Grounded Rubyist</h1><br /> -<br /> -<span class='quote'>Published at 2021-07-04T10:51:23+01:00</span><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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!</span><br /> -<br /> -<a href='./2021-07-04-the-well-grounded-rubyist/book-cover.jpg'><img src='./2021-07-04-the-well-grounded-rubyist/book-cover.jpg' /></a><br /> -<br /> -<span>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.</span><br /> -<br /> -<a href='./2021-07-04-the-well-grounded-rubyist/book-backside.jpg'><img src='./2021-07-04-the-well-grounded-rubyist/book-backside.jpg' /></a><br /> -<br /> -<span>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.</span><br /> -<br /> -<h2 style='display: inline'>My Ruby problem domain</h2><br /> -<br /> -<span>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 :-).</span><br /> -<br /> -<span>I don't use Ruby for all programming projects, though. </span><br /> -<br /> -<ul> -<li>I am using Bash for small sized (usually below 500 lines of code) scripts and ad-hoc command-line automation.</li> -<li>I program in Google Go for more complex tools (such as DTail) and for problem solving involving data crunching.</li> -<li>Occasionally, I write some lines of Java code for minor feature enhancements and fixes to improve the reliability of some the services.</li> -<li>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.</li> -</ul><br /> -<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>Also have a look at my personal Bash coding style.</a><br /> -<a class='textlink' href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>Read here about DTail - the distributed log tail program.</a><br /> -<a class='textlink' href='./2018-06-01-realistic-load-testing-with-ioriot-for-linux.html'>This is a magazine article about I/O Riot I wrote.</a><br /> -<br /> -<span>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).</span><br /> -<br /> -<h2 style='display: inline'>Being stuck in Ruby-mediocrity</h2><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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.</span><br /> -<br /> -<h2 style='display: inline'>O'Reilly Safari Books Online</h2><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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". :-)</span><br /> -<br /> -<span>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.</span><br /> -<br /> -<h2 style='display: inline'>Key takeaways</h2><br /> -<br /> -<span>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.</span><br /> -<br /> -<h3 style='display: inline'>"Everything" is an object</h3><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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.</span><br /> -<br /> -<h3 style='display: inline'>"Normal" objects and singleton objects</h3><br /> -<br /> -<span>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.</span><br /> -<br /> -<h3 style='display: inline'>Domain specific languages</h3><br /> -<br /> -<span>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.</span><br /> -<br /> -<h3 style='display: inline'>Ruby is "self-ish"</h3><br /> -<br /> -<span>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". </span><br /> -<br /> -<pre> ->> 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 -</pre> -<br /> -<span>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.</span><br /> -<br /> -<h3 style='display: inline'>Functional programming</h3><br /> -<br /> -<span>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).</span><br /> -<br /> -<span>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. </span><br /> -<br /> -<span>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. :-)</span><br /> -<br /> -<h2 style='display: inline'>Perl</h2><br /> -<br /> -<span>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".</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>Gemtexter - One Bash script to rule it all</title> - <link href="https://foo.zone/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html" /> - <id>https://foo.zone/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html</id> - <updated>2021-06-05T19:03:32+01:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>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.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline'>Gemtexter - One Bash script to rule it all</h1><br /> -<br /> -<span class='quote'>Published at 2021-06-05T19:03:32+01:00</span><br /> -<br /> -<pre> - o .,<>., o - |\/\/\/\/| - '========' - (_ SSSSSSs - )a'`SSSSSs - /_ SSSSSS - .=## SSSSS - .#### SSSSs - ###::::SSSSS - .;:::""""SSS - .:;:' . . \\ - .::/ ' .'| - .::( . | - :::) \ - /\( / - /) ( | - .' \ . ./ / - _-' |\ . | - _..--.. . /"---\ | ` | . | - -=====================,' _ \=(*#(7.#####() | `/_.. , ( - _.-''``';'-''-) ,. \ ' '+/// | .'/ \ ``-.) \ - ,' _.- (( `-' `._\ `` \_/_.' ) /`-._ ) | - ,'\ ,' _.'.`:-. \.-' / <_L )" | - _/ `._,' ,')`; `-'`' | L / / - / `. ,' ,|_/ / \ ( <_-' \ - \ / `./ ' / /,' \ /|` `. | - )\ /`._ ,'`._.-\ |) \' - / `.' )-'.-,' )__) |\ `| - : /`. `.._(--.`':`':/ \ ) \ \ - |::::\ ,'/::;-)) / ( )`. | - ||::::: . .::': :`-( |/ . | - ||::::| . :| |==[]=: . - \ - |||:::| : || : | | /\ ` | - ___ ___ '|;:::| | |' \=[]=| / \ \ -| /_ ||``|||::::: | ; | | | \_.'\_ `-. -: \_``[]--[]|::::'\_;' )-'..`._ .-'\``:: ` . \ - \___.>`''-.||:.__,' SSt |_______`> <_____:::. . . \ _/ - `+a:f:......jrei''' -</pre> -<br /> -<span>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.</span><br /> -<br /> -<span>This comes with the benefit that I can write content in my favourite text editor (Vim). </span><br /> -<br /> -<h2 style='display: inline'>Motivation</h2><br /> -<br /> -<span>Another benefit of using Gemini is that the Gemtext markup language is easy to parse. As my site is dual-hosted (Gemini+HTTP), I could, in theory, just write a shell script to deal with the conversion from Gemtext to HTML; there is no need for a full-featured programming language here. I have done a lot of Bash in the past, but I am also often revisiting old tools and techniques for refreshing and keeping the knowledge up to date here.</span><br /> -<br /> -<a href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all/blog-engine.jpg'><img alt='Motivational comic strip' title='Motivational comic strip' src='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all/blog-engine.jpg' /></a><br /> -<br /> -<span>I have exactly done that - I wrote a Bash script, named Gemtexter, for that:</span><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/gemtexter'>https://codeberg.org/snonux/gemtexter</a><br /> -<br /> -<span>In short, Gemtexter is a static site generator and blogging engine that uses Gemtext as its input format.</span><br /> -<br /> -<h2 style='display: inline'>Output formats</h2><br /> -<br /> -<span>Gemtexter takes the Gemtext Markup files as the input and generates the following outputs from it (you find examples for each of these output formats on the Gemtexter GitHub page):</span><br /> -<br /> -<ul> -<li>HTML files for my website</li> -<li>Markdown files for a GitHub page</li> -<li>A Gemtext Atom feed for my blog posts</li> -<li>A Gemfeed for my blog posts (a particular feed format commonly used in Geminispace. The Gemfeed can be used as an alternative to the Atom feed).</li> -<li>An HTML Atom feed of my blog posts</li> -</ul><br /> -<span>I could have done all of that with a more robust language than Bash (such as Perl, Ruby, Go...), but I didn't. The purpose of this exercise was to challenge what I can do with a "simple" Bash script and learn new things.</span><br /> -<br /> -<h2 style='display: inline'>Taking it as far as I should, but no farther</h2><br /> -<br /> -<span>The Bash is suitable very well for small scripts and ad-hoc automation on the command line. But it is for sure not a robust programming language. Writing this blog post, Gemtexter is nearing 1000 lines of code, which is actually a pretty large Bash script.</span><br /> -<br /> -<h3 style='display: inline'>Modularization </h3><br /> -<br /> -<span>I modularized the code so that each core functionality has its own file in ./lib. All the modules are included from the main Gemtexter script. For example, there is one module for HTML generation, one for Markdown generation, and so 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>paul <b><font color="#0000FF">in</font></b> uranus <b><font color="#0000FF">in</font></b> gemtexter on 🌱 main -❯ wc -l gemtexter lib<font color="#990000">/*</font> - <font color="#993399">117</font> gemtexter - <font color="#993399">59</font> lib/assert<font color="#990000">.</font><b><font color="#0000FF">source</font></b><font color="#990000">.</font>sh - <font color="#993399">128</font> lib/atomfeed<font color="#990000">.</font><b><font color="#0000FF">source</font></b><font color="#990000">.</font>sh - <font color="#993399">64</font> lib/gemfeed<font color="#990000">.</font><b><font color="#0000FF">source</font></b><font color="#990000">.</font>sh - <font color="#993399">161</font> lib/generate<font color="#990000">.</font><b><font color="#0000FF">source</font></b><font color="#990000">.</font>sh - <font color="#993399">50</font> lib/git<font color="#990000">.</font><b><font color="#0000FF">source</font></b><font color="#990000">.</font>sh - <font color="#993399">162</font> lib/html<font color="#990000">.</font><b><font color="#0000FF">source</font></b><font color="#990000">.</font>sh - <font color="#993399">30</font> lib/log<font color="#990000">.</font><b><font color="#0000FF">source</font></b><font color="#990000">.</font>sh - <font color="#993399">63</font> lib/md<font color="#990000">.</font><b><font color="#0000FF">source</font></b><font color="#990000">.</font>sh - <font color="#993399">834</font> total -</pre> -<br /> -<span>This way, the script could grow far beyond 1000 lines of code and still be maintainable. With more features, execution speed may slowly become a problem, though. I already notice that Gemtexter doesn't produce results instantly but requires few seconds of runtime already. That's not a problem yet, though. </span><br /> -<br /> -<h3 style='display: inline'>Bash best practises and ShellCheck</h3><br /> -<br /> -<span>While working on Gemtexter, I also had a look at the Google Shell Style Guide and wrote a blog post on that:</span><br /> -<br /> -<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>Personal bash coding style guide</a><br /> -<br /> -<span>I followed all these best practices, and in my opinion, the result is a pretty maintainable Bash script (given that you are fluent with all the sed and grep commands I used).</span><br /> -<br /> -<span>ShellCheck, a shell script analysis tool written in Haskell, is run on Gemtexter ensuring that all code is acceptable. I am pretty impressed with what ShellCheck found. </span><br /> -<br /> -<span>It, for example, detected "some_command | while read var; do ...; done" loops and hinted that these create a new subprocess for the while part. The result is that all variable modifications taking place in the while-subprocess won't reflect the primary Bash process. ShellSheck then recommended rewriting the loop so that no subprocess is spawned as "while read -r var; do ...; done < <(some_command)". ShellCheck also pointed out to add a "-r" to "read"; otherwise, there could be an issue with backspaces in the loop data.</span><br /> -<br /> -<span>Furthermore, ShellCheck recommended many more improvements. Declaration of unused variables and missing variable and string quotations were the most common ones. ShellSheck immensely helped to improve the robustness of the script.</span><br /> -<br /> -<a class='textlink' href='https://shellcheck.net'>https://shellcheck.net</a><br /> -<br /> -<h3 style='display: inline'>Unit testing</h3><br /> -<br /> -<span>There is a basic unit test module in ./lib/assert.source.sh, which is used for unit testing. I found this to be very beneficial for cross-platform development. For example, I noticed that some unit tests failed on macOS while everything still worked fine on my Fedora Linux laptop. </span><br /> -<br /> -<span>After digging a bit, I noticed that I had to install the GNU versions of the sed and grep commands on macOS and a newer version of the Bash to make all unit tests pass and Gemtexter work.</span><br /> -<br /> -<span>It has been proven quite helpful to have unit tests in place for the HTML part already when working on the Markdown generator part. To test the Markdown part, I copied the HTML unit tests and changed the expected outcome in the assertions. This way, I could implement the Markdown generator in a test-driven way (writing the test first and afterwards the implementation).</span><br /> -<br /> -<h3 style='display: inline'>HTML unit test example</h3><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="#009900">gemtext</font><font color="#990000">=</font><font color="#FF0000">'=> http://example.org Description of the link'</font> -assert<font color="#990000">::</font>equals <font color="#FF0000">"$(generate::make_link html "</font><font color="#009900">$gemtext</font><font color="#FF0000">")"</font> <font color="#990000">\</font> - <font color="#FF0000">'<a class="textlink" href="http://example.org">Description of the link</a><br />'</font> -</pre> -<br /> -<h3 style='display: inline'>Markdown unit test example</h3><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="#009900">gemtext</font><font color="#990000">=</font><font color="#FF0000">'=> http://example.org Description of the link'</font> -assert<font color="#990000">::</font>equals <font color="#FF0000">"$(generate::make_link md "</font><font color="#009900">$gemtext</font><font color="#FF0000">")"</font> <font color="#990000">\</font> - <font color="#FF0000">'[Description of the link](http://example.org) '</font> -</pre> -<br /> -<h2 style='display: inline'>Handcrafted HTML styles</h2><br /> -<br /> -<span>I had a look at some ready off the shelf CSS styles, but they all seemed too bloated. There is a whole industry selling CSS styles on the interweb. I preferred an effortless and minimalist style for the HTML site. So I handcrafted the Cascading Style Sheets manually with love and included them in the HTML header template. </span><br /> -<br /> -<span>For now, I have to re-generate all HTML files whenever the CSS changes. That should not be an issue now, but I might move the CSS into a separate file one day.</span><br /> -<br /> -<span>It's worth mentioning that all generated HTML files and Atom feeds pass the W3C validation tests.</span><br /> -<span> </span><br /> -<h2 style='display: inline'>Configurability</h2><br /> -<br /> -<span>In case someone else than me wants to use Gemtexter for his own site, it is pretty much configurable. It is possible to specify your own configuration file and your own HTML templates. Have a look at the GitHub page for examples.</span><br /> -<br /> -<h2 style='display: inline'>Future features</h2><br /> -<br /> -<span>I could think of the following features added to a future version of Gemtexter:</span><br /> -<br /> -<ul> -<li>Templating of Gemtext files so that the .html files are generated from .gmi.tpl files. The template engine could do such things as an automatic table of contents and sitemap generation. It could also include the output of inlined shell code, e.g. a fortune quote. </li> -<li>Add support for more output formats, such as Groff, PDF, plain text, Gopher, etc.</li> -<li>External CSS file for HTML.</li> -<li>Improve speed by introducing parallelism and/or concurrency and/or better caching.</li> -</ul><br /> -<h2 style='display: inline'>Conclusion</h2><br /> -<br /> -<span>It was quite a lot of fun writing Gemtexter. It's a relatively small project, but given that I worked on that in my spare time once in a while, it kept me busy for several weeks. </span><br /> -<br /> -<span>I finally revamped my personal internet site and started to blog again. I wanted the result to be exactly how it is now: A slightly retro-inspired internet site built for fun with unconventional tools. </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-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 (You are currently reading this)</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='./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='./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 /> -<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>Personal Bash coding style guide</title> - <link href="https://foo.zone/gemfeed/2021-05-16-personal-bash-coding-style-guide.html" /> - <id>https://foo.zone/gemfeed/2021-05-16-personal-bash-coding-style-guide.html</id> - <updated>2021-05-16T14:51:57+01:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>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. </summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline'>Personal Bash coding style guide</h1><br /> -<br /> -<span class='quote'>Published at 2021-05-16T14:51:57+01:00</span><br /> -<br /> -<pre> - .---------------------------. - /,--..---..---..---..---..--. `. - //___||___||___||___||___||___\_| - [j__ ######################## [_| - \============================| - .==| |"""||"""||"""||"""| |"""|| -/======"---""---""---""---"=| =|| -|____ []* ____ | ==|| -// \\ // \\ |===|| hjw -"\__/"---------------"\__/"-+---+' -</pre> -<br /> -<span>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. </span><br /> -<br /> -<a class='textlink' href='https://google.github.io/styleguide/shellguide.html'>Google Shell Style Guide</a><br /> -<br /> -<h2 style='display: inline'>My modifications</h2><br /> -<br /> -<span>These are my modifications to the Google Guide.</span><br /> -<br /> -<h3 style='display: inline'>Shebang</h3><br /> -<br /> -<span>Google recommends using always...</span><br /> -<br /> -<pre> -#!/bin/bash -</pre> -<br /> -<span>... as the shebang line, but that does not work on all Unix and Unix-like operating systems (e.g., the *BSDs don't have Bash installed to /bin/bash). Better is:</span><br /> -<br /> -<pre> -#!/usr/bin/env bash -</pre> -<br /> -<h3 style='display: inline'>Two space soft-tabs indentation</h3><br /> -<br /> -<span>I know there have been many tab- and soft-tab wars on this planet. Google recommends using two space soft-tabs for Bash scripts. </span><br /> -<br /> -<span>I don't care if I use two or four space indentations. I agree, however, that we should not use tabs. I tend to use four-space soft-tabs as that's how I currently configured Vim for any programming language. What matters most, though, is consistency within the same script/project.</span><br /> -<br /> -<span>Google also recommends limiting the line length to 80 characters. For some people, that seems to be an old habit from the '80s, where all computer terminals couldn't display longer lines. But I think that the 80 character mark is still a good practice, at least for shell scripts. For example, I am often writing code on a Microsoft Go Tablet PC (running Linux, of course), and it comes in convenient if the lines are not too long due to the relatively small display on the device.</span><br /> -<br /> -<span>I hit the 80 character line length quicker with the four spaces than with two spaces, but that makes me refactor the Bash code more aggressively, which is a good thing. </span><br /> -<br /> -<h3 style='display: inline'>Breaking long pipes</h3><br /> -<br /> -<span>Google recommends breaking up long pipes like this:</span><br /> -<br /> -<pre> -# All fits on one line -command1 | command2 - -# Long commands -command1 \ - | command2 \ - | command3 \ - | command4 -</pre> -<br /> -<span>I think there is a better way like the following, which is less noisy. The pipe | already indicates the Bash that another command is expected, thus making the explicit line breaks with \ obsolete:</span><br /> -<br /> -<pre> -# Long commands -command1 | - command2 | - command3 | - command4 -</pre> -<br /> -<h3 style='display: inline'>Quoting your variables</h3><br /> -<br /> -<span>Google recommends always quote your variables. Generally, it would be best if you did that only for variables where you are unsure about the content/values of the variables (e.g., content is from an external input source and may contain whitespace or other special characters). In my opinion, the code will become quite noisy when you always quote your variables like this:</span><br /> -<br /> -<pre> -greet () { - local -r greeting="${1}" - local -r name="${2}" - echo "${greeting} ${name}!" -} -</pre> -<br /> -<span>In this particular example, I agree that you should quote them as you don't know the input (are there, for example, whitespace characters?). But if you are sure that you are only using simple bare words, then I think that the code looks much cleaner when you do this instead:</span><br /> -<br /> -<pre> -say_hello_to_paul () { - local -r greeting=Hello - local -r name=Paul - echo "$greeting $name!" -} -</pre> -<br /> -<span>You see, I also omitted the curly braces { } around the variables. I only use the curly braces around variables when it makes the code either easier/clearer to read or if it is necessary to use them:</span><br /> -<br /> -<pre> -declare FOO=bar -# Curly braces around FOO are necessary -echo "foo${FOO}baz" -</pre> -<br /> -<span>A few more words on always quoting the variables: For the sake of consistency (and for making ShellCheck happy), I am not against quoting everything I encounter. I also think that the larger the Bash script becomes, the more critical it becomes always to quote variables. That's because it will be more likely that you might not remember that some of the functions don't work on values with spaces in them, for example. It's just that I won't quote everything in every small script I write. </span><br /> -<br /> -<h3 style='display: inline'>Prefer built-in commands over external commands</h3><br /> -<br /> -<span>Google recommends using the built-in commands over available external commands where possible:</span><br /> -<br /> -<pre> -# Prefer this: -addition=$(( X + Y )) -substitution="${string/#foo/bar}" - -# Instead of this: -addition="$(expr "${X}" + "${Y}")" -substitution="$(echo "${string}" | sed -e 's/^foo/bar/')" -</pre> -<br /> -<span>I can't entirely agree here. The external commands (especially sed) are much more sophisticated and powerful than the built-in Bash versions. Sed can do much more than the Bash can ever do by itself when it comes to text manipulation (the name "sed" stands for streaming editor, after all).</span><br /> -<br /> -<span>I prefer to do light text processing with the Bash built-ins and more complicated text processing with external programs such as sed, grep, awk, cut, and tr. However, there is also medium-light text processing where I would want to use external programs. That is so because I remember using them better than the Bash built-ins. The Bash can get relatively obscure here (even Perl will be more readable then - Side note: I love Perl).</span><br /> -<br /> -<span>Also, you would like to use an external command for floating-point calculation (e.g., bc) instead of using the Bash built-ins (worth noticing that ZSH supports built-in floating-points).</span><br /> -<br /> -<span>I even didn't get started with what you can do with awk (especially GNU Awk), a fully-fledged programming language. Tiny Awk snippets tend to be used quite often in Shell scripts without honouring the real power of Awk. But if you did everything in Perl or Awk or another scripting language, then it wouldn't be a Bash script anymore, wouldn't it? ;-)</span><br /> -<br /> -<h2 style='display: inline'>My additions</h2><br /> -<br /> -<h3 style='display: inline'>Use of 'yes' and 'no'</h3><br /> -<br /> -<span>Bash does not support a boolean type. I tend just to use the strings 'yes' and 'no' here. I used 0 for false and 1 for true for some time, but I think that the yes/no strings are easier to read. Yes, the Bash script would need to perform string comparisons on every check, but if performance is crucial to you, you wouldn't want to use a Bash script anyway, correct?</span><br /> -<br /> -<pre> -declare -r SUGAR_FREE=yes -declare -r I_NEED_THE_BUZZ=no - -buy_soda () { - local -r sugar_free=$1 - - if [[ $sugar_free == yes ]]; then - echo 'Diet Dr. Pepper' - else - echo 'Pepsi Coke' - fi -} - -buy_soda $I_NEED_THE_BUZZ -</pre> -<br /> -<h3 style='display: inline'>Non-evil alternative to variable assignments via eval</h3><br /> -<br /> -<span>Google is in the opinion that eval should be avoided. I think so too. They list these examples in their guide:</span><br /> -<br /> -<pre> -# What does this set? -# Did it succeed? In part or whole? -eval $(set_my_variables) - -# What happens if one of the returned values has a space in it? -variable="$(eval some_function)" - -</pre> -<br /> -<span>However, if I want to read variables from another file, I don't have to use eval here. I only have to source the file:</span><br /> -<br /> -<pre> -% cat vars.source.sh -declare foo=bar -declare bar=baz -declare bay=foo - -% bash -c 'source vars.source.sh; echo $foo $bar $baz' -bar baz foo -</pre> -<br /> -<span>And suppose I want to assign variables dynamically. In that case, I could just run an external script and source its output (This is how you could do metaprogramming in Bash without the use of eval - write code which produces code for immediate execution):</span><br /> -<br /> -<pre> -% cat vars.sh -#!/usr/bin/env bash -cat <<END -declare date="$(date)" -declare user=$USER -END - -% bash -c 'source <(./vars.sh); echo "Hello $user, it is $date"' -Hello paul, it is Sat 15 May 19:21:12 BST 2021 -</pre> -<br /> -<span>The downside is that ShellCheck won't be able to follow the dynamic sourcing anymore.</span><br /> -<br /> -<h3 style='display: inline'>Prefer pipes over arrays for list processing</h3><br /> -<br /> -<span>When I do list processing in Bash, I prefer to use pipes. You can chain them through Bash functions as well, which is pretty neat. Usually, my list processing scripts are of a structure like this:</span><br /> -<br /> -<pre> -filter_lines () { - echo 'Start filtering lines in a fancy way!' >&2 - grep ... | sed .... -} - -process_lines () { - echo 'Start processing line by line!' >&2 - while read -r line; do - ... do something and produce a result... - echo "$result" - done -} - -# Do some post-processing of the data -postprocess_lines () { - echo 'Start removing duplicates!' >&2 - sort -u -} - -genreate_report () { - echo 'My boss wants to have a report!' >&2 - tee outfile.txt - wc -l outfile.txt -} - -main () { - filter_lines | - process_lines | - postprocess_lines | - generate_report -} - -main -</pre> -<br /> -<span>The stdout is always passed as a pipe to the next following stage. The stderr is used for info logging.</span><br /> -<br /> -<h3 style='display: inline'>Assign-then-shift</h3><br /> -<br /> -<span>I often refactor existing Bash code. That leads me to add and removing function arguments quite often. It's pretty repetitive work changing the $1, $2.... function argument numbers every time you change the order or add/remove possible arguments.</span><br /> -<br /> -<span>The solution is to use of the "assign-then-shift"-method, which goes like this: "local -r var1=$1; shift; local -r var2=$1; shift". The idea is that you only use "$1" to assign function arguments to named (better readable) local function variables. You will never have to bother about "$2" or above. That is very useful when you constantly refactor your code and remove or add function arguments. It's something that I picked up from a colleague (a pure Bash wizard) some time ago:</span><br /> -<br /> -<pre> -some_function () { - local -r param_foo="$1"; shift - local -r param_baz="$1"; shift - local -r param_bay="$1"; shift - ... -} -</pre> -<br /> -<span>Want to add a param_baz? Just do this:</span><br /> -<br /> -<pre> -some_function () { - local -r param_foo="$1"; shift - local -r param_bar="$1"; shift - local -r param_baz="$1"; shift - local -r param_bay="$1"; shift - ... -} -</pre> -<br /> -<span>Want to remove param_foo? Nothing easier than that:</span><br /> -<br /> -<pre> -some_function () { - local -r param_bar="$1"; shift - local -r param_baz="$1"; shift - local -r param_bay="$1"; shift - ... -} -</pre> -<br /> -<span>As you can see, I didn't need to change any other assignments within the function. Of course, you would also need to change the function argument lists at every occasion where the function is invoked - you would do that within the same refactoring session.</span><br /> -<br /> -<h3 style='display: inline'>Paranoid mode</h3><br /> -<br /> -<span>I call this the paranoid mode. The Bash will stop executing when a command exits with a status not equal to 0:</span><br /> -<br /> -<pre> -set -e -grep -q foo <<< bar -echo Jo -</pre> -<br /> -<span>Here 'Jo' will never be printed out as the grep didn't find any match. It's unrealistic for most scripts to run in paranoid mode purely, so there must be a way to add exceptions. Critical Bash scripts of mine tend to look like this:</span><br /> -<br /> -<pre> -#!/usr/bin/env bash - -set -e - -some_function () { - .. some critical code - ... - - set +e - # Grep might fail, but that's OK now - grep .... - local -i ec=$? - set -e - - .. critical code continues ... - if [[ $ec -ne 0 ]]; then - ... - fi - ... -} -</pre> -<br /> -<h2 style='display: inline'>Learned</h2><br /> -<br /> -<span>There are also a couple of things I've learned from Google's guide.</span><br /> -<br /> -<h3 style='display: inline'>Unintended lexicographical comparison.</h3><br /> -<br /> -<span>The following looks like a valid Bash code:</span><br /> -<br /> -<pre> -if [[ "${my_var}" > 3 ]]; then - # True for 4, false for 22. - do_something -fi -</pre> -<br /> -<span>... but it is probably an unintended lexicographical comparison. A correct way would be:</span><br /> -<br /> -<pre> -if (( my_var > 3 )); then - do_something -fi -</pre> -<br /> -<span>or</span><br /> -<br /> -<pre> -if [[ "${my_var}" -gt 3 ]]; then - do_something -fi -</pre> -<br /> -<h3 style='display: inline'>PIPESTATUS</h3><br /> -<br /> -<span>I have never used the PIPESTATUS variable before. I knew that it's there, but I never bothered to understand how it works until now thoroughly.</span><br /> -<br /> -<span>The PIPESTATUS variable in Bash allows checking of the return code from all parts of a pipe. If it's only necessary to check the success or failure of the whole pipe, then the following is acceptable:</span><br /> -<br /> -<pre> -tar -cf - ./* | ( cd "${dir}" && tar -xf - ) -if (( PIPESTATUS[0] != 0 || PIPESTATUS[1] != 0 )); then - echo "Unable to tar files to ${dir}" >&2 -fi -</pre> -<br /> -<span>However, as PIPESTATUS will be overwritten as soon as you do any other command, if you need to act differently on errors based on where it happened in the pipe, you'll need to assign PIPESTATUS to another variable immediately after running the command (don't forget that [ is a command and will wipe out PIPESTATUS).</span><br /> -<br /> -<pre> -tar -cf - ./* | ( cd "${DIR}" && tar -xf - ) -return_codes=( "${PIPESTATUS[@]}" ) -if (( return_codes[0] != 0 )); then - do_something -fi -if (( return_codes[1] != 0 )); then - do_something_else -fi -</pre> -<br /> -<h2 style='display: inline'>Use common sense and BE CONSISTENT.</h2><br /> -<br /> -<span>The following two paragraphs are thoroughly quoted from the Google guidelines. But they hit the hammer on the head:</span><br /> -<br /> -<span class='quote'>If you are editing code, take a few minutes to look at the code around you and determine its style. If they use spaces around their if clauses, you should, too. If their comments have little boxes of stars around them, make your comments have little boxes of stars around them too.</span><br /> -<br /> -<span class='quote'>The point of having style guidelines is to have a common vocabulary of coding so people can concentrate on what you are saying rather than on how you are saying it. We present global style rules here, so people know the vocabulary. But local style is also important. If the code you add to a file looks drastically different from the existing code around it, the discontinuity throws readers out of their rhythm when they go to read it. Try to avoid this.</span><br /> -<br /> -<br /> -<h2 style='display: inline'>Advanced Bash learning pro tip</h2><br /> -<br /> -<span>I also highly recommend having a read through the "Advanced Bash-Scripting Guide" (not from Google). I use it as the universal Bash reference and learn something new every time I look at it.</span><br /> -<br /> -<a class='textlink' href='https://tldp.org/LDP/abs/html/'>Advanced Bash-Scripting Guide</a><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 (You are currently reading this)</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 /> -<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 Geminispace</title> - <link href="https://foo.zone/gemfeed/2021-04-24-welcome-to-the-geminispace.html" /> - <id>https://foo.zone/gemfeed/2021-04-24-welcome-to-the-geminispace.html</id> - <updated>2021-04-24T19:28:41+01:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>ASCII Art by Andy Hood!</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline'>Welcome to the Geminispace</h1><br /> -<br /> -<span class='quote'>Published at 2021-04-24T19:28:41+01:00; Updated at 2021-06-18</span><br /> -<br /> -<span>ASCII Art by Andy Hood!</span><br /> -<br /> -<span>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:</span><br /> -<br /> -<a class='textlink' href='https://foo.zone'>https://foo.zone</a><br /> -<br /> -<span>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 :-).</span><br /> -<br /> -<pre> - /\ - / \ - | | - |NASA| - | | - | | - | | - ' ` - |Gemini| - | | - |______| - '-`'-` . - / . \'\ . .' - ''( .'\.' ' .;' -'.;.;' ;'.;' ..;;' AsH - -</pre> -<br /> -<h2 style='display: inline'>Motivation</h2><br /> -<br /> -<h3 style='display: inline'>My urge to revamp my personal website</h3><br /> -<br /> -<span>For some time, I had to urge to revamp my personal website. Not to update the technology and its design but to update all the content (+ keep it current) and start a small tech blog again. So unconsciously, I began to search for an excellent platform to do all of that in a KISS (keep it simple & stupid) way.</span><br /> -<br /> -<h3 style='display: inline'>My still great Laptop running hot</h3><br /> -<br /> -<span>Earlier this year (2021), I noticed that my almost seven-year-old but still great Laptop started to become hot and slowed down while surfing the web. Also, the Laptop's fan became quite noisy. This was all due to the additional bloat such as JavaScript, excessive use of CSS, tracking cookies+pixels, ads, and so on there was on the website. </span><br /> -<br /> -<span>All I wanted was to read an interesting article, but after a big advertising pop-up banner appeared and made everything worse, I gave up and closed the browser tab.</span><br /> -<br /> -<h2 style='display: inline'>Discovering the Gemini internet protocol</h2><br /> -<br /> -<span>Around the same time, I discovered a relatively new, more lightweight protocol named Gemini, which does not support all these CPU-intensive features like HTML, JavaScript, and CSS. Also, tracking and ads are unsupported by the Gemini protocol.</span><br /> -<br /> -<span>The "downside" is that due to the limited capabilities of the Gemini protocol, all sites look very old and spartan. But that is not a downside; that is, in fact, a design choice people made. It is up to the client software how your capsule looks. For example, you could use a graphical client, such as Lagrange, with nice font renderings and colours to improve the appearance. Or you could use a very minimalistic command line black-and-white Gemini client. It's your (the user's) choice.</span><br /> -<br /> -<a href='./2021-04-24-welcome-to-the-geminispace/amfora-screenshot.png'><img alt='Screenshot Amfora Gemini terminal client surfing this site' title='Screenshot Amfora Gemini terminal client surfing this site' src='./2021-04-24-welcome-to-the-geminispace/amfora-screenshot.png' /></a><br /> -<a href='./2021-04-24-welcome-to-the-geminispace/lagrange-screenshot.png'><img alt='Screenshot graphical Lagrange Gemini client surfing this site' title='Screenshot graphical Lagrange Gemini client surfing this site' src='./2021-04-24-welcome-to-the-geminispace/lagrange-screenshot.png' /></a><br /> -<br /> -<span>Why is there a need for a new protocol? As the modern web is a superset of Gemini, can't we use simple HTML 1.0 instead? That's a good and valid question. It is not a technical problem but a human problem. We tend to abuse the features once they are available. You can ensure that things stay efficient and straightforward as long as you are using the Gemini protocol. On the other hand, you can't force every website on the modern web to only create plain and straightforward-looking HTML pages.</span><br /> -<br /> -<h2 style='display: inline'>My own Gemini capsule</h2><br /> -<br /> -<span>As it is effortless to set up and maintain your own Gemini capsule (Gemini server + content composed via the Gemtext markup language), I decided to create my own. What I like about Gemini is that I can use my favourite text editor and get typing. I don't need to worry about the style and design of the presence, and I also don't have to test anything in ten different web browsers. I can only focus on the content! As a matter of fact, I am using the Vim editor + its spellchecker + auto word completion functionality to write this. </span><br /> -<br /> -<span>This site was generated with Gemtexter. You can read more about it here:</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 /> -<h2 style='display: inline'>Gemini advantages summarised</h2><br /> -<br /> -<ul> -<li>Supports an alternative to the modern bloated web</li> -<li>Easy to operate and easy to write content</li> -<li>No need to worry about various web browser compatibilities</li> -<li>It's the client's responsibility how the content is designed+presented</li> -<li>Lightweight (although not as lightweight as the Gopher protocol)</li> -<li>Supports privacy (no cookies, no request header fingerprinting, TLS encryption)</li> -<li>Fun to play with (it's a bit geeky, yes, but a lot of fun!)</li> -</ul><br /> -<h2 style='display: inline'>Dive into deep Gemini space</h2><br /> -<br /> -<span>Check out one of the following links for more information about Gemini. For example, you will find a FAQ that explains why the protocol is named Gemini. Many Gemini capsules are dual-hosted via Gemini and HTTP(S) so that people new to Gemini can sneak peek at the content with a regular web browser. Some people go as far as tri-hosting all their content via HTTP(S), Gemini and Gopher.</span><br /> -<br /> -<a class='textlink' href='https://gemini.circumlunar.space'>https://gemini.circumlunar.space</a><br /> -<a class='textlink' href='https://gemini.circumlunar.space'>https://gemini.circumlunar.space</a><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 (You are currently reading this)</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='./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 /> -<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>DTail - The distributed log tail program</title> - <link href="https://foo.zone/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.html" /> - <id>https://foo.zone/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.html</id> - <updated>2021-04-22T19:28:41+01:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>This article first appeared at the Mimecast Engineering Blog but I made it available here in my personal internet site too.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline'>DTail - The distributed log tail program</h1><br /> -<br /> -<span class='quote'>Published at 2021-04-22T19:28:41+01:00; Updated at 2021-04-26</span><br /> -<br /> -<a href='./2021-04-22-dtail-the-distributed-log-tail-program/title.png'><img alt='DTail logo image' title='DTail logo image' src='./2021-04-22-dtail-the-distributed-log-tail-program/title.png' /></a><br /> -<br /> -<span>This article first appeared at the Mimecast Engineering Blog but I made it available here in my personal internet site too.</span><br /> -<br /> -<a class='textlink' href='https://medium.com/mimecast-engineering/dtail-the-distributed-log-tail-program-79b8087904bb'>Original Mimecast Engineering Blog post at Medium</a><br /> -<br /> -<span>Running a large cloud-based service requires monitoring the state of huge numbers of machines, a task for which many standard UNIX tools were not really designed. In this post, I will describe a simple program, DTail, that Mimecast has built and released as Open-Source, which enables us to monitor log files of many servers at once without the costly overhead of a full-blown log management system.</span><br /> -<br /> -<span>At Mimecast, we run over 10 thousand server boxes. Most of them host multiple microservices and each of them produces log files. Even with the use of time series databases and monitoring systems, raw application logs are still an important source of information when it comes to analysing, debugging, and troubleshooting services.</span><br /> -<br /> -<span>Every engineer familiar with UNIX or a UNIX-like platform (e.g., Linux) is well aware of tail, a command-line program for displaying a text file content on the terminal which is also especially useful for following application or system log files with tail -f logfile.</span><br /> -<br /> -<span>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.</span><br /> -<br /> -<h2 style='display: inline'>A Mimecast Pet Project</h2><br /> -<br /> -<span>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:</span><br /> -<br /> -<a class='textlink' href='https://dtail.dev'>https://dtail.dev</a><br /> -<br /> -<span>Try it out — We would love any feedback. But first, read on…</span><br /> -<br /> -<h2 style='display: inline'>Differentiating from log management systems</h2><br /> -<br /> -<span>Why not just use a full-blown log management system? There are various Open-Source and commercial log management solutions available on the market you could choose from (e.g. the ELK stack). Most of them store the logs in a centralized location and are fairly complex to set up and operate. Possibly they are also pretty expensive to operate if you have to buy dedicated hardware (or pay fees to your cloud provider) and have to hire support staff for it.</span><br /> -<br /> -<span>DTail does not aim to replace any of the log management tools already available but is rather an additional tool crafted especially for ad-hoc debugging and troubleshooting purposes. DTail is cheap to operate as it does not require any dedicated hardware for log storage as it operates directly on the source of the logs. It means that there is a DTail server installed on all server boxes producing logs. This decentralized comes with the direct advantages that there is no introduced delay because the logs are not shipped to a central log storage device. The reduced complexity also makes it more robust against outages. You won’t be able to troubleshoot your distributed application very well if the log management infrastructure isn’t working either.</span><br /> -<br /> -<a href='./2021-04-22-dtail-the-distributed-log-tail-program/dtail.gif'><img alt='DTail sample session animated gif' title='DTail sample session animated gif' src='./2021-04-22-dtail-the-distributed-log-tail-program/dtail.gif' /></a><br /> -<br /> -<span>As a downside, you won’t be able to access any logs with DTail when the server is down. Furthermore, a server can store logs only up to a certain capacity as disks will fill up. For the purpose of ad-hoc debugging, these are not typically issues. Usually, it’s the application you want to debug and not the server. And disk space is rarely an issue for bare metal and VM-based systems these days, with sufficient space for several weeks’ worth of log storage being available. DTail also supports reading compressed logs. The currently supported compression algorithms are gzip and zstd.</span><br /> -<br /> -<h2 style='display: inline'>Combining simplicity, security and efficiency</h2><br /> -<br /> -<span>DTail also has a client component that connects to multiple servers concurrently for log files (or any other text files).</span><br /> -<br /> -<span>The DTail client interacts with a DTail server on port TCP/2222 via SSH protocol and does not interact in any way with the system’s SSH server (e.g., OpenSSH Server) which might be running at port TCP/22 already. As a matter of fact, you don’t need a regular SSH server running for DTail at all. There is no support for interactive login shells at TCP/2222 either, as by design that port can only be used for text data streaming. The SSH protocol is used for the public/private key infrastructure and transport encryption only and DTail implements its own protocol on top of SSH for the features provided. There is no need to set up or buy any additional TLS certificates. The port 2222 can be easily reconfigured if you preferred to use a different one.</span><br /> -<br /> -<span>The DTail server, which is a single static binary, will not fork an external process. This means that all features are implemented in native Go code (exception: Linux ACL support is implemented in C, but it must be enabled explicitly on compile time) and therefore helping to make it robust, secure, efficient, and easy to deploy. A single client, running on a standard Laptop, can connect to thousands of servers concurrently while still maintaining a small resource footprint.</span><br /> -<br /> -<span>Recent log files are very likely still in the file system caches on the servers. Therefore, there tends to be a minimal I/O overhead involved.</span><br /> -<br /> -<h2 style='display: inline'>The DTail family of commands</h2><br /> -<br /> -<span>Following the UNIX philosophy, DTail includes multiple command-line commands each of them for a different purpose:</span><br /> -<br /> -<ul> -<li>dserver: The DTail server, the only binary required to be installed on the servers involved.</li> -<li>dtail: The distributed log tail client for following log files.</li> -<li>dcat: The distributed cat client for concatenating and displaying text files.</li> -<li>dgrep: The distributed grep client for searching text files for a regular expression pattern.</li> -<li>dmap: The distributed map-reduce client for aggregating stats from log files.</li> -</ul><br /> -<a href='./2021-04-22-dtail-the-distributed-log-tail-program/dgrep.gif'><img alt='DGrep sample session animated gif' title='DGrep sample session animated gif' src='./2021-04-22-dtail-the-distributed-log-tail-program/dgrep.gif' /></a><br /> -<br /> -<h2 style='display: inline'>Usage example</h2><br /> -<br /> -<span>The use of these commands is almost self-explanatory for a person already used to the standard command line in Unix systems. One of the main goals is to make DTail easy to use. A tool that is too complicated to use under high-pressure scenarios (e.g., during an incident) can be quite detrimental.</span><br /> -<br /> -<span>The basic idea is to start one of the clients from the command line and provide a list of servers to connect to with –servers. You also must provide a path of remote (log) files via –files. If you want to process multiple files per server, you could either provide a comma-separated list of file paths or make use of file system globbing (or a combination of both).</span><br /> -<br /> -<span>The following example would connect to all DTail servers listed in the serverlist.txt, follow all files with the ending .log and filter for lines containing the string error. You can specify any Go compatible regular expression. In this example we add the case-insensitive flag to the regex:</span><br /> -<br /> -<pre> -dtail –servers serverlist.txt –files ‘/var/log/*.log’ –regex ‘(?i:error)’ -</pre> -<br /> -<span>You usually want to specify a regular expression as a client argument. This will mean that responses are pre-filtered for all matching lines on the server-side and thus sending back only the relevant lines to the client. If your logs are growing very rapidly and the regex is not specific enough there might be the chance that your client is not fast enough to keep up processing all of the responses. This could be due to a network bottleneck or just as simple as a slow terminal emulator displaying the log lines on the client-side.</span><br /> -<br /> -<span>A green 100 in the client output before each log line received from the server always indicates that there were no such problems and 100% of all log lines could be displayed on your terminal (have a look at the animated Gifs in this post). If the percentage falls below 100 it means that some of the channels used by the servers to send data to the client are congested and lines were dropped. In this case, the color will change from green to red. The user then could decide to run the same query but with a more specific regex.</span><br /> -<br /> -<span>You could also provide a comma-separated list of servers as opposed to a text file. There are many more options you could use. The ones listed here are just the very basic ones. There are more instructions and usage examples on the GitHub page. Also, you can study even more of the available options via the –help switch (some real treasures might be hidden there).</span><br /> -<br /> -<h2 style='display: inline'>Fitting it in</h2><br /> -<br /> -<span>DTail integrates nicely into the user management of existing infrastructure. It follows normal system permissions and does not open new “holes” on the server which helps to keep security departments happy. The user would not have more or less file read permissions than he would have via a regular SSH login shell. There is a full SSH key, traditional UNIX permissions, and Linux ACL support. There is also a very low resource footprint involved. On average for tailing and searching log files less than 100MB RAM and less than a quarter of a CPU core per participating server are required. Complex map-reduce queries on big data sets will require more resources accordingly.</span><br /> -<br /> -<h2 style='display: inline'>Advanced features</h2><br /> -<br /> -<span>The features listed here are out of the scope of this blog post but are worthwhile to mention:</span><br /> -<br /> -<ul> -<li>Distributed map-reduce queries on stats provided in log files with dmap. dmap comes with its own SQL-like aggregation query language.</li> -<li>Stats streaming with continuous map-reduce queries. The difference to normal queries is that the stats are aggregated over a specified interval only on the newly written log lines. Thus, giving a de-facto live stat view for each interval.</li> -<li>Server-side scheduled queries on log files. The queries are configured in the DTail server configuration file and scheduled at certain time intervals. Results are written to CSV files. This is useful for generating daily stats from the log files without the need for an interactive client.</li> -<li>Server-side stats streaming with continuous map-reduce queries. This for example can be used to periodically generate stats from the logs at a configured interval, e.g., log error counts by the minute. These then can be sent to a time-series database (e.g., Graphite) and then plotted in a Grafana dashboard.</li> -<li>Support for custom extensions. E.g., for different server discovery methods (so you don’t have to rely on plain server lists) and log file formats (so that map-reduce queries can parse more stats from the logs).</li> -</ul><br /> -<h2 style='display: inline'>For the future</h2><br /> -<br /> -<span>There are various features we want to see in the future.</span><br /> -<br /> -<ul> -<li>A spartan mode, not printing out any extra information but the raw remote log files would be a nice feature to have. This will make it easier to post-process the data produced by the DTail client with common UNIX tools. (To some degree this is possible already, just disable the ANSI terminal color output of the client with -noColors and pipe the output to another program).</li> -<li>Tempting would be implementing the dgoawk command, a distributed version of the AWK programming language purely implemented in Go, for advanced text data stream processing capabilities. There are 3rd party libraries available implementing AWK in pure Go which could be used.</li> -<li>A more complex change would be the support of federated queries. You can connect to thousands of servers from a single client running on a laptop. But does it scale to 100k of servers? Some of the servers could be used as middleware for connecting to even more servers.</li> -<li>Another aspect is to extend the documentation. Especially the advanced features such as map-reduce query language and how to configure the server-side queries currently do require more documentation. For now, you can read the code, sample config files or just ask the author for that! But this will be certainly addressed in the future.</li> -</ul><br /> -<h2 style='display: inline'>Open Source</h2><br /> -<br /> -<span>Mimecast highly encourages you to have a look at DTail and submit an issue for any features you would like to see. Have you found a bug? Maybe you just have a question or comment? If you want to go a step further: We would also love to see pull requests for any features or improvements. Either way, if in doubt just contact us via the DTail GitHub page.</span><br /> -<br /> -<a class='textlink' href='https://dtail.dev'>https://dtail.dev</a><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 (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='./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>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>Realistic load testing with I/O Riot for Linux</title> - <link href="https://foo.zone/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux.html" /> - <id>https://foo.zone/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux.html</id> - <updated>2018-06-01T14:50:29+01:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>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. </summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline'>Realistic load testing with I/O Riot for Linux</h1><br /> -<br /> -<span class='quote'>Published at 2018-06-01T14:50:29+01:00; Updated at 2021-05-08</span><br /> -<br /> -<pre> - .---. - / \ - \.@-@./ - /`\_/`\ - // _ \\ - | \ )|_ - /`\_`> <_/ \ -jgs\__/'---'\__/ -</pre> -<br /> -<h2 style='display: inline'>Foreword</h2><br /> -<br /> -<span>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. </span><br /> -<br /> -<a class='textlink' href='https://www.admin-magazin.de/Das-Heft/2018/06/Realistische-Lasttests-mit-I-O-Riot'>https://www.admin-magazin.de/Das-Heft/2018/06/Realistische-Lasttests-mit-I-O-Riot</a><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>Pleace notice that some of the screenshots show the command "ioreplay" instead of "ioriot". That's because the name has changed after taking those.</span><br /> -<br /> -<h1 style='display: inline'>The article</h1><br /> -<br /> -<span>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. </span><br /> -<br /> -<span>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.</span><br /> -<br /> -<h2 style='display: inline'>Background: Existing Techniques</h2><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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.</span><br /> -<br /> -<h2 style='display: inline'>Benchmarking the Email Cloud at Mimecast</h2><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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.</span><br /> -<br /> -<h2 style='display: inline'>Using I/O Riot</h2><br /> -<br /> -<span>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.</span><br /> -<br /> -<h3 style='display: inline'>Installation</h3><br /> -<br /> -<span>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:</span><br /> -<br /> -<pre> -% sudo yum update -</pre> -<br /> -<span>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:</span><br /> -<br /> -<pre> -% 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 -</pre> -<br /> -<span>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.</span><br /> -<br /> -<h3 style='display: inline'>Recording of I/O events</h3><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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:</span><br /> -<br /> -<pre> -% sudo ioriot -c io.capture -</pre> -<br /> -<a href='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure1-ioriot-io-recording.png'><img alt='Screenshot I/O recording' title='Screenshot I/O recording' src='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure1-ioriot-io-recording.png' /></a><br /> -<br /> -<span>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.</span><br /> -<br /> -<h3 style='display: inline'>Test preparation</h3><br /> -<br /> -<span>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:</span><br /> -<br /> -<pre> -% sudo ioriot -c io.capture -r io.replay -u $USER -n TESTNAME -</pre> -<br /> -<span>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.</span><br /> -<br /> -<h3 style='display: inline'>Test Initialization</h3><br /> -<br /> -<span>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:</span><br /> -<br /> -<pre> -% sudo ioriot -i io.replay -</pre> -<br /> -<span>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.</span><br /> -<br /> -<a href='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure2-ioriot-test-preparation.png'><img alt='Screenshot test preparation' title='Screenshot test preparation' src='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure2-ioriot-test-preparation.png' /></a><br /> -<br /> -<span>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".</span><br /> -<br /> -<h3 style='display: inline'>Replay</h3><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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.</span><br /> -<br /> -<a href='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure3-ioriot-replay.png'><img alt='Screenshot replaying I/O' title='Screenshot replaying I/O' src='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure3-ioriot-replay.png' /></a><br /> -<br /> -<span>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:</span><br /> -<br /> -<pre> -% 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 -</pre> -<br /> -<span>According to the results, the test could run 940 seconds faster with Deadline Scheduler:</span><br /> -<br /> -<pre> -% 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 -</pre> -<br /> -<span>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.</span><br /> -<br /> -<a href='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure4-ioriot-read-latency.png'><img alt='Graphite visualization of the mean read access times in ms with CFQ and Deadline Scheduler.' title='Graphite visualization of the mean read access times in ms with CFQ and Deadline Scheduler.' src='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure4-ioriot-read-latency.png' /></a><br /> -<br /> -<a href='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure5-ioriot-write-latency.png'><img alt='Graphite visualization of the average write access times in ms with CFQ and Deadline Scheduler.' title='Graphite visualization of the average write access times in ms with CFQ and Deadline Scheduler.' src='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure5-ioriot-write-latency.png' /></a><br /> -<br /> -<span>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.</span><br /> -<br /> -<a href='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure6-iostat.png'><img alt='Output of iostat. The block device sdy seems to be almost fully utilized by 99%.' title='Output of iostat. The block device sdy seems to be almost fully utilized by 99%.' src='./2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure6-iostat.png' /></a><br /> -<br /> -<h2 style='display: inline'>I/O Riot is Open Source</h2><br /> -<br /> -<span>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:</span><br /> -<br /> -<a class='textlink' href='https://github.com/mimecast/ioriot'>https://github.com/mimecast/ioriot</a><br /> -<br /> -<h2 style='display: inline'>Systemtap</h2><br /> -<br /> -<span>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.</span><br /> -<br /> -<span>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.</span><br /> -<br /> -<a class='textlink' href='https://sourceware.org/systemtap/'>https://sourceware.org/systemtap/</a><br /> -<br /> -<h2 style='display: inline'>More refereces</h2><br /> -<br /> -<a class='textlink' href='http://www.iozone.org/'>IOZone</a><br /> -<a class='textlink' href='https://www.coker.com.au/bonnie++/'>Bonnie++</a><br /> -<a class='textlink' href='https://graphiteapp.org'>Graphite</a><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Memory-mapped_I/O'>Memory mapped I/O</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>Object oriented programming with ANSI C</title> - <link href="https://foo.zone/gemfeed/2016-11-20-object-oriented-programming-with-ansi-c.html" /> - <id>https://foo.zone/gemfeed/2016-11-20-object-oriented-programming-with-ansi-c.html</id> - <updated>2016-11-20T22:10:57+00:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>You can do a little of object-oriented programming in the C Programming Language. However, that is, in my humble opinion, limited. It's easier to use a different programming language than C for OOP. But still it's an interesting exercise to try using C for this.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline'>Object oriented programming with ANSI C</h1><br /> -<br /> -<span class='quote'>Published at 2016-11-20T22:10:57+00:00; Updated at 2022-01-29</span><br /> -<br /> -<pre> - ___ ___ ____ ____ - / _ \ / _ \| _ \ / ___| -| | | | | | | |_) |____| | -| |_| | |_| | __/_____| |___ - \___/ \___/|_| \____| - -</pre> -<br /> -<span>You can do a little of object-oriented programming in the C Programming Language. However, that is, in my humble opinion, limited. It's easier to use a different programming language than C for OOP. But still it's an interesting exercise to try using C for this.</span><br /> -<br /> -<h2 style='display: inline'>Function pointers</h2><br /> -<br /> -<span>Let's have a look at the following sample program. All you have to do is to add a function pointer such as "calculate" to the definition of struct "something_s". Later, during the struct initialization, assign a function address to that function pointer:</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="#000080">#include</font></b> <font color="#FF0000"><stdio.h></font> - -<b><font color="#0000FF">typedef</font></b> <b><font color="#0000FF">struct</font></b> <font color="#FF0000">{</font> - <font color="#009900">double</font> <font color="#990000">(*</font>calculate<font color="#990000">)(</font><b><font color="#0000FF">const</font></b> <font color="#009900">double</font><font color="#990000">,</font> <b><font color="#0000FF">const</font></b> <font color="#009900">double</font><font color="#990000">);</font> - <font color="#009900">char</font> <font color="#990000">*</font>name<font color="#990000">;</font> -<font color="#FF0000">}</font> something_s<font color="#990000">;</font> - -<font color="#009900">double</font> <b><font color="#000000">multiplication</font></b><font color="#990000">(</font><b><font color="#0000FF">const</font></b> <font color="#009900">double</font> a<font color="#990000">,</font> <b><font color="#0000FF">const</font></b> <font color="#009900">double</font> b<font color="#990000">)</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">return</font></b> a <font color="#990000">*</font> b<font color="#990000">;</font> -<font color="#FF0000">}</font> - -<font color="#009900">double</font> <b><font color="#000000">division</font></b><font color="#990000">(</font><b><font color="#0000FF">const</font></b> <font color="#009900">double</font> a<font color="#990000">,</font> <b><font color="#0000FF">const</font></b> <font color="#009900">double</font> b<font color="#990000">)</font> <font color="#FF0000">{</font> - <b><font color="#0000FF">return</font></b> a <font color="#990000">/</font> b<font color="#990000">;</font> -<font color="#FF0000">}</font> - -<font color="#009900">int</font> <b><font color="#000000">main</font></b><font color="#990000">(</font><font color="#009900">void</font><font color="#990000">)</font> <font color="#FF0000">{</font> - <font color="#008080">something_s</font> mult <font color="#990000">=</font> <font color="#990000">(</font>something_s<font color="#990000">)</font> <font color="#FF0000">{</font> - <font color="#990000">.</font>calculate <font color="#990000">=</font> multiplication<font color="#990000">,</font> - <font color="#990000">.</font>name <font color="#990000">=</font> <font color="#FF0000">"Multiplication"</font> - <font color="#FF0000">}</font><font color="#990000">;</font> - - <font color="#008080">something_s</font> div <font color="#990000">=</font> <font color="#990000">(</font>something_s<font color="#990000">)</font> <font color="#FF0000">{</font> - <font color="#990000">.</font>calculate <font color="#990000">=</font> division<font color="#990000">,</font> - <font color="#990000">.</font>name <font color="#990000">=</font> <font color="#FF0000">"Division"</font> - <font color="#FF0000">}</font><font color="#990000">;</font> - - <b><font color="#0000FF">const</font></b> <font color="#009900">double</font> a <font color="#990000">=</font> <font color="#993399">3</font><font color="#990000">,</font> b <font color="#990000">=</font> <font color="#993399">2</font><font color="#990000">;</font> - - <b><font color="#000000">printf</font></b><font color="#990000">(</font><font color="#FF0000">"%s(%f, %f) => %f</font><font color="#CC33CC">\n</font><font color="#FF0000">"</font><font color="#990000">,</font> mult<font color="#990000">.</font>name<font color="#990000">,</font> a<font color="#990000">,</font> b<font color="#990000">,</font> mult<font color="#990000">.</font><b><font color="#000000">calculate</font></b><font color="#990000">(</font>a<font color="#990000">,</font>b<font color="#990000">));</font> - <b><font color="#000000">printf</font></b><font color="#990000">(</font><font color="#FF0000">"%s(%f, %f) => %f</font><font color="#CC33CC">\n</font><font color="#FF0000">"</font><font color="#990000">,</font> div<font color="#990000">.</font>name<font color="#990000">,</font> a<font color="#990000">,</font> b<font color="#990000">,</font> div<font color="#990000">.</font><b><font color="#000000">calculate</font></b><font color="#990000">(</font>a<font color="#990000">,</font>b<font color="#990000">));</font> -<font color="#FF0000">}</font> -</pre> -<br /> -<span>As you can see, you can call the function (pointed by the function pointer) with the same syntax as in C++ or Java:</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="#000000">printf</font></b><font color="#990000">(</font><font color="#FF0000">"%s(%f, %f) => %f</font><font color="#CC33CC">\n</font><font color="#FF0000">"</font><font color="#990000">,</font> mult<font color="#990000">.</font>name<font color="#990000">,</font> a<font color="#990000">,</font> b<font color="#990000">,</font> mult<font color="#990000">.</font><b><font color="#000000">calculate</font></b><font color="#990000">(</font>a<font color="#990000">,</font>b<font color="#990000">));</font> -<b><font color="#000000">printf</font></b><font color="#990000">(</font><font color="#FF0000">"%s(%f, %f) => %f</font><font color="#CC33CC">\n</font><font color="#FF0000">"</font><font color="#990000">,</font> div<font color="#990000">.</font>name<font color="#990000">,</font> a<font color="#990000">,</font> b<font color="#990000">,</font> div<font color="#990000">.</font><b><font color="#000000">calculate</font></b><font color="#990000">(</font>a<font color="#990000">,</font>b<font color="#990000">));</font> -</pre> -<br /> -<span>However, that's just syntactic sugar for:</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="#000000">printf</font></b><font color="#990000">(</font><font color="#FF0000">"%s(%f, %f) => %f</font><font color="#CC33CC">\n</font><font color="#FF0000">"</font><font color="#990000">,</font> mult<font color="#990000">.</font>name<font color="#990000">,</font> a<font color="#990000">,</font> b<font color="#990000">,</font> <font color="#990000">(*</font>mult<font color="#990000">.</font>calculate<font color="#990000">)(</font>a<font color="#990000">,</font>b<font color="#990000">));</font> -<b><font color="#000000">printf</font></b><font color="#990000">(</font><font color="#FF0000">"%s(%f, %f) => %f</font><font color="#CC33CC">\n</font><font color="#FF0000">"</font><font color="#990000">,</font> div<font color="#990000">.</font>name<font color="#990000">,</font> a<font color="#990000">,</font> b<font color="#990000">,</font> <font color="#990000">(*</font>div<font color="#990000">.</font>calculate<font color="#990000">)(</font>a<font color="#990000">,</font>b<font color="#990000">));</font> -</pre> -<br /> -<span>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>pbuetow <font color="#990000">~</font>/git/blog/source <font color="#990000">[</font><font color="#993399">38268</font><font color="#990000">]%</font> gcc oop-c-example<font color="#990000">.</font>c -o oop-c-example -pbuetow <font color="#990000">~</font>/git/blog/source <font color="#990000">[</font><font color="#993399">38269</font><font color="#990000">]%</font> <font color="#990000">.</font>/oop-c-example -Multiplication<font color="#990000">(</font><font color="#993399">3.000000</font><font color="#990000">,</font> <font color="#993399">2.000000</font><font color="#990000">)</font> <font color="#990000">=></font> <font color="#993399">6.000000</font> -Division<font color="#990000">(</font><font color="#993399">3.000000</font><font color="#990000">,</font> <font color="#993399">2.000000</font><font color="#990000">)</font> <font color="#990000">=></font> <font color="#993399">1.500000</font> -</pre> -<br /> -<span>Not complicated at all, but nice to know and helps to make the code easier to read!</span><br /> -<br /> -<h2 style='display: inline'>That's not OOP, though</h2><br /> -<br /> -<span>However, that's not really how it works in object-oriented languages such as Java and C++. The method call in this example is not a method call as "mult" and "div" in this example are not "message receivers". I mean that the functions can not access the state of the "mult" and "div" struct objects. In C, you would need to do something like this instead if you wanted to access the state of "mult" from within the calculate function, you would have to pass it as an argument:</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>mult<font color="#990000">.</font><b><font color="#000000">calculate</font></b><font color="#990000">(</font>mult<font color="#990000">,</font>a<font color="#990000">,</font>b<font color="#990000">));</font> -</pre> -<br /> -<h2 style='display: inline'>Real object oriented programming with C</h2><br /> -<br /> -<span>If you want to take it further, hit "Object-Oriented Programming with ANSI-C" into your favourite internet search engine or follow the link below. It goes as far as writing a C preprocessor in AWK, which takes some object-oriented pseudo-C and transforms it to plain C so that the C compiler can compile it to machine code. This is similar to how the C++ language had its origins.</span><br /> -<br /> -<a class='textlink' href='https://www.cs.rit.edu/~ats/books/ooc.pdf'>https://www.cs.rit.edu/~ats/books/ooc.pdf</a><br /> -<br /> -<h2 style='display: inline'>OOP design patterns in the Linux Kernel</h2><br /> -<br /> -<span>Big C software projects, like Linux, also follow some OOP techniques:</span><br /> -<br /> -<a class='textlink' href='https://lwn.net/Articles/444910/'>https://lwn.net/Articles/444910/</a><br /> -<br /> -<span>C is a very old programming language with it's quirks. This might be one of the reasons why Linux will also let Rust code in.</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> </feed> diff --git a/gemfeed/bash-golf-part-3/bash-fork-bomb.jpg b/gemfeed/bash-golf-part-3/bash-fork-bomb.jpg Binary files differnew file mode 100644 index 00000000..6967c03a --- /dev/null +++ b/gemfeed/bash-golf-part-3/bash-fork-bomb.jpg diff --git a/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program/dgrep.gif b/gemfeed/dtail-the-distributed-log-tail-program/dgrep.gif Binary files differindex e2f2ac64..e2f2ac64 100644 --- a/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program/dgrep.gif +++ b/gemfeed/dtail-the-distributed-log-tail-program/dgrep.gif diff --git a/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program/dtail.gif b/gemfeed/dtail-the-distributed-log-tail-program/dtail.gif Binary files differindex 8f6b56bf..8f6b56bf 100644 --- a/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program/dtail.gif +++ b/gemfeed/dtail-the-distributed-log-tail-program/dtail.gif diff --git a/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program/title.png b/gemfeed/dtail-the-distributed-log-tail-program/title.png Binary files differindex 4e343c4f..4e343c4f 100644 --- a/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program/title.png +++ b/gemfeed/dtail-the-distributed-log-tail-program/title.png 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/from-.org-to-.cloud/old-man-yells-at-cloud.jpg b/gemfeed/from-.org-to-.cloud/old-man-yells-at-cloud.jpg Binary files differnew file mode 100644 index 00000000..da1170f8 --- /dev/null +++ b/gemfeed/from-.org-to-.cloud/old-man-yells-at-cloud.jpg diff --git a/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all/blog-engine.jpg b/gemfeed/gemtexter-one-bash-script-to-rule-it-all/blog-engine.jpg Binary files differindex 844bc9fc..844bc9fc 100644 --- a/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all/blog-engine.jpg +++ b/gemfeed/gemtexter-one-bash-script-to-rule-it-all/blog-engine.jpg diff --git a/gemfeed/index.html b/gemfeed/index.html index f5c3bcbd..e997f0c7 100644 --- a/gemfeed/index.html +++ b/gemfeed/index.html @@ -8,22 +8,46 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Gemfeed of foo.zone</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/gemfeed/index.md">Markdown</a> | <a href="gemini://foo.zone/gemfeed/index.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='gemfeed-of-foozone'>Gemfeed of foo.zone</h1><br /> <br /> -<h2 style='display: inline'>To be in the .zone!</h2><br /> +<h2 style='display: inline' id='to-be-in-the-zone'>To be in the .zone!</h2><br /> <br /> +<a class='textlink' href='./2025-02-08-random-weird-things-ii.html'>2025-02-08 - Random Weird Things - Part Ⅱ</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='./2025-01-15-working-with-an-sre-interview.html'>2025-01-15 - Working with an SRE Interview</a><br /> +<a class='textlink' href='./2025-01-01-posts-from-october-to-december-2024.html'>2025-01-01 - Posts from October to December 2024</a><br /> +<a class='textlink' href='./2024-12-15-random-helix-themes.html'>2024-12-15 - Random Helix Themes</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-10-24-staff-engineer-book-notes.html'>2024-10-24 - 'Staff Engineer' book notes</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='./2024-09-07-site-reliability-engineering-part-4.html'>2024-09-07 - Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers</a><br /> +<a class='textlink' href='./2024-09-07-projects-i-support.html'>2024-09-07 - Projects I financially support</a><br /> +<a class='textlink' href='./2024-08-05-typing-127.1-words-per-minute.html'>2024-08-05 - Typing <span class='inlinecode'>127.1</span> words per minute (<span class='inlinecode'>>100wpm average</span>)</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-07-05-random-weird-things.html'>2024-07-05 - Random Weird Things - Part Ⅰ</a><br /> +<a class='textlink' href='./2024-06-23-terminal-multiplexing-with-tmux.html'>2024-06-23 - Terminal multiplexing with <span class='inlinecode'>tmux</span></a><br /> +<a class='textlink' href='./2024-05-03-projects-i-currently-dont-have-time-for.html'>2024-05-03 - Projects I currently don't have time for</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-04-01-KISS-high-availability-with-OpenBSD.html'>2024-04-01 - KISS high-availability with OpenBSD</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</a><br /> +<a class='textlink' href='./2024-02-04-from-babylon5.buetow.org-to-.cloud.html'>2024-02-04 - From <span class='inlinecode'>babylon5.buetow.org</span> to <span class='inlinecode'>*.buetow.cloud</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='./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='./2023-12-10-bash-golf-part-3.html'>2023-12-10 - Bash Golf Part 3</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='./2023-11-11-mind-management-book-notes.html'>2023-11-11 - 'Mind Management' book notes</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-09-25-dtail-usage-examples.html'>2023-09-25 - DTail usage examples</a><br /> -<a class='textlink' href='./2023-08-20-site-reliability-engineering-part-3.html'>2023-08-20 - Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect</a><br /> -<a class='textlink' href='./2023-08-19-site-reliability-engineering-part-2.html'>2023-08-19 - Site Reliability Engineering - Part 2: Operational Balance in SRE</a><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-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-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-06-01-kiss-server-monitoring-with-gogios.html'>2023-06-01 - KISS server monitoring with Gogios</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-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 /> -<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='./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-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-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 - 'The Pragmatic Programmer' book notes</a><br /> @@ -64,12 +88,13 @@ <a class='textlink' href='./2010-05-09-the-fype-programming-language.html'>2010-05-09 - The Fype Programming Language</a><br /> <a class='textlink' href='./2010-05-07-lazy-evaluation-with-standarn-ml.html'>2010-05-07 - Lazy Evaluation with Standard ML</a><br /> <a class='textlink' href='./2010-04-09-standard-ml-and-haskell.html'>2010-04-09 - Standard ML and Haskell</a><br /> +<a class='textlink' href='./2009-02-13-sgi-onyx-3200.html'>2009-02-13 - SGI Onyx 3200</a><br /> <a class='textlink' href='./2008-12-29-using-my-nokia-n95-for-fixing-my-mta.html'>2008-12-29 - Using my Nokia N95 for fixing my MTA</a><br /> <a class='textlink' href='./2008-06-26-perl-poetry.html'>2008-06-26 - Perl Poetry</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/gemfeed/2023-06-01-kiss-server-monitoring-with-gogios/gogios-small.png b/gemfeed/kiss-server-monitoring-with-gogios/gogios-small.png Binary files differindex aebe695c..aebe695c 100644 --- a/gemfeed/2023-06-01-kiss-server-monitoring-with-gogios/gogios-small.png +++ b/gemfeed/kiss-server-monitoring-with-gogios/gogios-small.png diff --git a/gemfeed/2022-05-27-perl-is-still-a-great-choice/googletrendsperl.jpg b/gemfeed/perl-is-still-a-great-choice/googletrendsperl.jpg Binary files differindex 397c9f29..397c9f29 100644 --- a/gemfeed/2022-05-27-perl-is-still-a-great-choice/googletrendsperl.jpg +++ b/gemfeed/perl-is-still-a-great-choice/googletrendsperl.jpg diff --git a/gemfeed/2022-05-27-perl-is-still-a-great-choice/regular_expressions.png b/gemfeed/perl-is-still-a-great-choice/regular_expressions.png Binary files differindex acbc2437..acbc2437 100644 --- a/gemfeed/2022-05-27-perl-is-still-a-great-choice/regular_expressions.png +++ b/gemfeed/perl-is-still-a-great-choice/regular_expressions.png 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/2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure1-ioriot-io-recording.png b/gemfeed/realistic-load-testing-with-ioriot-for-linux/figure1-ioriot-io-recording.png Binary files differindex 43ac852f..43ac852f 100644 --- a/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure1-ioriot-io-recording.png +++ b/gemfeed/realistic-load-testing-with-ioriot-for-linux/figure1-ioriot-io-recording.png diff --git a/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure2-ioriot-test-preparation.png b/gemfeed/realistic-load-testing-with-ioriot-for-linux/figure2-ioriot-test-preparation.png Binary files differindex 709d7490..709d7490 100644 --- a/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure2-ioriot-test-preparation.png +++ b/gemfeed/realistic-load-testing-with-ioriot-for-linux/figure2-ioriot-test-preparation.png diff --git a/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure3-ioriot-replay.png b/gemfeed/realistic-load-testing-with-ioriot-for-linux/figure3-ioriot-replay.png Binary files differindex 3bd66b6f..3bd66b6f 100644 --- a/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure3-ioriot-replay.png +++ b/gemfeed/realistic-load-testing-with-ioriot-for-linux/figure3-ioriot-replay.png diff --git a/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure4-ioriot-read-latency.png b/gemfeed/realistic-load-testing-with-ioriot-for-linux/figure4-ioriot-read-latency.png Binary files differindex 160b2305..160b2305 100644 --- a/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure4-ioriot-read-latency.png +++ b/gemfeed/realistic-load-testing-with-ioriot-for-linux/figure4-ioriot-read-latency.png diff --git a/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure5-ioriot-write-latency.png b/gemfeed/realistic-load-testing-with-ioriot-for-linux/figure5-ioriot-write-latency.png Binary files differindex e30efdbb..e30efdbb 100644 --- a/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure5-ioriot-write-latency.png +++ b/gemfeed/realistic-load-testing-with-ioriot-for-linux/figure5-ioriot-write-latency.png diff --git a/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure6-iostat.png b/gemfeed/realistic-load-testing-with-ioriot-for-linux/figure6-iostat.png Binary files differindex 0d3fc0d8..0d3fc0d8 100644 --- a/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux/figure6-iostat.png +++ b/gemfeed/realistic-load-testing-with-ioriot-for-linux/figure6-iostat.png diff --git a/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid/Deboroid.png b/gemfeed/run-debian-on-your-phone-with-debroid/Deboroid.png Binary files differindex f76cf226..f76cf226 100644 --- a/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid/Deboroid.png +++ b/gemfeed/run-debian-on-your-phone-with-debroid/Deboroid.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 diff --git a/gemfeed/2022-06-15-sweating-the-small-stuff/jsmstrade.png b/gemfeed/sweating-the-small-stuff/jsmstrade.png Binary files differindex ce5276f8..ce5276f8 100644 --- a/gemfeed/2022-06-15-sweating-the-small-stuff/jsmstrade.png +++ b/gemfeed/sweating-the-small-stuff/jsmstrade.png diff --git a/gemfeed/2022-06-15-sweating-the-small-stuff/ninja.jpg b/gemfeed/sweating-the-small-stuff/ninja.jpg Binary files differindex 8a036323..8a036323 100644 --- a/gemfeed/2022-06-15-sweating-the-small-stuff/ninja.jpg +++ b/gemfeed/sweating-the-small-stuff/ninja.jpg diff --git a/gemfeed/terminal-multiplexing-with-tmux/tmux-session-fzf.png b/gemfeed/terminal-multiplexing-with-tmux/tmux-session-fzf.png Binary files differnew file mode 100644 index 00000000..7a2e9440 --- /dev/null +++ b/gemfeed/terminal-multiplexing-with-tmux/tmux-session-fzf.png diff --git a/gemfeed/terminal-multiplexing-with-tmux/tmux-tree-view.png b/gemfeed/terminal-multiplexing-with-tmux/tmux-tree-view.png Binary files differnew file mode 100644 index 00000000..672859c5 --- /dev/null +++ b/gemfeed/terminal-multiplexing-with-tmux/tmux-tree-view.png diff --git a/gemfeed/2021-07-04-the-well-grounded-rubyist/book-backside.jpg b/gemfeed/the-well-grounded-rubyist/book-backside.jpg Binary files differindex 2190e679..2190e679 100644 --- a/gemfeed/2021-07-04-the-well-grounded-rubyist/book-backside.jpg +++ b/gemfeed/the-well-grounded-rubyist/book-backside.jpg diff --git a/gemfeed/2021-07-04-the-well-grounded-rubyist/book-cover.jpg b/gemfeed/the-well-grounded-rubyist/book-cover.jpg Binary files differindex b5a00063..b5a00063 100644 --- a/gemfeed/2021-07-04-the-well-grounded-rubyist/book-cover.jpg +++ b/gemfeed/the-well-grounded-rubyist/book-cover.jpg diff --git a/gemfeed/typing-127.1-words-per-minute/all-time-stats.png b/gemfeed/typing-127.1-words-per-minute/all-time-stats.png Binary files differnew file mode 100644 index 00000000..4d8a5a8f --- /dev/null +++ b/gemfeed/typing-127.1-words-per-minute/all-time-stats.png diff --git a/gemfeed/typing-127.1-words-per-minute/glove80.jpg b/gemfeed/typing-127.1-words-per-minute/glove80.jpg Binary files differnew file mode 100644 index 00000000..80b9c4fb --- /dev/null +++ b/gemfeed/typing-127.1-words-per-minute/glove80.jpg diff --git a/gemfeed/typing-127.1-words-per-minute/kinesis1.jpg b/gemfeed/typing-127.1-words-per-minute/kinesis1.jpg Binary files differnew file mode 100644 index 00000000..1edffb84 --- /dev/null +++ b/gemfeed/typing-127.1-words-per-minute/kinesis1.jpg diff --git a/gemfeed/typing-127.1-words-per-minute/kinesis2.jpg b/gemfeed/typing-127.1-words-per-minute/kinesis2.jpg Binary files differnew file mode 100644 index 00000000..d6ae665d --- /dev/null +++ b/gemfeed/typing-127.1-words-per-minute/kinesis2.jpg diff --git a/gemfeed/typing-127.1-words-per-minute/typing-speed-over-lessons.png b/gemfeed/typing-127.1-words-per-minute/typing-speed-over-lessons.png Binary files differnew file mode 100644 index 00000000..f9f85417 --- /dev/null +++ b/gemfeed/typing-127.1-words-per-minute/typing-speed-over-lessons.png diff --git a/gemfeed/2022-12-24-ultrarelearning-java-my-takeaways/effective-java.jpg b/gemfeed/ultrarelearning-java-my-takeaways/effective-java.jpg Binary files differindex 213c6e03..213c6e03 100644 --- a/gemfeed/2022-12-24-ultrarelearning-java-my-takeaways/effective-java.jpg +++ b/gemfeed/ultrarelearning-java-my-takeaways/effective-java.jpg diff --git a/gemfeed/2022-12-24-ultrarelearning-java-my-takeaways/learnjava.jpg b/gemfeed/ultrarelearning-java-my-takeaways/learnjava.jpg Binary files differindex 4c3b9e7b..4c3b9e7b 100644 --- a/gemfeed/2022-12-24-ultrarelearning-java-my-takeaways/learnjava.jpg +++ b/gemfeed/ultrarelearning-java-my-takeaways/learnjava.jpg diff --git a/gemfeed/2008-12-29-using-my-nokia-n95-for-fixing-my-mta/nokia-n95.jpg b/gemfeed/using-my-nokia-n95-for-fixing-my-mta/nokia-n95.jpg Binary files differindex 6a11be8b..6a11be8b 100644 --- a/gemfeed/2008-12-29-using-my-nokia-n95-for-fixing-my-mta/nokia-n95.jpg +++ b/gemfeed/using-my-nokia-n95-for-fixing-my-mta/nokia-n95.jpg diff --git a/gemfeed/2021-04-24-welcome-to-the-geminispace/amfora-screenshot.png b/gemfeed/welcome-to-the-geminispace/amfora-screenshot.png Binary files differindex 093aec79..093aec79 100644 --- a/gemfeed/2021-04-24-welcome-to-the-geminispace/amfora-screenshot.png +++ b/gemfeed/welcome-to-the-geminispace/amfora-screenshot.png diff --git a/gemfeed/2021-04-24-welcome-to-the-geminispace/lagrange-screenshot.png b/gemfeed/welcome-to-the-geminispace/lagrange-screenshot.png Binary files differindex 478d2fdd..478d2fdd 100644 --- a/gemfeed/2021-04-24-welcome-to-the-geminispace/lagrange-screenshot.png +++ b/gemfeed/welcome-to-the-geminispace/lagrange-screenshot.png diff --git a/heading.ttf b/heading.ttf Binary files differnew file mode 100644 index 00000000..3e10e02f --- /dev/null +++ b/heading.ttf @@ -8,9 +8,14 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>foo.zone</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/index.md">Markdown</a> | <a href="gemini://foo.zone/index.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='foozone'>foo.zone</h1><br /> +<br /> +<span class='quote'>This site was generated at 2025-02-21T11:07:02+02:00 by <span class='inlinecode'>Gemtexter</span></span><br /> <br /> -<span class='quote'>This site was generated at 2023-11-11T22:22:24+02:00 by <span class='inlinecode'>Gemtexter</span></span><br /> +<span>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.</span><br /> <br /> <pre> |\---/| @@ -21,40 +26,54 @@ (_,...'(_,.`__)/'.....+ </pre> <br /> -<h2 style='display: inline'>Introduction</h2><br /> -<br /> -<span>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.</span><br /> +<h2 style='display: inline' id='some-links'>Some links</h2><br /> <br /> -<a class='textlink' href='https://justforfunnoreally.dev/'>All I post here on <span class='inlinecode'>foo.zone</span> is really only just for fun!</a><br /> -<a class='textlink' href='https://paul.buetow.org'>My contact information and resources (via HTTP)</a><br /> -<a class='textlink' href='gemini://paul.buetow.org'>My contact information and resources (via Gemini)</a><br /> +<a class='textlink' href='./about/index.html'>About me</a><br /> <a class='textlink' href='./uptime-stats.html'>My machine uptime statistics</a><br /> -<br /> -<span>If you reach this site via the modern web, please read this:</span><br /> -<br /> <a class='textlink' href='./gemfeed/2021-04-24-welcome-to-the-geminispace.html'>Welcome to the Geminispace</a><br /> <br /> -<h2 style='display: inline'>Personal blog</h2><br /> +<h2 style='display: inline' id='blog'>Blog</h2><br /> <br /> -<h3 style='display: inline'>Stay updated</h3><br /> +<h3 style='display: inline' id='atom-and-gemfeeds'>Atom and Gemfeeds</h3><br /> <br /> <a class='textlink' href='./gemfeed/atom.xml'>Subscribe to this blog's Atom feed</a><br /> <a class='textlink' href='./gemfeed/index.html'>Subscribe to this blog's Gemfeed</a><br /> <br /> -<h3 style='display: inline'>Posts</h3><br /> +<h3 style='display: inline' id='posts'>Posts</h3><br /> <br /> +<a class='textlink' href='./gemfeed/2025-02-08-random-weird-things-ii.html'>2025-02-08 - Random Weird Things - Part Ⅱ</a><br /> +<a class='textlink' href='./gemfeed/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='./gemfeed/2025-01-15-working-with-an-sre-interview.html'>2025-01-15 - Working with an SRE Interview</a><br /> +<a class='textlink' href='./gemfeed/2025-01-01-posts-from-october-to-december-2024.html'>2025-01-01 - Posts from October to December 2024</a><br /> +<a class='textlink' href='./gemfeed/2024-12-15-random-helix-themes.html'>2024-12-15 - Random Helix Themes</a><br /> +<a class='textlink' href='./gemfeed/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='./gemfeed/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='./gemfeed/2024-10-24-staff-engineer-book-notes.html'>2024-10-24 - 'Staff Engineer' book notes</a><br /> +<a class='textlink' href='./gemfeed/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='./gemfeed/2024-09-07-site-reliability-engineering-part-4.html'>2024-09-07 - Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers</a><br /> +<a class='textlink' href='./gemfeed/2024-09-07-projects-i-support.html'>2024-09-07 - Projects I financially support</a><br /> +<a class='textlink' href='./gemfeed/2024-08-05-typing-127.1-words-per-minute.html'>2024-08-05 - Typing <span class='inlinecode'>127.1</span> words per minute (<span class='inlinecode'>>100wpm average</span>)</a><br /> +<a class='textlink' href='./gemfeed/2024-07-07-the-stoic-challenge-book-notes.html'>2024-07-07 - 'The Stoic Challenge' book notes</a><br /> +<a class='textlink' href='./gemfeed/2024-07-05-random-weird-things.html'>2024-07-05 - Random Weird Things - Part Ⅰ</a><br /> +<a class='textlink' href='./gemfeed/2024-06-23-terminal-multiplexing-with-tmux.html'>2024-06-23 - Terminal multiplexing with <span class='inlinecode'>tmux</span></a><br /> +<a class='textlink' href='./gemfeed/2024-05-03-projects-i-currently-dont-have-time-for.html'>2024-05-03 - Projects I currently don't have time for</a><br /> +<a class='textlink' href='./gemfeed/2024-05-01-slow-productivity-book-notes.html'>2024-05-01 - 'Slow Productivity' book notes</a><br /> +<a class='textlink' href='./gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.html'>2024-04-01 - KISS high-availability with OpenBSD</a><br /> +<a class='textlink' href='./gemfeed/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</a><br /> +<a class='textlink' href='./gemfeed/2024-02-04-from-babylon5.buetow.org-to-.cloud.html'>2024-02-04 - From <span class='inlinecode'>babylon5.buetow.org</span> to <span class='inlinecode'>*.buetow.cloud</span></a><br /> +<a class='textlink' href='./gemfeed/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='./gemfeed/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='./gemfeed/2023-12-10-bash-golf-part-3.html'>2023-12-10 - Bash Golf Part 3</a><br /> +<a class='textlink' href='./gemfeed/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='./gemfeed/2023-11-11-mind-management-book-notes.html'>2023-11-11 - 'Mind Management' book notes</a><br /> <a class='textlink' href='./gemfeed/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='./gemfeed/2023-09-25-dtail-usage-examples.html'>2023-09-25 - DTail usage examples</a><br /> -<a class='textlink' href='./gemfeed/2023-08-20-site-reliability-engineering-part-3.html'>2023-08-20 - Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect</a><br /> -<a class='textlink' href='./gemfeed/2023-08-19-site-reliability-engineering-part-2.html'>2023-08-19 - Site Reliability Engineering - Part 2: Operational Balance in SRE</a><br /> <a class='textlink' href='./gemfeed/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='./gemfeed/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='./gemfeed/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='./gemfeed/2023-06-01-kiss-server-monitoring-with-gogios.html'>2023-06-01 - KISS server monitoring with Gogios</a><br /> <a class='textlink' href='./gemfeed/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='./gemfeed/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 /> -<a class='textlink' href='./gemfeed/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='./gemfeed/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='./gemfeed/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='./gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 - 'The Pragmatic Programmer' book notes</a><br /> @@ -95,12 +114,13 @@ <a class='textlink' href='./gemfeed/2010-05-09-the-fype-programming-language.html'>2010-05-09 - The Fype Programming Language</a><br /> <a class='textlink' href='./gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.html'>2010-05-07 - Lazy Evaluation with Standard ML</a><br /> <a class='textlink' href='./gemfeed/2010-04-09-standard-ml-and-haskell.html'>2010-04-09 - Standard ML and Haskell</a><br /> +<a class='textlink' href='./gemfeed/2009-02-13-sgi-onyx-3200.html'>2009-02-13 - SGI Onyx 3200</a><br /> <a class='textlink' href='./gemfeed/2008-12-29-using-my-nokia-n95-for-fixing-my-mta.html'>2008-12-29 - Using my Nokia N95 for fixing my MTA</a><br /> <a class='textlink' href='./gemfeed/2008-06-26-perl-poetry.html'>2008-06-26 - Perl Poetry</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/notes/a-monks-guide-to-happiness.html b/notes/a-monks-guide-to-happiness.html index 320595e5..937d6f0a 100644 --- a/notes/a-monks-guide-to-happiness.html +++ b/notes/a-monks-guide-to-happiness.html @@ -8,11 +8,26 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>"A Monk's Guide to Happiness" book notes</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/notes/a-monks-guide-to-happiness.md">Markdown</a> | <a href="gemini://foo.zone/notes/a-monks-guide-to-happiness.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='a-monk-s-guide-to-happiness-book-notes'>"A Monk's Guide to Happiness" book notes</h1><br /> <br /> <span class='quote'>Last updated 21.5.2023</span><br /> <br /> -<h2 style='display: inline'>Understanding Happiness</h2><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#a-monk-s-guide-to-happiness-book-notes'>"A Monk's Guide to Happiness" book notes</a></li> +<li>⇢ <a href='#understanding-happiness'>Understanding Happiness</a></li> +<li>⇢ <a href='#the-role-of-meditation'>The Role of Meditation</a></li> +<li>⇢ <a href='#managing-thoughts-and-emotions'>Managing Thoughts and Emotions</a></li> +<li>⇢ <a href='#practice-and-discipline'>Practice and Discipline</a></li> +<li>⇢ <a href='#perspectives-on-relationships-and-interactions'>Perspectives on Relationships and Interactions</a></li> +<li>⇢ <a href='#reflective-questions'>Reflective Questions</a></li> +<li>⇢ <a href='#miscellaneous-guidelines'>Miscellaneous Guidelines</a></li> +</ul><br /> +<h2 style='display: inline' id='understanding-happiness'>Understanding Happiness</h2><br /> <br /> <ul> <li>Happiness is a skill we can train. </li> @@ -20,7 +35,7 @@ <li>Feel free now. No urge about past and future. </li> <li>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. </li> </ul><br /> -<h2 style='display: inline'>The Role of Meditation</h2><br /> +<h2 style='display: inline' id='the-role-of-meditation'>The Role of Meditation</h2><br /> <br /> <ul> <li>Meditation is not about clearing your mind. A busy mind has nothing to do with interfering with your meditation.</li> @@ -30,7 +45,7 @@ <li>Have a baseline for time to build up discipline.</li> <li>We don't need to do anything about stress, just take a step back.</li> </ul><br /> -<h2 style='display: inline'>Managing Thoughts and Emotions</h2><br /> +<h2 style='display: inline' id='managing-thoughts-and-emotions'>Managing Thoughts and Emotions</h2><br /> <br /> <ul> <li>Our flow of emotions is really just habits. That can be changed through training, e.g., meditation training.</li> @@ -39,7 +54,7 @@ <li>Thoughts are friends and not enemies. </li> <li>Thoughts help the meditation as they make us notice that we wandered off, and therefore, we strengthen the reflection.</li> </ul><br /> -<h2 style='display: inline'>Practice and Discipline</h2><br /> +<h2 style='display: inline' id='practice-and-discipline'>Practice and Discipline</h2><br /> <br /> <ul> <li>The importance of habits to practice mindfulness. Bring mindfulness into the daily practice.</li> @@ -49,7 +64,7 @@ <li>Practice staying fully present in an uncomfortable situation and without judgement.</li> <li>Don't become two persons who never meet: the meditator and the not meditator. So integrate mindfulness during the day too.</li> </ul><br /> -<h2 style='display: inline'>Perspectives on Relationships and Interactions</h2><br /> +<h2 style='display: inline' id='perspectives-on-relationships-and-interactions'>Perspectives on Relationships and Interactions</h2><br /> <br /> <ul> <li>Who is the opponent? The other person. The things he said or our reactions to things? Forgiveness is a high form of compassion.</li> @@ -58,7 +73,7 @@ <li>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.</li> <li>Be grateful for people "trying" to hurt you as they help you to practice your path.</li> </ul><br /> -<h2 style='display: inline'>Reflective Questions</h2><br /> +<h2 style='display: inline' id='reflective-questions'>Reflective Questions</h2><br /> <br /> <ul> <li> Why do I do all the things I do? What do I try to achieve?</li> @@ -67,7 +82,7 @@ <li> What are the real causes of happiness and suffering?</li> <li> What about meditation? How does that address the situation?</li> </ul><br /> -<h2 style='display: inline'>Miscellaneous Guidelines</h2><br /> +<h2 style='display: inline' id='miscellaneous-guidelines'>Miscellaneous Guidelines</h2><br /> <br /> <ul> <li> Posture is important as the mind and body are connected.</li> @@ -83,9 +98,9 @@ <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/notes/career-guide-and-soft-skills.html b/notes/career-guide-and-soft-skills.html index f472778d..4c6f6335 100644 --- a/notes/career-guide-and-soft-skills.html +++ b/notes/career-guide-and-soft-skills.html @@ -8,7 +8,10 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>"Software Developmers Career Guide and Soft Skills" book notes</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/notes/career-guide-and-soft-skills.md">Markdown</a> | <a href="gemini://foo.zone/notes/career-guide-and-soft-skills.gmi">Gemini</a> +</p> +<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 /> @@ -26,9 +29,42 @@ ''' </pre> <br /> -<h1 style='display: inline'>Improve</h1><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<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 /> -<h2 style='display: inline'>Always learn new things</h2><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 /> @@ -46,11 +82,11 @@ <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'>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'>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 /> @@ -58,7 +94,7 @@ <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'>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 /> @@ -71,7 +107,7 @@ <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'>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 /> @@ -86,7 +122,7 @@ <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'>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 /> @@ -97,7 +133,7 @@ </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'>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 /> @@ -107,7 +143,7 @@ </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'>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 /> @@ -116,7 +152,7 @@ <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'>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 /> @@ -125,7 +161,7 @@ <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'>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 /> @@ -135,7 +171,7 @@ <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'>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 /> @@ -147,7 +183,7 @@ </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'>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> @@ -158,7 +194,7 @@ <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'>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 /> @@ -170,7 +206,7 @@ </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'>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 /> @@ -186,13 +222,13 @@ </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'>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'>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> @@ -205,11 +241,11 @@ <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'>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'>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 /> @@ -219,9 +255,9 @@ </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'>New job</h1><br /> +<h1 style='display: inline' id='new-job'>New job</h1><br /> <br /> -<h2 style='display: inline'>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> @@ -230,7 +266,7 @@ </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'>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 /> @@ -242,7 +278,7 @@ </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'>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 /> @@ -255,7 +291,7 @@ </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'>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> @@ -273,21 +309,21 @@ <ul> <li>Never spilt the difference is the best book for learning negotiation techniques..</li> </ul><br /> -<h2 style='display: inline'>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'>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'>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'>Books to read</h2><br /> +<h2 style='display: inline' id='books-to-read'>Books to read</h2><br /> <br /> <ul> <li>Clean Code</li> @@ -306,22 +342,24 @@ <li>The war of Art (to combat procrastination)</li> <li>Willpower Instinct</li> </ul><br /> -<span>Other book notes of mine are:</span><br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</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 /> +<span>Other book notes of mine are:</span><br /> <br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<a class='textlink' href='./staff-engineer.html'>2024-10-24 "Staff Engineer" book notes</a><br /> +<a class='textlink' href='./the-stoic-challenge.html'>2024-07-07 "The Stoic Challenge" book notes</a><br /> +<a class='textlink' href='./slow-productivity.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./mind-management.html'>2023-11-11 "Mind Management" book notes</a><br /> +<a class='textlink' href='./career-guide-and-soft-skills.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./the-obstacle-is-the-way.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> +<a class='textlink' href='./never-split-the-difference.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./the-pragmatic-programmer.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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/notes/eat-that-frog.html b/notes/eat-that-frog.html new file mode 100644 index 00000000..399a5988 --- /dev/null +++ b/notes/eat-that-frog.html @@ -0,0 +1,127 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>'Eat That Frog' book notes</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/notes/eat-that-frog.md">Markdown</a> | <a href="gemini://foo.zone/notes/eat-that-frog.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='eat-that-frog-book-notes'>"Eat That Frog" book notes</h1><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#eat-that-frog-book-notes'>"Eat That Frog" book notes</a></li> +<li>⇢ <a href='#time-and-task-management'>Time and Task Management</a></li> +<li>⇢ <a href='#prioritizing-tasks'>Prioritizing Tasks</a></li> +<li>⇢ <a href='#goal-setting-and-planning'>Goal Setting and Planning</a></li> +<li>⇢ <a href='#efficiency-and-procrastination'>Efficiency and Procrastination</a></li> +<li>⇢ <a href='#project-management-and-prioritization'>Project Management and Prioritization</a></li> +<li>⇢ <a href='#effective-work-strategies'>Effective Work Strategies</a></li> +<li>⇢ <a href='#maintaining-productivity'>Maintaining Productivity</a></li> +<li>⇢ <a href='#attitude-and-technology-management'>Attitude and Technology Management</a></li> +</ul><br /> +<h2 style='display: inline' id='time-and-task-management'>Time and Task Management</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='prioritizing-tasks'>Prioritizing Tasks</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>Three qualities necessary but learnable to form a habit of getting things done:</span><br /> +<br /> +<ul> +<li>1. Decision</li> +<li>2. Discipline</li> +<li>3. Determination</li> +</ul><br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='goal-setting-and-planning'>Goal Setting and Planning</h2><br /> +<br /> +<ul> +<li>Set deadlines or sub-deadlines. No deadline means no urgency, leading to procrastination.</li> +<li>Written goals drive achievement. The more you write, the more you think about them, and the stronger the desire to accomplish them.</li> +<li>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.</li> +<li>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.</li> +<li>Plan every day in advance. Bring the future into the now so you can act immediately.</li> +</ul><br /> +<h2 style='display: inline' id='efficiency-and-procrastination'>Efficiency and Procrastination</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span> Create lists a day before:</span><br /> +<br /> +<ul> +<li>Monthly list</li> +<li>Weekly list (updated as the week progresses)</li> +<li>Daily list the night before</li> +</ul><br /> +<span>Plan every week and month in advance. Always work from the list. Add new items back to the list.</span><br /> +<br /> +<h2 style='display: inline' id='project-management-and-prioritization'>Project Management and Prioritization</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='effective-work-strategies'>Effective Work Strategies</h2><br /> +<br /> +<ul> +<li>Do first things first and second things never. Set clear priorities.</li> +<li>Use creative procrastination by putting off less critical "ugly frogs."</li> +<li>Only by controlling what you say "no" to can you control your life and time.</li> +<li>Early and often, reject anything not of high value to your life.</li> +<li>No spare time means new priorities replace old activities (e.g., spend more time with family, reading, or sport).</li> +<li>Poor performance causes procrastination; people avoid areas where they aren't proficient. Everyone has strengths and weaknesses.</li> +<li>Set goals to improve in areas that need development.</li> +<li>Identify and develop skills that have the biggest positive impact on your life.</li> +<li>Continual improvement transforms your life.</li> +<li>Effective work leads to a decent work-life balance, enhancing life quality at home.</li> +</ul><br /> +<h2 style='display: inline' id='maintaining-productivity'>Maintaining Productivity</h2><br /> +<br /> +<span>Start with the highest value task of the day by just getting started—often the hardest part. A tidy desk makes starting easier.</span><br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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."</span><br /> +<br /> +<h2 style='display: inline' id='attitude-and-technology-management'>Attitude and Technology Management</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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).</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>Improve specific key skills to increase productivity and enter "the zone."</span><br /> +<br /> +<span>Other book notes of mine are:</span><br /> +<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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/notes/fluent-forever.html b/notes/fluent-forever.html new file mode 100644 index 00000000..a09739bd --- /dev/null +++ b/notes/fluent-forever.html @@ -0,0 +1,27 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>To be in the .zone!</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/notes/fluent-forever.md">Markdown</a> | <a href="gemini://foo.zone/notes/fluent-forever.gmi">Gemini</a> +</p> +<span>These are my personal book notes from Gabriel Weyner's "Fluent Forever" They are for myself, but I hope they might be useful to you too.</span><br /> +<br /> +<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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/notes/index.html b/notes/index.html index 8ce25041..e710ddc5 100644 --- a/notes/index.html +++ b/notes/index.html @@ -8,17 +8,29 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Notes on foo.zone</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/notes/index.md">Markdown</a> | <a href="gemini://foo.zone/notes/index.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='notes-on-foozone'>Notes on foo.zone</h1><br /> <br /> -<h2 style='display: inline'>To be in the .zone!</h2><br /> +<h2 style='display: inline' id='to-be-in-the-zone'>To be in the .zone!</h2><br /> <br /> +<a class='textlink' href='./when.html'>'When: The Scientific Secrets of Perfect Timing' book notes</a><br /> <a class='textlink' href='./the-stoic-challenge.html'>'The Stoic Challenge' book notes</a><br /> +<a class='textlink' href='./the-science-of-living.html'>'Science of Living' book notes</a><br /> <a class='textlink' href='./the-pragmatic-programmer.html'>'The Pragmatic Programmer' book notes</a><br /> +<a class='textlink' href='./the-power-of-neuroplasticity.html'>'The Power of Neuroplasticity' book notes</a><br /> <a class='textlink' href='./the-obstacle-is-the-way.html'>'The Obstacle is the Way' book notes</a><br /> <a class='textlink' href='./staff-engineer.html'>'Staff Engineer' book notes</a><br /> +<a class='textlink' href='./slow-productivity.html'>'Slow Productivity' book notes</a><br /> +<a class='textlink' href='./search-inside-yourself.html'>'Search Inside Yourself' book notes</a><br /> <a class='textlink' href='./never-split-the-difference.html'>'Never split the difference' book notes</a><br /> <a class='textlink' href='./mind-management.html'>'Mind Management' book notes</a><br /> <a class='textlink' href='./mental-combat.html'>'Mental Combat' book notes</a><br /> +<a class='textlink' href='./love-people-use-things.html'>Love People, Use Things</a><br /> +<a class='textlink' href='./joy-on-demand.html'>'Joy On Domand' book notes</a><br /> +<a class='textlink' href='./influence-wihout-authority.html'>'Influence without Authority' book notes</a><br /> +<a class='textlink' href='./eat-that-frog.html'>'Eat That Frog' book notes</a><br /> <a class='textlink' href='./career-guide-and-soft-skills.html'>'Software Developmers Career Guide and Soft Skills' book notes</a><br /> <a class='textlink' href='./a-monks-guide-to-happiness.html'>'A Monk's Guide to Happiness' book notes</a><br /> <br /> @@ -26,9 +38,9 @@ <br /> <a class='textlink' href='../'>Go back to main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/notes/influence-wihout-authority.html b/notes/influence-wihout-authority.html new file mode 100644 index 00000000..ed861b82 --- /dev/null +++ b/notes/influence-wihout-authority.html @@ -0,0 +1,92 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>'Influence without Authority' book notes</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/notes/influence-wihout-authority.md">Markdown</a> | <a href="gemini://foo.zone/notes/influence-wihout-authority.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='influence-without-authority-book-notes'>"Influence without Authority" book notes</h1><br /> +<br /> +<span class='quote'>Last updated 28.4.2024</span><br /> +<br /> +<span>These notes capture key strategies from "Influence Without Authority" by Allan R. Cohen and David L. Bradford for effective interpersonal relationships and influencing others in the workplace without formal authority.</span><br /> +<br /> +<span>These are my personal notes, but maybe you will find them usefull too.</span><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#influence-without-authority-book-notes'>"Influence without Authority" book notes</a></li> +<li>⇢ <a href='#building-relationships-and-communication'>Building Relationships and Communication</a></li> +<li>⇢ <a href='#managing-emotions-and-conflicts'>Managing Emotions and Conflicts</a></li> +<li>⇢ <a href='#strategic-influence-and-reciprocity'>Strategic Influence and Reciprocity</a></li> +<li>⇢ <a href='#working-with-management'>Working with Management</a></li> +<li>⇢ <a href='#adapting-to-workplace-culture'>Adapting to Workplace Culture</a></li> +<li>⇢ <a href='#diplomacy-and-discretion'>Diplomacy and Discretion</a></li> +</ul><br /> +<h2 style='display: inline' id='building-relationships-and-communication'>Building Relationships and Communication</h2><br /> +<br /> +<ul> +<li>Make relationships before they are needed. A good reputation acts as a reserve for difficult times.</li> +<li>Communicate inclusively by saying "we fix it" instead of "I fix it" to foster teamwork.</li> +<li>Influence through a give-and-take process. Diagnose the goals of the other person to find what you can offer in exchange for what you need.</li> +<li>Seeing the pressures others are under can help stop demonizing them and see them as potential allies.</li> +<li>Present your thoughts in a more business-like manner, less personally.</li> +<li>In remote meetings, use structured agendas and keep webcams on for better focus and easier opening up via video call as it’s less intense with fewer external clues.</li> +</ul><br /> +<h2 style='display: inline' id='managing-emotions-and-conflicts'>Managing Emotions and Conflicts</h2><br /> +<br /> +<ul> +<li>Downplay personal feelings and focus on the task.</li> +<li>Stay calm in the face of anger and avoid attacking others. Be tough and honest without being disrespectful.</li> +<li>Avoid blame as it's not helpful.</li> +<li>Handle conflicts by ensuring the other person feels they also won; aim for win-win situations.</li> +</ul><br /> +<h2 style='display: inline' id='strategic-influence-and-reciprocity'>Strategic Influence and Reciprocity</h2><br /> +<br /> +<ul> +<li>Insist on what is important to you but may not be to others.</li> +<li>Understand the law of reciprocity: what you give is expected to be returned in one form or another.</li> +<li>Give favors before you need them returned to build credit for future influence.</li> +<li>Recognize the hidden costs in exchanges and represent them when negotiating to ensure fair compensation.</li> +<li>Many people underestimate the "currencies" they can offer, like craftsmanship or teaching, to influence outcomes favorably.</li> +</ul><br /> +<h2 style='display: inline' id='working-with-management'>Working with Management</h2><br /> +<br /> +<ul> +<li>Use your boss as a potential ally, seeing them as a partner.</li> +<li>Be clear about your own goals and priorities when communicating with your boss.</li> +<li>Ensure you fully understand your boss's directives and the resources available.</li> +<li>Find projects or cases that align with your boss’s interests to involve them effectively.</li> +<li>Present new ideas to your boss only when they are well thought out and the benefits are clear.</li> +<li>The goal is to maintain a supportive work relationship with your boss as a partner, not to critique them. If alignment isn’t possible, consider moving on.</li> +</ul><br /> +<h2 style='display: inline' id='adapting-to-workplace-culture'>Adapting to Workplace Culture</h2><br /> +<br /> +<ul> +<li>Early successes can lead to better cooperation within teams.</li> +<li>Adjust to company culture when asking for things.</li> +<li>Recognize that truly powerful people don't need to show off but address problems directly and empower others.</li> +</ul><br /> +<h2 style='display: inline' id='diplomacy-and-discretion'>Diplomacy and Discretion</h2><br /> +<br /> +<ul> +<li>The three rules of being a diplomat: never tell a lie, never tell everything, and when in doubt, go to the bathroom.</li> +<li>Train your reflexes to respond appropriately in challenging situations.</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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/notes/joy-on-demand.html b/notes/joy-on-demand.html new file mode 100644 index 00000000..dc73bf95 --- /dev/null +++ b/notes/joy-on-demand.html @@ -0,0 +1,224 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>'Joy On Domand' book notes</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/notes/joy-on-demand.md">Markdown</a> | <a href="gemini://foo.zone/notes/joy-on-demand.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='joy-on-domand-book-notes'>"Joy On Domand" book notes</h1><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#joy-on-domand-book-notes'>"Joy On Domand" book notes</a></li> +<li>⇢ <a href='#mindfulness-and-joy'>Mindfulness and Joy</a></li> +<li>⇢ <a href='#joy-and-happiness'>Joy and Happiness</a></li> +<li>⇢ <a href='#training-joy-easing-inclining-and-uplifting'>Training Joy: Easing, Inclining, and Uplifting</a></li> +<li>⇢ <a href='#joy-and-pain'>Joy and Pain</a></li> +<li>⇢ <a href='#path-to-happiness'>Path to Happiness</a></li> +<li>⇢ <a href='#difference-between-joy-and-happiness'>Difference Between Joy and Happiness</a></li> +<li>⇢ <a href='#the-spiral-of-joy-and-practice'>The Spiral of Joy and Practice</a></li> +<li>⇢ <a href='#inner-peace-and-pain'>Inner Peace and Pain</a></li> +<li>⇢ <a href='#benefits-of-mind-training'>Benefits of Mind Training</a></li> +<li>⇢ <a href='#practicing-mind-training'>Practicing Mind Training</a></li> +<li>⇢ <a href='#creativity-and-mindfulness'>Creativity and Mindfulness</a></li> +<li>⇢ <a href='#the-joyful-mind-and-creativity'>The Joyful Mind and Creativity</a></li> +<li>⇢ <a href='#confidence-and-equanimity'>Confidence and Equanimity</a></li> +<li>⇢ <a href='#resilience-and-growth'>Resilience and Growth</a></li> +<li>⇢ <a href='#experiencing-joy'>Experiencing Joy</a></li> +<li>⇢ <a href='#compassion-and-joy'>Compassion and Joy</a></li> +<li>⇢ <a href='#meditation-and-mindfulness'>Meditation and Mindfulness</a></li> +<li>⇢ <a href='#the-joy-of-exercise'>The Joy of Exercise</a></li> +<li>⇢ <a href='#kick-starting-joy'>Kick-Starting Joy</a></li> +<li>⇢ <a href='#benefits-of-meditation'>Benefits of Meditation</a></li> +<li>⇢ <a href='#meditation-habits'>Meditation Habits</a></li> +<li>⇢ <a href='#amplifying-joy'>Amplifying Joy</a></li> +<li>⇢ <a href='#gratitude-and-perspective'>Gratitude and Perspective</a></li> +<li>⇢ <a href='#awareness-of-absence'>Awareness of Absence</a></li> +<li>⇢ <a href='#compassion-and-loving-kindness'>Compassion and Loving-Kindness</a></li> +<li>⇢ <a href='#path-to-compassion'>Path to Compassion</a></li> +<li>⇢ <a href='#practicing-loving-kindness'>Practicing Loving-Kindness</a></li> +<li>⇢ <a href='#understanding-suffering'>Understanding Suffering</a></li> +<li>⇢ <a href='#letting-go'>Letting Go</a></li> +</ul><br /> +<h2 style='display: inline' id='mindfulness-and-joy'>Mindfulness and Joy</h2><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='joy-and-happiness'>Joy and Happiness</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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. </span><br /> +<br /> +<h2 style='display: inline' id='training-joy-easing-inclining-and-uplifting'>Training Joy: Easing, Inclining, and Uplifting</h2><br /> +<br /> +<span>There are three main skills: easing, inclining, and uplifting. </span><br /> +<br /> +<ul> +<li>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.</li> +<li>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.</li> +<li>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).</li> +</ul><br /> +<span>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. </span><br /> +<br /> +<h2 style='display: inline' id='joy-and-pain'>Joy and Pain</h2><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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. </span><br /> +<br /> +<h2 style='display: inline' id='path-to-happiness'>Path to Happiness</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='difference-between-joy-and-happiness'>Difference Between Joy and Happiness</h2><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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. </span><br /> +<br /> +<h2 style='display: inline' id='the-spiral-of-joy-and-practice'>The Spiral of Joy and Practice</h2><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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. </span><br /> +<br /> +<h2 style='display: inline' id='inner-peace-and-pain'>Inner Peace and Pain</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='benefits-of-mind-training'>Benefits of Mind Training</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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. </span><br /> +<br /> +<h2 style='display: inline' id='practicing-mind-training'>Practicing Mind Training</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='creativity-and-mindfulness'>Creativity and Mindfulness</h2><br /> +<br /> +<span>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."</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='the-joyful-mind-and-creativity'>The Joyful Mind and Creativity</h2><br /> +<br /> +<span>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). </span><br /> +<br /> +<span>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. </span><br /> +<br /> +<h2 style='display: inline' id='confidence-and-equanimity'>Confidence and Equanimity</h2><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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. </span><br /> +<br /> +<h2 style='display: inline' id='resilience-and-growth'>Resilience and Growth</h2><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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. </span><br /> +<br /> +<h2 style='display: inline' id='experiencing-joy'>Experiencing Joy</h2><br /> +<br /> +<span>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. </span><br /> +<br /> +<h2 style='display: inline' id='compassion-and-joy'>Compassion and Joy</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='meditation-and-mindfulness'>Meditation and Mindfulness</h2><br /> +<br /> +<span>"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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='the-joy-of-exercise'>The Joy of Exercise</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='kick-starting-joy'>Kick-Starting Joy</h2><br /> +<br /> +<span>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. </span><br /> +<br /> +<h2 style='display: inline' id='benefits-of-meditation'>Benefits of Meditation</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='meditation-habits'>Meditation Habits</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='amplifying-joy'>Amplifying Joy</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='gratitude-and-perspective'>Gratitude and Perspective</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='awareness-of-absence'>Awareness of Absence</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='compassion-and-loving-kindness'>Compassion and Loving-Kindness</h2><br /> +<br /> +<span>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. </span><br /> +<br /> +<h2 style='display: inline' id='path-to-compassion'>Path to Compassion</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='practicing-loving-kindness'>Practicing Loving-Kindness</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='understanding-suffering'>Understanding Suffering</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='letting-go'>Letting Go</h2><br /> +<br /> +<span>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. </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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/notes/love-people-use-things.html b/notes/love-people-use-things.html new file mode 100644 index 00000000..718e4da7 --- /dev/null +++ b/notes/love-people-use-things.html @@ -0,0 +1,145 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Love People, Use Things</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/notes/love-people-use-things.md">Markdown</a> | <a href="gemini://foo.zone/notes/love-people-use-things.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='love-people-use-things'>Love People, Use Things</h1><br /> +<br /> +<span>These are my personal book notes from "The Minimalist"'s "Love People, Use Things" They are for myself, but I hope they might be useful to you too.</span><br /> +<br /> +<h2 style='display: inline' id='the-pursuit-of-minimalism-and-meaning'>The Pursuit of Minimalism and Meaning</h2><br /> +<br /> +<span>Love people and use things. Ask yourself, "Does this item serve a purpose in my life? Or does it spark joy?" People often believe that possessing item A will bring everlasting happiness. However, after obtaining item A, a new desire for the next item emerges. Happiness from these possessions is fleeting as you return to your baseline mood. </span><br /> +<br /> +<ul> +<li>Be careful with accumulating items, as they require maintenance: replacing or charging batteries, software updates, fixing, cleaning, etc.</li> +<li>Owning more reduces time for what truly matters. </li> +</ul><br /> +<h3 style='display: inline' id='sentimental-items'>Sentimental Items</h3><br /> +<br /> +<ul> +<li>For sentimental items you don't use, consider taking a photo or video and then discarding them.</li> +<li>Pursue happiness by seeking freedom, not possessions. True freedom is elusive and immeasurable.</li> +</ul><br /> +<h3 style='display: inline' id='advertising-and-services'>Advertising and Services</h3><br /> +<br /> +<ul> +<li>Free services bombard you with advertisements; it's better to pay for services where creators, not advertisement companies, hold influence.</li> +<li>Spending on services makes your choices intentional. Time is your most valuable currency, so spend it wisely.</li> +<li>Reach a state of "enough" in possessions. While more is always possible, ensure there is "enough."</li> +</ul><br /> +<h3 style='display: inline' id='financial-considerations'>Financial Considerations</h3><br /> +<br /> +<span>When purchasing something new, consider:</span><br /> +<span>1. Can you afford it, both financially and mentally?</span><br /> +<span>2. Does it serve a meaningful purpose? Does it truly improve your life?</span><br /> +<br /> +<ul> +<li>Consider the hidden costs: storage, maintenance, psychological strain.</li> +</ul><br /> +<h3 style='display: inline' id='decluttering-tips'>Decluttering Tips</h3><br /> +<br /> +<ul> +<li>Avoid bringing unnecessary items into your space.</li> +<li>Limit "just in case" items; you may never need them. Focus on emergency items only within reason.</li> +<li>"When" items—things you'll definitely use—are acceptable (e.g., stock of toilet paper, toothpaste, or whiskey if you enjoy it).</li> +</ul><br /> +<h3 style='display: inline' id='categorizing-possessions'>Categorizing Possessions</h3><br /> +<br /> +<span>Everything fits into three categories:</span><br /> +<br /> +<ul> +<li>Essentials</li> +<li>Non-essentials</li> +<li>Junk</li> +</ul><br /> +<h2 style='display: inline' id='embracing-truth-and-overcoming-fear'>Embracing Truth and Overcoming Fear</h2><br /> +<br /> +<span>Truth is preferable to lies, though it can be uncomfortable, facilitating the prevalence of dishonesty. Simplify life to expose the truth, stripping away its hiding places.</span><br /> +<br /> +<ul> +<li>Manufactured fears inhibit pursuing personal desires. Fear often keeps us holding onto things "just in case."</li> +<li>Ask yourself, "What am I afraid of?" The answer is often irrational or rooted in manufactured fears.</li> +</ul><br /> +<h3 style='display: inline' id='health-and-well-being'>Health and Well-being</h3><br /> +<br /> +<ul> +<li>The best medicine is free: good food, sleep, exercise, sunshine, and stress reduction. Avoid unnecessary medication.</li> +<li>If stagnant, try diverse, unconventional methods. Failure is likely, but experimentation is vital.</li> +</ul><br /> +<h3 style='display: inline' id='managing-stress'>Managing Stress</h3><br /> +<br /> +<ul> +<li>Identify major stressors and address them. </li> +<li>Resist the fear of missing out; prioritize current focus over FOMO.</li> +<li>True power lies in maintaining focus.</li> +</ul><br /> +<ul> +<li>Each item you own must either serve a purpose or bring lasting joy.</li> +</ul><br /> +<h3 style='display: inline' id='the-90-90-rule'>The 90-90 Rule</h3><br /> +<br /> +<ul> +<li>If you haven't used an item in the last 90 days and won't use it in the next 90, let it go. This covers both seasonal changes.</li> +</ul><br /> +<h2 style='display: inline' id='core-values'>Core Values</h2><br /> +<br /> +<ul> +<li>Health: Without it, nothing else matters, not even possessions.</li> +<li>Relationships: Share your life with someone.</li> +<li>Passion, Fulfillment, and Creativity</li> +<li>Intentional Growth: If not growing, you're decaying.</li> +<li>Constructive Contribution</li> +</ul><br /> +<ul> +<li>Index funds outperform gold.</li> +<li>Technology can transform people into unthinking "zombies."</li> +<li>Embrace digital minimalism, shifting from constant doing to simply being.</li> +</ul><br /> +<h2 style='display: inline' id='practical-minimalism'>Practical Minimalism</h2><br /> +<br /> +<span>"Don't Upgrade" Rule:</span><br /> +<br /> +<ul> +<li>Advertising invests millions in inciting desire. Counter this by questioning each upgrade. Once something breaks, decide to leave it, fix, or replace it only if necessary.</li> +<li>Consider downgrading if it significantly enriches your life.</li> +<li>Use time for writing, reading, or exercising.</li> +</ul><br /> +<h2 style='display: inline' id='imperfection-and-creativity'>Imperfection and Creativity</h2><br /> +<br /> +<ul> +<li>Avoid letting perfect be the enemy of good. "Good enough" is the new perfect.</li> +<li>Continuous slow progress is key. Perfectionism should not stifle creativity.</li> +<li>All work, even by professionals, has imperfections.</li> +</ul><br /> +<h2 style='display: inline' id='attitude-towards-possessions'>Attitude Towards Possessions</h2><br /> +<br /> +<ul> +<li>Appreciate someone else's joy to eliminate jealousy.</li> +<li>Don't cling to items; be prepared to abandon them swiftly. Detachment offers flexibility, crucial for self-care.</li> +</ul><br /> +<h2 style='display: inline' id='home-and-possessions'>Home and Possessions</h2><br /> +<br /> +<ul> +<li>An expensive watch doesn't grant more time. Keep only what adds genuine value.</li> +<li>Prioritize high-quality, enduring items. Though initially costly, they save money and time for meaningful activities.</li> +<li>A minimalistic home can include a reminder of life's absurdities, emphasizing substance over material extravagance.</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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/notes/mental-combat.html b/notes/mental-combat.html index a22fd3ff..262b1aee 100644 --- a/notes/mental-combat.html +++ b/notes/mental-combat.html @@ -8,11 +8,14 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>"Mental Combat" book notes</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/notes/mental-combat.md">Markdown</a> | <a href="gemini://foo.zone/notes/mental-combat.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='mental-combat-book-notes'>"Mental Combat" book notes</h1><br /> <br /> <span class='quote'>Last updated 29.5.2022</span><br /> <br /> -<h2 style='display: inline'>Mindfulness</h2><br /> +<h2 style='display: inline' id='mindfulness'>Mindfulness</h2><br /> <br /> <span>We overthink everything. Apply mindfulness. Take a step back and recognize the conflict. Then analyse and react. Mindfulness is experiencing the moment without judgement. Mindfulness can combat all kind of mental issues such as stress for example. Don't think about the future and the past. Be in the now. </span><br /> <br /> @@ -25,13 +28,13 @@ <li>Life will not slow down for you. You need to make your own priorities.</li> <li>There is a difference between sport and exercise psychology. One is for competition, the other for exercise.</li> </ul><br /> -<h2 style='display: inline'>Motivation</h2><br /> +<h2 style='display: inline' id='motivation'>Motivation</h2><br /> <br /> <span>Your mind sets limits not to self destruct your body. But there is always a buffer for emergency situations. It is possible to overcome the limits set by your mind. Motivation is everything. Without, you won't do things and will only dream. Or you will give up. Don't be externally motivated but by personal drive. Real training is though. The only way to succeed is motivation. Enjoy the process despite the pain and sweat. In order for this be internal motivated.</span><br /> <br /> <span>If you are not motivated, reevaluate your goals. Is this the right sport for you? Find the inner fire.</span><br /> <br /> -<h2 style='display: inline'>Self esteem</h2><br /> +<h2 style='display: inline' id='self-esteem'>Self esteem</h2><br /> <br /> <ul> <li>Competitive anxiety can interfere with your performance Don't worry at the outcome but focus on the now, e.g. the correct move.</li> @@ -45,9 +48,9 @@ <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/notes/mind-management.html b/notes/mind-management.html index 61a97c96..f11b3f18 100644 --- a/notes/mind-management.html +++ b/notes/mind-management.html @@ -8,7 +8,10 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>"Mind Management" book notes</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/notes/mind-management.md">Markdown</a> | <a href="gemini://foo.zone/notes/mind-management.gmi">Gemini</a> +</p> +<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 /> @@ -26,17 +29,33 @@ ''' </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'>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'>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 /> @@ -45,7 +64,7 @@ <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'>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 /> @@ -53,7 +72,7 @@ <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'>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 /> @@ -63,7 +82,7 @@ <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'>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 /> @@ -77,7 +96,7 @@ <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'>Creativity hacks</h2><br /> +<h2 style='display: inline' id='creativity-hacks'>Creativity hacks</h2><br /> <br /> <ul> <li>Coffee can cause anxiety.</li> @@ -88,7 +107,7 @@ <li>Go to open spaces for creativity.</li> <li>Go to closed spaces for polishing.</li> </ul><br /> -<h2 style='display: inline'>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 /> @@ -101,29 +120,32 @@ <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'>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> <li>Talk slowly and deepen your voice a bit to appear more confident. You will also become more confident.</li> <li>Also, use power positions for better confidence.</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='./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='./staff-engineer.html'>2024-10-24 "Staff Engineer" book notes</a><br /> +<a class='textlink' href='./the-stoic-challenge.html'>2024-07-07 "The Stoic Challenge" book notes</a><br /> +<a class='textlink' href='./slow-productivity.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./mind-management.html'>2023-11-11 "Mind Management" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./career-guide-and-soft-skills.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> +<a class='textlink' href='./the-obstacle-is-the-way.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> +<a class='textlink' href='./never-split-the-difference.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./the-pragmatic-programmer.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> <br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><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 /> +<br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/notes/never-split-the-difference.html b/notes/never-split-the-difference.html index 8dec98ec..97aa80cc 100644 --- a/notes/never-split-the-difference.html +++ b/notes/never-split-the-difference.html @@ -8,7 +8,10 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>"Never split the difference" book notes</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/notes/never-split-the-difference.md">Markdown</a> | <a href="gemini://foo.zone/notes/never-split-the-difference.gmi">Gemini</a> +</p> +<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 /> @@ -26,7 +29,23 @@ ''' </pre> <br /> -<h2 style='display: inline'>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 /> @@ -37,7 +56,7 @@ </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'>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 /> @@ -49,7 +68,7 @@ </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'>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> @@ -58,7 +77,7 @@ <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'>"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 /> @@ -71,11 +90,11 @@ </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'>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'>On Deadlines</h2><br /> +<h2 style='display: inline' id='on-deadlines'>On Deadlines</h2><br /> <br /> <ul> <li>All deadlines are imaginary.</li> @@ -83,7 +102,7 @@ <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'>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> @@ -93,7 +112,7 @@ </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'>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 /> @@ -101,7 +120,7 @@ <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'>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 /> @@ -117,11 +136,11 @@ </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'>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'>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 /> @@ -138,21 +157,24 @@ </ul><br /> <span>Slow.... it.... down....</span><br /> <br /> -<span>Other book notes of mine are:</span><br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</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 /> +<span>Other book notes of mine are:</span><br /> <br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<a class='textlink' href='./staff-engineer.html'>2024-10-24 "Staff Engineer" book notes</a><br /> +<a class='textlink' href='./the-stoic-challenge.html'>2024-07-07 "The Stoic Challenge" book notes</a><br /> +<a class='textlink' href='./slow-productivity.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./mind-management.html'>2023-11-11 "Mind Management" book notes</a><br /> +<a class='textlink' href='./career-guide-and-soft-skills.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> +<a class='textlink' href='./the-obstacle-is-the-way.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> +<a class='textlink' href='./never-split-the-difference.html'>2023-04-01 "Never split the difference" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./the-pragmatic-programmer.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/notes/search-inside-yourself.html b/notes/search-inside-yourself.html new file mode 100644 index 00000000..8bc0b9cf --- /dev/null +++ b/notes/search-inside-yourself.html @@ -0,0 +1,852 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>'Search Inside Yourself' book notes</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/notes/search-inside-yourself.md">Markdown</a> | <a href="gemini://foo.zone/notes/search-inside-yourself.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='search-inside-yourself-book-notes'>"Search Inside Yourself" book notes</h1><br /> +<br /> +<span class='quote'>Last updated 23.7.2024</span><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#search-inside-yourself-book-notes'>"Search Inside Yourself" book notes</a></li> +<li>⇢ <a href='#how-to-master-your-mind-in-100-minutes'>How to Master Your Mind in 100 Minutes</a></li> +<li>⇢ <a href='#mindfulness-and-personal-development'>Mindfulness and Personal Development</a></li> +<li>⇢ <a href='#three-steps-of-search-inside-yourself'>Three Steps of "Search Inside Yourself"</a></li> +<li>⇢ <a href='#even-an-engineer-can-thrive-on-emotional-intelligence'>Even an Engineer Can Thrive on Emotional Intelligence</a></li> +<li>⇢ <a href='#emotional-intelligence-enables-three-important-skills'>Emotional Intelligence Enables Three Important Skills</a></li> +<li>⇢ ⇢ <a href='#1-stellar-work-performance'>1. Stellar Work Performance</a></li> +<li>⇢ ⇢ <a href='#2-outstanding-leadership'>2. Outstanding Leadership</a></li> +<li>⇢ ⇢ <a href='#3-the-ability-to-create-the-conditions-for-happiness'>3. The Ability to Create the Conditions for Happiness</a></li> +<li>⇢ <a href='#attention-training'>Attention Training</a></li> +<li>⇢ ⇢ <a href='#train-attention'>Train Attention</a></li> +<li>⇢ <a href='#self-knowledge-and-self-mastery'>Self-Knowledge and Self-Mastery</a></li> +<li>⇢ <a href='#creating-useful-mental-habits'>Creating Useful Mental Habits</a></li> +<li>⇢ <a href='#optimize-thyself'>Optimize Thyself</a></li> +<li>⇢ <a href='#train-at-the-level-of-physiology'>Train at the Level of Physiology</a></li> +<li>⇢ ⇢ <a href='#high-resolution-perception'>High-Resolution Perception</a></li> +<li>⇢ <a href='#mindfulness-in-two-minutes'>Mindfulness in Two Minutes</a></li> +<li>⇢ ⇢ <a href='#meditation-is-exercise'>Meditation is Exercise</a></li> +<li>⇢ ⇢ <a href='#sustaining-your-practice'>Sustaining Your Practice</a></li> +<li>⇢ <a href='#breathing-as-if-your-life-depends-on-it'>Breathing as if Your Life Depends on It</a></li> +<li>⇢ <a href='#happiness-is-the-default-state-of-mind'>Happiness is the Default State of Mind</a></li> +<li>⇢ <a href='#experience-without-judging-or-reacting'>Experience, Without Judging or Reacting</a></li> +<li>⇢ <a href='#attention-and-mindful-meditation-is-like-macgyver-s-swiss-army-knife'>Attention and Mindful Meditation is like MacGyver's Swiss Army Knife</a></li> +<li>⇢ <a href='#meditation-techniques'>Meditation techniques</a></li> +<li>⇢ ⇢ <a href='#expensive-food-meditation'>Expensive Food Meditation</a></li> +<li>⇢ ⇢ <a href='#walking-meditation'>Walking Meditation</a></li> +<li>⇢ <a href='#mindful-listening'>Mindful Listening</a></li> +<li>⇢ <a href='#lightness-and-joy-in-meditation'>Lightness and Joy in Meditation</a></li> +<li>⇢ <a href='#mastering-both-focused-and-open-attention'>Mastering Both Focused and Open Attention</a></li> +<li>⇢ ⇢ <a href='#meditation-circuit-training'>Meditation Circuit Training</a></li> +<li>⇢ <a href='#zen-and-a-walking-baby'>Zen and a Walking Baby</a></li> +<li>⇢ <a href='#clarity'>Clarity</a></li> +<li>⇢ <a href='#about-self-awareness'>About Self-Awareness</a></li> +<li>⇢ ⇢ <a href='#1-emotional-awareness'>1. Emotional Awareness</a></li> +<li>⇢ ⇢ <a href='#2-accurate-self-assessment'>2. Accurate Self-Assessment</a></li> +<li>⇢ ⇢ <a href='#3-self-confidence'>3. Self-Confidence</a></li> +<li>⇢ <a href='#developing-self-awareness'>Developing Self-Awareness</a></li> +<li>⇢ ⇢ <a href='#body-scan'>Body Scan</a></li> +<li>⇢ ⇢ <a href='#scan-for-emotion'>Scan for Emotion</a></li> +<li>⇢ ⇢ <a href='#journaling'>Journaling</a></li> +<li>⇢ <a href='#my-emotions-are-not-me'>My Emotions Are Not Me</a></li> +<li>⇢ <a href='#riding-your-emotions-like-a-horse'>Riding Your Emotions Like a Horse</a></li> +<li>⇢ <a href='#self-regulation'>Self-Regulation</a></li> +<li>⇢ ⇢ <a href='#practice-of-letting-go'>Practice of Letting Go</a></li> +<li>⇢ ⇢ <a href='#know-when-you-are-not-in-pain'>Know When You Are Not in Pain</a></li> +<li>⇢ <a href='#dealing-with-triggers'>Dealing with Triggers</a></li> +<li>⇢ ⇢ <a href='#siberian-north-railroad'>Siberian North Railroad</a></li> +<li>⇢ ⇢ <a href='#siberian-north-railroad-practice'>Siberian North Railroad Practice</a></li> +<li>⇢ ⇢ <a href='#when-you-get-triggered'>When You Get Triggered:</a></li> +<li>⇢ ⇢ <a href='#creating-willingness-to-experience-and-accept-the-emotions'>Creating Willingness to Experience and Accept the Emotions:</a></li> +<li>⇢ <a href='#making-friends-with-emotions'>Making Friends with Emotions</a></li> +<li>⇢ <a href='#pleasure-passion-and-higher-purpose'>Pleasure, Passion, and Higher Purpose</a></li> +<li>⇢ <a href='#motivation-in-three-easy-steps'>Motivation in Three Easy Steps</a></li> +<li>⇢ ⇢ <a href='#alignment-having-fun-for-a-living'>Alignment: Having Fun for a Living</a></li> +<li>⇢ ⇢ <a href='#flow'>Flow</a></li> +<li>⇢ ⇢ <a href='#autonomy-mastery-purpose'>Autonomy, Mastery, Purpose</a></li> +<li>⇢ <a href='#envisioning'>Envisioning</a></li> +<li>⇢ ⇢ <a href='#discovering-my-ideal-future'>Discovering My Ideal Future</a></li> +<li>⇢ <a href='#resilience'>Resilience</a></li> +<li>⇢ ⇢ <a href='#meditation-on-resilience'>Meditation on Resilience</a></li> +<li>⇢ <a href='#cognitive-resilience'>Cognitive Resilience</a></li> +<li>⇢ <a href='#empathy'>Empathy</a></li> +<li>⇢ <a href='#creating-mental-habits'>Creating Mental Habits</a></li> +<li>⇢ ⇢ <a href='#just-like-me--loving-kindness-practice'>Just Like Me / Loving Kindness Practice</a></li> +<li>⇢ <a href='#establishing-trust-is-good-for-work'>Establishing Trust is Good for Work</a></li> +<li>⇢ ⇢ <a href='#three-assumptions'>Three Assumptions</a></li> +<li>⇢ ⇢ <a href='#empathic-listening'>Empathic Listening</a></li> +<li>⇢ <a href='#political-awareness'>Political Awareness</a></li> +<li>⇢ <a href='#mental-habits-of-highly-empathic-people'>Mental Habits of Highly Empathic People</a></li> +<li>⇢ ⇢ <a href='#being-effective-and-loved-at-the-same-time'>Being Effective and Loved at the Same Time</a></li> +<li>⇢ ⇢ <a href='#using-kindness-to-grow-friendship-from-an-ugly-situation'>Using Kindness to Grow Friendship from an Ugly Situation</a></li> +<li>⇢ <a href='#leading-with-compassion'>Leading with Compassion</a></li> +<li>⇢ ⇢ <a href='#difficult-conversations'>Difficult Conversations</a></li> +<li>⇢ <a href='#mindful-e-mailing'>Mindful E-Mailing</a></li> +<li>⇢ ⇢ <a href='#practice-of-mindful-e-mailing'>Practice of Mindful E-Mailing</a></li> +<li>⇢ <a href='#three-easy-steps-to-world-peace'>Three Easy Steps to World Peace</a></li> +<li>⇢ ⇢ <a href='#align-meditation-with-real-life'>Align Meditation with Real Life</a></li> +<li>⇢ <a href='#macgyver-s-swiss-army-knife'>MacGyver's Swiss Army knife</a></li> +<li>⇢ <a href='#other'>Other</a></li> +<li>⇢ <a href='#audio-book-notes'>Audio Book notes</a></li> +<li>⇢ ⇢ <a href='#books-to-check-out'>Books to Check Out</a></li> +<li>⇢ ⇢ <a href='#videos'>Videos</a></li> +</ul><br /> +<h2 style='display: inline' id='how-to-master-your-mind-in-100-minutes'>How to Master Your Mind in 100 Minutes</h2><br /> +<br /> +<span>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!</span><br /> +<br /> +<h2 style='display: inline' id='mindfulness-and-personal-development'>Mindfulness and Personal Development</h2><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='three-steps-of-search-inside-yourself'>Three Steps of "Search Inside Yourself"</h2><br /> +<br /> +<span>1. **Attention Training**</span><br /> +<span>2. **Self-Knowledge and Self-Mastery**</span><br /> +<span>3. **Creating Useful Mental Habits**</span><br /> +<br /> +<span>Train your attention to cultivate a mind that is both calm and clear. This quality of mind forms the foundation for emotional intelligence.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='even-an-engineer-can-thrive-on-emotional-intelligence'>Even an Engineer Can Thrive on Emotional Intelligence</h2><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>Goleman classifies emotional intelligence into five domains:</span><br /> +<br /> +<ul> +<li>1. Self-awareness: Knowledge of one's internal states, preferences, resources, and intuitions.</li> +<li>2. Self-regulation: Management of one's internal states, impulses, and resources.</li> +<li>3. Motivation: Emotional tendencies that guide or facilitate reaching goals.</li> +<li>4. Empathy: Awareness of others' feelings, needs, and concerns.</li> +<li>5. Social skills: Adeptness at inducing desirable responses in others.</li> +</ul><br /> +<h2 style='display: inline' id='emotional-intelligence-enables-three-important-skills'>Emotional Intelligence Enables Three Important Skills</h2><br /> +<br /> +<ul> +<li>1. Stellar Work Performance</li> +<li>2. Outstanding Leadership</li> +<li>3. Creating Conditions for Happiness</li> +</ul><br /> +<h3 style='display: inline' id='1-stellar-work-performance'>1. Stellar Work Performance</h3><br /> +<br /> +<span>Top six competencies that distinguish star performers from the average in the tech sector are:</span><br /> +<br /> +<ul> +<li>1. Strong achievement drive and high achievement standards.</li> +<li>2. Ability to focus.</li> +<li>3. Conceptual thinking (intellectual competency).</li> +<li>4. Analytical ability (intellectual competency).</li> +<li>5. Initiative in taking on challenges.</li> +<li>6. Self-confidence.</li> +</ul><br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='2-outstanding-leadership'>2. Outstanding Leadership</h3><br /> +<br /> +<span>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."</span><br /> +<br /> +<h3 style='display: inline' id='3-the-ability-to-create-the-conditions-for-happiness'>3. The Ability to Create the Conditions for Happiness</h3><br /> +<br /> +<span>Happiness is a skill that can be practiced through deliberate training. The other side effects may include resilience, optimism, and kindness.</span><br /> +<br /> +<h2 style='display: inline' id='attention-training'>Attention Training</h2><br /> +<br /> +<span>Train your attention to cultivate a mind that is both calm and clear. This quality of mind forms the foundation for emotional intelligence.</span><br /> +<br /> +<h3 style='display: inline' id='train-attention'>Train Attention</h3><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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." </span><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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). </span><br /> +<br /> +<span>"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.</span><br /> +<br /> +<h2 style='display: inline' id='self-knowledge-and-self-mastery'>Self-Knowledge and Self-Mastery</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='creating-useful-mental-habits'>Creating Useful Mental Habits</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='optimize-thyself'>Optimize Thyself</h2><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>Social skills are highly trainable and can also help others love you, by the way.</span><br /> +<br /> +<h2 style='display: inline' id='train-at-the-level-of-physiology'>Train at the Level of Physiology</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='high-resolution-perception'>High-Resolution Perception</h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='mindfulness-in-two-minutes'>Mindfulness in Two Minutes</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='meditation-is-exercise'>Meditation is Exercise</h3><br /> +<br /> +<span>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. </span><br /> +<span>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. </span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='sustaining-your-practice'>Sustaining Your Practice</h3><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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.</span><br /> +<br /> +<ul> +<li>*Do less than you can:* Keep the practice from becoming a burden. If mindfulness practice feels like a chore, it's not sustainable.</li> +<li>*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. </li> +</ul><br /> +<span>Also, creating the intention to meditate is itself meditation.</span><br /> +<br /> +<h2 style='display: inline' id='breathing-as-if-your-life-depends-on-it'>Breathing as if Your Life Depends on It</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='happiness-is-the-default-state-of-mind'>Happiness is the Default State of Mind</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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. </span><br /> +<br /> +<h2 style='display: inline' id='experience-without-judging-or-reacting'>Experience, Without Judging or Reacting</h2><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='attention-and-mindful-meditation-is-like-macgyver-s-swiss-army-knife'>Attention and Mindful Meditation is like MacGyver's Swiss Army Knife</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='meditation-techniques'>Meditation techniques</h2><br /> +<br /> +<h3 style='display: inline' id='expensive-food-meditation'>Expensive Food Meditation</h3><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>It is just like sitting meditation, except the object of meditation is the task at hand rather than just the breath.</span><br /> +<br /> +<h3 style='display: inline' id='walking-meditation'>Walking Meditation</h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='mindful-listening'>Mindful Listening</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='lightness-and-joy-in-meditation'>Lightness and Joy in Meditation</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span> 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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<ul> +<li>Formal mindfulness: Gives you better mindfulness gains but also requires discipline.</li> +<li>Joyful Mindfulness: Gives you fewer mindfulness gains but is far more sustainable.</li> +</ul><br /> +<span>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." </span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='mastering-both-focused-and-open-attention'>Mastering Both Focused and Open Attention</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>There are a few important features common to both focused and open attention:</span><br /> +<br /> +<ul> +<li>Strong meta-attention (attention of attention)</li> +<li>Clarity and vividness of attention</li> +<li>Both meditations require a balance of effort and relaxation.</li> +</ul><br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='meditation-circuit-training'>Meditation Circuit Training</h3><br /> +<br /> +<ul> +<li>1. Sit comfortably in a position that enables both relaxation and alertness at the same time.</li> +<li>2. Shift into focused attention. Focus on the breath or any other object of meditation you choose. Do this for 3 minutes.</li> +<li>3. Shift into open attention. Bring your attention to whatever you experience and whatever comes to mind. Do this for 3 minutes.</li> +<li>4. Repeat focused attention for 3 minutes and open attention for 3 minutes.</li> +<li>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).</li> +</ul><br /> +<h2 style='display: inline' id='zen-and-a-walking-baby'>Zen and a Walking Baby</h2><br /> +<br /> +<span>There seem to be two stages in one's meditation progress, which I call "initial access" and "consolidation."</span><br /> +<br /> +<ul> +<li>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.</li> +<li>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.</li> +</ul><br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='clarity'>Clarity</h2><br /> +<br /> +<span>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:</span><br /> +<br /> +<ul> +<li>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.</li> +<li>Increase the Brightness and Contrast: Make our perceptions more vivid.</li> +</ul><br /> +<span>This combination provides us with very useful high-definition information about our emotional life.</span><br /> +<br /> +<h2 style='display: inline' id='about-self-awareness'>About Self-Awareness</h2><br /> +<br /> +<span>"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.</span><br /> +<br /> +<span>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:</span><br /> +<br /> +<h3 style='display: inline' id='1-emotional-awareness'>1. Emotional Awareness</h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='2-accurate-self-assessment'>2. Accurate Self-Assessment</h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='3-self-confidence'>3. Self-Confidence</h3><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='developing-self-awareness'>Developing Self-Awareness</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='body-scan'>Body Scan</h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='scan-for-emotion'>Scan for Emotion</h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='journaling'>Journaling</h3><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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:</span><br /> +<br /> +<ul> +<li>What I am feeling now is...</li> +<li>I am aware that...</li> +<li>What motivates me is...</li> +<li>I am inspired by...</li> +<li>Today, I aspire to...</li> +<li>What hurts me is...</li> +<li>I wish...</li> +<li>Others are...</li> +<li>I made a happy mistake...</li> +<li>Love is...</li> +</ul><br /> +<h2 style='display: inline' id='my-emotions-are-not-me'>My Emotions Are Not Me</h2><br /> +<br /> +<span>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." </span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='riding-your-emotions-like-a-horse'>Riding Your Emotions Like a Horse</h2><br /> +<br /> +<span class='quote'>"One can have no smaller or greater mastery than mastery of oneself." —Leonardo da Vinci</span><br /> +<br /> +<span>"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.</span><br /> +<br /> +<h2 style='display: inline' id='self-regulation'>Self-Regulation</h2><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='practice-of-letting-go'>Practice of Letting Go</h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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. </span><br /> +<br /> +<span class='quote'>"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</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='know-when-you-are-not-in-pain'>Know When You Are Not in Pain</h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<ul> +<li>Do not feel bad about feeling bad.</li> +<li>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).</li> +<li>Start every thought with kindness and humor. It is all very funny. So every time I fail, it is a comedy.</li> +</ul><br /> +<h2 style='display: inline' id='dealing-with-triggers'>Dealing with Triggers</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<ul> +<li>Body: Shallow breathing, rapid heartbeat, and feeling sick to the stomach</li> +<li>Emotions: Experiencing a fight-or-flight response</li> +<li>Thoughts: Feeling like a victim, thoughts of blame and judgment, difficulty paying attention.</li> +</ul><br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='siberian-north-railroad'>Siberian North Railroad</h3><br /> +<br /> +<span>This practice helps to deal with triggers:</span><br /> +<br /> +<ul> +<li>Stop</li> +<li>Breathe</li> +<li>Notice</li> +<li>Reflect</li> +<li>Respond</li> +</ul><br /> +<span>SBNRR: SiBerian North RailRoad</span><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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."</span><br /> +<br /> +<span>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:</span><br /> +<br /> +<ul> +<li>Everybody wants to be happy</li> +<li>This person thinks acting this way will make them happy in some way.</li> +</ul><br /> +<span>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?</span><br /> +<br /> +<h3 style='display: inline' id='siberian-north-railroad-practice'>Siberian North Railroad Practice</h3><br /> +<br /> +<ul> +<li>1. Settling Attention: Start with three breaths.</li> +<li>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.</li> +<li>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. </li> +<li>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.</li> +<li>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. </li> +</ul><br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='when-you-get-triggered'>When You Get Triggered:</h3><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='creating-willingness-to-experience-and-accept-the-emotions'>Creating Willingness to Experience and Accept the Emotions:</h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='making-friends-with-emotions'>Making Friends with Emotions</h2><br /> +<br /> +<span>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."</span><br /> +<br /> +<span>"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."</span><br /> +<br /> +<h2 style='display: inline' id='pleasure-passion-and-higher-purpose'>Pleasure, Passion, and Higher Purpose</h2><br /> +<br /> +<span>There are three types of happiness: pleasure, passion, and higher purpose. </span><br /> +<br /> +<ul> +<li>The happiness that arises from pleasure is highly unsustainable. </li> +<li>Happiness that arises from flow is much more sustainable. </li> +<li>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. </li> +</ul><br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='motivation-in-three-easy-steps'>Motivation in Three Easy Steps</h2><br /> +<br /> +<h3 style='display: inline' id='alignment-having-fun-for-a-living'>Alignment: Having Fun for a Living</h3><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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:</span><br /> +<br /> +<ul> +<li>The work is deeply meaningful for you</li> +<li>It generates a state of flow in you</li> +</ul><br /> +<h3 style='display: inline' id='flow'>Flow</h3><br /> +<br /> +<span>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." </span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='autonomy-mastery-purpose'>Autonomy, Mastery, Purpose</h3><br /> +<br /> +<span>The best motivators are what he calls "intrinsic motivators"—motivation we find within ourselves.</span><br /> +<br /> +<ul> +<li>Autonomy: The urge to direct our own lives</li> +<li>Mastery: The desire to get better and better at something that matters</li> +<li>Purpose: The yearning to do what we do in service of something larger than ourselves</li> +</ul><br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='envisioning'>Envisioning</h2><br /> +<br /> +<span>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:</span><br /> +<br /> +<span class='quote'>"You have to expect things of yourself before you can do them." </span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='discovering-my-ideal-future'>Discovering My Ideal Future</h3><br /> +<br /> +<span>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:</span><br /> +<br /> +<ul> +<li>Who are you and what are you doing?</li> +<li>How do you feel?</li> +<li>What do people say about you?</li> +</ul><br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='resilience'>Resilience</h2><br /> +<br /> +<span>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:</span><br /> +<br /> +<ul> +<li>Inner calm: Just do a lot of mindfulness meditation, and this aspect will be "automagically" taken care of.</li> +<li>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.</li> +<li>Cognitive resilience</li> +</ul><br /> +<h3 style='display: inline' id='meditation-on-resilience'>Meditation on Resilience</h3><br /> +<br /> +<ul> +<li>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.</li> +<li>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.</li> +<li>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.</li> +<li>Returning to calm: Let us now return to the present for 3 minutes. Check in with your body and how it feels now.</li> +</ul><br /> +<h2 style='display: inline' id='cognitive-resilience'>Cognitive Resilience</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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."</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='empathy'>Empathy</h2><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='creating-mental-habits'>Creating Mental Habits</h2><br /> +<br /> +<span>"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.</span><br /> +<br /> +<h3 style='display: inline' id='just-like-me--loving-kindness-practice'>Just Like Me / Loving Kindness Practice</h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='establishing-trust-is-good-for-work'>Establishing Trust is Good for Work</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>The coaching/mentoring cycle involves these steps:</span><br /> +<br /> +<ul> +<li>Establish trust</li> +<li>Listen (by "looping" and "dipping")</li> +<li>Ask probing and open-ended questions</li> +<li>Provide feedback</li> +<li>Partner to create options and practices</li> +</ul><br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='three-assumptions'>Three Assumptions</h3><br /> +<br /> +<ul> +<li>Assume that everybody in this room is here to serve the greater good, until proven otherwise.</li> +<li>Given the above assumption, we therefore assume that none of us has any hidden agenda, until proven otherwise.</li> +<li>Given the above assumption, we therefore assume that we are all reasonable even when we disagree, until proven otherwise.</li> +</ul><br /> +<h3 style='display: inline' id='empathic-listening'>Empathic Listening</h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='political-awareness'>Political Awareness</h2><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>This reminds me of a joke:</span><br /> +<br /> +<span class='quote'>"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.'"</span><br /> +<br /> +<h2 style='display: inline' id='mental-habits-of-highly-empathic-people'>Mental Habits of Highly Empathic People</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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."</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='being-effective-and-loved-at-the-same-time'>Being Effective and Loved at the Same Time</h3><br /> +<br /> +<span class='quote'>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='using-kindness-to-grow-friendship-from-an-ugly-situation'>Using Kindness to Grow Friendship from an Ugly Situation</h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='leading-with-compassion'>Leading with Compassion</h2><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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:</span><br /> +<br /> +<ul> +<li>A cognitive component: "I understand you"</li> +<li>An affective component: "I feel you"</li> +<li>A motivational component: "I want to help you"</li> +</ul><br /> +<span>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. </span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>The three components of compassion can be used to train the two distinguishing qualities of Level 5 leadership:</span><br /> +<br /> +<ul> +<li> Affective (I feel for you)</li> +<li> Cognitive (I understand you)</li> +<li> Motivational (I want to help you)</li> +</ul><br /> +<span>The Ambition is for the greater good.</span><br /> +<span> </span><br /> +<span>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. </span><br /> +<br /> +<span>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. </span><br /> +<br /> +<span>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."</span><br /> +<br /> +<ul> +<li>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.</li> +</ul><br /> +<ul> +<li>Relatedness: The only experience in life that makes people sustainably happy over time is the quality and quantity of social connections.</li> +</ul><br /> +<ul> +<li>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.</li> +</ul><br /> +<h3 style='display: inline' id='difficult-conversations'>Difficult Conversations</h3><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>There are five steps to conducting a difficult conversation:</span><br /> +<br /> +<ul> +<li>Prepare by walking through the "three conversations."</li> +<li>Decide whether to raise the issue.</li> +<li>Start from the objective "third story."</li> +<li>Explore their story and yours.</li> +<li>Problem solve.</li> +</ul><br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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?"</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='mindful-e-mailing'>Mindful E-Mailing</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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. </span><br /> +<span>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.</span><br /> +<br /> +<h3 style='display: inline' id='practice-of-mindful-e-mailing'>Practice of Mindful E-Mailing</h3><br /> +<br /> +<ul> +<li>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.</li> +<li>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.</li> +<li>Write your e-mail</li> +<li>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.</li> +<li>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.</li> +</ul><br /> +<h2 style='display: inline' id='three-easy-steps-to-world-peace'>Three Easy Steps to World Peace</h2><br /> +<br /> +<span>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. </span><br /> +<br /> +<h3 style='display: inline' id='align-meditation-with-real-life'>Align Meditation with Real Life</h3><br /> +<br /> +<ul> +<li>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.</li> +<li>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.</li> +<li>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.</li> +</ul><br /> +<span>I want to create a world where meditation is widely treated like exercise for the mind.</span><br /> +<br /> +<h2 style='display: inline' id='macgyver-s-swiss-army-knife'>MacGyver's Swiss Army knife</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>It's also about the ability to pay attention to information for a prolonged period of time where meditation is beneficial.</span><br /> +<br /> +<span>Mindfulness feels almost like MagGyver's Swiss Army knife - it is sueful in every situation.</span><br /> +<br /> +<h2 style='display: inline' id='other'>Other</h2><br /> +<br /> +<span>I see great people. Walking around like regular people. They don't even know they are great.</span><br /> +<br /> +<h2 style='display: inline' id='audio-book-notes'>Audio Book notes</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>You will learn to calm your mind on demand. Response flexibility involves pausing before reacting.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>Ease and flow are best achieved through meditation. Simply rest for 10 minutes. Self-confidence stems from self-knowledge.</span><br /> +<br /> +<span>Paying attention to the body helps it relax, leading to overall increased relaxation. Most people are stressed because their bodies are not relaxed.</span><br /> +<br /> +<span>Daily journaling about emotionally impactful events, such as for 10 minutes a day, leads to improvement.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>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.</span><br /> +<br /> +<span>Uncertainty can occupy your mind, preventing you from doing other things.</span><br /> +<br /> +<h3 style='display: inline' id='books-to-check-out'>Books to Check Out</h3><br /> +<br /> +<ul> +<li>*Emotional Intelligence: Why It Can Matter More Than IQ* by Daniel Goleman</li> +<li>*Working with Emotional Intelligence* by Daniel Goleman</li> +<li>*Difficult Conversations* - It is useful and thin, can be read during a single flight.</li> +<li>*The Miracle of Mindfulness* by Thich Nhat Hanh - Short and sweet</li> +<li>*Wherever You Go, There You Are* by Jon Kabat-Zinn</li> +<li>*The Joy of Living* by Mingyur Rinpoche</li> +<li>*Destructive Emotions: How Can We Overcome Them?* by Daniel Goleman</li> +<li>*Your Brain at Work* by David Rock</li> +</ul><br /> +<h3 style='display: inline' id='videos'>Videos</h3><br /> +<br /> +<a class='textlink' href='http://siybook.com/v/ted_meng'>Chade-Meng Tan on how compassion can be practiced in a corporate setting</a><br /> +<a class='textlink' href='http://siybook.com/v/gtalk_dgoleman'>Daniel Goleman on emotional intelligence</a><br /> +<a class='textlink' href='http://siybook.com/v/gtalk_jkz'>Jon Kabat-Zinn on mindfulness</a><br /> +<a class='textlink' href='http://siybook.com/v/gtalk_rdavidson'>Richie Davidson on contemplative neuroscience</a><br /> +<a class='textlink' href='http://siybook.com/v/gtalk_pgolding'>Philippe Goldin on the neuroscience of emotions</a><br /> +<a class='textlink' href='http://siybook.com/v/gtalk_tlewis'>Thomas Lewis on the neuroscience of empathy</a><br /> +<a class='textlink' href='http://siybook.com/v/gtalk_drock'>David Rock on your brain at work</a><br /> +<a class='textlink' href='http://siybook.com/v/gtalk_shinzen'>Shinzen Young on the science and practice of mindfulness meditation</a><br /> +<a class='textlink' href='http://siybook.com/v/ted_dpink'>Dan Pink on the surprising science of motivation</a><br /> +<a class='textlink' href='http://siybook.com/v/tdd_jbt'>Jill Bolte Taylor on her "stroke of insight"</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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/notes/slow-productivity.html b/notes/slow-productivity.html new file mode 100644 index 00000000..563ed1f7 --- /dev/null +++ b/notes/slow-productivity.html @@ -0,0 +1,177 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>'Slow Productivity' book notes</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/notes/slow-productivity.md">Markdown</a> | <a href="gemini://foo.zone/notes/slow-productivity.gmi">Gemini</a> +</p> +<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 /> +<span>These are my personal takeaways after reading "Slow Productivity - The lost Art of Accomplishment Without Burnout" by Cal Newport.</span><br /> +<br /> +<span>The case studies in this book were a bit long, but they appeared to be well-researched. I will only highlight the interesting, actionable items in the book notes.</span><br /> +<br /> +<span>These notes are mainly for my own use, but you may find them helpful.</span><br /> +<br /> +<pre> + ,.......... .........., + ,..,' '.' ',.., + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,'............., : ,.............', ', +,' '............ '.' ............' ', + '''''''''''''''''';''';'''''''''''''''''' + ''' +</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='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 /> +<br /> +<span>There is a tendency to perform shallow work because people will otherwise dismiss you as lazy. A lot of shallow work can cause burnout, as multiple things are often being worked on in parallel. The more you have on your plate, the more stressed you will be.</span><br /> +<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='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 /> +<span>There are three principles for the maintenance of a sustainable work life:</span><br /> +<br /> +<ul> +<li>Do fewer things</li> +<li>Work at a natural pace</li> +<li>Obsess over quality</li> +</ul><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 /> +<span>Reduce the overhead tax. The overhead tax is all the administrative work to be done. With every additional project, there will also be more administrative stuff to be done on your work plate. So, doing fewer things leads to more and better output and better quality for the projects you are working on.</span><br /> +<br /> +<span>Limit the things on your plate. Limit your missions (personal goals, professional goals). Reduce your main objectives in life. More than five missions are usually not sustainable very easily, so you have to really prioritise what is important to you and your professional life.</span><br /> +<br /> +<span>A mission is an overall objective/goal that can have multiple projects. Limit the projects as well. Some projects need clear endings (e.g., work in support of a never-ending flow of incoming requests). In this case, set limits (e.g., time box your support hours). You can also plan "office hours" for collaborative work with colleagues to avoid ad hoc distractions.</span><br /> +<br /> +<span>The key point is that after making these commitments, you really deliver on them. This builds trust, and people will leave you alone and not ask for progress all the time.</span><br /> +<br /> +<span>Doing fever things is essential for modern knowledge workers. Breathing space in your work also makes you more creative and happier overall.</span><br /> +<br /> +<span>Pushing workers more work can make them less productive, so the better approach is the pull model, where workers pull in new work when the previous task is finished.</span><br /> +<br /> +<span>If you can quantify how busy you are or how many other projects you already work on, then it is easier to say no to new things. For example, show what you are doing, what's in the roadmap, etc. Transparency is the key here. </span><br /> +<br /> +<span>You can have your own simulated pull system if the company doesn't agree to a global one: </span><br /> +<br /> +<ul> +<li>State which additional information you would need.</li> +<li>Create a rough estimate of when you will be able to work on it</li> +<li>Estimate how long the project would take. Double that estimate, as humans are very bad estimators.</li> +<li>Respond to the requester and state that you will let him know when the estimates change.</li> +</ul><br /> +<span>Sometimes, a little friction is all that is needed to combat incoming work, e.g., when your manager starts seeing the reality of your work plate, and you also request additional information for the task. If you already have too much on your plate, then decline the new project or make room for it in your calendar. If you present a large task list, others will struggle to assign more to you.</span><br /> +<br /> +<span>Limit your daily goals. A good measure is to focus on one goal per day. You can time block time for deep work on your daily goal. During that time, you won't be easily available to others.</span><br /> +<br /> +<span>The battle against distractions must be fought to be the master of your time. Nobody will fight this war for you. You have to do it for yourself. (Also, have a look at Cal Newport's "time block planning" method).</span><br /> +<br /> +<span>Put tasks on autopilot (regular recurring tasks).</span><br /> +<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 /> +<span>Don't rush. If you rush or are under pressure, you will be less effective and eventually burn out. Our brains work better then not rushy. The stress heuristic usually indicates too much work, and it is generally too late to reduce workload. That's why we all typically have dangerously too much to do.</span><br /> +<br /> +<span>Have the courage to take longer to do things that are important. For example, plan on a yearly and larger scale, like 2 to 5 years.</span><br /> +<br /> +<span>Find a reasonable time for a project and then double the project timeline against overconfident optimism. Humans are not great at estimating. They gravitate towards best-case estimates. If you have planned more than enough time for your project, then you will fall into a natural work pace. Otherwise, you will struggle with rushing and stress.</span><br /> +<br /> +<span>Some days will still be intense and stressful, but those are exceptional cases. After those exceptions (e.g., finalizing that thing, etc.), calmer periods will follow again.</span><br /> +<br /> +<span>Pace yourself over modest results over time. Simplify and reduce the daily task lists. Meetings: Certain hours are protected for work. For each meeting, add a protected block to your calendar, so you attend meetings only half a day max.</span><br /> +<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='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 /> +<ul> +<li>Focus on the core activities of your work for your obsession - you will only have the time to obsess over some things.</li> +<li>Deliver solid work with good quality.</li> +<li>Sharpen the focus to do the best work possible.</li> +</ul><br /> +<span>Go pro to save time, and don't squeeze everything out that you can from freemium services. Professional software services eliminate administrative work:</span><br /> +<br /> +<ul> +<li>Pay people who know what they are doing and focus on your stuff. </li> +<li>For example, don't repair that car if you know the mechanic can do that much better than you. </li> +<li>Or don't use the free version of the music streaming service if it interrupts you with commercials, hindering your ability to concentrate on your work.</li> +<li>Hire an accountant for your yearly tax returns. He knows much more about that stuff than you do. And in the end, he will even be cheaper as he knows all the tax laws.</li> +<li>...</li> +</ul><br /> +<span>Adjust your workplace to what you want to accomplish. You could have dedicated places in your home for different things, e.g., a place where you read and think (armchair) and a place where you collaborate (your desk or whiteboard). Surround yourself with things that inspire you (e.g., your favourite books on your shelf next to you, etc.).</span><br /> +<br /> +<span>There is the concept of quiet quitting. It doesn't mean quitting your job, but it means that you don't go beyond and above the expectations people have of you. Quiet quitting became popular with modern work, which is often meaningless and full of shallow tasks. If you obsess over quality, you enjoy your craft and want to go beyond and above.</span><br /> +<br /> +<span>Implement rituals and routines which shift you towards your goals:</span><br /> +<br /> +<ul> +<li>For example, if you want to be a good Software Engineer, you also have to put in the work regularly. For instance, progress a bit every day in your project at hand, even if it is only one hour daily. Also, a little quality daily work will be more satisfying over time than many shallow tasks.</li> +<li>Do you want to be lean and/or healthy? Schedule your daily walks and workouts. They will become habits over time.</li> +<li>There's the compounding effect where every small effort made every day will yield significant results in the long run</li> +</ul><br /> +<span>Deciding what not to do is as important as deciding what to do. </span><br /> +<br /> +<span>It appears to be money thrown out of the window, but you get a $50 expensive paper notebook (and also a good pen). Unconsciously, it will make you take notes more seriously. You will think about what to put into the notebooks more profoundly and have thought through the ideas more intensively. If you used very cheap notebooks, you would scribble a lot of rubbish and wouldn't even recognise your handwriting after a while anymore. So choosing a high-quality notebook will help you to take higher-quality notes, too.</span><br /> +<br /> +<span>Slow productivity is actionable and can be applied immediately.</span><br /> +<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='./staff-engineer.html'>2024-10-24 "Staff Engineer" book notes</a><br /> +<a class='textlink' href='./the-stoic-challenge.html'>2024-07-07 "The Stoic Challenge" book notes</a><br /> +<a class='textlink' href='./slow-productivity.html'>2024-05-01 "Slow Productivity" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./mind-management.html'>2023-11-11 "Mind Management" book notes</a><br /> +<a class='textlink' href='./career-guide-and-soft-skills.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> +<a class='textlink' href='./the-obstacle-is-the-way.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> +<a class='textlink' href='./never-split-the-difference.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./the-pragmatic-programmer.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> +<br /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/notes/staff-engineer.html b/notes/staff-engineer.html index fcecd808..027f211b 100644 --- a/notes/staff-engineer.html +++ b/notes/staff-engineer.html @@ -8,15 +8,103 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>"Staff Engineer" book notes</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/notes/staff-engineer.md">Markdown</a> | <a href="gemini://foo.zone/notes/staff-engineer.gmi">Gemini</a> +</p> +<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 /> -<span class='quote'>Last updated 10.8.2023</span><br /> +<h2 style='display: inline' id='managing-up-and-across'>Managing Up and Across</h2><br /> <br /> -<h2 style='display: inline'>Not a faster Senior Engineer</h2><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. (But I want to be a senior engineer but a bit better).</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 /> @@ -26,7 +114,7 @@ <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'>The Balance</h2><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 /> @@ -38,7 +126,7 @@ <br /> <span>Sebactical: Take at least six months. Otherwise, it won't be as restored.</span><br /> <br /> -<h2 style='display: inline'>More things</h2><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> @@ -48,11 +136,23 @@ </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='./staff-engineer.html'>2024-10-24 "Staff Engineer" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./the-stoic-challenge.html'>2024-07-07 "The Stoic Challenge" book notes</a><br /> +<a class='textlink' href='./slow-productivity.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./mind-management.html'>2023-11-11 "Mind Management" book notes</a><br /> +<a class='textlink' href='./career-guide-and-soft-skills.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> +<a class='textlink' href='./the-obstacle-is-the-way.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> +<a class='textlink' href='./never-split-the-difference.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./the-pragmatic-programmer.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> +<br /> <a class='textlink' href='../'>Back to the main site</a><br /> +<br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/notes/style-override.css b/notes/style-override.css index b5953b41..e69de29b 100644 --- a/notes/style-override.css +++ b/notes/style-override.css @@ -1,23 +0,0 @@ -body { - font-family: handnotes, monospace; -} - -h1, h2, h3 { - font-family: handnotes, monospace; -} - -a { - font-family: typewriter, monospace; -} - -p.quote { - font-family: typewriter, monospace; -} - -ul { - font-family: typewriter, monospace; -} - -pre { - font-family: typewriter, monospace; -} diff --git a/notes/the-obstacle-is-the-way.html b/notes/the-obstacle-is-the-way.html index 92be78fc..9b1291d2 100644 --- a/notes/the-obstacle-is-the-way.html +++ b/notes/the-obstacle-is-the-way.html @@ -8,13 +8,15 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>"The Obstacle is the Way" book notes</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/notes/the-obstacle-is-the-way.md">Markdown</a> | <a href="gemini://foo.zone/notes/the-obstacle-is-the-way.gmi">Gemini</a> +</p> +<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> ,.......... .........., ,..,' '.' ',.., @@ -27,9 +29,26 @@ ''' </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'>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 /> @@ -37,38 +56,37 @@ <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'>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'>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'>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'>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'>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'>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'>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'>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 /> @@ -76,38 +94,40 @@ <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'>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'>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'>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 /> -<span>Other book notes of mine are:</span><br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</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 /> +<span>Other book notes of mine are:</span><br /> <br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<a class='textlink' href='./staff-engineer.html'>2024-10-24 "Staff Engineer" book notes</a><br /> +<a class='textlink' href='./the-stoic-challenge.html'>2024-07-07 "The Stoic Challenge" book notes</a><br /> +<a class='textlink' href='./slow-productivity.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./mind-management.html'>2023-11-11 "Mind Management" book notes</a><br /> +<a class='textlink' href='./career-guide-and-soft-skills.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> +<a class='textlink' href='./the-obstacle-is-the-way.html'>2023-05-06 "The Obstacle is the Way" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./never-split-the-difference.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./the-pragmatic-programmer.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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/notes/the-power-of-neuroplasticity.html b/notes/the-power-of-neuroplasticity.html new file mode 100644 index 00000000..fe361a4b --- /dev/null +++ b/notes/the-power-of-neuroplasticity.html @@ -0,0 +1,135 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>'The Power of Neuroplasticity' book notes</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/notes/the-power-of-neuroplasticity.md">Markdown</a> | <a href="gemini://foo.zone/notes/the-power-of-neuroplasticity.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='the-power-of-neuroplasticity-book-notes'>"The Power of Neuroplasticity" book notes</h1><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#the-power-of-neuroplasticity-book-notes'>"The Power of Neuroplasticity" book notes</a></li> +<li>⇢ <a href='#your-thoughts-can-influence-changes-in-your-brain'>Your thoughts can influence changes in your brain</a></li> +<li>⇢ <a href='#wire-on-what-we-can-do-and-not-what-we-can-t'>Wire on what we can do and not what we can't</a></li> +<li>⇢ <a href='#choose-the-friends-you-spend-time-woth-carefully'>Choose the friends you spend time woth carefully</a></li> +<li>⇢ <a href='#beware-of-the-brain-s-autopilot'>Beware of the brain's autopilot</a></li> +<li>⇢ <a href='#cultiate-a-positive-mindset'>Cultiate a positive mindset</a></li> +<li>⇢ <a href='#the-monkey-mind'>The monkey mind</a></li> +<li>⇢ <a href='#wiring-good-attitudes'>Wiring good attitudes</a></li> +<li>⇢ <a href='#techniques-to-train-the-brain'>Techniques to train the brain</a></li> +<li>⇢ <a href='#meditation-'>Meditation </a></li> +</ul><br /> +<h2 style='display: inline' id='your-thoughts-can-influence-changes-in-your-brain'>Your thoughts can influence changes in your brain</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='wire-on-what-we-can-do-and-not-what-we-can-t'>Wire on what we can do and not what we can't</h2><br /> +<br /> +<span>The direction you want to go is more critical than where you've been. Many people tend to focus on what they can't do. Instead, we should rewire our brains to think about what we can accomplish now. The more you repeat a thought, the stronger the pathways in your brain become. It's a case of 'use it or lose it'.</span><br /> +<br /> +<span>Your environment also plays a role in rewiring your brain, but this can sometimes result in unfavorable outcomes. The world feeds information into your mental computer according to its whims. Mirror neurons fire when we observe another person's behaviors. This is why you yawn when someone else yawns. It's not just actions that get copied, but also feelings and attitudes. When other people influence your thoughts and actions, it's as though they're programming your brain. We have a 'copycat' brain that helps us learn and adapt to the world, forming the basis of empathy.</span><br /> +<br /> +<h2 style='display: inline' id='choose-the-friends-you-spend-time-woth-carefully'>Choose the friends you spend time woth carefully</h2><br /> +<br /> +<span>Choose the friends you spend time with carefully because they can influence your thoughts. Others' opinions are based on their perspectives and not necessarily aligned with yours. While they may not affect your goals and values, they can provide different viewpoints that are worth consideration when you're open to new insights. It's about exercising independence and choosing your influences wisely. Be aware that even television, if left running in the background, can subtly shape your thoughts. Question its influence and consider if there are better ways to spend your time. Your environment can affect your mood, success, and psychological well-being. Choose hobbies that nourish your mind in desirable ways.</span><br /> +<br /> +<h2 style='display: inline' id='beware-of-the-brain-s-autopilot'>Beware of the brain's autopilot</h2><br /> +<br /> +<span>Be mindful of your brain's autopilot mode, which often makes decisions unconsciously, like craving a dessert. It's important to consciously override these automatic behaviors. We're often so preoccupied that we rely on autopilot mode without considering who we really want to be. We need to take charge of our attitudes and feelings. It's a matter of discerning between the mind and the brain.</span><br /> +<br /> +<h2 style='display: inline' id='cultiate-a-positive-mindset'>Cultiate a positive mindset</h2><br /> +<br /> +<span>The seven crucial elements for cultivating a positive mindset are:</span><br /> +<br /> +<ul> +<li>Mindfulness: The more aware you are of your thought processes, the stronger they become. Focused mindfulness can also improve your memory. Evaluate your current actions and question whether they align with your intentions.</li> +<li>Choices: Make deliberate decisions to avoid random influences and create the right thought patterns. This approach is key to forming habits. It's about conscious versus unconscious choices.</li> +<li>Intention: Your intentions and thoughts can influence the outcome. Instead of dwelling on the past, focus on your plans for the future. This mindset will manifest your desired future. For instance, if you mentally visualize lifting heavier weights, you will gain more strength. Intention is the engine of change, both physically and mentally.</li> +<li>Focus: Pay attention to the details of your goals. The more specific you are, the more likely you are to achieve them. For instance, saying "I'm going to Disneyland on July 16th" is more effective than saying "I'm going to Disneyland this summer". If you don't have a clear vision of your goal, your brain may create one that doesn't align with your aspirations. Visualization is key; your brain treats what you imagine as reality.</li> +<li>Repetition: Repeat your goals and intentions from various angles to embed them in your mind. This practice creates neuronal pathways and solidifies habits. </li> +<li>Emotion: Strong emotions make thought patterns more robust. Incorporate feelings into your goals to strengthen your mental attachment to them. For example, if you associate a goal with joy and satisfaction, it becomes easier to achieve. On the other hand, negative emotions like anger can lower your effective IQ. Visualize the success and positive outcomes associated with your goals. Use elements like music and physical movements to help generate positive emotions. These make the rewiring process more effective, and the new neurological paths stronger and more long-lasting.</li> +<li>Belief: This is the spiritual component of success. People who confidently believe in their abilities and outcomes tend to achieve better results than those who don't.</li> +</ul><br /> +<span>They all work together, so apply and practise of all of them. </span><br /> +<br /> +<h2 style='display: inline' id='the-monkey-mind'>The monkey mind</h2><br /> +<br /> +<span>"Mental noise," also known as the "monkey mind," is an indication of our active brain; these voices are not your true self. By listening to them, you can choose what to accept and what to ignore. It's like your mind running on autopilot. These voices are the programs stored in your brain over the years. They critically influence over 90 percent of your decisions. The way you talk to yourself programs your brain. Negative self-talk can be self-detrimental, while positive self-talk can be constructive. Conscious positive self-talk is the source of success and is always effective. The way you talk to yourself can mean the difference between success and failure. Listening passively to positive self-talk in the background can be beneficial, as well as before a meeting or other significant events.</span><br /> +<br /> +<h2 style='display: inline' id='wiring-good-attitudes'>Wiring good attitudes</h2><br /> +<br /> +<span>Attitudes can form either good or bad habits, and altering these attitudes can be beneficial. Attitudes can be controlled by our will, a choice that we can actively make. Foster and practice positive neuronal pathways, as it's a case of "use it or lose it." For example, anger and jealousy are automatic attitudes that we can control by mindfully thinking about them. We are not born with these attitudes; we learn them. Make a conscious choice about your attitude for the next day on the night before.</span><br /> +<br /> +<span>With this clear and mindful choice, you'll have a better day laying down the construction lines to be built with repetition. Ask yourself, "Who is directing my attitude now?" and recalibrate as needed. Music is a safe and accessible means of initiating positive attitudes. It can be used to help associate a particular action, such as writing or programming, with a positive attitude. The easiest way to change an attitude is through self-talk.</span><br /> +<br /> +<span>Top attitudes to wire in (post them at the wall to remember them):</span><br /> +<br /> +<ul> +<li>Love</li> +<li>Optimism</li> +<li>Peace and Serenity (tranquillity)</li> +<li>Kindness and harmony</li> +<li>Determination and focus</li> +<li>Intuition and awareness</li> +<li>Spiritual well-being</li> +<li>Service to others</li> +<li>Thankfulness, read the list</li> +<li>Forgiveness, all others and also myself</li> +<li>Healthiness</li> +<li>Patients, removing stress</li> +<li>Success</li> +</ul><br /> +<h2 style='display: inline' id='techniques-to-train-the-brain'>Techniques to train the brain</h2><br /> +<br /> +<span>To train your brain:</span><br /> +<br /> +<ul> +<li>Remember grocery list</li> +<li>Learn a new language</li> +<li>Meditation</li> +<li>Read books about topics you don't know about yet</li> +<li>Exercise</li> +<li>Games which are challenging</li> +<li>Write a book or blog</li> +</ul><br /> +<span>Each of these attitudes helps to wire and pattern your brain for growth. Actively participate in activities that reinforce these attitudes, repeat them, and keep doing them. Real focus is not a casual event. The activities should be fun but must also present a reasonable challenge. Think of it as growing a garden, but with your brain's neurons. The more emotional involvement you have, the stronger the rewiring will be. Love your activities and approach them with enthusiasm.</span><br /> +<br /> +<h2 style='display: inline' id='meditation-'>Meditation </h2><br /> +<br /> +<span>Meditation changes the physical structure of your brain. It's a focusing tool for your mind.</span><br /> +<br /> +<ul> +<li>Find time and place for meditation.</li> +<li>Sit in a comfortable position</li> +<li>Close your eyes and relax (Note: some recommend keeping eyes open during meditation).</li> +<li>Breathe deeply and slowly.</li> +<li>Repeat or focus on a word (e.g., "acceptance" or "this is it").</li> +<li>Ignore the past and future, focus on your central point (e.g., the task at hand).</li> +<li>Let other thoughts pass, but don't fight them</li> +<li>Reward yourself for not thinking about clutter; let your mind become free of distractions.</li> +<li>Listen to yourself, ask questions, you will receive short precise</li> +<li>Relax, breath</li> +<li>Reflect..</li> +</ul><br /> +<span>Meditation is about letting go of expectations. Every practice is unique and personal.</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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/notes/the-pragmatic-programmer.html b/notes/the-pragmatic-programmer.html index 1ac45d3e..ad4d27d8 100644 --- a/notes/the-pragmatic-programmer.html +++ b/notes/the-pragmatic-programmer.html @@ -8,7 +8,10 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>"The Pragmatic Programmer" book notes</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/notes/the-pragmatic-programmer.md">Markdown</a> | <a href="gemini://foo.zone/notes/the-pragmatic-programmer.gmi">Gemini</a> +</p> +<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 /> @@ -59,7 +62,7 @@ <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'>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 /> @@ -70,7 +73,7 @@ </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'>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 /> @@ -83,7 +86,7 @@ </ul><br /> <span>It's your life. Share it, celebrate it, be proud and have fun.</span><br /> <br /> -<h2 style='display: inline'>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 /> @@ -91,22 +94,24 @@ <br /> <span>By working together, everyone contributes what they can, achieving a greater good together.</span><br /> <br /> -<span>Other book notes of mine are:</span><br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</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 /> +<span>Other book notes of mine are:</span><br /> <br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<a class='textlink' href='./staff-engineer.html'>2024-10-24 "Staff Engineer" book notes</a><br /> +<a class='textlink' href='./the-stoic-challenge.html'>2024-07-07 "The Stoic Challenge" book notes</a><br /> +<a class='textlink' href='./slow-productivity.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./mind-management.html'>2023-11-11 "Mind Management" book notes</a><br /> +<a class='textlink' href='./career-guide-and-soft-skills.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> +<a class='textlink' href='./the-obstacle-is-the-way.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> +<a class='textlink' href='./never-split-the-difference.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./the-pragmatic-programmer.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 /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/notes/the-science-of-living.html b/notes/the-science-of-living.html new file mode 100644 index 00000000..cca5a9b4 --- /dev/null +++ b/notes/the-science-of-living.html @@ -0,0 +1,73 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>'Science of Living' book notes</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/notes/the-science-of-living.md">Markdown</a> | <a href="gemini://foo.zone/notes/the-science-of-living.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='science-of-living-book-notes'>"Science of Living" book notes</h1><br /> +<br /> +<span>These notes capture key points from "The Science of Living" by Stuart Farrimond. These are for my personal use, but you might find them useful, too.</span><br /> +<br /> +<h2 style='display: inline' id='morning-routine'>Morning Routine</h2><br /> +<br /> +<span>Don't check email or to-do lists in the first hour after awakening to avoid anxiety. Drink coffee 2 to 3 hours after waking when cortisol levels are waning. To wake up, try a cold splash shower in the morning to raise cortisol levels, similar to a caffeine kick. Light exercise in the morning can increase mood and mental performance.</span><br /> +<br /> +<h2 style='display: inline' id='sleep-hygiene'>Sleep Hygiene</h2><br /> +<br /> +<span>Take a warm bath 90 minutes before sleep to promote good sleep. Avoid washing for too long to retain the body's natural oils. Try to get at least 7 to 8 hours of sleep for optimum rest. Don't exercise after 8 PM to ensure good sleep.</span><br /> +<br /> +<h2 style='display: inline' id='nutrition-and-digestion'>Nutrition and Digestion</h2><br /> +<br /> +<span>Consume foods with lots of fiber, aiming for 30g per day. Avoid highly processed foods and prefer minimally processed grains like unrefined oats over highly refined cornflakes. Fiber slows down digestion and keeps you satiated. Juices are sugary and bad for your teeth.</span><br /> +<br /> +<h2 style='display: inline' id='oral-health'>Oral Health</h2><br /> +<br /> +<span>Bad breath can be related to microorganisms in your mouth. Fluoride helps prevent tooth decay rather than the frequency of brushing. Use toothpaste with 1450-1500 ppm fluoride and leave it in your mouth for optimal effect. Brush gently and avoid using mouthwash for 30 minutes after brushing to prevent washing away the fluoride. Use plaque-disclosing tablets to see missed parts while brushing.</span><br /> +<br /> +<h2 style='display: inline' id='hydration'>Hydration</h2><br /> +<br /> +<ul> +<li>Only drink water as much as you feel thirsty, e.g., one and a half liters daily.</li> +<li>Avoid eating when stressed, as it can lead to overeating and increased hunger.</li> +</ul><br /> +<h2 style='display: inline' id='exercise'>Exercise</h2><br /> +<br /> +<ul> +<li>37 percent of the genes can influence eagerness to exercise.</li> +<li>Only light exercise is recommended in the morning.</li> +<li>Mood-enhancing jogging or cross-training releases more endorphins than aerobic exercise.</li> +<li>Exercise is best done near meal times.</li> +</ul><br /> +<h2 style='display: inline' id='productivity'>Productivity</h2><br /> +<br /> +<span>Virtual commuting can help mark the start and end of the workday. Physical tasks are better done in the afternoon. Background music can improve productivity. Taking regular breaks can help you think outside the box. Incorporating plants can improve productivity by up to 15% and reduce CO2.</span><br /> +<br /> +<h2 style='display: inline' id='emotional-and-social-well-being'>Emotional and Social Well-being</h2><br /> +<br /> +<span>Engage in weekly intimacy, which can increase happiness with a partner. Trans fats are harmful, but regular fats can make food taste better. The brain influences brown fat, acting like a body oven. Hugs, even with animals, have emotional benefits and can reduce stress.</span><br /> +<br /> +<h2 style='display: inline' id='intuition-and-decision-making'>Intuition and Decision-Making</h2><br /> +<br /> +<span>Trust professional intuition only if you are familiar with the situation. The more complex the problem, the better it is to rely on gut instinct rather than overanalyzing.</span><br /> +<br /> +<h2 style='display: inline' id='miscellaneous'>Miscellaneous</h2><br /> +<br /> +<span>Watching a scary movie can amplify your feelings for another person.</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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/notes/the-stoic-challenge.html b/notes/the-stoic-challenge.html index 19f7465a..2e673cfe 100644 --- a/notes/the-stoic-challenge.html +++ b/notes/the-stoic-challenge.html @@ -8,9 +8,36 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>"The Stoic Challenge" book notes</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/notes/the-stoic-challenge.md">Markdown</a> | <a href="gemini://foo.zone/notes/the-stoic-challenge.gmi">Gemini</a> +</p> +<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 /> +<span>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. </span><br /> <br /> -<span class='quote'>Last updated 29.5.2022</span><br /> +<pre> + ,.......... .........., + ,..,' '.' ',.., + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,'............., : ,.............', ', +,' '............ '.' ............' ', + '''''''''''''''''';''';'''''''''''''''''' + ''' +</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 /> @@ -22,7 +49,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'>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 /> @@ -32,7 +59,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'>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 /> @@ -44,11 +71,22 @@ <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='./staff-engineer.html'>2024-10-24 "Staff Engineer" book notes</a><br /> +<a class='textlink' href='./the-stoic-challenge.html'>2024-07-07 "The Stoic Challenge" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./slow-productivity.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./mind-management.html'>2023-11-11 "Mind Management" book notes</a><br /> +<a class='textlink' href='./career-guide-and-soft-skills.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> +<a class='textlink' href='./the-obstacle-is-the-way.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> +<a class='textlink' href='./never-split-the-difference.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./the-pragmatic-programmer.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> +<br /> <a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> diff --git a/notes/when.html b/notes/when.html new file mode 100644 index 00000000..a480bda4 --- /dev/null +++ b/notes/when.html @@ -0,0 +1,115 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>'When: The Scientific Secrets of Perfect Timing' book notes</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<link rel="stylesheet" href="../style.css" /> +<link rel="stylesheet" href="style-override.css" /> +</head> +<body> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/notes/when.md">Markdown</a> | <a href="gemini://foo.zone/notes/when.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='when-the-scientific-secrets-of-perfect-timing-book-notes'>"When: The Scientific Secrets of Perfect Timing" book notes</h1><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#when-the-scientific-secrets-of-perfect-timing-book-notes'>"When: The Scientific Secrets of Perfect Timing" book notes</a></li> +<li>⇢ <a href='#daily-rhythms'>Daily Rhythms</a></li> +<li>⇢ <a href='#optimal-task-timing'>Optimal Task Timing</a></li> +<li>⇢ <a href='#exercise-timing'>Exercise Timing</a></li> +<li>⇢ <a href='#drinking-habits'>Drinking Habits</a></li> +<li>⇢ <a href='#afternoon-challenges-bermuda-triangle'>Afternoon Challenges ("Bermuda Triangle")</a></li> +<li>⇢ <a href='#breaks-and-productivity'>Breaks and Productivity</a></li> +<li>⇢ <a href='#napping'>Napping</a></li> +<li>⇢ <a href='#scheduling-breaks'>Scheduling Breaks</a></li> +<li>⇢ <a href='#final-impressions'>Final Impressions</a></li> +<li>⇢ <a href='#the-midlife-u-curve'>The Midlife U Curve</a></li> +<li>⇢ <a href='#project-management-tips'>Project Management Tips</a></li> +</ul><br /> +<span>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:</span><br /> +<br /> +<a class='textlink' href='https://www.danpink.com/mctq/'>Chronotype Assessment</a><br /> +<br /> +<span>Following your chronotype can lead to more happiness and higher job satisfaction.</span><br /> +<br /> +<h2 style='display: inline' id='daily-rhythms'>Daily Rhythms</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='optimal-task-timing'>Optimal Task Timing</h2><br /> +<br /> +<ul> +<li>Analytical work requiring sharpness and focus is best at the peak.</li> +<li>Creative work is more effective during non-peak times.</li> +<li>Biorhythms can sway performance by up to twenty percent.</li> +</ul><br /> +<h2 style='display: inline' id='exercise-timing'>Exercise Timing</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='drinking-habits'>Drinking Habits</h2><br /> +<br /> +<ul> +<li>Drink water in the morning to counter mild dehydration upon waking.</li> +<li>Delay coffee consumption until cortisol production peaks an hour or 90 minutes after waking. This helps avoid caffeine resistance.</li> +<li>For an afternoon boost, have coffee once cortisol levels drop.</li> +</ul><br /> +<h2 style='display: inline' id='afternoon-challenges-bermuda-triangle'>Afternoon Challenges ("Bermuda Triangle")</h2><br /> +<br /> +<ul> +<li>Mistakes are more common in hospitals during this period, like incorrect antibiotic subscriptions or missed handwashing.</li> +<li>Traffic accidents and unfavorable judge decisions occur more frequently in the afternoon.</li> +<li>2:55 pm is the least productive time of the day.</li> +</ul><br /> +<h2 style='display: inline' id='breaks-and-productivity'>Breaks and Productivity</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='napping'>Napping</h2><br /> +<br /> +<span>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.</span><br /> +<br /> +<h2 style='display: inline' id='scheduling-breaks'>Scheduling Breaks</h2><br /> +<br /> +<ul> +<li>Track breaks just as you do with tasks—aim for three breaks a day.</li> +<li>Every 25 minutes, look away and daydream for 20 seconds, or engage in short exercises.</li> +<li>Meditating for even three minutes is a highly effective restorative activity.</li> +<li>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.</li> +</ul><br /> +<h2 style='display: inline' id='final-impressions'>Final Impressions</h2><br /> +<br /> +<span>- The concluding experience of a vacation significantly influences overall memories.</span><br /> +<span>- Restaurant reviews often hinge on the end of the visit, highlighting extras like wrong bills or additional desserts.</span><br /> +<span>- Considering one's older future self can motivate improvements in the present.</span><br /> +<br /> +<h2 style='display: inline' id='the-midlife-u-curve'>The Midlife U Curve</h2><br /> +<br /> +<span>Life satisfaction tends to dip in midlife, around the forties, but increases around age 54.</span><br /> +<br /> +<h2 style='display: inline' id='project-management-tips'>Project Management Tips</h2><br /> +<br /> +<ul> +<li>Halfway through a project, there's a concentrated work effort ("Oh Oh Effect"), similar to an alarm when slightly behind schedule.</li> +<li>Recognizing daily accomplishments can elevate motivation and satisfaction.</li> +</ul><br /> +<span>These insights from "When" can guide actions to optimize performance, well-being, and satisfaction across various aspects of life.</span><br /> +<br /> +<span>Other book notes of mine are:</span><br /> +<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 /> +<p class="footer"> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> +</p> +</body> +</html> diff --git a/other-resources.html b/other-resources.html deleted file mode 100644 index 4fc225d5..00000000 --- a/other-resources.html +++ /dev/null @@ -1,23 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<title>Other resources</title> -<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> -<link rel="stylesheet" href="style.css" /> -<link rel="stylesheet" href="style-override.css" /> -</head> -<body> -<h1 style='display: inline'>Other resources</h1><br /> -<br /> -<span>Please go to:</span><br /> -<br /> -<a class='textlink' href='https://paul.buetow.org/other-resources.html'>https://paul.buetow.org/other-resources.html</a><br /> -<a class='textlink' href='gemini://paul.buetow.org/other-resources.gmi'>gemini://paul.buetow.org/other-resources.gmi</a><br /> -<p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> -</p> -</body> -</html> diff --git a/projects.html b/projects.html deleted file mode 100644 index 27d7d371..00000000 --- a/projects.html +++ /dev/null @@ -1,37 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<title>Projects</title> -<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> -<link rel="stylesheet" href="style.css" /> -<link rel="stylesheet" href="style-override.css" /> -</head> -<body> -<h1 style='display: inline'>Projects</h1><br /> -<br /> -<span class='quote'>This site was last updated at Sat 25 Mar 20:53:33 EET 2023</span><br /> -<br /> -<span>This is a "hidden" site listing my personal project list priorities!</span><br /> -<br /> -<ul> -<li>Finish and release <span class='inlinecode'>guprecords 2.0.0</span> (Raku)</li> -<li>Blog about Raku and <span class='inlinecode'>guprecords</span> (Raku)</li> -<li>Start blog series about Algorithms in Go (Golang)</li> -<li>Update dependencies and release <span class='inlinecode'>DTail 4.1.1</span> (Golang)</li> -<li>Read "The Go Notebook" and blog about it (Golang)</li> -<li>Work through "Bash it out" challenges (Bash)</li> -<li>Read "Programming Ruby (3.2)" (Ruby)</li> -<li>Try out <span class='inlinecode'>kickstart.nvim</span> or AstroVim (NeoVim)</li> -<li>Try out <span class='inlinecode'>Ruby LSP</span> in NeoVim, which is not Solar (NeoVim)</li> -<li>Finish <span class='inlinecode'>failunderd 1.0</span> (Perl or Golang)</li> -<li>Rewrite site stats script (Perl or Raku)</li> -<li>Modernise my NextCloud and Wallabag infra (Linux, Docker)</li> -<li>Release <span class='inlinecode'>Gemtexter 2.1.0</span> and blog about it (Bash)</li> -<p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> -</p> -</body> -</html> diff --git a/resources.html b/resources.html deleted file mode 100644 index ea1b3952..00000000 --- a/resources.html +++ /dev/null @@ -1,23 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<title>Resources</title> -<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> -<link rel="stylesheet" href="style.css" /> -<link rel="stylesheet" href="style-override.css" /> -</head> -<body> -<h1 style='display: inline'>Resources</h1><br /> -<br /> -<span>Please go to:</span><br /> -<br /> -<a class='textlink' href='https://paul.buetow.org/resources.html'>https://paul.buetow.org/resources.html</a><br /> -<a class='textlink' href='gemini://paul.buetow.org/resources.gmi'>gemini://paul.buetow.org/resources.gmi</a><br /> -<p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> -</p> -</body> -</html> diff --git a/site-mirrors.html b/site-mirrors.html index 984109a6..bfd0cb1b 100644 --- a/site-mirrors.html +++ b/site-mirrors.html @@ -8,28 +8,31 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>Site mirrors</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/site-mirrors.md">Markdown</a> | <a href="gemini://foo.zone/site-mirrors.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='site-mirrors'>Site mirrors</h1><br /> <br /> <span>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.</span><br /> <br /> -<span>All sites listed below are reachable via IPv4 as well as via IPv6.</span><br /> +<span>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). </span><br /> <br /> -<h2 style='display: inline'>Gemini protocol</h2><br /> +<a class='textlink' href='./gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.html'>Wondering how's decided what's the master and what's the standby host?</a><br /> <br /> -<a class='textlink' href='gemini://foo.zone'>gemini://foo.zone - Falkenstein, Germany (Hetzner Cloud)</a><br /> -<a class='textlink' href='gemini://www.foo.zone'>gemini://www.foo.zone - Amsterdam, Netherlands (OpenBSD.Amsterdam)</a><br /> +<h2 style='display: inline' id='gemini-protocol'>Gemini protocol</h2><br /> <br /> -<span>Wondering what's the Gemini protocol about? Read:</span><br /> +<a class='textlink' href='gemini://foo.zone'>gemini://foo.zone</a><br /> +<a class='textlink' href='gemini://standby.foo.zone'>gemini://standby.foo.zone</a><br /> <br /> -<a class='textlink' href='./gemfeed/2021-04-24-welcome-to-the-geminispace.html'>Welcome to the Geminispace</a><br /> +<a class='textlink' href='./gemfeed/2021-04-24-welcome-to-the-geminispace.html'>Wondering what's the Gemini protocol about?</a><br /> <br /> -<h2 style='display: inline'>HTTP protocol</h2><br /> +<h2 style='display: inline' id='http-protocol'>HTTP protocol</h2><br /> <br /> -<a class='textlink' href='https://foo.zone'>https://foo.zone - Falkenstein, Germany (Hetzner Cloud)</a><br /> -<a class='textlink' href='https://www.foo.zone'>https://www.foo.zone - Amsterdam, Netherlands (OpenBSD.Amsterdam)</a><br /> +<a class='textlink' href='https://foo.zone'>https://foo.zone</a><br /> +<a class='textlink' href='https://standby.foo.zone'>https://standby.foo.zone</a><br /> <a class='textlink' href='https://www2.buetow.org'>https://www2.buetow.org - Codeberg page, somewhere in Germany</a><br /> <br /> -<h2 style='display: inline'>OpenBSD.Amsterdam</h2><br /> +<h2 style='display: inline' id='openbsdamsterdam'>OpenBSD.Amsterdam</h2><br /> <br /> <span>Looking for opinionated OpenBSD VMs? Go to:</span><br /> <br /> @@ -39,9 +42,9 @@ <br /> <a class='textlink' href='./'>Go back to the main site</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> @@ -4,6 +4,11 @@ } @font-face { + font-family: 'heading'; + src: url("./heading.ttf") format("truetype"); +} + +@font-face { font-family: 'code'; src: url("./code.ttf") format("truetype"); } @@ -13,96 +18,80 @@ src: url("./handnotes.ttf") format("truetype"); } -@font-face { - font-family: 'typewriter'; - src: url("./typewriter.ttf") format("truetype"); +html { + background-image: radial-gradient(#cccccc 2px, transparent 2px); + background-size: 32px 32px; + background-color: #ffffff; } body { - font-family: text; - max-width: 1024px; - padding: 20px 20px; - margin: 20px auto; - border-image: linear-gradient(#f6b73c, #4d9f0c) 30; - border-width: 1px; - border-style: solid; + font-family: text, sans-serif; + background: #ffffff; + max-width: 1200px; + padding: 20px; + margin: 20px auto; + border: 5px solid #eeeeee; + border-radius: 15px; + word-wrap: break-word; } h1, h2, h3 { - background: -webkit-linear-gradient(#f6b73c, #4d9f0c); - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; + font-family: heading, serif; } a { - text-decoration: none; + font-family: code, monospace; + text-decoration: none; + color: #666666; + padding: 0 0 0 0; } a:hover { - text-decoration: underline; + text-decoration: underline; } a.textlink:before { - content: "⇒ "; - padding-left: 11px; + content: "⇒ "; } .quote { - font-style: italic; + font-style: italic; } .quote:before { - content: "« "; - padding-left: 2px; + content: "« "; + padding-left: 2px; } .quote:after { - content: " »"; - padding-right: 2px; + content: " »"; + padding-right: 2px; } ul { - list-style: none; - padding-right: 23px; - padding-left: 10px; - margin: 0.75em 0 0.75em 0; -} - -li { - color: purple; - margin-left: 1em; - margin-bottom: 0.25em; + list-style: none; + margin: 0 0 0 0; + padding: 0 0 0 0; } li:before { - content: "★"; - padding-right: 5px; + content: "★"; + padding-right: 5px; } img { - max-width: 90%; - display: block; - margin: auto; - border: 1px solid #333333; + max-width: 90%; } pre { - font-family: code; - padding: 0; - overflow-x: auto; - scrollbar-width: none; - margin-left: 23px; - margin-right: 23px; - padding: 23px; - border-image: linear-gradient(#f6b73c, #4d9f0c) 30; - border-width: 3px; - border-style: solid; - color: grey; + font-family: code, monospace; + padding: 20px; + border: 1px solid #dddddd; + border-radius: 15px; } span.inlinecode { - font-family: code; - border: 1px solid #000000; - padding: 1px; - color: grey; + font-family: code, monospace; + border: 1px solid #999999; + border-radius: 2px; } diff --git a/testpage.html b/testpage.html index 36844496..b06ccf9a 100644 --- a/testpage.html +++ b/testpage.html @@ -8,16 +8,19 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>This is a <span class='inlinecode'>test</span> page!</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/testpage.md">Markdown</a> | <a href="gemini://foo.zone/testpage.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='this-is-a-test-page'>This is a <span class='inlinecode'>test</span> page!</h1><br /> <br /> <span class='quote'>A <span class='inlinecode'>test</span> page this is!</span><br /> <br /> <span> Gefallen <span class='inlinecode'>eigentum</span> schuppen so ei feinheit. Gegen er kinde kenne mu se. Im zu sauber labsal werden en heraus sterne mu. Trostlos der das streckte gefallts ins tag begierig. Gebrauch eleonora horchend gedanken als ich befehlen. Geschirr manchmal an spateren hinunter es sichtbar er ri einander. Herkommen betrubtes einfacher es so am kreiselnd verwegene schnupfen. </span><br /> <br /> -<h2 style='display: inline'>Header 2 jo <span class='inlinecode'>yay</span> jo</h2><br /> +<h2 style='display: inline' id='header-2-jo-yay-jo'>Header 2 jo <span class='inlinecode'>yay</span> jo</h2><br /> <span>So argerlich gewachsen lohgruben lieblinge schranken an. Reinlich richtete hinunter einander herunter sog fur bezahlen den. Du stimme kohlen besser du. Im fu kiste en steht sagst zu sitte. Sog igen trug das noch. Barbieren schnupfen gescheite wu en. Ubelnehmen kindlichen des sog hoffnungen vom und aufgespart. </span><br /> <br /> -<h3 style='display: inline'>Header 3 jo <span class='inlinecode'>yay</span> jo</h3><br /> +<h3 style='display: inline' id='header-3-jo-yay-jo'>Header 3 jo <span class='inlinecode'>yay</span> jo</h3><br /> <span>Dessen mag lehren lassig der leuten. Wu wangen du husten da schlie ku gebaut. Fingern stunden lauernd schonen sonntag sie auf. Am hell lust habs in wohl sein kerl. Mudigkeit schreibet gar einfacher ehe schonheit. Feierabend dazwischen pa wahrhaftig launischen im es in. Ri em im drechslers wohnzimmer so messingnen nachmittag verrichtet vergnugter. Nachmittag werkstatte tag scherzwort bin uns verrichtet frohlicher ihm bescheiden. </span><br /> <br /> <span> * Entry 1 jo <span class='inlinecode'>yay</span> jo</span><br /> @@ -46,31 +49,31 @@ by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#0000FF">if</font></b> <font color="#990000">[</font> -f <font color="#FF0000">"foo"</font> <font color="#990000">];</font> <b><font color="#0000FF">then</font></b> +<pre><b><u><font color="#000000">if</font></u></b> [ -f <font color="#808080">"foo"</font> ]; <b><u><font color="#000000">then</font></u></b> echo foo -<b><font color="#0000FF">else</font></b> +<b><u><font color="#000000">else</font></u></b> echo bar -<b><font color="#0000FF">fi</font></b> +<b><u><font color="#000000">fi</font></u></b> </pre> <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="#9A1900"># Jo</font></i> -❯ <b><font color="#0000FF">exec</font></b> <font color="#993399">5</font><font color="#990000"><></font>/dev/tcp/google<font color="#990000">.</font>de<font color="#990000">/</font><font color="#993399">80</font> -❯ echo -e <font color="#FF0000">"GET / HTTP/1.1</font><font color="#CC33CC">\n</font><font color="#FF0000">host: google.de</font><font color="#CC33CC">\n\n</font><font color="#FF0000">"</font> <font color="#990000">>&</font><font color="#993399">5</font> -❯ cat <font color="#990000"><&</font><font color="#993399">5</font> <font color="#990000">|</font> head -HTTP<font color="#990000">/</font><font color="#993399">1.1</font> <font color="#993399">301</font> Moved Permanently -Location<font color="#990000">:</font> http<font color="#990000">:</font>//www<font color="#990000">.</font>google<font color="#990000">.</font>de<font color="#990000">/</font> -Content-Type<font color="#990000">:</font> text/html<font color="#990000">;</font> <font color="#009900">charset</font><font color="#990000">=</font>UTF-<font color="#993399">8</font> -Date<font color="#990000">:</font> Thu<font color="#990000">,</font> <font color="#993399">18</font> Nov <font color="#993399">2021</font> <font color="#993399">08</font><font color="#990000">:</font><font color="#993399">27</font><font color="#990000">:</font><font color="#993399">18</font> GMT -Expires<font color="#990000">:</font> Sat<font color="#990000">,</font> <font color="#993399">18</font> Dec <font color="#993399">2021</font> <font color="#993399">08</font><font color="#990000">:</font><font color="#993399">27</font><font color="#990000">:</font><font color="#993399">18</font> GMT -Cache-Control<font color="#990000">:</font> public<font color="#990000">,</font> max-age<font color="#990000">=</font><font color="#993399">2592000</font> -Server<font color="#990000">:</font> gws -Content-Length<font color="#990000">:</font> <font color="#993399">218</font> -X-XSS-Protection<font color="#990000">:</font> <font color="#993399">0</font> -X-Frame-Options<font color="#990000">:</font> SAMEORIGIN +<pre><i><font color="silver"># Jo</font></i> +❯ <b><u><font color="#000000">exec</font></u></b> <font color="#000000">5</font><>/dev/tcp/google.de/<font color="#000000">80</font> +❯ echo -e <font color="#808080">"GET / HTTP/1.1</font>\n<font color="#808080">host: google.de</font>\n\n<font color="#808080">"</font> >&<font color="#000000">5</font> +❯ cat <&<font color="#000000">5</font> | head +HTTP/<font color="#000000">1.1</font> <font color="#000000">301</font> Moved Permanently +Location: http://www.google.de/ +Content-Type: text/html; charset=UTF-<font color="#000000">8</font> +Date: Thu, <font color="#000000">18</font> Nov <font color="#000000">2021</font> <font color="#000000">08</font>:<font color="#000000">27</font>:<font color="#000000">18</font> GMT +Expires: Sat, <font color="#000000">18</font> Dec <font color="#000000">2021</font> <font color="#000000">08</font>:<font color="#000000">27</font>:<font color="#000000">18</font> GMT +Cache-Control: public, max-age=<font color="#000000">2592000</font> +Server: gws +Content-Length: <font color="#000000">218</font> +X-XSS-Protection: <font color="#000000">0</font> +X-Frame-Options: SAMEORIGIN </pre> <br /> <span>Foo0</span><br /> @@ -85,7 +88,7 @@ X-Frame-Options<font color="#990000">:</font> SAMEORIGIN <br /> <span>Bar2</span><br /> <br /> -<h3 style='display: inline'>OK</h3><br /> +<h3 style='display: inline' id='ok'>OK</h3><br /> <br /> <span>ok</span><br /> <br /> @@ -94,9 +97,9 @@ X-Frame-Options<font color="#990000">:</font> SAMEORIGIN <a class='textlink' href='https://foo.zone'>https://foo.zone</a><br /> <a class='textlink' href='https://foo.zone'>link</a><br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> Binary files differdiff --git a/typewriter.ttf b/typewriter.ttf Binary files differdeleted file mode 100644 index 375978ce..00000000 --- a/typewriter.ttf +++ /dev/null diff --git a/uptime-stats.html b/uptime-stats.html index 730b307d..85eee84f 100644 --- a/uptime-stats.html +++ b/uptime-stats.html @@ -8,9 +8,12 @@ <link rel="stylesheet" href="style-override.css" /> </head> <body> -<h1 style='display: inline'>My machine uptime stats</h1><br /> +<p class="header"> +<a href="https://foo.zone">Home</a> | <a href="https://codeberg.org/snonux/foo.zone/src/branch/content-md/uptime-stats.md">Markdown</a> | <a href="gemini://foo.zone/uptime-stats.gmi">Gemini</a> +</p> +<h1 style='display: inline' id='my-machine-uptime-stats'>My machine uptime stats</h1><br /> <br /> -<span class='quote'>This site was last updated at 2023-11-11T22:22:24+02:00</span><br /> +<span class='quote'>This site was last updated at 2025-02-21T11:07:08+02:00</span><br /> <br /> <span>The following stats were collected via <span class='inlinecode'>uptimed</span> on all of my personal computers over many years and the output was generated by <span class='inlinecode'>guprecords</span>, the global uptime records stats analyser of mine.</span><br /> <br /> @@ -23,303 +26,10 @@ <br /> <a class='textlink' href='./gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.html'>Unveiling <span class='inlinecode'>guprecords.raku</span>: Uptime records with Raku</a><br /> <br /> -<h2 style='display: inline'>Top 20 Boots's by Host</h2><br /> -<br /> -<span>Boots is the total number of host boots over the entire lifespan.</span><br /> -<br /> -<pre> -+-----+----------------+-------+ -| Pos | Host | Boots | -+-----+----------------+-------+ -| 1. | alphacentauri | 671 | -| 2. | mars | 207 | -| 3. | uranus | 168 | -| 4. | callisto | 153 | -| 5. | dionysus | 136 | -| 6. | tauceti-e | 120 | -| 7. | *earth | 107 | -| 8. | pluto | 51 | -| 9. | *mega15289 | 50 | -| 10. | makemake | 50 | -| 11. | *t450 | 45 | -| 12. | phobos | 40 | -| 13. | mega8477 | 40 | -| 14. | sun | 33 | -| 15. | vulcan | 19 | -| 16. | *blowfish | 19 | -| 17. | tauceti | 16 | -| 18. | sagittarius | 15 | -| 19. | deltavega | 12 | -| 20. | *fishfinger | 11 | -+-----+----------------+-------+ -</pre> -<br /> -<h2 style='display: inline'>Top 20 Uptime's by Host</h2><br /> -<br /> -<span>Uptime is the total uptime of a host over the entire lifespan.</span><br /> -<br /> -<pre> -+-----+----------------+-----------------------------+ -| Pos | Host | Uptime | -+-----+----------------+-----------------------------+ -| 1. | vulcan | 4 years, 5 months, 6 days | -| 2. | uranus | 3 years, 11 months, 29 days | -| 3. | sun | 3 years, 9 months, 26 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. | tauceti | 2 years, 3 months, 19 days | -| 8. | *mega15289 | 1 years, 10 months, 14 days | -| 9. | tauceti-f | 1 years, 9 months, 18 days | -| 10. | *earth | 1 years, 9 months, 16 days | -| 11. | *blowfish | 1 years, 9 months, 6 days | -| 12. | mega8477 | 1 years, 3 months, 25 days | -| 13. | host0 | 1 years, 3 months, 9 days | -| 14. | tauceti-e | 1 years, 2 months, 20 days | -| 15. | makemake | 1 years, 1 months, 25 days | -| 16. | *fishfinger | 1 years, 1 months, 3 days | -| 17. | callisto | 0 years, 10 months, 31 days | -| 18. | alphacentauri | 0 years, 10 months, 28 days | -| 19. | london | 0 years, 9 months, 16 days | -| 20. | twofish | 0 years, 8 months, 31 days | -+-----+----------------+-----------------------------+ -</pre> -<br /> -<h2 style='display: inline'>Top 20 Score's by Host</h2><br /> -<br /> -<span>Score is calculated by combining all other metrics.</span><br /> -<br /> -<pre> -+-----+----------------+-------+ -| Pos | Host | Score | -+-----+----------------+-------+ -| 1. | uranus | 313 | -| 2. | vulcan | 275 | -| 3. | sun | 238 | -| 4. | uugrn | 211 | -| 5. | alphacentauri | 201 | -| 6. | deltavega | 193 | -| 7. | pluto | 182 | -| 8. | dionysus | 156 | -| 9. | tauceti | 141 | -| 10. | *mega15289 | 130 | -| 11. | *earth | 125 | -| 12. | *blowfish | 110 | -| 13. | tauceti-f | 108 | -| 14. | tauceti-e | 96 | -| 15. | makemake | 90 | -| 16. | callisto | 86 | -| 17. | mega8477 | 80 | -| 18. | host0 | 76 | -| 19. | *fishfinger | 67 | -| 20. | mars | 67 | -+-----+----------------+-------+ -</pre> -<br /> -<h2 style='display: inline'>Top 20 Downtime's by Host</h2><br /> -<br /> -<span>Downtime is the total downtime of a host over the entire lifespan.</span><br /> -<br /> -<pre> -+-----+----------------+-----------------------------+ -| Pos | Host | Downtime | -+-----+----------------+-----------------------------+ -| 1. | dionysus | 8 years, 3 months, 16 days | -| 2. | alphacentauri | 5 years, 11 months, 18 days | -| 3. | uranus | 3 years, 5 months, 8 days | -| 4. | callisto | 1 years, 5 months, 15 days | -| 5. | makemake | 1 years, 3 months, 26 days | -| 6. | mars | 1 years, 2 months, 10 days | -| 7. | tauceti-e | 0 years, 12 months, 9 days | -| 8. | *mega15289 | 0 years, 9 months, 23 days | -| 9. | *t450 | 0 years, 9 months, 17 days | -| 10. | sirius | 0 years, 8 months, 20 days | -| 11. | *earth | 0 years, 5 months, 24 days | -| 12. | deimos | 0 years, 5 months, 15 days | -| 13. | joghurt | 0 years, 2 months, 9 days | -| 14. | host0 | 0 years, 2 months, 1 days | -| 15. | fibonacci | 0 years, 1 months, 11 days | -| 16. | cobol | 0 years, 1 months, 8 days | -| 17. | mega8477 | 0 years, 1 months, 8 days | -| 18. | sun | 0 years, 1 months, 7 days | -| 19. | sentax | 0 years, 1 months, 6 days | -| 20. | sagittarius | 0 years, 1 months, 6 days | -+-----+----------------+-----------------------------+ -</pre> -<br /> -<h2 style='display: inline'>Top 20 Lifespan's by Host</h2><br /> -<br /> -<span>Lifespan is the total uptime + the total downtime of a host.</span><br /> -<br /> -<pre> -+-----+----------------+-----------------------------+ -| Pos | Host | Lifespan | -+-----+----------------+-----------------------------+ -| 1. | dionysus | 8 years, 6 months, 17 days | -| 2. | uranus | 7 years, 4 months, 6 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. | deltavega | 3 years, 1 months, 21 days | -| 8. | pluto | 2 years, 10 months, 30 days | -| 9. | *mega15289 | 2 years, 7 months, 5 days | -| 10. | makemake | 2 years, 4 months, 19 days | -| 11. | tauceti | 2 years, 3 months, 22 days | -| 12. | callisto | 2 years, 3 months, 13 days | -| 13. | *earth | 2 years, 2 months, 7 days | -| 14. | tauceti-e | 2 years, 1 months, 29 days | -| 15. | tauceti-f | 1 years, 9 months, 20 days | -| 16. | *blowfish | 1 years, 9 months, 7 days | -| 17. | mars | 1 years, 8 months, 19 days | -| 18. | host0 | 1 years, 4 months, 10 days | -| 19. | mega8477 | 1 years, 4 months, 1 days | -| 20. | sirius | 1 years, 2 months, 24 days | -+-----+----------------+-----------------------------+ -</pre> -<br /> -<h2 style='display: inline'>Top 20 Boots's by KernelMajor</h2><br /> -<br /> -<span>Boots is the total number of host boots over the entire lifespan.</span><br /> -<br /> -<pre> -+-----+----------------+-------+ -| Pos | KernelMajor | Boots | -+-----+----------------+-------+ -| 1. | FreeBSD 10... | 551 | -| 2. | Linux 3... | 550 | -| 3. | *Linux 5... | 249 | -| 4. | Linux 4... | 164 | -| 5. | FreeBSD 11... | 153 | -| 6. | *FreeBSD 13... | 143 | -| 7. | *Linux 6... | 51 | -| 8. | Darwin 13... | 40 | -| 9. | *OpenBSD 7... | 40 | -| 10. | FreeBSD 5... | 25 | -| 11. | Linux 2... | 22 | -| 12. | Darwin 21... | 18 | -| 13. | Darwin 15... | 15 | -| 14. | Darwin 18... | 13 | -| 15. | *Darwin 22... | 12 | -| 16. | FreeBSD 7... | 10 | -| 17. | FreeBSD 6... | 10 | -| 18. | OpenBSD 4... | 10 | -| 19. | Darwin 20... | 6 | -| 20. | Darwin 19... | 1 | -+-----+----------------+-------+ -</pre> -<br /> -<h2 style='display: inline'>Top 20 Uptime's by KernelMajor</h2><br /> -<br /> -<span>Uptime is the total uptime of a host over the entire lifespan.</span><br /> -<br /> -<pre> -+-----+----------------+------------------------------+ -| Pos | KernelMajor | Uptime | -+-----+----------------+------------------------------+ -| 1. | Linux 3... | 15 years, 10 months, 25 days | -| 2. | FreeBSD 10... | 5 years, 9 months, 9 days | -| 3. | *Linux 5... | 4 years, 4 months, 28 days | -| 4. | *OpenBSD 7... | 3 years, 5 months, 8 days | -| 5. | Linux 4... | 2 years, 8 months, 9 days | -| 6. | FreeBSD 11... | 2 years, 4 months, 28 days | -| 7. | Linux 2... | 1 years, 11 months, 21 days | -| 8. | Darwin 13... | 1 years, 3 months, 25 days | -| 9. | FreeBSD 6... | 1 years, 3 months, 9 days | -| 10. | *Linux 6... | 0 years, 10 months, 31 days | -| 11. | OpenBSD 4... | 0 years, 8 months, 12 days | -| 12. | Darwin 21... | 0 years, 8 months, 9 days | -| 13. | Darwin 18... | 0 years, 7 months, 18 days | -| 14. | Darwin 15... | 0 years, 6 months, 15 days | -| 15. | *Darwin 22... | 0 years, 5 months, 25 days | -| 16. | FreeBSD 5... | 0 years, 5 months, 18 days | -| 17. | *FreeBSD 13... | 0 years, 4 months, 7 days | -| 18. | Darwin 20... | 0 years, 3 months, 21 days | -| 19. | FreeBSD 7... | 0 years, 2 months, 5 days | -| 20. | Darwin 19... | 0 years, 1 months, 9 days | -+-----+----------------+------------------------------+ -</pre> -<br /> -<h2 style='display: inline'>Top 20 Score's by KernelMajor</h2><br /> -<br /> -<span>Score is calculated by combining all other metrics.</span><br /> -<br /> -<pre> -+-----+----------------+-------+ -| Pos | KernelMajor | Score | -+-----+----------------+-------+ -| 1. | Linux 3... | 1045 | -| 2. | FreeBSD 10... | 406 | -| 3. | *Linux 5... | 296 | -| 4. | *OpenBSD 7... | 217 | -| 5. | Linux 4... | 178 | -| 6. | FreeBSD 11... | 159 | -| 7. | Linux 2... | 121 | -| 8. | Darwin 13... | 80 | -| 9. | FreeBSD 6... | 75 | -| 10. | *Linux 6... | 59 | -| 11. | Darwin 21... | 39 | -| 12. | OpenBSD 4... | 39 | -| 13. | Darwin 18... | 35 | -| 14. | *FreeBSD 13... | 31 | -| 15. | Darwin 15... | 29 | -| 16. | *Darwin 22... | 28 | -| 17. | FreeBSD 5... | 25 | -| 18. | Darwin 20... | 14 | -| 19. | FreeBSD 7... | 7 | -| 20. | Darwin 19... | 1 | -+-----+----------------+-------+ -</pre> -<br /> -<h2 style='display: inline'>Top 20 Boots's by KernelName</h2><br /> -<br /> -<span>Boots is the total number of host boots over the entire lifespan.</span><br /> -<br /> -<pre> -+-----+------------+-------+ -| Pos | KernelName | Boots | -+-----+------------+-------+ -| 1. | *Linux | 1036 | -| 2. | *FreeBSD | 892 | -| 3. | *Darwin | 105 | -| 4. | *OpenBSD | 50 | -+-----+------------+-------+ -</pre> -<br /> -<h2 style='display: inline'>Top 20 Uptime's by KernelName</h2><br /> -<br /> -<span>Uptime is the total uptime of a host over the entire lifespan.</span><br /> -<br /> -<pre> -+-----+------------+-----------------------------+ -| Pos | KernelName | Uptime | -+-----+------------+-----------------------------+ -| 1. | *Linux | 25 years, 6 months, 18 days | -| 2. | *FreeBSD | 9 years, 12 months, 8 days | -| 3. | *OpenBSD | 3 years, 12 months, 17 days | -| 4. | *Darwin | 3 years, 6 months, 19 days | -+-----+------------+-----------------------------+ -</pre> -<br /> -<h2 style='display: inline'>Top 20 Score's by KernelName</h2><br /> -<br /> -<span>Score is calculated by combining all other metrics.</span><br /> -<br /> -<pre> -+-----+------------+-------+ -| Pos | KernelName | Score | -+-----+------------+-------+ -| 1. | *Linux | 1699 | -| 2. | *FreeBSD | 706 | -| 3. | *OpenBSD | 256 | -| 4. | *Darwin | 230 | -+-----+------------+-------+ -</pre> -<br /> <p class="footer"> -Generated by <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 2.1.0-release</a> | -served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | -<a href="https://www.foo.zone/site-mirrors.html">Site Mirrors</a> +Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter 3.0.1-develop</a> | +served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/relayd.8">relayd(8)</a>+<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | +<a href="https://foo.zone/site-mirrors.html">Site Mirrors</a> </p> </body> </html> |
