Skip to content

Instantly share code, notes, and snippets.

View hexfusion's full-sized avatar
🐀
scampering

Sam Batschelet hexfusion

🐀
scampering
View GitHub Profile
#!/usr/bin/env bash
# https://grafana.com/docs/grafana/latest/http_api/auth/#create-api-token
GRAFANA_TOKEN=""
if [ "$1" = "" ]; then
echo "url to prometheus.tar required"
exit 1
fi
#!/usr/bin/env bash
CLUSTER_DOMAIN_1="uit-nonprod.pka.domain.com"
CLUSTER_DOMAIN_2="uit-nonprod.rz.domain.com"
NODE_IP="123.123.123.123"
init() {
if [ -d "$PWD/certs" ]; then
echo "$PWD/certs already exists please remove and retry"
exit 1
@hexfusion
hexfusion / tcpdump-pod
Last active May 5, 2020 17:28 — forked from ironcladlou/tcpdump-pod
OpenShift Network Helpers
#!/bin/bash
set -euo pipefail
NAMESPACE=$1
NAME=$2
IMAGE="${IMAGE:-quay.io/dmace/ditm}"
NODE_NAME="$(oc get --namespace $NAMESPACE pods $NAME -o go-template='{{ .spec.nodeName }}')"
CONTAINER_ID_URI="$(oc get --namespace $NAMESPACE pods $NAME -o go-template='{{ (index .status.containerStatuses 0).containerID }}')"
CONTAINER_ID="${CONTAINER_ID_URI:8}"
#!/bin/bash
export ETCDCTL_API=3
./etcdctl --cert ./etcd-client.crt --cacert ./etcd-ca-bundle.crt \
--key ./etcd-client.key \
--endpoints https://10.0.130.58:2379,https://10.0.138.124:2379,https://10.0.151.168:2379 $1
@hexfusion
hexfusion / docker-compose.yaml
Last active April 6, 2020 13:31
Docker compose 3 node etcd cluster
```
version: '2'
services:
etcd-1:
image: gcr.io/etcd-development/etcd:v3.3.18
restart: always
ports:
- 2379
- 2380
@hexfusion
hexfusion / elastic.md
Last active March 31, 2020 13:09
elasticsearch events parser

Intro

I will preface this with the fact that I am not a big data engineer and the methods described may or may not be best practice.

Install

I used a few different methods to run elk stack and what I found was https://github.com/deviantony/docker-elk

Follow steps in Readme for setup.

HEAD /index
GET /index/_source
version: '2'
services:
tests:
image: quay.io/hexfusion/openshift-tests:4.4
restart: always
ports:
- 9090
volumes:
- /home/remote/sbatsche/.ssh/libra.pem:/root/ssh-privatekey
#!/usr/bin/env bash
# https://grafana.com/docs/grafana/latest/http_api/auth/#create-api-token
GRAFANA_TOKEN=""
if [ "$1" = "" ]; then
echo "url to prometheus.tar required"
exit 1
fi
#!/usr/bin/env bash
set -euxo pipefail
COUNT=30
while [ $COUNT -gt 0 ]; do
IS_MEMBER_PRESENT=$( echo "foo" | grep -o "bar")
echo "I made it"
let COUNT=$COUNT-1
done