Skip to content

Instantly share code, notes, and snippets.

View wosc's full-sized avatar

Wolfgang Schnerring wosc

View GitHub Profile
@wosc
wosc / mac-open-terminal-and-wait.sh
Created January 12, 2019 13:59
Launch a command in a new macOS terminal window and block until it exits
#!/bin/bash
# Adapted from https://github.com/jlebon/files/blob/master/bin/gnome-terminal-wrapper
set -euo pipefail
# Needs `flock` command from https://github.com/discoteq/flock
# which can be installed via homebrew (which is not on the PATH by default)
export PATH=/usr/local/bin:$PATH
tmpf=$(mktemp)
trap "rm -f $tmpf" EXIT
@wosc
wosc / Vagrantfile
Created December 18, 2018 19:52
Build unison-2.51.2 deb, compatible with the MacOS binary release
Vagrant.configure("2") do |config|
config.vm.define "default" do |default|
default.vm.hostname = "unisonbuild"
default.vm.provider "lxc"
default.vm.box = "zeitonline/bionic64-lxc"
# default.vm.box = "bento/ubuntu-18.04"
end
end
@wosc
wosc / hatch-release.sh
Created March 19, 2023 17:07
Release dance for a python package with hatch
#!/bin/bash
# Generic "Bump version, update changelog, git tag, upload to pypi, bump version" workflow,
# like zest.releaser+setuptools, but for hatch+towncrier
# Matching pyproject.toml example: https://github.com/wosc/nginx-db-auth/blob/1.1.0/pyproject.toml
# (the salient points are 1) `hatch run release:towncrier`, 2) `dynamic = ["version"]`, 3) file locations for changelog and version)
set -ex
changelog=$(hatch run release:towncrier build --version=draft --draft 2>&1)
if echo "$changelog" | grep -q "No significant changes"; then
@wosc
wosc / README.md
Created July 8, 2021 07:49
Creating tracing data from an haproxy access log via fluent bit and opentelemetry collector

Creating opentelemetry tracing data from an haproxy access log

Approach

Unfortunately, otelcol currently has no receiver for logfiles that produces tracing data. There is log tailing functionality, and e.g. a fluent forward protocol receiver, but they all create "log" data, not tracing. I've seen this proof of concept to implement a forward receiver that creates tracing data, but that seems to have no traction and no relation to the upstream project at all (not even git history.

Thus, we've settled on this approach: