Skip to content

Instantly share code, notes, and snippets.

View andir's full-sized avatar

Andreas Rammhold andir

View GitHub Profile
#pragma once
#ifdef PARALLEL_UPDATE
#include <boost/thread.hpp>
#include <boost/thread/executors/basic_thread_pool.hpp>
#include <boost/thread/future.hpp>
#include <boost/thread/latch.hpp>
#include <deque>
#endif
#include <functional>
@andir
andir / foo.rs
Last active October 21, 2025 10:19
use proc_macro::TokenStream;
use quote::quote;
use syn::{Data, DeriveInput, Fields, Lit, Meta, MetaNameValue, parse_macro_input};
#[proc_macro_derive(SimplePrometheus, attributes(prefix))]
pub fn simple_prometheus_derive(input: TokenStream) -> TokenStream {
let ast = parse_macro_input!(input as DeriveInput);
let fields = match &ast.data {
[117434.251657] systemd-journald[268]: File /var/log/journal/73dc5ecda65653aa20c75f4452b0567e/user-1007.journal corrupted or uncleanly shut down, renaming and replacing.
[234148.780698] systemd invoked oom-killer: gfp_mask=0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), order=0, oom_score_adj=0
[234148.781805] CPU: 1 UID: 0 PID: 1 Comm: systemd Not tainted 6.12.48+deb13-amd64 #1 Debian 6.12.48-1
[234148.781809] Hardware name: Hetzner vServer/Standard PC (i440FX + PIIX, 1996), BIOS 20171111 11/11/2017
[234148.781811] Call Trace:
[234148.781815] <TASK>
[234148.781819] dump_stack_lvl+0x5d/0x80
[234148.781826] dump_header+0x43/0x1aa
[234148.781831] oom_kill_process.cold+0x8/0x8d
[234148.781836] out_of_memory+0x219/0x4b0
OpenSSH_8.4p1, OpenSSL 1.1.1h 22 Sep 2020
debug1: Reading configuration data /home/andi//.ssh/config
debug1: /home/andi//.ssh/config line 54: Applying options for localbinarycache
debug1: /home/andi//.ssh/config line 76: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 5: Applying options for *
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/andi/.ssh/known_hosts'
debug1: auto-mux: Trying existing master
debug1: Control socket "/home/andi/.ssh/master-andi@localbinarycache:2222" does not exist
debug2: resolving "localhost" port 2222
@andir
andir / README.md
Last active October 22, 2020 14:34
linotp vscode

VS Code LinOTP setup with Nix

Install the following extensions & make sure the settings (settings.json) are set.

  • Nix Environment Selector (arrterian.nix-env-selector)
  • Python (ms-python.python)

Put the given shell.nix into the linotp checkout.

Open the project in VS Code & select the Nix environment. It should automatically select the right file (since we changed the default).

@nix { "action": "setPhase", "phase": "initPhase" }
initPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/i0fqgkj2ypc85bvapqgg8cccvs6h4x0d-nix-tarball-2.4pre7276_04b79bb/tarballs/nix-2.4pre7276_04b79bb.tar.bz2
source root is nix-2.4pre7276_04b79bb
setting SOURCE_DATE_EPOCH to timestamp 1583247657 of file nix-2.4pre7276_04b79bb/src/libexpr/parser-tab.hh
warning: file nix-2.4pre7276_04b79bb/src/libexpr/parser-tab.hh may be generated; SOURCE_DATE_EPOCH may be non-deterministic
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "initPhase" }
initPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/6s0q1is71vr8pn2ba5islblxm4vwr3fm-source
source root is source
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/jx9xp6gq88sn8sjbgkv9xfica4vyk80s-source
source root is source
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
applying patch /nix/store/gaw6r3fclx1icvfmyndbxcvk8dbj3hgs-no-saved-proto.patch
patching file tensorflow/cc/saved_model/BUILD
applying patch /nix/store/wjksbxyzb9lwlsm3aziqvjsvvwnaafd3-system-jsoncpp.patch
patching file third_party/systemlibs/jsoncpp.BUILD
@andir
andir / private.pem
Created July 27, 2019 09:19
This file can be found on the internet yet COMODO/Sectigo doesn't bother revoking the certificate..
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAxN7nHgbc9gPAXdZg67fAJ51aP7ZhOJOq1CWgwT/Xwc4apJc8
GFBfQRG7wywLnVGNP73cFSwi8UaKFMmX6lHs0R6yprUYdkK6y8z/qNXUYBblGlyq
tSgZI/vUmKgnt38FnW0WKym3eaBx5x06SpXQFr/Xp2CFTS5Axo3/bj/jUNTBc2WE
06vWhnPXn5rps4kYc+7Yxqjxp2ieQxuYdrlFlOpo2121S3u9NaTCiQjoEIv41T0J
O9uQo/ziQJOA/1sg2Ur6w1h3h1bifE5y9/4R/AwatQVW39CMrtgVoXbWplx6Hqtx
DCUuez/bNPtC+1bL85iUdv6/fGLTm7Y+BOsOXQIDAQABAoIBAEPY9hm5D8mRPWiZ
i0lxSD3e0s2GUzcmXQdD+IThNcBLAY+bt1BB0rIgJG987HvJMT64dfKuBVTVlJzZ
ZQuSNGVViQg+/TE0ih/WhH1xRAHhog9VxFcufIuULI531Ug99HdusucpN1wpWVfn
EMHHo7FTaET81LPmrtg+87rRNcwTC1lK0CgozNHhYgv32Gv1F5Ni+7jSJVmNjVD2
starting VDE switch for network 1
running the VM test script
master: starting vm
master# Formatting '/tmp/nix-build-vm-test-run-mysql-replication.drv-0/vm-state-master/master.qcow2', fmt=qcow2 size=536870912 cluster_size=65536 lazy_refcounts=off refcount_bits=16
master: QEMU running (pid 6401)
master: waiting for unit ‘mysql’
master: running command: systemctl --no-pager show "mysql"
master: waiting for the VM to finish booting
master# cSeaBIOS (version rel-1.12.0-0-ga698c8995f-prebuilt.qemu.org)
master#