Skip to content

Instantly share code, notes, and snippets.

View gandro's full-sized avatar
🌴
On vacation

Sebastian Wicki gandro

🌴
On vacation
View GitHub Profile
DEBUG: Using RE2 as regex engine
DEBUG: Parsing configs
DEBUG: Checking for config file in /usr/src/app/config.js
DEBUG: File config
"config": {
"repositories": ["gandro/renovate-github-release-attachments-bug-repro"],
"dryRun": "true",
"token": "***********",
"forkProcessing": "enabled"
}
DEBUG: Using RE2 as regex engine
DEBUG: Parsing configs
DEBUG: Checking for config file in /usr/src/app/config.js
DEBUG: File config
"config": {
"repositories": ["gandro/renovate-github-release-attachments-bug-repro"],
"dryRun": "true",
"token": "***********",
"forkProcessing": "enabled"
}
@gandro
gandro / json_escape.sh
Last active March 14, 2019 09:58
POSIX shell compliant JSON string escape
json_escape() {
printf '"'
for oct in $(printf '%s' "$1" | od -A n -t o1) ; do
case $oct in
010) printf '\\b' ;;
011) printf '\\t' ;;
012) printf '\\n' ;;
014) printf '\\f' ;;
015) printf '\\r' ;;
042) printf '\\"' ;;
@gandro
gandro / git-tree-hash.sh
Last active November 24, 2023 15:44
Extract the git tree hash for a given directory
#!/bin/sh
exec git -C "${1?"Usage: $0 <pathname> [commit]"}" rev-parse "${2:-HEAD}:./"
@gandro
gandro / dockerd-on-qemu-arm64.md
Last active February 7, 2023 03:32
Running dockerd on linux/arm64 with QEMU

Running dockerd on linux/arm64 with QEMU

Why

  • You need to pull, build, or push linux/arm64 Docker images with tooling which does not support Docker's experimental --platform argument.
  • You are otherwise blocked by moby/moby#36552.
  • You are unable to configure your local dockerd and/or cannot use user-space emulation with qemu-user-static (see below).

Why not

@gandro
gandro / main.c
Created January 2, 2018 15:49
SoftPWM with SCHED_FIFO
/* compile as follows: gcc -Wall -lpthread -lrt main.c -o main */
#include <assert.h>
#include <errno.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
@gandro
gandro / hrt.c
Created January 2, 2018 01:06
nanosleep timer example
/* compile as follows: gcc -Wall -lpthread -lrt -D_GNU_SOURCE hrt.c -o hrt */
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <assert.h>
struct timer_conf;
typedef void (*timer_callback)(struct timer_conf *timer);
@gandro
gandro / Cargo.toml
Created October 15, 2017 21:12
poorgrep
[package]
authors = ["Sebastian Wicki <gandro@gmx.net>"]
name = "poorgrep"
version = "0.1.0"
[dependencies]
grep = "0.1.6"
ignore = "0.2.2"
memmap = "0.5.2"
@gandro
gandro / keybase.md
Created March 30, 2016 19:36
Keybase Verification

Keybase proof

I hereby claim:

  • I am gandro on github.
  • I am gandro (https://keybase.io/gandro) on keybase.
  • I have a public key ASBBoeBKPqHZuf7WCDp1CpQeYc967JsyjhU_r3XHhZiNrQo

To claim this, I am signing this object: