YAML processing with yq
Nowadays many configurations are done via YAML format. GitLab CI, GitHub Actions, Hugo, Docker compose, and of course Kubernetes. A YAML processor like yq will be useful when working with tools like kubectl that can output YAML. Basic features For examples in basic features section, we use a file deployment.yaml with the following content: apiVersion: v1 kind: Deployment metadata: name: hello-world spec: template: spec: containers: - name: hello image: hello:v0.0.1 - name: world image: world:v0....
Bash script tips
For some small tasks, sometimes Bash script (shell script in general) is better than a full-blown program using programming languages. Here are some personal tips to write a Bash script: Exit on fail Use set -o errexit to make the script exit when it fails. If some commands are allowed to fail, command1 || echo "command1 is failed, but continuing" can be used. Prevent access to undeclared variables Use set -o nounset to exit when the script tries to use undeclared variables....
Γειά σου Κόσμε!
Γειά σου Κόσμε!