From c199ee45cf7bf4388305cb5c6e92f130b5737d05 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 1 Apr 2023 15:55:00 +0300 Subject: Update content for gemtext --- gemfeed/atom.xml | 312 +++++++++++++++++++++++++++---------------------------- 1 file changed, 156 insertions(+), 156 deletions(-) (limited to 'gemfeed') diff --git a/gemfeed/atom.xml b/gemfeed/atom.xml index 4babf082..6d7c384d 100644 --- a/gemfeed/atom.xml +++ b/gemfeed/atom.xml @@ -1,6 +1,6 @@ - 2023-03-27T23:05:17+03:00 + 2023-04-01T15:50:57+03:00 foo.zone feed To be in the .zone! @@ -31,7 +31,7 @@ |o=======.| |:::::::[]| jgs `"""""""""` |o=======.| mod. by Paul Buetow `"""""""""` -
+

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.

https://codeberg.org/snonux/gemtexter

This is a new major release, so it contains a breaking change (see "Meta cache made obsolete").

@@ -52,7 +52,7 @@ Welcome to this capsule! echo Multiline template line $i done >>> -
+

... results into the following index.gmi after running ./gemtexter --generate (or ./gemtexter --template, which instructs to do only template processing and nothing else):

 # Hello world
@@ -71,7 +71,7 @@ Multiline template line 7
 Multiline template line 8
 Multiline template line 9
 Multiline template line 10
-

+

Another thing you can do is insert an index with links to similar blog posts. E.g.:

 See more entries about DTail and Golang:
@@ -79,7 +79,7 @@ See more entries about DTail and Golang:
 << template::inline::index dtail golang
 
 Blablabla...
-

+

... scans all other post entries with dtail and golang in the file name and generates a link list like this:

 See more entries about DTail and Golang:
@@ -90,14 +90,14 @@ See more entries about DTail and Golang:
 => ./2021-04-22-dtail-the-distributed-log-tail-program.gmi 2021-04-22 DTail - The distributed log tail program (You are currently reading this)
 
 Blablabla...
-

+

Added hooks

You can configure PRE_GENERATE_HOOK and POST_PUBLISH_HOOK to point to scripts to be executed before running --generate, or after running --publish. 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 --publish.

The sample config file gemtexter.conf includes this as an example now; these scripts will only be executed when they actually exist:

 declare -xr PRE_GENERATE_HOOK=./pre_generate_hook.sh
 declare -xr POST_PUBLISH_HOOK=./post_publish_hook.sh
-

+

Use of safer Bash options

Gemtexter now does set -euf -o pipefile, which helps to eliminate bugs and to catch scripting errors sooner. Previous versions only set -e.

Meta cache made obsolete

@@ -108,7 +108,7 @@ declare -xr POST_PUBLISH_HOOK=./post_publish_hook.sh # Title here The remaining content of the Gemtext file... -
+

Gemtexter will add a line starting with > Published at ... now. Any subsequent Atom feed generation will then use that date.

 % cat gemfeed/2023-02-26-title-here.gmi
@@ -117,7 +117,7 @@ The remaining content of the Gemtext file...
 > Published at 2023-02-26T21:43:51+01:00
 
 The remaining content of the Gemtext file...
-

+

XMLLint support

Optionally, when the xmllint 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.

More

