Skip to content

Instantly share code, notes, and snippets.

@b4tman
b4tman / daemon.json
Last active November 27, 2025 20:08
docker registry mirrors (/etc/docker/daemon.json) + podman (/etc/containers/registries.conf)
{
"registry-mirrors" : [
"https://cr.yandex/mirror",
"https://dockerhub.timeweb.cloud",
"https://huecker.io",
"https://noohub.ru",
"https://dcr-px.ru",
"https://mirror.gcr.io",
"https://quay.io",
"https://registry.access.redhat.com",
@mmizutani
mmizutani / envoy-schema.json
Last active October 11, 2024 13:24 — forked from linux-china/envoy-schema.json
Envoy configuration json schema for Json and Yaml based on Envoy v1.20.1 (e9f36d2)
{
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"node": {
"properties": {
"id": {
"type": "string",
"description": "An opaque node identifier for the Envoy node. This also provides the local\n service node name. It should be set if any of the following features are\n used: :ref:`statsd <arch_overview_statistics>`, :ref:`CDS\n <config_cluster_manager_cds>`, and :ref:`HTTP tracing\n <arch_overview_tracing>`, either in this message or via\n :option:`--service-node`."
},
"cluster": {
@MainActor
final class AutocompleteObject: ObservableObject {
let delay: TimeInterval = 0.3
@Published var suggestions: [String] = []
init() {
}
@AverageMarcus
AverageMarcus / Dockerfile
Created September 2, 2021 08:49
Example multi-arch Dockerfile for Go projects
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.16 as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETOS
ARG TARGETARCH
WORKDIR /app/
ADD . .
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-w -s" -o yourapplication main.go
@piperswe
piperswe / build_push_and_run.sh
Created April 17, 2021 01:53
Build multi-architecture Docker images with Nix
#!/bin/sh
# Required on macOS because cctools is marked as broken
export NIXPKGS_ALLOW_BROKEN=1
nix run -f image.nix -c push
docker run ghcr.io/piperswe/hello
@yankcrime
yankcrime / k3s-aws-cloud-provider.md
Last active January 4, 2025 20:02
Auto-deploying the external AWS Cloud Provider when bootstrapping K3s

Installing K3s with the external ("out-of-tree") AWS Cloud Provider

Pre-requisites

Refer to the upstream project's official documentation for the various pre-requisites. You must have an IAM role with the right permissions attached to your K3s instances, and you must also tag your nodes with a clusterid. Refer to the Rancher documentation for how to do this

Install K3s with the following options:

curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server \
@aheissenberger
aheissenberger / timemachine.sh
Last active February 21, 2025 21:18
Exclude package folder e.g. node_modules from being backuped by MacOS Time Machine
#!/bin/sh
#set -x
EXCLUDEFOLDERNAME=${3:-"node_modules"}
get_realpath ()
{
echo "$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"
}
SEARCHPATH="$(get_realpath ${2:-"${HOME}"})"
@superseb
superseb / k3s-etcd-commands.md
Last active November 3, 2025 12:55
k3s etcd commands

k3s etcd commands

etcd

Setup etcdctl using the instructions at https://github.com/etcd-io/etcd/releases/tag/v3.4.13 (changed path to /usr/local/bin):

Note: if you want to match th etcdctl binaries with the embedded k3s etcd version, please run the curl command for getting the version first and adjust ETCD_VER below accordingly:

curl -L --cacert /var/lib/rancher/k3s/server/tls/etcd/server-ca.crt --cert /var/lib/rancher/k3s/server/tls/etcd/server-client.crt --key /var/lib/rancher/k3s/server/tls/etcd/server-client.key https://127.0.0.1:2379/version
@kwilczynski
kwilczynski / binary.rb
Last active November 24, 2025 10:25
Example Homebrew formula for a Go command-line (CLI) binary
class Binary < Formula
desc ""
homepage ""
head do
url "", branch: "main"
depends_on "[email protected]" => :build if build.head?
end