Skip to content

Instantly share code, notes, and snippets.

FROM alpine:3.15 AS build
RUN apk --no-cache add libc6-compat device-mapper findutils zfs build-base linux-headers python3 bash git wget cmake pkgconfig ndctl-dev && \
apk --no-cache add thin-provisioning-tools --repository http://dl-3.alpinelinux.org/alpine/edge/main/ && \
apk --no-cache add go==1.16.10-r0 --repository http://dl-3.alpinelinux.org/alpine/v3.14/community/ && \
echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf && \
rm -rf /var/cache/apk/*
RUN wget https://sourceforge.net/projects/perfmon2/files/libpfm4/libpfm-4.11.0.tar.gz && \
echo "112bced9a67d565ff0ce6c2bb90452516d1183e5 libpfm-4.11.0.tar.gz" | sha1sum -c && \
@linki
linki / check-qemu-binfmt.sh
Created March 22, 2022 10:44 — forked from ArturKlauser/check-qemu-binfmt.sh
Building Multi-Architecture Docker Images With Buildx
#!/bin/bash
# (c) 2020 Artur.Klauser@computer.org
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
# This script checks if all software requirements are met in a Linux environment
# in order to use 'docker buildx' to build multi-architecture images.
# For more information see:
# https://nexus.eddiesinentropy.net/2020/01/12/Building-Multi-architecture-Docker-Images-With-Buildx/
function error() {
@linki
linki / main.go
Created March 16, 2017 12:20
mock metadata server
func main() {
metadataServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.RequestURI {
case "/dynamic/instance-identity/document":
w.Write([]byte(document))
case "/dynamic/instance-identity/pkcs7":
w.Write([]byte(pkcs7))
case "/dynamic/instance-identity/signature":
w.Write([]byte(signature))
}
@linki
linki / postgres.yaml
Created September 11, 2016 12:05
example manifest for can
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: postgres
spec:
replicas: 1
template:
metadata:
labels:
app: postgres
package main
import (
"log"
"golang.org/x/net/context"
"golang.org/x/oauth2/google"
cloudresourcemanager "google.golang.org/api/cloudresourcemanager/v1beta1"
compute "google.golang.org/api/compute/v1"
package main
import (
"log"
"golang.org/x/net/context"
"golang.org/x/oauth2/google"
cloudresourcemanager "google.golang.org/api/cloudresourcemanager/v1beta1"
compute "google.golang.org/api/compute/v1"
for i in $(gcloud projects list | tail +2 | awk '{print $1}'); do gcloud --project "$i" container clusters list 2>/dev/null | grep -v MASTER_VERSION | awk '{print $1}'; done
gcloud alpha container node-pools create pool-2 --cluster=cluster-teapot --enable-cloud-endpoints --disk-size=100 --num-nodes 5 --zone europe-west1-c --image-type "CONTAINER_VM" --machine-type n1-standard-1 --scopes=https://www.googleapis.com/auth/cloud-platform
gcloud alpha container node-pools create pool-1 --cluster=cluster-teapot --enable-cloud-endpoints --disk-size=100 --num-nodes 5 --zone europe-west1-c --image-type "GCI" --machine-type n1-standard-1 --scopes=https://www.googleapis.com/auth/cloud-platform
@linki
linki / shenza.sh
Last active May 15, 2016 15:08
shenza.sh
#!/usr/bin/env bash
set -e
# USAGE:
# ./shenza.sh appname "some reason"
appname="${1}"
reason="${2}"
if [ -z "${appname}" ]; then