diff options
| author | Paul Buetow <paul@buetow.org> | 2023-07-17 20:24:53 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2023-07-17 20:24:53 +0300 |
| commit | c79890d66e79566ab71e3221679b0689eefe50bc (patch) | |
| tree | 4c740e10654703050d8f959a914eb8c8efbdc53a | |
| parent | ef8c48015767b8b260d746b3f82baf2f4323425e (diff) | |
Update content for gemtext
| -rw-r--r-- | gemfeed/2022-05-27-perl-is-still-a-great-choice.gmi | 2 | ||||
| -rw-r--r-- | gemfeed/atom.xml.tmp | 6754 | ||||
| -rw-r--r-- | index.gmi | 2 | ||||
| -rw-r--r-- | uptime-stats.gmi | 2 |
4 files changed, 4 insertions, 6756 deletions
diff --git a/gemfeed/2022-05-27-perl-is-still-a-great-choice.gmi b/gemfeed/2022-05-27-perl-is-still-a-great-choice.gmi index 5859f42b..ecb2a9c3 100644 --- a/gemfeed/2022-05-27-perl-is-still-a-great-choice.gmi +++ b/gemfeed/2022-05-27-perl-is-still-a-great-choice.gmi @@ -103,7 +103,7 @@ About the first point, using Perl for better "shell" scripts was actually the or Here are some reasons why not to chose Perl and look for "better" alternatives: -* 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, .... +* If performance is your main objectives, then Perl might not be the language to use. Perl is a dynamic interpreted language, and it will generally never be as fast as statically typed languages compiled to native binaries (e.g. C/C++/Rust/Haskell) or statically typed languages run in a VM with JIT (e.g. Java) or languages like Golang (statically typed, compiled to a binary but still with a runtime in the binary). Perl might be still faster than the other language listed here in certain circumstances (e.g. faster startup time than Java or faster regular expressions engine), but usually it's not. It's not a problem of Perl, it's a problem of all dynamic scripting languages including Python, Ruby, .... * 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). * 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. * 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. diff --git a/gemfeed/atom.xml.tmp b/gemfeed/atom.xml.tmp index 9702c301..20cb849d 100644 --- a/gemfeed/atom.xml.tmp +++ b/gemfeed/atom.xml.tmp @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> - <updated>2023-07-17T05:18:04+03:00</updated> + <updated>2023-07-17T20:24:46+03:00</updated> <title>foo.zone feed</title> <subtitle>To be in the .zone!</subtitle> <link href="gemini://foo.zone/gemfeed/atom.xml" rel="self" /> @@ -2184,6755 +2184,3 @@ nmap ,<b><font color="#0000FF">j</font></b> :<b><font color="#0000FF">call</font </div> </content> </entry> - <entry> - <title>Installing DTail on OpenBSD</title> - <link href="gemini://foo.zone/gemfeed/2022-10-30-installing-dtail-on-openbsd.gmi" /> - <id>gemini://foo.zone/gemfeed/2022-10-30-installing-dtail-on-openbsd.gmi</id> - <updated>2022-10-30T11:03:19+02:00</updated> - <author> - <name>Paul Buetow</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>This will be a quick blog post, as I am busy with my personal life now. I have relocated to a different country and am still busy arranging things. So bear with me :-)</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline'>Installing DTail on OpenBSD</h1><br /> -<br /> -<span class='quote'>Published at 2022-10-30T11:03:19+02:00</span><br /> -<br /> -<pre> - ,_---~~~~~----._ - _,,_,*^____ _____``*g*\"*, -/ __/ /' ^. / \ ^@q f - @f | | | | 0 _/ -\`/ \~__((@/ __ \__((@/ \ - | _l__l_ I <--- The Go Gopher - } [______] I - ] | | | | - ] ~ ~ | - | | - | | - | | A ; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~|~~~,--,-/ \---,-/|~~,~~~~~~~~~~~~~~~~~~~~~~~~~~~ - _|\,'. /| /| `/|-. - \`.' /| , `;. - ,'\ A A A A _ /| `.; - ,/ _ A _ / _ /| ; - /\ / \ , , A / / `/| - /_| | _ \ , , ,/ \ - // | |/ `.\ ,- , , ,/ ,/ \/ - / @| |@ / /' \ \ , > /| ,--. - |\_/ \_/ / | | , ,/ \ ./' __:.. - | __ __ | | | .--. , > > |-' / ` - ,/| / ' \ | | | \ , | / - / |<--.__,->| | | . `. > > / ( - /_,' \\ ^ / \ / / `. >-- /^\ | - \\___/ \ / / \__' \ \ \/ \ | - `. |/ , , /`\ \ ) - \ ' |/ , V \ / `-\ - OpenBSD Puffy ---> `|/ ' V V \ \.' \_ - '`-. V V \./'\ - `|/-. \ / \ /,---`\ kat - / `._____V_____V' - ' ' -</pre> -<br /> -<span>This will be a quick blog post, as I am busy with my personal life now. I have relocated to a different country and am still busy arranging things. So bear with me :-)</span><br /> -<br /> -<span> In this post, I want to give a quick overview (or how-to) about installing DTail on OpenBSD, as the official documentation only covers Red Hat and Fedora Linux! And this blog post will also be used as my reference!</span><br /> -<br /> -<a class='textlink' href='https://dtail.dev'>https://dtail.dev</a><br /> -<br /> -<span>I am using Rexify for my OpenBSD automation. Check out the following article covering my Rex setup in a little bit more detail:</span><br /> -<br /> -<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>Let's Encrypt with OpenBSD and Rex</a><br /> -<br /> -<span>I will also mention some relevant <span class='inlinecode'>Rexfile</span> snippets in this post!</span><br /> -<br /> -<h2 style='display: inline'>Compile it</h2><br /> -<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> -<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 -$ git clone https://github.com/mimecast/dtail -$ cd dtail -$ gmake -</pre> -<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> -<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> -<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> -<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> -<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 - -daemon="/usr/local/bin/dserver" -daemon_flags="-cfg /etc/dserver/dtail.json" -daemon_user="_dserver" - -. /etc/rc.d/rc.subr - -rc_reload=NO - -rc_pre() { - install -d -o _dserver /var/log/dserver - install -d -o _dserver /var/run/dserver/cache -} - -rc_cmd $1 & -END -$ doas chmod 755 /etc/rc.d/dserver -</pre> -<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', - sub { - my $restart = FALSE; - - file '/etc/rc.d/dserver': - content => template('./etc/rc.d/dserver.tpl'), - owner => 'root', - group => 'wheel', - mode => '755', - on_change => sub { $restart = TRUE }; - - . - . - . - . - - service 'dserver' => 'restart' if $restart; - service 'dserver', ensure => 'started'; - }; -</pre> -<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/examples/dtail.json.examples | - 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 /> -<br /> -<pre> - "Common": { - "LogDir": "/var/log/dserver", - "Logger": "Fout", - "LogRotation": "Daily", - "CacheDir": "cache", - "SSHPort": 2222, - "LogLevel": "Info" - } -</pre> -<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'; - -file '/etc/dserver/dtail.json', - content => template('./etc/dserver/dtail.json.tpl'), - owner => 'root', - group => 'wheel', - mode => '755', - on_change => sub { $restart = TRUE }; -</pre> -<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 - -CACHEDIR=/var/run/dserver/cache -DSERVER_USER=_dserver -DSERVER_GROUP=_dserver - -echo 'Updating SSH key cache' - -ls /home/ | while read remoteuser; do - keysfile=/home/$remoteuser/.ssh/authorized_keys - - if [ -f $keysfile ]; then - cachefile=$CACHEDIR/$remoteuser.authorized_keys - echo "Caching $keysfile -> $cachefile" - - cp $keysfile $cachefile - chown $DSERVER_USER:$DSERVER_GROUP $cachefile - chmod 600 $cachefile - fi -done - -# Cleanup obsolete public SSH keys -find $CACHEDIR -name \*.authorized_keys -type f | -while read cachefile; do - remoteuser=$(basename $cachefile | cut -d. -f1) - keysfile=/home/$remoteuser/.ssh/authorized_keys - - if [ ! -f $keysfile ]; then - echo 'Deleting obsolete cache file $cachefile' - rm $cachefile - fi -done - -echo 'All set...' -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 /> -<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> -<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'), - owner => 'root', - group => 'wheel', - mode => '500'; - -append_if_no_such_line '/etc/daily.local', '/usr/local/bin/dserver-update-key-cache.sh'; -</pre> -<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 -$ tail -f /var/log/dserver/*.log -INFO|1022-090634|Starting scheduled job runner after 2s -INFO|1022-090634|Starting continuous job runner after 2s -INFO|1022-090644|24204|stats.go:53|2|11|7|||MAPREDUCE:STATS|currentConnections=0|lifetimeConnections=0 -INFO|1022-090654|24204|stats.go:53|2|11|7|||MAPREDUCE:STATS|currentConnections=0|lifetimeConnections=0 -INFO|1022-090719|Starting server|DTail 4.1.0 Protocol 4.1 Have a lot of fun! -INFO|1022-090719|Generating private server RSA host key -INFO|1022-090719|Starting server -INFO|1022-090719|Binding server|0.0.0.0:2222 -INFO|1022-090719|Starting scheduled job runner after 2s -INFO|1022-090719|Starting continuous job runner after 2s -INFO|1022-090729|86050|stats.go:53|2|11|7|||MAPREDUCE:STATS|currentConnections=0|lifetimeConnections=0 -INFO|1022-090739|86050|stats.go:53|2|11|7|||MAPREDUCE:STATS|currentConnections=0|lifetimeConnect -. -. -. -Ctr+C -</pre> -<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 -Caching /home/_dserver/.ssh/authorized_keys -> /var/cache/dserver/_dserver.authorized_keys -Caching /home/admin/.ssh/authorized_keys -> /var/cache/dserver/admin.authorized_keys -Caching /home/failunderd/.ssh/authorized_keys -> /var/cache/dserver/failunderd.authorized_keys -Caching /home/git/.ssh/authorized_keys -> /var/cache/dserver/git.authorized_keys -Caching /home/paul/.ssh/authorized_keys -> /var/cache/dserver/paul.authorized_keys -Caching /home/rex/.ssh/authorized_keys -> /var/cache/dserver/rex.authorized_keys -All set... -</pre> -<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} -CLIENT|earth|WARN|Encountered unknown host|{fishfinger.buetow.org:2222 0xc0000a0150 0xc000460110 [fishfinger.buetow.org]:2222 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNiikdL7+tWSN0rCaw1tOd9aQgeUFgb830V9ejkyJ5h93PKLCWZSMMCtiabc1aUeUZR//rZjcPHFLuLq/YC+Y3naYtGd6j8qVrcfG8jy3gCbs4tV9SZ9qd5E24mtYqYdGlee6JN6kEWhJxFkEwPfNlG+YAr3KC8lvEAE2JdWvaZavqsqMvHZtAX3b25WCBf2HGkyLZ+d9cnimRUOt+/+353BQFCEct/2mhMVlkr4I23CY6Tsufx0vtxx25nbFdZias6wmhxaE9p3LiWXygPWGU5iZ4RSQSImQz4zyOc9rnJeP1rwGk0OWDJhdKNXuf0kIPdzMfwxv2otgY32/DJj6L [46.23.94.99]:2222 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNiikdL7+tWSN0rCaw1tOd9aQgeUFgb830V9ejkyJ5h93PKLCWZSMMCtiabc1aUeUZR//rZjcPHFLuLq/YC+Y3naYtGd6j8qVrcfG8jy3gCbs4tV9SZ9qd5E24mtYqYdGlee6JN6kEWhJxFkEwPfNlG+YAr3KC8lvEAE2JdWvaZavqsqMvHZtAX3b25WCBf2HGkyLZ+d9cnimRUOt+/+353BQFCEct/2mhMVlkr4I23CY6Tsufx0vtxx25nbFdZias6wmhxaE9p3LiWXygPWGU5iZ4RSQSImQz4zyOc9rnJeP1rwGk0OWDJhdKNXuf0kIPdzMfwxv2otgY32/DJj6L 0xc0000a2240} -Encountered 2 unknown hosts: 'blowfish.buetow.org:2222,fishfinger.buetow.org:2222' -Do you want to trust these hosts?? (y=yes,a=all,n=no,d=details): a -CLIENT|earth|INFO|STATS:STATS|cgocalls=11|cpu=8|connected=2|servers=2|connected%=100|new=2|throttle=0|goroutines=19 -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> -<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> -<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 paul at buetow.org :-)</span><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>After a bad night's sleep</title> - <link href="gemini://foo.zone/gemfeed/2022-09-30-after-a-bad-nights-sleep.gmi" /> - <id>gemini://foo.zone/gemfeed/2022-09-30-after-a-bad-nights-sleep.gmi</id> - <updated>2022-09-30T09:53:23+03:00</updated> - <author> - <name>Paul Buetow</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>Everyone has it once in a while: A bad night's sleep. Here I attempt to list valuable tips on how to deal with it.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline'>After a bad night's sleep</h1><br /> -<br /> -<span class='quote'>Published at 2022-09-30T09:53:23+03:00; Updated at 2022-10-12</span><br /> -<br /> -<pre> - z - z - Z - .--. Z Z - / _(c\ .-. __ - | / / '-; \'-'` `\______ - \_\/'/ __/ ) / ) | \--, - | \`""`__-/ .'--/ /--------\ \ - \\` ///-\/ / /---;-. '-' -jgs (________\ \ - '-' -</pre> -<br /> -<span>Everyone has it once in a while: A bad night's sleep. Here I attempt to list valuable tips on how to deal with it.</span><br /> -<br /> -<h2 style='display: inline'>Don't take the day off.</h2><br /> -<br /> -<span>Don't take a day off after not sleeping enough the previous night. That would be wasting the holiday allowance. It wouldn't be possible to enjoy my free time anyway, so why not just work? There's still a way for an IT Engineer to be productive (sometimes even more) with half or less of the concentration power available!</span><br /> -<br /> -<h2 style='display: inline'>Start work early</h2><br /> -<br /> -<span>Probably I am already awake early and am unable to fall asleep again. My strategy here is to "attack" the day: Start work early and finish early. The early bird will also encounter fewer distractions from colleagues.</span><br /> -<br /> -<h2 style='display: inline'>Sweat the small stuff</h2><br /> -<br /> -<span>There's never a shortage of small items to hook off my list. Most of these items don't require my full concentration power, and I will be happy to get them off my list so that the next day, after a good night's sleep, I can immerse myself again in focused, deep work with all concentration powers at hand.</span><br /> -<br /> -<span>Examples of "small work items" are:</span><br /> -<br /> -<ul> -<li>Tidying up the workspace.</li> -<li>Installing pending computer software updates.</li> -<li>Going through the work backlog: Create new tickets, close obsolete ones, and roughly pre-plan upcoming work.</li> -<li>Finishing off the easy tickets from the current sprint.</li> -<li>Going through any tedious paperwork.</li> -<li>Catch up with the journal and mark off all trivial action items.</li> -</ul><br /> -<h2 style='display: inline'>Enter the flow state</h2><br /> -<br /> -<span>I find it easy to enter the "flow state" after a bad night's sleep. All I need to do is to put on some ambient music (preferably instrumental chill house) and start to work on a not-too-difficult ticket.</span><br /> -<br /> -<span>Usually, the "flow state" is associated with deep-focused work, but deep-focused work isn't easily possible under sleep deprivation. It's still possible to be in the flow by working on more manageable tasks and leaving the difficult ones for the next day.</span><br /> -<br /> -<h2 style='display: inline'>Reschedule meetings</h2><br /> -<br /> -<span>I find engaging in discussions and demanding meetings challenging after a lousy night's sleep. I still attend the sessions I am invited to as "only" a participant, but I prefer to reschedule all meetings I am the primary driver of.</span><br /> -<br /> -<span>This, unfortunately, also includes interviews. Interviews require full concentration power. So for interviews, I would find a colleague to step in for me or ask to reschedule the interview altogether. Everything else wouldn't make it justice and would waste everyone's time!</span><br /> -<br /> -<h2 style='display: inline'>Invent</h2><br /> -<br /> -<span>The mind works differently under sleep deprivation: It's easier to invent new stuff as it's easier to have a look at things from different perspectives. Until an hour ago, I didn't know yet what I would be blogging about for this month, and then I just started writing this, and it took me only half an hour to write the first draft of this blog post!</span><br /> -<br /> -<h2 style='display: inline'>Fast</h2><br /> -<br /> -<span>I don't eat breakfast, and I don't eat lunch on these days. I only have dinner. Not eating means my mind doesn't get foggy, and I keep up the work momentum. This is called intermittent fasting, which not only generally helps to keep the weight under control and boosts the concentration power. Furthermore, intermittent fasting is healthy. You should include it in your routine, even after a good night's sleep.</span><br /> -<br /> -<h2 style='display: inline'>Stretch</h2><br /> -<br /> -<span>I won't have enough energy for strenuous physical exercise on those days, but a 30 to a 60-minute stretching session can make the day. Stretching will even hurt less under sleep deprivation! The stretching could also be substituted with a light Yoga session.</span><br /> -<br /> -<h2 style='display: inline'>Walk</h2><br /> -<br /> -<span>Walking is healthy, and the time can be used to listen to interesting podcasts. The available concentration power might not be enough for more sophisticated audio literature. I will have enough energy for one or two daily walks (~10k steps for the day in total). Sometimes, I listen to music during walks. I also try to catch the bright sunlight.</span><br /> -<br /> -<h2 style='display: inline'>Red Bull</h2><br /> -<br /> -<span>I don't think that Red Bull is a healthy drink. But once in a while, a can in the early afternoon brings wonders, and productivity will skyrocket. Other than Red Bull, drink a lot of water throughout the day. Don't forget to drink the sugar-free version; otherwise, your intermittent fast will be broken.</span><br /> -<br /> -<h2 style='display: inline'>Power nap</h2><br /> -<br /> -<span>I don't know how to "enforce" a nap, but sometimes I manage to power nap, and it helps wonders. A 30-minute nap sometimes brings me back to normal. If you don't tend to fast as you are too hungry, it helps to try to nap approximately 30 minutes after eating something.</span><br /> -<br /> -<h2 style='display: inline'>Don't take anything personally.</h2><br /> -<br /> -<span>It's much more challenging to keep the mind "under control" in this state. Every annoyance can potentially upset, which could reflect on the work colleagues. It is wise to attempt to go with a positive attitude into the day, always smile and be polite to the family and colleagues at work. Don't let anything drop out to the people next; they don't deserve it as they didn't do anything wrong! Also, remember, it can't be controlled at all. It's time to let go of the annoyances for the day.</span><br /> -<br /> -<h2 style='display: inline'>Meditate</h2><br /> -<br /> -<span>To keep the good vibe, it helps to meditate for 10 minutes. Meditation must nothing be fancy. It can be just lying on the sofa and observing your thoughts as they come and go. Don't judge your thoughts, as that could put you in a negative mood. It's not necessary to sit in an uncomfortable Yoga pose, and it is not required to chant "Ohhmmmmm".</span><br /> -<br /> -<h2 style='display: inline'>Write things down</h2><br /> -<br /> -<span>Sometimes something requiring more concentration power demands time. This is where it helps to write a note in a journal and return to it another day. This doesn't mean slacking off but managing the rarely available concentration power for the day. I might repeat myself: Today, sweat all the small stuff. Tomorrow, do the deep-focused work on that crucial project again.</span><br /> -<br /> -<span>It's easier to forget things on those days, so everything should be written down so that it can be worked off later. Things written down will not be overlooked!</span><br /> -<br /> -<h2 style='display: inline'>Social media</h2><br /> -<br /> -<span>I wouldn't say I like checking social media, as it can consume a lot of time and can become addictive. But once in a while, I want to catch up with my "networks". After a bad night's sleep, it's the perfect time to check your social media. Once done, you don't have to do it anymore for the next couple of days!</span><br /> -<br /> -<span>E-Mail your comments to paul at buetow.org :-)</span><br /> -<br /> -<a class='textlink' href='../'>Back to the main site</a><br /> - </div> - </content> - </entry> - <entry> - <title>Gemtexter 1.1.0 - Let's Gemtext again</title> - <link href="gemini://foo.zone/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi" /> - <id>gemini://foo.zone/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi</id> - <updated>2022-08-27T18:25:57+01:00</updated> - <author> - <name>Paul Buetow</name> - <email>paul@dev.buetow.org</email> - </author> - <summary>I proudly announce that I've released Gemtexter version `1.1.0`. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash.</summary> - <content type="xhtml"> - <div xmlns="http://www.w3.org/1999/xhtml"> - <h1 style='display: inline'>Gemtexter 1.1.0 - Let's Gemtext again</h1><br /> -<br /> -<span class='quote'>Published at 2022-08-27T18:25:57+01:00</span><br /> -<br /> -<pre> --=[ typewriter ]=- 1/98 - - .-------. - _|~~ ~~ |_ - =(_|_______|_)= - |:::::::::| - |:::::::[]| - |o=======.| - jgs `"""""""""` -</pre> -<br /> -<span>I proudly announce that I've released Gemtexter version <span class='inlinecode'>1.1.0</span>. What is Gemtexter? It's my minimalist static site generator for Gemini Gemtext, HTML and Markdown written in GNU Bash.</span><br /> -<br /> -<a class='textlink' href='https://codeberg.org/snonux/gemtexter'>https://codeberg.org/snonux/gemtexter</a><br /> -<br /> -<span>It has been around a year since I released the first version <span class='inlinecode'>1.0.0</span>. Although, there aren't any groundbreaking changes, there have been a couple of smaller commits and adjustments. I was quite surprised that I received a bunch of feedback and requests about Gemtexter so it means that I am not the only person in the universe actually using it.</span><br /> -<br /> -<h2 style='display: inline'>What's new?</h2><br /> -<br /> -<h3 style='display: inline'>Automatic check for GNU version requirements</h3><br /> -<br /> -<span>Gemtexter relies on the GNU versions of the tools <span class='inlinecode'>grep</span>, <span class='inlinecode'>sed</span> and <span class='inlinecode'>date</span> and it also requires the Bash shell in version 5 at least. That's now done in the <span class='inlinecode'>check_dependencies()</span> function:</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><b><font color="#000000">check_dependencies ()</font></b> { - <i><font color="#9A1900"># At least, Bash 5 is required</font></i> - <b><font color="#0000FF">local</font></b> -i <font color="#009900">required_version</font><font color="#990000">=</font><font color="#993399">5</font> - <font color="#009900">IFS</font><font color="#990000">=.</font> <b><font color="#0000FF">read</font></b> -ra version <font color="#990000"><<<</font> <font color="#FF0000">"$BASH_VERSION"</font> - <b><font color="#0000FF">if</font></b> <font color="#990000">[</font> <font color="#FF0000">"${version[0]}"</font> -lt <font color="#009900">$required_version</font> <font color="#990000">];</font> <b><font color="#0000FF">then</font></b> - log ERROR <font color="#FF0000">"ERROR, </font><font color="#CC33CC">\"</font><font color="#FF0000">bash</font><font color="#CC33CC">\"</font><font color="#FF0000"> must be at least at major version $required_version!"</font> - <b><font color="#0000FF">exit</font></b> <font color="#993399">2</font> - <b><font color="#0000FF">fi</font></b> - - <i><font color="#9A1900"># These must be the GNU versions of the commands</font></i> - <b><font color="#0000FF">for</font></b> tool <b><font color="#0000FF">in</font></b> <font color="#009900">$DATE</font> <font color="#009900">$SED</font> <font color="#009900">$GREP</font><font color="#990000">;</font> <b><font color="#0000FF">do</font></b> - <b><font color="#0000FF">if</font></b> <font color="#990000">!</font> <font color="#009900">$tool</font> --version <font color="#990000">|</font> grep -q GNU<font color="#990000">;</font> <b><font color="#0000FF">then</font></b> - log ERROR <font color="#FF0000">"ERROR, </font><font color="#CC33CC">\"</font><font color="#FF0000">$tool</font><font color="#CC33CC">\"</font><font color="#FF0000"> command is not the GNU version, please install!"</font> - <b><font color="#0000FF">exit</font></b> <font color="#993399">2</font> - <b><font color="#0000FF">fi</font></b> - <b><font color="#0000FF">done</font></b> -} -</pre> -<br /> -<span>Especially macOS users didn't read the <span class='inlinecode'>README</span> carefully enough to install GNU Grep, GNU Sed and GNU Date before using Gemtexter.</span><br /> -<br /> -<h3 style='display: inline'>Backticks now produce <span class='inlinecode'>inline code blocks</span> in the HTML output</h3><br /> -<br /> -<span>The Gemtext format doesn't support inline code blocks, but Gemtexter now produces <span class='inlinecode'>inline code blocks</span> (means, small code fragments can be placed in the middle of a paragraph) in the HTML output when the code block is enclosed with Backticks. There were no adjustments required for the Markdown output format, because Markdown supports it already out of the box.</span><br /> -<br /> -<h3 style='display: inline'>Cache for Atom feed generation</h3><br /> -<br /> -<span>The Bash is not the most performant language. Gemtexter already takes a couple of seconds only to generate the Atom feed for around two hand full of articles on my slightly underpowered Surface Go 2 Linux tablet. Therefore, I introduced a cache, so that subsequent Atom feed generation runs finish much quicker. The cache uses a checksum of the Gemtext <span class='inlinecode'>.gmi</span> file to decide whether anything of the content has changed or not.</span><br /> -<br /> -<h3 style='display: inline'>Input filter support</h3><br /> -<br /> -<span>Once your capsule reaches a certain size, it can become annoying to re-generate everything if you only want to preview the HTML or Markdown output of one single content file. The following will add a filter to only generate the files matching a regular expression:</span><br /> -<br /> -<!-- Generator: GNU source-highlight 3.1.9 -by Lorenzo Bettini -http://www.lorenzobettini.it -http://www.gnu.org/software/src-highlite --> -<pre><font color="#990000">.</font>/gemtexter --generate <font color="#FF0000">'.*hello.*'</font> -</pre> -<br /> -<h3 style='display: inline'>Revamped <span class='inlinecode'>git</span> support</h3><br /> -<br /> -<span>The Git support has been completely rewritten. It's now more reliable and faster too. Have a look at the <span class='inlinecode'>README</span> for more information.</span><br /> -<br /> -<h3 style='display: inline'>Addition of <span class='inlinecode'>htmlextras</span> and web font support</h3><br /> -<br /> -<span>The <span class='inlinecode'>htmlextras</span> folder now contains all extra files required for the HTML output format such as cascading style sheet (CSS) files and web fonts.</span><br /> -<br /> -<h3 style='display: inline'>Sub-section support</h3><br /> -<br /> -<span>It's now possible to define sub-sections within a Gemtexter capsule. For the HTML output, each sub-section can use its own CSS and web font definitions. E.g.:</span><br /> -<br /> -<a class= |