@@ -654,7 +654,7 @@ nmap ,j :call OpenJournalPage()<CR> `|/-. \ / \ /,---`\ kat / `._____V_____V' ' ' -
+

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 :-)

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!

https://dtail.dev
@@ -665,7 +665,7 @@ nmap ,j :call OpenJournalPage()<CR>

First of all, DTail needs to be downloaded and compiled. For that, git, go, and gmake are required:

 $ doas pkg_add git go gmake
-

+

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:

 $ mkdir git
@@ -673,18 +673,18 @@ $ cd git
 $ git clone https://github.com/mimecast/dtail
 $ cd dtail
 $ gmake 
-

+

You can verify the version by running the following command:

 $ ./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
-

+

Now, there isn't any need anymore to keep git, go and gmake, so they can be deinstalled now:

 $ doas pkg_delete git go gmake
-

+

One day I shall create an official OpenBSD port for DTail.

Install it

Installing the binaries is now just a matter of copying them to /usr/local/bin as follows:

@@ -693,12 +693,12 @@ $ 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 -
+

Also, we will be creating the _dserver service user:

 $ doas adduser -class nologin -group _dserver -batch _dserver
 $ doas usermod -d /var/run/dserver/ _dserver
-

+

The OpenBSD init script is created from scratch (not part of the official DTail project). Run the following to install the bespoke script:

 $ cat <<'END' | doas tee /etc/rc.d/dserver
@@ -720,7 +720,7 @@ rc_pre() {
 rc_cmd $1 &
 END
 $ doas chmod 755 /etc/rc.d/dserver
-

+

Rexification

This is the task for setting it up via Rex. Note the . . . ., that's a placeholder which we will fill up more and more during this blog post:

@@ -744,14 +744,14 @@ task 'dtail', group => 'frontends',
       service 'dserver' => 'restart' if $restart;
       service 'dserver', ensure => 'started';
    };
-

+

Configure it

Now, DTail is fully installed but still needs to be configured. Grab the default config file from GitHub ...

 $ doas mkdir /etc/dserver
 $ curl https://raw.githubusercontent.com/mimecast/dtail/master/samples/dtail.json.sample |
     doas tee /etc/dserver/dtail.json
-

+

... and then edit it and adjust LogDir in the Common section to /var/log/dserver. The result will look like this:

   "Common": {
@@ -762,7 +762,7 @@ $ curl https://raw.githubusercontent.com/mimecast/dtail/master/samples/dtail.jso
     "SSHPort": 2222,
     "LogLevel": "Info"
   }
-

+

Rexification

That's as simple as adding the following to the Rex task:

@@ -775,7 +775,7 @@ file '/etc/dserver/dtail.json',
   group => 'wheel',
   mode => '755',
   on_change => sub { $restart = TRUE };
-

+

Update the key cache for it

DTail relies on SSH for secure authentication and communication. However, the system user _dserver 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 /var/run/dserver/cache.

The following script, populating the DTail server key cache, can be run periodically via CRON:

@@ -817,12 +817,12 @@ done echo 'All set...' END $ doas chmod 500 /usr/local/bin/dserver-update-key-cache.sh -
+

Note that the script above is a slight variation of the official DTail script. The official DTail one is a bash script, but on OpenBSD, there's ksh. I run it once daily by adding it to the daily.local:

 $ echo /usr/local/bin/dserver-update-key-cache.sh | doas tee -a /etc/daily.local
 /usr/local/bin/dserver-update-key-cache.sh
-

+

Rexification

That's done by adding ...

@@ -833,7 +833,7 @@ file '/usr/local/bin/dserver-update-key-cache.sh',
   mode => '500';
 
 append_if_no_such_line '/etc/daily.local', '/usr/local/bin/dserver-update-key-cache.sh';
-

+

... to the Rex task!

Start it

Now, it's time to enable and start the DTail server:

@@ -857,7 +857,7 @@ INFO|1022-090739|86050|stats.go:53|2|11|7|||MAPREDUCE:STATS|currentConnections=0 . . Ctr+C -
+

As we don't want to wait until tomorrow, let's populate the key cache manually:

 $ doas /usr/local/bin/dserver-update-key-cache.sh
@@ -869,7 +869,7 @@ Caching /home/git/.ssh/authorized_keys -> /var/cache/dserver/git.authorized_k
 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...
-

+

Use it

The DTail server is now ready to serve connections. You can use any DTail commands, such as dtail, dgrep, dmap, dcat, dtailhealth, to do so. Checkout out all the usage examples on the official DTail page.

I have installed DTail server this way on my personal OpenBSD frontends blowfish, and fishfinger, and the following command connects as user rex to both machines and greps the file /etc/fstab for the string local:

@@ -883,13 +883,13 @@ CLIENT|earth|INFO|STATS:STATS|cgocalls=11|cpu=8|connected=2|servers=2|connected% 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 -
+

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:

 ❯ ./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
-

+

Conclusions

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!

Check out the following for more information:

@@ -1004,7 +1004,7 @@ jgs (________\ \ |:::::::[]| |o=======.| jgs `"""""""""` -
+

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.

https://codeberg.org/snonux/gemtexter

It has been around a year since I released the first version 1.0.0. 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.

@@ -1029,7 +1029,7 @@ check_dependencies () { fi done } -
+

Especially macOS users didn't read the README carefully enough to install GNU Grep, GNU Sed and GNU Date before using Gemtexter.

Backticks now produce inline code blocks in the HTML output

The Gemtext format doesn't support inline code blocks, but Gemtexter now produces inline code blocks (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.

@@ -1039,7 +1039,7 @@ check_dependencies () {

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:

 ./gemtexter --generate '.*hello.*'
-

+

Revamped git support

The Git support has been completely rewritten. It's now more reliable and faster too. Have a look at the README for more information.

Addition of htmlextras and web font support

@@ -2159,7 +2159,7 @@ learn () { ] ~ ~ | | | | | -
+

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):

https://dtail.dev

So, what's new in 4.0.0?

@@ -2182,7 +2182,7 @@ const ( Trace level = iota All level = iota ) -
+

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).

Configurable terminal color codes

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, ...).

@@ -2280,7 +2280,7 @@ const ( }, ... } -
+

You notice the different sections - these are different contexts: