If your US-ANSI keyboard supports VIA you can use it to create macros for the German Umlauts. All Keychron models should support this by now.
Caps Lock
for that.MO(3)
is bound to fn
# Type ö
Caps Lock, Shift-', o
# Type Ö
Caps Lock, Shift-', Shift-o
# Type ö
fn-o
# Type Ö
fn-Shift-o
# Type ä/Ä
{KC_CAPS}{KC_RSFT,KC_QUOT}a
# Type ö/Ö
...
jq
is great when dealing with JSON data. Check out the official jq Manual.
jq '.[] | { Name, OriginString...
Hint
You're not able to control which redis replica will chosen for the failover.
Connect to your sentinel instance:
redis-cli -p <SENTINEL-PORT>
Have a look at the configured masters, current master and the available replicas
INFO sentinel
SENTINEL master <master name>
SENTINEL get-master-addr-by-name <master name> # IP and port only
SENTINEL slaves <master name>
Force a failover
SENTINEL failover <master name>
...
It happens from time to time that a job in a GitLab pipeline fails. Sometimes, however, the error message is too meaningless to be helpful.
Example:
Running with gitlab-runner 16.7.0 (102c81ba)
on <host>, system ID: <ID>
Resolving secrets
00:00
Preparing the "shell" executor
00:00
Using Shell (bash) executor...
Preparing environment
00:01
Running on <host>...
Getting source from Git repository
00:00
bash: line 157: /bin/mkdir: Argument list too long
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: e...
pg_ctl -D $configdir start|stop|restart
Start/Stop/Restart the corresponding PostgreSQL using the given configuration directory. The configuration directory should contain the postgresql.conf
file.
The following example would start the PostgreSQL of our governor instances: pg_ctl -D /var/lib/postgresql/config start
pg_ctl -D $configdir stop -m fast
Normal shutdown can take forever because postgres will w...
Wondering what these numbers in the mount entries in /etc/fstab
are meaning?
fs_freq
When this field is set to 1 dump(8)
will make a backup of the partition. Not using dump
for backups? You can ignore the field.
fs_passno
This field determines the order of partition to fsck
. Every partition that have seen more than Maximum mount count
will undergo an fsck
unless the vaule is set to 0
.
Lets see how Maximum mount count
is set on my Ubuntu 22.04:
sudo tune2fs -l /dev/n...
There is an issue with when restoring a PostgreSQL dump created with pg_dump
< v11 with pg_restore
> v10:
pg_restore: [archiver (db)] could not execute query: ERROR: schema "public"
already exists
Command was: CREATE SCHEMA public;
If you want to restore this dump you should convert the dump to the text format first and comment out the CREATE SCHEMA public;
statement. For further information see linked content.
#...
Short hint: If you want to push to a git repository that has CI configured, you can skip the CI pipeline for commits that don't need a CI run:
$ git push -o ci.skip
This has a few cavates:
Skips only branch pipelines and not merge request pipelines.
This does not skip pipelines for CI/CD integrations, such as Jenkins.
You can use pg_repack
to do a VACUUM FULL
without holding an exclusive lock during processing.
There is still a need of one exclusive lock at the beginning and the end of the repacking process. But in the time between, you can use the affected table.
To use it you have to do the following:
pg_repack
, e.g. for Ubuntu install the package according to your PostgreSQL Server version. There is no need to restart the PostgreSQL Server.$ sudo apt-get install postgresql-16-repack
Hint
This applies only to distributions based on Debian.
Requirement
You need to setup the PostgreSQL Apt Repository first.
If you have multiple Postgres versions installed on a system and want to start/stop/restore/.. them separately you need to use pg_ctlcluster
Usage: /usr/bin/pg_ctlcluster <version> <cluster> <action>
For example
/usr/bin/pg_ctlcluster 47 main start
With systemd you can start/stop the services via:
systemctl <action> p...
Apply Test Driven Development(TDD) to the process of building container images by defining test before writing code and automate the testing process. Iterate through the TDD cycle while developing and running the tests later in continuous integration to ensure robust and reliable container images.
We create a Gemfile
for installing all required gems.
# Gemfile
gem 'docker-api'
gem 'serverspec'
gem 'rspec'
Then we install them
bundle install
Create the directory where the Tests a...
Let's have a look at the classic way of managing Nagios configuration with exported Puppet resources.
Here is a good article about the topic written by Eric Holzbach.
First we export the checks on the nodes we want to monitor:
@@nagios_service { “check_unicorns-${::hostname}”:
host_name => $::hostname,
service_description => ‘Unicorn Status’,
check_command => ‘check_unicorn-${::hostname}“,
...
If you want to automatically delete old container images from your Elastic Container Registry, the solution is a quite simple ECR Lifecycle Rule that deletes images e.g. 7 days after they have been pushed to the registry.
If you however want to always keep the image tagged production
, possibly because that is a floating tag always associated with the image currently deployed to production
, the situation suddenly is not so simple any more. ECR does not provide a keep
action in their lifecycle rules, only "expire". The logic here is t...
There is a gem puppet-ghostbuster which can help you find dead code in puppet projects.
To use it, (as of now) it's best to get the latest version from git, as the last release is not yet on rubygems.org.
# Gemfile
gem 'puppet-ghostbuster', git: 'https://github.com/voxpupuli/puppet-ghostbuster.git', ref: 'XXXXX'
After that you can use puppet-lint
to find dead code in your project:
# You probably need to set some ENV Variables, see https://github.com/voxpupuli/puppet-ghostbu...
For some reason you have to pass the password hash if you want to create a role in postgres. To calculate the hash use the following snippet:
echo -n "md5"; echo -n "${PG_PASSWORD}${PG_USERNAME}" | md5sum | awk '{print $1}'
Legt man im DNS beispielsweise einen CNAME-Eintrag an, sollte das Ziel am Ende einen Punkt haben, also z.b. d31337.cloudfront.net.
Der abschließende Punkt kennzeichnet den Fully Qualified Domain Name. Lässt man diesen weg, kann es stattdessen vorkommen, dass was wirklich passiert nicht den Erwartungen entspricht. Trägt man etwa für www.example.com
als CNAME-Ziel diesen Record ohne abschließenden Punkt ein, wird der Rest der Domain noch angehängt und damit auf einen FQDN (inklusive abschließendem Punkt!) erweitert:
$ dig CN...
It's not possible to change the bwlimit of Proxmox storages via the Web-UI (at least in Proxmox 7.x).
To change the bwlimit you need to use the pvesm
command and specify the limit for the desired category.
For example to increase the bwlimit for migrations:
pvesm set $NAME_OF_STORAGE --bwlimit migration=$INTEGER_LIMIT
# example
pvesm set ssd --bwlimit migration=500000
These are the different categories:
If one etcd node is no longer a member of the remaining etcd cluster or fails to connect you need to remove it from the cluster and then add it again:
sudo service etcd stop
sudo rm -r /var/lib/etcd/data/*
sudo rm -r /var/lib/etcd/wal/*
When restoring a barman PITR backup you may encounter this error:
Copying required WAL segments.
EXCEPTION: {'ret': 2, 'err': '/bin/sh: 1: cannot open /var/lib/barman/foopostgres/wals/00000007.history: No such file\n', 'out': ''}
The reason is that the barman backups xlog.db
file contains a history file which is no longer present in the wals
directory of your backup. The most likely reason is that someone deleted this file in the past. If you do not need this file for restoring your current backup (maybe because it's very old a...
Terraform (and terragrunt) gives a lot of output when running plan
or apply
, outputting a lot of progress information when refreshing the state before creating the plan. They have reasons for this but it doesn't look like there is going to be any silent
flags any time soon. Especially when running larger environments or running multiple modules with terragrunt, this will clog the output on your terminal or in your CI jobs, possibly making the signal hard to find among the noise.
H...
Don't use exec
without user
parameter
If you use exec
without user
parameter, the command will get executed as root. You mostly don't want this.
There is a difference in the env variables of the exec if you run puppet manually or if the daemon runs.
Never ever use exec
without cwd
parameter
If you use exec
without cwd
parameter, the command get executed in the cwd of your puppet run. This can cause problems if you run the puppet agent manually.
Example:
# exec resource:
e...
Before you continue, ensure that you've created your certificate in the region us-east-1
(N. Virginia). Otherwise the certificate is not available for CloudFront.
At some point in time you may be confronted with the following issue:
When you synchronize directories with rsync
you have to pay attention to use (or not use) trailing /
.
Example:
# without trailing slash
$ mkdir -p a/foo/bar/baz
$ mkdir b
$ rsync -a a b
$ find b
b
b/a
b/a/foo
b/a/foo/bar
b/a/foo/bar/baz
# with trailing slash
$ mkdir -p a/foo/bar/baz
$ mkdir b
$ rsync -a a/ b/
$ find b
b
b/foo
b/foo/bar
b/foo/bar/baz
Attention
This is an edge-case. You probably don't want to mix different database dumps. It also requires that the mixed tables do not share relations to other database objects.
dump_a.pgdump
dump_b.pgdump
foobar
barfoo
foobaz
dump_a.foobar
dump_b.barfoo
dump_a.foobaz
These commands might be obvious but won't actually work:
pg_re...