summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gemfeed/atom.xml6161
1 files changed, 0 insertions, 6161 deletions
diff --git a/gemfeed/atom.xml b/gemfeed/atom.xml
index 77cfa8e9..257cc564 100644
--- a/gemfeed/atom.xml
+++ b/gemfeed/atom.xml
@@ -1,6162 +1 @@
-<?xml version="1.0" encoding="utf-8"?>
-<feed xmlns="http://www.w3.org/2005/Atom">
- <updated>2022-12-08T11:10:37+02:00</updated>
- <title>foo.zone feed</title>
- <subtitle>To be in the .zone!</subtitle>
- <link href="https://foo.zone/gemfeed/atom.xml" rel="self" />
- <link href="https://foo.zone/" />
- <id>https://foo.zone/</id>
- <entry>
- <title>I tried Doom Emacs, but I switched back to (Neo)Vim</title>
- <link href="https://foo.zone/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.html" />
- <id>https://foo.zone/gemfeed/2022-11-24-i-tried-emacs-but-i-switched-back-to-neovim.html</id>
- <updated>2022-11-24T11:17:15+02:00</updated>
- <author>
- <name>Paul C. Buetow</name>
- <email>comments@mx.buetow.org</email>
- </author>
- <summary>As a long-lasting user of Vim (and NeoVim), I always wondered what GNU Emacs is really about, so I decided to try it. I didn't try vanilla GNU Emacs, but Doom Emacs. I chose Doom Emacs as it is a neat distribution of Emacs with Evil mode enabled by default. Evil mode allows Vi(m) key bindings (so to speak, it's emulating Vim within Emacs), and I am pretty sure I won't be ready to give up all the muscle memory I have built over more than a decade.. .....to read on please visit my site.</summary>
- <content type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml">
- <h1>I tried (Doom) Emacs, but I switched back to (Neo)Vim</h1>
-<p class="quote"><i>Published by Paul at 2022-11-24 11:17:15 EET, last updated at 2022-11-26</i></p>
-<pre>
- _/ \ _(\(o
- / \ / _ ^^^o
- / ! \/ ! '!!!v'
- ! ! \ _' ( \____
- ! . \ _!\ \===^\)
-Art by \ \_! / __!
- Gunnar Z. \! / \ &lt;--- Emacs is a giant dragon
- (\_ _/ _\ )
- \ ^^--^^ __-^ /(__
- ^^----^^ "^--v'
-</pre><br />
-<p>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.</p>
-<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 />
-<p>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).</p>
-<a class="textlink" href="https://www.vim.org">Vim</a><br />
-<a class="textlink" href="https://neovim.io">NeoVim</a><br />
-<p>So why did I switch back to the Vi-family?</p>
-<h2>Emacs is a giant dragon</h2>
-<p>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)!</p>
-<p>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. </p>
-<h2>Magit love</h2>
-<p>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.</p>
-<a class="textlink" href="https://magit.vc/">Magit</a><br />
-<a class="textlink" href="https://github.com/jonas/tig">Tig</a><br />
-<p>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.</p>
-<h2>Graphical UI</h2>
-<p>If there is one thing I envy about Emacs is that it's a graphical program, whereas the Vi-family of editors are purely terminal-based. I see the benefits of being a graphical program as this enables the use of multiple fonts simultaneously to embed pictures and graphs (that would be neat as a Markdown preview, for example). There's also GVim (Vim with GTK UI), but that's more of an afterthought.</p>
-<p>There are now graphical front-end clients for NeoVim, but I still need to dig into them. Let me know your experience if you have one. Luckily, I don't rely on something graphical in my text editor, but it would improve how the editor looks and feels. UTF8 can already do a lot in the terminal, and terminal emulators also allow you to use TrueType fonts. Still, you will always be limited to one TTF font for the whole terminal, and it isn't possible to have, for example, a different font for headings, paragraphs, etc... you get the idea. TTF+UTF8 can't beat authentic graphics. </p>
-<h2>Scripting it</h2>
-<p>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).</p>
-<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 />
-<p>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?).</p>
-<a class="textlink" href="https://neovim.io/doc/user/lua.html">NeoVim Lua API</a><br />
-<p>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.</p>
-<p>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:</p>
-<pre>
-" Clipboard
-vnoremap ,y !pbcopy&lt;CR&gt;ugv
-vnoremap ,i !pbpaste&lt;CR&gt;
-nmap ,i !wpbpaste&lt;CR&gt;
-</pre><br />
-<p>That's only a very few lines and does precisely what I want. It's quick and dirty but get's the job done! If VimScript becomes too cumbersome, I can use Lua for NeoVim scripting.</p>
-<h2>The famous Emacs Org mode</h2>
-<p>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:</p>
-<a class="textlink" href="https://orgmode.org/">https://orgmode.org/</a><br />
-<p>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.</p>
-<p>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).</p>
-<a class="textlink" href="https://pwmt.org/projects/zathura/">Zathura</a><br />
-<p>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. </p>
-<a class="textlink" href="https://github.com/ranger/ranger">Ranger - A Vim inspired file manager</a><br />
-<p>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?</p>
-<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 />
-<h2>Seeking simplicity</h2>
-<p>I am not ready to dive deep into the whole world of Emacs. I prefer small and simple tools as opposed to complex tools. Emacs comes with many features out of the box, whereas in Vim/NeoVim, you would need to install many plugins to replicate some of the behaviour. Yes, I need to invest time managing all the Vim/NeoVim plugins I use, but I feel more in control compared to Doom Emacs, where a framework around vanilla Emacs manages all the plugins. I could use vanilla Emacs and manage all my plugins the vanilla way, but for me, it's not worth the effort to learn and dive into that as all that I want to do I can already do with Vim/NeoVim.</p>
-<p>I am not saying that Vim/NeoVim are simple programs, but they are much simpler than Emacs with much smaller footprints; furthermore, they appear to be more straightforward as I am used to them. I only need Vim/NeoVim to be an editor, an IDE (through some plugins), and nothing more.</p>
-<h2>Conclusion</h2>
-<p>I understand the Emacs users now. Emacs is an incredibly powerful platform for almost everything, not just text editing. With Emacs, you can do nearly everything (Writing, editing, programming, calendar scheduling and note taking, Jira integration, playing games, listening to music, reading/writing emails, browsing the web, using as a calculator, generating HTML pages, configuring interactive menus, jumping around between every feature and every file within one single session, chat on IRC, surf the Gopherspace, ... the options are endless....). If you want to have one piece of software which rules it all and you are happy to invest a large part of your time in your platform: Pick Emacs, and over time Emacs will become "your" Emacs, customized to your own needs and change the way it works, which makes the Emacs users stick even more to it.</p>
-<p>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).</p>
-<p class="quote"><i>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!</i></p>
-<a class="textlink" href="https://github.com/NvChad/NvChad">https://github.com/NvChad/NvChad</a><br />
-<p>E-Mail your comments to paul at buetow dot org! :-)</p>
-<h1>Appendix</h1>
-<p>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>:</p>
-<pre>
-function! ReadJournalPageNumber()
- let page = expand("&lt;cword&gt;")
- if page !~# '^\d\+$'
- for str in split(getline("."), "[ ,]")
- if str =~# '^\d\+$'
- let page = str
- break
- end
- endfor
- endif
- return page
-endfunction
-
-function! ReadJournalMeta()
- normal! mj
-
- 1/MetaFilePath:/
- normal! 3w
- let s:metaFilePath = expand("&lt;cWORD&gt;")
- echom s:metaFilePath
-
- 1/MetaOffset:/
- normal! 3w
- let s:metaOffset = expand("&lt;cword&gt;")
- echom s:metaOffset
-
- 1/MetaPageAtOffset:/
- normal! 3w
- let s:metaPageAtOffset = expand("&lt;cword&gt;")
- echom s:metaPageAtOffset
-
- 1/MetaPagesPerScan:/
- normal! 3w
- let s:metaPagesPerScan = expand("&lt;cword&gt;")
- echom s:metaPagesPerScan
-
- normal! `j
-endfunction
-
-function! GetPdfPage(page)
- return s:metaOffset + (a:page - s:metaPageAtOffset) / s:metaPagesPerScan
-endfunction
-
-function! OpenJournalPage()
- let page = ReadJournalPageNumber()
- if page !~# '^\d\+$'
- echoerr "Could not identify Journal page number"
- end
- call ReadJournalMeta()
- let pdfPage = GetPdfPage(page)
- echon "Location is " . s:metaFilePath . ":" . pdfPage
- call system("zathura --mode fullscreen -P " . pdfPage . " " . s:metaFilePath)
- " call system("evince -p " . pdfPage . " " . s:metaFilePath)
-endfunction
-
-nmap ,j :call OpenJournalPage()&lt;CR&gt;
-</pre><br />
- </div>
- </content>
- </entry>
- <entry>
- <title>Installing DTail on OpenBSD</title>
- <link href="https://foo.zone/gemfeed/2022-10-30-installing-dtail-on-openbsd.html" />
- <id>https://foo.zone/gemfeed/2022-10-30-installing-dtail-on-openbsd.html</id>
- <updated>2022-10-30T11:03:19+02:00</updated>
- <author>
- <name>Paul C. Buetow</name>
- <email>comments@mx.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 :-). .....to read on please visit my site.</summary>
- <content type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml">
- <h1>Installing DTail on OpenBSD</h1>
-<p class="quote"><i>Published by Paul at 2022-10-30 11:03:19 EET</i></p>
-<pre>
- ,_---~~~~~----._
- _,,_,*^____ _____``*g*\"*,
-/ __/ /' ^. / \ ^@q f
- @f | | | | 0 _/
-\`/ \~__((@/ __ \__((@/ \
- | _l__l_ I &lt;--- The Go Gopher
- } [______] I
- ] | | | |
- ] ~ ~ |
- | |
- | |
- | | A ;
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~|~~~,--,-/ \---,-/|~~,~~~~~~~~~~~~~~~~~~~~~~~~~~~
- _|\,'. /| /| `/|-.
- \`.' /| , `;.
- ,'\ A A A A _ /| `.;
- ,/ _ A _ / _ /| ;
- /\ / \ , , A / / `/|
- /_| | _ \ , , ,/ \
- // | |/ `.\ ,- , , ,/ ,/ \/
- / @| |@ / /' \ \ , &gt; /| ,--.
- |\_/ \_/ / | | , ,/ \ ./' __:..
- | __ __ | | | .--. , &gt; &gt; |-' / `
- ,/| / ' \ | | | \ , | /
- / |&lt;--.__,-&gt;| | | . `. &gt; &gt; / (
- /_,' \\ ^ / \ / / `. &gt;-- /^\ |
- \\___/ \ / / \__' \ \ \/ \ |
- `. |/ , , /`\ \ )
- \ ' |/ , V \ / `-\
- OpenBSD Puffy ---&gt; `|/ ' V V \ \.' \_
- '`-. V V \./'\
- `|/-. \ / \ /,---`\ kat
- / `._____V_____V'
- ' '
-</pre><br />
-<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>
-<pre>
-$ doas pkg_add git go gmake
-</pre><br />
-<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>
-<pre>
-$ mkdir git
-$ cd git
-$ git clone https://github.com/mimecast/dtail
-$ cd dtail
-$ gmake
-</pre><br />
-<p>You can verify the version by running the following command:</p>
-<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 />
-<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>
-<pre>
-$ doas pkg_delete git go gmake
-</pre><br />
-<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>
-<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 />
-<p>Also, we will be creating the <span class="inlinecode">_dserver</span> service user:</p>
-<pre>
-$ doas adduser -class nologin -group _dserver -batch _dserver
-$ doas usermod -d /var/run/dserver/ _dserver
-</pre><br />
-<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>
-<pre>
-$ cat &lt;&lt;'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 &amp;
-END
-$ doas chmod 755 /etc/rc.d/dserver
-</pre><br />
-<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>
-<pre>
-desc 'Setup DTail';
-task 'dtail', group =&gt; 'frontends',
- sub {
- my $restart = FALSE;
-
- file '/etc/rc.d/dserver':
- content =&gt; template('./etc/rc.d/dserver.tpl'),
- owner =&gt; 'root',
- group =&gt; 'wheel',
- mode =&gt; '755',
- on_change =&gt; sub { $restart = TRUE };
-
- .
- .
- .
- .
-
- service 'dserver' =&gt; 'restart' if $restart;
- service 'dserver', ensure =&gt; 'started';
- };
-</pre><br />
-<h2>Configure it</h2>
-<p>Now, DTail is fully installed but still needs to be configured. Grab the default config file from GitHub ...</p>
-<pre>
-$ doas mkdir /etc/dserver
-$ curl https://raw.githubusercontent.com/mimecast/dtail/master/samples/dtail.json.sample |
- doas tee /etc/dserver/dtail.json
-</pre><br />
-<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>
-<pre>
- "Common": {
- "LogDir": "/var/log/dserver",
- "Logger": "Fout",
- "LogRotation": "Daily",
- "CacheDir": "cache",
- "SSHPort": 2222,
- "LogLevel": "Info"
- }
-</pre><br />
-<h3>Rexification</h3>
-<p>That's as simple as adding the following to the Rex task:</p>
-<pre>
-file '/etc/dserver',
- ensure =&gt; 'directory';
-
-file '/etc/dserver/dtail.json',
- content =&gt; template('./etc/dserver/dtail.json.tpl'),
- owner =&gt; 'root',
- group =&gt; 'wheel',
- mode =&gt; '755',
- on_change =&gt; sub { $restart = TRUE };
-</pre><br />
-<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>
-<pre>
-$ cat &lt;&lt;'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 -&gt; $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 />
-<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>
-<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>Rexification</h3>
-<p>That's done by adding ...</p>
-<pre>
-file '/usr/local/bin/dserver-update-key-cache.sh',
- content =&gt; template('./scripts/dserver-update-key-cache.sh.tpl'),
- owner =&gt; 'root',
- group =&gt; 'wheel',
- mode =&gt; '500';
-
-append_if_no_such_line '/etc/daily.local', '/usr/local/bin/dserver-update-key-cache.sh';
-</pre><br />
-<p>... to the Rex task!</p>
-<h2>Start it</h2>
-<p>Now, it's time to enable and start the DTail server:</p>
-<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 />
-<p>As we don't want to wait until tomorrow, let's populate the key cache manually:</p>
-<pre>
-$ doas /usr/local/bin/dserver-update-key-cache.sh
-Updating SSH key cache
-Caching /home/_dserver/.ssh/authorized_keys -&gt; /var/cache/dserver/_dserver.authorized_keys
-Caching /home/admin/.ssh/authorized_keys -&gt; /var/cache/dserver/admin.authorized_keys
-Caching /home/failunderd/.ssh/authorized_keys -&gt; /var/cache/dserver/failunderd.authorized_keys
-Caching /home/git/.ssh/authorized_keys -&gt; /var/cache/dserver/git.authorized_keys
-Caching /home/paul/.ssh/authorized_keys -&gt; /var/cache/dserver/paul.authorized_keys
-Caching /home/rex/.ssh/authorized_keys -&gt; /var/cache/dserver/rex.authorized_keys
-All set...
-</pre><br />
-<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>
-<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 />
-<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>
-<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>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>E-Mail your comments to paul at buetow dot org! :-)</p>
- </div>
- </content>
- </entry>
- <entry>
- <title>After a bad night's sleep</title>
- <link href="https://foo.zone/gemfeed/2022-09-30-after-a-bad-nights-sleep.html" />
- <id>https://foo.zone/gemfeed/2022-09-30-after-a-bad-nights-sleep.html</id>
- <updated>2022-09-30T09:53:23+03:00</updated>
- <author>
- <name>Paul C. Buetow</name>
- <email>comments@mx.buetow.org</email>
- </author>
- <summary>Everyone has it once a while: A bad night's sleep. Here I attempt to list useful tips how to deal with it.. .....to read on please visit my site.</summary>
- <content type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml">
- <h1>After a bad night's sleep</h1>
-<p class="quote"><i>Published by Paul at 2022-09-30 09:53:23 EEST, last updated at 2022-10-12</i></p>
-<pre>
- z
- z
- Z
- .--. Z Z
- / _(c\ .-. __
- | / / '-; \'-'` `\______
- \_\/'/ __/ ) / ) | \--,
- | \`""`__-/ .'--/ /--------\ \
- \\` ///-\/ / /---;-. '-'
-jgs (________\ \
- '-'
-</pre><br />
-<p>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.</p>
-<h2>Don't take the day off.</h2>
-<p>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!</p>
-<h2>Start work early</h2>
-<p>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.</p>
-<h2>Sweat the small stuff</h2>
-<p>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.</p>
-<p>Examples of "small work items" are:</p>
-<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>
-<h2>Enter the flow state</h2>
-<p>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.</p>
-<p>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.</p>
-<h2>Reschedule meetings</h2>
-<p>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.</p>
-<p>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!</p>
-<h2>Invent</h2>
-<p>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!</p>
-<h2>Fast</h2>
-<p>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.</p>
-<h2>Stretch</h2>
-<p>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.</p>
-<h2>Walk</h2>
-<p>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.</p>
-<h2>Red Bull</h2>
-<p>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.</p>
-<h2>Power nap</h2>
-<p>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.</p>
-<h2>Don't take anything personally.</h2>
-<p>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.</p>
-<h2>Meditate</h2>
-<p>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".</p>
-<h2>Write things down</h2>
-<p>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.</p>
-<p>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!</p>
-<h2>Social media</h2>
-<p>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!</p>
-<p>E-Mail your comments to paul at buetow dot org! :-)</p>
- </div>
- </content>
- </entry>
- <entry>
- <title>Gemtexter 1.1.0 - Let's Gemtext again</title>
- <link href="https://foo.zone/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html" />
- <id>https://foo.zone/gemfeed/2022-08-27-gemtexter-1.1.0-lets-gemtext-again.html</id>
- <updated>2022-08-27T18:25:57+01:00</updated>
- <author>
- <name>Paul C. Buetow</name>
- <email>comments@mx.buetow.org</email>
- </author>
- <summary>I am proud to announce that I've released Gemtexter version `1.1.0`. What is Gemtexter? It's my static site generator written in GNU Bash:. .....to read on please visit my site.</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 by Paul at 2022-08-27 20:25:57 EEST</i></p>
-<pre>
--=[ typewriter ]=- 1/98
-
- .-------.
- _|~~ ~~ |_
- =(_|_______|_)=
- |:::::::::|
- |:::::::[]|
- |o=======.|
- jgs `"""""""""`
-</pre><br />
-<p>I am proud to announce that I've released Gemtexter version <span class="inlinecode">1.1.0</span>. What is Gemtexter? It's my static site generator written in GNU Bash:</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 />
-<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>
-<pre>
-ch