Skip to content

Instantly share code, notes, and snippets.

@vbatts
vbatts / gateway-prep.sh
Last active Mar 9, 2022
things for using Azure Gateway
View gateway-prep.sh
#!/bin/bash
set -eu
conf_zip=""
if [ -f kv0.zip ] ; then
conf_zip="kv0.zip"
fi
if [ -f kv1.zip ] ; then
conf_zip="kv1.zip"
@vbatts
vbatts / main.go
Created Sep 2, 2021
dumb simple access to the on-disk gentoo pkg database
View main.go
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
@vbatts
vbatts / Makefile
Last active Jun 2, 2021
Build https://launchpad.net/~smoser/+archive/ubuntu/swtpm for ubuntu-20.10 with the python scripts included
View Makefile
IMAGE := ubuntu:20.10
CWD := $(shell pwd)
NAME := $(shell git config user.name)
EMAIL := $(shell git config user.email)
SWTPM_URL := https://github.com/stefanberger/swtpm
build: build.sh output
docker run \
@vbatts
vbatts / cloud-config.yaml
Last active Apr 18, 2022
flatcar+k3s cloud-init
View cloud-config.yaml
#cloud-config
coreos:
units:
- name: install-opt-dir.service
content: |
[Unit]
Description=Install /opt directories
ConditionPathIsDirectory=!/opt/libexec
ConditionPathIsDirectory=!/opt/libexec.wd
@vbatts
vbatts / Makefile
Last active Jun 3, 2022
Makefile for running flatcar qemu images locally
View Makefile
# Vincent Batts <vbatts@kinvolk.io> 2020-09
CWD := $(shell pwd)
SSH_KEY ?= $(shell realpath $$HOME/.ssh/authorized_keys)
HOST_NAME ?= flatcar-local.test.lan
ISO_FILE = $(CWD)/$(HOST_NAME).iso
MEMORY ?= 4096
PORT ?= 2223
CHANNEL ?= stable
BOARD ?= amd64-usr
@vbatts
vbatts / .toolboxrc
Created Aug 25, 2020
Decent settings for Flatcar's `toolbox`
View .toolboxrc
TOOLBOX_DOCKER_IMAGE=debian
TOOLBOX_ENV=" --bind-ro=/run/torcx/unpack/docker/bin/docker:/usr/bin/docker --setenv=DOCKER_HOST=unix:///media/root/var/run/docker.sock --setenv=SSH_AUTH_SOCK=/media/root/${SSH_AUTH_SOCK} "
@vbatts
vbatts / cloud-config.yaml
Created Aug 13, 2020
cloud-config for crun+docker on flatcar
View cloud-config.yaml
#cloud-config
coreos:
units:
- name: docker.service
command: start
drop-ins:
- name: 50-crun-runtime.conf
content: |
[Service]
@vbatts
vbatts / flatcar.sh
Created Jun 24, 2020
run a local flatcar VM for testing
View flatcar.sh
#!/bin/sh
set -eu
curl -LO https://www.flatcar-linux.org/security/image-signing-key/Flatcar_Image_Signing_Key.asc
gpg --import Flatcar_Image_Signing_Key.asc
wget \
https://stable.release.flatcar-linux.net/amd64-usr/current/flatcar_production_qemu_image.img.bz2 \
https://stable.release.flatcar-linux.net/amd64-usr/current/flatcar_production_qemu.sh \
https://stable.release.flatcar-linux.net/amd64-usr/current/flatcar_production_qemu.README \
@vbatts
vbatts / build-wireguard.sh
Created Jun 16, 2020
building kernel module on flatcar
View build-wireguard.sh
#!/bin/bash
# more information on building kernel modules https://docs.flatcar-linux.org/os/kernel-modules/
set -ue
. /etc/os-release
. /etc/flatcar/update.conf
rm -f flatcar_developer_container.bin.bz2.DIGESTS ||:
wget "https://${GROUP}.release.flatcar-linux.net/${FLATCAR_BOARD}/${VERSION}/flatcar_developer_container.bin.bz2.DIGESTS"
@vbatts
vbatts / quickest.go
Created Nov 14, 2019
quickest rsync server response
View quickest.go
package main
import (
"bufio"
"fmt"
"io"
"log"
"os"
"os/exec"
"sort"