Disable IPv6 on Ubuntu 22.04 via sysctl settings

Check if IPv6 is disabled

sysctl -a 2>/dev/null | grep disable_ipv6

Disabling IPv6 temporarily

sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1
sysctl -w net.ipv6.conf.lo.disable_ipv6=1

Disabling IPv6  Permanently

sudo nano /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6 = 1
sysctl -p

References
https://www.thegeekdiary.com/how-to-disable-ipv6-on-ubuntu-18-04-bionic-beaver-linux/
https://www.golinuxcloud.com/linux-check-ipv6-enabled/
https://www.garron.me/en/go2linux/sysctl-linux.html

Generate and Prepare a new GPG key for Github

Generating a GPG key

gpg --full-generate-key
gpg --list-secret-keys --keyid-format=long

From the list of GPG keys, copy the long form of the GPG key ID you’d like to use. In this example, the GPG key ID is 3AA5C34371567BD2:

$ gpg --list-secret-keys --keyid-format=long
/Users/hubot/.gnupg/secring.gpg
------------------------------------
sec   4096R/3AA5C34371567BD2 2016-03-10 [expires: 2017-03-10]
uid                          Hubot 
ssb   4096R/42B317FD4BA89E7A 2016-03-10
gpg --armor --export 3AA5C34371567BD2
# Prints the GPG key ID, in ASCII armor format

Copy your GPG key, beginning with -----BEGIN PGP PUBLIC KEY BLOCK----- and ending with -----END PGP PUBLIC KEY BLOCK-----.

References
https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key

Export and Import GPG private key

gpg --list-secret-keys --keyid-format LONG

Example output:

pub   4096R/ABC12345 2020-01-01 [expires: 2025-12-31]
uid                  Your Name <user@example.com>
sub   4096R/DEF67890 2020-01-01 [expires: 2025-12-31]

Remember the ID of your key (second column, after the slash, e.g. “ABC12345”). If you have a “sub” entry, you can ignore it.

Run this command to export your key:

gpg --export-secret-keys YOUR_ID_HERE > private.key

Run this command to import your key:

gpg --import private.key

References
https://makandracards.com/makandra-orga/37763-gpg-extract-private-key-and-import-on-different-machine

Assign Output of Shell Command To Variable in Bash

var=$(command-name-here)
var=$(command-name-here arg1)
var=$(/path/to/command)
var=$(/path/to/command arg1 arg2)

OR use backticks based syntax as follows to assign output of a Linux command to a variable:

var=`command-name-here`
var=`command-name-here arg1`
var=`/path/to/command`
var=`/path/to/command arg1 arg2`

Examples

## store date command output to $now  ##
now=$(date)
## alternate syntax ##
now=`date`

To display back result (or output stored in a variable called $now) use the echo or printf command:

echo "$now"
printf "%s\n" "$now"

References
https://www.cyberciti.biz/faq/unix-linux-bsd-appleosx-bash-assign-variable-command-output/