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
hound | |
sleuth | |
waldo | |
snoop/snooper | |
seeker |
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 | |
SHA256SUMS_FILE="./sha256_sums" | |
UNIQ_COUNTS_SORTED="./uniq_counts_sorted" | |
find . -type f -exec sha256sum {} \; > $SHA256SUMS_FILE | |
cat $SHA256SUMS_FILE | sort -k1 | cut -f1 -d\ | uniq -c | sed "s:^ *::g" | sort -rk1 > $UNIQ_COUNTS_SORTED | |
IFS=" |
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
FROM golang:1.19 as build | |
WORKDIR /go/src/ | |
COPY go.* . | |
RUN go mod download | |
COPY . . | |
# --mount flag allows for speedier builds of the binary | |
RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 GOOS=linux go build -o app main.go | |
# Final image in the build process |
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
oaten |
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
.DEFAULT_GOAL := helper | |
# Uses the required .env for docker-compose to find root location. | |
CERTS_LOCATION ?= $(shell cat .env | grep -i CERTS_LOCATION | cut -f2 -d\=) | |
CA_LOC ?= $(CERTS_LOCATION)/ca | |
# Default location for client certificates to be stored. | |
CLIENT_LOC ?= $(CERTS_LOCATION)/client_certificates_remote | |
# Specific files for easier reference and changes. May change this in the future. | |
CA_CRT ?= $(CA_LOC)/ca.crt |
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
(global_configurations) { | |
log { | |
class all | |
} | |
errors | |
cache | |
prometheus :9153 | |
} | |
coredns.io:5300 { |
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
export CLUSTER="test" | |
PAYLOAD=$(aws eks describe-cluster --name $CLUSTER --query 'cluster.{CA: certificateAuthority.data,Endpoint: endpoint}') | |
echo $PAYLOAD | jq -rc .CA | base64 -D > /tmp/public_cert | |
ENDPOINT=$(echo $PAYLOAD | jq -rc .Endpoint) | |
curl -v --cacert /tmp/public_cert -H "Authorization: Bearer "$(aws eks get-token --cluster-name $CLUSTER | jq -rc .status.token) $ENDPOINT/api/v1/namespaces/default/pods/ | |
## Additional curl options | |
curl -X GET --cacert /var/lib/kubelet/pods/<podId>/volumes/kubernetes.io~secret/<kube-proxy token secret>/ca.crt -H "Authorization: Bearer $(cat token)" https://<endpoint IP>:443/api/v1/endpoints | |
kubectl -n kube-system create serviceaccount kube-dns |
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
.DEFAULT_GOAL := helper | |
BUILD_TIME ?= $(shell date '+%s') | |
# Useful for colour coding outputs | |
TEXT_RED = \033[0;31;1m | |
TEXT_BLUE = \033[0;34;1m | |
TEXT_GREEN = \033[0;32;1m | |
TEXT_PURPLE = \033[0;35;1m | |
TEXT_NOCOLOR = \033[0m |
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
export DOCKER_REGISTRY_USERNAME="marjamis" | |
export REPOSITORY="test" | |
# Note: If using the base64 command doesn't work here you can run a docker login with your credentials and then copy the base64 value from the file: ~/.docker/config.json | |
export TOKEN=$(curl -H "Authorization: Basic <base64 of docker hub username:password>" "https://auth.docker.io/token?service=registry.docker.io&scope=repository:$DOCKER_REGISTRY_USERNAME/$REPOSITORY:pull,push" | jq .) | |
# Get the manifest of a specific image | |
curl -LH "Authorization: Bearer $TOKEN" https://index.docker.io/v2/$DOCKER_REGISTRY_USERNAME/$REPOSITORY/manifests/<tag or digest> | jq . | |
# Get a list of tags for images in this repository |
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 | |
# echo "## Each files last update, sorted from oldest to newest" | |
# cd .. && git ls-tree -r --name-only HEAD | while read filename; do echo "$(git log -1 --format="%aI" -- $filename) $filename"; done | sort -rk1 | |
function lastCommit { | |
git log -1 --format=%cI | |
} | |
function addNumber { |
NewerOlder