Skip to content

Instantly share code, notes, and snippets.

View BradErz's full-sized avatar

Bradley Wilson-Hunt BradErz

View GitHub Profile
@BradErz
BradErz / Dockerfile
Last active February 3, 2024 13:31
Best practice Dockerfile, secure, minimal, and fast with buildkit caching
FROM golang:1.21.6-alpine AS deps
WORKDIR /app
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/go/pkg \
go mod download
FROM golang:1.21.6-alpine AS build
@BradErz
BradErz / Dockerfile
Last active February 1, 2024 20:15
Basic template dockerfile for all apps with buildkit caching
FROM golang:1.21.6-alpine AS build
ARG TARGETOS=linux
ARG TARGETARCH=amd64
ARG PROJECT=./cmd/myapp
WORKDIR /app
ENV CGO_ENABLED=0
COPY go.mod go.sum ./
@BradErz
BradErz / README.md
Last active October 30, 2020 21:06
fedora 33 upgrade issues

Fedora 33 upgrade issues

gcloud sdk doesnt work anymore

error

Traceback (most recent call last):
  File "/usr/lib64/google-cloud-sdk/lib/gcloud.py", line 104, in <module>
    main()
  File "/usr/lib64/google-cloud-sdk/lib/gcloud.py", line 62, in main
apiVersion: v1
data:
cortex-querier-frontend-conf.yaml: |-
# Disable the requirement that every request to Cortex has a
# X-Scope-OrgID header. `fake` will be substituted in instead.
auth_enabled: false
# We only want to run the query-frontend module.
target: query-frontend
@BradErz
BradErz / stackdriver-adapter.yaml
Last active October 21, 2019 07:56
A stackdriver-adapter config that works with istio-1.2.x....
apiVersion: "config.istio.io/v1alpha2"
kind: handler
metadata:
name: stackdriver
namespace: istio-system
labels:
app: istio-telemetry
release: istio-telemetry
spec:

Keybase proof

I hereby claim:

  • I am braderz on github.
  • I am braderz (https://keybase.io/braderz) on keybase.
  • I have a public key ASDBNtEQB49ajJ7yr8rgjT-hTiEkVLzMKMHrVzYht8qFpQo

To claim this, I am signing this object:

twitch_bot:channel_info:*
$5
COUNT
$8
10000000
*4
:46
:1502185700
:4024097
*6
@BradErz
BradErz / .gitignore_global
Created March 23, 2017 11:52
Recommended global .gitignore_global
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# IDE's #
#!/bin/sh
# iptables script generated 2017-01-24
# http://www.mista.nu/iptables
IPT="/sbin/iptables"
# Flush old rules, old custom tables
$IPT --flush
$IPT --delete-chain
@BradErz
BradErz / bash-one-liners.sh
Last active July 12, 2017 12:57
BashOneLiners
# Get all the old replicasets of a kubernetes cluster and output them to a file which is then run
kubectl get --all-namespaces rs -o json|jq -r '.items[] | select(.spec.replicas | contains(0)) | "kubectl delete rs --namespace=\(.metadata.namespace) \(.metadata.name)"' > old.sh && sh old.sh
# Remove all exited docker images
docker rm $(docker ps -qa --no-trunc --filter "status=exited")
# Add an existing IAM role to an existing EC2 instance
aws ec2 associate-iam-instance-profile --instance-id ${INSTANCE_ID} --iam-instance-profile Name=${IAM_ROLE}