Related cards:
Use systemd-run as an alternative for screen
You might use screen
or tmux
to run a temporary command on a server which continues to run after the SSH session is closed.
Consider systemd-run
as alternative. It will turn every command in a systemd ser...
HowTo: Clone and refresh all repos in a GitLab Group
If the project you're working on has, say, 39 repositories and counting in GitLab and you need all the repos checked out for some reason, here's how to do it.
Checking out all repos
- Create a personal access token for GitLab that has the `A...
HowTo: switch to mise from asdf
Add apt source:
apt update -y && apt install -y gpg sudo wget curl
sudo install -dm 755 /etc/apt/keyrings
wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/mise-archive-keyring.gpg 1> /dev/null
ech...
HowTo: Clone a MariaDB database with mariabackup, mbstream and netcat
If you have a very large datadir in MariaDB and you want to transfer the data to another host (e.g. for replication) you may want to avoid storing it locally and copying it between the hosts.
You can stream the backup directly via netcat
.
##...
When to use a function over a defined in Puppet
In Puppet, there are some differences between defined
and function
types when it comes to code encapsulation. In most cases, a defined type is best, but there are some situations where a function is more appropriate.
Use a defined type when:...
HowTo: Create scram-sha-256 password hash for use with postgres
If you need to pre-generate a scram-sha256
password hash for use with postgres, e.g. for using it with config management like puppet, pre-generating the password hash can be done in a small oneliner on any machine that has postgres installed:
`...
HowTo apply Test Driven Development to Container Images
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 integrat...
Use pg_repack to do a VACUUM FULL without holding an exclusive lock during processing
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 affecte...
HowTo: Curl applications that are usually behind reverse proxies with TLS termination without the application redirecting to https schema
A lot of web applications require being called over https
, which is a good thing. It's possible to configure this requirement at the web- or proxy server level, where nginx
or apache
will just redirect every request on http
to https
. Som...
Use chronic instead of redirecting cronjob output to /dev/null
When setting up cronjobs, commands somtimes output something every time. If these commands don't support limiting their output to errors only, this will create a lot of unnecessary email notifications. Often times we tend to use `> /dev/null 2>&...