Skip to content

Instantly share code, notes, and snippets.

View vbatts's full-sized avatar
🧁

Vincent Batts vbatts

🧁
View GitHub Profile
@vbatts
vbatts / flatcar.sh
Created June 24, 2020 21:27
run a local flatcar VM for testing
#!/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 / .toolboxrc
Created August 25, 2020 17:46
Decent settings for Flatcar's `toolbox`
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 August 13, 2020 21:48
cloud-config for crun+docker on flatcar
#cloud-config
coreos:
units:
- name: docker.service
command: start
drop-ins:
- name: 50-crun-runtime.conf
content: |
[Service]
@vbatts
vbatts / build-wireguard.sh
Created June 16, 2020 15:28
building kernel module on flatcar
#!/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 / .gitignore
Last active May 13, 2020 00:17
renegotiation example
.client
.server
Dockerfile
@vbatts
vbatts / quickest.go
Created November 14, 2019 19:10
quickest rsync server response
package main
import (
"bufio"
"fmt"
"io"
"log"
"os"
"os/exec"
"sort"
@vbatts
vbatts / Corefile
Last active October 30, 2019 19:39
using coredns to route a split tunnel (like having wireguard connected to home network)
batts.lan. {
# i compiled in this unbound plugin, to get recursive lookups. On centos it needed the 'unbound-devel' package.
unbound
cache
forward . 192.168.0.1
errors
log
}
. {
@vbatts
vbatts / Dockerfile
Created March 7, 2019 19:17
I want repo:tag@digest from every layer in non-colliding values!
ARG IMAGE=fedora
ARG IMAGE_TAG=29
FROM ${IMAGE}:${IMAGE_TAG}
LABEL com.hashbangbash.image=${IMAGE}:${IMAGE_TAG}@${DIGEST}
LABEL com.hashbangbash.image.repo=${IMAGE}
LABEL com.hashbangbash.image.tag=${IMAGE_TAG}
LABEL com.hashbangbash.image.digest=${DIGEST}
@vbatts
vbatts / main.go
Created March 4, 2019 14:02
buffering features from go releases
package main
import (
"fmt"
)
func main() {
var str = "apples and bananas; apples and bananas; apples and bananas; apples and bananas;"
fmt.Println(ReplaceAll(str, "an", "op"))
}
@vbatts
vbatts / README.md
Last active January 27, 2018 16:12
🙏 📎 Emoji that checksum! 🎉 💩

emojisum

🙏 📎 Emoji that checksum! 🎉 💩

I attempted a curated list of 256 emojis that are not entirely similar. Using http://www.webpagefx.com/tools/emoji-cheat-sheet/ to compare them. I went with 256 as that is 8bit/1byte, and the hexadecimal output that is 2 hex characters.

So 1 emoji is 2 hex positions.

new home