View k8s_nifi_grep.sh
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 |
View fieldalignment_fix.sh
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 |
View install_terraform_provider.sh
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" |
View signalflow_metrics.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
package main | |
import ( | |
"fmt" | |
"log" | |
. "github.com/signalfx/signalfx-go/signalflow" | |
) | |
const ( |
View gcloud_function_call.sh
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 |
View ec2_instance_creation_time.py
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 |
View ansible_pass_list.sh
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",]}' |
View lenses-cli-groups.sh
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" |
View git_log.sh
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
# See git log --help for details | |
git log --reverse --after='Jan 19' --format='format:%h %an' |
View check_keytabs.sh
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 | |
# Check all keytabs in the current directory | |
for kt in *.keytab | |
do | |
pr=$(klist -k $kt | tail -1 | awk '{print $2}') | |
echo -n "${kt}: " | |
kinit -kt $kt $pr > /dev/null 2>&1 && echo OK || echo FAILED | |
done |
NewerOlder