Skip to content

Instantly share code, notes, and snippets.

View vbatts's full-sized avatar
🧁

Vincent Batts vbatts

🧁
View GitHub Profile
@vbatts
vbatts / cloud-config.yaml
Last active April 21, 2024 20:24
flatcar+k3s cloud-init
#cloud-config
coreos:
units:
- name: install-opt-dir.service
content: |
[Unit]
Description=Install /opt directories
ConditionPathIsDirectory=!/opt/libexec
ConditionPathIsDirectory=!/opt/libexec.wd
@vbatts
vbatts / ruby-openssl-build.sh
Created July 11, 2012 14:58
building ruby with a specific openssl
#!/bin/sh
t_dir="$HOME/tmp"
mkdir -p ${t_dir}
pushd ${t_dir}
for url in \
ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.9.3-p194.tar.bz2 \
http://openssl.org/source/openssl-1.0.1c.tar.gz
@vbatts
vbatts / README.md
Last active May 23, 2023 23:08
knative+buildah deep dive

walkthrough: buildah on knative

The buildah utility is a versitile container build tool that does not require a daemon (everything is direct invocation). See my "deep dive" for a few hands on use-cases.

Recently knative was announced. It is a project to enable the kubernetes primitives needed to build a functions-as-a-service. There are a plumbing services needed around this use-case, "build" is one of them. Building containers is largely an indepenent goal and story of "serverless" or "FaaS", but I get why they are grouped together.

@vbatts
vbatts / Dockerfile
Last active February 5, 2023 16:34
buildah: quick deep dive
FROM buildpack-deps:stretch-scm
# gcc for cgo
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
gcc \
libc6-dev \
make \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
@vbatts
vbatts / main.go
Last active December 19, 2022 20:50
terrible instagram export HTML
package main
import (
"encoding/json"
"fmt"
"log"
"os"
"sort"
"strings"
"time"
@vbatts
vbatts / Makefile
Last active June 3, 2022 16:07
Makefile for running flatcar qemu images locally
# 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 / gateway-prep.sh
Last active March 9, 2022 12:00
things for using Azure Gateway
#!/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 September 2, 2021 16:28
dumb simple access to the on-disk gentoo pkg database
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
@vbatts
vbatts / Makefile
Last active June 2, 2021 15:28
Build https://launchpad.net/~smoser/+archive/ubuntu/swtpm for ubuntu-20.10 with the python scripts included
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 / README.md
Created September 24, 2015 13:59
`fmt.Sprintf("%s", buf)` vs `string(buf)` for simple []byte arrays

Curiosity on the differences from moby/moby#16531 (comment)

$ go test
PASS
ok      _/home/vbatts/tmp/string        0.003s
$ go test -run=NONE -bench=. -test.benchmem=true 
PASS
BenchmarkString-4 100000 18982 ns/op 0 B/op 0 allocs/op