In order to capture the error output from a command in bash shell and use it further in a bash shell you can you the following
COMMAND_ERROR=$( { command_with_error_output; } 2>&1 )
In order to capture the error output from a command in bash shell and use it further in a bash shell you can you the following
COMMAND_ERROR=$( { command_with_error_output; } 2>&1 )
Using the asdf version manager to manage versions of various binaries like terraform, vault or packer is easily done by following the instructions below:
asdf plugin add terraform asdf install terraform latest asdf global terraform 0.14.9 asdf list terraform 0.14.9 terraform --version Terraform v0.14.9
To get or set in environment variables the platform information of a system you can use the following:
export ARCH=$(case $(arch) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(arch) ;; esac) export OS=$(uname | awk '{print tolower($0)}')
Taken from the installation instructions of the Operator SKD here: https://master.sdk.operatorframework.io/docs/installation/
To stop having a service automatically start after bootup in a Linux system with systemctl use the following to stop and then disable the service:
sudo systemctl stop service_name sudo systemctl disable service_name
Trying to start the docker service after some upgrades fails with the following message:
Failed to start docker.service: Unit is masked.
It turns out that after upgrading or more specifically removing and then upgrading the docker installation in ubuntu (in this particular case in raspberry 4 with Ubuntu 20.04 installed), results in this error.
A search brings up the following:
https://forums.docker.com/t/failed-to-start-docker-service-unit-is-masked/67413
and from that the following bug post:
https://bugs.launchpad.net/ubuntu/+source/docker.io/+bug/1844894
So the solution is to run the following to be able to start the docker service (described in the first link above):
sudo systemctl unmask docker sudo systemctl start docker
To be able to get a more detailed information about your current linux distribution, including the code names use the following:
kosmas:$ cat /etc/os-release NAME="Ubuntu" VERSION="18.04.5 LTS (Bionic Beaver)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 18.04.5 LTS" VERSION_ID="18.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=bionic UBUNTU_CODENAME=bionic
If you would like to be able to see the dmesg output with timestamps instead of time in seconds since booting up, use the -T like:
dmesg -T | less
You would like to login to your Brennan B2 using your ssh key.
Copy your public ssh key to /root/.ssh/authorized_keys file in your Brennan B2
Trying to configure and use an nginx server that uses intermediate certifcates, you get the error about values mismatch and nginx does not start
2020/09/23 09:49:38 [emerg] 20958#20958: SSL_CTX_use_PrivateKey("/etc/ssl/private/cakey.pem") failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch)
It seems that this is a common mistake and it is mentioned here: https://nginx.org/en/docs/http/configuring_https_servers.html. In order to fix this you will need to change/reverse the original order that you have concatenated the chain, as in:
cat certs/cacert.pem intermediate/certs/intermediate.cacert.pem > intermediate/certs/ca-chain-bundle.cert_new.pem
Problem
You want to use the pgp encryption when using Terraform to create an AWS IAM user, and you have the secret access token returned as an output but encoded.
Solution
Use the following to get the actual secret key decoded (after copying your encoded key to a file encrypted_key.txt:
$ cat encrypted_key.txt | base64 --decode | gpg -d