diff options
| author | Paul Buetow <paul@buetow.org> | 2025-02-21 10:55:25 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-02-21 10:55:25 +0200 |
| commit | 5a76af565ea910512b0418c56437467068821fd6 (patch) | |
| tree | d8ee7610db5f698703d5891eb9b6aabd1f699f14 /gemfeed/atom.xml | |
| parent | a30460cc038708e3a01cbe8cf4d90c6572e26784 (diff) | |
| parent | 75655782fe8ad0b8b9b5fd26a6837e8a745b7268 (diff) | |
Merge branch 'content-gemtext' of codeberg.org:snonux/foo.zone into content-gemtext
Diffstat (limited to 'gemfeed/atom.xml')
| -rw-r--r-- | gemfeed/atom.xml | 8296 |
1 files changed, 4021 insertions, 4275 deletions
diff --git a/gemfeed/atom.xml b/gemfeed/atom.xml index e17c38f6..7f86085a 100644 --- a/gemfeed/atom.xml +++ b/gemfeed/atom.xml @@ -1,12 +1,2413 @@ <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> - <updated>2024-08-05T22:08:22+03:00</updated> + <updated>2025-02-13T10:21:17+02:00</updated> <title>foo.zone feed</title> <subtitle>To be in the .zone!</subtitle> <link href="gemini://foo.zone/gemfeed/atom.xml" rel="self" /> <link href="gemini://foo.zone/" /> <id>gemini://foo.zone/</id> <entry> + <title>Random Weird Things - Part Ⅱ</title> + <link href="gemini://foo.zone/gemfeed/2025-02-08-random-weird-things-ii.gmi" /> + <id>gemini://foo.zone/gemfeed/2025-02-08-random-weird-things-ii.gmi</id> + <updated>2025-02-08T11:06:16+02:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>Every so often, I come across random, weird, and unexpected things on the internet. I thought it would be neat to share them here from time to time. This is the second run.</summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='random-weird-things---part-'>Random Weird Things - Part Ⅱ</h1><br /> +<br /> +<span class='quote'>Published at 2025-02-08T11:06:16+02:00</span><br /> +<br /> +<span>Every so often, I come across random, weird, and unexpected things on the internet. I thought it would be neat to share them here from time to time. This is the second run.</span><br /> +<br /> +<a class='textlink' href='./2024-07-05-random-weird-things.html'>2024-07-05 Random Weird Things - Part Ⅰ</a><br /> +<a class='textlink' href='./2025-02-08-random-weird-things-ii.html'>2025-02-08 Random Weird Things - Part Ⅱ (You are currently reading this)</a><br /> +<br /> +<pre> +/\_/\ /\_/\ +( o.o ) WHOA!! ( o.o ) +> ^ < > ^ < +/ \ MOEEW! / \ +/______\ /______\ +</pre> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#random-weird-things---part-'>Random Weird Things - Part Ⅱ</a></li> +<li>⇢ <a href='#11-the-sqlite-codebase-is-a-gem'>11. The SQLite codebase is a gem</a></li> +<li>⇢ <a href='#go-programming'>Go Programming</a></li> +<li>⇢ ⇢ <a href='#12-official-go-font'>12. Official Go font</a></li> +<li>⇢ ⇢ <a href='#13-go-functions-can-have-methods'>13. Go functions can have methods</a></li> +<li>⇢ <a href='#macos'>macOS</a></li> +<li>⇢ ⇢ <a href='#14--and-ss-are-treated-the-same'>14. ß and ss are treated the same</a></li> +<li>⇢ ⇢ <a href='#15-colon-as-file-path-separator'>15. Colon as file path separator</a></li> +<li>⇢ <a href='#16-polyglots---programs-written-in-multiple-languages'>16. Polyglots - programs written in multiple languages</a></li> +<li>⇢ <a href='#17-languages-where-indices-start-at-1'>17. Languages, where indices start at 1</a></li> +<li>⇢ <a href='#18-perl-poetry'>18. Perl Poetry</a></li> +<li>⇢ <a href='#19-css3-is-turing-complete'>19. CSS3 is turing complete</a></li> +<li>⇢ <a href='#20-the-biggest-shell-programs-'>20. The biggest shell programs </a></li> +</ul><br /> +<h2 style='display: inline' id='11-the-sqlite-codebase-is-a-gem'>11. The SQLite codebase is a gem</h2><br /> +<br /> +<span>Check this out:</span><br /> +<br /> +<a href='./random-weird-things-ii/sqlite-gem.png'><img alt='SQLite Gem' title='SQLite Gem' src='./random-weird-things-ii/sqlite-gem.png' /></a><br /> +<br /> +<span>Source:</span><br /> +<br /> +<a class='textlink' href='https://wetdry.world/@memes/112717700557038278'>https://wetdry.world/@memes/112717700557038278</a><br /> +<br /> +<h2 style='display: inline' id='go-programming'>Go Programming</h2><br /> +<br /> +<h3 style='display: inline' id='12-official-go-font'>12. Official Go font</h3><br /> +<br /> +<span>The Go programming language has an official font called "Go Font." It was created to complement the aesthetic of the Go language, ensuring clear and legible rendering of code. The font includes a monospace version for code and a proportional version for general text, supporting consistent look and readability in Go-related materials and development environments. </span><br /> +<br /> +<span>Check out some Go code displayed using the Go font:</span><br /> +<br /> +<a href='./random-weird-things-ii/go-font-code.png'><img alt='Go font code' title='Go font code' src='./random-weird-things-ii/go-font-code.png' /></a><br /> +<br /> +<a class='textlink' href='https://go.dev/blog/go-fonts'>https://go.dev/blog/go-fonts</a><br /> +<br /> +<span>The design emphasizes simplicity and readability, reflecting Go's philosophy of clarity and efficiency.</span><br /> +<br /> +<span>I found it interesting and/or weird, as Go is a programming language. Why should it bother having its own font? I have never seen another open-source project like Go do this. But I also like it. Maybe I will use it in the future for this blog :-) </span><br /> +<br /> +<h3 style='display: inline' id='13-go-functions-can-have-methods'>13. Go functions can have methods</h3><br /> +<br /> +<span>Functions on struct types? Well, know. Functions on types like <span class='inlinecode'>int</span> and <span class='inlinecode'>string</span>? It's also known of, but a bit lesser. Functions on function types? That sounds a bit funky, but it's possible, too! For demonstration, have a look at this snippet:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><b><u><font color="#000000">package</font></u></b> main + +<b><u><font color="#000000">import</font></u></b> <font color="#808080">"log"</font> + +<b><u><font color="#000000">type</font></u></b> fun <b><u><font color="#000000">func</font></u></b>() <b><font color="#000000">string</font></b> + +<b><u><font color="#000000">func</font></u></b> (f fun) Bar() <b><font color="#000000">string</font></b> { + <b><u><font color="#000000">return</font></u></b> <font color="#808080">"Bar"</font> +} + +<b><u><font color="#000000">func</font></u></b> main() { + <b><u><font color="#000000">var</font></u></b> f fun = <b><u><font color="#000000">func</font></u></b>() <b><font color="#000000">string</font></b> { + <b><u><font color="#000000">return</font></u></b> <font color="#808080">"Foo"</font> + } + log.Println(<font color="#808080">"Example 1: "</font>, f()) + log.Println(<font color="#808080">"Example 2: "</font>, f.Bar()) + log.Println(<font color="#808080">"Example 3: "</font>, fun(f.Bar).Bar()) + log.Println(<font color="#808080">"Example 4: "</font>, fun(fun(f.Bar).Bar).Bar()) +} +</pre> +<br /> +<span>It runs just fine:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>❯ go run main.go +<font color="#000000">2025</font>/<font color="#000000">02</font>/<font color="#000000">07</font> <font color="#000000">22</font>:<font color="#000000">56</font>:<font color="#000000">14</font> Example <font color="#000000">1</font>: Foo +<font color="#000000">2025</font>/<font color="#000000">02</font>/<font color="#000000">07</font> <font color="#000000">22</font>:<font color="#000000">56</font>:<font color="#000000">14</font> Example <font color="#000000">2</font>: Bar +<font color="#000000">2025</font>/<font color="#000000">02</font>/<font color="#000000">07</font> <font color="#000000">22</font>:<font color="#000000">56</font>:<font color="#000000">14</font> Example <font color="#000000">3</font>: Bar +<font color="#000000">2025</font>/<font color="#000000">02</font>/<font color="#000000">07</font> <font color="#000000">22</font>:<font color="#000000">56</font>:<font color="#000000">14</font> Example <font color="#000000">4</font>: Bar +</pre> +<br /> +<h2 style='display: inline' id='macos'>macOS</h2><br /> +<br /> +<span>For personal computing, I don't use Apple, but I have to use it for work. </span><br /> +<br /> +<h3 style='display: inline' id='14--and-ss-are-treated-the-same'>14. ß and ss are treated the same</h3><br /> +<br /> +<span>Know German? In German, the letter "sarp s" is written as ß. ß is treated the same as ss on macOS.</span><br /> +<br /> +<span>On a case-insensitive file system like macOS, not only are uppercase and lowercase letters treated the same, but non-Latin characters like the German "ß" are also considered equivalent to their Latin counterparts (in this case, "ss").</span><br /> +<br /> +<span>So, even though "Maß" and "Mass" are not strictly equivalent, the macOS file system still treats them as the same filename due to its handling of Unicode characters. This can sometimes lead to unexpected behaviour. Check this out:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>❯ touch Maß +❯ ls -l +-rw-r--r--@ <font color="#000000">1</font> paul wheel <font color="#000000">0</font> Feb <font color="#000000">7</font> <font color="#000000">23</font>:<font color="#000000">02</font> Maß +❯ touch Mass +❯ ls -l +-rw-r--r--@ <font color="#000000">1</font> paul wheel <font color="#000000">0</font> Feb <font color="#000000">7</font> <font color="#000000">23</font>:<font color="#000000">02</font> Maß +❯ rm Mass +❯ ls -l + +❯ touch Mass +❯ ls -ltr +-rw-r--r--@ <font color="#000000">1</font> paul wheel <font color="#000000">0</font> Feb <font color="#000000">7</font> <font color="#000000">23</font>:<font color="#000000">02</font> Mass +❯ rm Maß +❯ ls -l + +</pre> +<br /> +<h3 style='display: inline' id='15-colon-as-file-path-separator'>15. Colon as file path separator</h3><br /> +<br /> +<span>MacOS can use the colon as a file path separator on its ADFS (file system). A typical ADFS file pathname on a hard disc might be:</span><br /> +<br /> +<pre> +ADFS::4.$.Documents.Techwriter.Myfile +</pre> +<br /> +<span>I can't reproduce this on my (work) Mac, though, as it now uses the APFS file system. In essence, ADFS is an older file system, while APFS is a contemporary file system optimized for Apple's modern devices.</span><br /> +<br /> +<a class='textlink' href='https://social.jvns.ca/@b0rk/113041293527832730'>https://social.jvns.ca/@b0rk/113041293527832730</a><br /> +<br /> +<h2 style='display: inline' id='16-polyglots---programs-written-in-multiple-languages'>16. Polyglots - programs written in multiple languages</h2><br /> +<br /> +<span>A coding polyglot is a program or script written so that it can be executed in multiple programming languages without modification. This is typically achieved by leveraging syntax overlaps or crafting valid and meaningful code in each targeted language. Polyglot programs are often created as a challenge or for demonstration purposes to showcase language similarities or clever coding techniques.</span><br /> +<br /> +<span>Check out my very own polyglot:</span><br /> +<br /> +<a class='textlink' href='./2014-03-24-the-fibonacci.pl.c-polyglot.html'>The <span class='inlinecode'>fibonatti.pl.c</span> Polyglot</a><br /> +<br /> +<h2 style='display: inline' id='17-languages-where-indices-start-at-1'>17. Languages, where indices start at 1</h2><br /> +<br /> +<span>Array indices start at 1 instead of 0 in some programming languages, known as one-based indexing. This can be controversial because zero-based indexing is more common in popular languages like C, C++, Java, and Python. One-based indexing can lead to off-by-one errors when developers switch between languages with different indexing schemes.</span><br /> +<br /> +<span>Languages with One-Based Indexing:</span><br /> +<br /> +<ul> +<li>Fortran</li> +<li>MATLAB</li> +<li>Lua</li> +<li>R (for vectors and lists)</li> +<li>Smalltalk</li> +<li>Julia (by default, although zero-based indexing is also possible)</li> +</ul><br /> +<span><span class='inlinecode'>foo.lua</span> example:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>arr = {<font color="#000000">10</font>, <font color="#000000">20</font>, <font color="#000000">30</font>, <font color="#000000">40</font>, <font color="#000000">50</font>} +print(arr[<font color="#000000">1</font>]) <i><font color="silver">-- Accessing the first element</font></i> +</pre> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>❯ lua foo.lua +<font color="#000000">10</font> +</pre> +<br /> +<span>One-based indexing is more natural for human-readable, mathematical, and theoretical contexts, where counting traditionally starts from one.</span><br /> +<br /> +<h2 style='display: inline' id='18-perl-poetry'>18. Perl Poetry</h2><br /> +<br /> +<span>Perl Poetry is a playful and creative practice within the programming community where Perl code is written as a poem. These poems are crafted to be syntactically valid Perl code and make sense as poetic text, often with whimsical or humorous intent. This showcases Perl's flexibility and expressiveness, as well as the creativity of its programmers.</span><br /> +<br /> +<span>See this Poetry of my own; the Perl interpreter does not yield any syntax error parsing that. But also, the Peom doesn't do anything useful then executed:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><i><font color="silver"># (C) 2006 by Paul C. Buetow</font></i> + +Christmas:{time;<i><font color="silver">#!!!</font></i> + +Children: <b><u><font color="#000000">do</font></u></b> <b><u><font color="#000000">tell</font></u></b> $wishes; + +Santa: <b><u><font color="#000000">for</font></u></b> $each (@children) { +BEGIN { <b><u><font color="#000000">read</font></u></b> $each, $their, wishes <b><u><font color="#000000">and</font></u></b> study them; <b><u><font color="#000000">use</font></u></b> Memoize<i><font color="silver">#ing</font></i> + +} <b><u><font color="#000000">use</font></u></b> constant gift, <font color="#808080">'wrapping'</font>; +<b><u><font color="#000000">package</font></u></b> Gifts; <b><u><font color="#000000">pack</font></u></b> $each, gift <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">bless</font></u></b> $each <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">goto</font></u></b> deliver +or <b><u><font color="#000000">do</font></u></b> <b><u><font color="#000000">import</font></u></b> <b><u><font color="#000000">if</font></u></b> not <b><u><font color="#000000">local</font></u></b> $available,!!! HO, HO, HO; + +<b><u><font color="#000000">redo</font></u></b> Santa, <b><u><font color="#000000">pipe</font></u></b> $gifts, to_childs; +<b><u><font color="#000000">redo</font></u></b> Santa <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">do</font></u></b> <b><u><font color="#000000">return</font></u></b> <b><u><font color="#000000">if</font></u></b> <b><u><font color="#000000">last</font></u></b> one, is, delivered; + +deliver: gift <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">require</font></u></b> diagnostics <b><u><font color="#000000">if</font></u></b> <b><u><font color="#000000">our</font></u></b> $gifts ,not break; +<b><u><font color="#000000">do</font></u></b>{ <b><u><font color="#000000">use</font></u></b> NEXT; time; <b><u><font color="#000000">tied</font></u></b> $gifts} <b><u><font color="#000000">if</font></u></b> broken <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">dump</font></u></b> the, broken, ones; +The_children: <b><u><font color="#000000">sleep</font></u></b> <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">wait</font></u></b> <b><u><font color="#000000">for</font></u></b> (<b><u><font color="#000000">each</font></u></b> %gift) <b><u><font color="#000000">and</font></u></b> try { to => <b><u><font color="#000000">untie</font></u></b> $gifts }; + +<b><u><font color="#000000">redo</font></u></b> Santa, <b><u><font color="#000000">pipe</font></u></b> $gifts, to_childs; +<b><u><font color="#000000">redo</font></u></b> Santa <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">do</font></u></b> <b><u><font color="#000000">return</font></u></b> <b><u><font color="#000000">if</font></u></b> <b><u><font color="#000000">last</font></u></b> one, is, delivered; + +The_christmas_tree: formline <b><u><font color="#000000">s</font></u></b><font color="#808080">/ /childrens/</font>, $gifts; +<b><u><font color="#000000">alarm</font></u></b> <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">warn</font></u></b> <b><u><font color="#000000">if</font></u></b> not <b><u><font color="#000000">exists</font></u></b> $Christmas{ tree}, @t, $ENV{HOME}; +<b><u><font color="#000000">write</font></u></b> <<EMail + to the parents to buy a new christmas tree!!!!<font color="#000000">111</font> + <b><u><font color="#000000">and</font></u></b> send the +EMail +;<b><u><font color="#000000">wait</font></u></b> <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">redo</font></u></b> deliver until <b><u><font color="#000000">defined</font></u></b> <b><u><font color="#000000">local</font></u></b> $tree; + +<b><u><font color="#000000">redo</font></u></b> Santa, <b><u><font color="#000000">pipe</font></u></b> $gifts, to_childs; +<b><u><font color="#000000">redo</font></u></b> Santa <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">do</font></u></b> <b><u><font color="#000000">return</font></u></b> <b><u><font color="#000000">if</font></u></b> <b><u><font color="#000000">last</font></u></b> one, is, delivered ;} + +END {} <b><u><font color="#000000">our</font></u></b> $mission <b><u><font color="#000000">and</font></u></b> <b><u><font color="#000000">do</font></u></b> <b><u><font color="#000000">sleep</font></u></b> until <b><u><font color="#000000">next</font></u></b> Christmas ;} + +__END__ + +This is perl, v5.<font color="#000000">8.8</font> built <b><u><font color="#000000">for</font></u></b> i386-freebsd-64int +</pre> +<br /> +<a class='textlink' href='./2008-06-26-perl-poetry.html'>More Perl Poetry of mine</a><br /> +<br /> +<h2 style='display: inline' id='19-css3-is-turing-complete'>19. CSS3 is turing complete</h2><br /> +<br /> +<span>CSS3 is Turing complete because it can simulate a Turing machine using only CSS animations and styles without any JavaScript or external logic. This is achieved by using keyframe animations to change the styles of HTML elements in a way that encodes computation, performing calculations and state transitions. </span><br /> +<br /> +<a class='textlink' href='https://stackoverflow.com/questions/2497146/is-css-turing-complete'>Is CSS turing complete?</a><br /> +<br /> +<span>It is surprising because CSS is primarily a styling language intended for the presentation layer of web pages, not for computation or logic. Its capability to perform complex computations defies its typical use case and showcases the unintended computational power that can emerge from the creative use of seemingly straightforward technologies.</span><br /> +<br /> +<span>Check out this 100% CSS implementation of the Conways Game of Life:</span><br /> +<br /> +<a href='./random-weird-things-ii/css-conway.png'><img src='./random-weird-things-ii/css-conway.png' /></a><br /> +<br /> +<a class='textlink' href='https://github.com/propjockey/css-conways-game-of-life'>CSS Conways Game of Life</a><br /> +<br /> +<span>Conway's Game of Life is Turing complete because it can simulate a universal Turing machine, meaning it can perform any computation that a computer can, given the right initial conditions and sufficient time and space. Suppose a language can implement Conway's Game of Life. In that case, it demonstrates the language's ability to handle complex state transitions and computations. It has the necessary constructs (like iteration, conditionals, and data manipulation) to simulate any algorithm, thus confirming its Turing completeness.</span><br /> +<br /> +<h2 style='display: inline' id='20-the-biggest-shell-programs-'>20. The biggest shell programs </h2><br /> +<br /> +<span>One would think that shell scripts are only suitable for small tasks. Well, I must be wrong, as there are huge shell programs out there (up to 87k LOC) which aren't auto-generated but hand-written!</span><br /> +<br /> +<a class='textlink' href='https://github.com/oils-for-unix/oils/wiki/The-Biggest-Shell-Programs-in-the-World'>The Biggest Sell Programs in the World</a><br /> +<br /> +<span>My Gemtexter (bash) is only 1329 LOC as of now. So it's tiny.</span><br /> +<br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>Gemtexter - One Bash script to rule it all</a><br /> +<br /> +<span>I hope you had some fun. E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</title> + <link href="gemini://foo.zone/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi" /> + <id>gemini://foo.zone/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi</id> + <updated>2025-01-30T09:22:06+02:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>This is the third blog post about my f3s series for my self-hosting demands in my home lab. f3s? The 'f' stands for FreeBSD, and the '3s' stands for k3s, the Kubernetes distribution we will use on FreeBSD-based physical machines.</summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='f3s-kubernetes-with-freebsd---part-3-protecting-from-power-cuts'>f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</h1><br /> +<br /> +<span class='quote'>Published at 2025-01-30T09:22:06+02:00</span><br /> +<br /> +<span>This is the third blog post about my f3s series for my self-hosting demands in my home lab. f3s? The "f" stands for FreeBSD, and the "3s" stands for k3s, the Kubernetes distribution we will use on FreeBSD-based physical machines.</span><br /> +<br /> +<a class='textlink' href='./2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</a><br /> +<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br /> +<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts (You are currently reading this)</a><br /> +<br /> +<a href='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png'><img alt='f3s logo' title='f3s logo' src='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png' /></a><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#f3s-kubernetes-with-freebsd---part-3-protecting-from-power-cuts'>f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a></li> +<li>⇢ <a href='#introduction'>Introduction</a></li> +<li>⇢ <a href='#changes-since-last-time'>Changes since last time</a></li> +<li>⇢ ⇢ <a href='#freebsd-upgrade-from-141-to-142'>FreeBSD upgrade from 14.1 to 14.2</a></li> +<li>⇢ ⇢ <a href='#a-new-home-behind-the-tv'>A new home (behind the TV)</a></li> +<li>⇢ <a href='#the-ups-hardware'>The UPS hardware</a></li> +<li>⇢ <a href='#configuring-freebsd-to-work-with-the-ups'>Configuring FreeBSD to Work with the UPS</a></li> +<li>⇢ ⇢ <a href='#usb-device-detection'>USB Device Detection</a></li> +<li>⇢ ⇢ <a href='#apcupsd-installation'><span class='inlinecode'>apcupsd</span> Installation</a></li> +<li>⇢ ⇢ <a href='#ups-connectivity-test'>UPS Connectivity Test</a></li> +<li>⇢ <a href='#apc-info-on-partner-nodes'>APC Info on Partner Nodes:</a></li> +<li>⇢ ⇢ <a href='#installation-on-partners'>Installation on partners</a></li> +<li>⇢ <a href='#power-outage-simulation'>Power outage simulation</a></li> +<li>⇢ ⇢ <a href='#pulling-the-plug'>Pulling the plug</a></li> +<li>⇢ ⇢ <a href='#restoring-power'>Restoring power</a></li> +</ul><br /> +<h2 style='display: inline' id='introduction'>Introduction</h2><br /> +<br /> +<span>In this blog post, we are setting up the UPS for the cluster. A UPS, or Uninterruptible Power Supply, safeguards my cluster from unexpected power outages and surges. It acts as a backup battery that kicks in when the electricity cuts out—especially useful in my area, where power cuts are frequent—allowing for a graceful system shutdown and preventing data loss and corruption. This is especially important since I will also store some of my data on the f3s nodes.</span><br /> +<br /> +<h2 style='display: inline' id='changes-since-last-time'>Changes since last time</h2><br /> +<br /> +<h3 style='display: inline' id='freebsd-upgrade-from-141-to-142'>FreeBSD upgrade from 14.1 to 14.2</h3><br /> +<br /> +<span>There has been a new release since the last blog post in this series. The upgrade from 14.1 was as easy as:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0: ~ % doas freebsd-update fetch +paul@f0: ~ % doas freebsd-update install +paul@f0: ~ % doas freebsd-update -r <font color="#000000">14.2</font>-RELEASE upgrade +paul@f0: ~ % doas freebsd-update install +paul@f0: ~ % doas shutdown -r now +</pre> +<br /> +<span>And after rebooting, I ran:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0: ~ % doas freebsd-update install +paul@f0: ~ % doas pkg update +paul@f0: ~ % doas pkg upgrade +paul@f0: ~ % doas shutdown -r now +</pre> +<br /> +<span>And after another reboot, I was on 14.2:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0:~ % uname -a +FreeBSD f0.lan.buetow.org <font color="#000000">14.2</font>-RELEASE FreeBSD <font color="#000000">14.2</font>-RELEASE + releng/<font color="#000000">14.2</font>-n<font color="#000000">269506</font>-c8918d6c7412 GENERIC amd64 +</pre> +<br /> +<span>And, of course, I ran this on all 3 nodes!</span><br /> +<br /> +<h3 style='display: inline' id='a-new-home-behind-the-tv'>A new home (behind the TV)</h3><br /> +<br /> +<span>I've put all the infrastructure behind my TV, as plenty of space is available. The TV hides most of the setup, which drastically improved the SAF (spouse acceptance factor).</span><br /> +<br /> +<a href='./f3s-kubernetes-with-freebsd-part-3/f3s-changes.jpg'><img alt='New hardware placement arrangement' title='New hardware placement arrangement' src='./f3s-kubernetes-with-freebsd-part-3/f3s-changes.jpg' /></a><br /> +<br /> +<span>I got rid of the mini-switch I mentioned in the previous blog post. I have the TP-Link EAP615-Wall mounted on the wall nearby, which is my OpenWrt-powered Wi-Fi hotspot. It also has 3 Ethernet ports, to which I connected the Beelink nodes. That's the device you see at the very top.</span><br /> +<br /> +<span>The Ethernet cables go downward through the cable boxes to the Beelink nodes. In addition to the Beelink f3s nodes, I connected the TP-Link to the UPS as well (not discussed further in this blog post, but the positive side effect is that my Wi-Fi will still work during a power loss for some time—and during a power cut, the Beelink nodes will still be able to communicate with each other).</span><br /> +<br /> +<span>On the very left (the black box) is the UPS, with four power outlets. Three go to the Beelink nodes, and one goes to the TP-Link. A USB output is also connected to the first Beelink node, <span class='inlinecode'>f0</span>. </span><br /> +<br /> +<span>On the very right (halfway hidden behind the TV) are the 3 Beelink nodes stacked on top of each other. The only downside (or upside?) is that my 14-month-old daughter is now chaos-testing the Beelink nodes, as the red power buttons (now reachable for her) are very attractive for her to press when passing by randomly. :-) Luckily, that will only cause graceful system shutdowns!</span><br /> +<br /> +<h2 style='display: inline' id='the-ups-hardware'>The UPS hardware</h2><br /> +<br /> +<span>I wanted a UPS that I could connect to via FreeBSD, and that would provide enough backup power to operate the cluster for a couple of minutes (it turned out to be around an hour, but this time will likely be shortened after future hardware upgrades, like additional drives and a backup enclosure) and to automatically initiate the shutdown of all the f3s nodes.</span><br /> +<br /> +<span>I decided on the APC Back-UPS BX750MI model because:</span><br /> +<br /> +<ul> +<li>Zero noise level when there is no power cut (some light noise when the battery is in operation during a power cut).</li> +<li>Cost: It is relatively affordable (not costing thousands).</li> +<li>USB connectivity: Can be connected via USB to one of the FreeBSD hosts to read the UPS status.</li> +<li>A power output of 750VA (or 410 watts), suitable for an hour of runtime for my f3s nodes (plus the Wi-Fi router).</li> +<li>Multiple power outlets: Can connect all 3 f3s nodes directly.</li> +<li>User-replaceable batteries: I can replace the batteries myself after two years or more (depending on usage).</li> +<li>Its compact design. Overall, I like how it looks.</li> +</ul><br /> +<a href='./f3s-kubernetes-with-freebsd-part-3/apc-back-ups.jpg'><img alt='The APC Back-UPS BX750MI in operation.' title='The APC Back-UPS BX750MI in operation.' src='./f3s-kubernetes-with-freebsd-part-3/apc-back-ups.jpg' /></a><br /> +<br /> +<h2 style='display: inline' id='configuring-freebsd-to-work-with-the-ups'>Configuring FreeBSD to Work with the UPS</h2><br /> +<br /> +<h3 style='display: inline' id='usb-device-detection'>USB Device Detection</h3><br /> +<br /> +<span>Once plugged in via USB on FreeBSD, I could see the following in the kernel messages:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0: ~ % doas dmesg | grep UPS +ugen0.<font color="#000000">2</font>: <American Power Conversion Back-UPS BX750MI> at usbus0 +</pre> +<br /> +<h3 style='display: inline' id='apcupsd-installation'><span class='inlinecode'>apcupsd</span> Installation</h3><br /> +<br /> +<span>To make use of the USB connection, the <span class='inlinecode'>apcupsd</span> package had to be installed:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0: ~ % doas install apcupsd +</pre> +<br /> +<span>I have made the following modifications to the configuration file so that the UPS can be used via the USB interface:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0:/usr/local/etc/apcupsd % diff -u apcupsd.conf.sample apcupsd.conf +--- apcupsd.conf.sample <font color="#000000">2024</font>-<font color="#000000">11</font>-<font color="#000000">01</font> <font color="#000000">16</font>:<font color="#000000">40</font>:<font color="#000000">42.000000000</font> +<font color="#000000">0200</font> ++++ apcupsd.conf <font color="#000000">2024</font>-<font color="#000000">12</font>-<font color="#000000">03</font> <font color="#000000">10</font>:<font color="#000000">58</font>:<font color="#000000">24.009501000</font> +<font color="#000000">0200</font> +@@ -<font color="#000000">31</font>,<font color="#000000">7</font> +<font color="#000000">31</font>,<font color="#000000">7</font> @@ + <i><font color="silver"># 940-1524C, 940-0024G, 940-0095A, 940-0095B,</font></i> + <i><font color="silver"># 940-0095C, 940-0625A, M-04-02-2000</font></i> + <i><font color="silver">#</font></i> +-UPSCABLE smart ++UPSCABLE usb + + <i><font color="silver"># To get apcupsd to work, in addition to defining the cable</font></i> + <i><font color="silver"># above, you must also define a UPSTYPE, which corresponds to</font></i> +@@ -<font color="#000000">88</font>,<font color="#000000">8</font> +<font color="#000000">88</font>,<font color="#000000">10</font> @@ + <i><font color="silver"># that apcupsd binds to that particular unit</font></i> + <i><font color="silver"># (helpful if you have more than one USB UPS).</font></i> + <i><font color="silver">#</font></i> +-UPSTYPE apcsmart +-DEVICE /dev/usv ++UPSTYPE usb ++DEVICE + + <i><font color="silver"># POLLTIME <int></font></i> + <i><font color="silver"># Interval (in seconds) at which apcupsd polls the UPS for status. This</font></i> +</pre> +<br /> +<span>I left the remaining settings as the default ones; for example, the following are of main interest:</span><br /> +<br /> +<pre> +# If during a power failure, the remaining battery percentage +# (as reported by the UPS) is below or equal to BATTERYLEVEL, +# apcupsd will initiate a system shutdown. +BATTERYLEVEL 5 + +# If during a power failure, the remaining runtime in minutes +# (as calculated internally by the UPS) is below or equal to MINUTES, +# apcupsd, will initiate a system shutdown. +MINUTES 3 +</pre> +<br /> +<span>I then enabled and started the daemon:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0:/usr/local/etc/apcupsd % doas sysrc apcupsd_enable=YES +apcupsd_enable: -> YES +paul@f0:/usr/local/etc/apcupsd % doas service apcupsd start +Starting apcupsd. +</pre> +<br /> +<h3 style='display: inline' id='ups-connectivity-test'>UPS Connectivity Test</h3><br /> +<br /> +<span>And voila, I could now access the UPS information via the <span class='inlinecode'>apcaccess</span> command; how convenient :-) (I also read through the manual page, which provides a good understanding of what else can be done with it!).</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0:~ % apcaccess +APC : <font color="#000000">001</font>,<font color="#000000">035</font>,<font color="#000000">0857</font> +DATE : <font color="#000000">2025</font>-<font color="#000000">01</font>-<font color="#000000">26</font> <font color="#000000">14</font>:<font color="#000000">43</font>:<font color="#000000">27</font> +<font color="#000000">0200</font> +HOSTNAME : f0.lan.buetow.org +VERSION : <font color="#000000">3.14</font>.<font color="#000000">14</font> (<font color="#000000">31</font> May <font color="#000000">2016</font>) freebsd +UPSNAME : f0.lan.buetow.org +CABLE : USB Cable +DRIVER : USB UPS Driver +UPSMODE : Stand Alone +STARTTIME: <font color="#000000">2025</font>-<font color="#000000">01</font>-<font color="#000000">26</font> <font color="#000000">14</font>:<font color="#000000">43</font>:<font color="#000000">25</font> +<font color="#000000">0200</font> +MODEL : Back-UPS BX750MI +STATUS : ONLINE +LINEV : <font color="#000000">230.0</font> Volts +LOADPCT : <font color="#000000">4.0</font> Percent +BCHARGE : <font color="#000000">100.0</font> Percent +TIMELEFT : <font color="#000000">65.3</font> Minutes +MBATTCHG : <font color="#000000">5</font> Percent +MINTIMEL : <font color="#000000">3</font> Minutes +MAXTIME : <font color="#000000">0</font> Seconds +SENSE : Medium +LOTRANS : <font color="#000000">145.0</font> Volts +HITRANS : <font color="#000000">295.0</font> Volts +ALARMDEL : No alarm +BATTV : <font color="#000000">13.6</font> Volts +LASTXFER : Automatic or explicit self <b><u><font color="#000000">test</font></u></b> +NUMXFERS : <font color="#000000">0</font> +TONBATT : <font color="#000000">0</font> Seconds +CUMONBATT: <font color="#000000">0</font> Seconds +XOFFBATT : N/A +SELFTEST : NG +STATFLAG : <font color="#000000">0x05000008</font> +SERIALNO : 9B2414A03599 +BATTDATE : <font color="#000000">2001</font>-<font color="#000000">01</font>-<font color="#000000">01</font> +NOMINV : <font color="#000000">230</font> Volts +NOMBATTV : <font color="#000000">12.0</font> Volts +NOMPOWER : <font color="#000000">410</font> Watts +END APC : <font color="#000000">2025</font>-<font color="#000000">01</font>-<font color="#000000">26</font> <font color="#000000">14</font>:<font color="#000000">44</font>:<font color="#000000">06</font> +<font color="#000000">0200</font> +</pre> +<br /> +<h2 style='display: inline' id='apc-info-on-partner-nodes'>APC Info on Partner Nodes:</h2><br /> +<br /> +<span>So far, so good. Host <span class='inlinecode'>f0</span> would shut down itself when short on power. But what about the <span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span> nodes? They aren't connected directly to the UPS and, therefore, wouldn't know that their power is about to be cut off. For this, <span class='inlinecode'>apcupsd</span> running on the <span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span> nodes can be configured to retrieve UPS information via the network from the <span class='inlinecode'>apcupsd</span> server running on the <span class='inlinecode'>f0</span> node, which is connected directly to the APC via USB.</span><br /> +<br /> +<span>Of course, this won't work when <span class='inlinecode'>f0</span> is down. In this case, no operational node would be connected to the UPS via USB; therefore, the current power status would not be known. However, I consider this a rare circumstance. Furthermore, in case of an <span class='inlinecode'>f0</span> system crash, sudden power outages on the two other nodes would occur at different times making real data loss (the main concern here) less likely.</span><br /> +<br /> +<span>And if <span class='inlinecode'>f0</span> is down and <span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span> receive new data and crash midway, it's likely that a client (e.g., an Android app or another laptop) still has the data stored on it, making data recoverable and data loss overall nearly impossible. I'd receive an alert if any of the nodes go down (more on monitoring later in this blog series).</span><br /> +<br /> +<h3 style='display: inline' id='installation-on-partners'>Installation on partners</h3><br /> +<br /> +<span>To do this, I installed <span class='inlinecode'>apcupsd</span> via <span class='inlinecode'>doas pkg install apcupsd</span> on <span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span>, and then I could connect to it this way:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f1:~ % apcaccess -h f0.lan.buetow.org | grep Percent +LOADPCT : <font color="#000000">12.0</font> Percent +BCHARGE : <font color="#000000">94.0</font> Percent +MBATTCHG : <font color="#000000">5</font> Percent +</pre> +<br /> +<span>But I want the daemon to be configured and enabled in such a way that it connects to the master UPS node (the one with the UPS connected via USB) so that it can also initiate a system shutdown when the UPS battery reaches low levels. For that, <span class='inlinecode'>apcupsd</span> itself needs to be aware of the UPS status.</span><br /> +<br /> +<span>On <span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span>, I changed the configuration to use <span class='inlinecode'>f0</span> (where <span class='inlinecode'>apcupsd</span> is listening) as a remote device. I also changed the <span class='inlinecode'>MINUTES</span> setting from 3 to 6 and the <span class='inlinecode'>BATTERYLEVEL</span> setting from 5 to 10 to ensure that the <span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span> nodes could still connect to the <span class='inlinecode'>f0</span> node for UPS information before <span class='inlinecode'>f0</span> decides to shut down itself. So <span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span> must shut down earlier than <span class='inlinecode'>f0</span>:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f2:/usr/local/etc/apcupsd % diff -u apcupsd.conf.sample apcupsd.conf +--- apcupsd.conf.sample <font color="#000000">2024</font>-<font color="#000000">11</font>-<font color="#000000">01</font> <font color="#000000">16</font>:<font color="#000000">40</font>:<font color="#000000">42.000000000</font> +<font color="#000000">0200</font> ++++ apcupsd.conf <font color="#000000">2025</font>-<font color="#000000">01</font>-<font color="#000000">26</font> <font color="#000000">15</font>:<font color="#000000">52</font>:<font color="#000000">45.108469000</font> +<font color="#000000">0200</font> +@@ -<font color="#000000">31</font>,<font color="#000000">7</font> +<font color="#000000">31</font>,<font color="#000000">7</font> @@ + <i><font color="silver"># 940-1524C, 940-0024G, 940-0095A, 940-0095B,</font></i> + <i><font color="silver"># 940-0095C, 940-0625A, M-04-02-2000</font></i> + <i><font color="silver">#</font></i> +-UPSCABLE smart ++UPSCABLE ether + + <i><font color="silver"># To get apcupsd to work, in addition to defining the cable</font></i> + <i><font color="silver"># above, you must also define a UPSTYPE, which corresponds to</font></i> +@@ -<font color="#000000">52</font>,<font color="#000000">7</font> +<font color="#000000">52</font>,<font color="#000000">6</font> @@ + <i><font color="silver"># Network Information Server. This is used if the</font></i> + <i><font color="silver"># UPS powering your computer is connected to a</font></i> + <i><font color="silver"># different computer for monitoring.</font></i> +-<i><font color="silver">#</font></i> + <i><font color="silver"># snmp hostname:port:vendor:community</font></i> + <i><font color="silver"># SNMP network link to an SNMP-enabled UPS device.</font></i> + <i><font color="silver"># Hostname is the ip address or hostname of the UPS</font></i> +@@ -<font color="#000000">88</font>,<font color="#000000">8</font> +<font color="#000000">87</font>,<font color="#000000">8</font> @@ + <i><font color="silver"># that apcupsd binds to that particular unit</font></i> + <i><font color="silver"># (helpful if you have more than one USB UPS).</font></i> + <i><font color="silver">#</font></i> +-UPSTYPE apcsmart +-DEVICE /dev/usv ++UPSTYPE net ++DEVICE f0.lan.buetow.org:<font color="#000000">3551</font> + + <i><font color="silver"># POLLTIME <int></font></i> + <i><font color="silver"># Interval (in seconds) at which apcupsd polls the UPS for status. This</font></i> +@@ -<font color="#000000">147</font>,<font color="#000000">12</font> +<font color="#000000">146</font>,<font color="#000000">12</font> @@ + <i><font color="silver"># If during a power failure, the remaining battery percentage</font></i> + <i><font color="silver"># (as reported by the UPS) is below or equal to BATTERYLEVEL,</font></i> + <i><font color="silver"># apcupsd will initiate a system shutdown.</font></i> +-BATTERYLEVEL <font color="#000000">5</font> ++BATTERYLEVEL <font color="#000000">10</font> + + <i><font color="silver"># If during a power failure, the remaining runtime in minutes</font></i> + <i><font color="silver"># (as calculated internally by the UPS) is below or equal to MINUTES,</font></i> + <i><font color="silver"># apcupsd, will initiate a system shutdown.</font></i> +-MINUTES <font color="#000000">3</font> ++MINUTES <font color="#000000">6</font> + + <i><font color="silver"># If during a power failure, the UPS has run on batteries for TIMEOUT</font></i> + <i><font color="silver"># many seconds or longer, apcupsd will initiate a system shutdown.</font></i> + +</pre> +<span>So I also ran the following commands on <span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span>:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f1:/usr/local/etc/apcupsd % doas sysrc apcupsd_enable=YES +apcupsd_enable: -> YES +paul@f1:/usr/local/etc/apcupsd % doas service apcupsd start +Starting apcupsd. +</pre> +<br /> +<span>And then I was able to connect to localhost via the <span class='inlinecode'>apcaccess</span> command:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f1:~ % doas apcaccess | grep Percent +LOADPCT : <font color="#000000">5.0</font> Percent +BCHARGE : <font color="#000000">95.0</font> Percent +MBATTCHG : <font color="#000000">5</font> Percent +</pre> +<br /> +<h2 style='display: inline' id='power-outage-simulation'>Power outage simulation</h2><br /> +<br /> +<h3 style='display: inline' id='pulling-the-plug'>Pulling the plug</h3><br /> +<br /> +<span>I simulated a power outage by removing the power input from the APC. Immediately, the following message appeared on all the nodes:</span><br /> +<br /> +<pre> +Broadcast Message from root@f0.lan.buetow.org + (no tty) at 15:03 EET... + +Power failure. Running on UPS batteries. +</pre> +<br /> +<span>I ran the following command to confirm the available battery time:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0:/usr/local/etc/apcupsd % apcaccess -p TIMELEFT +<font color="#000000">63.9</font> Minutes +</pre> +<br /> +<span>And after around one hour (<span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span> a bit earlier, <span class='inlinecode'>f0</span> a bit later due to the different <span class='inlinecode'>BATTERYLEVEL</span> and <span class='inlinecode'>MINUTES</span> settings outlined earlier), the following broadcast was sent out:</span><br /> +<br /> +<pre> +Broadcast Message from root@f0.lan.buetow.org + (no tty) at 15:08 EET... + + *** FINAL System shutdown message from root@f0.lan.buetow.org *** + +System going down IMMEDIATELY + +apcupsd initiated shutdown +</pre> +<br /> +<span>And all the nodes shut down safely before the UPS ran out of battery!</span><br /> +<br /> +<h3 style='display: inline' id='restoring-power'>Restoring power</h3><br /> +<br /> +<span>After restoring power, I checked the logs in <span class='inlinecode'>/var/log/daemon.log</span> and found the following on all 3 nodes:</span><br /> +<br /> +<pre> +Jan 26 17:36:24 f2 apcupsd[2159]: Power failure. +Jan 26 17:36:30 f2 apcupsd[2159]: Running on UPS batteries. +Jan 26 17:36:30 f2 apcupsd[2159]: Battery charge below low limit. +Jan 26 17:36:30 f2 apcupsd[2159]: Initiating system shutdown! +Jan 26 17:36:30 f2 apcupsd[2159]: User logins prohibited +Jan 26 17:36:32 f2 apcupsd[2159]: apcupsd exiting, signal 15 +Jan 26 17:36:32 f2 apcupsd[2159]: apcupsd shutdown succeeded +</pre> +<br /> +<span>All good :-) See you in the next post of this series!</span><br /> +<br /> +<span>Other BSD related posts are:</span><br /> +<br /> +<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br /> +<a class='textlink' href='./2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</a><br /> +<a class='textlink' href='./2024-04-01-KISS-high-availability-with-OpenBSD.html'>2024-04-01 KISS high-availability with OpenBSD</a><br /> +<a class='textlink' href='./2024-01-13-one-reason-why-i-love-openbsd.html'>2024-01-13 One reason why I love OpenBSD</a><br /> +<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> +<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>2022-07-30 Let's Encrypt with OpenBSD and Rex</a><br /> +<a class='textlink' href='./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html'>2016-04-09 Jails and ZFS with Puppet on FreeBSD</a><br /> +<br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>Working with an SRE Interview</title> + <link href="gemini://foo.zone/gemfeed/2025-01-15-working-with-an-sre-interview.gmi" /> + <id>gemini://foo.zone/gemfeed/2025-01-15-working-with-an-sre-interview.gmi</id> + <updated>2025-01-15T00:16:04+02:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>I have been interviewed by Florian Buetow on `cracking-ai-engineering.com` about what it's like working with a Site Reliability Engineer from the point of view of a Software Engineer, Data Scientist, and AI Engineer.</summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='working-with-an-sre-interview'>Working with an SRE Interview</h1><br /> +<br /> +<span class='quote'>Published at 2025-01-15T00:16:04+02:00</span><br /> +<br /> +<span>I have been interviewed by Florian Buetow on <span class='inlinecode'>cracking-ai-engineering.com</span> about what it's like working with a Site Reliability Engineer from the point of view of a Software Engineer, Data Scientist, and AI Engineer.</span><br /> +<br /> +<a class='textlink' href='https://www.cracking-ai-engineering.com/writing/2025/01/12/working-with-an-sre-interview/'>See original interview here</a><br /> +<a class='textlink' href='https://www.cracking-ai-engineering.com'>Cracking AI Engineering</a><br /> +<br /> +<span>Below, I am posting the interview here on my blog as well.</span><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#working-with-an-sre-interview'>Working with an SRE Interview</a></li> +<li>⇢ <a href='#preamble-'>Preamble </a></li> +<li>⇢ <a href='#introducing-paul'>Introducing Paul</a></li> +<li>⇢ <a href='#how-did-you-get-started'>How did you get started?</a></li> +<li>⇢ <a href='#roles-and-career-progression'>Roles and Career Progression</a></li> +<li>⇢ <a href='#anecdotes-and-best-practices'>Anecdotes and Best Practices</a></li> +<li>⇢ <a href='#working-with-different-teams'>Working with Different Teams</a></li> +<li>⇢ <a href='#using-ai-tools'>Using AI Tools</a></li> +<li>⇢ <a href='#sre-learning-resources'>SRE Learning Resources</a></li> +<li>⇢ <a href='#blogging'>Blogging</a></li> +<li>⇢ <a href='#wrap-up'>Wrap-up</a></li> +<li>⇢ <a href='#closing-comments'>Closing comments</a></li> +</ul><br /> +<h2 style='display: inline' id='preamble-'>Preamble </h2><br /> +<br /> +<span>In this insightful interview, Paul Bütow, a Principal Site Reliability Engineer at Mimecast, shares over a decade of experience in the field. Paul highlights the role of an Embedded SRE, emphasizing the importance of automation, observability, and effective incident management. We also focused on the key question of how you can work effectively with an SRE weather you are an individual contributor or a manager, a software engineer or data scientist. And how you can learn more about site reliability engineering.</span><br /> +<br /> +<h2 style='display: inline' id='introducing-paul'>Introducing Paul</h2><br /> +<br /> +<span>Hi Paul, please introduce yourself briefly to the audience. Who are you, what do you do for a living, and where do you work?</span><br /> +<br /> +<span class='quote'>My name is Paul Bütow, I work at Mimecast, and I’m a Principal Site Reliability Engineer there. I’ve been with Mimecast for almost ten years now. The company specializes in email security, including things like archiving, phishing detection, malware protection, and spam filtering.</span><br /> +<br /> +<span>You mentioned that you’re an ‘Embedded SRE.’ What does that mean exactly?</span><br /> +<br /> +<span class='quote'>It means that I’m directly part of the software engineering team, not in a separate Ops department. I ensure that nothing is deployed manually, and everything runs through automation. I also set up monitoring and observability. These are two distinct aspects: monitoring alerts us when something breaks, while observability helps us identify trends. I also create runbooks so we know what to do when specific incidents occur frequently.</span><br /> +<br /> +<span class='quote'>Infrastructure SREs on the other hand handle the foundational setup, like providing the Kubernetes cluster itself or ensuring the operating systems are installed. They don't work on the application directly but ensure the base infrastructure is there for others to use. This works well when a company has multiple teams that need shared infrastructure.</span><br /> +<br /> +<h2 style='display: inline' id='how-did-you-get-started'>How did you get started?</h2><br /> +<br /> +<span>How did your interest in Linux or FreeBSD start?</span><br /> +<br /> +<span class='quote'>It began during my school days. We had a PC with DOS at home, and I eventually bought Suse Linux 5.3. Shortly after, I discovered FreeBSD because I liked its handbook so much. I wanted to understand exactly how everything worked, so I also tried Linux from Scratch. That involves installing every package manually to gain a better understanding of operating systems.</span><br /> +<br /> +<a class='textlink' href='https://www.FreeBSD.org'>https://www.FreeBSD.org</a><br /> +<a class='textlink' href='https://linuxfromscratch.org/'>https://linuxfromscratch.org/</a><br /> +<br /> +<span>And after school, you pursued computer science, correct?</span><br /> +<br /> +<span class='quote'>Exactly. I wasn’t sure at first whether I wanted to be a software developer or a system administrator. I applied for both and eventually accepted an offer as a Linux system administrator. This was before 'SRE' became a buzzword, but much of what I did back then-automation, infrastructure as code, monitoring-is now considered part of the typical SRE role.</span><br /> +<br /> +<h2 style='display: inline' id='roles-and-career-progression'>Roles and Career Progression</h2><br /> +<br /> +<span>Tell us about how you joined Mimecast. When did you fully embrace the SRE role?</span><br /> +<br /> +<span class='quote'>I started as a Linux sysadmin at 1&1. I managed an ad server farm with hundreds of systems and later handled load balancers. Together with an architect, we managed F5 load balancers distributing around 2,000 services, including for portals like web.de and GMX. I also led the operations team technically for a while before moving to London to join Mimecast.</span><br /> +<br /> +<span class='quote'>At Mimecast, the job title was explicitly 'Site Reliability Engineer.' The biggest difference was that I was no longer in a separate Ops department but embedded directly within the storage and search backend team. I loved that because we could plan features together-from automation to measurability and observability. Mimecast also operates thousands of physical servers for email archiving, which was fascinating since I already had experience with large distributed systems at 1&1. It was the right step for me because it allowed me to work close to the code while remaining hands-on with infrastructure.</span><br /> +<br /> +<span>What are the differences between SRE, DevOps, SysAdmin, and Architects?</span><br /> +<br /> +<span class='quote'>SREs are like the next step after SysAdmins. A SysAdmin might manually install servers, replace disks, or use simple scripts for automation, while SREs use infrastructure as code and focus on reliability through SLIs, SLOs, and automation. DevOps isn’t really a job-it’s more of a way of working, where developers are involved in operations tasks like setting up CI/CD pipelines or on-call shifts. Architects focus on designing systems and infrastructures, such as load balancers or distributed systems, working alongside SREs to ensure the systems meet the reliability and scalability requirements. The specific responsibilities of each role depend on the company, and there is often overlap. </span><br /> +<br /> +<span>What are the most important reliability lessons you’ve learned so far?</span><br /> +<br /> +<ul> +<li>Don’t leave SRE aspects as an afterthought. It’s much better to discuss automation, monitoring, SLIs, and SLOs early on. Traditional sysadmins often installed systems manually, but today, we do everything via infrastructure as code-using tools like Terraform or Puppet.</li> +<li>I also distinguish between monitoring and observability. Monitoring tells us, 'The server is down, alarm!' Observability dives deeper, showing trends like increasing latency so we can act proactively.</li> +<li>SLI, SLO, and SLA are core elements. We focus on what users actually experience-for example, how quickly an email is sent-and set our goals accordingly.</li> +<li>Runbooks are also crucial. When something goes wrong at night, you don’t want to start from scratch. A runbook outlines how to debug and resolve specific problems, saving time and reducing downtime.</li> +</ul><br /> +<h2 style='display: inline' id='anecdotes-and-best-practices'>Anecdotes and Best Practices</h2><br /> +<br /> +<span>Runbooks sound very practical. Can you explain how they’re used day-to-day?</span><br /> +<br /> +<span class='quote'>Runbooks are essentially guides for handling specific incidents. For instance, if a service won’t start, the runbook will specify where the logs are and which commands to use. Observability takes it a step further, helping us spot changes early-like rising error rates or latency-so we can address issues before they escalate.</span><br /> +<br /> +<span>When should you decide to put something into a runbook, and when is it unnecessary?</span><br /> +<br /> +<span class='quote'>If an issue happens frequently, it should be documented in a runbook so that anyone, even someone new, can follow the steps to fix it. The idea is that 90% of the common incidents should be covered. For example, if a service is down, the runbook would specify where to find logs, which commands to check, and what actions to take. On the other hand, rare or complex issues, where the resolution depends heavily on context or varies each time, don’t make sense to include in detail. For those, it’s better to focus on general troubleshooting steps. </span><br /> +<br /> +<span>How do you search for and find the correct runbooks?</span><br /> +<br /> +<span class='quote'>Runbooks should be linked directly in the alert you receive. For example, if you get an alert about a service not running, the alert will have a link to the runbook that tells you what to check, like logs or commands to run. Runbooks are best stored in an internal wiki, so if you don’t find the link in the alert, you know where to search. The important thing is that runbooks are easy to find and up to date because that’s what makes them useful during incidents. </span><br /> +<br /> +<span>Do you have an interesting war story you can share with us?</span><br /> +<br /> +<span class='quote'>Sure. At 1&1, we had a proprietary ad server software that ran a SQL query during startup. The query got slower over time, eventually timing out and preventing the server from starting. Since we couldn’t access the source code, we searched the binary for the SQL and patched it. By pinpointing the issue, a developer was able to adjust the SQL. This collaboration between sysadmin and developer perspectives highlights the value of SRE work.</span><br /> +<br /> +<h2 style='display: inline' id='working-with-different-teams'>Working with Different Teams</h2><br /> +<br /> +<span>You’re embedded in a team-how does collaboration with developers work practically?</span><br /> +<br /> +<span class='quote'>We plan everything together from the start. If there’s a new feature, we discuss infrastructure, automated deployments, and monitoring right away. Developers are experts in the code, and I bring the infrastructure expertise. This avoids unpleasant surprises before going live.</span><br /> +<br /> +<span>How about working with data scientists or ML engineers? Are there differences?</span><br /> +<br /> +<span class='quote'>The principles are the same. ML models also need to be deployed and monitored. You deal with monitoring, resource allocation, and identifying performance drops. Whether it’s a microservice or an ML job, at the end of the day, it’s all running on servers or clusters that must remain stable.</span><br /> +<br /> +<span>What about working with managers or the FinOps team?</span><br /> +<br /> +<span class='quote'>We often discuss costs, especially in the cloud, where scaling up resources is easy. It’s crucial to know our metrics: do we have enough capacity? Do we need all instances? Or is the CPU only at 5% utilization? This data helps managers decide whether the budget is sufficient or if optimizations are needed.</span><br /> +<br /> +<span>Do you have practical tips for working with SREs?</span><br /> +<br /> +<span class='quote'>Yes, I have a few:</span><br /> +<br /> +<ul> +<li>Early involvement: Include SREs from the beginning in your project.</li> +<li>Runbooks & documentation: Document recurring errors.</li> +<li>Try first: Try to understand the issue yourself before immediately asking the SRE.</li> +<li>Basic infra knowledge: Kubernetes and Terraform aren’t magic. Some basic understanding helps every developer.</li> +</ul><br /> +<h2 style='display: inline' id='using-ai-tools'>Using AI Tools</h2><br /> +<br /> +<span>Let’s talk about AI. How do you use it in your daily work?</span><br /> +<br /> +<span class='quote'>For boilerplate code, like Terraform snippets, I often use ChatGPT. It saves time, although I always review and adjust the output. Log analysis is another exciting application. Instead of manually going through millions of lines, AI can summarize key outliers or errors.</span><br /> +<br /> +<span>Do you think AI could largely replace SREs or significantly change the role?</span><br /> +<br /> +<span class='quote'>I see AI as an additional tool. SRE requires a deep understanding of how distributed systems work internally. While AI can assist with routine tasks or quickly detect anomalies, human expertise is indispensable for complex issues.</span><br /> +<br /> +<h2 style='display: inline' id='sre-learning-resources'>SRE Learning Resources</h2><br /> +<br /> +<span>What resources would you recommend for learning about SRE?</span><br /> +<br /> +<span class='quote'>The Google SRE book is a classic, though a bit dry. I really like 'Seeking SRE,' as it offers various perspectives on SRE, with many practical stories from different companies.</span><br /> +<br /> +<a class='textlink' href='https://sre.google/books/'>https://sre.google/books/</a><br /> +<a class='textlink' href='https://www.oreilly.com/library/view/seeking-sre/9781491978856'>Seeking SRE</a><br /> +<br /> +<span>Do you have a podcast recommendation?</span><br /> +<br /> +<span class='quote'>The Google SRE prodcast is quite interesting. It offers insights into how Google approaches SRE, along with perspectives from external guests.</span><br /> +<br /> +<a class='textlink' href='https://sre.google/prodcast/'>https://sre.google/prodcast/</a><br /> +<br /> +<h2 style='display: inline' id='blogging'>Blogging</h2><br /> +<br /> +<span>You also have a blog. What motivates you to write regularly?</span><br /> +<br /> +<span class='quote'>Writing helps me learn the most. It also serves as a personal reference. Sometimes I look up how I solved a problem a year ago. And of course, others tackling similar projects might find inspiration in my posts.</span><br /> +<br /> +<span>What do you blog about?</span><br /> +<br /> +<span class='quote'>Mostly technical topics I find exciting, like homelab projects, Kubernetes, or book summaries on IT and productivity. It’s a personal blog, so I write about what I enjoy.</span><br /> +<br /> +<h2 style='display: inline' id='wrap-up'>Wrap-up</h2><br /> +<br /> +<span>To wrap up, what are three things every team should keep in mind for stability?</span><br /> +<br /> +<span class='quote'>First, maintain runbooks and documentation to avoid chaos at night. Second, automate everything-manual installs in production are risky. Third, define SLIs, SLOs, and SLAs early so everyone knows what we’re monitoring and guaranteeing.</span><br /> +<br /> +<span>Is there a motto or mindset that particularly inspires you as an SRE?</span><br /> +<br /> +<span class='quote'>"Keep it simple and stupid"-KISS. Not everything has to be overly complex. And always stay curious. I’m still fascinated by how systems work under the hood.</span><br /> +<br /> +<span>Where can people find you online?</span><br /> +<br /> +<span class='quote'>You can find links to my socials on my website paul.buetow.org</span><br /> +<span class='quote'>I regularly post articles and link to everything else I’m working on outside of work.</span><br /> +<br /> +<a class='textlink' href='https://paul.buetow.org'>https://paul.buetow.org</a><br /> +<br /> +<span>Thank you very much for your time and this insightful interview into the world of site reliability engineering</span><br /> +<br /> +<span class='quote'>My pleasure, this was fun.</span><br /> +<br /> +<h2 style='display: inline' id='closing-comments'>Closing comments</h2><br /> +<br /> +<span>Dear reader, I hope this conversation with Paul Bütow provided an exciting peak into the world of Site Reliability Engineering. Whether you’re a software developer, data scientist, ML engineer, or manager, reliable systems are always a team effort. Hopefully, you’ve taken some insights or tips from Paul’s experiences for your own team or next project. Thanks for joining us, and best of luck refining your own SRE practices!</span><br /> +<br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> or contact Florian via the Cracking AI Engineering :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>Posts from October to December 2024</title> + <link href="gemini://foo.zone/gemfeed/2025-01-01-posts-from-october-to-december-2024.gmi" /> + <id>gemini://foo.zone/gemfeed/2025-01-01-posts-from-october-to-december-2024.gmi</id> + <updated>2024-12-31T18:09:58+02:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>Happy new year!</summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='posts-from-october-to-december-2024'>Posts from October to December 2024</h1><br /> +<br /> +<span class='quote'>Published at 2024-12-31T18:09:58+02:00</span><br /> +<br /> +<span>Happy new year!</span><br /> +<br /> +<span>These are my social media posts from the last three months. I keep them here to reflect on them and also to not lose them. Social media networks come and go and are not under my control, but my domain is here to stay. </span><br /> +<br /> +<span>These are from Mastodon and LinkedIn. Have a look at my about page for my social media profiles. This list is generated with Gos, my social media platform sharing tool.</span><br /> +<br /> +<a class='textlink' href='../about/index.html'>My about page</a><br /> +<a class='textlink' href='https://codeberg.org/snonux/gos'>https://codeberg.org/snonux/gos</a><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#posts-from-october-to-december-2024'>Posts from October to December 2024</a></li> +<li><a href='#posts-for-202410-202411-202412'>Posts for 202410 202411 202412</a></li> +<li>⇢ <a href='#october-2024'>October 2024</a></li> +<li>⇢ ⇢ <a href='#first-on-call-experience-in-a-startup-doesn-t-'>First on-call experience in a startup. Doesn't ...</a></li> +<li>⇢ ⇢ <a href='#reviewing-your-own-pr-or-mr-before-asking-'>Reviewing your own PR or MR before asking ...</a></li> +<li>⇢ ⇢ <a href='#fun-with-defer-in-golang-i-did-t-know-that-'>Fun with defer in <span class='inlinecode'>#golang</span>, I did't know, that ...</a></li> +<li>⇢ ⇢ <a href='#i-have-been-in-incidents-understandably-'>I have been in incidents. Understandably, ...</a></li> +<li>⇢ ⇢ <a href='#little-tips-using-strings-in-golang-and-i-'>Little tips using strings in <span class='inlinecode'>#golang</span> and I ...</a></li> +<li>⇢ ⇢ <a href='#reading-this-post-about-rust-especially-the-'>Reading this post about <span class='inlinecode'>#rust</span> (especially the ...</a></li> +<li>⇢ ⇢ <a href='#the-opposite-of-chaosmonkey--'>The opposite of <span class='inlinecode'>#ChaosMonkey</span> ... ...</a></li> +<li>⇢ <a href='#november-2024'>November 2024</a></li> +<li>⇢ ⇢ <a href='#i-just-became-a-silver-patreon-for-osnews-what-'>I just became a Silver Patreon for OSnews. What ...</a></li> +<li>⇢ ⇢ <a href='#until-now-i-wasn-t-aware-that-go-is-under-a-'>Until now, I wasn't aware, that Go is under a ...</a></li> +<li>⇢ ⇢ <a href='#these-are-some-book-notes-from-staff-engineer-'>These are some book notes from "Staff Engineer" ...</a></li> +<li>⇢ ⇢ <a href='#looking-at-kubernetes-it-s-pretty-much-'>Looking at <span class='inlinecode'>#Kubernetes</span>, it's pretty much ...</a></li> +<li>⇢ ⇢ <a href='#there-has-been-an-outage-at-the-upstream-'>There has been an outage at the upstream ...</a></li> +<li>⇢ ⇢ <a href='#one-of-the-more-confusing-parts-in-go-nil-'>One of the more confusing parts in Go, nil ...</a></li> +<li>⇢ ⇢ <a href='#agreeably-writing-down-with-diagrams-helps-you-'>Agreeably, writing down with Diagrams helps you ...</a></li> +<li>⇢ ⇢ <a href='#i-like-the-idea-of-types-in-ruby-raku-is-'>I like the idea of types in Ruby. Raku is ...</a></li> +<li>⇢ ⇢ <a href='#so-haskell-is-better-suited-for-general-'>So, <span class='inlinecode'>#Haskell</span> is better suited for general ...</a></li> +<li>⇢ ⇢ <a href='#at-first-functional-options-add-a-bit-of-'>At first, functional options add a bit of ...</a></li> +<li>⇢ ⇢ <a href='#revamping-my-home-lab-a-little-bit-freebsd-'>Revamping my home lab a little bit. <span class='inlinecode'>#freebsd</span> ...</a></li> +<li>⇢ ⇢ <a href='#wondering-to-which-web-browser-i-should-'>Wondering to which <span class='inlinecode'>#web</span> <span class='inlinecode'>#browser</span> I should ...</a></li> +<li>⇢ ⇢ <a href='#eks-node-viewer-is-a-nifty-tool-showing-the-'>eks-node-viewer is a nifty tool, showing the ...</a></li> +<li>⇢ ⇢ <a href='#have-put-more-photos-on---on-my-static-photo-'>Have put more Photos on - On my static photo ...</a></li> +<li>⇢ ⇢ <a href='#in-go-passing-pointers-are-not-automatically-'>In Go, passing pointers are not automatically ...</a></li> +<li>⇢ ⇢ <a href='#myself-being-part-of-an-on-call-rotations-over-'>Myself being part of an on-call rotations over ...</a></li> +<li>⇢ ⇢ <a href='#feels-good-to-code-in-my-old-love-perl-again-'>Feels good to code in my old love <span class='inlinecode'>#Perl</span> again ...</a></li> +<li>⇢ ⇢ <a href='#this-is-an-interactive-summary-of-the-go-'>This is an interactive summary of the Go ...</a></li> +<li>⇢ <a href='#december-2024'>December 2024</a></li> +<li>⇢ ⇢ <a href='#thats-unexpected-you-cant-remove-a-nan-key-'>Thats unexpected, you cant remove a NaN key ...</a></li> +<li>⇢ ⇢ <a href='#my-second-blog-post-about-revamping-my-home-lab-'>My second blog post about revamping my home lab ...</a></li> +<li>⇢ ⇢ <a href='#very-insightful-article-about-tech-hiring-in-'>Very insightful article about tech hiring in ...</a></li> +<li>⇢ ⇢ <a href='#for-bpf-ebpf-performance-debugging-have-'>for <span class='inlinecode'>#bpf</span> <span class='inlinecode'>#ebpf</span> performance debugging, have ...</a></li> +<li>⇢ ⇢ <a href='#89-things-heshe-knows-about-git-commits-is-a-'>89 things he/she knows about Git commits is a ...</a></li> +<li>⇢ ⇢ <a href='#i-found-that-working-on-multiple-side-projects-'>I found that working on multiple side projects ...</a></li> +<li>⇢ ⇢ <a href='#agreed-agreed-besides-ruby-i-would-also-'>Agreed? Agreed. Besides <span class='inlinecode'>#Ruby</span>, I would also ...</a></li> +<li>⇢ ⇢ <a href='#plan9-assembly-format-in-go-but-wait-it-s-not-'>Plan9 assembly format in Go, but wait, it's not ...</a></li> +<li>⇢ ⇢ <a href='#this-is-a-neat-blog-post-about-the-helix-text-'>This is a neat blog post about the Helix text ...</a></li> +<li>⇢ ⇢ <a href='#this-blog-post-is-basically-a-rant-against-'>This blog post is basically a rant against ...</a></li> +<li>⇢ ⇢ <a href='#quick-trick-to-get-helix-themes-selected-'>Quick trick to get Helix themes selected ...</a></li> +<li>⇢ ⇢ <a href='#example-where-complexity-attacks-you-from-'>Example where complexity attacks you from ...</a></li> +<li>⇢ ⇢ <a href='#llms-for-ops-summaries-of-logs-probabilities-'>LLMs for Ops? Summaries of logs, probabilities ...</a></li> +<li>⇢ ⇢ <a href='#excellent-article-about-your-dream-product-'>Excellent article about your dream Product ...</a></li> +<li>⇢ ⇢ <a href='#i-just-finished-reading-all-chapters-of-cpu-'>I just finished reading all chapters of CPU ...</a></li> +<li>⇢ ⇢ <a href='#indeed-useful-to-know-this-stuff-sre-'>Indeed, useful to know this stuff! <span class='inlinecode'>#sre</span> ...</a></li> +<li>⇢ ⇢ <a href='#it-s-the-small-things-which-make-unix-like-'>It's the small things, which make Unix like ...</a></li> +<li>⇢ ⇢ <a href='#my-new-year-s-resolution-is-not-to-start-any-'>My New Year's resolution is not to start any ...</a></li> +</ul><br /> +<h1 style='display: inline' id='posts-for-202410-202411-202412'>Posts for 202410 202411 202412</h1><br /> +<br /> +<h2 style='display: inline' id='october-2024'>October 2024</h2><br /> +<br /> +<h3 style='display: inline' id='first-on-call-experience-in-a-startup-doesn-t-'>First on-call experience in a startup. Doesn't ...</h3><br /> +<br /> +<span>First on-call experience in a startup. Doesn't sound a lot of fun! But the lessons were learned! <span class='inlinecode'>#sre</span></span><br /> +<br /> +<a class='textlink' href='https://ntietz.com/blog/lessons-from-my-first-on-call/'>ntietz.com/blog/lessons-from-my-first-on-call/</a><br /> +<br /> +<h3 style='display: inline' id='reviewing-your-own-pr-or-mr-before-asking-'>Reviewing your own PR or MR before asking ...</h3><br /> +<br /> +<span>Reviewing your own PR or MR before asking others to review it makes a lot of sense. Have seen so many silly mistakes which would have been avoided. Saving time for the real reviewer.</span><br /> +<br /> +<a class='textlink' href='https://www.jvt.me/posts/2019/01/12/self-code-review/'>www.jvt.me/posts/2019/01/12/self-code-review/</a><br /> +<br /> +<h3 style='display: inline' id='fun-with-defer-in-golang-i-did-t-know-that-'>Fun with defer in <span class='inlinecode'>#golang</span>, I did't know, that ...</h3><br /> +<br /> +<span>Fun with defer in <span class='inlinecode'>#golang</span>, I did't know, that a defer object can either be heap or stack allocated. And there are some rules for inlining, too.</span><br /> +<br /> +<a class='textlink' href='https://victoriametrics.com/blog/defer-in-go/'>victoriametrics.com/blog/defer-in-go/</a><br /> +<br /> +<h3 style='display: inline' id='i-have-been-in-incidents-understandably-'>I have been in incidents. Understandably, ...</h3><br /> +<br /> +<span>I have been in incidents. Understandably, everyone wants the issue to be resolved as quickly and others want to know how long TTR will be. IMHO, providing no estimates at all is no solution either. So maybe give a rough estimate but clearly communicate that the estimate is rough and that X, Y, and Z can interfere, meaning there is a chance it will take longer to resolve the incident. Just my thought. What's yours?</span><br /> +<br /> +<a class='textlink' href='https://firehydrant.com/blog/hot-take-dont-provide-incident-resolution-estimates/'>firehydrant.com/blog/hot-take-dont-provide-incident-resolution-estimates/</a><br /> +<br /> +<h3 style='display: inline' id='little-tips-using-strings-in-golang-and-i-'>Little tips using strings in <span class='inlinecode'>#golang</span> and I ...</h3><br /> +<br /> +<span>Little tips using strings in <span class='inlinecode'>#golang</span> and I personally think one must look more into the std lib (not just for strings, also for slices, maps,...), there are tons of useful helper functions.</span><br /> +<br /> +<a class='textlink' href='https://www.calhoun.io/6-tips-for-using-strings-in-go/'>www.calhoun.io/6-tips-for-using-strings-in-go/</a><br /> +<br /> +<h3 style='display: inline' id='reading-this-post-about-rust-especially-the-'>Reading this post about <span class='inlinecode'>#rust</span> (especially the ...</h3><br /> +<br /> +<span>Reading this post about <span class='inlinecode'>#rust</span> (especially the first part), I think I made a good choice in deciding to dive into <span class='inlinecode'>#golang</span> instead. There was a point where I wanted to learn a new programming language, and Rust was on my list of choices. I think the Go project does a much better job of deciding what goes into the language and how. What are your thoughts?</span><br /> +<br /> +<a class='textlink' href='https://josephg.com/blog/rewriting-rust/'>josephg.com/blog/rewriting-rust/</a><br /> +<br /> +<h3 style='display: inline' id='the-opposite-of-chaosmonkey--'>The opposite of <span class='inlinecode'>#ChaosMonkey</span> ... ...</h3><br /> +<br /> +<span>The opposite of <span class='inlinecode'>#ChaosMonkey</span> ... automatically repairing and healing services helping to reduce manual toil work. Runbooks and scripts are only the first step, followed by a fully blown service written in Go. Could be useful, but IMHO why not rather address the root causes of the manual toil work? <span class='inlinecode'>#sre</span></span><br /> +<br /> +<a class='textlink' href='https://blog.cloudflare.com/nl-nl/improving-platform-resilience-at-cloudflare/'>blog.cloudflare.com/nl-nl/improving-platform-resilience-at-cloudflare/</a><br /> +<br /> +<h2 style='display: inline' id='november-2024'>November 2024</h2><br /> +<br /> +<h3 style='display: inline' id='i-just-became-a-silver-patreon-for-osnews-what-'>I just became a Silver Patreon for OSnews. What ...</h3><br /> +<br /> +<span>I just became a Silver Patreon for OSnews. What is OSnews? It is an independent news site about IT. It is slightly independent and, at times, alternative. I have enjoyed it since my early student days. This one and other projects I financially support are listed here:</span><br /> +<br /> +<a class='textlink' href='gemini://foo.zone/gemfeed/2024-09-07-projects-i-support.gmi'>foo.zone/gemfeed/2024-09-07-projects-i-support.gmi (Gemini)</a><br /> +<a class='textlink' href='https://foo.zone/gemfeed/2024-09-07-projects-i-support.html'>foo.zone/gemfeed/2024-09-07-projects-i-support.html</a><br /> +<br /> +<h3 style='display: inline' id='until-now-i-wasn-t-aware-that-go-is-under-a-'>Until now, I wasn't aware, that Go is under a ...</h3><br /> +<br /> +<span>Until now, I wasn't aware, that Go is under a BSD-style license (3-clause as it seems). Neat. I don't know why, but I always was under the impression it would be MIT. <span class='inlinecode'>#bsd</span> <span class='inlinecode'>#golang</span></span><br /> +<br /> +<a class='textlink' href='https://go.dev/LICENSE'>go.dev/LICENSE</a><br /> +<br /> +<h3 style='display: inline' id='these-are-some-book-notes-from-staff-engineer-'>These are some book notes from "Staff Engineer" ...</h3><br /> +<br /> +<span>These are some book notes from "Staff Engineer" – there is some really good insight into what is expected from a Staff Engineer and beyond in the industry. I wish I had read the book earlier.</span><br /> +<br /> +<a class='textlink' href='gemini://foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.gmi'>foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.gmi (Gemini)</a><br /> +<a class='textlink' href='https://foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.html'>foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.html</a><br /> +<br /> +<h3 style='display: inline' id='looking-at-kubernetes-it-s-pretty-much-'>Looking at <span class='inlinecode'>#Kubernetes</span>, it's pretty much ...</h3><br /> +<br /> +<span>Looking at <span class='inlinecode'>#Kubernetes</span>, it's pretty much following the Unix way of doing things. It has many tools, but each tool has its own single purpose: DNS, scheduling, container runtime, various controllers, networking, observability, alerting, and more services in the control plane. Everything is managed by different services or plugins, mostly running in their dedicated pods. They don't communicate through pipes, but network sockets, though. <span class='inlinecode'>#k8s</span></span><br /> +<br /> +<h3 style='display: inline' id='there-has-been-an-outage-at-the-upstream-'>There has been an outage at the upstream ...</h3><br /> +<br /> +<span>There has been an outage at the upstream network provider for OpenBSD.Amsterdam (hoster, I am using). This was the first real-world test for my KISS HA setup, and it worked flawlessly! All my sites and services failed over automatically to my other <span class='inlinecode'>#OpenBSD</span> VM!</span><br /> +<br /> +<a class='textlink' href='gemini://foo.zone/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi'>foo.zone/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi (Gemini)</a><br /> +<a class='textlink' href='https://foo.zone/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.html'>foo.zone/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.html</a><br /> +<a class='textlink' href='https://openbsd.amsterdam/'>openbsd.amsterdam/</a><br /> +<br /> +<h3 style='display: inline' id='one-of-the-more-confusing-parts-in-go-nil-'>One of the more confusing parts in Go, nil ...</h3><br /> +<br /> +<span>One of the more confusing parts in Go, nil values vs nil errors: <span class='inlinecode'>#golang</span></span><br /> +<br /> +<a class='textlink' href='https://unexpected-go.com/nil-errors-that-are-non-nil-errors.html'>unexpected-go.com/nil-errors-that-are-non-nil-errors.html</a><br /> +<br /> +<h3 style='display: inline' id='agreeably-writing-down-with-diagrams-helps-you-'>Agreeably, writing down with Diagrams helps you ...</h3><br /> +<br /> +<span>Agreeably, writing down with Diagrams helps you to think things more through. And keeps others on the same page. Only worth for projects from a certain size, IMHO.</span><br /> +<br /> +<a class='textlink' href='https://ntietz.com/blog/reasons-to-write-design-docs/'>ntietz.com/blog/reasons-to-write-design-docs/</a><br /> +<br /> +<h3 style='display: inline' id='i-like-the-idea-of-types-in-ruby-raku-is-'>I like the idea of types in Ruby. Raku is ...</h3><br /> +<br /> +<span>I like the idea of types in Ruby. Raku is supports that already, but in Ruby, you must specify the types in a separate .rbs file, which is, in my opinion, cumbersome and is a reason not to use it extensively for now. I believe there are efforts to embed the type information in the standard .rb files, and that the .rbs is just an experiment to see how types could work out without introducing changes into the core Ruby language itself right now? <span class='inlinecode'>#Ruby</span> <span class='inlinecode'>#RakuLang</span></span><br /> +<br /> +<a class='textlink' href='https://github.com/ruby/rbs'>github.com/ruby/rbs</a><br /> +<br /> +<h3 style='display: inline' id='so-haskell-is-better-suited-for-general-'>So, <span class='inlinecode'>#Haskell</span> is better suited for general ...</h3><br /> +<br /> +<span>So, <span class='inlinecode'>#Haskell</span> is better suited for general purpose than <span class='inlinecode'>#Rust</span>? I thought deploying something in Haskell means publishing an academic paper :-) Interesting rant about Rust, though:</span><br /> +<br /> +<a class='textlink' href='https://chrisdone.com/posts/rust/'>chrisdone.com/posts/rust/</a><br /> +<br /> +<h3 style='display: inline' id='at-first-functional-options-add-a-bit-of-'>At first, functional options add a bit of ...</h3><br /> +<br /> +<span>At first, functional options add a bit of boilerplate, but they turn out to be quite neat, especially when you have very long parameter lists that need to be made neat and tidy. <span class='inlinecode'>#golang</span></span><br /> +<br /> +<a class='textlink' href='https://www.calhoun.io/using-functional-options-instead-of-method-chaining-in-go/'>www.calhoun.io/using-functional-options-instead-of-method-chaining-in-go/</a><br /> +<br /> +<h3 style='display: inline' id='revamping-my-home-lab-a-little-bit-freebsd-'>Revamping my home lab a little bit. <span class='inlinecode'>#freebsd</span> ...</h3><br /> +<br /> +<span>Revamping my home lab a little bit. <span class='inlinecode'>#freebsd</span> <span class='inlinecode'>#bhyve</span> <span class='inlinecode'>#rocky</span> <span class='inlinecode'>#linux</span> <span class='inlinecode'>#vm</span> <span class='inlinecode'>#k3s</span> <span class='inlinecode'>#kubernetes</span> <span class='inlinecode'>#wireguard</span> <span class='inlinecode'>#zfs</span> <span class='inlinecode'>#nfs</span> <span class='inlinecode'>#ha</span> <span class='inlinecode'>#relayd</span> <span class='inlinecode'>#k8s</span> <span class='inlinecode'>#selfhosting</span> <span class='inlinecode'>#homelab</span></span><br /> +<br /> +<a class='textlink' href='gemini://foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi'>foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi (Gemini)</a><br /> +<a class='textlink' href='https://foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.html</a><br /> +<br /> +<h3 style='display: inline' id='wondering-to-which-web-browser-i-should-'>Wondering to which <span class='inlinecode'>#web</span> <span class='inlinecode'>#browser</span> I should ...</h3><br /> +<br /> +<span>Wondering to which <span class='inlinecode'>#web</span> <span class='inlinecode'>#browser</span> I should switch now personally ...</span><br /> +<br /> +<a class='textlink' href='https://www.osnews.com/story/141100/mozilla-foundation-lays-off-30-of-its-employees-ends-advocacy-for-open-web-privacy-and-more/'>www.osnews.com/story/141100/mozilla-fo..-..dvocacy-for-open-web-privacy-and-more/</a><br /> +<br /> +<h3 style='display: inline' id='eks-node-viewer-is-a-nifty-tool-showing-the-'>eks-node-viewer is a nifty tool, showing the ...</h3><br /> +<br /> +<span>eks-node-viewer is a nifty tool, showing the compute nodes currently in use in the <span class='inlinecode'>#EKS</span> cluster. especially useful when dynamically allocating nodes with <span class='inlinecode'>#karpenter</span> or auto scaling groups.</span><br /> +<br /> +<a class='textlink' href='https://github.com/awslabs/eks-node-viewer'>github.com/awslabs/eks-node-viewer</a><br /> +<br /> +<h3 style='display: inline' id='have-put-more-photos-on---on-my-static-photo-'>Have put more Photos on - On my static photo ...</h3><br /> +<br /> +<span>Have put more Photos on - On my static photo sites - Generated with a <span class='inlinecode'>#bash</span> script</span><br /> +<br /> +<a class='textlink' href='https://irregular.ninja'>irregular.ninja</a><br /> +<br /> +<h3 style='display: inline' id='in-go-passing-pointers-are-not-automatically-'>In Go, passing pointers are not automatically ...</h3><br /> +<br /> +<span>In Go, passing pointers are not automatically faster than values. Pointers often force the memory to be allocated on the heap, adding GC overhad. With values, Go can determine whether to put the memory on the stack instead. But with large structs/objects (how you want to call them) or if you want to modify state, then pointers are the semantic to use. <span class='inlinecode'>#golang</span></span><br /> +<br /> +<a class='textlink' href='https://blog.boot.dev/golang/pointers-faster-than-values/'>blog.boot.dev/golang/pointers-faster-than-values/</a><br /> +<br /> +<h3 style='display: inline' id='myself-being-part-of-an-on-call-rotations-over-'>Myself being part of an on-call rotations over ...</h3><br /> +<br /> +<span>Myself being part of an on-call rotations over my whole professional life, just have learned this lesson "Tell people who are new to on-call: Just have fun" :-) This is a neat blog post to read:</span><br /> +<br /> +<a class='textlink' href='https://ntietz.com/blog/what-i-tell-people-new-to-oncall/'>ntietz.com/blog/what-i-tell-people-new-to-oncall/</a><br /> +<br /> +<h3 style='display: inline' id='feels-good-to-code-in-my-old-love-perl-again-'>Feels good to code in my old love <span class='inlinecode'>#Perl</span> again ...</h3><br /> +<br /> +<span>Feels good to code in my old love <span class='inlinecode'>#Perl</span> again after a while. I am implementing a log parser for generating site stats of my personal homepage! :-) @Perl</span><br /> +<br /> +<h3 style='display: inline' id='this-is-an-interactive-summary-of-the-go-'>This is an interactive summary of the Go ...</h3><br /> +<br /> +<span>This is an interactive summary of the Go release, with a lot of examples utilising iterators in the slices and map packages. Love it! <span class='inlinecode'>#golang</span></span><br /> +<br /> +<a class='textlink' href='https://antonz.org/go-1-23/'>antonz.org/go-1-23/</a><br /> +<br /> +<h2 style='display: inline' id='december-2024'>December 2024</h2><br /> +<br /> +<h3 style='display: inline' id='thats-unexpected-you-cant-remove-a-nan-key-'>Thats unexpected, you cant remove a NaN key ...</h3><br /> +<br /> +<span>Thats unexpected, you cant remove a NaN key from a map without clearing it! <span class='inlinecode'>#golang</span></span><br /> +<br /> +<a class='textlink' href='https://unexpected-go.com/you-cant-remove-a-nan-key-from-a-map-without-clearing-it.html'>unexpected-go.com/you-cant-remove-a-nan-key-from-a-map-without-clearing-it.html</a><br /> +<br /> +<h3 style='display: inline' id='my-second-blog-post-about-revamping-my-home-lab-'>My second blog post about revamping my home lab ...</h3><br /> +<br /> +<span>My second blog post about revamping my home lab a little bit just hit the net. <span class='inlinecode'>#FreeBSD</span> <span class='inlinecode'>#ZFS</span> <span class='inlinecode'>#n100</span> <span class='inlinecode'>#k8s</span> <span class='inlinecode'>#k3s</span> <span class='inlinecode'>#kubernetes</span></span><br /> +<br /> +<a class='textlink' href='gemini://foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi'>foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi (Gemini)</a><br /> +<a class='textlink' href='https://foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.html</a><br /> +<br /> +<h3 style='display: inline' id='very-insightful-article-about-tech-hiring-in-'>Very insightful article about tech hiring in ...</h3><br /> +<br /> +<span>Very insightful article about tech hiring in the age of LLMs. As an interviewer, I have experienced some of the scrnarios already first hand...</span><br /> +<br /> +<a class='textlink' href='https://newsletter.pragmaticengineer.com/p/how-genai-changes-tech-hiring'>newsletter.pragmaticengineer.com/p/how-genai-changes-tech-hiring</a><br /> +<br /> +<h3 style='display: inline' id='for-bpf-ebpf-performance-debugging-have-'>for <span class='inlinecode'>#bpf</span> <span class='inlinecode'>#ebpf</span> performance debugging, have ...</h3><br /> +<br /> +<span>for <span class='inlinecode'>#bpf</span> <span class='inlinecode'>#ebpf</span> performance debugging, have a look at bpftop from Netflix. A neat tool showing you the estimated CPU time and other performance statistics for all the BPF programs currently loaded into the <span class='inlinecode'>#linux</span> kernel. Highly recommend!</span><br /> +<br /> +<a class='textlink' href='https://github.com/Netflix/bpftop'>github.com/Netflix/bpftop</a><br /> +<br /> +<h3 style='display: inline' id='89-things-heshe-knows-about-git-commits-is-a-'>89 things he/she knows about Git commits is a ...</h3><br /> +<br /> +<span>89 things he/she knows about Git commits is a neat list of <span class='inlinecode'>#Git</span> wisdoms</span><br /> +<br /> +<a class='textlink' href='https://www.jvt.me/posts/2024/07/12/things-know-commits/'>www.jvt.me/posts/2024/07/12/things-know-commits/</a><br /> +<br /> +<h3 style='display: inline' id='i-found-that-working-on-multiple-side-projects-'>I found that working on multiple side projects ...</h3><br /> +<br /> +<span>I found that working on multiple side projects concurrently is better than concentrating on just one. This seems inefficient at first, but whenever you tend to lose motivation, you can temporarily switch to another one with full élan. However, remember to stop starting and start finishing. This doesn't mean you should be working on 10+ (and a growing list of) side projects concurrently! Select your projects and commit to finishing them before starting the next thing. For example, my current limit of concurrent side projects is around five.</span><br /> +<br /> +<h3 style='display: inline' id='agreed-agreed-besides-ruby-i-would-also-'>Agreed? Agreed. Besides <span class='inlinecode'>#Ruby</span>, I would also ...</h3><br /> +<br /> +<span>Agreed? Agreed. Besides <span class='inlinecode'>#Ruby</span>, I would also add <span class='inlinecode'>#RakuLang</span> and <span class='inlinecode'>#Perl</span> @Perl to the list of languages that are great for shell scripts - "Making Easy Things Easy and Hard Things Possible"</span><br /> +<br /> +<a class='textlink' href='https://lucasoshiro.github.io/posts-en/2024-06-17-ruby-shellscript/'>lucasoshiro.github.io/posts-en/2024-06-17-ruby-shellscript/</a><br /> +<br /> +<h3 style='display: inline' id='plan9-assembly-format-in-go-but-wait-it-s-not-'>Plan9 assembly format in Go, but wait, it's not ...</h3><br /> +<br /> +<span>Plan9 assembly format in Go, but wait, it's not the Operating System Plan9! <span class='inlinecode'>#golang</span> <span class='inlinecode'>#rabbithole</span></span><br /> +<br /> +<a class='textlink' href='https://www.osnews.com/story/140941/go-plan9-memo-speeding-up-calculations-450/'>www.osnews.com/story/140941/go-plan9-memo-speeding-up-calculations-450/</a><br /> +<br /> +<h3 style='display: inline' id='this-is-a-neat-blog-post-about-the-helix-text-'>This is a neat blog post about the Helix text ...</h3><br /> +<br /> +<span>This is a neat blog post about the Helix text editor, to which I personally switched around a year ago (from NeoVim). I should blog about my experience as well. To summarize: I am using it together with the terminal multiplexer <span class='inlinecode'>#tmux</span>. It doesn't bother me that Helix is purely terminal-based and therefore everything has to be in the same font. <span class='inlinecode'>#HelixEditor</span></span><br /> +<br /> +<a class='textlink' href='https://jonathan-frere.com/posts/helix/'>jonathan-frere.com/posts/helix/</a><br /> +<br /> +<h3 style='display: inline' id='this-blog-post-is-basically-a-rant-against-'>This blog post is basically a rant against ...</h3><br /> +<br /> +<span>This blog post is basically a rant against DataDog... Personally, I don't have much experience with DataDog (actually, I have never used it), but one reason to work with logs at my day job (with over 2,000 physical server machines) and to be cost-effective is by using dtail! <span class='inlinecode'>#dtail</span> <span class='inlinecode'>#logs</span> <span class='inlinecode'>#logmanagement</span></span><br /> +<br /> +<a class='textlink' href='https://crys.site/blog/2024/reinventint-the-weel/'>crys.site/blog/2024/reinventint-the-weel/</a><br /> +<a class='textlink' href='https://dtail.dev'>dtail.dev</a><br /> +<br /> +<h3 style='display: inline' id='quick-trick-to-get-helix-themes-selected-'>Quick trick to get Helix themes selected ...</h3><br /> +<br /> +<span>Quick trick to get Helix themes selected randomly <span class='inlinecode'>#HelixEditor</span></span><br /> +<br /> +<a class='textlink' href='gemini://foo.zone/gemfeed/2024-12-15-random-helix-themes.gmi'>foo.zone/gemfeed/2024-12-15-random-helix-themes.gmi (Gemini)</a><br /> +<a class='textlink' href='https://foo.zone/gemfeed/2024-12-15-random-helix-themes.html'>foo.zone/gemfeed/2024-12-15-random-helix-themes.html</a><br /> +<br /> +<h3 style='display: inline' id='example-where-complexity-attacks-you-from-'>Example where complexity attacks you from ...</h3><br /> +<br /> +<span>Example where complexity attacks you from behind <span class='inlinecode'>#k8s</span> <span class='inlinecode'>#kubernetes</span> <span class='inlinecode'>#OpenAI</span></span><br /> +<br /> +<a class='textlink' href='https://surfingcomplexity.blog/2024/12/14/quick-takes-on-the-recent-openai-public-incident-write-up/'>surfingcomplexity.blog/2024/12/14/quic..-..ecent-openai-public-incident-write-up/</a><br /> +<br /> +<h3 style='display: inline' id='llms-for-ops-summaries-of-logs-probabilities-'>LLMs for Ops? Summaries of logs, probabilities ...</h3><br /> +<br /> +<span>LLMs for Ops? Summaries of logs, probabilities about correctness, auto-generating Ansible, some uses cases are there. Wouldn't trust it fully, though.</span><br /> +<br /> +<a class='textlink' href='https://youtu.be/WodaffxVq-E?si=noY0egrfl5izCSQI'>youtu.be/WodaffxVq-E?si=noY0egrfl5izCSQI</a><br /> +<br /> +<h3 style='display: inline' id='excellent-article-about-your-dream-product-'>Excellent article about your dream Product ...</h3><br /> +<br /> +<span>Excellent article about your dream Product Manager: Why every software team needs a product manager to thrive via @wallabagapp</span><br /> +<br /> +<a class='textlink' href='https://testdouble.com/insights/why-product-managers-accelerate-improve-software-delivery'>testdouble.com/insights/why-product-ma..-..s-accelerate-improve-software-delivery</a><br /> +<br /> +<h3 style='display: inline' id='i-just-finished-reading-all-chapters-of-cpu-'>I just finished reading all chapters of CPU ...</h3><br /> +<br /> +<span>I just finished reading all chapters of CPU land: ... not claiming to remember every detail, but it is a great refresher how CPUs and operating systems actually work under the hood when you execute a program, which we tend to forget in our higher abstraction world. I liked the "story" and some of the jokes along the way! Size wise, it is pretty digestable (not talking about books, but only 7 web articles/chapters)! <span class='inlinecode'>#cpu</span> <span class='inlinecode'>#linux</span> <span class='inlinecode'>#unix</span> <span class='inlinecode'>#kernel</span> <span class='inlinecode'>#macOS</span></span><br /> +<br /> +<a class='textlink' href='https://cpu.land/'>cpu.land/</a><br /> +<br /> +<h3 style='display: inline' id='indeed-useful-to-know-this-stuff-sre-'>Indeed, useful to know this stuff! <span class='inlinecode'>#sre</span> ...</h3><br /> +<br /> +<span>Indeed, useful to know this stuff! <span class='inlinecode'>#sre</span></span><br /> +<br /> +<a class='textlink' href='https://biriukov.dev/docs/resolver-dual-stack-application/0-sre-should-know-about-gnu-linux-resolvers-and-dual-stack-applications/'>biriukov.dev/docs/resolver-dual-stack-..-..resolvers-and-dual-stack-applications/</a><br /> +<br /> +<h3 style='display: inline' id='it-s-the-small-things-which-make-unix-like-'>It's the small things, which make Unix like ...</h3><br /> +<br /> +<span>It's the small things, which make Unix like systems, like GNU/Linux, interesting. Didn't know about this <span class='inlinecode'>#GNU</span> <span class='inlinecode'>#Tar</span> behaviour yet:</span><br /> +<br /> +<a class='textlink' href='https://xeiaso.net/notes/2024/pop-quiz-tar/'>xeiaso.net/notes/2024/pop-quiz-tar/</a><br /> +<br /> +<h3 style='display: inline' id='my-new-year-s-resolution-is-not-to-start-any-'>My New Year's resolution is not to start any ...</h3><br /> +<br /> +<span>My New Year's resolution is not to start any new non-fiction books (or only very few) but to re-read and listen to my favorites, which I read to reflect on and see things from different perspectives. Every time you re-read a book, you gain new insights.<nil>17491</span><br /> +<br /> +<span>Other related posts:</span><br /> +<br /> +<a class='textlink' href='./2025-01-01-posts-from-october-to-december-2024.html'>2025-01-01 Posts from October to December 2024 (You are currently reading this)</a><br /> +<br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>Random Helix Themes</title> + <link href="gemini://foo.zone/gemfeed/2024-12-15-random-helix-themes.gmi" /> + <id>gemini://foo.zone/gemfeed/2024-12-15-random-helix-themes.gmi</id> + <updated>2024-12-15T13:55:05+02:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>I thought it would be fun to have a random Helix theme every time I open a new shell. Helix is the text editor I use.</summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='random-helix-themes'>Random Helix Themes</h1><br /> +<br /> +<span class='quote'>Published at 2024-12-15T13:55:05+02:00; Last updated 2024-12-18</span><br /> +<br /> +<span>I thought it would be fun to have a random Helix theme every time I open a new shell. Helix is the text editor I use.</span><br /> +<br /> +<a class='textlink' href='https://helix-editor.com/'>https://helix-editor.com/</a><br /> +<br /> +<span>So I put this into my <span class='inlinecode'>zsh</span> dotfiles (in some <span class='inlinecode'>editor.zsh.source</span> in my <span class='inlinecode'>~</span> directory):</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><b><font color="#ffffff">export</font></b><font color="#ff0000"> </font><font color="#ff0000">EDITOR</font><font color="#F3E651">=</font><font color="#ff0000">hx</font> +<b><font color="#ffffff">export</font></b><font color="#ff0000"> </font><font color="#ff0000">VISUAL</font><font color="#F3E651">=</font><font color="#ff0000">$EDITOR</font> +<b><font color="#ffffff">export</font></b><font color="#ff0000"> </font><font color="#ff0000">GIT_EDITOR</font><font color="#F3E651">=</font><font color="#ff0000">$EDITOR</font> +<b><font color="#ffffff">export</font></b><font color="#ff0000"> </font><font color="#ff0000">HELIX_CONFIG_DIR</font><font color="#F3E651">=</font><font color="#ff0000">$HOME</font><font color="#F3E651">/.</font><font color="#ff0000">config/helix</font> + +<font color="#ff0000">editor</font><font color="#F3E651">::</font><font color="#ff0000">helix</font><font color="#F3E651">::</font><font color="#7bc710">random_theme ()</font><font color="#ff0000"> {</font> +<font color="#ff0000"> </font><i><font color="#ababab"># May add more theme search paths based on OS. This one is</font></i> +<font color="#ff0000"> </font><i><font color="#ababab"># for Fedora Linux, but there is also MacOS, etc.</font></i> +<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">theme_dir</font><font color="#F3E651">=</font><font color="#ff0000">/usr/share/helix/runtime/themes</font> +<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#F3E651">!</font><font color="#ff0000"> -d </font><font color="#ff0000">$theme_dir</font><font color="#ff0000"> </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> +<font color="#ff0000"> echo </font><font color="#bb00ff">"Helix theme dir $theme_dir doesnt exist"</font> +<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> </font><font color="#bb00ff">1</font> +<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> + +<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">config_file</font><font color="#F3E651">=</font><font color="#ff0000">$HELIX_CONFIG_DIR</font><font color="#ff0000">/config</font><font color="#F3E651">.</font><font color="#ff0000">toml</font> +<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">random_theme</font><font color="#F3E651">=</font><font color="#bb00ff">"$(basename "</font><font color="#ff0000">$(</font><font color="#ff0000">ls </font><font color="#ff0000">$theme_dir</font><font color="#ff0000"> </font><font color="#F3E651">\</font> +<font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> grep -v random</font><font color="#F3E651">.</font><font color="#ff0000">toml </font><font color="#F3E651">|</font><font color="#ff0000"> grep </font><font color="#F3E651">.</font><font color="#ff0000">toml </font><font color="#F3E651">|</font><font color="#ff0000"> sort -R </font><font color="#F3E651">\</font> +<font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> head -n </font><font color="#bb00ff">1</font><font color="#F3E651">)</font><font color="#bb00ff">" | cut -d. -f1)"</font> + +<font color="#ff0000"> sed </font><font color="#bb00ff">"/^theme =/ { s/.*/theme = </font><font color="#ffffff">\"</font><font color="#bb00ff">$random_theme</font><font color="#ffffff">\"</font><font color="#bb00ff">/; }"</font><font color="#ff0000"> </font><font color="#F3E651">\</font> +<font color="#ff0000"> </font><font color="#ff0000">$config_file</font><font color="#ff0000"> </font><font color="#F3E651">></font><font color="#ff0000"> </font><font color="#ff0000">$config_file</font><font color="#F3E651">.</font><font color="#ff0000">tmp </font><font color="#F3E651">&&</font><font color="#ff0000"> </font> +<font color="#ff0000"> mv </font><font color="#ff0000">$config_file</font><font color="#F3E651">.</font><font color="#ff0000">tmp </font><font color="#ff0000">$config_file</font> +<font color="#ff0000">}</font> + +<b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> -f </font><font color="#ff0000">$HELIX_CONFIG_DIR</font><font color="#ff0000">/config</font><font color="#F3E651">.</font><font color="#ff0000">toml </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> +<font color="#ff0000"> editor</font><font color="#F3E651">::</font><font color="#ff0000">helix</font><font color="#F3E651">::</font><font color="#ff0000">random_theme</font> +<b><font color="#ffffff">fi</font></b> +</pre> +<br /> +<span>So every time I open a new terminal or shell, <span class='inlinecode'>editor::helix::random_theme</span> gets called, which randomly selects a theme from all installed ones and updates the helix config accordingly.</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><font color="#F3E651">[</font><font color="#ff0000">paul@earth</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">~</font><font color="#ff0000"> </font><font color="#F3E651">%</font><font color="#ff0000"> editor</font><font color="#F3E651">::</font><font color="#ff0000">helix</font><font color="#F3E651">::</font><font color="#ff0000">random_theme</font> +<font color="#F3E651">[</font><font color="#ff0000">paul@earth</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">~</font><font color="#ff0000"> </font><font color="#F3E651">%</font><font color="#ff0000"> head -n </font><font color="#bb00ff">1</font><font color="#ff0000"> </font><font color="#F3E651">~/.</font><font color="#ff0000">config/helix/config</font><font color="#F3E651">.</font><font color="#ff0000">toml</font> +<font color="#ff0000">theme </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#bb00ff">"jellybeans"</font> +<font color="#F3E651">[</font><font color="#ff0000">paul@earth</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">~</font><font color="#ff0000"> </font><font color="#F3E651">%</font><font color="#ff0000"> editor</font><font color="#F3E651">::</font><font color="#ff0000">helix</font><font color="#F3E651">::</font><font color="#ff0000">random_theme</font> +<font color="#F3E651">[</font><font color="#ff0000">paul@earth</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">~</font><font color="#ff0000"> </font><font color="#F3E651">%</font><font color="#ff0000"> head -n </font><font color="#bb00ff">1</font><font color="#ff0000"> </font><font color="#F3E651">~/.</font><font color="#ff0000">config/helix/config</font><font color="#F3E651">.</font><font color="#ff0000">toml</font> +<font color="#ff0000">theme </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#bb00ff">"rose_pine"</font> +<font color="#F3E651">[</font><font color="#ff0000">paul@earth</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">~</font><font color="#ff0000"> </font><font color="#F3E651">%</font><font color="#ff0000"> editor</font><font color="#F3E651">::</font><font color="#ff0000">helix</font><font color="#F3E651">::</font><font color="#ff0000">random_theme</font> +<font color="#F3E651">[</font><font color="#ff0000">paul@earth</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">~</font><font color="#ff0000"> </font><font color="#F3E651">%</font><font color="#ff0000"> head -n </font><font color="#bb00ff">1</font><font color="#ff0000"> </font><font color="#F3E651">~/.</font><font color="#ff0000">config/helix/config</font><font color="#F3E651">.</font><font color="#ff0000">toml</font> +<font color="#ff0000">theme </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#bb00ff">"noctis"</font> +<font color="#F3E651">[</font><font color="#ff0000">paul@earth</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">~</font><font color="#ff0000"> </font><font color="#F3E651">%</font> +</pre> +<br /> +<h2 style='display: inline' id='a-better-version'>A better version</h2><br /> +<br /> +<span class='quote'>Update 2024-12-18: This is an improved version, which works cross platform (e.g., also on MacOS) and multiple theme directories:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><b><font color="#ffffff">export</font></b><font color="#ff0000"> </font><font color="#ff0000">EDITOR</font><font color="#F3E651">=</font><font color="#ff0000">hx</font> +<b><font color="#ffffff">export</font></b><font color="#ff0000"> </font><font color="#ff0000">VISUAL</font><font color="#F3E651">=</font><font color="#ff0000">$EDITOR</font> +<b><font color="#ffffff">export</font></b><font color="#ff0000"> </font><font color="#ff0000">GIT_EDITOR</font><font color="#F3E651">=</font><font color="#ff0000">$EDITOR</font> +<b><font color="#ffffff">export</font></b><font color="#ff0000"> </font><font color="#ff0000">HELIX_CONFIG_DIR</font><font color="#F3E651">=</font><font color="#ff0000">$HOME</font><font color="#F3E651">/.</font><font color="#ff0000">config/helix</font> + +<font color="#ff0000">editor</font><font color="#F3E651">::</font><font color="#ff0000">helix</font><font color="#F3E651">::</font><font color="#ff0000">theme</font><font color="#F3E651">::</font><font color="#7bc710">get_random ()</font><font color="#ff0000"> {</font> +<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> dir </font><b><font color="#ffffff">in</font></b><font color="#ff0000"> </font><font color="#ff0000">$(</font><font color="#ff0000">hx --health </font><font color="#F3E651">\</font> +<font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> awk </font><font color="#bb00ff">'/^Runtime directories/ { print $3 }'</font><font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> tr </font><font color="#bb00ff">';'</font><font color="#ff0000"> </font><font color="#bb00ff">' '</font><font color="#F3E651">);</font><font color="#ff0000"> </font><b><font color="#ffffff">do</font></b> +<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> -d </font><font color="#ff0000">$dir</font><font color="#ff0000">/themes </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> +<font color="#ff0000"> ls </font><font color="#ff0000">$dir</font><font color="#ff0000">/themes</font> +<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> +<font color="#ff0000"> </font><b><font color="#ffffff">done</font></b><font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> grep -F </font><font color="#F3E651">.</font><font color="#ff0000">toml </font><font color="#F3E651">|</font><font color="#ff0000"> sort -R </font><font color="#F3E651">|</font><font color="#ff0000"> head -n </font><font color="#bb00ff">1</font><font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> cut -d</font><font color="#F3E651">.</font><font color="#ff0000"> -f</font><font color="#bb00ff">1</font> +<font color="#ff0000">}</font> + +<font color="#ff0000">editor</font><font color="#F3E651">::</font><font color="#ff0000">helix</font><font color="#F3E651">::</font><font color="#ff0000">theme</font><font color="#F3E651">::</font><font color="#7bc710">set ()</font><font color="#ff0000"> {</font> +<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">theme</font><font color="#F3E651">=</font><font color="#bb00ff">"$1"</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">shift</font></b> + +<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">config_file</font><font color="#F3E651">=</font><font color="#ff0000">$HELIX_CONFIG_DIR</font><font color="#ff0000">/config</font><font color="#F3E651">.</font><font color="#ff0000">toml</font> + +<font color="#ff0000"> sed </font><font color="#bb00ff">"/^theme =/ { s/.*/theme = </font><font color="#ffffff">\"</font><font color="#bb00ff">$theme</font><font color="#ffffff">\"</font><font color="#bb00ff">/; }"</font><font color="#ff0000"> </font><font color="#F3E651">\</font> +<font color="#ff0000"> </font><font color="#ff0000">$config_file</font><font color="#ff0000"> </font><font color="#F3E651">></font><font color="#ff0000"> </font><font color="#ff0000">$config_file</font><font color="#F3E651">.</font><font color="#ff0000">tmp </font><font color="#F3E651">&&</font><font color="#ff0000"> </font> +<font color="#ff0000"> mv </font><font color="#ff0000">$config_file</font><font color="#F3E651">.</font><font color="#ff0000">tmp </font><font color="#ff0000">$config_file</font> +<font color="#ff0000">}</font> + +<b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> -f </font><font color="#ff0000">$HELIX_CONFIG_DIR</font><font color="#ff0000">/config</font><font color="#F3E651">.</font><font color="#ff0000">toml </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> +<font color="#ff0000"> editor</font><font color="#F3E651">::</font><font color="#ff0000">helix</font><font color="#F3E651">::</font><font color="#ff0000">theme</font><font color="#F3E651">::</font><b><font color="#ffffff">set</font></b><font color="#ff0000"> </font><font color="#ff0000">$(editor::helix::theme::get_random)</font> +<b><font color="#ffffff">fi</font></b> +</pre> +<br /> +<span>I hope you had some fun. E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</title> + <link href="gemini://foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi" /> + <id>gemini://foo.zone/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi</id> + <updated>2024-12-02T23:48:21+02:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>This is the second blog post about my f3s series for my self-hosting demands in my home lab. f3s? The 'f' stands for FreeBSD, and the '3s' stands for k3s, the Kubernetes distribution I will use on FreeBSD-based physical machines.</summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='f3s-kubernetes-with-freebsd---part-2-hardware-and-base-installation'>f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</h1><br /> +<br /> +<span class='quote'>Published at 2024-12-02T23:48:21+02:00</span><br /> +<br /> +<span>This is the second blog post about my f3s series for my self-hosting demands in my home lab. f3s? The "f" stands for FreeBSD, and the "3s" stands for k3s, the Kubernetes distribution I will use on FreeBSD-based physical machines.</span><br /> +<br /> +<span>We set the stage last time; this time, we will set up the hardware for this project. </span><br /> +<br /> +<span>These are all the posts so far:</span><br /> +<br /> +<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br /> +<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</a><br /> +<br /> +<a href='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png'><img alt='f3s logo' title='f3s logo' src='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png' /></a><br /> +<br /> +<span class='quote'>Logo was generated by ChatGPT.</span><br /> +<br /> +<span>Let's continue...</span><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#f3s-kubernetes-with-freebsd---part-2-hardware-and-base-installation'>f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a></li> +<li><a href='#deciding-on-the-hardware'>Deciding on the hardware</a></li> +<li>⇢ <a href='#not-arm-but-intel-n100-'>Not ARM but Intel N100 </a></li> +<li>⇢ <a href='#beelink-unboxing'>Beelink unboxing</a></li> +<li>⇢ <a href='#network-switch'>Network switch</a></li> +<li><a href='#installing-freebsd'>Installing FreeBSD</a></li> +<li>⇢ <a href='#base-install'>Base install</a></li> +<li>⇢ <a href='#latest-patch-level-and-customizing-etchosts'>Latest patch level and customizing <span class='inlinecode'>/etc/hosts</span></a></li> +<li>⇢ <a href='#after-install'>After install</a></li> +<li>⇢ ⇢ <a href='#helix-editor'>Helix editor</a></li> +<li>⇢ ⇢ <a href='#doas'><span class='inlinecode'>doas</span></a></li> +<li>⇢ ⇢ <a href='#periodic-zfs-snapshotting'>Periodic ZFS snapshotting</a></li> +<li>⇢ ⇢ <a href='#uptime-tracking'>Uptime tracking</a></li> +<li><a href='#hardware-check'>Hardware check</a></li> +<li>⇢ <a href='#ethernet'>Ethernet</a></li> +<li>⇢ <a href='#ram'>RAM</a></li> +<li>⇢ <a href='#cpus'>CPUs</a></li> +<li>⇢ <a href='#cpu-throttling'>CPU throttling</a></li> +<li><a href='#conclusion'>Conclusion</a></li> +</ul><br /> +<h1 style='display: inline' id='deciding-on-the-hardware'>Deciding on the hardware</h1><br /> +<br /> +<span>Note that the OpenBSD VMs included in the f3s setup (which will be used later in this blog series for internet ingress - as you know from the first part of this blog series) are already there. These are virtual machines that I rent at OpenBSD Amsterdam and Hetzner.</span><br /> +<br /> +<a class='textlink' href='https://openbsd.amsterdam'>https://openbsd.amsterdam</a><br /> +<a class='textlink' href='https://hetzner.cloud'>https://hetzner.cloud</a><br /> +<br /> +<span>This means that the FreeBSD boxes need to be covered, which will later be running k3s in Linux VMs via bhyve hypervisor.</span><br /> +<br /> +<span>I've been considering whether to use Raspberry Pis or look for alternatives. It turns out that complete N100-based mini-computers aren't much more expensive than Raspberry Pi 5s, and they don't require assembly. Furthermore, I like that they are AMD64 and not ARM-based, which increases compatibility with some applications (e.g., I might want to virtualize Windows (via bhyve) on one of those, though that's out of scope for this blog series).</span><br /> +<br /> +<h2 style='display: inline' id='not-arm-but-intel-n100-'>Not ARM but Intel N100 </h2><br /> +<br /> +<span>I needed something compact, efficient, and capable enough to handle the demands of a small-scale Kubernetes cluster and preferably something I don't have to assemble a lot. After researching, I decided on the Beelink S12 Pro with Intel N100 CPUs.</span><br /> +<br /> +<a class='textlink' href='https://www.bee-link.com/products/beelink-mini-s12-pro-n100'>Beelink Mini S12 Pro N100 official page</a><br /> +<br /> +<span>The Intel N100 CPUs are built on the "Alder Lake-N" architecture. These chips are designed to balance performance and energy efficiency well. With four cores, they're more than capable of running multiple containers, even with moderate workloads. Plus, they consume only around 8W of power (ok, that's more than the Pis...), keeping the electricity bill low enough and the setup quiet - perfect for 24/7 operation.</span><br /> +<br /> +<a href='./f3s-kubernetes-with-freebsd-part-2/f3s-collage1.jpg'><img alt='Beelink preparation' title='Beelink preparation' src='./f3s-kubernetes-with-freebsd-part-2/f3s-collage1.jpg' /></a><br /> +<br /> +<span>The Beelink comes with the following specs:</span><br /> +<br /> +<ul> +<li>12th Gen Intel N100 processor, with four cores and four threads, and a maximum frequency of up to 3.4 GHz.</li> +<li>16 GB of DDR4 RAM, with a maximum (official) size of 16 GB (but people could install 32 GB on it).</li> +<li>500 GB M.2 SSD, with the option to install a 2nd 2.5 SSD drive (which I want to make use of later in this blog series).</li> +<li>GBit ethernet</li> +<li>Four USB 3.2 Gen2 ports (maybe I want to mount something externally at some point)</li> +<li>Dimensions and weight: 115*102*39mm, 280g</li> +<li>Silent cooling system.</li> +<li>HDMI output (needed only for the initial installation and maybe for troubleshooting later)</li> +<li>Auto power on via WoL (may make use of it)</li> +<li>Wi-Fi (not going to use it)</li> +</ul><br /> +<span>I bought three (3) of them for the cluster I intend to build.</span><br /> +<br /> +<h2 style='display: inline' id='beelink-unboxing'>Beelink unboxing</h2><br /> +<br /> +<span>Unboxing was uneventful. Every Beelink PC came with: </span><br /> +<br /> +<ul> +<li>An AC power adapter</li> +<li>An HDMI cable</li> +<li>A VESA mount with screws (not using it as of now)</li> +<li>Some manuals</li> +<li>The pre-assembled Beelink PC itself.</li> +<li>A "Hello" post card (??)</li> +</ul><br /> +<span>Overall, I love the small form factor.</span><br /> +<br /> +<h2 style='display: inline' id='network-switch'>Network switch</h2><br /> +<br /> +<span>I went with the tp-link mini 5-port switch, as I had a spare one available. That switch will be plugged into my wall ethernet port, which connects directly to my fiber internet router with 100 Mbit/s down and 50 Mbit/s upload speed.</span><br /> +<br /> +<a href='./f3s-kubernetes-with-freebsd-part-2/switch.jpg'><img alt='Switch' title='Switch' src='./f3s-kubernetes-with-freebsd-part-2/switch.jpg' /></a><br /> +<br /> +<h1 style='display: inline' id='installing-freebsd'>Installing FreeBSD</h1><br /> +<br /> +<h2 style='display: inline' id='base-install'>Base install</h2><br /> +<br /> +<span>First, I downloaded the boot-only ISO of the latest FreeBSD release and dumped it on a USB stick via my Fedora laptop:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>[paul@earth]~/Downloads% sudo dd \ + <b><u><font color="#000000">if</font></u></b>=FreeBSD-<font color="#000000">14.1</font>-RELEASE-amd<font color="#000000">64</font>-bootonly.iso \ + of=/dev/sda conv=sync +</pre> +<br /> +<span>Next, I plugged the Beelinks (one after another) into my monitor via HDMI (the resolution of the FreeBSD text console seems strangely stretched, as I am using the LG Dual Up monitor), connected Ethernet, an external USB keyboard, and the FreeBSD USB stick, and booted the devices up. With F7, I entered the boot menu and selected the USB stick for the FreeBSD installation.</span><br /> +<br /> +<span>The installation was uneventful. I selected:</span><br /> +<br /> +<ul> +<li>Guided ZFS on root (pool <span class='inlinecode'>zroot</span>)</li> +<li>Unencrypted ZFS (I will encrypt separate datasets later; I want it to be able to boot without manual interaction)</li> +<li>Static IP configuration (to ensure that the boxes always have the same IPs, even after switching the router/DHCP server)</li> +<li>I decided to enable the SSH daemon, NTP server, and NTP time synchronization at boot, and I also enabled <span class='inlinecode'>powerd</span> for automatic CPU frequency scaling.</li> +<li>In addition to <span class='inlinecode'>root,</span> I added a personal user, <span class='inlinecode'>paul,</span> whom I placed in the <span class='inlinecode'>wheel</span> group.</li> +</ul><br /> +<span>After doing all that three times (once for each Beelink PC), I had three ready-to-use FreeBSD boxes! Their hostnames are <span class='inlinecode'>f0</span>, <span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span>!</span><br /> +<br /> +<a href='./f3s-kubernetes-with-freebsd-part-2/f3s-collage2.jpg'><img alt='Beelink installation' title='Beelink installation' src='./f3s-kubernetes-with-freebsd-part-2/f3s-collage2.jpg' /></a><br /> +<br /> +<h2 style='display: inline' id='latest-patch-level-and-customizing-etchosts'>Latest patch level and customizing <span class='inlinecode'>/etc/hosts</span></h2><br /> +<br /> +<span>After the first boot, I upgraded to the latest FreeBSD patch level as follows:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>root@f0:~ <i><font color="silver"># freebsd-update fetch</font></i> +root@f0:~ <i><font color="silver"># freebsd-update install</font></i> +root@f0:~ <i><font color="silver"># freebsd-update reboot</font></i> +</pre> +<br /> +<span>I also added the following entries for the three FreeBSD boxes to the <span class='inlinecode'>/etc/hosts</span> file:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>root@f0:~ <i><font color="silver"># cat <<END >>/etc/hosts</font></i> +<font color="#000000">192.168</font>.<font color="#000000">1.130</font> f0 f0.lan f0.lan.buetow.org +<font color="#000000">192.168</font>.<font color="#000000">1.131</font> f1 f1.lan f1.lan.buetow.org +<font color="#000000">192.168</font>.<font color="#000000">1.132</font> f2 f2.lan f2.lan.buetow.org +END +</pre> +<br /> +<span>You might wonder why bother using the hosts file? Why not use DNS properly? The reason is simplicity. I don't manage 100 hosts, only a few here and there. Having an OpenWRT router in my home, I could also configure everything there, but maybe I'll do that later. For now, keep it simple and straightforward.</span><br /> +<br /> +<h2 style='display: inline' id='after-install'>After install</h2><br /> +<br /> +<span>After that, I installed the following additional packages:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>root@f0:~ <i><font color="silver"># pkg install helix doas zfs-periodic uptimed</font></i> +</pre> +<br /> +<h3 style='display: inline' id='helix-editor'>Helix editor</h3><br /> +<br /> +<span>Helix? It's my favourite text editor. I have nothing against <span class='inlinecode'>vi</span> but like <span class='inlinecode'>hx</span> (Helix) more!</span><br /> +<br /> +<a class='textlink' href='https://helix-editor.com/'>https://helix-editor.com/</a><br /> +<br /> +<h3 style='display: inline' id='doas'><span class='inlinecode'>doas</span></h3><br /> +<br /> +<span><span class='inlinecode'>doas</span>? It's a pretty neat (and KISS) replacement for <span class='inlinecode'>sudo</span>. It has far fewer features than <span class='inlinecode'>sudo</span>, which is supposed to make it more secure. Its origin is the OpenBSD project. For <span class='inlinecode'>doas</span>, I accepted the default configuration (where users in the <span class='inlinecode'>wheel</span> group are allowed to run commands as <span class='inlinecode'>root</span>):</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>root@f0:~ <i><font color="silver"># cp /usr/local/etc/doas.conf.sample /usr/local/etc/doas.conf</font></i> +</pre> +<br /> +<a class='textlink' href='https://man.openbsd.org/doas'>https://man.openbsd.org/doas</a><br /> +<br /> +<h3 style='display: inline' id='periodic-zfs-snapshotting'>Periodic ZFS snapshotting</h3><br /> +<br /> +<span><span class='inlinecode'>zfs-periodic</span> is a nifty tool for automatically creating ZFS snapshots. I decided to go with the following configuration here:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>root@f0:~ <i><font color="silver"># cat <<END >>/etc/periodic.conf</font></i> +daily_zfs_snapshot_enable=<font color="#808080">"YES"</font> +daily_zfs_snapshot_pools=<font color="#808080">"zroot"</font> +daily_zfs_snapshot_keep=<font color="#808080">"7"</font> +weekly_zfs_snapshot_enable=<font color="#808080">"YES"</font> +weekly_zfs_snapshot_pools=<font color="#808080">"zroot"</font> +weekly_zfs_snapshot_keep=<font color="#808080">"5"</font> +monthly_zfs_snapshot_enable=<font color="#808080">"YES"</font> +monthly_zfs_snapshot_pools=<font color="#808080">"zroot"</font> +monthly_zfs_snapshot_keep=<font color="#808080">"6"</font> +END +</pre> +<br /> +<a class='textlink' href='https://github.com/ross/zfs-periodic'>https://github.com/ross/zfs-periodic</a><br /> +<br /> +<h3 style='display: inline' id='uptime-tracking'>Uptime tracking</h3><br /> +<br /> +<span><span class='inlinecode'>uptimed</span>? I like to track my uptimes. This is how I configured the daemon:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>root@f0:~ <i><font color="silver"># cp /usr/local/mimecast/etc/uptimed.conf-dist \</font></i> + /usr/local/mimecast/etc/uptimed.conf +root@f0:~ <i><font color="silver"># hx /usr/local/mimecast/etc/uptimed.conf</font></i> +</pre> +<br /> +<span>In the Helix editor session, I changed <span class='inlinecode'>LOG_MAXIMUM_ENTRIES</span> to <span class='inlinecode'>0</span> to keep all uptime entries forever and not cut off at 50 (the default config). After that, I enabled and started <span class='inlinecode'>uptimed</span>:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>root@f0:~ <i><font color="silver"># service uptimed enable</font></i> +root@f0:~ <i><font color="silver"># service uptimed start</font></i> +</pre> +<br /> +<span>To check the current uptime stats, I can now run <span class='inlinecode'>uprecords</span>:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre> root@f0:~ <i><font color="silver"># uprecords</font></i> + <i><font color="silver"># Uptime | System Boot up</font></i> +----------------------------+--------------------------------------------------- +-> <font color="#000000">1</font> <font color="#000000">0</font> days, <font color="#000000">00</font>:<font color="#000000">07</font>:<font color="#000000">34</font> | FreeBSD <font color="#000000">14.1</font>-RELEASE Mon Dec <font color="#000000">2</font> <font color="#000000">12</font>:<font color="#000000">21</font>:<font color="#000000">44</font> <font color="#000000">2024</font> +----------------------------+--------------------------------------------------- +NewRec <font color="#000000">0</font> days, <font color="#000000">00</font>:<font color="#000000">07</font>:<font color="#000000">33</font> | since Mon Dec <font color="#000000">2</font> <font color="#000000">12</font>:<font color="#000000">21</font>:<font color="#000000">44</font> <font color="#000000">2024</font> + up <font color="#000000">0</font> days, <font color="#000000">00</font>:<font color="#000000">07</font>:<font color="#000000">34</font> | since Mon Dec <font color="#000000">2</font> <font color="#000000">12</font>:<font color="#000000">21</font>:<font color="#000000">44</font> <font color="#000000">2024</font> + down <font color="#000000">0</font> days, <font color="#000000">00</font>:<font color="#000000">00</font>:<font color="#000000">00</font> | since Mon Dec <font color="#000000">2</font> <font color="#000000">12</font>:<font color="#000000">21</font>:<font color="#000000">44</font> <font color="#000000">2024</font> + %up <font color="#000000">100.000</font> | since Mon Dec <font color="#000000">2</font> <font color="#000000">12</font>:<font color="#000000">21</font>:<font color="#000000">44</font> <font color="#000000">2024</font> +</pre> +<br /> +<span>This is how I track the uptimes for all of my host:</span><br /> +<br /> +<a class='textlink' href='./2023-05-01-unveiling-guprecords:-uptime-records-with-raku.html'>Unveiling <span class='inlinecode'>guprecords.raku</span>: Global Uptime Records with Raku-</a><br /> +<a class='textlink' href='https://github.com/rpodgorny/uptimed'>https://github.com/rpodgorny/uptimed</a><br /> +<br /> +<h1 style='display: inline' id='hardware-check'>Hardware check</h1><br /> +<br /> +<h2 style='display: inline' id='ethernet'>Ethernet</h2><br /> +<br /> +<span>Works. Nothing eventful, really. It's a cheap Realtek chip, but it will do what it is supposed to do.</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0:~ % ifconfig re0 +re0: flags=<font color="#000000">1008843</font><UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric <font color="#000000">0</font> mtu <font color="#000000">1500</font> + options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE> + ether e8:ff:1e:d7:1c:ac + inet <font color="#000000">192.168</font>.<font color="#000000">1.130</font> netmask <font color="#000000">0xffffff00</font> broadcast <font color="#000000">192.168</font>.<font color="#000000">1.255</font> + inet6 fe80::eaff:1eff:fed7:1cac%re0 prefixlen <font color="#000000">64</font> scopeid <font color="#000000">0x1</font> + inet6 fd22:c702:acb7:<font color="#000000">0</font>:eaff:1eff:fed7:1cac prefixlen <font color="#000000">64</font> detached autoconf + inet6 2a01:5a8:<font color="#000000">304</font>:1d5c:eaff:1eff:fed7:1cac prefixlen <font color="#000000">64</font> autoconf pltime <font color="#000000">10800</font> vltime <font color="#000000">14400</font> + media: Ethernet autoselect (1000baseT <full-duplex>) + status: active + nd6 options=<font color="#000000">23</font><PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL> +</pre> +<br /> +<h2 style='display: inline' id='ram'>RAM</h2><br /> +<br /> +<span>All there:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0:~ % sysctl hw.physmem +hw.physmem: <font color="#000000">16902905856</font> + +</pre> +<br /> +<h2 style='display: inline' id='cpus'>CPUs</h2><br /> +<br /> +<span>They work:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0:~ % sysctl dev.cpu | grep freq: +dev.cpu.<font color="#000000">3</font>.freq: <font color="#000000">705</font> +dev.cpu.<font color="#000000">2</font>.freq: <font color="#000000">705</font> +dev.cpu.<font color="#000000">1</font>.freq: <font color="#000000">604</font> +dev.cpu.<font color="#000000">0</font>.freq: <font color="#000000">604</font> +</pre> +<br /> +<h2 style='display: inline' id='cpu-throttling'>CPU throttling</h2><br /> +<br /> +<span>With <span class='inlinecode'>powerd</span> running, CPU freq is dowthrottled when the box isn't jam-packed. To stress it a bit, I run <span class='inlinecode'>ubench</span> to see the frequencies being unthrottled again:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre>paul@f0:~ % doas pkg install ubench +paul@f0:~ % rehash <i><font color="silver"># For tcsh to find the newly installed command</font></i> +paul@f0:~ % ubench & +paul@f0:~ % sysctl dev.cpu | grep freq: +dev.cpu.<font color="#000000">3</font>.freq: <font color="#000000">2922</font> +dev.cpu.<font color="#000000">2</font>.freq: <font color="#000000">2922</font> +dev.cpu.<font color="#000000">1</font>.freq: <font color="#000000">2923</font> +dev.cpu.<font color="#000000">0</font>.freq: <font color="#000000">2922</font> +</pre> +<br /> +<span>Idle, all three Beelinks plus the switch consumed 26.2W. But with <span class='inlinecode'>ubench</span> stressing all the CPUs, it went up to 38.8W.</span><br /> +<br /> +<a href='./f3s-kubernetes-with-freebsd-part-2/watt.jpg'><img alt='Idle consumption.' title='Idle consumption.' src='./f3s-kubernetes-with-freebsd-part-2/watt.jpg' /></a><br /> +<br /> +<h1 style='display: inline' id='conclusion'>Conclusion</h1><br /> +<br /> +<span>The Beelink S12 Pro with Intel N100 CPUs checks all the boxes for a k3s project: Compact, efficient, expandable, and affordable. Its compatibility with both Linux and FreeBSD makes it versatile for other use cases, whether as part of your cluster or as a standalone system. If you’re looking for hardware that punches above its weight for Kubernetes, this little device deserves a spot on your shortlist.</span><br /> +<br /> +<a href='./f3s-kubernetes-with-freebsd-part-2/3beelinks.jpg'><img alt='Beelinks stacked' title='Beelinks stacked' src='./f3s-kubernetes-with-freebsd-part-2/3beelinks.jpg' /></a><br /> +<br /> +<span>To ease cable management, I need to get shorter ethernet cables. I will place the tower on my shelf, where most of the cables will be hidden (together with a UPS, which will also be added to the setup).</span><br /> +<br /> +<span>Read the next post of this series:</span><br /> +<br /> +<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br /> +<br /> +<span>Other *BSD-related posts:</span><br /> +<br /> +<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br /> +<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</a><br /> +<a class='textlink' href='./2024-04-01-KISS-high-availability-with-OpenBSD.html'>2024-04-01 KISS high-availability with OpenBSD</a><br /> +<a class='textlink' href='./2024-01-13-one-reason-why-i-love-openbsd.html'>2024-01-13 One reason why I love OpenBSD</a><br /> +<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> +<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>2022-07-30 Let's Encrypt with OpenBSD and Rex</a><br /> +<a class='textlink' href='./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html'>2016-04-09 Jails and ZFS with Puppet on FreeBSD</a><br /> +<br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</title> + <link href="gemini://foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi" /> + <id>gemini://foo.zone/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi</id> + <updated>2024-11-16T23:20:14+02:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>This is the first blog post about my f3s series for my self-hosting demands in my home lab. f3s? The 'f' stands for FreeBSD, and the '3s' stands for k3s, the Kubernetes distribution I will use on FreeBSD-based physical machines.</summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='f3s-kubernetes-with-freebsd---part-1-setting-the-stage'>f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</h1><br /> +<br /> +<span class='quote'>Published at 2024-11-16T23:20:14+02:00</span><br /> +<br /> +<span>This is the first blog post about my f3s series for my self-hosting demands in my home lab. f3s? The "f" stands for FreeBSD, and the "3s" stands for k3s, the Kubernetes distribution I will use on FreeBSD-based physical machines.</span><br /> +<br /> +<span>I will post a new entry every month or so (there are too many other side projects for more frequent updates—I bet you can understand).</span><br /> +<br /> +<span>These are all the posts so far:</span><br /> +<br /> +<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br /> +<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br /> +<a class='textlink' href='./2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage (You are currently reading this)</a><br /> +<br /> +<a href='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png'><img alt='f3s logo' title='f3s logo' src='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png' /></a><br /> +<br /> +<span class='quote'>Logo was generated by ChatGPT.</span><br /> +<br /> +<span>Let's begin...</span><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#f3s-kubernetes-with-freebsd---part-1-setting-the-stage'>f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</a></li> +<li>⇢ <a href='#why-this-setup'>Why this setup?</a></li> +<li>⇢ <a href='#the-infrastructure'>The infrastructure</a></li> +<li>⇢ ⇢ <a href='#physical-freebsd-nodes-and-linux-vms'>Physical FreeBSD nodes and Linux VMs</a></li> +<li>⇢ ⇢ <a href='#kubernetes-with-k3s-'>Kubernetes with k3s </a></li> +<li>⇢ ⇢ <a href='#ha-volumes-for-k3s-with-hastzfs-and-nfs'>HA volumes for k3s with HAST/ZFS and NFS</a></li> +<li>⇢ ⇢ <a href='#openbsdrelayd-to-the-rescue-for-external-connectivity'>OpenBSD/<span class='inlinecode'>relayd</span> to the rescue for external connectivity</a></li> +<li>⇢ <a href='#data-integrity'>Data integrity</a></li> +<li>⇢ ⇢ <a href='#periodic-backups'>Periodic backups</a></li> +<li>⇢ ⇢ <a href='#power-protection'>Power protection</a></li> +<li>⇢ <a href='#monitoring-keeping-an-eye-on-everything'>Monitoring: Keeping an eye on everything</a></li> +<li>⇢ ⇢ <a href='#prometheus-and-grafana'>Prometheus and Grafana</a></li> +<li>⇢ ⇢ <a href='#gogios-my-custom-alerting-system'>Gogios: My custom alerting system</a></li> +<li>⇢ <a href='#what-s-after-this-all'>What's after this all?</a></li> +</ul><br /> +<h2 style='display: inline' id='why-this-setup'>Why this setup?</h2><br /> +<br /> +<span>My previous setup was great for learning Terraform and AWS, but it is too expensive. Costs are under control there, but only because I am shutting down all containers after use (so they are offline ninety percent of the time and still cost around $20 monthly). With the new setup, I could run all containers 24/7 at home, which would still be cheaper in terms of electricity consumption. I have a 50 MBit/s uplink (I could have more if I wanted, but it is plenty for my use case already).</span><br /> +<br /> +<a class='textlink' href='./2024-02-04-from-babylon5.buetow.org-to-.cloud.html'>From <span class='inlinecode'>babylon5.buetow.org</span> to <span class='inlinecode'>.cloud</span></a><br /> +<br /> +<span>Migrating off all my containers from AWS ECS means I need a reliable and scalable environment to host my workloads. I wanted something:</span><br /> +<br /> +<ul> +<li>To self-host all my open-source apps (Docker containers).</li> +<li>Fully under my control (goodbye cloud vendor lock-in).</li> +<li>Secure and redundant.</li> +<li>Cost-efficient (after the initial hardware investment).</li> +<li>Something I can poke around with and also pick up new skills.</li> +</ul><br /> +<h2 style='display: inline' id='the-infrastructure'>The infrastructure</h2><br /> +<br /> +<span>This is still in progress, and I need to own the hardware. But in this first part of the blog series, I will outline what I intend to do.</span><br /> +<br /> +<a href='./f3s-kubernetes-with-freebsd-part-1/diagram.png'><img alt='Diagram' title='Diagram' src='./f3s-kubernetes-with-freebsd-part-1/diagram.png' /></a><br /> +<br /> +<h3 style='display: inline' id='physical-freebsd-nodes-and-linux-vms'>Physical FreeBSD nodes and Linux VMs</h3><br /> +<br /> +<span>The setup starts with three physical FreeBSD nodes deployed into my home LAN. On these, I'm going to run Rocky Linux virtual machines with bhyve. Why Linux VMs in FreeBSD and not Linux directly? I want to leverage the great ZFS integration in FreeBSD (among other features), and I have been using FreeBSD for a while in my home lab. And with bhyve, there is a very performant hypervisor available which makes the Linux VMs de-facto run at native speed (another use case of mine would be maybe running a Windows bhyve VM on one of the nodes - but out of scope for this blog series).</span><br /> +<br /> +<a class='textlink' href='https://www.freebsd.org/'>https://www.freebsd.org/</a><br /> +<a class='textlink' href='https://wiki.freebsd.org/bhyve'>https://wiki.freebsd.org/bhyve</a><br /> +<br /> +<span>I selected Rocky Linux because it comes with long-term support (I don't want to upgrade the VMs every 6 months). Rocky Linux 9 will reach its end of life in 2032, which is plenty of time! Of course, there will be minor upgrades, but nothing will significantly break my setup.</span><br /> +<br /> +<a class='textlink' href='https://rockylinux.org/'>https://rockylinux.org/</a><br /> +<a class='textlink' href='https://wiki.rockylinux.org/rocky/version/'>https://wiki.rockylinux.org/rocky/version/</a><br /> +<br /> +<span>Furthermore, I am already using "RHEL-family" related distros at work and Fedora on my main personal laptop. Rocky Linux belongs to the same type of Linux distribution family, so I already feel at home here. I also used Rocky 9 before I switched to AWS ECS. Now, I am switching back in one sense or another ;-)</span><br /> +<br /> +<h3 style='display: inline' id='kubernetes-with-k3s-'>Kubernetes with k3s </h3><br /> +<br /> +<span>These Linux VMs form a three-node k3s Kubernetes cluster, where my containers will reside moving forward. The 3-node k3s cluster will be highly available (in <span class='inlinecode'>etcd</span> mode), and all apps will probably be deployed with Helm. Prometheus will also be running in k3s, collecting time-series metrics and handling monitoring. Additionally, a private Docker registry will be deployed into the k3s cluster, where I will store some of my self-created Docker images. k3s is the perfect distribution of Kubernetes for homelabbers due to its simplicity and the inclusion of the most useful features out of the box!</span><br /> +<br /> +<a class='textlink' href='https://k3s.io/'>https://k3s.io/</a><br /> +<br /> +<h3 style='display: inline' id='ha-volumes-for-k3s-with-hastzfs-and-nfs'>HA volumes for k3s with HAST/ZFS and NFS</h3><br /> +<br /> +<span>Persistent storage for the k3s cluster will be handled by highly available (HA) NFS shares backed by ZFS on the FreeBSD hosts. </span><br /> +<br /> +<span>On two of the three physical FreeBSD nodes, I will add a second SSD drive to each and dedicate it to a <span class='inlinecode'>zhast</span> ZFS pool. With HAST (FreeBSD's solution for highly available storage), this <span class='inlinecode'>pool</span> will be replicated at the byte level to a standby node.</span><br /> +<br /> +<span>A virtual IP (VIP) will point to the master node. When the master node goes down, the VIP will failover to the standby node, where the ZFS pool will be mounted. An NFS server will listen to both nodes. k3s will use the VIP to access the NFS shares.</span><br /> +<br /> +<a class='textlink' href='https://wiki.freebsd.org/HighlyAvailableStorage'>FreeBSD Wiki: Highly Available Storage</a><br /> +<br /> +<span>You can think of DRBD being the Linux equivalent to FreeBSD's HAST.</span><br /> +<br /> +<h3 style='display: inline' id='openbsdrelayd-to-the-rescue-for-external-connectivity'>OpenBSD/<span class='inlinecode'>relayd</span> to the rescue for external connectivity</h3><br /> +<br /> +<span>All apps should be reachable through the internet (e.g., from my phone or computer when travelling). For external connectivity and TLS management, I've got two OpenBSD VMs (one hosted by OpenBSD Amsterdam and another hosted by Hetzner) handling public-facing services like DNS, relaying traffic, and automating Let's Encrypt certificates. </span><br /> +<br /> +<span>All of this (every Linux VM to every OpenBSD box) will be connected via WireGuard tunnels, keeping everything private and secure. There will be 6 WireGuard tunnels (3 k3s nodes times two OpenBSD VMs).</span><br /> +<br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/WireGuard'>https://en.wikipedia.org/wiki/WireGuard</a><br /> +<br /> +<span>So, when I want to access a service running in k3s, I will hit an external DNS endpoint (with the authoritative DNS servers being the OpenBSD boxes). The DNS will resolve to the master OpenBSD VM (see my KISS highly-available with OpenBSD blog post), and from there, the <span class='inlinecode'>relayd</span> process (with a Let's Encrypt certificate—see my Let's Encrypt with OpenBSD and Rex blog post) will accept the TCP connection and forward it through the WireGuard tunnel to a reachable node port of one of the k3s nodes, thus serving the traffic.</span><br /> +<br /> +<a class='textlink' href='./2024-04-01-KISS-high-availability-with-OpenBSD.html'>KISS high-availability with OpenBSD</a><br /> +<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>Let's Encrypt with OpenBSD and Rex</a><br /> +<br /> +<span>The OpenBSD setup described here already exists and is ready to use. The only thing that does not yet exist is the configuration of <span class='inlinecode'>relayd</span> to forward requests to k3s through the WireGuard tunnel(s).</span><br /> +<br /> +<h2 style='display: inline' id='data-integrity'>Data integrity</h2><br /> +<br /> +<h3 style='display: inline' id='periodic-backups'>Periodic backups</h3><br /> +<br /> +<span>Let's face it, backups are non-negotiable. </span><br /> +<br /> +<span>On the HAST master node, incremental and encrypted ZFS snapshots are created daily and automatically backed up to AWS S3 Glacier Deep Archive via CRON. I have a bunch of scripts already available, which I currently use for a similar purpose on my FreeBSD Home NAS server (an old ThinkPad T440 with an external USB drive enclosure, which I will eventually retire when the HAST setup is ready). I will copy them and slightly modify them to fit the purpose.</span><br /> +<br /> +<span>There's also <span class='inlinecode'>zfstools</span> in the ports, which helps set up an automatic snapshot regime:</span><br /> +<br /> +<a class='textlink' href='https://www.freshports.org/sysutils/zfstools'>https://www.freshports.org/sysutils/zfstools</a><br /> +<br /> +<span>The backup scripts also perform some zpool scrubbing now and then. A scrub once in a while keeps the trouble away.</span><br /> +<br /> +<h3 style='display: inline' id='power-protection'>Power protection</h3><br /> +<br /> +<span>Power outages are regularly in my area, so a UPS keeps the infrastructure running during short outages and protects the hardware. I'm still trying to decide which hardware to get, and I still need one, as my previous NAS is simply an older laptop that already has a battery for power outages. However, there are plenty of options to choose from. My main criterion is that the UPS should be silent, as the whole setup will be installed in an upper shelf unit in my daughter's room. ;-)</span><br /> +<br /> +<h2 style='display: inline' id='monitoring-keeping-an-eye-on-everything'>Monitoring: Keeping an eye on everything</h2><br /> +<br /> +<span>Robust monitoring is vital to any infrastructure, especially one as distributed as mine. I've thought about a setup that ensures I'll always be aware of what's happening in my environment.</span><br /> +<br /> +<h3 style='display: inline' id='prometheus-and-grafana'>Prometheus and Grafana</h3><br /> +<br /> +<span>Inside the k3s cluster, Prometheus will be deployed to handle metrics collection. It will be configured to scrape data from my Kubernetes workloads, nodes, and any services I monitor. Prometheus also integrates with Alertmanager to generate alerts based on predefined thresholds or conditions.</span><br /> +<br /> +<a class='textlink' href='https://prometheus.io'>https://prometheus.io</a><br /> +<br /> +<span>For visualization, Grafana will be deployed alongside Prometheus. Grafana lets me build dynamic, customizable dashboards that provide a real-time view of everything from resource utilization to application performance. Whether it's keeping track of CPU load, memory usage, or the health of Kubernetes pods, Grafana has it covered. This will also make troubleshooting easier, as I can quickly pinpoint where issues are arising.</span><br /> +<br /> +<a class='textlink' href='https://grafana.com'>https://grafana.com</a><br /> +<br /> +<h3 style='display: inline' id='gogios-my-custom-alerting-system'>Gogios: My custom alerting system</h3><br /> +<br /> +<span>Alerts generated by Prometheus are forwarded to Alertmanager, which I will configure to work with Gogios, a lightweight monitoring and alerting system I wrote myself. Gogios runs on one of my OpenBSD VMs. At regular intervals, Gogios scrapes the alerts generated in the k3s cluster and notifies me via Email.</span><br /> +<br /> +<a class='textlink' href='./2023-06-01-kiss-server-monitoring-with-gogios.html'>KISS server monitoring with Gogios</a><br /> +<br /> +<span>Ironically, I implemented Gogios to avoid using more complex alerting systems like Prometheus, but here we go—it integrates well now.</span><br /> +<br /> +<h2 style='display: inline' id='what-s-after-this-all'>What's after this all?</h2><br /> +<br /> +<span>This setup may be just the beginning. Some ideas I'm thinking about for the future:</span><br /> +<br /> +<ul> +<li>Adding more FreeBSD nodes (in different physical locations, maybe at my wider family's places? WireGuard would make it possible!) for better redundancy. (HA storage then might be trickier)</li> +<li>Deploying more Docker apps (data-intensive ones, like a picture gallery, my entire audiobook catalogue, or even a music server) to k3s.</li> +</ul><br /> +<span>For now, though, I'm focused on completing the migration from AWS ECS and getting all my Docker containers running smoothly in k3s.</span><br /> +<br /> +<span>What's your take on self-hosting? Are you planning to move away from managed cloud services? Stay tuned for the second part of this series, where I will likely write about the hardware and the OS setups.</span><br /> +<br /> +<span>Read the next post of this series:</span><br /> +<br /> +<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br /> +<br /> +<span>Other *BSD-related posts:</span><br /> +<br /> +<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br /> +<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br /> +<a class='textlink' href='./2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-04-01-KISS-high-availability-with-OpenBSD.html'>2024-04-01 KISS high-availability with OpenBSD</a><br /> +<a class='textlink' href='./2024-01-13-one-reason-why-i-love-openbsd.html'>2024-01-13 One reason why I love OpenBSD</a><br /> +<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> +<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>2022-07-30 Let's Encrypt with OpenBSD and Rex</a><br /> +<a class='textlink' href='./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html'>2016-04-09 Jails and ZFS with Puppet on FreeBSD</a><br /> +<br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>'Staff Engineer' book notes</title> + <link href="gemini://foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.gmi" /> + <id>gemini://foo.zone/gemfeed/2024-10-24-staff-engineer-book-notes.gmi</id> + <updated>2024-10-24T20:57:44+03:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>These are my personal takeaways after reading 'Staff Engineer' by Will Larson. Note that the book contains much more knowledge wisdom and that these notes only contain points I personally found worth writing down. This is mainly for my own use, but you might find it helpful too.</summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='staff-engineer-book-notes'>"Staff Engineer" book notes</h1><br /> +<br /> +<span class='quote'>Published at 2024-10-24T20:57:44+03:00</span><br /> +<br /> +<span>These are my personal takeaways after reading "Staff Engineer" by Will Larson. Note that the book contains much more knowledge wisdom and that these notes only contain points I personally found worth writing down. This is mainly for my own use, but you might find it helpful too.</span><br /> +<br /> +<pre> + ,.......... .........., + ,..,' '.' ',.., + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,' : ', ', + ,' ,'............., : ,.............', ', +,' '............ '.' ............' ', + '''''''''''''''''';''';'''''''''''''''''' + ''' +</pre> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#staff-engineer-book-notes'>"Staff Engineer" book notes</a></li> +<li>⇢ <a href='#the-four-archetypes-of-a-staff-engineer'>The Four Archetypes of a Staff Engineer</a></li> +<li>⇢ <a href='#influence-and-impact-over-authority'>Influence and Impact over Authority</a></li> +<li>⇢ <a href='#breadth-and-depth-of-knowledge'>Breadth and Depth of Knowledge</a></li> +<li>⇢ <a href='#mentorship-and-sponsorship'>Mentorship and Sponsorship</a></li> +<li>⇢ <a href='#managing-up-and-across'>Managing Up and Across</a></li> +<li>⇢ <a href='#strategic-thinking'>Strategic Thinking</a></li> +<li>⇢ <a href='#emotional-intelligence'>Emotional Intelligence</a></li> +<li>⇢ <a href='#navigating-ambiguity'>Navigating Ambiguity</a></li> +<li>⇢ <a href='#visible-and-invisible-work'>Visible and Invisible Work</a></li> +<li>⇢ <a href='#scaling-yourself'>Scaling Yourself</a></li> +<li>⇢ <a href='#career-progression-and-title-inflation'>Career Progression and Title Inflation</a></li> +<li>⇢ <a href='#not-a-faster-senior-engineer'>Not a faster Senior Engineer</a></li> +<li>⇢ <a href='#the-balance'>The Balance</a></li> +<li>⇢ <a href='#more-things'>More things</a></li> +</ul><br /> +<h2 style='display: inline' id='the-four-archetypes-of-a-staff-engineer'>The Four Archetypes of a Staff Engineer</h2><br /> +<br /> +<span>Larson breaks down the role of a Staff Engineer into four main archetypes, which can help frame how you approach the role:</span><br /> +<br /> +<ul> +<li>Tech Lead: Focuses on the technical direction of a team, ensuring high-quality execution, architecture, and aligning the team around shared goals.</li> +<li>Solver: Gets pulled into complex, high-impact problems that often involve many teams or systems, operating as a fixer or troubleshooter.</li> +<li>Architect: Works on the long-term technical vision for an organization, setting standards and designing systems that will scale and last over time.</li> +<li>Right Hand: Functions as a trusted technical advisor to leadership, providing input on strategy, long-term decisions, and navigating organizational politics.</li> +</ul><br /> +<h2 style='display: inline' id='influence-and-impact-over-authority'>Influence and Impact over Authority</h2><br /> +<br /> +<span>As a Staff Engineer, influence is often more important than formal authority. You’ll rarely have direct control over teams or projects but will need to drive outcomes by influencing peers, other teams, and leadership. It’s about understanding how to persuade, align, and mentor others to achieve technical outcomes.</span><br /> +<br /> +<h2 style='display: inline' id='breadth-and-depth-of-knowledge'>Breadth and Depth of Knowledge</h2><br /> +<br /> +<span>Staff Engineers often need to maintain a breadth of knowledge across various areas while maintaining depth in a few. This can mean keeping a high-level understanding of several domains (e.g., infrastructure, security, product development) but being able to dive deep when needed in certain core areas.</span><br /> +<br /> +<h2 style='display: inline' id='mentorship-and-sponsorship'>Mentorship and Sponsorship</h2><br /> +<br /> +<span>An important part of a Staff Engineer’s role is mentoring others, not just in technical matters but in career development as well. Sponsorship goes a step beyond mentorship, where you actively advocate for others, create opportunities for them, and push them toward growth.</span><br /> +<br /> +<h2 style='display: inline' id='managing-up-and-across'>Managing Up and Across</h2><br /> +<br /> +<span>Success as a Staff Engineer often depends on managing up (influencing leadership and setting expectations) and managing across (working effectively with peers and other teams). This is often tied to communication skills, the ability to advocate for technical needs, and fostering alignment across departments or organizations.</span><br /> +<br /> +<h2 style='display: inline' id='strategic-thinking'>Strategic Thinking</h2><br /> +<br /> +<span>While Senior Engineers may focus on execution, Staff Engineers are expected to think strategically, making decisions that will affect the company or product months or years down the line. This means balancing short-term execution needs with long-term architectural decisions, which may require challenging short-term pressures.</span><br /> +<br /> +<h2 style='display: inline' id='emotional-intelligence'>Emotional Intelligence</h2><br /> +<br /> +<span>The higher you go in engineering roles, the more soft skills, particularly emotional intelligence (EQ), come into play. Building relationships, resolving conflicts, and understanding the broader emotional dynamics of the team and organization become key parts of your role.</span><br /> +<br /> +<h2 style='display: inline' id='navigating-ambiguity'>Navigating Ambiguity</h2><br /> +<br /> +<span>Staff Engineers are often placed in situations with high ambiguity—whether in defining the problem space, coming up with a solution, or aligning stakeholders. The ability to operate effectively in these unclear areas is critical to success.</span><br /> +<br /> +<h2 style='display: inline' id='visible-and-invisible-work'>Visible and Invisible Work</h2><br /> +<br /> +<span>Much of the work done by Staff Engineers is invisible. Solving complex problems, creating alignment, or influencing decisions doesn’t always result in tangible code, but it can have a massive impact. Larson emphasizes that part of the role is being comfortable with this type of invisible contribution.</span><br /> +<br /> +<h2 style='display: inline' id='scaling-yourself'>Scaling Yourself</h2><br /> +<br /> +<span>At the Staff Engineer level, you must scale your impact beyond direct contribution. This can involve improving documentation, developing repeatable processes, mentoring others, or automating parts of the workflow. The idea is to enable teams and individuals to be more effective, even when you’re not directly involved.</span><br /> +<br /> +<h2 style='display: inline' id='career-progression-and-title-inflation'>Career Progression and Title Inflation</h2><br /> +<br /> +<span>Larson touches on how different companies have varying definitions of "Staff Engineer," and titles don’t always correlate directly with responsibility or skill. He emphasizes the importance of focusing more on the work you're doing and the impact you're having, rather than the title itself.</span><br /> +<br /> +<span>These additional points reflect more of the strategic, interpersonal, and leadership aspects that go beyond the technical expertise expected at this level. The role of a Staff Engineer is often about balancing high-level strategy with technical execution, while influencing teams and projects in a sustainable, long-term way.</span><br /> +<br /> +<h2 style='display: inline' id='not-a-faster-senior-engineer'>Not a faster Senior Engineer</h2><br /> +<br /> +<ul> +<li>A Staff engineer is more than just a faster Senior.</li> +<li>A staff engineer is not a senior engineer but a bit better.</li> +</ul><br /> +<span>It's important to know what work or which role most energizes you. A Staff engineer is not a more senior engineer. A Staff engineer also fits into another archetype.</span><br /> +<br /> +<span>As a staff engineer, you are always expected to go beyond your comfort zone and learn new things.</span><br /> +<br /> +<span>Your job sometimes will feel like an SEM and sometimes strangely similar to your senior roles.</span><br /> +<br /> +<span>A Staff engineer is, like a Manager, a leader. However, being a Manager is a specific job. Leaders can apply to any job, especially to Staff engineers.</span><br /> +<br /> +<h2 style='display: inline' id='the-balance'>The Balance</h2><br /> +<br /> +<span>The more senior you become, the more responsibility you will have to cope with them in less time. Balance your speed of progress with your personal life, don't work late hours and don't skip these personal care events.</span><br /> +<br /> +<span>Do fewer things but do them better. Everything done will accelerate the organization. Everything else will drag it down—quality over quantity.</span><br /> +<br /> +<span>Don't work at ten things and progress slowly; focus on one thing and finish it.</span><br /> +<br /> +<span>Only spend some of the time firefighting. Have time for deep thinking. Only deep think some of the time. Otherwise, you lose touch with reality.</span><br /> +<br /> +<span>Sebactical: Take at least six months. Otherwise, it won't be as restored.</span><br /> +<br /> +<h2 style='display: inline' id='more-things'>More things</h2><br /> +<br /> +<ul> +<li>Provide simple but widely used tools. Complex and powerful tools will have power users but only a very few. All others will not use the tool.</li> +<li>In meetings, when someone is inactive, try to pull him in. Pull in max one person at a time. Don't open the discussion to multiple people.</li> +<li>Get used to writing things down and repeating yourself. You will scale yourself much more.</li> +<li>Title inflation: skills correspond to work, but the titles don't.</li> +</ul><br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<span>Other book notes of mine are:</span><br /> +<br /> +<a class='textlink' href='./2024-10-24-staff-engineer-book-notes.html'>2024-10-24 "Staff Engineer" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-07-07-the-stoic-challenge-book-notes.html'>2024-07-07 "The Stoic Challenge" book notes</a><br /> +<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> +<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> +<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> +<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>Gemtexter 3.0.0 - Let's Gemtext again⁴</title> + <link href="gemini://foo.zone/gemfeed/2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.gmi" /> + <id>gemini://foo.zone/gemfeed/2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.gmi</id> + <updated>2024-10-01T21:46:26+03:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>I proudly announce that I've released Gemtexter version `3.0.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown, written in GNU Bash.</summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='gemtexter-300---let-s-gemtext-again'>Gemtexter 3.0.0 - Let's Gemtext again⁴</h1><br /> +<br /> +<span class='quote'>Published at 2024-10-01T21:46:26+03:00</span><br /> +<br /> +<span>I proudly announce that I've released Gemtexter version <span class='inlinecode'>3.0.0</span>. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown, written in GNU Bash.</span><br /> +<br /> +<a class='textlink' href='https://codeberg.org/snonux/gemtexter'>https://codeberg.org/snonux/gemtexter</a><br /> +<br /> +<pre> +-=[ typewriters ]=- 1/98 + .-------. + .-------. _|~~ ~~ |_ + _|~~ ~~ |_ .-------. =(_|_______|_) + =(_|_______|_)= _|~~ ~~ |_ |:::::::::| .-------. + |:::::::::| =(_|_______|_) |:::::::[]| _|~~ ~~ |_ + |:::::::[]| |:::::::::| |o=======.| =(_|_______|_) + |o=======.| |:::::::[]| `"""""""""` |:::::::::| + jgs `"""""""""` |o=======.| |:::::::[]| + mod. by Paul Buetow `"""""""""` |o=======.| + `"""""""""` +</pre> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#gemtexter-300---let-s-gemtext-again'>Gemtexter 3.0.0 - Let's Gemtext again⁴</a></li> +<li>⇢ <a href='#why-bash'>Why Bash?</a></li> +<li>⇢ <a href='#html-exact-variant-is-the-only-variant'>HTML exact variant is the only variant</a></li> +<li>⇢ <a href='#table-of-contents-auto-generation'>Table of Contents auto-generation</a></li> +<li>⇢ <a href='#configurable-themes'>Configurable themes</a></li> +<li>⇢ <a href='#no-use-of-webfonts-by-default'>No use of webfonts by default</a></li> +<li>⇢ <a href='#more'>More</a></li> +</ul><br /> +<h2 style='display: inline' id='why-bash'>Why Bash?</h2><br /> +<br /> +<span>This project is too complex for a Bash script. Writing it in Bash was to try out how maintainable a "larger" Bash script could be. It's still pretty maintainable and helps me try new Bash tricks here and then!</span><br /> +<br /> +<span>Let's list what's new!</span><br /> +<br /> +<h2 style='display: inline' id='html-exact-variant-is-the-only-variant'>HTML exact variant is the only variant</h2><br /> +<br /> +<span>The last version of Gemtexter introduced the HTML exact variant, which wasn't enabled by default. This version of Gemtexter removes the previous (inexact) variant and makes the exact variant the default. This is a breaking change, which is why there is a major version bump of Gemtexter. Here is a reminder of what the exact variant was:</span><br /> +<br /> +<span class='quote'>Gemtexter is there to convert your Gemini Capsule into other formats, such as HTML and Markdown. An HTML exact variant can now be enabled in the <span class='inlinecode'>gemtexter.conf</span> by adding the line <span class='inlinecode'>declare -rx HTML_VARIANT=exact</span>. The HTML/CSS output changed to reflect a more exact Gemtext appearance and to respect the same spacing as you would see in the Geminispace. </span><br /> +<br /> +<h2 style='display: inline' id='table-of-contents-auto-generation'>Table of Contents auto-generation</h2><br /> +<br /> +<span>Just add...</span><br /> +<br /> +<pre> + << template::inline::toc +</pre> +<br /> +<span>...into a Gemtexter template file and Gemtexter will automatically generate a table of contents for the page based on the headings (see this page's ToC for example). The ToC will also have links to the relevant sections in HTML and Markdown output. The Gemtext format does not support links, so the ToC will simply be displayed as a bullet list. </span><br /> +<br /> +<h2 style='display: inline' id='configurable-themes'>Configurable themes</h2><br /> +<br /> +<span>It was always possible to customize the style of a Gemtexter's resulting HTML page, but all the config options were scattered across multiple files. Now, the CSS style, web fonts, etc., are all configurable via themes.</span><br /> +<br /> +<span>Simply configure <span class='inlinecode'>HTML_THEME_DIR</span> in the <span class='inlinecode'>gemtexter.conf</span> file to the corresponding directory. For example:</span><br /> +<br /> +<!-- Generator: GNU source-highlight 3.1.9 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><b><u><font color="#000000">declare</font></u></b> -xr HTML_THEME_DIR=./extras/html/themes/simple +</pre> +<br /> +<span>To customize the theme or create your own, simply copy the theme directory and modify it as needed. This makes it also much easier to switch between layouts.</span><br /> +<br /> +<h2 style='display: inline' id='no-use-of-webfonts-by-default'>No use of webfonts by default</h2><br /> +<br /> +<span>The default theme is now "back to the basics" and does not utilize any web fonts. The previous themes are still part of the release and can be easily configured. These are currently the <span class='inlinecode'>future</span> and <span class='inlinecode'>business</span> themes. You can check them out from the themes directory.</span><br /> +<br /> +<h2 style='display: inline' id='more'>More</h2><br /> +<br /> +<span>Additionally, there were a couple of bug fixes, refactorings and overall improvements in the documentation made. </span><br /> +<br /> +<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<span>Other related posts are:</span><br /> +<br /> +<a class='textlink' href='./2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.html'>2024-10-02 Gemtexter 3.0.0 - Let's Gemtext again⁴ (You are currently reading this)</a><br /> +<a class='textlink' href='./2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.html'>2023-07-21 Gemtexter 2.1.0 - Let's Gemtext again³</a><br /> +<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again²</a><br /> +<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> +<a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace</a><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers</title> + <link href="gemini://foo.zone/gemfeed/2024-09-07-site-reliability-engineering-part-4.gmi" /> + <id>gemini://foo.zone/gemfeed/2024-09-07-site-reliability-engineering-part-4.gmi</id> + <updated>2024-09-07T16:27:58+03:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>Welcome to Part 4 of my Site Reliability Engineering (SRE) series. I'm currently working as a Site Reliability Engineer, and I’m here to share what SRE is all about in this blog series.</summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='site-reliability-engineering---part-4-onboarding-for-on-call-engineers'>Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers</h1><br /> +<br /> +<span class='quote'>Published at 2024-09-07T16:27:58+03:00</span><br /> +<br /> +<span>Welcome to Part 4 of my Site Reliability Engineering (SRE) series. I'm currently working as a Site Reliability Engineer, and I’m here to share what SRE is all about in this blog series.</span><br /> +<br /> +<a class='textlink' href='./2023-08-18-site-reliability-engineering-part-1.html'>2023-08-18 Site Reliability Engineering - Part 1: SRE and Organizational Culture</a><br /> +<a class='textlink' href='./2023-11-19-site-reliability-engineering-part-2.html'>2023-11-19 Site Reliability Engineering - Part 2: Operational Balance</a><br /> +<a class='textlink' href='./2024-01-09-site-reliability-engineering-part-3.html'>2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture</a><br /> +<a class='textlink' href='./2024-09-07-site-reliability-engineering-part-4.html'>2024-09-07 Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers (You are currently reading this)</a><br /> +<br /> +<pre> + __..._ _...__ + _..-" `Y` "-._ + \ Once upon | / + \\ a time..| // + \\\ | /// + \\\ _..---.|.---.._ /// +jgs \\`_..---.Y.---.._`// +</pre> +<br /> +<span>This time, I want to share some tips on how to onboard software engineers, QA engineers, and Site Reliability Engineers (SREs) to the primary on-call rotation. Traditionally, onboarding might take half a year (depending on the complexity of the infrastructure), but with a bit of strategy and structured sessions, we've managed to reduce it to just six weeks per person. Let's dive in!</span><br /> +<br /> +<h2 style='display: inline' id='setting-the-scene-tier-1-on-call-rotation'>Setting the Scene: Tier-1 On-Call Rotation</h2><br /> +<br /> +<span>First things first, let's talk about Tier-1. This is where the magic begins. Tier-1 covers over 80% of the common on-call cases and is the perfect breeding ground for new on-call engineers to get their feet wet. It's designed to be manageable training ground.</span><br /> +<br /> +<h3 style='display: inline' id='why-tier-1'>Why Tier-1?</h3><br /> +<br /> +<ul> +<li>Easy to Understand: Every on-call engineer should be familiar with Tier-1 tasks. </li> +<li>Training Ground: This is where engineers start their on-call career. It's purposefully kept simple so that it's not overwhelming right off the bat.</li> +<li>Runbook/recipe driven: Every alert is attached to a comprehensive runbook, making it easy for every engineer to follow.</li> +</ul><br /> +<h2 style='display: inline' id='onboarding-process-from-6-months-to-6-weeks'>Onboarding Process: From 6 Months to 6 Weeks</h2><br /> +<br /> +<span>So how did we cut down the onboarding time so drastically? Here’s the breakdown of our process:</span><br /> +<br /> +<span>Knowledge Transfer (KT) Sessions: We kicked things off with more than 10 KT sessions, complete with video recordings. These sessions are comprehensive and cover everything from the basics to some more advanced topics. The recorded sessions mean that new engineers can revisit them anytime they need a refresher.</span><br /> +<br /> +<span>Shadowing Sessions: Each new engineer undergoes two on-call week shadowing sessions. This hands-on experience is invaluable. They get to see real-time incident handling and resolution, gaining practical knowledge that's hard to get from just reading docs.</span><br /> +<br /> +<span>Comprehensive Runbooks: We created 64 runbooks (by the time writing this probably more than 100) that are composable like Lego bricks. Each runbook covers a specific scenario and guides the engineer step-by-step to resolution. Pairing these with monitoring alerts linked directly to Confluence docs, and from there to the respective runbooks, ensures every alert can be navigated with ease (well, there are always exceptions to the rule...).</span><br /> +<br /> +<span>Self-Sufficiency & Confidence Building: With all these resources at their fingertips, our on-call engineers become self-sufficient for most of the common issues they'll face (new starters can now handle around 80% of the most common issue after 6 weeks they had joined the company). This boosts their confidence and ensures they can handle Tier-1 incidents independently.</span><br /> +<br /> +<span>Documentation and Feedback Loop: Continuous improvement is key. We regularly update our documentation based on feedback from the engineers. This makes our process even more robust and user-friendly.</span><br /> +<br /> +<h2 style='display: inline' id='it-s-all-about-the-tiers'>It's All About the Tiers</h2><br /> +<br /> +<span>Let’s briefly touch on the Tier levels:</span><br /> +<br /> +<ul> +<li>Tier 1: Easy and foundational tasks. Perfect for getting new engineers started. This covers around 80% of all on-call cases we face. This is what we trained on.</li> +<li>Tier 2: Slightly more complex, requiring more background knowledge. We trained on some of the topics but not all.</li> +<li>Tier 3: Requires a good understanding of the platform/architecture. Likely needs KT sessions with domain experts.</li> +<li>Tier DE (Domain Expert): The heavy hitters. Domain experts are required for these tasks. </li> +</ul><br /> +<h3 style='display: inline' id='growing-into-higher-tiers'>Growing into Higher Tiers</h3><br /> +<br /> +<span>From Tier-1, engineers naturally grow into Tier-2 and beyond. The structured training and gradual increase in complexity help ensure a smooth transition as they gain experience and confidence. The key here is that engineers stay curous and engaged in the on-call, so that they always keep learning.</span><br /> +<br /> +<h2 style='display: inline' id='keeping-runbooks-up-to-date'>Keeping Runbooks Up to Date</h2><br /> +<br /> +<span>It is important that runbooks are not a "project to be finished"; runbooks have to be maintained and updated over time. Sections may change, new runbooks need to be added, and old ones can be deleted. So the acceptance criteria of an on-call shift would not just be reacting to alerts and incidents, but also reviewing and updating the current runbooks.</span><br /> +<br /> +<h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> +<br /> +<span>By structuring the onboarding process with KT sessions, shadowing, comprehensive runbooks, and a feedback loop, we've been able to fast-track the process from six months to just six weeks. This not only prepares our engineers for the on-call rotation quicker but also ensures they're confident and capable when handling incidents.</span><br /> +<br /> +<span>If you're looking to optimize your on-call onboarding process, these strategies could be your ticket to a more efficient and effective transition. Happy on-calling!</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> + <title>Projects I financially support</title> + <link href="gemini://foo.zone/gemfeed/2024-09-07-projects-i-support.gmi" /> + <id>gemini://foo.zone/gemfeed/2024-09-07-projects-i-support.gmi</id> + <updated>2024-09-07T16:04:19+03:00</updated> + <author> + <name>Paul Buetow aka snonux</name> + <email>paul@dev.buetow.org</email> + </author> + <summary>This is the list of projects and initiatives I support/sponsor. </summary> + <content type="xhtml"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h1 style='display: inline' id='projects-i-financially-support'>Projects I financially support</h1><br /> +<br /> +<span class='quote'>Published at 2024-09-07T16:04:19+03:00</span><br /> +<br /> +<span>This is the list of projects and initiatives I support/sponsor. </span><br /> +<br /> +<pre> +||====================================================================|| +||//$\\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\//$\\|| +||(100)==================| FEDERAL SPONSOR NOTE |================(100)|| +||\\$// ~ '------========--------' \\$//|| +||<< / /$\ // ____ \\ \ >>|| +||>>| 12 //L\\ // ///..) \\ L38036133B 12 |<<|| +||<<| \\ // || <|| >\ || |>>|| +||>>| \$/ || $$ --/ || One Hundred |<<|| +||<<| L38036133B *\\ |\_/ //* series |>>|| +||>>| 12 *\\/___\_//* 1989 |<<|| +||<<\ Open Source ______/Franklin\________ Supporting />>|| +||//$\ ~| SPONSORING AND FUNDING |~ /$\\|| +||(100)=================== AWESOME OPEN SOURCE =================(100)|| +||\\$//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\$//|| +||====================================================================|| + +</pre> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#projects-i-financially-support'>Projects I financially support</a></li> +<li>⇢ <a href='#motivation'>Motivation</a></li> +<li>⇢ <a href='#osnews'>OSnews</a></li> +<li>⇢ <a href='#cup-o--go-podcast'>Cup o' Go Podcast</a></li> +<li>⇢ <a href='#codeberg'>Codeberg</a></li> +<li>⇢ <a href='#grapheneos'>GrapheneOS</a></li> +<li>⇢ <a href='#ankidroid'>AnkiDroid</a></li> +<li>⇢ <a href='#openbsd-through-openbsdamsterdam'>OpenBSD through OpenBSD.Amsterdam</a></li> +<li>⇢ <a href='#protonmail'>ProtonMail</a></li> +<li>⇢ <a href='#librofm'><span class='inlinecode'>Libro.fm</span></a></li> +</ul><br /> +<h2 style='display: inline' id='motivation'>Motivation</h2><br /> +<br /> +<span>Sponsoring free and open-source projects, even for personal use, is important to ensure the sustainability, security, and continuous improvement of the software. It supports developers who often maintain these projects without compensation, helping them provide updates, new features, and security patches. By contributing, you recognize their efforts, foster a culture of innovation, and benefit from perks like early access or support, all while ensuring the long-term viability of the tools you rely on.</span><br /> +<br /> +<span>Albeit I am not putting a lot of money into my sponsoring efforts, it still helps the open-source maintainers because the more little sponsors there are, the higher the total sum.</span><br /> +<br /> +<h2 style='display: inline' id='osnews'>OSnews</h2><br /> +<br /> +<span>I am a silver Patreon member of OSnews. I have been following this site since my student years. It's always been a great source of independent and slightly alternative IT news.</span><br /> +<br /> +<a class='textlink' href='https://osnews.com'>https://osnews.com</a><br /> +<br /> +<h2 style='display: inline' id='cup-o--go-podcast'>Cup o' Go Podcast</h2><br /> +<br /> +<span>I am a Patreon of the Cup o' Go Podcast. The podcast helps me stay updated with the Go community for around 15 minutes per week. I am not a full-time software developer, but my long-term ambition is to become better in Go every week by working on personal projects and tools for work.</span><br /> +<br /> +<a class='textlink' href='https://cupogo.dev'>https://cupogo.dev</a><br /> +<br /> +<h2 style='display: inline' id='codeberg'>Codeberg</h2><br /> +<br /> +<span>Codeberg e.V. is a nonprofit organization that provides online resources for software development and collaboration. I am a user and a supporting member, paying an annual membership of €24. I didn't have to pay that membership fee, as Codeberg offers all the services I use for free.</span><br /> +<br /> +<a class='textlink' href='https://codeberg.org'>https://codeberg.org</a><br /> +<a class='textlink' href='https://codeberg.org/snonux'>https://codeberg.org/snonux - My Codeberg page</a><br /> +<br /> +<h2 style='display: inline' id='grapheneos'>GrapheneOS</h2><br /> +<br /> +<span>GrapheneOS is an open-source project that improves Android's privacy and security with sandboxing, exploit mitigations, and a permission model. It does not include Google apps or services but offers a sandboxed Google Play compatibility layer and its own apps and services. </span><br /> +<br /> +<span>I've made a one-off €100 donation because I really like this, and I run GrapheneOS on my personal Phone as my main daily driver.</span><br /> +<br /> +<a class='textlink' href='https://grapheneos.org/'>https://grapheneos.org/</a><br /> +<a class='textlink' href='https://foo.zone/gemfeed/2023-01-23-why-grapheneos-rox.html'>Why GrapheneOS Rox</a><br /> +<br /> +<h2 style='display: inline' id='ankidroid'>AnkiDroid</h2><br /> +<br /> +<span>AnkiDroid is an app that lets you learn flashcards efficiently with spaced repetition. It is compatible with Anki software and supports various flashcard content, syncing, statistics, and more.</span><br /> +<br /> +<span>I've been learning vocabulary with this free app, and it is, in my opinion, the best flashcard app I know. I've made a 20$ one-off donation to this project.</span><br /> +<br /> +<a class='textlink' href='https://opencollective.com/ankidroid'>https://opencollective.com/ankidroid</a><br /> +<br /> +<h2 style='display: inline' id='openbsd-through-openbsdamsterdam'>OpenBSD through OpenBSD.Amsterdam</h2><br /> +<br /> +<span> The OpenBSD project produces a FREE, multi-platform 4.4BSD-based UNIX-like operating system. Our efforts emphasize portability, standardization, correctness, proactive security and integrated cryptography. As an example of the effect OpenBSD has, the popular OpenSSH software comes from OpenBSD. OpenBSD is freely available from their download sites.</span><br /> +<br /> +<span>I implicitly support the OpenBSD project through a VM I have rented at OpenBSD Amsterdam. They donate €10 per VM and €15 per VM for every renewal to the OpenBSD Foundation, with dedicated servers running vmm(4)/vmd(8) to host opinionated VMs.</span><br /> +<br /> +<a class='textlink' href='https://www.OpenBSD.org'>https://www.OpenBSD.org</a><br /> +<a class='textlink' href='https://OpenBSD.Amsterdam'>https://OpenBSD.Amsterdam</a><br /> +<br /> +<h2 style='display: inline' id='protonmail'>ProtonMail</h2><br /> +<br /> +<span>I am not directly funding this project, but I am a very happy paying customer, and I am listing it here as an alternative to big tech if you don't want to run your own mail infrastructure. I am listing ProtonMail here as it is a non-profit organization, and I want to emphasize the importance of considering alternatives to big tech.</span><br /> +<br /> +<a class='textlink' href='https://proton.me/'>https://proton.me/</a><br /> +<br /> +<h2 style='display: inline' id='librofm'><span class='inlinecode'>Libro.fm</span></h2><br /> +<br /> +<span>This is the alternative to Audible if you are into audiobooks (like I am). For every book or every month of membership, I am also supporting a local bookstore I selected. Their catalog is not as large as Audible's, but it's still pretty decent.</span><br /> +<br /> +<span>Libro.fm began as a conversation among friends at Third Place Books, a local bookstore in Seattle, Washington, about the growing popularity of audiobooks and the lack of a way for readers to purchase them from independent bookstores. Flash forward, and Libro.fm was founded in 2014.</span><br /> +<br /> +<a class='textlink' href='https://libro.fm'>https://libro.fm</a><br /> +<br /> +<span>E-mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> + </div> + </content> + </entry> + <entry> <title>Typing `127.1` words per minute (`>100wpm average`)</title> <link href="gemini://foo.zone/gemfeed/2024-08-05-typing-127.1-words-per-minute.gmi" /> <id>gemini://foo.zone/gemfeed/2024-08-05-typing-127.1-words-per-minute.gmi</id> @@ -18,7 +2419,7 @@ <summary>After work one day, I noticed some discomfort in my right wrist. Upon research, it appeared to be a mild case of Repetitive Strain Injury (RSI). Initially, I thought that this would go away after a while, but after a week it became even worse. This led me to consider potential causes such as poor posture or keyboard use habits. As an enthusiast of keyboards, I experimented with ergonomic concave ortholinear split keyboards. Wait, what?...</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Typing1271wordsperminute100wpmaverage'>Typing <span class='inlinecode'>127.1</span> words per minute (<span class='inlinecode'>>100wpm average</span>)</h1><br /> + <h1 style='display: inline' id='typing-1271-words-per-minute-100wpm-average'>Typing <span class='inlinecode'>127.1</span> words per minute (<span class='inlinecode'>>100wpm average</span>)</h1><br /> <br /> <span class='quote'>Published at 2024-08-05T17:39:30+03:00</span><br /> <br /> @@ -37,6 +2438,38 @@ Nieminen Mika </pre> <br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#typing-1271-words-per-minute-100wpm-average'>Typing <span class='inlinecode'>127.1</span> words per minute (<span class='inlinecode'>>100wpm average</span>)</a></li> +<li>⇢ <a href='#introduction'>Introduction</a></li> +<li>⇢ <a href='#kinesis-review'>Kinesis review</a></li> +<li>⇢ ⇢ <a href='#top-build-quality'>Top build quality</a></li> +<li>⇢ ⇢ <a href='#bluetooth-connectivity'>Bluetooth connectivity</a></li> +<li>⇢ ⇢ <a href='#gateron-brown-key-switches'>Gateron Brown key switches</a></li> +<li>⇢ ⇢ <a href='#keycaps'>Keycaps</a></li> +<li>⇢ ⇢ <a href='#keymap-editor'>Keymap editor</a></li> +<li>⇢ <a href='#first-steps'>First steps</a></li> +<li>⇢ <a href='#considering-alternate-layouts'>Considering alternate layouts</a></li> +<li>⇢ <a href='#training-how-to-type'>Training how to type</a></li> +<li>⇢ ⇢ <a href='#tools'>Tools</a></li> +<li>⇢ <a href='#my-keybrcom-statistics'>My <span class='inlinecode'>keybr.com</span> statistics</a></li> +<li>⇢ <a href='#tips-and-tricks'>Tips and tricks</a></li> +<li>⇢ ⇢ <a href='#relax'>Relax</a></li> +<li>⇢ ⇢ <a href='#focus-on-accuracy-first'>Focus on accuracy first</a></li> +<li>⇢ ⇢ <a href='#chording'>Chording</a></li> +<li>⇢ ⇢ <a href='#punctuation-and-capitalization'>Punctuation and Capitalization</a></li> +<li>⇢ ⇢ <a href='#reverse-shifting'>Reverse shifting</a></li> +<li>⇢ ⇢ <a href='#enter-the-flow-state'>Enter the flow state</a></li> +<li>⇢ ⇢ <a href='#repeat-every-word'>Repeat every word</a></li> +<li>⇢ ⇢ <a href='#don-t-use-the-same-finger-for-two-consecutive-keystrokes'>Don't use the same finger for two consecutive keystrokes</a></li> +<li>⇢ ⇢ <a href='#warm-up'>Warm-up</a></li> +<li>⇢ <a href='#travel-keyboard'>Travel keyboard</a></li> +<li>⇢ <a href='#upcoming-custom-kinesis-build'>Upcoming custom Kinesis build</a></li> +<li>⇢ <a href='#conclusion'>Conclusion</a></li> +</ul><br /> +<h2 style='display: inline' id='introduction'>Introduction</h2><br /> +<br /> <span>After work one day, I noticed some discomfort in my right wrist. Upon research, it appeared to be a mild case of Repetitive Strain Injury (RSI). Initially, I thought that this would go away after a while, but after a week it became even worse. This led me to consider potential causes such as poor posture or keyboard use habits. As an enthusiast of keyboards, I experimented with ergonomic concave ortholinear split keyboards. Wait, what?...</span><br /> <br /> <ul> @@ -46,23 +2479,23 @@ </ul><br /> <span>After discovering ThePrimagen (I found him long ago, but I never bothered buying the same keyboard he is on) on YouTube and reading/watching a couple of reviews, I thought that as a computer professional, the equipment could be expensive anyway (laptop, adjustable desk, comfortable chair), so why not invest a bit more into the keyboard? I purchased myself the Kinesis Advantage360 Professional keyboard. </span><br /> <br /> -<h2 style='display: inline' id='Kinesisreview'>Kinesis review</h2><br /> +<h2 style='display: inline' id='kinesis-review'>Kinesis review</h2><br /> <br /> <span>For an in-depth review, have a look at this great article:</span><br /> <br /> <a class='textlink' href='https://arslan.io/2022/10/22/review-of-the-kinesis-advantage360-professional'>Review of the Kinesis Advantage360 Professional keyboard</a><br /> <br /> -<h3 style='display: inline' id='Topbuildquality'>Top build quality</h3><br /> +<h3 style='display: inline' id='top-build-quality'>Top build quality</h3><br /> <br /> <span>Overall, the keyboard feels excellent quality and robust. It has got some weight to it. Because of that, it is not ideally suited for travel, though. But I have a different keyboard to solve this (see later in this post). Overall, I love how it is built and how it feels.</span><br /> <br /> <a href='./typing-127.1-words-per-minute/kinesis2.jpg'><img alt='Kinesis Adv.360 Pro at home' title='Kinesis Adv.360 Pro at home' src='./typing-127.1-words-per-minute/kinesis2.jpg' /></a><br /> <br /> -<h3 style='display: inline' id='Bluetoothconnectivity'>Bluetooth connectivity</h3><br /> +<h3 style='display: inline' id='bluetooth-connectivity'>Bluetooth connectivity</h3><br /> <br /> <span>Despite encountering concerns about Bluetooth connectivity issues with the Kinesis keyboard during my research, I purchased one anyway as I intended to use it only via USB. However, I discovered that the firmware updates available afterwards had addressed these reported Bluetooth issues, and as a result, I did not experience any difficulties with the Bluetooth functionality. This positive outcome allowed me to enjoy using the keyboard also wirelessly.</span><br /> <br /> -<h3 style='display: inline' id='GateronBrowmkeyswitches'>Gateron Browm key switches</h3><br /> +<h3 style='display: inline' id='gateron-brown-key-switches'>Gateron Brown key switches</h3><br /> <br /> <span>Many voices on the internet seem to dislike the Gateron Brown switches, the only official choice for non-clicky tactile switches in the Kinesis, so I was also a bit concerned. I almost went with Cherry MX Browns for my Kinesis (a custom build from a 3rd party provider that is partnershipping with Kinesis). Still, I decided on Gateron Browns to try different switches than the Cherry MX Browns I already have on my ZSA Moonlander keyboard (another ortho-linear split keyboard, but without a concave keycap layout). </span><br /> <br /> @@ -70,7 +2503,7 @@ <br /> <span>So, the Cherry MX feel sharper but are more tiring in the long run, and the Gaterons are easier to write on and the tactile Feedback is slightly less pronounced. </span><br /> <br /> -<h3 style='display: inline' id='Keycaps'>Keycaps</h3><br /> +<h3 style='display: inline' id='keycaps'>Keycaps</h3><br /> <br /> <span>If you ever purchase a Kinesis keyboard, go with the PCB keycaps. They upgrade the typing experience a lot. The only thing you will lose is that the backlighting won't shine through them. But that is a reasonable tradeoff. When do I need backlighting? I am supposed to look at the screen and not the keyboard while typing. </span><br /> <br /> @@ -78,7 +2511,7 @@ <br /> <a href='./typing-127.1-words-per-minute/kinesis1.jpg'><img alt='Kinesis Adv.360 Pro at home' title='Kinesis Adv.360 Pro at home' src='./typing-127.1-words-per-minute/kinesis1.jpg' /></a><br /> <br /> -<h3 style='display: inline' id='Keymapeditor'>Keymap editor</h3><br /> +<h3 style='display: inline' id='keymap-editor'>Keymap editor</h3><br /> <br /> <span>There is no official keymap editor. You have to edit a configuration file manually, build the firmware from scratch, and upload the firmware with the new keymap to both keyboard halves. The Professional version of his keyboard, by the way, runs on the ZMK open-source firmware.</span><br /> <br /> @@ -86,7 +2519,7 @@ <br /> <span>There is a 3rd party solution which is supposed to configure the keymap for the Professional model as bliss, but I have never used it. As a part-time programmer and full-time Site Reliability Engineer, I am okay configuring the keymap in my text editor and building it in a local docker container. This is one of the standard ways of doing it here. You could also use a GitHub pipeline for the firmware build, but I prefer building it locally on my machine. This all seems natural to me, but this may be an issue for "the average Joe" user.</span><br /> <br /> -<h2 style='display: inline' id='Firststeps'>First steps</h2><br /> +<h2 style='display: inline' id='first-steps'>First steps</h2><br /> <br /> <span>I didn't measure the usual words per minute (wpm) on my previous keyboard, the ZSA Moonlander, but I guess that it was around 40-50wpm. Once the Kinesis arrived, I started practising. The experience was quite different due to the concave keycaps, so I barely managed 10wpm on the first day.</span><br /> <br /> @@ -98,7 +2531,7 @@ <br /> <span>I also had a problem with the left pinky finger, where I could not comfortably reach the <span class='inlinecode'>p</span> key. This involved moving the whole hand. An easy fix was to swap <span class='inlinecode'>p</span> with <span class='inlinecode'>;</span> on the keyboard layout.</span><br /> <br /> -<h2 style='display: inline' id='Consideringalternatelayouts'>Considering alternate layouts</h2><br /> +<h2 style='display: inline' id='considering-alternate-layouts'>Considering alternate layouts</h2><br /> <br /> <span>As I was going to learn 10-finger touch typing from scratch, I also played with the thought of switching from the Qwerty to the Dvorak or Colemak keymap, but after reading some comments on the internet, I decided against it: </span><br /> <br /> @@ -108,9 +2541,9 @@ <li>There are also many applications and websites with keyboard shortcuts and are Qwerty-optimized.</li> <li>You won't be able to use someone else's computer as there will be likely Qwerty. Some report that after using an alternative layout for a while, they forget how to use Qwerty.</li> </ul><br /> -<h2 style='display: inline' id='Traininghowtotype'>Training how to type</h2><br /> +<h2 style='display: inline' id='training-how-to-type'>Training how to type</h2><br /> <br /> -<h3 style='display: inline' id='Tools'>Tools</h3><br /> +<h3 style='display: inline' id='tools'>Tools</h3><br /> <br /> <span>One of the most influential tools in my touch typing journey has been <span class='inlinecode'>keybr.com</span>. This site/app helped me learn 10-finger touch typing, and I practice daily for 30 minutes (in the first two weeks, up to an hour every day). The key is persistence and focus on technique rather than speed; the latter naturally improves with regular practice. Precision matters, too, so I always correct my errors using the backspace key.</span><br /> <br /> @@ -122,38 +2555,39 @@ <br /> <span>I wrote myself a small Ruby script that would randomly select a paragraph from one of my eBooks or book notes and pipe it to <span class='inlinecode'>tt</span>. This helped me remember some of the books I read and also practice touch typing.</span><br /> <br /> -<h2 style='display: inline' id='Mykeybrcomstatistics'>My <span class='inlinecode'>keybr.com</span> statistics</h2><br /> +<h2 style='display: inline' id='my-keybrcom-statistics'>My <span class='inlinecode'>keybr.com</span> statistics</h2><br /> <br /> <span>Overall, I trained for around 4 months in more than 5,000 sessions. My top speed in a session was 127.1wpm (up from barely 10wpm at the beginning).</span><br /> <br /> -<a href='./typing-127.1-words-per-minute/all-time-stats.png'><img src='./typing-127.1-words-per-minute/all-time-stats.png' /></a><br /> +<a href='./typing-127.1-words-per-minute/all-time-stats.png'><img alt='All time stats' title='All time stats' src='./typing-127.1-words-per-minute/all-time-stats.png' /></a><br /> <br /> <span>My overall average speed over those 5,000 sessions was 80wpm. The average speed over the last week was over 100wpm. The green line represents the wpm average (increasing trend), the purple line represents the number of keys in the practices (not much movement there, as all keys are unlocked), and the red line represents the average typing accuracy.</span><br /> <br /> -<a href='./typing-127.1-words-per-minute/typing-speed-over-lessons.png'><img src='./typing-127.1-words-per-minute/typing-speed-over-lessons.png' /></a><br /> +<a href='./typing-127.1-words-per-minute/typing-speed-over-lessons.png'><img alt='Typing speed over leson' title='Typing speed over leson' src='./typing-127.1-words-per-minute/typing-speed-over-lessons.png' /></a><br /> <br /> <span>Around the middle, you see a break-in of the wpm average value. This was where I swapped the <span class='inlinecode'>p</span> and <span class='inlinecode'>;</span> keys, but after some retraining, I came back to the previous level and beyond.</span><br /> <br /> -<h2 style='display: inline' id='Tipsandtricks'>Tips and tricks</h2><br /> +<h2 style='display: inline' id='tips-and-tricks'>Tips and tricks</h2><br /> <br /> <span>These are some tips and tricks I learned along the way to improve my typing speed:</span><br /> <br /> -<h3 style='display: inline' id='Relax'>Relax</h3><br /> +<h3 style='display: inline' id='relax'>Relax</h3><br /> <br /> <span>It's easy to get cramped when trying to hit this new wpm mark, but this is just holding you back. Relax and type at a natural pace. Now I also understand why my Katate Sensei back in London kept screaming "RELAAAX" at me during practice.... It didn't help much back then, though, as it is difficult to relax while someone screams at you! </span><br /> -<h3 style='display: inline' id='Focusonaccuracyfirst'>Focus on accuracy first</h3><br /> +<br /> +<h3 style='display: inline' id='focus-on-accuracy-first'>Focus on accuracy first</h3><br /> <br /> <span>This goes with the previous point. Instead of trying to speed through sessions as quickly as possible, slow down and try to type the words correctly—so don't rush it. If you aren't fast yet, the reason is that your brain hasn't trained enough. It will come over time, and you will be faster.</span><br /> <br /> -<h3 style='display: inline' id='Chording'>Chording</h3><br /> +<h3 style='display: inline' id='chording'>Chording</h3><br /> <br /> <span>A trick to getting faster is to type by word and pause between each word so you learn the words by chords. From 80wpm and beyond, this makes a real difference. </span><br /> <br /> -<h3 style='display: inline' id='PunctuationandCapitalization'>Punctuation and Capitalization</h3><br /> +<h3 style='display: inline' id='punctuation-and-capitalization'>Punctuation and Capitalization</h3><br /> <br /> <span>I included 10% punctuation and 20% capital letters in my <span class='inlinecode'>keybr.com</span> practice sessions to simulate real typing conditions, which improved my overall working efficiency. I guess I would have gone to 120wpm in average if I didn't include this options...</span><br /> <br /> -<h3 style='display: inline' id='Reverseshifting'>Reverse shifting</h3><br /> +<h3 style='display: inline' id='reverse-shifting'>Reverse shifting</h3><br /> <br /> <span>Reverse shifting aka left-right shifting is to... </span><br /> <br /> @@ -163,24 +2597,24 @@ </ul><br /> <span>This makes using the shift key a blaze.</span><br /> <br /> -<h3 style='display: inline' id='Entertheflowstate'>Enter the flow state</h3><br /> +<h3 style='display: inline' id='enter-the-flow-state'>Enter the flow state</h3><br /> <br /> <span>Listening to music helps me enter a flow state during practice sessions, which makes typing training a bit addictive (which is good, or isn't it?).</span><br /> <br /> -<h3 style='display: inline' id='Repeateveryword'>Repeat every word</h3><br /> +<h3 style='display: inline' id='repeat-every-word'>Repeat every word</h3><br /> <br /> <span>There's a setting on <span class='inlinecode'>keybr.com</span> that makes it so that every word is always repeated, having you type every word twice in a row. I liked this feature very much, and I think it also helped to improve my practice.</span><br /> <br /> -<h3 style='display: inline' id='Dontusethesamefingerfortwoconsecutivekeystrokes'>Don't use the same finger for two consecutive keystrokes</h3><br /> +<h3 style='display: inline' id='don-t-use-the-same-finger-for-two-consecutive-keystrokes'>Don't use the same finger for two consecutive keystrokes</h3><br /> <br /> <span>Apparently, if you want to type fast, avoid using the same finger for two consecutive keystrokes. This means you don't always need to use the same finger for the same keys. </span><br /> <span>However, there are no hard and fast rules. Thus, everyone develops their system for typing word combinations. An exception would be if you are typing the very same letter in a row (e.g., t in letter)—here, you are using the same finger for both ts.</span><br /> <br /> -<h3 style='display: inline' id='Warmup'>Warm-up</h3><br /> +<h3 style='display: inline' id='warm-up'>Warm-up</h3><br /> <br /> <span>You can't reach your average typing speed first ting the morning. It would help if you warmed up before the exercise or practice later during the day. Also, some days are good, others not so, e.g., after a bad night's sleep. What matters is the mid- and long-term trend, not the fluctuations here, though.</span><br /> <br /> -<h2 style='display: inline' id='Travelkeyboard'>Travel keyboard</h2><br /> +<h2 style='display: inline' id='travel-keyboard'>Travel keyboard</h2><br /> <br /> <span>As mentioned, the Kinesis is a great keyboard, but it is not meant for travel.</span><br /> <br /> @@ -200,11 +2634,11 @@ <br /> <a class='textlink' href='https://arslan.io/2024/04/22/review-of-the-moergo-glove80-keyboard/'>Review of the Glove80 keyboard</a><br /> <br /> -<h2 style='display: inline' id='UpcomingcustomKinesisbuild'>Upcoming custom Kinesis build</h2><br /> +<h2 style='display: inline' id='upcoming-custom-kinesis-build'>Upcoming custom Kinesis build</h2><br /> <br /> <span>As I mentioned, keyboards will remain an expensive hobby of mine. I don't regret anything here, though. After all, I use keyboards at my day job. I've ordered a Kinesis custom build with the Gateron Kangaroo switches, and I'm excited to see how that compares to my current setup. I'm still deciding whether to keep my Gateron Brown-equipped Kinesis as a secondary keyboard or possibly leave it at my in-laws for use when visiting or to sell it.</span><br /> <br /> -<h2 style='display: inline' id='Conclusion'>Conclusion</h2><br /> +<h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> <br /> <span>When I traveled with the Glove80 for work to the London office, a colleague stared at my keyboard and made jokes that it might be broken (split into two halves). But other than that... </span><br /> <br /> @@ -234,7 +2668,7 @@ <summary>These are my personal takeaways after reading 'The Stoic Challenge: A Philosopher's Guide to Becoming Tougher, Calmer, and More Resilient' by William B. Irvine. </summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='TheStoicChallengebooknotes'>"The Stoic Challenge" book notes</h1><br /> + <h1 style='display: inline' id='the-stoic-challenge-book-notes'>"The Stoic Challenge" book notes</h1><br /> <br /> <span class='quote'>Published at 2024-07-07T12:46:55+03:00</span><br /> <br /> @@ -252,6 +2686,16 @@ ''' </pre> <br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#the-stoic-challenge-book-notes'>"The Stoic Challenge" book notes</a></li> +<li>⇢ <a href='#god-sets-you-up-for-a-challenge'>God sets you up for a challenge</a></li> +<li>⇢ <a href='#negative-visualization'>Negative visualization</a></li> +<li>⇢ <a href='#oh-nice-trick-you-stoic-god--'>Oh, nice trick, you stoic "god"! ;-)</a></li> +</ul><br /> +<h2 style='display: inline' id='god-sets-you-up-for-a-challenge'>God sets you up for a challenge</h2><br /> +<br /> <span>Gods set you up for a challenge to see how resilient you are. Is getting angry worth the price? If you stay calm then you can find the optimal workaround for the obstacle. Stay calm even with big setbacks. Practice minimalism of negative emotions.</span><br /> <br /> <span>Put a positive spin on everything. What should you do if someone wrong you? Don't get angry, there is no point in that, it just makes you suffer. Do the best what you got now and keep calm and carry on. A resilient person will refuse to play the role of a victim. You can develop the setback response skills. Turn a setback. e.g. a handycap, into a personal triumph.</span><br /> @@ -262,7 +2706,7 @@ <br /> <span>Stoics are thankful that they are mortal. As then you can get reminded of how great it is to be alive at all. In dying we are more alive we have ever been as every thing you do could be the last time you do it. Rather than fighting your death you should embrace it if there are no workarounds. Embrace a good death.</span><br /> <br /> -<h2 style='display: inline' id='Negativevisualization'>Negative visualization</h2><br /> +<h2 style='display: inline' id='negative-visualization'>Negative visualization</h2><br /> <br /> <span>It is easy what we have to take for granted.</span><br /> <br /> @@ -272,7 +2716,7 @@ <li>Now close your eyes for a minute and imagine you would be blind, so that you will never be able to experience the world again and let it sink in. When you open your eyes again you will feel a lot of gratefulness.</li> <li>Last time meditation. Lets you appreciate the life as it is now. Life gets vitalised again.</li> </ul><br /> -<h2 style='display: inline' id='Ohnicetrickyoustoicgod'>Oh, nice trick, you stoic "god"! ;-)</h2><br /> +<h2 style='display: inline' id='oh-nice-trick-you-stoic-god--'>Oh, nice trick, you stoic "god"! ;-)</h2><br /> <br /> <span>Take setbacks as a challenge. Also take it with some humor.</span><br /> <br /> @@ -286,21 +2730,21 @@ <br /> <span>Other book notes of mine are:</span><br /> <br /> -<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> -<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> -<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> -<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> -<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> -<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2024-10-24-staff-engineer-book-notes.html'>2024-10-24 "Staff Engineer" book notes</a><br /> <a class='textlink' href='./2024-07-07-the-stoic-challenge-book-notes.html'>2024-07-07 "The Stoic Challenge" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> +<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> +<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> +<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> <br /> -<a class='textlink' href='../resources.html'>More books and other resources I found useful.</a><br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> </entry> <entry> - <title>Random Weird Things</title> + <title>Random Weird Things - Part Ⅰ</title> <link href="gemini://foo.zone/gemfeed/2024-07-05-random-weird-things.gmi" /> <id>gemini://foo.zone/gemfeed/2024-07-05-random-weird-things.gmi</id> <updated>2024-07-05T10:59:59+03:00</updated> @@ -311,12 +2755,15 @@ <summary>Every so often, I come across random, weird, and unexpected things on the internet. I thought it would be neat to share them here from time to time. As a start, here are ten of them.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='RandomWeirdThings'>Random Weird Things</h1><br /> + <h1 style='display: inline' id='random-weird-things---part-'>Random Weird Things - Part Ⅰ</h1><br /> <br /> -<span class='quote'>Published at 2024-07-05T10:59:59+03:00</span><br /> +<span class='quote'>Published at 2024-07-05T10:59:59+03:00; Updated at 2025-02-08</span><br /> <br /> <span>Every so often, I come across random, weird, and unexpected things on the internet. I thought it would be neat to share them here from time to time. As a start, here are ten of them.</span><br /> <br /> +<a class='textlink' href='./2024-07-05-random-weird-things.html'>2024-07-05 Random Weird Things - Part Ⅰ (You are currently reading this)</a><br /> +<a class='textlink' href='./2025-02-08-random-weird-things-ii.html'>2025-02-08 Random Weird Things - Part Ⅱ</a><br /> +<br /> <pre> /\_/\ WHOA!! ( o.o ) @@ -326,55 +2773,87 @@ WHOA!! ( o.o ) /______\ \ </pre> <br /> -<h2 style='display: inline' id='1badhorsetraceroute'>1. <span class='inlinecode'>bad.horse</span> traceroute</h2><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#random-weird-things---part-'>Random Weird Things - Part Ⅰ</a></li> +<li>⇢ <a href='#1-badhorse-traceroute'>1. <span class='inlinecode'>bad.horse</span> traceroute</a></li> +<li>⇢ <a href='#2-ascii-cinema'>2. ASCII cinema</a></li> +<li>⇢ <a href='#3-netflix-s-hello-world-application'>3. Netflix's Hello World application</a></li> +<li>⇢ <a href='#c-programming'>C programming</a></li> +<li>⇢ ⇢ <a href='#4-indexing-an-array'>4. Indexing an array</a></li> +<li>⇢ ⇢ <a href='#5-variables-with-prefix-'>5. Variables with prefix <span class='inlinecode'>$</span></a></li> +<li>⇢ <a href='#6-object-oriented-shell-scripts-using-ksh'>6. Object oriented shell scripts using <span class='inlinecode'>ksh</span></a></li> +<li>⇢ <a href='#7-this-works-in-go'>7. This works in Go</a></li> +<li>⇢ <a href='#8-i-am-a-teapot-http-response-code'>8. "I am a Teapot" HTTP response code</a></li> +<li>⇢ <a href='#9-jq-is-a-functional-programming-language'>9. <span class='inlinecode'>jq</span> is a functional programming language</a></li> +<li>⇢ <a href='#10-regular-expression-to-verify-email-addresses'>10. Regular expression to verify email addresses</a></li> +</ul><br /> +<h2 style='display: inline' id='1-badhorse-traceroute'>1. <span class='inlinecode'>bad.horse</span> traceroute</h2><br /> <br /> <span>Run traceroute to get the poem (or song).</span><br /> <br /> +<span class='quote'>Update: A reader hinted that by specifying <span class='inlinecode'>-n 60</span>, there will be even more output!</span><br /> +<br /> <!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> traceroute bad</font><font color="#F3E651">.</font><font color="#ff0000">horse</font> -<font color="#ff0000">traceroute to bad</font><font color="#F3E651">.</font><font color="#ff0000">horse </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.157</font><font color="#F3E651">),</font><font color="#ff0000"> </font><font color="#bb00ff">30</font><font color="#ff0000"> hops max</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">60</font><font color="#ff0000"> byte packets</font> -<font color="#ff0000"> </font><font color="#bb00ff">1</font><font color="#ff0000"> dsldevice</font><font color="#F3E651">.</font><font color="#ff0000">lan </font><font color="#F3E651">(</font><font color="#bb00ff">192.168</font><font color="#F3E651">.</font><font color="#bb00ff">1.1</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">5.712</font><font color="#ff0000"> ms </font><font color="#bb00ff">5.800</font><font color="#ff0000"> ms </font><font color="#bb00ff">6.466</font><font color="#ff0000"> ms</font> -<font color="#ff0000"> </font><font color="#bb00ff">2</font><font color="#ff0000"> </font><font color="#bb00ff">87</font><font color="#ff0000">-</font><font color="#bb00ff">243</font><font color="#ff0000">-</font><font color="#bb00ff">116</font><font color="#ff0000">-</font><font color="#bb00ff">2</font><font color="#F3E651">.</font><font color="#ff0000">ip</font><font color="#F3E651">.</font><font color="#ff0000">btc-net</font><font color="#F3E651">.</font><b><font color="#ffffff">bg</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><font color="#bb00ff">87.243</font><font color="#F3E651">.</font><font color="#bb00ff">116.2</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">8.017</font><font color="#ff0000"> ms </font><font color="#bb00ff">7.506</font><font color="#ff0000"> ms </font><font color="#bb00ff">8.432</font><font color="#ff0000"> ms</font> -<font color="#ff0000"> </font><font color="#bb00ff">3</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font> -<font color="#ff0000"> </font><font color="#bb00ff">4</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font> -<font color="#ff0000"> </font><font color="#bb00ff">5</font><font color="#ff0000"> xe-</font><font color="#bb00ff">1</font><font color="#ff0000">-</font><font color="#bb00ff">2</font><font color="#ff0000">-</font><font color="#bb00ff">0</font><font color="#F3E651">.</font><font color="#ff0000">mpr1</font><font color="#F3E651">.</font><font color="#ff0000">fra4</font><font color="#F3E651">.</font><font color="#ff0000">de</font><font color="#F3E651">.</font><font color="#ff0000">above</font><font color="#F3E651">.</font><font color="#ff0000">net </font><font color="#F3E651">(</font><font color="#bb00ff">80.81</font><font color="#F3E651">.</font><font color="#bb00ff">194.26</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">39.952</font><font color="#ff0000"> ms </font><font color="#bb00ff">40.155</font><font color="#ff0000"> ms </font><font color="#bb00ff">40.139</font><font color="#ff0000"> ms</font> -<font color="#ff0000"> </font><font color="#bb00ff">6</font><font color="#ff0000"> ae12</font><font color="#F3E651">.</font><font color="#ff0000">cs1</font><font color="#F3E651">.</font><font color="#ff0000">fra6</font><font color="#F3E651">.</font><font color="#ff0000">de</font><font color="#F3E651">.</font><font color="#ff0000">eth</font><font color="#F3E651">.</font><font color="#ff0000">zayo</font><font color="#F3E651">.</font><font color="#ff0000">com </font><font color="#F3E651">(</font><font color="#bb00ff">64.125</font><font color="#F3E651">.</font><font color="#bb00ff">26.172</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">128.014</font><font color="#ff0000"> ms </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font> -<font color="#ff0000"> </font><font color="#bb00ff">7</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font> -<font color="#ff0000"> </font><font color="#bb00ff">8</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font> -<font color="#ff0000"> </font><font color="#bb00ff">9</font><font color="#ff0000"> ae10</font><font color="#F3E651">.</font><font color="#ff0000">cs1</font><font color="#F3E651">.</font><font color="#ff0000">lhr15</font><font color="#F3E651">.</font><font color="#ff0000">uk</font><font color="#F3E651">.</font><font color="#ff0000">eth</font><font color="#F3E651">.</font><font color="#ff0000">zayo</font><font color="#F3E651">.</font><font color="#ff0000">com </font><font color="#F3E651">(</font><font color="#bb00ff">64.125</font><font color="#F3E651">.</font><font color="#bb00ff">29.17</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">120.625</font><font color="#ff0000"> ms </font><font color="#bb00ff">121.117</font><font color="#ff0000"> ms </font><font color="#bb00ff">121.050</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">10</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font> -<font color="#bb00ff">11</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font> -<font color="#bb00ff">12</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font> -<font color="#bb00ff">13</font><font color="#ff0000"> ae5</font><font color="#F3E651">.</font><font color="#ff0000">mpr1</font><font color="#F3E651">.</font><font color="#ff0000">tor3</font><font color="#F3E651">.</font><font color="#ff0000">ca</font><font color="#F3E651">.</font><font color="#ff0000">zip</font><font color="#F3E651">.</font><font color="#ff0000">zayo</font><font color="#F3E651">.</font><font color="#ff0000">com </font><font color="#F3E651">(</font><font color="#bb00ff">64.125</font><font color="#F3E651">.</font><font color="#bb00ff">23.118</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">192.605</font><font color="#ff0000"> ms </font><font color="#bb00ff">205.741</font><font color="#ff0000"> ms </font><font color="#bb00ff">203.607</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">14</font><font color="#ff0000"> </font><font color="#bb00ff">64.124</font><font color="#F3E651">.</font><font color="#bb00ff">217.237</font><font color="#F3E651">.</font><font color="#ff0000">IDIA-</font><font color="#bb00ff">265104</font><font color="#ff0000">-ZYO</font><font color="#F3E651">.</font><font color="#ff0000">zip</font><font color="#F3E651">.</font><font color="#ff0000">zayo</font><font color="#F3E651">.</font><font color="#ff0000">com </font><font color="#F3E651">(</font><font color="#bb00ff">64.124</font><font color="#F3E651">.</font><font color="#bb00ff">217.237</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">204.673</font><font color="#ff0000"> ms </font><font color="#bb00ff">134.674</font><font color="#ff0000"> ms </font><font color="#bb00ff">131.442</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">15</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> </font><font color="#F3E651">*</font> -<font color="#bb00ff">16</font><font color="#ff0000"> </font><font color="#bb00ff">67.223</font><font color="#F3E651">.</font><font color="#bb00ff">96.90</font><font color="#ff0000"> </font><font color="#F3E651">(</font><font color="#bb00ff">67.223</font><font color="#F3E651">.</font><font color="#bb00ff">96.90</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">128.245</font><font color="#ff0000"> ms </font><font color="#bb00ff">127.844</font><font color="#ff0000"> ms </font><font color="#bb00ff">127.843</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">17</font><font color="#ff0000"> bad</font><font color="#F3E651">.</font><font color="#ff0000">horse </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.130</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">128.194</font><font color="#ff0000"> ms </font><font color="#bb00ff">122.854</font><font color="#ff0000"> ms </font><font color="#bb00ff">121.786</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">18</font><font color="#ff0000"> bad</font><font color="#F3E651">.</font><font color="#ff0000">horse </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.131</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">128.831</font><font color="#ff0000"> ms </font><font color="#bb00ff">128.341</font><font color="#ff0000"> ms </font><font color="#bb00ff">186.559</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">19</font><font color="#ff0000"> bad</font><font color="#F3E651">.</font><font color="#ff0000">horse </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.132</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">185.716</font><font color="#ff0000"> ms </font><font color="#bb00ff">180.121</font><font color="#ff0000"> ms </font><font color="#bb00ff">180.042</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">20</font><font color="#ff0000"> bad</font><font color="#F3E651">.</font><font color="#ff0000">horse </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.133</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">203.170</font><font color="#ff0000"> ms </font><font color="#bb00ff">203.076</font><font color="#ff0000"> ms </font><font color="#bb00ff">203.168</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">21</font><font color="#ff0000"> he</font><font color="#F3E651">.</font><font color="#ff0000">rides</font><font color="#F3E651">.</font><font color="#ff0000">across</font><font color="#F3E651">.</font><font color="#ff0000">the</font><font color="#F3E651">.</font><font color="#ff0000">nation </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.134</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">203.115</font><font color="#ff0000"> ms </font><font color="#bb00ff">141.830</font><font color="#ff0000"> ms </font><font color="#bb00ff">141.799</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">22</font><font color="#ff0000"> the</font><font color="#F3E651">.</font><font color="#ff0000">thoroughbred</font><font color="#F3E651">.</font><font color="#ff0000">of</font><font color="#F3E651">.</font><font color="#ff0000">sin </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.135</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">147.965</font><font color="#ff0000"> ms </font><font color="#bb00ff">148.230</font><font color="#ff0000"> ms </font><font color="#bb00ff">170.478</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">23</font><font color="#ff0000"> he</font><font color="#F3E651">.</font><font color="#ff0000">got</font><font color="#F3E651">.</font><font color="#ff0000">the</font><font color="#F3E651">.</font><font color="#ff0000">application </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.136</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">165.161</font><font color="#ff0000"> ms </font><font color="#bb00ff">164.939</font><font color="#ff0000"> ms </font><font color="#bb00ff">159.085</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">24</font><font color="#ff0000"> that</font><font color="#F3E651">.</font><font color="#ff0000">you</font><font color="#F3E651">.</font><font color="#ff0000">just</font><font color="#F3E651">.</font><font color="#ff0000">sent</font><font color="#F3E651">.</font><b><font color="#ffffff">in</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.137</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">162.310</font><font color="#ff0000"> ms </font><font color="#bb00ff">158.569</font><font color="#ff0000"> ms </font><font color="#bb00ff">158.896</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">25</font><font color="#ff0000"> it</font><font color="#F3E651">.</font><font color="#ff0000">needs</font><font color="#F3E651">.</font><font color="#ff0000">evaluation </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.138</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">162.927</font><font color="#ff0000"> ms </font><font color="#bb00ff">163.046</font><font color="#ff0000"> ms </font><font color="#bb00ff">163.085</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">26</font><font color="#ff0000"> so</font><font color="#F3E651">.</font><b><font color="#ffffff">let</font></b><font color="#F3E651">.</font><font color="#ff0000">the</font><font color="#F3E651">.</font><font color="#ff0000">games</font><font color="#F3E651">.</font><font color="#ff0000">begin </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.139</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">233.363</font><font color="#ff0000"> ms </font><font color="#bb00ff">233.545</font><font color="#ff0000"> ms </font><font color="#bb00ff">233.317</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">27</font><font color="#ff0000"> a</font><font color="#F3E651">.</font><font color="#ff0000">heinous</font><font color="#F3E651">.</font><font color="#ff0000">crime </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.140</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">237.745</font><font color="#ff0000"> ms </font><font color="#bb00ff">233.614</font><font color="#ff0000"> ms </font><font color="#bb00ff">233.740</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">28</font><font color="#ff0000"> a</font><font color="#F3E651">.</font><font color="#ff0000">show</font><font color="#F3E651">.</font><font color="#ff0000">of</font><font color="#F3E651">.</font><font color="#ff0000">force </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.141</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">237.974</font><font color="#ff0000"> ms </font><font color="#bb00ff">176.085</font><font color="#ff0000"> ms </font><font color="#bb00ff">175.927</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">29</font><font color="#ff0000"> a</font><font color="#F3E651">.</font><font color="#ff0000">murder</font><font color="#F3E651">.</font><font color="#ff0000">would</font><font color="#F3E651">.</font><font color="#ff0000">be</font><font color="#F3E651">.</font><font color="#ff0000">nice</font><font color="#F3E651">.</font><font color="#ff0000">of</font><font color="#F3E651">.</font><font color="#ff0000">course </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.142</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">181.838</font><font color="#ff0000"> ms </font><font color="#bb00ff">181.858</font><font color="#ff0000"> ms </font><font color="#bb00ff">182.059</font><font color="#ff0000"> ms</font> -<font color="#bb00ff">30</font><font color="#ff0000"> bad</font><font color="#F3E651">.</font><font color="#ff0000">horse </font><font color="#F3E651">(</font><font color="#bb00ff">162.252</font><font color="#F3E651">.</font><font color="#bb00ff">205.143</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#bb00ff">187.731</font><font color="#ff0000"> ms </font><font color="#bb00ff">187.416</font><font color="#ff0000"> ms </font><font color="#bb00ff">187.532</font><font color="#ff0000"> ms</font> -</pre> -<br /> -<h2 style='display: inline' id='2ASCIIcinema'>2. ASCII cinema</h2><br /> +<pre>❯ traceroute -m <font color="#000000">60</font> bad.horse +traceroute to bad.horse (<font color="#000000">162.252</font>.<font color="#000000">205.157</font>), <font color="#000000">60</font> hops max, <font color="#000000">60</font> byte packets + <font color="#000000">1</font> _gateway (<font color="#000000">192.168</font>.<font color="#000000">1.1</font>) <font color="#000000">5.237</font> ms <font color="#000000">5.264</font> ms <font color="#000000">6.009</font> ms + <font color="#000000">2</font> <font color="#000000">77</font>-<font color="#000000">85</font>-<font color="#000000">0</font>-<font color="#000000">2</font>.ip.btc-net.<b><u><font color="#000000">bg</font></u></b> (<font color="#000000">77.85</font>.<font color="#000000">0.2</font>) <font color="#000000">8.753</font> ms <font color="#000000">7.112</font> ms <font color="#000000">8.336</font> ms + <font color="#000000">3</font> <font color="#000000">212</font>-<font color="#000000">39</font>-<font color="#000000">69</font>-<font color="#000000">103</font>.ip.btc-net.<b><u><font color="#000000">bg</font></u></b> (<font color="#000000">212.39</font>.<font color="#000000">69.103</font>) <font color="#000000">9.434</font> ms <font color="#000000">9.268</font> ms <font color="#000000">9.986</font> ms + <font color="#000000">4</font> * * * + <font color="#000000">5</font> xe-<font color="#000000">1</font>-<font color="#000000">2</font>-<font color="#000000">0</font>.mpr1.fra4.de.above.net (<font color="#000000">80.81</font>.<font color="#000000">194.26</font>) <font color="#000000">39.812</font> ms <font color="#000000">39.030</font> ms <font color="#000000">39.772</font> ms + <font color="#000000">6</font> * ae12.cs1.fra6.de.eth.zayo.com (<font color="#000000">64.125</font>.<font color="#000000">26.172</font>) <font color="#000000">123.576</font> ms * + <font color="#000000">7</font> * * * + <font color="#000000">8</font> * * * + <font color="#000000">9</font> ae10.cr1.lhr15.uk.eth.zayo.com (<font color="#000000">64.125</font>.<font color="#000000">29.17</font>) <font color="#000000">119.097</font> ms <font color="#000000">119.478</font> ms <font color="#000000">120.767</font> ms +<font color="#000000">10</font> ae2.cr1.lhr11.uk.zip.zayo.com (<font color="#000000">64.125</font>.<font color="#000000">24.140</font>) <font color="#000000">120.398</font> ms <font color="#000000">121.147</font> ms <font color="#000000">120.948</font> ms +<font color="#000000">11</font> * * * +<font color="#000000">12</font> ae25.mpr1.yyz1.ca.zip.zayo.com (<font color="#000000">64.125</font>.<font color="#000000">23.117</font>) <font color="#000000">145.072</font> ms * <font color="#000000">181.773</font> ms +<font color="#000000">13</font> ae5.mpr1.tor3.ca.zip.zayo.com (<font color="#000000">64.125</font>.<font color="#000000">23.118</font>) <font color="#000000">168.239</font> ms <font color="#000000">168.158</font> ms <font color="#000000">168.137</font> ms +<font color="#000000">14</font> <font color="#000000">64.124</font>.<font color="#000000">217.237</font>.IDIA-<font color="#000000">265104</font>-ZYO.zip.zayo.com (<font color="#000000">64.124</font>.<font color="#000000">217.237</font>) <font color="#000000">168.026</font> ms <font color="#000000">167.999</font> ms <font color="#000000">165.451</font> ms +<font color="#000000">15</font> * * * +<font color="#000000">16</font> t00.toroc1.on.ca.sn11.net (<font color="#000000">162.252</font>.<font color="#000000">204.2</font>) <font color="#000000">131.598</font> ms <font color="#000000">131.308</font> ms <font color="#000000">131.482</font> ms +<font color="#000000">17</font> bad.horse (<font color="#000000">162.252</font>.<font color="#000000">205.130</font>) <font color="#000000">131.430</font> ms <font color="#000000">145.914</font> ms <font color="#000000">130.514</font> ms +<font color="#000000">18</font> bad.horse (<font color="#000000">162.252</font>.<font color="#000000">205.131</font>) <font color="#000000">136.634</font> ms <font color="#000000">145.295</font> ms <font color="#000000">135.631</font> ms +<font color="#000000">19</font> bad.horse (<font color="#000000">162.252</font>.<font color="#000000">205.132</font>) <font color="#000000">139.158</font> ms <font color="#000000">148.363</font> ms <font color="#000000">138.934</font> ms +<font color="#000000">20</font> bad.horse (<font color="#000000">162.252</font>.<font color="#000000">205.133</font>) <font color="#000000">145.395</font> ms <font color="#000000">148.054</font> ms <font color="#000000">147.140</font> ms +<font color="#000000">21</font> he.rides.across.the.nation (<font color="#000000">162.252</font>.<font color="#000000">205.134</font>) <font color="#000000">149.687</font> ms <font color="#000000">147.731</font> ms <font color="#000000">150.135</font> ms +<font color="#000000">22</font> the.thoroughbred.of.sin (<font color="#000000">162.252</font>.<font color="#000000">205.135</font>) <font color="#000000">156.644</font> ms <font color="#000000">155.155</font> ms <font color="#000000">156.447</font> ms +<font color="#000000">23</font> he.got.the.application (<font color="#000000">162.252</font>.<font color="#000000">205.136</font>) <font color="#000000">161.187</font> ms <font color="#000000">162.318</font> ms <font color="#000000">162.674</font> ms +<font color="#000000">24</font> that.you.just.sent.<b><u><font color="#000000">in</font></u></b> (<font color="#000000">162.252</font>.<font color="#000000">205.137</font>) <font color="#000000">166.763</font> ms <font color="#000000">166.675</font> ms <font color="#000000">164.243</font> ms +<font color="#000000">25</font> it.needs.evaluation (<font color="#000000">162.252</font>.<font color="#000000">205.138</font>) <font color="#000000">172.073</font> ms <font color="#000000">171.919</font> ms <font color="#000000">171.390</font> ms +<font color="#000000">26</font> so.<b><u><font color="#000000">let</font></u></b>.the.games.begin (<font color="#000000">162.252</font>.<font color="#000000">205.139</font>) <font color="#000000">175.386</font> ms <font color="#000000">174.180</font> ms <font color="#000000">175.965</font> ms +<font color="#000000">27</font> a.heinous.crime (<font color="#000000">162.252</font>.<font color="#000000">205.140</font>) <font color="#000000">180.857</font> ms <font color="#000000">180.766</font> ms <font color="#000000">180.192</font> ms +<font color="#000000">28</font> a.show.of.force (<font color="#000000">162.252</font>.<font color="#000000">205.141</font>) <font color="#000000">187.942</font> ms <font color="#000000">186.669</font> ms <font color="#000000">186.986</font> ms +<font color="#000000">29</font> a.murder.would.be.nice.of.course (<font color="#000000">162.252</font>.<font color="#000000">205.142</font>) <font color="#000000">191.349</font> ms <font color="#000000">191.939</font> ms <font color="#000000">190.740</font> ms +<font color="#000000">30</font> bad.horse (<font color="#000000">162.252</font>.<font color="#000000">205.143</font>) <font color="#000000">195.425</font> ms <font color="#000000">195.716</font> ms <font color="#000000">196.186</font> ms +<font color="#000000">31</font> bad.horse (<font color="#000000">162.252</font>.<font color="#000000">205.144</font>) <font color="#000000">199.238</font> ms <font color="#000000">200.620</font> ms <font color="#000000">200.318</font> ms +<font color="#000000">32</font> bad.horse (<font color="#000000">162.252</font>.<font color="#000000">205.145</font>) <font color="#000000">207.554</font> ms <font color="#000000">206.729</font> ms <font color="#000000">205.201</font> ms +<font color="#000000">33</font> he-s.bad (<font color="#000000">162.252</font>.<font color="#000000">205.146</font>) <font color="#000000">211.087</font> ms <font color="#000000">211.649</font> ms <font color="#000000">211.712</font> ms +<font color="#000000">34</font> the.evil.league.of.evil (<font color="#000000">162.252</font>.<font color="#000000">205.147</font>) <font color="#000000">212.657</font> ms <font color="#000000">216.777</font> ms <font color="#000000">216.589</font> ms +<font color="#000000">35</font> is.watching.so.beware (<font color="#000000">162.252</font>.<font color="#000000">205.148</font>) <font color="#000000">220.911</font> ms <font color="#000000">220.326</font> ms <font color="#000000">221.961</font> ms +<font color="#000000">36</font> the.grade.that.you.receive (<font color="#000000">162.252</font>.<font color="#000000">205.149</font>) <font color="#000000">225.384</font> ms <font color="#000000">225.696</font> ms <font color="#000000">225.640</font> ms +<font color="#000000">37</font> will.be.your.last.we.swear (<font color="#000000">162.252</font>.<font color="#000000">205.150</font>) <font color="#000000">232.312</font> ms <font color="#000000">230.989</font> ms <font color="#000000">230.919</font> ms +<font color="#000000">38</font> so.make.the.bad.horse.gleeful (<font color="#000000">162.252</font>.<font color="#000000">205.151</font>) <font color="#000000">235.761</font> ms <font color="#000000">235.291</font> ms <font color="#000000">235.585</font> ms +<font color="#000000">39</font> or.he-ll.make.you.his.mare (<font color="#000000">162.252</font>.<font color="#000000">205.152</font>) <font color="#000000">241.350</font> ms <font color="#000000">239.407</font> ms <font color="#000000">238.394</font> ms +<font color="#000000">40</font> o_o (<font color="#000000">162.252</font>.<font color="#000000">205.153</font>) <font color="#000000">246.154</font> ms <font color="#000000">247.650</font> ms <font color="#000000">247.110</font> ms +<font color="#000000">41</font> you-re.saddled.up (<font color="#000000">162.252</font>.<font color="#000000">205.154</font>) <font color="#000000">250.925</font> ms <font color="#000000">250.401</font> ms <font color="#000000">250.619</font> ms +<font color="#000000">42</font> there-s.no.recourse (<font color="#000000">162.252</font>.<font color="#000000">205.155</font>) <font color="#000000">256.071</font> ms <font color="#000000">251.154</font> ms <font color="#000000">255.340</font> ms +<font color="#000000">43</font> it-s.hi-ho.silver (<font color="#000000">162.252</font>.<font color="#000000">205.156</font>) <font color="#000000">260.152</font> ms <font color="#000000">261.775</font> ms <font color="#000000">261.544</font> ms +<font color="#000000">44</font> signed.bad.horse (<font color="#000000">162.252</font>.<font color="#000000">205.157</font>) <font color="#000000">262.430</font> ms <font color="#000000">261.410</font> ms <font color="#000000">261.365</font> ms +</pre> +<br /> +<h2 style='display: inline' id='2-ascii-cinema'>2. ASCII cinema</h2><br /> <br /> <span>Fancy watching Star Wars Episode IV in ASCII? Head to the ASCII cinema:</span><br /> <br /> <a class='textlink' href='https://asciinema.org/a/569727'>https://asciinema.org/a/569727</a><br /> <br /> -<h2 style='display: inline' id='3NetflixsHelloWorldapplication'>3. Netflix's Hello World application</h2><br /> +<h2 style='display: inline' id='3-netflix-s-hello-world-application'>3. Netflix's Hello World application</h2><br /> <br /> <span>Netflix has got the Hello World application run in production 😱</span><br /> <br /> @@ -383,9 +2862,9 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span class='quote'>By the time this is posted, it seems that Netflix has taken it offline... I should have created a screenshot!</span><br /> <br /> -<h2 style='display: inline' id='Cprogramming'>C programming</h2><br /> +<h2 style='display: inline' id='c-programming'>C programming</h2><br /> <br /> -<h3 style='display: inline' id='4Indexinganarray'>4. Indexing an array</h3><br /> +<h3 style='display: inline' id='4-indexing-an-array'>4. Indexing an array</h3><br /> <br /> <span>In C, you can index an array like this: <span class='inlinecode'>array[i]</span> (not surprising). But this works as well and is valid C code: <span class='inlinecode'>i[array]</span>, 🤯 It's because after the spec <span class='inlinecode'>A[B]</span> is equivalent to <span class='inlinecode'>*(A + B)</span> and the ordering doesn't matter for the <span class='inlinecode'>+</span> operator. All 3 loops are producing the same output. Would be funny to use <span class='inlinecode'>i[array]</span> in a merge request of some code base on April Fool's day!</span><br /> <br /> @@ -393,23 +2872,23 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ababab">#include</font><font color="#ff0000"> </font><font color="#bb00ff"><stdio.h></font> +<pre><b><u><font color="#000000">#include</font></u></b> <font color="#808080"><stdio.h></font> -<b><font color="#F35E1E">int</font></b><font color="#ff0000"> </font><font color="#7bc710">main</font><font color="#F3E651">(</font><b><font color="#F35E1E">void</font></b><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#F35E1E">int</font></b><font color="#ff0000"> array</font><font color="#F3E651">[</font><font color="#bb00ff">5</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#F3E651">{</font><font color="#ff0000"> </font><font color="#bb00ff">1</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">2</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">3</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">4</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">5</font><font color="#ff0000"> </font><font color="#F3E651">}</font><font color="#F3E651">;</font> +<b><font color="#000000">int</font></b> main(<b><font color="#000000">void</font></b>) { + <b><font color="#000000">int</font></b> array[<font color="#000000">5</font>] = { <font color="#000000">1</font>, <font color="#000000">2</font>, <font color="#000000">3</font>, <font color="#000000">4</font>, <font color="#000000">5</font> }; -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><b><font color="#F35E1E">int</font></b><font color="#ff0000"> i </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> i </font><font color="#F3E651"><</font><font color="#ff0000"> </font><font color="#bb00ff">5</font><font color="#F3E651">;</font><font color="#ff0000"> i</font><font color="#F3E651">++)</font> -<font color="#ff0000"> </font><font color="#7bc710">printf</font><font color="#F3E651">(</font><font color="#bb00ff">"%d</font><font color="#ffffff">\n</font><font color="#bb00ff">"</font><font color="#F3E651">,</font><font color="#ff0000"> array</font><font color="#F3E651">[</font><font color="#ff0000">i</font><font color="#F3E651">]);</font> + <b><u><font color="#000000">for</font></u></b> (<b><font color="#000000">int</font></b> i = <font color="#000000">0</font>; i < <font color="#000000">5</font>; i++) + printf(<font color="#808080">"%d</font>\n<font color="#808080">"</font>, array[i]); -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><b><font color="#F35E1E">int</font></b><font color="#ff0000"> i </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> i </font><font color="#F3E651"><</font><font color="#ff0000"> </font><font color="#bb00ff">5</font><font color="#F3E651">;</font><font color="#ff0000"> i</font><font color="#F3E651">++)</font> -<font color="#ff0000"> </font><font color="#7bc710">printf</font><font color="#F3E651">(</font><font color="#bb00ff">"%d</font><font color="#ffffff">\n</font><font color="#bb00ff">"</font><font color="#F3E651">,</font><font color="#ff0000"> i</font><font color="#F3E651">[</font><font color="#ff0000">array</font><font color="#F3E651">]);</font> + <b><u><font color="#000000">for</font></u></b> (<b><font color="#000000">int</font></b> i = <font color="#000000">0</font>; i < <font color="#000000">5</font>; i++) + printf(<font color="#808080">"%d</font>\n<font color="#808080">"</font>, i[array]); -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><b><font color="#F35E1E">int</font></b><font color="#ff0000"> i </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> i </font><font color="#F3E651"><</font><font color="#ff0000"> </font><font color="#bb00ff">5</font><font color="#F3E651">;</font><font color="#ff0000"> i</font><font color="#F3E651">++)</font> -<font color="#ff0000"> </font><font color="#7bc710">printf</font><font color="#F3E651">(</font><font color="#bb00ff">"%d</font><font color="#ffffff">\n</font><font color="#bb00ff">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#F3E651">*(</font><font color="#ff0000">i </font><font color="#F3E651">+</font><font color="#ff0000"> array</font><font color="#F3E651">));</font> -<font color="#F3E651">}</font> + <b><u><font color="#000000">for</font></u></b> (<b><font color="#000000">int</font></b> i = <font color="#000000">0</font>; i < <font color="#000000">5</font>; i++) + printf(<font color="#808080">"%d</font>\n<font color="#808080">"</font>, *(i + array)); +} </pre> <br /> -<h3 style='display: inline' id='5Variableswithprefix'>5. Variables with prefix <span class='inlinecode'>$</span></h3><br /> +<h3 style='display: inline' id='5-variables-with-prefix-'>5. Variables with prefix <span class='inlinecode'>$</span></h3><br /> <br /> <span>In C you can prefix variables with <span class='inlinecode'>$</span>! E.g. the following is valid C code 🫠:</span><br /> <br /> @@ -417,23 +2896,23 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ababab">#include</font><font color="#ff0000"> </font><font color="#bb00ff"><stdio.h></font> +<pre><b><u><font color="#000000">#include</font></u></b> <font color="#808080"><stdio.h></font> -<b><font color="#F35E1E">int</font></b><font color="#ff0000"> </font><font color="#7bc710">main</font><font color="#F3E651">(</font><b><font color="#F35E1E">void</font></b><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#F35E1E">int</font></b><font color="#ff0000"> $array</font><font color="#F3E651">[</font><font color="#bb00ff">5</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#F3E651">{</font><font color="#ff0000"> </font><font color="#bb00ff">1</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">2</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">3</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">4</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">5</font><font color="#ff0000"> </font><font color="#F3E651">}</font><font color="#F3E651">;</font> +<b><font color="#000000">int</font></b> main(<b><font color="#000000">void</font></b>) { + <b><font color="#000000">int</font></b> $array[<font color="#000000">5</font>] = { <font color="#000000">1</font>, <font color="#000000">2</font>, <font color="#000000">3</font>, <font color="#000000">4</font>, <font color="#000000">5</font> }; -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><b><font color="#F35E1E">int</font></b><font color="#ff0000"> $i </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> $i </font><font color="#F3E651"><</font><font color="#ff0000"> </font><font color="#bb00ff">5</font><font color="#F3E651">;</font><font color="#ff0000"> $i</font><font color="#F3E651">++)</font> -<font color="#ff0000"> </font><font color="#7bc710">printf</font><font color="#F3E651">(</font><font color="#bb00ff">"%d</font><font color="#ffffff">\n</font><font color="#bb00ff">"</font><font color="#F3E651">,</font><font color="#ff0000"> $array</font><font color="#F3E651">[</font><font color="#ff0000">$i</font><font color="#F3E651">]);</font> + <b><u><font color="#000000">for</font></u></b> (<b><font color="#000000">int</font></b> $i = <font color="#000000">0</font>; $i < <font color="#000000">5</font>; $i++) + printf(<font color="#808080">"%d</font>\n<font color="#808080">"</font>, $array[$i]); -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><b><font color="#F35E1E">int</font></b><font color="#ff0000"> $i </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> $i </font><font color="#F3E651"><</font><font color="#ff0000"> </font><font color="#bb00ff">5</font><font color="#F3E651">;</font><font color="#ff0000"> $i</font><font color="#F3E651">++)</font> -<font color="#ff0000"> </font><font color="#7bc710">printf</font><font color="#F3E651">(</font><font color="#bb00ff">"%d</font><font color="#ffffff">\n</font><font color="#bb00ff">"</font><font color="#F3E651">,</font><font color="#ff0000"> $i</font><font color="#F3E651">[</font><font color="#ff0000">$array</font><font color="#F3E651">]);</font> + <b><u><font color="#000000">for</font></u></b> (<b><font color="#000000">int</font></b> $i = <font color="#000000">0</font>; $i < <font color="#000000">5</font>; $i++) + printf(<font color="#808080">"%d</font>\n<font color="#808080">"</font>, $i[$array]); -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><b><font color="#F35E1E">int</font></b><font color="#ff0000"> $i </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> $i </font><font color="#F3E651"><</font><font color="#ff0000"> </font><font color="#bb00ff">5</font><font color="#F3E651">;</font><font color="#ff0000"> $i</font><font color="#F3E651">++)</font> -<font color="#ff0000"> </font><font color="#7bc710">printf</font><font color="#F3E651">(</font><font color="#bb00ff">"%d</font><font color="#ffffff">\n</font><font color="#bb00ff">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#F3E651">*(</font><font color="#ff0000">$i </font><font color="#F3E651">+</font><font color="#ff0000"> $array</font><font color="#F3E651">));</font> -<font color="#F3E651">}</font> + <b><u><font color="#000000">for</font></u></b> (<b><font color="#000000">int</font></b> $i = <font color="#000000">0</font>; $i < <font color="#000000">5</font>; $i++) + printf(<font color="#808080">"%d</font>\n<font color="#808080">"</font>, *($i + $array)); +} </pre> <br /> -<h2 style='display: inline' id='6Objectorientedshellscriptsusingksh'>6. Object oriented shell scripts using <span class='inlinecode'>ksh</span></h2><br /> +<h2 style='display: inline' id='6-object-oriented-shell-scripts-using-ksh'>6. Object oriented shell scripts using <span class='inlinecode'>ksh</span></h2><br /> <br /> <span>Experienced software developers are aware that scripting languages like Python, Perl, Ruby, and JavaScript support object-oriented programming (OOP) concepts such as classes and inheritance. However, many might be surprised to learn that the latest version of the Korn shell (Version 93t+) also supports OOP. In ksh93, OOP is implemented using user-defined types:</span><br /> <br /> @@ -441,45 +2920,45 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/ksh93</font></i> -<font color="#ff0000"> </font> -<b><font color="#ffffff">typeset</font></b><font color="#ff0000"> -T </font><font color="#ff0000">Point_t</font><font color="#F3E651">=(</font> -<font color="#ff0000"> integer -h </font><font color="#bb00ff">'x coordinate'</font><font color="#ff0000"> </font><font color="#ff0000">x</font><font color="#F3E651">=</font><font color="#bb00ff">0</font> -<font color="#ff0000"> integer -h </font><font color="#bb00ff">'y coordinate'</font><font color="#ff0000"> </font><font color="#ff0000">y</font><font color="#F3E651">=</font><font color="#bb00ff">0</font> -<font color="#ff0000"> </font><b><font color="#ffffff">typeset</font></b><font color="#ff0000"> -h </font><font color="#bb00ff">'point color'</font><font color="#ff0000"> </font><font color="#ff0000">color</font><font color="#F3E651">=</font><font color="#bb00ff">"red"</font> - -<font color="#ff0000"> </font><font color="#7bc710">function getcolor </font><font color="#ff0000">{</font> -<font color="#ff0000"> print -r </font><font color="#ff0000">${_.color}</font> -<font color="#ff0000"> }</font> - -<font color="#ff0000"> </font><font color="#7bc710">function setcolor </font><font color="#ff0000">{</font> -<font color="#ff0000"> _</font><font color="#F3E651">.</font><font color="#ff0000">color</font><font color="#F3E651">=</font><font color="#ff0000">$1</font> -<font color="#ff0000"> }</font> - -<font color="#ff0000"> </font><font color="#7bc710">setxy()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> _</font><font color="#F3E651">.</font><font color="#ff0000">x</font><font color="#F3E651">=</font><font color="#ff0000">$1</font><font color="#F3E651">;</font><font color="#ff0000"> _</font><font color="#F3E651">.</font><font color="#ff0000">y</font><font color="#F3E651">=</font><font color="#ff0000">$2</font> -<font color="#ff0000"> }</font> - -<font color="#ff0000"> </font><font color="#7bc710">getxy()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> print -r </font><font color="#bb00ff">"(${_.x},${_.y})"</font> -<font color="#ff0000"> }</font> -<font color="#F3E651">)</font> -<font color="#ff0000"> </font> -<font color="#ff0000">Point_t point</font> -<font color="#ff0000"> </font> -<font color="#ff0000">echo </font><font color="#bb00ff">"Initial coordinates are (${point.x},${point.y}). Color is ${point.color}"</font> -<font color="#ff0000"> </font> -<font color="#ff0000">point</font><font color="#F3E651">.</font><font color="#ff0000">setxy </font><font color="#bb00ff">5</font><font color="#ff0000"> </font><font color="#bb00ff">6</font> -<font color="#ff0000">point</font><font color="#F3E651">.</font><font color="#ff0000">setcolor blue</font> -<font color="#ff0000"> </font> -<font color="#ff0000">echo </font><font color="#bb00ff">"New coordinates are ${point.getxy}. Color is ${point.getcolor}"</font> -<font color="#ff0000"> </font> -<b><font color="#ffffff">exit</font></b><font color="#ff0000"> </font><font color="#bb00ff">0</font> +<pre><i><font color="silver">#!/usr/bin/ksh93</font></i> + +<b><u><font color="#000000">typeset</font></u></b> -T Point_t=( + integer -h <font color="#808080">'x coordinate'</font> x=<font color="#000000">0</font> + integer -h <font color="#808080">'y coordinate'</font> y=<font color="#000000">0</font> + <b><u><font color="#000000">typeset</font></u></b> -h <font color="#808080">'point color'</font> color=<font color="#808080">"red"</font> + + function getcolor { + print -r ${_.color} + } + + function setcolor { + _.color=$1 + } + + setxy() { + _.x=$1; _.y=$2 + } + + getxy() { + print -r <font color="#808080">"(${_.x},${_.y})"</font> + } +) + +Point_t point + +echo <font color="#808080">"Initial coordinates are (${point.x},${point.y}). Color is ${point.color}"</font> + +point.setxy <font color="#000000">5</font> <font color="#000000">6</font> +point.setcolor blue + +echo <font color="#808080">"New coordinates are ${point.getxy}. Color is ${point.getcolor}"</font> + +<b><u><font color="#000000">exit</font></u></b> <font color="#000000">0</font> </pre> <br /> <a class='textlink' href='https://blog.fpmurphy.com/2010/05/ksh93-using-types-to-create-object-orientated-scripts.html'>Using types to create object oriented Korn shell 93 scripts</a><br /> <br /> -<h2 style='display: inline' id='7ThisworksinGo'>7. This works in Go</h2><br /> +<h2 style='display: inline' id='7-this-works-in-go'>7. This works in Go</h2><br /> <br /> <span>There is no pointer arithmetic in Go like in C, but it is still possible to do some brain teasers with pointers 😧:</span><br /> <br /> @@ -487,29 +2966,29 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">package</font></b><font color="#ff0000"> main</font> +<pre><b><u><font color="#000000">package</font></u></b> main -<b><font color="#ffffff">import</font></b><font color="#ff0000"> </font><font color="#bb00ff">"fmt"</font> +<b><u><font color="#000000">import</font></u></b> <font color="#808080">"fmt"</font> -<b><font color="#ffffff">func</font></b><font color="#ff0000"> </font><font color="#7bc710">main</font><font color="#F3E651">()</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#ffffff">var</font></b><font color="#ff0000"> i int</font> -<font color="#ff0000"> f </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><b><font color="#ffffff">func</font></b><font color="#F3E651">()</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000">int </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> </font><font color="#F3E651">&</font><font color="#ff0000">i</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#7bc710">f</font><font color="#F3E651">()++</font> -<font color="#ff0000"> fmt</font><font color="#F3E651">.</font><font color="#7bc710">Println</font><font color="#F3E651">(</font><font color="#ff0000">i</font><font color="#F3E651">)</font> -<font color="#F3E651">}</font> +<b><u><font color="#000000">func</font></u></b> main() { + <b><u><font color="#000000">var</font></u></b> i int + f := <b><u><font color="#000000">func</font></u></b>() *int { + <b><u><font color="#000000">return</font></u></b> &i + } + *f()++ + fmt.Println(i) +} </pre> <br /> <a class='textlink' href='https://go.dev/play/p/sPRdyDvXefK?__s=mk8u899owb9yurl256gw'>Go playground</a><br /> <br /> -<h2 style='display: inline' id='8IamaTeapotHTTPresponsecode'>8. "I am a Teapot" HTTP response code</h2><br /> +<h2 style='display: inline' id='8-i-am-a-teapot-http-response-code'>8. "I am a Teapot" HTTP response code</h2><br /> <br /> <span>Defined in 1998 as one of the IETF's traditional April Fools' jokes (RFC 2324), the Hyper Text Coffee Pot Control Protocol specifies an HTTP status code that is not intended for actual HTTP server implementation. According to the RFC, this code should be returned by teapots when asked to brew coffee. This status code also serves as an Easter egg on some websites, such as Google.com's "I'm a teapot" feature. Occasionally, it is used to respond to a blocked request, even though the more appropriate response would be the 403 Forbidden status code.</span><br /> <br /> <a class='textlink' href='https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#418'>https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#418</a><br /> <br /> -<h2 style='display: inline' id='9jqisafunctionalprogramminglanguage'>9. <span class='inlinecode'>jq</span> is a functional programming language</h2><br /> +<h2 style='display: inline' id='9-jq-is-a-functional-programming-language'>9. <span class='inlinecode'>jq</span> is a functional programming language</h2><br /> <br /> <span>Many know of <span class='inlinecode'>jq</span>, the handy small tool and swiss army knife for JSON parsing. </span><br /> <br /> @@ -563,7 +3042,7 @@ def _token: . </pre> <br /> -<h2 style='display: inline' id='10Regularexpressiontoverifyemailaddresses'>10. Regular expression to verify email addresses</h2><br /> +<h2 style='display: inline' id='10-regular-expression-to-verify-email-addresses'>10. Regular expression to verify email addresses</h2><br /> <br /> <span>This is a pretty old meme, but still worth posting here (as some may be unaware). The RFC822 Perl regex to validate email addresses is 😱:</span><br /> <br /> @@ -574,7 +3053,7 @@ def _token: ?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\0 31]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\ -](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+ +>(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+ (?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?: (?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z |(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n) @@ -590,8 +3069,8 @@ r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\ |\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r \n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?: \r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t -]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031 -]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\]( +>))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031 +>+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\]( ?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(? :(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(? :\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(? @@ -610,7 +3089,7 @@ r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\ :\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([ ^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\" .\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\ -]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\ +>\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\ [\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\ r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\] @@ -622,17 +3101,17 @@ r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\ (?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\". \[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[ ^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\] -]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)(?:,\s*( +>))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)(?:,\s*( ?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\ ".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:( ?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[ \["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t -])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t -])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(? +>)*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t +>)+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(? :\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+| \Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?: [^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\ -]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n) +>]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n) ?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[" ()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n) ?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<> @@ -671,13 +3150,23 @@ r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\ <name>Paul Buetow aka snonux</name> <email>paul@dev.buetow.org</email> </author> - <summary>Table of contents</summary> + <summary>Tmux (Terminal Multiplexer) is a powerful, terminal-based tool that manages multiple terminal sessions within a single window. Here are some of its primary features and functionalities:</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Terminalmultiplexingwithtmux'>Terminal multiplexing with <span class='inlinecode'>tmux</span></h1><br /> + <h1 style='display: inline' id='terminal-multiplexing-with-tmux'>Terminal multiplexing with <span class='inlinecode'>tmux</span></h1><br /> <br /> <span class='quote'>Published at 2024-06-23T22:41:59+03:00</span><br /> <br /> +<span>Tmux (Terminal Multiplexer) is a powerful, terminal-based tool that manages multiple terminal sessions within a single window. Here are some of its primary features and functionalities:</span><br /> +<br /> +<ul> +<li>Session management</li> +<li>Window and Pane management</li> +<li>Persistent Workspace</li> +<li>Customization</li> +</ul><br /> +<a class='textlink' href='https://github.com/tmux/tmux/wiki'>https://github.com/tmux/tmux/wiki</a><br /> +<br /> <pre> _______ |.-----.| @@ -690,40 +3179,28 @@ jgs `-=========-`() mod. by Paul B. </pre> <br /> -<pre> -Table of contents -================= - -Terminal multiplexing with `tmux` - Introduction - Shell aliases - The `tn` alias - Creating a new session - Cleaning up default sessions automatically - Renaming sessions - The `ta` alias - Attaching to a session - The `tr` alias - For a nested remote session - Change of the Tmux prefix for better nesting - The `ts` alias - Searching sessions with fuzzy finder - The `tssh` alias - Cluster SSH replacement - The `tmux::tssh_from_argument` helper - The `tmux::tssh_from_file` helper - `tssh` examples - Common Tmux commands I use in `tssh` - Copy and paste workflow - Tmux configurations -</pre> -<br /> -<h2 style='display: inline' id='Introduction'>Introduction</h2><br /> -<br /> -<span>Tmux (Terminal Multiplexer) is a powerful, terminal-based tool that manages multiple terminal sessions within a single window. Here are some of its primary features and functionalities:</span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> <ul> -<li>Session management</li> -<li>Window and Pane management</li> -<li>Persistent Workspace</li> -<li>Customization</li> +<li><a href='#terminal-multiplexing-with-tmux'>Terminal multiplexing with <span class='inlinecode'>tmux</span></a></li> +<li>⇢ <a href='#before-continuing'>Before continuing...</a></li> +<li>⇢ <a href='#shell-aliases'>Shell aliases</a></li> +<li>⇢ <a href='#the-tn-alias---creating-a-new-session'>The <span class='inlinecode'>tn</span> alias - Creating a new session</a></li> +<li>⇢ ⇢ <a href='#cleaning-up-default-sessions-automatically'>Cleaning up default sessions automatically</a></li> +<li>⇢ ⇢ <a href='#renaming-sessions'>Renaming sessions</a></li> +<li>⇢ <a href='#the-ta-alias---attaching-to-a-session'>The <span class='inlinecode'>ta</span> alias - Attaching to a session</a></li> +<li>⇢ <a href='#the-tr-alias---for-a-nested-remote-session'>The <span class='inlinecode'>tr</span> alias - For a nested remote session</a></li> +<li>⇢ ⇢ <a href='#change-of-the-tmux-prefix-for-better-nesting'>Change of the Tmux prefix for better nesting</a></li> +<li>⇢ <a href='#the-ts-alias---searching-sessions-with-fuzzy-finder'>The <span class='inlinecode'>ts</span> alias - Searching sessions with fuzzy finder</a></li> +<li>⇢ <a href='#the-tssh-alias---cluster-ssh-replacement'>The <span class='inlinecode'>tssh</span> alias - Cluster SSH replacement</a></li> +<li>⇢ ⇢ <a href='#the-tmuxtsshfromargument-helper'>The <span class='inlinecode'>tmux::tssh_from_argument</span> helper</a></li> +<li>⇢ ⇢ <a href='#the-tmuxtsshfromfile-helper'>The <span class='inlinecode'>tmux::tssh_from_file</span> helper</a></li> +<li>⇢ ⇢ <a href='#tssh-examples'><span class='inlinecode'>tssh</span> examples</a></li> +<li>⇢ ⇢ <a href='#common-tmux-commands-i-use-in-tssh'>Common Tmux commands I use in <span class='inlinecode'>tssh</span></a></li> +<li>⇢ <a href='#copy-and-paste-workflow'>Copy and paste workflow</a></li> +<li>⇢ <a href='#tmux-configurations'>Tmux configurations</a></li> </ul><br /> -<a class='textlink' href='https://github.com/tmux/tmux/wiki'>https://github.com/tmux/tmux/wiki</a><br /> +<h2 style='display: inline' id='before-continuing'>Before continuing...</h2><br /> <br /> <span>Before continuing to read this post, I encourage you to get familiar with Tmux first (unless you already know the basics). You can go through the official getting started guide:</span><br /> <br /> @@ -739,7 +3216,7 @@ Terminal multiplexing with `tmux` <br /> <span>Tmux is highly configurable, and I think I am only scratching the surface of what is possible with it. Nevertheless, it may still be useful for you. I also love that Tmux is part of the OpenBSD base system!</span><br /> <br /> -<h2 style='display: inline' id='Shellaliases'>Shell aliases</h2><br /> +<h2 style='display: inline' id='shell-aliases'>Shell aliases</h2><br /> <br /> <span>I am a user of the Z-Shell (<span class='inlinecode'>zsh</span>), but I believe all the snippets mentioned in this blog post also work with Bash. </span><br /> <br /> @@ -751,20 +3228,20 @@ Terminal multiplexing with `tmux` by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">tm</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">tl</font><font color="#F3E651">=</font><font color="#bb00ff">'tmux list-sessions'</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">tn</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#ff0000">new</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">ta</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#ff0000">attach</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">tx</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#ff0000">remote</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">ts</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#ff0000">search</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">tssh</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#ff0000">cluster_ssh</font> +<pre><b><u><font color="#000000">alias</font></u></b> tm=tmux +<b><u><font color="#000000">alias</font></u></b> tl=<font color="#808080">'tmux list-sessions'</font> +<b><u><font color="#000000">alias</font></u></b> tn=tmux::new +<b><u><font color="#000000">alias</font></u></b> ta=tmux::attach +<b><u><font color="#000000">alias</font></u></b> tx=tmux::remote +<b><u><font color="#000000">alias</font></u></b> ts=tmux::search +<b><u><font color="#000000">alias</font></u></b> tssh=tmux::cluster_ssh </pre> <br /> <span>Note all <span class='inlinecode'>tmux::...</span>; those are custom shell functions doing certain things, and they aren't part of the Tmux distribution. But let's run through every aliases one by one. </span><br /> <br /> <span>The first two are pretty straightforward. <span class='inlinecode'>tm</span> is simply a shorthand for <span class='inlinecode'>tmux</span>, so I have to type less, and <span class='inlinecode'>tl</span> lists all Tmux sessions that are currently open. No magic here.</span><br /> <br /> -<h2 style='display: inline' id='ThetnaliasCreatinganewsession'>The <span class='inlinecode'>tn</span> alias - Creating a new session</h2><br /> +<h2 style='display: inline' id='the-tn-alias---creating-a-new-session'>The <span class='inlinecode'>tn</span> alias - Creating a new session</h2><br /> <br /> <span>The <span class='inlinecode'>tn</span> alias is referencing this function:</span><br /> <br /> @@ -772,30 +3249,30 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab"># Create new session and if alread exists attach to it</font></i> -<font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#7bc710">new ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">readonly</font></b><font color="#ff0000"> </font><font color="#ff0000">session</font><font color="#F3E651">=</font><font color="#ff0000">$1</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> </font><font color="#ff0000">date</font><font color="#F3E651">=</font><font color="#ff0000">date</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> where gdate </font><font color="#F3E651">&></font><font color="#ff0000">/dev/null</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> </font><font color="#ff0000">date</font><font color="#F3E651">=</font><font color="#ff0000">gdate</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> - -<font color="#ff0000"> tmux</font><font color="#F3E651">::</font><font color="#ff0000">cleanup_default</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> -z </font><font color="#bb00ff">"$session"</font><font color="#ff0000"> </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> tmux</font><font color="#F3E651">::</font><font color="#ff0000">new T</font><font color="#ff0000">$($date</font><font color="#ff0000"> </font><font color="#F3E651">+%</font><font color="#ff0000">s</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><b><font color="#ffffff">else</font></b> -<font color="#ff0000"> tmux new-session -d -s </font><font color="#ff0000">$session</font> -<font color="#ff0000"> tmux -</font><font color="#bb00ff">2</font><font color="#ff0000"> attach-session -t </font><font color="#ff0000">$session</font><font color="#ff0000"> </font><font color="#F3E651">||</font><font color="#ff0000"> tmux -</font><font color="#bb00ff">2</font><font color="#ff0000"> switch-client -t </font><font color="#ff0000">$session</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> -<font color="#ff0000">}</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">tn</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#ff0000">new</font> +<pre><i><font color="silver"># Create new session and if alread exists attach to it</font></i> +tmux::new () { + <b><u><font color="#000000">readonly</font></u></b> session=$1 + <b><u><font color="#000000">local</font></u></b> date=date + <b><u><font color="#000000">if</font></u></b> where gdate &>/dev/null; <b><u><font color="#000000">then</font></u></b> + date=gdate + <b><u><font color="#000000">fi</font></u></b> + + tmux::cleanup_default + <b><u><font color="#000000">if</font></u></b> [ -z <font color="#808080">"$session"</font> ]; <b><u><font color="#000000">then</font></u></b> + tmux::new T$($date +%s) + <b><u><font color="#000000">else</font></u></b> + tmux new-session -d -s $session + tmux -<font color="#000000">2</font> attach-session -t $session || tmux -<font color="#000000">2</font> switch-client -t $session + <b><u><font color="#000000">fi</font></u></b> +} +<b><u><font color="#000000">alias</font></u></b> tn=tmux::new </pre> <br /> <span>There is a lot going on here. Let's have a detailed look at what it is doing. As a note, the function relies on GNU Date, so MacOS is looking for the <span class='inlinecode'>gdate</span> commands to be available. Otherwise, it will fall back to <span class='inlinecode'>date</span>. You need to install GNU Date for Mac, as it isn't installed by default there. As I use Fedora Linux on my personal Laptop and a MacBook for work, I have to make it work for both.</span><br /> <br /> <span>First, a Tmux session name can be passed to the function as a first argument. That session name is only optional. Without it, Tmux will select a session named <span class='inlinecode'>T$($date +%s)</span> as a default. Which is T followed by the UNIX epoch, e.g. <span class='inlinecode'>T1717133796</span>.</span><br /> <br /> -<h3 style='display: inline' id='Cleaningupdefaultsessionsautomatically'>Cleaning up default sessions automatically</h3><br /> +<h3 style='display: inline' id='cleaning-up-default-sessions-automatically'>Cleaning up default sessions automatically</h3><br /> <br /> <span>Note also the call to <span class='inlinecode'>tmux::cleanup_default</span>; it would clean up all already opened default sessions if they aren't attached. Those sessions were only temporary, and I had too many flying around after a while. So, I decided to auto-delete the sessions if they weren't attached. If I want to keep sessions around, I will rename them with the Tmux command <span class='inlinecode'>prefix-key $</span>. This is the cleanup function:</span><br /> <br /> @@ -803,23 +3280,23 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#7bc710">cleanup_default ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> s</font> -<font color="#ff0000"> tmux list-sessions </font><font color="#F3E651">|</font><font color="#ff0000"> grep </font><font color="#bb00ff">'^T.*: '</font><font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> grep -F -v attached </font><font color="#F3E651">|</font> -<font color="#ff0000"> cut -d</font><font color="#F3E651">:</font><font color="#ff0000"> -f</font><font color="#bb00ff">1</font><font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> </font><b><font color="#ffffff">while</font></b><font color="#ff0000"> </font><b><font color="#ffffff">read</font></b><font color="#ff0000"> -r s</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">do</font></b> -<font color="#ff0000"> echo </font><font color="#bb00ff">"Killing $s"</font> -<font color="#ff0000"> tmux kill-session -t </font><font color="#bb00ff">"$s"</font> -<font color="#ff0000"> </font><b><font color="#ffffff">done</font></b> -<font color="#ff0000">}</font> +<pre>tmux::cleanup_default () { + <b><u><font color="#000000">local</font></u></b> s + tmux list-sessions | grep <font color="#808080">'^T.*: '</font> | grep -F -v attached | + cut -d: -f<font color="#000000">1</font> | <b><u><font color="#000000">while</font></u></b> <b><u><font color="#000000">read</font></u></b> -r s; <b><u><font color="#000000">do</font></u></b> + echo <font color="#808080">"Killing $s"</font> + tmux kill-session -t <font color="#808080">"$s"</font> + <b><u><font color="#000000">done</font></u></b> +} </pre> <br /> <span>The cleanup function kills all open Tmux sessions that haven't been renamed properly yet—but only if they aren't attached (e.g., don't run in the foreground in any terminal). Cleaning them up automatically keeps my Tmux sessions as neat and tidy as possible. </span><br /> <br /> -<h3 style='display: inline' id='Renamingsessions'>Renaming sessions</h3><br /> +<h3 style='display: inline' id='renaming-sessions'>Renaming sessions</h3><br /> <br /> <span>Whenever I am in a temporary session (named <span class='inlinecode'>T....</span>), I may decide that I want to keep this session around. I have to rename the session to prevent the cleanup function from doing its thing. That's, as mentioned already, easily accomplished with the standard <span class='inlinecode'>prefix-key $</span> Tmux command.</span><br /> <br /> -<h2 style='display: inline' id='ThetaaliasAttachingtoasession'>The <span class='inlinecode'>ta</span> alias - Attaching to a session</h2><br /> +<h2 style='display: inline' id='the-ta-alias---attaching-to-a-session'>The <span class='inlinecode'>ta</span> alias - Attaching to a session</h2><br /> <br /> <span>This alias refers to the following function, which tries to attach to an already-running Tmux session.</span><br /> <br /> @@ -827,21 +3304,21 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#7bc710">attach ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">readonly</font></b><font color="#ff0000"> </font><font color="#ff0000">session</font><font color="#F3E651">=</font><font color="#ff0000">$1</font> - -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> -z </font><font color="#bb00ff">"$session"</font><font color="#ff0000"> </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> tmux attach-session </font><font color="#F3E651">||</font><font color="#ff0000"> tmux</font><font color="#F3E651">::</font><font color="#ff0000">new</font> -<font color="#ff0000"> </font><b><font color="#ffffff">else</font></b> -<font color="#ff0000"> tmux attach-session -t </font><font color="#ff0000">$session</font><font color="#ff0000"> </font><font color="#F3E651">||</font><font color="#ff0000"> tmux</font><font color="#F3E651">::</font><font color="#ff0000">new </font><font color="#ff0000">$session</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> -<font color="#ff0000">}</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">ta</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#ff0000">attach</font> +<pre>tmux::attach () { + <b><u><font color="#000000">readonly</font></u></b> session=$1 + + <b><u><font color="#000000">if</font></u></b> [ -z <font color="#808080">"$session"</font> ]; <b><u><font color="#000000">then</font></u></b> + tmux attach-session || tmux::new + <b><u><font color="#000000">else</font></u></b> + tmux attach-session -t $session || tmux::new $session + <b><u><font color="#000000">fi</font></u></b> +} +<b><u><font color="#000000">alias</font></u></b> ta=tmux::attach </pre> <br /> <span>If no session is specified (as the argument of the function), it will try to attach to the first open session. If no Tmux server is running, it will create a new one with <span class='inlinecode'>tmux::new</span>. Otherwise, with a session name given as the argument, it will attach to it. If unsuccessful (e.g., the session doesn't exist), it will be created and attached to.</span><br /> <br /> -<h2 style='display: inline' id='ThetraliasForanestedremotesession'>The <span class='inlinecode'>tr</span> alias - For a nested remote session</h2><br /> +<h2 style='display: inline' id='the-tr-alias---for-a-nested-remote-session'>The <span class='inlinecode'>tr</span> alias - For a nested remote session</h2><br /> <br /> <span>This SSHs into the remote server specified and then, remotely on the server itself, starts a nested Tmux session. So we have one Tmux session on the local computer and, inside of it, an SSH connection to a remote server with a Tmux session running again. The benefit of this is that, in case my network connection breaks down, the next time I connect, I can continue my work on the remote server exactly where I left off. The session name is the name of the server being SSHed into. If a session like this already exists, it simply attaches to it.</span><br /> <br /> @@ -849,15 +3326,15 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#7bc710">remote ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">readonly</font></b><font color="#ff0000"> </font><font color="#ff0000">server</font><font color="#F3E651">=</font><font color="#ff0000">$1</font> -<font color="#ff0000"> tmux new -s </font><font color="#ff0000">$server</font><font color="#ff0000"> </font><font color="#bb00ff">"ssh -t $server 'tmux attach-session || tmux'"</font><font color="#ff0000"> </font><font color="#F3E651">||</font><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> tmux attach-session -d -t </font><font color="#ff0000">$server</font> -<font color="#ff0000">}</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">tr</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#ff0000">remote</font> +<pre>tmux::remote () { + <b><u><font color="#000000">readonly</font></u></b> server=$1 + tmux new -s $server <font color="#808080">"ssh -t $server 'tmux attach-session || tmux'"</font> || \ + tmux attach-session -d -t $server +} +<b><u><font color="#000000">alias</font></u></b> tr=tmux::remote </pre> <br /> -<h3 style='display: inline' id='ChangeoftheTmuxprefixforbetternesting'>Change of the Tmux prefix for better nesting</h3><br /> +<h3 style='display: inline' id='change-of-the-tmux-prefix-for-better-nesting'>Change of the Tmux prefix for better nesting</h3><br /> <br /> <span>To make nested Tmux sessions work smoothly, one must change the Tmux prefix key locally or remotely. By default, the Tmux prefix key is <span class='inlinecode'>Ctrl-b</span>, so <span class='inlinecode'>Ctrl-b $</span>, for example, renames the current session. To change the prefix key from the standard <span class='inlinecode'>Ctrl-b</span> to, for example, <span class='inlinecode'>Ctrl-g</span>, you must add this to the <span class='inlinecode'>tmux.conf</span>:</span><br /> <br /> @@ -869,7 +3346,7 @@ set-option -g prefix C-g <br /> <span>There might also be another way around this (without reconfiguring the prefix key), but that is cumbersome to use, as far as I remember. </span><br /> <br /> -<h2 style='display: inline' id='ThetsaliasSearchingsessionswithfuzzyfinder'>The <span class='inlinecode'>ts</span> alias - Searching sessions with fuzzy finder</h2><br /> +<h2 style='display: inline' id='the-ts-alias---searching-sessions-with-fuzzy-finder'>The <span class='inlinecode'>ts</span> alias - Searching sessions with fuzzy finder</h2><br /> <br /> <span>Despite the fact that with <span class='inlinecode'>tmux::cleanup_default</span>, I don't leave a huge mess with trillions of Tmux sessions flying around all the time, at times, it can become challenging to find exactly the session I am currently interested in. After a busy workday, I often end up with around twenty sessions on my laptop. This is where fuzzy searching for session names comes in handy, as I often don't remember the exact session names.</span><br /> <br /> @@ -877,15 +3354,15 @@ set-option -g prefix C-g by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#7bc710">search ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">session</font><font color="#F3E651">=</font><font color="#ff0000">$(</font><font color="#ff0000">tmux list-sessions </font><font color="#F3E651">|</font><font color="#ff0000"> fzf </font><font color="#F3E651">|</font><font color="#ff0000"> cut -d</font><font color="#F3E651">:</font><font color="#ff0000"> -f</font><font color="#bb00ff">1</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> -z </font><font color="#bb00ff">"$TMUX"</font><font color="#ff0000"> </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> tmux attach-session -t </font><font color="#ff0000">$session</font> -<font color="#ff0000"> </font><b><font color="#ffffff">else</font></b> -<font color="#ff0000"> tmux switch -t </font><font color="#ff0000">$session</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> -<font color="#ff0000">}</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">ts</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#ff0000">search</font> +<pre>tmux::search () { + <b><u><font color="#000000">local</font></u></b> -r session=$(tmux list-sessions | fzf | cut -d: -f<font color="#000000">1</font>) + <b><u><font color="#000000">if</font></u></b> [ -z <font color="#808080">"$TMUX"</font> ]; <b><u><font color="#000000">then</font></u></b> + tmux attach-session -t $session + <b><u><font color="#000000">else</font></u></b> + tmux switch -t $session + <b><u><font color="#000000">fi</font></u></b> +} +<b><u><font color="#000000">alias</font></u></b> ts=tmux::search </pre> <br /> <span>All it does is list all currently open sessions in <span class='inlinecode'>fzf</span>, where one of them can be searched and selected through fuzzy find, and then either switch (if already inside a session) to the other session or attach to the other session (if not yet in Tmux).</span><br /> @@ -894,7 +3371,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <a href='./terminal-multiplexing-with-tmux/tmux-session-fzf.png'><img alt='Tmux session fuzzy finder' title='Tmux session fuzzy finder' src='./terminal-multiplexing-with-tmux/tmux-session-fzf.png' /></a><br /> <br /> -<h2 style='display: inline' id='ThetsshaliasClusterSSHreplacement'>The <span class='inlinecode'>tssh</span> alias - Cluster SSH replacement</h2><br /> +<h2 style='display: inline' id='the-tssh-alias---cluster-ssh-replacement'>The <span class='inlinecode'>tssh</span> alias - Cluster SSH replacement</h2><br /> <br /> <span>Before I used Tmux, I was a heavy user of ClusterSSH, which allowed me to log in to multiple servers at once in a single terminal window and type and run commands on all of them in parallel.</span><br /> <br /> @@ -912,20 +3389,20 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#7bc710">cluster_ssh ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> -f </font><font color="#bb00ff">"$1"</font><font color="#ff0000"> </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> tmux</font><font color="#F3E651">::</font><font color="#ff0000">tssh_from_file </font><font color="#ff0000">$1</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> +<pre>tmux::cluster_ssh () { + <b><u><font color="#000000">if</font></u></b> [ -f <font color="#808080">"$1"</font> ]; <b><u><font color="#000000">then</font></u></b> + tmux::tssh_from_file $1 + <b><u><font color="#000000">return</font></u></b> + <b><u><font color="#000000">fi</font></u></b> -<font color="#ff0000"> tmux</font><font color="#F3E651">::</font><font color="#ff0000">tssh_from_argument </font><font color="#ff0000">$@</font> -<font color="#ff0000">}</font> -<b><font color="#ffffff">alias</font></b><font color="#ff0000"> </font><font color="#ff0000">tssh</font><font color="#F3E651">=</font><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#ff0000">cluster_ssh</font> + tmux::tssh_from_argument $@ +} +<b><u><font color="#000000">alias</font></u></b> tssh=tmux::cluster_ssh </pre> <br /> <span>This function is just a wrapper around the more complex <span class='inlinecode'>tmux::tssh_from_file</span> and <span class='inlinecode'>tmux::tssh_from_argument</span> functions, as you have learned already. Most of the magic happens there.</span><br /> <br /> -<h3 style='display: inline' id='Thetmuxtsshfromargumenthelper'>The <span class='inlinecode'>tmux::tssh_from_argument</span> helper</h3><br /> +<h3 style='display: inline' id='the-tmuxtsshfromargument-helper'>The <span class='inlinecode'>tmux::tssh_from_argument</span> helper</h3><br /> <br /> <span>This is the most magic helper function we will cover in this post. It looks like this:</span><br /> <br /> @@ -933,23 +3410,23 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#7bc710">tssh_from_argument ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">session</font><font color="#F3E651">=</font><font color="#ff0000">$1</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">shift</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> </font><font color="#ff0000">first_server</font><font color="#F3E651">=</font><font color="#ff0000">$1</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">shift</font></b> - -<font color="#ff0000"> tmux new-session -d -s </font><font color="#ff0000">$session</font><font color="#ff0000"> </font><font color="#bb00ff">"ssh -t $first_server"</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">!</font><font color="#ff0000"> tmux list-session </font><font color="#F3E651">|</font><font color="#ff0000"> grep </font><font color="#bb00ff">"^$session:"</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> echo </font><font color="#bb00ff">"Could not create session $session"</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> </font><font color="#bb00ff">2</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> - -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> server </font><b><font color="#ffffff">in</font></b><font color="#ff0000"> </font><font color="#bb00ff">"${@[@]}"</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">do</font></b> -<font color="#ff0000"> tmux split-window -t </font><font color="#ff0000">$session</font><font color="#ff0000"> </font><font color="#bb00ff">"tmux select-layout tiled; ssh -t $server"</font> -<font color="#ff0000"> </font><b><font color="#ffffff">done</font></b> - -<font color="#ff0000"> tmux setw -t </font><font color="#ff0000">$session</font><font color="#ff0000"> synchronize-panes on</font> -<font color="#ff0000"> tmux -</font><font color="#bb00ff">2</font><font color="#ff0000"> attach-session -t </font><font color="#ff0000">$session</font><font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> tmux -</font><font color="#bb00ff">2</font><font color="#ff0000"> switch-client -t </font><font color="#ff0000">$session</font> -<font color="#ff0000">}</font> +<pre>tmux::tssh_from_argument () { + <b><u><font color="#000000">local</font></u></b> -r session=$1; <b><u><font color="#000000">shift</font></u></b> + <b><u><font color="#000000">local</font></u></b> first_server=$1; <b><u><font color="#000000">shift</font></u></b> + + tmux new-session -d -s $session <font color="#808080">"ssh -t $first_server"</font> + <b><u><font color="#000000">if</font></u></b> ! tmux list-session | grep <font color="#808080">"^$session:"</font>; <b><u><font color="#000000">then</font></u></b> + echo <font color="#808080">"Could not create session $session"</font> + <b><u><font color="#000000">return</font></u></b> <font color="#000000">2</font> + <b><u><font color="#000000">fi</font></u></b> + + <b><u><font color="#000000">for</font></u></b> server <b><u><font color="#000000">in</font></u></b> <font color="#808080">"${@[@]}"</font>; <b><u><font color="#000000">do</font></u></b> + tmux split-window -t $session <font color="#808080">"tmux select-layout tiled; ssh -t $server"</font> + <b><u><font color="#000000">done</font></u></b> + + tmux setw -t $session synchronize-panes on + tmux -<font color="#000000">2</font> attach-session -t $session | tmux -<font color="#000000">2</font> switch-client -t $session +} </pre> <br /> <span>It expects at least two arguments. The first argument is the session name to create for the clustered SSH session. All other arguments are server hostnames or FQDNs to which to connect. The first one is used to make the initial session. All remaining ones are added to that session with <span class='inlinecode'>tmux split-window -t $session...</span>. At the end, we enable synchronized panes by default, so whenever you type, the commands will be sent to every SSH connection, thus allowing the neat ClusterSSH feature to run commands on multiple servers simultaneously. Once done, we attach (or switch, if already in Tmux) to it.</span><br /> @@ -961,7 +3438,7 @@ bind-key p setw synchronize-panes off bind-key P setw synchronize-panes on </pre> <br /> -<h3 style='display: inline' id='Thetmuxtsshfromfilehelper'>The <span class='inlinecode'>tmux::tssh_from_file</span> helper</h3><br /> +<h3 style='display: inline' id='the-tmuxtsshfromfile-helper'>The <span class='inlinecode'>tmux::tssh_from_file</span> helper</h3><br /> <br /> <span>This one sets the session name to the file name and then reads a list of servers from that file, passing the list of servers to <span class='inlinecode'>tmux::tssh_from_argument</span> as the arguments. So, this is a neat little wrapper that also enables me to open clustered SSH sessions from an input file.</span><br /> <br /> @@ -969,15 +3446,15 @@ bind-key P setw synchronize-panes on by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">tmux</font><font color="#F3E651">::</font><font color="#7bc710">tssh_from_file ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">serverlist</font><font color="#F3E651">=</font><font color="#ff0000">$1</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">shift</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">session</font><font color="#F3E651">=</font><font color="#ff0000">$(</font><font color="#ff0000">basename </font><font color="#ff0000">$serverlist</font><font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> cut -d</font><font color="#F3E651">.</font><font color="#ff0000"> -f</font><font color="#bb00ff">1</font><font color="#F3E651">)</font> +<pre>tmux::tssh_from_file () { + <b><u><font color="#000000">local</font></u></b> -r serverlist=$1; <b><u><font color="#000000">shift</font></u></b> + <b><u><font color="#000000">local</font></u></b> -r session=$(basename $serverlist | cut -d. -f<font color="#000000">1</font>) -<font color="#ff0000"> tmux</font><font color="#F3E651">::</font><font color="#ff0000">tssh_from_argument </font><font color="#ff0000">$session</font><font color="#ff0000"> </font><font color="#ff0000">$(</font><font color="#ff0000">awk </font><font color="#bb00ff">'{ print $1} '</font><font color="#ff0000"> </font><font color="#ff0000">$serverlist</font><font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> sed </font><font color="#bb00ff">'s/.lan./.lan/g'</font><font color="#F3E651">)</font> -<font color="#ff0000">}</font> + tmux::tssh_from_argument $session $(awk <font color="#808080">'{ print $1} '</font> $serverlist | sed <font color="#808080">'s/.lan./.lan/g'</font>) +} </pre> <br /> -<h3 style='display: inline' id='tsshexamples'><span class='inlinecode'>tssh</span> examples</h3><br /> +<h3 style='display: inline' id='tssh-examples'><span class='inlinecode'>tssh</span> examples</h3><br /> <br /> <span>To open a new session named <span class='inlinecode'>fish</span> and log in to 4 remote hosts, run this command (Note that it is also possible to specify the remote user):</span><br /> <br /> @@ -992,7 +3469,7 @@ $ tssh fish blowfish.buetow.org fishfinger.buetow.org \ $ tssh manyservers.txt </pre> <br /> -<h3 style='display: inline' id='CommonTmuxcommandsIuseintssh'>Common Tmux commands I use in <span class='inlinecode'>tssh</span></h3><br /> +<h3 style='display: inline' id='common-tmux-commands-i-use-in-tssh'>Common Tmux commands I use in <span class='inlinecode'>tssh</span></h3><br /> <br /> <span>These are default Tmux commands that I make heavy use of in a <span class='inlinecode'>tssh</span> session:</span><br /> <br /> @@ -1001,7 +3478,7 @@ $ tssh manyservers.txt <li>Press <span class='inlinecode'>prefix-key <space></span> to change the pane layout (can be pressed multiple times to cycle through them).</li> <li>Press <span class='inlinecode'>prefix-key z</span> to zoom in and out of the current active pane.</li> </ul><br /> -<h2 style='display: inline' id='Copyandpasteworkflow'>Copy and paste workflow</h2><br /> +<h2 style='display: inline' id='copy-and-paste-workflow'>Copy and paste workflow</h2><br /> <br /> <span>As you will see later in this blog post, I have configured a history limit of 1 million items in Tmux so that I can scroll back quite far. One main workflow of mine is to search for text in the Tmux history, select and copy it, and then switch to another window or session and paste it there (e.g., into my text editor to do something with it).</span><br /> <br /> @@ -1020,7 +3497,7 @@ bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel <br /> <span>Once the text is yanked, I switch to another Tmux window or session where, for example, a text editor is running and paste the yanked text from Tmux into the editor with <span class='inlinecode'>prefix-key ]</span>. Note that when pasting into a modal text editor like Vi or Helix, you would first need to enter insert mode before <span class='inlinecode'>prefix-key ]</span> would paste anything.</span><br /> <br /> -<h2 style='display: inline' id='Tmuxconfigurations'>Tmux configurations</h2><br /> +<h2 style='display: inline' id='tmux-configurations'>Tmux configurations</h2><br /> <br /> <span>Some features I have configured directly in Tmux don't require an external shell alias to function correctly. Let's walk line by line through my local <span class='inlinecode'>~/.config/tmux/tmux.conf</span>:</span><br /> <br /> @@ -1110,13 +3587,15 @@ bind-key r source-file ~/.config/tmux/tmux.conf \; display-message "tmux.conf re <name>Paul Buetow aka snonux</name> <email>paul@dev.buetow.org</email> </author> - <summary>Art by Laura Brown</summary> + <summary>Over the years, I have collected many ideas for my personal projects and noted them down. I am currently in the process of cleaning up all my notes and reviewing those ideas. I don’t have time for the ones listed here and won’t have any soon due to other commitments and personal projects. So, in order to 'get rid of them' from my notes folder, I decided to simply put them in this blog post so that those ideas don't get lost. Maybe I will pick up one or another idea someday in the future, but for now, they are all put on ice in favor of other personal projects or family time.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='ProjectsIcurrentlydonthavetimefor'>Projects I currently don't have time for</h1><br /> + <h1 style='display: inline' id='projects-i-currently-don-t-have-time-for'>Projects I currently don't have time for</h1><br /> <br /> <span class='quote'>Published at 2024-05-03T16:23:03+03:00</span><br /> <br /> +<span>Over the years, I have collected many ideas for my personal projects and noted them down. I am currently in the process of cleaning up all my notes and reviewing those ideas. I don’t have time for the ones listed here and won’t have any soon due to other commitments and personal projects. So, in order to "get rid of them" from my notes folder, I decided to simply put them in this blog post so that those ideas don't get lost. Maybe I will pick up one or another idea someday in the future, but for now, they are all put on ice in favor of other personal projects or family time.</span><br /> +<br /> <pre> Art by Laura Brown @@ -1130,58 +3609,51 @@ Art by Laura Brown </pre> <br /> -<h2 style='display: inline' id='Introduction'>Introduction</h2><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<span>Over the years, I have collected many ideas for my personal projects and noted them down. I am currently in the process of cleaning up all my notes and reviewing those ideas. I don’t have time for the ones listed here and won’t have any soon due to other commitments and personal projects. So, in order to "get rid of them" from my notes folder, I decided to simply put them in this blog post so that those ideas don't get lost. Maybe I will pick up one or another idea someday in the future, but for now, they are all put on ice in favor of other personal projects or family time.</span><br /> +<ul> +<li><a href='#projects-i-currently-don-t-have-time-for'>Projects I currently don't have time for</a></li> +<li>⇢ <a href='#hardware-projects-i-don-t-have-time-for'>Hardware projects I don't have time for</a></li> +<li>⇢ ⇢ <a href='#i-use-arch-btw'>I use Arch, btw!</a></li> +<li>⇢ ⇢ <a href='#openbsd-home-router'>OpenBSD home router</a></li> +<li>⇢ ⇢ <a href='#pi-hole-server'>Pi-Hole server</a></li> +<li>⇢ ⇢ <a href='#infodash'>Infodash</a></li> +<li>⇢ ⇢ <a href='#reading-station'>Reading station</a></li> +<li>⇢ ⇢ <a href='#retro-station'>Retro station</a></li> +<li>⇢ ⇢ <a href='#sound-server'>Sound server</a></li> +<li>⇢ ⇢ <a href='#project-freekat'>Project Freekat</a></li> +<li>⇢ <a href='#programming-projects-i-don-t-have-time-for'>Programming projects I don't have time for</a></li> +<li>⇢ ⇢ <a href='#cli-hive'>CLI-HIVE</a></li> +<li>⇢ ⇢ <a href='#enhanced-kiss-home-photo-albums'>Enhanced KISS home photo albums</a></li> +<li>⇢ ⇢ <a href='#kiss-file-sync-server-with-end-to-end-encryption'>KISS file sync server with end-to-end encryption</a></li> +<li>⇢ ⇢ <a href='#a-language-that-compiles-to-bash'>A language that compiles to <span class='inlinecode'>bash</span></a></li> +<li>⇢ ⇢ <a href='#a-language-that-compiles-to-sed'>A language that compiles to <span class='inlinecode'>sed</span></a></li> +<li>⇢ ⇢ <a href='#renovate-vs-sim'>Renovate VS-Sim</a></li> +<li>⇢ ⇢ <a href='#kiss-ticketing-system'>KISS ticketing system</a></li> +<li>⇢ ⇢ <a href='#a-domain-specific-language-dsl-for-work'>A domain-specific language (DSL) for work</a></li> +<li>⇢ <a href='#self-hosting-projects-i-don-t-have-time-for'>Self-hosting projects I don't have time for</a></li> +<li>⇢ ⇢ <a href='#my-own-matrix-server'>My own Matrix server</a></li> +<li>⇢ ⇢ <a href='#ampache-music-server'>Ampache music server</a></li> +<li>⇢ ⇢ <a href='#librum-ebook-reader'>Librum eBook reader</a></li> +<li>⇢ ⇢ <a href='#memos---note-taking-service'>Memos - Note-taking service</a></li> +<li>⇢ ⇢ <a href='#bepasty-server'>Bepasty server</a></li> +<li>⇢ <a href='#books-i-don-t-have-time-to-read'>Books I don't have time to read</a></li> +<li>⇢ ⇢ <a href='#fluent-python'>Fluent Python</a></li> +<li>⇢ ⇢ <a href='#programming-ruby'>Programming Ruby</a></li> +<li>⇢ ⇢ <a href='#peter-f-hamilton-science-fiction-books'>Peter F. Hamilton science fiction books</a></li> +<li>⇢ <a href='#new-websites-i-don-t-have-time-for'>New websites I don't have time for</a></li> +<li>⇢ ⇢ <a href='#create-a-why-raku-rox-site'>Create a "Why Raku Rox" site</a></li> +<li>⇢ <a href='#research-projects-i-don-t-have-time-for'>Research projects I don't have time for</a></li> +<li>⇢ ⇢ <a href='#project-secure'>Project secure</a></li> +<li>⇢ ⇢ <a href='#cpu-utilisation-is-all-wrong'>CPU utilisation is all wrong</a></li> +</ul><br /> +<h2 style='display: inline' id='hardware-projects-i-don-t-have-time-for'>Hardware projects I don't have time for</h2><br /> <br /> -<pre> -Table of contents -================= - -Projects I currently don't have time for - Introduction - Hardware projects I don't have time for - I use Arch, btw! - OpenBSD home router - Pi-Hole server - Infodash - Reading station - Retro station - Sound server - Project Freekat - Programming projects I don't have time for - CLI-HIVE - Enhanced KISS home photo albums - KISS file sync server with end-to-end encryption - A language that compiles to `bash` - A language that compiles to `sed` - Renovate VS-Sim - KISS ticketing system - A domain-specific language (DSL) for work - Self-hosting projects I don't have time for - My own Matrix server - Ampache music server - Librum eBook reader - Memos - Note-taking service - Bepasty server - Books I don't have time to read - Fluent Python - Programming Ruby - Peter F. Hamilton science fiction books - New websites I don't have time for - Create a "Why Raku Rox" site - Research projects I don't have time for - Project secure - CPU utilisation is all wrong -</pre> -<br /> -<h2 style='display: inline' id='HardwareprojectsIdonthavetimefor'>Hardware projects I don't have time for</h2><br /> -<br /> -<h3 style='display: inline' id='IuseArchbtw'>I use Arch, btw!</h3><br /> +<h3 style='display: inline' id='i-use-arch-btw'>I use Arch, btw!</h3><br /> <br /> <span>The idea was to build the ultimate Arch Linux setup on an old ThinkPad X200 booting with the open-source LibreBoot firmware, complete with a tiling window manager, dmenu, and all the elite tools. This is mainly for fun, as I am pretty happy (and productive) with my Fedora Linux setup. I ran EndeavourOS (close enough to Arch) on an old ThinkPad for a while, but then I switched back to Fedora because the rolling releases were annoying (there were too many updates).</span><br /> <br /> -<h3 style='display: inline' id='OpenBSDhomerouter'>OpenBSD home router</h3><br /> +<h3 style='display: inline' id='openbsd-home-router'>OpenBSD home router</h3><br /> <br /> <span>In my student days, I operated a 486DX PC with OpenBSD as my home DSL internet router. I bought the setup from my brother back then. The router's hostname was <span class='inlinecode'>fishbone</span>, and it performed very well until it became too slow for larger broadband bandwidth after a few years of use.</span><br /> <br /> @@ -1196,23 +3668,23 @@ Projects I currently don't have time for <br /> <a class='textlink' href='https://OpenWRT.org/'>https://OpenWRT.org/</a><br /> <br /> -<h3 style='display: inline' id='PiHoleserver'>Pi-Hole server</h3><br /> +<h3 style='display: inline' id='pi-hole-server'>Pi-Hole server</h3><br /> <br /> <span>Install Pi-hole on one of my Pis or run it in a container on Freekat. For now, I am putting this on hold as the primary use for this would be ad-blocking, and I am avoiding surfing ad-heavy sites anyway. So there's no significant use for me personally at the moment.</span><br /> <br /> <a class='textlink' href='https://pi-hole.net/'>https://pi-hole.net/</a><br /> <br /> -<h3 style='display: inline' id='Infodash'>Infodash</h3><br /> +<h3 style='display: inline' id='infodash'>Infodash</h3><br /> <br /> <span>The idea was to implement my smart info screen using purely open-source software. It would display information such as the health status of my personal infrastructure, my current work tracker balance (I track how much I work to prevent overworking), and my sports balance (I track my workouts to stay within my quotas for general health). The information would be displayed on a small screen in my home office, on my Pine watch, or remotely from any terminal window.</span><br /> <br /> <span>I don't have this, and I haven't missed having it, so I guess it would have been nice to have it but not provide any value other than the "fun of tinkering."</span><br /> <br /> -<h3 style='display: inline' id='Readingstation'>Reading station</h3><br /> +<h3 style='display: inline' id='reading-station'>Reading station</h3><br /> <br /> <span>I wanted to create the most comfortable setup possible for reading digital notes, articles, and books. This would include a comfy armchair, a silent barebone PC or Raspberry Pi computer running either Linux or *BSD, and an e-Ink display mounted on a flexible arm/stand. There would also be a small table for my paper journal for occasional note-taking. There are a bunch of open-source software available for PDF and ePub reading. It would have been neat, but I am currently using the most straightforward solution: a Kobo Elipsa 2E, which I can use on my sofa.</span><br /> <br /> -<h3 style='display: inline' id='Retrostation'>Retro station</h3><br /> +<h3 style='display: inline' id='retro-station'>Retro station</h3><br /> <br /> <span>I had an idea to build a computer infused with retro elements. It wouldn't use actual retro hardware but would look and feel like a retro machine. I would call this machine HAL or Retron.</span><br /> <br /> @@ -1224,14 +3696,14 @@ Projects I currently don't have time for <br /> <span>The computer would occasionally be used to surf the Gemini space, take notes, blog, or do light coding. However, I have abandoned the project for now because there isn't enough space in my apartment, as my daughter will have a room for herself.</span><br /> <br /> -<h3 style='display: inline' id='Soundserver'>Sound server</h3><br /> +<h3 style='display: inline' id='sound-server'>Sound server</h3><br /> <br /> <span>My idea involved using a barebone mini PC running FreeBSD with the Navidrome sound server software. I could remotely connect to it from my phone, workstation/laptop to listen to my music collection. The storage would be based on ZFS with at least two drives for redundancy. The app would run in a Linux Docker container under FreeBSD via Bhyve.</span><br /> <br /> <a class='textlink' href='https://github.com/navidrome/navidrome'>https://github.com/navidrome/navidrome</a><br /> <a class='textlink' href='https://wiki.freebsd.org/bhyve'>https://wiki.freebsd.org/bhyve</a><br /> <br /> -<h3 style='display: inline' id='ProjectFreekat'>Project Freekat</h3><br /> +<h3 style='display: inline' id='project-freekat'>Project Freekat</h3><br /> <br /> <span>My idea involved purchasing the Meerkat mini PC from System76 and installing FreeBSD. Like the sound-server idea (see previous idea), it would run Linux Docker through Bhyve. I would self-host a bunch of applications on it:</span><br /> <br /> @@ -1255,15 +3727,15 @@ Projects I currently don't have time for <br /> <a class='textlink' href='./2024-02-04-from-babylon5.buetow.org-to-.cloud.html'>My personal AWS setup</a><br /> <br /> -<h2 style='display: inline' id='ProgrammingprojectsIdonthavetimefor'>Programming projects I don't have time for</h2><br /> +<h2 style='display: inline' id='programming-projects-i-don-t-have-time-for'>Programming projects I don't have time for</h2><br /> <br /> -<h3 style='display: inline' id='CLIHIVE'>CLI-HIVE</h3><br /> +<h3 style='display: inline' id='cli-hive'>CLI-HIVE</h3><br /> <br /> <span>This was a pet project idea that my brother and I had. The concept was to collect all shell history of all servers at work in a central place, apply ML/AI, and return suggestions for commands to type or allow a fuzzy search on all the commands in the history. The recommendations for the commands on a server could be context-based (e.g., past occurrences on the same server type). </span><br /> <br /> <span>You could decide whether to share your command history with others so they would receive better suggestions depending on which server they are on, or you could keep all the history private and secure. The plan was to add hooks into zsh and bash shells so that all commands typed would be pushed to the central location for data mining.</span><br /> <br /> -<h3 style='display: inline' id='EnhancedKISShomephotoalbums'>Enhanced KISS home photo albums</h3><br /> +<h3 style='display: inline' id='enhanced-kiss-home-photo-albums'>Enhanced KISS home photo albums</h3><br /> <br /> <span>I don't use third-party cloud providers such as Google Photos to store/archive my photos. Instead, they are all on a ZFS volume on my home NAS, with regular offsite backups taken. Thus, my project would involve implementing the features I miss most or finding a solution simple enough to host on my LAN:</span><br /> <br /> @@ -1275,7 +3747,7 @@ Projects I currently don't have time for </ul><br /> <a class='textlink' href='./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.html'>KISS static web photo albums with <span class='inlinecode'>photoalbum.sh</span></a><br /> <br /> -<h3 style='display: inline' id='KISSfilesyncserverwithendtoendencryption'>KISS file sync server with end-to-end encryption</h3><br /> +<h3 style='display: inline' id='kiss-file-sync-server-with-end-to-end-encryption'>KISS file sync server with end-to-end encryption</h3><br /> <br /> <span>I aimed to have a simple server to which I could sync notes and other documents, ensuring that the data is fully end-to-end encrypted. This way, only the clients could decrypt the data, while an encrypted copy of all the data would be stored on the server side. There are a few solutions (e.g., NextCloud), but they are bloated or complex to set up. </span><br /> <br /> @@ -1285,7 +3757,7 @@ Projects I currently don't have time for <br /> <span>I also had the idea of using this as a pet project for work and naming it <span class='inlinecode'>Cryptolake</span>, utilizing post-quantum-safe encryption algorithms and a distributed data store.</span><br /> <br /> -<h3 style='display: inline' id='Alanguagethatcompilestobash'>A language that compiles to <span class='inlinecode'>bash</span></h3><br /> +<h3 style='display: inline' id='a-language-that-compiles-to-bash'>A language that compiles to <span class='inlinecode'>bash</span></h3><br /> <br /> <span>I had an idea to implement a higher-level language with strong typing that could be compiled into native Bash code. This would make all resulting Bash scripts more robust and secure by default. The project would involve developing a parser, lexer, and a Bash code generator. I planned to implement this in Go.</span><br /> <br /> @@ -1293,11 +3765,11 @@ Projects I currently don't have time for <br /> <a class='textlink' href='./2010-05-09-the-fype-programming-language.html'>The Fype Programming Language</a><br /> <br /> -<h3 style='display: inline' id='Alanguagethatcompilestosed'>A language that compiles to <span class='inlinecode'>sed</span></h3><br /> +<h3 style='display: inline' id='a-language-that-compiles-to-sed'>A language that compiles to <span class='inlinecode'>sed</span></h3><br /> <br /> <span>This is similar to the previous idea, but the difference is that the language would compile into a sed script. Sed has many features, but the brief syntax makes scripts challenging to read. The higher-level language would mimic sed but in a form that is easier for humans to read.</span><br /> <br /> -<h3 style='display: inline' id='RenovateVSSim'>Renovate VS-Sim</h3><br /> +<h3 style='display: inline' id='renovate-vs-sim'>Renovate VS-Sim</h3><br /> <br /> <span>VS-Sim is an open-source simulator programmed in Java for distributed systems. VS-Sim stands for "Verteilte Systeme Simulator," the German translation for "Distributed Systems Simulator." The VS-Sim project was my diploma thesis at Aachen University of Applied Sciences.</span><br /> <br /> @@ -1313,13 +3785,13 @@ Projects I currently don't have time for </ul><br /> <span>I have put this project on hold for now, as I want to do more things in Go and fewer in Java in my personal time.</span><br /> <br /> -<h3 style='display: inline' id='KISSticketingsystem'>KISS ticketing system</h3><br /> +<h3 style='display: inline' id='kiss-ticketing-system'>KISS ticketing system</h3><br /> <br /> <span>My idea was to program a KISS (Keep It Simple, Stupid) ticketing system for my personal use. However, I am abandoning this project because I now use the excellent Taskwarrior software. You can learn more about it at:</span><br /> <br /> <a class='textlink' href='https://taskwarrior.org/'>https://taskwarrior.org/</a><br /> <br /> -<h3 style='display: inline' id='AdomainspecificlanguageDSLforwork'>A domain-specific language (DSL) for work</h3><br /> +<h3 style='display: inline' id='a-domain-specific-language-dsl-for-work'>A domain-specific language (DSL) for work</h3><br /> <br /> <span>At work, an internal service allocates storage space for our customers on our storage clusters. It automates many tasks, but many tweaks are accessible through APIs. I had the idea to implement a Ruby-based DSL that would make using all those APIs for ad-hoc changes effortless, e.g.:</span><br /> <br /> @@ -1327,31 +3799,31 @@ Projects I currently don't have time for by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">Cluster </font><font color="#F3E651">:</font><font color="#ff0000">UK</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#F3E651">:</font><font color="#ff0000">uk01 </font><b><font color="#ffffff">do</font></b> -<font color="#ff0000"> Customer</font><font color="#F3E651">.</font><font color="#ff0000">C1A1</font><font color="#F3E651">.</font><font color="#ff0000">segments</font><font color="#F3E651">.</font><font color="#ff0000">volumes</font><font color="#F3E651">.</font><font color="#ff0000">each </font><b><font color="#ffffff">do</font></b><font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000">volume</font><font color="#F3E651">|</font> -<font color="#ff0000"> puts volume</font><font color="#F3E651">.</font><font color="#ff0000">usage_stats</font> -<font color="#ff0000"> volume</font><font color="#F3E651">.</font><font color="#ff0000">move_off! </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> volume</font><font color="#F3E651">.</font><font color="#ff0000">over_subscribed?</font> -<font color="#ff0000"> </font><b><font color="#ffffff">end</font></b> -<b><font color="#ffffff">end</font></b> +<pre>Cluster :UK, :uk01 <b><u><font color="#000000">do</font></u></b> + Customer.C1A1.segments.volumes.each <b><u><font color="#000000">do</font></u></b> |volume| + puts volume.usage_stats + volume.move_off! <b><u><font color="#000000">if</font></u></b> volume.over_subscribed? + <b><u><font color="#000000">end</font></u></b> +<b><u><font color="#000000">end</font></u></b> </pre> <br /> <span>I am abandoning this project because my workplace has stopped the annual pet project competition, and I have other more important projects to work on at the moment.</span><br /> <br /> <a class='textlink' href='./2022-04-10-creative-universe.html'>Creative universe (Work pet project contests)</a><br /> <br /> -<h2 style='display: inline' id='SelfhostingprojectsIdonthavetimefor'>Self-hosting projects I don't have time for</h2><br /> +<h2 style='display: inline' id='self-hosting-projects-i-don-t-have-time-for'>Self-hosting projects I don't have time for</h2><br /> <br /> -<h3 style='display: inline' id='MyownMatrixserver'>My own Matrix server</h3><br /> +<h3 style='display: inline' id='my-own-matrix-server'>My own Matrix server</h3><br /> <br /> <span>I value privacy. It would be great to run my own Matrix server for communication within my family. I have yet to have time to look into this more closely.</span><br /> <br /> <a class='textlink' href='https://matrix.org'>https://matrix.org</a><br /> <br /> -<h3 style='display: inline' id='Ampachemusicserver'>Ampache music server</h3><br /> +<h3 style='display: inline' id='ampache-music-server'>Ampache music server</h3><br /> <br /> <span>Ampache is an open-source music streaming server that allows you to host and manage your music collection online, accessible via a web interface. Setting it up involves configuring a web server, installing Ampache, and organising your music files, which can be time-consuming. </span><br /> <br /> -<h3 style='display: inline' id='LibrumeBookreader'>Librum eBook reader</h3><br /> +<h3 style='display: inline' id='librum-ebook-reader'>Librum eBook reader</h3><br /> <br /> <span>Librum is a self-hostable e-book reader that allows users to manage and read their e-book collection from a web interface. Designed to be a self-contained platform where users can upload, organise, and access their e-books, Librum emphasises privacy and control over one's digital library.</span><br /> <br /> @@ -1359,7 +3831,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>I am using my Kobo devices or my laptop to read these kinds of things for now.</span><br /> <br /> -<h3 style='display: inline' id='MemosNotetakingservice'>Memos - Note-taking service</h3><br /> +<h3 style='display: inline' id='memos---note-taking-service'>Memos - Note-taking service</h3><br /> <br /> <span>Memos is a note-taking service that simplifies and streamlines information capture and organisation. It focuses on providing users with a minimalistic and intuitive interface, aiming to enhance productivity without the clutter commonly associated with more complex note-taking apps.</span><br /> <br /> @@ -1367,27 +3839,27 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>I am abandoning this idea for now, as I am currently using plain Markdown files for notes and syncing them with Syncthing across my devices.</span><br /> <br /> -<h3 style='display: inline' id='Bepastyserver'>Bepasty server</h3><br /> +<h3 style='display: inline' id='bepasty-server'>Bepasty server</h3><br /> <br /> <span>Bepasty is like a Pastebin for all kinds of files (text, image, audio, video, documents, binary, etc.). It seems very neat, but I only share a little nowadays. When I do, I upload files via SCP to one of my OpenBSD VMs and serve them via vanilla httpd there, keeping it KISS.</span><br /> <br /> <a class='textlink' href='https://github.com/bepasty/bepasty-server'>https://github.com/bepasty/bepasty-server</a><br /> <br /> -<h2 style='display: inline' id='BooksIdonthavetimetoread'>Books I don't have time to read</h2><br /> +<h2 style='display: inline' id='books-i-don-t-have-time-to-read'>Books I don't have time to read</h2><br /> <br /> -<h3 style='display: inline' id='FluentPython'>Fluent Python</h3><br /> +<h3 style='display: inline' id='fluent-python'>Fluent Python</h3><br /> <br /> <span>I consider myself an advanced programmer in Ruby, Bash, and Perl. However, Python seems to be ubiquitous nowadays, and most of my colleagues prefer Python over any other languages. Thus, it makes sense for me to also learn and use Python. After conducting some research, "Fluent Python" appears to be the best book for this purpose.</span><br /> <br /> <span>I don't have time to read this book at the moment, as I am focusing more on Go (Golang) and I know just enough Python to get by (e.g., for code reviews). Additionally, there are still enough colleagues around who can review my Ruby or Bash code.</span><br /> <br /> -<h3 style='display: inline' id='ProgrammingRuby'>Programming Ruby</h3><br /> +<h3 style='display: inline' id='programming-ruby'>Programming Ruby</h3><br /> <br /> <span>I've read a couple of Ruby books already, but "Programming Ruby," which covers up to Ruby 3.2, was just recently released. I would like to read this to deepen my Ruby knowledge further and to revisit some concepts that I may have forgotten.</span><br /> <br /> <span>As stated in this blog post, I am currently more eager to focus on Go, so I've put the Ruby book on hold. Additionally, there wouldn't be enough colleagues who could "understand" my advanced Ruby skills anyway, as most of them are either Java developers or SREs who don't code a lot.</span><br /> <br /> -<h3 style='display: inline' id='PeterFHamiltonsciencefictionbooks'>Peter F. Hamilton science fiction books</h3><br /> +<h3 style='display: inline' id='peter-f-hamilton-science-fiction-books'>Peter F. Hamilton science fiction books</h3><br /> <br /> <span>I am a big fan of science fiction, but my reading list is currently too long anyway. So, I've put the Hamilton books on the back burner for now. You can see all the novels I've read here:</span><br /> <br /> @@ -1395,9 +3867,9 @@ http://www.gnu.org/software/src-highlite --> <a class='textlink' href='gemini://paul.buetow.org/novels.gmi'>gemini://paul.buetow.org/novels.gmi</a><br /> <br /> <br /> -<h2 style='display: inline' id='NewwebsitesIdonthavetimefor'>New websites I don't have time for</h2><br /> +<h2 style='display: inline' id='new-websites-i-don-t-have-time-for'>New websites I don't have time for</h2><br /> <br /> -<h3 style='display: inline' id='CreateaWhyRakuRoxsite'>Create a "Why Raku Rox" site</h3><br /> +<h3 style='display: inline' id='create-a-why-raku-rox-site'>Create a "Why Raku Rox" site</h3><br /> <br /> <span>The website "Why Raku Rox" would showcase the unique features and benefits of the Raku programming language and highlight why it is an exceptional choice for developers. Raku, originally known as Perl 6, is a dynamic, expressive language designed for flexible and powerful software development.</span><br /> <br /> @@ -1408,9 +3880,9 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>I am not working on this for now, as I currently don’t even have time to program in Raku.</span><br /> <br /> -<h2 style='display: inline' id='ResearchprojectsIdonthavetimefor'>Research projects I don't have time for</h2><br /> +<h2 style='display: inline' id='research-projects-i-don-t-have-time-for'>Research projects I don't have time for</h2><br /> <br /> -<h3 style='display: inline' id='Projectsecure'>Project secure</h3><br /> +<h3 style='display: inline' id='project-secure'>Project secure</h3><br /> <br /> <span>For work: Implement a PoC that dumps Java heaps to extract secrets from memory. Based on the findings, write a Java program that encrypts secrets in the kernel using the <span class='inlinecode'>memfd_secret()</span> syscall to make it even more secure.</span><br /> <br /> @@ -1418,7 +3890,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Due to other priorities, I am putting this on hold for now. The software we have built is pretty damn secure already!</span><br /> <br /> -<h3 style='display: inline' id='CPUutilisationisallwrong'>CPU utilisation is all wrong</h3><br /> +<h3 style='display: inline' id='cpu-utilisation-is-all-wrong'>CPU utilisation is all wrong</h3><br /> <br /> <span>This research project, based on Brendan Gregg's blog post, could potentially significantly impact my work.</span><br /> <br /> @@ -1448,7 +3920,7 @@ http://www.gnu.org/software/src-highlite --> <summary>These are my personal takeaways after reading 'Slow Productivity - The lost Art of Accomplishment Without Burnout' by Cal Newport.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='SlowProductivitybooknotes'>"Slow Productivity" book notes</h1><br /> + <h1 style='display: inline' id='slow-productivity-book-notes'>"Slow Productivity" book notes</h1><br /> <br /> <span class='quote'>Published at 2024-04-27T14:18:51+03:00</span><br /> <br /> @@ -1470,9 +3942,22 @@ http://www.gnu.org/software/src-highlite --> ''' </pre> <br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#slow-productivity-book-notes'>"Slow Productivity" book notes</a></li> +<li>⇢ <a href='#it-s-not-slow-productivity'>It's not "slow productivity"</a></li> +<li>⇢ <a href='#pseudo-productivity-and-shallow-work'>Pseudo-productivity and Shallow work</a></li> +<li>⇢ <a href='#accomplishments-without-burnout'>Accomplishments without burnout</a></li> +<li>⇢ <a href='#do-fewer-things'>Do fewer things</a></li> +<li>⇢ <a href='#work-at-a-natural-pace'>Work at a natural pace</a></li> +<li>⇢ <a href='#obsess-over-quality-'>Obsess over quality </a></li> +</ul><br /> +<h2 style='display: inline' id='it-s-not-slow-productivity'>It's not "slow productivity"</h2><br /> +<br /> <span>"Slow productivity" does not mean being less productive. Cal Newport wants to point out that you can be much more productive with "slow productivity" than you would be without it. It is a different way of working than most of us are used to in the modern workplace, which is hyper-connected and always online.</span><br /> <br /> -<h2 style='display: inline' id='PseudoproductivityandShallowwork'>Pseudo-productivity and Shallow work</h2><br /> +<h2 style='display: inline' id='pseudo-productivity-and-shallow-work'>Pseudo-productivity and Shallow work</h2><br /> <br /> <span>People use visible activity instead of real productivity because it's easier to measure. This is called pseudo-productivity.</span><br /> <span>Pseudo-productivity is used as a proxy for real productivity. If you don't look busy, you are dismissed as lazy or lacking a work ethic.</span><br /> @@ -1481,7 +3966,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Shallow work usually doesn't help you to accomplish big things. Always have the big picture in mind. Shallow work can't be entirely eliminated, but it can be managed—for example, plan dedicated time slots for certain types of shallow work.</span><br /> <br /> -<h2 style='display: inline' id='Accomplishmentswithoutburnout'>Accomplishments without burnout</h2><br /> +<h2 style='display: inline' id='accomplishments-without-burnout'>Accomplishments without burnout</h2><br /> <br /> <span>The overall perception is that if you want to accomplish something, you must put yourself on the verge of burnout. Cal Newport writes about "The lost Art of Accomplishments without Burnouts", where you can accomplish big things without all the stress usually involved.</span><br /> <br /> @@ -1492,7 +3977,7 @@ http://www.gnu.org/software/src-highlite --> <li>Work at a natural pace</li> <li>Obsess over quality</li> </ul><br /> -<h2 style='display: inline' id='Dofewerthings'>Do fewer things</h2><br /> +<h2 style='display: inline' id='do-fewer-things'>Do fewer things</h2><br /> <br /> <span>There will always be more work. The faster you finish it, the quicker you will have something new on your plate.</span><br /> <br /> @@ -1526,7 +4011,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Put tasks on autopilot (regular recurring tasks).</span><br /> <br /> -<h2 style='display: inline' id='Workatanaturalpace'>Work at a natural pace</h2><br /> +<h2 style='display: inline' id='work-at-a-natural-pace'>Work at a natural pace</h2><br /> <br /> <span>We suffer from overambitious timelines, task lists, and business. Focus on what matters. Don't rush your most important work to achieve better results.</span><br /> <br /> @@ -1542,7 +4027,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Schedule slow seasons (e.g., when on vacation). Disconnect in the slow season. Doing nothing will not satisfy your mind, though. You could read a book on your subject matter to counteract that.</span><br /> <br /> -<h2 style='display: inline' id='Obsessoverquality'>Obsess over quality </h2><br /> +<h2 style='display: inline' id='obsess-over-quality-'>Obsess over quality </h2><br /> <br /> <span>Obsess over quality even if you lose short-term opportunities by rejecting other projects. Quality demands you slow down. The two previous two principles (do fewer things and work at a natural pace) are mandatory for this principle to work:</span><br /> <br /> @@ -1581,15 +4066,15 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other book notes of mine are:</span><br /> <br /> -<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> -<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> -<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> -<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> -<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> -<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-10-24-staff-engineer-book-notes.html'>2024-10-24 "Staff Engineer" book notes</a><br /> <a class='textlink' href='./2024-07-07-the-stoic-challenge-book-notes.html'>2024-07-07 "The Stoic Challenge" book notes</a><br /> +<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> +<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> +<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> +<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> <br /> -<a class='textlink' href='../resources.html'>More books and other resources I found useful.</a><br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> @@ -1603,13 +4088,21 @@ http://www.gnu.org/software/src-highlite --> <name>Paul Buetow aka snonux</name> <email>paul@dev.buetow.org</email> </author> - <summary>Art by Michael J. Penick (mod. by Paul B.)</summary> + <summary>I have always wanted a highly available setup for my personal websites. I could have used off-the-shelf hosting solutions or hosted my sites in an AWS S3 bucket. I have used technologies like (in unsorted and slightly unrelated order) BGP, LVS/IPVS, ldirectord, Pacemaker, STONITH, scripted VIP failover via ARP, heartbeat, heartbeat2, Corosync, keepalived, DRBD, and commercial F5 Load Balancers for high availability at work. </summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='KISShighavailabilitywithOpenBSD'>KISS high-availability with OpenBSD</h1><br /> + <h1 style='display: inline' id='kiss-high-availability-with-openbsd'>KISS high-availability with OpenBSD</h1><br /> <br /> <span class='quote'>Published at 2024-03-30T22:12:56+02:00</span><br /> <br /> +<span>I have always wanted a highly available setup for my personal websites. I could have used off-the-shelf hosting solutions or hosted my sites in an AWS S3 bucket. I have used technologies like (in unsorted and slightly unrelated order) BGP, LVS/IPVS, ldirectord, Pacemaker, STONITH, scripted VIP failover via ARP, heartbeat, heartbeat2, Corosync, keepalived, DRBD, and commercial F5 Load Balancers for high availability at work. </span><br /> +<br /> +<span>But still, my personal sites were never highly available. All those technologies are great for professional use, but I was looking for something much more straightforward for my personal space - something as KISS (keep it simple and stupid) as possible.</span><br /> +<br /> +<span>It would be fine if my personal website wasn't highly available, but the geek in me wants it anyway.</span><br /> +<br /> +<span class='quote'>PS: ASCII-art below reflects an OpenBSD under-water world with all the tools available in the base system.</span><br /> +<br /> <pre> Art by Michael J. Penick (mod. by Paul B.) ACME-sky @@ -1635,32 +4128,22 @@ _____|_:_:_| (o)-(o) |_:_:_|--'`-. ,--. ksh under-water (((\'/ </pre> <br /> -<pre> -Table of contents -================= - -KISS high-availability with OpenBSD - My auto-failover requirements - My HA solution - Only OpenBSD base installation required - Fairly cheap and geo-redundant - Failover time and split-brain - Failover support for multiple protocols - Let's encrypt TLS certificates - Monitoring - Rex automation - More HA -</pre> -<br /> -<span>I have always wanted a highly available setup for my personal websites. I could have used off-the-shelf hosting solutions or hosted my sites in an AWS S3 bucket. I have used technologies like (in unsorted and slightly unrelated order) BGP, LVS/IPVS, ldirectord, Pacemaker, STONITH, scripted VIP failover via ARP, heartbeat, heartbeat2, Corosync, keepalived, DRBD, and commercial F5 Load Balancers for high availability at work. </span><br /> -<br /> -<span>But still, my personal sites were never highly available. All those technologies are great for professional use, but I was looking for something much more straightforward for my personal space - something as KISS (keep it simple and stupid) as possible.</span><br /> -<br /> -<span>It would be fine if my personal website wasn't highly available, but the geek in me wants it anyway.</span><br /> -<br /> -<span class='quote'>PS: ASCII-art reflects an OpenBSD under-water world with all the tools available in the base system.</span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline' id='Myautofailoverrequirements'>My auto-failover requirements</h2><br /> +<ul> +<li><a href='#kiss-high-availability-with-openbsd'>KISS high-availability with OpenBSD</a></li> +<li>⇢ <a href='#my-auto-failover-requirements'>My auto-failover requirements</a></li> +<li>⇢ <a href='#my-ha-solution'>My HA solution</a></li> +<li>⇢ ⇢ <a href='#only-openbsd-base-installation-required'>Only OpenBSD base installation required</a></li> +<li>⇢ ⇢ <a href='#fairly-cheap-and-geo-redundant'>Fairly cheap and geo-redundant</a></li> +<li>⇢ ⇢ <a href='#failover-time-and-split-brain'>Failover time and split-brain</a></li> +<li>⇢ ⇢ <a href='#failover-support-for-multiple-protocols'>Failover support for multiple protocols</a></li> +<li>⇢ ⇢ <a href='#let-s-encrypt-tls-certificates'>Let's encrypt TLS certificates</a></li> +<li>⇢ ⇢ <a href='#monitoring'>Monitoring</a></li> +<li>⇢ ⇢ <a href='#rex-automation'>Rex automation</a></li> +<li>⇢ <a href='#more-ha'>More HA</a></li> +</ul><br /> +<h2 style='display: inline' id='my-auto-failover-requirements'>My auto-failover requirements</h2><br /> <br /> <ul> <li>Be OpenBSD-based (I prefer OpenBSD because of the cleanliness and good documentation) and rely on as few external packages as possible. </li> @@ -1673,9 +4156,9 @@ KISS high-availability with OpenBSD <li>Have good monitoring in place so I know when a failover was performed and when something went wrong with the failover.</li> <li>Don't configure everything manually. The configuration should be automated and reproducible.</li> </ul><br /> -<h2 style='display: inline' id='MyHAsolution'>My HA solution</h2><br /> +<h2 style='display: inline' id='my-ha-solution'>My HA solution</h2><br /> <br /> -<h3 style='display: inline' id='OnlyOpenBSDbaseinstallationrequired'>Only OpenBSD base installation required</h3><br /> +<h3 style='display: inline' id='only-openbsd-base-installation-required'>Only OpenBSD base installation required</h3><br /> <br /> <span>My HA solution for Web and Gemini is based on DNS (OpenBSD's <span class='inlinecode'>nsd</span>) and a simple shell script (OpenBSD's <span class='inlinecode'>ksh</span> and some little <span class='inlinecode'>sed</span> and <span class='inlinecode'>awk</span> and <span class='inlinecode'>grep</span>). All software used here is part of the OpenBSD base system and no external package needs to be installed - OpenBSD is a complete operating system.</span><br /> <br /> @@ -1695,38 +4178,38 @@ KISS high-availability with OpenBSD by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/bin/ksh</font></i> - -<font color="#ff0000">ZONES_DIR</font><font color="#F3E651">=</font><font color="#ff0000">/var/nsd/zones/master</font><font color="#F3E651">/</font> -<font color="#ff0000">DEFAULT_MASTER</font><font color="#F3E651">=</font><font color="#ff0000">fishfinger</font><font color="#F3E651">.</font><font color="#ff0000">buetow</font><font color="#F3E651">.</font><font color="#ff0000">org</font> -<font color="#ff0000">DEFAULT_STANDBY</font><font color="#F3E651">=</font><font color="#ff0000">blowfish</font><font color="#F3E651">.</font><font color="#ff0000">buetow</font><font color="#F3E651">.</font><font color="#ff0000">org</font> - -<font color="#7bc710">determine_master_and_standby ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> </font><font color="#ff0000">master</font><font color="#F3E651">=</font><font color="#ff0000">$DEFAULT_MASTER</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> </font><font color="#ff0000">standby</font><font color="#F3E651">=</font><font color="#ff0000">$DEFAULT_STANDBY</font> - -<font color="#ff0000"> </font><font color="#F3E651">.</font> -<font color="#ff0000"> </font><font color="#F3E651">.</font> -<font color="#ff0000"> </font><font color="#F3E651">.</font> -<font color="#ff0000"> </font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -i </font><font color="#ff0000">health_ok</font><font color="#F3E651">=</font><font color="#bb00ff">1</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">!</font><font color="#ff0000"> ftp -</font><font color="#bb00ff">4</font><font color="#ff0000"> -o - https</font><font color="#F3E651">://</font><font color="#ff0000">$master</font><font color="#ff0000">/index</font><font color="#F3E651">.</font><font color="#ff0000">txt </font><font color="#F3E651">|</font><font color="#ff0000"> grep -q </font><font color="#bb00ff">"Welcome to $master"</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> echo </font><font color="#bb00ff">"https://$master/index.txt IPv4 health check failed"</font> -<font color="#ff0000"> </font><font color="#ff0000">health_ok</font><font color="#F3E651">=</font><font color="#bb00ff">0</font> -<font color="#ff0000"> </font><b><font color="#ffffff">elif</font></b><font color="#ff0000"> </font><font color="#F3E651">!</font><font color="#ff0000"> ftp -</font><font color="#bb00ff">6</font><font color="#ff0000"> -o - https</font><font color="#F3E651">://</font><font color="#ff0000">$master</font><font color="#ff0000">/index</font><font color="#F3E651">.</font><font color="#ff0000">txt </font><font color="#F3E651">|</font><font color="#ff0000"> grep -q </font><font color="#bb00ff">"Welcome to $master"</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> echo </font><font color="#bb00ff">"https://$master/index.txt IPv6 health check failed"</font> -<font color="#ff0000"> </font><font color="#ff0000">health_ok</font><font color="#F3E651">=</font><font color="#bb00ff">0</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#ff0000">$health_ok</font><font color="#ff0000"> -eq </font><font color="#bb00ff">0</font><font color="#ff0000"> </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> </font><font color="#ff0000">tmp</font><font color="#F3E651">=</font><font color="#ff0000">$master</font> -<font color="#ff0000"> </font><font color="#ff0000">master</font><font color="#F3E651">=</font><font color="#ff0000">$standby</font> -<font color="#ff0000"> </font><font color="#ff0000">standby</font><font color="#F3E651">=</font><font color="#ff0000">$tmp</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> - -<font color="#ff0000"> </font><font color="#F3E651">.</font> -<font color="#ff0000"> </font><font color="#F3E651">.</font> -<font color="#ff0000"> </font><font color="#F3E651">.</font> -<font color="#ff0000">}</font> +<pre><i><font color="silver">#!/bin/ksh</font></i> + +ZONES_DIR=/var/nsd/zones/master/ +DEFAULT_MASTER=fishfinger.buetow.org +DEFAULT_STANDBY=blowfish.buetow.org + +determine_master_and_standby () { + <b><u><font color="#000000">local</font></u></b> master=$DEFAULT_MASTER + <b><u><font color="#000000">local</font></u></b> standby=$DEFAULT_STANDBY + + . + . + . + + <b><u><font color="#000000">local</font></u></b> -i health_ok=<font color="#000000">1</font> + <b><u><font color="#000000">if</font></u></b> ! ftp -<font color="#000000">4</font> -o - https://$master/index.txt | grep -q <font color="#808080">"Welcome to $master"</font>; <b><u><font color="#000000">then</font></u></b> + echo <font color="#808080">"https://$master/index.txt IPv4 health check failed"</font> + health_ok=<font color="#000000">0</font> + <b><u><font color="#000000">elif</font></u></b> ! ftp -<font color="#000000">6</font> -o - https://$master/index.txt | grep -q <font color="#808080">"Welcome to $master"</font>; <b><u><font color="#000000">then</font></u></b> + echo <font color="#808080">"https://$master/index.txt IPv6 health check failed"</font> + health_ok=<font color="#000000">0</font> + <b><u><font color="#000000">fi</font></u></b> + <b><u><font color="#000000">if</font></u></b> [ $health_ok -eq <font color="#000000">0</font> ]; <b><u><font color="#000000">then</font></u></b> + <b><u><font color="#000000">local</font></u></b> tmp=$master + master=$standby + standby=$tmp + <b><u><font color="#000000">fi</font></u></b> + + . + . + . +} </pre> <br /> <span>The failover scripts looks for the <span class='inlinecode'> ; Enable failover</span> string in the DNS zone files and swaps the <span class='inlinecode'>A</span> and <span class='inlinecode'>AAAA</span> records of the DNS entries accordingly:</span><br /> @@ -1735,42 +4218,42 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">fishfinger$ grep failover /var/nsd/zones/master/foo</font><font color="#F3E651">.</font><font color="#ff0000">zone</font><font color="#F3E651">.</font><font color="#ff0000">zone</font> -<font color="#ff0000"> </font><font color="#bb00ff">300</font><font color="#ff0000"> IN A </font><font color="#bb00ff">46.23</font><font color="#F3E651">.</font><font color="#bb00ff">94.99</font><font color="#ff0000"> </font><font color="#F3E651">;</font><font color="#ff0000"> Enable failover</font> -<font color="#ff0000"> </font><font color="#bb00ff">300</font><font color="#ff0000"> IN AAAA 2a03</font><font color="#F3E651">:</font><font color="#bb00ff">6000</font><font color="#F3E651">:</font><font color="#ff0000">6f67</font><font color="#F3E651">:</font><font color="#bb00ff">624</font><font color="#F3E651">::</font><font color="#bb00ff">99</font><font color="#ff0000"> </font><font color="#F3E651">;</font><font color="#ff0000"> Enable failover</font> -<font color="#ff0000">www </font><font color="#bb00ff">300</font><font color="#ff0000"> IN A </font><font color="#bb00ff">46.23</font><font color="#F3E651">.</font><font color="#bb00ff">94.99</font><font color="#ff0000"> </font><font color="#F3E651">;</font><font color="#ff0000"> Enable failover</font> -<font color="#ff0000">www </font><font color="#bb00ff">300</font><font color="#ff0000"> IN AAAA 2a03</font><font color="#F3E651">:</font><font color="#bb00ff">6000</font><font color="#F3E651">:</font><font color="#ff0000">6f67</font><font color="#F3E651">:</font><font color="#bb00ff">624</font><font color="#F3E651">::</font><font color="#bb00ff">99</font><font color="#ff0000"> </font><font color="#F3E651">;</font><font color="#ff0000"> Enable failover</font> -<font color="#ff0000">standby </font><font color="#bb00ff">300</font><font color="#ff0000"> IN A </font><font color="#bb00ff">23.88</font><font color="#F3E651">.</font><font color="#bb00ff">35.144</font><font color="#ff0000"> </font><font color="#F3E651">;</font><font color="#ff0000"> Enable failover</font> -<font color="#ff0000">standby </font><font color="#bb00ff">300</font><font color="#ff0000"> IN AAAA 2a01</font><font color="#F3E651">:</font><font color="#ff0000">4f8</font><font color="#F3E651">:</font><font color="#ff0000">c17</font><font color="#F3E651">:</font><font color="#ff0000">20f1</font><font color="#F3E651">::</font><font color="#bb00ff">42</font><font color="#ff0000"> </font><font color="#F3E651">;</font><font color="#ff0000"> Enable failover</font> +<pre>fishfinger$ grep failover /var/nsd/zones/master/foo.zone.zone + <font color="#000000">300</font> IN A <font color="#000000">46.23</font>.<font color="#000000">94.99</font> ; Enable failover + <font color="#000000">300</font> IN AAAA 2a03:<font color="#000000">6000</font>:6f67:<font color="#000000">624</font>::<font color="#000000">99</font> ; Enable failover +www <font color="#000000">300</font> IN A <font color="#000000">46.23</font>.<font color="#000000">94.99</font> ; Enable failover +www <font color="#000000">300</font> IN AAAA 2a03:<font color="#000000">6000</font>:6f67:<font color="#000000">624</font>::<font color="#000000">99</font> ; Enable failover +standby <font color="#000000">300</font> IN A <font color="#000000">23.88</font>.<font color="#000000">35.144</font> ; Enable failover +standby <font color="#000000">300</font> IN AAAA 2a01:4f8:c17:20f1::<font color="#000000">42</font> ; Enable failover </pre> <br /> <!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#7bc710">transform ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> sed -E </font><font color="#bb00ff">'</font> -<font color="#bb00ff"> /IN A .*; Enable failover/ {</font> -<font color="#bb00ff"> /^standby/! {</font> -<font color="#bb00ff"> s/^(.*) 300 IN A (.*) ; (.*)/</font><font color="#ffffff">\1</font><font color="#bb00ff"> 300 IN A '</font><font color="#ff0000">$(</font><font color="#ff0000">cat /var/nsd/run/master_a</font><font color="#F3E651">)</font><font color="#bb00ff">' ; </font><font color="#ffffff">\3</font><font color="#bb00ff">/;</font> -<font color="#bb00ff"> }</font> -<font color="#bb00ff"> /^standby/ {</font> -<font color="#bb00ff"> s/^(.*) 300 IN A (.*) ; (.*)/</font><font color="#ffffff">\1</font><font color="#bb00ff"> 300 IN A '</font><font color="#ff0000">$(</font><font color="#ff0000">cat /var/nsd/run/standby_a</font><font color="#F3E651">)</font><font color="#bb00ff">' ; </font><font color="#ffffff">\3</font><font color="#bb00ff">/;</font> -<font color="#bb00ff"> }</font> -<font color="#bb00ff"> }</font> -<font color="#bb00ff"> /IN AAAA .*; Enable failover/ {</font> -<font color="#bb00ff"> /^standby/! {</font> -<font color="#bb00ff"> s/^(.*) 300 IN AAAA (.*) ; (.*)/</font><font color="#ffffff">\1</font><font color="#bb00ff"> 300 IN AAAA '</font><font color="#ff0000">$(</font><font color="#ff0000">cat /var/nsd/run/master_aaaa</font><font color="#F3E651">)</font><font color="#bb00ff">' ; </font><font color="#ffffff">\3</font><font color="#bb00ff">/;</font> -<font color="#bb00ff"> }</font> -<font color="#bb00ff"> /^standby/ {</font> -<font color="#bb00ff"> s/^(.*) 300 IN AAAA (.*) ; (.*)/</font><font color="#ffffff">\1</font><font color="#bb00ff"> 300 IN AAAA '</font><font color="#ff0000">$(</font><font color="#ff0000">cat /var/nsd/run/standby_aaaa</font><font color="#F3E651">)</font><font color="#bb00ff">' ; </font><font color="#ffffff">\3</font><font color="#bb00ff">/;</font> -<font color="#bb00ff"> }</font> -<font color="#bb00ff"> }</font> -<font color="#bb00ff"> / ; serial/ {</font> -<font color="#bb00ff"> s/^( +) ([0-9]+) .*; (.*)/</font><font color="#ffffff">\1</font><font color="#bb00ff"> '</font><font color="#ff0000">$(</font><font color="#ff0000">date </font><font color="#F3E651">+%</font><font color="#ff0000">s</font><font color="#F3E651">)</font><font color="#bb00ff">' ; </font><font color="#ffffff">\3</font><font color="#bb00ff">/;</font> -<font color="#bb00ff"> }</font> -<font color="#bb00ff"> '</font> -<font color="#ff0000">}</font> +<pre>transform () { + sed -E <font color="#808080">'</font> +<font color="#808080"> /IN A .*; Enable failover/ {</font> +<font color="#808080"> /^standby/! {</font> +<font color="#808080"> s/^(.*) 300 IN A (.*) ; (.*)/</font>\1<font color="#808080"> 300 IN A '</font>$(cat /var/nsd/run/master_a)<font color="#808080">' ; </font>\3<font color="#808080">/;</font> +<font color="#808080"> }</font> +<font color="#808080"> /^standby/ {</font> +<font color="#808080"> s/^(.*) 300 IN A (.*) ; (.*)/</font>\1<font color="#808080"> 300 IN A '</font>$(cat /var/nsd/run/standby_a)<font color="#808080">' ; </font>\3<font color="#808080">/;</font> +<font color="#808080"> }</font> +<font color="#808080"> }</font> +<font color="#808080"> /IN AAAA .*; Enable failover/ {</font> +<font color="#808080"> /^standby/! {</font> +<font color="#808080"> s/^(.*) 300 IN AAAA (.*) ; (.*)/</font>\1<font color="#808080"> 300 IN AAAA '</font>$(cat /var/nsd/run/master_aaaa)<font color="#808080">' ; </font>\3<font color="#808080">/;</font> +<font color="#808080"> }</font> +<font color="#808080"> /^standby/ {</font> +<font color="#808080"> s/^(.*) 300 IN AAAA (.*) ; (.*)/</font>\1<font color="#808080"> 300 IN AAAA '</font>$(cat /var/nsd/run/standby_aaaa)<font color="#808080">' ; </font>\3<font color="#808080">/;</font> +<font color="#808080"> }</font> +<font color="#808080"> }</font> +<font color="#808080"> / ; serial/ {</font> +<font color="#808080"> s/^( +) ([0-9]+) .*; (.*)/</font>\1<font color="#808080"> '</font>$(date +%s)<font color="#808080">' ; </font>\3<font color="#808080">/;</font> +<font color="#808080"> }</font> +<font color="#808080"> '</font> +} </pre> <br /> <span>After the failover, the script reloads <span class='inlinecode'>nsd</span> and performs a sanity check to see if DNS still works. If not, a rollback will be performed:</span><br /> @@ -1779,48 +4262,48 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#! Race condition !#</font></i> -<font color="#ff0000"> </font> -<b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> -f </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">bak </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> mv </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">bak </font><font color="#ff0000">$zone_file</font> -<b><font color="#ffffff">fi</font></b> - -<font color="#ff0000">cat </font><font color="#ff0000">$zone_file</font><font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> transform </font><font color="#F3E651">></font><font color="#ff0000"> </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">new</font><font color="#F3E651">.</font><font color="#ff0000">tmp </font> - -<font color="#ff0000">grep -v </font><font color="#bb00ff">' ; serial'</font><font color="#ff0000"> </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">new</font><font color="#F3E651">.</font><font color="#ff0000">tmp </font><font color="#F3E651">></font><font color="#ff0000"> </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">new</font><font color="#F3E651">.</font><font color="#ff0000">noserial</font><font color="#F3E651">.</font><font color="#ff0000">tmp</font> -<font color="#ff0000">grep -v </font><font color="#bb00ff">' ; serial'</font><font color="#ff0000"> </font><font color="#ff0000">$zone_file</font><font color="#ff0000"> </font><font color="#F3E651">></font><font color="#ff0000"> </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">old</font><font color="#F3E651">.</font><font color="#ff0000">noserial</font><font color="#F3E651">.</font><font color="#ff0000">tmp</font> - -<font color="#ff0000">echo </font><font color="#bb00ff">"Has zone $zone_file changed?"</font> -<b><font color="#ffffff">if</font></b><font color="#ff0000"> diff -u </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">old</font><font color="#F3E651">.</font><font color="#ff0000">noserial</font><font color="#F3E651">.</font><font color="#ff0000">tmp </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">new</font><font color="#F3E651">.</font><font color="#ff0000">noserial</font><font color="#F3E651">.</font><font color="#ff0000">tmp</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> echo </font><font color="#bb00ff">"The zone $zone_file hasn't changed"</font> -<font color="#ff0000"> rm </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.*.</font><font color="#ff0000">tmp</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> </font><font color="#bb00ff">0</font> -<b><font color="#ffffff">fi</font></b> - -<font color="#ff0000">cp </font><font color="#ff0000">$zone_file</font><font color="#ff0000"> </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">bak</font> -<font color="#ff0000">mv </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">new</font><font color="#F3E651">.</font><font color="#ff0000">tmp </font><font color="#ff0000">$zone_file</font> -<font color="#ff0000">rm </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.*.</font><font color="#ff0000">tmp</font> -<font color="#ff0000">echo </font><font color="#bb00ff">"Reloading nsd"</font> -<font color="#ff0000">nsd-control reload</font> - -<b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">!</font><font color="#ff0000"> zone_is_ok </font><font color="#ff0000">$zone</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> echo </font><font color="#bb00ff">"Rolling back $zone_file changes"</font> -<font color="#ff0000"> cp </font><font color="#ff0000">$zone_file</font><font color="#ff0000"> </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">invalid</font> -<font color="#ff0000"> mv </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">bak </font><font color="#ff0000">$zone_file</font> -<font color="#ff0000"> echo </font><font color="#bb00ff">"Reloading nsd"</font> -<font color="#ff0000"> nsd-control reload</font> -<font color="#ff0000"> zone_is_ok </font><font color="#ff0000">$zone</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> </font><font color="#bb00ff">3</font> -<b><font color="#ffffff">fi</font></b> - -<b><font color="#ffffff">for</font></b><font color="#ff0000"> cleanup </font><b><font color="#ffffff">in</font></b><font color="#ff0000"> invalid bak</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">do</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> -f </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">$cleanup</font><font color="#ff0000"> </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> rm </font><font color="#ff0000">$zone_file</font><font color="#F3E651">.</font><font color="#ff0000">$cleanup</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> -<b><font color="#ffffff">done</font></b> - -<font color="#ff0000">echo </font><font color="#bb00ff">"Failover of zone $zone to $MASTER completed"</font> -<b><font color="#ffffff">return</font></b><font color="#ff0000"> </font><font color="#bb00ff">1</font> +<pre><i><font color="silver">#! Race condition !#</font></i> + +<b><u><font color="#000000">if</font></u></b> [ -f $zone_file.bak ]; <b><u><font color="#000000">then</font></u></b> + mv $zone_file.bak $zone_file +<b><u><font color="#000000">fi</font></u></b> + +cat $zone_file | transform > $zone_file.new.tmp + +grep -v <font color="#808080">' ; serial'</font> $zone_file.new.tmp > $zone_file.new.noserial.tmp +grep -v <font color="#808080">' ; serial'</font> $zone_file > $zone_file.old.noserial.tmp + +echo <font color="#808080">"Has zone $zone_file changed?"</font> +<b><u><font color="#000000">if</font></u></b> diff -u $zone_file.old.noserial.tmp $zone_file.new.noserial.tmp; <b><u><font color="#000000">then</font></u></b> + echo <font color="#808080">"The zone $zone_file hasn't changed"</font> + rm $zone_file.*.tmp + <b><u><font color="#000000">return</font></u></b> <font color="#000000">0</font> +<b><u><font color="#000000">fi</font></u></b> + +cp $zone_file $zone_file.bak +mv $zone_file.new.tmp $zone_file +rm $zone_file.*.tmp +echo <font color="#808080">"Reloading nsd"</font> +nsd-control reload + +<b><u><font color="#000000">if</font></u></b> ! zone_is_ok $zone; <b><u><font color="#000000">then</font></u></b> + echo <font color="#808080">"Rolling back $zone_file changes"</font> + cp $zone_file $zone_file.invalid + mv $zone_file.bak $zone_file + echo <font color="#808080">"Reloading nsd"</font> + nsd-control reload + zone_is_ok $zone + <b><u><font color="#000000">return</font></u></b> <font color="#000000">3</font> +<b><u><font color="#000000">fi</font></u></b> + +<b><u><font color="#000000">for</font></u></b> cleanup <b><u><font color="#000000">in</font></u></b> invalid bak; <b><u><font color="#000000">do</font></u></b> + <b><u><font color="#000000">if</font></u></b> [ -f $zone_file.$cleanup ]; <b><u><font color="#000000">then</font></u></b> + rm $zone_file.$cleanup + <b><u><font color="#000000">fi</font></u></b> +<b><u><font color="#000000">done</font></u></b> + +echo <font color="#808080">"Failover of zone $zone to $MASTER completed"</font> +<b><u><font color="#000000">return</font></u></b> <font color="#000000">1</font> </pre> <br /> <span>A non-zero return code (here, 3 when a rollback and 1 when a DNS failover was performed) will cause CRON to send an E-Mail with the whole script output.</span><br /> @@ -1831,7 +4314,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <a class='textlink' href='https://codeberg.org/snonux/rexfiles/src/branch/master/frontends/scripts/dns-failover.ksh'>dns-failover.ksh</a><br /> <br /> -<h3 style='display: inline' id='Fairlycheapandgeoredundant'>Fairly cheap and geo-redundant</h3><br /> +<h3 style='display: inline' id='fairly-cheap-and-geo-redundant'>Fairly cheap and geo-redundant</h3><br /> <br /> <span>I am renting two small OpenBSD VMs: One at OpenBSD Amsterdam and the other at Hetzner Cloud. So, both VMs are hosted at another provider, in different IP subnets, and in different countries (the Netherlands and Germany).</span><br /> <br /> @@ -1842,13 +4325,13 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>A DNS-based failover is cheap, as there isn't any BGP or fancy load balancer to pay for. Small VMs also cost less than millions.</span><br /> <br /> -<h3 style='display: inline' id='Failovertimeandsplitbrain'>Failover time and split-brain</h3><br /> +<h3 style='display: inline' id='failover-time-and-split-brain'>Failover time and split-brain</h3><br /> <br /> <span>A DNS failover doesn't happen immediately. I've configured a DNS TTL of <span class='inlinecode'>300</span> seconds, and the failover script checks once per minute whether to perform a failover or not. So, in total, a failover can take six minutes (not including other DNS caching servers somewhere in the interweb, but that's fine - eventually, all requests will resolve to the new master after a failover).</span><br /> <br /> <span>A split-brain scenario between the old master and the new master might happen. That's OK, as my sites are static, and there's no database to synchronise other than HTML, CSS, and images when the site is updated.</span><br /> <br /> -<h3 style='display: inline' id='Failoversupportformultipleprotocols'>Failover support for multiple protocols</h3><br /> +<h3 style='display: inline' id='failover-support-for-multiple-protocols'>Failover support for multiple protocols</h3><br /> <br /> <span>With the DNS failover, HTTP, HTTPS, and Gemini protocols are failovered. This works because all domain virtual hosts are configured on either VM's <span class='inlinecode'>httpd</span> (OpenBSD's HTTP server) and <span class='inlinecode'>relayd</span> (it's also part of OpenBSD and I use it to TLS offload the Gemini protocol). So, both VMs accept requests for all the hosts. It's just a matter of the DNS entries, which VM receives the requests.</span><br /> <br /> @@ -1859,7 +4342,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>On DNS failover, master and standby swap roles without config changes other than the DNS entries. That's KISS (keep it simple and stupid)!</span><br /> <br /> -<h3 style='display: inline' id='LetsencryptTLScertificates'>Let's encrypt TLS certificates</h3><br /> +<h3 style='display: inline' id='let-s-encrypt-tls-certificates'>Let's encrypt TLS certificates</h3><br /> <br /> <span>All my hosts use TLS certificates from Let's Encrypt. The ACME automation for requesting and keeping the certificates valid (up to date) requires that the host requesting a certificate from Let's Encrypt is also the host using that certificate.</span><br /> <br /> @@ -1877,13 +4360,13 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab"># Weekly auto-failover for Let's Encrypt automation</font></i> -<b><font color="#ffffff">local</font></b><font color="#ff0000"> -i -r </font><font color="#ff0000">week_of_the_year</font><font color="#F3E651">=</font><font color="#ff0000">$(</font><font color="#ff0000">date </font><font color="#F3E651">+%</font><font color="#ff0000">U</font><font color="#F3E651">)</font> -<b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#ff0000">$(</font><font color="#F3E651">(</font><font color="#ff0000"> week_of_the_year </font><font color="#F3E651">%</font><font color="#ff0000"> </font><font color="#bb00ff">2</font><font color="#ff0000"> </font><font color="#F3E651">))</font><font color="#ff0000"> -eq </font><font color="#bb00ff">0</font><font color="#ff0000"> </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> </font><font color="#ff0000">tmp</font><font color="#F3E651">=</font><font color="#ff0000">$master</font> -<font color="#ff0000"> </font><font color="#ff0000">master</font><font color="#F3E651">=</font><font color="#ff0000">$standby</font> -<font color="#ff0000"> </font><font color="#ff0000">standby</font><font color="#F3E651">=</font><font color="#ff0000">$tmp</font> -<b><font color="#ffffff">fi</font></b> +<pre><i><font color="silver"># Weekly auto-failover for Let's Encrypt automation</font></i> +<b><u><font color="#000000">local</font></u></b> -i -r week_of_the_year=$(date +%U) +<b><u><font color="#000000">if</font></u></b> [ $(( week_of_the_year % <font color="#000000">2</font> )) -eq <font color="#000000">0</font> ]; <b><u><font color="#000000">then</font></u></b> + <b><u><font color="#000000">local</font></u></b> tmp=$master + master=$standby + standby=$tmp +<b><u><font color="#000000">fi</font></u></b> </pre> <br /> <span>This way, a DNS failover is performed weekly so that the ACME automation can update the Let's Encrypt certificates (for master and standby) before they expire on each VM.</span><br /> @@ -1896,7 +4379,7 @@ http://www.gnu.org/software/src-highlite --> <a class='textlink' href='https://man.OpenBSD.org/acme-client.1'>https://man.OpenBSD.org/acme-client.1</a><br /> <a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>Let's Encrypt with OpenBSD and Rex</a><br /> <br /> -<h3 style='display: inline' id='Monitoring'>Monitoring</h3><br /> +<h3 style='display: inline' id='monitoring'>Monitoring</h3><br /> <br /> <span>CRON is sending me an E-Mail whenever a failover is performed (or whenever a failover failed). Furthermore, I am monitoring my DNS servers and hosts through Gogios, the monitoring system I have developed. </span><br /> <br /> @@ -1905,7 +4388,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Gogios, as I developed it by myself, isn't part of the OpenBSD base system. </span><br /> <br /> -<h3 style='display: inline' id='Rexautomation'>Rex automation</h3><br /> +<h3 style='display: inline' id='rex-automation'>Rex automation</h3><br /> <br /> <span>I use Rexify, a friendly configuration management system that allows automatic deployment and configuration.</span><br /> <br /> @@ -1914,7 +4397,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Rex isn't part of the OpenBSD base system, but I didn't need to install any external software on OpenBSD either as Rex is invoked from my Laptop!</span><br /> <br /> -<h2 style='display: inline' id='MoreHA'>More HA</h2><br /> +<h2 style='display: inline' id='more-ha'>More HA</h2><br /> <br /> <span>Other high-available services running on my OpenBSD VMs are my MTAs for mail forwarding (OpenSMTPD - also part of the OpenBSD base system) and the authoritative DNS servers (<span class='inlinecode'>nsd</span>) for all my domains. No particular HA setup is required, though, as the protocols (SMTP and DNS) already take care of the failover to the next available host! </span><br /> <br /> @@ -1928,13 +4411,16 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other *BSD and KISS related posts are:</span><br /> <br /> -<a class='textlink' href='./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html'>2016-04-09 Jails and ZFS with Puppet on FreeBSD</a><br /> -<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>2022-07-30 Let's Encrypt with OpenBSD and Rex</a><br /> -<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> -<a class='textlink' href='./2023-06-01-kiss-server-monitoring-with-gogios.html'>2023-06-01 KISS server monitoring with Gogios</a><br /> -<a class='textlink' href='./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.html'>2023-10-29 KISS static web photo albums with <span class='inlinecode'>photoalbum.sh</span></a><br /> -<a class='textlink' href='./2024-01-13-one-reason-why-i-love-openbsd.html'>2024-01-13 One reason why I love OpenBSD</a><br /> +<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br /> +<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br /> +<a class='textlink' href='./2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</a><br /> <a class='textlink' href='./2024-04-01-KISS-high-availability-with-OpenBSD.html'>2024-04-01 KISS high-availability with OpenBSD (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-01-13-one-reason-why-i-love-openbsd.html'>2024-01-13 One reason why I love OpenBSD</a><br /> +<a class='textlink' href='./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.html'>2023-10-29 KISS static web photo albums with <span class='inlinecode'>photoalbum.sh</span></a><br /> +<a class='textlink' href='./2023-06-01-kiss-server-monitoring-with-gogios.html'>2023-06-01 KISS server monitoring with Gogios</a><br /> +<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> +<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>2022-07-30 Let's Encrypt with OpenBSD and Rex</a><br /> +<a class='textlink' href='./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html'>2016-04-09 Jails and ZFS with Puppet on FreeBSD</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> @@ -1952,7 +4438,7 @@ http://www.gnu.org/software/src-highlite --> <summary>I am an ideas person. I find myself frequently somewhere on the streets with an idea in my head but no paper journal noting it down. </summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='AfineFyneAndroidappforquicklyloggingideasprogrammedinGo'>A fine Fyne Android app for quickly logging ideas programmed in Go</h1><br /> + <h1 style='display: inline' id='a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-go'>A fine Fyne Android app for quickly logging ideas programmed in Go</h1><br /> <br /> <span class='quote'>Published at 2024-03-03T00:07:21+02:00</span><br /> <br /> @@ -1962,6 +4448,15 @@ http://www.gnu.org/software/src-highlite --> <br /> <a href='a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang/logo-small.png'><img alt='Quick logger Logo' title='Quick logger Logo' src='a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang/logo-small.png' /></a><br /> <br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-go'>A fine Fyne Android app for quickly logging ideas programmed in Go</a></li> +<li>⇢ <a href='#enter-quick-logger'>Enter Quick logger</a></li> +<li>⇢ <a href='#all-easy-peasy'>All easy-peasy?</a></li> +</ul><br /> +<h2 style='display: inline' id='enter-quick-logger'>Enter Quick logger</h2><br /> +<br /> <span>Enter Quick logger – a compact GUI Android (well, cross-platform due to Fyne) app I've crafted using Go and the nifty Fyne framework. With Fyne, the app can be compiled easily into an Android APK. As of this writing, this app's whole Go source code is only 75 lines short!! This little tool is designed for spontaneous moments, allowing me to quickly log my thoughts as plain text files on my Android phone. There are no fancy file formats. Just plain text!</span><br /> <br /> <a class='textlink' href='https://codeberg.org/snonux/quicklogger'>https://codeberg.org/snonux/quicklogger</a><br /> @@ -1984,7 +4479,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>My Android apps will never be polished, but they will get the job done, and this is precisely how I want them to be. Minimalistic but functional. I could spend more time polishing Quick logger, but my Quick logger app then may be the same as any other notes app out there (complicated or bloated).</span><br /> <br /> -<h2 style='display: inline' id='Alleasypeasy'>All easy-peasy?</h2><br /> +<h2 style='display: inline' id='all-easy-peasy'>All easy-peasy?</h2><br /> <br /> <span>I did have some issues with the app logo for Android, though. Android always showed the default app icon and not my custom icon whenever I used a custom <span class='inlinecode'>AndroidManifest.xml</span> for custom app storage permissions. Without a custom <span class='inlinecode'>AndroidAmnifest.xml</span> the app icon would be displayed under Android, but then the app would not have the <span class='inlinecode'>MANAGE_EXTERNAL_STORAGE</span> permission, which is required for Quick logger to write to a custom directory. I found a workaround, which I commented on here at Github:</span><br /> <br /> @@ -2000,7 +4495,6 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other Go related posts are:</span><br /> <br /> -<a class='textlink' href='./2023-04-09-algorithms-and-data-structures-in-golang-part-1.html'>2023-04-09 Algorithms and Data Structures in Go - Part 1</a><br /> <a class='textlink' href='./2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.html'>2024-03-03 A fine Fyne Android app for quickly logging ideas programmed in Go (You are currently reading this)</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> @@ -2019,7 +4513,7 @@ http://www.gnu.org/software/src-highlite --> <summary>Recently, my employer sent me to a week-long AWS course. After the course, there wasn't any hands-on project I could dive into immediately, so I moved parts of my personal infrastructure to AWS to level up a bit through practical hands-on.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Frombabylon5buetoworgtobuetowcloud'>From <span class='inlinecode'>babylon5.buetow.org</span> to <span class='inlinecode'>*.buetow.cloud</span></h1><br /> + <h1 style='display: inline' id='from-babylon5buetoworg-to-buetowcloud'>From <span class='inlinecode'>babylon5.buetow.org</span> to <span class='inlinecode'>*.buetow.cloud</span></h1><br /> <br /> <span class='quote'>Published at 2024-02-04T00:50:50+02:00</span><br /> <br /> @@ -2029,7 +4523,25 @@ http://www.gnu.org/software/src-highlite --> <br /> <a href='./from-.org-to-.cloud/old-man-yells-at-cloud.jpg'><img alt='Old man yells at cloud' title='Old man yells at cloud' src='./from-.org-to-.cloud/old-man-yells-at-cloud.jpg' /></a><br /> <br /> -<h2 style='display: inline' id='Theoldbuetoworgway'>The old <span class='inlinecode'>*.buetow.org</span> way</h2><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#from-babylon5buetoworg-to-buetowcloud'>From <span class='inlinecode'>babylon5.buetow.org</span> to <span class='inlinecode'>*.buetow.cloud</span></a></li> +<li>⇢ <a href='#the-old-buetoworg-way'>The old <span class='inlinecode'>*.buetow.org</span> way</a></li> +<li>⇢ <a href='#i-kept-my-buetoworg-openbsd-boxes-alive'>I kept my <span class='inlinecode'>buetow.org</span> OpenBSD boxes alive</a></li> +<li>⇢ <a href='#the-new-buetowcloud-way'>The new <span class='inlinecode'>*.buetow.cloud</span> way</a></li> +<li>⇢ <a href='#the-container-apps'>The container apps</a></li> +<li>⇢ ⇢ <a href='#fluxbuetowcloud'><span class='inlinecode'>flux.buetow.cloud</span></a></li> +<li>⇢ ⇢ <a href='#audiobookshelfbuetowcloud'><span class='inlinecode'>audiobookshelf.buetow.cloud</span></a></li> +<li>⇢ ⇢ <a href='#syncthingbuetowcloud'><span class='inlinecode'>syncthing.buetow.cloud</span></a></li> +<li>⇢ ⇢ <a href='#radicalebuetowcloud'><span class='inlinecode'>radicale.buetow.cloud</span></a></li> +<li>⇢ ⇢ <a href='#bagbuetowcloud'><span class='inlinecode'>bag.buetow.cloud</span></a></li> +<li>⇢ ⇢ <a href='#ankibuetowcloud'><span class='inlinecode'>anki.buetow.cloud</span></a></li> +<li>⇢ ⇢ <a href='#vaultbuetowcloud'><span class='inlinecode'>vault.buetow.cloud</span></a></li> +<li>⇢ ⇢ <a href='#bastionbuetowcloud'><span class='inlinecode'>bastion.buetow.cloud</span></a></li> +<li>⇢ <a href='#conclusion'>Conclusion</a></li> +</ul><br /> +<h2 style='display: inline' id='the-old-buetoworg-way'>The old <span class='inlinecode'>*.buetow.org</span> way</h2><br /> <br /> <span>Before the migration, all those services were reachable through <span class='inlinecode'>buetow.org</span>-subdomains (Buetow is my last name) and ran on Docker containers on a single Rocky Linux 9 VM at Hetzner. And there was a Nginx reverse proxy with TLS offloading (with Let's Encrypt certificates). The Rocky Linux 9's hostname was <span class='inlinecode'>babylon5.buetow.org</span> (based on the Science Fiction series). </span><br /> <br /> @@ -2049,7 +4561,7 @@ http://www.gnu.org/software/src-highlite --> <li>KISS (Keep it Simple Stupid)</li> <li>Cheap</li> </ul><br /> -<h2 style='display: inline' id='IkeptmybuetoworgOpenBSDboxesalive'>I kept my <span class='inlinecode'>buetow.org</span> OpenBSD boxes alive</h2><br /> +<h2 style='display: inline' id='i-kept-my-buetoworg-openbsd-boxes-alive'>I kept my <span class='inlinecode'>buetow.org</span> OpenBSD boxes alive</h2><br /> <br /> <span>As pointed out, I only migrated the Docker-based self-hosted services (which run on the Babylon 5 Rocky Linux box) to AWS. Many self-hostable apps come with ready-to-use container images, making deploying them easy.</span><br /> <br /> @@ -2070,7 +4582,7 @@ http://www.gnu.org/software/src-highlite --> <a class='textlink' href='./2023-06-01-kiss-server-monitoring-with-gogios.html'>KISS server monitoring with Gogios</a><br /> <a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>Let's encrypt with OpenBSD and Rex</a><br /> <br /> -<h2 style='display: inline' id='Thenewbuetowcloudway'>The new <span class='inlinecode'>*.buetow.cloud</span> way</h2><br /> +<h2 style='display: inline' id='the-new-buetowcloud-way'>The new <span class='inlinecode'>*.buetow.cloud</span> way</h2><br /> <br /> <span>With AWS, I decided to get myself a new domain name, as I could fully separate my AWS setup from my conventional setup and give Route 53 as an authoritative DNS a spin.</span><br /> <br /> @@ -2100,7 +4612,7 @@ http://www.gnu.org/software/src-highlite --> <li><span class='inlinecode'>org-buetow-elb</span> sets up the Elastic Load Balancer, a prerequisite for any service running in ECS Fargate.</li> <li><span class='inlinecode'>org-buetow-ecs</span> finally sets up and deploys all the Docker apps mentioned above. Any apps can be turned on or off via the <span class='inlinecode'>variables.tf</span> file.</li> </ul><br /> -<h2 style='display: inline' id='Thecontainerapps'>The container apps</h2><br /> +<h2 style='display: inline' id='the-container-apps'>The container apps</h2><br /> <br /> <span>And here, finally, is the list of all the container apps my Terraform manifests deploy. The FQDNs here may not be reachable. I spin them up only on demand (for cost reasons). All services are fully dual-stacked (IPv4 & IPv6). </span><br /> <br /> @@ -2171,7 +4683,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>This is a tiny ARM-based Amazon Linux EC2 instance, which I sometimes spin up for investigation or manual work on my EFS file system in AWS.</span><br /> <br /> -<h2 style='display: inline' id='Conclusion'>Conclusion</h2><br /> +<h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> <br /> <span>I have learned a lot about AWS and Terraform during this migration. This was actually my first AWS hands-on project with practical use.</span><br /> <br /> @@ -2201,7 +4713,7 @@ http://www.gnu.org/software/src-highlite --> <summary>HKISSFISHKISSFISHKISSFISHKISSFISH KISS</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='OnereasonwhyIloveOpenBSD'>One reason why I love OpenBSD</h1><br /> + <h1 style='display: inline' id='one-reason-why-i-love-openbsd'>One reason why I love OpenBSD</h1><br /> <br /> <span class='quote'>Published at 2024-01-13T22:55:33+02:00</span><br /> <br /> @@ -2229,8 +4741,8 @@ SSFISHKISSFISHKISSFISHKISSFISHKIS SFIS by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">$ doas installboot sd0 </font><i><font color="#ababab"># Update the bootloader (not for every upgrade required)</font></i> -<font color="#ff0000">$ doas sysupgrade </font><i><font color="#ababab"># Update all binaries (including Kernel)</font></i> +<pre>$ doas installboot sd0 <i><font color="silver"># Update the bootloader (not for every upgrade required)</font></i> +$ doas sysupgrade <i><font color="silver"># Update all binaries (including Kernel)</font></i> </pre> <br /> <span><span class='inlinecode'>sysupgrade</span> downloaded and upgraded to the next release and rebooted the system. After the reboot, I run:</span><br /> @@ -2239,9 +4751,9 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">$ doas sysmerge </font><i><font color="#ababab"># Update system configuration files</font></i> -<font color="#ff0000">$ doas pkg_add -u </font><i><font color="#ababab"># Update all packages</font></i> -<font color="#ff0000">$ doas reboot </font><i><font color="#ababab"># Just in case, reboot one more time</font></i> +<pre>$ doas sysmerge <i><font color="silver"># Update system configuration files</font></i> +$ doas pkg_add -u <i><font color="silver"># Update all packages</font></i> +$ doas reboot <i><font color="silver"># Just in case, reboot one more time</font></i> </pre> <br /> <span>That's it! Took me around 5 minutes in total! No issues, only these few comands, only 5 minutes! It just works! No problems, no conflicts, no tons (actually none) config file merge conflicts.</span><br /> @@ -2260,18 +4772,21 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other *BSD related posts are:</span><br /> <br /> -<a class='textlink' href='./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html'>2016-04-09 Jails and ZFS with Puppet on FreeBSD</a><br /> -<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>2022-07-30 Let's Encrypt with OpenBSD and Rex</a><br /> -<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> -<a class='textlink' href='./2024-01-13-one-reason-why-i-love-openbsd.html'>2024-01-13 One reason why I love OpenBSD (You are currently reading this)</a><br /> +<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br /> +<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br /> +<a class='textlink' href='./2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</a><br /> <a class='textlink' href='./2024-04-01-KISS-high-availability-with-OpenBSD.html'>2024-04-01 KISS high-availability with OpenBSD</a><br /> +<a class='textlink' href='./2024-01-13-one-reason-why-i-love-openbsd.html'>2024-01-13 One reason why I love OpenBSD (You are currently reading this)</a><br /> +<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> +<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>2022-07-30 Let's Encrypt with OpenBSD and Rex</a><br /> +<a class='textlink' href='./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html'>2016-04-09 Jails and ZFS with Puppet on FreeBSD</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> </entry> <entry> - <title>Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect</title> + <title>Site Reliability Engineering - Part 3: On-Call Culture</title> <link href="gemini://foo.zone/gemfeed/2024-01-09-site-reliability-engineering-part-3.gmi" /> <id>gemini://foo.zone/gemfeed/2024-01-09-site-reliability-engineering-part-3.gmi</id> <updated>2024-01-09T18:35:48+02:00</updated> @@ -2279,18 +4794,19 @@ http://www.gnu.org/software/src-highlite --> <name>Paul Buetow aka snonux</name> <email>paul@dev.buetow.org</email> </author> - <summary>This is the third part of my Site Reliability Engineering (SRE) series. I am currently employed as a Site Reliability Engineer and will try to share what SRE is about in this blog series.</summary> + <summary>Welcome to Part 3 of my Site Reliability Engineering (SRE) series. I'm currently working as a Site Reliability Engineer, and I’m here to share what SRE is all about in this blog series.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='SiteReliabilityEngineeringPart3OnCallCultureandtheHumanAspect'>Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect</h1><br /> + <h1 style='display: inline' id='site-reliability-engineering---part-3-on-call-culture'>Site Reliability Engineering - Part 3: On-Call Culture</h1><br /> <br /> <span class='quote'>Published at 2024-01-09T18:35:48+02:00</span><br /> <br /> -<span>This is the third part of my Site Reliability Engineering (SRE) series. I am currently employed as a Site Reliability Engineer and will try to share what SRE is about in this blog series.</span><br /> +<span>Welcome to Part 3 of my Site Reliability Engineering (SRE) series. I'm currently working as a Site Reliability Engineer, and I’m here to share what SRE is all about in this blog series.</span><br /> <br /> <a class='textlink' href='./2023-08-18-site-reliability-engineering-part-1.html'>2023-08-18 Site Reliability Engineering - Part 1: SRE and Organizational Culture</a><br /> -<a class='textlink' href='./2023-11-19-site-reliability-engineering-part-2.html'>2023-11-19 Site Reliability Engineering - Part 2: Operational Balance in SRE</a><br /> -<a class='textlink' href='./2024-01-09-site-reliability-engineering-part-3.html'>2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect (You are currently reading this)</a><br /> +<a class='textlink' href='./2023-11-19-site-reliability-engineering-part-2.html'>2023-11-19 Site Reliability Engineering - Part 2: Operational Balance</a><br /> +<a class='textlink' href='./2024-01-09-site-reliability-engineering-part-3.html'>2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-09-07-site-reliability-engineering-part-4.html'>2024-09-07 Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers</a><br /> <br /> <pre> ..--""""----.. @@ -2318,23 +4834,29 @@ http://www.gnu.org/software/src-highlite --> </pre> <br /> -<h2 style='display: inline' id='OnCallCultureandtheHumanAspectPrioritisingWellbeingintheRealmofReliability'>On-Call Culture and the Human Aspect: Prioritising Well-being in the Realm of Reliability</h2><br /> +<h2 style='display: inline' id='putting-well-being-first'>Putting Well-being First</h2><br /> +<br /> +<span>Site Reliability Engineering is all about keeping systems reliable, but we often forget how important the human side is. A healthy on-call culture is just as crucial as any technical fix. The well-being of the engineers really matters.</span><br /> +<br /> +<span>First off, a healthy on-call rotation is about more than just handling incidents. It's about creating a supportive ecosystem. This means cutting down on pain points, offering mentorship, quickly iterating on processes, and making sure engineers have the right tools. But there's a catch—engineers need to be willing to learn. Especially in on-call rotations where SREs work with Software Engineers or QA Engineers, it can be tough to get everyone motivated. QA Engineers want to test, Software Engineers want to build new features; they don’t want to deal with production issues. This can be really frustrating for the SREs trying to mentor them.</span><br /> <br /> -<span>Site Reliability Engineering is synonymous with ensuring system reliability, but the human factor is an often-underestimated part of this discipline. Ensuring an healthy on-call culture is as critical as any technical solution. The well-being of the engineers is an important factor.</span><br /> +<span>Plus, measuring a good on-call experience isn't always clear-cut. You might think fewer pages mean a better on-call setup—and yeah, no one wants to get paged after hours—but it's not just about the number of pages. Trust, ownership, accountability, and solid communication are what really matter.</span><br /> <br /> -<span>Firstly, a healthy on-call rotation is about more than just managing and responding to incidents. It's about the entire ecosystem that supports this practice. This involves reducing pain points, offering mentorship, rapid iteration, and ensuring that engineers have the right tools and processes. One ceavat is, that engineers should be willing to learn. Especially in on-call rotation embedding SREs with other engineers (for example Software Engineers or QA Engineers), it's difficult to motivate everyone to engage. QA Engineers want to test the software, Software Engineers want to implement new features; they don't want to troubleshoot and debug production incidents. It can be depressing for the mentoring SRE.</span><br /> +<span>A key part is giving feedback about the on-call experience to keep learning and improving. If alerts are mostly noise, they need to be tweaked or even ditched. If alerts are helpful, can we automate the repetitive tasks? If there are knowledge gaps, is the documentation lacking? Regular retrospectives ensure that the systems get better over time and the on-call experience improves for the engineers.</span><br /> <br /> -<span>Furthermore, the metrics that measure the success of an on-call experience are only sometimes straightforward. While one might assume that fewer pages translate to better on-call expertise (which is true to a degree, as who wants to receive a page out of office hours?), it's not always the volume of pages that matters most. Trust, ownership, accountability, and effective communication play the important roles.</span><br /> +<span>Getting new team members ready for on-call duties is super important for keeping systems reliable and efficient. This means giving them the knowledge, tools, and support they need to handle incidents with confidence. It starts with a rundown of the system architecture and common issues, then training on monitoring tools, alerting systems, and incident response protocols. Watching experienced on-call engineers in action can provide some hands-on learning. Too often, though, new engineers get thrown into the deep end without proper onboarding because the more experienced engineers are too busy dealing with ongoing production issues.</span><br /> <br /> -<span>An important part is giving feedback about the on-call experience to ensure continuous learning. If alerts are mostly noise, they should be tuned or even eliminated. If alerts are actionable, can recurring tasks be automated? If there are knowledge gaps, is the documentation not good enough? Continuous retrospection ensures that not only do systems evolve, but the experience for the on-call engineers becomes progressively better.</span><br /> +<span>A culture where everyone's always on and alert can cause burnout. Engineers need to know their limits, take breaks, and ask for help when they need it. This isn't just about personal health; a burnt-out engineer can drag down the whole team and the systems they manage. A good on-call culture keeps systems running while making sure engineers are happy, healthy, and supported. Experienced engineers should take the time to mentor juniors, but junior engineers should also stay engaged, investigate issues, and learn new things on their own.</span><br /> <br /> -<span>Onboarding for on-call duties is a crucial aspect of ensuring the reliability and efficiency of systems. This process involves equipping new team members with the knowledge, tools, and support to handle incidents confidently. It begins with an overview of the system architecture and common challenges, followed by training on monitoring tools, alerting mechanisms, and incident response protocols. Shadowing experienced on-call engineers can offer practical exposure. Too often, new engineers are thrown into the cold water without proper onboarding and training because the more experienced engineers are too busy fire-fighting production issues in the first place.</span><br /> +<span>For junior engineers, it's tempting to always ask the experts for help whenever something goes wrong. While that might seem reasonable, constantly handing out solutions doesn't scale—there are endless ways for production systems to break. So, every engineer needs to learn how to debug, troubleshoot, and resolve incidents on their own. The experts should be there for guidance and can step in when a junior gets really stuck, but they also need to give space for less experienced engineers to grow and learn.</span><br /> <br /> -<span>An always-on, always-alert culture can lead to burnout. Engineers should be encouraged to recognise their limits, take breaks, and seek support when needed. This isn't just about individual health; a burnt-out engineer can have cascading effects on the entire team and the systems they manage. A successful on-call culture ensures that while systems are kept running, the engineers are kept happy, healthy, and supported. The more experienced engineers should take time to mentor the junior engineers, but the junior engineers should also be fully engaged, try to investigate and learn new things by themselves.</span><br /> +<span>A blameless on-call culture is essential for creating a safe and collaborative environment where engineers can handle incidents without worrying about getting blamed. It recognizes that mistakes are just part of learning and innovating. When people know they won’t be punished for errors, they’re more likely to talk openly about what went wrong, which helps the whole team learn and improve. Plus, a blameless culture boosts psychological safety, job satisfaction, and reduces burnout, keeping everyone committed and engaged.</span><br /> <br /> -<span>For the junior engineer, it's too easy to fall back and ask the experts in the team every time an issue arises. This seems reasonable, but serving recipes for solving production issues on a silver tablet won't scale forever, as there are infinite scenarios of how production systems can break. So every engineer should learn to debug, troubleshoot and resolve production incidents independently. The experts will still be there for guidance and step in when the junior gets stuck after trying, but the experts should also learn to step down so that lesser experienced engineers can step up and learn. But mistakes can always happen here; that's why having a blameless on-call culture is essential.</span><br /> +<span>Mistakes are gonna happen, which is why having a blameless on-call culture is so important.</span><br /> <br /> -<span>A blameless on-call culture is a must for a safe and collaborative environment where engineers can effectively respond to incidents without fear of retribution. This approach acknowledges that mistakes are a natural part of the learning and innovation process. When individuals are assured they won't be punished for errors, they're more likely to openly discuss mistakes, allowing the entire team to learn and grow from each incident. Furthermore, a blameless culture promotes psychological safety, enhances job satisfaction, reduces burnout, and ensures that talent remains committed and engaged.</span><br /> +<span>Continue with the fourth part of this series:</span><br /> +<br /> +<a class='textlink' href='./2024-09-07-site-reliability-engineering-part-4.html'>2024-09-07 Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers</a><br /> <br /> <span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> <br /> @@ -2354,10 +4876,16 @@ http://www.gnu.org/software/src-highlite --> <summary>This is the third blog post about my Bash Golf series. This series is random Bash tips, tricks, and weirdnesses I have encountered over time. </summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='BashGolfPart3'>Bash Golf Part 3</h1><br /> + <h1 style='display: inline' id='bash-golf-part-3'>Bash Golf Part 3</h1><br /> <br /> <span class='quote'>Published at 2023-12-10T11:35:54+02:00</span><br /> <br /> +<span>This is the third blog post about my Bash Golf series. This series is random Bash tips, tricks, and weirdnesses I have encountered over time. </span><br /> +<br /> +<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> +<a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2</a><br /> +<a class='textlink' href='./2023-12-10-bash-golf-part-3.html'>2023-12-10 Bash Golf Part 3 (You are currently reading this)</a><br /> +<br /> <pre> '\ '\ '\ . . |>18>> \ \ \ . ' . | @@ -2369,13 +4897,20 @@ jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Art by Joan Stark, mod. by Paul Buetow </pre> <br /> -<span>This is the third blog post about my Bash Golf series. This series is random Bash tips, tricks, and weirdnesses I have encountered over time. </span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> -<a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2</a><br /> -<a class='textlink' href='./2023-12-10-bash-golf-part-3.html'>2023-12-10 Bash Golf Part 3 (You are currently reading this)</a><br /> -<br /> -<h2 style='display: inline' id='FUNCNAME'><span class='inlinecode'>FUNCNAME</span></h2><br /> +<ul> +<li><a href='#bash-golf-part-3'>Bash Golf Part 3</a></li> +<li>⇢ <a href='#funcname'><span class='inlinecode'>FUNCNAME</span></a></li> +<li>⇢ <a href='#--'><span class='inlinecode'>:(){ :|:& };:</span></a></li> +<li>⇢ <a href='#inner-functions'>Inner functions</a></li> +<li>⇢ <a href='#exporting-functions'>Exporting functions</a></li> +<li>⇢ <a href='#dynamic-variables-with-local'>Dynamic variables with <span class='inlinecode'>local</span></a></li> +<li>⇢ <a href='#if-conditionals'><span class='inlinecode'>if</span> conditionals</a></li> +<li>⇢ <a href='#multi-line-comments'>Multi-line comments</a></li> +<li>⇢ <a href='#don-t-change-it-while-it-s-executed'>Don't change it while it's executed</a></li> +</ul><br /> +<h2 style='display: inline' id='funcname'><span class='inlinecode'>FUNCNAME</span></h2><br /> <br /> <span><span class='inlinecode'>FUNCNAME</span> is an array you are looking for a way to dynamically determine the name of the current function (which could be considered the callee in the context of its own execution), you can use the special variable <span class='inlinecode'>FUNCNAME</span>. This is an array variable that contains the names of all shell functions currently in the execution call stack. The element <span class='inlinecode'>FUNCNAME[0]</span> holds the name of the currently executing function, <span class='inlinecode'>FUNCNAME[1]</span> the name of the function that called that, and so on.</span><br /> <br /> @@ -2385,24 +4920,24 @@ jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/env bash</font></i> +<pre><i><font color="silver">#!/usr/bin/env bash</font></i> -<font color="#7bc710">log ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">level</font><font color="#F3E651">=</font><font color="#bb00ff">"$1"</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">shift</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">message</font><font color="#F3E651">=</font><font color="#bb00ff">"$1"</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">shift</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -i </font><font color="#ff0000">pid</font><font color="#F3E651">=</font><font color="#bb00ff">"$$"</font> +log () { + <b><u><font color="#000000">local</font></u></b> -r level=<font color="#808080">"$1"</font>; <b><u><font color="#000000">shift</font></u></b> + <b><u><font color="#000000">local</font></u></b> -r message=<font color="#808080">"$1"</font>; <b><u><font color="#000000">shift</font></u></b> + <b><u><font color="#000000">local</font></u></b> -i pid=<font color="#808080">"$$"</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">callee</font><font color="#F3E651">=</font><font color="#ff0000">${FUNCNAME[1]}</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -r </font><font color="#ff0000">stamp</font><font color="#F3E651">=</font><font color="#ff0000">$(</font><font color="#ff0000">date </font><font color="#F3E651">+%</font><font color="#ff0000">Y</font><font color="#F3E651">%</font><font color="#ff0000">m</font><font color="#F3E651">%</font><font color="#ff0000">d-</font><font color="#F3E651">%</font><font color="#ff0000">H</font><font color="#F3E651">%</font><font color="#ff0000">M</font><font color="#F3E651">%</font><font color="#ff0000">S</font><font color="#F3E651">)</font> + <b><u><font color="#000000">local</font></u></b> -r callee=${FUNCNAME[1]} + <b><u><font color="#000000">local</font></u></b> -r stamp=$(date +%Y%m%d-%H%M%S) -<font color="#ff0000"> echo </font><font color="#bb00ff">"$level|$stamp|$pid|$callee|$message"</font><font color="#ff0000"> </font><font color="#F3E651">>&</font><font color="#bb00ff">2</font> -<font color="#ff0000">}</font> + echo <font color="#808080">"$level|$stamp|$pid|$callee|$message"</font> >&<font color="#000000">2</font> +} -<font color="#7bc710">at_home_friday_evening ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> log INFO </font><font color="#bb00ff">'One Peperoni Pizza, please'</font> -<font color="#ff0000">}</font> +at_home_friday_evening () { + log INFO <font color="#808080">'One Peperoni Pizza, please'</font> +} -<font color="#ff0000">at_home_friday_evening</font> +at_home_friday_evening </pre> <br /> <span>The output is as follows:</span><br /> @@ -2411,11 +4946,11 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">❯ </font><font color="#F3E651">.</font><font color="#ff0000">/logexample</font><font color="#F3E651">.</font><font color="#ff0000">sh</font> -<font color="#ff0000">INFO</font><font color="#F3E651">|</font><font color="#bb00ff">20231210</font><font color="#ff0000">-</font><font color="#bb00ff">082732</font><font color="#F3E651">|</font><font color="#bb00ff">123002</font><font color="#F3E651">|</font><font color="#ff0000">at_home_friday_evening</font><font color="#F3E651">|</font><font color="#ff0000">One Peperoni Pizza</font><font color="#F3E651">,</font><font color="#ff0000"> please</font> +<pre>❯ ./logexample.sh +INFO|<font color="#000000">20231210</font>-<font color="#000000">082732</font>|<font color="#000000">123002</font>|at_home_friday_evening|One Peperoni Pizza, please </pre> <br /> -<h2 style='display: inline' id=''><span class='inlinecode'>:(){ :|:& };:</span></h2><br /> +<h2 style='display: inline' id='--'><span class='inlinecode'>:(){ :|:& };:</span></h2><br /> <br /> <span>This one may be widely known already, but I am including it here as I found a cute image illustrating it. But to break <span class='inlinecode'>:(){ :|:& };:</span> down:</span><br /> <br /> @@ -2438,7 +4973,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <a href='./bash-golf-part-3/bash-fork-bomb.jpg'><img alt='Bash fork bomb' title='Bash fork bomb' src='./bash-golf-part-3/bash-fork-bomb.jpg' /></a><br /> <br /> -<h2 style='display: inline' id='Innerfunctions'>Inner functions</h2><br /> +<h2 style='display: inline' id='inner-functions'>Inner functions</h2><br /> <br /> <span>Bash defines variables as it is interpreting the code. The same applies to function declarations. Let's consider this code:</span><br /> <br /> @@ -2446,18 +4981,18 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/env bash</font></i> +<pre><i><font color="silver">#!/usr/bin/env bash</font></i> -<font color="#7bc710">outer()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><font color="#7bc710">inner()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> echo </font><font color="#bb00ff">'Intel inside!'</font> -<font color="#ff0000"> }</font> -<font color="#ff0000"> inner</font> -<font color="#ff0000">}</font> +outer() { + inner() { + echo <font color="#808080">'Intel inside!'</font> + } + inner +} -<font color="#ff0000">inner</font> -<font color="#ff0000">outer</font> -<font color="#ff0000">inner</font> +inner +outer +inner </pre> <br /> <span>And let's execute it:</span><br /> @@ -2475,26 +5010,26 @@ Intel inside! by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/env bash</font></i> +<pre><i><font color="silver">#!/usr/bin/env bash</font></i> -<font color="#7bc710">outer1()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><font color="#7bc710">inner()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> echo </font><font color="#bb00ff">'Intel inside!'</font> -<font color="#ff0000"> }</font> -<font color="#ff0000"> inner</font> -<font color="#ff0000">}</font> +outer1() { + inner() { + echo <font color="#808080">'Intel inside!'</font> + } + inner +} -<font color="#7bc710">outer2()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><font color="#7bc710">inner()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> echo </font><font color="#bb00ff">'Wintel inside!'</font> -<font color="#ff0000"> }</font> -<font color="#ff0000"> inner</font> -<font color="#ff0000">}</font> +outer2() { + inner() { + echo <font color="#808080">'Wintel inside!'</font> + } + inner +} -<font color="#ff0000">outer1</font> -<font color="#ff0000">inner</font> -<font color="#ff0000">outer2</font> -<font color="#ff0000">inner</font> +outer1 +inner +outer2 +inner </pre> <br /> <span>And let's run it:</span><br /> @@ -2507,7 +5042,7 @@ Wintel inside! Wintel inside! </pre> <br /> -<h2 style='display: inline' id='Exportingfunctions'>Exporting functions</h2><br /> +<h2 style='display: inline' id='exporting-functions'>Exporting functions</h2><br /> <br /> <span>Have you ever wondered how to execute a shell function in parallel through <span class='inlinecode'>xargs</span>? The problem is that this won't work:</span><br /> <br /> @@ -2515,14 +5050,14 @@ Wintel inside! by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/env bash</font></i> +<pre><i><font color="silver">#!/usr/bin/env bash</font></i> -<font color="#7bc710">some_expensive_operations()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> echo </font><font color="#bb00ff">"Doing expensive operations with '$1' from pid $$"</font> -<font color="#ff0000">}</font> +some_expensive_operations() { + echo <font color="#808080">"Doing expensive operations with '$1' from pid $$"</font> +} -<b><font color="#ffffff">for</font></b><font color="#ff0000"> i </font><b><font color="#ffffff">in</font></b><font color="#ff0000"> {</font><font color="#bb00ff">0</font><font color="#F3E651">..</font><font color="#bb00ff">9</font><font color="#ff0000">}</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">do</font></b><font color="#ff0000"> echo </font><font color="#ff0000">$i</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">done</font></b><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> xargs -P</font><font color="#bb00ff">10</font><font color="#ff0000"> -I{} bash -c </font><font color="#bb00ff">'some_expensive_operations "{}"'</font> +<b><u><font color="#000000">for</font></u></b> i <b><u><font color="#000000">in</font></u></b> {<font color="#000000">0</font>..<font color="#000000">9</font>}; <b><u><font color="#000000">do</font></u></b> echo $i; <b><u><font color="#000000">done</font></u></b> \ + | xargs -P<font color="#000000">10</font> -I{} bash -c <font color="#808080">'some_expensive_operations "{}"'</font> </pre> <br /> <span>We try here to run ten parallel processes; each of them should run the <span class='inlinecode'>some_expensive_operations</span> function with a different argument. The arguments are provided to <span class='inlinecode'>xargs</span> through <span class='inlinecode'>STDIN</span> one per line. When executed, we get this:</span><br /> @@ -2547,15 +5082,15 @@ bash: line 1: some_expensive_operations: command not found by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/env bash</font></i> +<pre><i><font color="silver">#!/usr/bin/env bash</font></i> -<font color="#7bc710">some_expensive_operations()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> echo </font><font color="#bb00ff">"Doing expensive operations with '$1' from pid $$"</font> -<font color="#ff0000">}</font> -<b><font color="#ffffff">export</font></b><font color="#ff0000"> -f some_expensive_operations</font> +some_expensive_operations() { + echo <font color="#808080">"Doing expensive operations with '$1' from pid $$"</font> +} +<b><u><font color="#000000">export</font></u></b> -f some_expensive_operations -<b><font color="#ffffff">for</font></b><font color="#ff0000"> i </font><b><font color="#ffffff">in</font></b><font color="#ff0000"> {</font><font color="#bb00ff">0</font><font color="#F3E651">..</font><font color="#bb00ff">9</font><font color="#ff0000">}</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">do</font></b><font color="#ff0000"> echo </font><font color="#ff0000">$i</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">done</font></b><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> xargs -P</font><font color="#bb00ff">10</font><font color="#ff0000"> -I{} bash -c </font><font color="#bb00ff">'some_expensive_operations "{}"'</font> +<b><u><font color="#000000">for</font></u></b> i <b><u><font color="#000000">in</font></u></b> {<font color="#000000">0</font>..<font color="#000000">9</font>}; <b><u><font color="#000000">do</font></u></b> echo $i; <b><u><font color="#000000">done</font></u></b> \ + | xargs -P<font color="#000000">10</font> -I{} bash -c <font color="#808080">'some_expensive_operations "{}"'</font> </pre> <br /> <span>When we run this now, we get:</span><br /> @@ -2580,24 +5115,24 @@ Doing expensive operations with '9' from pid 132840 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/env bash</font></i> +<pre><i><font color="silver">#!/usr/bin/env bash</font></i> -<font color="#7bc710">some_other_function()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> echo </font><font color="#bb00ff">"$1"</font> -<font color="#ff0000">}</font> +some_other_function() { + echo <font color="#808080">"$1"</font> +} -<font color="#7bc710">some_expensive_operations()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> some_other_function </font><font color="#bb00ff">"Doing expensive operations with '$1' from pid $$"</font> -<font color="#ff0000">}</font> -<b><font color="#ffffff">export</font></b><font color="#ff0000"> -f some_expensive_operations</font> +some_expensive_operations() { + some_other_function <font color="#808080">"Doing expensive operations with '$1' from pid $$"</font> +} +<b><u><font color="#000000">export</font></u></b> -f some_expensive_operations -<b><font color="#ffffff">for</font></b><font color="#ff0000"> i </font><b><font color="#ffffff">in</font></b><font color="#ff0000"> {</font><font color="#bb00ff">0</font><font color="#F3E651">..</font><font color="#bb00ff">9</font><font color="#ff0000">}</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">do</font></b><font color="#ff0000"> echo </font><font color="#ff0000">$i</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">done</font></b><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> </font><font color="#F3E651">|</font><font color="#ff0000"> xargs -P</font><font color="#bb00ff">10</font><font color="#ff0000"> -I{} bash -c </font><font color="#bb00ff">'some_expensive_operations "{}"'</font> +<b><u><font color="#000000">for</font></u></b> i <b><u><font color="#000000">in</font></u></b> {<font color="#000000">0</font>..<font color="#000000">9</font>}; <b><u><font color="#000000">do</font></u></b> echo $i; <b><u><font color="#000000">done</font></u></b> \ + | xargs -P<font color="#000000">10</font> -I{} bash -c <font color="#808080">'some_expensive_operations "{}"'</font> </pre> <br /> <span>... because <span class='inlinecode'>some_other_function</span> isn't exported! You will also need to add an <span class='inlinecode'>export -f some_other_function</span>!</span><br /> <br /> -<h2 style='display: inline' id='Dynamicvariableswithlocal'>Dynamic variables with <span class='inlinecode'>local</span></h2><br /> +<h2 style='display: inline' id='dynamic-variables-with-local'>Dynamic variables with <span class='inlinecode'>local</span></h2><br /> <br /> <span>You may know that <span class='inlinecode'>local</span> is how to declare local variables in a function. Most don't know that those variables actually have dynamic scope. Let's consider the following example:</span><br /> <br /> @@ -2605,22 +5140,22 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/env bash</font></i> +<pre><i><font color="silver">#!/usr/bin/env bash</font></i> -<font color="#7bc710">foo()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> </font><font color="#ff0000">foo</font><font color="#F3E651">=</font><font color="#ff0000">bar </font><i><font color="#ababab"># Declare local/dynamic variable</font></i> -<font color="#ff0000"> bar</font> -<font color="#ff0000"> echo </font><font color="#bb00ff">"$foo"</font> -<font color="#ff0000">}</font> +foo() { + <b><u><font color="#000000">local</font></u></b> foo=bar <i><font color="silver"># Declare local/dynamic variable</font></i> + bar + echo <font color="#808080">"$foo"</font> +} -<font color="#7bc710">bar()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> echo </font><font color="#bb00ff">"$foo"</font> -<font color="#ff0000"> </font><font color="#ff0000">foo</font><font color="#F3E651">=</font><font color="#ff0000">baz</font> -<font color="#ff0000">}</font> +bar() { + echo <font color="#808080">"$foo"</font> + foo=baz +} -<font color="#ff0000">foo</font><font color="#F3E651">=</font><font color="#ff0000">foo </font><i><font color="#ababab"># Declare global variable</font></i> -<font color="#ff0000">foo </font><i><font color="#ababab"># Call function foo</font></i> -<font color="#ff0000">echo </font><font color="#bb00ff">"$foo"</font> +foo=foo <i><font color="silver"># Declare global variable</font></i> +foo <i><font color="silver"># Call function foo</font></i> +echo <font color="#808080">"$foo"</font> </pre> <br /> <span>Let's pause a minute. What do you think the output would be?</span><br /> @@ -2637,7 +5172,7 @@ foo <span>What happened? The variable <span class='inlinecode'>foo</span> (declared with <span class='inlinecode'>local</span>) is available in the function it was declared in and in all other functions down the call stack! We can even modify the value of <span class='inlinecode'>foo</span>, and the change will be visible up the call stack. It's not a global variable; on the last line, <span class='inlinecode'>echo "$foo"</span> echoes the global variable content.</span><br /> <br /> <br /> -<h2 style='display: inline' id='ifconditionals'><span class='inlinecode'>if</span> conditionals</h2><br /> +<h2 style='display: inline' id='if-conditionals'><span class='inlinecode'>if</span> conditionals</h2><br /> <br /> <span>Consider all variants here more or less equivalent:</span><br /> <br /> @@ -2645,34 +5180,34 @@ foo by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/env bash</font></i> +<pre><i><font color="silver">#!/usr/bin/env bash</font></i> -<b><font color="#ffffff">declare</font></b><font color="#ff0000"> -r </font><font color="#ff0000">foo</font><font color="#F3E651">=</font><font color="#ff0000">foo</font> -<b><font color="#ffffff">declare</font></b><font color="#ff0000"> -r </font><font color="#ff0000">bar</font><font color="#F3E651">=</font><font color="#ff0000">bar</font> +<b><u><font color="#000000">declare</font></u></b> -r foo=foo +<b><u><font color="#000000">declare</font></u></b> -r bar=bar -<b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#bb00ff">"$foo"</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> foo </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#bb00ff">"$bar"</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> bar </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> echo ok1</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> -<b><font color="#ffffff">fi</font></b> +<b><u><font color="#000000">if</font></u></b> [ <font color="#808080">"$foo"</font> = foo ]; <b><u><font color="#000000">then</font></u></b> + <b><u><font color="#000000">if</font></u></b> [ <font color="#808080">"$bar"</font> = bar ]; <b><u><font color="#000000">then</font></u></b> + echo ok1 + <b><u><font color="#000000">fi</font></u></b> +<b><u><font color="#000000">fi</font></u></b> -<b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#bb00ff">"$foo"</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> foo </font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">&&</font><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#bb00ff">"$bar"</font><font color="#ff0000"> </font><font color="#F3E651">==</font><font color="#ff0000"> bar </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> echo ok2a</font> -<b><font color="#ffffff">fi</font></b> +<b><u><font color="#000000">if</font></u></b> [ <font color="#808080">"$foo"</font> = foo ] && [ <font color="#808080">"$bar"</font> == bar ]; <b><u><font color="#000000">then</font></u></b> + echo ok2a +<b><u><font color="#000000">fi</font></u></b> -<font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#bb00ff">"$foo"</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> foo </font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">&&</font><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#bb00ff">"$bar"</font><font color="#ff0000"> </font><font color="#F3E651">==</font><font color="#ff0000"> bar </font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">&&</font><font color="#ff0000"> echo ok2b</font> +[ <font color="#808080">"$foo"</font> = foo ] && [ <font color="#808080">"$bar"</font> == bar ] && echo ok2b -<b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[[</font><font color="#ff0000"> </font><font color="#bb00ff">"$foo"</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> foo </font><font color="#F3E651">&&</font><font color="#ff0000"> </font><font color="#bb00ff">"$bar"</font><font color="#ff0000"> </font><font color="#F3E651">==</font><font color="#ff0000"> bar </font><font color="#F3E651">]];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> echo ok3a</font> -<b><font color="#ffffff">fi</font></b> +<b><u><font color="#000000">if</font></u></b> [[ <font color="#808080">"$foo"</font> = foo && <font color="#808080">"$bar"</font> == bar ]]; <b><u><font color="#000000">then</font></u></b> + echo ok3a +<b><u><font color="#000000">fi</font></u></b> -<font color="#ff0000"> </font><font color="#F3E651">[[</font><font color="#ff0000"> </font><font color="#bb00ff">"$foo"</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> foo </font><font color="#F3E651">&&</font><font color="#ff0000"> </font><font color="#bb00ff">"$bar"</font><font color="#ff0000"> </font><font color="#F3E651">==</font><font color="#ff0000"> bar </font><font color="#F3E651">]]</font><font color="#ff0000"> </font><font color="#F3E651">&&</font><font color="#ff0000"> echo ok3b</font> + [[ <font color="#808080">"$foo"</font> = foo && <font color="#808080">"$bar"</font> == bar ]] && echo ok3b -<b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><b><font color="#ffffff">test</font></b><font color="#ff0000"> </font><font color="#bb00ff">"$foo"</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> foo </font><font color="#F3E651">&&</font><font color="#ff0000"> </font><b><font color="#ffffff">test</font></b><font color="#ff0000"> </font><font color="#bb00ff">"$bar"</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> bar</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> echo ok4a</font> -<b><font color="#ffffff">fi</font></b> +<b><u><font color="#000000">if</font></u></b> <b><u><font color="#000000">test</font></u></b> <font color="#808080">"$foo"</font> = foo && <b><u><font color="#000000">test</font></u></b> <font color="#808080">"$bar"</font> = bar; <b><u><font color="#000000">then</font></u></b> + echo ok4a +<b><u><font color="#000000">fi</font></u></b> -<b><font color="#ffffff">test</font></b><font color="#ff0000"> </font><font color="#bb00ff">"$foo"</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> foo </font><font color="#F3E651">&&</font><font color="#ff0000"> </font><b><font color="#ffffff">test</font></b><font color="#ff0000"> </font><font color="#bb00ff">"$bar"</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> bar </font><font color="#F3E651">&&</font><font color="#ff0000"> echo ok4b</font> +<b><u><font color="#000000">test</font></u></b> <font color="#808080">"$foo"</font> = foo && <b><u><font color="#000000">test</font></u></b> <font color="#808080">"$bar"</font> = bar && echo ok4b </pre> <br /> <span>The output we get is:</span><br /> @@ -2688,7 +5223,7 @@ ok4a ok4b </pre> <br /> -<h2 style='display: inline' id='Multilinecomments'>Multi-line comments</h2><br /> +<h2 style='display: inline' id='multi-line-comments'>Multi-line comments</h2><br /> <br /> <span>You all know how to comment. Put a <span class='inlinecode'>#</span> in front of it. You could use multiple single-line comments or abuse heredocs and redirect it to the <span class='inlinecode'>:</span> no-op command to emulate multi-line comments. </span><br /> <br /> @@ -2696,23 +5231,23 @@ ok4b by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/env bash</font></i> +<pre><i><font color="silver">#!/usr/bin/env bash</font></i> -<i><font color="#ababab"># Single line comment</font></i> +<i><font color="silver"># Single line comment</font></i> -<i><font color="#ababab"># These are two single line</font></i> -<i><font color="#ababab"># comments one after another</font></i> +<i><font color="silver"># These are two single line</font></i> +<i><font color="silver"># comments one after another</font></i> -<font color="#F3E651">:</font><font color="#ff0000"> </font><font color="#F3E651"><<</font><font color="#ff0000">COMMENT</font> -<font color="#ff0000">This is another way a</font> -<font color="#ff0000">multi line comment</font> -<font color="#ff0000">could be written</font><font color="#F3E651">!</font> -<font color="#ff0000">COMMENT</font> +: <<COMMENT +This is another way a +multi line comment +could be written! +COMMENT </pre> <br /> <span>I will not demonstrate the execution of this script, as it won't print anything! It's obviously not the most pretty way of commenting on your code, but it could sometimes be handy!</span><br /> <br /> -<h2 style='display: inline' id='Dontchangeitwhileitsexecuted'>Don't change it while it's executed</h2><br /> +<h2 style='display: inline' id='don-t-change-it-while-it-s-executed'>Don't change it while it's executed</h2><br /> <br /> <span>Consider this script:</span><br /> <br /> @@ -2720,11 +5255,11 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">#!/usr/bin/env bash</font></i> +<pre><i><font color="silver">#!/usr/bin/env bash</font></i> -<font color="#ff0000">echo foo</font> -<font color="#ff0000">echo echo baz </font><font color="#F3E651">>></font><font color="#ff0000"> </font><font color="#ff0000">$0</font> -<font color="#ff0000">echo bar</font> +echo foo +echo echo baz >> $0 +echo bar </pre> <br /> <span>When it is run, it will do:</span><br /> @@ -2749,18 +5284,18 @@ echo baz <br /> <span>Other related posts are:</span><br /> <br /> -<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>2021-05-16 Personal Bash coding style guide</a><br /> -<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> -<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> -<a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2</a><br /> <a class='textlink' href='./2023-12-10-bash-golf-part-3.html'>2023-12-10 Bash Golf Part 3 (You are currently reading this)</a><br /> +<a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2</a><br /> +<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> +<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>2021-05-16 Personal Bash coding style guide</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> </entry> <entry> - <title>Site Reliability Engineering - Part 2: Operational Balance in SRE</title> + <title>Site Reliability Engineering - Part 2: Operational Balance</title> <link href="gemini://foo.zone/gemfeed/2023-11-19-site-reliability-engineering-part-2.gmi" /> <id>gemini://foo.zone/gemfeed/2023-11-19-site-reliability-engineering-part-2.gmi</id> <updated>2023-11-19T00:18:18+03:00</updated> @@ -2771,15 +5306,16 @@ echo baz <summary>This is the second part of my Site Reliability Engineering (SRE) series. I am currently employed as a Site Reliability Engineer and will try to share what SRE is about in this blog series.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='SiteReliabilityEngineeringPart2OperationalBalanceinSRE'>Site Reliability Engineering - Part 2: Operational Balance in SRE</h1><br /> + <h1 style='display: inline' id='site-reliability-engineering---part-2-operational-balance'>Site Reliability Engineering - Part 2: Operational Balance</h1><br /> <br /> <span class='quote'>Published at 2023-11-19T00:18:18+03:00</span><br /> <br /> <span>This is the second part of my Site Reliability Engineering (SRE) series. I am currently employed as a Site Reliability Engineer and will try to share what SRE is about in this blog series.</span><br /> <br /> <a class='textlink' href='./2023-08-18-site-reliability-engineering-part-1.html'>2023-08-18 Site Reliability Engineering - Part 1: SRE and Organizational Culture</a><br /> -<a class='textlink' href='./2023-11-19-site-reliability-engineering-part-2.html'>2023-11-19 Site Reliability Engineering - Part 2: Operational Balance in SRE (You are currently reading this)</a><br /> -<a class='textlink' href='./2024-01-09-site-reliability-engineering-part-3.html'>2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect</a><br /> +<a class='textlink' href='./2023-11-19-site-reliability-engineering-part-2.html'>2023-11-19 Site Reliability Engineering - Part 2: Operational Balance (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-01-09-site-reliability-engineering-part-3.html'>2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture</a><br /> +<a class='textlink' href='./2024-09-07-site-reliability-engineering-part-4.html'>2024-09-07 Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers</a><br /> <br /> <pre> ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⣷⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ @@ -2796,27 +5332,26 @@ echo baz ⠀⠀⠀⠀⠀⠀⠴⠶⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠶⠦⠀⠀ </pre> <br /> -<h2 style='display: inline' id='OperationalBalanceinSREFindingtheEquilibriuminReliabilityandVelocity'>Operational Balance in SRE: Finding the Equilibrium in Reliability and Velocity</h2><br /> -<br /> -<span>Site Reliability Engineering has established itself as more than just a set of best practices or methodologies. Instead, it stands as a beacon of operational excellence, which guides engineering teams through the turbulent waters of modern software development and system management.</span><br /> +<h2 style='display: inline' id='striking-the-right-balance-between-reliability-and-speed'>Striking the Right Balance Between Reliability and Speed</h2><br /> <br /> -<span>In the universe of software production, two fundamental forces are often at odds: The drive for rapid feature release (velocity) and the need for system reliability. Traditionally, the faster teams moved, the more risk was introduced into systems. SRE offers a approach to mitigate these conflicting drives through concepts like error budgets and SLIs/SLOs. These mechanisms offer a tangible metric, allowing teams to quantify how much they can push changes while ensuring they don't compromise system health. Thus, the error budget becomes a balancing act, where teams weigh the trade-offs between innovation and reliability.</span><br /> +<span>Site Reliability Engineering is more than just a bunch of best practices or methods. It's a guiding light for engineering teams, helping them navigate the tricky waters of modern software development and system management.</span><br /> +<span>In the world of software production, there are two big forces that often clash: the push for fast feature releases (velocity) and the need for reliable systems. Traditionally, moving faster meant more risk. SRE helps balance these opposing goals with things like error budgets and SLIs/SLOs. These tools give teams a clear way to measure how much they can push changes without hurting system health. So, the error budget becomes a balancing act, helping teams trade off between innovation and reliability.</span><br /> <br /> -<span>An important part of this balance is the dichotomy between operations and coding. According to SRE principles, an engineer should ideally spend an equal amount of time on operations work and coding - 50% on each. This isn't just a random metric; it's a reflection of the value SRE places on both maintaining operational excellence and progressing forward with innovations. This balance ensures that while SREs are solving today's problems, they are also preparing for tomorrow's challenges. </span><br /> +<span>Finding the right balance in SRE means juggling operations and coding. Ideally, engineers should split their time 50/50 between these tasks. This isn't just a random rule; it highlights how much SRE values both maintaining smooth operations and driving innovation. This way, SREs not only handle today's problems but also prepare for tomorrow's challenges.</span><br /> <br /> -<span>However, not all operational tasks are equal. SRE differentiates between "ops work" and "toil". While ops work is integral to system maintenance and can provide value, toil represents repetitive, mundane tasks which offer little value in the long run. Recognising and minimising toil is crucial. A culture that allows engineers to drown in toil stifles innovation and growth. Hence, an organisation's approach to toil indicates its operational health and commitment to balance.</span><br /> +<span>But not all operations tasks are the same. SRE makes a clear distinction between "ops work" and "toil." Ops work is essential for maintaining systems and adds value, while toil is the repetitive, boring stuff that doesn’t. It's super important to recognize and minimize toil because a culture that lets engineers get bogged down in it will kill innovation and growth. The way an organization handles toil says a lot about its operational health and commitment to balance.</span><br /> <br /> -<span>A cornerstone of achieving operational balance lies in the tools and processes SREs use. Effective monitoring, observability tools, and ensuring that tools can handle high cardinality data are foundational. These aren't just technical requisites but reflective of an organisational culture prioritising proactive problem-solving. By having systems that effectively flag potential issues before they escalate, SREs can maintain the balance between system stability and forward momentum.</span><br /> +<span>A key part of finding operational balance is the tools and processes that SREs use. Great monitoring and observability tools, especially those that can handle lots of complex data, are essential. This isn’t just about having the right tech—it shows that the organization values proactive problem-solving. With systems that can spot potential issues early, SREs can keep things stable while still pushing forward.</span><br /> <br /> -<span>Moreover, operational balance isn't just a technological or process challenge; it's a human one. The health of on-call engineers is as crucial as the health of the services they manage. On-call postmortems, continuous feedback loops, and recognising gaps (be it tooling, operational expertise, or resources) ensure that the human elements of operations are noticed. </span><br /> +<span>Operational balance isn't just about tech or processes; it's also about people. The well-being of on-call engineers is just as important as the health of the services they manage. Doing postmortems after incidents, having continuous feedback loops, and identifying gaps in tools, skills, or resources all help make sure the human side of operations gets the attention it deserves.</span><br /> <br /> -<span>In conclusion, operational balance in SRE isn't static thing but an ongoing journey. It requires organisations to constantly evaluate their practices, tools, and, most importantly, their culture. By achieving this balance, organisations can ensure that they have time for innovation while maintaining the robustness and reliability of their systems, resulting in sustainable long-term success.</span><br /> +<span>In the end, finding operational balance in SRE is an ongoing journey, not a one-time thing. Companies need to keep reassessing their practices, tools, and especially their culture. When they get this balance right, they can keep innovating without sacrificing the reliability of their systems, leading to long-term success.</span><br /> <br /> -<span>That all sounds very romantic. The truth is, it's brutal to archive the perfect balance. No system will ever be perfect. But at least we should aim for it!</span><br /> +<span>That all sounds pretty idealistic. The reality is that getting the perfect balance is really tough. No system is ever going to be perfect. But hey, we should still strive for it!</span><br /> <br /> <span>Continue with the third part of this series:</span><br /> <br /> -<a class='textlink' href='./2024-01-09-site-reliability-engineering-part-3.html'>2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect</a><br /> +<a class='textlink' href='./2024-01-09-site-reliability-engineering-part-3.html'>2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture</a><br /> <br /> <span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> <br /> @@ -2836,7 +5371,7 @@ echo baz <summary>These are my personal takeaways after reading 'Mind Management' by David Kadavy. Note that the book contains much more knowledge wisdom and that these notes only contain points I personally found worth writing down. This is mainly for my own use, but you might find it helpful too.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='MindManagementbooknotes'>"Mind Management" book notes</h1><br /> + <h1 style='display: inline' id='mind-management-book-notes'>"Mind Management" book notes</h1><br /> <br /> <span class='quote'>Published at 2023-11-11T22:21:47+02:00</span><br /> <br /> @@ -2854,17 +5389,33 @@ echo baz ''' </pre> <br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#mind-management-book-notes'>"Mind Management" book notes</a></li> +<li>⇢ <a href='#it-s-not-about-time-management'>It's not about time management</a></li> +<li>⇢ <a href='#empty-slots-in-the-calendar'>Empty slots in the calendar</a></li> +<li>⇢ <a href='#when-you-safe-time'>When you safe time...</a></li> +<li>⇢ <a href='#follow-your-mood'>Follow your mood</a></li> +<li>⇢ <a href='#boosting-creativity'>Boosting creativity</a></li> +<li>⇢ <a href='#the-right-mood-for-the-task-at-hand'>The right mood for the task at hand</a></li> +<li>⇢ <a href='#creativity-hacks'>Creativity hacks</a></li> +<li>⇢ <a href='#planning-and-strategizing'>Planning and strategizing</a></li> +<li>⇢ <a href='#fake-it-until-you-make-it-'>Fake it until you make it. </a></li> +</ul><br /> +<h2 style='display: inline' id='it-s-not-about-time-management'>It's not about time management</h2><br /> +<br /> <span>Productivity isn't about time management - it's about mind management. When you put a lot of effort into something, there are:</span><br /> <br /> <ul> <li>The point of diminishing returns</li> <li>The point of negative return</li> </ul><br /> -<h2 style='display: inline' id='Emptyslotsinthecalendar'>Empty slots in the calendar</h2><br /> +<h2 style='display: inline' id='empty-slots-in-the-calendar'>Empty slots in the calendar</h2><br /> <br /> <span>If we do more things in less time and use all possible slots, speed read, etc., we are more productive. But in reality, that's not the entire truth. You also exchange one thing against everything else.... You cut out too much from your actual life.</span><br /> <br /> -<h2 style='display: inline' id='Whenyousafetime'>When you safe time...</h2><br /> +<h2 style='display: inline' id='when-you-safe-time'>When you safe time...</h2><br /> <br /> <span>...keep it.</span><br /> <br /> @@ -2873,7 +5424,7 @@ echo baz <li>Creative thinking needs space. It will pay dividends tomorrow.</li> <li>You will be rewarded with the "Eureka effect" - a sudden new insight.</li> </ul><br /> -<h2 style='display: inline' id='Followyourmood'>Follow your mood</h2><br /> +<h2 style='display: inline' id='follow-your-mood'>Follow your mood</h2><br /> <br /> <span>Ask yourself: what is my mood now? We never have the energy to do anything, so the better strategy is to follow your current mode and energy. E.g.:</span><br /> <br /> @@ -2881,7 +5432,7 @@ echo baz <li>Didn't sleep enough today? Then, do simple, non-demanding tasks at work</li> <li>Had a great sleep, and there is even time before work starts? Pull in a workout...</li> </ul><br /> -<h2 style='display: inline' id='Boostingcreativity'>Boosting creativity</h2><br /> +<h2 style='display: inline' id='boosting-creativity'>Boosting creativity</h2><br /> <br /> <span>The morning without coffee is a gift for creativity, but you often get distracted. Minimize distractions, too. I have no window to stare out but a plain blank wall.</span><br /> <br /> @@ -2891,7 +5442,7 @@ echo baz <li>Don't race with time but walk alongside it as rough time lines.</li> <li>Don't judge every day after the harvest, but the seed you lay</li> </ul><br /> -<h2 style='display: inline' id='Therightmoodforthetaskathand'>The right mood for the task at hand</h2><br /> +<h2 style='display: inline' id='the-right-mood-for-the-task-at-hand'>The right mood for the task at hand</h2><br /> <br /> <span>We need to try many different combinations. Limiting ourselves and trying too hard makes us frustrated and burn out. Creativity requires many iterations.</span><br /> <br /> @@ -2905,7 +5456,7 @@ echo baz <br /> <span>It gives you pleasure and is in a good mood. This increases creativity if you do what you want to do.</span><br /> <br /> -<h2 style='display: inline' id='Creativityhacks'>Creativity hacks</h2><br /> +<h2 style='display: inline' id='creativity-hacks'>Creativity hacks</h2><br /> <br /> <ul> <li>Coffee can cause anxiety.</li> @@ -2916,7 +5467,7 @@ echo baz <li>Go to open spaces for creativity.</li> <li>Go to closed spaces for polishing.</li> </ul><br /> -<h2 style='display: inline' id='Planningandstrategizing'>Planning and strategizing</h2><br /> +<h2 style='display: inline' id='planning-and-strategizing'>Planning and strategizing</h2><br /> <br /> <span>Minds work better in sprints and not in marathons. Have a weekly plan, not a daily one.</span><br /> <br /> @@ -2929,7 +5480,7 @@ echo baz <br /> <span>You could schedule exploratory tasks when you are under grief. Sound systems should create slack for creativity. Plan only for a few minutes.</span><br /> <br /> -<h2 style='display: inline' id='Fakeituntilyoumakeit'>Fake it until you make it. </h2><br /> +<h2 style='display: inline' id='fake-it-until-you-make-it-'>Fake it until you make it. </h2><br /> <br /> <ul> <li>E.g. act calm if you want to be calm.</li> @@ -2940,15 +5491,15 @@ echo baz <br /> <span>Other book notes of mine are:</span><br /> <br /> -<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> -<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> -<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> -<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> -<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes (You are currently reading this)</a><br /> -<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2024-10-24-staff-engineer-book-notes.html'>2024-10-24 "Staff Engineer" book notes</a><br /> <a class='textlink' href='./2024-07-07-the-stoic-challenge-book-notes.html'>2024-07-07 "The Stoic Challenge" book notes</a><br /> +<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> +<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> +<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> <br /> -<a class='textlink' href='../resources.html'>More books and other resources I found useful.</a><br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> @@ -2965,10 +5516,16 @@ echo baz <summary>Once in a while, I share photos on the inter-web with either family and friends or on my The Irregular Ninja photo site. One hobby of mine is photography (even though I don't have enough time for it - so I am primarily a point-and-shoot photographer).</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='KISSstaticwebphotoalbumswithphotoalbumsh'>KISS static web photo albums with <span class='inlinecode'>photoalbum.sh</span></h1><br /> + <h1 style='display: inline' id='kiss-static-web-photo-albums-with-photoalbumsh'>KISS static web photo albums with <span class='inlinecode'>photoalbum.sh</span></h1><br /> <br /> <span class='quote'>Published at 2023-10-29T22:25:04+02:00</span><br /> <br /> +<span>Once in a while, I share photos on the inter-web with either family and friends or on my The Irregular Ninja photo site. One hobby of mine is photography (even though I don't have enough time for it - so I am primarily a point-and-shoot photographer).</span><br /> +<br /> +<span>I'm not particularly eager to use any photo social sharing platforms such as Flickr, 500px (I used them regularly in the past), etc., anymore. I value self-hosting, DIY and privacy (nobody should data mine my photos), and no third party should have any rights to my pictures. </span><br /> +<br /> +<span>I value KISS (keep it simple and stupid) and simplicity. All that's required for a web photo album is some simple HTML and spice it up with CSS. No need for JavaScript, no need for a complex dynamic website. </span><br /> +<br /> <pre> ___ .---------.._ ______!fsc!_....-' .g8888888p. '-------....._ @@ -2986,19 +5543,23 @@ echo baz '._____________________________________________.' </pre> <br /> -<h2 style='display: inline' id='Motivation'>Motivation</h2><br /> -<br /> -<span>Once in a while, I share photos on the inter-web with either family and friends or on my The Irregular Ninja photo site. One hobby of mine is photography (even though I don't have enough time for it - so I am primarily a point-and-shoot photographer).</span><br /> -<br /> -<span>I'm not particularly eager to use any photo social sharing platforms such as Flickr, 500px (I used them regularly in the past), etc., anymore. I value self-hosting, DIY and privacy (nobody should data mine my photos), and no third party should have any rights to my pictures. </span><br /> -<br /> -<span>I value KISS (keep it simple and stupid) and simplicity. All that's required for a web photo album is some simple HTML and spice it up with CSS. No need for JavaScript, no need for a complex dynamic website. </span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline' id='Introducingphotoalbumsh'>Introducing <span class='inlinecode'>photoalbum.sh</span></h2><br /> +<ul> +<li><a href='#kiss-static-web-photo-albums-with-photoalbumsh'>KISS static web photo albums with <span class='inlinecode'>photoalbum.sh</span></a></li> +<li>⇢ <a href='#introducing-photoalbumsh'>Introducing <span class='inlinecode'>photoalbum.sh</span></a></li> +<li>⇢ <a href='#installation'>Installation</a></li> +<li>⇢ <a href='#setting-it-up'>Setting it up</a></li> +<li>⇢ <a href='#generating-the-static-photo-album'>Generating the static photo album</a></li> +<li>⇢ <a href='#cleaning-it-up'>Cleaning it up</a></li> +<li>⇢ <a href='#html-templates'>HTML templates</a></li> +<li>⇢ <a href='#conclusion'>Conclusion</a></li> +</ul><br /> +<h2 style='display: inline' id='introducing-photoalbumsh'>Introducing <span class='inlinecode'>photoalbum.sh</span></h2><br /> <br /> <span><span class='inlinecode'>photoalbum.sh</span> is a minimal Bash (Bourne Again Shell) script for Unix-like operating systems (such as Linux) to generate static web photo albums. The resulting static photo album is pure HTML+CSS (without any JavaScript!). It is specially designed to be as simple as possible.</span><br /> <br /> -<h2 style='display: inline' id='Installation'>Installation</h2><br /> +<h2 style='display: inline' id='installation'>Installation</h2><br /> <br /> <span>Installation is straightforward. All required is a recent version of GNU Bash, GNU Make, Git and ImageMagick. On Fedora, the dependencies are installed with:</span><br /> <br /> @@ -3041,7 +5602,7 @@ cp ./src/photoalbum.default.conf /etc/default/photoalbum This is Photoalbum Version 0.5.1 </pre> <br /> -<h2 style='display: inline' id='Settingitup'>Setting it up</h2><br /> +<h2 style='display: inline' id='setting-it-up'>Setting it up</h2><br /> <br /> <span>Now, it's time to set up the Irregular Ninja static web photo album (or any other web photo album you may be setting up!)! Create a directory (here: <span class='inlinecode'>irregular.ninja</span> for the Irregular Ninja Photo site - or any oter sub-directory reflecting your album's name), and inside of that directory, create an <span class='inlinecode'>incoming</span> directory. The <span class='inlinecode'>incoming</span> directory. Copy all photos to be part of the album there.</span><br /> <br /> @@ -3074,42 +5635,42 @@ photoalbum makemake by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> photoalbum makemake</font> -<font color="#ff0000">You may now customize </font><font color="#F3E651">.</font><font color="#ff0000">/photoalbumrc and run make</font> - -<font color="#F3E651">%</font><font color="#ff0000"> cat Makefile</font> -<font color="#ff0000">all</font><font color="#F3E651">:</font> -<font color="#ff0000"> photoalbum generate photoalbumrc</font> -<font color="#ff0000">clean</font><font color="#F3E651">:</font> -<font color="#ff0000"> photoalbum clean photoalbumrc</font> - -<font color="#F3E651">%</font><font color="#ff0000"> cat photoalbumrc</font> -<i><font color="#ababab"># The title of the photoalbum</font></i> -<font color="#ff0000">TITLE</font><font color="#F3E651">=</font><font color="#bb00ff">'A simple Photoalbum'</font> - -<i><font color="#ababab"># Thumbnail height geometry</font></i> -<font color="#ff0000">THUMBHEIGHT</font><font color="#F3E651">=</font><font color="#bb00ff">300</font> -<i><font color="#ababab"># Normal geometry height (when viewing photo). Uncomment, to keep original size.</font></i> -<font color="#ff0000">HEIGHT</font><font color="#F3E651">=</font><font color="#bb00ff">1200</font> -<i><font color="#ababab"># Max previews per page.</font></i> -<font color="#ff0000">MAXPREVIEWS</font><font color="#F3E651">=</font><font color="#bb00ff">40</font> -<i><font color="#ababab"># Randomly shuffle all previews.</font></i> -<i><font color="#ababab"># SHUFFLE=yes</font></i> - -<i><font color="#ababab"># Diverse directories, need to be full paths, not relative!</font></i> -<font color="#ff0000">INCOMING_DIR</font><font color="#F3E651">=</font><font color="#ff0000">$(pwd)</font><font color="#ff0000">/incoming</font> -<font color="#ff0000">DIST_DIR</font><font color="#F3E651">=</font><font color="#ff0000">$(pwd)</font><font color="#ff0000">/dist</font> -<font color="#ff0000">TEMPLATE_DIR</font><font color="#F3E651">=</font><font color="#ff0000">/usr/share/photoalbum/templates/default</font> -<i><font color="#ababab">#TEMPLATE_DIR=/usr/share/photoalbum/templates/minimal</font></i> - -<i><font color="#ababab"># Includes a .tar of the incoming dir in the dist, can be yes or no</font></i> -<font color="#ff0000">TARBALL_INCLUDE</font><font color="#F3E651">=</font><font color="#ff0000">yes</font> -<font color="#ff0000">TARBALL_SUFFIX</font><font color="#F3E651">=.</font><font color="#ff0000">tar</font> -<font color="#ff0000">TAR_OPTS</font><font color="#F3E651">=</font><font color="#bb00ff">'-c'</font> - -<i><font color="#ababab"># Some debugging options</font></i> -<i><font color="#ababab">#set -e</font></i> -<i><font color="#ababab">#set -x</font></i> +<pre>% photoalbum makemake +You may now customize ./photoalbumrc and run make + +% cat Makefile +all: + photoalbum generate photoalbumrc +clean: + photoalbum clean photoalbumrc + +% cat photoalbumrc +<i><font color="silver"># The title of the photoalbum</font></i> +TITLE=<font color="#808080">'A simple Photoalbum'</font> + +<i><font color="silver"># Thumbnail height geometry</font></i> +THUMBHEIGHT=<font color="#000000">300</font> +<i><font color="silver"># Normal geometry height (when viewing photo). Uncomment, to keep original size.</font></i> +HEIGHT=<font color="#000000">1200</font> +<i><font color="silver"># Max previews per page.</font></i> +MAXPREVIEWS=<font color="#000000">40</font> +<i><font color="silver"># Randomly shuffle all previews.</font></i> +<i><font color="silver"># SHUFFLE=yes</font></i> + +<i><font color="silver"># Diverse directories, need to be full paths, not relative!</font></i> +INCOMING_DIR=$(pwd)/incoming +DIST_DIR=$(pwd)/dist +TEMPLATE_DIR=/usr/share/photoalbum/templates/default +<i><font color="silver">#TEMPLATE_DIR=/usr/share/photoalbum/templates/minimal</font></i> + +<i><font color="silver"># Includes a .tar of the incoming dir in the dist, can be yes or no</font></i> +TARBALL_INCLUDE=yes +TARBALL_SUFFIX=.tar +TAR_OPTS=<font color="#808080">'-c'</font> + +<i><font color="silver"># Some debugging options</font></i> +<i><font color="silver">#set -e</font></i> +<i><font color="silver">#set -x</font></i> </pre> <br /> <span>In the case for <span class='inlinecode'>irregular.ninja</span>, I changed the defaults to the following:</span><br /> @@ -3118,43 +5679,43 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">--- photoalbumrc 2023-10-29 21:42:00.894202045 +0200</font> -<font color="#ff0000">+++ photoalbumrc.new 2023-06-04 10:40:08.030994440 +0300</font> -<font color="#ff0000">@@ -1,23 +1,24 @@</font> -<font color="#ff0000"> # The title of the photoalbum</font> -<font color="#ff0000">-TITLE='A simple Photoalbum'</font> -<font color="#ff0000">+TITLE='Irregular.Ninja'</font> - -<font color="#ff0000"> # Thumbnail height geometry</font> -<font color="#ff0000">-THUMBHEIGHT=300</font> -<font color="#ff0000">+THUMBHEIGHT=400</font> -<font color="#ff0000"> # Normal geometry height (when viewing photo). Uncomment, to keep original size.</font> -<font color="#ff0000">-HEIGHT=1200</font> -<font color="#ff0000">+HEIGHT=1800</font> -<font color="#ff0000"> # Max previews per page.</font> -<font color="#ff0000"> MAXPREVIEWS=40</font> -<font color="#ff0000">-# Randomly shuffle all previews.</font> -<font color="#ff0000">-# SHUFFLE=yes</font> -<font color="#ff0000">+# Randomly shuffle</font> -<font color="#ff0000">+SHUFFLE=yes</font> - -<font color="#ff0000"> # Diverse directories, need to be full paths, not relative!</font> -<font color="#ff0000">-INCOMING_DIR=$(pwd)/incoming</font> -<font color="#ff0000">+INCOMING_DIR=~/Nextcloud/Photos/irregular.ninja</font> -<font color="#ff0000"> DIST_DIR=$(pwd)/dist</font> -<font color="#ff0000"> TEMPLATE_DIR=/usr/share/photoalbum/templates/default</font> -<font color="#ff0000"> #TEMPLATE_DIR=/usr/share/photoalbum/templates/minimal</font> - -<font color="#ff0000"> # Includes a .tar of the incoming dir in the dist, can be yes or no</font> -<font color="#ff0000">-TARBALL_INCLUDE=yes</font> -<font color="#ff0000">+TARBALL_INCLUDE=no</font> -<font color="#ff0000"> TARBALL_SUFFIX=.tar</font> -<font color="#ff0000"> TAR_OPTS='-c'</font> +<pre>--- photoalbumrc 2023-10-29 21:42:00.894202045 +0200 ++++ photoalbumrc.new 2023-06-04 10:40:08.030994440 +0300 +@@ -1,23 +1,24 @@ + # The title of the photoalbum +-TITLE='A simple Photoalbum' ++TITLE='Irregular.Ninja' + + # Thumbnail height geometry +-THUMBHEIGHT=300 ++THUMBHEIGHT=400 + # Normal geometry height (when viewing photo). Uncomment, to keep original size. +-HEIGHT=1200 ++HEIGHT=1800 + # Max previews per page. + MAXPREVIEWS=40 +-# Randomly shuffle all previews. +-# SHUFFLE=yes ++# Randomly shuffle ++SHUFFLE=yes + + # Diverse directories, need to be full paths, not relative! +-INCOMING_DIR=$(pwd)/incoming ++INCOMING_DIR=~/Nextcloud/Photos/irregular.ninja + DIST_DIR=$(pwd)/dist + TEMPLATE_DIR=/usr/share/photoalbum/templates/default + #TEMPLATE_DIR=/usr/share/photoalbum/templates/minimal + + # Includes a .tar of the incoming dir in the dist, can be yes or no +-TARBALL_INCLUDE=yes ++TARBALL_INCLUDE=no + TARBALL_SUFFIX=.tar + TAR_OPTS='-c' </pre> <br /> <span>So I changed the album title, adjusted some image and thumbnail dimensions, and I want all images to be randomly shuffled every time the album is generated! I also have all my photos in my Nextcloud Photo directory and don't want to copy them to the local <span class='inlinecode'>incoming</span> directory. Also, a tarball containing the whole album as a download isn't provided.</span><br /> <br /> -<h2 style='display: inline' id='Generatingthestaticphotoalbum'>Generating the static photo album</h2><br /> +<h2 style='display: inline' id='generating-the-static-photo-album'>Generating the static photo album</h2><br /> <br /> <span>Let's generate it. Depending on the image sizes and count, the following step may take a while. </span><br /> <br /> @@ -3217,15 +5778,15 @@ blurs html index.html photos thumbs <br /> <span class='quote'>PS: There's also a server-side synchronisation script mirroring the same content to another server for high availability reasons (out of scope for this blog post).</span><br /> <br /> -<h2 style='display: inline' id='Cleaningitup'>Cleaning it up</h2><br /> +<h2 style='display: inline' id='cleaning-it-up'>Cleaning it up</h2><br /> <br /> <span>A simple <span class='inlinecode'>make clean</span> will clean up the <span class='inlinecode'>./dist</span> directory and all other (if any) temp files created.</span><br /> <br /> -<h2 style='display: inline' id='HTMLtemplates'>HTML templates</h2><br /> +<h2 style='display: inline' id='html-templates'>HTML templates</h2><br /> <br /> <span>Poke around in this source directory. You will find a bunch of Bash-HTML template files. You could tweak them to your liking. </span><br /> <br /> -<h2 style='display: inline' id='Conclusion'>Conclusion</h2><br /> +<h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> <br /> <span>A decent looking (in my opinion, at least) in less than 500 (273 as of this writing, to be precise) lines of Bash code and with minimal dependencies; what more do you want? How many LOCs would this be in Raku with the same functionality (can it be sub-100?). </span><br /> <br /> @@ -3237,15 +5798,15 @@ blurs html index.html photos thumbs <br /> <span>Other Bash and KISS-related posts are:</span><br /> <br /> -<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>2021-05-16 Personal Bash coding style guide</a><br /> -<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> -<a class='textlink' href='./2021-09-12-keep-it-simple-and-stupid.html'>2021-09-12 Keep it simple and stupid</a><br /> -<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> -<a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2</a><br /> -<a class='textlink' href='./2023-06-01-kiss-server-monitoring-with-gogios.html'>2023-06-01 KISS server monitoring with Gogios</a><br /> -<a class='textlink' href='./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.html'>2023-10-29 KISS static web photo albums with <span class='inlinecode'>photoalbum.sh</span> (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-12-10-bash-golf-part-3.html'>2023-12-10 Bash Golf Part 3</a><br /> <a class='textlink' href='./2024-04-01-KISS-high-availability-with-OpenBSD.html'>2024-04-01 KISS high-availability with OpenBSD</a><br /> +<a class='textlink' href='./2023-12-10-bash-golf-part-3.html'>2023-12-10 Bash Golf Part 3</a><br /> +<a class='textlink' href='./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.html'>2023-10-29 KISS static web photo albums with <span class='inlinecode'>photoalbum.sh</span> (You are currently reading this)</a><br /> +<a class='textlink' href='./2023-06-01-kiss-server-monitoring-with-gogios.html'>2023-06-01 KISS server monitoring with Gogios</a><br /> +<a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2</a><br /> +<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> +<a class='textlink' href='./2021-09-12-keep-it-simple-and-stupid.html'>2021-09-12 Keep it simple and stupid</a><br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> +<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>2021-05-16 Personal Bash coding style guide</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> @@ -3263,7 +5824,7 @@ blurs html index.html photos thumbs <summary>Hey there. As I am pretty busy this month personally (I am now on Paternity Leave) and as I still want to post once monthly, the blog post of this month will only be some DTail usage examples. They're from the DTail documentation, but not all readers of my blog may be aware of those!</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='DTailusageexamples'>DTail usage examples</h1><br /> + <h1 style='display: inline' id='dtail-usage-examples'>DTail usage examples</h1><br /> <br /> <span class='quote'>Published at 2023-09-25T14:57:42+03:00</span><br /> <br /> @@ -3287,6 +5848,23 @@ blurs html index.html photos thumbs | | </pre> <br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#dtail-usage-examples'>DTail usage examples</a></li> +<li>⇢ <a href='#commands'>Commands</a></li> +<li>⇢ <a href='#following-logs'>Following logs</a></li> +<li>⇢ <a href='#aggregating-logs'>Aggregating logs</a></li> +<li>⇢ <a href='#how-to-use-dcat'>How to use <span class='inlinecode'>dcat</span></a></li> +<li>⇢ <a href='#how-to-use-dgrep'>How to use <span class='inlinecode'>dgrep</span></a></li> +<li>⇢ <a href='#how-to-use-dmap'>How to use <span class='inlinecode'>dmap</span></a></li> +<li>⇢ <a href='#how-to-use-the-dtail-serverless-mode'>How to use the DTail serverless mode</a></li> +<li>⇢ ⇢ <a href='#serverless-map-reduce-query'>Serverless map-reduce query</a></li> +<li>⇢ ⇢ <a href='#aggregating-csv-files'>Aggregating CSV files</a></li> +<li>⇢ ⇢ <a href='#other-serverless-commands'>Other serverless commands</a></li> +</ul><br /> +<h2 style='display: inline' id='commands'>Commands</h2><br /> +<br /> <span>DTail consists out of a server and several client binaries. In this post, I am showcasing their use!</span><br /> <br /> <ul> @@ -3297,7 +5875,7 @@ blurs html index.html photos thumbs <li>Use <span class='inlinecode'>dmap</span> to aggregate logs and other text files already written</li> <li><span class='inlinecode'>dserver</span> is the DTail server, where all the clients can connect to</li> </ul><br /> -<h2 style='display: inline' id='Followinglogs'>Following logs</h2><br /> +<h2 style='display: inline' id='following-logs'>Following logs</h2><br /> <br /> <span>The following example demonstrates how to follow logs of several servers at once. The server list is provided as a flat text file. The example filters all records containing the string <span class='inlinecode'>INFO</span>. Any other Go compatible regular expression can also be used instead of <span class='inlinecode'>INFO</span>.</span><br /> <br /> @@ -3305,7 +5883,7 @@ blurs html index.html photos thumbs by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dtail --servers serverlist</font><font color="#F3E651">.</font><font color="#ff0000">txt --grep INFO --files </font><font color="#bb00ff">"/var/log/dserver/*.log"</font> +<pre>% dtail --servers serverlist.txt --grep INFO --files <font color="#808080">"/var/log/dserver/*.log"</font> </pre> <br /> <span>Hint: you can also provide a comma separated server list, e.g.: <span class='inlinecode'>servers server1.example.org,server2.example.org:PORT,...</span></span><br /> @@ -3318,10 +5896,10 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dtail --servers serverlist</font><font color="#F3E651">.</font><font color="#ff0000">txt --grep INFO </font><font color="#bb00ff">"/var/log/dserver/*.log"</font> +<pre>% dtail --servers serverlist.txt --grep INFO <font color="#808080">"/var/log/dserver/*.log"</font> </pre> <br /> -<h2 style='display: inline' id='Aggregatinglogs'>Aggregating logs</h2><br /> +<h2 style='display: inline' id='aggregating-logs'>Aggregating logs</h2><br /> <br /> <span>To run ad-hoc map-reduce aggregations on newly written log lines you must add a query. The following example follows all remote log lines and prints out every few seconds the result to standard output.</span><br /> <br /> @@ -3331,10 +5909,10 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dtail --servers serverlist</font><font color="#F3E651">.</font><font color="#ff0000">txt </font><font color="#F3E651">\</font> -<font color="#ff0000"> --files </font><font color="#bb00ff">'/var/log/dserver/*.log'</font><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> --query </font><font color="#bb00ff">'from STATS select sum($goroutines),sum($cgocalls),</font> -<font color="#bb00ff"> last($time),max(lifetimeConnections)'</font> +<pre>% dtail --servers serverlist.txt \ + --files <font color="#808080">'/var/log/dserver/*.log'</font> \ + --query <font color="#808080">'from STATS select sum($goroutines),sum($cgocalls),</font> +<font color="#808080"> last($time),max(lifetimeConnections)'</font> </pre> <br /> <span>Beware: For map-reduce queries to work, you have to ensure that DTail supports your log format. Check out the documentaiton of the DTail query language and the DTail log formats on the DTail homepage for more information.</span><br /> @@ -3347,10 +5925,10 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dtail --servers serverlist</font><font color="#F3E651">.</font><font color="#ff0000">txt </font><font color="#F3E651">\</font> -<font color="#ff0000"> --files </font><font color="#bb00ff">'/var/log/dserver/*.log'</font><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> </font><font color="#bb00ff">'from STATS select sum($goroutines),sum($cgocalls),</font> -<font color="#bb00ff"> last($time),max(lifetimeConnections)'</font> +<pre>% dtail --servers serverlist.txt \ + --files <font color="#808080">'/var/log/dserver/*.log'</font> \ + <font color="#808080">'from STATS select sum($goroutines),sum($cgocalls),</font> +<font color="#808080"> last($time),max(lifetimeConnections)'</font> </pre> <br /> <span>Here is another example:</span><br /> @@ -3359,10 +5937,10 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dtail --servers serverlist</font><font color="#F3E651">.</font><font color="#ff0000">txt </font><font color="#F3E651">\</font> -<font color="#ff0000"> --files </font><font color="#bb00ff">'/var/log/dserver/*.log'</font><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> --query </font><font color="#bb00ff">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> -<font color="#bb00ff"> lifetimeConnections group by $hostname order by max($cgocalls)'</font> +<pre>% dtail --servers serverlist.txt \ + --files <font color="#808080">'/var/log/dserver/*.log'</font> \ + --query <font color="#808080">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> +<font color="#808080"> lifetimeConnections group by $hostname order by max($cgocalls)'</font> </pre> <br /> <a href='./dtail-usage-examples/dtail-map2.gif'><img alt='Tail map-reduce example 2' title='Tail map-reduce example 2' src='./dtail-usage-examples/dtail-map2.gif' /></a><br /> @@ -3373,12 +5951,12 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dtail --servers serverlist</font><font color="#F3E651">.</font><font color="#ff0000">txt </font><font color="#F3E651">\</font> -<font color="#ff0000"> --files </font><font color="#bb00ff">'/var/log/dserver/*.log'</font><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> --query </font><font color="#bb00ff">'from STATS select ... outfile append result.csv'</font> +<pre>% dtail --servers serverlist.txt \ + --files <font color="#808080">'/var/log/dserver/*.log'</font> \ + --query <font color="#808080">'from STATS select ... outfile append result.csv'</font> </pre> <br /> -<h2 style='display: inline' id='Howtousedcat'>How to use <span class='inlinecode'>dcat</span></h2><br /> +<h2 style='display: inline' id='how-to-use-dcat'>How to use <span class='inlinecode'>dcat</span></h2><br /> <br /> <span>The following example demonstrates how to cat files (display the full content of the files) on several servers at once.</span><br /> <br /> @@ -3388,7 +5966,7 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dcat --servers serverlist</font><font color="#F3E651">.</font><font color="#ff0000">txt --files /etc/hostname</font> +<pre>% dcat --servers serverlist.txt --files /etc/hostname </pre> <br /> <a href='./dtail-usage-examples/dcat.gif'><img alt='Cat example' title='Cat example' src='./dtail-usage-examples/dcat.gif' /></a><br /> @@ -3399,10 +5977,10 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dcat --servers serverlist</font><font color="#F3E651">.</font><font color="#ff0000">txt /etc/hostname</font> +<pre>% dcat --servers serverlist.txt /etc/hostname </pre> <br /> -<h2 style='display: inline' id='Howtousedgrep'>How to use <span class='inlinecode'>dgrep</span></h2><br /> +<h2 style='display: inline' id='how-to-use-dgrep'>How to use <span class='inlinecode'>dgrep</span></h2><br /> <br /> <span>The following example demonstrates how to grep files (display only the lines which match a given regular expression) of multiple servers at once. In this example, we look after some entries in <span class='inlinecode'>/etc/passwd</span>. This time, we don't provide the server list via an file but rather via a comma separated list directly on the command line. We also explore the <span class='inlinecode'>-before</span>, <span class='inlinecode'>-after</span> and <span class='inlinecode'>-max</span> flags (see animation).</span><br /> <br /> @@ -3410,9 +5988,9 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dgrep --servers server1</font><font color="#F3E651">.</font><font color="#ff0000">example</font><font color="#F3E651">.</font><font color="#ff0000">org</font><font color="#F3E651">:</font><font color="#bb00ff">2223</font><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> --files /etc/passwd </font><font color="#F3E651">\</font> -<font color="#ff0000"> --regex nologin</font> +<pre>% dgrep --servers server1.example.org:<font color="#000000">2223</font> \ + --files /etc/passwd \ + --regex nologin </pre> <br /> <span>Generally, <span class='inlinecode'>dgrep</span> is also a very useful way to search historic application logs for certain content.</span><br /> @@ -3421,7 +5999,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span class='quote'>Hint: <span class='inlinecode'>-regex</span> is an alias for <span class='inlinecode'>-grep</span>.</span><br /> <br /> -<h2 style='display: inline' id='Howtousedmap'>How to use <span class='inlinecode'>dmap</span></h2><br /> +<h2 style='display: inline' id='how-to-use-dmap'>How to use <span class='inlinecode'>dmap</span></h2><br /> <br /> <span>To run a map-reduce aggregation over logs written in the past, the <span class='inlinecode'>dmap</span> command can be used. The following example aggregates all map-reduce fields <span class='inlinecode'>dmap</span> will print interim results every few seconds. You can also write the result to an CSV file by adding <span class='inlinecode'>outfile result.csv</span> to the query.</span><br /> <br /> @@ -3429,17 +6007,17 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dmap --servers serverlist</font><font color="#F3E651">.</font><font color="#ff0000">txt </font><font color="#F3E651">\</font> -<font color="#ff0000"> --files </font><font color="#bb00ff">'/var/log/dserver/*.log'</font><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> --query </font><font color="#bb00ff">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> -<font color="#bb00ff"> lifetimeConnections group by $hostname order by max($cgocalls)'</font> +<pre>% dmap --servers serverlist.txt \ + --files <font color="#808080">'/var/log/dserver/*.log'</font> \ + --query <font color="#808080">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> +<font color="#808080"> lifetimeConnections group by $hostname order by max($cgocalls)'</font> </pre> <br /> <span>Remember: For that to work, you have to make sure that DTail supports your log format. You can either use the ones already defined in <span class='inlinecode'>internal/mapr/logformat</span> or add an extension to support a custom log format. The example here works out of the box though, as DTail understands its own log format already. </span><br /> <br /> <a href='./dtail-usage-examples/dmap.gif'><img alt='DMap example' title='DMap example' src='./dtail-usage-examples/dmap.gif' /></a><br /> <br /> -<h2 style='display: inline' id='HowtousetheDTailserverlessmode'>How to use the DTail serverless mode</h2><br /> +<h2 style='display: inline' id='how-to-use-the-dtail-serverless-mode'>How to use the DTail serverless mode</h2><br /> <br /> <span>Until now, all examples so far required to have remote server(s) to connect to. That makes sense, as after all DTail is a *distributed* tool. However, there are circumstances where you don't really need to connect to a server remotely. For example, you already have a login shell open to the server an all what you want is to run some queries directly on local log files.</span><br /> <br /> @@ -3447,7 +6025,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>All commands shown so far also work in a serverless mode. All what needs to be done is to omit a server list. The DTail client then starts in serverless mode.</span><br /> <br /> -<h3 style='display: inline' id='Serverlessmapreducequery'>Serverless map-reduce query</h3><br /> +<h3 style='display: inline' id='serverless-map-reduce-query'>Serverless map-reduce query</h3><br /> <br /> <span>The following <span class='inlinecode'>dmap</span> example is the same as the previously shown one, but the difference is that it operates on a local log file directly:</span><br /> <br /> @@ -3455,9 +6033,9 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dmap --files /var/log/dserver/dserver</font><font color="#F3E651">.</font><font color="#ff0000">log</font> -<font color="#ff0000"> --query </font><font color="#bb00ff">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> -<font color="#bb00ff"> lifetimeConnections group by $hostname order by max($cgocalls)'</font> +<pre>% dmap --files /var/log/dserver/dserver.log + --query <font color="#808080">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> +<font color="#808080"> lifetimeConnections group by $hostname order by max($cgocalls)'</font> </pre> <br /> <span>As a shorthand version the following command can be used:</span><br /> @@ -3466,9 +6044,9 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dmap </font><font color="#bb00ff">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> -<font color="#bb00ff"> lifetimeConnections group by $hostname order by max($cgocalls)'</font><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> /var/log/dsever/dserver</font><font color="#F3E651">.</font><font color="#ff0000">log</font> +<pre>% dmap <font color="#808080">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> +<font color="#808080"> lifetimeConnections group by $hostname order by max($cgocalls)'</font> \ + /var/log/dsever/dserver.log </pre> <br /> <span>You can also use a file input pipe as follows:</span><br /> @@ -3477,12 +6055,12 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> cat /var/log/dserver/dserver</font><font color="#F3E651">.</font><font color="#ff0000">log </font><font color="#F3E651">|</font><font color="#ff0000"> </font><font color="#F3E651">\</font> -<font color="#ff0000"> dmap </font><font color="#bb00ff">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> -<font color="#bb00ff"> lifetimeConnections group by $hostname order by max($cgocalls)'</font> +<pre>% cat /var/log/dserver/dserver.log | \ + dmap <font color="#808080">'from STATS select $hostname,max($goroutines),max($cgocalls),$loadavg,</font> +<font color="#808080"> lifetimeConnections group by $hostname order by max($cgocalls)'</font> </pre> <br /> -<h3 style='display: inline' id='AggregatingCSVfiles'>Aggregating CSV files</h3><br /> +<h3 style='display: inline' id='aggregating-csv-files'>Aggregating CSV files</h3><br /> <br /> <span>In essence, this works exactly like aggregating logs. All files operated on must be valid CSV files and the first line of the CSV must be the header. E.g.:</span><br /> <br /> @@ -3490,21 +6068,21 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> cat example</font><font color="#F3E651">.</font><font color="#ff0000">csv</font> -<font color="#ff0000">name</font><font color="#F3E651">,</font><font color="#ff0000">lastname</font><font color="#F3E651">,</font><font color="#ff0000">age</font><font color="#F3E651">,</font><font color="#ff0000">profession</font> -<font color="#ff0000">Michael</font><font color="#F3E651">,</font><font color="#ff0000">Jordan</font><font color="#F3E651">,</font><font color="#bb00ff">40</font><font color="#F3E651">,</font><font color="#ff0000">Basketball player</font> -<font color="#ff0000">Michael</font><font color="#F3E651">,</font><font color="#ff0000">Jackson</font><font color="#F3E651">,</font><font color="#bb00ff">100</font><font color="#F3E651">,</font><font color="#ff0000">Singer</font> -<font color="#ff0000">Albert</font><font color="#F3E651">,</font><font color="#ff0000">Einstein</font><font color="#F3E651">,</font><font color="#bb00ff">200</font><font color="#F3E651">,</font><font color="#ff0000">Physician</font> -<font color="#F3E651">%</font><font color="#ff0000"> dmap --query </font><font color="#bb00ff">'select lastname,name where age > 40 logformat csv outfile result.csv'</font><font color="#ff0000"> example</font><font color="#F3E651">.</font><font color="#ff0000">csv</font> -<font color="#F3E651">%</font><font color="#ff0000"> cat result</font><font color="#F3E651">.</font><font color="#ff0000">csv</font> -<font color="#ff0000">lastname</font><font color="#F3E651">,</font><font color="#ff0000">name</font> -<font color="#ff0000">Jackson</font><font color="#F3E651">,</font><font color="#ff0000">Michael</font> -<font color="#ff0000">Einstein</font><font color="#F3E651">,</font><font color="#ff0000">Albert</font> +<pre>% cat example.csv +name,lastname,age,profession +Michael,Jordan,<font color="#000000">40</font>,Basketball player +Michael,Jackson,<font color="#000000">100</font>,Singer +Albert,Einstein,<font color="#000000">200</font>,Physician +% dmap --query <font color="#808080">'select lastname,name where age > 40 logformat csv outfile result.csv'</font> example.csv +% cat result.csv +lastname,name +Jackson,Michael +Einstein,Albert </pre> <br /> <span>DMap can also be used to query and aggregate CSV files from remote servers.</span><br /> <br /> -<h3 style='display: inline' id='Otherserverlesscommands'>Other serverless commands</h3><br /> +<h3 style='display: inline' id='other-serverless-commands'>Other serverless commands</h3><br /> <br /> <span>The serverless mode works transparently with all other DTail commands. Here are some examples:</span><br /> <br /> @@ -3512,44 +6090,44 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dtail /var/log/dserver/dserver</font><font color="#F3E651">.</font><font color="#ff0000">log</font> +<pre>% dtail /var/log/dserver/dserver.log </pre> <br /> <!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dtail --logLevel trace /var/log/dserver/dserver</font><font color="#F3E651">.</font><font color="#ff0000">log</font> +<pre>% dtail --logLevel trace /var/log/dserver/dserver.log </pre> <br /> <!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dcat /etc/passwd</font> +<pre>% dcat /etc/passwd </pre> <br /> <!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dcat --plain /etc/passwd </font><font color="#F3E651">></font><font color="#ff0000"> /etc/test</font> -<i><font color="#ababab"># Should show no differences.</font></i> -<font color="#ff0000">diff /etc/test /etc/passwd </font> +<pre>% dcat --plain /etc/passwd > /etc/test +<i><font color="silver"># Should show no differences.</font></i> +diff /etc/test /etc/passwd </pre> <br /> <!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dgrep --regex ERROR --files /var/log/dserver/dsever</font><font color="#F3E651">.</font><font color="#ff0000">log</font> +<pre>% dgrep --regex ERROR --files /var/log/dserver/dsever.log </pre> <br /> <!-- Generator: GNU source-highlight 3.1.9 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> dgrep --before </font><font color="#bb00ff">10</font><font color="#ff0000"> --after </font><font color="#bb00ff">10</font><font color="#ff0000"> --max </font><font color="#bb00ff">10</font><font color="#ff0000"> --grep ERROR /var/log/dserver/dsever</font><font color="#F3E651">.</font><font color="#ff0000">log</font> +<pre>% dgrep --before <font color="#000000">10</font> --after <font color="#000000">10</font> --max <font color="#000000">10</font> --grep ERROR /var/log/dserver/dsever.log </pre> <br /> <span>Use <span class='inlinecode'>--help</span> for more available options. Or go to the DTail page for more information! Hope you find DTail useful!</span><br /> @@ -3558,10 +6136,10 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other related posts are:</span><br /> <br /> -<a class='textlink' href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>2021-04-22 DTail - The distributed log tail program</a><br /> -<a class='textlink' href='./2022-03-06-the-release-of-dtail-4.0.0.html'>2022-03-06 The release of DTail 4.0.0</a><br /> -<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> <a class='textlink' href='./2023-09-25-dtail-usage-examples.html'>2023-09-25 DTail usage examples (You are currently reading this)</a><br /> +<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> +<a class='textlink' href='./2022-03-06-the-release-of-dtail-4.0.0.html'>2022-03-06 The release of DTail 4.0.0</a><br /> +<a class='textlink' href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>2021-04-22 DTail - The distributed log tail program</a><br /> <br /> <span>I hope you find the tools presented in this post useful!</span><br /> <br /> @@ -3580,18 +6158,19 @@ http://www.gnu.org/software/src-highlite --> <name>Paul Buetow aka snonux</name> <email>paul@dev.buetow.org</email> </author> - <summary>The universe of Site Reliability Engineering (SRE) is like an intricate tapestry woven with diverse technology, culture, and personal grit threads. Site Reliability Engineering is one of the most demanding jobs. With all the facets, it's impossible to get bored. There is always a new challenge to master, and there is always a new technology to tinker with. It's not just technical; it's also about communication, collaboration and teamwork. I am currently employed as a Site Reliability Engineer and will try to share what SRE is about in this blog series.</summary> + <summary>Being a Site Reliability Engineer (SRE) is like stepping into a lively, ever-evolving universe. The world of SRE mixes together different tech, a unique culture, and a whole lot of determination. It’s one of the toughest but most exciting jobs out there. There's zero chance of getting bored because there's always a fresh challenge to tackle and new technology to play around with. It's not just about the tech side of things either; it's heavily rooted in communication, collaboration, and teamwork. As someone currently working as an SRE, I’m here to break it all down for you in this blog series. Let's dive into what SRE is really all about!</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='SiteReliabilityEngineeringPart1SREandOrganizationalCulture'>Site Reliability Engineering - Part 1: SRE and Organizational Culture</h1><br /> + <h1 style='display: inline' id='site-reliability-engineering---part-1-sre-and-organizational-culture'>Site Reliability Engineering - Part 1: SRE and Organizational Culture</h1><br /> <br /> <span class='quote'>Published at 2023-08-18T22:43:47+03:00</span><br /> <br /> -<span>The universe of Site Reliability Engineering (SRE) is like an intricate tapestry woven with diverse technology, culture, and personal grit threads. Site Reliability Engineering is one of the most demanding jobs. With all the facets, it's impossible to get bored. There is always a new challenge to master, and there is always a new technology to tinker with. It's not just technical; it's also about communication, collaboration and teamwork. I am currently employed as a Site Reliability Engineer and will try to share what SRE is about in this blog series.</span><br /> +<span>Being a Site Reliability Engineer (SRE) is like stepping into a lively, ever-evolving universe. The world of SRE mixes together different tech, a unique culture, and a whole lot of determination. It’s one of the toughest but most exciting jobs out there. There's zero chance of getting bored because there's always a fresh challenge to tackle and new technology to play around with. It's not just about the tech side of things either; it's heavily rooted in communication, collaboration, and teamwork. As someone currently working as an SRE, I’m here to break it all down for you in this blog series. Let's dive into what SRE is really all about!</span><br /> <br /> <a class='textlink' href='./2023-08-18-site-reliability-engineering-part-1.html'>2023-08-18 Site Reliability Engineering - Part 1: SRE and Organizational Culture (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-11-19-site-reliability-engineering-part-2.html'>2023-11-19 Site Reliability Engineering - Part 2: Operational Balance in SRE</a><br /> -<a class='textlink' href='./2024-01-09-site-reliability-engineering-part-3.html'>2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture and the Human Aspect</a><br /> +<a class='textlink' href='./2023-11-19-site-reliability-engineering-part-2.html'>2023-11-19 Site Reliability Engineering - Part 2: Operational Balance</a><br /> +<a class='textlink' href='./2024-01-09-site-reliability-engineering-part-3.html'>2024-01-09 Site Reliability Engineering - Part 3: On-Call Culture</a><br /> +<a class='textlink' href='./2024-09-07-site-reliability-engineering-part-4.html'>2024-09-07 Site Reliability Engineering - Part 4: Onboarding for On-Call Engineers</a><br /> <br /> <pre> ▓▓▓▓░░ @@ -3615,29 +6194,29 @@ DC on fire: ░░░░░░░░░░▒▒░░░░░░░░░░░░░░░░░░░░░░░░▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒░░░░░░░░░░░░░░░░░░ </pre> <br /> -<h2 style='display: inline' id='SREandOrganizationalCultureNavigatingtheNexus'>SRE and Organizational Culture: Navigating the Nexus</h2><br /> +<h2 style='display: inline' id='sre-and-organizational-culture-navigating-the-nexus'>SRE and Organizational Culture: Navigating the Nexus</h2><br /> <br /> -<span>At the heart of SRE lies the proactive mindset of "prevention over cure." Traditional IT models focused predominantly on reactive solutions, but SRE mandates a shift towards foresight. By adopting Service Level Indicators (SLIs) and Service Level Objectives (SLOs), teams are equipped with clear metrics and goals that guide them toward ensuring reliability and user satisfaction. They reflect an organisational culture prioritising user experience and constant system alignment with user needs. </span><br /> +<span>At the core of SRE is the principle of "prevention over cure." Unlike traditional IT setups that mostly react to problems, SRE focuses on spotting issues before they happen. This proactive approach involves using Service Level Indicators (SLIs) and Service Level Objectives (SLOs). These tools give teams specific metrics and targets to aim for, helping them keep systems reliable and users happy. It's all about creating a culture that prioritizes user experience and makes sure everything runs smoothly to meet their needs.</span><br /> <br /> -<span>Another defining SRE idea concept the "error budget." This ingenious framework accepts that no system is flawless. Failures are inevitable. However, instead of being punitive, the culture here is to accept, learn, and iterate. By providing teams with a "budget" for errors, organisations create an environment where innovation is encouraged, and failures are viewed as learning opportunities.</span><br /> +<span>Another key concept in SRE is the "error budget." It’s a clever approach that recognizes no system is perfect and that failures will happen. Instead of punishing mistakes, SRE culture embraces them as chances to learn and improve. The idea is to give teams a "budget" for errors, creating a space where innovation can thrive and failures are simply seen as lessons learned.</span><br /> <br /> -<span>But SRE isn't just about technology and metrics; it's also human. It challenges the "hero culture" that plagues many IT teams. While individual heroics might occasionally save the day, a sustainable model requires collective expertise. An SRE culture recognises that heroes achieve their best within teams, negating the need for a hero-centric environment. This philosophy promotes a balanced on-call experience, emphasising the importance of trust, ownership, effective communication, and collaboration as cornerstones of team success. I personally have fallen into the hero trap, and know it's unsustainable to be the only go-to person for every arising problem.</span><br /> +<span>SRE isn't just about tech and metrics; it's also about people. It tackles the "hero culture" that often ends up burning out IT teams. Sure, having a hero swoop in to save the day can be great, but relying on that all the time just isn’t sustainable. Instead, SRE focuses on collective expertise and teamwork. It recognizes that heroes are at their best within a solid team, making the need for constant heroics unnecessary. This way of thinking promotes a balanced on-call experience and highlights trust, ownership, good communication, and collaboration as key to success. I've been there myself, falling into the hero trap, and I know firsthand that it's just not feasible to be the go-to person for every problem that comes up.</span><br /> <br /> -<span>Additionally, the SRE model requires good documentation. However, it's essential ensuring that this documentation undergoes the same quality checks as code, reinforcing effective onboarding, training and communication.</span><br /> +<span>Also, the SRE model puts a big emphasis on good documentation. It's not enough to just have docs; they need to be top-notch and go through the same quality checks as code. This really helps with onboarding new team members, training, and keeping everyone on the same page.</span><br /> <br /> -<span>Organisations might face a significant challenge when adopting SRE. Some might feel SRE principles counter their goals. They might prioritise feature rollouts over reliability or view SRE practices as cumbersome. Hence, creating an SRE culture often demands patient explanations and showcasing benefits, such as increased release velocity and improved user experience.</span><br /> +<span>Adopting SRE can be a big challenge for some organizations. They might think the SRE approach goes against their goals, like preferring to roll out new features quickly rather than focusing on reliability, or seeing SRE practices as too much hassle. Building an SRE culture often means taking the time to explain things patiently and showing the benefits, like faster release cycles and a better user experience.</span><br /> <br /> -<span>Monitoring and observability form another SRE aspect, emphasising the need for high-quality tools to query and analyse data. This ties back to the cultural emphasis on continuous learning and adaptability. SREs, by nature, need to be curious, ready to delve into anomalies, and keen on adopting new tools and practices. </span><br /> +<span>Monitoring and observability are also big parts of SRE, highlighting the need for top-notch tools to query and analyze data. This aligns with the SRE focus on continuous learning and being adaptable. SREs naturally need to be curious, ready to dive into any strange issues, and always open to picking up new tools and practices.</span><br /> <br /> -<span>The success of SRE within any organisation depends on the broader acceptance of its principles. It demands a move away from siloed operations, where SRE acts as a bandage on flawed systems, to a model where reliability is everyone's responsibility.</span><br /> +<span>For SRE to really work in any organization, everyone needs to buy into its principles. It's about moving away from working in isolated silos and relying on SRE to just patch things up. Instead, it’s about making reliability a shared responsibility across the whole team.</span><br /> <br /> -<span>In essence, the integration of SRE principles transcends technical practices. It paves the way for a shift in organisational culture that values proactive prevention, continuous learning, collaboration, and transparent communication. The successful melding of SRE and corporate culture promises not just reliable systems but also a robust, resilient, and progressive work environment.</span><br /> +<span>In short, bringing SRE principles into the mix goes beyond just the technical stuff. It helps shift the whole organizational culture to value things like preventing issues before they happen, always learning, working together, and being open with communication. When SRE and corporate culture blend well, you end up with not just reliable systems but also a strong, resilient, and forward-thinking workplace.</span><br /> <br /> -<span>Organisations with the implementation of SLIs, SLOs and error budgets are already advanced in their SRE journey. It takes a lot of communication, convincing, and patience until that point is reached.</span><br /> +<span>Organizations that have SLIs, SLOs, and error budgets in place are already pretty far along in their SRE journey. Getting there takes a lot of communication, convincing people, and patience.</span><br /> <br /> <span>Continue with the second part of this series:</span><br /> <br /> -<a class='textlink' href='./2023-11-19-site-reliability-engineering-part-2.html'>2023-11-19 Site Reliability Engineering - Part 2: Operational Balance in SRE</a><br /> +<a class='textlink' href='./2023-11-19-site-reliability-engineering-part-2.html'>2023-11-19 Site Reliability Engineering - Part 2: Operational Balance</a><br /> <br /> <span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> <br /> @@ -3657,10 +6236,14 @@ DC on fire: <summary>I proudly announce that I've released Gemtexter version `2.1.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown, written in GNU Bash.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Gemtexter210LetsGemtextagain'>Gemtexter 2.1.0 - Let's Gemtext again³</h1><br /> + <h1 style='display: inline' id='gemtexter-210---let-s-gemtext-again'>Gemtexter 2.1.0 - Let's Gemtext again³</h1><br /> <br /> <span class='quote'>Published at 2023-07-21T10:19:31+03:00</span><br /> <br /> +<span>I proudly announce that I've released Gemtexter version <span class='inlinecode'>2.1.0</span>. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown, written in GNU Bash.</span><br /> +<br /> +<a class='textlink' href='https://codeberg.org/snonux/gemtexter'>https://codeberg.org/snonux/gemtexter</a><br /> +<br /> <pre> -=[ typewriters ]=- 1/98 .-------. @@ -3674,21 +6257,29 @@ DC on fire: mod. by Paul Buetow `"""""""""` </pre> <br /> -<span>I proudly announce that I've released Gemtexter version <span class='inlinecode'>2.1.0</span>. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown, written in GNU Bash.</span><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/gemtexter'>https://codeberg.org/snonux/gemtexter</a><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline' id='WhyBash'>Why Bash?</h2><br /> +<ul> +<li><a href='#gemtexter-210---let-s-gemtext-again'>Gemtexter 2.1.0 - Let's Gemtext again³</a></li> +<li>⇢ <a href='#why-bash'>Why Bash?</a></li> +<li>⇢ <a href='#switch-to-gpl3-license'>Switch to GPL3 license</a></li> +<li>⇢ <a href='#source-code-highlighting-support'>Source code highlighting support</a></li> +<li>⇢ <a href='#html-exact-variant'>HTML exact variant</a></li> +<li>⇢ <a href='#use-of-hack-webfont-by-default'>Use of Hack webfont by default</a></li> +<li>⇢ <a href='#html-mastodon-verification-support'>HTML Mastodon verification support</a></li> +<li>⇢ <a href='#more'>More</a></li> +</ul><br /> +<h2 style='display: inline' id='why-bash'>Why Bash?</h2><br /> <br /> <span>This project is too complex for a Bash script. Writing it in Bash was to try out how maintainable a "larger" Bash script could be. It's still pretty maintainable and helps me try new Bash tricks here and then!</span><br /> <br /> <span>Let's list what's new!</span><br /> <br /> -<h2 style='display: inline' id='SwitchtoGPL3license'>Switch to GPL3 license</h2><br /> +<h2 style='display: inline' id='switch-to-gpl3-license'>Switch to GPL3 license</h2><br /> <br /> <span>Many (almost all) of the tools and commands (GNU Bash, GMU Sed, GNU Date, GNU Grep, GNU Source Highlight) used by <span class='inlinecode'>Gemtexter</span> are licensed under the GPL anyway. So why not use the same? This was an easy switch, as I was the only code contributor so far!</span><br /> <br /> -<h2 style='display: inline' id='Sourcecodehighlightingsupport'>Source code highlighting support</h2><br /> +<h2 style='display: inline' id='source-code-highlighting-support'>Source code highlighting support</h2><br /> <br /> <span>The HTML output now supports source code highlighting, which is pretty neat if your site is about programming. The requirement is to have the <span class='inlinecode'>source-highlight</span> command, which is GNU Source Highlight, to be installed. Once done, you can annotate a bare block with the language to be highlighted. E.g.:</span><br /> <br /> @@ -3706,18 +6297,18 @@ DC on fire: by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> -n </font><font color="#bb00ff">"$foo"</font><font color="#ff0000"> </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> echo </font><font color="#bb00ff">"$foo"</font> -<b><font color="#ffffff">fi</font></b> +<pre><b><u><font color="#000000">if</font></u></b> [ -n <font color="#808080">"$foo"</font> ]; <b><u><font color="#000000">then</font></u></b> + echo <font color="#808080">"$foo"</font> +<b><u><font color="#000000">fi</font></u></b> </pre> <br /> <span>Please run <span class='inlinecode'>source-highlight --lang-list</span> for a list of all supported languages.</span><br /> <br /> -<h2 style='display: inline' id='HTMLexactvariant'>HTML exact variant</h2><br /> +<h2 style='display: inline' id='html-exact-variant'>HTML exact variant</h2><br /> <br /> <span>Gemtexter is there to convert your Gemini Capsule into other formats, such as HTML and Markdown. An HTML exact variant can now be enabled in the <span class='inlinecode'>gemtexter.conf</span> by adding the line <span class='inlinecode'>declare -rx HTML_VARIANT=exact</span>. The HTML/CSS output changed to reflect a more exact Gemtext appearance and to respect the same spacing as you would see in the Geminispace. </span><br /> <br /> -<h2 style='display: inline' id='UseofHackwebfontbydefault'>Use of Hack webfont by default</h2><br /> +<h2 style='display: inline' id='use-of-hack-webfont-by-default'>Use of Hack webfont by default</h2><br /> <br /> <span>The Hack web font is a typeface designed explicitly for source code. It's a derivative of the Bitstream Vera and DejaVu Mono lineage, but it features many improvements and refinements that make it better suited to reading and writing code.</span><br /> <br /> @@ -3725,7 +6316,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Hack is open-source and freely available for use and modification under the MIT License.</span><br /> <br /> -<h2 style='display: inline' id='HTMLMastodonverificationsupport'>HTML Mastodon verification support</h2><br /> +<h2 style='display: inline' id='html-mastodon-verification-support'>HTML Mastodon verification support</h2><br /> <br /> <span>The following link explains how URL verification works in Mastodon:</span><br /> <br /> @@ -3737,7 +6328,7 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">declare</font></b><font color="#ff0000"> -xr </font><font color="#ff0000">MASTODON_URI</font><font color="#F3E651">=</font><font color="#bb00ff">'https://fosstodon.org/@snonux'</font> +<pre><b><u><font color="#000000">declare</font></u></b> -xr MASTODON_URI=<font color="#808080">'https://fosstodon.org/@snonux'</font> </pre> <br /> <span>and add the following into your <span class='inlinecode'>index.gmi</span>:</span><br /> @@ -3752,10 +6343,10 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff"><a</font></b><font color="#ff0000"> </font><b><font color="#F35E1E">href</font></b><font color="#F3E651">=</font><font color="#bb00ff">'https://fosstodon.org/@snonux'</font><font color="#ff0000"> </font><b><font color="#F35E1E">rel</font></b><font color="#F3E651">=</font><font color="#bb00ff">'me'</font><b><font color="#ffffff">></font></b><font color="#ff0000">Me at Mastodon</font><b><font color="#ffffff"></a></font></b> +<pre><b><u><font color="#000000"><a</font></u></b> <b><font color="#000000">href</font></b>=<font color="#808080">'https://fosstodon.org/@snonux'</font> <b><font color="#000000">rel</font></b>=<font color="#808080">'me'</font><b><u><font color="#000000">></font></u></b>Me at Mastodon<b><u><font color="#000000"></a></font></u></b> </pre> <br /> -<h2 style='display: inline' id='More'>More</h2><br /> +<h2 style='display: inline' id='more'>More</h2><br /> <br /> <span>Additionally, there were a couple of bug fixes, refactorings and overall improvements in the documentation made. </span><br /> <br /> @@ -3763,11 +6354,12 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other related posts are:</span><br /> <br /> -<a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace</a><br /> -<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> -<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> -<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again²</a><br /> +<a class='textlink' href='./2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.html'>2024-10-02 Gemtexter 3.0.0 - Let's Gemtext again⁴</a><br /> <a class='textlink' href='./2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.html'>2023-07-21 Gemtexter 2.1.0 - Let's Gemtext again³ (You are currently reading this)</a><br /> +<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again²</a><br /> +<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> +<a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> @@ -3785,7 +6377,7 @@ http://www.gnu.org/software/src-highlite --> <summary>These notes are of two books by 'John Sommez' I found helpful. I also added some of my own keypoints to it. These notes are mainly for my own use, but you might find them helpful, too.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='SoftwareDevelopmersCareerGuideandSoftSkillsbooknotes'>"Software Developmers Career Guide and Soft Skills" book notes</h1><br /> + <h1 style='display: inline' id='software-developmers-career-guide-and-soft-skills-book-notes'>"Software Developmers Career Guide and Soft Skills" book notes</h1><br /> <br /> <span class='quote'>Published at 2023-07-17T04:56:20+03:00</span><br /> <br /> @@ -3803,9 +6395,42 @@ http://www.gnu.org/software/src-highlite --> ''' </pre> <br /> -<h1 style='display: inline' id='Improve'>Improve</h1><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline' id='Alwayslearnnewthings'>Always learn new things</h2><br /> +<ul> +<li><a href='#software-developmers-career-guide-and-soft-skills-book-notes'>"Software Developmers Career Guide and Soft Skills" book notes</a></li> +<li>⇢ <a href='#improve'>Improve</a></li> +<li>⇢ ⇢ <a href='#always-learn-new-things'>Always learn new things</a></li> +<li>⇢ ⇢ <a href='#set-goals'>Set goals</a></li> +<li>⇢ ⇢ <a href='#ratings'>Ratings</a></li> +<li>⇢ ⇢ <a href='#promotions'>Promotions</a></li> +<li>⇢ ⇢ <a href='#finish-things'>Finish things</a></li> +<li>⇢ <a href='#expand-the-empire'>Expand the empire</a></li> +<li>⇢ <a href='#be-pragmatic-and-also-manage-your-time'>Be pragmatic and also manage your time</a></li> +<li>⇢ ⇢ <a href='#the-quota-system'>The quota system</a></li> +<li>⇢ ⇢ <a href='#don-t-waste-time'>Don't waste time</a></li> +<li>⇢ ⇢ <a href='#habits'>Habits</a></li> +<li><a href='#work-life-balance'>Work-life balance</a></li> +<li>⇢ <a href='#mental-health'>Mental health</a></li> +<li>⇢ <a href='#physical-health'>Physical health</a></li> +<li>⇢ <a href='#no-drama'>No drama</a></li> +<li><a href='#personal-brand'>Personal brand</a></li> +<li>⇢ <a href='#market-yourself'>Market yourself</a></li> +<li>⇢ <a href='#networking'>Networking</a></li> +<li>⇢ <a href='#public-speaking'>Public speaking</a></li> +<li><a href='#new-job'>New job</a></li> +<li>⇢ <a href='#for-the-interview'>For the interview</a></li> +<li>⇢ <a href='#find-the-right-type-of-company'>Find the right type of company</a></li> +<li>⇢ <a href='#apply-for-the-new-job'>Apply for the new job</a></li> +<li>⇢ <a href='#negotiation'>Negotiation</a></li> +<li>⇢ <a href='#leaving-the-old-job'>Leaving the old job</a></li> +<li><a href='#other-things'>Other things</a></li> +<li>⇢ <a href='#testing'>Testing</a></li> +<li>⇢ <a href='#books-to-read'>Books to read</a></li> +</ul><br /> +<h2 style='display: inline' id='improve'>Improve</h2><br /> +<br /> +<h3 style='display: inline' id='always-learn-new-things'>Always learn new things</h3><br /> <br /> <span>When you learn something new, e.g. a programming language, first gather an overview, learn from multiple sources, play around and learn by doing and not consuming and form your own questions. Don't read too much upfront. A large amount of time is spent in learning technical skills which were never use. You want to have a practical set of skills you are actually using. You need to know 20 percent to get out 80 percent of the results.</span><br /> <br /> @@ -3823,11 +6448,11 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Boot camps: The advantage of a boot camp is to pragmatically learn things fast. We almost always overestimate what we can do in a day. Especially during boot camps. Connect to others during the boot camps</span><br /> <br /> -<h2 style='display: inline' id='Setgoals'>Set goals</h2><br /> +<h3 style='display: inline' id='set-goals'>Set goals</h3><br /> <br /> <span>Your own goals are important but the manager also looks at how the team performs and how someone can help the team perform better. Check whether you are on track with your goals every 2 weeks in order to avoid surprises for the annual review. Make concrete goals for next review. Track and document your progress. Invest in your education. Make your goals known. If you want something, then ask for it. Nobody but you knows what you want.</span><br /> <br /> -<h2 style='display: inline' id='Ratings'>Ratings</h2><br /> +<h3 style='display: inline' id='ratings'>Ratings</h3><br /> <br /> <span>That's a trap: If you have to rate yourself, that's a trap. That never works in an unbiased way. Rate yourself always the best way but rate your weakest part as high as possible minus one point. Rate yourself as good as you can otherwise. Nobody is putting for fun a gun on his own head. </span><br /> <br /> @@ -3835,7 +6460,7 @@ http://www.gnu.org/software/src-highlite --> <li>Don't do peer rating, it can fire back on you. What if the colleague becomes your new boss?</li> <li>Cooperate rankings are unfortunately HR guidelines and politics and only mirror a little your actual performance.</li> </ul><br /> -<h2 style='display: inline' id='Promotions'>Promotions</h2><br /> +<h3 style='display: inline' id='promotions'>Promotions</h3><br /> <br /> <span>The most valuable employees are the ones who make themselves obsolete and automate all away. Keep a safety net of 3 to 6 months of finances. Safe at least 10 percent of your earnings. Also, if you make money it does not mean that you have to spent more money. Is a new car better than a used car which both can bring you from A to B? Liability vs assets.</span><br /> <br /> @@ -3848,7 +6473,7 @@ http://www.gnu.org/software/src-highlite --> <li>If you want a raise be specific how much and know to back your demands. Don't make a thread and no ultimatums.</li> <li>Best way for a promotion is to switch jobs. You can even switch back with a better salary.</li> </ul><br /> -<h2 style='display: inline' id='Finishthings'>Finish things</h2><br /> +<h3 style='display: inline' id='finish-things'>Finish things</h3><br /> <br /> <span>Hard work is necessary for accomplish results. However, work smarter not harder. Furthermore, working smart is not a substitute for working hard. Work both, hard and smart.</span><br /> <br /> @@ -3863,7 +6488,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Defeat is finally give up. Failure is the road to success, embrace it. Failure does not define you but how you respond to it. Events don't make your unhappy, but how you react to events do.</span><br /> <br /> -<h2 style='display: inline' id='Expandtheempire'>Expand the empire</h2><br /> +<h2 style='display: inline' id='expand-the-empire'>Expand the empire</h2><br /> <br /> <span>The larger your empire is, the larger your circle of influence is. The larger the circle of influence is, the more opportunities you have.</span><br /> <br /> @@ -3874,7 +6499,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Become visible, keep track that you accomplishments. E.g. write a weekly summary. Do presentations, be seen. Learn new things and share your learnings. Be the problem solver and not the blamer.</span><br /> <br /> -<h2 style='display: inline' id='Bepragmaticandalsomanageyourtime'>Be pragmatic and also manage your time</h2><br /> +<h2 style='display: inline' id='be-pragmatic-and-also-manage-your-time'>Be pragmatic and also manage your time</h2><br /> <br /> <span>Make use of time boxing via the Pomodoro technique: Set a target of rounds and track the rounds. That give you exact focused work time. That's really the trick. For example set a goal of 6 daily pomodores.</span><br /> <br /> @@ -3884,7 +6509,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>You should feel good of the work done even if you don't finished the task. You will feel good about pomodoro wise even you don't finish the task on hand yet. Helps you to enjoy time off more. Working longer may not sell anything.</span><br /> <br /> -<h3 style='display: inline' id='Thequotasystem'>The quota system</h3><br /> +<h3 style='display: inline' id='the-quota-system'>The quota system</h3><br /> <br /> <span>Defined quota of things done. E.g. N runs per week or M Blog posts per month or O pomodoros per week. This helps with consistency. Truly commit to these quotas. Failure is not an option. Start with small commitments. Don't commit to something you can't fulfill otherwise you set yourself up for failure.</span><br /> <br /> @@ -3893,7 +6518,7 @@ http://www.gnu.org/software/src-highlite --> <li>Internal motivation is more important over external motivation. Check out Daniels book drive.</li> <li>Multitasking: Batching is effective. E.g. emails twice daily at pre-set times..</li> </ul><br /> -<h3 style='display: inline' id='Dontwastetime'>Don't waste time</h3><br /> +<h3 style='display: inline' id='don-t-waste-time'>Don't waste time</h3><br /> <br /> <span>The biggest time waster is TV watching. The TV is programming you. It's insane that Americans watch so much TV as they work full time. Schedule one show at a time and watch it when you want to watch it. Most movies are crap anyways. The good movies will come to you as people will talk about them.</span><br /> <br /> @@ -3902,7 +6527,7 @@ http://www.gnu.org/software/src-highlite --> <li>Meetings can waste time as well. Simply don't go to them. Try to cancel meeting if it can be dealt with via email.</li> <li>Enjoying things is not a waste of time. E.g. you could still play a game once in a while. It is important not to cut away all you enjoy from your life.</li> </ul><br /> -<h3 style='display: inline' id='Habits'>Habits</h3><br /> +<h3 style='display: inline' id='habits'>Habits</h3><br /> <br /> <span>Try to have as many good habits as possible. Start with easy habits, and make them a little bit more challenging over time. Set ankers and rewards. Over time the routines will become habits naturally.</span><br /> <br /> @@ -3912,7 +6537,7 @@ http://www.gnu.org/software/src-highlite --> <li>We don't have control over our habits but our own routines.</li> <li>Routines help to form the habits, though.</li> </ul><br /> -<h1 style='display: inline' id='Worklifebalance'>Work-life balance</h1><br /> +<h1 style='display: inline' id='work-life-balance'>Work-life balance</h1><br /> <br /> <span>Avoid overwork hours. That's not as beneficial as you might think and comes only with very small rewards. Invest rather in yourself and not in your employer.</span><br /> <br /> @@ -3924,7 +6549,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Use your most productive hours to work on you. Make that your priority. Take care of yourself a priority (E.g. do workouts or learn a new language). You can always workout 2 or 1 hour per day, but will you pay the price?</span><br /> <br /> -<h2 style='display: inline' id='Mentalhealth'>Mental health</h2><br /> +<h2 style='display: inline' id='mental-health'>Mental health</h2><br /> <br /> <ul> <li>Friendships and positive thinking help to have and maintain better health, longer Life, better productivity and increased happiness.</li> @@ -3935,7 +6560,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>In most cases burnout is just an illusion. If you don't have motivation push through the wall. People usually don't pass the wall as they feel they are burned out. After pushing through the wall you will have the most fun, for example you will be able playing the guitar greatly.</span><br /> <br /> -<h2 style='display: inline' id='Physicalhealth'>Physical health</h2><br /> +<h2 style='display: inline' id='physical-health'>Physical health</h2><br /> <br /> <span>Utilise a standing desk and treadmill (you could walk and type at the same time). Increase the incline in order to burn more calories. Even on the standing desk you burn more calories than sitting. When you use pomodoro then you can use the small breaks for push-ups (maybe won't do as good when you are in a fasted state).</span><br /> <br /> @@ -3947,7 +6572,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Intermittent fasting is an effective method to maintain weight and health. But it does not mean that you can only eat junk food in the feeding windows. Also, diet and nutrition is the most important for health and fitness. They make it also easier to stay focused and positive.</span><br /> <br /> -<h2 style='display: inline' id='Nodrama'>No drama</h2><br /> +<h2 style='display: inline' id='no-drama'>No drama</h2><br /> <br /> <span>Avoid drama at work. Where are humans there is drama. You can decide where to spent your energy in. But don't avoid conflict. Conflict is healthy in any kind of relationship. Be tactful and state your opinion. The goal is to find the best solution to the problem.</span><br /> <br /> @@ -3963,13 +6588,13 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>You have to learn how to work in a team. Be honest but tactful. It's not too be the loudest but about selling your ideas. Don't argue otherwise you won't sell anything. Be persuasive by finding the common ground. Or lead the colleagues to your idea and don't sell it upfront. Communicate clearly.</span><br /> <br /> -<h1 style='display: inline' id='Personalbrand'>Personal brand</h1><br /> +<h1 style='display: inline' id='personal-brand'>Personal brand</h1><br /> <br /> <ul> <li>Invest your value outside the company. Build your personal brand. Show how valuable you are, also to other companies. Become an asset.</li> <li>Invest in your education. Make your goals known. If you want something ask for it (see also the sections about goals in this document).</li> </ul><br /> -<h2 style='display: inline' id='Marketyourself'>Market yourself</h2><br /> +<h2 style='display: inline' id='market-yourself'>Market yourself</h2><br /> <br /> <ul> <li>The best way to market yourself is to make you usable.</li> @@ -3982,11 +6607,11 @@ http://www.gnu.org/software/src-highlite --> <li>Have an elevator pitch: "buetow.org - Having fun with computers!"</li> <li>Have social media accounts, especially the ones which are more tech related.</li> </ul><br /> -<h2 style='display: inline' id='Networking'>Networking</h2><br /> +<h2 style='display: inline' id='networking'>Networking</h2><br /> <br /> <span>Ask people so they talk about themselves. They are not really interested in you. Use meetup.com to find groups you are interested and build up the network over time. Don't drink on social networking events even when others do. Talking to other people at events only has upsides. Just saying "hi" and introducing yourself is enough. What worse can happen? If the person rejects you so what, life goes on. Ask open questions and no "yes" and "no" questions. E.g.: "What is your story, why are you here?".</span><br /> <br /> -<h2 style='display: inline' id='Publicspeaking'>Public speaking</h2><br /> +<h2 style='display: inline' id='public-speaking'>Public speaking</h2><br /> <br /> <span>Before your talk go on stage 10 minutes in advance. Introduce yourself to the front row people. During the talk they will smile at you and encourage you during your talk.</span><br /> <br /> @@ -3996,9 +6621,9 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Just do it. Just go to conferences. Even if you are not speaking. Sell your boss what you would learn and "this and that" and you would present the learnings to the team afterwards.</span><br /> <br /> -<h1 style='display: inline' id='Newjob'>New job</h1><br /> +<h1 style='display: inline' id='new-job'>New job</h1><br /> <br /> -<h2 style='display: inline' id='Fortheinterview'>For the interview</h2><br /> +<h2 style='display: inline' id='for-the-interview'>For the interview</h2><br /> <br /> <ul> <li>Build up a network before the interview. E.g., follow and comment blogs. Or go to meet-ups and conferences. Join user groups.</li> @@ -4007,7 +6632,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>If you are specialized then there is a better chance to get a fitting job. No one will hire a general lawyer if there are specialized lawyers available. Even if you are specialized, you will have a wide range of skills (T-shape knowledge).</span><br /> <br /> -<h2 style='display: inline' id='Findtherighttypeofcompany'>Find the right type of company</h2><br /> +<h2 style='display: inline' id='find-the-right-type-of-company'>Find the right type of company</h2><br /> <br /> <span>Not all companies are equal. They have individual cultures and guidelines.</span><br /> <br /> @@ -4019,7 +6644,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Work in a tech. company if you want to work on/with cutting edge technologies.</span><br /> <br /> -<h2 style='display: inline' id='Applyforthenewjob'>Apply for the new job</h2><br /> +<h2 style='display: inline' id='apply-for-the-new-job'>Apply for the new job</h2><br /> <br /> <span>Get a professional resume writer. Get referrals of writers and get samples from there. Get sufficient with algorithm and data structures interview questions. Cracking the coding interview book and blog </span><br /> <br /> @@ -4032,7 +6657,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Invest in your dress code as appearance masters. It does make sense to invest in your style. You could even hire a professional stylist (not my personal way though).</span><br /> <br /> -<h2 style='display: inline' id='Negotiation'>Negotiation</h2><br /> +<h2 style='display: inline' id='negotiation'>Negotiation</h2><br /> <br /> <ul> <li>Whoever names the number first loses. You don't know what someone else is expecting unless told. Low ball number may be an issue but you have to know the market.</li> @@ -4050,21 +6675,21 @@ http://www.gnu.org/software/src-highlite --> <ul> <li>Never spilt the difference is the best book for learning negotiation techniques..</li> </ul><br /> -<h2 style='display: inline' id='Leavingtheoldjob'>Leaving the old job</h2><br /> +<h2 style='display: inline' id='leaving-the-old-job'>Leaving the old job</h2><br /> <br /> <span>When leaving a job make a clean and non personal as possible. Never complain and never explain. Don't worry about abandonment of the team. Everybody is replacement and you make a business decision. Don't threaten to quit as you are replaceable.</span><br /> <br /> -<h1 style='display: inline' id='Otherthings'>Other things</h1><br /> +<h1 style='display: inline' id='other-things'>Other things</h1><br /> <br /> <ul> <li>As a leader lead by example and don't lead from the Eiffel tower.</li> <li>As a leader you are responsible for the team. If the team fails then it's your fault only.</li> </ul><br /> -<h2 style='display: inline' id='Testing'>Testing</h2><br /> +<h2 style='display: inline' id='testing'>Testing</h2><br /> <br /> <span>Unit testing Vs regression testing: Unit tests test the smallest possible unit and get rewritten if the unit gets changed. It's like programming against a specification n. Regression tests test whether the software still works after the change. Now you know more than most software engineers.</span><br /> <br /> -<h2 style='display: inline' id='Bookstoread'>Books to read</h2><br /> +<h2 style='display: inline' id='books-to-read'>Books to read</h2><br /> <br /> <ul> <li>Clean Code</li> @@ -4087,15 +6712,15 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other book notes of mine are:</span><br /> <br /> -<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> -<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> -<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> -<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> -<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2024-10-24-staff-engineer-book-notes.html'>2024-10-24 "Staff Engineer" book notes</a><br /> <a class='textlink' href='./2024-07-07-the-stoic-challenge-book-notes.html'>2024-07-07 "The Stoic Challenge" book notes</a><br /> +<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> +<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> +<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> <br /> -<a class='textlink' href='../resources.html'>More books and other resources I found useful.</a><br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> @@ -4112,20 +6737,36 @@ http://www.gnu.org/software/src-highlite --> <summary>Gogios is a minimalistic and easy-to-use monitoring tool I programmed in Google Go designed specifically for small-scale self-hosted servers and virtual machines. The primary purpose of Gogios is to monitor my personal server infrastructure for `foo.zone`, my MTAs, my authoritative DNS servers, my NextCloud, Wallabag and Anki sync server installations, etc.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='KISSservermonitoringwithGogios'>KISS server monitoring with Gogios</h1><br /> + <h1 style='display: inline' id='kiss-server-monitoring-with-gogios'>KISS server monitoring with Gogios</h1><br /> <br /> <span class='quote'>Published at 2023-06-01T21:10:17+03:00</span><br /> <br /> -<a href='./kiss-server-monitoring-with-gogios/gogios-small.png'><img alt='Gogios logo' title='Gogios logo' src='./kiss-server-monitoring-with-gogios/gogios-small.png' /></a><br /> -<br /> -<h2 style='display: inline' id='Introduction'>Introduction</h2><br /> -<br /> <span>Gogios is a minimalistic and easy-to-use monitoring tool I programmed in Google Go designed specifically for small-scale self-hosted servers and virtual machines. The primary purpose of Gogios is to monitor my personal server infrastructure for <span class='inlinecode'>foo.zone</span>, my MTAs, my authoritative DNS servers, my NextCloud, Wallabag and Anki sync server installations, etc.</span><br /> <br /> <span>With compatibility with the Nagios Check API, Gogios offers a simple yet effective solution to monitor a limited number of resources. In theory, Gogios scales to a couple of thousand checks, though. You can clone it from Codeberg here:</span><br /> <br /> <a class='textlink' href='https://codeberg.org/snonux/gogios'>https://codeberg.org/snonux/gogios</a><br /> <br /> +<a href='./kiss-server-monitoring-with-gogios/gogios-small.png'><img alt='Gogios logo' title='Gogios logo' src='./kiss-server-monitoring-with-gogios/gogios-small.png' /></a><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#kiss-server-monitoring-with-gogios'>KISS server monitoring with Gogios</a></li> +<li>⇢ <a href='#motivation'>Motivation</a></li> +<li>⇢ <a href='#features'>Features</a></li> +<li>⇢ <a href='#example-alert'>Example alert</a></li> +<li>⇢ <a href='#installation'>Installation</a></li> +<li>⇢ ⇢ <a href='#compiling-and-installing-gogios'>Compiling and installing Gogios</a></li> +<li>⇢ ⇢ <a href='#setting-up-user-group-and-directories'>Setting up user, group and directories</a></li> +<li>⇢ ⇢ <a href='#installing-monitoring-plugins'>Installing monitoring plugins</a></li> +<li>⇢ <a href='#configuration'>Configuration</a></li> +<li>⇢ ⇢ <a href='#mta'>MTA</a></li> +<li>⇢ ⇢ <a href='#configuring-gogios'>Configuring Gogios</a></li> +<li>⇢ <a href='#running-gogios'>Running Gogios</a></li> +<li>⇢ ⇢ <a href='#high-availability'>High-availability</a></li> +<li>⇢ <a href='#conclusion'>Conclusion:</a></li> +</ul><br /> <pre> _____________________________ ____________________________ / \ / \ @@ -4149,7 +6790,7 @@ The original can be found at https://asciiart.website/index.php?art=objects/computers </pre> <br /> -<h2 style='display: inline' id='Motivation'>Motivation</h2><br /> +<h2 style='display: inline' id='motivation'>Motivation</h2><br /> <br /> <span>With experience in monitoring solutions like Nagios, Icinga, Prometheus and OpsGenie, these tools often came with many features that I didn't necessarily need for personal use. Contact groups, host groups, check clustering, and the requirement of operating a DBMS and a WebUI added complexity and bloat to my monitoring setup.</span><br /> <br /> @@ -4157,7 +6798,7 @@ https://asciiart.website/index.php?art=objects/computers <br /> <span>This led me to create Gogios, a lightweight monitoring tool tailored to my specific needs. I chose the Go programming language for this project as it comes, in my opinion, with the best balance of ease to use and performance.</span><br /> <br /> -<h2 style='display: inline' id='Features'>Features</h2><br /> +<h2 style='display: inline' id='features'>Features</h2><br /> <br /> <ul> <li>Compatible with Nagios Check scripts: Gogios leverages the widely-used Nagios Check API, allowing to use existing Nagios plugins.</li> @@ -4168,7 +6809,7 @@ https://asciiart.website/index.php?art=objects/computers <li>Email Notifications: Gogios can send email notifications regarding the status of monitored services, ensuring you stay informed about potential issues.</li> <li>CRON-based Execution: Gogios can be quickly scheduled to run periodically via CRON, allowing you to automate monitoring without needing a complex setup.</li> </ul><br /> -<h2 style='display: inline' id='Examplealert'>Example alert</h2><br /> +<h2 style='display: inline' id='example-alert'>Example alert</h2><br /> <br /> <span>This is an example alert report received via E-Mail. Whereas, <span class='inlinecode'>[C:2 W:0 U:0 OK:51]</span> means that we've got two alerts in status critical, 0 warnings, 0 unknowns and 51 OKs.</span><br /> <br /> @@ -4190,9 +6831,9 @@ CRITICAL: Check ICMP6 vulcan.buetow.org: Check command timed out Have a nice day! </pre> <br /> -<h2 style='display: inline' id='Installation'>Installation</h2><br /> +<h2 style='display: inline' id='installation'>Installation</h2><br /> <br /> -<h3 style='display: inline' id='CompilingandinstallingGogios'>Compiling and installing Gogios</h3><br /> +<h3 style='display: inline' id='compiling-and-installing-gogios'>Compiling and installing Gogios</h3><br /> <br /> <span>This document is primarily written for OpenBSD, but applying the corresponding steps to any Unix-like (e.g. Linux-based) operating system should be easy. On systems other than OpenBSD, you may always have to replace <span class='inlinecode'>does</span> with the <span class='inlinecode'>sudo</span> command and replace the <span class='inlinecode'>/usr/local/bin</span> path with <span class='inlinecode'>/usr/bin</span>.</span><br /> <br /> @@ -4202,11 +6843,11 @@ Have a nice day! by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">git clone https</font><font color="#F3E651">:</font><font color="#ff0000">//codeberg</font><font color="#F3E651">.</font><font color="#ff0000">org/snonux/gogios</font><font color="#F3E651">.</font><font color="#ff0000">git</font> -<font color="#ff0000">cd gogios</font> -<font color="#ff0000">go build -o gogios cmd/gogios/main</font><font color="#F3E651">.</font><font color="#ff0000">go</font> -<font color="#ff0000">doas cp gogios /usr/local/bin/gogios</font> -<font color="#ff0000">doas chmod </font><font color="#bb00ff">755</font><font color="#ff0000"> /usr/local/bin/gogios</font> +<pre>git clone https://codeberg.org/snonux/gogios.git +cd gogios +go build -o gogios cmd/gogios/main.go +doas cp gogios /usr/local/bin/gogios +doas chmod <font color="#000000">755</font> /usr/local/bin/gogios </pre> <br /> <span>You can use cross-compilation if you want to compile Gogios for OpenBSD on a Linux system without installing the Go compiler on OpenBSD. Follow these steps:</span><br /> @@ -4215,16 +6856,16 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">export</font></b><font color="#ff0000"> </font><font color="#ff0000">GOOS</font><font color="#F3E651">=</font><font color="#ff0000">openbsd</font> -<b><font color="#ffffff">export</font></b><font color="#ff0000"> </font><font color="#ff0000">GOARCH</font><font color="#F3E651">=</font><font color="#ff0000">amd64</font> -<font color="#ff0000">go build -o gogios cmd/gogios/main</font><font color="#F3E651">.</font><font color="#ff0000">go</font> +<pre><b><u><font color="#000000">export</font></u></b> GOOS=openbsd +<b><u><font color="#000000">export</font></u></b> GOARCH=amd64 +go build -o gogios cmd/gogios/main.go </pre> <br /> <span>On your OpenBSD system, copy the binary to <span class='inlinecode'>/usr/local/bin/gogios</span> and set the correct permissions as described in the previous section. All steps described here you could automate with your configuration management system of choice. I use Rexify, the friendly configuration management system, to automate the installation, but that is out of the scope of this document.</span><br /> <br /> <a class='textlink' href='https://www.rexify.org'>https://www.rexify.org</a><br /> <br /> -<h3 style='display: inline' id='Settingupusergroupanddirectories'>Setting up user, group and directories</h3><br /> +<h3 style='display: inline' id='setting-up-user-group-and-directories'>Setting up user, group and directories</h3><br /> <br /> <span>It is best to create a dedicated system user and group for Gogios to ensure proper isolation and security. Here are the steps to create the <span class='inlinecode'>_gogios</span> user and group under OpenBSD:</span><br /> <br /> @@ -4232,16 +6873,16 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">doas adduser -group _gogios -batch _gogios</font> -<font color="#ff0000">doas usermod -d /var/run/gogios _gogios</font> -<font color="#ff0000">doas mkdir -p /var/run/gogios</font> -<font color="#ff0000">doas chown _gogios</font><font color="#F3E651">:</font><font color="#ff0000">_gogios /var/run/gogios</font> -<font color="#ff0000">doas chmod </font><font color="#bb00ff">750</font><font color="#ff0000"> /var/run/gogios</font> +<pre>doas adduser -group _gogios -batch _gogios +doas usermod -d /var/run/gogios _gogios +doas mkdir -p /var/run/gogios +doas chown _gogios:_gogios /var/run/gogios +doas chmod <font color="#000000">750</font> /var/run/gogios </pre> <br /> <span>Please note that creating a user and group might differ depending on your operating system. For other operating systems, consult their documentation for creating system users and groups.</span><br /> <br /> -<h3 style='display: inline' id='Installingmonitoringplugins'>Installing monitoring plugins</h3><br /> +<h3 style='display: inline' id='installing-monitoring-plugins'>Installing monitoring plugins</h3><br /> <br /> <span>Gogios relies on external Nagios or Icinga monitoring plugin scripts. On OpenBSD, you can install the <span class='inlinecode'>monitoring-plugins</span> package with Gogios. The monitoring-plugins package is a collection of monitoring plugins, similar to Nagios plugins, that can be used to monitor various services and resources:</span><br /> <br /> @@ -4249,15 +6890,15 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">doas pkg_add monitoring-plugins</font> -<font color="#ff0000">doas pkg_add nrpe </font><i><font color="#ababab"># If you want to execute checks remotely via NRPE.</font></i> +<pre>doas pkg_add monitoring-plugins +doas pkg_add nrpe <i><font color="silver"># If you want to execute checks remotely via NRPE.</font></i> </pre> <br /> <span>Once the installation is complete, you can find the monitoring plugins in the <span class='inlinecode'>/usr/local/libexec/nagios</span> directory, which then can be configured to be used in <span class='inlinecode'>gogios.json</span>.</span><br /> <br /> -<h2 style='display: inline' id='Configuration'>Configuration</h2><br /> +<h2 style='display: inline' id='configuration'>Configuration</h2><br /> <br /> -<h3 style='display: inline' id='MTA'>MTA</h3><br /> +<h3 style='display: inline' id='mta'>MTA</h3><br /> <br /> <span>Gogios requires a local Mail Transfer Agent (MTA) such as Postfix or OpenBSD SMTPD running on the same server where the CRON job (see about the CRON job further below) is executed. The local MTA handles email delivery, allowing Gogios to send email notifications to monitor status changes. Before using Gogios, ensure that you have a properly configured MTA installed and running on your server to facilitate the sending of emails. Once the MTA is set up and functioning correctly, Gogios can leverage it to send email notifications.</span><br /> <br /> @@ -4269,7 +6910,7 @@ echo 'This is a test email from OpenBSD.' | mail -s 'Test Email' <br /> <span>Check the recipient's inbox to confirm the delivery of the test email. If the email is delivered successfully, it indicates that your email server is configured correctly and functioning. Please check your MTA logs in case of issues.</span><br /> <br /> -<h3 style='display: inline' id='ConfiguringGogios'>Configuring Gogios</h3><br /> +<h3 style='display: inline' id='configuring-gogios'>Configuring Gogios</h3><br /> <br /> <span>To configure Gogios, create a JSON configuration file (e.g., <span class='inlinecode'>/etc/gogios.json</span>). Here's an example configuration:</span><br /> <br /> @@ -4277,41 +6918,41 @@ echo 'This is a test email from OpenBSD.' | mail -s 'Test Email' by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">{</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">EmailTo</font><font color="#ff0000">"</font><font color="#ff0000">:</font><font color="#ff0000"> "</font><font color="#bb00ff">paul@dev.buetow.org</font><font color="#ff0000">"</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">EmailFrom</font><font color="#ff0000">"</font><font color="#ff0000">:</font><font color="#ff0000"> "</font><font color="#bb00ff">gogios@buetow.org</font><font color="#ff0000">"</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">CheckTimeoutS</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#bb00ff">10</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">CheckConcurrency</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#bb00ff">2</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">StateDir</font><font color="#ff0000">"</font><font color="#ff0000">:</font><font color="#ff0000"> "</font><font color="#bb00ff">/var/run/gogios</font><font color="#ff0000">"</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Checks</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Check ICMP4 www.foo.zone</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Plugin</font><font color="#ff0000">"</font><font color="#ff0000">:</font><font color="#ff0000"> "</font><font color="#bb00ff">/usr/local/libexec/nagios/check_ping</font><font color="#ff0000">"</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Args</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-H</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">www.foo.zone</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-4</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-w</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">50,10%</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-c</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">100,15%</font><font color="#ff0000">"</font><font color="#ff0000"> </font><font color="#F3E651">],</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Retries</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#bb00ff">3</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">RetryInterval</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#bb00ff">10</font> -<font color="#ff0000"> </font><font color="#F3E651">},</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Check ICMP6 www.foo.zone</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Plugin</font><font color="#ff0000">"</font><font color="#ff0000">:</font><font color="#ff0000"> "</font><font color="#bb00ff">/usr/local/libexec/nagios/check_ping</font><font color="#ff0000">"</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Args</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-H</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">www.foo.zone</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-6</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-w</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">50,10%</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-c</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">100,15%</font><font color="#ff0000">"</font><font color="#ff0000"> </font><font color="#F3E651">],</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Retries</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#bb00ff">3</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">RetryInterval</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#bb00ff">10</font> -<font color="#ff0000"> </font><font color="#F3E651">},</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">www.foo.zone HTTP IPv4</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Plugin</font><font color="#ff0000">"</font><font color="#ff0000">:</font><font color="#ff0000"> "</font><font color="#bb00ff">/usr/local/libexec/nagios/check_http</font><font color="#ff0000">"</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Args</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">[</font><font color="#ff0000">"</font><font color="#ff0000">www.foo.zone</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-4</font><font color="#ff0000">"</font><font color="#F3E651">],</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">DependsOn</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">[</font><font color="#ff0000">"</font><font color="#ff0000">Check ICMP4 www.foo.zone</font><font color="#ff0000">"</font><font color="#F3E651">]</font> -<font color="#ff0000"> </font><font color="#F3E651">},</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">www.foo.zone HTTP IPv6</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Plugin</font><font color="#ff0000">"</font><font color="#ff0000">:</font><font color="#ff0000"> "</font><font color="#bb00ff">/usr/local/libexec/nagios/check_http</font><font color="#ff0000">"</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Args</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">[</font><font color="#ff0000">"</font><font color="#ff0000">www.foo.zone</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-6</font><font color="#ff0000">"</font><font color="#F3E651">],</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">DependsOn</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">[</font><font color="#ff0000">"</font><font color="#ff0000">Check ICMP6 www.foo.zone</font><font color="#ff0000">"</font><font color="#F3E651">]</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Check NRPE Disk Usage foo.zone</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Plugin</font><font color="#ff0000">"</font><font color="#ff0000">:</font><font color="#ff0000"> "</font><font color="#bb00ff">/usr/local/libexec/nagios/check_nrpe</font><font color="#ff0000">"</font><font color="#F3E651">,</font> -<font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">Args</font><font color="#ff0000">"</font><font color="#ff0000">: </font><font color="#F3E651">[</font><font color="#ff0000">"</font><font color="#ff0000">-H</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">foo.zone</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-c</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">check_disk</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-p</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">5666</font><font color="#ff0000">"</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#ff0000">"</font><font color="#ff0000">-4</font><font color="#ff0000">"</font><font color="#F3E651">]</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#F3E651">}</font> +<pre>{ + "EmailTo": "<font color="#808080">paul@dev.buetow.org</font>", + "EmailFrom": "<font color="#808080">gogios@buetow.org</font>", + "CheckTimeoutS": <font color="#000000">10</font>, + "CheckConcurrency": <font color="#000000">2</font>, + "StateDir": "<font color="#808080">/var/run/gogios</font>", + "Checks": { + "Check ICMP4 www.foo.zone": { + "Plugin": "<font color="#808080">/usr/local/libexec/nagios/check_ping</font>", + "Args": [ "-H", "www.foo.zone", "-4", "-w", "50,10%", "-c", "100,15%" ], + "Retries": <font color="#000000">3</font>, + "RetryInterval": <font color="#000000">10</font> + }, + "Check ICMP6 www.foo.zone": { + "Plugin": "<font color="#808080">/usr/local/libexec/nagios/check_ping</font>", + "Args": [ "-H", "www.foo.zone", "-6", "-w", "50,10%", "-c", "100,15%" ], + "Retries": <font color="#000000">3</font>, + "RetryInterval": <font color="#000000">10</font> + }, + "www.foo.zone HTTP IPv4": { + "Plugin": "<font color="#808080">/usr/local/libexec/nagios/check_http</font>", + "Args": ["www.foo.zone", "-4"], + "DependsOn": ["Check ICMP4 www.foo.zone"] + }, + "www.foo.zone HTTP IPv6": { + "Plugin": "<font color="#808080">/usr/local/libexec/nagios/check_http</font>", + "Args": ["www.foo.zone", "-6"], + "DependsOn": ["Check ICMP6 www.foo.zone"] + } + "Check NRPE Disk Usage foo.zone": { + "Plugin": "<font color="#808080">/usr/local/libexec/nagios/check_nrpe</font>", + "Args": ["-H", "foo.zone", "-c", "check_disk", "-p", "5666", "-4"] + } + } +} </pre> <br /> <ul> @@ -4332,7 +6973,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>The <span class='inlinecode'>state.json</span> file mentioned above keeps track of the monitoring state and check results between Gogios runs, enabling Gogios only to send email notifications when there are changes in the check status.</span><br /> <br /> -<h2 style='display: inline' id='RunningGogios'>Running Gogios</h2><br /> +<h2 style='display: inline' id='running-gogios'>Running Gogios</h2><br /> <br /> <span>Now it is time to give it a first run. On OpenBSD, do:</span><br /> <br /> @@ -4340,7 +6981,7 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">doas -u _gogios /usr/local/bin/gogios -cfg /etc/gogios</font><font color="#F3E651">.</font><font color="#ff0000">json</font> +<pre>doas -u _gogios /usr/local/bin/gogios -cfg /etc/gogios.json </pre> <br /> <span>To run Gogios via CRON on OpenBSD as the <span class='inlinecode'>gogios</span> user and check all services once per minute, follow these steps:</span><br /> @@ -4354,7 +6995,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Gogios is now configured to run every five minutes from 8 am to 10 pm via CRON as the <span class='inlinecode'>_gogios</span> user. It will execute the checks and send monitoring status whenever a check status changes via email according to your configuration. Also, Gogios will run once at 7 am every morning and re-notify all unhandled alerts as a reminder.</span><br /> <br /> -<h3 style='display: inline' id='Highavailability'>High-availability</h3><br /> +<h3 style='display: inline' id='high-availability'>High-availability</h3><br /> <br /> <span>To create a high-availability Gogios setup, you can install Gogios on two servers that will monitor each other using the NRPE (Nagios Remote Plugin Executor) plugin. By running Gogios in alternate CRON intervals on both servers, you can ensure that even if one server goes down, the other will continue monitoring your infrastructure and sending notifications.</span><br /> <br /> @@ -4367,7 +7008,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>There are plans to make it possible to execute certain checks only on certain nodes (e.g. on elected leader or master nodes). This is still in progress (check out my Gorum Git project).</span><br /> <br /> -<h2 style='display: inline' id='Conclusion'>Conclusion:</h2><br /> +<h2 style='display: inline' id='conclusion'>Conclusion:</h2><br /> <br /> <span>Gogios is a lightweight and straightforward monitoring tool that is perfect for small-scale environments. With its compatibility with the Nagios Check API, email notifications, and CRON-based scheduling, Gogios offers an easy-to-use solution for those looking to monitor a limited number of resources. I personally use it to execute around 500 checks on my personal server infrastructure. I am very happy with this solution.</span><br /> <br /> @@ -4375,10 +7016,10 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other KISS-related posts are:</span><br /> <br /> -<a class='textlink' href='./2021-09-12-keep-it-simple-and-stupid.html'>2021-09-12 Keep it simple and stupid</a><br /> -<a class='textlink' href='./2023-06-01-kiss-server-monitoring-with-gogios.html'>2023-06-01 KISS server monitoring with Gogios (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.html'>2023-10-29 KISS static web photo albums with <span class='inlinecode'>photoalbum.sh</span></a><br /> <a class='textlink' href='./2024-04-01-KISS-high-availability-with-OpenBSD.html'>2024-04-01 KISS high-availability with OpenBSD</a><br /> +<a class='textlink' href='./2023-10-29-kiss-static-web-photo-albums-with-photoalbum.sh.html'>2023-10-29 KISS static web photo albums with <span class='inlinecode'>photoalbum.sh</span></a><br /> +<a class='textlink' href='./2023-06-01-kiss-server-monitoring-with-gogios.html'>2023-06-01 KISS server monitoring with Gogios (You are currently reading this)</a><br /> +<a class='textlink' href='./2021-09-12-keep-it-simple-and-stupid.html'>2021-09-12 Keep it simple and stupid</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> @@ -4396,13 +7037,12 @@ http://www.gnu.org/software/src-highlite --> <summary>These are my personal takeaways after reading 'The Obstacle Is the Way' by Ryan Holiday. This is mainly for my own use, but you might find it helpful too.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='TheObstacleistheWaybooknotes'>"The Obstacle is the Way" book notes</h1><br /> + <h1 style='display: inline' id='the-obstacle-is-the-way-book-notes'>"The Obstacle is the Way" book notes</h1><br /> <br /> <span class='quote'>Published at 2023-05-06T17:23:16+03:00</span><br /> <br /> <span>These are my personal takeaways after reading "The Obstacle Is the Way" by Ryan Holiday. This is mainly for my own use, but you might find it helpful too.</span><br /> <br /> -<br /> <pre> ,.......... .........., ,..,' '.' ',.., @@ -4415,9 +7055,26 @@ http://www.gnu.org/software/src-highlite --> ''' </pre> <br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#the-obstacle-is-the-way-book-notes'>"The Obstacle is the Way" book notes</a></li> +<li>⇢ <a href='#reframe-your-perspective'>Reframe your perspective</a></li> +<li>⇢ <a href='#embrace-rationality'>Embrace rationality</a></li> +<li>⇢ <a href='#control-your-response'>Control your response</a></li> +<li>⇢ <a href='#practice-emotional-and-physical-resilience'>Practice emotional and physical resilience</a></li> +<li>⇢ <a href='#persistence-and-patience'>Persistence and patience</a></li> +<li>⇢ <a href='#embrace-failure'>Embrace failure</a></li> +<li>⇢ <a href='#be-adaptable'>Be adaptable</a></li> +<li>⇢ <a href='#embrace-non-action'>Embrace non-action</a></li> +<li>⇢ <a href='#leverage-crisis'>Leverage crisis</a></li> +<li>⇢ <a href='#build-your-inner-citadel'>Build your inner citadel</a></li> +<li>⇢ <a href='#love-everything-that-happens'>Love everything that happens</a></li> +<li>⇢ <a href='#conclusion'>Conclusion</a></li> +</ul><br /> <span>"The obstacle is the way" is a powerful statement that encapsulates the wisdom of turning challenges into opportunities for growth and success. We will explore using obstacles as fuel, transforming weaknesses into strengths, and adopting a mindset that allows us to be creative and persistent in the face of adversity.</span><br /> <br /> -<h2 style='display: inline' id='Reframeyourperspective'>Reframe your perspective</h2><br /> +<h2 style='display: inline' id='reframe-your-perspective'>Reframe your perspective</h2><br /> <br /> <span>The obstacle in your path can become your path to success. Instead of being paralyzed by challenges, see them as opportunities to learn and grow. Remember, the things that hurt us often instruct us. </span><br /> <br /> @@ -4425,38 +7082,37 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Don't always try to use the front door; a backdoor could open. It's nonsense. Don't fight the judo master with judo. Non-action can be action, exposing the weaknesses of others.</span><br /> <br /> -<br /> -<h2 style='display: inline' id='Embracerationality'>Embrace rationality</h2><br /> +<h2 style='display: inline' id='embrace-rationality'>Embrace rationality</h2><br /> <br /> <span>It is a superpower to see things rationally when others are fearful. Focus on the reality of the situation without letting emotions, such as anger, cloud your judgment. This ability will enable you to make better decisions in adversity. Ability to see things what they really are. E.g. wine is old fermented grapes, or other people behaving like animals during a fight. Show the middle finger if someone persists on the stupid rules occasionally.</span><br /> <br /> -<h2 style='display: inline' id='Controlyourresponse'>Control your response</h2><br /> +<h2 style='display: inline' id='control-your-response'>Control your response</h2><br /> <br /> <span>You can choose how you respond to obstacles. Focus on what you can control, and don't let yourself feel harmed by external circumstances. Remember, you decide how things affect you; nobody else does. Choose to feel good in response to any situation. Embrace the challenges and obstacles that come your way, as they are opportunities for growth and learning.</span><br /> <br /> -<h2 style='display: inline' id='Practiceemotionalandphysicalresilience'>Practice emotional and physical resilience</h2><br /> +<h2 style='display: inline' id='practice-emotional-and-physical-resilience'>Practice emotional and physical resilience</h2><br /> <br /> <span>Martial artists know the importance of developing physical and emotional strength. Cultivate the art of not panicking; it will help you avoid making mistakes during high-pressure situations.</span><br /> <br /> <span>Focus on what you can control. Don't choose to feel harmed, and then you won't be harmed. I decide things that affect me; nobody else does. E.g., in prison, your mind stays your own. Don't ignore fear but explain it away, have a different view.</span><br /> <br /> -<h2 style='display: inline' id='Persistenceandpatience'>Persistence and patience</h2><br /> +<h2 style='display: inline' id='persistence-and-patience'>Persistence and patience</h2><br /> <br /> <span>Practice persistence and patience in your pursuits. Focus on the process rather than the prize and take one step at a time. Remember, the journey is about finishing tasks, projects, or workouts to the best of your ability. Never be in a hurry and never be desperate. There is no reason to be rushed; there are all in the long haul. Follow the process and not the price. Take it one step at a time. The process is about finishing (workout, task, project, etc.).</span><br /> <br /> -<h2 style='display: inline' id='Embracefailure'>Embrace failure</h2><br /> +<h2 style='display: inline' id='embrace-failure'>Embrace failure</h2><br /> <br /> <span>Failure is a natural part of life and can make us stronger. Treat defeat as a stepping stone to success and education. What is defeat? The first step to education. Failure makes you stronger. If we do our best, we can be proud of it, regardless of the result. Do your job, but do it right. Only an asshole thinks he is too good at the things he does. Also, asking for forgiveness is easier than asking for permission. </span><br /> <br /> -<h2 style='display: inline' id='Beadaptable'>Be adaptable</h2><br /> +<h2 style='display: inline' id='be-adaptable'>Be adaptable</h2><br /> <br /> <span>There are many ways to achieve your goals; sometimes, unconventional methods are necessary. Feel free to break the rules or go off the beaten path if it will lead to better results. Transform weaknesses into strengths. We have a choice of how to respond to things. It's not about being positive but to be creative. Aim high, but stuff will happen; E.g., surprises will always happen.</span><br /> <br /> -<h2 style='display: inline' id='Embracenonaction'>Embrace non-action</h2><br /> +<h2 style='display: inline' id='embrace-non-action'>Embrace non-action</h2><br /> <br /> <span>We constantly push to the next thing. Sometimes the best course of action is standing still or even going backwards. Obstacles might resolve by themselves. Or going sideways. Sometimes, the best action is to stand still, go sideways, or even go backwards. Obstacles may resolve themselves or present new opportunities if you're patient and observant. People always want your input before you have all the facts. They want you to play after their rules. The question is, do you let them? The English call it the cool head. Being in control of Stress; requires practice. Appear, the absence of fear (Greek). When all others do it one way, it does not mean it is the correct or best practice.</span><br /> <br /> -<h2 style='display: inline' id='Leveragecrisis'>Leverage crisis</h2><br /> +<h2 style='display: inline' id='leverage-crisis'>Leverage crisis</h2><br /> <br /> <span>In times of crisis, seize the chance to do things never done before. Great people use negative situations to their advantage and become the most effective in challenging circumstances.</span><br /> <br /> @@ -4464,19 +7120,19 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Be prepared for nothing to work. Problems are an opportunity to do your best, not to do miracles. Always manage your expectations. It will suck, but it will be ok. Be prepared to begin from the beginning. Be cheerful and eagerly work on the next obstacle. Each time you become better. Life is not a sprint but a marathon. After each obstacle lies another obstacle, there won't be anything without obstacles. Passing one means you are ready for the next.</span><br /> <br /> -<h2 style='display: inline' id='Buildyourinnercitadel'>Build your inner citadel</h2><br /> +<h2 style='display: inline' id='build-your-inner-citadel'>Build your inner citadel</h2><br /> <br /> <span>Develop your inner strength during good times so you can rely on it in bad times. Always prepare for adversity and face it with calmness and resilience. Be humble enough that things which happen will happen. Build your inner citadel. In good times strengthen it. In bad times rely on it.</span><br /> <br /> <span>We should always prepare for things to get tough. Your house burns down: no worries, we eliminated much rubbish. Imagine what can go wrong before things go wrong. We are prepared for adversity; it's other people who aren't. Phil Jackson's hip problem example. To receive unexpected benefits, you must first accept the unexpected obstacles. Meditate on death. It's a universal obstacle. Use it as a reminder to do your best.</span><br /> <br /> -<h2 style='display: inline' id='Loveeverythingthathappens'>Love everything that happens</h2><br /> +<h2 style='display: inline' id='love-everything-that-happens'>Love everything that happens</h2><br /> <br /> <span>Turn an obstacle the other way around for your benefit. Use it at fuel. It's simple but challenging. Most are paralyzed instead. The obstacle in the path becomes the path. Obstacles are neither good nor bad. The things which hurt, instruct.</span><br /> <br /> <span>Should I hate people who hate me? That's their problem and not mine. Be always calm and relaxed during the fight. The story of the battle is the story of the smile. Cheerfulness in all situations, especially the bad ones. Love for everything that happens; if it happens, it was meant to happen. We can choose how we react to things, so why not choose to feel good? I love everything that happens. You must never lower yourself to the person you don't like.</span><br /> <br /> -<h2 style='display: inline' id='Conclusion'>Conclusion</h2><br /> +<h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> <br /> <span>Life is a marathon, not a sprint. Each obstacle we overcome prepares us for the next one. Remember, the obstacle is not just a barrier to be turned upside down; it can also be used as a catapult to propel us forward. By embracing challenges and using them as opportunities for growth, we become stronger, more adaptable, and, ultimately, more successful.</span><br /> <br /> @@ -4484,15 +7140,15 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other book notes of mine are:</span><br /> <br /> -<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> -<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> -<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> -<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> -<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2024-10-24-staff-engineer-book-notes.html'>2024-10-24 "Staff Engineer" book notes</a><br /> <a class='textlink' href='./2024-07-07-the-stoic-challenge-book-notes.html'>2024-07-07 "The Stoic Challenge" book notes</a><br /> +<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> +<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> +<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> <br /> -<a class='textlink' href='../resources.html'>More books and other resources I found useful.</a><br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> @@ -4509,7 +7165,7 @@ http://www.gnu.org/software/src-highlite --> <summary>For fun, I am tracking the uptime of various personal machines (servers, laptops, workstations...). I have been doing this for over ten years now, so I have a lot of statistics collected.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='UnveilingguprecordsrakuGlobalUptimeRecordswithRaku'>Unveiling <span class='inlinecode'>guprecords.raku</span>: Global Uptime Records with Raku</h1><br /> + <h1 style='display: inline' id='unveiling-guprecordsraku-global-uptime-records-with-raku'>Unveiling <span class='inlinecode'>guprecords.raku</span>: Global Uptime Records with Raku</h1><br /> <br /> <span class='quote'>Published at 2023-04-30T13:10:26+03:00</span><br /> <br /> @@ -4530,7 +7186,16 @@ http://www.gnu.org/software/src-highlite --> +-----+-----------------+-----------------------------+ </pre> <br /> -<h1 style='display: inline' id='Introduction'>Introduction</h1><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#unveiling-guprecordsraku-global-uptime-records-with-raku'>Unveiling <span class='inlinecode'>guprecords.raku</span>: Global Uptime Records with Raku</a></li> +<li>⇢ <a href='#introduction'>Introduction</a></li> +<li>⇢ <a href='#how-guprecords-works'>How Guprecords works</a></li> +<li>⇢ <a href='#example'>Example</a></li> +<li>⇢ <a href='#conclusion'>Conclusion</a></li> +</ul><br /> +<h2 style='display: inline' id='introduction'>Introduction</h2><br /> <br /> <span>For fun, I am tracking the uptime of various personal machines (servers, laptops, workstations...). I have been doing this for over ten years now, so I have a lot of statistics collected.</span><br /> <br /> @@ -4553,7 +7218,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>And I have been following the Raku newsletter, and sometimes I have been lurking around in the IRC channels, too. Watching Raku coding challenges on YouTube was pretty fun, too. However, nothing beats actually using Raku to learn the language. After reading all of these resources, I may have a good idea about the features and paradigms, but I am by far not an expert.</span><br /> <br /> -<h2 style='display: inline' id='HowGuprecordsworks'>How Guprecords works</h2><br /> +<h2 style='display: inline' id='how-guprecords-works'>How Guprecords works</h2><br /> <br /> <span>Guprecords works in three stages:</span><br /> <br /> @@ -4566,7 +7231,7 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">$ raku guprecords</font><font color="#F3E651">.</font><font color="#ff0000">raku --stats</font><font color="#F3E651">=</font><font color="#ff0000">dir</font><font color="#F3E651">=</font><font color="#ff0000">$HOME</font><font color="#ff0000">/git/uprecords/stats --all</font> +<pre>$ raku guprecords.raku --stats=dir=$HOME/git/uprecords/stats --all </pre> <br /> <span>This command will generate a comprehensive uptime report from the collected statistics, making it easy to review and enjoy the data.</span><br /> @@ -4579,7 +7244,7 @@ http://www.gnu.org/software/src-highlite --> <li>Output formats available: Plaintext, Markdown, and Gemtext</li> <li>Provides top entries based on the specified limit</li> </ul><br /> -<h2 style='display: inline' id='Example'>Example</h2><br /> +<h2 style='display: inline' id='example'>Example</h2><br /> <br /> <span>You have already seen an example at the very top of this post, where the hosts were grouped by their total lifespans (uptime+downtime). Here's an example of what the global uptime report (grouped by total host uptimes) might look like:</span><br /> <br /> @@ -4650,7 +7315,7 @@ no1 in 455 days, 18:52:44 | at Sun Jul 21 07:37:51 2024 %up 99.997 | since Tue Dec 18 10:16:08 2018 </pre> <br /> -<h2 style='display: inline' id='Conclusion'>Conclusion</h2><br /> +<h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> <br /> <span>Guprecords is a small, yet powerful tool for analyzing uptime statistics. While developing Guprecords, I have come to truly appreciate and love Raku's expressiveness. The language is designed to be both powerful and flexible, allowing developers to express their intentions and logic more clearly and concisely.</span><br /> <br /> @@ -4669,284 +7334,11 @@ no1 in 455 days, 18:52:44 | at Sun Jul 21 07:37:51 2024 <br /> <span>Other related posts are:</span><br /> <br /> -<a class='textlink' href='./2008-06-26-perl-poetry.html'>2008-06-26 Perl Poetry</a><br /> -<a class='textlink' href='./2011-05-07-perl-daemon-service-framework.html'>2011-05-07 Perl Daemon (Service Framework)</a><br /> -<a class='textlink' href='./2022-05-27-perl-is-still-a-great-choice.html'>2022-05-27 Perl is still a great choice</a><br /> -<a class='textlink' href='./2022-06-15-sweating-the-small-stuff.html'>2022-06-15 Sweating the small stuff - Tiny projects of mine</a><br /> <a class='textlink' href='./2023-05-01-unveiling-guprecords:-uptime-records-with-raku.html'>2023-05-01 Unveiling <span class='inlinecode'>guprecords.raku</span>: Global Uptime Records with Raku (You are currently reading this)</a><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>Algorithms and Data Structures in Go - Part 1</title> - <link href="gemini://foo.zone/gemfeed/2023-04-09-algorithms-and-data-structures-in-golang-part-1.gmi" /> - <id>gemini://foo.zone/gemfeed/2023-04-09-algorithms-and-data-structures-in-golang-part-1.gmi</id> - <updated>2023-04-09T22:31:42+03:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>This is the first blog post about my Algorithms and Data Structures in Go series. I am not a Software Developer in my day job. In my current role, programming and scripting skills are desirable but not mandatory. I have been learning about Data Structures and Algorithms many years ago at University. I thought it would be fun to revisit/refresh my knowledge here and implement many of the algorithms in Go.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='AlgorithmsandDataStructuresinGoPart1'>Algorithms and Data Structures in Go - Part 1</h1><br /> -<br /> -<span class='quote'>Published at 2023-04-09T22:31:42+03:00</span><br /> -<br /> -<pre> - ,_---~~~~~----._ - _,,_,*^____ _____``*g*\"*, - / __/ /' ^. / \ ^@q f -[ @f | @)) | | @)) l 0 _/ - \`/ \~____ / __ \_____/ \ - | _l__l_ I - } [______] I - ] | | | | - ] ~ ~ | - | | - | | -</pre> -<br /> -<span>This is the first blog post about my Algorithms and Data Structures in Go series. I am not a Software Developer in my day job. In my current role, programming and scripting skills are desirable but not mandatory. I have been learning about Data Structures and Algorithms many years ago at University. I thought it would be fun to revisit/refresh my knowledge here and implement many of the algorithms in Go.</span><br /> -<br /> -<a class='textlink' href='./2023-04-09-algorithms-and-data-structures-in-golang-part-1.html'>2023-04-09 Algorithms and Data Structures in Go - Part 1 (You are currently reading this)</a><br /> -<br /> -<span>This post is about setting up some basic data structures and methods for this blog series. I promise, everything will be easy to follow in this post. It will become more interesting later in this series.</span><br /> -<br /> -<h2 style='display: inline' id='Typeconstraints'>Type constraints</h2><br /> -<br /> -<span>First, the package <span class='inlinecode'>ds</span> (data structures) defines the <span class='inlinecode'>types.go</span>. All examples will either operate on the <span class='inlinecode'>Integer</span> or <span class='inlinecode'>Number</span> type:</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">package</font></b><font color="#ff0000"> ds</font> - -<b><font color="#ffffff">import</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font> -<font color="#ff0000"> </font><font color="#bb00ff">"golang.org/x/exp/constraints"</font> -<font color="#F3E651">)</font> - -<b><font color="#ffffff">type</font></b><font color="#ff0000"> Integer </font><b><font color="#ffffff">interface</font></b><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> constraints</font><font color="#F3E651">.</font><font color="#ff0000">Integer</font> -<font color="#F3E651">}</font> - -<b><font color="#ffffff">type</font></b><font color="#ff0000"> Number </font><b><font color="#ffffff">interface</font></b><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> constraints</font><font color="#F3E651">.</font><font color="#ff0000">Integer </font><font color="#F3E651">|</font><font color="#ff0000"> constraints</font><font color="#F3E651">.</font><font color="#ff0000">Float</font> -<font color="#F3E651">}</font> - -</pre> -<br /> -<h2 style='display: inline' id='ArrayList'>ArrayList</h2><br /> -<br /> -<span>Next comes the <span class='inlinecode'>arraylist.go</span>, which defines the underlying data structure all the algorithms of this series will use. <span class='inlinecode'>ArrayList</span> is just a type alias of a Go array (or slice) with custom methods on it:</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">package</font></b><font color="#ff0000"> ds</font> - -<b><font color="#ffffff">import</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font> -<font color="#ff0000"> </font><font color="#bb00ff">"fmt"</font> -<font color="#ff0000"> </font><font color="#bb00ff">"math/rand"</font> -<font color="#ff0000"> </font><font color="#bb00ff">"strings"</font> -<font color="#F3E651">)</font> - -<b><font color="#ffffff">type</font></b><font color="#ff0000"> ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V Number</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">[]</font><font color="#ff0000">V</font> - -<b><font color="#ffffff">func</font></b><font color="#ff0000"> NewArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V Number</font><font color="#F3E651">](</font><font color="#ff0000">l int</font><font color="#F3E651">)</font><font color="#ff0000"> ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> </font><font color="#7bc710">make</font><font color="#F3E651">(</font><font color="#ff0000">ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">],</font><font color="#ff0000"> l</font><font color="#F3E651">)</font> -<font color="#F3E651">}</font> -</pre> -<br /> -<span>As you can see, the code uses Go generics, which I refactored recently. Besides the default constructor (which only returns an empty <span class='inlinecode'>ArrayList</span> with a given capacity), there are also a bunch of special constructors. <span class='inlinecode'>NewRandomArrayList</span> is returning an <span class='inlinecode'>ArrayList</span> with random numbers, <span class='inlinecode'>NewAscendingArrayList</span> and <span class='inlinecode'>NewDescendingArrayList</span> are returning <span class='inlinecode'>ArrayList</span>s in either ascending or descending order. They all will be used later on for testing and benchmarking the algorithms.</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">func</font></b><font color="#ff0000"> NewRandomArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V Number</font><font color="#F3E651">](</font><font color="#ff0000">l</font><font color="#F3E651">,</font><font color="#ff0000"> max int</font><font color="#F3E651">)</font><font color="#ff0000"> ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> a </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><font color="#7bc710">make</font><font color="#F3E651">(</font><font color="#ff0000">ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">],</font><font color="#ff0000"> l</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> i </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> i </font><font color="#F3E651"><</font><font color="#ff0000"> l</font><font color="#F3E651">;</font><font color="#ff0000"> i</font><font color="#F3E651">++</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> max </font><font color="#F3E651">></font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">i</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#7bc710">V</font><font color="#F3E651">(</font><font color="#ff0000">rand</font><font color="#F3E651">.</font><font color="#7bc710">Intn</font><font color="#F3E651">(</font><font color="#ff0000">max</font><font color="#F3E651">))</font> -<font color="#ff0000"> </font><b><font color="#ffffff">continue</font></b> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">i</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#7bc710">V</font><font color="#F3E651">(</font><font color="#ff0000">rand</font><font color="#F3E651">.</font><font color="#7bc710">Int</font><font color="#F3E651">())</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> a</font> -<font color="#F3E651">}</font> - -<b><font color="#ffffff">func</font></b><font color="#ff0000"> NewAscendingArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V Number</font><font color="#F3E651">](</font><font color="#ff0000">l int</font><font color="#F3E651">)</font><font color="#ff0000"> ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> a </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><font color="#7bc710">make</font><font color="#F3E651">(</font><font color="#ff0000">ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">],</font><font color="#ff0000"> l</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> i </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> i </font><font color="#F3E651"><</font><font color="#ff0000"> l</font><font color="#F3E651">;</font><font color="#ff0000"> i</font><font color="#F3E651">++</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">i</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#7bc710">V</font><font color="#F3E651">(</font><font color="#ff0000">i</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> a</font> -<font color="#F3E651">}</font> - -<b><font color="#ffffff">func</font></b><font color="#ff0000"> NewDescendingArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V Number</font><font color="#F3E651">](</font><font color="#ff0000">l int</font><font color="#F3E651">)</font><font color="#ff0000"> ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> a </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><font color="#7bc710">make</font><font color="#F3E651">(</font><font color="#ff0000">ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">],</font><font color="#ff0000"> l</font><font color="#F3E651">)</font> -<font color="#ff0000"> j </font><font color="#F3E651">:=</font><font color="#ff0000"> l </font><font color="#F3E651">-</font><font color="#ff0000"> </font><font color="#bb00ff">1</font> -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> i </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> i </font><font color="#F3E651"><</font><font color="#ff0000"> l</font><font color="#F3E651">;</font><font color="#ff0000"> i</font><font color="#F3E651">++</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">i</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#7bc710">V</font><font color="#F3E651">(</font><font color="#ff0000">j</font><font color="#F3E651">)</font> -<font color="#ff0000"> j</font><font color="#F3E651">--</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> a</font> -<font color="#F3E651">}</font> -</pre> -<br /> -<h2 style='display: inline' id='Helpermethods'>Helper methods</h2><br /> -<br /> -<span>The <span class='inlinecode'>FirstN</span> method only returns the first N elements of the <span class='inlinecode'>ArrayList</span>. This is useful for printing out only parts of the data structure:</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">func</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><font color="#ff0000">a ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">])</font><font color="#ff0000"> </font><font color="#7bc710">FirstN</font><font color="#F3E651">(</font><font color="#ff0000">n int</font><font color="#F3E651">)</font><font color="#ff0000"> </font><b><font color="#F35E1E">string</font></b><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#ffffff">var</font></b><font color="#ff0000"> sb strings</font><font color="#F3E651">.</font><font color="#ff0000">Builder</font> -<font color="#ff0000"> j </font><font color="#F3E651">:=</font><font color="#ff0000"> n</font> - -<font color="#ff0000"> l </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><font color="#7bc710">len</font><font color="#F3E651">(</font><font color="#ff0000">a</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> j </font><font color="#F3E651">></font><font color="#ff0000"> l </font><font color="#F3E651">{</font> -<font color="#ff0000"> j </font><font color="#F3E651">=</font><font color="#ff0000"> l</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> - -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> i </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> i </font><font color="#F3E651"><</font><font color="#ff0000"> j</font><font color="#F3E651">;</font><font color="#ff0000"> i</font><font color="#F3E651">++</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> fmt</font><font color="#F3E651">.</font><font color="#7bc710">Fprintf</font><font color="#F3E651">(&</font><font color="#ff0000">sb</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">"%v "</font><font color="#F3E651">,</font><font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">i</font><font color="#F3E651">])</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> - -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> j </font><font color="#F3E651"><</font><font color="#ff0000"> l </font><font color="#F3E651">{</font> -<font color="#ff0000"> fmt</font><font color="#F3E651">.</font><font color="#7bc710">Fprintf</font><font color="#F3E651">(&</font><font color="#ff0000">sb</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">"... "</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> - -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> sb</font><font color="#F3E651">.</font><font color="#7bc710">String</font><font color="#F3E651">()</font> -<font color="#F3E651">}</font> -</pre> -<br /> -<span>The <span class='inlinecode'>Sorted</span> method checks whether the <span class='inlinecode'>ArrayList</span> is sorted. This will be used by the unit tests later on:</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">func</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><font color="#ff0000">a ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">])</font><font color="#ff0000"> </font><font color="#7bc710">Sorted</font><font color="#F3E651">()</font><font color="#ff0000"> </font><b><font color="#F35E1E">bool</font></b><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> i </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><font color="#7bc710">len</font><font color="#F3E651">(</font><font color="#ff0000">a</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#F3E651">-</font><font color="#ff0000"> </font><font color="#bb00ff">1</font><font color="#F3E651">;</font><font color="#ff0000"> i </font><font color="#F3E651">></font><font color="#ff0000"> </font><font color="#bb00ff">0</font><font color="#F3E651">;</font><font color="#ff0000"> i</font><font color="#F3E651">--</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">i</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651"><</font><font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">i</font><font color="#F3E651">-</font><font color="#bb00ff">1</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> false</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> true</font> -<font color="#F3E651">}</font> -</pre> -<br /> -<span>And the last utility method used is <span class='inlinecode'>Swap</span>, which allows swapping the values of two indices in the <span class='inlinecode'>ArrayList</span>:</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">func</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font><font color="#ff0000">a ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">])</font><font color="#ff0000"> </font><font color="#7bc710">Swap</font><font color="#F3E651">(</font><font color="#ff0000">i</font><font color="#F3E651">,</font><font color="#ff0000"> j int</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> aux </font><font color="#F3E651">:=</font><font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">i</font><font color="#F3E651">]</font> -<font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">i</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">j</font><font color="#F3E651">]</font> -<font color="#ff0000"> a</font><font color="#F3E651">[</font><font color="#ff0000">j</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">=</font><font color="#ff0000"> aux</font> -<font color="#F3E651">}</font> - -</pre> -<br /> -<h2 style='display: inline' id='Sleepsort'>Sleep sort</h2><br /> -<br /> -<span>Let's implement our first algorithm, sleep sort. Sleep sort is a non-traditional and unconventional sorting algorithm based on the idea of waiting a certain amount of time corresponding to the value of each element in the input <span class='inlinecode'>ArrayList</span>. It's more of a fun, creative concept rather than an efficient or practical sorting technique. This is not a sorting algorithm you would use in any production code. As you can imagine, it is quite an inefficient sorting algorithm (it's only listed here as a warm-up exercise). This sorting method may also return false results depending on how the Goroutines are scheduled by the Go runtime. </span><br /> -<br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">package</font></b><font color="#ff0000"> sort</font> - -<b><font color="#ffffff">import</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font> -<font color="#ff0000"> </font><font color="#bb00ff">"codeberg.org/snonux/algorithms/ds"</font> -<font color="#ff0000"> </font><font color="#bb00ff">"sync"</font> -<font color="#ff0000"> </font><font color="#bb00ff">"time"</font> -<font color="#F3E651">)</font> - -<b><font color="#ffffff">func</font></b><font color="#ff0000"> Sleep</font><font color="#F3E651">[</font><font color="#ff0000">V ds</font><font color="#F3E651">.</font><font color="#ff0000">Integer</font><font color="#F3E651">](</font><font color="#ff0000">a ds</font><font color="#F3E651">.</font><font color="#ff0000">ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">])</font><font color="#ff0000"> ds</font><font color="#F3E651">.</font><font color="#ff0000">ArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">]</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> sorted </font><font color="#F3E651">:=</font><font color="#ff0000"> ds</font><font color="#F3E651">.</font><font color="#ff0000">NewArrayList</font><font color="#F3E651">[</font><font color="#ff0000">V</font><font color="#F3E651">](</font><font color="#7bc710">len</font><font color="#F3E651">(</font><font color="#ff0000">a</font><font color="#F3E651">))</font> - -<font color="#ff0000"> numCh </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><font color="#7bc710">make</font><font color="#F3E651">(</font><b><font color="#ffffff">chan</font></b><font color="#ff0000"> V</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><b><font color="#ffffff">var</font></b><font color="#ff0000"> wg sync</font><font color="#F3E651">.</font><font color="#ff0000">WaitGroup</font> -<font color="#ff0000"> wg</font><font color="#F3E651">.</font><font color="#7bc710">Add</font><font color="#F3E651">(</font><font color="#7bc710">len</font><font color="#F3E651">(</font><font color="#ff0000">a</font><font color="#F3E651">))</font> - -<font color="#ff0000"> </font><b><font color="#ffffff">go</font></b><font color="#ff0000"> </font><b><font color="#ffffff">func</font></b><font color="#F3E651">()</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> wg</font><font color="#F3E651">.</font><font color="#7bc710">Wait</font><font color="#F3E651">()</font> -<font color="#ff0000"> </font><font color="#7bc710">close</font><font color="#F3E651">(</font><font color="#ff0000">numCh</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font><font color="#F3E651">()</font> - -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> _</font><font color="#F3E651">,</font><font color="#ff0000"> num </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><b><font color="#ffffff">range</font></b><font color="#ff0000"> a </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#ffffff">go</font></b><font color="#ff0000"> </font><b><font color="#ffffff">func</font></b><font color="#F3E651">(</font><font color="#ff0000">num V</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> </font><b><font color="#ffffff">defer</font></b><font color="#ff0000"> wg</font><font color="#F3E651">.</font><font color="#7bc710">Done</font><font color="#F3E651">()</font> -<font color="#ff0000"> time</font><font color="#F3E651">.</font><font color="#7bc710">Sleep</font><font color="#F3E651">(</font><font color="#ff0000">time</font><font color="#F3E651">.</font><font color="#7bc710">Duration</font><font color="#F3E651">(</font><font color="#ff0000">num</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#F3E651">*</font><font color="#ff0000"> time</font><font color="#F3E651">.</font><font color="#ff0000">Second</font><font color="#F3E651">)</font> -<font color="#ff0000"> numCh </font><font color="#F3E651"><-</font><font color="#ff0000"> num</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font><font color="#F3E651">(</font><font color="#ff0000">num</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> - -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> num </font><font color="#F3E651">:=</font><font color="#ff0000"> </font><b><font color="#ffffff">range</font></b><font color="#ff0000"> numCh </font><font color="#F3E651">{</font> -<font color="#ff0000"> sorted </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#7bc710">append</font><font color="#F3E651">(</font><font color="#ff0000">sorted</font><font color="#F3E651">,</font><font color="#ff0000"> num</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> - -<font color="#ff0000"> </font><b><font color="#ffffff">return</font></b><font color="#ff0000"> sorted</font> -<font color="#F3E651">}</font> -</pre> -<br /> -<span>This Go code implements the sleep sort algorithm using generics and goroutines. The main function <span class='inlinecode'>Sleep[V ds.Integer](a ds.ArrayList[V]) ds.ArrayList[V]</span> takes a generic <span class='inlinecode'>ArrayList</span> as input and returns a sorted <span class='inlinecode'>ArrayList</span>. The code creates a separate goroutine for each element in the input array, sleeps for a duration proportional to the element's value, and then sends the element to a channel. Another goroutine waits for all the sleeping goroutines to finish and then closes the channel. The sorted result <span class='inlinecode'>ArrayList</span> is constructed by appending the elements received from the channel in the order they arrive. The <span class='inlinecode'>sync.WaitGroup</span> is used to synchronize goroutines and ensure that all of them have completed before closing the channel.</span><br /> -<br /> -<h3 style='display: inline' id='Testing'>Testing</h3><br /> -<br /> -<span>For testing, we only allow values up to 10, as otherwise, it would take too long to finish:</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">package</font></b><font color="#ff0000"> sort</font> - -<b><font color="#ffffff">import</font></b><font color="#ff0000"> </font><font color="#F3E651">(</font> -<font color="#ff0000"> </font><font color="#bb00ff">"fmt"</font> -<font color="#ff0000"> </font><font color="#bb00ff">"testing"</font> - -<font color="#ff0000"> </font><font color="#bb00ff">"codeberg.org/snonux/algorithms/ds"</font> -<font color="#F3E651">)</font> - -<b><font color="#ffffff">func</font></b><font color="#ff0000"> </font><font color="#7bc710">TestSleepSort</font><font color="#F3E651">(</font><font color="#ff0000">t </font><font color="#F3E651">*</font><font color="#ff0000">testing</font><font color="#F3E651">.</font><font color="#ff0000">T</font><font color="#F3E651">)</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> a </font><font color="#F3E651">:=</font><font color="#ff0000"> ds</font><font color="#F3E651">.</font><font color="#ff0000">NewRandomArrayList</font><font color="#F3E651">[</font><font color="#ff0000">int</font><font color="#F3E651">](</font><font color="#bb00ff">10</font><font color="#F3E651">,</font><font color="#ff0000"> </font><font color="#bb00ff">10</font><font color="#F3E651">)</font> -<font color="#ff0000"> a </font><font color="#F3E651">=</font><font color="#ff0000"> </font><font color="#7bc710">Sleep</font><font color="#F3E651">(</font><font color="#ff0000">a</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">!</font><font color="#ff0000">a</font><font color="#F3E651">.</font><font color="#7bc710">Sorted</font><font color="#F3E651">()</font><font color="#ff0000"> </font><font color="#F3E651">{</font> -<font color="#ff0000"> t</font><font color="#F3E651">.</font><font color="#7bc710">Errorf</font><font color="#F3E651">(</font><font color="#bb00ff">"Array not sorted: %v"</font><font color="#F3E651">,</font><font color="#ff0000"> a</font><font color="#F3E651">)</font> -<font color="#ff0000"> </font><font color="#F3E651">}</font> -<font color="#F3E651">}</font> -</pre> -<br /> -<span>As you can see, it takes <span class='inlinecode'>9s</span> here for the algorithm to finish (which is the highest value in the <span class='inlinecode'>ArrayList</span>):</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><font color="#ff0000">❯ go </font><b><font color="#ffffff">test</font></b><font color="#ff0000"> </font><font color="#F3E651">.</font><font color="#ff0000">/sort -v -run SleepSort</font> -<font color="#F3E651">===</font><font color="#ff0000"> RUN TestSleepSort</font> -<font color="#ff0000">--- PASS</font><font color="#F3E651">:</font><font color="#ff0000"> TestSleepSort </font><font color="#F3E651">(</font><font color="#bb00ff">9</font><font color="#F3E651">.</font><font color="#ff0000">00s</font><font color="#F3E651">)</font> -<font color="#ff0000">PASS</font> -<font color="#ff0000">ok codeberg</font><font color="#F3E651">.</font><font color="#ff0000">org/snonux/algorithms/sort </font><font color="#bb00ff">9</font><font color="#F3E651">.</font><font color="#ff0000">002s</font> -</pre> -<br /> -<span>I won't write any benchmark for sleep sort; that will be done for the algorithms to come in this series :-).</span><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> +<a class='textlink' href='./2022-06-15-sweating-the-small-stuff.html'>2022-06-15 Sweating the small stuff - Tiny projects of mine</a><br /> +<a class='textlink' href='./2022-05-27-perl-is-still-a-great-choice.html'>2022-05-27 Perl is still a great choice</a><br /> +<a class='textlink' href='./2011-05-07-perl-daemon-service-framework.html'>2011-05-07 Perl Daemon (Service Framework)</a><br /> +<a class='textlink' href='./2008-06-26-perl-poetry.html'>2008-06-26 Perl Poetry</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> @@ -4964,7 +7356,7 @@ http://www.gnu.org/software/src-highlite --> <summary>These are my personal takeaways after reading 'Never split the difference' by Chris Voss. Note that the book contains much more knowledge wisdom and that these notes only contain points I personally found worth writing down. This is mainly for my own use, but you might find it helpful too.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Neversplitthedifferencebooknotes'>"Never split the difference" book notes</h1><br /> + <h1 style='display: inline' id='never-split-the-difference-book-notes'>"Never split the difference" book notes</h1><br /> <br /> <span class='quote'>Published at 2023-04-01T20:00:17+03:00</span><br /> <br /> @@ -4982,7 +7374,23 @@ http://www.gnu.org/software/src-highlite --> ''' </pre> <br /> -<h2 style='display: inline' id='Tacticallisteningspreadingempathy'>Tactical listening, spreading empathy</h2><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#never-split-the-difference-book-notes'>"Never split the difference" book notes</a></li> +<li>⇢ <a href='#tactical-listening-spreading-empathy'>Tactical listening, spreading empathy</a></li> +<li>⇢ <a href='#mindset-of-discovery'>Mindset of discovery</a></li> +<li>⇢ ⇢ <a href='#more-tips-'>More tips </a></li> +<li>⇢ <a href='#no-starts-the-conversation'>"No" starts the conversation</a></li> +<li>⇢ <a href='#win-win'>Win-win</a></li> +<li>⇢ <a href='#on-deadlines'>On Deadlines</a></li> +<li>⇢ <a href='#analyse-the-opponent'>Analyse the opponent</a></li> +<li>⇢ <a href='#use-different-ways-of-saying-no'>Use different ways of saying "no."</a></li> +<li>⇢ <a href='#calibrated-question'>Calibrated question</a></li> +<li>⇢ <a href='#the-black-swan-'>The black swan </a></li> +<li>⇢ <a href='#more'>More</a></li> +</ul><br /> +<h2 style='display: inline' id='tactical-listening-spreading-empathy'>Tactical listening, spreading empathy</h2><br /> <br /> <span>Be a mirror, copy each other to be comfy with each other to build up trust. Mirroring is mainly body language. A mirror is to repeat the words the other just said. Simple but effective.</span><br /> <br /> @@ -4993,7 +7401,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Mirror training is like Jedi training. Simple but effective. A mirror needs space. Be silent after "you want this?" </span><br /> <br /> -<h2 style='display: inline' id='Mindsetofdiscovery'>Mindset of discovery</h2><br /> +<h2 style='display: inline' id='mindset-of-discovery'>Mindset of discovery</h2><br /> <br /> <span>Try to have multiple realities in your mind and use facts to distinguish between real and false.</span><br /> <br /> @@ -5005,7 +7413,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Try: to put a label on someone's emotion and then be silent. Wait for the other to reveal himself. "You seem unhappy about this?"</span><br /> <br /> -<h3 style='display: inline' id='Moretips'>More tips </h3><br /> +<h3 style='display: inline' id='more-tips-'>More tips </h3><br /> <br /> <ul> <li>Put on a poker face and don't show emotions.</li> @@ -5014,7 +7422,7 @@ http://www.gnu.org/software/src-highlite --> <li>Being right is not the key to successful negotiation; being mindful is.</li> <li>Be in the safe zone of empathy and acknowledge bad news.</li> </ul><br /> -<h2 style='display: inline' id='Nostartstheconversation'>"No" starts the conversation</h2><br /> +<h2 style='display: inline' id='no-starts-the-conversation'>"No" starts the conversation</h2><br /> <br /> <span>When the opponent starts with a "no", he feels in control and comfortable. That's why he has to start with "no".</span><br /> <br /> @@ -5027,11 +7435,11 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Get a "That's right" when negotiating. Don't get a "you're right". You can summarise the opponent to get a "that's right".</span><br /> <br /> -<h2 style='display: inline' id='Winwin'>Win-win</h2><br /> +<h2 style='display: inline' id='win-win'>Win-win</h2><br /> <br /> <span>Win-win is a naive approach when encountering the win-lose counterpart, but always cooperate. Don't compromise, and don't split the difference. We don't compromise because it's right; we do it because it is easy. You must embrace the hard stuff; that's where the great deals are.</span><br /> <br /> -<h2 style='display: inline' id='OnDeadlines'>On Deadlines</h2><br /> +<h2 style='display: inline' id='on-deadlines'>On Deadlines</h2><br /> <br /> <ul> <li>All deadlines are imaginary.</li> @@ -5039,7 +7447,7 @@ http://www.gnu.org/software/src-highlite --> <li>They push a deal to a conclusion.</li> <li>They rush the counterpart to cause pressure and anxiety.</li> </ul><br /> -<h2 style='display: inline' id='Analysetheopponent'>Analyse the opponent</h2><br /> +<h2 style='display: inline' id='analyse-the-opponent'>Analyse the opponent</h2><br /> <br /> <ul> <li>Understand the motivation of people behind the table as well.</li> @@ -5049,7 +7457,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>The person on the other side is never the issue; the problem is the issue. Keep this in mind to avoid emotional issues with the person and focus on the problem, not the person. The bond is essential; never create an enemy.</span><br /> <br /> -<h2 style='display: inline' id='Usedifferentwaysofsayingno'>Use different ways of saying "no."</h2><br /> +<h2 style='display: inline' id='use-different-ways-of-saying-no'>Use different ways of saying "no."</h2><br /> <br /> <span class='quote'>I had paid my rent always in time. I had positive experiences with the building and would be sad for the landlord to lose a good tenant. I am looking for a win-win agreement between us. Pulling out the research, other neighbours offer much lower prices even if your building is a better location and services. How can I effort 200 more.... </span><br /> <br /> @@ -5057,7 +7465,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>You always have to embrace thoughtful confrontation for good negotiation and life. Don't avoid honest, clear conflict. It will give you the best deals. Compromises are mostly bad deals for both sides. Most people don't negotiate a win-win but a win-lose. Know the best and worst outcomes and what is acceptable for you.</span><br /> <br /> -<h2 style='display: inline' id='Calibratedquestion'>Calibrated question</h2><br /> +<h2 style='display: inline' id='calibrated-question'>Calibrated question</h2><br /> <br /> <span>Calibrated questions. Give the opponent a sense of power. Ask open-how questions to get the opponent to solve your problem and move him in your direction. Calibrated questions are the best tools. Summarise everything, and then ask, "how I am supposed to do that?". Asking for help this way with a calibrated question is a powerful tool for joint problem solving</span><br /> <br /> @@ -5073,11 +7481,11 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Prepare 3 to 5 calibrated questions for your counterpart. Be curious what is really motivating the other side. You can get out the "Black Swan".</span><br /> <br /> -<h2 style='display: inline' id='Theblackswan'>The black swan </h2><br /> +<h2 style='display: inline' id='the-black-swan-'>The black swan </h2><br /> <br /> <span>What we don't know can break our deal. Uncovering it can bring us unexpected success. You get what you ask for in this world, but you must learn to ask correctly. Reveal the black swan by asking questions.</span><br /> <br /> -<h2 style='display: inline' id='More'>More</h2><br /> +<h2 style='display: inline' id='more'>More</h2><br /> <br /> <span>Establish a range at top places like corp. I get... (e.g. remote London on a project basis). Set a high salary range and not a number. Also, check on LinkedIn premium for the salaries.</span><br /> <br /> @@ -5098,13 +7506,14 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other book notes of mine are:</span><br /> <br /> -<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> -<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> -<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> -<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> -<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2024-10-24-staff-engineer-book-notes.html'>2024-10-24 "Staff Engineer" book notes</a><br /> <a class='textlink' href='./2024-07-07-the-stoic-challenge-book-notes.html'>2024-07-07 "The Stoic Challenge" book notes</a><br /> +<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> +<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> +<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> +<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes (You are currently reading this)</a><br /> +<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> @@ -5122,10 +7531,18 @@ http://www.gnu.org/software/src-highlite --> <summary>I proudly announce that I've released Gemtexter version `2.0.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Gemtexter200LetsGemtextagain'>Gemtexter 2.0.0 - Let's Gemtext again²</h1><br /> + <h1 style='display: inline' id='gemtexter-200---let-s-gemtext-again'>Gemtexter 2.0.0 - Let's Gemtext again²</h1><br /> <br /> <span class='quote'>Published at 2023-03-25T17:50:32+02:00</span><br /> <br /> +<span>I proudly announce that I've released Gemtexter version <span class='inlinecode'>2.0.0</span>. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash.</span><br /> +<br /> +<a class='textlink' href='https://codeberg.org/snonux/gemtexter'>https://codeberg.org/snonux/gemtexter</a><br /> +<br /> +<span>This is a new major release, so it contains a breaking change (see "Meta cache made obsolete").</span><br /> +<br /> +<span>Let's list what's new!</span><br /> +<br /> <pre> -=[ typewriters ]=- 1/98 @@ -5139,15 +7556,18 @@ http://www.gnu.org/software/src-highlite --> mod. by Paul Buetow `"""""""""` </pre> <br /> -<span>I proudly announce that I've released Gemtexter version <span class='inlinecode'>2.0.0</span>. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash.</span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<a class='textlink' href='https://codeberg.org/snonux/gemtexter'>https://codeberg.org/snonux/gemtexter</a><br /> -<br /> -<span>This is a new major release, so it contains a breaking change (see "Meta cache made obsolete").</span><br /> -<br /> -<span>Let's list what's new!</span><br /> -<br /> -<h2 style='display: inline' id='Minimaltemplateengine'>Minimal template engine</h2><br /> +<ul> +<li><a href='#gemtexter-200---let-s-gemtext-again'>Gemtexter 2.0.0 - Let's Gemtext again²</a></li> +<li>⇢ <a href='#minimal-template-engine'>Minimal template engine</a></li> +<li>⇢ <a href='#added-hooks'>Added hooks</a></li> +<li>⇢ <a href='#use-of-safer-bash-options'>Use of safer Bash options</a></li> +<li>⇢ <a href='#meta-cache-made-obsolete'>Meta cache made obsolete</a></li> +<li>⇢ <a href='#xmllint-support'>XMLLint support</a></li> +<li>⇢ <a href='#more'>More</a></li> +</ul><br /> +<h2 style='display: inline' id='minimal-template-engine'>Minimal template engine</h2><br /> <br /> <span>Gemtexter now supports templating, enabling dynamically generated content to <span class='inlinecode'>.gmi</span> files before converting anything to any output format like HTML and Markdown.</span><br /> <br /> @@ -5195,7 +7615,7 @@ Multiline template line 10 <pre> See more entries about DTail and Golang: -<< template::inline::index dtail golang +<< template::inline::rindex dtail golang Blablabla... </pre> @@ -5213,7 +7633,7 @@ See more entries about DTail and Golang: Blablabla... </pre> <br /> -<h2 style='display: inline' id='Addedhooks'>Added hooks</h2><br /> +<h2 style='display: inline' id='added-hooks'>Added hooks</h2><br /> <br /> <span>You can configure <span class='inlinecode'>PRE_GENERATE_HOOK</span> and <span class='inlinecode'>POST_PUBLISH_HOOK</span> to point to scripts to be executed before running <span class='inlinecode'>--generate</span>, or after running <span class='inlinecode'>--publish</span>. E.g. you could populate some of the content by an external script before letting Gemtexter do its thing or you could automatically deploy the site after running <span class='inlinecode'>--publish</span>.</span><br /> <br /> @@ -5223,15 +7643,15 @@ Blablabla... by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#ffffff">declare</font></b><font color="#ff0000"> -xr </font><font color="#ff0000">PRE_GENERATE_HOOK</font><font color="#F3E651">=.</font><font color="#ff0000">/pre_generate_hook</font><font color="#F3E651">.</font><font color="#ff0000">sh</font> -<b><font color="#ffffff">declare</font></b><font color="#ff0000"> -xr </font><font color="#ff0000">POST_PUBLISH_HOOK</font><font color="#F3E651">=.</font><font color="#ff0000">/post_publish_hook</font><font color="#F3E651">.</font><font color="#ff0000">sh</font> +<pre><b><u><font color="#000000">declare</font></u></b> -xr PRE_GENERATE_HOOK=./pre_generate_hook.sh +<b><u><font color="#000000">declare</font></u></b> -xr POST_PUBLISH_HOOK=./post_publish_hook.sh </pre> <br /> -<h2 style='display: inline' id='UseofsaferBashoptions'>Use of safer Bash options</h2><br /> +<h2 style='display: inline' id='use-of-safer-bash-options'>Use of safer Bash options</h2><br /> <br /> <span>Gemtexter now does <span class='inlinecode'>set -euf -o pipefile</span>, which helps to eliminate bugs and to catch scripting errors sooner. Previous versions only <span class='inlinecode'>set -e</span>.</span><br /> <br /> -<h2 style='display: inline' id='Metacachemadeobsolete'>Meta cache made obsolete</h2><br /> +<h2 style='display: inline' id='meta-cache-made-obsolete'>Meta cache made obsolete</h2><br /> <br /> <span>Here is the breaking change to older versions of Gemtexter. The <span class='inlinecode'>$BASE_CONTENT_DIR/meta</span> directory was made obsolete. <span class='inlinecode'>meta</span> was used to store various information about all the blog post entries to make generating an Atom feed in Bash easier. Especially the publishing dates of each post were stored there. Instead, the publishing date is now encoded in the <span class='inlinecode'>.gmi</span> file. And if it is missing, Gemtexter will set it to the current date and time at first run.</span><br /> <br /> @@ -5241,10 +7661,10 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> cat gemfeed</font><font color="#F3E651">/</font><font color="#bb00ff">2023</font><font color="#ff0000">-</font><font color="#bb00ff">02</font><font color="#ff0000">-</font><font color="#bb00ff">26</font><font color="#ff0000">-title-here</font><font color="#F3E651">.</font><font color="#ff0000">gmi</font> -<i><font color="#ababab"># Title here</font></i> +<pre>% cat gemfeed/<font color="#000000">2023</font>-<font color="#000000">02</font>-<font color="#000000">26</font>-title-here.gmi +<i><font color="silver"># Title here</font></i> -<font color="#ff0000">The remaining content of the Gemtext file</font><font color="#F3E651">...</font> +The remaining content of the Gemtext file... </pre> <br /> <span>Gemtexter will add a line starting with <span class='inlinecode'>> Published at ...</span> now. Any subsequent Atom feed generation will then use that date.</span><br /> @@ -5253,19 +7673,19 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">%</font><font color="#ff0000"> cat gemfeed</font><font color="#F3E651">/</font><font color="#bb00ff">2023</font><font color="#ff0000">-</font><font color="#bb00ff">02</font><font color="#ff0000">-</font><font color="#bb00ff">26</font><font color="#ff0000">-title-here</font><font color="#F3E651">.</font><font color="#ff0000">gmi</font> -<i><font color="#ababab"># Title here</font></i> +<pre>% cat gemfeed/<font color="#000000">2023</font>-<font color="#000000">02</font>-<font color="#000000">26</font>-title-here.gmi +<i><font color="silver"># Title here</font></i> -<font color="#F3E651">></font><font color="#ff0000"> Published at </font><font color="#bb00ff">2023</font><font color="#ff0000">-</font><font color="#bb00ff">02</font><font color="#ff0000">-26T21</font><font color="#F3E651">:</font><font color="#bb00ff">43</font><font color="#F3E651">:</font><font color="#bb00ff">51</font><font color="#F3E651">+</font><font color="#bb00ff">01</font><font color="#F3E651">:</font><font color="#bb00ff">00</font> +> Published at <font color="#000000">2023</font>-<font color="#000000">02</font>-26T21:<font color="#000000">43</font>:<font color="#000000">51</font>+<font color="#000000">01</font>:<font color="#000000">00</font> -<font color="#ff0000">The remaining content of the Gemtext file</font><font color="#F3E651">...</font> +The remaining content of the Gemtext file... </pre> <br /> -<h2 style='display: inline' id='XMLLintsupport'>XMLLint support</h2><br /> +<h2 style='display: inline' id='xmllint-support'>XMLLint support</h2><br /> <br /> <span>Optionally, when the <span class='inlinecode'>xmllint</span> binary is installed, Gemtexter will perform a simple XML lint check against the Atom feed generated. This is a double-check of whether the Atom feed is a valid XML.</span><br /> <br /> -<h2 style='display: inline' id='More'>More</h2><br /> +<h2 style='display: inline' id='more'>More</h2><br /> <br /> <span>Additionally, there were a couple of bug fixes, refactorings and overall improvements in the documentation made. </span><br /> <br /> @@ -5273,11 +7693,12 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other related posts are:</span><br /> <br /> -<a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace</a><br /> -<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> -<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> -<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again² (You are currently reading this)</a><br /> +<a class='textlink' href='./2024-10-02-gemtexter-3.0.0-lets-gemtext-again-4.html'>2024-10-02 Gemtexter 3.0.0 - Let's Gemtext again⁴</a><br /> <a class='textlink' href='./2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.html'>2023-07-21 Gemtexter 2.1.0 - Let's Gemtext again³</a><br /> +<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again² (You are currently reading this)</a><br /> +<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> +<a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> @@ -5295,7 +7716,7 @@ http://www.gnu.org/software/src-highlite --> <summary>These are my personal takeaways after reading 'The Pragmatic Programmer' by David Thomas and Andrew Hunt. Note that the book contains much more knowledge wisdom and that these notes only contain points I personally found worth writing down. This is mainly for my own use, but you might find it helpful too.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='ThePragmaticProgrammerbooknotes'>"The Pragmatic Programmer" book notes</h1><br /> + <h1 style='display: inline' id='the-pragmatic-programmer-book-notes'>"The Pragmatic Programmer" book notes</h1><br /> <br /> <span class='quote'>Published at 2023-03-16T00:55:20+02:00</span><br /> <br /> @@ -5346,7 +7767,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Do what works and not what's fashionable. E.g. does SCRUM make sense? The goal is to deliver deliverables and not to "become" agile.</span><br /> <br /> -<h2 style='display: inline' id='Continuouslearning'>Continuous learning</h2><br /> +<h2 style='display: inline' id='continuous-learning'>Continuous learning</h2><br /> <br /> <span>Add new tools to your repertoire every day and keep the momentum up. Learning new things is your most crucial aspect. Invest regularly in your knowledge portfolio. The learning process extends your thinking. It does not matter if you will never use it.</span><br /> <br /> @@ -5357,7 +7778,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Think critically about everything you learn. Use paper for your notes. There is something special about it.</span><br /> <br /> -<h2 style='display: inline' id='Stayconnected'>Stay connected</h2><br /> +<h2 style='display: inline' id='stay-connected'>Stay connected</h2><br /> <br /> <span>It's your life, and you own it. Bruce Lee once said: </span><br /> <br /> @@ -5370,7 +7791,7 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>It's your life. Share it, celebrate it, be proud and have fun.</span><br /> <br /> -<h2 style='display: inline' id='Thestoryofstonesoup'>The story of stone soup</h2><br /> +<h2 style='display: inline' id='the-story-of-stone-soup'>The story of stone soup</h2><br /> <br /> <span>How to motivate others to contribute something (e.g. ideas to a startup):</span><br /> <br /> @@ -5382,15 +7803,15 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Other book notes of mine are:</span><br /> <br /> -<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> -<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> -<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> -<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> -<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2024-10-24-staff-engineer-book-notes.html'>2024-10-24 "Staff Engineer" book notes</a><br /> <a class='textlink' href='./2024-07-07-the-stoic-challenge-book-notes.html'>2024-07-07 "The Stoic Challenge" book notes</a><br /> +<a class='textlink' href='./2024-05-01-slow-productivity-book-notes.html'>2024-05-01 "Slow Productivity" book notes</a><br /> +<a class='textlink' href='./2023-11-11-mind-management-book-notes.html'>2023-11-11 "Mind Management" book notes</a><br /> +<a class='textlink' href='./2023-07-17-career-guide-and-soft-skills-book-notes.html'>2023-07-17 "Software Developmers Career Guide and Soft Skills" book notes</a><br /> +<a class='textlink' href='./2023-05-06-the-obstacle-is-the-way-book-notes.html'>2023-05-06 "The Obstacle is the Way" book notes</a><br /> +<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes (You are currently reading this)</a><br /> <br /> -<a class='textlink' href='../resources.html'>More books and other resources I found useful.</a><br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> @@ -5407,10 +7828,12 @@ http://www.gnu.org/software/src-highlite --> <summary>Do you need help fully discharging from work in the evenings or for the weekend? Shutting down from work won't just improve your work-life balance; it will also significantly improve the quality of your personal life and work. After a restful weekend, you will be much more energized and productive the next working day. So it should not just be in your own, but also your employers' interest that you fully relax and shut down after work. </summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Howtoshutdownafterwork'>How to shut down after work</h1><br /> + <h1 style='display: inline' id='how-to-shut-down-after-work'>How to shut down after work</h1><br /> <br /> <span class='quote'>Published at 2023-02-26T23:48:01+02:00</span><br /> <br /> +<span>Do you need help fully discharging from work in the evenings or for the weekend? Shutting down from work won't just improve your work-life balance; it will also significantly improve the quality of your personal life and work. After a restful weekend, you will be much more energized and productive the next working day. So it should not just be in your own, but also your employers' interest that you fully relax and shut down after work. </span><br /> +<br /> <pre> |\ "Music should be heard not only with the ears, but also the soul." |---|--\-----------------------|-----------------------------------------| @@ -5426,15 +7849,25 @@ http://www.gnu.org/software/src-highlite --> -@- [kom...@uwec.edu] </pre> <br /> -<span>Do you need help fully discharging from work in the evenings or for the weekend? Shutting down from work won't just improve your work-life balance; it will also significantly improve the quality of your personal life and work. After a restful weekend, you will be much more energized and productive the next working day. So it should not just be in your own, but also your employers' interest that you fully relax and shut down after work. </span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline' id='Haveashutdownroutine'>Have a shutdown routine</h2><br /> +<ul> +<li><a href='#how-to-shut-down-after-work'>How to shut down after work</a></li> +<li>⇢ <a href='#have-a-shutdown-routine'>Have a shutdown routine</a></li> +<li>⇢ <a href='#don-t-work-when-you-officially-don-t-work'>Don't work when you officially don't work</a></li> +<li>⇢ <a href='#distract-your-mind'>Distract your mind</a></li> +<li>⇢ <a href='#get-a-pet'>Get a pet</a></li> +<li>⇢ <a href='#journal-your-day'>Journal your day</a></li> +<li>⇢ <a href='#don-t-stress-about-what-your-employer-expects-from-you'>Don't stress about what your employer expects from you</a></li> +<li>⇢ <a href='#call-it-a-day'>Call it a day</a></li> +</ul><br /> +<h2 style='display: inline' id='have-a-shutdown-routine'>Have a shutdown routine</h2><br /> <br /> <span>Have a routine. Try to finish work around the same time every day. Write any outstanding tasks down for the next day, so you are sure you will remember them. Writing them down brings wonders as you can remove them from your mind for the remainder of the day (or the upcoming weekend) as you know you will surely pick them up the next working day. Tidying up your workplace could also count toward your daily shutdown routine. </span><br /> <br /> <span>A commute home from the office also greatly helps, as it disconnects your work from your personal life. Don't work on your commute home, though! If you don't commute but work from home, then it helps to walk around the block or in a nearby park to disconnect from work. </span><br /> <br /> -<h2 style='display: inline' id='Dontworkwhenyouofficiallydontwork'>Don't work when you officially don't work</h2><br /> +<h2 style='display: inline' id='don-t-work-when-you-officially-don-t-work'>Don't work when you officially don't work</h2><br /> <br /> <span>Unless you are self-employed, you have likely signed an N-hour per week contract with your employer, and your regular working times are from X o'clock in the morning to Y o'clock in the evening (with M minutes lunch break in the middle). And there might be some flexibility in your working times, too. But that kind of flexibility (e.g. extending the lunch break so that there is time to pick up a family member from the airport) will be agreed upon, and you will counteract it, for example, by starting working earlier the next day or working late, that one exception. But overall, your weekly working time will stay N hours. </span><br /> <br /> @@ -5448,7 +7881,7 @@ http://www.gnu.org/software/src-highlite --> <br /> <span>Checking for your messages constantly outside of regular office times makes it impossible to shut down and relax from work altogether. </span><br /> <br /> -<h2 style='display: inline' id='Distractyourmind'>Distract your mind</h2><br /> +<h2 style='display: inline' id='distract-your-mind'>Distract your mind</h2><br /> <br /> <span>Often, your mind goes back to work-related stuff even after work. That's normal as you concentrated highly on your work throughout the day. The brain unconsciously continues to work and will automatically present you with random work-related thoughts. You can counteract this by focusing on non-work stuff, which may include:</span><br /> <br /> @@ -5461,23 +7894,23 @@ http://www.gnu.org/software/src-highlite --> </ul><br /> <span>Some of these can be habit-stacked: Exercise could be combined with watching videos about your passion project (e.g. watching lectures about that new programming language you are currently learning for fun). With walking, for example, you could combine listening to an Audiobook or music, or you could also think about your passion project during that walk. </span><br /> <br /> -<h2 style='display: inline' id='Getapet'>Get a pet</h2><br /> +<h2 style='display: inline' id='get-a-pet'>Get a pet</h2><br /> <br /> <span>Even if you have children, it helps wonders to get a pet. My cat, for example, will remind me a few times daily to take a few minute's breaks to pet, play or give food. So my cat not only helps me after work but throughout the day.</span><br /> <br /> <span>My neighbour also works from home, and he has dogs, which he regularly has to take out to the park.</span><br /> <br /> -<h2 style='display: inline' id='Journalyourday'>Journal your day</h2><br /> +<h2 style='display: inline' id='journal-your-day'>Journal your day</h2><br /> <br /> <span>If you are upset about something, making it impossible to shut down from work, write down everything (e.g., with a pen in a paper journal). Writing things down helps you to "get rid" of the negative. Especially after conflicts with colleagues or company decisions, you don't agree on. This kind of self-therapy is excellent. Brainstorm all your emotions and (even if opinionated) opinions so you have everything on paper. Once done, you don't think about it so much anymore, as you know you can access that information if required. But stopping ruminating about it will be much easier now. You will likely never access that information again, though. But at least writing the thoughts down saved your day. </span><br /> <br /> <span>Write down three things which went well for the day. This helps you to appreciate the day. </span><br /> <br /> -<h2 style='display: inline' id='Dontstressaboutwhatyouremployerexpectsfromyou'>Don't stress about what your employer expects from you</h2><br /> +<h2 style='display: inline' id='don-t-stress-about-what-your-employer-expects-from-you'>Don't stress about what your employer expects from you</h2><br /> <br /> <span>Think about what's fun and motivates you. Maybe the next promotion to Principal or a Manager role isn't for you. Many fall into the trap of stressing themselves out to satisfy the employer so that the next upgrade will happen and think about it constantly, even after work. But it is more important that you enjoy your craftsmanship. Work on what you expect from yourself. Ideally, your goals should be aligned with your employer. I am not saying you should abandon everything what your manager is asking you to do, but it is, after all, your life. And you have to decide where and on what you want to work. But don't sell yourself short. Keep track of your accomplishments.</span><br /> <br /> -<h2 style='display: inline' id='Callitaday'>Call it a day</h2><br /> +<h2 style='display: inline' id='call-it-a-day'>Call it a day</h2><br /> <br /> <span>Every day you gave your best was good; the day's outcome doesn't matter. What matters is that you know you gave your best and are closer to your goals than the previous day. This gives you a sense of progress and accomplishment.</span><br /> <br /> @@ -5498,13 +7931,26 @@ http://www.gnu.org/software/src-highlite --> <name>Paul Buetow aka snonux</name> <email>paul@dev.buetow.org</email> </author> - <summary>Art by Joan Stark</summary> + <summary>In 2021 I wrote 'On Being Pedantic about Open-Source', and there was a section 'What about mobile?' where I expressed the dilemma about the necessity of using proprietary mobile operating systems. With GrapheneOS, I found my perfect solution for personal mobile phone use. </summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='WhyGrapheneOSrox'>Why GrapheneOS rox</h1><br /> + <h1 style='display: inline' id='why-grapheneos-rox'>Why GrapheneOS rox</h1><br /> <br /> <span class='quote'>Published at 2023-01-23T15:31:52+02:00</span><br /> <br /> +<span>In 2021 I wrote "On Being Pedantic about Open-Source", and there was a section "What about mobile?" where I expressed the dilemma about the necessity of using proprietary mobile operating systems. With GrapheneOS, I found my perfect solution for personal mobile phone use. </span><br /> +<br /> +<a class='textlink' href='./2021-08-01-on-being-pedantic-about-open-source.html'>On Being Pedantic about Open-Source</a><br /> +<br /> +<span>What is GrapheneOS?</span><br /> +<br /> +<span class='quote'>GrapheneOS is a privacy and security-focused mobile OS with Android app compatibility developed as a non-profit open-source project. It's focused on the research and development of privacy and security technologies, including substantial improvements to sandboxing, exploits mitigations and the permission model.</span><br /> +<br /> +<span>GrapheneOS is an independent Android distribution based on the Android Open Source Project (AOSP) but hardened in multiple ways. Other independent Android distributions, like LineageOS, are also based on AOSP, but GrapheneOS takes it further so that it can be my daily driver on my phone.</span><br /> +<br /> +<a class='textlink' href='https://GrapheneOS.org'>https://GrapheneOS.org</a><br /> +<a class='textlink' href='https://LineageOS.org'>https://LineageOS.org</a><br /> +<br /> <pre> Art by Joan Stark _.===========================._ @@ -5528,20 +7974,20 @@ Art by Joan Stark '-'-'-'--' </pre> <br /> -<span>In 2021 I wrote "On Being Pedantic about Open-Source", and there was a section "What about mobile?" where I expressed the dilemma about the necessity of using proprietary mobile operating systems. With GrapheneOS, I found my perfect solution for personal mobile phone use. </span><br /> -<br /> -<a class='textlink' href='./2021-08-01-on-being-pedantic-about-open-source.html'>On Being Pedantic about Open-Source</a><br /> -<br /> -<span>What is GrapheneOS?</span><br /> -<br /> -<span class='quote'>GrapheneOS is a privacy and security-focused mobile OS with Android app compatibility developed as a non-profit open-source project. It's focused on the research and development of privacy and security technologies, including substantial improvements to sandboxing, exploits mitigations and the permission model.</span><br /> -<br /> -<span>GrapheneOS is an independent Android distribution based on the Android Open Source Project (AOSP) but hardened in multiple ways. Other independent Android distributions, like LineageOS, are also based on AOSP, but GrapheneOS takes it further so that it can be my daily driver on my phone.</span><br /> -<br /> -<a class='textlink' href='https://GrapheneOS.org'>https://GrapheneOS.org</a><br /> -<a class='textlink' href='https://LineageOS.org'>https://LineageOS.org</a><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline' id='UserProfiles'>User Profiles</h2><br /> +<ul> +<li><a href='#why-grapheneos-rox'>Why GrapheneOS rox</a></li> +<li>⇢ <a href='#user-profiles'>User Profiles</a></li> +<li>⇢ <a href='#proxying-some-of-the-google-offerings-'>Proxying some of the Google offerings </a></li> +<li>⇢ <a href='#google-play-sandboxing-'>Google Play Sandboxing </a></li> +<li>⇢ <a href='#the-camera-and-the-cloud-'>The camera and the cloud </a></li> +<li>⇢ <a href='#fine-granular-permissions'>Fine granular permissions</a></li> +<li>⇢ <a href='#termux'>Termux</a></li> +<li>⇢ <a href='#so-why-not-use-a-pure-linux-phone'>So, why not use a pure Linux phone?</a></li> +<li>⇢ <a href='#small-grapheneos-downsides-'>Small GrapheneOS downsides </a></li> +</ul><br /> +<h2 style='display: inline' id='user-profiles'>User Profiles</h2><br /> <br /> <span>GrapheneOS allows configuring up to 32 user profiles (including a guest profile) on a single phone. A profile is a completely different environment within the phone, and it is possible to switch between them instantly. Sessions of a profile can continue running in the background or be fully terminated. Each profile can have completely different settings and different applications installed.</span><br /> <br /> @@ -5551,7 +7997,7 @@ Art by Joan Stark <br /> <span>You notice how much longer (multiple days) your phone can be on a single charge when Google Play Services isn't running in the background. This tells a lot about the background activities and indicates that using Google Play shouldn't be the norm.</span><br /> <br /> -<h2 style='display: inline' id='ProxyingsomeoftheGoogleofferings'>Proxying some of the Google offerings </h2><br /> +<h2 style='display: inline' id='proxying-some-of-the-google-offerings-'>Proxying some of the Google offerings </h2><br /> <br /> <span>There's also the case that I am using an app from the Google Play store (as the app isn't available from F-Droid), which doesn't require Google Play Services to run in the background. Here's where I use the Aurora Android store. The Aurora store can be installed through F-Droid. Aurora acts as an anonymous proxy from your phone to the Google Play Store and lets you install apps from there. No Google credentials are required for that!</span><br /> <br /> @@ -5559,7 +8005,7 @@ Art by Joan Stark <br /> <span>There's a similar solution for watching videos on YouTube. You can use the NewPipe app (also from F-Droid), which acts as an anonymous proxy for watching videos from YouTube. So there isn't any need to install the official YouTube app, and there isn't any need to login to your Google account. What's so bad about the official app? You don't know which data it is sending about you to Google, so it is a privacy concern. </span><br /> <br /> -<h2 style='display: inline' id='GooglePlaySandboxing'>Google Play Sandboxing </h2><br /> +<h2 style='display: inline' id='google-play-sandboxing-'>Google Play Sandboxing </h2><br /> <br /> <span>Before switching to GrapheneOS, I had been using LineageOS on one of my phones for a couple of years. Still, I always had to have a secondary personal phone with all of these proprietary apps which (partially) only work with Google Play on the phone (e.g. Banking, Navigation, various travel apps from various Airlines, etc.) somewhere around as I didn't install Google Play on my LineageOS phone due to privacy concerns and only installed apps from the F-Droid store on it. When travelling, I always had to carry around a second phone with Google Play on it, as without it; life would become inconvenient pretty soon. </span><br /> <br /> @@ -5577,7 +8023,7 @@ Art by Joan Stark <br /> <span>It is great to have the flexibility to use any proprietary Android app when needed. That only applies to around 1% of my phone usage time, but you often don't always know when you need "that one app now". So it's perfect that it's covered with the phone you always have with you. </span><br /> <br /> -<h2 style='display: inline' id='Thecameraandthecloud'>The camera and the cloud </h2><br /> +<h2 style='display: inline' id='the-camera-and-the-cloud-'>The camera and the cloud </h2><br /> <br /> <span>I really want my phone to shoot good looking pictures, so that I can later upload them to the Irregular Ninja:</span><br /> <br /> @@ -5597,7 +8043,7 @@ Art by Joan Stark <br /> <span>I also use NextCloud to synchronize my notes (NextCloud Notes), my RSS news feeds (NextCloud News) and contacts (DAVx5). All apps required are available in the F-Droid store.</span><br /> <br /> -<h2 style='display: inline' id='Finegranularpermissions'>Fine granular permissions</h2><br /> +<h2 style='display: inline' id='fine-granular-permissions'>Fine granular permissions</h2><br /> <br /> <span>Another great thing about GrapheneOS is that, besides putting your apps into different profiles, you can also restrict network access and configure storage scopes per app individually.</span><br /> <br /> @@ -5605,7 +8051,7 @@ Art by Joan Stark <br /> <span>The app also wants to store and read some data from your phone (e.g. it could be a proprietary app for enhancing photos, and therefore storage access to a photo folder would be required). In GrapheneOS, you can configure a storage scope for that particular app, e.g. only read and write from one folder but still forbid access to all other folders on your phone.</span><br /> <br /> -<h2 style='display: inline' id='Termux'>Termux</h2><br /> +<h2 style='display: inline' id='termux'>Termux</h2><br /> <br /> <span>Termux can be installed on any Android phone through F-Droid, so it doesn't need to be a GrapheneOS phone. But I have to mention Termux here as it significantly adds value to my phone experience. </span><br /> <br /> @@ -5617,7 +8063,7 @@ Art by Joan Stark <br /> <span>There are Pixel phones with a screen size of 6", and that's decent enough for occasional use like that, and everything (the phone, the BT keyboard, maybe an external battery pack) all fit nicely in a small travel pocket.</span><br /> <br /> -<h2 style='display: inline' id='SowhynotuseapureLinuxphone'>So, why not use a pure Linux phone?</h2><br /> +<h2 style='display: inline' id='so-why-not-use-a-pure-linux-phone'>So, why not use a pure Linux phone?</h2><br /> <br /> <span>Strictly speaking, an Android phone is a Linux phone, but it's heavily modified and customized. For me, a "pure" Linux phone is a more streamlined Linux kernel running in a distribution like Ubuntu Touch or Mobian. </span><br /> <br /> @@ -5632,7 +8078,7 @@ Art by Joan Stark <br /> <a class='textlink' href='https://sailfishos.org'>SailfishOS</a><br /> <br /> -<h2 style='display: inline' id='SmallGrapheneOSdownsides'>Small GrapheneOS downsides </h2><br /> +<h2 style='display: inline' id='small-grapheneos-downsides-'>Small GrapheneOS downsides </h2><br /> <br /> <span>Sometimes, switching a profile to use a different app is annoying, and you can't copy and paste from the system clipboard from one profile to another. But that's a small price I am willing to pay!</span><br /> <br /> @@ -5658,12 +8104,10 @@ Art by Joan Stark <summary>As a regular participant in the annual Pet Project competition at work, I always try to find a project where I can learn something new. In this post, I would like to share my takeaways after revisiting Java. You can read about my motivations in my 'Creative universe' post:</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='RelearningJavaMytakeaways'>(Re)learning Java - My takeaways</h1><br /> + <h1 style='display: inline' id='relearning-java---my-takeaways'>(Re)learning Java - My takeaways</h1><br /> <br /> <span class='quote'>Published at 2022-12-24T23:18:40+02:00</span><br /> <br /> -<a href='./ultrarelearning-java-my-takeaways/learnjava.jpg'><img src='./ultrarelearning-java-my-takeaways/learnjava.jpg' /></a><br /> -<br /> <span>As a regular participant in the annual Pet Project competition at work, I always try to find a project where I can learn something new. In this post, I would like to share my takeaways after revisiting Java. You can read about my motivations in my "Creative universe" post:</span><br /> <br /> <a class='textlink' href='./2022-04-10-creative-universe.html'>Creative universe</a><br /> @@ -5676,13 +8120,31 @@ Art by Joan Stark <br /> <span>At my workplace, as an SRE, I don't do Java a lot. I have been reading Java code to understand the software better so I can apply and suggest workarounds or fixes to existing issues and bugs. However, most of our stack is in Java, and our Software Engineers use Java as their primary programming language.</span><br /> <br /> -<h2 style='display: inline' id='StuckatJava14'>Stuck at Java 1.4</h2><br /> +<a href='./ultrarelearning-java-my-takeaways/learnjava.jpg'><img src='./ultrarelearning-java-my-takeaways/learnjava.jpg' /></a><br /> +<br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> +<br /> +<ul> +<li><a href='#relearning-java---my-takeaways'>(Re)learning Java - My takeaways</a></li> +<li>⇢ <a href='#stuck-at-java-14'>Stuck at Java 1.4</a></li> +<li>⇢ <a href='#relearning--upskilling-to-java-18'>(Re)learning & upskilling to Java 18</a></li> +<li>⇢ ⇢ <a href='#effective-java'>Effective Java</a></li> +<li>⇢ ⇢ <a href='#java-pub-house'>Java Pub House</a></li> +<li>⇢ ⇢ <a href='#java-concurrency-course'>Java Concurrency course</a></li> +<li>⇢ ⇢ <a href='#read-a-lot-of-java-code'>Read a lot of Java code</a></li> +<li>⇢ ⇢ <a href='#observed-java-code-reviews'>Observed Java code reviews</a></li> +<li>⇢ ⇢ <a href='#took-ownership-of-a-roadmap-java-project'>Took ownership of a roadmap-Java project</a></li> +<li>⇢ <a href='#the-good'>The good</a></li> +<li>⇢ <a href='#the-bad-and-the-ugly'>The bad and the ugly</a></li> +<li>⇢ <a href='#conclusion'>Conclusion</a></li> +</ul><br /> +<h2 style='display: inline' id='stuck-at-java-14'>Stuck at Java 1.4</h2><br /> <br /> <span>Over time, I had been missing out on many new features that were added to the language since Java 1.4, so I decided to implement my next Pet Project in Java and learn every further aspect of the language as my main goal. Of course, I still liked the idea of winning a Pet Project Prize, but my main objective was to level up my Java skills.</span><br /> <br /> -<h2 style='display: inline' id='RelearningupskillingtoJava18'>(Re)learning & upskilling to Java 18</h2><br /> +<h2 style='display: inline' id='relearning--upskilling-to-java-18'>(Re)learning & upskilling to Java 18</h2><br /> <br /> -<h3 style='display: inline' id='EffectiveJava'>Effective Java</h3><br /> +<h3 style='display: inline' id='effective-java'>Effective Java</h3><br /> <br /> <span>This book was recommended by my brother and also by at least another colleague at work to be one of the best, if not the best, book about Java programming. I read the whole book from the beginning to the end and immersed myself in it. I fully agree; this is a great book. Every Java developer or Java software engineer should read it!</span><br /> <br /> @@ -5692,30 +8154,30 @@ Art by Joan Stark <br /> <a class='textlink' href='https://dev.to/kylec32/series/2292'>Kyle Carter's 90-part Effective Java Series </a><br /> <br /> -<h3 style='display: inline' id='JavaPubHouse'>Java Pub House</h3><br /> +<h3 style='display: inline' id='java-pub-house'>Java Pub House</h3><br /> <br /> <span>During my lunch breaks, I usually have a walk around the block or in a nearby park. I used that time to listen to the Java Pub House podcast. I listened to *every* episode and learned tons of new stuff. I can highly recommend this podcast. Especially GraalVM, a high-performance JDK distribution written for Java and other JVM languages, captured my attention. GraalVM can compile Java code into native binaries, improving performance and easing the distribution of Java programs. Because of the latter, I should release a VS-Sim GraalVM edition one day through a Linux AppImage ;-).</span><br /> <br /> <a class='textlink' href='https://www.javapubhouse.com'>https://www.javapubhouse.com</a><br /> <a class='textlink' href='https://www.graalvm.org'>https://www.graalvm.org</a><br /> <br /> -<h3 style='display: inline' id='JavaConcurrencycourse'>Java Concurrency course</h3><br /> +<h3 style='display: inline' id='java-concurrency-course'>Java Concurrency course</h3><br /> <br /> <span>I also watched a course on O'Reilly Safari Books online about Java Concurrency. That gave an excellent refresher on how the Java thread pools work and what were the concurrency primitives available in the standard library.</span><br /> <br /> -<h3 style='display: inline' id='ReadalotofJavacode'>Read a lot of Java code</h3><br /> +<h3 style='display: inline' id='read-a-lot-of-java-code'>Read a lot of Java code</h3><br /> <br /> <span>First, the source code is often the best documentation (if programmed nicely), and second, it helps to get the hang of the language and standard practices. I started to read more and more Java code at work. I did that whenever I had to understand how something, in particular, worked (e.g. while troubleshooting and debugging an issue). </span><br /> <br /> -<h3 style='display: inline' id='ObservedJavacodereviews'>Observed Java code reviews</h3><br /> +<h3 style='display: inline' id='observed-java-code-reviews'>Observed Java code reviews</h3><br /> <br /> <span>Another great way to get the hang of Java again was to sneak into the code reviews of the Software Engineer colleagues. They are the expert on the matter and are a great source to copy knowledge. It's OK to stay passive and only follow the reviews. Sometimes, it's OK to step up and take ownership of the review. The developers will also always be happy to answer any naive questions which come up.</span><br /> <br /> -<h3 style='display: inline' id='TookownershipofaroadmapJavaproject'>Took ownership of a roadmap-Java project</h3><br /> +<h3 style='display: inline' id='took-ownership-of-a-roadmap-java-project'>Took ownership of a roadmap-Java project</h3><br /> <br /> <span>Besides my Pet Project, I also took ownership of a regular roadmap Java project at work, making an internal Java service capable of running in Kubernetes. This was a bunch of minor changes and adding a bunch of classes and unit tests dealing with the statelessness and a persistent job queue in Redis. The job also involved reading and understanding a lot of already existing Java code. It wasn't part of my job description, but it was fun, and I learned a lot. The service runs smoothly in production now. Of course, all of my code got reviewed by my Software Engineering colleagues.</span><br /> <br /> -<h2 style='display: inline' id='Thegood'>The good</h2><br /> +<h2 style='display: inline' id='the-good'>The good</h2><br /> <br /> <span>From the new language features and syntaxes, there are many personal takeaways, and I can't possibly list them all, but here are some of my personal highlights:</span><br /> <br /> @@ -5736,7 +8198,7 @@ Art by Joan Stark <li>Lambdas are much cleaner, shorter and easier to read than anonymous classes. Many Java libraries require passing instances of (anonymous) classes (e.g. in Swing) to other objects. Lambdas are so lovely because they are primarily compatible with the passing of anonymous classes, so they are a 1:1 replacement in many instances. Lambdas also play very nicely together with the Java functional interfaces, as each Lambda got a type, and the type can be an already existing functional interface (or, if you got a particular case, you could define your custom functional interface for your own set of Lambdas, of course).</li> <li>I love the concept of Java records. You can think of a record as an immutable object holding some data (as members). They are ideal for pipe and stream processing. They are much easier to define (with much less boilerplate) and come with write protection out of the box.</li> </ul><br /> -<h2 style='display: inline' id='Thebadandtheugly'>The bad and the ugly</h2><br /> +<h2 style='display: inline' id='the-bad-and-the-ugly'>The bad and the ugly</h2><br /> <br /> <span>There are also many ugly corners in Java. Many are doomed to stay there forever due to historical decisions and ensuring backward compatibility with older versions of the Java language and the Java standard library. </span><br /> <br /> @@ -5750,7 +8212,7 @@ Art by Joan Stark <li>Being a bit spoiled by Golang's Goroutines, I was shocked about the limitations of the Java threads. They are resource hungry, and you can't just spin up millions of them as you would with Goroutines. I knew this limitation of threads already (as it's not a problem of the language but of how threads work in the OS), but still, I was pretty shocked when I got reminded of them again. Of course, there's a workaround: Use asynchronous sockets so that you don't waste a whole thread on a single I/O operation (in my case, waiting for a network response). Golang's runtime does that automatically for you: An OS thread will be re-used for other tasks until the network socket unblocks. Every modern programming language should support lightweight threads or Coroutines like Go's Goroutines. </li> </ul><br /> <br /> -<h2 style='display: inline' id='Conclusion'>Conclusion</h2><br /> +<h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> <br /> <span>While (re)learning Java, I felt like a student again and was quite enthusiastic about it initially. I invested around half a year, immersing myself intensively in Java (again). The last time I did that was many years ago as a university student. I even won a Silver Prize at work, implementing a project this year (2022 as of writing this). I feel confident now with understanding, debugging and patching Java code at work, which boosted my debugging and troubleshooting skills. </span><br /> <br /> @@ -5779,13 +8241,25 @@ Art by Joan Stark <name>Paul Buetow aka snonux</name> <email>paul@dev.buetow.org</email> </author> - <summary>Art by \ \_! / __!</summary> + <summary>As a long-lasting user of Vim (and NeoVim), I always wondered what GNU Emacs is really about, so I decided to try it. I didn't try vanilla GNU Emacs, but Doom Emacs. I chose Doom Emacs as it is a neat distribution of Emacs with Evil mode enabled by default. Evil mode allows Vi(m) key bindings (so to speak, it's emulating Vim within Emacs), and I am pretty sure I won't be ready to give up all the muscle memory I have built over more than a decade.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='ItriedDoomEmacsbutIswitchedbacktoNeoVim'>I tried (Doom) Emacs, but I switched back to (Neo)Vim</h1><br /> + <h1 style='display: inline' id='i-tried-doom-emacs-but-i-switched-back-to-neovim'>I tried (Doom) Emacs, but I switched back to (Neo)Vim</h1><br /> <br /> <span class='quote'>Published at 2022-11-24T11:17:15+02:00; Updated at 2022-11-26</span><br /> <br /> +<span>As a long-lasting user of Vim (and NeoVim), I always wondered what GNU Emacs is really about, so I decided to try it. I didn't try vanilla GNU Emacs, but Doom Emacs. I chose Doom Emacs as it is a neat distribution of Emacs with Evil mode enabled by default. Evil mode allows Vi(m) key bindings (so to speak, it's emulating Vim within Emacs), and I am pretty sure I won't be ready to give up all the muscle memory I have built over more than a decade.</span><br /> +<br /> +<a class='textlink' href='https://www.gnu.org/software/emacs/'>GNU Emacs</a><br /> +<a class='textlink' href='https://github.com/doomemacs/'>Doom Emacs</a><br /> +<br /> +<span>I used Doom Emacs for around two months. Still, ultimately I decided to switch back to NeoVim as my primary editor and IDE and Vim (usually pre-installed on Linux-based systems) and Nvi (usually pre-installed on *BSD systems) as my "always available editor" for quick edits. (It is worth mentioning that I don't have a high opinion on whether Vim or NeoVim is the better editor, I prefer NeoVim as it comes with better defaults out of the box, but there is no real blocker to use Vim instead).</span><br /> +<br /> +<a class='textlink' href='https://www.vim.org'>Vim</a><br /> +<a class='textlink' href='https://neovim.io'>NeoVim</a><br /> +<br /> +<span>So why did I switch back to the Vi-family?</span><br /> +<br /> <pre> _/ \ _(\(o / \ / _ ^^^o @@ -5799,25 +8273,25 @@ Art by \ \_! / __! ^^----^^ "^--v' </pre> <br /> -<span>As a long-lasting user of Vim (and NeoVim), I always wondered what GNU Emacs is really about, so I decided to try it. I didn't try vanilla GNU Emacs, but Doom Emacs. I chose Doom Emacs as it is a neat distribution of Emacs with Evil mode enabled by default. Evil mode allows Vi(m) key bindings (so to speak, it's emulating Vim within Emacs), and I am pretty sure I won't be ready to give up all the muscle memory I have built over more than a decade.</span><br /> -<br /> -<a class='textlink' href='https://www.gnu.org/software/emacs/'>GNU Emacs</a><br /> -<a class='textlink' href='https://github.com/doomemacs/'>Doom Emacs</a><br /> -<br /> -<span>I used Doom Emacs for around two months. Still, ultimately I decided to switch back to NeoVim as my primary editor and IDE and Vim (usually pre-installed on Linux-based systems) and Nvi (usually pre-installed on *BSD systems) as my "always available editor" for quick edits. (It is worth mentioning that I don't have a high opinion on whether Vim or NeoVim is the better editor, I prefer NeoVim as it comes with better defaults out of the box, but there is no real blocker to use Vim instead).</span><br /> -<br /> -<a class='textlink' href='https://www.vim.org'>Vim</a><br /> -<a class='textlink' href='https://neovim.io'>NeoVim</a><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<span>So why did I switch back to the Vi-family?</span><br /> -<br /> -<h2 style='display: inline' id='Emacsisagiantdragon'>Emacs is a giant dragon</h2><br /> +<ul> +<li><a href='#i-tried-doom-emacs-but-i-switched-back-to-neovim'>I tried (Doom) Emacs, but I switched back to (Neo)Vim</a></li> +<li>⇢ <a href='#emacs-is-a-giant-dragon'>Emacs is a giant dragon</a></li> +<li>⇢ <a href='#magit-love'>Magit love</a></li> +<li>⇢ <a href='#graphical-ui'>Graphical UI</a></li> +<li>⇢ <a href='#scripting-it'>Scripting it</a></li> +<li>⇢ <a href='#the-famous-emacs-org-mode'>The famous Emacs Org mode</a></li> +<li>⇢ <a href='#seeking-simplicity'>Seeking simplicity</a></li> +<li>⇢ <a href='#conclusion'>Conclusion</a></li> +</ul><br /> +<h2 style='display: inline' id='emacs-is-a-giant-dragon'>Emacs is a giant dragon</h2><br /> <br /> <span>Emacs feels like a giant dragon as it is much more than an editor or an integrated development environment. Emacs is a whole platform on its own. There's an E-Mail client, an IRC client, or even games you can run within Emacs. And you can also change Emacs within Emacs using its own Lisp dialect, Emacs Lisp (Emacs is programmed in Emacs Lisp). Therefore, Emacs is also its own programming language. You can change every aspect of Emacs within Emacs itself. People jokingly state Emacs is an operating system and that you should directly use it as the <span class='inlinecode'>init 1</span> process (if you don't know what the <span class='inlinecode'>init 1</span> process is: Under UNIX and similar operating systems, it's the very first userland processed launched. That's usually <span class='inlinecode'>systemd</span> on Linux-based systems, <span class='inlinecode'>launchd</span> on macOS, or any other init script or init system used by the OS)!</span><br /> <br /> <span>In many aspects, Emacs is like shooting at everything with a bazooka! However, I prefer it simple. I only wanted Emacs to be a good editor (which it is, too), but there's too much other stuff in Emacs that I don't need to care about! Vim and NeoVim do one thing excellent: Being great text editors and, when loaded with plugins, decent IDEs, too. </span><br /> <br /> -<h2 style='display: inline' id='Magitlove'>Magit love</h2><br /> +<h2 style='display: inline' id='magit-love'>Magit love</h2><br /> <br /> <span>I almost fell in love with Magit, an integrated Git client for Emacs. But I think the best way to interact with Git is to use the <span class='inlinecode'>git</span> command line directly. I don't worry about typing out all the commands, as the most commonly used commands are in my shell history. Other useful Git programs I use frequently are <span class='inlinecode'>bit</span> and <span class='inlinecode'>tig</span>. Also, get a mechanical keyboard that makes hammering whole commands into the terminal even more enjoyable.</span><br /> <br /> @@ -5826,13 +8300,13 @@ Art by \ \_! / __! <br /> <span>Magit is pretty neat for basic Git operations, but I found myself searching the internet for the correct sub-commands to do the things I wanted to do in Git. Mainly, the way how branches are managed is confusing. Often, I fell back to the command line to fix up the mess I produced with Magit (e.g. accidentally pushing to the wrong remote branch, so I found myself fixing things manually on the terminal with the <span class='inlinecode'>git</span> command with forced pushes....). Magit is hotkey driven, and common commands are quickly explorable through built-in hotkey menus. Still, I found it challenging to navigate to more advanced Git sub-commands that way which was much easier accomplished by using the <span class='inlinecode'>git</span> command directly.</span><br /> <br /> -<h2 style='display: inline' id='GraphicalUI'>Graphical UI</h2><br /> +<h2 style='display: inline' id='graphical-ui'>Graphical UI</h2><br /> <br /> <span>If there is one thing I envy about Emacs is that it's a graphical program, whereas the Vi-family of editors are purely terminal-based. I see the benefits of being a graphical program as this enables the use of multiple fonts simultaneously to embed pictures and graphs (that would be neat as a Markdown preview, for example). There's also GVim (Vim with GTK UI), but that's more of an afterthought.</span><br /> <br /> <span>There are now graphical front-end clients for NeoVim, but I still need to dig into them. Let me know your experience if you have one. Luckily, I don't rely on something graphical in my text editor, but it would improve how the editor looks and feels. UTF8 can already do a lot in the terminal, and terminal emulators also allow you to use TrueType fonts. Still, you will always be limited to one TTF font for the whole terminal, and it isn't possible to have, for example, a different font for headings, paragraphs, etc... you get the idea. TTF+UTF8 can't beat authentic graphics. </span><br /> <br /> -<h2 style='display: inline' id='Scriptingit'>Scripting it</h2><br /> +<h2 style='display: inline' id='scripting-it'>Scripting it</h2><br /> <br /> <span>It is possible to customize every aspect of Emacs through Emacs Lisp. I have done some Elk Scheme programming in the past (a dialect of Lisp), but that was a long time ago, and I am not willing to dive here again to customize my environment. I would instead take the pragmatic approach and script what I need in VimScript (a terrible language, but it gets the job done!). I watched Damian Conway's VimScript course on O'Reilly Safari Books Online, which I greatly recommend. Yes, VimScript feels clunky, funky and weird and is far less elegant than Lisp, but it gets its job done - in most cases! (That reminds me that the Vim team has announced a new major version of VimScript with improvements and language changes made - I haven't gotten to it yet - but I assume that VimScript will always stay VimScript).</span><br /> <br /> @@ -5853,15 +8327,15 @@ Art by \ \_! / __! by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><i><font color="#ababab">" Clipboard</font></i> -<font color="#ff0000">vnoremap ,</font><b><font color="#ffffff">y</font></b><font color="#ff0000"> !pbcopy</font><font color="#ff0000"><CR></font><font color="#ff0000">ugv</font> -<font color="#ff0000">vnoremap ,</font><b><font color="#ffffff">i</font></b><font color="#ff0000"> !pbpaste</font><font color="#ff0000"><CR></font> -<font color="#ff0000">nmap ,</font><b><font color="#ffffff">i</font></b><font color="#ff0000"> !wpbpaste</font><font color="#ff0000"><CR></font> +<pre><i><font color="silver">" Clipboard</font></i> +vnoremap ,<b><u><font color="#000000">y</font></u></b> !pbcopy<CR>ugv +vnoremap ,<b><u><font color="#000000">i</font></u></b> !pbpaste<CR> +nmap ,<b><u><font color="#000000">i</font></u></b> !wpbpaste<CR> </pre> <br /> <span>That's only a very few lines and does precisely what I want. It's quick and dirty but get's the job done! If VimScript becomes too cumbersome, I can use Lua for NeoVim scripting.</span><br /> <br /> -<h2 style='display: inline' id='ThefamousEmacsOrgmode'>The famous Emacs Org mode</h2><br /> +<h2 style='display: inline' id='the-famous-emacs-org-mode'>The famous Emacs Org mode</h2><br /> <br /> <span>Org-mode is an Emacs mode for keeping notes, authoring documents, computational notebooks, literate programming, maintaining to-do lists, planning projects, and more — in a fast and effective plain-text system. There's even a dedicated website for it:</span><br /> <br /> @@ -5881,13 +8355,13 @@ http://www.gnu.org/software/src-highlite --> <a class='textlink' href='https://zsh.sourceforge.io/'>Z shell</a><br /> <a class='textlink' href='https://github.com/tmux/tmux'>tmux terminal multiplexer</a><br /> <br /> -<h2 style='display: inline' id='Seekingsimplicity'>Seeking simplicity</h2><br /> +<h2 style='display: inline' id='seeking-simplicity'>Seeking simplicity</h2><br /> <br /> <span>I am not ready to dive deep into the whole world of Emacs. I prefer small and simple tools as opposed to complex tools. Emacs comes with many features out of the box, whereas in Vim/NeoVim, you would need to install many plugins to replicate some of the behaviour. Yes, I need to invest time managing all the Vim/NeoVim plugins I use, but I feel more in control compared to Doom Emacs, where a framework around vanilla Emacs manages all the plugins. I could use vanilla Emacs and manage all my plugins the vanilla way, but for me, it's not worth the effort to learn and dive into that as all that I want to do I can already do with Vim/NeoVim.</span><br /> <br /> <span>I am not saying that Vim/NeoVim are simple programs, but they are much simpler than Emacs with much smaller footprints; furthermore, they appear to be more straightforward as I am used to them. I only need Vim/NeoVim to be an editor, an IDE (through some plugins), and nothing more.</span><br /> <br /> -<h2 style='display: inline' id='Conclusion'>Conclusion</h2><br /> +<h2 style='display: inline' id='conclusion'>Conclusion</h2><br /> <br /> <span>I understand the Emacs users now. Emacs is an incredibly powerful platform for almost everything, not just text editing. With Emacs, you can do nearly everything (Writing, editing, programming, calendar scheduling and note taking, Jira integration, playing games, listening to music, reading/writing emails, browsing the web, using as a calculator, generating HTML pages, configuring interactive menus, jumping around between every feature and every file within one single session, chat on IRC, surf the Gopherspace, ... the options are endless....). If you want to have one piece of software which rules it all and you are happy to invest a large part of your time in your platform: Pick Emacs, and over time Emacs will become "your" Emacs, customized to your own needs and change the way it works, which makes the Emacs users stick even more to it.</span><br /> <br /> @@ -5915,10 +8389,22 @@ http://www.gnu.org/software/src-highlite --> <summary>This will be a quick blog post, as I am busy with my personal life now. I have relocated to a different country and am still busy arranging things. So bear with me :-)</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='InstallingDTailonOpenBSD'>Installing DTail on OpenBSD</h1><br /> + <h1 style='display: inline' id='installing-dtail-on-openbsd'>Installing DTail on OpenBSD</h1><br /> <br /> <span class='quote'>Published at 2022-10-30T11:03:19+02:00</span><br /> <br /> +<span>This will be a quick blog post, as I am busy with my personal life now. I have relocated to a different country and am still busy arranging things. So bear with me :-)</span><br /> +<br /> +<span> In this post, I want to give a quick overview (or how-to) about installing DTail on OpenBSD, as the official documentation only covers Red Hat and Fedora Linux! And this blog post will also be used as my reference!</span><br /> +<br /> +<a class='textlink' href='https://dtail.dev'>https://dtail.dev</a><br /> +<br /> +<span>I am using Rexify for my OpenBSD automation. Check out the following article covering my Rex setup in a little bit more detail:</span><br /> +<br /> +<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>Let's Encrypt with OpenBSD and Rex</a><br /> +<br /> +<span>I will also mention some relevant <span class='inlinecode'>Rexfile</span> snippets in this post!</span><br /> +<br /> <pre> ,_---~~~~~----._ _,,_,*^____ _____``*g*\"*, @@ -5956,19 +8442,22 @@ http://www.gnu.org/software/src-highlite --> ' ' </pre> <br /> -<span>This will be a quick blog post, as I am busy with my personal life now. I have relocated to a different country and am still busy arranging things. So bear with me :-)</span><br /> -<br /> -<span> In this post, I want to give a quick overview (or how-to) about installing DTail on OpenBSD, as the official documentation only covers Red Hat and Fedora Linux! And this blog post will also be used as my reference!</span><br /> -<br /> -<a class='textlink' href='https://dtail.dev'>https://dtail.dev</a><br /> -<br /> -<span>I am using Rexify for my OpenBSD automation. Check out the following article covering my Rex setup in a little bit more detail:</span><br /> -<br /> -<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>Let's Encrypt with OpenBSD and Rex</a><br /> -<br /> -<span>I will also mention some relevant <span class='inlinecode'>Rexfile</span> snippets in this post!</span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline' id='Compileit'>Compile it</h2><br /> +<ul> +<li><a href='#installing-dtail-on-openbsd'>Installing DTail on OpenBSD</a></li> +<li>⇢ <a href='#compile-it'>Compile it</a></li> +<li>⇢ <a href='#install-it'>Install it</a></li> +<li>⇢ ⇢ <a href='#rexification'>Rexification</a></li> +<li>⇢ <a href='#configure-it'>Configure it</a></li> +<li>⇢ ⇢ <a href='#rexification'>Rexification</a></li> +<li>⇢ <a href='#update-the-key-cache-for-it'>Update the key cache for it</a></li> +<li>⇢ ⇢ <a href='#rexification'>Rexification</a></li> +<li>⇢ <a href='#start-it'>Start it</a></li> +<li>⇢ <a href='#use-it'>Use it</a></li> +<li>⇢ <a href='#conclusions'>Conclusions</a></li> +</ul><br /> +<h2 style='display: inline' id='compile-it'>Compile it</h2><br /> <br /> <span>First of all, DTail needs to be downloaded and compiled. For that, <span class='inlinecode'>git</span>, <span class='inlinecode'>go</span>, and <span class='inlinecode'>gmake</span> are required:</span><br /> <br /> @@ -6003,7 +8492,7 @@ $ doas pkg_delete git go gmake <br /> <span>One day I shall create an official OpenBSD port for DTail.</span><br /> <br /> -<h2 style='display: inline' id='Installit'>Install it</h2><br /> +<h2 style='display: inline' id='install-it'>Install it</h2><br /> <br /> <span>Installing the binaries is now just a matter of copying them to <span class='inlinecode'>/usr/local/bin</span> as follows:</span><br /> <br /> @@ -6045,7 +8534,7 @@ END $ doas chmod 755 /etc/rc.d/dserver </pre> <br /> -<h3 style='display: inline' id='Rexification'>Rexification</h3><br /> +<h3 style='display: inline' id='rexification'>Rexification</h3><br /> <br /> <span>This is the task for setting it up via Rex. Note the <span class='inlinecode'>. . . .</span>, that's a placeholder which we will fill up more and more during this blog post:</span><br /> <br /> @@ -6072,7 +8561,7 @@ task 'dtail', group => 'frontends', }; </pre> <br /> -<h2 style='display: inline' id='Configureit'>Configure it</h2><br /> +<h2 style='display: inline' id='configure-it'>Configure it</h2><br /> <br /> <span>Now, DTail is fully installed but still needs to be configured. Grab the default config file from GitHub ...</span><br /> <br /> @@ -6095,7 +8584,7 @@ $ curl https://raw.githubusercontent.com/mimecast/dtail/master/examples/dtail.js } </pre> <br /> -<h3 style='display: inline' id='Rexification'>Rexification</h3><br /> +<h3 style='display: inline' id='rexification'>Rexification</h3><br /> <br /> <span>That's as simple as adding the following to the Rex task:</span><br /> <br /> @@ -6111,7 +8600,7 @@ file '/etc/dserver/dtail.json', on_change => sub { $restart = TRUE }; </pre> <br /> -<h2 style='display: inline' id='Updatethekeycacheforit'>Update the key cache for it</h2><br /> +<h2 style='display: inline' id='update-the-key-cache-for-it'>Update the key cache for it</h2><br /> <br /> <span>DTail relies on SSH for secure authentication and communication. However, the system user <span class='inlinecode'>_dserver</span> has no permission to read the SSH public keys from the user's home directories, so the DTail server also checks for available public keys in an alternative path <span class='inlinecode'>/var/run/dserver/cache</span>. </span><br /> <br /> @@ -6164,7 +8653,7 @@ $ echo /usr/local/bin/dserver-update-key-cache.sh | doas tee -a /etc/daily.local /usr/local/bin/dserver-update-key-cache.sh </pre> <br /> -<h3 style='display: inline' id='Rexification'>Rexification</h3><br /> +<h3 style='display: inline' id='rexification'>Rexification</h3><br /> <br /> <span>That's done by adding ...</span><br /> <br /> @@ -6180,7 +8669,7 @@ append_if_no_such_line '/etc/daily.local', '/usr/local/bin/dserver-u <br /> <span>... to the Rex task!</span><br /> <br /> -<h2 style='display: inline' id='Startit'>Start it</h2><br /> +<h2 style='display: inline' id='start-it'>Start it</h2><br /> <br /> <span>Now, it's time to enable and start the DTail server:</span><br /> <br /> @@ -6220,7 +8709,7 @@ Caching /home/rex/.ssh/authorized_keys -> /var/cache/dserver/rex.authorized_k All set... </pre> <br /> -<h2 style='display: inline' id='Useit'>Use it</h2><br /> +<h2 style='display: inline' id='use-it'>Use it</h2><br /> <br /> <span>The DTail server is now ready to serve connections. You can use any DTail commands, such as <span class='inlinecode'>dtail</span>, <span class='inlinecode'>dgrep</span>, <span class='inlinecode'>dmap</span>, <span class='inlinecode'>dcat</span>, <span class='inlinecode'>dtailhealth</span>, to do so. Checkout out all the usage examples on the official DTail page.</span><br /> <br /> @@ -6246,7 +8735,7 @@ REMOTE|blowfish|100|7|fstab|31bfd9d9a6788844.h /usr/local ffs rw,wxallowed,nodev REMOTE|fishfinger|100|7|fstab|093f510ec5c0f512.h /usr/local ffs rw,wxallowed,nodev 1 2 </pre> <br /> -<h2 style='display: inline' id='Conclusions'>Conclusions</h2><br /> +<h2 style='display: inline' id='conclusions'>Conclusions</h2><br /> <br /> <span>It's a bit of manual work, but it's ok on this small scale! I shall invest time in creating an official OpenBSD port, though. That would render most of the manual steps obsolete, as outlined in this post!</span><br /> <br /> @@ -6260,10 +8749,10 @@ REMOTE|fishfinger|100|7|fstab|093f510ec5c0f512.h /usr/local ffs rw,wxallowed,nod <br /> <span>Other related posts are:</span><br /> <br /> -<a class='textlink' href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>2021-04-22 DTail - The distributed log tail program</a><br /> -<a class='textlink' href='./2022-03-06-the-release-of-dtail-4.0.0.html'>2022-03-06 The release of DTail 4.0.0</a><br /> -<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD (You are currently reading this)</a><br /> <a class='textlink' href='./2023-09-25-dtail-usage-examples.html'>2023-09-25 DTail usage examples</a><br /> +<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD (You are currently reading this)</a><br /> +<a class='textlink' href='./2022-03-06-the-release-of-dtail-4.0.0.html'>2022-03-06 The release of DTail 4.0.0</a><br /> +<a class='textlink' href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>2021-04-22 DTail - The distributed log tail program</a><br /> <br /> <a class='textlink' href='../'>Back to the main site</a><br /> </div> @@ -6281,10 +8770,12 @@ REMOTE|fishfinger|100|7|fstab|093f510ec5c0f512.h /usr/local ffs rw,wxallowed,nod <summary>Everyone has it once in a while: A bad night's sleep. Here I attempt to list valuable tips on how to deal with it.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Afterabadnightssleep'>After a bad night's sleep</h1><br /> + <h1 style='display: inline' id='after-a-bad-night-s-sleep'>After a bad night's sleep</h1><br /> <br /> <span class='quote'>Published at 2022-09-30T09:53:23+03:00; Updated at 2022-10-12</span><br /> <br /> +<span>Everyone has it once in a while: A bad night's sleep. Here I attempt to list valuable tips on how to deal with it.</span><br /> +<br /> <pre> z z @@ -6299,17 +8790,35 @@ jgs (________\ \ '-' </pre> <br /> -<span>Everyone has it once in a while: A bad night's sleep. Here I attempt to list valuable tips on how to deal with it.</span><br /> +<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br /> <br /> -<h2 style='display: inline' id='Donttakethedayoff'>Don't take the day off.</h2><br /> +<ul> +<li><a href='#after-a-bad-night-s-sleep'>After a bad night's sleep</a></li> +<li>⇢ <a href='#don-t-take-the-day-off'>Don't take the day off.</a></li> +<li>⇢ <a href='#start-work-early'>Start work early</a></li> +<li>⇢ <a href='#sweat-the-small-stuff'>Sweat the small stuff</a></li> +<li>⇢ <a href='#enter-the-flow-state'>Enter the flow state</a></li> +<li>⇢ <a href='#reschedule-meetings'>Reschedule meetings</a></li> +<li>⇢ <a href='#invent'>Invent</a></li> +<li>⇢ <a href='#fast'>Fast</a></li> +<li>⇢ <a href='#stretch'>Stretch</a></li> +<li>⇢ <a href='#walk'>Walk</a></li> +<li>⇢ <a href='#red-bull'>Red Bull</a></li> +<li>⇢ <a href='#power-nap'>Power nap</a></li> +<li>⇢ <a href='#don-t-take-anything-personally'>Don't take anything personally.</a></li> +<li>⇢ <a href='#meditate'>Meditate</a></li> +<li>⇢ <a href='#write-things-down'>Write things down</a></li> +<li>⇢ <a href='#social-media'>Social media</a></li> +</ul><br /> +<h2 style='display: inline' id='don-t-take-the-day-off'>Don't take the day off.</h2><br /> <br /> <span>Don't take a day off after not sleeping enough the previous night. That would be wasting the holiday allowance. It wouldn't be possible to enjoy my free time anyway, so why not just work? There's still a way for an IT Engineer to be productive (sometimes even more) with half or less of the concentration power available!</span><br /> <br /> -<h2 style='display: inline' id='Startworkearly'>Start work early</h2><br /> +<h2 style='display: inline' id='start-work-early'>Start work early</h2><br /> <br /> <span>Probably I am already awake early and am unable to fall asleep again. My strategy here is to "attack" the day: Start work early and finish early. The early bird will also encounter fewer distractions from colleagues.</span><br /> <br /> -<h2 style='display: inline' id='Sweatthesmallstuff'>Sweat the small stuff</h2><br /> +<h2 style='display: inline' id='sweat-the-small-stuff'>Sweat the small stuff</h2><br /> <br /> <span>There's never a shortage of small items to hook off my list. Most of these items don't require my full concentration power, and I will be happy to get them off my list so that the next day, after a good night's sleep, I can immerse myself again in focused, deep work with all concentration powers at hand.</span><br /> <br /> @@ -6323,57 +8832,57 @@ jgs (________\ \ <li>Going through any tedious paperwork.</li> <li>Catch up with the journal and mark off all trivial action items.</li> </ul><br /> -<h2 style='display: inline' id='Entertheflowstate'>Enter the flow state</h2><br /> +<h2 style='display: inline' id='enter-the-flow-state'>Enter the flow state</h2><br /> <br /> <span>I find it easy to enter the "flow state" after a bad night's sleep. All I need to do is to put on some ambient music (preferably instrumental chill house) and start to work on a not-too-difficult ticket.</span><br /> <br /> <span>Usually, the "flow state" is associated with deep-focused work, but deep-focused work isn't easily possible under sleep deprivation. It's still possible to be in the flow by working on more manageable tasks and leaving the difficult ones for the next day.</span><br /> <br /> -<h2 style='display: inline' id='Reschedulemeetings'>Reschedule meetings</h2><br /> +<h2 style='display: inline' id='reschedule-meetings'>Reschedule meetings</h2><br /> <br /> <span>I find engaging in discussions and demanding meetings challenging after a lousy night's sleep. I still attend the sessions I am invited to as "only" a participant, but I prefer to reschedule all meetings I am the primary driver of.</span><br /> <br /> <span>This, unfortunately, also includes interviews. Interviews require full concentration power. So for interviews, I would find a colleague to step in for me or ask to reschedule the interview altogether. Everything else wouldn't make it justice and would waste everyone's time!</span><br /> <br /> -<h2 style='display: inline' id='Invent'>Invent</h2><br /> +<h2 style='display: inline' id='invent'>Invent</h2><br /> <br /> <span>The mind works differently under sleep deprivation: It's easier to invent new stuff as it's easier to have a look at things from different perspectives. Until an hour ago, I didn't know yet what I would be blogging about for this month, and then I just started writing this, and it took me only half an hour to write the first draft of this blog post!</span><br /> <br /> -<h2 style='display: inline' id='Fast'>Fast</h2><br /> +<h2 style='display: inline' id='fast'>Fast</h2><br /> <br /> <span>I don't eat breakfast, and I don't eat lunch on these days. I only have dinner. Not eating means my mind doesn't get foggy, and I keep up the work momentum. This is called intermittent fasting, which not only generally helps to keep the weight under control and boosts the concentration power. Furthermore, intermittent fasting is healthy. You should include it in your routine, even after a good night's sleep.</span><br /> <br /> -<h2 style='display: inline' id='Stretch'>Stretch</h2><br /> +<h2 style='display: inline' id='stretch'>Stretch</h2><br /> <br /> <span>I won't have enough energy for strenuous physical exercise on those days, but a 30 to a 60-minute stretching session can make the day. Stretching will even hurt less under sleep deprivation! The stretching could also be substituted with a light Yoga session.</span><br /> <br /> -<h2 style='display: inline' id='Walk'>Walk</h2><br /> +<h2 style='display: inline' id='walk'>Walk</h2><br /> <br /> <span>Walking is healthy, and the time can be used to listen to interesting podcasts. The available concentration power might not be enough for more sophisticated audio literature. I will have enough energy for one or two daily walks (~10k steps for the day in total). Sometimes, I listen to music during walks. I also try to catch the bright sunlight.</span><br /> <br /> -<h2 style='display: inline' id='RedBull'>Red Bull</h2><br /> +<h2 style='display: inline' id='red-bull'>Red Bull</h2><br /> <br /> <span>I don't think that Red Bull is a healthy drink. But once in a while, a can in the early afternoon brings wonders, and productivity will skyrocket. Other than Red Bull, drink a lot of water throughout the day. Don't forget to drink the sugar-free version; otherwise, your intermittent fast will be broken.</span><br /> <br /> -<h2 style='display: inline' id='Powernap'>Power nap</h2><br /> +<h2 style='display: inline' id='power-nap'>Power nap</h2><br /> <br /> <span>I don't know how to "enforce" a nap, but sometimes I manage to power nap, and it helps wonders. A 30-minute nap sometimes brings me back to normal. If you don't tend to fast as you are too hungry, it helps to try to nap approximately 30 minutes after eating something.</span><br /> <br /> -<h2 style='display: inline' id='Donttakeanythingpersonally'>Don't take anything personally.</h2><br /> +<h2 style='display: inline' id='don-t-take-anything-personally'>Don't take anything personally.</h2><br /> <br /> <span>It's much more challenging to keep the mind "under control" in this state. Every annoyance can potentially upset, which could reflect on the work colleagues. It is wise to attempt to go with a positive attitude into the day, always smile and be polite to the family and colleagues at work. Don't let anything drop out to the people next; they don't deserve it as they didn't do anything wrong! Also, remember, it can't be controlled at all. It's time to let go of the annoyances for the day.</span><br /> <br /> -<h2 style='display: inline' id='Meditate'>Meditate</h2><br /> +<h2 style='display: inline' id='meditate'>Meditate</h2><br /> <br /> <span>To keep the good vibe, it helps to meditate for 10 minutes. Meditation must nothing be fancy. It can be just lying on the sofa and observing your thoughts as they come and go. Don't judge your thoughts, as that could put you in a negative mood. It's not necessary to sit in an uncomfortable Yoga pose, and it is not required to chant "Ohhmmmmm".</span><br /> <br /> -<h2 style='display: inline' id='Writethingsdown'>Write things down</h2><br /> +<h2 style='display: inline' id='write-things-down'>Write things down</h2><br /> <br /> <span>Sometimes something requiring more concentration power demands time. This is where it helps to write a note in a journal and return to it another day. This doesn't mean slacking off but managing the rarely available concentration power for the day. I might repeat myself: Today, sweat all the small stuff. Tomorrow, do the deep-focused work on that crucial project again.</span><br /> <br /> <span>It's easier to forget things on those days, so everything should be written down so that it can be worked off later. Things written down will not be overlooked!</span><br /> <br /> -<h2 style='display: inline' id='Socialmedia'>Social media</h2><br /> +<h2 style='display: inline' id='social-media'>Social media</h2><br /> <br /> <span>I wouldn't say I like checking social media, as it can consume a lot of time and can become addictive. But once in a while, I want to catch up with my "networks". After a bad night's sleep, it's the perfect time to check your social media. Once done, you don't have to do it anymore for the next couple of days!</span><br /> <br /> @@ -6383,2767 +8892,4 @@ jgs (________\ \ </div> </content> </entry> - <entry> - <title>Gemtexter 1.1.0 - Let's Gemtext again</title> - <link href="gemini://foo.zone/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi" /> - <id>gemini://foo.zone/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi</id> - <updated>2022-08-27T18:25:57+01:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>I proudly announce that I've released Gemtexter version `1.1.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Gemtexter110LetsGemtextagain'>Gemtexter 1.1.0 - Let's Gemtext again</h1><br /> -<br /> -<span class='quote'>Published at 2022-08-27T18:25:57+01:00</span><br /> -<br /> -<pre> --=[ typewriter ]=- 1/98 - - .-------. - _|~~ ~~ |_ - =(_|_______|_)= - |:::::::::| - |:::::::[]| - |o=======.| - jgs `"""""""""` -</pre> -<br /> -<span>I proudly announce that I've released Gemtexter version <span class='inlinecode'>1.1.0</span>. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash.</span><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/gemtexter'>https://codeberg.org/snonux/gemtexter</a><br /> -<br /> -<span>It has been around a year since I released the first version <span class='inlinecode'>1.0.0</span>. Although, there aren't any groundbreaking changes, there have been a couple of smaller commits and adjustments. I was quite surprised that I received a bunch of feedback and requests about Gemtexter so it means that I am not the only person in the universe actually using it.</span><br /> -<br /> -<h2 style='display: inline' id='Whatsnew'>What's new?</h2><br /> -<br /> -<h3 style='display: inline' id='AutomaticcheckforGNUversionrequirements'>Automatic check for GNU version requirements</h3><br /> -<br /> -<span>Gemtexter relies on the GNU versions of the tools <span class='inlinecode'>grep</span>, <span class='inlinecode'>sed</span> and <span class='inlinecode'>date</span> and it also requires the Bash shell in version 5 at least. That's now done in the <span class='inlinecode'>check_dependencies()</span> function:</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><font color="#7bc710">check_dependencies ()</font><font color="#ff0000"> {</font> -<font color="#ff0000"> </font><i><font color="#ababab"># At least, Bash 5 is required</font></i> -<font color="#ff0000"> </font><b><font color="#ffffff">local</font></b><font color="#ff0000"> -i </font><font color="#ff0000">required_version</font><font color="#F3E651">=</font><font color="#bb00ff">5</font> -<font color="#ff0000"> </font><font color="#ff0000">IFS</font><font color="#F3E651">=.</font><font color="#ff0000"> </font><b><font color="#ffffff">read</font></b><font color="#ff0000"> -ra version </font><font color="#F3E651"><<<</font><font color="#ff0000"> </font><font color="#bb00ff">"$BASH_VERSION"</font> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">[</font><font color="#ff0000"> </font><font color="#bb00ff">"${version[0]}"</font><font color="#ff0000"> -lt </font><font color="#ff0000">$required_version</font><font color="#ff0000"> </font><font color="#F3E651">];</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> log ERROR </font><font color="#bb00ff">"ERROR, </font><font color="#ffffff">\"</font><font color="#bb00ff">bash</font><font color="#ffffff">\"</font><font color="#bb00ff"> must be at least at major version $required_version!"</font> -<font color="#ff0000"> </font><b><font color="#ffffff">exit</font></b><font color="#ff0000"> </font><font color="#bb00ff">2</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> - -<font color="#ff0000"> </font><i><font color="#ababab"># These must be the GNU versions of the commands</font></i> -<font color="#ff0000"> </font><b><font color="#ffffff">for</font></b><font color="#ff0000"> tool </font><b><font color="#ffffff">in</font></b><font color="#ff0000"> </font><font color="#ff0000">$DATE</font><font color="#ff0000"> </font><font color="#ff0000">$SED</font><font color="#ff0000"> </font><font color="#ff0000">$GREP</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">do</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">if</font></b><font color="#ff0000"> </font><font color="#F3E651">!</font><font color="#ff0000"> </font><font color="#ff0000">$tool</font><font color="#ff0000"> --version </font><font color="#F3E651">|</font><font color="#ff0000"> grep -q GNU</font><font color="#F3E651">;</font><font color="#ff0000"> </font><b><font color="#ffffff">then</font></b> -<font color="#ff0000"> log ERROR </font><font color="#bb00ff">"ERROR, </font><font color="#ffffff">\"</font><font color="#bb00ff">$tool</font><font color="#ffffff">\"</font><font color="#bb00ff"> command is not the GNU version, please install!"</font> -<font color="#ff0000"> </font><b><font color="#ffffff">exit</font></b><font color="#ff0000"> </font><font color="#bb00ff">2</font> -<font color="#ff0000"> </font><b><font color="#ffffff">fi</font></b> -<font color="#ff0000"> </font><b><font color="#ffffff">done</font></b> -<font color="#ff0000">}</font> -</pre> -<br /> -<span>Especially macOS users didn't read the <span class='inlinecode'>README</span> carefully enough to install GNU Grep, GNU Sed and GNU Date before using Gemtexter.</span><br /> -<br /> -<h3 style='display: inline' id='BackticksnowproduceinlinecodeblocksintheHTMLoutput'>Backticks now produce <span class='inlinecode'>inline code blocks</span> in the HTML output</h3><br /> -<br /> -<span>The Gemtext format doesn't support inline code blocks, but Gemtexter now produces <span class='inlinecode'>inline code blocks</span> (means, small code fragments can be placed in the middle of a paragraph) in the HTML output when the code block is enclosed with Backticks. There were no adjustments required for the Markdown output format, because Markdown supports it already out of the box.</span><br /> -<br /> -<h3 style='display: inline' id='CacheforAtomfeedgeneration'>Cache for Atom feed generation</h3><br /> -<br /> -<span>The Bash is not the most performant language. Gemtexter already takes a couple of seconds only to generate the Atom feed for around two hand full of articles on my slightly underpowered Surface Go 2 Linux tablet. Therefore, I introduced a cache, so that subsequent Atom feed generation runs finish much quicker. The cache uses a checksum of the Gemtext <span class='inlinecode'>.gmi</span> file to decide whether anything of the content has changed or not.</span><br /> -<br /> -<h3 style='display: inline' id='Inputfiltersupport'>Input filter support</h3><br /> -<br /> -<span>Once your capsule reaches a certain size, it can become annoying to re-generate everything if you only want to preview the HTML or Markdown output of one single content file. The following will add a filter to only generate the files matching a regular expression:</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><font color="#F3E651">.</font><font color="#ff0000">/gemtexter --generate </font><font color="#bb00ff">'.*hello.*'</font> -</pre> -<br /> -<h3 style='display: inline' id='Revampedgitsupport'>Revamped <span class='inlinecode'>git</span> support</h3><br /> -<br /> -<span>The Git support has been completely rewritten. It's now more reliable and faster too. Have a look at the <span class='inlinecode'>README</span> for more information.</span><br /> -<br /> -<h3 style='display: inline' id='Additionofhtmlextrasandwebfontsupport'>Addition of <span class='inlinecode'>htmlextras</span> and web font support</h3><br /> -<br /> -<span>The <span class='inlinecode'>htmlextras</span> folder now contains all extra files required for the HTML output format such as cascading style sheet (CSS) files and web fonts.</span><br /> -<br /> -<h3 style='display: inline' id='Subsectionsupport'>Sub-section support</h3><br /> -<br /> -<span>It's now possible to define sub-sections within a Gemtexter capsule. For the HTML output, each sub-section can use its own CSS and web font definitions. E.g.:</span><br /> -<br /> -<a class='textlink' href='https://foo.zone'>The foo.zone main site</a><br /> -<a class='textlink' href='https://foo.zone/notes'>The notes sub-section (with different fonts)</a><br /> -<br /> -<h3 style='display: inline' id='More'>More</h3><br /> -<br /> -<span>Additionally, there were a couple of bug fixes, refactorings and overall improvements in the documentation made. </span><br /> -<br /> -<span>Overall I think it's a pretty solid <span class='inlinecode'>1.1.0</span> release without anything groundbreaking (therefore no major version jump). But I am happy about it.</span><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<span>Other related posts are:</span><br /> -<br /> -<a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace</a><br /> -<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> -<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again²</a><br /> -<a class='textlink' href='./2023-07-21-gemtexter-2.1.0-lets-gemtext-again-3.html'>2023-07-21 Gemtexter 2.1.0 - Let's Gemtext again³</a><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>Let's Encrypt with OpenBSD and Rex</title> - <link href="gemini://foo.zone/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi" /> - <id>gemini://foo.zone/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi</id> - <updated>2022-07-30T12:14:31+01:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>I was amazed at how easy it is to automatically generate and update Let's Encrypt certificates with OpenBSD.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='LetsEncryptwithOpenBSDandRex'>Let's Encrypt with OpenBSD and Rex</h1><br /> -<br /> -<span class='quote'>Published at 2022-07-30T12:14:31+01:00</span><br /> -<br /> -<pre> - / _ \ - The Hebern Machine \ ." ". / - ___ / \ - .."" "".. | O | - / \ | | - / \ | | - --------------------------------- - _/ o (O) o _ | - _/ ." ". | - I/ _________________/ \ | - _/I ." | | - ===== / I / / | - ===== | | | \ | _________________." | -===== | | | | | / \ / _|_|__|_|_ __ | - | | | | | | | \ "._." / o o \ ." ". | - | --| --| -| / \ _/ / \ | - \____\____\__| \ ______ | / | | | - -------- --- / | | | - ( ) (O) / \ / | - ----------------------- ".__." | - _|__________________________________________|_ - / \ - /________________________________________________\ - ASCII Art by John Savard -</pre> -<br /> -<span>I was amazed at how easy it is to automatically generate and update Let's Encrypt certificates with OpenBSD.</span><br /> -<br /> -<h2 style='display: inline' id='WhatsLetsEncrypt'>What's Let's Encrypt?</h2><br /> -<br /> -<span class='quote'>Let's Encrypt is a non-profit certificate authority run by Internet Security Research Group that provides X.509 certificates for Transport Layer Security (TLS) encryption at no charge. It is the world's largest certificate authority, used by more than 265 million websites, with the goal of all websites being secure and using HTTPS.</span><br /> -<br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Let's_Encrypt'>Source: Wikipedia</a><br /> -<br /> -<span>In short, it gives away TLS certificates for your website - for free! The catch is, that the certificates are only valid for three months. So it is better to automate certificate generation and renewals.</span><br /> -<br /> -<h2 style='display: inline' id='Meetacmeclient'>Meet <span class='inlinecode'>acme-client</span></h2><br /> -<br /> -<span><span class='inlinecode'>acme-client</span> is the default Automatic Certifcate Management Environment (ACME) client on OpenBSD and part of the OpenBSD base system. </span><br /> -<br /> -<span>When invoked, the client first checks whether certificates actually require to be generated.</span><br /> -<br /> -<ul> -<li>It first checks whether a certificate already exists; if not, it will attempt to generate a new one.</li> -<li>If the certificate already exists but expires within the next 30 days, it will renew it.</li> -<li>Otherwise, <span class='inlinecode'>acme-client</span> won't do anything.</li> -</ul><br /> -<span>Oversimplified, the following steps are undertaken by <span class='inlinecode'>acme-client</span> for generating a new certificate:</span><br /> -<br /> -<ul> -<li>Reading its config file <span class='inlinecode'>/etc/acme-client.conf</span> for a list of hosts (and their alternative names) to generate certificates. So it means you can also have certificates for arbitrary subdomains!</li> -<li>Automatic generation of the private certificate part (the certificate key) and the certificate signing request (CSR) to <span class='inlinecode'>/etc/ssl/...</span>.</li> -<li>Requesting Let's Encrypt to sign the certificate. This also includes providing a set of temporary files requested by Let's Encrypt in the next step for verification.</li> -<li>Let's Encrypt then will contact the hostname for the certificate through a particular URL (e.g. <span class='inlinecode'>http://foo.zone/.well-known/acme-challenge/...</span>) to verify that the requester is the valid owner of the host.</li> -<li>Let's Encrypt generates a certificate, which then is downloaded to <span class='inlinecode'>/etc/ssl/...</span>.</li> -</ul><br /> -<h2 style='display: inline' id='Configuration'>Configuration</h2><br /> -<br /> -<span>There is some (but easy) configuration required to make that all work on OpenBSD.</span><br /> -<br /> -<h3 style='display: inline' id='acmeclientconf'>acme-client.conf</h3><br /> -<br /> -<span>This is how my <span class='inlinecode'>/etc/acme-client.conf</span> looks like (I copied a template from <span class='inlinecode'>/etc/examples/acme-client.conf</span> to <span class='inlinecode'>/etc/acme-client.conf</span> and added my domains to the bottom:</span><br /> -<br /> -<pre> -# -# $OpenBSD: acme-client.conf,v 1.4 2020/09/17 09:13:06 florian Exp $ -# -authority letsencrypt { - api url "https://acme-v02.api.letsencrypt.org/directory" - account key "/etc/acme/letsencrypt-privkey.pem" -} - -authority letsencrypt-staging { - api url "https://acme-staging-v02.api.letsencrypt.org/directory" - account key "/etc/acme/letsencrypt-staging-privkey.pem" -} - -authority buypass { - api url "https://api.buypass.com/acme/directory" - account key "/etc/acme/buypass-privkey.pem" - contact "mailto:me@example.com" -} - -authority buypass-test { - api url "https://api.test4.buypass.no/acme/directory" - account key "/etc/acme/buypass-test-privkey.pem" - contact "mailto:me@example.com" -} - -domain buetow.org { - alternative names { www.buetow.org paul.buetow.org } - domain key "/etc/ssl/private/buetow.org.key" - domain full chain certificate "/etc/ssl/buetow.org.fullchain.pem" - sign with letsencrypt -} - -domain dtail.dev { - alternative names { www.dtail.dev } - domain key "/etc/ssl/private/dtail.dev.key" - domain full chain certificate "/etc/ssl/dtail.dev.fullchain.pem" - sign with letsencrypt -} - -domain foo.zone { - alternative names { www.foo.zone } - domain key "/etc/ssl/private/foo.zone.key" - domain full chain certificate "/etc/ssl/foo.zone.fullchain.pem" - sign with letsencrypt -} - -domain irregular.ninja { - alternative names { www.irregular.ninja } - domain key "/etc/ssl/private/irregular.ninja.key" - domain full chain certificate "/etc/ssl/irregular.ninja.fullchain.pem" - sign with letsencrypt -} - -domain snonux.land { - alternative names { www.snonux.land } - domain key "/etc/ssl/private/snonux.land.key" - domain full chain certificate "/etc/ssl/snonux.land.fullchain.pem" - sign with letsencrypt -} -</pre> -<br /> -<h3 style='display: inline' id='httpdconf'>httpd.conf</h3><br /> -<br /> -<span>For ACME to work, you will need to configure the HTTP daemon so that the "special" ACME requests from Let's Encrypt are served correctly. I am using the standard OpenBSD <span class='inlinecode'>httpd</span> here. These are the snippets I use for the <span class='inlinecode'>foo.zone</span> host in <span class='inlinecode'>/etc/httpd.conf</span> (of course, you need a similar setup for all other hosts as well):</span><br /> -<br /> -<pre> -server "foo.zone" { - listen on * port 80 - location "/.well-known/acme-challenge/*" { - root "/acme" - request strip 2 - } - location * { - block return 302 "https://$HTTP_HOST$REQUEST_URI" - } -} - -server "foo.zone" { - listen on * tls port 443 - tls { - certificate "/etc/ssl/foo.zone.fullchain.pem" - key "/etc/ssl/private/foo.zone.key" - } - location * { - root "/htdocs/gemtexter/foo.zone" - directory auto index - } -} -</pre> -<br /> -<span>As you see, plain HTTP only serves the ACME challenge path. Otherwise, it redirects the requests to TLS. The TLS section then attempts to use the Let's Encrypt certificates.</span><br /> -<br /> -<span>It is worth noticing that <span class='inlinecode'>httpd</span> will start without the certificates being present. This will cause a certificate error when you try to reach the HTTPS endpoint, but it helps to bootstrap Let's Encrypt. As you saw in the config snippet above, Let's Encrypt only requests the plain HTTP endpoint for the verification process, so HTTPS doesn't need to be operational yet at this stage. But once the certificates are generated, you will have to reload or restart <span class='inlinecode'>httpd</span> to use any new certificate.</span><br /> -<br /> -<h3 style='display: inline' id='CRONjob'>CRON job</h3><br /> -<br /> -<span>You could now run <span class='inlinecode'>doas acme-client foo.zone</span> to generate the certificate or to renew it. Or you could automate it with CRON.</span><br /> -<br /> -<span>I have created a script <span class='inlinecode'>/usr/local/bin/acme.sh</span> for that for all of my domains:</span><br /> -<br /> -<pre> -#!/bin/sh - -function handle_cert { - host=$1 - # Create symlink, so that relayd also can read it. - crt_path=/etc/ssl/$host - if [ -e $crt_path.crt ]; then - rm $crt_path.crt - fi - ln -s $crt_path.fullchain.pem $crt_path.crt - # Requesting and renewing certificate. - /usr/sbin/acme-client -v $host -} - -has_update=no -handle_cert www.buetow.org -if [ $? -eq 0 ]; then - has_update=yes -fi -handle_cert www.paul.buetow.org -if [ $? -eq 0 ]; then - has_update=yes -fi -handle_cert www.tmp.buetow.org -if [ $? -eq 0 ]; then - has_update=yes -fi -handle_cert www.dtail.dev -if [ $? -eq 0 ]; then - has_update=yes -fi -handle_cert www.foo.zone -if [ $? -eq 0 ]; then - has_update=yes -fi -handle_cert www.irregular.ninja -if [ $? -eq 0 ]; then - has_update=yes -fi -handle_cert www.snonux.land -if [ $? -eq 0 ]; then - has_update=yes -fi - -# Pick up the new certs. -if [ $has_update = yes ]; then - /usr/sbin/rcctl reload httpd - /usr/sbin/rcctl reload relayd - /usr/sbin/rcctl restart smtpd -fi -</pre> -<br /> -<span>And added the following line to <span class='inlinecode'>/etc/daily.local</span> to run the script once daily so that certificates will be renewed fully automatically:</span><br /> -<br /> -<pre> -/usr/local/bin/acme.sh -</pre> -<br /> -<span>I am receiving a daily output via E-Mail like this now:</span><br /> -<br /> -<pre> -Running daily.local: -acme-client: /etc/ssl/buetow.org.fullchain.pem: certificate valid: 80 days left -acme-client: /etc/ssl/paul.buetow.org.fullchain.pem: certificate valid: 80 days left -acme-client: /etc/ssl/tmp.buetow.org.fullchain.pem: certificate valid: 80 days left -acme-client: /etc/ssl/dtail.dev.fullchain.pem: certificate valid: 80 days left -acme-client: /etc/ssl/foo.zone.fullchain.pem: certificate valid: 80 days left -acme-client: /etc/ssl/irregular.ninja.fullchain.pem: certificate valid: 80 days left -acme-client: /etc/ssl/snonux.land.fullchain.pem: certificate valid: 79 days left -</pre> -<br /> -<h2 style='display: inline' id='relaydconfandsmtpdconf'>relayd.conf and smtpd.conf</h2><br /> -<br /> -<span>Besides <span class='inlinecode'>httpd</span>, <span class='inlinecode'>relayd</span> (mainly for Gemini) and <span class='inlinecode'>smtpd</span> (for mail, of course) also use TLS certificates. And as you can see in <span class='inlinecode'>acme.sh</span>, the services are reloaded or restarted (<span class='inlinecode'>smtpd</span> doesn't support reload) whenever a certificate is generated or updated.</span><br /> -<br /> -<h2 style='display: inline' id='Rexification'>Rexification</h2><br /> -<br /> -<span>I didn't write all these configuration files by hand. As a matter of fact, everything is automated with the Rex configuration management system.</span><br /> -<br /> -<a class='textlink' href='https://www.rexify.org'>https://www.rexify.org</a><br /> -<br /> -<span>At the top of the <span class='inlinecode'>Rexfile</span> I define all my hosts:</span><br /> -<br /> -<pre> -our @acme_hosts = qw/buetow.org paul.buetow.org tmp.buetow.org dtail.dev foo.zone irregular.ninja snonux.land/; -</pre> -<br /> -<h3 style='display: inline' id='GeneralACMEclientconfiguration'>General ACME client configuration</h3><br /> -<br /> -<span>ACME will be installed into the frontend group of hosts. Here, blowfish is the primary, and twofish is the secondary OpenBSD box.</span><br /> -<br /> -<pre> -group frontends => 'blowfish.buetow.org', 'twofish.buetow.org'; -</pre> -<br /> -<span>This is my Rex task for the general ACME configuration:</span><br /> -<br /> -<pre> -desc 'Configure ACME client'; -task 'acme', group => 'frontends', - sub { - file '/etc/acme-client.conf', - content => template('./etc/acme-client.conf.tpl', - acme_hosts => \@acme_hosts, - is_primary => $is_primary), - owner => 'root', - group => 'wheel', - mode => '644'; - - file '/usr/local/bin/acme.sh', - content => template('./scripts/acme.sh.tpl', - acme_hosts => \@acme_hosts, - is_primary => $is_primary), - owner => 'root', - group => 'wheel', - mode => '744'; - - file '/etc/daily.local', - ensure => 'present', - owner => 'root', - group => 'wheel', - mode => '644'; - - append_if_no_such_line '/etc/daily.local', '/usr/local/bin/acme.sh'; - }; -</pre> -<br /> -<span>And there is also a Rex task just to run the ACME script remotely:</span><br /> -<br /> -<pre> -desc 'Invoke ACME client'; -task 'acme_invoke', group => 'frontends', - sub { - say run '/usr/local/bin/acme.sh'; - }; - -</pre> -<br /> -<span>Furthermore, this snippet (also at the top of the Rexfile) helps to determine whether the current server is the primary server (all hosts will be without the <span class='inlinecode'>www.</span> prefix) or the secondary server (all hosts will be with the <span class='inlinecode'>www.</span> prefix):</span><br /> -<br /> -<pre> -# Bootstrapping the FQDN based on the server IP as the hostname and domain -# facts aren't set yet due to the myname file in the first place. -our $fqdns = sub { - my $ipv4 = shift; - return 'blowfish.buetow.org' if $ipv4 eq '23.88.35.144'; - return 'twofish.buetow.org' if $ipv4 eq '108.160.134.135'; - Rex::Logger::info("Unable to determine hostname for $ipv4", 'error'); - return 'HOSTNAME-UNKNOWN.buetow.org'; -}; - -# To determine whether the server is the primary or the secondary. -our $is_primary = sub { - my $ipv4 = shift; - $fqdns->($ipv4) eq 'blowfish.buetow.org'; -}; -</pre> -<br /> -<span>The following is the <span class='inlinecode'>acme-client.conf.tpl</span> Rex template file used for the automation. You see that the <span class='inlinecode'>www.</span> prefix isn't sent for the primary server. E.g. <span class='inlinecode'>foo.zone</span> will be served by the primary server (in my case, a server located in Germany) and <span class='inlinecode'>www.foo.zone</span> by the secondary server (in my case, a server located in Japan):</span><br /> -<br /> -<pre> -# -# $OpenBSD: acme-client.conf,v 1.4 2020/09/17 09:13:06 florian Exp $ -# -authority letsencrypt { - api url "https://acme-v02.api.letsencrypt.org/directory" - account key "/etc/acme/letsencrypt-privkey.pem" -} - -authority letsencrypt-staging { - api url "https://acme-staging-v02.api.letsencrypt.org/directory" - account key "/etc/acme/letsencrypt-staging-privkey.pem" -} - -authority buypass { - api url "https://api.buypass.com/acme/directory" - account key "/etc/acme/buypass-privkey.pem" - contact "mailto:me@example.com" -} - -authority buypass-test { - api url "https://api.test4.buypass.no/acme/directory" - account key "/etc/acme/buypass-test-privkey.pem" - contact "mailto:me@example.com" -} - -<% - our $primary = $is_primary->($vio0_ip); - our $prefix = $primary ? '' : 'www.'; -%> - -<% for my $host (@$acme_hosts) { %> -domain <%= $prefix.$host %> { - domain key "/etc/ssl/private/<%= $prefix.$host %>.key" - domain full chain certificate "/etc/ssl/<%= $prefix.$host %>.fullchain.pem" - sign with letsencrypt -} -<% } %> - -</pre> -<br /> -<span>And this is the <span class='inlinecode'>acme.sh.tpl</span>:</span><br /> -<br /> -<pre> -#!/bin/sh - -<% - our $primary = $is_primary->($vio0_ip); - our $prefix = $primary ? '' : 'www.'; --%> - -function handle_cert { - host=$1 - # Create symlink, so that relayd also can read it. - crt_path=/etc/ssl/$host - if [ -e $crt_path.crt ]; then - rm $crt_path.crt - fi - ln -s $crt_path.fullchain.pem $crt_path.crt - # Requesting and renewing certificate. - /usr/sbin/acme-client -v $host -} - -has_update=no -<% for my $host (@$acme_hosts) { -%> -handle_cert <%= $prefix.$host %> -if [ $? -eq 0 ]; then - has_update=yes -fi -<% } -%> - -# Pick up the new certs. -if [ $has_update = yes ]; then - /usr/sbin/rcctl reload httpd - /usr/sbin/rcctl reload relayd - /usr/sbin/rcctl restart smtpd -fi -</pre> -<br /> -<h3 style='display: inline' id='Servicerexification'>Service rexification </h3><br /> -<br /> -<span>These are the Rex tasks setting up <span class='inlinecode'>httpd</span>, <span class='inlinecode'>relayd</span> and <span class='inlinecode'>smtpd</span> services:</span><br /> -<br /> -<pre> -desc 'Setup httpd'; -task 'httpd', group => 'frontends', - sub { - append_if_no_such_line '/etc/rc.conf.local', 'httpd_flags='; - - file '/etc/httpd.conf', - content => template('./etc/httpd.conf.tpl', - acme_hosts => \@acme_hosts, - is_primary => $is_primary), - owner => 'root', - group => 'wheel', - mode => '644', - on_change => sub { service 'httpd' => 'restart' }; - - service 'httpd', ensure => 'started'; - }; - -desc 'Setup relayd'; -task 'relayd', group => 'frontends', - sub { - append_if_no_such_line '/etc/rc.conf.local', 'relayd_flags='; - - file '/etc/relayd.conf', - content => template('./etc/relayd.conf.tpl', - ipv6address => $ipv6address, - is_primary => $is_primary), - owner => 'root', - group => 'wheel', - mode => '600', - on_change => sub { service 'relayd' => 'restart' }; - - service 'relayd', ensure => 'started'; - }; - -desc 'Setup OpenSMTPD'; -task 'smtpd', group => 'frontends', - sub { - Rex::Logger::info('Dealing with mail aliases'); - file '/etc/mail/aliases', - source => './etc/mail/aliases', - owner => 'root', - group => 'wheel', - mode => '644', - on_change => sub { say run 'newaliases' }; - - Rex::Logger::info('Dealing with mail virtual domains'); - file '/etc/mail/virtualdomains', - source => './etc/mail/virtualdomains', - owner => 'root', - group => 'wheel', - mode => '644', - on_change => sub { service 'smtpd' => 'restart' }; - - Rex::Logger::info('Dealing with mail virtual users'); - file '/etc/mail/virtualusers', - source => './etc/mail/virtualusers', - owner => 'root', - group => 'wheel', - mode => '644', - on_change => sub { service 'smtpd' => 'restart' }; - - Rex::Logger::info('Dealing with smtpd.conf'); - file '/etc/mail/smtpd.conf', - content => template('./etc/mail/smtpd.conf.tpl', - is_primary => $is_primary), - owner => 'root', - group => 'wheel', - mode => '644', - on_change => sub { service 'smtpd' => 'restart' }; - - service 'smtpd', ensure => 'started'; - }; - -</pre> -<br /> -<span>This is the <span class='inlinecode'>httpd.conf.tpl</span>:</span><br /> -<br /> -<pre> -<% - our $primary = $is_primary->($vio0_ip); - our $prefix = $primary ? '' : 'www.'; -%> - -# Plain HTTP for ACME and HTTPS redirect -<% for my $host (@$acme_hosts) { %> -server "<%= $prefix.$host %>" { - listen on * port 80 - location "/.well-known/acme-challenge/*" { - root "/acme" - request strip 2 - } - location * { - block return 302 "https://$HTTP_HOST$REQUEST_URI" - } -} -<% } %> - -# Gemtexter hosts -<% for my $host (qw/foo.zone snonux.land/) { %> -server "<%= $prefix.$host %>" { - listen on * tls port 443 - tls { - certificate "/etc/ssl/<%= $prefix.$host %>.fullchain.pem" - key "/etc/ssl/private/<%= $prefix.$host %>.key" - } - location * { - root "/htdocs/gemtexter/<%= $host %>" - directory auto index - } -} -<% } %> - -# DTail special host -server "<%= $prefix %>dtail.dev" { - listen on * tls port 443 - tls { - certificate "/etc/ssl/<%= $prefix %>dtail.dev.fullchain.pem" - key "/etc/ssl/private/<%= $prefix %>dtail.dev.key" - } - location * { - block return 302 "https://github.dtail.dev$REQUEST_URI" - } -} - -# Irregular Ninja special host -server "<%= $prefix %>irregular.ninja" { - listen on * tls port 443 - tls { - certificate "/etc/ssl/<%= $prefix %>irregular.ninja.fullchain.pem" - key "/etc/ssl/private/<%= $prefix %>irregular.ninja.key" - } - location * { - root "/htdocs/irregular.ninja" - directory auto index - } -} - -# buetow.org special host. -server "<%= $prefix %>buetow.org" { - listen on * tls port 443 - tls { - certificate "/etc/ssl/<%= $prefix %>buetow.org.fullchain.pem" - key "/etc/ssl/private/<%= $prefix %>buetow.org.key" - } - block return 302 "https://paul.buetow.org" -} - -server "<%= $prefix %>paul.buetow.org" { - listen on * tls port 443 - tls { - certificate "/etc/ssl/<%= $prefix %>paul.buetow.org.fullchain.pem" - key "/etc/ssl/private/<%= $prefix %>paul.buetow.org.key" - } - block return 302 "https://foo.zone/contact-information.html" -} - -server "<%= $prefix %>tmp.buetow.org" { - listen on * tls port 443 - tls { - certificate "/etc/ssl/<%= $prefix %>tmp.buetow.org.fullchain.pem" - key "/etc/ssl/private/<%= $prefix %>tmp.buetow.org.key" - } - root "/htdocs/buetow.org/tmp" - directory auto index -} -</pre> -<br /> -<span>and this the <span class='inlinecode'>relayd.conf.tpl</span>:</span><br /> -<br /> -<pre> -<% - our $primary = $is_primary->($vio0_ip); - our $prefix = $primary ? '' : 'www.'; -%> - -log connection - -tcp protocol "gemini" { - tls keypair <%= $prefix %>foo.zone - tls keypair <%= $prefix %>buetow.org -} - -relay "gemini4" { - listen on <%= $vio0_ip %> port 1965 tls - protocol "gemini" - forward to 127.0.0.1 port 11965 -} - -relay "gemini6" { - listen on <%= $ipv6address->($hostname) %> port 1965 tls - protocol "gemini" - forward to 127.0.0.1 port 11965 -} -</pre> -<br /> -<span>And last but not least, this is the <span class='inlinecode'>smtpd.conf.tpl</span>:</span><br /> -<br /> -<pre> -<% - our $primary = $is_primary->($vio0_ip); - our $prefix = $primary ? '' : 'www.'; -%> - -pki "buetow_org_tls" cert "/etc/ssl/<%= $prefix %>buetow.org.fullchain.pem" -pki "buetow_org_tls" key "/etc/ssl/private/<%= $prefix %>buetow.org.key" - -table aliases file:/etc/mail/aliases -table virtualdomains file:/etc/mail/virtualdomains -table virtualusers file:/etc/mail/virtualusers - -listen on socket -listen on all tls pki "buetow_org_tls" hostname "<%= $prefix %>buetow.org" -#listen on all - -action localmail mbox alias <aliases> -action receive mbox virtual <virtualusers> -action outbound relay - -match from any for domain <virtualdomains> action receive -match from local for local action localmail -match from local for any action outbound -</pre> -<br /> -<h2 style='display: inline' id='Allpiecestogether'>All pieces together</h2><br /> -<br /> -<span>For the complete <span class='inlinecode'>Rexfile</span> example and all the templates, please look at the Git repository:</span><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/rexfiles'>https://codeberg.org/snonux/rexfiles</a><br /> -<br /> -<span>Besides ACME, other things, such as DNS servers, are also rexified. The following command will run all the Rex tasks and configure everything on my frontend machines automatically:</span><br /> -<br /> -<pre> -rex commons -</pre> -<br /> -<span>The <span class='inlinecode'>commons</span> is a group of tasks I specified which combines a set of common tasks I always want to execute on all frontend machines. This also includes the ACME tasks mentioned in this article!</span><br /> -<br /> -<h2 style='display: inline' id='Conclusion'>Conclusion</h2><br /> -<br /> -<span>ACME and Let's Encrypt greatly help reduce recurring manual maintenance work (creating and renewing certificates). Furthermore, all the certificates are free of cost! I love to use OpenBSD and Rex to automate all of this.</span><br /> -<br /> -<span>OpenBSD suits perfectly here as all the tools are already part of the base installation. But I like underdogs. Rex is not as powerful and popular as other configuration management systems (e.g. Puppet, Chef, SALT or even Ansible). It is more of an underdog, and the community is small.</span><br /> -<br /> -<span>Why re-inventing the wheel? I love that a <span class='inlinecode'>Rexfile</span> is just a Perl DSL. Also, OpenBSD comes with Perl in the base system. So no new programming language had to be added to my mix for the configuration management system. Also, the <span class='inlinecode'>acme.sh</span> shell script is not a Bash but a standard Bourne shell script, so I didn't have to install an additional shell as OpenBSD does not come with the Bash pre-installed.</span><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<span>Other *BSD related posts are:</span><br /> -<br /> -<a class='textlink' href='./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html'>2016-04-09 Jails and ZFS with Puppet on FreeBSD</a><br /> -<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>2022-07-30 Let's Encrypt with OpenBSD and Rex (You are currently reading this)</a><br /> -<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> -<a class='textlink' href='./2024-01-13-one-reason-why-i-love-openbsd.html'>2024-01-13 One reason why I love OpenBSD</a><br /> -<a class='textlink' href='./2024-04-01-KISS-high-availability-with-OpenBSD.html'>2024-04-01 KISS high-availability with OpenBSD</a><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>Sweating the small stuff - Tiny projects of mine</title> - <link href="gemini://foo.zone/gemfeed/2022-06-15-sweating-the-small-stuff.gmi" /> - <id>gemini://foo.zone/gemfeed/2022-06-15-sweating-the-small-stuff.gmi</id> - <updated>2022-06-15T08:47:44+01:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>This blog post is a bit different from the others. It consists of multiple but smaller projects worth mentioning. I got inspired by Julia Evan's 'Tiny programs' blog post and the side projects of The Sephist, so I thought I would also write a blog posts listing a couple of small projects of mine:</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='SweatingthesmallstuffTinyprojectsofmine'>Sweating the small stuff - Tiny projects of mine</h1><br /> -<br /> -<span class='quote'>Published at 2022-06-15T08:47:44+01:00; Updated at 2022-06-18</span><br /> -<br /> -<pre> - _ - /_/_ .'''. - =O(_)))) ...' `. - jgs \_\ `. .''' - `..' -</pre> -<br /> -<span>This blog post is a bit different from the others. It consists of multiple but smaller projects worth mentioning. I got inspired by Julia Evan's "Tiny programs" blog post and the side projects of The Sephist, so I thought I would also write a blog posts listing a couple of small projects of mine:</span><br /> -<br /> -<a class='textlink' href='https://jvns.ca/blog/2022/03/08/tiny-programs/'>Tiny programs</a><br /> -<a class='textlink' href='https://thesephist.com/projects/'>The Sephist's project list</a><br /> -<br /> -<span>Working on tiny projects is a lot of fun as you don't need to worry about any standards or code reviews and you decide how and when you work on it. There aren't restrictions regarding technologies used. You are likely the only person working on these tiny projects and that means that there is no conflict with any other developers. This is complete freedom :-).</span><br /> -<br /> -<span>But before going through the tiny projects let's take a paragraph for the <span class='inlinecode'>1y</span> anniversary retrospective.</span><br /> -<br /> -<h2 style='display: inline' id='1yanniversary'><span class='inlinecode'>1y</span> anniversary</h2><br /> -<br /> -<span>It has been one year since I started posting regularly (at least once monthly) on this blog again. It has been a lot of fun (and work) doing so for various reasons:</span><br /> -<br /> -<ul> -<li>I practice English writing (I am not a native speaker). I am far from being a novelist, but this blog helps improves my writing skills. I also tried out tools like Grammarly.com and Languagetool.org and also worked with <span class='inlinecode'>:spell</span> in Vim or the LibreOffice checker. This post was checked with the <span class='inlinecode'>write-better</span> Node application. </li> -<li>I force myself to "finish" some kind of project worth writing about every month. If its not a project, then its still a topic which requires research and deep thinking. Producing 2k words of text can actually be challenging.</li> -<li>It's fun to rely on KISS (keep it simple & stupid) tools. E.g. use of Gemtexter and not WordPress, use of Vim instead of an office suite or a rich web editor.</li> -</ul><br /> -<span>Retrospectively, these have been the most popular blog posts of mine over the last year:</span><br /> -<br /> -<a class='textlink' href='./2021-09-12-keep-it-simple-and-stupid.html'>Keep it simple and stupid</a><br /> -<a class='textlink' href='./2022-04-10-creative-universe.html'>Creative universe</a><br /> -<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>Bash Golf series</a><br /> -<a class='textlink' href='./2021-12-26-how-to-stay-sane-as-a-devops-person.html'>How to stay sane as a DevOps person</a><br /> -<a class='textlink' href='./2022-05-27-perl-is-still-a-great-choice.html'>Perl is still a great choice</a><br /> -<br /> -<span>But now, let's continue with the small projects worth mentioning :-)</span><br /> -<br /> -<h2 style='display: inline' id='Staticphotoalbumgenerator'>Static photo album generator</h2><br /> -<br /> -<span><span class='inlinecode'>photoalbum.sh</span> is a minimal static HTML photo album generator. I use it to drive "The Irregular Ninja" site and for some ad-hoc (personal) albums to share photos with the family and friends.</span><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/photoalbum'>https://codeberg.org/snonux/photoalbum</a><br /> -<br /> -<h3 style='display: inline' id='TheIrregularNinja'>The Irregular Ninja</h3><br /> -<br /> -<span>Photography is one of my casual hobbies. I love to capture interesting perspectives and motifs. I love to walk new streets and neighbourhoods I never walked before so I can capture those unexpected motifs, colours and moments. Unfortunately, because of time constraints (and sometime weather constraints), I do that on a pretty infrequent basis.</span><br /> -<br /> -<a href='./sweating-the-small-stuff/ninja.jpg'><img src='./sweating-the-small-stuff/ninja.jpg' /></a><br /> -<br /> -<span>More than 10 years ago I wrote the bespoke small static photo album generator in Bash <span class='inlinecode'>photoalbum.sh</span> which I recently refactored to a modern Bash coding style and also freshened up the Cascading Style Sheets. Last but not least, the new domain name <span class='inlinecode'>irregular.ninja</span> has been registered.</span><br /> -<br /> -<span>The thumbnails are presented in a random order and there are also random CSS effects for each preview. There's also a simple background blur for each page generated. And that's all in less than 300 lines of Bash code! The script requires ImageMagick (available for all common Linux and *BSD distributions) to be installed.</span><br /> -<br /> -<span>As you can see, there is a lot of randomization and irregularity going on. Thus, the name "Irregular Ninja" was born.</span><br /> -<br /> -<a class='textlink' href='https://irregular.ninja'>https://irregular.ninja</a><br /> -<br /> -<span>I only use a digital compact camera or a smartphone to take the photos. I don't like the idea of carrying around a big camera with me "just in case" so I keep it small and simple. The best camera is the camera you have with you. :-)</span><br /> -<br /> -<span>I hope you like this photo site. It's worth checking it out again around once every other month!</span><br /> -<br /> -<h2 style='display: inline' id='Randomjournalpageextractor'>Random journal page extractor</h2><br /> -<br /> -<span>I bullet journal. I write my notes into a Leuchtturm paper notebook. Once full, I am scanning it to a PDF file and archive it. As of writing this, I am at journal #7 (each from 123 up to 251 pages in A5). It means that there is a lot of material already.</span><br /> -<br /> -<span>Once in a while I want to revisit older notes and ideas. For that I have written a simple Bash script <span class='inlinecode'>randomjournalpage.sh</span> which randomly picks a PDF file from a folder and extracts 42 pages from it at a random page offset and opens them in a PDF viewer (Evince in this case, as I am a GNOME user). </span><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/randomjournalpage'>https://codeberg.org/snonux/randomjournalpage</a><br /> -<br /> -<span>There's also a weekly <span class='inlinecode'>CRON</span> job on my servers to send me a reminder that I might want to read in my old journals again. My laptop also runs this script each time it boots and saves the output to a NextCloud folder. From there, it's synchronized to the NextCloud server so I can pick it up from there with my smartphone later when I am "on the road".</span><br /> -<br /> -<h2 style='display: inline' id='Globaluptimerecordsstatisticgenerator'>Global uptime records statistic generator</h2><br /> -<br /> -<span><span class='inlinecode'>guprecords</span> is a Perl script which reads multiple <span class='inlinecode'>uprecord</span> files (produced by <span class='inlinecode'>uptimed</span> - a widely available daemon for recording server uptimes) and generates uptime statistics of multiple hosts combined. I keep all the record files of all my personal computers in a Git repository (I even keep the records of the boxes I don't own or use anymore) and there's already quite a collection of it. It looks like this:</span><br /> -<br /> -<pre> -❯ perl ~/git/guprecords/src/guprecords --indir=./stats/ --count=20 --all -Pos | System | Kernel | Uptime | Boot time - 1 | sun | FreeBSD 10.1-RELEA.. | 502d 03:29:19 | Sun Aug 16 15:56:40 2015 - 2 | vulcan | Linux 3.10.0-1160... | 313d 13:19:39 | Sun Jul 25 18:32:25 2021 - 3 | uugrn | FreeBSD 10.2-RELEASE | 303d 15:19:35 | Tue Dec 22 21:33:07 2015 - 4 | uugrn | FreeBSD 11.0-RELEA.. | 281d 14:38:04 | Fri Oct 21 15:22:02 2016 - 5 | deltavega | Linux 3.10.0-957.2.. | 279d 11:15:00 | Sun Jun 30 11:42:38 2019 - 6 | vulcan | Linux 3.10.0-957.2.. | 279d 11:12:14 | Sun Jun 30 11:43:41 2019 - 7 | deltavega | Linux 3.10.0-1160... | 253d 04:42:22 | Sat Apr 24 13:34:34 2021 - 8 | host0 | FreeBSD 6.2-RELEAS.. | 240d 02:23:23 | Wed Jan 31 20:34:46 2007 - 9 | uugrn | FreeBSD 11.1-RELEA.. | 202d 21:12:41 | Sun May 6 18:06:17 2018 - 10 | tauceti | Linux 3.2.0-4-amd64 | 197d 18:45:40 | Mon Dec 16 19:47:54 2013 - 11 | pluto | Linux 2.6.32-5-amd64 | 185d 11:53:04 | Wed Aug 1 07:34:10 2012 - 12 | sun | FreeBSD 10.3-RELEA.. | 164d 22:31:55 | Sat Jul 22 18:47:21 2017 - 13 | vulcan | Linux 3.10.0-1160... | 161d 07:08:43 | Sun Feb 14 10:05:38 2021 - 14 | sun | FreeBSD 10.3-RELEA.. | 158d 21:18:36 | Sat Jan 27 10:18:57 2018 - 15 | uugrn | FreeBSD 11.1-RELEA.. | 157d 20:57:24 | Fri Nov 3 05:02:54 2017 - 16 | tauceti-f | Linux 3.2.0-3-amd64 | 150d 04:12:38 | Mon Sep 16 09:02:58 2013 - 17 | tauceti | Linux 3.2.0-4-amd64 | 149d 09:21:43 | Mon Aug 11 09:47:50 2014 - 18 | pluto | Linux 3.2.0-4-amd64 | 142d 02:57:31 | Mon Sep 8 01:59:02 2014 - 19 | tauceti-f | Linux 3.2.0-3-amd64 | 132d 22:46:26 | Mon May 6 11:11:35 2013 - 20 | keppler-16b | Darwin 13.4.0 | 131d 08:17:12 | Thu Jun 11 10:44:25 2015 -</pre> -<br /> -<span>It can also sum up all uptimes for each host to generate a total per host uptime top list:</span><br /> -<br /> -<pre> -❯ perl ~/git/guprecords/src/guprecords --indir=./stats/ --count=20 --total -Pos | System | Kernel | Uptime | - 1 | uranus | Linux 5.4.17-200.f.. | 1419d 19:05:39 | - 2 | sun | FreeBSD 10.1-RELEA.. | 1363d 11:41:14 | - 3 | vulcan | Linux 3.10.0-1160... | 1262d 20:27:48 | - 4 | uugrn | FreeBSD 10.2-RELEASE | 1219d 15:10:16 | - 5 | deltavega | Linux 3.10.0-957.2.. | 1115d 06:33:55 | - 6 | pluto | Linux 2.6.32-5-amd64 | 1086d 10:44:05 | - 7 | tauceti | Linux 3.2.0-4-amd64 | 846d 12:58:21 | - 8 | tauceti-f | Linux 3.2.0-3-amd64 | 625d 07:16:39 | - 9 | host0 | FreeBSD 6.2-RELEAS.. | 534d 19:50:13 | - 10 | keppler-16b | Darwin 13.4.0 | 448d 06:15:00 | - 11 | tauceti-e | Linux 3.2.0-4-amd64 | 415d 18:14:13 | - 12 | moon | Darwin 18.7.0 | 326d 11:21:42 | - 13 | callisto | Linux 4.0.4-303.fc.. | 303d 12:18:24 | - 14 | alphacentauri | FreeBSD 10.1-RELEA.. | 300d 20:15:00 | - 15 | earth | Linux 5.13.14-200... | 289d 08:05:05 | - 16 | makemake | Linux 5.11.9-200.f.. | 286d 21:53:03 | - 17 | london | Linux 3.2.0-4-amd64 | 258d 15:10:38 | - 18 | fishbone | OpenBSD 4.1 .. | 223d 05:55:26 | - 19 | sagittarius | Darwin 15.6.0 | 198d 23:53:59 | - 20 | mars | Linux 3.2.0-4-amd64 | 190d 05:44:21 | -</pre> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/guprecords'>https://codeberg.org/snonux/guprecords</a><br /> -<br /> -<span>This all is of no real practical use but fun!</span><br /> -<br /> -<h2 style='display: inline' id='Serverconfigurationmanagement'>Server configuration management</h2><br /> -<br /> -<span>The <span class='inlinecode'>rexfiles</span> project contains all Rex files for my (personal) server setup automation. A <span class='inlinecode'>Rexfile</span> is written in a Perl DSL run by the Rex configuration management system. It's pretty much KISS and that's why I love it. It suits my personal needs perfectly. </span><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/rexfiles'>https://codeberg.org/snonux/rexfiles</a><br /> -<a class='textlink' href='https://www.rexify.org'>https://www.rexify.org</a><br /> -<br /> -<span>This is an E-Mail I posted to the Rex mailing list:</span><br /> -<br /> -<span class='quote'>Hi there! I was searching for a simple way to automate my personal OpenBSD setup. I found that configuration management systems like Puppet, Salt, Chef, etc.. were too bloated for my personal needs. So for a while I was configuring everything by hand. At one point I got fed up and started writing Shell scripts. But that was not the holy grail so that I looked at Ansible. I found that Ansible had some dependencies on Python on the target machine when you want to use all the features. Furthermore, I am not really familiar with Python. But then I remembered that there was also Rex. It's written in my beloved Perl. Also, OpenBSD comes with Perl in the base system out of the box which makes it integrate better than all my scripts (automation and also scripts deployed via the automation to the system) are all in the same language. Rex may not have all the features like other configuration management systems, but its easy to work-around or extend when you know Perl. Thanks!</span><br /> -<br /> -<h2 style='display: inline' id='FancySSHexecutionloop'>Fancy SSH execution loop</h2><br /> -<br /> -<span><span class='inlinecode'>rubyfy</span> is a fancy SSH loop wrapper written in Ruby for running shell commands on multiple remote servers at once. I also forked this project for work (under a different name) where I added even more features such as automatic server discovery. It's used by many colleagues on a frequent basis. Here are some examples:</span><br /> -<br /> -<pre> -# Run command 'hostname' on server foo.example.com -./rubyfy.rb -c 'hostname' <<< foo.example.com - -# Run command 'id' as root (via sudo) on all servers listed in the list file -# Do it on 10 servers in parallel -./rubyfy.rb --parallel 10 --root --command 'id' < serverlist.txt - -# Run a fancy script in background on 50 servers in parallel -./rubyfy.rb -p 50 -r -b -c '/usr/local/scripts/fancy.zsh' < serverlist.txt - -# Grep for specific process on both servers and write output to ./out/grep.txt -echo {foo,bar}.example.com | ./rubyfy.rb -p 10 -c 'pgrep -lf httpd' -n grep.txt - -# Reboot server only if file /var/run/maintenance.lock does NOT exist! -echo foo.example.com | -./rubyfy.rb --root --command reboot --precondition /var/run/maintenance.lock -</pre> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/rubyfy'>https://codeberg.org/snonux/rubyfy</a><br /> -<br /> -<h2 style='display: inline' id='AKISSdynamicDNSsolution'>A KISS dynamic DNS solution</h2><br /> -<br /> -<span><span class='inlinecode'>dyndns</span> is a tiny shell script which implements "your" own DynDNS service. It relies on SSH access to the authoritative DNS server and the <span class='inlinecode'>nsupdate</span> command. There is really no need to use any of the "other" free DynDNS services out there.</span><br /> -<br /> -<span>Syntax (this must run from the client connecting to the DNS server through SSH): </span><br /> -<br /> -<pre> -ssh dyndns@dyndnsserver /path/to/dyndns-update \ - your.host.name. TYPE new-entry TIMEOUT -</pre> -<br /> -<span>This is a real world example: </span><br /> -<br /> -<pre> -ssh dyndns@dyndnsserver /path/to/dyndns-update \ - local.buetow.org. A 137.226.50.91 30 -</pre> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/dyndns'>https://codeberg.org/snonux/dyndns</a><br /> -<br /> -<h2 style='display: inline' id='CPUinformationgathererforLinux'>CPU information gatherer for Linux</h2><br /> -<br /> -<span>This is a tiny GNU Awk script for Linux which displays information about the CPU. All what it does is presenting <span class='inlinecode'>/proc/cpuinfo</span> in an easier to read way. The output is somewhat more compact than the standard <span class='inlinecode'>lscpu</span> command you find commonly on Linux distributions.</span><br /> -<br /> -<pre> -❯ ./cpuinfo -cpuinfo (c) 1.0.2 Paul Buetow - - 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz GenuineIntel 12288 KB cache - -p = 001 Physical processors -c = 004 Cores -s = 008 Siblings (Hyper-Threading enabled if s != c) -v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs - Hyper-Threading is enabled - -0003000 MHz each core -0012000 MHz total -0005990 Bogomips each processor (including virtual) -0023961 Bogomips total -</pre> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/cpuinfo'>https://codeberg.org/snonux/cpuinfo</a><br /> -<br /> -<h2 style='display: inline' id='Showdifferencesoftwofilesoverthenetwork'>Show differences of two files over the network</h2><br /> -<br /> -<span>This is a shell wrapper to use the standard diff tool over the network to compare a file between two computers. It uses NetCat for the network part and also encrypts all traffic using OpenSSL. This is how its used:</span><br /> -<br /> -<span>1. Open two terminal windows and login to two different hosts (you could use ClusterSSH or <span class='inlinecode'>tmux</span> here). 2. Run on the first host <span class='inlinecode'>netdiff otherhost.example.org /file/to/diff.txt</span> and run on the second host <span class='inlinecode'>netdiff firsthost.example.org /file/to/diff.txt</span>. 3. You then will see the file differences.</span><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/netdiff'>https://codeberg.org/snonux/netdiff</a><br /> -<br /> -<h2 style='display: inline' id='DelaysendingoutEMailswithMutt'>Delay sending out E-Mails with Mutt</h2><br /> -<br /> -<span>This is a shell script for the Mutt email client for delaying sending out E-Mails. For example, you want to write an email on Saturday but don't want to bother the recipient earlier than Monday. It relies on CRON.</span><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/muttdelay'>https://codeberg.org/snonux/muttdelay</a><br /> -<br /> -<h2 style='display: inline' id='GraphicalUIforsendingtextmessages'>Graphical UI for sending text messages</h2><br /> -<br /> -<span><span class='inlinecode'>jsmstrade</span> is a minimalistic graphical Java swing client for sending SMS messages over the SMStrade service.</span><br /> -<br /> -<a href='./sweating-the-small-stuff/jsmstrade.png'><img src='./sweating-the-small-stuff/jsmstrade.png' /></a><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/jsmstrade'>https://codeberg.org/snonux/jsmstrade</a><br /> -<a class='textlink' href='https://smstrade.de'>https://smstrade.de</a><br /> -<br /> -<h2 style='display: inline' id='IPv6andIPv4connectivitytestingsite'>IPv6 and IPv4 connectivity testing site</h2><br /> -<br /> -<span><span class='inlinecode'>ipv6test</span> is a quick and dirty Perl CGI script for testing whether your browser connects via IPv4 or IPv6. It requires you to setup three sub-domains: One reachable only via IPv4 (e.g. <span class='inlinecode'>test4.ipv6.buetow.org</span>), another reachable only via IPv6 (e.g. <span class='inlinecode'>test6.ipv6.buetow.org</span>) and the main one reachable through both protocols (e.g. <span class='inlinecode'>ipv6.buetow.org</span>).</span><br /> -<br /> -<span>I don't have it running on any of my servers at the moment. This means that there is no demo to show now. Sorry!</span><br /> -<br /> -<h2 style='display: inline' id='ListopenJiraticketsintheterminal'>List open Jira tickets in the terminal</h2><br /> -<br /> -<span><span class='inlinecode'>japi</span> s a small Perl script for listing open Jira issues. It might be broken by now as the Jira APIs may have changed. Sorry! But feel free to fork and modernize it. :-)</span><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/jsmstrade'>https://codeberg.org/snonux/jsmstrade</a><br /> -<span> </span><br /> -<h2 style='display: inline' id='DebianrunningonyourAndroidphone'>Debian running on "your" Android phone</h2><br /> -<br /> -<span>Debroid is a tutorial and a set of scripts to install and to run a Debian <span class='inlinecode'>chroot</span> on an Android phone.</span><br /> -<br /> -<a class='textlink' href='./2015-12-05-run-debian-on-your-phone-with-debroid.html'>Check out my previous post about it</a><br /> -<br /> -<span>I am not using Debroid anymore as I have switched to Termux now.</span><br /> -<br /> -<a class='textlink' href='https://termux.com'>https://termux.com</a><br /> -<br /> -<h2 style='display: inline' id='Perlserviceframework'>Perl service framework</h2><br /> -<br /> -<span>PerlDaemon is a minimal daemon for Linux and other Unix like operating systems programmed in Perl. It is a minimal but pretty functional and fairly generic service framework. This means that it does not do anything useful other than providing a framework for starting, stopping, configuring and logging. To do something useful, a module (written in Perl) must be provided.</span><br /> -<br /> -<a class='textlink' href='./2011-05-07-perl-daemon-service-framework.html'>Checkout my previous post about it</a><br /> -<br /> -<h2 style='display: inline' id='More'>More</h2><br /> -<br /> -<span>There are more projects on my Codeberg page but they aren't as tiny as the ones mentioned in this post or aren't finished yet so I won't bother listing them here. However, there also a few more scripts used frequently by me (not publicly accessible (yet?)) which I would like to mention here:</span><br /> -<br /> -<h3 style='display: inline' id='Worktimetracker'>Work time tracker</h3><br /> -<br /> -<span><span class='inlinecode'>worktime.rb</span>, for example, is a command line Ruby script I use to track my time spent working. This is to make sure that I don't overwork (in particular useful when working from home). It also generates some daily and weekly stats and carries over work time (surpluses or minuses) to the next work day, week or even year.</span><br /> -<br /> -<span>It has some special features such as tracking time for self-improvement/development, days off and time spent at the lunch break and time spent on Pet Projects.</span><br /> -<br /> -<span>An example weekly report looks like this (I often don't track my lunch time but what I do instead I stop the work timer when I go out for lunch and start the work timer once back at the desk):</span><br /> -<br /> -<pre> - Mon 20211213 50: work:5.92h - Tue 20211214 50: work:7.47h lunch:0.50h pet:0.42h - Wed 20211215 50: work:8.86h pet:0.50h - Thu 20211216 50: work:8.02h pet:0.50h - Fri 20211217 50: work:9.81h - * Sat 20211218 50: work:0.00h selfdevelopment:1.00h - * Sun 20211219 50: work:2.08h pet:1.00h selfdevelopment:-2.08h -================================================ - balance:0.06h work:42.15h lunch:0.50h pet:2.42h selfdevelopment:-1.08h buffer:8.38h -</pre> -<br /> -<span>All I do when I start work is to run the <span class='inlinecode'>wtlogin</span> command and after finishing work to run the <span class='inlinecode'>wtlogout</span> command. My shell will remind me when I work without having logged in. It uses a simple JSON database which is editable with <span class='inlinecode'>wtedit</span> (this opens the JSON in Vim). The report shown above can be generated with <span class='inlinecode'>wtreport</span>. Any out-of-bounds reporting can be added with the <span class='inlinecode'>wtadd</span> command.</span><br /> -<br /> -<h3 style='display: inline' id='Passwordanddocumentstore'>Password and document store</h3><br /> -<br /> -<span><span class='inlinecode'>geheim.rb</span> is my personal password and document store ("geheim" is the German word for secret). It's written in Ruby and heavily relies on Git, FZF (for search), Vim and standard encryption algorithms. Other than the standard <span class='inlinecode'>pass</span> Unix password manager, <span class='inlinecode'>geheim</span> also encrypts the file names and password titles.</span><br /> -<br /> -<span>The tool is command line driven but also provides an interactive shell when invoked with <span class='inlinecode'>geheim shell</span>. It also works on my Android phone via Termux so I have all my documents and passwords always with me. </span><br /> -<br /> -<h3 style='display: inline' id='Backupprocedure'>Backup procedure</h3><br /> -<br /> -<span><span class='inlinecode'>backup</span> is a Bash script which does run once daily (or every time on boot) on my home FreeBSD NAS server and performs backup related tasks such as creating a local backup of my remote NextCloud instance, creating encrypted (incremental) ZFS snapshots of everything what's stored on the NAS and synchronizes (via <span class='inlinecode'>rsync</span>) backups to a remote cloud storage. It also can synchronize backups to a local external USB drive.</span><br /> -<br /> -<a class='textlink' href='./2016-04-03-offsite-backup-with-zfs.html'>Check out my offsite backup series</a><br /> -<br /> -<h2 style='display: inline' id='konpeitomedia'>konpeito.media</h2><br /> -<br /> -<span>Here's a bonus...</span><br /> -<br /> -<pre> - ▄ █ ▄ ▄ █ ▄ ▄ █ ▄ - ▄▀█▀▄ ▄▀█▀▄ ▄▀█▀▄ - ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▀ ▀ ▀ - █ ▄▄ ▄▄ █ - █ █ █▀▀▀█ █ █ █ ▄▀ ▄▀▀▀▀▄ █▄ █ █▀▀▀▀▀▄ ▄▀▀▀▀▄ █ ▀▀▀█▀▀▀ ▄▀▀▀▀▄ - █ ▀▀▀▀▀▀▀▀▀ █ █ ▄█ █ █ █ ▀▄ █ █▄▄▄▄▄▀ █▄▄▄▄▄▄█ █ █ █ █ - █ ▄▀▀▀▀▀▀▀▀▀▀▀▄ █ █▀ ▀▄ ▀▄ ▄▀ █ ▀▄█ █ ▀▄ ▄ █ █ ▀▄ ▄▀ - ▀▄█▄█▄▄▄▄▄▄▄█▄█▄▀ ▀ ▀ ▀▀▀▀ ▀ ▀ ▀ ▀▀▀▀ ▀ ▀ ▀▀▀ -</pre> -<br /> -<span>*THIS ISN'T MY PROJECT* but I found KONPEITO an interesting Gemini capsule. It's a quarterly released Low-Fi music mix tape distributed only through Gemini (and not the web). </span><br /> -<br /> -<a class='textlink' href='gemini://konpeito.media'>gemini://konpeito.media</a><br /> -<br /> -<span>If you wonder what Gemini is:</span><br /> -<br /> -<a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>Welcome to the Geminispae</a><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>Perl is still a great choice</title> - <link href="gemini://foo.zone/gemfeed/2022-05-27-perl-is-still-a-great-choice.gmi" /> - <id>gemini://foo.zone/gemfeed/2022-05-27-perl-is-still-a-great-choice.gmi</id> - <updated>2022-05-27T07:50:12+01:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>Perl (the Practical Extraction and Report Language) is a battle-tested, mature, multi-paradigm dynamic programming language. Note that it's not called PERL, neither P.E.R.L. nor Pearl. 'Perl' is the name of the language and `perl` the name of the interpreter or the interpreter command.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Perlisstillagreatchoice'>Perl is still a great choice</h1><br /> -<br /> -<span class='quote'>Published at 2022-05-27T07:50:12+01:00; Updated at 2023-01-28</span><br /> -<br /> -<a href='./perl-is-still-a-great-choice/regular_expressions.png'><img alt='Comic source: XKCD' title='Comic source: XKCD' src='./perl-is-still-a-great-choice/regular_expressions.png' /></a><br /> -<br /> -<span>Perl (the Practical Extraction and Report Language) is a battle-tested, mature, multi-paradigm dynamic programming language. Note that it's not called PERL, neither P.E.R.L. nor Pearl. "Perl" is the name of the language and <span class='inlinecode'>perl</span> the name of the interpreter or the interpreter command.</span><br /> -<br /> -<span>Unfortunately (it makes me sad), Perl's popularity has been declining over the last years as Google trends shows:</span><br /> -<br /> -<a href='./perl-is-still-a-great-choice/googletrendsperl.jpg'><img src='./perl-is-still-a-great-choice/googletrendsperl.jpg' /></a><br /> -<br /> -<span>So why is that? Once the de-facto standard super-glue language for the web nowadays seems to have a bad reputation. Often, people state:</span><br /> -<br /> -<ul> -<li>Perl is a write-only language. Nobody can read Perl code.</li> -<li>Perl? Isn't it abandoned? It's still at version 5!</li> -<li>Why use Perl as there are better alternatives?</li> -<li>Why all the sigils? It looks like an exploding ASCII factory!!</li> -</ul><br /> -<h2 style='display: inline' id='Writeonlylanguage'>Write-only language</h2><br /> -<br /> -<span>Is Perl really a write-only language? You have to understand that Perl 5 was released in 1994 (28 years ago as of this writing) and when we refer to Perl we usually mean Perl 5. That's many years, and there are many old scripts not following the modern Perl best practices (as they didn't exist yet). So yes, legacy scripts may be difficult to read. Japanese may be difficult to read too if you don't know Japanese, though.</span><br /> -<br /> -<span>To come back to the question: Is Perl a write-only language? I don't think so. Like in any other language, you have to apply best practices in order to keep your code maintainable. Some other programming languages enforce best practices, but that makes these languages less expressive. Perl follows the principles "there is more than one way to do it" (aka TIMTOWDI) and "making easy things easy and hard things possible".</span><br /> -<br /> -<span>Perl gives the programmer more flexibility in how to do things, and this results in a stronger learning curve than for lesser expressive languages like for example Go or Python. But, like in everything in life, common sense has to be applied. You should not take TIMTOWDI to the extreme in a production piece of code. In my personal opinion, it is also more satisfying to program in an expressive language.</span><br /> -<br /> -<span>Some good books on "good" Perl I can recommend are:</span><br /> -<br /> -<a class='textlink' href='http://modernperlbooks.com'>Modern Perl</a><br /> -<a class='textlink' href='https://hop.perl.plover.com'>Higher Order Perl</a><br /> -<br /> -<span>Due to Perl's expressiveness you will find a lot of obscure code in the interweb in form of obfuscation, fancy email signatures (JAPHs), art, polyglots and even poetry in Perl syntax. But that's not what you will find in production code. That's only people having fun with the language which is different to "getting things done". The expressiveness is a bonus. It makes the Perl programmers love Perl.</span><br /> -<br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Just_another_Perl_hacker'>JAPH</a><br /> -<a class='textlink' href='http://www.cpan.org/misc/japh'>http://www.cpan.org/misc/japh</a><br /> -<a class='textlink' href='https://www.perlmonks.org/index.pl?next=20;node_id=1590'>Perl Poetry</a><br /> -<br /> -<span>Even I personally have written some poetry in Perl and experimented with a polyglot script:</span><br /> -<br /> -<a class='textlink' href='./2008-06-26-perl-poetry.html'>My very own Perl Poetry</a><br /> -<a class='textlink' href='./2014-03-24-the-fibonacci.pl.c-polyglot.html'>A Perl-Raku-C polyglot generating the Fibonacci sequence</a><br /> -<br /> -<span>This all doesn't mean that you can't "get things done" with Perl. Quite the opposite is the case. Perl is a very pragmatic programming language and is suitable very well for rapid prototyping and any kind of small to medium-sized scripts and programs. You can write large enterprise scale application in Perl too, but that wasn't the original intend of why Perl was invented (more on that later).</span><br /> -<br /> -<h2 style='display: inline' id='IsPerlabandoned'>Is Perl abandoned?</h2><br /> -<br /> -<span>As I pointed out in the previous section, Perl 5 is around for quite some time without any new major version released. This can lead to the impression that development is not progressing and that the project is abandoned. Nothing can be further from the truth. Perl 5.000 was released in 1994 and the latest version (as of this writing) Perl 5.34.1 was released two months ago in 2022. You can check the version history on Wikipedia. You will notice releases being made regularly:</span><br /> -<br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Perl_5_version_history'>Perl 5 version history</a><br /> -<br /> -<span>As you can see, Perl 5 is under active development. I can also recommend to have a look at the following book, it summarizes all new Perl features which showed up after Perl v5.10:</span><br /> -<br /> -<a class='textlink' href='https://perlschool.com/books/perl-new-features/'>Perl New Features by Joshua McAdams and brian d foy</a><br /> -<br /> -<span>Actually, Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it also referred to its redesigned "sister language", Perl 6, before the latter's name was officially changed to Raku in October 2019 as the differences between Perl 5 and Perl 6 were too groundbreaking. Raku would be a different topic (mostly out of scope of this blog article) but I at least wanted it to mention here. In my opinion, Raku is the "most powerful" programming language out there (I recently started learning it and intend to use it for some of my future personal programming projects):</span><br /> -<br /> -<a class='textlink' href='https://raku.org'>The Raku Programming Language</a><br /> -<br /> -<span>So it means that Perl and Raku now exist in parallel. They influence each other, but are different programming languages now. So why not just all use Raku instead of Perl? There are still a couple of reasons of why to choose Perl over Raku:</span><br /> -<br /> -<ul> -<li>Many programmers already know Perl and many scripts are already written in Perl. It's possible to call Perl code from Raku (either inline or as a library) and it is also possible to auto-convert Perl code into Raku code, but that's either a workaround or involves some kind of additional work.</li> -<li>Perl 5 comes with a great backwards compatibility. Perl scripts from 5.000 will generally still work on a recent version of Perl. New features usually have to be enabled via a so-called "use pragmas". For example, in order to enable sub signatures, <span class='inlinecode'>use signatures;</span> has to be specified.</li> -<li>Perl is pre-installed almost everywhere. Fancy running a quick one-off script? In almost all cases, there's no need to install Perl first - it's already there on almost any Linux or *BSD or Unix or other Unix like operating system!</li> -<li>Perl has been ported to "zillions" of platforms. One day I found myself on a VMS box. Perl doesn't come installed by default on VMS, but the admin installed Perl there already. The whole operating system was very strange to me, but I was able to write "shell scripts" in Perl and became productive pretty quickly on VMS without knowing almost anything about VMS :-).</li> -<li>Perl is reliable. It has been proven itself "millions" of times, over and over again. Large enterprises, such as booking.com, heavily rely on Perl. Did you know that the package manager of the OpenBSD operating system is programmed in Perl, too?</li> -<li>Perl is a great language to program in (given that you follow the modern best practices). Don't get confused when Perl is doing some things differently than other programming languages.</li> -</ul><br /> -<a class='textlink' href='https://perldoc.perl.org/feature'>Perl feature pragmas</a><br /> -<a class='textlink' href='https://www.OpenBSD.org'>The OpenBSD Operating System</a><br /> -<a class='textlink' href='https://news.ycombinator.com/item?id=23360338'>Why does OpenBSD still include Perl in its base installation?</a><br /> -<br /> -<span>The renaming of Perl 6 to Raku has now opened the door for a future Perl 7. As far as I understand, Perl 7 will be Perl 5 but with modern features enabled by default (e.g. pragmas <span class='inlinecode'>use strict;</span>, <span class='inlinecode'>use warnings;</span>, <span class='inlinecode'>use signatures;</span> and so on. Also, the hope is that a Perl 7 with modern standards will attract more beginners. There aren't many Perl jobs out there nowadays. That's mostly due to Perl's bad (bad for no real reasons) reputation.</span><br /> -<br /> -<span class='quote'>Update 2022-12-10: A reader pointed out, that <span class='inlinecode'>use v5.36;</span> already turns strict, warnings and signatures pragmas automatically on! </span><br /> -<br /> -<a class='textlink' href='https://www.perl.com/article/announcing-perl-7/'>Announcing Perl 7</a><br /> -<a class='textlink' href='http://blogs.perl.org/users/psc/2022/05/what-happened-to-perl-7.html'>What happened to Perl 7? (maybe have to use <span class='inlinecode'>use v7;</span>)</a><br /> -<br /> -<span class='quote'>Update 2022-12-10: A reader pointed out, that Perl 7 needs to provide a big improvement to earn and keep the attention for a major version bump.</span><br /> -<br /> -<span class='quote'>Update 2023-01-28: Meanwhile, I was also reading brian d foy's Perl New Feature book. It nicely presents all new features added to Perl since <span class='inlinecode'>v5.10</span>.</span><br /> -<br /> -<a class='textlink' href='https://www.leanpub.com/perl_new_features'>Perl New Features</a><br /> -<br /> -<h2 style='display: inline' id='WhyusePerlastherearebetteralternatives'>Why use Perl as there are better alternatives?</h2><br /> -<br /> -<span>Here, common sense must be applied. I don't believe there is anything like "the perfect" programming language. Everyone has got his preferred (or a set of preferred) programming language to chose from. All programming languages come with their own set of strengths and weaknesses. These are the strengths making Perl shine, and you (technically) don't need to bother to look for "better" alternatives:</span><br /> -<br /> -<ul> -<li>Perl is better than Shell/AWK/SED scripts. There's a point where shell scripts become fairly complex. The next step-up is to switch to Perl. There are many different versions of shells and AWK and SED interpreters. Do you always know which versions (<span class='inlinecode'>mawk</span>, <span class='inlinecode'>nawk</span>, <span class='inlinecode'>gawk</span>, <span class='inlinecode'>sed</span>, <span class='inlinecode'>gsed</span>, <span class='inlinecode'>grep</span>, <span class='inlinecode'>ggrep</span>...) are currently installed? These commands aren't fully compatible to each other. However, there is only one Perl 5. Simply: Perl is faster, more powerful, more expressive than any shell script can ever be, and it is also extendible through CPAN. Perl can directly talk to databases, which shell scripts can't.</li> -<li>Perl code tends to be compact so that it's much better suitable for "shell scripting" and quick "one-liners" than other languages. In my own experience: Ruby and Python code tends to blow up quickly. It doesn't mean that Ruby and Python are not suitable for this task, but I think Perl does much better.</li> -<li>Perl 5 has proven itself for decades and is a very stable/robust language. It is a battle-tested and mature as something can ever become.</li> -<li>Perl is the reference standard for regular expressions. Even so much that there is a PCRE library (Perl Compatible Regular Expressions) used by many other languages now. Perl fully integrates regular expression syntax into the language, which doesn't feel like an odd add-on like in most other languages.</li> -<li>Perl 5 is the master of text processing (well, maybe after Raku now. But you might not have the latest Raku available everywhere). The chief objective of developing the language was for text processing, and this is where Perl (Practical extraction and report language) really shines.</li> -<li>Perl is a "deep" language. That means Perl got a lot of features and syntactic sugar and magic. Depending on the perspective, this could be interpreted as a downside too. But IMHO mastery of a "deep" language brings big rewards. The code can be very compact, and it is fun to code in it.</li> -<li>Perl is the only language I know which can do "taint checking". Running a script in taint mode makes Perl sanitize all external input and that's a great security feature. Ruby used to have this feature too, but it got removed (as I understand there were some problems with the implementation not completely safe and it was easier just to remove it from the language than to fix it).</li> -</ul><br /> -<span>About the first point, using Perl for better "shell" scripts was actually the original intend of why Perl was invented in the first place.</span><br /> -<br /> -<a class='textlink' href='https://nostarch.com/perloneliners'>Perl one-liners</a><br /> -<a class='textlink' href='http://regex.info/book.html'>Mastering Regular Expressions</a><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Taint_checking'>Taint checking</a><br /> -<br /> -<span>Here are some reasons why not to chose Perl and look for "better" alternatives:</span><br /> -<br /> -<ul> -<li>If performance is your main objectives, then Perl might not be the language to use. Perl is a dynamic interpreted language, and it will generally never be as fast as statically typed languages compiled to native binaries (e.g. C/C++/Rust/Haskell) or statically typed languages run in a VM with JIT (e.g. Java) or languages like Golang (statically typed, compiled to a binary but still with a runtime in the binary). Perl might be still faster than the other language listed here in certain circumstances (e.g. faster startup time than Java or faster regular expressions engine), but usually it's not. It's not a problem of Perl, it's a problem of all dynamic scripting languages including Python, Ruby, ....</li> -<li>Don't use Perl (just yet) if you want to code object-oriented. Perl supports OOP, but it feels clunky and odd to use (blessed references to any data types are objects) and doesn't support real encapsulation out of the box. There are many (many) extensions available on CPAN to make OOP better, but that's totally fragmented. The most popular extension, Moose, comes with a huge dependency tree. But wait for Perl 7. It will maybe come with a new object system (an object system inspired by Raku).</li> -<li>It's possible to write large programs in Perl (make difficult things possible), but it might not be the best choice here. This also leads back to the clunky object system Perl has. You could write your projects in a procedural or functional style (Perl perfectly fits here), but OOP seems to be the gold standard for large projects nowadays. Functional programming requires a different mindset, and pure procedural programming lacks abstractions.</li> -<li>Apply common sense. What is the skill set your team has? What's already widely used and supported at work? Which languages comes with the best modules for the things you want to work on? Maybe Python is the answer (better machine learning modules). Maybe Perl is the better choice (better Bioinformatic modules). Perhaps Ruby is already the de-facto standard at work and everyone knows at least a little Ruby (as it happened to be at my workplace) and Ruby is "good enough" for all the tasks already. But that's not a hindrance to throw in a Perl one-liner once in a while :P.</li> -</ul><br /> -<a class='textlink' href='https://github.com/Ovid/Cor'>Cor - Bringing modern OOP to the Perl Core</a><br /> -<br /> -<h2 style='display: inline' id='WhyallthesigilsItlookslikeanexplodingASCIIfactory'>Why all the sigils? It looks like an exploding ASCII factory!!</h2><br /> -<br /> -<span>The sigils <span class='inlinecode'>$ @ % &</span> (where Perl is famously known for) serve a purpose. They seem confusing at first, but they actually make the code better readable. <span class='inlinecode'>$scalar</span> is a scalar variable (holding a single value), <span class='inlinecode'>@array</span> is an array (holding a list of values), <span class='inlinecode'>%hash</span> holds a list of key-value pairs and <span class='inlinecode'>&sub</span> is for subroutines. A given variable <span class='inlinecode'>$ref</span> can also hold reference to something. <span class='inlinecode'>@$arrayref</span> dereferences a reference to an array, <span class='inlinecode'>%$hashref</span> to a hash, <span class='inlinecode'>$$scalarref</span> to a scalar, <span class='inlinecode'>&$subref</span> dereferences a referene to a subroutine, etc. That can be encapsulated as deep as you want. (This paragraph only scratched the surface here of what Perl can do, and there is a lot of syntactic sugar not mentioned here).</span><br /> -<br /> -<span>In most other programming languages, you won't know instantly what's the "basic type" of a given variable without looking at the variable declaration or the variable name (If named intelligently, e.g. a variable name containing a list of cats is <span class='inlinecode'>cat_list</span>). Even Ruby makes some use of sigils (<span class='inlinecode'>@</span>, <span class='inlinecode'>@@</span> and <span class='inlinecode'>$</span>), but that's for a different purpose than in Perl (in Ruby it is about object scope, class scope and global scope). Raku uses all the sigils Perl uses plus an additional bunch of twigils, e.g. <span class='inlinecode'>$.foo</span> for a scalar object variable with public accessors, <span class='inlinecode'>$!foo</span> for a private scalar object variable, <span class='inlinecode'>@.foo</span>, <span class='inlinecode'>@!foo</span>, <span class='inlinecode'>%.foo</span>, <span class='inlinecode'>%!foo</span> and so on. Sigils (and twigils) are very convenient once you get used to them. Don't let them scare you off - they are there to help you!</span><br /> -<br /> -<a class='textlink' href='https://www.perl.com/article/on-sigils/'>https://www.perl.com/article/on-sigils/</a><br /> -<br /> -<h2 style='display: inline' id='WheredoIpersonallystilluseperl'>Where do I personally still use perl?</h2><br /> -<br /> -<ul> -<li>I use Rexify for my OpenBSD server automation. Rexify is a configuration management system developed in Perl with similar features to Ansible but less bloated. It suits my personal needs perfectly.</li> -<li>I have written a couple of smaller to medium-sized Perl scripts which I (mostly) still use regularly. You can find them on my Codeberg page.</li> -<li>My day-to-day workflow heavily relies on "ack-grep". Ack is a tool developed in Perl aimed at programmers and can be used for quick searches on source code at the command line.</li> -<li>I aim to leave my OpenBSD servers as "vanilla" as possible (trying to rely only on the standard/base installation without installing additional software from the packaging system or ports tree). All my scripts are written either Bourne shell or in Perl here. So there is no need to install additional interpreters.</li> -<li>Here and there, I drop a Perl one-liner in order to get stuff done (work and personally). A wise Perl Monk would say: "One one-liner a day keeps the troubles away".</li> -</ul><br /> -<span>Btw.: Did you know that the first version of PHP was a set of Perl snippets? Only later, PHP became an independent programming language.</span><br /> -<br /> -<a class='textlink' href='https://www.perl.org'>https://www.perl.org</a><br /> -<br /> -<span class='quote'>Update 2022-12-17: The following is another related post. I don't agree to the statement made there, that Python code tends to be shorter than Perl code, though!</span><br /> -<br /> -<a class='textlink' href='https://stackoverflow.blog/2022/07/06/why-perl-is-still-relevant-in-2022/'>Why Perl is still relevant in 2022</a><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<span>Other related posts are:</span><br /> -<br /> -<a class='textlink' href='./2008-06-26-perl-poetry.html'>2008-06-26 Perl Poetry</a><br /> -<a class='textlink' href='./2011-05-07-perl-daemon-service-framework.html'>2011-05-07 Perl Daemon (Service Framework)</a><br /> -<a class='textlink' href='./2022-05-27-perl-is-still-a-great-choice.html'>2022-05-27 Perl is still a great choice (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-05-01-unveiling-guprecords:-uptime-records-with-raku.html'>2023-05-01 Unveiling <span class='inlinecode'>guprecords.raku</span>: Global Uptime Records with Raku</a><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>Creative universe</title> - <link href="gemini://foo.zone/gemfeed/2022-04-10-creative-universe.gmi" /> - <id>gemini://foo.zone/gemfeed/2022-04-10-creative-universe.gmi</id> - <updated>2022-04-10T10:09:11+01:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>I have been participating in an annual work-internal project contest (we call it Pet Project contest) since I moved to London and switched jobs to my current employer. I am very happy to say that I won a 'silver' prize last week here 🎆. Over the last couple of years I have been a finalist in this contest six times and won some kind of prize five times. Some of my projects were also released as open source software. One had a magazine article published, and for another one I wrote an article on my employer's engineering blog. If you have followed all my posts on this blog (the one you are currently reading), then you have probably figured out what these projects were:</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Creativeuniverse'>Creative universe</h1><br /> -<br /> -<span class='quote'>Published at 2022-04-10T10:09:11+01:00; Updated at 2022-04-18</span><br /> -<br /> -<pre> - . + . . . . . . - . . . * - . * . . . . . . + . - "You Are Here" . . + . . . -. | . . . . . . - | . . . +. + . - \|/ . . . . - . . V . * . . . . + . - + . . . + - . . + .+. . - . . . + . . . . . - . . . . . . . . ! / - * . . . + . . - O - - . . . + . . * . . / | - . + . . . .. + . -. . . . * . * . +.. . * - . . . . . . . . + . . + - - the universe -</pre> -<br /> -<h2 style='display: inline' id='Prelude'>Prelude</h2><br /> -<br /> -<span>I have been participating in an annual work-internal project contest (we call it Pet Project contest) since I moved to London and switched jobs to my current employer. I am very happy to say that I won a "silver" prize last week here 🎆. Over the last couple of years I have been a finalist in this contest six times and won some kind of prize five times. Some of my projects were also released as open source software. One had a magazine article published, and for another one I wrote an article on my employer's engineering blog. If you have followed all my posts on this blog (the one you are currently reading), then you have probably figured out what these projects were:</span><br /> -<br /> -<a class='textlink' href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>DTail - The distributed log tail program</a><br /> -<a class='textlink' href='./2018-06-01-realistic-load-testing-with-ioriot-for-linux.html'>Realistic load testing with I/O Riot for linux</a><br /> -<br /> -<span>Note that my latest silver prize project isn't open source software and because of that there is no public material I can refer to. Maybe the next one again?</span><br /> -<br /> -<span>I want to point out that I never won the "gold" prize and it's the first time I won "silver", though. I believe, looking at the company's contest history, I am the employee with the most consecutive successful project submissions (my streak broke as I didn't participate last year) and am also the one with the highest successful project count in total. Sorry if this all sounds a bit self-promotional, but I think it is something to be proud of. Consistency beats a one-off success.</span><br /> -<br /> -<span>I often put endless hours and sometimes sleepless nights into such projects and all of that in my own time. I, an engineer whose native tongue is not English, also have to present such a project in front of the CEO, CTO and CPO, the Chief Scientist, the founders of the company, and, if it is not enough, to all other staff of the company too. I usually also demonstrate a working prototype live on a production grid during the presentation. 😓</span><br /> -<br /> -<span>So why would I sign up myself for such side projects? Isn't it a lot of stress and extra work? Besides the prize in form of money (you can not count on that, you may win or you may not win something) and recognition, there are also other motivational points:</span><br /> -<br /> -<ul> -<li>I want to learn new technologies or to deepen my knowledge of a given technology. I want to have a personal benefit from the project, even when I don't win any prize. So when the company is offering a contest, why not use it as a motivational trampoline? It's good to have a hard deadline for a project. And the project will also benefit the company in some way. So it's a win-win.</li> -<li>I love the idea of combining several old things into a new thing. You can call this creativity. At work, we call this sometimes Lego: Building new things from given blocks. But I also love to add something new and unique to the mix, something that didn't exist as a Lego block before and could not be built by using only the already existing blocks.</li> -</ul><br /> -<h2 style='display: inline' id='Howtobecreative'>How to be creative</h2><br /> -<br /> -<span>How did I manage to be creative with all these Pet Projects? Unfortunately, there is no step-by-step guide I could point you to. But what I want to do in this blog post is share my personal experience so far.</span><br /> -<br /> -<h3 style='display: inline' id='Knowwhichproblemyouwanttosolve'>Know which problem you want to solve</h3><br /> -<br /> -<span>There must be a problem to be solved or a thing to be improved. It makes no sense to have a project without a goal. A problem might be obvious to you, and you don't even need to think about it. In that case, you are all set, and you can immerse yourself with the problem.</span><br /> -<br /> -<span>If, however, you don't know what problem you want to solve: Do you really need to be creative? All problems are solved anyway, correct? In that case, just go on with your work. As you immerse yourself with your daily work, you will find a project naturally after a while. I don't believe you should artificially find a project. It should come naturally to you. You should have an interest in the problem domain and a strong desire to find a proper solution for the problem. Artificially created projects come with the catch that you might give up on it rather sooner than later due to lack of motivation and desire.</span><br /> -<br /> -<h3 style='display: inline' id='Immersedeepdive'>Immerse / deep dive</h3><br /> -<br /> -<span>If you want to be creative in a field, you must know a lot about it. The more you know about it, the more dots you can connect. When you are learning a new technology or if you are thinking about a tough problem, do it thoroughly. Don't let anything distract you. Read books, watch lectures, listen to podcasts or audiobooks about the topic, talk to other people working on similar topics. Immerse yourself for multiple hours per day, multiple days per week, multiple weeks and maybe even months. Create your own inner universe.</span><br /> -<br /> -<span>But once a day is over, shut your thoughts down. Hit the off-switch. Stop thinking about this problem for the remainder of the day. This can be difficult, as you didn't solve the problem- or didn't understand everything of the new technology yet, and you really want to get to the point. But be strict to yourself and stop thinking about it for a while.</span><br /> -<br /> -<span>You must understand that you are more than just your conscious thoughts. Your brain does a lot of work in the background that you aren't aware of consciously. What happens when you stop consciously thinking about a problem is that your brain continues processing it. You might have experienced the "AHA"-effect, where suddenly you had an idea out of nowhere (e.g. during a walk, in the shower, or in the morning when you woke up)? This is your conscious self downloading a result from the background thread of your brain. You can elevate this effect by immersing with the problem immensely before giving your conscious self a break.</span><br /> -<br /> -<span>Sometimes, depending on how deeply you were immersed, you may need to let the problem go for a couple of days (e.g. over a weekend) before you can download a new insight.</span><br /> -<br /> -<h3 style='display: inline' id='Alwayshaveanotebookwithyou'>Always have a notebook with you</h3><br /> -<br /> -<span>Wherever you go, ensure that you always have something to take notes with you. Once you have an idea from nowhere (or from your unconscious but volatile brain), you really want to write it down to persistent storage. It doesn't matter what kind of note-taking device you use here. It can be a paper journal, or it can be your smartphone. </span><br /> -<br /> -<span>My advice is to have a separate section where you put your notes of all of your ideas. At home or in the office, I write everything in my paper journal. When I am not at home, I use a digital note-taking app on my phone. Later, I copy the digital notes from it into a project-specific section of my paper journal.</span><br /> -<br /> -<span>I prefer taking notes on paper, as it gives you more freedom of how to structure it. You can use any colour, and you can also quickly create diagrams without the use of any complex computer program.</span><br /> -<br /> -<h3 style='display: inline' id='Whenyoudidntsleepenough'>When you didn't sleep enough</h3><br /> -<br /> -<span>I noticed while being sleep-deprived I am (obviously) unable to concentrate so much, and it is difficult to be immersed in a focused way. But on the other hand, I am a lot more creative compared to when I am not sleep-deprived. Then, my brain suddenly presents me with connections I have not thought of before. Here, I usually write any idea I have down on a sheet of paper or in my journal, so I can pick it up later. I then often continue to philosophise about a possible solution. Sometimes to the absurd, and sometimes to something pretty useful.</span><br /> -<br /> -<span>I am not saying that you should skip sleep. By all means, if you can sleep, then sleep. But there are some days when you don't manage to sleep (e.g. think too much about a project and didn't manage to hit the off switch). This is, where you can take advantage of your current state of mind. Disclaimer: Skipping sleep damages your health. So, please don't try this out on purpose. But in case you had a bad night, remember this trick.</span><br /> -<br /> -<h3 style='display: inline' id='Haveregularbreaksandrelax'>Have regular breaks and relax</h3><br /> -<br /> -<span>Have regular breaks. Don't skip your lunch break. Best, have a walk during lunchtime. And after work, do some kind of workout or visit a sports class. Do something completely unrelated to work before going to sleep (e.g. visit a parallel universe and read a Science Fiction novel). In short: Totally hit the off-switch after your work for the day is finished. You will be much more energised and motivated the next time you open your work laptop.</span><br /> -<br /> -<a class='textlink' href='../other-resources.html'>I personally love to read Science Fiction novels</a><br /> -<br /> -<span>I skip breakfast and lunch during the week. This means that on average, I intermittent fast on average 18-20 hours daily. It may sound odd to most people (who don't intermittent fast), but in a fasted state, I can be even more focused, thus helping me immerse myself in something even more. Not having breakfast and lunch also gives me back some time for other things (e.g. a nice walk, where I listen to podcasts or audiobooks or practise using my camera (street photography)). I relax my routine during the week ends, where I may enjoy a meal at any given time of the day.</span><br /> -<br /> -<span>It also helps a lot eat healthy. Healthy food makes your brain work more efficiently. But I won't go into more details here, as nothing is as contradictory as the health and food industry. Conduct your own research. Your opinion may be different from mine anyway, and everyone's body reacts to certain foods differently. What for one person works may not work for another person. But be aware that you will find a lot of wrong and also conflicting information on the internet. So always use multiple resources for your research.</span><br /> -<br /> -<h3 style='display: inline' id='Upsidedownapproach'>Upside-down approach</h3><br /> -<br /> -<span>It's easy to fall into the habit of "boxed" thinking, but creativity is exactly the opposite. Once in a while, make yourself think "Is A really required to do B?". Many assumptions are believed to be true. But are they really? A concrete example: "At work we only use the programming language L and framework F" and therefore, it is the standard we must use.</span><br /> -<br /> -<span>Another way to think about it is "Is there an alternative way to accomplish the desired result? What if there were no programming language L and framework F? What would I do instead?". Maybe you would use programming language X to implement your own domain-specific language, which does what framework F would have done but in exactly the way you want to + much more flexible than F! And maybe language X would be much better suitable than L to implement a DSL anyway. Conclusion: It never hurts to verify your assumptions.</span><br /> -<br /> -<span>Often, you will also find solutions to problems you never intended to solve and find new problems you never imagined to actually exist. That might not be a bad thing, but it might sidetrack you on your path to finding a solution for a particular problem. So be careful not to get sidetracked too much. In this case, just save a note for later reference (maybe your next Pet Project?) somewhere and go on with your actual problem.</span><br /> -<br /> -<span>Don't be afraid to think about weird and unconventional solutions. Sometimes, the most unconventional solution is the best solution to a problem. Also, try to keep to the basics. The best solutions are KISS.</span><br /> -<br /> -<a class='textlink' href='./2021-09-12-keep-it-simple-and-stupid.html'>Keep it simple and stupid</a><br /> -<br /> -<span>A small additional trick: you can train yourself to generate new and unconventional ideas. Just write down 20 random ideas every day. It doesn't matter what the ideas are about and whether they are useful or not. The purpose of this exercise is to make your brain think about something new and unconventional. These can be absurd ideas such as "Jump out of the window naked in the morning in order to wake up faster". Of course, you would never do that, but at least you had an idea and made your brain generate something.</span><br /> -<br /> -<h3 style='display: inline' id='Dontbebusyallthetime'>Don't be busy all the time</h3><br /> -<br /> -<span>Especially as a DevOps Engineer, you could be busy all the time with small, but frequent, ad hoc tasks. Don't lose yourself here. Yes, you should pay attention to your job and those tasks, but you should also make some room for creativity. Don't schedule meeting after ad hoc work after meeting after Jira ticket work after another Jira ticket. There should also be some "free" space in your calendar.</span><br /> -<br /> -<span>Use the "free" time to play around with your tech stack. Try out new options, explore the system metrics, explore new tools, etc. Dividends will pay off with new ideas, which you would have never come up with if you were "just busy" like a machine.</span><br /> -<br /> -<span>Sometimes, I pick a Unix manual page of a random command and start reading it. I have a bash helper function which will pick one for me:</span><br /> -<br /> -<pre> -❯ where learn -learn () { - man $(ls /bin /sbin /usr/bin /usr/sbin 2>/dev/null | shuf -n 1) | - sed -n "/^NAME/ { n;p;q }" -} -❯ learn - perltidy - a perl script indenter and reformatter -❯ learn - timedatectl - Control the system time and date -</pre> -<br /> -<h2 style='display: inline' id='Conclusion'>Conclusion</h2><br /> -<br /> -<span>This all summarises advice I have, really. I hope this was interesting and helpful for you.</span><br /> -<br /> -<span>I have one more small tip: I never published a blog post the same day I wrote it. After finishing writing it, I always wait for a couple of days. In all cases so far, I had an additional idea to add or to fine tune the blog post.</span><br /> -<br /> -<span>Another article I found interesting and relevant is</span><br /> -<br /> -<a class='textlink' href='https://thesephist.com/posts/paradise/'>Creative Paradise by The Sephist</a><br /> -<br /> -<span>Relevant books I can recommend are:</span><br /> -<br /> -<ul> -<li>Consciousness: A Very Short Introduction; Susan Blackmore; Oxford Uiversity Press</li> -<li>Deep Work; Cal Newport; Piatkus</li> -<li>So Good They Can't Ignore You; Cal Newport; Business Plus</li> -<li>The Off Switch; Mark Cropley; Virgin Books</li> -<li>Ultralearning; Scott Young; Thorsons</li> -</ul><br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>The release of DTail 4.0.0</title> - <link href="gemini://foo.zone/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.gmi" /> - <id>gemini://foo.zone/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.gmi</id> - <updated>2022-03-06T18:11:39+00:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>I have recently released DTail 4.0.0 and this blog post goes through all the new goodies. If you want to jump directly to DTail, do it here (there are nice animated gifs which demonstrates the usage pretty well):</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='ThereleaseofDTail400'>The release of DTail 4.0.0</h1><br /> -<br /> -<span class='quote'>Published at 2022-03-06T18:11:39+00:00</span><br /> -<br /> -<pre> - ,_---~~~~~----._ - _,,_,*^____ _____``*g*\"*, - ____ _____ _ _ / __/ /' ^. / \ ^@q f - | _ \_ _|_ _(_) | @f | @)) | | @)) l 0 _/ - | | | || |/ _` | | | \`/ \~____ / __ \_____/ \ - | |_| || | (_| | | | | _l__l_ I - |____/ |_|\__,_|_|_| } [______] I - ] | | | | - ] ~ ~ | - | | - | | -</pre> -<br /> -<span>I have recently released DTail 4.0.0 and this blog post goes through all the new goodies. If you want to jump directly to DTail, do it here (there are nice animated gifs which demonstrates the usage pretty well):</span><br /> -<br /> -<a class='textlink' href='https://dtail.dev'>https://dtail.dev</a><br /> -<br /> -<h2 style='display: inline' id='Sowhatsnewin400'>So, what's new in 4.0.0?</h2><br /> -<br /> -<h3 style='display: inline' id='Rewrittenlogging'>Rewritten logging</h3><br /> -<br /> -<span>For DTail 4, logging has been completely rewritten. The new package name is "internal/io/dlog". I rewrote the logging because DTail is a special case here: There are logs processed by DTail, there are logs produced by the DTail server itself, there are logs produced by a DTail client itself, there are logs only logged by a DTail client, there are logs only logged by the DTail server, and there are logs logged by both, server and client. There are also different logging levels and outputs involved.</span><br /> -<br /> -<span>As you can imagine, it becomes fairly complex. There is no ready Go off-shelf logging library which suits my needs and the logging code in DTail 3 was just one big source code file with global variables and it wasn't sustainable to maintain anymore. So why not rewrite it for profit and fun? </span><br /> -<br /> -<span>There's a are new log level structure now (The log level now can be specified with the "-logLevel" command line flag):</span><br /> -<br /> -<pre> -// Available log levels. -const ( - None level = iota - Fatal level = iota - Error level = iota - Warn level = iota - Info level = iota - Default level = iota - Verbose level = iota - Debug level = iota - Devel level = iota - Trace level = iota - All level = iota -) -</pre> -<br /> -<span>DTail also supports multiple log outputs (e.g. to file or to stdout). More are now easily pluggable with the new logging package. The output can also be "enriched" (default) or "plain" (read more about that further below).</span><br /> -<br /> -<h3 style='display: inline' id='Configurableterminalcolorcodes'>Configurable terminal color codes</h3><br /> -<br /> -<span>A complaint I received from the users of DTail 3 were the terminal colors used for the output. Under some circumstances (terminal configuration) it made the output difficult to read so that users defaulted to "--noColor" (disabling colored output completely). I toke it by heart and also rewrote the color handling. It's now possible to configure the foreground and background colors and an attribute (e.g. dim, bold, ...).</span><br /> -<br /> -<span>The example "dtail.json" configuration file represents the default (now, more reasonable default) color codes used, and it is free to the user to customize them:</span><br /> -<br /> -<pre> -{ - "Client": { - "TermColorsEnable": true, - "TermColors": { - "Remote": { - "DelimiterAttr": "Dim", - "DelimiterBg": "Blue", - "DelimiterFg": "Cyan", - "RemoteAttr": "Dim", - "RemoteBg": "Blue", - "RemoteFg": "White", - "CountAttr": "Dim", - "CountBg": "Blue", - "CountFg": "White", - "HostnameAttr": "Bold", - "HostnameBg": "Blue", - "HostnameFg": "White", - "IDAttr": "Dim", - "IDBg": "Blue", - "IDFg": "White", - "StatsOkAttr": "None", - "StatsOkBg": "Green", - "StatsOkFg": "Black", - "StatsWarnAttr": "None", - "StatsWarnBg": "Red", - "StatsWarnFg": "White", - "TextAttr": "None", - "TextBg": "Black", - "TextFg": "White" - }, - "Client": { - "DelimiterAttr": "Dim", - "DelimiterBg": "Yellow", - "DelimiterFg": "Black", - "ClientAttr": "Dim", - "ClientBg": "Yellow", - "ClientFg": "Black", - "HostnameAttr": "Dim", - "HostnameBg": "Yellow", - "HostnameFg": "Black", - "TextAttr": "None", - "TextBg": "Black", - "TextFg": "White" - }, - "Server": { - "DelimiterAttr": "AttrDim", - "DelimiterBg": "BgCyan", - "DelimiterFg": "FgBlack", - "ServerAttr": "AttrDim", - "ServerBg": "BgCyan", - "ServerFg": "FgBlack", - "HostnameAttr": "AttrBold", - "HostnameBg": "BgCyan", - "HostnameFg": "FgBlack", - "TextAttr": "AttrNone", - "TextBg": "BgBlack", - "TextFg": "FgWhite" - }, - "Common": { - "SeverityErrorAttr": "AttrBold", - "SeverityErrorBg": "BgRed", - "SeverityErrorFg": "FgWhite", - "SeverityFatalAttr": "AttrBold", - "SeverityFatalBg": "BgMagenta", - "SeverityFatalFg": "FgWhite", - "SeverityWarnAttr": "AttrBold", - "SeverityWarnBg": "BgBlack", - "SeverityWarnFg": "FgWhite" - }, - "MaprTable": { - "DataAttr": "AttrNone", - "DataBg": "BgBlue", - "DataFg": "FgWhite", - "DelimiterAttr": "AttrDim", - "DelimiterBg": "BgBlue", - "DelimiterFg": "FgWhite", - "HeaderAttr": "AttrBold", - "HeaderBg": "BgBlue", - "HeaderFg": "FgWhite", - "HeaderDelimiterAttr": "AttrDim", - "HeaderDelimiterBg": "BgBlue", - "HeaderDelimiterFg": "FgWhite", - "HeaderSortKeyAttr": "AttrUnderline", - "HeaderGroupKeyAttr": "AttrReverse", - "RawQueryAttr": "AttrDim", - "RawQueryBg": "BgBlack", - "RawQueryFg": "FgCyan" - } - } - }, - ... -} -</pre> -<br /> -<span>You notice the different sections - these are different contexts:</span><br /> -<br /> -<ul> -<li>Remote: Color configuration for all log lines sent remotely from the server to the client. </li> -<li>Client: Color configuration for all lines produced by a DTail client by itself (e.g. status information).</li> -<li>Server: Color configuration for all lines produced by the DTail server by itself and sent to the client (e.g. server warnings or errors)</li> -<li>MaprTable: Color configuration for the map-reduce table output.</li> -<li>Common: Common color configuration used in various places (e.g. when it's not clear what's the current context of a line).</li> -</ul><br /> -<span>When you do so, make sure that you check your "dtail.json" against the JSON schema file. This is to ensure that you don't configure an invalid color accidentally (requires "jsonschema" to be installed on your computer). Furthermore, the schema file is also a good reference for all possible colors available:</span><br /> -<br /> -<pre> -jsonschema -i dtail.json schemas/dtail.schema.json -</pre> -<br /> -<h3 style='display: inline' id='Serverlessmode'>Serverless mode</h3><br /> -<br /> -<span>All DTail commands can now operate on log files (and other text files) directly without any DTail server running. So there isn't a need anymore to install a DTail server when you are on the target server already anyway, like the following example shows:</span><br /> -<br /> -<pre> -% dtail --files /var/log/foo.log -</pre> -<br /> -<span>or</span><br /> -<br /> -<pre> -% dmap --files /var/log/foo.log --query 'from TABLE select .... outfile result.csv' -</pre> -<br /> -<span>The way it works in Go code is that a connection to a server is managed through an interface and in serverless mode DTail calls through that interface to the server code directly without any TCP/IP and SSH connection made in the background. This means, that the binaries are a bit larger (also ship with the code which normally would be executed by the server) but the increase of binary size is not much.</span><br /> -<br /> -<h3 style='display: inline' id='Shorthandflags'>Shorthand flags</h3><br /> -<br /> -<span>The "--files" from the previous example is now redundant. As a shorthand, It is now possible to do the following instead:</span><br /> -<br /> -<pre> -% dtail /var/log/foo.log -</pre> -<br /> -<span>Of course, this also works with all other DTail client commands (dgrep, dcat, ... etc).</span><br /> -<br /> -<h3 style='display: inline' id='Spartanakaplainmode'>Spartan (aka plain) mode</h3><br /> -<br /> -<span>There's a plain mode, which makes DTail only print out the "plain" text of the files operated on (without any DTail specific enriched output). E.g.:</span><br /> -<br /> -<pre> -% dcat --plain /etc/passwd > /etc/test -% diff /etc/test /etc/passwd # Same content, no diff -</pre> -<br /> -<span>This might be useful if you wanted to post-process the output. </span><br /> -<br /> -<h3 style='display: inline' id='Standardinputpipe'>Standard input pipe</h3><br /> -<br /> -<span>In serverless mode, you might want to process your data in a pipeline. You can do that now too through an input pipe:</span><br /> -<br /> -<pre> -% dgrep --plain --regex 'somethingspecial' /var/log/foo.log | - dmap --query 'from TABLE select .... outfile result.csv' -</pre> -<br /> -<span>Or, use any other "standard" tool:</span><br /> -<br /> -<pre> -% awk '.....' < /some/file | dtail .... -</pre> -<br /> -<h3 style='display: inline' id='Newcommanddtailhealth'>New command dtailhealth</h3><br /> -<br /> -<span>Prior to DTail 4, there was a flag for the "dtail" command to check the health of a remote DTail server (for use with monitoring system such as Nagios). That has been moved out to a separate binary to reduce complexity of the "dtail" command. The following checks whether DTail is operational on the current machine (you could also check a remote instance of DTail server, just adjust the server address).</span><br /> -<br /> -<pre> -% cat check_dtail.sh -#!/bin/sh - -exec /usr/local/bin/dtailhealth --server localhost:2222 -</pre> -<br /> -<h3 style='display: inline' id='Improveddocumentation'>Improved documentation</h3><br /> -<br /> -<span>Some features, such as custom log formats and the map-reduce query language, are now documented. Also, the examples have been updated to reflect the new features added. This also includes the new animated example Gifs (plus documentation how they were created).</span><br /> -<br /> -<span>I must admit that not all features are documented yet:</span><br /> -<br /> -<ul> -<li>Server side scheduled map-reduce queries</li> -<li>Server side continuous map-reduce queries</li> -<li>Some more docs about terminal color customization</li> -<li>Some more docs about log levels</li> -</ul><br /> -<span>That will be added in one of the future releases. </span><br /> -<br /> -<h3 style='display: inline' id='Integrationtestingsuite'>Integration testing suite</h3><br /> -<br /> -<span>DTail comes already with some unit tests, but what's new is a full integration testing suite which covers all common use cases of all the commands (dtail, dcat, dgrep, dmap) with a server backend and also in serverless mode.</span><br /> -<br /> -<span>How are the tests implemented? All integration tests are simply unit tests in the "./integrationtests" folder. They must be explicitly activated with:</span><br /> -<br /> -<pre> -% export DTAIL_INTEGRATION_TEST_RUN_MODE=yes -</pre> -<br /> -<span>Once done, first compile all commands, and then run the integration tests:</span><br /> -<br /> -<pre> -% make -. -. -. -% go clean -testcache -% go test -race -v ./integrationtests -</pre> -<br /> -<h3 style='display: inline' id='Improvedcode'>Improved code</h3><br /> -<br /> -<span>Not that the code quality of DTail has been bad (I have been using Go vet and Go lint for previous releases and will keep using these), but this time I had new tools (such as SonarQube and BlackDuck) in my arsenal to:</span><br /> -<br /> -<ul> -<li>Reduce the complexity of a couple of functions (splitting code up into several smaller functions)</li> -<li>Avoid repeating code (this version of DTail doesn't use Go generics yet, though).</li> -</ul><br /> -<span>Other than that, a lot of other code has been refactored as I saw fit.</span><br /> -<br /> -<h3 style='display: inline' id='Useofmemorypools'>Use of memory pools</h3><br /> -<br /> -<span>DTail makes excessive use of string builder and byte buffer objects. For performance reasons, those are now re-used from memory pools.</span><br /> -<br /> -<h2 style='display: inline' id='Whatsnext'>What's next</h2><br /> -<br /> -<span>DTail 5 won't be released any time soon I guess, but some 4.x.y releases will follow this year fore sure. I can think of:</span><br /> -<br /> -<ul> -<li>New (but backwards compatible) features which don't require a new major version bump (some features have been requested at work internally).</li> -<li>Even more improved documentation.</li> -<li>Dependency updates.</li> -</ul><br /> -<span>I use usually DTail at work, but I have recently installed it on my personal OpenBSD machines too. I might write a small tutorial here (and I might also add the rc scripts as examples to one of the next DTail releases).</span><br /> -<br /> -<span>I am a bit busy at the moment with two other pet projects of mine (one internal work-project, and one personal one, the latter you will read about in the next couple of months). If you have ideas (or even a patch), then please don't hesitate to contact me (either via E-Mail or a request at GitHub).</span><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<span>Other related posts are:</span><br /> -<br /> -<a class='textlink' href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>2021-04-22 DTail - The distributed log tail program</a><br /> -<a class='textlink' href='./2022-03-06-the-release-of-dtail-4.0.0.html'>2022-03-06 The release of DTail 4.0.0 (You are currently reading this)</a><br /> -<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> -<a class='textlink' href='./2023-09-25-dtail-usage-examples.html'>2023-09-25 DTail usage examples</a><br /> -<br /> -<span>Thanks!</span><br /> -<br /> -<span>Paul</span><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>Computer operating systems I use(d)</title> - <link href="gemini://foo.zone/gemfeed/2022-02-04-computer-operating-systems-i-use.gmi" /> - <id>gemini://foo.zone/gemfeed/2022-02-04-computer-operating-systems-i-use.gmi</id> - <updated>2022-02-04T09:58:22+00:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>This is a list of Operating Systems I currently use. This list is in no particular order and also will be updated over time. The very first operating system I used was MS-DOS (mainly for games) and the very first Unix like operating system I used was SuSE Linux 5.3. My first smartphone OS was Symbian on a clunky Sony Ericsson device.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='ComputeroperatingsystemsIused'>Computer operating systems I use(d)</h1><br /> -<br /> -<span class='quote'>Published at 2022-02-04T09:58:22+00:00; Updated at 2022-02-18</span><br /> -<br /> -<pre> - /( )` - \ \___ / | - /- _ `-/ ' - (/\/ \ \ /\ - / / | ` \ - O O ) / | - `-^--'`< ' - (_.) _ ) / - `.___/` / - `-----' / - <----. __ / __ \ - <----|====O)))==) \) /==== - <----' `--' `.__,' \ - | | - \ / - ______( (_ / \______ - (FL) ,' ,-----' | \ - `--{__________) \/ "Berkeley Unix Daemon" -</pre> -<br /> -<span>This is a list of Operating Systems I currently use. This list is in no particular order and also will be updated over time. The very first operating system I used was MS-DOS (mainly for games) and the very first Unix like operating system I used was SuSE Linux 5.3. My first smartphone OS was Symbian on a clunky Sony Ericsson device.</span><br /> -<br /> -<h2 style='display: inline' id='FedoraLinux'>Fedora Linux</h2><br /> -<br /> -<span>Fedora Linux is the operating system I use on my primary (personal) laptop. It's a ThinkPad X1 Carbon Gen. 9. Lenovo which comes along with official Lenovo Linux support. I already noticed hardware firmware updates being installed directly through Fedora from Lenovo. Fedora is a real powerhouse, cutting-edge and reasonably stable at the same time. It's baked by Red Hat.</span><br /> -<br /> -<span>I also use Fedora on my Microsoft Surface Go 2 convertible tablet. Fedora works quite OK (and much better than Windows) on this device. It's also the perfect travel companion.</span><br /> -<br /> -<span>I use the GNOME Desktop on my Fedora boxes. I have memorized and customized a bunch of keyboard shortcuts. But the fact that I mostly work in the terminal (with tmux) makes the Desktop environment I use only secondary.</span><br /> -<br /> -<h2 style='display: inline' id='EndeavourOS'>EndeavourOS</h2><br /> -<br /> -<span>I installed EndeavourOS on my (older) ThinkPad X240 to try out an Arch based Linux distribution. I also could have installed plain Arch, but I don't see the point when there is EndeavourOS. EndeavourOS is as close as you can get to the plain Arch experience but with an easy installer. I am not saying that it's difficult to install plain Arch but it's, unless you are new to Linux and want to learn about the installation procedure, just waste of time in my humble opinion. Give Linux From Scratch a shot instead if you really want to learn about Linux.</span><br /> -<br /> -<a class='textlink' href='https://www.linuxfromscratch.org/'>https://www.linuxfromscratch.org/</a><br /> -<br /> -<span>On EndeavourOS, I use the Xfce desktop environment which feels very snappy and fast on the X240 (which I purchased back in 2014). Usually, I have my X240 standing right next to my work laptop and use it for playing music (mainly online radio streams), for personal note taking and occasional emailing and instant messaging.</span><br /> -<br /> -<span>As this is a rolling Linux distribution there are a lot of software updates coming through every day. Sometimes, it only takes a minute until the next version of a package is available. Honestly, I find that a bit annoying to constantly catch up with all the updates. As for now I will live with it and/or automate it a bit more. It'll be OK if it breaks occasionally, as this is not my primary laptop anyway. </span><br /> -<br /> -<span>Arch Linux and EndeavourOS are community distributions. This means, that there is no big corporation in the backyard lurking around. They won't give you the firmware updates for cutting edge hardware out of the box, though, but they are still a very good choice for hobbyist and also for older hardware where future firmware updates are less likely to happen.</span><br /> -<br /> -<span>I am very happy with the package availability through the official repository and AUR.</span><br /> -<br /> -<a class='textlink' href='https://endeavouros.com/'>https://endeavouros.com/</a><br /> -<br /> -<h2 style='display: inline' id='FreeBSD'>FreeBSD</h2><br /> -<br /> -<span>I have run FreeBSD in many occasions. Right after SuSE Linux, FreeBSD (around 4.x) was the second open source system I used in my life on regular basis. I didn't even go to university yet then I started using it :-). Also, a former employer of mine even allowed me to install FreeBSD on my main workstation (which I actually did and used it for a couple of years). </span><br /> -<br /> -<span>I remember it used to be a pain bootstrapping Java for FreeBSD due to the lack of pre-compiled binary packages. You had first to enable the Linux compatibility layer, then install Linux Java, and then compile FreeBSD Java with the bootstrapped Linux Java (yes, Java is mainly programmed in C++, but for some reason compiling Java for FreeBSD also required an installation of Java). Nowadays, there are ready OpenJDK binary packages you could install. So things have improved a lot since.</span><br /> -<br /> -<span>FreeBSD always had a place somewhere in my life:</span><br /> -<br /> -<ul> -<li>On a Desktop PC (personal and work)</li> -<li>On a Laptop</li> -<li>On a webserver, FTP server, DNS server, mail server</li> -<li>On a server offering FreeBSD jails to customers for rent</li> -<li>As an experiment running Debian GNU/kFreeBSD inside of jails</li> -</ul><br /> -<span>Debian GNU/kFreeBSD is now dead (same is my experiment)...</span><br /> -<br /> -<a class='textlink' href='https://www.debian.org/ports/kfreebsd-gnu/'>https://www.debian.org/ports/kfreebsd-gnu/</a><br /> -<br /> -<span>...but I still have saved and old uname output :-):</span><br /> -<br /> -<pre> -[root@saturn /usr/jail/serv14/etc] # jexec 21 bash -root@rhea:/ # uname -a -GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 27 13:10:09 CET - 2010 root@saturn.buetow.org:/usr/obj/usr/srcs/freebsd.src8/src/sys/SERV10 x86 64 amd64 Intel(R) - Core(TM) i7 CPU 920 @ 2.67GHz GNU/kFreeBSD -</pre> -<br /> -<span>Currently, I use FreeBSD on my personal NAS server. The server is a regular PC with a bunch of hard drives and a ZFS RAIDZ (with 4x2TB drives) + a couple of external backup drives.</span><br /> -<br /> -<a class='textlink' href='https://www.FreeBSD.org'>https://www.FreeBSD.org</a><br /> -<br /> -<h2 style='display: inline' id='CentOS7'>CentOS 7</h2><br /> -<br /> -<span>While CentOS 8 is already out of support, I still use CentOS 7 (which will receive security updates until 2024). CentOS 7 runs in a cloud VM and is the home to my personal NextCloud and Wallabag installations. You probably know already NextCloud. About Wallabag: It is a great free and open source alternative to Pocket (for reading articles from the web offline later). Yes, you can pay for a Wallabag subscription, but you can also host it for free on your own server.</span><br /> -<br /> -<a class='textlink' href='https://nextcloud.com'>NextCloud</a><br /> -<a class='textlink' href='https://www.wallabag.it/en'>Wallabag</a><br /> -<br /> -<span>The reason I use Linux and not *BSD at the moment for these services is Docker. With Docker, it's so easy-peasy to get these up and running. I will have to switch to another OS before CentOS 7 runs out of support, though. It might be CentOS Stream, Rocky Linux, or, more likely, I will use FreeBSD. On FreeBSD there isn't Docker, but what can be done is to create a self-contained Jail for each of the web-apps. </span><br /> -<br /> -<span>I have been using FreeBSD Jails for LAMP stacks before I started using CentOS. The reason why I switched to CentOS (it was still CentOS 6 at that time) in the first place was, that I wanted to try out something new.</span><br /> -<br /> -<a class='textlink' href='https://www.centos.org'>https://www.centos.org</a><br /> -<br /> -<h2 style='display: inline' id='OpenBSD'>OpenBSD</h2><br /> -<br /> -<span>I use two small OpenBSD "cloud" boxes for my "public facing internet front-ends". The services I run here are:</span><br /> -<br /> -<ul> -<li>HTTP server (serving this site via https://foo.zone)</li> -<li>Gemini server (serving this site via gemini://foo.zone)</li> -<li>MTA server (for receiving E-Mails to my hosts)</li> -<li>Authorative DNS server (for all of my "domains")</li> -<li>Some personal/private git repositories (accessible only via SSH)</li> -</ul><br /> -<span>OpenBSD is a complete operating system. I love it due to it's "simplicity" and "correctness" and the good documentation (I love the manual pages in particular). OpenBSD is also known for its innovations in security. I must admin, though, that most Unix like operating system would be secure enough for my personal needs and that I don't really need to use OpenBSD here. But nevertheless, I think it's the ideal operating system for what I am using it for.</span><br /> -<br /> -<span>The only softwares which were not part of the base system and I had to install additionally were the Gemini server (vger) and Git, which both were available as pre-compiled OpenBSD binary packages. So, besides of these two packages, it is indeed a pretty complete operating system for my use case.</span><br /> -<br /> -<a class='textlink' href='https://www.openbsd.org'>https://www.openbsd.org</a><br /> -<br /> -<h2 style='display: inline' id='macOSproprietary'>macOS (proprietary)</h2><br /> -<br /> -<span>I have to use a MacBook Pro with macOS for work. What else can I say but that this would have never been my personal choice. At least macOS is a UNIX under the hood and comes with a decent terminal and there are plenty of terminal apps available via Brew. Some of the inner workings of macOS were actually forked from the FreeBSD project. </span><br /> -<br /> -<a class='textlink' href='https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/BSD/BSD.html'>developer.apple.com: BSD in macOS/Darwin</a><br /> -<br /> -<span>I find the macOS UI rather confusing.</span><br /> -<br /> -<h2 style='display: inline' id='LineageOSmobile'>LineageOS (mobile)</h2><br /> -<br /> -<span>At some point I got fed up with big tech, like Google and Samsung (or Apple, but personally I don't use Apple), spying on me. So I purchased a Google phone (a midrange Pixel phone) and installed LineageOS, a free and open source distribution of Android, on it. I don't have anything from Google installed on it (not even the play store, I install my apps from F-Droid). It's my daily driver since mid 2021 now. </span><br /> -<br /> -<span>So far the experience is not great but good. The main culprits are not having Google Maps, Google Gboard and the camera app. The latter lacks some features on LineageOS (e.g. No wide angle lens support). Also, I can't use my banking apps anymore. Sometimes apps crash for no apparent reason(s) but I get around it so far. I shouldn't spend so much time on my smartphone anyway! And the whole point of switching to LineageOS was to get away of big tech and therefore I should not complain :-). What I do like is that 95% the things I used to do on a proprietary mobile phone also can be done with LineageOS.</span><br /> -<br /> -<a class='textlink' href='./2021-08-01-on-being-pedantic-about-open-source.html'>Read also "The Midle Way" section of this blog post regarding smartphones.</a><br /> -<br /> -<span>There's also the excellent Termux app in the F-Droid store, which transforms the phone into a small Linux handheld device. I am able to run all of my Linux/Unix terminal apps with it.</span><br /> -<br /> -<a class='textlink' href='https://lineageos.org/'>https://lineageos.org/</a><br /> -<a class='textlink' href='https://termux.com/'>https://termux.com/</a><br /> -<br /> -<h2 style='display: inline' id='SamsungsStockAndroidmobileproprietary'>Samsung's Stock Android (mobile proprietary)</h2><br /> -<br /> -<span>Unfortunatley, I still have to keep my proprietary Android phone around. Sometimes, I really need to use some proprietary apps which are only available form the Google play store and also require the Google services installed on the phone. I don't carry this phone around all the time and I only use it intentionally for very specific use cases. I think this is the best compromise I can make.</span><br /> -<br /> -<h2 style='display: inline' id='iOSmobileproprietary'>iOS (mobile proprietary)</h2><br /> -<br /> -<span>I have to use an iPhone for work. I like the hardware but I hate the OS (you can also call it spyOS), but it's the necessarries evil, unfortunately. Apple is even worse than Google here (despite claiming for themselves to produce the most secure phone(s)). I don't have it with me all the time or switched off when I don't need it. I also find iOS quite unintuitive to use.</span><br /> -<br /> -<span>Being on-call for work means to to be reachable 24/7. This implies that the phone is carried around all the time (in an switched-on state). 1984 is now.</span><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Nineteen_Eighty-Four'>https://en.wikipedia.org/wiki/Nineteen_Eighty-Four</a><br /> -<br /> -<h2 style='display: inline' id='OtherOSes'>Other OSes</h2><br /> -<br /> -<h3 style='display: inline' id='InfinyTimesmartwatch'>InfinyTime (smartwatch)</h3><br /> -<br /> -<span>I use it on my PineTime smartwatch. Other than checking the time and my step count, I really don't do anything else fancy with it (yet). </span><br /> -<br /> -<a class='textlink' href='https://www.pine64.org/pinetime/'>https://www.pine64.org/pinetime/</a><br /> -<a class='textlink' href='https://infinitime.io/'>https://infinitime.io/</a><br /> -<br /> -<h3 style='display: inline' id='motionEyeOS'>motionEyeOS</h3><br /> -<br /> -<span>I usually install an army of RaspberryPi 3's in my house before I travel for a prolonged amount of time. All Pi's are equipped with an camera and have motionEyeOS (Linux based video surveillance system) installed. There's a neat Android app in the F-Droid store which let's me keep an eye on everything. I make the Pi's accessible from the internet via reverse SSH tunnels through one of my frontend servers.</span><br /> -<br /> -<a class='textlink' href='https://github.com/ccrisan/motioneyeos'>https://github.com/ccrisan/motioneyeos</a><br /> -<br /> -<h3 style='display: inline' id='KoboOSproprietary'>Kobo OS (proprietary)</h3><br /> -<br /> -<span>I use a Kobo Forma as my e-reader device. I have started to switch off the Wifi and to only sideload DRM free ePubs on it. Even offline, it's a fully capable reader device. I wouldn't like the Kobo to call home to Rakuten. I would love to replace it one day with an open source e-reader alternative like the PineNote. There are also some interesting attempts installing postmarketOS Linux on Kobo devices. The latter boots already, but is far from being usable as a normal e-reader.</span><br /> -<br /> -<a class='textlink' href='https://www.pine64.org/pinenote/'>The PineNote</a><br /> -<a class='textlink' href='https://liliputing.com/2021/07/kobo-clara-hd-becomes-an-e-ink-linux-tablet-with-the-help-of-postmarketos.html'>Kobo Clara HD becomes an e-ink Linux tablet</a><br /> -<br /> -<span>But as a fall-back, someone could still use the good old dead tree format!</span><br /> -<br /> -<h3 style='display: inline' id='AndroidTVproprietary'>Android TV (proprietary)</h3><br /> -<br /> -<span>An Android TV box is used for watching movies and series on Netflix and Amazon Prime video (yes, I am human too and rely once in a while on big tech streaming services). The Android TV box is currently in the process of being replaced by OSMC, though. Most services seem to work fine with OSMC, but didn't get around tinkering with Netflix and Amazon there yet.</span><br /> -<br /> -<a class='textlink' href='https://osmc.tv/'>https://osmc.tv/</a><br /> -<br /> -<h2 style='display: inline' id='OtherOSes'>Other OSes..</h2><br /> -<br /> -<span>This section is just for the sake of having a complete list of all OSes I used for some significant amount of time. I might not use all of them any more...</span><br /> -<br /> -<h3 style='display: inline' id='NetBSD'>NetBSD</h3><br /> -<br /> -<span>I have been using NetBSD on an old Sun Sparcstation 10 as a student. I also have run NetBSD on a very old ThinkPad with 96MB!!! of RAM (even with X/evilWM). I also installed (but never really used) NetBSD on an HP Jornada 680. But that's all more than 10 years ago. I haven't looked at NetBSD for long time. I want to revive it on an "old" ThinkPad T450 of mine which I currently don't use.</span><br /> -<br /> -<a class='textlink' href='https://netbsd.org'>https://netbsd.org</a><br /> -<br /> -<h3 style='display: inline' id='OtherOSesinuse'>Other OSes in use...</h3><br /> -<br /> -<a class='textlink' href='https://sailfish.org'>SailfishOS - Nice mobile OS, but unfortunately includes proprietary components</a><br /> -<a class='textlink' href='https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux'>Red Hat Enterprise Linux - Only for some work stuff</a><br /> -<br /> -<h3 style='display: inline' id='OtherOSesnotusedanymore'>Other OSes not used any more...</h3><br /> -<br /> -<a class='textlink' href='https://en.opensuse.org/Archive:S.u.S.E._Linux_5.3'>SuSE Linux 5.3 - The first Linux OS I used</a><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/IRIX'>SGI's IRIX - On a SGI Onyx 3200</a><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/MeeGo'>MeeGo - On a Nokia N9</a><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Microsoft_Windows'>Microsoft Windows</a><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/MS-DOS'>Microsoft DOS - With and without Windows 3.x</a><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Symbian'>Symbian - The first smartphone OS I used </a><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Wear_OS'>WearOS - On a Google smartwatch</a><br /> -<a class='textlink' href='https://www.debian.org'>Debian GNU/Linux - Rock solid, but atm. I prefer Fedora/EndeavourOS</a><br /> -<a class='textlink' href='https://www.ubuntu.com'>Ubuntu Linux (based on Debian)</a><br /> -<a class='textlink' href='https://www.linuxfromscratch.org/'>Linux from scratch - The best way to learn Linux</a><br /> -<a class='textlink' href='https://www.suse.com/products/server/'>SUSE Linux Enterprise - Only for some work stuff</a><br /> -<br /> -<h3 style='display: inline' id='OtherOSesIonlyhadaglanceat'>Other OSes I only had a glance at...</h3><br /> -<br /> -<a class='textlink' href='https://archiveos.org/opensolaris/'>OpenSolaris - Continuation of the open source version of Solaris</a><br /> -<a class='textlink' href='https://archlinuxarm.org/'>Arch Linux ARM</a><br /> -<a class='textlink' href='https://ecomstation.com/'>eComStation - Continuation of IBM OS/2</a><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Minix'>MINIX</a><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/OpenVMS'>OpenVMS</a><br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/OS/2'>IBM OS/2 Warp</a><br /> -<a class='textlink' href='https://freedos.org'>FreeDOS - Open source alternative to DOS</a><br /> -<a class='textlink' href='https://plan9.io/plan9/'>Plan9 </a><br /> -<a class='textlink' href='https://reactos.org/'>ReactOS - A Microsoft Windows open source clone</a><br /> -<a class='textlink' href='https://www.debian.org/ports/hurd/'>Debian GNU/Hurd - Debian on the GNU kernel</a><br /> -<a class='textlink' href='https://www.debian.org/ports/kfreebsd-gnu/'>Debian GNU/kFreeBSD - Debian on the FreeBSD kernel</a><br /> -<a class='textlink' href='https://www.gentoo.org'>Gentoo Linux</a><br /> -<a class='textlink' href='https://www.haiku-os.org/'>Haiku - A BeOS open source clone</a><br /> -<a class='textlink' href='https://www.oracle.com/solaris/solaris11/'>Sun Solaris (now owned by Oracle)</a><br /> -<a class='textlink' href='https://www.puredarwin.org/'>OpenDarwin ("now" PureDarwin) - Open source operating system based on the open parts of macOS</a><br /> -<br /> -<h3 style='display: inline' id='OtherOSeswhichseeminteresting'>Other OSes which seem interesting...</h3><br /> -<br /> -<a class='textlink' href='https://asteroidos.org/'>Asteroids OS - Open source smartphone OS</a><br /> -<a class='textlink' href='https://www.dragonflybsd.org/'>DragonFly BSD - Fork of FreeBSD 4</a><br /> -<a class='textlink' href='http://wiki.postmarketos.org/wiki/Phosh'>Phosh (on postmarketOS) - A true Linux shell for the smartphone</a><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>Welcome to the foo.zone</title> - <link href="gemini://foo.zone/gemfeed/2022-01-23-welcome-to-the-foo.zone.gmi" /> - <id>gemini://foo.zone/gemfeed/2022-01-23-welcome-to-the-foo.zone.gmi</id> - <updated>2022-01-23T16:42:04+00:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>I don't count this as a real blog post, but more of an announcement (I aim to write one real post once monthly). From now on, 'foo.zone' is the new address of this site. All other addresses will still forward to it and eventually (based on the traffic still going through) will be deactivated.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='Welcometothefoozone'>Welcome to the foo.zone</h1><br /> -<br /> -<span class='quote'>Published at 2022-01-23T16:42:04+00:00</span><br /> -<br /> -<pre> - __ - / _| ___ ___ _______ _ __ ___ -| |_ / _ \ / _ \ |_ / _ \| '_ \ / _ \ -| _| (_) | (_) | / / (_) | | | | __/ -|_| \___/ \___(_)___\___/|_| |_|\___| - -</pre> -<br /> -<span>I don't count this as a real blog post, but more of an announcement (I aim to write one real post once monthly). From now on, "foo.zone" is the new address of this site. All other addresses will still forward to it and eventually (based on the traffic still going through) will be deactivated.</span><br /> -<br /> -<span>As you can read on Wikipedia, "foo" is, alongside to "bar" and "baz", a metasyntactic variable (you know what I mean if you are a programmer or IT person):</span><br /> -<br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Metasyntactic_variable'>https://en.wikipedia.org/wiki/Metasyntactic_variable</a><br /> -<br /> -<h2 style='display: inline' id='Whatisthefoozone'>What is the foo zone?</h2><br /> -<br /> -<span>It's my personal internet site and blog. Everything you read on this site is my personal opinion and experience. It's not intended to be anything professional. If you want my professional background, then go to my LinkedIn profile.</span><br /> -<br /> -<span>Since I re-booted this blog last year, I struggled to find a good host name for it. I started off with "buetow.org", and later I switched halfway to "snonux.de". Buetow is my last name, and snonux relates to some of my internet nicknames and personal IT projects. I also have a "SnonuxBSD" ASCII-art banner in the motd of my FreeBSD based home-NAS.</span><br /> -<br /> -<span>For a while, I was thinking about a better host name for this site, meeting the following criteria:</span><br /> -<br /> -<ul> -<li>Isn't directly linked to my name or my internet nicknames.</li> -<li>Reflects the "nature" of this site.</li> -<li>Is still pretty generic.</li> -<li>Is "cool".</li> -<li>Is short and easy to remember. </li> -<li>Doesn't cost millions.</li> -</ul><br /> -<span>So I think that foo.zone is the perfect match. It's a bit geeky, but so is this site. The meta-syntactic variable relates to computer science and programming, so does this site. Other than that, staying in this sphere, it's a pretty generic name.</span><br /> -<br /> -<h2 style='display: inline' id='Tobeinthezoneandnotinasurfclub'>To be in the .zone and not in a .surf club</h2><br /> -<br /> -<span>I was pretty happy finding out that foo.zone was still available for registration. I stumbled across it just yesterday while I was playing around with my new authoritative DNS servers. I was actually quite surprised as usually such short SLDs (second level domains), especially "foo", are all taken already.</span><br /> -<br /> -<span>As a funny bit, I almost chose "foo.surf" over "foo.zone" as in "surfing this site", but then decided against it as I would have to tell everyone that I am not into water sports so much. Well, on the other hand, I now may have to explain to non-programmers that I am not a fan of the rock band "Foo Fighters". But that will be acceptable, as I don't expect "normal" people visiting the foo zone as much anyway. If you reached as far, I have to congratulate you. You are not a normal person.</span><br /> -<br /> -<h2 style='display: inline' id='Whataboutmyoldhosts'>What about my old hosts</h2><br /> -<br /> -<span>The host buetow.org will stay. However, not as the primary address for this site. I will keep using it for my personal internet infrastructure as well as for most of my E-Mail addresses. I used buetow.org for that over the past 10 years already anyway and that won't change any time soon. I don't know what I am going to do with snonux.de in the long run. A .de SLD (for Germany) is pretty cheap, so I might just keep it for now. </span><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>Bash Golf Part 2</title> - <link href="gemini://foo.zone/gemfeed/2022-01-01-bash-golf-part-2.gmi" /> - <id>gemini://foo.zone/gemfeed/2022-01-01-bash-golf-part-2.gmi</id> - <updated>2022-01-01T23:36:15+00:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>This is the second blog post about my Bash Golf series. This series is random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='BashGolfPart2'>Bash Golf Part 2</h1><br /> -<br /> -<span class='quote'>Published at 2022-01-01T23:36:15+00:00; Updated at 2022-01-05</span><br /> -<br /> -<pre> - '\ '\ . . |>18>> - \ \ . ' . | - O>> O>> . 'o | - \ .\. .. . | - /\ . /\ . . | - / / . / / .' . | -jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Art by Joan Stark, mod. by Paul Buetow -</pre> -<br /> -<span>This is the second blog post about my Bash Golf series. This series is random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content.</span><br /> -<br /> -<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> -<a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2 (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-12-10-bash-golf-part-3.html'>2023-12-10 Bash Golf Part 3</a><br /> -<br /> -<h2 style='display: inline' id='Redirection'>Redirection</h2><br /> -<br /> -<span>Let's have a closer look at Bash redirection. As you might already know that there are 3 standard file descriptors:</span><br /> -<br /> -<ul> -<li>0 aka stdin (standard input)</li> -<li>1 aka stdout (standard output)</li> -<li>2 aka stderr (standard error output)</li> -</ul><br /> -<span>These are most certainly the ones you are using on regular basis. "/proc/self/fd" lists all file descriptors which are open by the current process (in this case: the current Bash shell itself):</span><br /> -<br /> -<pre> -❯ ls -l /proc/self/fd/ -total 0 -lrwx------. 1 paul paul 64 Nov 23 09:46 0 -> /dev/pts/9 -lrwx------. 1 paul paul 64 Nov 23 09:46 1 -> /dev/pts/9 -lrwx------. 1 paul paul 64 Nov 23 09:46 2 -> /dev/pts/9 -lr-x------. 1 paul paul 64 Nov 23 09:46 3 -> /proc/162912/fd -</pre> -<br /> -<span>The following examples demonstrate two different ways to accomplish the same thing. The difference is that the first command is directly printing out "Foo" to stdout and the second command is explicitly redirecting stdout to its own stdout file descriptor:</span><br /> -<br /> -<pre> -❯ echo Foo -Foo -❯ echo Foo > /proc/self/fd/0 -Foo -</pre> -<br /> -<span class='quote'>Update: A reader pointed out, that the redirection should actually go to <span class='inlinecode'>/proc/self/fd/1</span> and not <span class='inlinecode'>0</span>. But apparently, either way works for this particular example. Do you know why? </span><br /> -<br /> -<span>Other useful redirections are:</span><br /> -<br /> -<ul> -<li>Redirect stderr to stdin: "echo foo 2>&1"</li> -<li>Redirect stdin to stderr: "echo foo >&2"</li> -</ul><br /> -<span>It is, however, not possible to redirect multiple times within the same command. E.g. the following won't work. You would expect stdin to be redirected to stderr and then stderr to be redirected to /dev/null. But as the example shows, Foo is still printed out:</span><br /> -<br /> -<pre> -❯ echo Foo 1>&2 2>/dev/null -Foo -</pre> -<br /> -<span class='quote'>Update: A reader sent me an email and pointed out that the order of the redirections is important. </span><br /> -<br /> -<span>As you can see, the following will not print out anything:</span><br /> -<br /> -<pre> -❯ echo Foo 2>/dev/null 1>&2 -❯ -</pre> -<br /> -<span>A good description (also pointed out by the reader) can be found here:</span><br /> -<br /> -<a class='textlink' href='https://wiki.bash-hackers.org/howto/redirection_tutorial#order_of_redirection_ie_file_2_1_vs_2_1_file'>Order of redirection</a><br /> -<br /> -<span>Ok, back to the original blog post. You can also use grouping here (neither of these commands will print out anything to stdout):</span><br /> -<br /> -<pre> -❯ { echo Foo 1>&2; } 2>/dev/null -❯ ( echo Foo 1>&2; ) 2>/dev/null -❯ { { { echo Foo 1>&2; } 2>&1; } 1>&2; } 2>/dev/null -❯ ( ( ( echo Foo 1>&2; ) 2>&1; ) 1>&2; ) 2>/dev/null -❯ -</pre> -<br /> -<span>A handy way to list all open file descriptors is to use the "lsof" command (that's not a Bash built-in), whereas $$ is the process id (pid) of the current shell process:</span><br /> -<br /> -<pre> -❯ lsof -a -p $$ -d0,1,2 -COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME -bash 62676 paul 0u CHR 136,9 0t0 12 /dev/pts/9 -bash 62676 paul 1u CHR 136,9 0t0 12 /dev/pts/9 -bash 62676 paul 2u CHR 136,9 0t0 12 /dev/pts/9 -</pre> -<br /> -<span>Let's create our own descriptor "3" for redirection to a file named "foo":</span><br /> -<br /> -<pre> -❯ touch foo -❯ exec 3>foo # This opens fd 3 and binds it to file foo. -❯ ls -l /proc/self/fd/3 -l-wx------. 1 paul paul 64 Nov 23 10:10 \ - /proc/self/fd/3 -> /home/paul/foo -❯ cat foo -❯ echo Bratwurst >&3 -❯ cat foo -Bratwurst -❯ exec 3>&- # This closes fd 3. -❯ echo Steak >&3 --bash: 3: Bad file descriptor -</pre> -<br /> -<span>You can also override the default file descriptors, as the following example script demonstrates:</span><br /> -<br /> -<pre> -❯ cat grandmaster.sh -#!/usr/bin/env bash - -# Write a file data-file containing two lines -echo Learn You a Haskell > data-file -echo for Great Good >> data-file - -# Link fd with fd 6 (saves default stdin) -exec 6<&0 - -# Overwrite stdin with data-file -exec < data-file - -# Read the first two lines from it -declare LINE1 LINE2 -read LINE1 -read LINE2 - -# Print them -echo First line: $LINE1 -echo Second line: $LINE2 - -# Restore default stdin and delete fd 6 -exec 0<&6 6<&- -</pre> -<br /> -<span>Let's execute it:</span><br /> -<br /> -<pre> -❯ chmod 750 ./grandmaster.sh -❯ ./grandmaster.sh -First line: Learn You a Haskell -Second line: for Great Good -</pre> -<br /> -<h2 style='display: inline' id='HERE'>HERE</h2><br /> -<br /> -<span>I have mentioned HERE-documents and HERE-strings already in this post. Let's do some more examples. The following "cat" receives a multi line string from stdin. In this case, the input multi line string is a HERE-document. As you can see, it also interpolates variables (in this case the output of "date" running in a subshell).</span><br /> -<br /> -<pre> -❯ cat <<END -> Hello World -> It’s $(date) -> END -Hello World -It's Fri 26 Nov 08:46:52 GMT 2021 -</pre> -<br /> -<span>You can also write it the following way, but that's less readable (it's good for an obfuscation contest):</span><br /> -<br /> -<pre> -❯ <<END cat -> Hello Universe -> It’s $(date) -> END -Hello Universe -It's Fri 26 Nov 08:47:32 GMT 2021 -</pre> -<br /> -<span>Besides of an HERE-document, there is also a so-called HERE-string. Besides of...</span><br /> -<br /> -<pre> -❯ declare VAR=foo -❯ if echo "$VAR" | grep -q foo; then -> echo '$VAR ontains foo' -> fi -$VAR ontains foo -</pre> -<br /> -<span>...you can use a HERE-string like that:</span><br /> -<br /> -<pre> -❯ if grep -q foo <<< "$VAR"; then -> echo '$VAR contains foo' -> fi -$VAR contains foo -</pre> -<br /> -<span>Or even shorter, you can do:</span><br /> -<br /> -<pre> -❯ grep -q foo <<< "$VAR" && echo '$VAR contains foo' -$VAR contains foo -</pre> -<br /> -<span>You can also use a Bash regex to accomplish the same thing, but the points of the examples so far were to demonstrate HERE-{documents,strings} and not Bash regular expressions:</span><br /> -<br /> -<pre> -❯ if [[ "$VAR" =~ foo ]]; then echo yay; fi -yay -</pre> -<br /> -<span>You can also use it with "read":</span><br /> -<br /> -<pre> -❯ read a <<< ja -❯ echo $a -ja -❯ read b <<< 'NEIN!!!' -❯ echo $b -NEIN!!! -❯ dumdidumstring='Learn you a Golang for Great Good' -❯ read -a words <<< "$dumdidumstring" -❯ echo ${words[0]} -Learn -❯ echo ${words[3]} -Golang -</pre> -<br /> -<span>The following is good for an obfuscation contest too:</span><br /> -<br /> -<pre> -❯ echo 'I like Perl too' > perllove.txt -❯ cat - perllove.txt <<< "$dumdidumstring" -Learn you a Golang for Great Good -I like Perl too -</pre> -<br /> -<h2 style='display: inline' id='RANDOM'>RANDOM</h2><br /> -<br /> -<span>Random is a special built-in variable containing a different pseudo random number each time it's used.</span><br /> -<br /> -<pre> -❯ echo $RANDOM -11811 -❯ echo $RANDOM -14997 -❯ echo $RANDOM -9104 -</pre> -<br /> -<span>That's very useful if you want to randomly delay the execution of your scripts when you run it on many servers concurrently, just to spread the server load (which might be caused by the script run) better.</span><br /> -<br /> -<span>Let's say you want to introduce a random delay of 1 minute. You can accomplish it with:</span><br /> -<br /> -<pre> -❯ cat ./calc_answer_to_ultimate_question_in_life.sh -#!/usr/bin/env bash - -declare -i MAX_DELAY=60 - -random_delay () { - local -i sleep_for=$((RANDOM % MAX_DELAY)) - echo "Delaying script execution for $sleep_for seconds..." - sleep $sleep_for - echo 'Continuing script execution...' -} - -main () { - random_delay - # From here, do the real work. Calculating the answer to - # the ultimate question can take billions of years.... - : .... -} - -main - -❯ -❯ ./calc_answer_to_ultimate_question_in_life.sh -Delaying script execution for 42 seconds... -Continuing script execution... -</pre> -<br /> -<h2 style='display: inline' id='setxandseteandpipefile'>set -x and set -e and pipefile</h2><br /> -<br /> -<span>In my opinion, -x and -e and pipefile are the most useful Bash options. Let's have a look at them one after another.</span><br /> -<br /> -<h3 style='display: inline' id='x'>-x</h3><br /> -<br /> -<span>-x prints commands and their arguments as they are executed. This helps to develop and debug your Bash code:</span><br /> -<br /> -<pre> -❯ set -x -❯ square () { local -i num=$1; echo $((num*num)); } -❯ num=11; echo "Square of $num is $(square $num)" -+ num=11 -++ square 11 -++ local -i num=11 -++ echo 121 -+ echo 'Square of 11 is 121' -Square of 11 is 121 -</pre> -<br /> -<span>You can also set it when calling an external script without modifying the script itself:</span><br /> -<br /> -<pre> -❯ bash -x ./half_broken_script_to_be_debugged.sh -</pre> -<br /> -<span>Let's do that on one of the example scripts we covered earlier:</span><br /> -<br /> -<pre> -❯ bash -x ./grandmaster.sh -+ bash -x ./grandmaster.sh -+ echo Learn You a Haskell -+ echo for Great Good -+ exec -+ exec -+ declare LINE1 LINE2 -+ read LINE1 -+ read LINE2 -+ echo First line: Learn You a Haskell -First line: Learn You a Haskell -+ echo Second line: for Great Good -Second line: for Great Good -+ exec -❯ -</pre> -<br /> -<h3 style='display: inline' id='e'>-e</h3><br /> -<br /> -<span>This is a very important option you want to use when you are paranoid. This means, you should always "set -e" in your scripts when you need to make absolutely sure that your script runs successfully (with that I mean that no command should exit with an unexpected status code).</span><br /> -<br /> -<span>Ok, let's dig deeper:</span><br /> -<br /> -<pre> -❯ help set | grep -- -e - -e Exit immediately if a command exits with a non-zero status. -</pre> -<br /> -<span>As you can see in the following example, the Bash terminates after the execution of "grep" as "foo" is not matching "bar". Therefore, grep exits with 1 (unsuccessfully) and the shell aborts. And therefore, "bar" will not be printed out anymore:</span><br /> -<br /> -<pre> -❯ bash -c 'set -e; echo hello; grep -q bar <<< foo; echo bar' -hello -❯ echo $? -1 -</pre> -<br /> -<span>Whereas the outcome changes when the regex matches:</span><br /> -<br /> -<pre> -❯ bash -c 'set -e; echo hello; grep -q bar <<< barman; echo bar' -hello -bar -❯ echo $? -0 -</pre> -<br /> -<span>So does it mean that grep will always make the shell terminate whenever its exit code isn't 0? This will render "set -e" quite unusable. Frankly, there are other commands where an exit status other than 0 should not terminate the whole script abruptly. Usually, what you want is to branch your code based on the outcome (exit code) of a command:</span><br /> -<br /> -<pre> -❯ bash -c 'set -e -> grep -q bar <<< foo -> if [ $? -eq 0 ]; then -> echo "matching" -> else -> echo "not matching" -> fi' -❯ echo $? -1 -</pre> -<br /> -<span>...but the example above won't reach any of the branches and won't print out anything, as the script terminates right after grep.</span><br /> -<br /> -<span>The proper solution is to use grep as an expression in a conditional (e.g. in an if-else statement):</span><br /> -<br /> -<pre> -❯ bash -c 'set -e -> if grep -q bar <<< foo; then -> echo "matching" -> else -> echo "not matching" -> fi' -not matching -❯ echo $? -0 -❯ bash -c 'set -e -> if grep -q bar <<< barman; then -> echo "matching" -> else -> echo "not matching" -> fi' -matching -❯ echo $? -0 -</pre> -<br /> -<span>You can also temporally undo "set -e" if there is no other way:</span><br /> -<br /> -<pre> -❯ cat ./e.sh -#!/usr/bin/env bash - -set -e - -foo () { - local arg="$1"; shift - - if [ -z "$arg" ]; then - arg='You!' - fi - echo "Hello $arg" -} - -bar () { - # Temporally disable e - set +e - local arg="$1"; shift - # Enable e again. - set -e - - if [ -z "$arg" ]; then - arg='You!' - fi - echo "Hello $arg" -} - -# Will succeed -bar World -foo Universe -bar - -# Will terminate the script -foo - -❯ ./e.sh -Hello World -Hello Universe -Hello You! -</pre> -<br /> -<span>Why does calling "foo" with no arguments make the script terminate? Because as no argument was given, the "shift" won't have anything to do as the argument list $@ is empty, and therefore "shift" fails with a non-zero status.</span><br /> -<br /> -<span>Why would you want to use "shift" after function-local variable assignments? Have a look at my personal Bash coding style guide for an explanation :-):</span><br /> -<br /> -<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>./2021-05-16-personal-bash-coding-style-guide.html</a><br /> -<br /> -<h3 style='display: inline' id='pipefail'>pipefail</h3><br /> -<br /> -<span>The pipefail option makes it so that not only the exit code of the last command of the pipe counts regards its exit code but any command of the pipe:</span><br /> -<br /> -<pre> -❯ help set | grep pipefail -A 2 - pipefail the return value of a pipeline is the status of - the last command to exit with a non-zero status, - or zero if no command exited with a non-zero status -</pre> -<br /> -<span>The following greps for paul in passwd and converts all lowercase letters to uppercase letters. The exit code of the pipe is 0, as the last command of the pipe (converting from lowercase to uppercase) succeeded:</span><br /> -<br /> -<pre> -❯ grep paul /etc/passwd | tr '[a-z]' '[A-Z]' -PAUL:X:1000:1000:PAUL BUETOW:/HOME/PAUL:/BIN/BASH -❯ echo $? -0 -</pre> -<br /> -<span>Let's look at another example, where "TheRock" doesn't exist in the passwd file. However, the pipes exit status is still 0 (success). This is so because the last command ("tr" in this case) still succeeded. It is just that it didn't get any input on stdin to process:</span><br /> -<br /> -<pre> -❯ grep TheRock /etc/passwd -❯ echo $? -1 -❯ grep TheRock /etc/passwd | tr '[a-z]' '[A-Z]' -❯ echo $? -0 -</pre> -<br /> -<span>To change this behaviour, pipefile can be used. Now, the pipes exit status is 1 (fail), because the pipe contains at least one command (in this case grep) which exited with status 1:</span><br /> -<br /> -<pre> -❯ set -o pipefail -❯ grep TheRock /etc/passwd | tr '[a-z]' '[A-Z]' -❯ echo $? -1 -</pre> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<span>Other related posts are:</span><br /> -<br /> -<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>2021-05-16 Personal Bash coding style guide</a><br /> -<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> -<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> -<a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2 (You are currently reading this)</a><br /> -<a class='textlink' href='./2023-12-10-bash-golf-part-3.html'>2023-12-10 Bash Golf Part 3</a><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>How to stay sane as a DevOps person </title> - <link href="gemini://foo.zone/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.gmi" /> - <id>gemini://foo.zone/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.gmi</id> - <updated>2021-12-26T12:02:02+00:00</updated> - <author> - <name>Paul Buetow aka snonux</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>Log4shell (CVE-2021-44228) made it clear, once again, that working in information technology is not an easy job (especially when you are a DevOps person). I thought it would be interesting to summarize a few techniques to help you to relax.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline' id='HowtostaysaneasaDevOpsperson'>How to stay sane as a DevOps person </h1><br /> -<br /> -<span class='quote'>Published at 2021-12-26T12:02:02+00:00; Updated at 2022-01-12</span><br /> -<br /> -<pre> - ) - ) (( ( - ( )) ) - ) ) // ( - _ ( __ ( ~->> - ,-----' |__,_~~___<'__`)-~__--__-~->> < - | // : | -__ ~__ o)____)),__ - '> >- > - | // : |- \_ \ -\_\ -\ \ \ ~\_ \ ->> - , >> - | // : |_~_\ -\__\ \~'\ \ \, \__ . -<- >> - `-----._| ` -__`-- - ~~ -- ` --~> > - _/___\_ //)_`// | ||] - _____[_______]_[~~-_ (.L_/ || - [____________________]' `\_,/'/ - ||| / ||| ,___,'./ - ||| \ |||,'______| - ||| / /|| I==|| - ||| \ __/_|| __||__ ------||-/------`-._/||-o--o---o--- - ~~~~~' -</pre> -<br /> -<span>Log4shell (CVE-2021-44228) made it clear, once again, that working in information technology is not an easy job (especially when you are a DevOps person). I thought it would be interesting to summarize a few techniques to help you to relax.</span><br /> -<br /> -<span>(PS: When I mean DevOps, I also mean Site Reliability Engineers and Sysadmins. I believe SRE, DevOps Engineer and Sysadmin are just synonym titles for the same job).</span><br /> -<br /> -<a class='textlink' href='https://en.wikipedia.org/wiki/Log4Shell'>https://en.wikipedia.org/wiki/Log4Shell</a><br /> -<br /> -<h2 style='display: inline' id='Setclearexpectations'>Set clear expectations</h2><br /> -<br /> -<span>It's important to set clear expectations. It can be difficult to guess what others expect or don't expect from you. If you know exactly what you are supposed to do, you can work towards a specific goal and don't worry about all the other noise so much.</span><br /> -<br /> -<span>However, if you are in a more senior position, it is expected from you to plan your tasks by yourself to a large degree and also be flexible, so you can react quickly to new situations (e.g. resolving incidents). Also, to a large degree, you have to prioritise your work by yourself. This can overthrow all of your plans. In extreme cases, it can help to share your plans with your team so that everyone is on the same page. Afterwards, be the execution machine. People are happy when they see that stuff gets done. Communicate clearly all critical work you do. This will capture all the technical debt there might be. It does not help in the long run if things are fixed in the background without any visibility. </span><br /> -<br /> -<span>Due to politeness, many people are not setting clear expectations. I personally may sound sometimes "too German" when setting expectations, but so far nobody complained, and I have even received positive feedback about it.</span><br /> -<br /> -<h2 style='display: inline' id='Alwaysrespondtorequestsbutsetexpectationsandboundaries'>Always respond to requests but set expectations and boundaries</h2><br /> -<br /> -<span>There are many temptations to get side-tracked by other projects and/or issues. It is important to set boundaries here. But always answer to all requests as nothing is more frustrating than asking a person and never getting any answer back. This is especially the case when everyone is working form home where people are using tools such as Slack and E-Mail for most of their communications.</span><br /> -<br /> -<h3 style='display: inline' id='Dealingwithrequests'>Dealing with requests</h3><br /> -<br /> -<span>If the request is urgent, and you have the capacity to help, probably you should help. If it's not urgent, maybe ask to pospone the request (e.g. ask to create a ticket, so that someone from your team can work on it later).</span><br /> -<br /> -<span>If the request is urgent, but you don't have the knowledge or the capacity to help, try to defer to a colleague who might be able to help. You could also provide some quick tips and hints, so that the requester can resolve the issue by himself. Make it transparent why you might not have the time right now, as this can help the person to review his own priorities or to escalate. </span><br /> -<br /> -<h3 style='display: inline' id='Escalationisonlyatool'>Escalation is only a tool</h3><br /> -<br /> -<span>Never make or take an escalation personally. The only forms of escalation should be due to technical issues or lack of resources. An escalation then becomes like a math equation and does not need human resources involved. So de-facto, an escalation is nothing negative, but just a process people can follow to form decision-making. In a good company escalations tend to be an exception, though. Staff knows how to deal with the things by themselves without bothering management too much. </span><br /> -<br /> -<h2 style='display: inline' id='Thinkpositively'>Think positively</h2><br /> -<br /> -<span>If times are very stressful, think that it could always be worse:</span><br /> -<br /> -<ul> -<li>Nobody is dying, we are only doing some IT stuff.</li> -<li>Your time after work is your own time, look forward to time with your family or a nice dinner or your favourite sports class.</li> -<li>You probably will never run out of work in the IT sector. So you will always be able to make a living.</li> -<li>Your IT job and life is actually pretty good (compared to a homeless person for example). You are probably part of the world's top 1% regarding life standard.</li> -</ul><br /> -<h2 style='display: inline' id='Goslowerevenifyoucouldgofaster'>Go slower even if you could go faster</h2><br /> -<br /> -<span>When working in a team, you may feel that you could get done things faster when you just did everything by yourself. This can be a bit frustrating at times, as you might need to work late hours and also might need to explain things over and over again to others. Also, you could be the one who needs to get things explained over and over again as you are not so familiar with the topic (yet). You will appreciate it if the other person is slowing down for you a bit.</span><br /> -<br /> -<h3 style='display: inline' id='Youworkinateam'>You work in a team</h3><br /> -<br /> -<span>Security is a team sport. So slow down and make sure that everyone is on track with the goals. You can go full-speed with your very own subtasks, though. Not everyone knows how to use all the tools so well like a full-time DevOps person. As a DevOps person, you are not a security expert, though. Security experts are different people in your company, but DevOps will be the main tribe deploying mitigations (following the security recommendations) and management will be the main tribe coordinating all the efforts. </span><br /> -<br /> -<span>So even if you think that you can do everything faster by your own, can you really? You probably don't know what you don't know about IT security. The more you know about it, the more you know about what you don't know.</span><br /> -<br /> -<h3 style='display: inline' id='Dontrush'>Don't rush</h3><br /> -<br /> -<span>Slowing down also helps to prevent errors. Don't rush your tasks, even if they are urgent. Try to be quick, but don't rush them. Maybe you are writing a script to mitigate a production issue. You could others peer review that script, for example. Their primary programming language may not be the same (e.g. Golang vs Perl), but they would understand the logic. Or ask another DevOps person from your company with good scripting skills review your mitigation, but he then may lack the domain knowledge of the software you are patching. So in either case, the review will take a bit longer as the reviewer might not be an expert in everything.</span><br /> -<br /> -<span>So relax, don't always expect immediate results. Set clear and reasonable timelines for the management about the mitigations. You are not a superhero who has to do everything by yourself. Sometimes, you will miss a deadline. But that will have good reasons. Don't rush to complete just to meet a deadline. </span><br /> -<br /> -<a class='textlink' href='./2021-10-22-defensive-devops.html'>Read also "Defensive DevOps" about deploying mitigation scripts.</a><br /> -<br /> -<h2 style='display: inline' id='Youarenotasuperhero'>You are not a superhero</h2><br /> -<br /> -<span>Always keep that in mind. You can't solve all problems by your own. Maybe you could, but that would be a lot of additional stress (and this will reflect to your personal life). Also, Superman and Wonder Woman receive much higher salaries than you will ever do ;-).</span><br /> -<br /> -<span>I have been a superhero multiple times mitigating critical incidents, and I was proud about it in those moments. But actually, I am not proud looking at those retrospectively as for everything there should be other people around who should be able to resolve an incident. No company should rely on a single person, there must always be a substitute. You are not a superhero and as harsh as it sounds, everyone is replaceable. Every superhero can be replaced with another superhero. The only thing it takes to become a superhero is time to get to know the infrastructure and tools very well, paired with work dedication.</span><br /> -<br /> -<span>This doesn't mean, that you shouldn't try your best. But you don't need to try to be the superhero. Maybe someone else will be the superhero, but that's OK as long as it's not always the same person every time. Everyone can have a good day after all. If I could choose between being a superhero or having a good night sleep, I would probably prefer the sleep. </span><br /> -<br /> -<h3 style='display: inline' id='Giveawaysomeofyoursuperpowers'>Give away some of your superpowers</h3><br /> -<br /> -<span>If you are a superhero, try to give away some of your superpowers, so that you can relax in the evening knowing that others (e.g. the current on-call engineers) know how to tackle things. Every member of the team needs to do DevOps (even the team managers, in my humble opinion). Some may be less experienced than others or have other expertises, but to counteract this you could document the recurring tasks so that they are easy to follow (which then later could be either automated away or, even better, fully fixed).</span><br /> -<br /> -<span>On the other side, if you are a DevOps person, try to sneak into other people's shoes too. For example, you might not be an expert in Java programming, but a lot of the infrastructure is programmed in Java. This is where usually the Software Developers and Engineers shine. But if you know how to read, debug and even extend Java code too (by learning from the Software Developer superheroes), then your will only benefit from it. </span><br /> -<br /> -<span>So you are not a superhero. Or, if you are a superhero, then all colleagues should be superheroes too.</span><br /> -<br /> -<h2 style='display: inline' id='Dontjumponallproblemsimmediately'>Don't jump on all problems immediately</h2><br /> -<br /> -<span>In a perfect world, every member of a team comes along with the same strengths and skills. But in reality, everyone is different. </span><br /> -<br /> -<span>In order to distribute the troubleshooting skills across the team, you should not jump on every problem immediately. Leave some space for others to resolve the issue. This is where the best learning happens. Nobody will learn from you when you solve all problems. People might learn something after you explained what you did, but the takeaways will be minimal compared to when people try to resolve issues by themselves. Always be available for questions which will help your colleagues to steer into the right direction and if you think it helps, give them some tips resolving the issue, even if they didn't ask for it. Sometimes, engineers are too proud to ask. </span><br /> -<br /> -<span>The whole paragraph changes when there is an issue you don't know how to resolve. Jump on it, so you can learn from it. But also ask for advice if you are unsure about it.</span><br /> -<br /> -<span>If the issue is a very critical one, then you might better off trying to resolve it as fast as possible with your full powers in order to avoid any major damage to the company. This, of course, only works if you know how to resolve it quickly. So, don't leave others with not much experience yet looking at it. If possible, work with the team to resolve the issue. Unfortunately, solving it with the team is not always the fastest way. So in this particular circumstance, the company may be better off being saved by a single superhero. Make sure that the problem will not occur again or, at least, that others can fix it the next time without Superman flying by.</span><br /> -<br /> -<h2 style='display: inline' id='Forcebreaksandshutdownnow'>Force breaks; and shutdown now</h2><br /> -<br /> -<span>Be strict about your time off. Nowadays, tech workers check their messages also out of office hours and are reachable 24/7. This really should only be the case when you are on-call, to be honest (or if you work for a startup). All other out-of-office time is owned by you and not your employer. You have signed an 40 hour/week and not 7 days/week contract. Of course, there will be always some sort of flexibility and exceptions. You might need to work over the weekend to get a migration done or a problem solved. But to balance it out, you should have other days off as substitutes.</span><br /> -<br /> -<span>It's important to shut down your brain from work during your breaks (be strict with your breaks, leave your desk for lunch or for a walk early afternoon and if you aren't on-call also don't take your work-phone with you). You will be happier and also much more energized and productive in the afternoon. Also, when you are reachable 24/7, your colleagues will start thinking that you don't have anything more important to do than work.</span><br /> -<br /> -<h2 style='display: inline' id='Blocktimeeverydayforpersonaladvance'>Block time every day for personal advance</h2><br /> -<br /> -<span>It does not matter how many tasks are in your backlog or how many issues are to be tackled. *Always* find time for personal advance. The most issues aren't critical anyway and can wait a bit. At the end of the day, you will have a nice feeling that you have accomplished something meaningful. This can be an interesting project or learning a new technology you are interested in. Of course, there must be consensus with your manager (unless you do that kind of thing in your personal time of course). </span><br /> -<br /> -<span>If you are too busy at work and just can't block time, then maybe it's time to think about alternatives. But before you do that, probably there is something else you can do. Perhaps you just think you can't block time, but you would be positively surprised to hear from your manager that he will fully support you. Of course, he won't agree to you working full-time on your pet projects. But a certain portion of your time should be allocated for personal advance. After all, your employer also want's you to stay happy so that you don't look for alternatives. It's of everyone's interest that you like your job and stay motivated. The more you are motivated, the more productive you are. The more productive you are, the more valuable you are for the company.</span><br /> -<br /> -<h2 style='display: inline' id='More'>More</h2><br /> -<br /> -<span>Another blog post worth reading:</span><br /> -<br /> -<a class='textlink' href='https://unixsheikh.com/articles/how-to-stay-sane-in-todays-world-of-tech.html'>https://unixsheikh.com/articles/how-to-stay-sane-in-todays-world-of-tech.html</a><br /> -<br /> -<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> </feed> |
