robert@notes: ~ — zsh
➜ robert@notes ~ git:(master) cat ~/.motd
Robert's notes - Notes on Go, Kubernetes, Terraform/OpenTofu, AWS and DevOps culture.
➜ robert@notes ~ git:(master) ls ~
➜ robert@notes ~ git:(master) ls -t posts/ | head -n 5 | xargs head -n 3

Add new key to APT AKA tell APT to trust given key

Linux

On one of my desktop boxes I recently got this message when I wanted to update it via apt:

Fetched 1448 B in 8s (180 B/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used.
GPG error: http://xxxxxxx ./ Release: The following signatures couldn't be verified because
the public key is not available: NO_PUBKEY 0000000000
read more →

Temporary Disabling Bash History

bash

How to do it? It’s actually very simple. You can achieve this with unset HISTFILE. Of course, in that case we only disable history for the current session. What if we want to selectively keep some commands out of the bash history?

read more →

Add timestamp to Bash history

bash

Sometimes there is a need to add a timestamp to bash history. At my work I found it quite useful, especially when some other developers have access to the same box or when you simply want to have an idea when a command from the history was executed.   This is how we can achieve this:

echo 'export HISTTIMEFORMAT="%d.%m.%y %T"' >> ~/.profile

(or .bash_profile if you use a RHEL based distro) and after that just re-login or reload your profile file. Time formatting is exactly the same as for strftime - please check man 3 strftime.

Hint: reloading the profile can be done like this: . .profile or source .profile

– Cheers Robert

read more →

IPtables returns an error : security raw nat mangle filter FAILED

After setting up my new “linode” on linode.com I started configuring the firewall (iptables). After writing down all my rules I tried to restart iptables, but got output like this:

$ service iptables restart
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Setting chains to policy ACCEPT: security raw nat[FAILED]filter
iptables: Unloading modules:                               [  OK  ]
iptables: Applying firewall rules:                         [  OK  ]
read more →
➜ robert@notes ~ git:(master) ls -t posts/ | sed -n