Memo

S3 blockstorage
S3 blockstorage
S3cmd command S3cmd is a tool to handle blockstorage S3 type. Install the command 1# Ubuntu install 2sudo apt-get install s3cmd 3 4# Redhat install 5sudo dnf install s3cmd 6 7# or from sources 8wget https://sourceforge.net/projects/s3tools/files/s3cmd/2.2.0/s3cmd-2.2.0.tar.gz 9tar xzf s3cmd-2.2.0.tar.gz 10cd s3cmd-2.2.0 11sudo python3 setup.py install Configure it From Cloud providers (for example DO): Log in to the DigitalOcean Control Panel. Navigate to API > Spaces Access Keys and generate a new key pair.
Terraform
Terraform
Validate Terraform code 1dirs -c 2for DIR in $(find ./examples -type d); do 3 pushd $DIR 4 terraform init -backend=false 5 terraform fmt -check 6 terraform validate 7 popd 8 done Execute Terraform 1export DO_PAT="dop_v1_xxxxxxxxxxxxxxxx" 2doctl auth init --context rkub 3 4# inside a dir with a tf file 5terraform init 6terraform validate 7terraform plan -var "do_token=${DO_PAT}" 8terraform apply -var "do_token=${DO_PAT}" -auto-approve 9 10# clean apply 11terraform plan -out=infra.tfplan -var "do_token=${DO_PAT}" 12terraform apply infra.tfplan 13 14# Control 15terraform show terraform.tfstate 16 17# Destroy 18terraform plan -destroy -out=terraform.tfplan -var "do_token=${DO_PAT}" 19terraform apply terraform.tfplan Connect to server getting the ip with terraform command: 1ssh root@$(terraform output -json ip_address_workers | jq -r '.[0]') -i .key Troubleshoot some terraform Check the schema of a Resource (for example libvirt_domain from provider multani/libvirt ) 1terraform providers schema -json| jq '.provider_schemas["registry.terraform.io/multani/libvirt"].resource_schemas["libvirt_domain"].block.attributes | keys' 2[ 3 "arch", 4 "autostart", 5 "cloudinit", 6 "cmdline", 7 "coreos_ignition", 8 "cpu", 9 "description", 10 "disk", 11 "id", 12... 13] Then check what is expected: 1terraform providers schema -json| jq '.provider_schemas["registry.terraform.io/multani/libvirt"].resource_schemas["libvirt_domain"].block.attributes.cpu' 2["libvirt_domain"].block.attributes.cpu' 3{ 4 "type": [ 5 "map", 6 "string" 7 ], 8 "description_kind": "plain", Work with yaml in terraform Two possibilities:
🖥️ GUI
🗒️ Sessions
🗒️ Sessions
Register your session Useful to keep a trace, or to document and share what has been done. script : save all commands and results in a “typescript” file. script -a : append to an existing “typescript” file (otherwise erase the previous one). exit : to stop the session. asciinema : save the terminal session as a video. For RHEL - something like Tlog exists and can be configured and centralised with Rsyslog.
🛰️ Satellite
🛰️ Satellite
Satellite - Repository
🪟 Tmux
🪟 Tmux
Tmux git clone https://github.com/tmux-plugins/tmux-logging.git Command line tmux new -s my_session : Create a new session. tmux attach : Attach to the last used session. tmux attach -t X : Attach to the tmux session with number X. tmux ls : List active tmux sessions. tmux split-window -dh "!!" : Run a command in a separate pane. tmux source-file ~/.tmux.conf : Reload config. Basic Commands with key-bindings C-b w : List sessions/panes. C-b x : Close pane or session.