This file contains 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 -e | |
# Find all the pods using a given imageID | |
kubectl get pods --all-namespaces \ | |
-o 'custom-columns=NS:.metadata.namespace,NAME:.metadata.name,IMAGE:.status.containerStatuses[*].imageID' | | |
awk '{if ($3 ~ "bitnami/external-dns@sha256:b615d1c97d93e5a4d83da00de8d1854f0274814b4ef57708d0ed9341205753e9") {print $1 "/" $2}}' |
This file contains 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
for ns in $(kubectl get sts --all-namespaces | awk '{if ($2 == "zookeeper") {print $1}}'); do | |
if [ $(kubectl get sts zookeeper -n $ns -o json | jq '.spec.template.spec.containers[1].image') != null ]; then | |
kubectl patch sts zookeeper -n $ns \ | |
-p '{"spec":{"template":{"spec": {"containers":[{"name": "jmx-exporter", "image":"bitnami/jmx-exporter:1.0.1"}]}}}}' | |
fi | |
done |
This file contains 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 | |
PATTERN='for-example-a-kafka-topic-name-to-look-for' | |
for ns in $(kubectl get ns | awk '{if ($1 !~ /^NAME|kube-/) {print $1}}') | |
do | |
echo "Looking into $ns" | |
kubectl exec -n "$ns" -c nifi nifi-0 -- zgrep "$PATTERN" permanent_configs/flow.xml.gz 2>/dev/null | |
done |
This file contains 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
go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/fieldalignment | |
fieldalignment -fix a_problematic_file.go |
This file contains 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/sh -e | |
# Install a Terraform provider | |
OS=linux | |
ARCH=amd64 | |
OPTS=`getopt -l dont-unzip,full-url:,group:,provider:,site:,url:,version: -- df:g:p:u:s:v: "$@"` || exit 1 | |
eval set -- "$OPTS" |
This file contains 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
package main | |
import ( | |
"fmt" | |
"log" | |
. "github.com/signalfx/signalfx-go/signalflow" | |
) | |
const ( |
This file contains 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
gcloud --project my-project-id \ | |
functions call hello-world \ | |
--data '{}' \ | |
--region us-east1 |
This file contains 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
import boto3 | |
import datetime | |
# iterator over EC2 instances for region | |
def ec2_instances(region): | |
client = boto3.client('ec2', region_name = region) | |
for reservation in client.describe_instances().get('Reservations', []): | |
for instance in reservation.get('Instances', []): | |
yield instance |
This file contains 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
ansible-playbook our_playbook.yml -e '{"our_var": ["one", "two", "three",]}' |
This file contains 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
# Nice doc is here: https://docs.lenses.io/dev/lenses-cli/index.html | |
LENSES_CLI_CMD="lenses-cli --host https://10.0.17.20:9991/ --user admin --pass admin --insecure groups" | |
# Get the list | |
$LENSES_CLI_CMD get --output JSON | |
# Group config file | |
cat > config.yaml << EOF | |
name: windows_admins | |
description: "Admins from AD" |
NewerOlder