Archives

Using confd and consul for config management

This tutorial demonstrates how to use confd and consul to manage application configurations. consul acts as a key/value store for your configuration data, while confd uses templates to generate configuration files based on the values in consul. This approach helps to decouple configuration from your application code.

Consul is used in clouds as a key/value store to hold configs, just like etcd, Zookeeper, AWS SSM, etc. Additionally, consul can provide a DNS server for service discovery.

[more]

About

In Linux basically everything can be turned into a mount helper.

(TBD) UPDATE: This article hardly needs a rewrite. I still keep it online until then.

Scripts

Save this as mount.autofs:

#!/bin/bash

##
# AutoFS user-folder indirect Automounter for S3 using either FUSE goofyfs or s3fs
#
# Requirements
# - AWS CLI installed
# - JQ installed
# - Either FUSE goofyfs or s3fs installed
#
# Usage
#  - place config to $S3FS_CONFIG directory using s3fs config format (ACCESS_KEY:ACCESS_SECRET)
#  - place this file to /etc/auto.s3 and make it executable
#  - add to /etc/auto.master: /home/<user>/Remote/S3 /etc/auto.s3 --timeout=3000
#  - choose backend by config section in this file (NOTE: goofyfs needs )
#  - cd <mountpoint>/<aws-profile>/<bucket>
#
# Debugging
# - Stop system service by:
#   systemctl stop autofs
# - Execute as process (use --debug to see mount commands)
#   automount -f -v
#
# Clean up mountpoints (when autofs hangs or mountpoints are still used)
# …
[more]

Dealing with PHP timezones

Sadly, our developers still use procedural functions. Here is a SPL implementation.

$dtFromDb = '2020-11-03 18:00:00'; // No TZ info provided here!
$dateTimeZoneServer = new DateTimeZone(date_default_timezone_get());
$dateTimeZoneAccount = new DateTimeZone('Indian/Christmas');

$dateTimeZoneUser = 'UTC';
$dateTimeZoneServer = new DateTimeZone($dateTimeZoneUser);

$dt = new DateTime($dtFromDb, $dateTimeZoneServer);
// or $dt->setTime($hour, $minute);
$dt->setTimezone($dateTimeZoneAccount);

echo $dt->format('Y-m-d H:i:s'); // now H:i in account's tz

$dt->setTimezone($dateTimeZoneUser);
echo $dt->format('Y-m-d H:i:s'); // now H:i in user's tz
[more]

Fight Flash Fraud

It was late, I was tired and since Amazon sold an AmazonBasic 512GB microSDXC for 40EUR. Too much! Altgough it was Black Friday we cpuld get that cheaper from a Fraud eBay Seller, namely a Samsung ExtremoPro 512GB microSD for 10EUR (that usually should be around 90-100EUR!).

Buyer Protection. That means I would get my money back from eBay, or would I? Let’s try!

Arrival

It did arrive in a very trustworthy fashion with pixelated smartphone in the background:

[more]

Docker?

Docker?
$ lsblk  -o NAME,FSTYPE,SIZE,TYPE,RO,RM,LABEL,MOUNTPOINT'
nvme0n1                     1.8T disk   0  0         
├─nvme0n1p1   vfat         1023M part   0  0 EFI     /boot/efi                                                                    
└─nvme0n1p2   crypto_LUKS 952.9G part   0  0                                                                                                                 
  └─cryptdata btrfs       952.9G crypt  0  0         /var/lib/docker/plugins/76a8e5822617ba4923187fe7a2c0dde066eaa1d0de469f9545f74402a0b9861c/propagated-mount

/var/lib/docker/plugins/76a8e5822617ba4923187fe7a2c0dde066eaa1d0de469f9545f7

$ truncate -s "1G" "foo.btrfs.img"   
$ truncate -s "200M" "foo.btrfs.img"   
$ mkfs.btrfs -f foo.btrfs.img                                                                                                                                                         ✓ nmc-prod 11:23
Label:              (null)
UUID: …
[more]

image-20260128125411007 aa

cc dd ee ff

UPDATE: Found this Parametric Wheel Generator on MakerWorld

[more]

img image-20260128124413911
[more]

img

Source: https://xkcd.com/1987/

SDK versionb manager only

  • vfox (Golang) A cross-platform and extendable version manager with support for Java, Node.js, Golang, Python, Flutter, .NET & more

https://terminaltrove.com/list/

https://terminaltrove.com/terminals/

  • Aqua is arguably the most powerful tool in this category right now. Like dotbins and eget, it downloads binaries from GitHub, but it functions more like a declarative package manager.
  • eget (Golang) Easily install prebuilt binaries from GitHub like eget jgm/pandoc --to /usr/local/bin --tag nightly. Meanwhile also has a config ~/.eget.toml keeping the tools. Also the standard on https://terminaltrove.com/

[more]

[more]

Fighting E-Mail Spam (with AI)

Fighting E-Mail Spam (with AI)

Some decades ago – yes, I’m old – I started using All-inkl.com for my E-Mail. They are still 100% reliable with a great uptime and I could say I never had an E-Mail outage or someone received “Quota exceeded” or “Mailbox is full” or “cannot be found”.

Downside: they are state of the art. They still using Procmail and SpamAssassin and my E-Mail Inbox is flooded more and more with Spam.

[more]