Linux
Cheatsheete for linux commands
Posted May 4, 2022 by Adrian Wyssmann
General
Set proxy
export http_proxy='http://:@myproxy.intra:8080'
export https_proxy='http://:@myproxy.intra:8080'
export no_proxy=".intra,localhost,.svc.intra"
Check Are HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables standard?
Bash
For-loop oneliner
Run a command 5 times:
for i in {1..5}; do COMMAND; done
or
for((i=1;i<=10;i+=2)); do COMMAND; done
Run a particular command for a list of strings
for context in cluster1 cluster2 cluster3; do echo $context; done
Archlinux
Pacman
error: key “xxxxx” could not be looked up remotely
Problem
When upgrading with pacman the following error occurs
....
downloading required keys...
error: key "xxxxx" could not be looked up remotely
error: required key missing from keyring
error: failed to commit transaction (unexpected error)
Errors occurred, no packages were upgraded.
Solution
Upgrade archlinux-keyring
before upgrading the system
sudo pacman -S archlinux-keyring
Reference: ArchLinux Forum