Skip to content

Instantly share code, notes, and snippets.

View Oberon00's full-sized avatar

Christian Neumüller Oberon00

View GitHub Profile
@Oberon00
Oberon00 / impfungen_at.py
Created May 14, 2021 23:13
Some calculations about the velocity of the Austrian vaccination campaign
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.dates
import matplotlib.ticker
import seaborn as sns
# Get from https://info.gesundheitsministerium.gv.at/?re=opendata
bbg = pd.read_csv('timeline-bbg.csv', sep=';')
states = pd.read_csv('timeline-bundeslaendermeldungen.csv', sep=';')
states['BundeslandID'].replace(0, -1, inplace=True)
@Oberon00
Oberon00 / threadlogging.java
Created July 14, 2020 08:43
Debug multithreading issues with logging: Formatter that prints thread ID and milliseconds
Logger.getLogger("").setLevel(Level.ALL);
final ConsoleHandler consoleHandler = new ConsoleHandler();
consoleHandler.setFormatter(
new Formatter() {
private final MessageFormat messageFormat =
new MessageFormat("[{0,date,hh:mm:ss.SSS} {1} {2} {3}] {4}{5}\n", Locale.ROOT);
@Override
public String format(LogRecord record) {
final String backtrace;
@Oberon00
Oberon00 / protobubexporter.py
Created January 10, 2020 16:41
OpenTelemetry-Python protobuf exporter
# https://github.com/open-telemetry/opentelemetry-java/blob/91b6c1fe41d0df52b14541a6ad0866195f1a90c9/api/src/main/java/io/opentelemetry/trace/SpanId.java#L121-L123
_IDENTIFIER_BYTE_ORDER = "big"
def _set_pb_attrval(attrpb, attrval):
"""Convert the attributes to otel tags (based on the jaeger exporter)."""
if isinstance(attrval, bool):
attrpb.type = common_pb2.AttributeKeyValue.ValueType.BOOL
attrpb.bool_value = attrval
elif isinstance(attrval, str):
attrpb.type = common_pb2.AttributeKeyValue.ValueType.STRING
@Oberon00
Oberon00 / ln.strace
Last active March 28, 2019 15:38
WSL error traces (microsoft/WSL#3943)
execve("/usr/sbin/ln", ["ln", "-s", "somefile", "foo"], 0x7fffff8e7138 /* 16 vars */) = 0
brk(NULL) = 0x7fffe1bd3000
arch_prctl(0x3001 /* ARCH_??? */, 0x7fffe9d3bf80) = -1 EINVAL (Invalid argument)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=36424, ...}) = 0
mmap(NULL, 36424, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f0400732000
close(3) = 0
openat(AT_FDCWD, "/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000C\2\0\0\0\0\0"..., 832) = 832
@Oberon00
Oberon00 / .bashrc
Last active April 16, 2019 08:44
A fine .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@Oberon00
Oberon00 / funcidx.lua
Last active June 14, 2020 08:14
Lua C API function HTML reference table data & generator (http://oberon00.github.io/lua-cfuncidx/index.html)
-- Helpers {{{1
local function fail_on_missing_tbl(t, missing_name)
missing_name = missing_name or 'table entry'
return setmetatable(t, {__index = function(t, k)
error(('No %s with key "%s" (in %s).'):format(missing_name, k, t))
end
})
end
fail_on_missing_tbl(_G, 'global');
From b21cd087bf1f9c3e98cccf56b405dcc8ac6b11ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20Neum=C3=BCller?= <cn00@gmx.at>
Date: Tue, 15 Dec 2015 11:16:59 +0100
Subject: [PATCH] exynos4210: Fix race condition in idle states.
1. Initially, only CPU0 is online.
2. CPU0 starts to bring CPU1 online.
3. CPU0 is waiting for CPU1 to come online, and meanwhile enters idle. Since it
is the only online CPU, it lowers the CPU speed to save power.
4. CPU1 goes online (NOTE: While CPU0 is still idling!)
@Oberon00
Oberon00 / testfreq.sh
Last active December 13, 2015 22:07
SGS2 CPU stress test
#!/bin/bash
# To recover after running this script do
# echo ondemand >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
#
set -e
cd /sys/devices/system/cpu/cpu0/cpufreq/
echo userspace >scaling_governor
From d6bc063f086bbd736fea6e386ec73b6b50b1b35d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20Neum=C3=BCller?= <cn00@gmx.at>
Date: Fri, 4 Dec 2015 08:26:42 +0100
Subject: [PATCH 1/2] Logging in exynos4_set_frequency.
Change-Id: I2de17ea99ee1ce8b077c551679955867c7e45f06
---
arch/arm/mach-exynos/cpufreq-4210.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
@Oberon00
Oberon00 / 0001-ARM-vfp-fix-a-hole-in-VFP-thread-migration.patch
Last active August 29, 2015 14:11
Full patchset for Exynos 4210 FPU corruption fix. (Revert Lanchon's changes that are not included here (that's just his last one) first!)
From fb62238974be027f3619881fc336ae41c01cfe76 Mon Sep 17 00:00:00 2001
From: Russell King <rmk+kernel@arm.linux.org.uk>
Date: Sat, 9 Jul 2011 16:09:43 +0100
Subject: [PATCH 01/13] ARM: vfp: fix a hole in VFP thread migration
Fix a hole in the VFP thread migration. Lets define two threads.
Thread 1, we'll call 'interesting_thread' which is a thread which is
running on CPU0, using VFP (so vfp_current_hw_state[0] =
&interesting_thread->vfpstate) and gets migrated off to CPU1, where