diff options
| author | Paul Buetow <paul@buetow.org> | 2023-04-08 12:32:25 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2023-04-08 12:32:25 +0300 |
| commit | 89f83d49ad7d4cd8baa815993d3172ca72e5b30e (patch) | |
| tree | f91acfa483e4ef3a0632af7f0f91d8b45cc9d76d /gemfeed | |
| parent | d0098c5faf74b0b3291395114b99bc5c309718b3 (diff) | |
Update content for html
Diffstat (limited to 'gemfeed')
44 files changed, 2019 insertions, 1247 deletions
diff --git a/gemfeed/2008-06-26-perl-poetry.html b/gemfeed/2008-06-26-perl-poetry.html index 635d0ac0..0482b638 100644 --- a/gemfeed/2008-06-26-perl-poetry.html +++ b/gemfeed/2008-06-26-perl-poetry.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Perl Poetry</h1><br /> <br /> -<span class=quote>Published at 2008-06-26T21:43:51+01:00; Updated at 2021-05-04</span><br /> +<span class='quote'>Published at 2008-06-26T21:43:51+01:00; Updated at 2021-05-04</span><br /> <br /> <pre> '\|/' * @@ -39,7 +39,7 @@ _~~|~/_|_|__/|~~~~~~~ | / ~~~~~ | | ~~~~~~~~ <br /> <span>Wikipedia: "Perl poetry is the practice of writing poems that can be compiled as legal Perl code, for example the piece known as Black Perl. Perl poetry is made possible by the large number of English words that are used in the Perl language. New poems are regularly submitted to the community at PerlMonks."</span><br /> <br /> -<a class=textlink href='https://en.wikipedia.org/wiki/Perl'>https://en.wikipedia.org/wiki/Perl</a><br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/Perl'>https://en.wikipedia.org/wiki/Perl</a><br /> <br /> <h2 style='display: inline'>math.pl</h2><br /> <br /> @@ -169,17 +169,17 @@ This is perl, v5.8.8 built for i386-freebsd-64int <br /> <span>Did you like what you saw? Have a look at Codeberg to see my other poems too:</span><br /> <br /> -<a class=textlink href='https://codeberg.org/snonux/perl-poetry'>https://codeberg.org/snonux/perl-poetry</a><br /> +<a class='textlink' href='https://codeberg.org/snonux/perl-poetry'>https://codeberg.org/snonux/perl-poetry</a><br /> <br /> <span>Other related posts are:</span><br /> <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 (You are currently reading this)</a><br /> +<a class='textlink' href='./2022-05-27-perl-is-still-a-great-choice.html'>2022-05-27 Perl is still a great choice</a><br /> +<a class='textlink' href='./2011-05-07-perl-daemon-service-framework.html'>2011-05-07 Perl Daemon (Service Framework)</a><br /> +<a class='textlink' href='./2008-06-26-perl-poetry.html'>2008-06-26 Perl Poetry (You are currently reading this)</a><br /> <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2008-12-29-using-my-nokia-n95-for-fixing-my-mta.html b/gemfeed/2008-12-29-using-my-nokia-n95-for-fixing-my-mta.html index a993fc98..b49efb8c 100644 --- a/gemfeed/2008-12-29-using-my-nokia-n95-for-fixing-my-mta.html +++ b/gemfeed/2008-12-29-using-my-nokia-n95-for-fixing-my-mta.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Using my Nokia N95 for fixing my MTA</h1><br /> <br /> -<span class=quote>Published at 2008-12-29T09:10:41+00:00; Updated at 2021-12-01</span><br /> +<span class='quote'>Published at 2008-12-29T09:10:41+00:00; Updated at 2021-12-01</span><br /> <br /> <pre> @@ -49,7 +49,7 @@ _jgs_\|//_\\|///_\V/_\|//__ <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2010-04-09-standard-ml-and-haskell.html b/gemfeed/2010-04-09-standard-ml-and-haskell.html index dcad4602..fc08fd33 100644 --- a/gemfeed/2010-04-09-standard-ml-and-haskell.html +++ b/gemfeed/2010-04-09-standard-ml-and-haskell.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Standard ML and Haskell</h1><br /> <br /> -<span class=quote>Published at 2010-04-09T22:57:36+01:00</span><br /> +<span class='quote'>Published at 2010-04-09T22:57:36+01:00</span><br /> <br /> <span>I am currently looking into the functional programming language Standard ML (aka SML). The purpose is to refresh my functional programming skills and to learn something new too. Since I already knew a little Haskell, I could not help myself, and I also implemented the same exercises in Haskell.</span><br /> <br /> @@ -181,7 +181,7 @@ my_filter f l = foldr (make_filter_fn f) [] l <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.html b/gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.html index 0d56577d..bfb83d94 100644 --- a/gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.html +++ b/gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Lazy Evaluation with Standard ML</h1><br /> <br /> -<span class=quote>Published at 2010-05-07T08:17:59+01:00</span><br /> +<span class='quote'>Published at 2010-05-07T08:17:59+01:00</span><br /> <br /> <pre> @@ -27,8 +27,8 @@ <br /> <span>In contrast to Haskell, Standard SML does not use lazy evaluation by default but an eager evaluation. </span><br /> <br /> -<a class=textlink href='https://en.wikipedia.org/wiki/Eager_evaluation'>https://en.wikipedia.org/wiki/Eager_evaluation</a><br /> -<a class=textlink href='https://en.wikipedia.org/wiki/Lazy_evaluation'>https://en.wikipedia.org/wiki/Lazy_evaluation</a><br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/Eager_evaluation'>https://en.wikipedia.org/wiki/Eager_evaluation</a><br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/Lazy_evaluation'>https://en.wikipedia.org/wiki/Lazy_evaluation</a><br /> <br /> <br /> <span>You can solve specific problems with lazy evaluation easier than with eager evaluation. For example, you might want to list the number Pi or another infinite list of something. With the help of lazy evaluation, each element of the list is calculated when it is accessed first, but not earlier.</span><br /> @@ -77,7 +77,7 @@ val test = first 10 (nat_pairs_not_null ()); *) </pre> <br /> -<a class=textlink href='http://smlnj.org/'>http://smlnj.org/</a><br /> +<a class='textlink' href='http://smlnj.org/'>http://smlnj.org/</a><br /> <br /> <h2 style='display: inline'>Real laziness with Haskell </h2><br /> <br /> @@ -105,11 +105,11 @@ first 10 nat_pairs_not_null -} </pre> <br /> -<a class=textlink href='http://www.haskell.org/'>http://www.haskell.org/</a><br /> +<a class='textlink' href='http://www.haskell.org/'>http://www.haskell.org/</a><br /> <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2010-05-09-the-fype-programming-language.html b/gemfeed/2010-05-09-the-fype-programming-language.html index eba53a7e..061c1673 100644 --- a/gemfeed/2010-05-09-the-fype-programming-language.html +++ b/gemfeed/2010-05-09-the-fype-programming-language.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>The Fype Programming Language</h1><br /> <br /> -<span class=quote>Published at 2010-05-09T12:48:29+01:00; Updated at 2021-05-05</span><br /> +<span class='quote'>Published at 2010-05-09T12:48:29+01:00; Updated at 2021-05-05</span><br /> <br /> <pre> ____ _ __ @@ -514,11 +514,11 @@ BB <br /> <span>You can find all of this on the GitHub page. There is also an "examples" folders containing some Fype scripts!</span><br /> <br /> -<a class=textlink href='https://codeberg.org/snonux/fype'>https://codeberg.org/snonux/fype</a><br /> +<a class='textlink' href='https://codeberg.org/snonux/fype'>https://codeberg.org/snonux/fype</a><br /> <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2011-05-07-perl-daemon-service-framework.html b/gemfeed/2011-05-07-perl-daemon-service-framework.html index c7f53f11..cf27a47d 100644 --- a/gemfeed/2011-05-07-perl-daemon-service-framework.html +++ b/gemfeed/2011-05-07-perl-daemon-service-framework.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Perl Daemon (Service Framework)</h1><br /> <br /> -<span class=quote>Published at 2011-05-07T22:26:02+01:00; Updated at 2021-05-07</span><br /> +<span class='quote'>Published at 2011-05-07T22:26:02+01:00; Updated at 2021-05-07</span><br /> <br /> <pre> a'! _,,_ a'! _,,_ a'! _,,_ @@ -107,7 +107,7 @@ $ ./control keys daemon.loopinterval=10 > new.conf; mv new.conf conf/perldaem <br /> <h2 style='display: inline'>HiRes event loop</h2><br /> <br /> -<span>PerlDaemon uses <span class=inlinecode>Time::HiRes</span> to make sure that all the events run incorrect intervals. For each loop run, a time carry value is recorded and added to the next loop run to catch up on lost time.</span><br /> +<span>PerlDaemon uses <span class='inlinecode'>Time::HiRes</span> to make sure that all the events run incorrect intervals. For each loop run, a time carry value is recorded and added to the next loop run to catch up on lost time.</span><br /> <br /> <h2 style='display: inline'>Writing your own modules</h2><br /> <br /> @@ -159,7 +159,7 @@ sub do ($) { ./bin/perldaemon restart (or shortcurt ./control restart) </pre> <br /> -<span>Now watch <span class=inlinecode>./log/perldaemon.log</span> closely. It is a good practice to test your modules in 'foreground mode' (see above how to do that).</span><br /> +<span>Now watch <span class='inlinecode'>./log/perldaemon.log</span> closely. It is a good practice to test your modules in 'foreground mode' (see above how to do that).</span><br /> <br /> <span>BTW: You can install as many modules within the same instance as desired. But they are run in sequential order (in future, they can also run in parallel using several threads or processes).</span><br /> <br /> @@ -167,17 +167,17 @@ sub do ($) { <br /> <span>You can find PerlDaemon (including the examples) at:</span><br /> <br /> -<a class=textlink href='https://codeberg.org/snonux/perldaemon'>https://codeberg.org/snonux/perldaemon</a><br /> +<a class='textlink' href='https://codeberg.org/snonux/perldaemon'>https://codeberg.org/snonux/perldaemon</a><br /> <br /> <span>Other related posts are:</span><br /> <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) (You are currently reading this)</a><br /> -<a class=textlink href='./2008-06-26-perl-poetry.html'>2008-06-26 Perl Poetry</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) (You are currently reading this)</a><br /> +<a class='textlink' href='./2008-06-26-perl-poetry.html'>2008-06-26 Perl Poetry</a><br /> <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2014-03-24-the-fibonacci.pl.c-polyglot.html b/gemfeed/2014-03-24-the-fibonacci.pl.c-polyglot.html index ab51d6bc..fdc7a3f7 100644 --- a/gemfeed/2014-03-24-the-fibonacci.pl.c-polyglot.html +++ b/gemfeed/2014-03-24-the-fibonacci.pl.c-polyglot.html @@ -10,11 +10,11 @@ <body> <h1 style='display: inline'>The fibonacci.pl.raku.c Polyglot</h1><br /> <br /> -<span class=quote>Published at 2014-03-24T21:32:53+00:00; Updated at 2022-04-23</span><br /> +<span class='quote'>Published at 2014-03-24T21:32:53+00:00; Updated at 2022-04-23</span><br /> <br /> <span>In computing, a polyglot is a computer program or script written in a valid form of multiple programming languages, which performs the same operations or output independent of the programming language used to compile or interpret it.</span><br /> <br /> -<a class=textlink href='https://en.wikipedia.org/wiki/Polyglot_(computing)'>https://en.wikipedia.org/wiki/Polyglot_(computing)</a><br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/Polyglot_(computing)'>https://en.wikipedia.org/wiki/Polyglot_(computing)</a><br /> <br /> <h2 style='display: inline'>The Fibonacci numbers</h2><br /> <br /> @@ -66,7 +66,7 @@ BEGIN { <br /> <span>You can find the full source code at GitHub:</span><br /> <br /> -<a class=textlink href='https://codeberg.org/snonux/perl-c-fibonacci'>https://codeberg.org/snonux/perl-c-fibonacci</a><br /> +<a class='textlink' href='https://codeberg.org/snonux/perl-c-fibonacci'>https://codeberg.org/snonux/perl-c-fibonacci</a><br /> <br /> <h3 style='display: inline'>Let's run it with C and C++</h3><br /> <br /> @@ -150,7 +150,7 @@ fib(10) = 55 <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.html b/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.html index 38236701..d4e04923 100644 --- a/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.html +++ b/gemfeed/2015-12-05-run-debian-on-your-phone-with-debroid.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Run Debian on your phone with Debroid</h1><br /> <br /> -<span class=quote>Published at 2015-12-05T16:12:57+00:00; Updated at 2021-05-16</span><br /> +<span class='quote'>Published at 2015-12-05T16:12:57+00:00; Updated at 2021-05-16</span><br /> <br /> <pre> ____ _ _ _ @@ -33,7 +33,7 @@ <br /> <span>All scripts mentioned here can be found on GitHub at:</span><br /> <br /> -<a class=textlink href='https://codeberg.org/snonux/debroid'>https://codeberg.org/snonux/debroid</a><br /> +<a class='textlink' href='https://codeberg.org/snonux/debroid'>https://codeberg.org/snonux/debroid</a><br /> <br /> <h3 style='display: inline'>First debootstrap stage</h3><br /> <br /> @@ -187,7 +187,7 @@ exit <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2016-04-03-offsite-backup-with-zfs.html b/gemfeed/2016-04-03-offsite-backup-with-zfs.html index d703ad1c..3a1b2de0 100644 --- a/gemfeed/2016-04-03-offsite-backup-with-zfs.html +++ b/gemfeed/2016-04-03-offsite-backup-with-zfs.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Offsite backup with ZFS</h1><br /> <br /> -<span class=quote>Published at 2016-04-03T22:43:42+01:00</span><br /> +<span class='quote'>Published at 2016-04-03T22:43:42+01:00</span><br /> <br /> <pre> ________________ @@ -25,8 +25,8 @@ \____||__|_____|__| </pre> <br /> -<a class=textlink href='./2016-04-03-offsite-backup-with-zfs.html'>Offsite backup with ZFS Part 1 (you are reading this atm.)</a><br /> -<a class=textlink href='./2016-04-16-offsite-backup-with-zfs-part2.html'>Offsite backup with ZFS Part 2</a><br /> +<a class='textlink' href='./2016-04-03-offsite-backup-with-zfs.html'>Offsite backup with ZFS Part 1 (you are reading this atm.)</a><br /> +<a class='textlink' href='./2016-04-16-offsite-backup-with-zfs-part2.html'>Offsite backup with ZFS Part 2</a><br /> <br /> <h2 style='display: inline'>Please don't lose all my pictures again!</h2><br /> <br /> @@ -52,7 +52,7 @@ <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html b/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html index 74d12fd7..09d93565 100644 --- a/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html +++ b/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Jails and ZFS with Puppet on FreeBSD</h1><br /> <br /> -<span class=quote>Published at 2016-04-09T18:29:47+01:00</span><br /> +<span class='quote'>Published at 2016-04-09T18:29:47+01:00</span><br /> <br /> <pre> __ __ @@ -399,7 +399,7 @@ Notice: Finished catalog run in 206.09 seconds <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2016-04-16-offsite-backup-with-zfs-part2.html b/gemfeed/2016-04-16-offsite-backup-with-zfs-part2.html index 11e4d845..c1f799fb 100644 --- a/gemfeed/2016-04-16-offsite-backup-with-zfs-part2.html +++ b/gemfeed/2016-04-16-offsite-backup-with-zfs-part2.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Offsite backup with ZFS (Part 2)</h1><br /> <br /> -<span class=quote>Published at 2016-04-16T22:43:42+01:00</span><br /> +<span class='quote'>Published at 2016-04-16T22:43:42+01:00</span><br /> <br /> <pre> ________________ @@ -27,8 +27,8 @@ \____||__|_____|__| </pre> <br /> -<a class=textlink href='./2016-04-03-offsite-backup-with-zfs.html'>Offsite backup with ZFS Part 1</a><br /> -<a class=textlink href='./2016-04-16-offsite-backup-with-zfs-part2.html'>Offsite backup with ZFS Part 2 (you are reading this atm.)</a><br /> +<a class='textlink' href='./2016-04-03-offsite-backup-with-zfs.html'>Offsite backup with ZFS Part 1</a><br /> +<a class='textlink' href='./2016-04-16-offsite-backup-with-zfs-part2.html'>Offsite backup with ZFS Part 2 (you are reading this atm.)</a><br /> <br /> <span>I enhanced the procedure a bit. From now on, I have two external 2TB USB hard drives. Both are set up precisely the same way. To decrease the probability that both drives will not fail simultaneously, they are of different brands. One drive is kept at a secret location. The other one is held at home, right next to my HP MicroServer.</span><br /> <br /> @@ -38,7 +38,7 @@ <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.html b/gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.html index cd451e53..946df597 100644 --- a/gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.html +++ b/gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.html @@ -10,13 +10,13 @@ <body> <h1 style='display: inline'>Spinning up my own authoritative DNS servers</h1><br /> <br /> -<span class=quote>Published at 2016-05-22T18:59:01+01:00</span><br /> +<span class='quote'>Published at 2016-05-22T18:59:01+01:00</span><br /> <br /> <h2 style='display: inline'>Background</h2><br /> <br /> <span>Finally, I had time to deploy my authoritative DNS servers (master and slave) for my domains "buetow.org" and "buetow.zone". My domain name provider is Schlund Technologies. They allow their customers to edit the DNS records (BIND files) manually. And they also allow you to set your authoritative DNS servers for your domains. From now, I am making use of that option.</span><br /> <br /> -<a class=textlink href='http://www.schlundtech.de'>Schlund Technologies</a><br /> +<a class='textlink' href='http://www.schlundtech.de'>Schlund Technologies</a><br /> <br /> <h2 style='display: inline'>All FreeBSD Jails</h2><br /> <br /> @@ -247,7 +247,7 @@ apply Service "dig6" { <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2016-11-20-object-oriented-programming-with-ansi-c.html b/gemfeed/2016-11-20-object-oriented-programming-with-ansi-c.html index bf0cd556..bee292e4 100644 --- a/gemfeed/2016-11-20-object-oriented-programming-with-ansi-c.html +++ b/gemfeed/2016-11-20-object-oriented-programming-with-ansi-c.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Object oriented programming with ANSI C</h1><br /> <br /> -<span class=quote>Published at 2016-11-20T22:10:57+00:00; Updated at 2022-01-29</span><br /> +<span class='quote'>Published at 2016-11-20T22:10:57+00:00; Updated at 2022-01-29</span><br /> <br /> <pre> ___ ___ ____ ____ @@ -98,19 +98,19 @@ mult.calculate(mult,a,b)); <br /> <span>If you want to take it further, hit "Object-Oriented Programming with ANSI-C" into your favourite internet search engine or follow the link below. It goes as far as writing a C preprocessor in AWK, which takes some object-oriented pseudo-C and transforms it to plain C so that the C compiler can compile it to machine code. This is similar to how the C++ language had its origins.</span><br /> <br /> -<a class=textlink href='https://www.cs.rit.edu/~ats/books/ooc.pdf'>https://www.cs.rit.edu/~ats/books/ooc.pdf</a><br /> +<a class='textlink' href='https://www.cs.rit.edu/~ats/books/ooc.pdf'>https://www.cs.rit.edu/~ats/books/ooc.pdf</a><br /> <br /> <h2 style='display: inline'>OOP design patterns in the Linux Kernel</h2><br /> <br /> <span>Big C software projects, like Linux, also follow some OOP techniques:</span><br /> <br /> -<a class=textlink href='https://lwn.net/Articles/444910/'>https://lwn.net/Articles/444910/</a><br /> +<a class='textlink' href='https://lwn.net/Articles/444910/'>https://lwn.net/Articles/444910/</a><br /> <br /> <span>C is a very old programming language with it's quirks. This might be one of the reasons why Linux will also let Rust code in.</span><br /> <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux.html b/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux.html index 9a20eef7..3fbc20bf 100644 --- a/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux.html +++ b/gemfeed/2018-06-01-realistic-load-testing-with-ioriot-for-linux.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Realistic load testing with I/O Riot for Linux</h1><br /> <br /> -<span class=quote>Published at 2018-06-01T14:50:29+01:00; Updated at 2021-05-08</span><br /> +<span class='quote'>Published at 2018-06-01T14:50:29+01:00; Updated at 2021-05-08</span><br /> <br /> <pre> .---. @@ -27,7 +27,7 @@ jgs\__/'---'\__/ <br /> <span>This text first was published in the german IT-Administrator computer Magazine. 3 years have passed since and I decided to publish it on my blog too. </span><br /> <br /> -<a class=textlink href='https://www.admin-magazin.de/Das-Heft/2018/06/Realistische-Lasttests-mit-I-O-Riot'>https://www.admin-magazin.de/Das-Heft/2018/06/Realistische-Lasttests-mit-I-O-Riot</a><br /> +<a class='textlink' href='https://www.admin-magazin.de/Das-Heft/2018/06/Realistische-Lasttests-mit-I-O-Riot'>https://www.admin-magazin.de/Das-Heft/2018/06/Realistische-Lasttests-mit-I-O-Riot</a><br /> <br /> <span>I havn't worked on I/O Riot for some time now, but all what is written here is still valid. I am still using I/O Riot to debug I/O issues and pattern once in a while, so by all means the tool is not obsolete yet. The tool even helped to resolve a major production incident at work caused by disk I/O.</span><br /> <br /> @@ -179,7 +179,7 @@ Total time: 1213.00s <br /> <span>The tool has already proven to be very useful and will continue to be actively developed as time and priority permits. Mimecast intends to be an ongoing contributor to Open Source. You can find I/O Riot at:</span><br /> <br /> -<a class=textlink href='https://github.com/mimecast/ioriot'>https://github.com/mimecast/ioriot</a><br /> +<a class='textlink' href='https://github.com/mimecast/ioriot'>https://github.com/mimecast/ioriot</a><br /> <br /> <h2 style='display: inline'>Systemtap</h2><br /> <br /> @@ -187,18 +187,18 @@ Total time: 1213.00s <br /> <span>For example, the open syscall opens a file and returns the responsible file descriptor. The read and write syscalls can operate on a file descriptor and return the number of read or written bytes. The close syscall closes a given file descriptor. I/O Riot comes with a ready-made Systemtap program, which you have already compiled into a kernel module and installed to /opt/ioriot. In addition to open, read and close, it logs many other I/O-relevant calls.</span><br /> <br /> -<a class=textlink href='https://sourceware.org/systemtap/'>https://sourceware.org/systemtap/</a><br /> +<a class='textlink' href='https://sourceware.org/systemtap/'>https://sourceware.org/systemtap/</a><br /> <br /> <h2 style='display: inline'>More refereces</h2><br /> <br /> -<a class=textlink href='http://www.iozone.org/'>IOZone</a><br /> -<a class=textlink href='https://www.coker.com.au/bonnie++/'>Bonnie++</a><br /> -<a class=textlink href='https://graphiteapp.org'>Graphite</a><br /> -<a class=textlink href='https://en.wikipedia.org/wiki/Memory-mapped_I/O'>Memory mapped I/O</a><br /> +<a class='textlink' href='http://www.iozone.org/'>IOZone</a><br /> +<a class='textlink' href='https://www.coker.com.au/bonnie++/'>Bonnie++</a><br /> +<a class='textlink' href='https://graphiteapp.org'>Graphite</a><br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/Memory-mapped_I/O'>Memory mapped I/O</a><br /> <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.html b/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.html index b2a4f196..e654cab4 100644 --- a/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.html +++ b/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.html @@ -10,13 +10,13 @@ <body> <h1 style='display: inline'>DTail - The distributed log tail program</h1><br /> <br /> -<span class=quote>Published at 2021-04-22T19:28:41+01:00; Updated at 2021-04-26</span><br /> +<span class='quote'>Published at 2021-04-22T19:28:41+01:00; Updated at 2021-04-26</span><br /> <br /> <a href='./2021-04-22-dtail-the-distributed-log-tail-program/title.png'><img alt='DTail logo image' title='DTail logo image' src='./2021-04-22-dtail-the-distributed-log-tail-program/title.png' /></a><br /> <br /> <span>This article first appeared at the Mimecast Engineering Blog but I made it available here in my personal internet site too.</span><br /> <br /> -<a class=textlink href='https://medium.com/mimecast-engineering/dtail-the-distributed-log-tail-program-79b8087904bb'>Original Mimecast Engineering Blog post at Medium</a><br /> +<a class='textlink' href='https://medium.com/mimecast-engineering/dtail-the-distributed-log-tail-program-79b8087904bb'>Original Mimecast Engineering Blog post at Medium</a><br /> <br /> <span>Running a large cloud-based service requires monitoring the state of huge numbers of machines, a task for which many standard UNIX tools were not really designed. In this post, I will describe a simple program, DTail, that Mimecast has built and released as Open-Source, which enables us to monitor log files of many servers at once without the costly overhead of a full-blown log management system.</span><br /> <br /> @@ -30,7 +30,7 @@ <br /> <span>DTail got its inspiration from public domain tools available already in this area but it is a blue sky from-scratch development which was first presented at Mimecast’s annual internal Pet Project competition (awarded with a Bronze prize). It has gained popularity since and is one of the most widely deployed DevOps tools at Mimecast (reaching nearly 10k server installations) and many engineers use it on a regular basis. The Open-Source version of DTail is available at:</span><br /> <br /> -<a class=textlink href='https://dtail.dev'>https://dtail.dev</a><br /> +<a class='textlink' href='https://dtail.dev'>https://dtail.dev</a><br /> <br /> <span>Try it out — We would love any feedback. But first, read on…</span><br /> <br /> @@ -114,17 +114,17 @@ dtail –servers serverlist.txt –files ‘/var/log/*.log’ –regex ‘(?i:er <br /> <span>Mimecast highly encourages you to have a look at DTail and submit an issue for any features you would like to see. Have you found a bug? Maybe you just have a question or comment? If you want to go a step further: We would also love to see pull requests for any features or improvements. Either way, if in doubt just contact us via the DTail GitHub page.</span><br /> <br /> -<a class=textlink href='https://dtail.dev'>https://dtail.dev</a><br /> +<a class='textlink' href='https://dtail.dev'>https://dtail.dev</a><br /> <br /> <span>Other related posts are:</span><br /> <br /> -<a class=textlink href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> -<a class=textlink href='./2022-03-06-the-release-of-dtail-4.0.0.html'>2022-03-06 The release of DTail 4.0.0</a><br /> -<a class=textlink href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>2021-04-22 DTail - The distributed log tail program (You are currently reading this)</a><br /> +<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> +<a class='textlink' href='./2022-03-06-the-release-of-dtail-4.0.0.html'>2022-03-06 The release of DTail 4.0.0</a><br /> +<a class='textlink' href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>2021-04-22 DTail - The distributed log tail program (You are currently reading this)</a><br /> <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2021-04-24-welcome-to-the-geminispace.html b/gemfeed/2021-04-24-welcome-to-the-geminispace.html index de2dc798..1af39899 100644 --- a/gemfeed/2021-04-24-welcome-to-the-geminispace.html +++ b/gemfeed/2021-04-24-welcome-to-the-geminispace.html @@ -10,13 +10,13 @@ <body> <h1 style='display: inline'>Welcome to the Geminispace</h1><br /> <br /> -<span class=quote>Published at 2021-04-24T19:28:41+01:00; Updated at 2021-06-18</span><br /> +<span class='quote'>Published at 2021-04-24T19:28:41+01:00; Updated at 2021-06-18</span><br /> <br /> <span>ASCII Art by Andy Hood!</span><br /> <br /> <span>Have you reached this article already via Gemini? It requires a Gemini client; web browsers such as Firefox, Chrome, Safari, etc., don't support the Gemini protocol. The Gemini address of this site (or the address of this capsule as people say in Geminispace) is:</span><br /> <br /> -<a class=textlink href='gemini://foo.zone'>gemini://foo.zone</a><br /> +<a class='textlink' href='gemini://foo.zone'>gemini://foo.zone</a><br /> <br /> <span>However, if you still use HTTP, you are just surfing the fallback HTML version of this capsule. In that case, I suggest reading on what this is all about :-).</span><br /> <br /> @@ -69,7 +69,7 @@ <br /> <span>This site was generated with Gemtexter. You can read more about it here:</span><br /> <br /> -<a class=textlink href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>Gemtexter - One Bash script to rule it all</a><br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>Gemtexter - One Bash script to rule it all</a><br /> <br /> <h2 style='display: inline'>Gemini advantages summarised</h2><br /> <br /> @@ -86,19 +86,19 @@ <br /> <span>Check out one of the following links for more information about Gemini. For example, you will find a FAQ that explains why the protocol is named Gemini. Many Gemini capsules are dual-hosted via Gemini and HTTP(S) so that people new to Gemini can sneak peek at the content with a regular web browser. Some people go as far as tri-hosting all their content via HTTP(S), Gemini and Gopher.</span><br /> <br /> -<a class=textlink href='gemini://gemini.circumlunar.space'>gemini://gemini.circumlunar.space</a><br /> -<a class=textlink href='https://gemini.circumlunar.space'>https://gemini.circumlunar.space</a><br /> +<a class='textlink' href='gemini://gemini.circumlunar.space'>gemini://gemini.circumlunar.space</a><br /> +<a class='textlink' href='https://gemini.circumlunar.space'>https://gemini.circumlunar.space</a><br /> <br /> <span>Other related posts are:</span><br /> <br /> -<a class=textlink href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again^2</a><br /> -<a class=textlink href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> -<a class=textlink href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> -<a class=textlink href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace (You are currently reading this)</a><br /> +<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^2</a><br /> +<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> +<a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace (You are currently reading this)</a><br /> <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2021-05-16-personal-bash-coding-style-guide.html b/gemfeed/2021-05-16-personal-bash-coding-style-guide.html index 499d4cc7..861e9256 100644 --- a/gemfeed/2021-05-16-personal-bash-coding-style-guide.html +++ b/gemfeed/2021-05-16-personal-bash-coding-style-guide.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Personal Bash coding style guide</h1><br /> <br /> -<span class=quote>Published at 2021-05-16T14:51:57+01:00</span><br /> +<span class='quote'>Published at 2021-05-16T14:51:57+01:00</span><br /> <br /> <pre> .---------------------------. @@ -27,7 +27,7 @@ <br /> <span>Lately, I have been polishing and writing a lot of Bash code. Not that I never wrote a lot of Bash, but now as I also looked through the Google Shell Style Guide, I thought it is time also to write my thoughts on that. I agree with that guide in most, but not in all points. </span><br /> <br /> -<a class=textlink href='https://google.github.io/styleguide/shellguide.html'>Google Shell Style Guide</a><br /> +<a class='textlink' href='https://google.github.io/styleguide/shellguide.html'>Google Shell Style Guide</a><br /> <br /> <h2 style='display: inline'>My modifications</h2><br /> <br /> @@ -379,27 +379,27 @@ fi <br /> <span>The following two paragraphs are thoroughly quoted from the Google guidelines. But they hit the hammer on the head:</span><br /> <br /> -<span class=quote>If you are editing code, take a few minutes to look at the code around you and determine its style. If they use spaces around their if clauses, you should, too. If their comments have little boxes of stars around them, make your comments have little boxes of stars around them too.</span><br /> +<span class='quote'>If you are editing code, take a few minutes to look at the code around you and determine its style. If they use spaces around their if clauses, you should, too. If their comments have little boxes of stars around them, make your comments have little boxes of stars around them too.</span><br /> <br /> -<span class=quote>The point of having style guidelines is to have a common vocabulary of coding so people can concentrate on what you are saying rather than on how you are saying it. We present global style rules here, so people know the vocabulary. But local style is also important. If the code you add to a file looks drastically different from the existing code around it, the discontinuity throws readers out of their rhythm when they go to read it. Try to avoid this.</span><br /> +<span class='quote'>The point of having style guidelines is to have a common vocabulary of coding so people can concentrate on what you are saying rather than on how you are saying it. We present global style rules here, so people know the vocabulary. But local style is also important. If the code you add to a file looks drastically different from the existing code around it, the discontinuity throws readers out of their rhythm when they go to read it. Try to avoid this.</span><br /> <br /> <br /> <h2 style='display: inline'>Advanced Bash learning pro tip</h2><br /> <br /> <span>I also highly recommend having a read through the "Advanced Bash-Scripting Guide" (not from Google). I use it as the universal Bash reference and learn something new every time I look at it.</span><br /> <br /> -<a class=textlink href='https://tldp.org/LDP/abs/html/'>Advanced Bash-Scripting Guide</a><br /> +<a class='textlink' href='https://tldp.org/LDP/abs/html/'>Advanced Bash-Scripting Guide</a><br /> <br /> <span>Other related posts are:</span><br /> <br /> -<a class=textlink href='./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 (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 (You are currently reading this)</a><br /> <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html b/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html index d51e3e34..4b7ae78b 100644 --- a/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html +++ b/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Gemtexter - One Bash script to rule it all</h1><br /> <br /> -<span class=quote>Published at 2021-06-05T19:03:32+01:00</span><br /> +<span class='quote'>Published at 2021-06-05T19:03:32+01:00</span><br /> <br /> <pre> o .,<>., o @@ -65,7 +65,7 @@ <br /> <span>I have exactly done that - I wrote a Bash script, named Gemtexter, for that:</span><br /> <br /> -<a class=textlink href='https://codeberg.org/snonux/gemtexter'>https://codeberg.org/snonux/gemtexter</a><br /> +<a class='textlink' href='https://codeberg.org/snonux/gemtexter'>https://codeberg.org/snonux/gemtexter</a><br /> <br /> <span>In short, Gemtexter is a static site generator and blogging engine that uses Gemtext as its input format.</span><br /> <br /> @@ -111,7 +111,7 @@ paul in uranus in gemtexter on 🌱 main <br /> <span>While working on Gemtexter, I also had a look at the Google Shell Style Guide and wrote a blog post on that:</span><br /> <br /> -<a class=textlink href='./2021-05-16-personal-bash-coding-style-guide.html'>Personal bash coding style guide</a><br /> +<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>Personal bash coding style guide</a><br /> <br /> <span>I followed all these best practices, and in my opinion, the result is a pretty maintainable Bash script (given that you are fluent with all the sed and grep commands I used).</span><br /> <br /> @@ -121,7 +121,7 @@ paul in uranus in gemtexter on 🌱 main <br /> <span>Furthermore, ShellCheck recommended many more improvements. Declaration of unused variables and missing variable and string quotations were the most common ones. ShellSheck immensely helped to improve the robustness of the script.</span><br /> <br /> -<a class=textlink href='https://shellcheck.net'>https://shellcheck.net</a><br /> +<a class='textlink' href='https://shellcheck.net'>https://shellcheck.net</a><br /> <br /> <h3 style='display: inline'>Unit testing</h3><br /> <br /> @@ -178,17 +178,17 @@ assert::equals "$(generate::make_link md "$gemtext")" \ <br /> <span>Other related posts are:</span><br /> <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^2</a><br /> -<a class=textlink href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> -<a class=textlink href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2</a><br /> -<a class=textlink href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> -<a class=textlink href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all (You are currently reading this)</a><br /> -<a class=textlink href='./2021-05-16-personal-bash-coding-style-guide.html'>2021-05-16 Personal Bash coding style guide</a><br /> -<a class=textlink href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace</a><br /> +<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^2</a><br /> +<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> +<a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2</a><br /> +<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all (You are currently reading this)</a><br /> +<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>2021-05-16 Personal Bash coding style guide</a><br /> +<a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace</a><br /> <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2021-07-04-the-well-grounded-rubyist.html b/gemfeed/2021-07-04-the-well-grounded-rubyist.html index 2673e5d9..2f751bab 100644 --- a/gemfeed/2021-07-04-the-well-grounded-rubyist.html +++ b/gemfeed/2021-07-04-the-well-grounded-rubyist.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>The Well-Grounded Rubyist</h1><br /> <br /> -<span class=quote>Published at 2021-07-04T10:51:23+01:00</span><br /> +<span class='quote'>Published at 2021-07-04T10:51:23+01:00</span><br /> <br /> <span>When I was a Linux System Administrator, I have been programming in Perl for years. I still maintain some personal Perl programming projects (e.g. Xerl, guprecords, Loadbars). After switching jobs a couple of years ago (becoming a Site Reliability Engineer), I found Ruby (and some Python) widely used there. As I wanted to do something new, I decided to give Ruby a go.</span><br /> <br /> @@ -36,9 +36,9 @@ <li>Occasionally, I write some lines of Java code for minor feature enhancements and fixes to improve the reliability of some the services.</li> <li>Sometimes, I still program in good old C. This is for special projects (e.g. I/O Riot) or low-level PoCs or SystemTap guru mode scripts.</li> </ul><br /> -<a class=textlink href='./2021-05-16-personal-bash-coding-style-guide.html'>Also have a look at my personal Bash coding style.</a><br /> -<a class=textlink href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>Read here about DTail - the distributed log tail program.</a><br /> -<a class=textlink href='./2018-06-01-realistic-load-testing-with-ioriot-for-linux.html'>This is a magazine article about I/O Riot I wrote.</a><br /> +<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>Also have a look at my personal Bash coding style.</a><br /> +<a class='textlink' href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>Read here about DTail - the distributed log tail program.</a><br /> +<a class='textlink' href='./2018-06-01-realistic-load-testing-with-ioriot-for-linux.html'>This is a magazine article about I/O Riot I wrote.</a><br /> <br /> <span>For all other in-between tasks I mainly use the Ruby programming language (unless I decide to give something new a shot once in a while).</span><br /> <br /> @@ -115,7 +115,7 @@ Hello World <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2021-08-01-on-being-pedantic-about-open-source.html b/gemfeed/2021-08-01-on-being-pedantic-about-open-source.html index 67d3978a..68d14251 100644 --- a/gemfeed/2021-08-01-on-being-pedantic-about-open-source.html +++ b/gemfeed/2021-08-01-on-being-pedantic-about-open-source.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>On being Pedantic about Open-Source</h1><br /> <br /> -<span class=quote>Published at 2021-08-01T10:37:58+03:00; Updated at 2023-01-23</span><br /> +<span class='quote'>Published at 2021-08-01T10:37:58+03:00; Updated at 2023-01-23</span><br /> <br /> <pre> __ @@ -74,9 +74,9 @@ <br /> <h2 style='display: inline'>What about mobile?</h2><br /> <br /> -<span class=quote>Update 2023-01-21: Check out my newer post about GrapheneOS, which solves some of my dilemmas</span><br /> +<span class='quote'>Update 2023-01-21: Check out my newer post about GrapheneOS, which solves some of my dilemmas</span><br /> <br /> -<a class=textlink href='./2023-01-23-why-grapheneos-rox.html'>Why GrapheneOS Rox</a><br /> +<a class='textlink' href='./2023-01-23-why-grapheneos-rox.html'>Why GrapheneOS Rox</a><br /> <br /> <span>I struggle to go 100% open-source on my Smartphone. I use a Samsung phone with the stock Android as provided by Samsung. I love the device as it is large enough to use as a portable reading and note-taking device, and it can also take decent pictures. As a cloud backup solution, I have my own NextCloud server (open-source). Android is mainly open-source software, but many closed parts are still included. I replaced most of the standard apps with free and open-source variants from the F-Droid store though.</span><br /> <br /> @@ -92,7 +92,7 @@ <br /> <span>The biggest problem I have with going 100% open-source is actually time. You can't control all the software you use or might be using in the future. You have only a finite amount of time available in your life. So you have to decide what's more important: Investigate and use an open-source alternative of every program and app you have installed, or rather spend quality time with your family and have a nice walk in the park or go to a sports class or cook a nice meal? You can't control it all in today's world of tech, not as a user and even not as a tech worker. There's a great blog post worth reading: </span><br /> <br /> -<a class=textlink href='https://unixsheikh.com/articles/how-to-stay-sane-in-todays-world-of-tech.html'>https://unixsheikh.com/articles/how-to-stay-sane-in-todays-world-of-tech.html</a><br /> +<a class='textlink' href='https://unixsheikh.com/articles/how-to-stay-sane-in-todays-world-of-tech.html'>https://unixsheikh.com/articles/how-to-stay-sane-in-todays-world-of-tech.html</a><br /> <br /> <h2 style='display: inline'>The middle way</h2><br /> <br /> @@ -105,7 +105,7 @@ </ul><br /> <span>I have been playing with other smartphone OS alternatives, especially with MeeGo (which has died already) and SailfishOS, too. Security and privacy seem to be significantly improved compared to an Android. As a matter of fact, I bought a cheap and used Sony Xperia XA2 last year and installed SailfishOS on it. It's a nice toy, but it's still not the holy open-source grail as there are also proprietary parts in SailfishOS. Platforms such as Mobian, Ubuntu Touch and Plasma Mobile are more compelling to me. People must explore alternatives to Android and Apple here, as otherwise, you won't own any gadgets anymore:</span><br /> <br /> -<a class=textlink href='https://news.slashdot.org/story/21/07/10/0120236/by-2030-you-wont-own-any-gadgets'>https://news.slashdot.org/story/21/07/10/0120236/by-2030-you-wont-own-any-gadgets</a><br /> +<a class='textlink' href='https://news.slashdot.org/story/21/07/10/0120236/by-2030-you-wont-own-any-gadgets'>https://news.slashdot.org/story/21/07/10/0120236/by-2030-you-wont-own-any-gadgets</a><br /> <br /> <span>Anyhow, any gadgets, including your phone, should be a tool you use. Don't let the phone use you!</span><br /> <br /> @@ -127,7 +127,7 @@ <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2021-09-12-keep-it-simple-and-stupid.html b/gemfeed/2021-09-12-keep-it-simple-and-stupid.html index c0bd599f..c374c118 100644 --- a/gemfeed/2021-09-12-keep-it-simple-and-stupid.html +++ b/gemfeed/2021-09-12-keep-it-simple-and-stupid.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Keep it simple and stupid</h1><br /> <br /> -<span class=quote>Published at 2021-09-12T09:39:20+03:00; Updated at 2023-03-23</span><br /> +<span class='quote'>Published at 2021-09-12T09:39:20+03:00; Updated at 2023-03-23</span><br /> <br /> <pre> _______________ |*\_/*|_______ @@ -39,7 +39,7 @@ <br /> <span>Have a look at COBOL, a prevalent programming language of the past. No one is learning COBOL in college or university anymore, but many legacy systems still require COBOL experts. Why is this? It's just too scary to write everything from scratch. There's too much COBOL code out there that can't be replaced from today to tomorrow. </span><br /> <br /> -<a class=textlink href='https://nymag.com/intelligencer/2020/04/what-is-cobol-what-does-it-have-to-do-with-the-coronavirus.html'>https://nymag.com/intelligencer/2020/04/what-is-cobol-what-does-it-have-to-do-with-the-coronavirus.html</a><br /> +<a class='textlink' href='https://nymag.com/intelligencer/2020/04/what-is-cobol-what-does-it-have-to-do-with-the-coronavirus.html'>https://nymag.com/intelligencer/2020/04/what-is-cobol-what-does-it-have-to-do-with-the-coronavirus.html</a><br /> <br /> <h2 style='display: inline'>On Kubernetes</h2><br /> <br /> @@ -51,21 +51,21 @@ <br /> <span>Coming back to COBOL, k8s is on its way to becoming something similar. One day, k8s might not be the hottest tech stuff everyone wants to use. But there will be still many legacy k8s clusters around but not enough experts available to manage those:</span><br /> <br /> -<a class=textlink href='https://www.techrepublic.com/article/why-kubernetes-is-our-modern-day-cobol-says-a-tech-expert/'>https://www.techrepublic.com/article/why-kubernetes-is-our-modern-day-cobol-says-a-tech-expert/</a><br /> +<a class='textlink' href='https://www.techrepublic.com/article/why-kubernetes-is-our-modern-day-cobol-says-a-tech-expert/'>https://www.techrepublic.com/article/why-kubernetes-is-our-modern-day-cobol-says-a-tech-expert/</a><br /> <br /> <span>Another article which stroke me is:</span><br /> <br /> -<a class=textlink href='https://it.slashdot.org/story/21/09/23/163212/todays-students-dont-understand-the-basics-of-computer-operations'>Today's Students Don't Understand the Basics of Computer Operations </a><br /> +<a class='textlink' href='https://it.slashdot.org/story/21/09/23/163212/todays-students-dont-understand-the-basics-of-computer-operations'>Today's Students Don't Understand the Basics of Computer Operations </a><br /> <br /> <span>And here is something to smile about:</span><br /> <br /> -<a class=textlink href='https://christine.website/blog/theres-a-node-2021-10-02'>https://christine.website/blog/theres-a-node-2021-10-02</a><br /> +<a class='textlink' href='https://christine.website/blog/theres-a-node-2021-10-02'>https://christine.website/blog/theres-a-node-2021-10-02</a><br /> <br /> <h1 style='display: inline'>The bloated web</h1><br /> <br /> <span>Another example is the modern web. Have you ever wondered why the internet becomes slower and slower nowadays? The modern web is so much like lasagna that I decided to use Gemini to be the primary protocol of my website. The HTML version of this website is just a fallback as many visitors don't know what Gemini is and don't have any compatible software installed for surfing the Geminispace:</span><br /> <br /> -<a class=textlink href='2021-04-24-welcome-to-the-geminispace.html'>2021-04-24-welcome-to-the-geminispace.html</a><br /> +<a class='textlink' href='2021-04-24-welcome-to-the-geminispace.html'>2021-04-24-welcome-to-the-geminispace.html</a><br /> <br /> <span>The Gemtext protocol is KISS. There's no way to do other formattings than headings, links, paragraphs, lists, quotes, and bare text blocks (e.g., ASCII art or code snippets). There's no way to create bloated Gemini sites, and due to its limited capabilities, there's also no way to commercialise it (e.g. there's no good way to track the site visitors as things like cookies don't exist). By design, the Gemini protocol can't be extended, so there is no chance to abuse it even in the future. Gemini sites will stay KISS forever, and there won't be any fancy HTML/JavaScript frameworks like we see on the modern web.</span><br /> <br /> @@ -73,7 +73,7 @@ <br /> <span>Yet another example I want to bring up is DTail, the distributed log tail program I wrote. There are many great and fancy log-management solutions available to choose from, and they all seem complex to set up and maintain. The ELK stack, for example, requires you to operate an ElasticSearch cluster (or multiple, if you are geo-redundant), Logstash (different configurations and instances, depending on your infrastructure) and a Kibana web-frontend (which also needs to be highly available). I have operated ElasticSearch clusters on multiple occasions, and I must say that it is not an easy task to optimise it for the particular workload you might encounter. I also have seen many ES clusters operated by other people, and I have seen these clusters failing a lot (so it's not just me). The reduced complexity of DTail also makes it more robust against outages. You won't troubleshoot your distributed application very well if the log management infrastructure isn't working either.</span><br /> <br /> -<a class=textlink href='2021-04-22-dtail-the-distributed-log-tail-program.html'>2021-04-22-dtail-the-distributed-log-tail-program.html</a><br /> +<a class='textlink' href='2021-04-22-dtail-the-distributed-log-tail-program.html'>2021-04-22-dtail-the-distributed-log-tail-program.html</a><br /> <br /> <span>I don't say that the ELK stack doesn't work, but it requires experts and additional hardware resources to support it. But instead, if you keep your infrastructure simple (e.g. only use DTail), it will maintain pretty much by itself. </span><br /> <br /> @@ -91,7 +91,7 @@ <br /> <span>Not to mention, keeping things simple and stupid also reduces the potential malicious attack surface. It's not just about the software and services you use and operate. It's also about the software you write. Here is a nice article about the KISS principle in software development:</span><br /> <br /> -<a class=textlink href='https://thevaluable.dev/kiss-principle-explained/'>https://thevaluable.dev/kiss-principle-explained/</a><br /> +<a class='textlink' href='https://thevaluable.dev/kiss-principle-explained/'>https://thevaluable.dev/kiss-principle-explained/</a><br /> <br /> <h1 style='display: inline'>When KISS is not KISS anymore</h1><br /> <br /> @@ -99,16 +99,16 @@ <br /> <h2 style='display: inline'>Other relevant readings</h2><br /> <br /> -<a class=textlink href='https://unixsheikh.com/articles/is-the-madness-ever-going-to-end.html'>Is the madness ever going to end?</a><br /> -<a class=textlink href='https://sive.rs/plaintext'>Write plain text files</a><br /> +<a class='textlink' href='https://unixsheikh.com/articles/is-the-madness-ever-going-to-end.html'>Is the madness ever going to end?</a><br /> +<a class='textlink' href='https://sive.rs/plaintext'>Write plain text files</a><br /> <br /> <span>Enough ranted for now!</span><br /> <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<span class=quote>Controversially, a lack of features is a feature. Enjoy your peace an quiet. - Michael W Lucas </span><br /> +<span class='quote'>Controversially, a lack of features is a feature. Enjoy your peace an quiet. - Michael W Lucas </span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2021-10-22-defensive-devops.html b/gemfeed/2021-10-22-defensive-devops.html index dde46c5a..fc8c914d 100644 --- a/gemfeed/2021-10-22-defensive-devops.html +++ b/gemfeed/2021-10-22-defensive-devops.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Defensive DevOps</h1><br /> <br /> -<span class=quote>Published at 2021-10-22T10:02:46+03:00</span><br /> +<span class='quote'>Published at 2021-10-22T10:02:46+03:00</span><br /> <br /> <pre> c=====e @@ -93,7 +93,7 @@ <br /> <span>Now, you can add a handful more canary servers to the automation. You should keep close attention to what the automation is doing. You could use a tool like DTail for distributed log file following. At this point, you could also think of deploying a monitoring check (e.g. Icinga) to see whether your script is not terminating abnormally or logging warnings or errors.</span><br /> <br /> -<a class=textlink href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>DTail - The distributed log tail program</a><br /> +<a class='textlink' href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>DTail - The distributed log tail program</a><br /> <br /> <span>From there, you could automate the solution on more and more servers. Best, ramp up the automation to a handful of systems, and later to a whole line of servers (e.g. all secondary servers of a given cluster). And afterwards, automate it on all servers.</span><br /> <br /> @@ -113,7 +113,7 @@ <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2021-11-29-bash-golf-part-1.html b/gemfeed/2021-11-29-bash-golf-part-1.html index 1495c3b2..52a1db82 100644 --- a/gemfeed/2021-11-29-bash-golf-part-1.html +++ b/gemfeed/2021-11-29-bash-golf-part-1.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Bash Golf Part 1</h1><br /> <br /> -<span class=quote>Published at 2021-11-29T14:06:14+00:00; Updated at 2022-01-05</span><br /> +<span class='quote'>Published at 2021-11-29T14:06:14+00:00; Updated at 2022-01-05</span><br /> <br /> <pre> @@ -26,8 +26,8 @@ jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ <br /> <span>This is the first blog post about my Bash Golf series. This series is about random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content.</span><br /> <br /> -<a class=textlink href='./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 (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 (You are currently reading this)</a><br /> <br /> <h2 style='display: inline'>TCP/IP networking</h2><br /> <br /> @@ -177,7 +177,7 @@ foo bar baz <br /> <span>In case you know more (subtle) differences, please write me an E-Mail and let me know.</span><br /> <br /> -<span class=quote>Update: A reader sent me an E-Mail and pointed me to the Bash manual page, which explains the difference between () and {} (I should have checked that by myself):</span><br /> +<span class='quote'>Update: A reader sent me an E-Mail and pointed me to the Bash manual page, which explains the difference between () and {} (I should have checked that by myself):</span><br /> <br /> <pre> (list) list is executed in a subshell environment (see COMMAND EXECUTION ENVIRONMENT @@ -476,14 +476,14 @@ bash: line 1: 1/10.0 : syntax error: invalid arithmetic operator (error token is <br /> <span>Other related posts are:</span><br /> <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 (You are currently reading this)</a><br /> -<a class=textlink href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> -<a class=textlink href='./2021-05-16-personal-bash-coding-style-guide.html'>2021-05-16 Personal Bash coding style guide</a><br /> +<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 (You are currently reading this)</a><br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> +<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>2021-05-16 Personal Bash coding style guide</a><br /> <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.html b/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.html index cc3a6bce..94b78584 100644 --- a/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.html +++ b/gemfeed/2021-12-26-how-to-stay-sane-as-a-devops-person.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>How to stay sane as a DevOps person </h1><br /> <br /> -<span class=quote>Published at 2021-12-26T12:02:02+00:00; Updated at 2022-01-12</span><br /> +<span class='quote'>Published at 2021-12-26T12:02:02+00:00; Updated at 2022-01-12</span><br /> <br /> <pre> ) @@ -38,7 +38,7 @@ <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 /> +<a class='textlink' href='https://en.wikipedia.org/wiki/Log4Shell'>https://en.wikipedia.org/wiki/Log4Shell</a><br /> <br /> <h2 style='display: inline'>Set clear expectations</h2><br /> <br /> @@ -88,7 +88,7 @@ <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 /> +<a class='textlink' href='./2021-10-22-defensive-devops.html'>Read also "Defensive DevOps" about deploying mitigation scripts.</a><br /> <br /> <h2 style='display: inline'>You are not a superhero</h2><br /> <br /> @@ -132,11 +132,11 @@ <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 /> +<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 hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2022-01-01-bash-golf-part-2.html b/gemfeed/2022-01-01-bash-golf-part-2.html index bbf12b21..57946256 100644 --- a/gemfeed/2022-01-01-bash-golf-part-2.html +++ b/gemfeed/2022-01-01-bash-golf-part-2.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Bash Golf Part 2</h1><br /> <br /> -<span class=quote>Published at 2022-01-01T23:36:15+00:00; Updated at 2022-01-05</span><br /> +<span class='quote'>Published at 2022-01-01T23:36:15+00:00; Updated at 2022-01-05</span><br /> <br /> <pre> @@ -26,8 +26,8 @@ jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ <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='./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='./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='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> <br /> <h2 style='display: inline'>Redirection</h2><br /> <br /> @@ -71,7 +71,7 @@ Foo 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 /> +<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 /> @@ -82,7 +82,7 @@ Foo <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 /> +<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 /> @@ -450,7 +450,7 @@ Hello You! <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 /> +<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>./2021-05-16-personal-bash-coding-style-guide.html</a><br /> <br /> <h3 style='display: inline'>pipefail</h3><br /> <br /> @@ -494,14 +494,14 @@ PAUL:X:1000:1000:PAUL BUETOW:/HOME/PAUL:/BIN/BASH <br /> <span>Other related posts are:</span><br /> <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='./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 /> +<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='./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 /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2022-01-23-welcome-to-the-foo.zone.html b/gemfeed/2022-01-23-welcome-to-the-foo.zone.html index ecfe5c76..24685b39 100644 --- a/gemfeed/2022-01-23-welcome-to-the-foo.zone.html +++ b/gemfeed/2022-01-23-welcome-to-the-foo.zone.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Welcome to the foo.zone</h1><br /> <br /> -<span class=quote>Published at 2022-01-23T16:42:04+00:00</span><br /> +<span class='quote'>Published at 2022-01-23T16:42:04+00:00</span><br /> <br /> <pre> __ @@ -25,7 +25,7 @@ <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 /> +<a class='textlink' href='https://en.wikipedia.org/wiki/Metasyntactic_variable'>https://en.wikipedia.org/wiki/Metasyntactic_variable</a><br /> <br /> <h2 style='display: inline'>What is the foo zone?</h2><br /> <br /> @@ -57,7 +57,7 @@ <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2022-02-04-computer-operating-systems-i-use.html b/gemfeed/2022-02-04-computer-operating-systems-i-use.html index 86e2456f..e2770810 100644 --- a/gemfeed/2022-02-04-computer-operating-systems-i-use.html +++ b/gemfeed/2022-02-04-computer-operating-systems-i-use.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Computer operating systems I use(d)</h1><br /> <br /> -<span class=quote>Published at 2022-02-04T09:58:22+00:00; Updated at 2022-02-18</span><br /> +<span class='quote'>Published at 2022-02-04T09:58:22+00:00; Updated at 2022-02-18</span><br /> <br /> <pre> /( )` @@ -47,7 +47,7 @@ <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 /> +<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 /> @@ -57,7 +57,7 @@ <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 /> +<a class='textlink' href='https://endeavouros.com/'>https://endeavouros.com/</a><br /> <br /> <h2 style='display: inline'>FreeBSD</h2><br /> <br /> @@ -76,7 +76,7 @@ </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 /> +<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 /> @@ -90,20 +90,20 @@ GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 2 <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 /> +<a class='textlink' href='https://www.FreeBSD.org'>https://www.FreeBSD.org</a><br /> <br /> <h2 style='display: inline'>CentOS 7</h2><br /> <br /> <span>While CentOS 8 is already out of support, I still use CentOS 7 (which will receive security updates until 2024). CentOS 7 runs in a cloud VM and is the home to my personal NextCloud and Wallabag installations. You probably know already NextCloud. About Wallabag: It is a great free and open source alternative to Pocket (for reading articles from the web offline later). Yes, you can pay for a Wallabag subscription, but you can also host it for free on your own server.</span><br /> <br /> -<a class=textlink href='https://nextcloud.com'>NextCloud</a><br /> -<a class=textlink href='https://www.wallabag.it/en'>Wallabag</a><br /> +<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 /> +<a class='textlink' href='https://www.centos.org'>https://www.centos.org</a><br /> <br /> <h2 style='display: inline'>OpenBSD</h2><br /> <br /> @@ -120,13 +120,13 @@ GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 2 <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 /> +<a class='textlink' href='https://www.openbsd.org'>https://www.openbsd.org</a><br /> <br /> <h2 style='display: inline'>macOS (proprietary)</h2><br /> <br /> <span>I have to use a MacBook Pro with macOS for work. What else can I say but that this would have never been my personal choice. At least macOS is a UNIX under the hood and comes with a decent terminal and there are plenty of terminal apps available via Brew. Some of the inner workings of macOS were actually forked from the FreeBSD project. </span><br /> <br /> -<a class=textlink href='https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/BSD/BSD.html'>developer.apple.com: BSD in macOS/Darwin</a><br /> +<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 /> @@ -136,12 +136,12 @@ GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 2 <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 /> +<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 /> +<a class='textlink' href='https://lineageos.org/'>https://lineageos.org/</a><br /> +<a class='textlink' href='https://termux.com/'>https://termux.com/</a><br /> <br /> <h2 style='display: inline'>Samsung's Stock Android (mobile proprietary)</h2><br /> <br /> @@ -152,7 +152,7 @@ GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 2 <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 /> +<a class='textlink' href='https://en.wikipedia.org/wiki/Nineteen_Eighty-Four'>https://en.wikipedia.org/wiki/Nineteen_Eighty-Four</a><br /> <br /> <h2 style='display: inline'>Other OSes</h2><br /> <br /> @@ -160,21 +160,21 @@ GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 2 <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 /> +<a class='textlink' href='https://www.pine64.org/pinetime/'>https://www.pine64.org/pinetime/</a><br /> +<a class='textlink' href='https://infinitime.io/'>https://infinitime.io/</a><br /> <br /> <h3 style='display: inline'>motionEyeOS</h3><br /> <br /> <span>I usually install an army of RaspberryPi 3's in my house before I travel for a prolonged amount of time. All Pi's are equipped with an camera and have motionEyeOS (Linux based video surveillance system) installed. There's a neat Android app in the F-Droid store which let's me keep an eye on everything. I make the Pi's accessible from the internet via reverse SSH tunnels through one of my frontend servers.</span><br /> <br /> -<a class=textlink href='https://github.com/ccrisan/motioneyeos'>https://github.com/ccrisan/motioneyeos</a><br /> +<a class='textlink' href='https://github.com/ccrisan/motioneyeos'>https://github.com/ccrisan/motioneyeos</a><br /> <br /> <h3 style='display: inline'>Kobo OS (proprietary)</h3><br /> <br /> <span>I use a Kobo Forma as my e-reader device. I have started to switch off the Wifi and to only sideload DRM free ePubs on it. Even offline, it's a fully capable reader device. I wouldn't like the Kobo to call home to Rakuten. I would love to replace it one day with an open source e-reader alternative like the PineNote. There are also some interesting attempts installing postmarketOS Linux on Kobo devices. The latter boots already, but is far from being usable as a normal e-reader.</span><br /> <br /> -<a class=textlink href='https://www.pine64.org/pinenote/'>The PineNote</a><br /> -<a class=textlink href='https://liliputing.com/2021/07/kobo-clara-hd-becomes-an-e-ink-linux-tablet-with-the-help-of-postmarketos.html'>Kobo Clara HD becomes an e-ink Linux tablet</a><br /> +<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 /> @@ -182,7 +182,7 @@ GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 2 <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 /> +<a class='textlink' href='https://osmc.tv/'>https://osmc.tv/</a><br /> <br /> <h2 style='display: inline'>Other OSes..</h2><br /> <br /> @@ -192,54 +192,54 @@ GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 2 <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 /> +<a class='textlink' href='https://netbsd.org'>https://netbsd.org</a><br /> <br /> <h3 style='display: inline'>Other OSes in use...</h3><br /> <br /> -<a class=textlink href='https://sailfish.org'>SailfishOS - Nice mobile OS, but unfortunately includes proprietary components</a><br /> -<a class=textlink href='https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux'>Red Hat Enterprose Linux - Only for some work stuff</a><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 Enterprose Linux - Only for some work stuff</a><br /> <br /> <h3 style='display: inline'>Other OSes not used any more...</h3><br /> <br /> -<a class=textlink href='https://en.opensuse.org/Archive:S.u.S.E._Linux_5.3'>SuSE Linux 5.3 - The first Linux OS I used</a><br /> -<a class=textlink href='https://en.wikipedia.org/wiki/IRIX'>SGI's IRIX - On a SGI Onyx 3200</a><br /> -<a class=textlink href='https://en.wikipedia.org/wiki/MeeGo'>MeeGo - On a Nokia N9</a><br /> -<a class=textlink href='https://en.wikipedia.org/wiki/Microsoft_Windows'>Microsoft Windows</a><br /> -<a class=textlink href='https://en.wikipedia.org/wiki/MS-DOS'>Microsoft DOS - With and without Windows 3.x</a><br /> -<a class=textlink href='https://en.wikipedia.org/wiki/Symbian'>Symbian - The first smartphone OS I used </a><br /> -<a class=textlink href='https://en.wikipedia.org/wiki/Wear_OS'>WearOS - On a Google smartwatch</a><br /> -<a class=textlink href='https://www.debian.org'>Debian GNU/Linux - Rock solid, but atm. I prefer Fedora/EndeavourOS</a><br /> -<a class=textlink href='https://www.ubuntu.com'>Ubuntu Linux (based on Debian)</a><br /> -<a class=textlink href='https://www.linuxfromscratch.org/'>Linux from scratch - The best way to learn Linux</a><br /> -<a class=textlink href='https://www.suse.com/products/server/'>SUSE Linux Enterprise - Only for some work stuff</a><br /> +<a class='textlink' href='https://en.opensuse.org/Archive:S.u.S.E._Linux_5.3'>SuSE Linux 5.3 - The first Linux OS I used</a><br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/IRIX'>SGI's IRIX - On a SGI Onyx 3200</a><br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/MeeGo'>MeeGo - On a Nokia N9</a><br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/Microsoft_Windows'>Microsoft Windows</a><br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/MS-DOS'>Microsoft DOS - With and without Windows 3.x</a><br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/Symbian'>Symbian - The first smartphone OS I used </a><br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/Wear_OS'>WearOS - On a Google smartwatch</a><br /> +<a class='textlink' href='https://www.debian.org'>Debian GNU/Linux - Rock solid, but atm. I prefer Fedora/EndeavourOS</a><br /> +<a class='textlink' href='https://www.ubuntu.com'>Ubuntu Linux (based on Debian)</a><br /> +<a class='textlink' href='https://www.linuxfromscratch.org/'>Linux from scratch - The best way to learn Linux</a><br /> +<a class='textlink' href='https://www.suse.com/products/server/'>SUSE Linux Enterprise - Only for some work stuff</a><br /> <br /> <h3 style='display: inline'>Other OSes I only had a glance at...</h3><br /> <br /> -<a class=textlink href='https://archiveos.org/opensolaris/'>OpenSolaris - Continuation of the open source version of Solaris</a><br /> -<a class=textlink href='https://archlinuxarm.org/'>Arch Linux ARM</a><br /> -<a class=textlink href='https://ecomstation.com/'>eComStation - Continuation of IBM OS/2</a><br /> -<a class=textlink href='https://en.wikipedia.org/wiki/Minix'>Minix</a><br /> -<a class=textlink href='https://en.wikipedia.org/wiki/OpenVMS'>OpenVMS</a><br /> -<a class=textlink href='https://en.wikipedia.org/wiki/OS/2'>IBM OS/2 Warp</a><br /> -<a class=textlink href='https://freedos.org'>FreeDOS - Open source alternative to DOS</a><br /> -<a class=textlink href='https://plan9.io/plan9/'>Plan9 </a><br /> -<a class=textlink href='https://reactos.org/'>ReactOS - A Microsoft Windows open source clone</a><br /> -<a class=textlink href='https://www.debian.org/ports/hurd/'>Debian GNU/Hurd - Debian on the GNU kernel</a><br /> -<a class=textlink href='https://www.debian.org/ports/kfreebsd-gnu/'>Debian GNU/kFreeBSD - Debian on the FreeBSD kernel</a><br /> -<a class=textlink href='https://www.gentoo.org'>Gentoo Linux</a><br /> -<a class=textlink href='https://www.haiku-os.org/'>Haiku - A BeOS open source clone</a><br /> -<a class=textlink href='https://www.oracle.com/solaris/solaris11/'>Sun Solaris (now owned by Oracle)</a><br /> -<a class=textlink href='https://www.puredarwin.org/'>OpenDarwin ("now" PureDarwin) - Open source operating system based on the open parts of macOS</a><br /> +<a class='textlink' href='https://archiveos.org/opensolaris/'>OpenSolaris - Continuation of the open source version of Solaris</a><br /> +<a class='textlink' href='https://archlinuxarm.org/'>Arch Linux ARM</a><br /> +<a class='textlink' href='https://ecomstation.com/'>eComStation - Continuation of IBM OS/2</a><br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/Minix'>Minix</a><br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/OpenVMS'>OpenVMS</a><br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/OS/2'>IBM OS/2 Warp</a><br /> +<a class='textlink' href='https://freedos.org'>FreeDOS - Open source alternative to DOS</a><br /> +<a class='textlink' href='https://plan9.io/plan9/'>Plan9 </a><br /> +<a class='textlink' href='https://reactos.org/'>ReactOS - A Microsoft Windows open source clone</a><br /> +<a class='textlink' href='https://www.debian.org/ports/hurd/'>Debian GNU/Hurd - Debian on the GNU kernel</a><br /> +<a class='textlink' href='https://www.debian.org/ports/kfreebsd-gnu/'>Debian GNU/kFreeBSD - Debian on the FreeBSD kernel</a><br /> +<a class='textlink' href='https://www.gentoo.org'>Gentoo Linux</a><br /> +<a class='textlink' href='https://www.haiku-os.org/'>Haiku - A BeOS open source clone</a><br /> +<a class='textlink' href='https://www.oracle.com/solaris/solaris11/'>Sun Solaris (now owned by Oracle)</a><br /> +<a class='textlink' href='https://www.puredarwin.org/'>OpenDarwin ("now" PureDarwin) - Open source operating system based on the open parts of macOS</a><br /> <br /> <h3 style='display: inline'>Other OSes which seem interesting...</h3><br /> <br /> -<a class=textlink href='https://asteroidos.org/'>Asteroids OS - Open source smartphone OS</a><br /> -<a class=textlink href='https://www.dragonflybsd.org/'>DragonFly BSD - Fork of FreeBSD 4</a><br /> -<a class=textlink href='http://wiki.postmarketos.org/wiki/Phosh'>Phosh (on postmarketOS) - A true Linux shell for the smartphone</a><br /> +<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 hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.html b/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.html index a13efb87..193bad58 100644 --- a/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.html +++ b/gemfeed/2022-03-06-the-release-of-dtail-4.0.0.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>The release of DTail 4.0.0</h1><br /> <br /> -<span class=quote>Published at 2022-03-06T18:11:39+00:00</span><br /> +<span class='quote'>Published at 2022-03-06T18:11:39+00:00</span><br /> <br /> <pre> ,_---~~~~~----._ @@ -28,7 +28,7 @@ <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 /> +<a class='textlink' href='https://dtail.dev'>https://dtail.dev</a><br /> <br /> <h2 style='display: inline'>So, what's new in 4.0.0?</h2><br /> <br /> @@ -302,9 +302,9 @@ exec /usr/local/bin/dtailhealth --server localhost:2222 <br /> <span>Other related posts are:</span><br /> <br /> -<a class=textlink href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> -<a class=textlink href='./2022-03-06-the-release-of-dtail-4.0.0.html'>2022-03-06 The release of DTail 4.0.0 (You are currently reading this)</a><br /> -<a class=textlink href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>2021-04-22 DTail - The distributed log tail program</a><br /> +<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> +<a class='textlink' href='./2022-03-06-the-release-of-dtail-4.0.0.html'>2022-03-06 The release of DTail 4.0.0 (You are currently reading this)</a><br /> +<a class='textlink' href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>2021-04-22 DTail - The distributed log tail program</a><br /> <br /> <span>Thanks!</span><br /> <br /> @@ -312,7 +312,7 @@ exec /usr/local/bin/dtailhealth --server localhost:2222 <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2022-04-10-creative-universe.html b/gemfeed/2022-04-10-creative-universe.html index 0a963bbe..a400488f 100644 --- a/gemfeed/2022-04-10-creative-universe.html +++ b/gemfeed/2022-04-10-creative-universe.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Creative universe</h1><br /> <br /> -<span class=quote>Published at 2022-04-10T10:09:11+01:00; Updated at 2022-04-18</span><br /> +<span class='quote'>Published at 2022-04-10T10:09:11+01:00; Updated at 2022-04-18</span><br /> <br /> <pre> . + . . . . . . @@ -37,8 +37,8 @@ <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 /> +<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 /> @@ -90,7 +90,7 @@ <br /> <span>Have regular breaks. Don't skip your lunch break. Best, have a walk during lunchtime. And after work, do some kind of workout or visit a sports class. Do something completely unrelated to work before going to sleep (e.g. visit a parallel universe and read a Science Fiction novel). In short: Totally hit the off-switch after your work for the day is finished. You will be much more energised and motivated the next time you open your work laptop.</span><br /> <br /> -<a class=textlink href='../other-resources.html'>I personally love to read Science Fiction novels</a><br /> +<a class='textlink' href='../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 /> @@ -106,7 +106,7 @@ <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 /> +<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 /> @@ -138,7 +138,7 @@ learn () { <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 /> +<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 /> @@ -151,7 +151,7 @@ learn () { </ul><br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2022-05-27-perl-is-still-a-great-choice.html b/gemfeed/2022-05-27-perl-is-still-a-great-choice.html index 9fd52a58..ae5036a9 100644 --- a/gemfeed/2022-05-27-perl-is-still-a-great-choice.html +++ b/gemfeed/2022-05-27-perl-is-still-a-great-choice.html @@ -10,11 +10,11 @@ <body> <h1 style='display: inline'>Perl is still a great choice</h1><br /> <br /> -<span class=quote>Published at 2022-05-27T07:50:12+01:00; Updated at 2023-01-28</span><br /> +<span class='quote'>Published at 2022-05-27T07:50:12+01:00; Updated at 2023-01-28</span><br /> <br /> <a href='./2022-05-27-perl-is-still-a-great-choice/regular_expressions.png'><img alt='Comic source: XKCD' title='Comic source: XKCD' src='./2022-05-27-perl-is-still-a-great-choice/regular_expressions.png' /></a><br /> <br /> -<span>Perl (the Practical Extraction and Report Language) is a battle-tested, mature, multi-paradigm dynamic programming language. Note that it's not called PERL, neither P.E.R.L. nor Pearl. "Perl" is the name of the language and <span class=inlinecode>perl</span> the name of the interpreter or the interpreter command.</span><br /> +<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 /> @@ -38,19 +38,19 @@ <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 /> +<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 /> +<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 /> +<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 /> @@ -58,49 +58,49 @@ <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 /> +<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 /> +<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 /> +<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 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 /> +<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 /> +<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 /> +<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 /> +<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 /> +<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 /> +<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 /> +<a class='textlink' href='https://www.leanpub.com/perl_new_features'>Perl New Features</a><br /> <br /> <h2 style='display: inline'>Why use Perl as there are better alternatives?</h2><br /> <br /> <span>Here, common sense must be applied. I don't believe there is anything like "the perfect" programming language. Everyone has got his preferred (or a set of preferred) programming language to chose from. All programming languages come with their own set of strengths and weaknesses. These are the strengths making Perl shine, and you (technically) don't need to bother to look for "better" alternatives:</span><br /> <br /> <ul> -<li>Perl is better than Shell/AWK/SED scripts. There's a point where shell scripts become fairly complex. The next step-up is to switch to Perl. There are many different versions of shells and AWK and SED interpreters. Do you always know which versions (<span class=inlinecode>mawk</span>, <span class=inlinecode>nawk</span>, <span class=inlinecode>gawk</span>, <span class=inlinecode>sed</span>, <span class=inlinecode>gsed</span>, <span class=inlinecode>grep</span>, <span class=inlinecode>ggrep</span>...) are currently installed? These commands aren't fully compatible to each other. However, there is only one Perl 5. Simply: Perl is faster, more powerful, more expressive than any shell script can ever be, and it is also extendible through CPAN. Perl can directly talk to databases, which shell scripts can't.</li> +<li>Perl 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> @@ -110,9 +110,9 @@ </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 /> +<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 /> @@ -122,15 +122,15 @@ <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 /> +<a class='textlink' href='https://github.com/Ovid/Cor'>Cor - Bringing modern OOP to the Perl Core</a><br /> <br /> <h2 style='display: inline'>Why all the sigils? It looks like an exploding ASCII factory!!</h2><br /> <br /> -<span>The sigils <span class=inlinecode>$ @ % &</span> (where Perl is famously known for) serve a purpose. They seem confusing at first, but they actually make the code better readable. <span class=inlinecode>$scalar</span> is a scalar variable (holding a single value), <span class=inlinecode>@array</span> is an array (holding a list of values), <span class=inlinecode>%hash</span> holds a list of key-value pairs and <span class=inlinecode>&sub</span> is for subroutines. A given variable <span class=inlinecode>$ref</span> can also hold reference to something. <span class=inlinecode>@$arrayref</span> dereferences a reference to an array, <span class=inlinecode>%$hashref</span> to a hash, <span class=inlinecode>$$scalarref</span> to a scalar, <span class=inlinecode>&$subref</span> dereferences a referene to a subroutine, etc. That can be encapsulated as deep as you want. (This paragraph only scratched the surface here of what Perl can do, and there is a lot of syntactic sugar not mentioned here).</span><br /> +<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 /> +<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 /> +<a class='textlink' href='https://www.perl.com/article/on-sigils/'>https://www.perl.com/article/on-sigils/</a><br /> <br /> <h2 style='display: inline'>Where do I personally still use perl?</h2><br /> <br /> @@ -143,21 +143,21 @@ </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 /> +<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 /> +<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 /> +<a class='textlink' href='https://stackoverflow.blog/2022/07/06/why-perl-is-still-relevant-in-2022/'>Why Perl is still relevant in 2022</a><br /> <br /> <span>Other related posts are:</span><br /> <br /> -<a class=textlink href='./2022-05-27-perl-is-still-a-great-choice.html'>2022-05-27 Perl is still a great choice (You are currently reading this)</a><br /> -<a class=textlink href='./2011-05-07-perl-daemon-service-framework.html'>2011-05-07 Perl Daemon (Service Framework)</a><br /> -<a class=textlink href='./2008-06-26-perl-poetry.html'>2008-06-26 Perl Poetry</a><br /> +<a class='textlink' href='./2022-05-27-perl-is-still-a-great-choice.html'>2022-05-27 Perl is still a great choice (You are currently reading this)</a><br /> +<a class='textlink' href='./2011-05-07-perl-daemon-service-framework.html'>2011-05-07 Perl Daemon (Service Framework)</a><br /> +<a class='textlink' href='./2008-06-26-perl-poetry.html'>2008-06-26 Perl Poetry</a><br /> <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2022-06-15-sweating-the-small-stuff.html b/gemfeed/2022-06-15-sweating-the-small-stuff.html index 6634c7d2..8b16c97e 100644 --- a/gemfeed/2022-06-15-sweating-the-small-stuff.html +++ b/gemfeed/2022-06-15-sweating-the-small-stuff.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Sweating the small stuff - Tiny projects of mine</h1><br /> <br /> -<span class=quote>Published at 2022-06-15T08:47:44+01:00; Updated at 2022-06-18</span><br /> +<span class='quote'>Published at 2022-06-15T08:47:44+01:00; Updated at 2022-06-18</span><br /> <br /> <pre> _ @@ -22,37 +22,37 @@ <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 /> +<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 /> +<span>But before going through the tiny projects let's take a paragraph for the <span class='inlinecode'>1y</span> anniversary retrospective.</span><br /> <br /> -<h2 style='display: inline'><span class=inlinecode>1y</span> anniversary</h2><br /> +<h2 style='display: inline'><span class='inlinecode'>1y</span> anniversary</h2><br /> <br /> <span>It has been one year since I started posting regularly (at least once monthly) on this blog again. It has been a lot of fun (and work) doing so for various reasons:</span><br /> <br /> <ul> -<li>I practice English writing (I am not a native speaker). I am far from being a novelist, but this blog helps improves my writing skills. I also tried out tools like Grammarly.com and Languagetool.org and also worked with <span class=inlinecode>:spell</span> in Vim or the LibreOffice checker. This post was checked with the <span class=inlinecode>write-better</span> Node application. </li> +<li>I 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 /> +<a class='textlink' href='./2021-09-12-keep-it-simple-and-stupid.html'>Keep it simple and stupid</a><br /> +<a class='textlink' href='./2022-04-10-creative-universe.html'>Creative universe</a><br /> +<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>Bash Golf series</a><br /> +<a class='textlink' href='./2021-12-26-how-to-stay-sane-as-a-devops-person.html'>How to stay sane as a DevOps person</a><br /> +<a class='textlink' href='./2022-05-27-perl-is-still-a-great-choice.html'>Perl is still a great choice</a><br /> <br /> <span>But now, let's continue with the small projects worth mentioning :-)</span><br /> <br /> <h2 style='display: inline'>Static photo album generator</h2><br /> <br /> -<span><span class=inlinecode>photoalbum.sh</span> is a minimal static HTML photo album generator. I use it to drive "The Irregular Ninja" site and for some ad-hoc (personal) albums to share photos with the family and friends.</span><br /> +<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 /> +<a class='textlink' href='https://codeberg.org/snonux/photoalbum'>https://codeberg.org/snonux/photoalbum</a><br /> <br /> <h3 style='display: inline'>The Irregular Ninja</h3><br /> <br /> @@ -60,13 +60,13 @@ <br /> <a href='./2022-06-15-sweating-the-small-stuff/ninja.jpg'><img src='./2022-06-15-sweating-the-small-stuff/ninja.jpg' /></a><br /> <br /> -<span>More than 10 years ago I wrote the bespoke small static photo album generator in Bash <span class=inlinecode>photoalbum.sh</span> which I recently refactored to a modern Bash coding style and also freshened up the Cascading Style Sheets. Last but not least, the new domain name <span class=inlinecode>irregular.ninja</span> has been registered.</span><br /> +<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 /> +<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 /> @@ -76,15 +76,15 @@ <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 /> +<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 /> +<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 /> +<span>There's also a weekly <span class='inlinecode'>CRON</span> job on my servers to send me a reminder that I might want to read in my old journals again. My laptop also runs this script each time it boots and saves the output to a NextCloud folder. From there, it's synchronized to the NextCloud server so I can pick it up from there with my smartphone later when I am "on the road".</span><br /> <br /> <h2 style='display: inline'>Global uptime records statistic generator</h2><br /> <br /> -<span><span class=inlinecode>guprecords</span> is a Perl script which reads multiple <span class=inlinecode>uprecord</span> files (produced by <span class=inlinecode>uptimed</span> - a widely available daemon for recording server uptimes) and generates uptime statistics of multiple hosts combined. I keep all the record files of all my personal computers in a Git repository (I even keep the records of the boxes I don't own or use anymore) and there's already quite a collection of it. It looks like this:</span><br /> +<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 @@ -138,24 +138,24 @@ Pos | System | Kernel | Uptime | 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 /> +<a class='textlink' href='https://codeberg.org/snonux/guprecords'>https://codeberg.org/snonux/guprecords</a><br /> <br /> <span>This all is of no real practical use but fun!</span><br /> <br /> <h2 style='display: inline'>Server configuration management</h2><br /> <br /> -<span>The <span class=inlinecode>rexfiles</span> project contains all Rex files for my (personal) server setup automation. A <span class=inlinecode>Rexfile</span> is written in a Perl DSL run by the Rex configuration management system. It's pretty much KISS and that's why I love it. It suits my personal needs perfectly. </span><br /> +<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 /> +<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 /> +<span class='quote'>Hi there! I was searching for a simple way to automate my personal OpenBSD setup. I found that configuration management systems like Puppet, Salt, Chef, etc.. were too bloated for my personal needs. So for a while I was configuring everything by hand. At one point I got fed up and started writing Shell scripts. But that was not the holy grail so that I looked at Ansible. I found that Ansible had some dependencies on Python on the target machine when you want to use all the features. Furthermore, I am not really familiar with Python. But then I remembered that there was also Rex. It's written in my beloved Perl. Also, OpenBSD comes with Perl in the base system out of the box which makes it integrate better than all my scripts (automation and also scripts deployed via the automation to the system) are all in the same language. Rex may not have all the features like other configuration management systems, but its easy to work-around or extend when you know Perl. Thanks!</span><br /> <br /> <h2 style='display: inline'>Fancy SSH execution loop</h2><br /> <br /> -<span><span class=inlinecode>rubyfy</span> is a fancy SSH loop wrapper written in Ruby for running shell commands on multiple remote servers at once. I also forked this project for work (under a different name) where I added even more features such as automatic server discovery. It's used by many colleagues on a frequent basis. Here are some examples:</span><br /> +<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 @@ -176,11 +176,11 @@ 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 /> +<a class='textlink' href='https://codeberg.org/snonux/rubyfy'>https://codeberg.org/snonux/rubyfy</a><br /> <br /> <h2 style='display: inline'>A KISS dynamic DNS solution</h2><br /> <br /> -<span><span class=inlinecode>dyndns</span> is a tiny shell script which implements "your" own DynDNS service. It relies on SSH access to the authoritative DNS server and the <span class=inlinecode>nsupdate</span> command. There is really no need to use any of the "other" free DynDNS services out there.</span><br /> +<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 /> @@ -196,11 +196,11 @@ 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 /> +<a class='textlink' href='https://codeberg.org/snonux/dyndns'>https://codeberg.org/snonux/dyndns</a><br /> <br /> <h2 style='display: inline'>CPU information gatherer for Linux</h2><br /> <br /> -<span>This is a tiny GNU Awk script for Linux which displays information about the CPU. All what it does is presenting <span class=inlinecode>/proc/cpuinfo</span> in an easier to read way. The output is somewhat more compact than the standard <span class=inlinecode>lscpu</span> command you find commonly on Linux distributions.</span><br /> +<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 @@ -220,58 +220,58 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs 0023961 Bogomips total </pre> <br /> -<a class=textlink href='https://codeberg.org/snonux/cpuinfo'>https://codeberg.org/snonux/cpuinfo</a><br /> +<a class='textlink' href='https://codeberg.org/snonux/cpuinfo'>https://codeberg.org/snonux/cpuinfo</a><br /> <br /> <h2 style='display: inline'>Show differences of two files over the network</h2><br /> <br /> <span>This is a shell wrapper to use the standard diff tool over the network to compare a file between two computers. It uses NetCat for the network part and also encrypts all traffic using OpenSSL. This is how its used:</span><br /> <br /> -<span>1. Open two terminal windows and login to two different hosts (you could use ClusterSSH or <span class=inlinecode>tmux</span> here). 2. Run on the first host <span class=inlinecode>netdiff otherhost.example.org /file/to/diff.txt</span> and run on the second host <span class=inlinecode>netdiff firsthost.example.org /file/to/diff.txt</span>. 3. You then will see the file differences.</span><br /> +<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 /> +<a class='textlink' href='https://codeberg.org/snonux/netdiff'>https://codeberg.org/snonux/netdiff</a><br /> <br /> <h2 style='display: inline'>Delay sending out E-Mails with Mutt</h2><br /> <br /> <span>This is a shell script for the Mutt email client for delaying sending out E-Mails. For example, you want to write an email on Saturday but don't want to bother the recipient earlier than Monday. It relies on CRON.</span><br /> <br /> -<a class=textlink href='https://codeberg.org/snonux/muttdelay'>https://codeberg.org/snonux/muttdelay</a><br /> +<a class='textlink' href='https://codeberg.org/snonux/muttdelay'>https://codeberg.org/snonux/muttdelay</a><br /> <br /> <h2 style='display: inline'>Graphical UI for sending text messages</h2><br /> <br /> -<span><span class=inlinecode>jsmstrade</span> is a minimalistic graphical Java swing client for sending SMS messages over the SMStrade service.</span><br /> +<span><span class='inlinecode'>jsmstrade</span> is a minimalistic graphical Java swing client for sending SMS messages over the SMStrade service.</span><br /> <br /> <a href='./2022-06-15-sweating-the-small-stuff/jsmstrade.png'><img src='./2022-06-15-sweating-the-small-stuff/jsmstrade.png' /></a><br /> <br /> -<a class=textlink href='https://codeberg.org/snonux/jsmstrade'>https://codeberg.org/snonux/jsmstrade</a><br /> -<a class=textlink href='https://smstrade.de'>https://smstrade.de</a><br /> +<a class='textlink' href='https://codeberg.org/snonux/jsmstrade'>https://codeberg.org/snonux/jsmstrade</a><br /> +<a class='textlink' href='https://smstrade.de'>https://smstrade.de</a><br /> <br /> <h2 style='display: inline'>IPv6 and IPv4 connectivity testing site</h2><br /> <br /> -<span><span class=inlinecode>ipv6test</span> is a quick and dirty Perl CGI script for testing whether your browser connects via IPv4 or IPv6. It requires you to setup three sub-domains: One reachable only via IPv4 (e.g. <span class=inlinecode>test4.ipv6.buetow.org</span>), another reachable only via IPv6 (e.g. <span class=inlinecode>test6.ipv6.buetow.org</span>) and the main one reachable through both protocols (e.g. <span class=inlinecode>ipv6.buetow.org</span>).</span><br /> +<span><span class='inlinecode'>ipv6test</span> is a quick and dirty Perl CGI script for testing whether your browser connects via IPv4 or IPv6. It requires you to setup three sub-domains: One reachable only via IPv4 (e.g. <span class='inlinecode'>test4.ipv6.buetow.org</span>), another reachable only via IPv6 (e.g. <span class='inlinecode'>test6.ipv6.buetow.org</span>) and the main one reachable through both protocols (e.g. <span class='inlinecode'>ipv6.buetow.org</span>).</span><br /> <br /> <span>I don't have it running on any of my servers at the moment. This means that there is no demo to show now. Sorry!</span><br /> <br /> <h2 style='display: inline'>List open Jira tickets in the terminal</h2><br /> <br /> -<span><span class=inlinecode>japi</span> s a small Perl script for listing open Jira issues. It might be broken by now as the Jira APIs may have changed. Sorry! But feel free to fork and modernize it. :-)</span><br /> +<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 /> +<a class='textlink' href='https://codeberg.org/snonux/jsmstrade'>https://codeberg.org/snonux/jsmstrade</a><br /> <span> </span><br /> <h2 style='display: inline'>Debian running on "your" Android phone</h2><br /> <br /> -<span>Debroid is a tutorial and a set of scripts to install and to run a Debian <span class=inlinecode>chroot</span> on an Android phone.</span><br /> +<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 /> +<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 /> +<a class='textlink' href='https://termux.com'>https://termux.com</a><br /> <br /> <h2 style='display: inline'>Perl service framework</h2><br /> <br /> <span>PerlDaemon is a minimal daemon for Linux and other Unix like operating systems programmed in Perl. It is a minimal but pretty functional and fairly generic service framework. This means that it does not do anything useful other than providing a framework for starting, stopping, configuring and logging. To do something useful, a module (written in Perl) must be provided.</span><br /> <br /> -<a class=textlink href='./2011-05-07-perl-daemon-service-framework.html'>Checkout my previous post about it</a><br /> +<a class='textlink' href='./2011-05-07-perl-daemon-service-framework.html'>Checkout my previous post about it</a><br /> <br /> <h2 style='display: inline'>More</h2><br /> <br /> @@ -279,7 +279,7 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <br /> <h3 style='display: inline'>Work time tracker</h3><br /> <br /> -<span><span class=inlinecode>worktime.rb</span>, for example, is a command line Ruby script I use to track my time spent working. This is to make sure that I don't overwork (in particular useful when working from home). It also generates some daily and weekly stats and carries over work time (surpluses or minuses) to the next work day, week or even year.</span><br /> +<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 /> @@ -297,19 +297,19 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs 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 /> +<span>All I do when I start work is to run the <span class='inlinecode'>wtlogin</span> command and after finishing work to run the <span class='inlinecode'>wtlogout</span> command. My shell will remind me when I work without having logged in. It uses a simple JSON database which is editable with <span class='inlinecode'>wtedit</span> (this opens the JSON in Vim). The report shown above can be generated with <span class='inlinecode'>wtreport</span>. Any out-of-bounds reporting can be added with the <span class='inlinecode'>wtadd</span> command.</span><br /> <br /> <h3 style='display: inline'>Password and document store</h3><br /> <br /> -<span><span class=inlinecode>geheim.rb</span> is my personal password and document store ("geheim" is the German word for secret). It's written in Ruby and heavily relies on Git, FZF (for search), Vim and standard encryption algorithms. Other than the standard <span class=inlinecode>pass</span> Unix password manager, <span class=inlinecode>geheim</span> also encrypts the file names and password titles.</span><br /> +<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 /> +<span>The tool is command line driven but also provides an interactive shell when invoked with <span class='inlinecode'>geheim shell</span>. It also works on my Android phone via Termux so I have all my documents and passwords always with me. </span><br /> <br /> <h3 style='display: inline'>Backup procedure</h3><br /> <br /> -<span><span class=inlinecode>backup</span> is a Bash script which does run once daily (or every time on boot) on my home FreeBSD NAS server and performs backup related tasks such as creating a local backup of my remote NextCloud instance, creating encrypted (incremental) ZFS snapshots of everything what's stored on the NAS and synchronizes (via <span class=inlinecode>rsync</span>) backups to a remote cloud storage. It also can synchronize backups to a local external USB drive.</span><br /> +<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 /> +<a class='textlink' href='./2016-04-03-offsite-backup-with-zfs.html'>Check out my offsite backup series</a><br /> <br /> <h2 style='display: inline'>konpeito.media</h2><br /> <br /> @@ -328,15 +328,15 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <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 /> +<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 /> +<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 hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.html b/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.html index 7e14c984..c93e8d07 100644 --- a/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.html +++ b/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Let's Encrypt with OpenBSD and Rex</h1><br /> <br /> -<span class=quote>Published at 2022-07-30T12:14:31+01:00</span><br /> +<span class='quote'>Published at 2022-07-30T12:14:31+01:00</span><br /> <br /> <pre> / _ \ @@ -43,31 +43,31 @@ <br /> <h2 style='display: inline'>What's Let's Encrypt?</h2><br /> <br /> -<span class=quote>Let's Encrypt is a non-profit certificate authority run by Internet Security Research Group that provides X.509 certificates for Transport Layer Security (TLS) encryption at no charge. It is the world's largest certificate authority, used by more than 265 million websites, with the goal of all websites being secure and using HTTPS.</span><br /> +<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 /> +<a class='textlink' href='https://en.wikipedia.org/wiki/Let's_Encrypt'>Source: Wikipedia</a><br /> <br /> <span>In short, it gives away TLS certificates for your website - for free! The catch is, that the certificates are only valid for three months. So it is better to automate certificate generation and renewals.</span><br /> <br /> -<h2 style='display: inline'>Meet <span class=inlinecode>acme-client</span></h2><br /> +<h2 style='display: inline'>Meet <span class='inlinecode'>acme-client</span></h2><br /> <br /> -<span><span class=inlinecode>acme-client</span> is the default Automatic Certifcate Management Environment (ACME) client on OpenBSD and part of the OpenBSD base system. </span><br /> +<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> +<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 /> +<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>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> +<li>Let's Encrypt then will contact the hostname for the certificate through a particular URL (e.g. <span class='inlinecode'>http://foo.zone/.well-known/acme-challenge/...</span>) to verify that the requester is the valid owner of the host.</li> +<li>Let's Encrypt generates a certificate, which then is downloaded to <span class='inlinecode'>/etc/ssl/...</span>.</li> </ul><br /> <h2 style='display: inline'>Configuration</h2><br /> <br /> @@ -75,7 +75,7 @@ <br /> <h3 style='display: inline'>acme-client.conf</h3><br /> <br /> -<span>This is how my <span class=inlinecode>/etc/acme-client.conf</span> looks like (I copied a template from <span class=inlinecode>/etc/examples/acme-client.conf</span> to <span class=inlinecode>/etc/acme-client.conf</span> and added my domains to the bottom:</span><br /> +<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> # @@ -141,7 +141,7 @@ domain snonux.land { <br /> <h3 style='display: inline'>httpd.conf</h3><br /> <br /> -<span>For ACME to work, you will need to configure the HTTP daemon so that the "special" ACME requests from Let's Encrypt are served correctly. I am using the standard OpenBSD <span class=inlinecode>httpd</span> here. These are the snippets I use for the <span class=inlinecode>foo.zone</span> host in <span class=inlinecode>/etc/httpd.conf</span> (of course, you need a similar setup for all other hosts as well):</span><br /> +<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" { @@ -170,13 +170,13 @@ server "foo.zone" { <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 /> +<span>It is worth noticing that <span class='inlinecode'>httpd</span> will start without the certificates being present. This will cause a certificate error when you try to reach the HTTPS endpoint, but it helps to bootstrap Let's Encrypt. As you saw in the config snippet above, Let's Encrypt only requests the plain HTTP endpoint for the verification process, so HTTPS doesn't need to be operational yet at this stage. But once the certificates are generated, you will have to reload or restart <span class='inlinecode'>httpd</span> to use any new certificate.</span><br /> <br /> <h3 style='display: inline'>CRON job</h3><br /> <br /> -<span>You could now run <span class=inlinecode>doas acme-client foo.zone</span> to generate the certificate or to renew it. Or you could automate it with CRON.</span><br /> +<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 /> +<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 @@ -231,7 +231,7 @@ if [ $has_update = yes ]; then 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 /> +<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 @@ -252,15 +252,15 @@ acme-client: /etc/ssl/snonux.land.fullchain.pem: certificate valid: 79 days left <br /> <h2 style='display: inline'>relayd.conf and smtpd.conf</h2><br /> <br /> -<span>Besides <span class=inlinecode>httpd</span>, <span class=inlinecode>relayd</span> (mainly for Gemini) and <span class=inlinecode>smtpd</span> (for mail, of course) also use TLS certificates. And as you can see in <span class=inlinecode>acme.sh</span>, the services are reloaded or restarted (<span class=inlinecode>smtpd</span> doesn't support reload) whenever a certificate is generated or updated.</span><br /> +<span>Besides <span class='inlinecode'>httpd</span>, <span class='inlinecode'>relayd</span> (mainly for Gemini) and <span class='inlinecode'>smtpd</span> (for mail, of course) also use TLS certificates. And as you can see in <span class='inlinecode'>acme.sh</span>, the services are reloaded or restarted (<span class='inlinecode'>smtpd</span> doesn't support reload) whenever a certificate is generated or updated.</span><br /> <br /> <h2 style='display: inline'>Rexification</h2><br /> <br /> <span>I didn't write all these configuration files by hand. As a matter of fact, everything is automated with the Rex configuration management system.</span><br /> <br /> -<a class=textlink href='https://www.rexify.org'>https://www.rexify.org</a><br /> +<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 /> +<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/; @@ -317,7 +317,7 @@ task 'acme_invoke', group => 'frontends', </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 /> +<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 @@ -337,7 +337,7 @@ our $is_primary = sub { }; </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 /> +<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> # @@ -380,7 +380,7 @@ domain <%= $prefix.$host %> { </pre> <br /> -<span>And this is the <span class=inlinecode>acme.sh.tpl</span>:</span><br /> +<span>And this is the <span class='inlinecode'>acme.sh.tpl</span>:</span><br /> <br /> <pre> #!/bin/sh @@ -420,7 +420,7 @@ fi <br /> <h3 style='display: inline'>Service rexification </h3><br /> <br /> -<span>These are the Rex tasks setting up <span class=inlinecode>httpd</span>, <span class=inlinecode>relayd</span> and <span class=inlinecode>smtpd</span> services:</span><br /> +<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'; @@ -498,7 +498,7 @@ task 'smtpd', group => 'frontends', </pre> <br /> -<span>This is the <span class=inlinecode>httpd.conf.tpl</span>:</span><br /> +<span>This is the <span class='inlinecode'>httpd.conf.tpl</span>:</span><br /> <br /> <pre> <% @@ -590,7 +590,7 @@ server "<%= $prefix %>tmp.buetow.org" { } </pre> <br /> -<span>and this the <span class=inlinecode>relayd.conf.tpl</span>:</span><br /> +<span>and this the <span class='inlinecode'>relayd.conf.tpl</span>:</span><br /> <br /> <pre> <% @@ -618,7 +618,7 @@ relay "gemini6" { } </pre> <br /> -<span>And last but not least, this is the <span class=inlinecode>smtpd.conf.tpl</span>:</span><br /> +<span>And last but not least, this is the <span class='inlinecode'>smtpd.conf.tpl</span>:</span><br /> <br /> <pre> <% @@ -648,9 +648,9 @@ match from local for any action outbound <br /> <h2 style='display: inline'>All pieces together</h2><br /> <br /> -<span>For the complete <span class=inlinecode>Rexfile</span> example and all the templates, please look at the Git repository:</span><br /> +<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 /> +<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 /> @@ -658,7 +658,7 @@ match from local for any action outbound 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 /> +<span>The <span class='inlinecode'>commons</span> is a group of tasks I specified which combines a set of common tasks I always want to execute on all frontend machines. This also includes the ACME tasks mentioned in this article!</span><br /> <br /> <h2 style='display: inline'>Conclusion</h2><br /> <br /> @@ -666,11 +666,11 @@ rex commons <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 /> +<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 hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html b/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html index 709434d0..a423d4f3 100644 --- a/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html +++ b/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Gemtexter 1.1.0 - Let's Gemtext again</h1><br /> <br /> -<span class=quote>Published at 2022-08-27T18:25:57+01:00</span><br /> +<span class='quote'>Published at 2022-08-27T18:25:57+01:00</span><br /> <br /> <pre> -=[ typewriter ]=- 1/98 @@ -24,17 +24,17 @@ 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 /> +<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 /> +<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 /> +<span>It has been around a year since I released the first version <span class='inlinecode'>1.0.0</span>. Although, there aren't any groundbreaking changes, there have been a couple of smaller commits and adjustments. I was quite surprised that I received a bunch of feedback and requests about Gemtexter so it means that I am not the only person in the universe actually using it.</span><br /> <br /> <h2 style='display: inline'>What's new?</h2><br /> <br /> <h3 style='display: inline'>Automatic check for GNU version requirements</h3><br /> <br /> -<span>Gemtexter relies on the GNU versions of the tools <span class=inlinecode>grep</span>, <span class=inlinecode>sed</span> and <span class=inlinecode>date</span> and it also requires the Bash shell in version 5 at least. That's now done in the <span class=inlinecode>check_dependencies()</span> function:</span><br /> +<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 /> <pre> check_dependencies () { @@ -56,15 +56,15 @@ check_dependencies () { } </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 /> +<span>Especially macOS users didn't read the <span class='inlinecode'>README</span> carefully enough to install GNU Grep, GNU Sed and GNU Date before using Gemtexter.</span><br /> <br /> -<h3 style='display: inline'>Backticks now produce <span class=inlinecode>inline code blocks</span> in the HTML output</h3><br /> +<h3 style='display: inline'>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 /> +<span>The Gemtext format doesn't support inline code blocks, but Gemtexter now produces <span class='inlinecode'>inline code blocks</span> (means, small code fragments can be placed in the middle of a paragraph) in the HTML output when the code block is enclosed with Backticks. There were no adjustments required for the Markdown output format, because Markdown supports it already out of the box.</span><br /> <br /> <h3 style='display: inline'>Cache for Atom feed generation</h3><br /> <br /> -<span>The Bash is not the most performant language. Gemtexter already takes a couple of seconds only to generate the Atom feed for around two hand full of articles on my slightly underpowered Surface Go 2 Linux tablet. Therefore, I introduced a cache, so that subsequent Atom feed generation runs finish much quicker. The cache uses a checksum of the Gemtext <span class=inlinecode>.gmi</span> file to decide whether anything of the content has changed or not.</span><br /> +<span>The Bash is not the most performant language. Gemtexter already takes a couple of seconds only to generate the Atom feed for around two hand full of articles on my slightly underpowered Surface Go 2 Linux tablet. Therefore, I introduced a cache, so that subsequent Atom feed generation runs finish much quicker. The cache uses a checksum of the Gemtext <span class='inlinecode'>.gmi</span> file to decide whether anything of the content has changed or not.</span><br /> <br /> <h3 style='display: inline'>Input filter support</h3><br /> <br /> @@ -74,37 +74,37 @@ check_dependencies () { ./gemtexter --generate '.*hello.*' </pre> <br /> -<h3 style='display: inline'>Revamped <span class=inlinecode>git</span> support</h3><br /> +<h3 style='display: inline'>Revamped <span class='inlinecode'>git</span> support</h3><br /> <br /> -<span>The Git support has been completely rewritten. It's now more reliable and faster too. Have a look at the <span class=inlinecode>README</span> for more information.</span><br /> +<span>The Git support has been completely rewritten. It's now more reliable and faster too. Have a look at the <span class='inlinecode'>README</span> for more information.</span><br /> <br /> -<h3 style='display: inline'>Addition of <span class=inlinecode>htmlextras</span> and web font support</h3><br /> +<h3 style='display: inline'>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 /> +<span>The <span class='inlinecode'>htmlextras</span> folder now contains all extra files required for the HTML output format such as cascading style sheet (CSS) files and web fonts.</span><br /> <br /> <h3 style='display: inline'>Sub-section support</h3><br /> <br /> <span>It's now possible to define sub-sections within a Gemtexter capsule. For the HTML output, each sub-section can use its own CSS and web font definitions. E.g.:</span><br /> <br /> -<a class=textlink href='https://foo.zone'>The foo.zone main site</a><br /> -<a class=textlink href='https://foo.zone/notes'>The notes sub-section (with different fonts)</a><br /> +<a class='textlink' href='https://foo.zone'>The foo.zone main site</a><br /> +<a class='textlink' href='https://foo.zone/notes'>The notes sub-section (with different fonts)</a><br /> <br /> <h3 style='display: inline'>More</h3><br /> <br /> <span>Additionally, there were a couple of bug fixes, refactorings and overall improvements in the documentation made. </span><br /> <br /> -<span>Overall I think it's a pretty solid <span class=inlinecode>1.1.0</span> release without anything groundbreaking (therefore no major version jump). But I am happy about it.</span><br /> +<span>Overall I think it's a pretty solid <span class='inlinecode'>1.1.0</span> release without anything groundbreaking (therefore no major version jump). But I am happy about it.</span><br /> <br /> <span>Other related posts are:</span><br /> <br /> -<a class=textlink href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again^2</a><br /> -<a class=textlink href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again (You are currently reading this)</a><br /> -<a class=textlink href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> -<a class=textlink href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace</a><br /> +<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^2</a><br /> +<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again (You are currently reading this)</a><br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> +<a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace</a><br /> <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2022-09-30-after-a-bad-nights-sleep.html b/gemfeed/2022-09-30-after-a-bad-nights-sleep.html index 64a87dd3..fdf71a25 100644 --- a/gemfeed/2022-09-30-after-a-bad-nights-sleep.html +++ b/gemfeed/2022-09-30-after-a-bad-nights-sleep.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>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 /> +<span class='quote'>Published at 2022-09-30T09:53:23+03:00; Updated at 2022-10-12</span><br /> <br /> <pre> z @@ -106,7 +106,7 @@ jgs (________\ \ <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2022-10-30-installing-dtail-on-openbsd.html b/gemfeed/2022-10-30-installing-dtail-on-openbsd.html index 53bd9b1c..5f2615a3 100644 --- a/gemfeed/2022-10-30-installing-dtail-on-openbsd.html +++ b/gemfeed/2022-10-30-installing-dtail-on-openbsd.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Installing DTail on OpenBSD</h1><br /> <br /> -<span class=quote>Published at 2022-10-30T11:03:19+02:00</span><br /> +<span class='quote'>Published at 2022-10-30T11:03:19+02:00</span><br /> <br /> <pre> ,_---~~~~~----._ @@ -53,17 +53,17 @@ <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 /> +<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 /> +<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 /> +<span>I will also mention some relevant <span class='inlinecode'>Rexfile</span> snippets in this post!</span><br /> <br /> <h2 style='display: inline'>Compile it</h2><br /> <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 /> +<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 /> <pre> $ doas pkg_add git go gmake @@ -88,7 +88,7 @@ $ file dtail dtail: ELF 64-bit LSB executable, x86-64, version 1 </pre> <br /> -<span>Now, there isn't any need anymore to keep <span class=inlinecode>git</span>, <span class=inlinecode>go</span> and <span class=inlinecode>gmake</span>, so they can be deinstalled now:</span><br /> +<span>Now, there isn't any need anymore to keep <span class='inlinecode'>git</span>, <span class='inlinecode'>go</span> and <span class='inlinecode'>gmake</span>, so they can be deinstalled now:</span><br /> <br /> <pre> $ doas pkg_delete git go gmake @@ -98,7 +98,7 @@ $ doas pkg_delete git go gmake <br /> <h2 style='display: inline'>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 /> +<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 /> <pre> $ for bin in dserver dcat dgrep dmap dtail dtailhealth; do @@ -107,7 +107,7 @@ $ for bin in dserver dcat dgrep dmap dtail dtailhealth; do done </pre> <br /> -<span>Also, we will be creating the <span class=inlinecode>_dserver</span> service user:</span><br /> +<span>Also, we will be creating the <span class='inlinecode'>_dserver</span> service user:</span><br /> <br /> <pre> $ doas adduser -class nologin -group _dserver -batch _dserver @@ -140,7 +140,7 @@ $ doas chmod 755 /etc/rc.d/dserver <br /> <h3 style='display: inline'>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 /> +<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 /> <pre> desc 'Setup DTail'; @@ -175,7 +175,7 @@ $ curl https://raw.githubusercontent.com/mimecast/dtail/master/samples/dtail.jso doas tee /etc/dserver/dtail.json </pre> <br /> -<span>... and then edit it and adjust <span class=inlinecode>LogDir</span> in the <span class=inlinecode>Common</span> section to <span class=inlinecode>/var/log/dserver</span>. The result will look like this:</span><br /> +<span>... and then edit it and adjust <span class='inlinecode'>LogDir</span> in the <span class='inlinecode'>Common</span> section to <span class='inlinecode'>/var/log/dserver</span>. The result will look like this:</span><br /> <br /> <pre> "Common": { @@ -206,9 +206,9 @@ file '/etc/dserver/dtail.json', <br /> <h2 style='display: inline'>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 /> +<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 /> -<span>The following script, populating the DTail server key cache, can be run periodically via <span class=inlinecode>CRON</span>:</span><br /> +<span>The following script, populating the DTail server key cache, can be run periodically via <span class='inlinecode'>CRON</span>:</span><br /> <br /> <pre> $ cat <<'END' | doas tee /usr/local/bin/dserver-update-key-cache.sh @@ -250,7 +250,7 @@ END $ doas chmod 500 /usr/local/bin/dserver-update-key-cache.sh </pre> <br /> -<span>Note that the script above is a slight variation of the official DTail script. The official DTail one is a <span class=inlinecode>bash</span> script, but on OpenBSD, there's <span class=inlinecode>ksh</span>. I run it once daily by adding it to the <span class=inlinecode>daily.local</span>:</span><br /> +<span>Note that the script above is a slight variation of the official DTail script. The official DTail one is a <span class='inlinecode'>bash</span> script, but on OpenBSD, there's <span class='inlinecode'>ksh</span>. I run it once daily by adding it to the <span class='inlinecode'>daily.local</span>:</span><br /> <br /> <pre> $ echo /usr/local/bin/dserver-update-key-cache.sh | doas tee -a /etc/daily.local @@ -315,9 +315,9 @@ All set... <br /> <h2 style='display: inline'>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 /> +<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 /> -<span>I have installed DTail server this way on my personal OpenBSD frontends <span class=inlinecode>blowfish</span>, and <span class=inlinecode>fishfinger</span>, and the following command connects as user <span class=inlinecode>rex</span> to both machines and greps the file <span class=inlinecode>/etc/fstab</span> for the string <span class=inlinecode>local</span>:</span><br /> +<span>I have installed DTail server this way on my personal OpenBSD frontends <span class='inlinecode'>blowfish</span>, and <span class='inlinecode'>fishfinger</span>, and the following command connects as user <span class='inlinecode'>rex</span> to both machines and greps the file <span class='inlinecode'>/etc/fstab</span> for the string <span class='inlinecode'>local</span>:</span><br /> <br /> <pre> ❯ ./dgrep -user rex -servers blowfish.buetow.org,fishfinger.buetow.org --regex local /etc/fstab @@ -345,19 +345,19 @@ REMOTE|fishfinger|100|7|fstab|093f510ec5c0f512.h /usr/local ffs rw,wxallowed,nod <br /> <span>Check out the following for more information:</span><br /> <br /> -<a class=textlink href='https://dtail.dev'>https://dtail.dev</a><br /> -<a class=textlink href='https://github.com/mimecast/dtail'>https://github.com/mimecast/dtail</a><br /> -<a class=textlink href='https://www.rexify.org'>https://www.rexify.org</a><br /> +<a class='textlink' href='https://dtail.dev'>https://dtail.dev</a><br /> +<a class='textlink' href='https://github.com/mimecast/dtail'>https://github.com/mimecast/dtail</a><br /> +<a class='textlink' href='https://www.rexify.org'>https://www.rexify.org</a><br /> <br /> <span>Other related posts are:</span><br /> <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 /> +<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 /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.html b/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.html index 14cd9994..64762fe0 100644 --- a/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.html +++ b/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>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 /> +<span class='quote'>Published at 2022-11-24T11:17:15+02:00; Updated at 2022-11-26</span><br /> <br /> <pre> _/ \ _(\(o @@ -27,30 +27,30 @@ Art by \ \_! / __! <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 /> +<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 /> +<a class='textlink' href='https://www.vim.org'>Vim</a><br /> +<a class='textlink' href='https://neovim.io'>NeoVim</a><br /> <br /> <span>So why did I switch back to the Vi-family?</span><br /> <br /> <h2 style='display: inline'>Emacs is a giant dragon</h2><br /> <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 /> +<span>Emacs feels like a giant dragon as it is much more than an editor or an integrated development environment. Emacs is a whole platform on its own. There's an E-Mail client, an IRC client, or even games you can run within Emacs. And you can also change Emacs within Emacs using its own Lisp dialect, Emacs Lisp (Emacs is programmed in Emacs Lisp). Therefore, Emacs is also its own programming language. You can change every aspect of Emacs within Emacs itself. People jokingly state Emacs is an operating system and that you should directly use it as the <span class='inlinecode'>init 1</span> process (if you don't know what the <span class='inlinecode'>init 1</span> process is: Under UNIX and similar operating systems, it's the very first userland processed launched. That's usually <span class='inlinecode'>systemd</span> on Linux-based systems, <span class='inlinecode'>launchd</span> on macOS, or any other init script or init system used by the OS)!</span><br /> <br /> <span>In many aspects, Emacs is like shooting at everything with a bazooka! However, I prefer it simple. I only wanted Emacs to be a good editor (which it is, too), but there's too much other stuff in Emacs that I don't need to care about! Vim and NeoVim do one thing excellent: Being great text editors and, when loaded with plugins, decent IDEs, too. </span><br /> <br /> <h2 style='display: inline'>Magit love</h2><br /> <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 /> +<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 /> -<a class=textlink href='https://magit.vc/'>Magit</a><br /> -<a class=textlink href='https://github.com/jonas/tig'>Tig</a><br /> +<a class='textlink' href='https://magit.vc/'>Magit</a><br /> +<a class='textlink' href='https://github.com/jonas/tig'>Tig</a><br /> <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 /> +<span>Magit is pretty neat for basic Git operations, but I found myself searching the internet for the correct sub-commands to do the things I wanted to do in Git. Mainly, the way how branches are managed is confusing. Often, I fell back to the command line to fix up the mess I produced with Magit (e.g. accidentally pushing to the wrong remote branch, so I found myself fixing things manually on the terminal with the <span class='inlinecode'>git</span> command with forced pushes....). Magit is hotkey driven, and common commands are quickly explorable through built-in hotkey menus. Still, I found it challenging to navigate to more advanced Git sub-commands that way which was much easier accomplished by using the <span class='inlinecode'>git</span> command directly.</span><br /> <br /> <h2 style='display: inline'>Graphical UI</h2><br /> <br /> @@ -62,16 +62,16 @@ Art by \ \_! / __! <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 /> -<a class=textlink href='https://en.wikipedia.org/wiki/Emacs_Lisp'>Emacs Lisp</a><br /> -<a class=textlink href='http://sam.zoy.org/elk/'>Elk Scheme</a><br /> -<a class=textlink href='http://vimscript.org/'>VimScript</a><br /> -<a class=textlink href='https://www.oreilly.com/library/view/scripting-vim/9781491996287/'>Scripting Vim by Damian Conway</a><br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/Emacs_Lisp'>Emacs Lisp</a><br /> +<a class='textlink' href='http://sam.zoy.org/elk/'>Elk Scheme</a><br /> +<a class='textlink' href='http://vimscript.org/'>VimScript</a><br /> +<a class='textlink' href='https://www.oreilly.com/library/view/scripting-vim/9781491996287/'>Scripting Vim by Damian Conway</a><br /> <br /> <span>NeoVim is also programmable with Lua, which seems to be a step up and Vim comes with a Perl plugin API (which was removed from NeoVim, but that is a different story - why would someone remove the most potent mature text manipulation programming language from one of the most powerful text editors?).</span><br /> <br /> -<a class=textlink href='https://neovim.io/doc/user/lua.html'>NeoVim Lua API</a><br /> +<a class='textlink' href='https://neovim.io/doc/user/lua.html'>NeoVim Lua API</a><br /> <br /> -<span>One example is my workflow of how I compose my blog articles (e.g. this one you are currently reading): I am writing everything in NeoVim, but I also want to have every paragraph checked against Grammarly (as English is not my first language). So I write a whole paragraph, then I select the entire paragraph via visual selection with <span class=inlinecode>SHIFT+v</span>, and then I press <span class=inlinecode>,y</span> to yank the paragraph to the systems clipboard, then I paste the paragraph to Grammarly's browser window with <span class=inlinecode>CTRL+v</span>, let Grammarly suggest the improvements, and then I copy the result back with <span class=inlinecode>CTRL+c</span> to the system clipboard and in NeoVim I type <span class=inlinecode>,i</span> to insert the result back overriding the old paragraph (which is still selected in visual mode) with the new content. That all sounds a bit complicated, but it's surprisingly natural and efficient.</span><br /> +<span>One example is my workflow of how I compose my blog articles (e.g. this one you are currently reading): I am writing everything in NeoVim, but I also want to have every paragraph checked against Grammarly (as English is not my first language). So I write a whole paragraph, then I select the entire paragraph via visual selection with <span class='inlinecode'>SHIFT+v</span>, and then I press <span class='inlinecode'>,y</span> to yank the paragraph to the systems clipboard, then I paste the paragraph to Grammarly's browser window with <span class='inlinecode'>CTRL+v</span>, let Grammarly suggest the improvements, and then I copy the result back with <span class='inlinecode'>CTRL+c</span> to the system clipboard and in NeoVim I type <span class='inlinecode'>,i</span> to insert the result back overriding the old paragraph (which is still selected in visual mode) with the new content. That all sounds a bit complicated, but it's surprisingly natural and efficient.</span><br /> <br /> <span>To come back to the example, for the clipboard integration, I use this small VimScript snippet, and I didn't have to dig into any Lisp or Perl for this:</span><br /> <pre> @@ -87,21 +87,21 @@ nmap ,i !wpbpaste<CR> <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 /> -<a class=textlink href='https://orgmode.org/'>https://orgmode.org/</a><br /> +<a class='textlink' href='https://orgmode.org/'>https://orgmode.org/</a><br /> <br /> <span>In short, Org-mode is an "interactive markup language" that helps you organize everything mentioned above. I rarely touched the surface during my two-month experiment with Emacs, and I am impressed by it, so I see the benefits of having that. But it's not for me.</span><br /> <br /> -<span>I use "Dead Tree Mode" to organize my work and notes. Dead tree? Yeah, I use an actual pen and a real paper journal (Leuchtturm or a Moleskine and a set of coloured <span class=inlinecode>0.5</span> Muji Pens are excellent choices). That's far more immersive and flexible than a computer program can ever be. Yes, some automation and interaction with the computer (like calendar scheduling etc.) are missing. Still, an actual paper journal forces you to stay simple and focus on the actual work rather than tinkering with your computer program. (But I could not resist, and I wrote a VimScript which parses a table of contents page in Markdown format of my scanned paper journals, and NeoVim allows me to select a topic so that the corresponding PDF scan on the right journal page gets opened in an external PDF viewer (the PDF viewer is <span class=inlinecode>zathura</span>, it uses Vi-keybindings, of course) :-). (See the appendix of this blog post for that script).</span><br /> +<span>I use "Dead Tree Mode" to organize my work and notes. Dead tree? Yeah, I use an actual pen and a real paper journal (Leuchtturm or a Moleskine and a set of coloured <span class='inlinecode'>0.5</span> Muji Pens are excellent choices). That's far more immersive and flexible than a computer program can ever be. Yes, some automation and interaction with the computer (like calendar scheduling etc.) are missing. Still, an actual paper journal forces you to stay simple and focus on the actual work rather than tinkering with your computer program. (But I could not resist, and I wrote a VimScript which parses a table of contents page in Markdown format of my scanned paper journals, and NeoVim allows me to select a topic so that the corresponding PDF scan on the right journal page gets opened in an external PDF viewer (the PDF viewer is <span class='inlinecode'>zathura</span>, it uses Vi-keybindings, of course) :-). (See the appendix of this blog post for that script).</span><br /> <br /> -<a class=textlink href='https://pwmt.org/projects/zathura/'>Zathura</a><br /> +<a class='textlink' href='https://pwmt.org/projects/zathura/'>Zathura</a><br /> <br /> -<span>On the road, I also write some of my notes in Markdown format to NextCloud Notes, which is editable from my phone and via NeoVim on my computers. Markdown is much less powerful than Org-mode, but I prefer it the simple way. There's a neat terminal application, <span class=inlinecode>ranger</span>, which I use to browse my NextCloud Notes when they are synced to a local folder on my machine. <span class=inlinecode>ranger</span> is a file manager inspired by Vim and therefore makes use of Vim keybindings and it feels just natural to me. </span><br /> +<span>On the road, I also write some of my notes in Markdown format to NextCloud Notes, which is editable from my phone and via NeoVim on my computers. Markdown is much less powerful than Org-mode, but I prefer it the simple way. There's a neat terminal application, <span class='inlinecode'>ranger</span>, which I use to browse my NextCloud Notes when they are synced to a local folder on my machine. <span class='inlinecode'>ranger</span> is a file manager inspired by Vim and therefore makes use of Vim keybindings and it feels just natural to me. </span><br /> <br /> -<a class=textlink href='https://github.com/ranger/ranger'>Ranger - A Vim inspired file manager</a><br /> -<span>Did I mention that I also use my <span class=inlinecode>zsh</span> (my default shell) and my <span class=inlinecode>tmux</span> (terminal multiplexer) in Vi-mode?</span><br /> +<a class='textlink' href='https://github.com/ranger/ranger'>Ranger - A Vim inspired file manager</a><br /> +<span>Did I mention that I also use my <span class='inlinecode'>zsh</span> (my default shell) and my <span class='inlinecode'>tmux</span> (terminal multiplexer) in Vi-mode?</span><br /> <br /> -<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 /> +<a class='textlink' href='https://zsh.sourceforge.io/'>Z shell</a><br /> +<a class='textlink' href='https://github.com/tmux/tmux'>tmux terminal multiplexer</a><br /> <br /> <h2 style='display: inline'>Seeking simplicity</h2><br /> <br /> @@ -115,17 +115,17 @@ nmap ,i !wpbpaste<CR> <br /> <span>Vim/NeoVim also comes with a very high degree of customization options, but to a lesser extreme than Emacs (but still, a much higher degree than most other editors out there). If you want the best text editor in the world, which can also be tweaked to be a decent IDE, you are only looking for: Pick Vim or NeoVim! You would also need to invest a lot of time in learning, tweaking and customizing Vim/NeoVim, but that's a little more straightforward, and the result is much more lightweight once you get used to the "Vi way of doing things" you never would want to change back. I haven't tried the Emacs vanilla keystrokes, but they are terrible (that's probably one of the reasons why Doom Emacs uses Vim keybindings by default).</span><br /> <br /> -<span class=quote>Update: One reader recommended to have a look at NvChad. NvChad is a NeoVim config written in Lua aiming to provide a base configuration with very beautiful UI and blazing fast startuptime (around <span class=inlinecode>0.02</span> secs ~ <span class=inlinecode>0.07</span> secs). They tweak UI plugins such as telescope, nvim-tree, bufferline etc well to provide an aesthetic UI experience. That sounds interesting!</span><br /> +<span class='quote'>Update: One reader recommended to have a look at NvChad. NvChad is a NeoVim config written in Lua aiming to provide a base configuration with very beautiful UI and blazing fast startuptime (around <span class='inlinecode'>0.02</span> secs ~ <span class='inlinecode'>0.07</span> secs). They tweak UI plugins such as telescope, nvim-tree, bufferline etc well to provide an aesthetic UI experience. That sounds interesting!</span><br /> <br /> -<a class=textlink href='https://github.com/NvChad/NvChad'>https://github.com/NvChad/NvChad</a><br /> +<a class='textlink' href='https://github.com/NvChad/NvChad'>https://github.com/NvChad/NvChad</a><br /> <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <br /> <h1 style='display: inline'>Appendix</h1><br /> <br /> -<span>This is the VimScript I mentioned earlier, which parses a table of contents index of my scanned paper journals and opens the corresponding PDF at the right page in <span class=inlinecode>zathura</span>:</span><br /> +<span>This is the VimScript I mentioned earlier, which parses a table of contents index of my scanned paper journals and opens the corresponding PDF at the right page in <span class='inlinecode'>zathura</span>:</span><br /> <br /> <pre> function! ReadJournalPageNumber() @@ -186,7 +186,7 @@ endfunction nmap ,j :call OpenJournalPage()<CR> </pre> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2022-12-24-ultrarelearning-java-my-takeaways.html b/gemfeed/2022-12-24-ultrarelearning-java-my-takeaways.html index 5699dce6..f3940b70 100644 --- a/gemfeed/2022-12-24-ultrarelearning-java-my-takeaways.html +++ b/gemfeed/2022-12-24-ultrarelearning-java-my-takeaways.html @@ -10,17 +10,17 @@ <body> <h1 style='display: inline'>(Re)learning Java - My takeaways</h1><br /> <br /> -<span class=quote>Published at 2022-12-24T23:18:40+02:00</span><br /> +<span class='quote'>Published at 2022-12-24T23:18:40+02:00</span><br /> <br /> <a href='./2022-12-24-ultrarelearning-java-my-takeaways/learnjava.jpg'><img src='./2022-12-24-ultrarelearning-java-my-takeaways/learnjava.jpg' /></a><br /> <br /> <span>As a regular participant in the annual Pet Project competition at work, I always try to find a project where I can learn something new. In this post, I would like to share my takeaways after revisiting Java. You can read about my motivations in my "Creative universe" post:</span><br /> <br /> -<a class=textlink href='./2022-04-10-creative-universe.html'>Creative universe</a><br /> +<a class='textlink' href='./2022-04-10-creative-universe.html'>Creative universe</a><br /> <br /> <span>I have been programming in Java back in the days as a university student, and even my Diploma Thesis I implemented in Java (it would require some overhaul so that it is fully compatible with a recent version of Java, though - It still compiles and runs, but with a lot of warnings, though!):</span><br /> <br /> -<a class=textlink href='https://codeberg.org/snonux/vs-sim'>VS-Sim: Distributed systems simulator</a><br /> +<a class='textlink' href='https://codeberg.org/snonux/vs-sim'>VS-Sim: Distributed systems simulator</a><br /> <br /> <span>However, after that, I became a Linux Sysadmin and mainly continued programming in Perl, Puppet, bash, and a little Python. For personal use, I also programmed a bit in Haskell and C. After my Sysadmin role, I moved to London and became a Site Reliability Engineer (SRE), where I mainly programmed in Ruby, bash, Puppet and Golang and a little bit of C. </span><br /> <br /> @@ -38,16 +38,16 @@ <br /> <a href='./2022-12-24-ultrarelearning-java-my-takeaways/effective-java.jpg'><img src='./2022-12-24-ultrarelearning-java-my-takeaways/effective-java.jpg' /></a><br /> <br /> -<span>I recommend reading the 90-part effective Java Series on <span class=inlinecode>dev.to</span>. It's a perfect companion to the book as it explains all the chapters again but from a slightly different perspective and helps you to really understand the content.</span><br /> +<span>I recommend reading the 90-part effective Java Series on <span class='inlinecode'>dev.to</span>. It's a perfect companion to the book as it explains all the chapters again but from a slightly different perspective and helps you to really understand the content.</span><br /> <br /> -<a class=textlink href='https://dev.to/kylec32/series/2292'>Kyle Carter's 90-part Effective Java Series </a><br /> +<a class='textlink' href='https://dev.to/kylec32/series/2292'>Kyle Carter's 90-part Effective Java Series </a><br /> <br /> <h3 style='display: inline'>Java Pub House</h3><br /> <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 /> +<a class='textlink' href='https://www.javapubhouse.com'>https://www.javapubhouse.com</a><br /> +<a class='textlink' href='https://www.graalvm.org'>https://www.graalvm.org</a><br /> <br /> <h3 style='display: inline'>Java Concurrency course</h3><br /> <br /> @@ -71,18 +71,18 @@ <br /> <ul> <li>Static factory methods and public constructors both have their uses, and it pays to understand their relative merits. Often static factories are preferable (cleaner and easier to read), so avoid the reflex to provide public constructors without first considering static factories.</li> -<li>Java streams were utterly new to me. I love how they can help to produce more compact code. But it's challenging to set the line of when enough is enough. Overusing streams can have the opposite effect: Code becomes more complex and challenging to understand. And it is so easy to parallelize the computation of streams by "just" marking the stream as <span class=inlinecode>.parallel()</span> (more on that later in this post).</li> +<li>Java streams were utterly new to me. I love how they can help to produce more compact code. But it's challenging to set the line of when enough is enough. Overusing streams can have the opposite effect: Code becomes more complex and challenging to understand. And it is so easy to parallelize the computation of streams by "just" marking the stream as <span class='inlinecode'>.parallel()</span> (more on that later in this post).</li> <li>Overall, object-oriented languages tend to include more and more functional paradigms. The functional interfaces, which Java provides now, are fantastic. Their full powers shine in combination with the use of streams. An entire book can be written about Java functional interfaces, so I leave it to you to do any further digging.</li> -<li>Local type inference help to reduce even more boilerplate code. E.g. instead of <span class=inlinecode>Hash<String,Hash<String,String>> foo = new Hash<String,Hash<String,String>>();</span> it's possible to just write <span class=inlinecode>var foo = new Hash<String,Hash<String,String>>();</span></li> +<li>Local type inference help to reduce even more boilerplate code. E.g. instead of <span class='inlinecode'>Hash<String,Hash<String,String>> foo = new Hash<String,Hash<String,String>>();</span> it's possible to just write <span class='inlinecode'>var foo = new Hash<String,Hash<String,String>>();</span></li> <li>Class inheritance isn't the preferred way anymore to structure reusable code. Now, it's composition over inheritance. E.g. use dependency injection (inject one object to another object through its constructor) or prefer interfaces (which now also support default implementations of methods) over class inheritance. This makes sense to me as I do that already when I program in Ruby. </li> -<li>I learned the <span class=inlinecode>try-with-resources</span> pattern. Very useful in ensuring closing resources again correctly. No need anymore for complicated and nested <span class=inlinecode>finally</span>-blocks, which used to be almost impossible to get right previously in case of an error condition (e.g. I/O error somewhere deeply nested in an input or output stream).</li> -<li>Optimize only when required. It's considered to be cleaner to prefer immutable variables (declaring them as <span class=inlinecode>final</span>). I knew that already, but for Java, it always seemed to be a waste of resources (creating entirely new objects whenever states change), but apparently, it's okay. Java also does many internal tricks for performance optimization here, e.g. interning strings.</li> +<li>I learned the <span class='inlinecode'>try-with-resources</span> pattern. Very useful in ensuring closing resources again correctly. No need anymore for complicated and nested <span class='inlinecode'>finally</span>-blocks, which used to be almost impossible to get right previously in case of an error condition (e.g. I/O error somewhere deeply nested in an input or output stream).</li> +<li>Optimize only when required. It's considered to be cleaner to prefer immutable variables (declaring them as <span class='inlinecode'>final</span>). I knew that already, but for Java, it always seemed to be a waste of resources (creating entirely new objects whenever states change), but apparently, it's okay. Java also does many internal tricks for performance optimization here, e.g. interning strings.</li> <li>I learned about the concept of static member classes and the difference between non-static member classes (also sometimes known as inner classes). Non-static member classes have full access to all members of their outer class (think of closure). In contrast, static member classes act like completely separate classes without such access but provide the benefit of a nested name that can help group functionality in the code.</li> <li>I learned about the existence of thread-local variables. These are only available to the current thread and aren't shared with other threads.</li> <li>I learned about the concept of Java modules, which help to structure larger code bases better. The traditional Java packages are different. </li> -<li>I learned to love the new <span class=inlinecode>Optional</span> type. I already knew the concept from Haskell, where <span class=inlinecode>Maybe</span> would be the corresponding type. <span class=inlinecode>Optional</span> helps to avoid <span class=inlinecode>null</span>-pointers but comes with some (minimal) performance penalty. So, in the end, you end up with both <span class=inlinecode>Optional</span> types and <span class=inlinecode>null</span>-pointers in your code (depending on the requirements). But I like to prefer <span class=inlinecode>Optional</span> over <span class=inlinecode>null</span>-pointer when "no result" is a valid return value from a method.</li> -<li>The <span class=inlinecode>enum</span> type is way more powerful than I thought. Initially, I felt an <span class=inlinecode>enum</span> could only be used to define a list of constants and then to compare an instance to another instance of the same. An <span class=inlinecode>enum</span> is still there to define a list of constants, but it's also almost like a <span class=inlinecode>class</span> (you can implement constructors, and methods, inherit from other enums). There are quite a lot of possible use cases.</li> -<li>A small but almost the most helpful thing I learned is always to use the <span class=inlinecode>@Override</span> annotation when overriding a method from a parent class. If done, Java helps to detect any typos or type errors when overriding methods. That's useful and spares a lot of time debugging where a method was mistakenly overloaded but not overridden.</li> +<li>I learned to love the new <span class='inlinecode'>Optional</span> type. I already knew the concept from Haskell, where <span class='inlinecode'>Maybe</span> would be the corresponding type. <span class='inlinecode'>Optional</span> helps to avoid <span class='inlinecode'>null</span>-pointers but comes with some (minimal) performance penalty. So, in the end, you end up with both <span class='inlinecode'>Optional</span> types and <span class='inlinecode'>null</span>-pointers in your code (depending on the requirements). But I like to prefer <span class='inlinecode'>Optional</span> over <span class='inlinecode'>null</span>-pointer when "no result" is a valid return value from a method.</li> +<li>The <span class='inlinecode'>enum</span> type is way more powerful than I thought. Initially, I felt an <span class='inlinecode'>enum</span> could only be used to define a list of constants and then to compare an instance to another instance of the same. An <span class='inlinecode'>enum</span> is still there to define a list of constants, but it's also almost like a <span class='inlinecode'>class</span> (you can implement constructors, and methods, inherit from other enums). There are quite a lot of possible use cases.</li> +<li>A small but almost the most helpful thing I learned is always to use the <span class='inlinecode'>@Override</span> annotation when overriding a method from a parent class. If done, Java helps to detect any typos or type errors when overriding methods. That's useful and spares a lot of time debugging where a method was mistakenly overloaded but not overridden.</li> <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 /> @@ -93,8 +93,8 @@ <ul> <li>Finalizers and cleaners seem obsolete, fragile and still, you can use them.</li> <li>In many cases, extreme caution needs to be taken to minimize the accessibility of class members. You might think that Java provides the best "out-of-the-box" solution for proper encapsulation, but the language has many loopholes.</li> -<li>In the early days, Java didn't support generics yet. So what you would use is to cast everything to <span class=inlinecode>Object</span>. Java now fully supports generics (for a while already), but you can still cast everything to <span class=inlinecode>Object</span> and back to whatever type you want. That can lead to nasty runtime errors. Also, there's a particular case to convert between an Array of Object to an Array of String or from an Array of String to a List of String. Java can't convert between these types automatically, and extreme caution needs to be taken when enforcing so (e.g. through explicit type casts). In many of these cases, Java would print out warnings that need to be manually suppressed via annotations. Programming that way, converting data between old and new best practices, is clunky.</li> -<li>If you don't know what you do, Java streams can be all wrong. Side effects in functions used in streams can be nasty to debug. Also, don't just blindly add a <span class=inlinecode>.parallel()</span> to your stream. You need to understand what the stream does and how it exactly works; otherwise, parallelizing a stream can impact the performance drastically (in a negative way). There need to be language constructs preventing you from doing the wrong things. That's so much easier to do it right in a purely functional programming language like Haskell.</li> +<li>In the early days, Java didn't support generics yet. So what you would use is to cast everything to <span class='inlinecode'>Object</span>. Java now fully supports generics (for a while already), but you can still cast everything to <span class='inlinecode'>Object</span> and back to whatever type you want. That can lead to nasty runtime errors. Also, there's a particular case to convert between an Array of Object to an Array of String or from an Array of String to a List of String. Java can't convert between these types automatically, and extreme caution needs to be taken when enforcing so (e.g. through explicit type casts). In many of these cases, Java would print out warnings that need to be manually suppressed via annotations. Programming that way, converting data between old and new best practices, is clunky.</li> +<li>If you don't know what you do, Java streams can be all wrong. Side effects in functions used in streams can be nasty to debug. Also, don't just blindly add a <span class='inlinecode'>.parallel()</span> to your stream. You need to understand what the stream does and how it exactly works; otherwise, parallelizing a stream can impact the performance drastically (in a negative way). There need to be language constructs preventing you from doing the wrong things. That's so much easier to do it right in a purely functional programming language like Haskell.</li> <li>Java is a pretty old language (already), so there are many obstacles to consider. There are too many exceptions and different outcomes of how Java code can behave. In most cases, when you write an API, every method you program needs to be documented so the user won't encounter any surprises using your code. Writing and reading a lot of documentation seems to be quite the overhead when the method name is already descriptive.</li> <li>Java serialization is broken. It works, and the language still supports it, but you better not use Java's native way of object serialization and deserialization. Unbelievable how much can get wrong here, especially regarding security (injecting arbitrary code).</li> <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> @@ -108,7 +108,7 @@ <br /> <span>Although Java has significantly improved since 1.4, its code still tends to be more boilerplate. Not mainly because due to lines of code (Golang code tends to be quite repetitive, primarily when no generics are used), but due to the levels of abstractions it uses. Class hierarchies can be ten classes or deeper, and it is challenging to understand what the code is doing. Good test coverage and much documentation can mitigate the problem partially. Big enterprises use Java, and that also reflects to the language. There are too many libraries and too many abstractions that are bundled with too many legacy abstractions and interfaces and too many exceptions in the library APIs. There's even an external library named Lombok, which aims to reduce Java boilerplate code. Why is there a need for an external library? It should be all part of Java itself.</span><br /> <br /> -<a class=textlink href='https://projectlombok.org/'>https://projectlombok.org/</a><br /> +<a class='textlink' href='https://projectlombok.org/'>https://projectlombok.org/</a><br /> <br /> <span>Java needs a clean cut. The clean cut shall be incompatible with previous versions of Java and only promote modern best practices without all the legacy burden carried around. The same can be said for other languages, e.g. Perl, but in Perl, they already attack the problem with the use of flags which change the behaviour of the language to more modern standards. Or do it like Python, where they had a hard (incompatible) cut from version 2 to version 3. It will be painful, for sure. But that would be the only way I would enjoy using that language as one of my primary languages to code new stuff regularly. Currently, my Java will stay limited to very few projects and the more minor things already mentioned in this post. </span><br /> <br /> @@ -116,7 +116,7 @@ <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2023-01-23-why-grapheneos-rox.html b/gemfeed/2023-01-23-why-grapheneos-rox.html index ea28474e..515d2161 100644 --- a/gemfeed/2023-01-23-why-grapheneos-rox.html +++ b/gemfeed/2023-01-23-why-grapheneos-rox.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Why GrapheneOS rox</h1><br /> <br /> -<span class=quote>Published at 2023-01-23T15:31:52+02:00</span><br /> +<span class='quote'>Published at 2023-01-23T15:31:52+02:00</span><br /> <br /> <pre> Art by Joan Stark @@ -37,16 +37,16 @@ Art by Joan Stark <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 /> +<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 /> +<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 /> +<a class='textlink' href='https://GrapheneOS.org'>https://GrapheneOS.org</a><br /> +<a class='textlink' href='https://LineageOS.org'>https://LineageOS.org</a><br /> <br /> <h2 style='display: inline'>User Profiles</h2><br /> <br /> @@ -62,7 +62,7 @@ Art by Joan Stark <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 /> -<a class=textlink href='https://f-droid.org'>https://f-droid.org</a><br /> +<a class='textlink' href='https://f-droid.org'>https://f-droid.org</a><br /> <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 /> @@ -72,7 +72,7 @@ Art by Joan Stark <br /> <span>With GrapheneOS, it is different. Here, I do not just have a separate user profile, "Google", for various Google apps where Google Play runs, but Google Play also runs in a sandbox!!!</span><br /> <br /> -<span class=quote>GrapheneOS has a compatibility layer providing the option to install and use the official releases of Google Play in the standard app sandbox. Google Play receives no special access or privileges on GrapheneOS instead of bypassing the app sandbox and receiving a massive amount of highly privileged access. Instead, the compatibility layer teaches it how to work within the full app sandbox. It also isn't used as a backend for the OS services as it would be elsewhere since GrapheneOS doesn't use Google Play even when it's installed.</span><br /> +<span class='quote'>GrapheneOS has a compatibility layer providing the option to install and use the official releases of Google Play in the standard app sandbox. Google Play receives no special access or privileges on GrapheneOS instead of bypassing the app sandbox and receiving a massive amount of highly privileged access. Instead, the compatibility layer teaches it how to work within the full app sandbox. It also isn't used as a backend for the OS services as it would be elsewhere since GrapheneOS doesn't use Google Play even when it's installed.</span><br /> <br /> <span>When I need to access Google Play, I can switch to the "Google" profile. Even there, Google is sandboxed to the absolute minimum permissions required to be operational, which gives additional privacy protection.</span><br /> <br /> @@ -88,7 +88,7 @@ Art by Joan Stark <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 /> -<a class=textlink href='https://irregular.ninja'>https://irregular.ninja</a><br /> +<a class='textlink' href='https://irregular.ninja'>https://irregular.ninja</a><br /> <br /> <span>The stock camera app of the OASP could be better. Photos usually look washed out, and the app lacks features. With GrapheneOS, there are two options:</span><br /> <br /> @@ -100,7 +100,7 @@ Art by Joan Stark <br /> <span>For automatic backups of my photos, I am relying on a self-hosted instance of NextCloud (with a client app available via F-Droid). So there isn't any need to rely on any Google apps and services (Google Play Photos or Google Camera app) anymore, and that's great!</span><br /> <br /> -<a class=textlink href='https://nextcloud.com'>https://nextcloud.com</a><br /> +<a class='textlink' href='https://nextcloud.com'>https://nextcloud.com</a><br /> <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 /> @@ -116,11 +116,11 @@ Art by Joan Stark <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 /> -<span class=quote>Termux is an Android terminal emulator and Linux environment app that works directly with no rooting or setup required. A minimal base system is installed automatically - additional packages are available using the APT package manager.</span><br /> +<span class='quote'>Termux is an Android terminal emulator and Linux environment app that works directly with no rooting or setup required. A minimal base system is installed automatically - additional packages are available using the APT package manager.</span><br /> <br /> -<a class=textlink href='https://termux.dev'>https://termux.dev</a><br /> +<a class='textlink' href='https://termux.dev'>https://termux.dev</a><br /> <br /> -<span>In short, Termux is an entire Linux environment running on your Android phone. Just pair your phone with a Bluetooth keyboard, and you will have the whole Linux experience. I am only using terminal Linux applications with Termux, though. What makes it especially great is that I could write on a new blog post (in Neovim through Termux on my phone) or do some coding whilst travelling (e.g. during a flight), or look up my passwords or some other personal documents (through my terminal-based password manager). All changes I commit to Git can be synced to the server with a simple <span class=inlinecode>git push</span> once online (e.g. after the plane landed) again.</span><br /> +<span>In short, Termux is an entire Linux environment running on your Android phone. Just pair your phone with a Bluetooth keyboard, and you will have the whole Linux experience. I am only using terminal Linux applications with Termux, though. What makes it especially great is that I could write on a new blog post (in Neovim through Termux on my phone) or do some coding whilst travelling (e.g. during a flight), or look up my passwords or some other personal documents (through my terminal-based password manager). All changes I commit to Git can be synced to the server with a simple <span class='inlinecode'>git push</span> once online (e.g. after the plane landed) again.</span><br /> <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 /> @@ -130,14 +130,14 @@ Art by Joan Stark <br /> <span>A pure Linux phone, e.g. with Ubuntu Touch installed, e.g. on a PinePhone, Fairphone, the Librem 5 or the Volla phone, is very appealing to me. And they would also provide an even better Linux experience than Termux does. Some support running LineageOS within an Anbox, enabling you to run various proprietary Android apps occasionally within Linux.</span><br /> <br /> -<a class=textlink href='https://ubuntu-touch.io/'>Ubuntu Touch</a><br /> -<a class=textlink href='https://en.wikipedia.org/wiki/Linux_for_mobile_devices'>More Linux distributions for mobile devices </a><br /> +<a class='textlink' href='https://ubuntu-touch.io/'>Ubuntu Touch</a><br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/Linux_for_mobile_devices'>More Linux distributions for mobile devices </a><br /> <br /> <span>But here, Google Play would not be sandboxed; you could not configure individual network permissions and storage scopes like in GrapheneOS. Pure Linux-compatible phones usually come with a crappy camera, and the battery life is generally pretty bad (only a few hours). Also, no big tech company pushes the development of Linux phones. Everything relies on hobbyists, whereas multiple big tech companies put a lot of effort into the Android project, and a lot of code also goes into the Android Open-Source project. </span><br /> <br /> <span>Currently, pure Linux phones are only a nice toy to tinker with but are still not ready (will they ever?) to be the daily driver. SailfishOS may be an exception; I played around with it in the past. It is pretty usable, but it's not an option for me as it is partial a proprietary operating system.</span><br /> <br /> -<a class=textlink href='https://sailfishos.org'>SailfishOS</a><br /> +<a class='textlink' href='https://sailfishos.org'>SailfishOS</a><br /> <br /> <h2 style='display: inline'>Small GrapheneOS downsides </h2><br /> <br /> @@ -149,7 +149,7 @@ Art by Joan Stark <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2023-02-26-how-to-shut-down-after-work.html b/gemfeed/2023-02-26-how-to-shut-down-after-work.html index 1686bc5a..3c292e3e 100644 --- a/gemfeed/2023-02-26-how-to-shut-down-after-work.html +++ b/gemfeed/2023-02-26-how-to-shut-down-after-work.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>How to shut down after work</h1><br /> <br /> -<span class=quote>Published at 2023-02-26T23:48:01+02:00</span><br /> +<span class='quote'>Published at 2023-02-26T23:48:01+02:00</span><br /> <br /> <pre> |\ "Music should be heard not only with the ears, but also the soul." @@ -86,7 +86,7 @@ <span> </span><br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.html b/gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.html index 29578408..06b0bf8f 100644 --- a/gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.html +++ b/gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>"The Pragmatic Programmer" book notes</h1><br /> <br /> -<span class=quote>Published at 2023-03-16T00:55:20+02:00</span><br /> +<span class='quote'>Published at 2023-03-16T00:55:20+02:00</span><br /> <br /> <span>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.</span><br /> <br /> @@ -74,7 +74,7 @@ <br /> <span>It's your life, and you own it. Bruce Lee once said: </span><br /> <br /> -<span class=quote>"I am not on the world to life after your expectations, neither are you to life after mine."</span><br /> +<span class='quote'>"I am not on the world to life after your expectations, neither are you to life after mine."</span><br /> <br /> <ul> <li>Go to meet-ups and actively engage.</li> @@ -87,19 +87,19 @@ <br /> <span>How to motivate others to contribute something (e.g. ideas to a startup):</span><br /> <br /> -<span class=quote>A kindly, old stranger was walking through the land when he came upon a village. As he entered, the villagers moved towards their homes, locking doors and windows. The stranger smiled and asked, why are you all so frightened. I am a simple traveler, looking for a soft place to stay for the night and a warm place for a meal. "There's not a bite to eat in the whole province," he was told. "We are weak and our children are starving. Better keep moving on." "Oh, I have everything I need," he said. "In fact, I was thinking of making some stone soup to share with all of you." He pulled an iron cauldron from his cloak, filled it with water, and began to build a fire under it. Then, with great ceremony, he drew an ordinary-looking stone from a silken bag and dropped it into the water. By now, hearing the rumor of food, most of the villagers had come out of their homes or watched from their windows. As the stranger sniffed the "broth" and licked his lips in anticipation, hunger began to overcome their fear. "Ahh," the stranger said to himself rather loudly, "I do like a tasty stone soup. Of course, stone soup with cabbage -- that's hard to beat." Soon a villager approached hesitantly, holding a small cabbage he'd retrieved from its hiding place, and added it to the pot. "Wonderful!!" cried the stranger. "You know, I once had stone soup with cabbage and a bit of salt beef as well, and it was fit for a king." The village butcher managed to find some salt beef . . . And so it went, through potatoes, onions, carrots, mushrooms, and so on, until there was indeed a delicious meal for everyone in the village to share. The village elder offered the stranger a great deal of money for the magic stone, but he refused to sell it and traveled on the next day. As he left, the stranger came upon a group of village children standing near the road. He gave the silken bag containing the stone to the youngest child, whispering to a group, "It was not the stone, but the villagers that had performed the magic." </span><br /> +<span class='quote'>A kindly, old stranger was walking through the land when he came upon a village. As he entered, the villagers moved towards their homes, locking doors and windows. The stranger smiled and asked, why are you all so frightened. I am a simple traveler, looking for a soft place to stay for the night and a warm place for a meal. "There's not a bite to eat in the whole province," he was told. "We are weak and our children are starving. Better keep moving on." "Oh, I have everything I need," he said. "In fact, I was thinking of making some stone soup to share with all of you." He pulled an iron cauldron from his cloak, filled it with water, and began to build a fire under it. Then, with great ceremony, he drew an ordinary-looking stone from a silken bag and dropped it into the water. By now, hearing the rumor of food, most of the villagers had come out of their homes or watched from their windows. As the stranger sniffed the "broth" and licked his lips in anticipation, hunger began to overcome their fear. "Ahh," the stranger said to himself rather loudly, "I do like a tasty stone soup. Of course, stone soup with cabbage -- that's hard to beat." Soon a villager approached hesitantly, holding a small cabbage he'd retrieved from its hiding place, and added it to the pot. "Wonderful!!" cried the stranger. "You know, I once had stone soup with cabbage and a bit of salt beef as well, and it was fit for a king." The village butcher managed to find some salt beef . . . And so it went, through potatoes, onions, carrots, mushrooms, and so on, until there was indeed a delicious meal for everyone in the village to share. The village elder offered the stranger a great deal of money for the magic stone, but he refused to sell it and traveled on the next day. As he left, the stranger came upon a group of village children standing near the road. He gave the silken bag containing the stone to the youngest child, whispering to a group, "It was not the stone, but the villagers that had performed the magic." </span><br /> <br /> <span>By working together, everyone contributes what they can, achieving a greater good together.</span><br /> <br /> <span>Other book notes of mine are:</span><br /> <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 /> +<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes (You are currently reading this)</a><br /> <br /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../resources.html'>More books and other resources I found useful.</a><br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../resources.html'>More books and other resources I found useful.</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html b/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html index 91b3578a..a25f053d 100644 --- a/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html +++ b/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>Gemtexter 2.0.0 - Let's Gemtext again^2</h1><br /> <br /> -<span class=quote>Published at 2023-03-25T17:50:32+02:00</span><br /> +<span class='quote'>Published at 2023-03-25T17:50:32+02:00</span><br /> <br /> <pre> -=[ typewriters ]=- 1/98 @@ -25,9 +25,9 @@ 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 /> +<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 /> +<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 /> @@ -35,11 +35,11 @@ <br /> <h2 style='display: inline'>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 /> +<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 /> -<span>A template file name must have the suffix <span class=inlinecode>gmi.tpl</span>. A template must be put into the same directory as the Gemtext <span class=inlinecode>.gmi</span> file to be generated. Gemtexter will generate a Gemtext file <span class=inlinecode>index.gmi</span> from a given template <span class=inlinecode>index.gmi.tpl</span>. A <span class=inlinecode><<<</span> and <span class=inlinecode>>>></span> encloses a multiline template. All lines starting with <span class=inlinecode><< </span> will be evaluated as a single line of Bash code and the output will be written into the resulting Gemtext file.</span><br /> +<span>A template file name must have the suffix <span class='inlinecode'>gmi.tpl</span>. A template must be put into the same directory as the Gemtext <span class='inlinecode'>.gmi</span> file to be generated. Gemtexter will generate a Gemtext file <span class='inlinecode'>index.gmi</span> from a given template <span class='inlinecode'>index.gmi.tpl</span>. A <span class='inlinecode'><<<</span> and <span class='inlinecode'>>>></span> encloses a multiline template. All lines starting with <span class='inlinecode'><< </span> will be evaluated as a single line of Bash code and the output will be written into the resulting Gemtext file.</span><br /> <br /> -<span>For example, the template <span class=inlinecode>index.gmi.tpl</span>:</span><br /> +<span>For example, the template <span class='inlinecode'>index.gmi.tpl</span>:</span><br /> <br /> <pre> # Hello world @@ -55,7 +55,7 @@ Welcome to this capsule! >>> </pre> <br /> -<span>... results into the following <span class=inlinecode>index.gmi</span> after running <span class=inlinecode>./gemtexter --generate</span> (or <span class=inlinecode>./gemtexter --template</span>, which instructs to do only template processing and nothing else):</span><br /> +<span>... results into the following <span class='inlinecode'>index.gmi</span> after running <span class='inlinecode'>./gemtexter --generate</span> (or <span class='inlinecode'>./gemtexter --template</span>, which instructs to do only template processing and nothing else):</span><br /> <br /> <pre> # Hello world @@ -86,7 +86,7 @@ See more entries about DTail and Golang: Blablabla... </pre> <br /> -<span>... scans all other post entries with <span class=inlinecode>dtail</span> and <span class=inlinecode>golang</span> in the file name and generates a link list like this:</span><br /> +<span>... scans all other post entries with <span class='inlinecode'>dtail</span> and <span class='inlinecode'>golang</span> in the file name and generates a link list like this:</span><br /> <br /> <pre> See more entries about DTail and Golang: @@ -101,9 +101,9 @@ Blablabla... <br /> <h2 style='display: inline'>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 /> +<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 /> -<span>The sample config file <span class=inlinecode>gemtexter.conf</span> includes this as an example now; these scripts will only be executed when they actually exist:</span><br /> +<span>The sample config file <span class='inlinecode'>gemtexter.conf</span> includes this as an example now; these scripts will only be executed when they actually exist:</span><br /> <br /> <pre> declare -xr PRE_GENERATE_HOOK=./pre_generate_hook.sh @@ -112,11 +112,11 @@ declare -xr POST_PUBLISH_HOOK=./post_publish_hook.sh <br /> <h2 style='display: inline'>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 /> +<span>Gemtexter now does <span class='inlinecode'>set -euf -o pipefile</span>, which helps to eliminate bugs and to catch scripting errors sooner. Previous versions only <span class='inlinecode'>set -e</span>.</span><br /> <br /> <h2 style='display: inline'>Meta cache made obsolete</h2><br /> <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 /> +<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 /> <span>An example blog post without any publishing date looks like this:</span><br /> <br /> @@ -127,7 +127,7 @@ declare -xr POST_PUBLISH_HOOK=./post_publish_hook.sh 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 /> +<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 /> <br /> <pre> % cat gemfeed/2023-02-26-title-here.gmi @@ -140,7 +140,7 @@ The remaining content of the Gemtext file... <br /> <h2 style='display: inline'>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 /> +<span>Optionally, when the <span class='inlinecode'>xmllint</span> binary is installed, Gemtexter will perform a simple XML lint check against the Atom feed generated. This is a double-check of whether the Atom feed is a valid XML.</span><br /> <br /> <h2 style='display: inline'>More</h2><br /> <br /> @@ -148,14 +148,14 @@ The remaining content of the Gemtext file... <br /> <span>Other related posts are:</span><br /> <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^2 (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 /> +<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^2 (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 /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/2023-04-01-never-split-the-difference-book-notes.html b/gemfeed/2023-04-01-never-split-the-difference-book-notes.html index 970107cd..965ceecf 100644 --- a/gemfeed/2023-04-01-never-split-the-difference-book-notes.html +++ b/gemfeed/2023-04-01-never-split-the-difference-book-notes.html @@ -10,7 +10,7 @@ <body> <h1 style='display: inline'>"Never split the difference" book notes</h1><br /> <br /> -<span class=quote>Published at 2023-04-01T20:00:17+03:00</span><br /> +<span class='quote'>Published at 2023-04-01T20:00:17+03:00</span><br /> <br /> <span>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.</span><br /> <br /> @@ -95,7 +95,7 @@ <br /> <h2 style='display: inline'>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 /> +<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 /> <span>...then put an extreme anker.</span><br /> <br /> @@ -140,12 +140,12 @@ <br /> <span>Other book notes of mine are:</span><br /> <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 /> +<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 /> <span>E-Mail your comments to hi@paul.cyou :-)</span><br /> <br /> -<a class=textlink href='../'>Back to the main site</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | diff --git a/gemfeed/atom.xml b/gemfeed/atom.xml index 13310926..2b23b61a 100644 --- a/gemfeed/atom.xml +++ b/gemfeed/atom.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> - <updated>2023-04-03T23:19:57+03:00</updated> + <updated>2023-04-08T12:32:07+03:00</updated> <title>foo.zone feed</title> <subtitle>To be in the .zone!</subtitle> <link href="https://foo.zone/gemfeed/atom.xml" rel="self" /> @@ -18,9 +18,12 @@ <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>"Never split the difference" book notes</h1> -<p class="quote"><i>Published at 2023-04-01T20:00:17+03:00</i></p> -<p>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.</p> + <h1 style='display: inline'>"Never split the difference" book notes</h1><br /> +<br /> +<span class='quote'>Published at 2023-04-01T20:00:17+03:00</span><br /> +<br /> +<span>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.</span><br /> +<br /> <pre> ,.......... .........., ,..,' '.' ',.., @@ -32,77 +35,106 @@ '''''''''''''''''';''';'''''''''''''''''' ''' </pre> -<h2>Tactical listening, spreading empathy</h2> -<p>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.</p> +<br /> +<h2 style='display: inline'>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 /> <ul> <li>A mirror needs space and silence between the words. At least 4 seconds.</li> <li>A mirror might be awkward to be used at first, especially with a question coupled to it.</li> <li>We fear what's different and are drawn to what is similar.</li> -</ul> -<p>Mirror training is like Jedi training. Simple but effective. A mirror needs space. Be silent after "you want this?" </p> -<h2>Mindset of discovery</h2> -<p>Try to have multiple realities in your mind and use facts to distinguish between real and false.</p> +</ul><br /> +<span>Mirror training is like Jedi training. Simple but effective. A mirror needs space. Be silent after "you want this?" </span><br /> +<br /> +<h2 style='display: inline'>Mindset of discovery</h2><br /> +<br /> +<span>Try to have multiple realities in your mind and use facts to distinguish between real and false.</span><br /> +<br /> <ul> <li>Focus on what the counterpart has to say and what he needs and wants. Understanding him makes him vulnerable.</li> <li>Empathy understanding the other person from his perspective, but it does not mean agreeing with him.</li> <li>Detect and label the emotions of others for your powers. </li> <li>To be understood seems to solve all problems magically.</li> -</ul> -<p>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?"</p> -<h3>More tips </h3> +</ul><br /> +<span>Try: to put a label on someone's emotion and then be silent. Wait for the other to reveal himself. "You seem unhappy about this?"</span><br /> +<br /> +<h3 style='display: inline'>More tips </h3><br /> +<br /> <ul> <li>Put on a poker face and don't show emotions.</li> <li>Slow things down. Don't be a problem solver.</li> <li>Smile while you are talking, even on the phone. Be easy and encouraging.</li> <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> -<h2>"No" starts the conversation</h2> -<p>When the opponent starts with a "no", he feels in control and comfortable. That's why he has to start with "no".</p> +</ul><br /> +<h2 style='display: inline'>"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 /> <ul> <li>"Yes" and "maybe" might be worthless, but "no" starts the conversation.</li> <li>If someone is saying "no" to you, he will be open to what you have to say next.</li> <li>"No" is not stopping the negotiation but will open up opportunities you were not thinking about before.</li> <li>Start with "no". Great negotiators seek "no" because that's when the great discussions begin.</li> <li>A "no" can be scary if you are not used to it. If your biggest fear is "no", then you can't negotiate.</li> -</ul> -<p>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".</p> -<h2>Win-win</h2> -<p>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.</p> -<h2>On Deadlines</h2> +</ul><br /> +<span>Get a "That's right" when negotiating. Don't get a "you're right". You can summarise the opponent to get a "that's right".</span><br /> +<br /> +<h2 style='display: inline'>Win-win</h2><br /> +<br /> +<span>Win-win is a naive approach when encountering the win-lose counterpart, but always cooperate. Don't compromise, and don't split the difference. We don't compromise because it's right; we do it because it is easy. You must embrace the hard stuff; that's where the great deals are.</span><br /> +<br /> +<h2 style='display: inline'>On Deadlines</h2><br /> +<br /> <ul> <li>All deadlines are imaginary.</li> <li>Most of the time, deadlines unsettle us without a good reason.</li> <li>They push a deal to a conclusion.</li> <li>They rush the counterpart to cause pressure and anxiety.</li> -</ul> -<h2>Analyse the opponent</h2> +</ul><br /> +<h2 style='display: inline'>Analyse the opponent</h2><br /> +<br /> <ul> <li>Understand the motivation of people behind the table as well.</li> <li>Ask how affected they will be.</li> <li>Determine your and the opposite negotiation style. Accommodation, analyst, assertive.</li> <li>Treat them how they need to be treated.</li> -</ul> -<p>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.</p> -<h2>Use different ways of saying "no."</h2> -<p class="quote"><i>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.... </i></p> -<p>...then put an extreme anker.</p> -<p>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.</p> -<h2>Calibrated question</h2> -<p>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</p> -<p>Being calm and respectful is essential. Without control of your emotions, it won't work. The counterpart will have no idea how constrained they are with your question. Avoid questions which get a yes or short answers. Use "why?".</p> -<p>Counterparts are more involved if these are their solutions. The counterpart must answer with "that's right", not "you are right". He has to own the problem. If not, then add more why questions.</p> +</ul><br /> +<span>The person on the other side is never the issue; the problem is the issue. Keep this in mind to avoid emotional issues with the person and focus on the problem, not the person. The bond is essential; never create an enemy.</span><br /> +<br /> +<h2 style='display: inline'>Use different ways of saying "no."</h2><br /> +<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 /> +<span>...then put an extreme anker.</span><br /> +<br /> +<span>You always have to embrace thoughtful confrontation for good negotiation and life. Don't avoid honest, clear conflict. It will give you the best deals. Compromises are mostly bad deals for both sides. Most people don't negotiate a win-win but a win-lose. Know the best and worst outcomes and what is acceptable for you.</span><br /> +<br /> +<h2 style='display: inline'>Calibrated question</h2><br /> +<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 /> +<span>Being calm and respectful is essential. Without control of your emotions, it won't work. The counterpart will have no idea how constrained they are with your question. Avoid questions which get a yes or short answers. Use "why?".</span><br /> +<br /> +<span>Counterparts are more involved if these are their solutions. The counterpart must answer with "that's right", not "you are right". He has to own the problem. If not, then add more why questions.</span><br /> +<br /> <ul> <li>Tone and body language need to align with what people are saying.</li> <li>Deal with it via a labelled question. </li> <li>Liers tend to talk with "them" and "their" and not with "I".</li> <li>Also, liars tend to talk in complex sentences.</li> -</ul> -<p>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".</p> -<h2>The black swan </h2> -<p>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.</p> -<h2>More</h2> -<p>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.</p> +</ul><br /> +<span>Prepare 3 to 5 calibrated questions for your counterpart. Be curious what is really motivating the other side. You can get out the "Black Swan".</span><br /> +<br /> +<h2 style='display: inline'>The black swan </h2><br /> +<br /> +<span>What we don't know can break our deal. Uncovering it can bring us unexpected success. You get what you ask for in this world, but you must learn to ask correctly. Reveal the black swan by asking questions.</span><br /> +<br /> +<h2 style='display: inline'>More</h2><br /> +<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 /> <ul> <li>Give an unexpected gift, e.g. show them my pet project and publicity for engineering.</li> <li>Use an odd number, which makes you seem to have thought a lot about the sum and calculated it.</li> @@ -113,13 +145,17 @@ <li>Tactical empathy, listening as a martial art. It is emotional intelligence on steroids.</li> <li>Being right isn't the key to a successful negotiation, but having the correct mindset is.</li> <li>Don't shop the groceries when you are hungry.</li> -</ul> -<p>Slow.... it.... down....</p> -<p>Other book notes of mine are:</p> -<a class="textlink" href="https://foo.zone/gemfeed/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="https://foo.zone/gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.html">2023-03-16 "The Pragmatic Programmer" book notes</a><br /> -<p>E-Mail your comments to hi@paul.cyou :-)</p> -<a class="textlink" href="../">Back to the main site</a><br /> +</ul><br /> +<span>Slow.... it.... down....</span><br /> +<br /> +<span>Other book notes of mine are:</span><br /> +<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 /> +<span>E-Mail your comments to hi@paul.cyou :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> </entry> @@ -135,8 +171,10 @@ <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>Gemtexter 2.0.0 - Let's Gemtext again^2</h1> -<p class="quote"><i>Published at 2023-03-25T17:50:32+02:00</i></p> + <h1 style='display: inline'>Gemtexter 2.0.0 - Let's Gemtext again^2</h1><br /> +<br /> +<span class='quote'>Published at 2023-03-25T17:50:32+02:00</span><br /> +<br /> <pre> -=[ typewriters ]=- 1/98 @@ -149,14 +187,23 @@ jgs `"""""""""` |o=======.| mod. by Paul Buetow `"""""""""` </pre> -<p>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.</p> -<a class="textlink" href="https://codeberg.org/snonux/gemtexter">https://codeberg.org/snonux/gemtexter</a><br /> -<p>This is a new major release, so it contains a breaking change (see "Meta cache made obsolete").</p> -<p>Let's list what's new!</p> -<h2>Minimal template engine</h2> -<p>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.</p> -<p>A template file name must have the suffix <span class="inlinecode">gmi.tpl</span>. A template must be put into the same directory as the Gemtext <span class="inlinecode">.gmi</span> file to be generated. Gemtexter will generate a Gemtext file <span class="inlinecode">index.gmi</span> from a given template <span class="inlinecode">index.gmi.tpl</span>. A <span class="inlinecode"><<<</span> and <span class="inlinecode">>>></span> encloses a multiline template. All lines starting with <span class="inlinecode"><< </span> will be evaluated as a single line of Bash code and the output will be written into the resulting Gemtext file.</p> -<p>For example, the template <span class="inlinecode">index.gmi.tpl</span>:</p> +<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 /> +<h2 style='display: inline'>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 /> +<span>A template file name must have the suffix <span class='inlinecode'>gmi.tpl</span>. A template must be put into the same directory as the Gemtext <span class='inlinecode'>.gmi</span> file to be generated. Gemtexter will generate a Gemtext file <span class='inlinecode'>index.gmi</span> from a given template <span class='inlinecode'>index.gmi.tpl</span>. A <span class='inlinecode'><<<</span> and <span class='inlinecode'>>>></span> encloses a multiline template. All lines starting with <span class='inlinecode'><< </span> will be evaluated as a single line of Bash code and the output will be written into the resulting Gemtext file.</span><br /> +<br /> +<span>For example, the template <span class='inlinecode'>index.gmi.tpl</span>:</span><br /> +<br /> <pre> # Hello world @@ -170,7 +217,9 @@ Welcome to this capsule! done >>> </pre> -<p>... results into the following <span class="inlinecode">index.gmi</span> after running <span class="inlinecode">./gemtexter --generate</span> (or <span class="inlinecode">./gemtexter --template</span>, which instructs to do only template processing and nothing else):</p> +<br /> +<span>... results into the following <span class='inlinecode'>index.gmi</span> after running <span class='inlinecode'>./gemtexter --generate</span> (or <span class='inlinecode'>./gemtexter --template</span>, which instructs to do only template processing and nothing else):</span><br /> +<br /> <pre> # Hello world @@ -189,7 +238,9 @@ Multiline template line 8 Multiline template line 9 Multiline template line 10 </pre> -<p>Another thing you can do is insert an index with links to similar blog posts. E.g.:</p> +<br /> +<span>Another thing you can do is insert an index with links to similar blog posts. E.g.:</span><br /> +<br /> <pre> See more entries about DTail and Golang: @@ -197,7 +248,9 @@ See more entries about DTail and Golang: Blablabla... </pre> -<p>... scans all other post entries with <span class="inlinecode">dtail</span> and <span class="inlinecode">golang</span> in the file name and generates a link list like this:</p> +<br /> +<span>... scans all other post entries with <span class='inlinecode'>dtail</span> and <span class='inlinecode'>golang</span> in the file name and generates a link list like this:</span><br /> +<br /> <pre> See more entries about DTail and Golang: @@ -208,25 +261,37 @@ See more entries about DTail and Golang: Blablabla... </pre> -<h2>Added hooks</h2> -<p>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>.</p> -<p>The sample config file <span class="inlinecode">gemtexter.conf</span> includes this as an example now; these scripts will only be executed when they actually exist:</p> +<br /> +<h2 style='display: inline'>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 /> +<span>The sample config file <span class='inlinecode'>gemtexter.conf</span> includes this as an example now; these scripts will only be executed when they actually exist:</span><br /> +<br /> <pre> declare -xr PRE_GENERATE_HOOK=./pre_generate_hook.sh declare -xr POST_PUBLISH_HOOK=./post_publish_hook.sh </pre> -<h2>Use of safer Bash options</h2> -<p>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>.</p> -<h2>Meta cache made obsolete</h2> -<p>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.</p> -<p>An example blog post without any publishing date looks like this:</p> +<br /> +<h2 style='display: inline'>Use of safer Bash options</h2><br /> +<br /> +<span>Gemtexter now does <span class='inlinecode'>set -euf -o pipefile</span>, which helps to eliminate bugs and to catch scripting errors sooner. Previous versions only <span class='inlinecode'>set -e</span>.</span><br /> +<br /> +<h2 style='display: inline'>Meta cache made obsolete</h2><br /> +<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 /> +<span>An example blog post without any publishing date looks like this:</span><br /> +<br /> <pre> % cat gemfeed/2023-02-26-title-here.gmi # Title here The remaining content of the Gemtext file... </pre> -<p>Gemtexter will add a line starting with <span class="inlinecode">> Published at ...</span> now. Any subsequent Atom feed generation will then use that date.</p> +<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 /> +<br /> <pre> % cat gemfeed/2023-02-26-title-here.gmi # Title here @@ -235,17 +300,25 @@ The remaining content of the Gemtext file... The remaining content of the Gemtext file... </pre> -<h2>XMLLint support</h2> -<p>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.</p> -<h2>More</h2> -<p>Additionally, there were a couple of bug fixes, refactorings and overall improvements in the documentation made. </p> -<p>Other related posts are:</p> -<a class="textlink" href="https://foo.zone/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html">2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again^2 (You are currently reading this)</a><br /> -<a class="textlink" href="https://foo.zone/gemfeed/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="https://foo.zone/gemfeed/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="https://foo.zone/gemfeed/2021-04-24-welcome-to-the-geminispace.html">2021-04-24 Welcome to the Geminispace</a><br /> -<p>E-Mail your comments to hi@paul.cyou :-)</p> -<a class="textlink" href="../">Back to the main site</a><br /> +<br /> +<h2 style='display: inline'>XMLLint support</h2><br /> +<br /> +<span>Optionally, when the <span class='inlinecode'>xmllint</span> binary is installed, Gemtexter will perform a simple XML lint check against the Atom feed generated. This is a double-check of whether the Atom feed is a valid XML.</span><br /> +<br /> +<h2 style='display: inline'>More</h2><br /> +<br /> +<span>Additionally, there were a couple of bug fixes, refactorings and overall improvements in the documentation made. </span><br /> +<br /> +<span>Other related posts are:</span><br /> +<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^2 (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 /> +<span>E-Mail your comments to hi@paul.cyou :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> </entry> @@ -261,9 +334,12 @@ The remaining content of the Gemtext file... <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>"The Pragmatic Programmer" book notes</h1> -<p class="quote"><i>Published at 2023-03-16T00:55:20+02:00</i></p> -<p>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.</p> + <h1 style='display: inline'>"The Pragmatic Programmer" book notes</h1><br /> +<br /> +<span class='quote'>Published at 2023-03-16T00:55:20+02:00</span><br /> +<br /> +<span>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.</span><br /> +<br /> <pre> ,.......... .........., ,..,' '.' ',.., @@ -275,58 +351,81 @@ The remaining content of the Gemtext file... '''''''''''''''''';''';'''''''''''''''''' ''' </pre> -<p>Think about your work while doing it - every day on every project. Have a feeling of continuous improvement. </p> +<br /> +<span>Think about your work while doing it - every day on every project. Have a feeling of continuous improvement. </span><br /> +<br /> <ul> <li>Be a realist.</li> <li>Smell challenges.</li> <li>Care about your craft.</li> <li>Code can always be flawed, but it can meet the requirements.</li> <li>You should be proud of your code, though.</li> -</ul> -<p>No one writes perfect code, including you. However:</p> +</ul><br /> +<span>No one writes perfect code, including you. However:</span><br /> +<br /> <ul> <li>Paranoia is good thinking.</li> <li>Practice defensive programming and crash early.</li> <li>Crashing is often the best thing you can do. </li> <li>Changes should be reversible.</li> -</ul> -<p>Erlang: Defensive programming is a waste of time. Let it crash. "This can never happen" - don't practise that kind of self-deception when programming. </p> -<p>Leave assertions in the code, even in production. Only leave out the assertions causing the performance issues.</p> -<p>Take small steps, always. Get feedback, too, for each of the steps the code does. Avoid fortune telling. If you have to involve in it, then the step is too large.</p> -<p>Decouple the code (e.g. OOP or functional programming). Prefer interfaces for types and mixins for a class extension over class inheritance.</p> +</ul><br /> +<span>Erlang: Defensive programming is a waste of time. Let it crash. "This can never happen" - don't practise that kind of self-deception when programming. </span><br /> +<br /> +<span>Leave assertions in the code, even in production. Only leave out the assertions causing the performance issues.</span><br /> +<br /> +<span>Take small steps, always. Get feedback, too, for each of the steps the code does. Avoid fortune telling. If you have to involve in it, then the step is too large.</span><br /> +<br /> +<span>Decouple the code (e.g. OOP or functional programming). Prefer interfaces for types and mixins for a class extension over class inheritance.</span><br /> +<br /> <ul> <li>Refactor now and not later.</li> <li>Later, it will be even more painful.</li> -</ul> -<p>Don't think outside the box. Find the box. The box is more extensive than you think. Think about the hard problem at hand. Do you have to do it a certain way, or do you have to do it at all?</p> -<p>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.</p> -<h2>Continuous learning</h2> -<p>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.</p> +</ul><br /> +<span>Don't think outside the box. Find the box. The box is more extensive than you think. Think about the hard problem at hand. Do you have to do it a certain way, or do you have to do it at all?</span><br /> +<br /> +<span>Do what works and not what's fashionable. E.g. does SCRUM make sense? The goal is to deliver deliverables and not to "become" agile.</span><br /> +<br /> +<h2 style='display: inline'>Continuous learning</h2><br /> +<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 /> <ul> <li>Learn a new programming language every year.</li> <li>Read a technical book every month.</li> <li>Take courses.</li> -</ul> -<p>Think critically about everything you learn. Use paper for your notes. There is something special about it.</p> -<h2>Stay connected</h2> -<p>It's your life, and you own it. Bruce Lee once said: </p> -<p class="quote"><i>"I am not on the world to life after your expectations, neither are you to life after mine."</i></p> +</ul><br /> +<span>Think critically about everything you learn. Use paper for your notes. There is something special about it.</span><br /> +<br /> +<h2 style='display: inline'>Stay connected</h2><br /> +<br /> +<span>It's your life, and you own it. Bruce Lee once said: </span><br /> +<br /> +<span class='quote'>"I am not on the world to life after your expectations, neither are you to life after mine."</span><br /> +<br /> <ul> <li>Go to meet-ups and actively engage.</li> <li>Stay current.</li> <li>Dealing with computers is hard. Dealing with people is harder. </li> -</ul> -<p>It's your life. Share it, celebrate it, be proud and have fun.</p> -<h2>The story of stone soup</h2> -<p>How to motivate others to contribute something (e.g. ideas to a startup):</p> -<p class="quote"><i>A kindly, old stranger was walking through the land when he came upon a village. As he entered, the villagers moved towards their homes, locking doors and windows. The stranger smiled and asked, why are you all so frightened. I am a simple traveler, looking for a soft place to stay for the night and a warm place for a meal. "There's not a bite to eat in the whole province," he was told. "We are weak and our children are starving. Better keep moving on." "Oh, I have everything I need," he said. "In fact, I was thinking of making some stone soup to share with all of you." He pulled an iron cauldron from his cloak, filled it with water, and began to build a fire under it. Then, with great ceremony, he drew an ordinary-looking stone from a silken bag and dropped it into the water. By now, hearing the rumor of food, most of the villagers had come out of their homes or watched from their windows. As the stranger sniffed the "broth" and licked his lips in anticipation, hunger began to overcome their fear. "Ahh," the stranger said to himself rather loudly, "I do like a tasty stone soup. Of course, stone soup with cabbage -- that's hard to beat." Soon a villager approached hesitantly, holding a small cabbage he'd retrieved from its hiding place, and added it to the pot. "Wonderful!!" cried the stranger. "You know, I once had stone soup with cabbage and a bit of salt beef as well, and it was fit for a king." The village butcher managed to find some salt beef . . . And so it went, through potatoes, onions, carrots, mushrooms, and so on, until there was indeed a delicious meal for everyone in the village to share. The village elder offered the stranger a great deal of money for the magic stone, but he refused to sell it and traveled on the next day. As he left, the stranger came upon a group of village children standing near the road. He gave the silken bag containing the stone to the youngest child, whispering to a group, "It was not the stone, but the villagers that had performed the magic." </i></p> -<p>By working together, everyone contributes what they can, achieving a greater good together.</p> -<p>Other book notes of mine are:</p> -<a class="textlink" href="https://foo.zone/gemfeed/2023-04-01-never-split-the-difference-book-notes.html">2023-04-01 "Never split the difference" book notes</a><br /> -<a class="textlink" href="https://foo.zone/gemfeed/2023-03-16-the-pragmatic-programmer-book-notes.html">2023-03-16 "The Pragmatic Programmer" book notes (You are currently reading this)</a><br /> -<p>E-Mail your comments to hi@paul.cyou :-)</p> -<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 /> +</ul><br /> +<span>It's your life. Share it, celebrate it, be proud and have fun.</span><br /> +<br /> +<h2 style='display: inline'>The story of stone soup</h2><br /> +<br /> +<span>How to motivate others to contribute something (e.g. ideas to a startup):</span><br /> +<br /> +<span class='quote'>A kindly, old stranger was walking through the land when he came upon a village. As he entered, the villagers moved towards their homes, locking doors and windows. The stranger smiled and asked, why are you all so frightened. I am a simple traveler, looking for a soft place to stay for the night and a warm place for a meal. "There's not a bite to eat in the whole province," he was told. "We are weak and our children are starving. Better keep moving on." "Oh, I have everything I need," he said. "In fact, I was thinking of making some stone soup to share with all of you." He pulled an iron cauldron from his cloak, filled it with water, and began to build a fire under it. Then, with great ceremony, he drew an ordinary-looking stone from a silken bag and dropped it into the water. By now, hearing the rumor of food, most of the villagers had come out of their homes or watched from their windows. As the stranger sniffed the "broth" and licked his lips in anticipation, hunger began to overcome their fear. "Ahh," the stranger said to himself rather loudly, "I do like a tasty stone soup. Of course, stone soup with cabbage -- that's hard to beat." Soon a villager approached hesitantly, holding a small cabbage he'd retrieved from its hiding place, and added it to the pot. "Wonderful!!" cried the stranger. "You know, I once had stone soup with cabbage and a bit of salt beef as well, and it was fit for a king." The village butcher managed to find some salt beef . . . And so it went, through potatoes, onions, carrots, mushrooms, and so on, until there was indeed a delicious meal for everyone in the village to share. The village elder offered the stranger a great deal of money for the magic stone, but he refused to sell it and traveled on the next day. As he left, the stranger came upon a group of village children standing near the road. He gave the silken bag containing the stone to the youngest child, whispering to a group, "It was not the stone, but the villagers that had performed the magic." </span><br /> +<br /> +<span>By working together, everyone contributes what they can, achieving a greater good together.</span><br /> +<br /> +<span>Other book notes of mine are:</span><br /> +<br /> +<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 "Never split the difference" book notes</a><br /> +<a class='textlink' href='./2023-03-16-the-pragmatic-programmer-book-notes.html'>2023-03-16 "The Pragmatic Programmer" book notes (You are currently reading this)</a><br /> +<br /> +<span>E-Mail your comments to hi@paul.cyou :-)</span><br /> +<br /> +<a class='textlink' href='../resources.html'>More books and other resources I found useful.</a><br /> +<a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> </entry> @@ -737,8 +836,10 @@ nmap ,j :call OpenJournalPage()<CR> <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>Installing DTail on OpenBSD</h1> -<p class="quote"><i>Published at 2022-10-30T11:03:19+02:00</i></p> + <h1 style='display: inline'>Installing DTail on OpenBSD</h1><br /> +<br /> +<span class='quote'>Published at 2022-10-30T11:03:19+02:00</span><br /> +<br /> <pre> ,_---~~~~~----._ _,,_,*^____ _____``*g*\"*, @@ -775,18 +876,29 @@ nmap ,j :call OpenJournalPage()<CR> / `._____V_____V' ' ' </pre> -<p>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 :-)</p> -<p> 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!</p> -<a class="textlink" href="https://dtail.dev">https://dtail.dev</a><br /> -<p>I am using Rexify for my OpenBSD automation. Check out the following article covering my Rex setup in a little bit more detail:</p> -<a class="textlink" href="https://foo.zone/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.html">Let's Encrypt with OpenBSD and Rex</a><br /> -<p>I will also mention some relevant <span class="inlinecode">Rexfile</span> snippets in this post!</p> -<h2>Compile it</h2> -<p>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:</p> +<br /> +<span>This will be a quick blog post, as I am busy with my personal life now. I have relocated to a different country and am still busy arranging things. So bear with me :-)</span><br /> +<br /> +<span> In this post, I want to give a quick overview (or how-to) about installing DTail on OpenBSD, as the official documentation only covers Red Hat and Fedora Linux! And this blog post will also be used as my reference!</span><br /> +<br /> +<a class='textlink' href='https://dtail.dev'>https://dtail.dev</a><br /> +<br /> +<span>I am using Rexify for my OpenBSD automation. Check out the following article covering my Rex setup in a little bit more detail:</span><br /> +<br /> +<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>Let's Encrypt with OpenBSD and Rex</a><br /> +<br /> +<span>I will also mention some relevant <span class='inlinecode'>Rexfile</span> snippets in this post!</span><br /> +<br /> +<h2 style='display: inline'>Compile it</h2><br /> +<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 /> <pre> $ doas pkg_add git go gmake </pre> -<p>I am happy that the Go Programming Language is readily available in the OpenBSD packaging system. Once the dependencies got installed, clone DTail and compile it:</p> +<br /> +<span>I am happy that the Go Programming Language is readily available in the OpenBSD packaging system. Once the dependencies got installed, clone DTail and compile it:</span><br /> +<br /> <pre> $ mkdir git $ cd git @@ -794,32 +906,44 @@ $ git clone https://github.com/mimecast/dtail $ cd dtail $ gmake </pre> -<p>You can verify the version by running the following command:</p> +<br /> +<span>You can verify the version by running the following command:</span><br /> +<br /> <pre> $ ./dtail --version DTail 4.1.0 Protocol 4.1 Have a lot of fun! $ file dtail dtail: ELF 64-bit LSB executable, x86-64, version 1 </pre> -<p>Now, there isn't any need anymore to keep <span class="inlinecode">git</span>, <span class="inlinecode">go</span> and <span class="inlinecode">gmake</span>, so they can be deinstalled now:</p> +<br /> +<span>Now, there isn't any need anymore to keep <span class='inlinecode'>git</span>, <span class='inlinecode'>go</span> and <span class='inlinecode'>gmake</span>, so they can be deinstalled now:</span><br /> +<br /> <pre> $ doas pkg_delete git go gmake </pre> -<p>One day I shall create an official OpenBSD port for DTail.</p> -<h2>Install it</h2> -<p>Installing the binaries is now just a matter of copying them to <span class="inlinecode">/usr/local/bin</span> as follows:</p> +<br /> +<span>One day I shall create an official OpenBSD port for DTail.</span><br /> +<br /> +<h2 style='display: inline'>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 /> <pre> $ for bin in dserver dcat dgrep dmap dtail dtailhealth; do doas cp -p $bin /usr/local/bin/$bin doas chown root:wheel /usr/local/bin/$bin done </pre> -<p>Also, we will be creating the <span class="inlinecode">_dserver</span> service user:</p> +<br /> +<span>Also, we will be creating the <span class='inlinecode'>_dserver</span> service user:</span><br /> +<br /> <pre> $ doas adduser -class nologin -group _dserver -batch _dserver $ doas usermod -d /var/run/dserver/ _dserver </pre> -<p>The OpenBSD init script is created from scratch (not part of the official DTail project). Run the following to install the bespoke script:</p> +<br /> +<span>The OpenBSD init script is created from scratch (not part of the official DTail project). Run the following to install the bespoke script:</span><br /> +<br /> <pre> $ cat <<'END' | doas tee /etc/rc.d/dserver #!/bin/ksh @@ -841,8 +965,11 @@ rc_cmd $1 & END $ doas chmod 755 /etc/rc.d/dserver </pre> -<h3>Rexification</h3> -<p>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:</p> +<br /> +<h3 style='display: inline'>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 /> <pre> desc 'Setup DTail'; task 'dtail', group => 'frontends', @@ -865,14 +992,19 @@ task 'dtail', group => 'frontends', service 'dserver', ensure => 'started'; }; </pre> -<h2>Configure it</h2> -<p>Now, DTail is fully installed but still needs to be configured. Grab the default config file from GitHub ...</p> +<br /> +<h2 style='display: inline'>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 /> <pre> $ doas mkdir /etc/dserver $ curl https://raw.githubusercontent.com/mimecast/dtail/master/samples/dtail.json.sample | doas tee /etc/dserver/dtail.json </pre> -<p>... and then edit it and adjust <span class="inlinecode">LogDir</span> in the <span class="inlinecode">Common</span> section to <span class="inlinecode">/var/log/dserver</span>. The result will look like this:</p> +<br /> +<span>... and then edit it and adjust <span class='inlinecode'>LogDir</span> in the <span class='inlinecode'>Common</span> section to <span class='inlinecode'>/var/log/dserver</span>. The result will look like this:</span><br /> +<br /> <pre> "Common": { "LogDir": "/var/log/dserver", @@ -883,8 +1015,11 @@ $ curl https://raw.githubusercontent.com/mimecast/dtail/master/samples/dtail.jso "LogLevel": "Info" } </pre> -<h3>Rexification</h3> -<p>That's as simple as adding the following to the Rex task:</p> +<br /> +<h3 style='display: inline'>Rexification</h3><br /> +<br /> +<span>That's as simple as adding the following to the Rex task:</span><br /> +<br /> <pre> file '/etc/dserver', ensure => 'directory'; @@ -896,9 +1031,13 @@ file '/etc/dserver/dtail.json', mode => '755', on_change => sub { $restart = TRUE }; </pre> -<h2>Update the key cache for it</h2> -<p>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>. </p> -<p>The following script, populating the DTail server key cache, can be run periodically via <span class="inlinecode">CRON</span>:</p> +<br /> +<h2 style='display: inline'>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 /> +<span>The following script, populating the DTail server key cache, can be run periodically via <span class='inlinecode'>CRON</span>:</span><br /> +<br /> <pre> $ cat <<'END' | doas tee /usr/local/bin/dserver-update-key-cache.sh #!/bin/ksh @@ -938,13 +1077,18 @@ echo 'All set...' END $ doas chmod 500 /usr/local/bin/dserver-update-key-cache.sh </pre> -<p>Note that the script above is a slight variation of the official DTail script. The official DTail one is a <span class="inlinecode">bash</span> script, but on OpenBSD, there's <span class="inlinecode">ksh</span>. I run it once daily by adding it to the <span class="inlinecode">daily.local</span>:</p> +<br /> +<span>Note that the script above is a slight variation of the official DTail script. The official DTail one is a <span class='inlinecode'>bash</span> script, but on OpenBSD, there's <span class='inlinecode'>ksh</span>. I run it once daily by adding it to the <span class='inlinecode'>daily.local</span>:</span><br /> +<br /> <pre> $ echo /usr/local/bin/dserver-update-key-cache.sh | doas tee -a /etc/daily.local /usr/local/bin/dserver-update-key-cache.sh </pre> -<h3>Rexification</h3> -<p>That's done by adding ...</p> +<br /> +<h3 style='display: inline'>Rexification</h3><br /> +<br /> +<span>That's done by adding ...</span><br /> +<br /> <pre> file '/usr/local/bin/dserver-update-key-cache.sh', content => template('./scripts/dserver-update-key-cache.sh.tpl'), @@ -954,9 +1098,13 @@ file '/usr/local/bin/dserver-update-key-cache.sh', append_if_no_such_line '/etc/daily.local', '/usr/local/bin/dserver-update-key-cache.sh'; </pre> -<p>... to the Rex task!</p> -<h2>Start it</h2> -<p>Now, it's time to enable and start the DTail server:</p> +<br /> +<span>... to the Rex task!</span><br /> +<br /> +<h2 style='display: inline'>Start it</h2><br /> +<br /> +<span>Now, it's time to enable and start the DTail server:</span><br /> +<br /> <pre> $ sudo rcctl enable dserver $ sudo rcctl start dserver @@ -978,7 +1126,9 @@ INFO|1022-090739|86050|stats.go:53|2|11|7|||MAPREDUCE:STATS|currentConnections=0 . Ctr+C </pre> -<p>As we don't want to wait until tomorrow, let's populate the key cache manually:</p> +<br /> +<span>As we don't want to wait until tomorrow, let's populate the key cache manually:</span><br /> +<br /> <pre> $ doas /usr/local/bin/dserver-update-key-cache.sh Updating SSH key cache @@ -990,9 +1140,13 @@ Caching /home/paul/.ssh/authorized_keys -> /var/cache/dserver/paul.authorized Caching /home/rex/.ssh/authorized_keys -> /var/cache/dserver/rex.authorized_keys All set... </pre> -<h2>Use it</h2> -<p>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.</p> -<p>I have installed DTail server this way on my personal OpenBSD frontends <span class="inlinecode">blowfish</span>, and <span class="inlinecode">fishfinger</span>, and the following command connects as user <span class="inlinecode">rex</span> to both machines and greps the file <span class="inlinecode">/etc/fstab</span> for the string <span class="inlinecode">local</span>:</p> +<br /> +<h2 style='display: inline'>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 /> +<span>I have installed DTail server this way on my personal OpenBSD frontends <span class='inlinecode'>blowfish</span>, and <span class='inlinecode'>fishfinger</span>, and the following command connects as user <span class='inlinecode'>rex</span> to both machines and greps the file <span class='inlinecode'>/etc/fstab</span> for the string <span class='inlinecode'>local</span>:</span><br /> +<br /> <pre> ❯ ./dgrep -user rex -servers blowfish.buetow.org,fishfinger.buetow.org --regex local /etc/fstab CLIENT|earth|WARN|Encountered unknown host|{blowfish.buetow.org:2222 0xc0000a00f0 0xc0000a61e0 [blowfish.buetow.org]:2222 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9ZnF/LAk14SgqCzk38yENVTNfqibcluMTuKx1u53cKSp2xwHWzy0Ni5smFPpJDIQQljQEJl14ZdXvhhjp1kKHxJ79ubqRtIXBlC0PhlnP8Kd+mVLLHYpH9VO4rnaSfHE1kBjWkI7U6lLc6ks4flgAgGTS5Bb7pLAjwdWg794GWcnRh6kSUEQd3SftANqQLgCunDcP2Vc4KR9R78zBmEzXH/OPzl/ANgNA6wWO2OoKKy2VrjwVAab6FW15h3Lr6rYIw3KztpG+UMmEj5ReexIjXi/jUptdnUFWspvAmzIl6kwzzF8ExVyT9D75JRuHvmxXKKjyJRxqb8UnSh2JD4JN [23.88.35.144]:2222 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9ZnF/LAk14SgqCzk38yENVTNfqibcluMTuKx1u53cKSp2xwHWzy0Ni5smFPpJDIQQljQEJl14ZdXvhhjp1kKHxJ79ubqRtIXBlC0PhlnP8Kd+mVLLHYpH9VO4rnaSfHE1kBjWkI7U6lLc6ks4flgAgGTS5Bb7pLAjwdWg794GWcnRh6kSUEQd3SftANqQLgCunDcP2Vc4KR9R78zBmEzXH/OPzl/ANgNA6wWO2OoKKy2VrjwVAab6FW15h3Lr6rYIw3KztpG+UMmEj5ReexIjXi/jUptdnUFWspvAmzIl6kwzzF8ExVyT9D75JRuHvmxXKKjyJRxqb8UnSh2JD4JN 0xc0000a2180} @@ -1004,24 +1158,34 @@ CLIENT|earth|INFO|Added hosts to known hosts file|/home/paul/.ssh/known_hosts REMOTE|blowfish|100|7|fstab|31bfd9d9a6788844.h /usr/local ffs rw,wxallowed,nodev 1 2 REMOTE|fishfinger|100|7|fstab|093f510ec5c0f512.h /usr/local ffs rw,wxallowed,nodev 1 2 </pre> -<p>Running it the second time, and given that you trusted the keys the first time, it won't prompt you for the host keys anymore:</p> +<br /> +<span>Running it the second time, and given that you trusted the keys the first time, it won't prompt you for the host keys anymore:</span><br /> +<br /> <pre> ❯ ./dgrep -user rex -servers blowfish.buetow.org,fishfinger.buetow.org --regex local /etc/fstab REMOTE|blowfish|100|7|fstab|31bfd9d9a6788844.h /usr/local ffs rw,wxallowed,nodev 1 2 REMOTE|fishfinger|100|7|fstab|093f510ec5c0f512.h /usr/local ffs rw,wxallowed,nodev 1 2 </pre> -<h2>Conclusions</h2> -<p>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!</p> -<p>Check out the following for more information:</p> -<a class="textlink" href="https://dtail.dev">https://dtail.dev</a><br /> -<a class="textlink" href="https://github.com/mimecast/dtail">https://github.com/mimecast/dtail</a><br /> -<a class="textlink" href="https://www.rexify.org">https://www.rexify.org</a><br /> -<p>Other related posts are:</p> -<a class="textlink" href="https://foo.zone/gemfeed/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="https://foo.zone/gemfeed/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="https://foo.zone/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.html">2021-04-22 DTail - The distributed log tail program</a><br /> -<p>E-Mail your comments to hi@paul.cyou :-)</p> -<a class="textlink" href="../">Back to the main site</a><br /> +<br /> +<h2 style='display: inline'>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 /> +<span>Check out the following for more information:</span><br /> +<br /> +<a class='textlink' href='https://dtail.dev'>https://dtail.dev</a><br /> +<a class='textlink' href='https://github.com/mimecast/dtail'>https://github.com/mimecast/dtail</a><br /> +<a class='textlink' href='https://www.rexify.org'>https://www.rexify.org</a><br /> +<br /> +<span>Other related posts are:</span><br /> +<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 /> +<span>E-Mail your comments to hi@paul.cyou :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> </entry> @@ -1112,8 +1276,10 @@ jgs (________\ \ <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>Gemtexter 1.1.0 - Let's Gemtext again</h1> -<p class="quote"><i>Published at 2022-08-27T18:25:57+01:00</i></p> + <h1 style='display: inline'>Gemtexter 1.1.0 - Let's Gemtext again</h1><br /> +<br /> +<span class='quote'>Published at 2022-08-27T18:25:57+01:00</span><br /> +<br /> <pre> -=[ typewriter ]=- 1/98 @@ -1125,12 +1291,19 @@ jgs (________\ \ |o=======.| jgs `"""""""""` </pre> -<p>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.</p> -<a class="textlink" href="https://codeberg.org/snonux/gemtexter">https://codeberg.org/snonux/gemtexter</a><br /> -<p>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.</p> -<h2>What's new?</h2> -<h3>Automatic check for GNU version requirements</h3> -<p>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:</p> +<br /> +<span>I proudly announce that I've released Gemtexter version <span class='inlinecode'>1.1.0</span>. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash.</span><br /> +<br /> +<a class='textlink' href='https://codeberg.org/snonux/gemtexter'>https://codeberg.org/snonux/gemtexter</a><br /> +<br /> +<span>It has been around a year since I released the first version <span class='inlinecode'>1.0.0</span>. Although, there aren't any groundbreaking changes, there have been a couple of smaller commits and adjustments. I was quite surprised that I received a bunch of feedback and requests about Gemtexter so it means that I am not the only person in the universe actually using it.</span><br /> +<br /> +<h2 style='display: inline'>What's new?</h2><br /> +<br /> +<h3 style='display: inline'>Automatic check for GNU version requirements</h3><br /> +<br /> +<span>Gemtexter relies on the GNU versions of the tools <span class='inlinecode'>grep</span>, <span class='inlinecode'>sed</span> and <span class='inlinecode'>date</span> and it also requires the Bash shell in version 5 at least. That's now done in the <span class='inlinecode'>check_dependencies()</span> function:</span><br /> +<br /> <pre> check_dependencies () { # At least, Bash 5 is required @@ -1150,34 +1323,56 @@ check_dependencies () { done } </pre> -<p>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.</p> -<h3>Backticks now produce <span class="inlinecode">inline code blocks</span> in the HTML output</h3> -<p>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.</p> -<h3>Cache for Atom feed generation</h3> -<p>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.</p> -<h3>Input filter support</h3> -<p>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:</p> +<br /> +<span>Especially macOS users didn't read the <span class='inlinecode'>README</span> carefully enough to install GNU Grep, GNU Sed and GNU Date before using Gemtexter.</span><br /> +<br /> +<h3 style='display: inline'>Backticks now produce <span class='inlinecode'>inline code blocks</span> in the HTML output</h3><br /> +<br /> +<span>The Gemtext format doesn't support inline code blocks, but Gemtexter now produces <span class='inlinecode'>inline code blocks</span> (means, small code fragments can be placed in the middle of a paragraph) in the HTML output when the code block is enclosed with Backticks. There were no adjustments required for the Markdown output format, because Markdown supports it already out of the box.</span><br /> +<br /> +<h3 style='display: inline'>Cache for Atom feed generation</h3><br /> +<br /> +<span>The Bash is not the most performant language. Gemtexter already takes a couple of seconds only to generate the Atom feed for around two hand full of articles on my slightly underpowered Surface Go 2 Linux tablet. Therefore, I introduced a cache, so that subsequent Atom feed generation runs finish much quicker. The cache uses a checksum of the Gemtext <span class='inlinecode'>.gmi</span> file to decide whether anything of the content has changed or not.</span><br /> +<br /> +<h3 style='display: inline'>Input filter support</h3><br /> +<br /> +<span>Once your capsule reaches a certain size, it can become annoying to re-generate everything if you only want to preview the HTML or Markdown output of one single content file. The following will add a filter to only generate the files matching a regular expression:</span><br /> +<br /> <pre> ./gemtexter --generate '.*hello.*' </pre> -<h3>Revamped <span class="inlinecode">git</span> support</h3> -<p>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.</p> -<h3>Addition of <span class="inlinecode">htmlextras</span> and web font support</h3> -<p>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.</p> -<h3>Sub-section support</h3> -<p>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.:</p> -<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 /> -<h3>More</h3> -<p>Additionally, there were a couple of bug fixes, refactorings and overall improvements in the documentation made. </p> -<p>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.</p> -<p>Other related posts are:</p> -<a class="textlink" href="https://foo.zone/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html">2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again^2</a><br /> -<a class="textlink" href="https://foo.zone/gemfeed/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="https://foo.zone/gemfeed/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="https://foo.zone/gemfeed/2021-04-24-welcome-to-the-geminispace.html">2021-04-24 Welcome to the Geminispace</a><br /> -<p>E-Mail your comments to hi@paul.cyou :-)</p> -<a class="textlink" href="../">Back to the main site</a><br /> +<br /> +<h3 style='display: inline'>Revamped <span class='inlinecode'>git</span> support</h3><br /> +<br /> +<span>The Git support has been completely rewritten. It's now more reliable and faster too. Have a look at the <span class='inlinecode'>README</span> for more information.</span><br /> +<br /> +<h3 style='display: inline'>Addition of <span class='inlinecode'>htmlextras</span> and web font support</h3><br /> +<br /> +<span>The <span class='inlinecode'>htmlextras</span> folder now contains all extra files required for the HTML output format such as cascading style sheet (CSS) files and web fonts.</span><br /> +<br /> +<h3 style='display: inline'>Sub-section support</h3><br /> +<br /> +<span>It's now possible to define sub-sections within a Gemtexter capsule. For the HTML output, each sub-section can use its own CSS and web font definitions. E.g.:</span><br /> +<br /> +<a class='textlink' href='https://foo.zone'>The foo.zone main site</a><br /> +<a class='textlink' href='https://foo.zone/notes'>The notes sub-section (with different fonts)</a><br /> +<br /> +<h3 style='display: inline'>More</h3><br /> +<br /> +<span>Additionally, there were a couple of bug fixes, refactorings and overall improvements in the documentation made. </span><br /> +<br /> +<span>Overall I think it's a pretty solid <span class='inlinecode'>1.1.0</span> release without anything groundbreaking (therefore no major version jump). But I am happy about it.</span><br /> +<br /> +<span>Other related posts are:</span><br /> +<br /> +<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again^2</a><br /> +<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again (You are currently reading this)</a><br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> +<a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace</a><br /> +<br /> +<span>E-Mail your comments to hi@paul.cyou :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> </entry> @@ -2043,105 +2238,156 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <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>Perl is still a great choice</h1> -<p class="quote"><i>Published at 2022-05-27T07:50:12+01:00; Updated at 2023-01-28</i></p> -<a href="https://foo.zone/gemfeed/2022-05-27-perl-is-still-a-great-choice/regular_expressions.png"><img alt="Comic source: XKCD" title="Comic source: XKCD" src="https://foo.zone/gemfeed/2022-05-27-perl-is-still-a-great-choice/regular_expressions.png" /></a><br /> -<p>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.</p> -<p>Unfortunately (it makes me sad), Perl's popularity has been declining over the last years as Google trends shows:</p> -<a href="https://foo.zone/gemfeed/2022-05-27-perl-is-still-a-great-choice/googletrendsperl.jpg"><img src="https://foo.zone/gemfeed/2022-05-27-perl-is-still-a-great-choice/googletrendsperl.jpg" /></a><br /> -<p>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:</p> + <h1 style='display: inline'>Perl is still a great choice</h1><br /> +<br /> +<span class='quote'>Published at 2022-05-27T07:50:12+01:00; Updated at 2023-01-28</span><br /> +<br /> +<a href='./2022-05-27-perl-is-still-a-great-choice/regular_expressions.png'><img alt='Comic source: XKCD' title='Comic source: XKCD' src='./2022-05-27-perl-is-still-a-great-choice/regular_expressions.png' /></a><br /> +<br /> +<span>Perl (the Practical Extraction and Report Language) is a battle-tested, mature, multi-paradigm dynamic programming language. Note that it's not called PERL, neither P.E.R.L. nor Pearl. "Perl" is the name of the language and <span class='inlinecode'>perl</span> the name of the interpreter or the interpreter command.</span><br /> +<br /> +<span>Unfortunately (it makes me sad), Perl's popularity has been declining over the last years as Google trends shows:</span><br /> +<br /> +<a href='./2022-05-27-perl-is-still-a-great-choice/googletrendsperl.jpg'><img src='./2022-05-27-perl-is-still-a-great-choice/googletrendsperl.jpg' /></a><br /> +<br /> +<span>So why is that? Once the de-facto standard super-glue language for the web nowadays seems to have a bad reputation. Often, people state:</span><br /> +<br /> <ul> <li>Perl is a write-only language. Nobody can read Perl code.</li> <li>Perl? Isn't it abandoned? It's still at version 5!</li> <li>Why use Perl as there are better alternatives?</li> <li>Why all the sigils? It looks like an exploding ASCII factory!!</li> -</ul> -<h2>Write-only language</h2> -<p>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.</p> -<p>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".</p> -<p>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.</p> -<p>Some good books on "good" Perl I can recommend are:</p> -<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 /> -<p>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.</p> -<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 /> -<p>Even I personally have written some poetry in Perl and experimented with a polyglot script:</p> -<a class="textlink" href="https://foo.zone/gemfeed/2008-06-26-perl-poetry.html">My very own Perl Poetry</a><br /> -<a class="textlink" href="https://foo.zone/gemfeed/2014-03-24-the-fibonacci.pl.c-polyglot.html">A Perl-Raku-C polyglot generating the Fibonacci sequence</a><br /> -<p>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).</p> -<h2>Is Perl abandoned?</h2> -<p>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:</p> -<a class="textlink" href="https://en.wikipedia.org/wiki/Perl_5_version_history">Perl 5 version history</a><br /> -<p>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:</p> -<a class="textlink" href="https://perlschool.com/books/perl-new-features/">Perl New Features by Joshua McAdams and brian d foy</a><br /> -<p>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):</p> -<a class="textlink" href="https://raku.org">The Raku Programming Language</a><br /> -<p>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:</p> +</ul><br /> +<h2 style='display: inline'>Write-only language</h2><br /> +<br /> +<span>Is Perl really a write-only language? You have to understand that Perl 5 was released in 1994 (28 years ago as of this writing) and when we refer to Perl we usually mean Perl 5. That's many years, and there are many old scripts not following the modern Perl best practices (as they didn't exist yet). So yes, legacy scripts may be difficult to read. Japanese may be difficult to read too if you don't know Japanese, though.</span><br /> +<br /> +<span>To come back to the question: Is Perl a write-only language? I don't think so. Like in any other language, you have to apply best practices in order to keep your code maintainable. Some other programming languages enforce best practices, but that makes these languages less expressive. Perl follows the principles "there is more than one way to do it" (aka TIMTOWDI) and "making easy things easy and hard things possible".</span><br /> +<br /> +<span>Perl gives the programmer more flexibility in how to do things, and this results in a stronger learning curve than for lesser expressive languages like for example Go or Python. But, like in everything in life, common sense has to be applied. You should not take TIMTOWDI to the extreme in a production piece of code. In my personal opinion, it is also more satisfying to program in an expressive language.</span><br /> +<br /> +<span>Some good books on "good" Perl I can recommend are:</span><br /> +<br /> +<a class='textlink' href='http://modernperlbooks.com'>Modern Perl</a><br /> +<a class='textlink' href='https://hop.perl.plover.com'>Higher Order Perl</a><br /> +<br /> +<span>Due to Perl's expressiveness you will find a lot of obscure code in the interweb in form of obfuscation, fancy email signatures (JAPHs), art, polyglots and even poetry in Perl syntax. But that's not what you will find in production code. That's only people having fun with the language which is different to "getting things done". The expressiveness is a bonus. It makes the Perl programmers love Perl.</span><br /> +<br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/Just_another_Perl_hacker'>JAPH</a><br /> +<a class='textlink' href='http://www.cpan.org/misc/japh'>http://www.cpan.org/misc/japh</a><br /> +<a class='textlink' href='https://www.perlmonks.org/index.pl?next=20;node_id=1590'>Perl Poetry</a><br /> +<br /> +<span>Even I personally have written some poetry in Perl and experimented with a polyglot script:</span><br /> +<br /> +<a class='textlink' href='./2008-06-26-perl-poetry.html'>My very own Perl Poetry</a><br /> +<a class='textlink' href='./2014-03-24-the-fibonacci.pl.c-polyglot.html'>A Perl-Raku-C polyglot generating the Fibonacci sequence</a><br /> +<br /> +<span>This all doesn't mean that you can't "get things done" with Perl. Quite the opposite is the case. Perl is a very pragmatic programming language and is suitable very well for rapid prototyping and any kind of small to medium-sized scripts and programs. You can write large enterprise scale application in Perl too, but that wasn't the original intend of why Perl was invented (more on that later).</span><br /> +<br /> +<h2 style='display: inline'>Is Perl abandoned?</h2><br /> +<br /> +<span>As I pointed out in the previous section, Perl 5 is around for quite some time without any new major version released. This can lead to the impression that development is not progressing and that the project is abandoned. Nothing can be further from the truth. Perl 5.000 was released in 1994 and the latest version (as of this writing) Perl 5.34.1 was released two months ago in 2022. You can check the version history on Wikipedia. You will notice releases being made regularly:</span><br /> +<br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/Perl_5_version_history'>Perl 5 version history</a><br /> +<br /> +<span>As you can see, Perl 5 is under active development. I can also recommend to have a look at the following book, it summarizes all new Perl features which showed up after Perl v5.10:</span><br /> +<br /> +<a class='textlink' href='https://perlschool.com/books/perl-new-features/'>Perl New Features by Joshua McAdams and brian d foy</a><br /> +<br /> +<span>Actually, Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it also referred to its redesigned "sister language", Perl 6, before the latter's name was officially changed to Raku in October 2019 as the differences between Perl 5 and Perl 6 were too groundbreaking. Raku would be a different topic (mostly out of scope of this blog article) but I at least wanted it to mention here. In my opinion, Raku is the "most powerful" programming language out there (I recently started learning it and intend to use it for some of my future personal programming projects):</span><br /> +<br /> +<a class='textlink' href='https://raku.org'>The Raku Programming Language</a><br /> +<br /> +<span>So it means that Perl and Raku now exist in parallel. They influence each other, but are different programming languages now. So why not just all use Raku instead of Perl? There are still a couple of reasons of why to choose Perl over Raku:</span><br /> +<br /> <ul> <li>Many programmers already know Perl and many scripts are already written in Perl. It's possible to call Perl code from Raku (either inline or as a library) and it is also possible to auto-convert Perl code into Raku code, but that's either a workaround or involves some kind of additional work.</li> -<li>Perl 5 comes with a great backwards compatibility. Perl scripts from 5.000 will generally still work on a recent version of Perl. New features usually have to be enabled via a so-called "use pragmas". For example, in order to enable sub signatures, <span class="inlinecode">use signatures;</span> has to be specified.</li> +<li>Perl 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> -<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 /> -<p>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.</p> -<p class="quote"><i>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! </i></p> -<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 /> -<p class="quote"><i>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.</i></p> -<p class="quote"><i>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>.</i></p> -<a class="textlink" href="https://www.leanpub.com/perl_new_features">Perl New Features</a><br /> -<h2>Why use Perl as there are better alternatives?</h2> -<p>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:</p> +</ul><br /> +<a class='textlink' href='https://perldoc.perl.org/feature'>Perl feature pragmas</a><br /> +<a class='textlink' href='https://www.OpenBSD.org'>The OpenBSD Operating System</a><br /> +<a class='textlink' href='https://news.ycombinator.com/item?id=23360338'>Why does OpenBSD still include Perl in its base installation?</a><br /> +<br /> +<span>The renaming of Perl 6 to Raku has now opened the door for a future Perl 7. As far as I understand, Perl 7 will be Perl 5 but with modern features enabled by default (e.g. pragmas <span class='inlinecode'>use strict;</span>, <span class='inlinecode'>use warnings;</span>, <span class='inlinecode'>use signatures;</span> and so on. Also, the hope is that a Perl 7 with modern standards will attract more beginners. There aren't many Perl jobs out there nowadays. That's mostly due to Perl's bad (bad for no real reasons) reputation.</span><br /> +<br /> +<span class='quote'>Update 2022-12-10: A reader pointed out, that <span class='inlinecode'>use v5.36;</span> already turns strict, warnings and signatures pragmas automatically on! </span><br /> +<br /> +<a class='textlink' href='https://www.perl.com/article/announcing-perl-7/'>Announcing Perl 7</a><br /> +<a class='textlink' href='http://blogs.perl.org/users/psc/2022/05/what-happened-to-perl-7.html'>What happened to Perl 7? (maybe have to use <span class='inlinecode'>use v7;</span>)</a><br /> +<br /> +<span class='quote'>Update 2022-12-10: A reader pointed out, that Perl 7 needs to provide a big improvement to earn and keep the attention for a major version bump.</span><br /> +<br /> +<span class='quote'>Update 2023-01-28: Meanwhile, I was also reading brian d foy's Perl New Feature book. It nicely presents all new features added to Perl since <span class='inlinecode'>v5.10</span>.</span><br /> +<br /> +<a class='textlink' href='https://www.leanpub.com/perl_new_features'>Perl New Features</a><br /> +<br /> +<h2 style='display: inline'>Why use Perl as there are better alternatives?</h2><br /> +<br /> +<span>Here, common sense must be applied. I don't believe there is anything like "the perfect" programming language. Everyone has got his preferred (or a set of preferred) programming language to chose from. All programming languages come with their own set of strengths and weaknesses. These are the strengths making Perl shine, and you (technically) don't need to bother to look for "better" alternatives:</span><br /> +<br /> <ul> -<li>Perl is better than Shell/AWK/SED scripts. There's a point where shell scripts become fairly complex. The next step-up is to switch to Perl. There are many different versions of shells and AWK and SED interpreters. Do you always know which versions (<span class="inlinecode">mawk</span>, <span class="inlinecode">nawk</span>, <span class="inlinecode">gawk</span>, <span class="inlinecode">sed</span>, <span class="inlinecode">gsed</span>, <span class="inlinecode">grep</span>, <span class="inlinecode">ggrep</span>...) are currently installed? These commands aren't fully compatible to each other. However, there is only one Perl 5. Simply: Perl is faster, more powerful, more expressive than any shell script can ever be, and it is also extendible through CPAN. Perl can directly talk to databases, which shell scripts can't.</li> +<li>Perl 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> -<p>About the first point, using Perl for better "shell" scripts was actually the original intend of why Perl was invented in the first place.</p> -<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 /> -<p>Here are some reasons why not to chose Perl and look for "better" alternatives:</p> +</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 gradually typed languages run in a VM (e.g. Raku) 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> -<a class="textlink" href="https://github.com/Ovid/Cor">Cor - Bringing modern OOP to the Perl Core</a><br /> -<h2>Why all the sigils? It looks like an exploding ASCII factory!!</h2> -<p>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).</p> -<p>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!</p> -<a class="textlink" href="https://www.perl.com/article/on-sigils/">https://www.perl.com/article/on-sigils/</a><br /> -<h2>Where do I personally still use perl?</h2> +</ul><br /> +<a class='textlink' href='https://github.com/Ovid/Cor'>Cor - Bringing modern OOP to the Perl Core</a><br /> +<br /> +<h2 style='display: inline'>Why all the sigils? It looks like an exploding ASCII factory!!</h2><br /> +<br /> +<span>The sigils <span class='inlinecode'>$ @ % &</span> (where Perl is famously known for) serve a purpose. They seem confusing at first, but they actually make the code better readable. <span class='inlinecode'>$scalar</span> is a scalar variable (holding a single value), <span class='inlinecode'>@array</span> is an array (holding a list of values), <span class='inlinecode'>%hash</span> holds a list of key-value pairs and <span class='inlinecode'>&sub</span> is for subroutines. A given variable <span class='inlinecode'>$ref</span> can also hold reference to something. <span class='inlinecode'>@$arrayref</span> dereferences a reference to an array, <span class='inlinecode'>%$hashref</span> to a hash, <span class='inlinecode'>$$scalarref</span> to a scalar, <span class='inlinecode'>&$subref</span> dereferences a referene to a subroutine, etc. That can be encapsulated as deep as you want. (This paragraph only scratched the surface here of what Perl can do, and there is a lot of syntactic sugar not mentioned here).</span><br /> +<br /> +<span>In most other programming languages, you won't know instantly what's the "basic type" of a given variable without looking at the variable declaration or the variable name (If named intelligently, e.g. a variable name containing a list of cats is <span class='inlinecode'>cat_list</span>). Even Ruby makes some use of sigils (<span class='inlinecode'>@</span>, <span class='inlinecode'>@@</span> and <span class='inlinecode'>$</span>), but that's for a different purpose than in Perl (in Ruby it is about object scope, class scope and global scope). Raku uses all the sigils Perl uses plus an additional bunch of twigils, e.g. <span class='inlinecode'>$.foo</span> for a scalar object variable with public accessors, <span class='inlinecode'>$!foo</span> for a private scalar object variable, <span class='inlinecode'>@.foo</span>, <span class='inlinecode'>@!foo</span>, <span class='inlinecode'>%.foo</span>, <span class='inlinecode'>%!foo</span> and so on. Sigils (and twigils) are very convenient once you get used to them. Don't let them scare you off - they are there to help you!</span><br /> +<br /> +<a class='textlink' href='https://www.perl.com/article/on-sigils/'>https://www.perl.com/article/on-sigils/</a><br /> +<br /> +<h2 style='display: inline'>Where do I personally still use perl?</h2><br /> +<br /> <ul> <li>I use Rexify for my OpenBSD server automation. Rexify is a configuration management system developed in Perl with similar features to Ansible but less bloated. It suits my personal needs perfectly.</li> <li>I have written a couple of smaller to medium-sized Perl scripts which I (mostly) still use regularly. You can find them on my Codeberg page.</li> <li>My day-to-day workflow heavily relies on "ack-grep". Ack is a tool developed in Perl aimed at programmers and can be used for quick searches on source code at the command line.</li> <li>I aim to leave my OpenBSD servers as "vanilla" as possible (trying to rely only on the standard/base installation without installing additional software from the packaging system or ports tree). All my scripts are written either Bourne shell or in Perl here. So there is no need to install additional interpreters.</li> <li>Here and there, I drop a Perl one-liner in order to get stuff done (work and personally). A wise Perl Monk would say: "One one-liner a day keeps the troubles away".</li> -</ul> -<p>Btw.: Did you know that the first version of PHP was a set of Perl snippets? Only later, PHP became an independent programming language.</p> -<a class="textlink" href="https://www.perl.org">https://www.perl.org</a><br /> -<p class="quote"><i>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!</i></p> -<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 /> -<p>Other related posts are:</p> -<a class="textlink" href="https://foo.zone/gemfeed/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="https://foo.zone/gemfeed/2011-05-07-perl-daemon-service-framework.html">2011-05-07 Perl Daemon (Service Framework)</a><br /> -<a class="textlink" href="https://foo.zone/gemfeed/2008-06-26-perl-poetry.html">2008-06-26 Perl Poetry</a><br /> -<p>E-Mail your comments to hi@paul.cyou :-)</p> -<a class="textlink" href="../">Back to the main site</a><br /> +</ul><br /> +<span>Btw.: Did you know that the first version of PHP was a set of Perl snippets? Only later, PHP became an independent programming language.</span><br /> +<br /> +<a class='textlink' href='https://www.perl.org'>https://www.perl.org</a><br /> +<br /> +<span class='quote'>Update 2022-12-17: The following is another related post. I don't agree to the statement made there, that Python code tends to be shorter than Perl code, though!</span><br /> +<br /> +<a class='textlink' href='https://stackoverflow.blog/2022/07/06/why-perl-is-still-relevant-in-2022/'>Why Perl is still relevant in 2022</a><br /> +<br /> +<span>Other related posts are:</span><br /> +<br /> +<a class='textlink' href='./2022-05-27-perl-is-still-a-great-choice.html'>2022-05-27 Perl is still a great choice (You are currently reading this)</a><br /> +<a class='textlink' href='./2011-05-07-perl-daemon-service-framework.html'>2011-05-07 Perl Daemon (Service Framework)</a><br /> +<a class='textlink' href='./2008-06-26-perl-poetry.html'>2008-06-26 Perl Poetry</a><br /> +<br /> +<span>E-Mail your comments to hi@paul.cyou :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> </entry> @@ -2265,8 +2511,10 @@ learn () { <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>The release of DTail 4.0.0</h1> -<p class="quote"><i>Published at 2022-03-06T18:11:39+00:00</i></p> + <h1 style='display: inline'>The release of DTail 4.0.0</h1><br /> +<br /> +<span class='quote'>Published at 2022-03-06T18:11:39+00:00</span><br /> +<br /> <pre> ,_---~~~~~----._ _,,_,*^____ _____``*g*\"*, @@ -2280,13 +2528,21 @@ learn () { | | | | </pre> -<p>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):</p> -<a class="textlink" href="https://dtail.dev">https://dtail.dev</a><br /> -<h2>So, what's new in 4.0.0?</h2> -<h3>Rewritten logging</h3> -<p>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.</p> -<p>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? </p> -<p>There's a are new log level structure now (The log level now can be specified with the "-logLevel" command line flag):</p> +<br /> +<span>I have recently released DTail 4.0.0 and this blog post goes through all the new goodies. If you want to jump directly to DTail, do it here (there are nice animated gifs which demonstrates the usage pretty well):</span><br /> +<br /> +<a class='textlink' href='https://dtail.dev'>https://dtail.dev</a><br /> +<br /> +<h2 style='display: inline'>So, what's new in 4.0.0?</h2><br /> +<br /> +<h3 style='display: inline'>Rewritten logging</h3><br /> +<br /> +<span>For DTail 4, logging has been completely rewritten. The new package name is "internal/io/dlog". I rewrote the logging because DTail is a special case here: There are logs processed by DTail, there are logs produced by the DTail server itself, there are logs produced by a DTail client itself, there are logs only logged by a DTail client, there are logs only logged by the DTail server, and there are logs logged by both, server and client. There are also different logging levels and outputs involved.</span><br /> +<br /> +<span>As you can imagine, it becomes fairly complex. There is no ready Go off-shelf logging library which suits my needs and the logging code in DTail 3 was just one big source code file with global variables and it wasn't sustainable to maintain anymore. So why not rewrite it for profit and fun? </span><br /> +<br /> +<span>There's a are new log level structure now (The log level now can be specified with the "-logLevel" command line flag):</span><br /> +<br /> <pre> // Available log levels. const ( @@ -2303,10 +2559,15 @@ const ( All level = iota ) </pre> -<p>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).</p> -<h3>Configurable terminal color codes</h3> -<p>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, ...).</p> -<p>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:</p> +<br /> +<span>DTail also supports multiple log outputs (e.g. to file or to stdout). More are now easily pluggable with the new logging package. The output can also be "enriched" (default) or "plain" (read more about that further below).</span><br /> +<br /> +<h3 style='display: inline'>Configurable terminal color codes</h3><br /> +<br /> +<span>A complaint I received from the users of DTail 3 were the terminal colors used for the output. Under some circumstances (terminal configuration) it made the output difficult to read so that users defaulted to "--noColor" (disabling colored output completely). I toke it by heart and also rewrote the color handling. It's now possible to configure the foreground and background colors and an attribute (e.g. dim, bold, ...).</span><br /> +<br /> +<span>The example "dtail.json" configuration file represents the default (now, more reasonable default) color codes used, and it is free to the user to customize them:</span><br /> +<br /> <pre> { "Client": { @@ -2401,76 +2662,111 @@ const ( ... } </pre> -<p>You notice the different sections - these are different contexts:</p> +<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> -<p>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:</p> +</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> -<h3>Serverless mode</h3> -<p>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:</p> +<br /> +<h3 style='display: inline'>Serverless mode</h3><br /> +<br /> +<span>All DTail commands can now operate on log files (and other text files) directly without any DTail server running. So there isn't a need anymore to install a DTail server when you are on the target server already anyway, like the following example shows:</span><br /> +<br /> <pre> % dtail --files /var/log/foo.log </pre> -<p>or</p> +<br /> +<span>or</span><br /> +<br /> <pre> % dmap --files /var/log/foo.log --query 'from TABLE select .... outfile result.csv' </pre> -<p>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.</p> -<h3>Shorthand flags</h3> -<p>The "--files" from the previous example is now redundant. As a shorthand, It is now possible to do the following instead:</p> +<br /> +<span>The way it works in Go code is that a connection to a server is managed through an interface and in serverless mode DTail calls through that interface to the server code directly without any TCP/IP and SSH connection made in the background. This means, that the binaries are a bit larger (also ship with the code which normally would be executed by the server) but the increase of binary size is not much.</span><br /> +<br /> +<h3 style='display: inline'>Shorthand flags</h3><br /> +<br /> +<span>The "--files" from the previous example is now redundant. As a shorthand, It is now possible to do the following instead:</span><br /> +<br /> <pre> % dtail /var/log/foo.log </pre> -<p>Of course, this also works with all other DTail client commands (dgrep, dcat, ... etc).</p> -<h3>Spartan (aka plain) mode</h3> -<p>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.:</p> +<br /> +<span>Of course, this also works with all other DTail client commands (dgrep, dcat, ... etc).</span><br /> +<br /> +<h3 style='display: inline'>Spartan (aka plain) mode</h3><br /> +<br /> +<span>There's a plain mode, which makes DTail only print out the "plain" text of the files operated on (without any DTail specific enriched output). E.g.:</span><br /> +<br /> <pre> % dcat --plain /etc/passwd > /etc/test % diff /etc/test /etc/passwd # Same content, no diff </pre> -<p>This might be useful if you wanted to post-process the output. </p> -<h3>Standard input pipe</h3> -<p>In serverless mode, you might want to process your data in a pipeline. You can do that now too through an input pipe:</p> +<br /> +<span>This might be useful if you wanted to post-process the output. </span><br /> +<br /> +<h3 style='display: inline'>Standard input pipe</h3><br /> +<br /> +<span>In serverless mode, you might want to process your data in a pipeline. You can do that now too through an input pipe:</span><br /> +<br /> <pre> % dgrep --plain --regex 'somethingspecial' /var/log/foo.log | dmap --query 'from TABLE select .... outfile result.csv' </pre> -<p>Or, use any other "standard" tool:</p> +<br /> +<span>Or, use any other "standard" tool:</span><br /> +<br /> <pre> % awk '.....' < /some/file | dtail .... </pre> -<h3>New command dtailhealth</h3> -<p>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).</p> +<br /> +<h3 style='display: inline'>New command dtailhealth</h3><br /> +<br /> +<span>Prior to DTail 4, there was a flag for the "dtail" command to check the health of a remote DTail server (for use with monitoring system such as Nagios). That has been moved out to a separate binary to reduce complexity of the "dtail" command. The following checks whether DTail is operational on the current machine (you could also check a remote instance of DTail server, just adjust the server address).</span><br /> +<br /> <pre> % cat check_dtail.sh #!/bin/sh exec /usr/local/bin/dtailhealth --server localhost:2222 </pre> -<h3>Improved documentation</h3> -<p>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).</p> -<p>I must admit that not all features are documented yet:</p> +<br /> +<h3 style='display: inline'>Improved documentation</h3><br /> +<br /> +<span>Some features, such as custom log formats and the map-reduce query language, are now documented. Also, the examples have been updated to reflect the new features added. This also includes the new animated example Gifs (plus documentation how they were created).</span><br /> +<br /> +<span>I must admit that not all features are documented yet:</span><br /> +<br /> <ul> <li>Server side scheduled map-reduce queries</li> <li>Server side continuous map-reduce queries</li> <li>Some more docs about terminal color customization</li> <li>Some more docs about log levels</li> -</ul> -<p>That will be added in one of the future releases. </p> -<h3>Integration testing suite</h3> -<p>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.</p> -<p>How are the tests implemented? All integration tests are simply unit tests in the "./integrationtests" folder. They must be explicitly activated with:</p> +</ul><br /> +<span>That will be added in one of the future releases. </span><br /> +<br /> +<h3 style='display: inline'>Integration testing suite</h3><br /> +<br /> +<span>DTail comes already with some unit tests, but what's new is a full integration testing suite which covers all common use cases of all the commands (dtail, dcat, dgrep, dmap) with a server backend and also in serverless mode.</span><br /> +<br /> +<span>How are the tests implemented? All integration tests are simply unit tests in the "./integrationtests" folder. They must be explicitly activated with:</span><br /> +<br /> <pre> % export DTAIL_INTEGRATION_TEST_RUN_MODE=yes </pre> -<p>Once done, first compile all commands, and then run the integration tests:</p> +<br /> +<span>Once done, first compile all commands, and then run the integration tests:</span><br /> +<br /> <pre> % make . @@ -2479,32 +2775,47 @@ exec /usr/local/bin/dtailhealth --server localhost:2222 % go clean -testcache % go test -race -v ./integrationtests </pre> -<h3>Improved code</h3> -<p>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:</p> +<br /> +<h3 style='display: inline'>Improved code</h3><br /> +<br /> +<span>Not that the code quality of DTail has been bad (I have been using Go vet and Go lint for previous releases and will keep using these), but this time I had new tools (such as SonarQube and BlackDuck) in my arsenal to:</span><br /> +<br /> <ul> <li>Reduce the complexity of a couple of functions (splitting code up into several smaller functions)</li> <li>Avoid repeating code (this version of DTail doesn't use Go generics yet, though).</li> -</ul> -<p>Other than that, a lot of other code has been refactored as I saw fit.</p> -<h3>Use of memory pools</h3> -<p>DTail makes excessive use of string builder and byte buffer objects. For performance reasons, those are now re-used from memory pools.</p> -<h2>What's next</h2> -<p>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:</p> +</ul><br /> +<span>Other than that, a lot of other code has been refactored as I saw fit.</span><br /> +<br /> +<h3 style='display: inline'>Use of memory pools</h3><br /> +<br /> +<span>DTail makes excessive use of string builder and byte buffer objects. For performance reasons, those are now re-used from memory pools.</span><br /> +<br /> +<h2 style='display: inline'>What's next</h2><br /> +<br /> +<span>DTail 5 won't be released any time soon I guess, but some 4.x.y releases will follow this year fore sure. I can think of:</span><br /> +<br /> <ul> <li>New (but backwards compatible) features which don't require a new major version bump (some features have been requested at work internally).</li> <li>Even more improved documentation.</li> <li>Dependency updates.</li> -</ul> -<p>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).</p> -<p>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).</p> -<p>Other related posts are:</p> -<a class="textlink" href="https://foo.zone/gemfeed/2022-10-30-installing-dtail-on-openbsd.html">2022-10-30 Installing DTail on OpenBSD</a><br /> -<a class="textlink" href="https://foo.zone/gemfeed/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="https://foo.zone/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.html">2021-04-22 DTail - The distributed log tail program</a><br /> -<p>Thanks!</p> -<p>Paul</p> -<p>E-Mail your comments to hi@paul.cyou :-)</p> -<a class="textlink" href="../">Back to the main site</a><br /> +</ul><br /> +<span>I use usually DTail at work, but I have recently installed it on my personal OpenBSD machines too. I might write a small tutorial here (and I might also add the rc scripts as examples to one of the next DTail releases).</span><br /> +<br /> +<span>I am a bit busy at the moment with two other pet projects of mine (one internal work-project, and one personal one, the latter you will read about in the next couple of months). If you have ideas (or even a patch), then please don't hesitate to contact me (either via E-Mail or a request at GitHub).</span><br /> +<br /> +<span>Other related posts are:</span><br /> +<br /> +<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> +<a class='textlink' href='./2022-03-06-the-release-of-dtail-4.0.0.html'>2022-03-06 The release of DTail 4.0.0 (You are currently reading this)</a><br /> +<a class='textlink' href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>2021-04-22 DTail - The distributed log tail program</a><br /> +<br /> +<span>Thanks!</span><br /> +<br /> +<span>Paul</span><br /> +<br /> +<span>E-Mail your comments to hi@paul.cyou :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> </entry> @@ -2735,8 +3046,10 @@ GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 2 <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>Bash Golf Part 2</h1> -<p class="quote"><i>Published at 2022-01-01T23:36:15+00:00; Updated at 2022-01-05</i></p> + <h1 style='display: inline'>Bash Golf Part 2</h1><br /> +<br /> +<span class='quote'>Published at 2022-01-01T23:36:15+00:00; Updated at 2022-01-05</span><br /> +<br /> <pre> '\ '\ . . |>18>> @@ -2748,17 +3061,23 @@ GNU/kFreeBSD rhea.buetow.org 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #2: Sat Nov 2 jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Art by Joan Stark, mod. by Paul Buetow </pre> -<p>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.</p> -<a class="textlink" href="https://foo.zone/gemfeed/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="https://foo.zone/gemfeed/2021-11-29-bash-golf-part-1.html">2021-11-29 Bash Golf Part 1</a><br /> -<h2>Redirection</h2> -<p>Let's have a closer look at Bash redirection. As you might already know that there are 3 standard file descriptors:</p> +<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='./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='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> +<br /> +<h2 style='display: inline'>Redirection</h2><br /> +<br /> +<span>Let's have a closer look at Bash redirection. As you might already know that there are 3 standard file descriptors:</span><br /> +<br /> <ul> <li>0 aka stdin (standard input)</li> <li>1 aka stdout (standard output)</li> <li>2 aka stderr (standard error output)</li> -</ul> -<p>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):</p> +</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 @@ -2767,32 +3086,44 @@ 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> -<p>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:</p> +<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> -<p>Other useful redirections are:</p> +<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> -<p>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:</p> +</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> -<p class="quote"><i>Update: A reader sent me an email and pointed out that the order of the redirections is important. </i></p> -<p>As you can see, the following will not print out anything:</p> +<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> -<p>A good description (also pointed out by the reader) can be found here:</p> -<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 /> -<p>Ok, back to the original blog post. You can also use grouping here (neither of these commands will print out anything to stdout):</p> +<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 @@ -2800,7 +3131,9 @@ Foo ❯ ( ( ( echo Foo 1>&2; ) 2>&1; ) 1>&2; ) 2>/dev/null ❯ </pre> -<p>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:</p> +<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 @@ -2808,7 +3141,9 @@ 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> -<p>Let's create our own descriptor "3" for redirection to a file named "foo":</p> +<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. @@ -2823,7 +3158,9 @@ Bratwurst ❯ echo Steak >&3 -bash: 3: Bad file descriptor </pre> -<p>You can also override the default file descriptors, as the following example script demonstrates:</p> +<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 @@ -2850,15 +3187,20 @@ echo Second line: $LINE2 # Restore default stdin and delete fd 6 exec 0<&6 6<&- </pre> -<p>Let's execute it:</p> +<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> -<h2>HERE</h2> -<p>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).</p> +<br /> +<h2 style='display: inline'>HERE</h2><br /> +<br /> +<span>I have mentioned HERE-documents and HERE-strings already in this post. Let's do some more examples. The following "cat" receives a multi line string from stdin. In this case, the input multi line string is a HERE-document. As you can see, it also interpolates variables (in this case the output of "date" running in a subshell).</span><br /> +<br /> <pre> ❯ cat <<END > Hello World @@ -2867,7 +3209,9 @@ Second line: for Great Good Hello World It's Fri 26 Nov 08:46:52 GMT 2021 </pre> -<p>You can also write it the following way, but that's less readable (it's good for an obfuscation contest):</p> +<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 @@ -2876,7 +3220,9 @@ It's Fri 26 Nov 08:46:52 GMT 2021 Hello Universe It's Fri 26 Nov 08:47:32 GMT 2021 </pre> -<p>Besides of an HERE-document, there is also a so-called HERE-string. Besides of...</p> +<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 @@ -2884,24 +3230,32 @@ It's Fri 26 Nov 08:47:32 GMT 2021 > fi $VAR ontains foo </pre> -<p>...you can use a HERE-string like that:</p> +<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> -<p>Or even shorter, you can do:</p> +<br /> +<span>Or even shorter, you can do:</span><br /> +<br /> <pre> ❯ grep -q foo <<< "$VAR" && echo '$VAR contains foo' $VAR contains foo </pre> -<p>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:</p> +<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> -<p>You can also use it with "read":</p> +<br /> +<span>You can also use it with "read":</span><br /> +<br /> <pre> ❯ read a <<< ja ❯ echo $a @@ -2916,15 +3270,20 @@ Learn ❯ echo ${words[3]} Golang </pre> -<p>The following is good for an obfuscation contest too:</p> +<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> -<h2>RANDOM</h2> -<p>Random is a special built-in variable containing a different pseudo random number each time it's used.</p> +<br /> +<h2 style='display: inline'>RANDOM</h2><br /> +<br /> +<span>Random is a special built-in variable containing a different pseudo random number each time it's used.</span><br /> +<br /> <pre> ❯ echo $RANDOM 11811 @@ -2933,8 +3292,11 @@ I like Perl too ❯ echo $RANDOM 9104 </pre> -<p>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.</p> -<p>Let's say you want to introduce a random delay of 1 minute. You can accomplish it with:</p> +<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 @@ -2962,10 +3324,15 @@ main Delaying script execution for 42 seconds... Continuing script execution... </pre> -<h2>set -x and set -e and pipefile</h2> -<p>In my opinion, -x and -e and pipefile are the most useful Bash options. Let's have a look at them one after another.</p> -<h3>-x</h3> -<p>-x prints commands and their arguments as they are executed. This helps to develop and debug your Bash code:</p> +<br /> +<h2 style='display: inline'>set -x and set -e and pipefile</h2><br /> +<br /> +<span>In my opinion, -x and -e and pipefile are the most useful Bash options. Let's have a look at them one after another.</span><br /> +<br /> +<h3 style='display: inline'>-x</h3><br /> +<br /> +<span>-x prints commands and their arguments as they are executed. This helps to develop and debug your Bash code:</span><br /> +<br /> <pre> ❯ set -x ❯ square () { local -i num=$1; echo $((num*num)); } @@ -2977,11 +3344,15 @@ Continuing script execution... + echo 'Square of 11 is 121' Square of 11 is 121 </pre> -<p>You can also set it when calling an external script without modifying the script itself:</p> +<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> -<p>Let's do that on one of the example scripts we covered earlier:</p> +<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 @@ -2999,21 +3370,29 @@ Second line: for Great Good + exec ❯ </pre> -<h3>-e</h3> -<p>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).</p> -<p>Ok, let's dig deeper:</p> +<br /> +<h3 style='display: inline'>-e</h3><br /> +<br /> +<span>This is a very important option you want to use when you are paranoid. This means, you should always "set -e" in your scripts when you need to make absolutely sure that your script runs successfully (with that I mean that no command should exit with an unexpected status code).</span><br /> +<br /> +<span>Ok, let's dig deeper:</span><br /> +<br /> <pre> ❯ help set | grep -- -e -e Exit immediately if a command exits with a non-zero status. </pre> -<p>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:</p> +<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> -<p>Whereas the outcome changes when the regex matches:</p> +<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 @@ -3021,7 +3400,9 @@ bar ❯ echo $? 0 </pre> -<p>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:</p> +<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 @@ -3033,8 +3414,11 @@ bar ❯ echo $? 1 </pre> -<p>...but the example above won't reach any of the branches and won't print out anything, as the script terminates right after grep.</p> -<p>The proper solution is to use grep as an expression in a conditional (e.g. in an if-else statement):</p> +<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 @@ -3055,7 +3439,9 @@ matching ❯ echo $? 0 </pre> -<p>You can also temporally undo "set -e" if there is no other way:</p> +<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 @@ -3097,25 +3483,35 @@ Hello World Hello Universe Hello You! </pre> -<p>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.</p> -<p>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 :-):</p> -<a class="textlink" href="https://foo.zone/gemfeed/2021-05-16-personal-bash-coding-style-guide.html">./2021-05-16-personal-bash-coding-style-guide.html</a><br /> -<h3>pipefail</h3> -<p>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:</p> +<br /> +<span>Why does calling "foo" with no arguments make the script terminate? Because as no argument was given, the "shift" won't have anything to do as the argument list $@ is empty, and therefore "shift" fails with a non-zero status.</span><br /> +<br /> +<span>Why would you want to use "shift" after function-local variable assignments? Have a look at my personal Bash coding style guide for an explanation :-):</span><br /> +<br /> +<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>./2021-05-16-personal-bash-coding-style-guide.html</a><br /> +<br /> +<h3 style='display: inline'>pipefail</h3><br /> +<br /> +<span>The pipefail option makes it so that not only the exit code of the last command of the pipe counts regards its exit code but any command of the pipe:</span><br /> +<br /> <pre> ❯ help set | grep pipefail -A 2 pipefail the return value of a pipeline is the status of the last command to exit with a non-zero status, or zero if no command exited with a non-zero status </pre> -<p>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:</p> +<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> -<p>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:</p> +<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 $? @@ -3124,20 +3520,26 @@ PAUL:X:1000:1000:PAUL BUETOW:/HOME/PAUL:/BIN/BASH ❯ echo $? 0 </pre> -<p>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:</p> +<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> -<p>Other related posts are:</p> -<a class="textlink" href="https://foo.zone/gemfeed/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="https://foo.zone/gemfeed/2021-11-29-bash-golf-part-1.html">2021-11-29 Bash Golf Part 1</a><br /> -<a class="textlink" href="https://foo.zone/gemfeed/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="https://foo.zone/gemfeed/2021-05-16-personal-bash-coding-style-guide.html">2021-05-16 Personal Bash coding style guide</a><br /> -<p>E-Mail your comments to hi@paul.cyou :-)</p> -<a class="textlink" href="../">Back to the main site</a><br /> +<br /> +<span>Other related posts are:</span><br /> +<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='./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 /> +<span>E-Mail your comments to hi@paul.cyou :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> </entry> @@ -3246,8 +3648,10 @@ PAUL:X:1000:1000:PAUL BUETOW:/HOME/PAUL:/BIN/BASH <summary>This is the first blog post about my Bash Golf series. This series is about random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1>Bash Golf Part 1</h1> -<p class="quote"><i>Published at 2021-11-29T14:06:14+00:00; Updated at 2022-01-05</i></p> + <h1 style='display: inline'>Bash Golf Part 1</h1><br /> +<br /> +<span class='quote'>Published at 2021-11-29T14:06:14+00:00; Updated at 2022-01-05</span><br /> +<br /> <pre> '\ . . |>18>> @@ -3259,19 +3663,28 @@ PAUL:X:1000:1000:PAUL BUETOW:/HOME/PAUL:/BIN/BASH jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Art by Joan Stark </pre> -<p>This is the first blog post about my Bash Golf series. This series is about random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content.</p> -<a class="textlink" href="https://foo.zone/gemfeed/2022-01-01-bash-golf-part-2.html">2022-01-01 Bash Golf Part 2</a><br /> -<a class="textlink" href="https://foo.zone/gemfeed/2021-11-29-bash-golf-part-1.html">2021-11-29 Bash Golf Part 1 (You are currently reading this)</a><br /> -<h2>TCP/IP networking</h2> -<p>You probably know the Netcat tool, which is a swiss army knife for TCP/IP networking on the command line. But did you know that the Bash natively supports TCP/IP networking?</p> -<p>Have a look here how that works:</p> +<br /> +<span>This is the first blog post about my Bash Golf series. This series is about random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content.</span><br /> +<br /> +<a class='textlink' href='./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 (You are currently reading this)</a><br /> +<br /> +<h2 style='display: inline'>TCP/IP networking</h2><br /> +<br /> +<span>You probably know the Netcat tool, which is a swiss army knife for TCP/IP networking on the command line. But did you know that the Bash natively supports TCP/IP networking?</span><br /> +<br /> +<span>Have a look here how that works:</span><br /> +<br /> <pre> ❯ cat < /dev/tcp/time.nist.gov/13 59536 21-11-18 08:09:16 00 0 0 153.6 UTC(NIST) * </pre> -<p>The Bash treats /dev/tcp/HOST/PORT in a special way so that it is actually establishing a TCP connection to HOST:PORT. The example above redirects the TCP output of the time-server to cat and cat is printing it on standard output (stdout).</p> -<p>A more sophisticated example is firing up an HTTP request. Let's create a new read-write (rw) file descriptor (fd) 5, redirect the HTTP request string to it, and then read the response back:</p> +<br /> +<span>The Bash treats /dev/tcp/HOST/PORT in a special way so that it is actually establishing a TCP connection to HOST:PORT. The example above redirects the TCP output of the time-server to cat and cat is printing it on standard output (stdout).</span><br /> +<br /> +<span>A more sophisticated example is firing up an HTTP request. Let's create a new read-write (rw) file descriptor (fd) 5, redirect the HTTP request string to it, and then read the response back:</span><br /> +<br /> <pre> ❯ exec 5<>/dev/tcp/google.de/80 ❯ echo -e "GET / HTTP/1.1\nhost: google.de\n\n" >&5 @@ -3287,9 +3700,13 @@ Content-Length: 218 X-XSS-Protection: 0 X-Frame-Options: SAMEORIGIN </pre> -<p>You would assume that this also works with the ZSH, but it doesn't. This is one of the few things which don't work with the ZSH but in the Bash. There might be plugins you could use for ZSH to do something similar, though.</p> -<h2>Process substitution</h2> -<p>The idea here is, that you can read the output (stdout) of a command from a file descriptor:</p> +<br /> +<span>You would assume that this also works with the ZSH, but it doesn't. This is one of the few things which don't work with the ZSH but in the Bash. There might be plugins you could use for ZSH to do something similar, though.</span><br /> +<br /> +<h2 style='display: inline'>Process substitution</h2><br /> +<br /> +<span>The idea here is, that you can read the output (stdout) of a command from a file descriptor:</span><br /> +<br /> <pre> ❯ uptime # Without process substitution 10:58:03 up 4 days, 22:08, 1 user, load average: 0.16, 0.34, 0.41 @@ -3308,8 +3725,11 @@ Modify: 2021-11-20 10:59:31.482411961 +0000 Change: 2021-11-20 10:59:31.482411961 +0000 Birth: - </pre> -<p>This example doesn't make any sense practically speaking, but it clearly demonstrates how process substitution works. The standard output pipe of "uptime" is redirected to an anonymous file descriptor. That fd then is opened by the "cat" command as a regular file.</p> -<p>A useful use case is displaying the differences of two sorted files:</p> +<br /> +<span>This example doesn't make any sense practically speaking, but it clearly demonstrates how process substitution works. The standard output pipe of "uptime" is redirected to an anonymous file descriptor. That fd then is opened by the "cat" command as a regular file.</span><br /> +<br /> +<span>A useful use case is displaying the differences of two sorted files:</span><br /> +<br /> <pre> ❯ echo a > /tmp/file-a.txt ❯ echo b >> /tmp/file-a.txt @@ -3330,11 +3750,15 @@ Change: 2021-11-20 10:59:31.482411961 +0000 ❯ diff -u <(sort /tmp/file-a.txt) <(sort /tmp/file-b.txt) ❯ </pre> -<p>Another example is displaying the differences of two directories:</p> +<br /> +<span>Another example is displaying the differences of two directories:</span><br /> +<br /> <pre> ❯ diff -u <(ls ./dir1/ | sort) <(ls ./dir2/ | sort) </pre> -<p>More (Bash golfing) examples:</p> +<br /> +<span>More (Bash golfing) examples:</span><br /> +<br /> <pre> ❯ wc -l <(ls /tmp/) /etc/passwd <(env) 24 /dev/fd/63 @@ -3349,21 +3773,29 @@ Change: 2021-11-20 10:59:31.482411961 +0000 foo bar baz ❯ </pre> -<p>So far, we only used process substitution for stdout redirection. But it also works for stdin. The following two commands result into the same outcome, but the second one is writing the tar data stream to an anonymous file descriptor which is substituted by the "bzip2" command reading the data stream from stdin and compressing it to its own stdout, which then gets redirected to a file:</p> +<br /> +<span>So far, we only used process substitution for stdout redirection. But it also works for stdin. The following two commands result into the same outcome, but the second one is writing the tar data stream to an anonymous file descriptor which is substituted by the "bzip2" command reading the data stream from stdin and compressing it to its own stdout, which then gets redirected to a file:</span><br /> +<br /> <pre> ❯ tar cjf file.tar.bz2 foo ❯ tar cjf >(bzip2 -c > file.tar.bz2) foo </pre> -<p>Just think a while and see whether you understand fully what is happening here.</p> -<h2>Grouping</h2> -<p>Command grouping can be quite useful for combining the output of multiple commands:</p> +<br /> +<span>Just think a while and see whether you understand fully what is happening here.</span><br /> +<br /> +<h2 style='display: inline'>Grouping</h2><br /> +<br /> +<span>Command grouping can be quite useful for combining the output of multiple commands:</span><br /> +<br /> <pre> ❯ { ls /tmp; cat /etc/passwd; env; } | wc -l 97 ❯ ( ls /tmp; cat /etc/passwd; env; ) | wc -l 97 </pre> -<p>But wait, what is the difference between curly braces and normal braces? I assumed that the normal braces create a subprocess whereas the curly ones don't, but I was wrong:</p> +<br /> +<span>But wait, what is the difference between curly braces and normal braces? I assumed that the normal braces create a subprocess whereas the curly ones don't, but I was wrong:</span><br /> +<br /> <pre> ❯ echo $$ 62676 @@ -3372,7 +3804,9 @@ foo bar baz ❯ ( echo $$; ) 62676 </pre> -<p>One difference is, that the curly braces require you to end the last statement with a semicolon, whereas with the normal braces you can omit the last semicolon:</p> +<br /> +<span>One difference is, that the curly braces require you to end the last statement with a semicolon, whereas with the normal braces you can omit the last semicolon:</span><br /> +<br /> <pre> ❯ ( env; ls ) | wc -l 27 @@ -3380,8 +3814,11 @@ foo bar baz > > ^C </pre> -<p>In case you know more (subtle) differences, please write me an E-Mail and let me know.</p> -<p class="quote"><i>Update: A reader sent me an E-Mail and pointed me to the Bash manual page, which explains the difference between () and {} (I should have checked that by myself):</i></p> +<br /> +<span>In case you know more (subtle) differences, please write me an E-Mail and let me know.</span><br /> +<br /> +<span class='quote'>Update: A reader sent me an E-Mail and pointed me to the Bash manual page, which explains the difference between () and {} (I should have checked that by myself):</span><br /> +<br /> <pre> (list) list is executed in a subshell environment (see COMMAND EXECUTION ENVIRONMENT below). Variable assignments and builtin commands that affect the shell's @@ -3396,20 +3833,27 @@ foo bar baz is permitted to be recognized. Since they do not cause a word break, they must be separated from list by whitespace or another shell metacharacter. </pre> -<p>So I was right that () is executed in a subprocess. But why does $$ not show a different PID? Also here (as pointed out by the reader) is the answer in the manual page:</p> +<br /> +<span>So I was right that () is executed in a subprocess. But why does $$ not show a different PID? Also here (as pointed out by the reader) is the answer in the manual page:</span><br /> +<br /> <pre> $ Expands to the process ID of the shell. In a () subshell, it expands to the process ID of the current shell, not the subshell. </pre> -<p>If we want print the subprocess PID, we can use the BASHPID variable:</p> +<br /> +<span>If we want print the subprocess PID, we can use the BASHPID variable:</span><br /> +<br /> <pre> ❯ echo $BASHPID; { echo $BASHPID; }; ( echo $BASHPID; ) 1028465 1028465 1028739 </pre> -<h2>Expansions</h2> -<p>Let's start with simple examples:</p> +<br /> +<h2 style='display: inline'>Expansions</h2><br /> +<br /> +<span>Let's start with simple examples:</span><br /> +<br /> <pre> ❯ echo {0..5} 0 1 2 3 4 5 @@ -3421,7 +3865,9 @@ $ Expands to the process ID of the shell. In a () subshell, it expands to 4 5 </pre> -<p>You can also add leading 0 or expand to any number range:</p> +<br /> +<span>You can also add leading 0 or expand to any number range:</span><br /> +<br /> <pre> ❯ echo {00..05} 00 01 02 03 04 05 @@ -3430,30 +3876,41 @@ $ Expands to the process ID of the shell. In a () subshell, it expands to ❯ echo {201..205} 201 202 203 204 205 </pre> -<p>It also works with letters:</p> +<br /> +<span>It also works with letters:</span><br /> +<br /> <pre> ❯ echo {a..e} a b c d e </pre> -<p>Now it gets interesting. The following takes a list of words and expands it so that all words are quoted:</p> +<br /> +<span>Now it gets interesting. The following takes a list of words and expands it so that all words are quoted:</span><br /> +<br /> <pre> ❯ echo \"{These,words,are,quoted}\" "These" "words" "are" "quoted" </pre> -<p>Let's also expand to the cross product of two given lists:</p> +<br /> +<span>Let's also expand to the cross product of two given lists:</span><br /> +<br /> <pre> ❯ echo {one,two}\:{A,B,C} one:A one:B one:C two:A two:B two:C ❯ echo \"{one,two}\:{A,B,C}\" "one:A" "one:B" "one:C" "two:A" "two:B" "two:C" </pre> -<p>Just because we can:</p> +<br /> +<span>Just because we can:</span><br /> +<br /> <pre> ❯ echo Linux-{one,two,three}\:{A,B,C}-FreeBSD Linux-one:A-FreeBSD Linux-one:B-FreeBSD Linux-one:C-FreeBSD Linux-two:A-FreeBSD Linux-two:B-FreeBSD Linux-two:C-FreeBSD Linux-three:A-FreeBSD Linux-three:B-FreeBSD Linux-three:C-FreeBSD </pre> -<h2>- aka stdin and stdout placeholder</h2> -<p>Some commands and Bash builtins use "-" as a placeholder for stdin and stdout:</p> +<br /> +<h2 style='display: inline'>- aka stdin and stdout placeholder</h2><br /> +<br /> +<span>Some commands and Bash builtins use "-" as a placeholder for stdin and stdout:</span><br /> +<br /> <pre> ❯ echo Hello world Hello world @@ -3466,24 +3923,31 @@ Hello world ❯ cat - <<< 'Hello world' Hello world </pre> -<p>Let's walk through all three examples from the above snippet:</p> +<br /> +<span>Let's walk through all three examples from the above snippet:</span><br /> +<br /> <ul> <li>The first example is obvious (the Bash builtin "echo" prints its arguments to stdout).</li> <li>The second pipes "Hello world" via stdout to stdin of the "cat" command. As cat's argument is "-" it reads its data from stdin and not from a regular file named "-". So "-" has a special meaning for cat.</li> <li>The third and fourth examples are interesting as we don't use a pipe as of "|" but a so-called HERE-document and a HERE-string. But the end results are the same.</li> -</ul> -<p>The "tar" command understands "-" too. The following example tars up some local directory and sends the data to stdout (this is what "-f -" commands it to do). stdout then is piped via an SSH session to a remote tar process (running on buetow.org) and reads the data from stdin and extracts all the data coming from stdin (as we told tar with "-f -") on the remote machine:</p> +</ul><br /> +<span>The "tar" command understands "-" too. The following example tars up some local directory and sends the data to stdout (this is what "-f -" commands it to do). stdout then is piped via an SSH session to a remote tar process (running on buetow.org) and reads the data from stdin and extracts all the data coming from stdin (as we told tar with "-f -") on the remote machine:</span><br /> +<br /> <pre> ❯ tar -czf - /some/dir | ssh hercules@buetow.org tar -xzvf - </pre> -<p>This is yet another example of using "-", but this time using the "file" command:</p> +<br /> +<span>This is yet another example of using "-", but this time using the "file" command:</span><br /> +<br /> <pre> $ head -n 1 grandmaster.sh #!/usr/bin/env bash $ file - < <(head -n 1 grandmaster.sh) /dev/stdin: a /usr/bin/env bash script, ASCII text executable </pre> -<p>Some more golfing:</p> +<br /> +<span>Some more golfing:</span><br /> +<br /> <pre> $ cat - hello @@ -3493,8 +3957,11 @@ $ file - #!/usr/bin/perl /dev/stdin: Perl script text executable </pre> -<h2>Alternative argument passing</h2> -<p>This is a quite unusual way of passing arguments to a Bash script:</p> +<br /> +<h2 style='display: inline'>Alternative argument passing</h2><br /> +<br /> +<span>This is a quite unusual way of passing arguments to a Bash script:</span><br /> +<br /> <pre> ❯ cat foo.sh #/usr/bin/env bash @@ -3502,7 +3969,9 @@ declare -r USER=${USER:?Missing the username} declare -r PASS=${PASS:?Missing the secret password for $USER} echo $USER:$PASS </pre> -<p>So what we are doing here is to pass the arguments via environment variables to the script. The script will abort with an error when there's an undefined argument.</p> +<br /> +<span>So what we are doing here is to pass the arguments via environment variables to the script. The script will abort with an error when there's an undefined argument.</span><br /> +<br /> <pre> ❯ chmod +x foo.sh ❯ ./foo.sh @@ -3514,19 +3983,27 @@ echo $USER:$PASS ❯ USER=paul PASS=secret ./foo.sh paul:secret </pre> -<p>You have probably noticed this *strange* syntax:</p> +<br /> +<span>You have probably noticed this *strange* syntax:</span><br /> +<br /> <pre> ❯ VARIABLE1=value1 VARIABLE2=value2 ./script.sh </pre> -<p>That's just another way to pass environment variables to a script. You can write it as well as like this:</p> +<br /> +<span>That's just another way to pass environment variables to a script. You can write it as well as like this:</span><br /> +<br /> <pre> ❯ export VARIABLE1=value1 ❯ export VARIABLE2=value2 ❯ ./script.sh </pre> -<p>But the downside of it is that the variables will also be defined in your current shell environment and not just in the scripts sub-process.</p> -<h2>: aka the null command</h2> -<p>First, let's use the "help" Bash built-in to see what it says about the null command:</p> +<br /> +<span>But the downside of it is that the variables will also be defined in your current shell environment and not just in the scripts sub-process.</span><br /> +<br /> +<h2 style='display: inline'>: aka the null command</h2><br /> +<br /> +<span>First, let's use the "help" Bash built-in to see what it says about the null command:</span><br /> +<br /> <pre> ❯ help : :: : @@ -3537,14 +4014,19 @@ paul:secret Exit Status: Always succeeds. </pre> -<p>PS: IMHO, people should use the Bash help more often. It is a very useful Bash reference. Too many fallbacks to a Google search and then land on Stack Overflow. Sadly, there's no help built-in for the ZSH shell though (so even when I am using the ZSH I make use of the Bash help as most of the built-ins are compatible). </p> -<p>OK, back to the null command. What happens when you try to run it? As you can see, absolutely nothing. And its exit status is 0 (success):</p> +<br /> +<span>PS: IMHO, people should use the Bash help more often. It is a very useful Bash reference. Too many fallbacks to a Google search and then land on Stack Overflow. Sadly, there's no help built-in for the ZSH shell though (so even when I am using the ZSH I make use of the Bash help as most of the built-ins are compatible). </span><br /> +<br /> +<span>OK, back to the null command. What happens when you try to run it? As you can see, absolutely nothing. And its exit status is 0 (success):</span><br /> +<br /> <pre> ❯ : ❯ echo $? 0 </pre> -<p>Why would that be useful? You can use it as a placeholder in an endless while-loop:</p> +<br /> +<span>Why would that be useful? You can use it as a placeholder in an endless while-loop:</span><br /> +<br /> <pre> ❯ while : ; do date; sleep 1; done Sun 21 Nov 12:08:31 GMT 2021 @@ -3553,7 +4035,9 @@ Sun 21 Nov 12:08:33 GMT 2021 ^C ❯ </pre> -<p>You can also use it as a placeholder for a function body not yet fully implemented, as an empty function ill result in a syntax error:</p> +<br /> +<span>You can also use it as a placeholder for a function body not yet fully implemented, as an empty function ill result in a syntax error:</span><br /> +<br /> <pre> ❯ foo () { } -bash: syntax error near unexpected token `}' @@ -3561,11 +4045,15 @@ Sun 21 Nov 12:08:33 GMT 2021 ❯ foo ❯ </pre> -<p>Or use it as a placeholder for not yet implemented conditional branches:</p> +<br /> +<span>Or use it as a placeholder for not yet implemented conditional branches:</span><br /> +<br /> <pre> ❯ if foo; then :; else echo bar; fi </pre> -<p>Or (not recommended) as a fancy way to comment your Bash code:</p> +<br /> +<span>Or (not recommended) as a fancy way to comment your Bash code:</span><br /> +<br /> <pre> ❯ : I am a comment and have no other effect ❯ : I am a comment and result in a syntax error () @@ -3573,7 +4061,9 @@ Sun 21 Nov 12:08:33 GMT 2021 ❯ : "I am a comment and don't result in a syntax error ()" ❯ </pre> -<p>As you can see in the previous example, the Bash still tries to interpret some syntax of all text following after ":". This can be exploited (also not recommended) like this:</p> +<br /> +<span>As you can see in the previous example, the Bash still tries to interpret some syntax of all text following after ":". This can be exploited (also not recommended) like this:</span><br /> +<br /> <pre> ❯ declare i=0 ❯ $[ i = i + 1 ] @@ -3584,7 +4074,9 @@ bash: 1: command not found... ❯ echo $i 4 </pre> -<p>For these kinds of expressions it's always better to use "let" though. And you should also use $((...expression...)) instead of the old (deprecated) way $[ ...expression... ] like this example demonstrates:</p> +<br /> +<span>For these kinds of expressions it's always better to use "let" though. And you should also use $((...expression...)) instead of the old (deprecated) way $[ ...expression... ] like this example demonstrates:</span><br /> +<br /> <pre> ❯ declare j=0 ❯ let j=$((j + 1)) @@ -3594,8 +4086,11 @@ bash: 1: command not found... ❯ echo $j 4 </pre> -<h2>(No) floating point support</h2> -<p>I have to give a plus-point to the ZSH here. As the ZSH supports floating point calculation, whereas the Bash doesn't:</p> +<br /> +<h2 style='display: inline'>(No) floating point support</h2><br /> +<br /> +<span>I have to give a plus-point to the ZSH here. As the ZSH supports floating point calculation, whereas the Bash doesn't:</span><br /> +<br /> <pre> ❯ bash -c 'echo $(( 1/10 ))' 0 @@ -3607,20 +4102,28 @@ bash: line 1: 1/10.0 : syntax error: invalid arithmetic operator (error token is 0.10000000000000001 ❯ </pre> -<p>It would be nice to have native floating point support for the Bash too, but you don't want to use the shell for complicated calculations anyway. So it's fine that Bash doesn't have that, I guess. </p> -<p>In the Bash you will have to fall back to an external command like "bc" (the arbitrary precision calculator language):</p> +<br /> +<span>It would be nice to have native floating point support for the Bash too, but you don't want to use the shell for complicated calculations anyway. So it's fine that Bash doesn't have that, I guess. </span><br /> +<br /> +<span>In the Bash you will have to fall back to an external command like "bc" (the arbitrary precision calculator language):</span><br /> +<br /> <pre> ❯ bc <<< 'scale=2; 1/10' .10 </pre> -<p>See you later for the next post of this series.</p> -<p>Other related posts are:</p> -<a class="textlink" href="https://foo.zone/gemfeed/2022-01-01-bash-golf-part-2.html">2022-01-01 Bash Golf Part 2</a><br /> -<a class="textlink" href="https://foo.zone/gemfeed/2021-11-29-bash-golf-part-1.html">2021-11-29 Bash Golf Part 1 (You are currently reading this)</a><br /> -<a class="textlink" href="https://foo.zone/gemfeed/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="https://foo.zone/gemfeed/2021-05-16-personal-bash-coding-style-guide.html">2021-05-16 Personal Bash coding style guide</a><br /> -<p>E-Mail your comments to hi@paul.cyou :-)</p> -<a class="textlink" href="../">Back to the main site</a><br /> +<br /> +<span>See you later for the next post of this series.</span><br /> +<br /> +<span>Other related posts are:</span><br /> +<br /> +<a class='textlink' href='./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 (You are currently reading this)</a><br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> +<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>2021-05-16 Personal Bash coding style guide</a><br /> +<br /> +<span>E-Mail your comments to hi@paul.cyou :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> </entry> @@ -3954,8 +4457,10 @@ Hello World <summary>You might have read my previous blog posts about entering the Geminispace, where I pointed out the benefits of having and maintaining an internet presence there. This whole site (the blog and all other pages) is composed in the Gemtext markup language.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1>Gemtexter - One Bash script to rule it all</h1> -<p class="quote"><i>Published at 2021-06-05T19:03:32+01:00</i></p> + <h1 style='display: inline'>Gemtexter - One Bash script to rule it all</h1><br /> +<br /> +<span class='quote'>Published at 2021-06-05T19:03:32+01:00</span><br /> +<br /> <pre> o .,<>., o |\/\/\/\/| @@ -3996,28 +4501,44 @@ Hello World \___.>`''-.||:.__,' SSt |_______`> <_____:::. . . \ _/ `+a:f:......jrei''' </pre> -<p>You might have read my previous blog posts about entering the Geminispace, where I pointed out the benefits of having and maintaining an internet presence there. This whole site (the blog and all other pages) is composed in the Gemtext markup language.</p> -<p>This comes with the benefit that I can write content in my favourite text editor (Vim). </p> -<h2>Motivation</h2> -<p>Another benefit of using Gemini is that the Gemtext markup language is easy to parse. As my site is dual-hosted (Gemini+HTTP), I could, in theory, just write a shell script to deal with the conversion from Gemtext to HTML; there is no need for a full-featured programming language here. I have done a lot of Bash in the past, but I am also often revisiting old tools and techniques for refreshing and keeping the knowledge up to date here.</p> -<a href="https://foo.zone/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all/blog-engine.jpg"><img alt="Motivational comic strip" title="Motivational comic strip" src="https://foo.zone/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all/blog-engine.jpg" /></a><br /> -<p>I have exactly done that - I wrote a Bash script, named Gemtexter, for that:</p> -<a class="textlink" href="https://codeberg.org/snonux/gemtexter">https://codeberg.org/snonux/gemtexter</a><br /> -<p>In short, Gemtexter is a static site generator and blogging engine that uses Gemtext as its input format.</p> -<h2>Output formats</h2> -<p>Gemtexter takes the Gemtext Markup files as the input and generates the following outputs from it (you find examples for each of these output formats on the Gemtexter GitHub page):</p> +<br /> +<span>You might have read my previous blog posts about entering the Geminispace, where I pointed out the benefits of having and maintaining an internet presence there. This whole site (the blog and all other pages) is composed in the Gemtext markup language.</span><br /> +<br /> +<span>This comes with the benefit that I can write content in my favourite text editor (Vim). </span><br /> +<br /> +<h2 style='display: inline'>Motivation</h2><br /> +<br /> +<span>Another benefit of using Gemini is that the Gemtext markup language is easy to parse. As my site is dual-hosted (Gemini+HTTP), I could, in theory, just write a shell script to deal with the conversion from Gemtext to HTML; there is no need for a full-featured programming language here. I have done a lot of Bash in the past, but I am also often revisiting old tools and techniques for refreshing and keeping the knowledge up to date here.</span><br /> +<br /> +<a href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all/blog-engine.jpg'><img alt='Motivational comic strip' title='Motivational comic strip' src='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all/blog-engine.jpg' /></a><br /> +<br /> +<span>I have exactly done that - I wrote a Bash script, named Gemtexter, for that:</span><br /> +<br /> +<a class='textlink' href='https://codeberg.org/snonux/gemtexter'>https://codeberg.org/snonux/gemtexter</a><br /> +<br /> +<span>In short, Gemtexter is a static site generator and blogging engine that uses Gemtext as its input format.</span><br /> +<br /> +<h2 style='display: inline'>Output formats</h2><br /> +<br /> +<span>Gemtexter takes the Gemtext Markup files as the input and generates the following outputs from it (you find examples for each of these output formats on the Gemtexter GitHub page):</span><br /> +<br /> <ul> <li>HTML files for my website</li> <li>Markdown files for a GitHub page</li> <li>A Gemtext Atom feed for my blog posts</li> <li>A Gemfeed for my blog posts (a particular feed format commonly used in Geminispace. The Gemfeed can be used as an alternative to the Atom feed).</li> <li>An HTML Atom feed of my blog posts</li> -</ul> -<p>I could have done all of that with a more robust language than Bash (such as Perl, Ruby, Go...), but I didn't. The purpose of this exercise was to challenge what I can do with a "simple" Bash script and learn new things.</p> -<h2>Taking it as far as I should, but no farther</h2> -<p>The Bash is suitable very well for small scripts and ad-hoc automation on the command line. But it is for sure not a robust programming language. Writing this blog post, Gemtexter is nearing 1000 lines of code, which is actually a pretty large Bash script.</p> -<h3>Modularization </h3> -<p>I modularized the code so that each core functionality has its own file in ./lib. All the modules are included from the main Gemtexter script. For example, there is one module for HTML generation, one for Markdown generation, and so on. </p> +</ul><br /> +<span>I could have done all of that with a more robust language than Bash (such as Perl, Ruby, Go...), but I didn't. The purpose of this exercise was to challenge what I can do with a "simple" Bash script and learn new things.</span><br /> +<br /> +<h2 style='display: inline'>Taking it as far as I should, but no farther</h2><br /> +<br /> +<span>The Bash is suitable very well for small scripts and ad-hoc automation on the command line. But it is for sure not a robust programming language. Writing this blog post, Gemtexter is nearing 1000 lines of code, which is actually a pretty large Bash script.</span><br /> +<br /> +<h3 style='display: inline'>Modularization </h3><br /> +<br /> +<span>I modularized the code so that each core functionality has its own file in ./lib. All the modules are included from the main Gemtexter script. For example, there is one module for HTML generation, one for Markdown generation, and so on. </span><br /> +<br /> <pre> paul in uranus in gemtexter on 🌱 main ❯ wc -l gemtexter lib/* @@ -4032,60 +4553,91 @@ paul in uranus in gemtexter on 🌱 main 63 lib/md.source.sh 834 total </pre> -<p>This way, the script could grow far beyond 1000 lines of code and still be maintainable. With more features, execution speed may slowly become a problem, though. I already notice that Gemtexter doesn't produce results instantly but requires few seconds of runtime already. That's not a problem yet, though. </p> -<h3>Bash best practises and ShellCheck</h3> -<p>While working on Gemtexter, I also had a look at the Google Shell Style Guide and wrote a blog post on that:</p> -<a class="textlink" href="https://foo.zone/gemfeed/2021-05-16-personal-bash-coding-style-guide.html">Personal bash coding style guide</a><br /> -<p>I followed all these best practices, and in my opinion, the result is a pretty maintainable Bash script (given that you are fluent with all the sed and grep commands I used).</p> -<p>ShellCheck, a shell script analysis tool written in Haskell, is run on Gemtexter ensuring that all code is acceptable. I am pretty impressed with what ShellCheck found. </p> -<p>It, for example, detected "some_command | while read var; do ...; done" loops and hinted that these create a new subprocess for the while part. The result is that all variable modifications taking place in the while-subprocess won't reflect the primary Bash process. ShellSheck then recommended rewriting the loop so that no subprocess is spawned as "while read -r var; do ...; done < <(some_command)". ShellCheck also pointed out to add a "-r" to "read"; otherwise, there could be an issue with backspaces in the loop data.</p> -<p>Furthermore, ShellCheck recommended many more improvements. Declaration of unused variables and missing variable and string quotations were the most common ones. ShellSheck immensely helped to improve the robustness of the script.</p> -<a class="textlink" href="https://shellcheck.net">https://shellcheck.net</a><br /> -<h3>Unit testing</h3> -<p>There is a basic unit test module in ./lib/assert.source.sh, which is used for unit testing. I found this to be very beneficial for cross-platform development. For example, I noticed that some unit tests failed on macOS while everything still worked fine on my Fedora Linux laptop. </p> -<p>After digging a bit, I noticed that I had to install the GNU versions of the sed and grep commands on macOS and a newer version of the Bash to make all unit tests pass and Gemtexter work.</p> -<p>It has been proven quite helpful to have unit tests in place for the HTML part already when working on the Markdown generator part. To test the Markdown part, I copied the HTML unit tests and changed the expected outcome in the assertions. This way, I could implement the Markdown generator in a test-driven way (writing the test first and afterwards the implementation).</p> -<h3>HTML unit test example</h3> +<br /> +<span>This way, the script could grow far beyond 1000 lines of code and still be maintainable. With more features, execution speed may slowly become a problem, though. I already notice that Gemtexter doesn't produce results instantly but requires few seconds of runtime already. That's not a problem yet, though. </span><br /> +<br /> +<h3 style='display: inline'>Bash best practises and ShellCheck</h3><br /> +<br /> +<span>While working on Gemtexter, I also had a look at the Google Shell Style Guide and wrote a blog post on that:</span><br /> +<br /> +<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>Personal bash coding style guide</a><br /> +<br /> +<span>I followed all these best practices, and in my opinion, the result is a pretty maintainable Bash script (given that you are fluent with all the sed and grep commands I used).</span><br /> +<br /> +<span>ShellCheck, a shell script analysis tool written in Haskell, is run on Gemtexter ensuring that all code is acceptable. I am pretty impressed with what ShellCheck found. </span><br /> +<br /> +<span>It, for example, detected "some_command | while read var; do ...; done" loops and hinted that these create a new subprocess for the while part. The result is that all variable modifications taking place in the while-subprocess won't reflect the primary Bash process. ShellSheck then recommended rewriting the loop so that no subprocess is spawned as "while read -r var; do ...; done < <(some_command)". ShellCheck also pointed out to add a "-r" to "read"; otherwise, there could be an issue with backspaces in the loop data.</span><br /> +<br /> +<span>Furthermore, ShellCheck recommended many more improvements. Declaration of unused variables and missing variable and string quotations were the most common ones. ShellSheck immensely helped to improve the robustness of the script.</span><br /> +<br /> +<a class='textlink' href='https://shellcheck.net'>https://shellcheck.net</a><br /> +<br /> +<h3 style='display: inline'>Unit testing</h3><br /> +<br /> +<span>There is a basic unit test module in ./lib/assert.source.sh, which is used for unit testing. I found this to be very beneficial for cross-platform development. For example, I noticed that some unit tests failed on macOS while everything still worked fine on my Fedora Linux laptop. </span><br /> +<br /> +<span>After digging a bit, I noticed that I had to install the GNU versions of the sed and grep commands on macOS and a newer version of the Bash to make all unit tests pass and Gemtexter work.</span><br /> +<br /> +<span>It has been proven quite helpful to have unit tests in place for the HTML part already when working on the Markdown generator part. To test the Markdown part, I copied the HTML unit tests and changed the expected outcome in the assertions. This way, I could implement the Markdown generator in a test-driven way (writing the test first and afterwards the implementation).</span><br /> +<br /> +<h3 style='display: inline'>HTML unit test example</h3><br /> +<br /> <pre> gemtext='=> http://example.org Description of the link' assert::equals "$(generate::make_link html "$gemtext")" \ '<a class="textlink" href="http://example.org">Description of the link</a><br />' </pre> -<h3>Markdown unit test example</h3> +<br /> +<h3 style='display: inline'>Markdown unit test example</h3><br /> +<br /> <pre> gemtext='=> http://example.org Description of the link' assert::equals "$(generate::make_link md "$gemtext")" \ '[Description of the link](http://example.org) ' </pre> -<h2>Handcrafted HTML styles</h2> -<p>I had a look at some ready off the shelf CSS styles, but they all seemed too bloated. There is a whole industry selling CSS styles on the interweb. I preferred an effortless and minimalist style for the HTML site. So I handcrafted the Cascading Style Sheets manually with love and included them in the HTML header template. </p> -<p>For now, I have to re-generate all HTML files whenever the CSS changes. That should not be an issue now, but I might move the CSS into a separate file one day.</p> -<p>It's worth mentioning that all generated HTML files and Atom feeds pass the W3C validation tests.</p> -<p> </p> -<h2>Configurability</h2> -<p>In case someone else than me wants to use Gemtexter for his own site, it is pretty much configurable. It is possible to specify your own configuration file and your own HTML templates. Have a look at the GitHub page for examples.</p> -<h2>Future features</h2> -<p>I could think of the following features added to a future version of Gemtexter:</p> +<br /> +<h2 style='display: inline'>Handcrafted HTML styles</h2><br /> +<br /> +<span>I had a look at some ready off the shelf CSS styles, but they all seemed too bloated. There is a whole industry selling CSS styles on the interweb. I preferred an effortless and minimalist style for the HTML site. So I handcrafted the Cascading Style Sheets manually with love and included them in the HTML header template. </span><br /> +<br /> +<span>For now, I have to re-generate all HTML files whenever the CSS changes. That should not be an issue now, but I might move the CSS into a separate file one day.</span><br /> +<br /> +<span>It's worth mentioning that all generated HTML files and Atom feeds pass the W3C validation tests.</span><br /> +<span> </span><br /> +<h2 style='display: inline'>Configurability</h2><br /> +<br /> +<span>In case someone else than me wants to use Gemtexter for his own site, it is pretty much configurable. It is possible to specify your own configuration file and your own HTML templates. Have a look at the GitHub page for examples.</span><br /> +<br /> +<h2 style='display: inline'>Future features</h2><br /> +<br /> +<span>I could think of the following features added to a future version of Gemtexter:</span><br /> +<br /> <ul> <li>Templating of Gemtext files so that the .html files are generated from .gmi.tpl files. The template engine could do such things as an automatic table of contents and sitemap generation. It could also include the output of inlined shell code, e.g. a fortune quote. </li> <li>Add support for more output formats, such as Groff, PDF, plain text, Gopher, etc.</li> <li>External CSS file for HTML.</li> <li>Improve speed by introducing parallelism and/or concurrency and/or better caching.</li> -</ul> -<h2>Conclusion</h2> -<p>It was quite a lot of fun writing Gemtexter. It's a relatively small project, but given that I worked on that in my spare time once in a while, it kept me busy for several weeks. </p> -<p>I finally revamped my personal internet site and started to blog again. I wanted the result to be exactly how it is now: A slightly retro-inspired internet site built for fun with unconventional tools. </p> -<p>Other related posts are:</p> -<a class="textlink" href="https://foo.zone/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html">2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again^2</a><br /> -<a class="textlink" href="https://foo.zone/gemfeed/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="https://foo.zone/gemfeed/2022-01-01-bash-golf-part-2.html">2022-01-01 Bash Golf Part 2</a><br /> -<a class="textlink" href="https://foo.zone/gemfeed/2021-11-29-bash-golf-part-1.html">2021-11-29 Bash Golf Part 1</a><br /> -<a class="textlink" href="https://foo.zone/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html">2021-06-05 Gemtexter - One Bash script to rule it all (You are currently reading this)</a><br /> -<a class="textlink" href="https://foo.zone/gemfeed/2021-05-16-personal-bash-coding-style-guide.html">2021-05-16 Personal Bash coding style guide</a><br /> -<a class="textlink" href="https://foo.zone/gemfeed/2021-04-24-welcome-to-the-geminispace.html">2021-04-24 Welcome to the Geminispace</a><br /> -<p>E-Mail your comments to hi@paul.cyou :-)</p> -<a class="textlink" href="../">Back to the main site</a><br /> +</ul><br /> +<h2 style='display: inline'>Conclusion</h2><br /> +<br /> +<span>It was quite a lot of fun writing Gemtexter. It's a relatively small project, but given that I worked on that in my spare time once in a while, it kept me busy for several weeks. </span><br /> +<br /> +<span>I finally revamped my personal internet site and started to blog again. I wanted the result to be exactly how it is now: A slightly retro-inspired internet site built for fun with unconventional tools. </span><br /> +<br /> +<span>Other related posts are:</span><br /> +<br /> +<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again^2</a><br /> +<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> +<a class='textlink' href='./2022-01-01-bash-golf-part-2.html'>2022-01-01 Bash Golf Part 2</a><br /> +<a class='textlink' href='./2021-11-29-bash-golf-part-1.html'>2021-11-29 Bash Golf Part 1</a><br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all (You are currently reading this)</a><br /> +<a class='textlink' href='./2021-05-16-personal-bash-coding-style-guide.html'>2021-05-16 Personal Bash coding style guide</a><br /> +<a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace</a><br /> +<br /> +<span>E-Mail your comments to hi@paul.cyou :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> </entry> @@ -4101,8 +4653,10 @@ assert::equals "$(generate::make_link md "$gemtext")" \ <summary>Lately, I have been polishing and writing a lot of Bash code. Not that I never wrote a lot of Bash, but now as I also looked through the Google Shell Style Guide, I thought it is time also to write my thoughts on that. I agree with that guide in most, but not in all points. </summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1>Personal Bash coding style guide</h1> -<p class="quote"><i>Published at 2021-05-16T14:51:57+01:00</i></p> + <h1 style='display: inline'>Personal Bash coding style guide</h1><br /> +<br /> +<span class='quote'>Published at 2021-05-16T14:51:57+01:00</span><br /> +<br /> <pre> .---------------------------. /,--..---..---..---..---..--. `. @@ -4115,26 +4669,43 @@ assert::equals "$(generate::make_link md "$gemtext")" \ // \\ // \\ |===|| hjw "\__/"---------------"\__/"-+---+' </pre> -<p>Lately, I have been polishing and writing a lot of Bash code. Not that I never wrote a lot of Bash, but now as I also looked through the Google Shell Style Guide, I thought it is time also to write my thoughts on that. I agree with that guide in most, but not in all points. </p> -<a class="textlink" href="https://google.github.io/styleguide/shellguide.html">Google Shell Style Guide</a><br /> -<h2>My modifications</h2> -<p>These are my modifications to the Google Guide.</p> -<h3>Shebang</h3> -<p>Google recommends using always...</p> +<br /> +<span>Lately, I have been polishing and writing a lot of Bash code. Not that I never wrote a lot of Bash, but now as I also looked through the Google Shell Style Guide, I thought it is time also to write my thoughts on that. I agree with that guide in most, but not in all points. </span><br /> +<br /> +<a class='textlink' href='https://google.github.io/styleguide/shellguide.html'>Google Shell Style Guide</a><br /> +<br /> +<h2 style='display: inline'>My modifications</h2><br /> +<br /> +<span>These are my modifications to the Google Guide.</span><br /> +<br /> +<h3 style='display: inline'>Shebang</h3><br /> +<br /> +<span>Google recommends using always...</span><br /> +<br /> <pre> #!/bin/bash </pre> -<p>... as the shebang line, but that does not work on all Unix and Unix-like operating systems (e.g., the *BSDs don't have Bash installed to /bin/bash). Better is:</p> +<br /> +<span>... as the shebang line, but that does not work on all Unix and Unix-like operating systems (e.g., the *BSDs don't have Bash installed to /bin/bash). Better is:</span><br /> +<br /> <pre> #!/usr/bin/env bash </pre> -<h3>Two space soft-tabs indentation</h3> -<p>I know there have been many tab- and soft-tab wars on this planet. Google recommends using two space soft-tabs for Bash scripts. </p> -<p>I don't care if I use two or four space indentations. I agree, however, that we should not use tabs. I tend to use four-space soft-tabs as that's how I currently configured Vim for any programming language. What matters most, though, is consistency within the same script/project.</p> -<p>Google also recommends limiting the line length to 80 characters. For some people, that seems to be an old habit from the '80s, where all computer terminals couldn't display longer lines. But I think that the 80 character mark is still a good practice, at least for shell scripts. For example, I am often writing code on a Microsoft Go Tablet PC (running Linux, of course), and it comes in convenient if the lines are not too long due to the relatively small display on the device.</p> -<p>I hit the 80 character line length quicker with the four spaces than with two spaces, but that makes me refactor the Bash code more aggressively, which is a good thing. </p> -<h3>Breaking long pipes</h3> -<p>Google recommends breaking up long pipes like this:</p> +<br /> +<h3 style='display: inline'>Two space soft-tabs indentation</h3><br /> +<br /> +<span>I know there have been many tab- and soft-tab wars on this planet. Google recommends using two space soft-tabs for Bash scripts. </span><br /> +<br /> +<span>I don't care if I use two or four space indentations. I agree, however, that we should not use tabs. I tend to use four-space soft-tabs as that's how I currently configured Vim for any programming language. What matters most, though, is consistency within the same script/project.</span><br /> +<br /> +<span>Google also recommends limiting the line length to 80 characters. For some people, that seems to be an old habit from the '80s, where all computer terminals couldn't display longer lines. But I think that the 80 character mark is still a good practice, at least for shell scripts. For example, I am often writing code on a Microsoft Go Tablet PC (running Linux, of course), and it comes in convenient if the lines are not too long due to the relatively small display on the device.</span><br /> +<br /> +<span>I hit the 80 character line length quicker with the four spaces than with two spaces, but that makes me refactor the Bash code more aggressively, which is a good thing. </span><br /> +<br /> +<h3 style='display: inline'>Breaking long pipes</h3><br /> +<br /> +<span>Google recommends breaking up long pipes like this:</span><br /> +<br /> <pre> # All fits on one line command1 | command2 @@ -4145,7 +4716,9 @@ command1 \ | command3 \ | command4 </pre> -<p>I think there is a better way like the following, which is less noisy. The pipe | already indicates the Bash that another command is expected, thus making the explicit line breaks with \ obsolete:</p> +<br /> +<span>I think there is a better way like the following, which is less noisy. The pipe | already indicates the Bash that another command is expected, thus making the explicit line breaks with \ obsolete:</span><br /> +<br /> <pre> # Long commands command1 | @@ -4153,8 +4726,11 @@ command1 | command3 | command4 </pre> -<h3>Quoting your variables</h3> -<p>Google recommends always quote your variables. Generally, it would be best if you did that only for variables where you are unsure about the content/values of the variables (e.g., content is from an external input source and may contain whitespace or other special characters). In my opinion, the code will become quite noisy when you always quote your variables like this:</p> +<br /> +<h3 style='display: inline'>Quoting your variables</h3><br /> +<br /> +<span>Google recommends always quote your variables. Generally, it would be best if you did that only for variables where you are unsure about the content/values of the variables (e.g., content is from an external input source and may contain whitespace or other special characters). In my opinion, the code will become quite noisy when you always quote your variables like this:</span><br /> +<br /> <pre> greet () { local -r greeting="${1}" @@ -4162,7 +4738,9 @@ greet () { echo "${greeting} ${name}!" } </pre> -<p>In this particular example, I agree that you should quote them as you don't know the input (are there, for example, whitespace characters?). But if you are sure that you are only using simple bare words, then I think that the code looks much cleaner when you do this instead:</p> +<br /> +<span>In this particular example, I agree that you should quote them as you don't know the input (are there, for example, whitespace characters?). But if you are sure that you are only using simple bare words, then I think that the code looks much cleaner when you do this instead:</span><br /> +<br /> <pre> say_hello_to_paul () { local -r greeting=Hello @@ -4170,15 +4748,21 @@ say_hello_to_paul () { echo "$greeting $name!" } </pre> -<p>You see, I also omitted the curly braces { } around the variables. I only use the curly braces around variables when it makes the code either easier/clearer to read or if it is necessary to use them:</p> +<br /> +<span>You see, I also omitted the curly braces { } around the variables. I only use the curly braces around variables when it makes the code either easier/clearer to read or if it is necessary to use them:</span><br /> +<br /> <pre> declare FOO=bar # Curly braces around FOO are necessary echo "foo${FOO}baz" </pre> -<p>A few more words on always quoting the variables: For the sake of consistency (and for making ShellCheck happy), I am not against quoting everything I encounter. I also think that the larger the Bash script becomes, the more critical it becomes always to quote variables. That's because it will be more likely that you might not remember that some of the functions don't work on values with spaces in them, for example. It's just that I won't quote everything in every small script I write. </p> -<h3>Prefer built-in commands over external commands</h3> -<p>Google recommends using the built-in commands over available external commands where possible:</p> +<br /> +<span>A few more words on always quoting the variables: For the sake of consistency (and for making ShellCheck happy), I am not against quoting everything I encounter. I also think that the larger the Bash script becomes, the more critical it becomes always to quote variables. That's because it will be more likely that you might not remember that some of the functions don't work on values with spaces in them, for example. It's just that I won't quote everything in every small script I write. </span><br /> +<br /> +<h3 style='display: inline'>Prefer built-in commands over external commands</h3><br /> +<br /> +<span>Google recommends using the built-in commands over available external commands where possible:</span><br /> +<br /> <pre> # Prefer this: addition=$(( X + Y )) @@ -4188,13 +4772,21 @@ substitution="${string/#foo/bar}" addition="$(expr "${X}" + "${Y}")" substitution="$(echo "${string}" | sed -e 's/^foo/bar/')" </pre> -<p>I can't entirely agree here. The external commands (especially sed) are much more sophisticated and powerful than the built-in Bash versions. Sed can do much more than the Bash can ever do by itself when it comes to text manipulation (the name "sed" stands for streaming editor, after all).</p> -<p>I prefer to do light text processing with the Bash built-ins and more complicated text processing with external programs such as sed, grep, awk, cut, and tr. However, there is also medium-light text processing where I would want to use external programs. That is so because I remember using them better than the Bash built-ins. The Bash can get relatively obscure here (even Perl will be more readable then - Side note: I love Perl).</p> -<p>Also, you would like to use an external command for floating-point calculation (e.g., bc) instead of using the Bash built-ins (worth noticing that ZSH supports built-in floating-points).</p> -<p>I even didn't get started with what you can do with awk (especially GNU Awk), a fully-fledged programming language. Tiny Awk snippets tend to be used quite often in Shell scripts without honouring the real power of Awk. But if you did everything in Perl or Awk or another scripting language, then it wouldn't be a Bash script anymore, wouldn't it? ;-)</p> -<h2>My additions</h2> -<h3>Use of 'yes' and 'no'</h3> -<p>Bash does not support a boolean type. I tend just to use the strings 'yes' and 'no' here. I used 0 for false and 1 for true for some time, but I think that the yes/no strings are easier to read. Yes, the Bash script would need to perform string comparisons on every check, but if performance is crucial to you, you wouldn't want to use a Bash script anyway, correct?</p> +<br /> +<span>I can't entirely agree here. The external commands (especially sed) are much more sophisticated and powerful than the built-in Bash versions. Sed can do much more than the Bash can ever do by itself when it comes to text manipulation (the name "sed" stands for streaming editor, after all).</span><br /> +<br /> +<span>I prefer to do light text processing with the Bash built-ins and more complicated text processing with external programs such as sed, grep, awk, cut, and tr. However, there is also medium-light text processing where I would want to use external programs. That is so because I remember using them better than the Bash built-ins. The Bash can get relatively obscure here (even Perl will be more readable then - Side note: I love Perl).</span><br /> +<br /> +<span>Also, you would like to use an external command for floating-point calculation (e.g., bc) instead of using the Bash built-ins (worth noticing that ZSH supports built-in floating-points).</span><br /> +<br /> +<span>I even didn't get started with what you can do with awk (especially GNU Awk), a fully-fledged programming language. Tiny Awk snippets tend to be used quite often in Shell scripts without honouring the real power of Awk. But if you did everything in Perl or Awk or another scripting language, then it wouldn't be a Bash script anymore, wouldn't it? ;-)</span><br /> +<br /> +<h2 style='display: inline'>My additions</h2><br /> +<br /> +<h3 style='display: inline'>Use of 'yes' and 'no'</h3><br /> +<br /> +<span>Bash does not support a boolean type. I tend just to use the strings 'yes' and 'no' here. I used 0 for false and 1 for true for some time, but I think that the yes/no strings are easier to read. Yes, the Bash script would need to perform string comparisons on every check, but if performance is crucial to you, you wouldn't want to use a Bash script anyway, correct?</span><br /> +<br /> <pre> declare -r SUGAR_FREE=yes declare -r I_NEED_THE_BUZZ=no @@ -4211,8 +4803,11 @@ buy_soda () { buy_soda $I_NEED_THE_BUZZ </pre> -<h3>Non-evil alternative to variable assignments via eval</h3> -<p>Google is in the opinion that eval should be avoided. I think so too. They list these examples in their guide:</p> +<br /> +<h3 style='display: inline'>Non-evil alternative to variable assignments via eval</h3><br /> +<br /> +<span>Google is in the opinion that eval should be avoided. I think so too. They list these examples in their guide:</span><br /> +<br /> <pre> # What does this set? # Did it succeed? In part or whole? @@ -4222,7 +4817,9 @@ eval $(set_my_variables) variable="$(eval some_function)" </pre> -<p>However, if I want to read variables from another file, I don't have to use eval here. I only have to source the file:</p> +<br /> +<span>However, if I want to read variables from another file, I don't have to use eval here. I only have to source the file:</span><br /> +<br /> <pre> % cat vars.source.sh declare foo=bar @@ -4232,7 +4829,9 @@ declare bay=foo % bash -c 'source vars.source.sh; echo $foo $bar $baz' bar baz foo </pre> -<p>And suppose I want to assign variables dynamically. In that case, I could just run an external script and source its output (This is how you could do metaprogramming in Bash without the use of eval - write code which produces code for immediate execution):</p> +<br /> +<span>And suppose I want to assign variables dynamically. In that case, I could just run an external script and source its output (This is how you could do metaprogramming in Bash without the use of eval - write code which produces code for immediate execution):</span><br /> +<br /> <pre> % cat vars.sh #!/usr/bin/env bash @@ -4244,9 +4843,13 @@ END % bash -c 'source <(./vars.sh); echo "Hello $user, it is $date"' Hello paul, it is Sat 15 May 19:21:12 BST 2021 </pre> -<p>The downside is that ShellCheck won't be able to follow the dynamic sourcing anymore.</p> -<h3>Prefer pipes over arrays for list processing</h3> -<p>When I do list processing in Bash, I prefer to use pipes. You can chain them through Bash functions as well, which is pretty neat. Usually, my list processing scripts are of a structure like this:</p> +<br /> +<span>The downside is that ShellCheck won't be able to follow the dynamic sourcing anymore.</span><br /> +<br /> +<h3 style='display: inline'>Prefer pipes over arrays for list processing</h3><br /> +<br /> +<span>When I do list processing in Bash, I prefer to use pipes. You can chain them through Bash functions as well, which is pretty neat. Usually, my list processing scripts are of a structure like this:</span><br /> +<br /> <pre> filter_lines () { echo 'Start filtering lines in a fancy way!' >&2 @@ -4282,10 +4885,15 @@ main () { main </pre> -<p>The stdout is always passed as a pipe to the next following stage. The stderr is used for info logging.</p> -<h3>Assign-then-shift</h3> -<p>I often refactor existing Bash code. That leads me to add and removing function arguments quite often. It's pretty repetitive work changing the $1, $2.... function argument numbers every time you change the order or add/remove possible arguments.</p> -<p>The solution is to use of the "assign-then-shift"-method, which goes like this: "local -r var1=$1; shift; local -r var2=$1; shift". The idea is that you only use "$1" to assign function arguments to named (better readable) local function variables. You will never have to bother about "$2" or above. That is very useful when you constantly refactor your code and remove or add function arguments. It's something that I picked up from a colleague (a pure Bash wizard) some time ago:</p> +<br /> +<span>The stdout is always passed as a pipe to the next following stage. The stderr is used for info logging.</span><br /> +<br /> +<h3 style='display: inline'>Assign-then-shift</h3><br /> +<br /> +<span>I often refactor existing Bash code. That leads me to add and removing function arguments quite often. It's pretty repetitive work changing the $1, $2.... function argument numbers every time you change the order or add/remove possible arguments.</span><br /> +<br /> +<span>The solution is to use of the "assign-then-shift"-method, which goes like this: "local -r var1=$1; shift; local -r var2=$1; shift". The idea is that you only use "$1" to assign function arguments to named (better readable) local function variables. You will never have to bother about "$2" or above. That is very useful when you constantly refactor your code and remove or add function arguments. It's something that I picked up from a colleague (a pure Bash wizard) some time ago:</span><br /> +<br /> <pre> some_function () { local -r param_foo="$1"; shift @@ -4294,7 +4902,9 @@ some_function () { ... } </pre> -<p>Want to add a param_baz? Just do this:</p> +<br /> +<span>Want to add a param_baz? Just do this:</span><br /> +<br /> <pre> some_function () { local -r param_foo="$1"; shift @@ -4304,7 +4914,9 @@ some_function () { ... } </pre> -<p>Want to remove param_foo? Nothing easier than that:</p> +<br /> +<span>Want to remove param_foo? Nothing easier than that:</span><br /> +<br /> <pre> some_function () { local -r param_bar="$1"; shift @@ -4313,15 +4925,21 @@ some_function () { ... } </pre> -<p>As you can see, I didn't need to change any other assignments within the function. Of course, you would also need to change the function argument lists at every occasion where the function is invoked - you would do that within the same refactoring session.</p> -<h3>Paranoid mode</h3> -<p>I call this the paranoid mode. The Bash will stop executing when a command exits with a status not equal to 0:</p> +<br /> +<span>As you can see, I didn't need to change any other assignments within the function. Of course, you would also need to change the function argument lists at every occasion where the function is invoked - you would do that within the same refactoring session.</span><br /> +<br /> +<h3 style='display: inline'>Paranoid mode</h3><br /> +<br /> +<span>I call this the paranoid mode. The Bash will stop executing when a command exits with a status not equal to 0:</span><br /> +<br /> <pre> set -e grep -q foo <<< bar echo Jo </pre> -<p>Here 'Jo' will never be printed out as the grep didn't find any match. It's unrealistic for most scripts to run in paranoid mode purely, so there must be a way to add exceptions. Critical Bash scripts of mine tend to look like this:</p> +<br /> +<span>Here 'Jo' will never be printed out as the grep didn't find any match. It's unrealistic for most scripts to run in paranoid mode purely, so there must be a way to add exceptions. Critical Bash scripts of mine tend to look like this:</span><br /> +<br /> <pre> #!/usr/bin/env bash @@ -4344,38 +4962,53 @@ some_function () { ... } </pre> -<h2>Learned</h2> -<p>There are also a couple of things I've learned from Google's guide.</p> -<h3>Unintended lexicographical comparison.</h3> -<p>The following looks like a valid Bash code:</p> +<br /> +<h2 style='display: inline'>Learned</h2><br /> +<br /> +<span>There are also a couple of things I've learned from Google's guide.</span><br /> +<br /> +<h3 style='display: inline'>Unintended lexicographical comparison.</h3><br /> +<br /> +<span>The following looks like a valid Bash code:</span><br /> +<br /> <pre> if [[ "${my_var}" > 3 ]]; then # True for 4, false for 22. do_something fi </pre> -<p>... but it is probably an unintended lexicographical comparison. A correct way would be:</p> +<br /> +<span>... but it is probably an unintended lexicographical comparison. A correct way would be:</span><br /> +<br /> <pre> if (( my_var > 3 )); then do_something fi </pre> -<p>or</p> +<br /> +<span>or</span><br /> +<br /> <pre> if [[ "${my_var}" -gt 3 ]]; then do_something fi </pre> -<h3>PIPESTATUS</h3> -<p>I have never used the PIPESTATUS variable before. I knew that it's there, but I never bothered to understand how it works until now thoroughly.</p> -<p>The PIPESTATUS variable in Bash allows checking of the return code from all parts of a pipe. If it's only necessary to check the success or failure of the whole pipe, then the following is acceptable:</p> +<br /> +<h3 style='display: inline'>PIPESTATUS</h3><br /> +<br /> +<span>I have never used the PIPESTATUS variable before. I knew that it's there, but I never bothered to understand how it works until now thoroughly.</span><br /> +<br /> +<span>The PIPESTATUS variable in Bash allows checking of the return code from all parts of a pipe. If it's only necessary to check the success or failure of the whole pipe, then the following is acceptable:</span><br /> +<br /> <pre> tar -cf - ./* | ( cd "${dir}" && tar -xf - ) if (( PIPESTATUS[0] != 0 || PIPESTATUS[1] != 0 )); then echo "Unable to tar files to ${dir}" >&2 fi </pre> -<p>However, as PIPESTATUS will be overwritten as soon as you do any other command, if you need to act differently on errors based on where it happened in the pipe, you'll need to assign PIPESTATUS to another variable immediately after running the command (don't forget that [ is a command and will wipe out PIPESTATUS).</p> +<br /> +<span>However, as PIPESTATUS will be overwritten as soon as you do any other command, if you need to act differently on errors based on where it happened in the pipe, you'll need to assign PIPESTATUS to another variable immediately after running the command (don't forget that [ is a command and will wipe out PIPESTATUS).</span><br /> +<br /> <pre> tar -cf - ./* | ( cd "${DIR}" && tar -xf - ) return_codes=( "${PIPESTATUS[@]}" ) @@ -4386,20 +5019,32 @@ if (( return_codes[1] != 0 )); then do_something_else fi </pre> -<h2>Use common sense and BE CONSISTENT.</h2> -<p>The following two paragraphs are thoroughly quoted from the Google guidelines. But they hit the hammer on the head:</p> -<p class="quote"><i>If you are editing code, take a few minutes to look at the code around you and determine its style. If they use spaces around their if clauses, you should, too. If their comments have little boxes of stars around them, make your comments have little boxes of stars around them too.</i></p> -<p class="quote"><i>The point of having style guidelines is to have a common vocabulary of coding so people can concentrate on what you are saying rather than on how you are saying it. We present global style rules here, so people know the vocabulary. But local style is also important. If the code you add to a file looks drastically different from the existing code around it, the discontinuity throws readers out of their rhythm when they go to read it. Try to avoid this.</i></p> -<h2>Advanced Bash learning pro tip</h2> -<p>I also highly recommend having a read through the "Advanced Bash-Scripting Guide" (not from Google). I use it as the universal Bash reference and learn something new every time I look at it.</p> -<a class="textlink" href="https://tldp.org/LDP/abs/html/">Advanced Bash-Scripting Guide</a><br /> -<p>Other related posts are:</p> -<a class="textlink" href="https://foo.zone/gemfeed/2022-01-01-bash-golf-part-2.html">2022-01-01 Bash Golf Part 2</a><br /> -<a class="textlink" href="https://foo.zone/gemfeed/2021-11-29-bash-golf-part-1.html">2021-11-29 Bash Golf Part 1</a><br /> -<a class="textlink" href="https://foo.zone/gemfeed/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="https://foo.zone/gemfeed/2021-05-16-personal-bash-coding-style-guide.html">2021-05-16 Personal Bash coding style guide (You are currently reading this)</a><br /> -<p>E-Mail your comments to hi@paul.cyou :-)</p> -<a class="textlink" href="../">Back to the main site</a><br /> +<br /> +<h2 style='display: inline'>Use common sense and BE CONSISTENT.</h2><br /> +<br /> +<span>The following two paragraphs are thoroughly quoted from the Google guidelines. But they hit the hammer on the head:</span><br /> +<br /> +<span class='quote'>If you are editing code, take a few minutes to look at the code around you and determine its style. If they use spaces around their if clauses, you should, too. If their comments have little boxes of stars around them, make your comments have little boxes of stars around them too.</span><br /> +<br /> +<span class='quote'>The point of having style guidelines is to have a common vocabulary of coding so people can concentrate on what you are saying rather than on how you are saying it. We present global style rules here, so people know the vocabulary. But local style is also important. If the code you add to a file looks drastically different from the existing code around it, the discontinuity throws readers out of their rhythm when they go to read it. Try to avoid this.</span><br /> +<br /> +<br /> +<h2 style='display: inline'>Advanced Bash learning pro tip</h2><br /> +<br /> +<span>I also highly recommend having a read through the "Advanced Bash-Scripting Guide" (not from Google). I use it as the universal Bash reference and learn something new every time I look at it.</span><br /> +<br /> +<a class='textlink' href='https://tldp.org/LDP/abs/html/'>Advanced Bash-Scripting Guide</a><br /> +<br /> +<span>Other related posts are:</span><br /> +<br /> +<a class='textlink' href='./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 (You are currently reading this)</a><br /> +<br /> +<span>E-Mail your comments to hi@paul.cyou :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> </entry> @@ -4415,12 +5060,18 @@ fi <summary>ASCII Art by Andy Hood!</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1>Welcome to the Geminispace</h1> -<p class="quote"><i>Published at 2021-04-24T19:28:41+01:00; Updated at 2021-06-18</i></p> -<p>ASCII Art by Andy Hood!</p> -<p>Have you reached this article already via Gemini? It requires a Gemini client; web browsers such as Firefox, Chrome, Safari, etc., don't support the Gemini protocol. The Gemini address of this site (or the address of this capsule as people say in Geminispace) is:</p> -<a class="textlink" href="https://foo.zone">https://foo.zone</a><br /> -<p>However, if you still use HTTP, you are just surfing the fallback HTML version of this capsule. In that case, I suggest reading on what this is all about :-).</p> + <h1 style='display: inline'>Welcome to the Geminispace</h1><br /> +<br /> +<span class='quote'>Published at 2021-04-24T19:28:41+01:00; Updated at 2021-06-18</span><br /> +<br /> +<span>ASCII Art by Andy Hood!</span><br /> +<br /> +<span>Have you reached this article already via Gemini? It requires a Gemini client; web browsers such as Firefox, Chrome, Safari, etc., don't support the Gemini protocol. The Gemini address of this site (or the address of this capsule as people say in Geminispace) is:</span><br /> +<br /> +<a class='textlink' href='https://foo.zone'>https://foo.zone</a><br /> +<br /> +<span>However, if you still use HTTP, you are just surfing the fallback HTML version of this capsule. In that case, I suggest reading on what this is all about :-).</span><br /> +<br /> <pre> /\ @@ -4440,23 +5091,40 @@ fi '.;.;' ;'.;' ..;;' AsH </pre> -<h2>Motivation</h2> -<h3>My urge to revamp my personal website</h3> -<p>For some time, I had to urge to revamp my personal website. Not to update the technology and its design but to update all the content (+ keep it current) and start a small tech blog again. So unconsciously, I began to search for an excellent platform to do all of that in a KISS (keep it simple & stupid) way.</p> -<h3>My still great Laptop running hot</h3> -<p>Earlier this year (2021), I noticed that my almost seven-year-old but still great Laptop started to become hot and slowed down while surfing the web. Also, the Laptop's fan became quite noisy. This was all due to the additional bloat such as JavaScript, excessive use of CSS, tracking cookies+pixels, ads, and so on there was on the website. </p> -<p>All I wanted was to read an interesting article, but after a big advertising pop-up banner appeared and made everything worse, I gave up and closed the browser tab.</p> -<h2>Discovering the Gemini internet protocol</h2> -<p>Around the same time, I discovered a relatively new, more lightweight protocol named Gemini, which does not support all these CPU-intensive features like HTML, JavaScript, and CSS. Also, tracking and ads are unsupported by the Gemini protocol.</p> -<p>The "downside" is that due to the limited capabilities of the Gemini protocol, all sites look very old and spartan. But that is not a downside; that is, in fact, a design choice people made. It is up to the client software how your capsule looks. For example, you could use a graphical client, such as Lagrange, with nice font renderings and colours to improve the appearance. Or you could use a very minimalistic command line black-and-white Gemini client. It's your (the user's) choice.</p> -<a href="https://foo.zone/gemfeed/2021-04-24-welcome-to-the-geminispace/amfora-screenshot.png"><img alt="Screenshot Amfora Gemini terminal client surfing this site" title="Screenshot Amfora Gemini terminal client surfing this site" src="https://foo.zone/gemfeed/2021-04-24-welcome-to-the-geminispace/amfora-screenshot.png" /></a><br /> -<a href="https://foo.zone/gemfeed/2021-04-24-welcome-to-the-geminispace/lagrange-screenshot.png"><img alt="Screenshot graphical Lagrange Gemini client surfing this site" title="Screenshot graphical Lagrange Gemini client surfing this site" src="https://foo.zone/gemfeed/2021-04-24-welcome-to-the-geminispace/lagrange-screenshot.png" /></a><br /> -<p>Why is there a need for a new protocol? As the modern web is a superset of Gemini, can't we use simple HTML 1.0 instead? That's a good and valid question. It is not a technical problem but a human problem. We tend to abuse the features once they are available. You can ensure that things stay efficient and straightforward as long as you are using the Gemini protocol. On the other hand, you can't force every website on the modern web to only create plain and straightforward-looking HTML pages.</p> -<h2>My own Gemini capsule</h2> -<p>As it is effortless to set up and maintain your own Gemini capsule (Gemini server + content composed via the Gemtext markup language), I decided to create my own. What I like about Gemini is that I can use my favourite text editor and get typing. I don't need to worry about the style and design of the presence, and I also don't have to test anything in ten different web browsers. I can only focus on the content! As a matter of fact, I am using the Vim editor + its spellchecker + auto word completion functionality to write this. </p> -<p>This site was generated with Gemtexter. You can read more about it here:</p> -<a class="textlink" href="https://foo.zone/gemfeed/2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html">Gemtexter - One Bash script to rule it all</a><br /> -<h2>Gemini advantages summarised</h2> +<br /> +<h2 style='display: inline'>Motivation</h2><br /> +<br /> +<h3 style='display: inline'>My urge to revamp my personal website</h3><br /> +<br /> +<span>For some time, I had to urge to revamp my personal website. Not to update the technology and its design but to update all the content (+ keep it current) and start a small tech blog again. So unconsciously, I began to search for an excellent platform to do all of that in a KISS (keep it simple & stupid) way.</span><br /> +<br /> +<h3 style='display: inline'>My still great Laptop running hot</h3><br /> +<br /> +<span>Earlier this year (2021), I noticed that my almost seven-year-old but still great Laptop started to become hot and slowed down while surfing the web. Also, the Laptop's fan became quite noisy. This was all due to the additional bloat such as JavaScript, excessive use of CSS, tracking cookies+pixels, ads, and so on there was on the website. </span><br /> +<br /> +<span>All I wanted was to read an interesting article, but after a big advertising pop-up banner appeared and made everything worse, I gave up and closed the browser tab.</span><br /> +<br /> +<h2 style='display: inline'>Discovering the Gemini internet protocol</h2><br /> +<br /> +<span>Around the same time, I discovered a relatively new, more lightweight protocol named Gemini, which does not support all these CPU-intensive features like HTML, JavaScript, and CSS. Also, tracking and ads are unsupported by the Gemini protocol.</span><br /> +<br /> +<span>The "downside" is that due to the limited capabilities of the Gemini protocol, all sites look very old and spartan. But that is not a downside; that is, in fact, a design choice people made. It is up to the client software how your capsule looks. For example, you could use a graphical client, such as Lagrange, with nice font renderings and colours to improve the appearance. Or you could use a very minimalistic command line black-and-white Gemini client. It's your (the user's) choice.</span><br /> +<br /> +<a href='./2021-04-24-welcome-to-the-geminispace/amfora-screenshot.png'><img alt='Screenshot Amfora Gemini terminal client surfing this site' title='Screenshot Amfora Gemini terminal client surfing this site' src='./2021-04-24-welcome-to-the-geminispace/amfora-screenshot.png' /></a><br /> +<a href='./2021-04-24-welcome-to-the-geminispace/lagrange-screenshot.png'><img alt='Screenshot graphical Lagrange Gemini client surfing this site' title='Screenshot graphical Lagrange Gemini client surfing this site' src='./2021-04-24-welcome-to-the-geminispace/lagrange-screenshot.png' /></a><br /> +<br /> +<span>Why is there a need for a new protocol? As the modern web is a superset of Gemini, can't we use simple HTML 1.0 instead? That's a good and valid question. It is not a technical problem but a human problem. We tend to abuse the features once they are available. You can ensure that things stay efficient and straightforward as long as you are using the Gemini protocol. On the other hand, you can't force every website on the modern web to only create plain and straightforward-looking HTML pages.</span><br /> +<br /> +<h2 style='display: inline'>My own Gemini capsule</h2><br /> +<br /> +<span>As it is effortless to set up and maintain your own Gemini capsule (Gemini server + content composed via the Gemtext markup language), I decided to create my own. What I like about Gemini is that I can use my favourite text editor and get typing. I don't need to worry about the style and design of the presence, and I also don't have to test anything in ten different web browsers. I can only focus on the content! As a matter of fact, I am using the Vim editor + its spellchecker + auto word completion functionality to write this. </span><br /> +<br /> +<span>This site was generated with Gemtexter. You can read more about it here:</span><br /> +<br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>Gemtexter - One Bash script to rule it all</a><br /> +<br /> +<h2 style='display: inline'>Gemini advantages summarised</h2><br /> +<br /> <ul> <li>Supports an alternative to the modern bloated web</li> <li>Easy to operate and easy to write content</li> @@ -4465,18 +5133,24 @@ fi <li>Lightweight (although not as lightweight as the Gopher protocol)</li> <li>Supports privacy (no cookies, no request header fingerprinting, TLS encryption)</li> <li>Fun to play with (it's a bit geeky, yes, but a lot of fun!)</li> -</ul> -<h2>Dive into deep Gemini space</h2> -<p>Check out one of the following links for more information about Gemini. For example, you will find a FAQ that explains why the protocol is named Gemini. Many Gemini capsules are dual-hosted via Gemini and HTTP(S) so that people new to Gemini can sneak peek at the content with a regular web browser. Some people go as far as tri-hosting all their content via HTTP(S), Gemini and Gopher.</p> -<a class="textlink" href="https://gemini.circumlunar.space">https://gemini.circumlunar.space</a><br /> -<a class="textlink" href="https://gemini.circumlunar.space">https://gemini.circumlunar.space</a><br /> -<p>Other related posts are:</p> -<a class="textlink" href="https://foo.zone/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html">2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again^2</a><br /> -<a class="textlink" href="https://foo.zone/gemfeed/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="https://foo.zone/gemfeed/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="https://foo.zone/gemfeed/2021-04-24-welcome-to-the-geminispace.html">2021-04-24 Welcome to the Geminispace (You are currently reading this)</a><br /> -<p>E-Mail your comments to hi@paul.cyou :-)</p> -<a class="textlink" href="../">Back to the main site</a><br /> +</ul><br /> +<h2 style='display: inline'>Dive into deep Gemini space</h2><br /> +<br /> +<span>Check out one of the following links for more information about Gemini. For example, you will find a FAQ that explains why the protocol is named Gemini. Many Gemini capsules are dual-hosted via Gemini and HTTP(S) so that people new to Gemini can sneak peek at the content with a regular web browser. Some people go as far as tri-hosting all their content via HTTP(S), Gemini and Gopher.</span><br /> +<br /> +<a class='textlink' href='https://gemini.circumlunar.space'>https://gemini.circumlunar.space</a><br /> +<a class='textlink' href='https://gemini.circumlunar.space'>https://gemini.circumlunar.space</a><br /> +<br /> +<span>Other related posts are:</span><br /> +<br /> +<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 Gemtexter 2.0.0 - Let's Gemtext again^2</a><br /> +<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again</a><br /> +<a class='textlink' href='./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.html'>2021-06-05 Gemtexter - One Bash script to rule it all</a><br /> +<a class='textlink' href='./2021-04-24-welcome-to-the-geminispace.html'>2021-04-24 Welcome to the Geminispace (You are currently reading this)</a><br /> +<br /> +<span>E-Mail your comments to hi@paul.cyou :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> </entry> @@ -4492,77 +5166,123 @@ fi <summary>This article first appeared at the Mimecast Engineering Blog but I made it available here in my personal internet site too.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1>DTail - The distributed log tail program</h1> -<p class="quote"><i>Published at 2021-04-22T19:28:41+01:00; Updated at 2021-04-26</i></p> -<a href="https://foo.zone/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program/title.png"><img alt="DTail logo image" title="DTail logo image" src="https://foo.zone/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program/title.png" /></a><br /> -<p>This article first appeared at the Mimecast Engineering Blog but I made it available here in my personal internet site too.</p> -<a class="textlink" href="https://medium.com/mimecast-engineering/dtail-the-distributed-log-tail-program-79b8087904bb">Original Mimecast Engineering Blog post at Medium</a><br /> -<p>Running a large cloud-based service requires monitoring the state of huge numbers of machines, a task for which many standard UNIX tools were not really designed. In this post, I will describe a simple program, DTail, that Mimecast has built and released as Open-Source, which enables us to monitor log files of many servers at once without the costly overhead of a full-blown log management system.</p> -<p>At Mimecast, we run over 10 thousand server boxes. Most of them host multiple microservices and each of them produces log files. Even with the use of time series databases and monitoring systems, raw application logs are still an important source of information when it comes to analysing, debugging, and troubleshooting services.</p> -<p>Every engineer familiar with UNIX or a UNIX-like platform (e.g., Linux) is well aware of tail, a command-line program for displaying a text file content on the terminal which is also especially useful for following application or system log files with tail -f logfile.</p> -<p>Think of DTail as a distributed version of the tail program which is very useful when you have a distributed application running on many servers. DTail is an Open-Source, cross-platform, fairly easy to use, support and maintain log file analysis & statistics gathering tool designed for Engineers and Systems Administrators. It is programmed in Google Go.</p> -<h2>A Mimecast Pet Project</h2> -<p>DTail got its inspiration from public domain tools available already in this area but it is a blue sky from-scratch development which was first presented at Mimecast’s annual internal Pet Project competition (awarded with a Bronze prize). It has gained popularity since and is one of the most widely deployed DevOps tools at Mimecast (reaching nearly 10k server installations) and many engineers use it on a regular basis. The Open-Source version of DTail is available at:</p> -<a class="textlink" href="https://dtail.dev">https://dtail.dev</a><br /> -<p>Try it out — We would love any feedback. But first, read on…</p> -<h2>Differentiating from log management systems</h2> -<p>Why not just use a full-blown log management system? There are various Open-Source and commercial log management solutions available on the market you could choose from (e.g. the ELK stack). Most of them store the logs in a centralized location and are fairly complex to set up and operate. Possibly they are also pretty expensive to operate if you have to buy dedicated hardware (or pay fees to your cloud provider) and have to hire support staff for it.</p> -<p>DTail does not aim to replace any of the log management tools already available but is rather an additional tool crafted especially for ad-hoc debugging and troubleshooting purposes. DTail is cheap to operate as it does not require any dedicated hardware for log storage as it operates directly on the source of the logs. It means that there is a DTail server installed on all server boxes producing logs. This decentralized comes with the direct advantages that there is no introduced delay because the logs are not shipped to a central log storage device. The reduced complexity also makes it more robust against outages. You won’t be able to troubleshoot your distributed application very well if the log management infrastructure isn’t working either.</p> -<a href="https://foo.zone/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program/dtail.gif"><img alt="DTail sample session animated gif" title="DTail sample session animated gif" src="https://foo.zone/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program/dtail.gif" /></a><br /> -<p>As a downside, you won’t be able to access any logs with DTail when the server is down. Furthermore, a server can store logs only up to a certain capacity as disks will fill up. For the purpose of ad-hoc debugging, these are not typically issues. Usually, it’s the application you want to debug and not the server. And disk space is rarely an issue for bare metal and VM-based systems these days, with sufficient space for several weeks’ worth of log storage being available. DTail also supports reading compressed logs. The currently supported compression algorithms are gzip and zstd.</p> -<h2>Combining simplicity, security and efficiency</h2> -<p>DTail also has a client component that connects to multiple servers concurrently for log files (or any other text files).</p> -<p>The DTail client interacts with a DTail server on port TCP/2222 via SSH protocol and does not interact in any way with the system’s SSH server (e.g., OpenSSH Server) which might be running at port TCP/22 already. As a matter of fact, you don’t need a regular SSH server running for DTail at all. There is no support for interactive login shells at TCP/2222 either, as by design that port can only be used for text data streaming. The SSH protocol is used for the public/private key infrastructure and transport encryption only and DTail implements its own protocol on top of SSH for the features provided. There is no need to set up or buy any additional TLS certificates. The port 2222 can be easily reconfigured if you preferred to use a different one.</p> -<p>The DTail server, which is a single static binary, will not fork an external process. This means that all features are implemented in native Go code (exception: Linux ACL support is implemented in C, but it must be enabled explicitly on compile time) and therefore helping to make it robust, secure, efficient, and easy to deploy. A single client, running on a standard Laptop, can connect to thousands of servers concurrently while still maintaining a small resource footprint.</p> -<p>Recent log files are very likely still in the file system caches on the servers. Therefore, there tends to be a minimal I/O overhead involved.</p> -<h2>The DTail family of commands</h2> -<p>Following the UNIX philosophy, DTail includes multiple command-line commands each of them for a different purpose:</p> + <h1 style='display: inline'>DTail - The distributed log tail program</h1><br /> +<br /> +<span class='quote'>Published at 2021-04-22T19:28:41+01:00; Updated at 2021-04-26</span><br /> +<br /> +<a href='./2021-04-22-dtail-the-distributed-log-tail-program/title.png'><img alt='DTail logo image' title='DTail logo image' src='./2021-04-22-dtail-the-distributed-log-tail-program/title.png' /></a><br /> +<br /> +<span>This article first appeared at the Mimecast Engineering Blog but I made it available here in my personal internet site too.</span><br /> +<br /> +<a class='textlink' href='https://medium.com/mimecast-engineering/dtail-the-distributed-log-tail-program-79b8087904bb'>Original Mimecast Engineering Blog post at Medium</a><br /> +<br /> +<span>Running a large cloud-based service requires monitoring the state of huge numbers of machines, a task for which many standard UNIX tools were not really designed. In this post, I will describe a simple program, DTail, that Mimecast has built and released as Open-Source, which enables us to monitor log files of many servers at once without the costly overhead of a full-blown log management system.</span><br /> +<br /> +<span>At Mimecast, we run over 10 thousand server boxes. Most of them host multiple microservices and each of them produces log files. Even with the use of time series databases and monitoring systems, raw application logs are still an important source of information when it comes to analysing, debugging, and troubleshooting services.</span><br /> +<br /> +<span>Every engineer familiar with UNIX or a UNIX-like platform (e.g., Linux) is well aware of tail, a command-line program for displaying a text file content on the terminal which is also especially useful for following application or system log files with tail -f logfile.</span><br /> +<br /> +<span>Think of DTail as a distributed version of the tail program which is very useful when you have a distributed application running on many servers. DTail is an Open-Source, cross-platform, fairly easy to use, support and maintain log file analysis & statistics gathering tool designed for Engineers and Systems Administrators. It is programmed in Google Go.</span><br /> +<br /> +<h2 style='display: inline'>A Mimecast Pet Project</h2><br /> +<br /> +<span>DTail got its inspiration from public domain tools available already in this area but it is a blue sky from-scratch development which was first presented at Mimecast’s annual internal Pet Project competition (awarded with a Bronze prize). It has gained popularity since and is one of the most widely deployed DevOps tools at Mimecast (reaching nearly 10k server installations) and many engineers use it on a regular basis. The Open-Source version of DTail is available at:</span><br /> +<br /> +<a class='textlink' href='https://dtail.dev'>https://dtail.dev</a><br /> +<br /> +<span>Try it out — We would love any feedback. But first, read on…</span><br /> +<br /> +<h2 style='display: inline'>Differentiating from log management systems</h2><br /> +<br /> +<span>Why not just use a full-blown log management system? There are various Open-Source and commercial log management solutions available on the market you could choose from (e.g. the ELK stack). Most of them store the logs in a centralized location and are fairly complex to set up and operate. Possibly they are also pretty expensive to operate if you have to buy dedicated hardware (or pay fees to your cloud provider) and have to hire support staff for it.</span><br /> +<br /> +<span>DTail does not aim to replace any of the log management tools already available but is rather an additional tool crafted especially for ad-hoc debugging and troubleshooting purposes. DTail is cheap to operate as it does not require any dedicated hardware for log storage as it operates directly on the source of the logs. It means that there is a DTail server installed on all server boxes producing logs. This decentralized comes with the direct advantages that there is no introduced delay because the logs are not shipped to a central log storage device. The reduced complexity also makes it more robust against outages. You won’t be able to troubleshoot your distributed application very well if the log management infrastructure isn’t working either.</span><br /> +<br /> +<a href='./2021-04-22-dtail-the-distributed-log-tail-program/dtail.gif'><img alt='DTail sample session animated gif' title='DTail sample session animated gif' src='./2021-04-22-dtail-the-distributed-log-tail-program/dtail.gif' /></a><br /> +<br /> +<span>As a downside, you won’t be able to access any logs with DTail when the server is down. Furthermore, a server can store logs only up to a certain capacity as disks will fill up. For the purpose of ad-hoc debugging, these are not typically issues. Usually, it’s the application you want to debug and not the server. And disk space is rarely an issue for bare metal and VM-based systems these days, with sufficient space for several weeks’ worth of log storage being available. DTail also supports reading compressed logs. The currently supported compression algorithms are gzip and zstd.</span><br /> +<br /> +<h2 style='display: inline'>Combining simplicity, security and efficiency</h2><br /> +<br /> +<span>DTail also has a client component that connects to multiple servers concurrently for log files (or any other text files).</span><br /> +<br /> +<span>The DTail client interacts with a DTail server on port TCP/2222 via SSH protocol and does not interact in any way with the system’s SSH server (e.g., OpenSSH Server) which might be running at port TCP/22 already. As a matter of fact, you don’t need a regular SSH server running for DTail at all. There is no support for interactive login shells at TCP/2222 either, as by design that port can only be used for text data streaming. The SSH protocol is used for the public/private key infrastructure and transport encryption only and DTail implements its own protocol on top of SSH for the features provided. There is no need to set up or buy any additional TLS certificates. The port 2222 can be easily reconfigured if you preferred to use a different one.</span><br /> +<br /> +<span>The DTail server, which is a single static binary, will not fork an external process. This means that all features are implemented in native Go code (exception: Linux ACL support is implemented in C, but it must be enabled explicitly on compile time) and therefore helping to make it robust, secure, efficient, and easy to deploy. A single client, running on a standard Laptop, can connect to thousands of servers concurrently while still maintaining a small resource footprint.</span><br /> +<br /> +<span>Recent log files are very likely still in the file system caches on the servers. Therefore, there tends to be a minimal I/O overhead involved.</span><br /> +<br /> +<h2 style='display: inline'>The DTail family of commands</h2><br /> +<br /> +<span>Following the UNIX philosophy, DTail includes multiple command-line commands each of them for a different purpose:</span><br /> +<br /> <ul> <li>dserver: The DTail server, the only binary required to be installed on the servers involved.</li> <li>dtail: The distributed log tail client for following log files.</li> <li>dcat: The distributed cat client for concatenating and displaying text files.</li> <li>dgrep: The distributed grep client for searching text files for a regular expression pattern.</li> <li>dmap: The distributed map-reduce client for aggregating stats from log files.</li> -</ul> -<a href="https://foo.zone/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program/dgrep.gif"><img alt="DGrep sample session animated gif" title="DGrep sample session animated gif" src="https://foo.zone/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program/dgrep.gif" /></a><br /> -<h2>Usage example</h2> -<p>The use of these commands is almost self-explanatory for a person already used to the standard command line in Unix systems. One of the main goals is to make DTail easy to use. A tool that is too complicated to use under high-pressure scenarios (e.g., during an incident) can be quite detrimental.</p> -<p>The basic idea is to start one of the clients from the command line and provide a list of servers to connect to with –servers. You also must provide a path of remote (log) files via –files. If you want to process multiple files per server, you could either provide a comma-separated list of file paths or make use of file system globbing (or a combination of both).</p> -<p>The following example would connect to all DTail servers listed in the serverlist.txt, follow all files with the ending .log and filter for lines containing the string error. You can specify any Go compatible regular expression. In this example we add the case-insensitive flag to the regex:</p> +</ul><br /> +<a href='./2021-04-22-dtail-the-distributed-log-tail-program/dgrep.gif'><img alt='DGrep sample session animated gif' title='DGrep sample session animated gif' src='./2021-04-22-dtail-the-distributed-log-tail-program/dgrep.gif' /></a><br /> +<br /> +<h2 style='display: inline'>Usage example</h2><br /> +<br /> +<span>The use of these commands is almost self-explanatory for a person already used to the standard command line in Unix systems. One of the main goals is to make DTail easy to use. A tool that is too complicated to use under high-pressure scenarios (e.g., during an incident) can be quite detrimental.</span><br /> +<br /> +<span>The basic idea is to start one of the clients from the command line and provide a list of servers to connect to with –servers. You also must provide a path of remote (log) files via –files. If you want to process multiple files per server, you could either provide a comma-separated list of file paths or make use of file system globbing (or a combination of both).</span><br /> +<br /> +<span>The following example would connect to all DTail servers listed in the serverlist.txt, follow all files with the ending .log and filter for lines containing the string error. You can specify any Go compatible regular expression. In this example we add the case-insensitive flag to the regex:</span><br /> +<br /> <pre> dtail –servers serverlist.txt –files ‘/var/log/*.log’ –regex ‘(?i:error)’ </pre> -<p>You usually want to specify a regular expression as a client argument. This will mean that responses are pre-filtered for all matching lines on the server-side and thus sending back only the relevant lines to the client. If your logs are growing very rapidly and the regex is not specific enough there might be the chance that your client is not fast enough to keep up processing all of the responses. This could be due to a network bottleneck or just as simple as a slow terminal emulator displaying the log lines on the client-side.</p> -<p>A green 100 in the client output before each log line received from the server always indicates that there were no such problems and 100% of all log lines could be displayed on your terminal (have a look at the animated Gifs in this post). If the percentage falls below 100 it means that some of the channels used by the servers to send data to the client are congested and lines were dropped. In this case, the color will change from green to red. The user then could decide to run the same query but with a more specific regex.</p> -<p>You could also provide a comma-separated list of servers as opposed to a text file. There are many more options you could use. The ones listed here are just the very basic ones. There are more instructions and usage examples on the GitHub page. Also, you can study even more of the available options via the –help switch (some real treasures might be hidden there).</p> -<h2>Fitting it in</h2> -<p>DTail integrates nicely into the user management of existing infrastructure. It follows normal system permissions and does not open new “holes” on the server which helps to keep security departments happy. The user would not have more or less file read permissions than he would have via a regular SSH login shell. There is a full SSH key, traditional UNIX permissions, and Linux ACL support. There is also a very low resource footprint involved. On average for tailing and searching log files less than 100MB RAM and less than a quarter of a CPU core per participating server are required. Complex map-reduce queries on big data sets will require more resources accordingly.</p> -<h2>Advanced features</h2> -<p>The features listed here are out of the scope of this blog post but are worthwhile to mention:</p> +<br /> +<span>You usually want to specify a regular expression as a client argument. This will mean that responses are pre-filtered for all matching lines on the server-side and thus sending back only the relevant lines to the client. If your logs are growing very rapidly and the regex is not specific enough there might be the chance that your client is not fast enough to keep up processing all of the responses. This could be due to a network bottleneck or just as simple as a slow terminal emulator displaying the log lines on the client-side.</span><br /> +<br /> +<span>A green 100 in the client output before each log line received from the server always indicates that there were no such problems and 100% of all log lines could be displayed on your terminal (have a look at the animated Gifs in this post). If the percentage falls below 100 it means that some of the channels used by the servers to send data to the client are congested and lines were dropped. In this case, the color will change from green to red. The user then could decide to run the same query but with a more specific regex.</span><br /> +<br /> +<span>You could also provide a comma-separated list of servers as opposed to a text file. There are many more options you could use. The ones listed here are just the very basic ones. There are more instructions and usage examples on the GitHub page. Also, you can study even more of the available options via the –help switch (some real treasures might be hidden there).</span><br /> +<br /> +<h2 style='display: inline'>Fitting it in</h2><br /> +<br /> +<span>DTail integrates nicely into the user management of existing infrastructure. It follows normal system permissions and does not open new “holes” on the server which helps to keep security departments happy. The user would not have more or less file read permissions than he would have via a regular SSH login shell. There is a full SSH key, traditional UNIX permissions, and Linux ACL support. There is also a very low resource footprint involved. On average for tailing and searching log files less than 100MB RAM and less than a quarter of a CPU core per participating server are required. Complex map-reduce queries on big data sets will require more resources accordingly.</span><br /> +<br /> +<h2 style='display: inline'>Advanced features</h2><br /> +<br /> +<span>The features listed here are out of the scope of this blog post but are worthwhile to mention:</span><br /> +<br /> <ul> <li>Distributed map-reduce queries on stats provided in log files with dmap. dmap comes with its own SQL-like aggregation query language.</li> <li>Stats streaming with continuous map-reduce queries. The difference to normal queries is that the stats are aggregated over a specified interval only on the newly written log lines. Thus, giving a de-facto live stat view for each interval.</li> <li>Server-side scheduled queries on log files. The queries are configured in the DTail server configuration file and scheduled at certain time intervals. Results are written to CSV files. This is useful for generating daily stats from the log files without the need for an interactive client.</li> <li>Server-side stats streaming with continuous map-reduce queries. This for example can be used to periodically generate stats from the logs at a configured interval, e.g., log error counts by the minute. These then can be sent to a time-series database (e.g., Graphite) and then plotted in a Grafana dashboard.</li> <li>Support for custom extensions. E.g., for different server discovery methods (so you don’t have to rely on plain server lists) and log file formats (so that map-reduce queries can parse more stats from the logs).</li> -</ul> -<h2>For the future</h2> -<p>There are various features we want to see in the future.</p> +</ul><br /> +<h2 style='display: inline'>For the future</h2><br /> +<br /> +<span>There are various features we want to see in the future.</span><br /> +<br /> <ul> <li>A spartan mode, not printing out any extra information but the raw remote log files would be a nice feature to have. This will make it easier to post-process the data produced by the DTail client with common UNIX tools. (To some degree this is possible already, just disable the ANSI terminal color output of the client with -noColors and pipe the output to another program).</li> <li>Tempting would be implementing the dgoawk command, a distributed version of the AWK programming language purely implemented in Go, for advanced text data stream processing capabilities. There are 3rd party libraries available implementing AWK in pure Go which could be used.</li> <li>A more complex change would be the support of federated queries. You can connect to thousands of servers from a single client running on a laptop. But does it scale to 100k of servers? Some of the servers could be used as middleware for connecting to even more servers.</li> <li>Another aspect is to extend the documentation. Especially the advanced features such as map-reduce query language and how to configure the server-side queries currently do require more documentation. For now, you can read the code, sample config files or just ask the author for that! But this will be certainly addressed in the future.</li> -</ul> -<h2>Open Source</h2> -<p>Mimecast highly encourages you to have a look at DTail and submit an issue for any features you would like to see. Have you found a bug? Maybe you just have a question or comment? If you want to go a step further: We would also love to see pull requests for any features or improvements. Either way, if in doubt just contact us via the DTail GitHub page.</p> -<a class="textlink" href="https://dtail.dev">https://dtail.dev</a><br /> -<p>Other related posts are:</p> -<a class="textlink" href="https://foo.zone/gemfeed/2022-10-30-installing-dtail-on-openbsd.html">2022-10-30 Installing DTail on OpenBSD</a><br /> -<a class="textlink" href="https://foo.zone/gemfeed/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="https://foo.zone/gemfeed/2021-04-22-dtail-the-distributed-log-tail-program.html">2021-04-22 DTail - The distributed log tail program (You are currently reading this)</a><br /> -<p>E-Mail your comments to hi@paul.cyou :-)</p> -<a class="textlink" href="../">Back to the main site</a><br /> +</ul><br /> +<h2 style='display: inline'>Open Source</h2><br /> +<br /> +<span>Mimecast highly encourages you to have a look at DTail and submit an issue for any features you would like to see. Have you found a bug? Maybe you just have a question or comment? If you want to go a step further: We would also love to see pull requests for any features or improvements. Either way, if in doubt just contact us via the DTail GitHub page.</span><br /> +<br /> +<a class='textlink' href='https://dtail.dev'>https://dtail.dev</a><br /> +<br /> +<span>Other related posts are:</span><br /> +<br /> +<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br /> +<a class='textlink' href='./2022-03-06-the-release-of-dtail-4.0.0.html'>2022-03-06 The release of DTail 4.0.0</a><br /> +<a class='textlink' href='./2021-04-22-dtail-the-distributed-log-tail-program.html'>2021-04-22 DTail - The distributed log tail program (You are currently reading this)</a><br /> +<br /> +<span>E-Mail your comments to hi@paul.cyou :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> </entry> @@ -5807,17 +6527,23 @@ fib(10) = 55 <summary>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.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1>Perl Daemon (Service Framework)</h1> -<p class="quote"><i>Published at 2011-05-07T22:26:02+01:00; Updated at 2021-05-07</i></p> + <h1 style='display: inline'>Perl Daemon (Service Framework)</h1><br /> +<br /> +<span class='quote'>Published at 2011-05-07T22:26:02+01:00; Updated at 2021-05-07</span><br /> +<br /> <pre> a'! _,,_ a'! _,,_ a'! _,,_ \\_/ \ \\_/ \ \\_/ \.-, \, /-( /'-,\, /-( /'-, \, /-( / //\ //\\ //\ //\\ //\ //\\jrei </pre> -<p>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.</p> -<h2>Features</h2> -<p>PerlDaemon supports:</p> +<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 /> +<h2 style='display: inline'>Features</h2><br /> +<br /> +<span>PerlDaemon supports:</span><br /> +<br /> <ul> <li>Automatic daemonizing</li> <li>Logging</li> @@ -5827,8 +6553,9 @@ fib(10) = 55 <li>Easy to configure</li> <li>Easy to extend</li> <li>Multi-instance support (just use a different directory for each instance).</li> -</ul> -<h2>Quick Guide</h2> +</ul><br /> +<h2 style='display: inline'>Quick Guide</h2><br /> +<br /> <pre> # Starting ./bin/perldaemon start (or shortcut ./control start) @@ -5839,9 +6566,13 @@ fib(10) = 55 # Alternatively: Starting in foreground ./bin/perldaemon start daemon.daemonize=no (or shortcut ./control foreground) </pre> -<p>To stop a daemon from running in foreground mode, "Ctrl+C" must be hit. To see more available startup options run "./control" without any argument.</p> -<h2>How to configure</h2> -<p>The daemon instance can be configured in "./conf/perldaemon.conf". If you want to change a property only once, it is also possible to specify it on the command line (which will take precedence over the config file). All available config properties can be displayed via "./control keys":</p> +<br /> +<span>To stop a daemon from running in foreground mode, "Ctrl+C" must be hit. To see more available startup options run "./control" without any argument.</span><br /> +<br /> +<h2 style='display: inline'>How to configure</h2><br /> +<br /> +<span>The daemon instance can be configured in "./conf/perldaemon.conf". If you want to change a property only once, it is also possible to specify it on the command line (which will take precedence over the config file). All available config properties can be displayed via "./control keys":</span><br /> +<br /> <pre> pb@titania:~/svn/utils/perldaemon/trunk$ ./control keys # Path to the logfile @@ -5868,8 +6599,11 @@ daemon.alivefile=./run/perldaemon.alive # Specifies the working directory daemon.wd=./ </pre> -<h2>Example </h2> -<p>So let's start the daemon with a loop interval of 10 seconds:</p> +<br /> +<h2 style='display: inline'>Example </h2><br /> +<br /> +<span>So let's start the daemon with a loop interval of 10 seconds:</span><br /> +<br /> <pre> $ ./control keys | grep daemon.loopinterval daemon.loopinterval=1 @@ -5883,15 +6617,23 @@ Mon Jun 13 11:29:27 2011 (PID 2838): ExampleModule Test 2 $ ./control stop Stopping daemon now... </pre> -<p>If you want to change that property forever, either edit perldaemon.conf or do this:</p> +<br /> +<span>If you want to change that property forever, either edit perldaemon.conf or do this:</span><br /> +<br /> <pre> $ ./control keys daemon.loopinterval=10 > new.conf; mv new.conf conf/perldaemon.conf </pre> -<h2>HiRes event loop</h2> -<p>PerlDaemon uses <span class="inlinecode">Time::HiRes</span> to make sure that all the events run incorrect intervals. For each loop run, a time carry value is recorded and added to the next loop run to catch up on lost time.</p> -<h2>Writing your own modules</h2> -<h3>Example module</h3> -<p>This is one of the example modules you will find in the source code. It should be pretty self-explanatory if you know Perl :-).</p> +<br /> +<h2 style='display: inline'>HiRes event loop</h2><br /> +<br /> +<span>PerlDaemon uses <span class='inlinecode'>Time::HiRes</span> to make sure that all the events run incorrect intervals. For each loop run, a time carry value is recorded and added to the next loop run to catch up on lost time.</span><br /> +<br /> +<h2 style='display: inline'>Writing your own modules</h2><br /> +<br /> +<h3 style='display: inline'>Example module</h3><br /> +<br /> +<span>This is one of the example modules you will find in the source code. It should be pretty self-explanatory if you know Perl :-).</span><br /> +<br /> <pre> package PerlDaemonModules::ExampleModule; @@ -5923,8 +6665,11 @@ sub do ($) { 1; </pre> -<h3>Your own module</h3> -<p>Want to give it some better use? It's just as easy as:</p> +<br /> +<h3 style='display: inline'>Your own module</h3><br /> +<br /> +<span>Want to give it some better use? It's just as easy as:</span><br /> +<br /> <pre> cd ./lib/PerlDaemonModules/ cp ExampleModule.pm YourModule.pm @@ -5932,17 +6677,26 @@ sub do ($) { cd - ./bin/perldaemon restart (or shortcurt ./control restart) </pre> -<p>Now watch <span class="inlinecode">./log/perldaemon.log</span> closely. It is a good practice to test your modules in 'foreground mode' (see above how to do that).</p> -<p>BTW: You can install as many modules within the same instance as desired. But they are run in sequential order (in future, they can also run in parallel using several threads or processes).</p> -<h2>May the source be with you</h2> -<p>You can find PerlDaemon (including the examples) at:</p> -<a class="textlink" href="https://codeberg.org/snonux/perldaemon">https://codeberg.org/snonux/perldaemon</a><br /> -<p>Other related posts are:</p> -<a class="textlink" href="https://foo.zone/gemfeed/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="https://foo.zone/gemfeed/2011-05-07-perl-daemon-service-framework.html">2011-05-07 Perl Daemon (Service Framework) (You are currently reading this)</a><br /> -<a class="textlink" href="https://foo.zone/gemfeed/2008-06-26-perl-poetry.html">2008-06-26 Perl Poetry</a><br /> -<p>E-Mail your comments to hi@paul.cyou :-)</p> -<a class="textlink" href="../">Back to the main site</a><br /> +<br /> +<span>Now watch <span class='inlinecode'>./log/perldaemon.log</span> closely. It is a good practice to test your modules in 'foreground mode' (see above how to do that).</span><br /> +<br /> +<span>BTW: You can install as many modules within the same instance as desired. But they are run in sequential order (in future, they can also run in parallel using several threads or processes).</span><br /> +<br /> +<h2 style='display: inline'>May the source be with you</h2><br /> +<br /> +<span>You can find PerlDaemon (including the examples) at:</span><br /> +<br /> +<a class='textlink' href='https://codeberg.org/snonux/perldaemon'>https://codeberg.org/snonux/perldaemon</a><br /> +<br /> +<span>Other related posts are:</span><br /> +<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) (You are currently reading this)</a><br /> +<a class='textlink' href='./2008-06-26-perl-poetry.html'>2008-06-26 Perl Poetry</a><br /> +<br /> +<span>E-Mail your comments to hi@paul.cyou :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> </entry> @@ -6677,8 +7431,10 @@ _jgs_\|//_\\|///_\V/_\|//__ <summary>Here are some Perl Poems I wrote. They don't do anything useful when you run them, but they don't produce a compiler error either. They only exist for fun and demonstrate what you can do with Perl syntax.</summary> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> - <h1>Perl Poetry</h1> -<p class="quote"><i>Published at 2008-06-26T21:43:51+01:00; Updated at 2021-05-04</i></p> + <h1 style='display: inline'>Perl Poetry</h1><br /> +<br /> +<span class='quote'>Published at 2008-06-26T21:43:51+01:00; Updated at 2021-05-04</span><br /> +<br /> <pre> '\|/' * -- * ----- @@ -6701,10 +7457,15 @@ _~~|~/_|_|__/|~~~~~~~ | / ~~~~~ | | ~~~~~~~~ ~ ~ ~~~ _|| (_/ (___)_| |Nov291999 (__) (____) </pre> -<p>Here are some Perl Poems I wrote. They don't do anything useful when you run them, but they don't produce a compiler error either. They only exist for fun and demonstrate what you can do with Perl syntax.</p> -<p>Wikipedia: "Perl poetry is the practice of writing poems that can be compiled as legal Perl code, for example the piece known as Black Perl. Perl poetry is made possible by the large number of English words that are used in the Perl language. New poems are regularly submitted to the community at PerlMonks."</p> -<a class="textlink" href="https://en.wikipedia.org/wiki/Perl">https://en.wikipedia.org/wiki/Perl</a><br /> -<h2>math.pl</h2> +<br /> +<span>Here are some Perl Poems I wrote. They don't do anything useful when you run them, but they don't produce a compiler error either. They only exist for fun and demonstrate what you can do with Perl syntax.</span><br /> +<br /> +<span>Wikipedia: "Perl poetry is the practice of writing poems that can be compiled as legal Perl code, for example the piece known as Black Perl. Perl poetry is made possible by the large number of English words that are used in the Perl language. New poems are regularly submitted to the community at PerlMonks."</span><br /> +<br /> +<a class='textlink' href='https://en.wikipedia.org/wiki/Perl'>https://en.wikipedia.org/wiki/Perl</a><br /> +<br /> +<h2 style='display: inline'>math.pl</h2><br /> +<br /> <pre> #!/usr/bin/perl @@ -6746,7 +7507,9 @@ home: //ig,'nore', time and sleep $very =~ s/tr/on/g; __END__ </pre> -<h2>christmas.pl</h2> +<br /> +<h2 style='display: inline'>christmas.pl</h2><br /> +<br /> <pre> #!/usr/bin/perl @@ -6790,7 +7553,9 @@ __END__ This is perl, v5.8.8 built for i386-freebsd-64int </pre> -<h2>shopping.pl</h2> +<br /> +<h2 style='display: inline'>shopping.pl</h2><br /> +<br /> <pre> #!/usr/bin/perl @@ -6822,15 +7587,22 @@ and sleep until unpack$ing, cool products(); __END__ This is perl, v5.8.8 built for i386-freebsd-64int </pre> -<h2>More...</h2> -<p>Did you like what you saw? Have a look at Codeberg to see my other poems too:</p> -<a class="textlink" href="https://codeberg.org/snonux/perl-poetry">https://codeberg.org/snonux/perl-poetry</a><br /> -<p>Other related posts are:</p> -<a class="textlink" href="https://foo.zone/gemfeed/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="https://foo.zone/gemfeed/2011-05-07-perl-daemon-service-framework.html">2011-05-07 Perl Daemon (Service Framework)</a><br /> -<a class="textlink" href="https://foo.zone/gemfeed/2008-06-26-perl-poetry.html">2008-06-26 Perl Poetry (You are currently reading this)</a><br /> -<p>E-Mail your comments to hi@paul.cyou :-)</p> -<a class="textlink" href="../">Back to the main site</a><br /> +<br /> +<h2 style='display: inline'>More...</h2><br /> +<br /> +<span>Did you like what you saw? Have a look at Codeberg to see my other poems too:</span><br /> +<br /> +<a class='textlink' href='https://codeberg.org/snonux/perl-poetry'>https://codeberg.org/snonux/perl-poetry</a><br /> +<br /> +<span>Other related posts are:</span><br /> +<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 (You are currently reading this)</a><br /> +<br /> +<span>E-Mail your comments to hi@paul.cyou :-)</span><br /> +<br /> +<a class='textlink' href='../'>Back to the main site</a><br /> </div> </content> </entry> diff --git a/gemfeed/index.html b/gemfeed/index.html index c7f055ba..99333ddd 100644 --- a/gemfeed/index.html +++ b/gemfeed/index.html @@ -12,48 +12,48 @@ <br /> <h2 style='display: inline'>To be in the .zone!</h2><br /> <br /> -<a class=textlink href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 - 'Never split the difference' book notes</a><br /> -<a class=textlink href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 - Gemtexter 2.0.0 - Let's Gemtext again^2</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 /> -<a class=textlink href='./2023-02-26-how-to-shut-down-after-work.html'>2023-02-26 - How to shut down after work</a><br /> -<a class=textlink href='./2023-01-23-why-grapheneos-rox.html'>2023-01-23 - Why GrapheneOS rox</a><br /> -<a class=textlink href='./2022-12-24-ultrarelearning-java-my-takeaways.html'>2022-12-24 - (Re)learning Java - My takeaways</a><br /> -<a class=textlink href='./2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.html'>2022-11-24 - I tried (Doom) Emacs, but I switched back to (Neo)Vim</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-09-30-after-a-bad-nights-sleep.html'>2022-09-30 - After a bad night's sleep</a><br /> -<a class=textlink href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 - Gemtexter 1.1.0 - Let's Gemtext again</a><br /> -<a class=textlink href='./2022-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-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='./2022-04-10-creative-universe.html'>2022-04-10 - Creative universe</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-02-04-computer-operating-systems-i-use.html'>2022-02-04 - Computer operating systems I use(d)</a><br /> -<a class=textlink href='./2022-01-23-welcome-to-the-foo.zone.html'>2022-01-23 - Welcome to the foo.zone</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-12-26-how-to-stay-sane-as-a-devops-person.html'>2021-12-26 - How to stay sane as a DevOps person </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-10-22-defensive-devops.html'>2021-10-22 - Defensive DevOps</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-08-01-on-being-pedantic-about-open-source.html'>2021-08-01 - On being Pedantic about Open-Source</a><br /> -<a class=textlink href='./2021-07-04-the-well-grounded-rubyist.html'>2021-07-04 - The Well-Grounded Rubyist</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 /> -<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-04-22-dtail-the-distributed-log-tail-program.html'>2021-04-22 - DTail - The distributed log tail program</a><br /> -<a class=textlink href='./2018-06-01-realistic-load-testing-with-ioriot-for-linux.html'>2018-06-01 - Realistic load testing with I/O Riot for Linux</a><br /> -<a class=textlink href='./2016-11-20-object-oriented-programming-with-ansi-c.html'>2016-11-20 - Object oriented programming with ANSI C</a><br /> -<a class=textlink href='./2016-05-22-spinning-up-my-own-authoritative-dns-servers.html'>2016-05-22 - Spinning up my own authoritative DNS servers</a><br /> -<a class=textlink href='./2016-04-16-offsite-backup-with-zfs-part2.html'>2016-04-16 - Offsite backup with ZFS (Part 2)</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 /> -<a class=textlink href='./2016-04-03-offsite-backup-with-zfs.html'>2016-04-03 - Offsite backup with ZFS</a><br /> -<a class=textlink href='./2015-12-05-run-debian-on-your-phone-with-debroid.html'>2015-12-05 - Run Debian on your phone with Debroid</a><br /> -<a class=textlink href='./2014-03-24-the-fibonacci.pl.c-polyglot.html'>2014-03-24 - The fibonacci.pl.raku.c Polyglot</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='./2010-05-09-the-fype-programming-language.html'>2010-05-09 - The Fype Programming Language</a><br /> -<a class=textlink href='./2010-05-07-lazy-evaluation-with-standarn-ml.html'>2010-05-07 - Lazy Evaluation with Standard ML</a><br /> -<a class=textlink href='./2010-04-09-standard-ml-and-haskell.html'>2010-04-09 - Standard ML and Haskell</a><br /> -<a class=textlink href='./2008-12-29-using-my-nokia-n95-for-fixing-my-mta.html'>2008-12-29 - Using my Nokia N95 for fixing my MTA</a><br /> -<a class=textlink href='./2008-06-26-perl-poetry.html'>2008-06-26 - Perl Poetry</a><br /> +<a class='textlink' href='./2023-04-01-never-split-the-difference-book-notes.html'>2023-04-01 - 'Never split the difference' book notes</a><br /> +<a class='textlink' href='./2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.html'>2023-03-25 - Gemtexter 2.0.0 - Let's Gemtext again^2</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 /> +<a class='textlink' href='./2023-02-26-how-to-shut-down-after-work.html'>2023-02-26 - How to shut down after work</a><br /> +<a class='textlink' href='./2023-01-23-why-grapheneos-rox.html'>2023-01-23 - Why GrapheneOS rox</a><br /> +<a class='textlink' href='./2022-12-24-ultrarelearning-java-my-takeaways.html'>2022-12-24 - (Re)learning Java - My takeaways</a><br /> +<a class='textlink' href='./2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.html'>2022-11-24 - I tried (Doom) Emacs, but I switched back to (Neo)Vim</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-09-30-after-a-bad-nights-sleep.html'>2022-09-30 - After a bad night's sleep</a><br /> +<a class='textlink' href='./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html'>2022-08-27 - Gemtexter 1.1.0 - Let's Gemtext again</a><br /> +<a class='textlink' href='./2022-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-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='./2022-04-10-creative-universe.html'>2022-04-10 - Creative universe</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-02-04-computer-operating-systems-i-use.html'>2022-02-04 - Computer operating systems I use(d)</a><br /> +<a class='textlink' href='./2022-01-23-welcome-to-the-foo.zone.html'>2022-01-23 - Welcome to the foo.zone</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-12-26-how-to-stay-sane-as-a-devops-person.html'>2021-12-26 - How to stay sane as a DevOps person </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-10-22-defensive-devops.html'>2021-10-22 - Defensive DevOps</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-08-01-on-being-pedantic-about-open-source.html'>2021-08-01 - On being Pedantic about Open-Source</a><br /> +<a class='textlink' href='./2021-07-04-the-well-grounded-rubyist.html'>2021-07-04 - The Well-Grounded Rubyist</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 /> +<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-04-22-dtail-the-distributed-log-tail-program.html'>2021-04-22 - DTail - The distributed log tail program</a><br /> +<a class='textlink' href='./2018-06-01-realistic-load-testing-with-ioriot-for-linux.html'>2018-06-01 - Realistic load testing with I/O Riot for Linux</a><br /> +<a class='textlink' href='./2016-11-20-object-oriented-programming-with-ansi-c.html'>2016-11-20 - Object oriented programming with ANSI C</a><br /> +<a class='textlink' href='./2016-05-22-spinning-up-my-own-authoritative-dns-servers.html'>2016-05-22 - Spinning up my own authoritative DNS servers</a><br /> +<a class='textlink' href='./2016-04-16-offsite-backup-with-zfs-part2.html'>2016-04-16 - Offsite backup with ZFS (Part 2)</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 /> +<a class='textlink' href='./2016-04-03-offsite-backup-with-zfs.html'>2016-04-03 - Offsite backup with ZFS</a><br /> +<a class='textlink' href='./2015-12-05-run-debian-on-your-phone-with-debroid.html'>2015-12-05 - Run Debian on your phone with Debroid</a><br /> +<a class='textlink' href='./2014-03-24-the-fibonacci.pl.c-polyglot.html'>2014-03-24 - The fibonacci.pl.raku.c Polyglot</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='./2010-05-09-the-fype-programming-language.html'>2010-05-09 - The Fype Programming Language</a><br /> +<a class='textlink' href='./2010-05-07-lazy-evaluation-with-standarn-ml.html'>2010-05-07 - Lazy Evaluation with Standard ML</a><br /> +<a class='textlink' href='./2010-04-09-standard-ml-and-haskell.html'>2010-04-09 - Standard ML and Haskell</a><br /> +<a class='textlink' href='./2008-12-29-using-my-nokia-n95-for-fixing-my-mta.html'>2008-12-29 - Using my Nokia N95 for fixing my MTA</a><br /> +<a class='textlink' href='./2008-06-26-perl-poetry.html'>2008-06-26 - Perl Poetry</a><br /> <p class="footer"> Generated with <a href="https://codeberg.org/snonux/gemtexter">Gemtexter</a> | served by <a href="https://www.OpenBSD.org">OpenBSD</a>/<a href="https://man.openbsd.org/httpd.8">httpd(8)</a> | |
