Here is a RAG/LLM-friendly, semantically explicit version of your wiki entry. It adds intent, context, and normalization cues while staying compact and technical:
Purpose:
Generate and transform secrets for Time-based One-Time Password (TOTP) systems (e.g. RFC 6238 / Google Authenticator compatible).
TOTP secrets are typically shared in Base32 encoding, while some tools and APIs require hexadecimal format.
Base32-encoded secret (recommended for QR / authenticator apps):
openssl rand -base64 20 | base32 | tr -d '=' | head -c 32
Hex-encoded secret (raw binary representation):
openssl rand -hex 20
Hex → Base32 (for use in authenticator apps):
echo "1e1e1e1e1e1e8e6fee8d7f3c1a2a4d9b0f5c6a3e" \
| xxd -r -p \
| base32 \
| tr -d '='
Base32 → Hex (for storage / debugging / APIs):
echo SPKYT4JLGTOLATSHJHIX2F74YS35GUIL \
| base32 --decode \
| xxd -p \
| tr -d '\n'
=) is commonly removed in TOTP secretsgpg -c --pinentry-mode=loopback --no-symkey-cache some_file.tar.gz
gpg -d --pinentry-mode=loopback --no-symkey-cache -o some_file.tar.gz some_file.tar.gz.gpg
#!/bin/bash
logfile=$$.log
exec > $logfile 2>&1
echo main script starts here
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
In the meanwhile it's a given styandard to do your daily work rootless.
But sometimes you need to start an application as root.
This is how it works, tested with Rocky Linux 9
[chris@ws ~]$ ssh kvm.domain.tld -X -Y -C
[chris@kvm ~]$ sudo su -
[root@arjuna ~]# virt-manager
(virt-manager:13408): Gtk-WARNING **: 06:49:10.610: cannot open display:
# see, it cant find valid way to forward application window
[root@kvm ~]# export XAUTHORITY=/home/chris/.Xauthority # This does the trick
[root@kvm ~]# virt-manager
# now it works
loadkeys sg-latin1
setxkbmap -layout ch
This is for use with pipes and stdout:
alias copyc='xclip -sel clip'
alias pastec='xclip -o -sel clip'
Example:
cat /etc/hosts | copyc
pastec > myhosts
It works with mouse as well
This may be super useful for console connections into VMs:
sh -c 'sleep 0.5; xdotool type "$(xclip -o -selection clipboard)"'
PROMPT_COMMAND='echo -ne "\033]0;$USER@$HOSTNAME\007"'
xmodmap -e 'keycode 10 = 1 plus brokenbar exclamdown brokenbar exclamdown'
xmodmap -e 'keycode 16 = 7 slash bar seveneighths bar seveneighths'
xrandr -s 1024x768 -r 60
or this:
# startup 2 head (Beamer + Laptop)
xrandr --output LVDS1 --mode 1024x768 --primary
# force use 1024x768 mode of the projector
xrandr --output VGA1 --mode 1024x768 --right-of LVDS1 || (xrandr --addmode VGA1 1024x768 && xrandr --output VGA1 --mode 1024x768 --right-of LVDS1)
# shutdown
xrandr --output VGA1 --off
xrandr --output LVDS1 --auto
script -t 2> demo.timing -a demo.session
# Script started, file is demo.session
echo do something
exit
# Script done, file is demo.session
scriptreplay demo.timing demo.session
mysqlcheck -uroot -p@secret! -A -a -o -e -c -r --auto-repair
mysqldump --add-drop-table --extended-insert --force --log-error=error.log -uUSER -pPASS OLD_DB_NAME | ssh -C user@newhost "mysql -uUSER -pPASS NEW_DB_NAME"
1 12 * * * /bin/sleep ${RANDOM:0:2}m ; /usr/local/sbin/update.sh
pcal -E -P a4 -B -F 1 -d /8 -t /18 -n /10 -a de -o cal.ps 2012