ctr=0
max_retries=10
while [ {{condition}} ]; do
ctr=`expr $ctr + 1`
sleep 5
if [ $ctr == $max_retries ]; then
echo "max retries ($max_retries) reached"
exit 1
fi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| hello | |
| world | |
| dog | |
| cat | |
| fish | |
| car | |
| golang |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -o pipefail | |
| set -o nounset | |
| set -o errexit | |
| IFS=$'\n\t' | |
| function print_help { | |
| echo "usage: $0 [options] <cluster-name>" |
At some point in your day to day hacking life, getting the Struct fields and values may come in handy.
package main
import (
"fmt"
"reflect"
)Version 1.
package main
import (
"context"
"fmt"
"os"
"os/signal"curl -X PUT -H 'Content-Type: application/json' localhost:9200/jaeger-span-*/_settings -d ' {
"index": {
"blocks": {
"read_only_allow_delete": "false"
}
}
}'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: monitoring.coreos.com/v1 | |
| kind: PrometheusRule | |
| metadata: | |
| labels: | |
| app: prometheus-operator | |
| release: prometheus | |
| name: alertmanager-flux | |
| namespace: monitoring | |
| spec: | |
| groups: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Copyright © 2017 Google Inc. | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Copyright © 2017 Google Inc. | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software |
Getting LazyVim set up for senior-level Go development is less about piling on dozens of random plugins and more about orchestrating the "Big Three": LSP (gopls), Linting (golangci-lint), and Debugging (delve).
This guide transforms a stock LazyVim installation into a production-ready Go IDE.