Skip to content

Instantly share code, notes, and snippets.

View niedbalski's full-sized avatar
Be humble and stay focused

Jorge Niedbalski niedbalski

Be humble and stay focused
View GitHub Profile
import select,socket,asyncio,datetime,dataclasses,typing
s,sk,a,G,T,c=select,socket,asyncio,typing.Generic,typing.TypeVar('T'),typing.cast
class X:
def __init__(s,c):s.c,s.g,s.r,s.e,s.x=c,c.__await__(),None,None,0
def cancel(s):s.x=1
class R(G[T]):
def __await__(s):r=yield s;return c(T,r)
@dataclasses.dataclass
class S(R[None]):s:float
@dataclasses.dataclass
@niedbalski
niedbalski / heap-after-free.c
Created December 2, 2024 12:58
heap-after-free.c
Test filter_parser_use_system_timezone... [2024/12/02 07:40:22] [ info] [fluent bit] version=3.2.3, commit=4acffc2ce8, pid=89607
[2024/12/02 07:40:22] [debug] [engine] coroutine stack size: 36864 bytes (36.0K)
[2024/12/02 07:40:22] [ info] [storage] ver=1.5.2, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2024/12/02 07:40:22] [ info] [simd ] disabled
[2024/12/02 07:40:22] [ info] [cmetrics] version=0.9.9
[2024/12/02 07:40:22] [ info] [ctraces ] version=0.5.7
[2024/12/02 07:40:22] [ info] [input:lib:lib.0] initializing
[2024/12/02 07:40:22] [ info] [input:lib:lib.0] storage_strategy='memory' (memory only)
[2024/12/02 07:40:22] [debug] [lib:lib.0] created event channels: read=25 write=26
[2024/12/02 07:40:22] [debug] [lib:lib.0] created event channels: read=29 write=30
@niedbalski
niedbalski / patch.patch
Created November 13, 2024 11:47
patch.patch
diff --git a/src/config_format/flb_cf_yaml.c b/src/config_format/flb_cf_yaml.c
index 6581692a4..dfed60197 100644
--- a/src/config_format/flb_cf_yaml.c
+++ b/src/config_format/flb_cf_yaml.c
@@ -106,7 +106,7 @@ enum state {
STATE_SECTION, /* top level */
STATE_SECTION_KEY,
STATE_SECTION_VAL,
-
+ STATE_SECTION_VAL_LIST, /* List of section values */
@niedbalski
niedbalski / stacktrace
Created November 8, 2024 14:13
stacktrace
Thread 4 "flb-out-stdout." hit Breakpoint 1.4, cb_process_logs (ins=0x1660e10,
chunk_data=0x7fffe8001100, tag=0x7ffff001d850 "dummy.0", tag_len=7)
at /var/home/ikslabdein/code/oss/fluent-bit/plugins/processor_chunk_dedup/chunk_dedup.c:72
72 struct flb_mp_chunk_cobj *chunk_cobj = (struct flb_mp_chunk_cobj *)chunk_data;
(gdb) bt
#0 cb_process_logs (ins=0x1660e10, chunk_data=0x7fffe8001100, tag=0x7ffff001d850 "dummy.0", tag_len=7)
at /var/home/ikslabdein/code/oss/fluent-bit/plugins/processor_chunk_dedup/chunk_dedup.c:72
#1 0x000000000053ae46 in flb_processor_run (proc=0x1660530, starting_stage=0, type=1,
@niedbalski
niedbalski / chunk_dedup.c
Last active November 8, 2024 19:47
chunk_dedup.c
#include <stdio.h>
#include <fluent-bit/flb_processor_plugin.h>
#include <fluent-bit/flb_mem.h>
#include <fluent-bit/flb_log.h>
#include <fluent-bit/flb_sds.h>
#include <fluent-bit/flb_hash_table.h>
#include <fluent-bit/flb_log_event_decoder.h>
#include <fluent-bit/flb_mp.h>
#include <msgpack.h>
@niedbalski
niedbalski / repro-config.yaml
Created November 4, 2024 14:11
repro-config.yaml
service:
http_server: on
pipeline:
inputs:
- name: dummy
rate: 1000
dummy: '{"message": "a message", "event_cluster": "raptor"}'
outputs:
- name: splunk
alias: splunk_pccs_standard
@niedbalski
niedbalski / macos-tls.patch
Last active October 25, 2024 10:42
macos-tls.patch
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e24666484..82c958dde 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -284,6 +284,7 @@ if(FLB_SYSTEM_MACOS)
${FLB_DEPS}
"-framework Foundation"
"-framework IOKit"
+ "-framework Security"
)
@niedbalski
niedbalski / macos-certs.patch
Created October 25, 2024 10:38
macos-certs.patch
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e24666484..82c958dde 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -284,6 +284,7 @@ if(FLB_SYSTEM_MACOS)
${FLB_DEPS}
"-framework Foundation"
"-framework IOKit"
+ "-framework Security"
)
@niedbalski
niedbalski / certs.patch
Created October 25, 2024 10:26
certs.patch
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e24666484..82c958dde 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -284,6 +284,7 @@ if(FLB_SYSTEM_MACOS)
${FLB_DEPS}
"-framework Foundation"
"-framework IOKit"
+ "-framework Security"
)
@niedbalski
niedbalski / fluent-bit-flamegraph.sh
Created October 22, 2024 09:49
fluent-bit-flamegraph.sh
sudo perf record -F 99 -p $(pgrep fluent-bit) -g -- sleep 60
sudo perf script > out.perf
git clone https://github.com/brendangregg/FlameGraph.git
cd FlameGraph
./stackcollapse-perf.pl out.perf > out.folded
./flamegraph.pl out.folded > flamegraph.svg