Skip to content

Instantly share code, notes, and snippets.

-- Kafka (Redpanda) -> ClickHouse pipeline for crawl-url-events.
-- A Kafka engine table is PASSIVE; a Materialized View drives it into a MergeTree target:
-- crawl_frontier_queue (Kafka) --[crawl_frontier_mv]--> crawl_frontier_events (ReplicatedMergeTree)
--
-- Run: oc -n ddg-index-clickhouse exec -i chi-main-ddgindex-0-0-0 -c clickhouse -- \
-- clickhouse-client --multiquery < clickhouse-kafka-pipeline.sql
--
-- NOTE on offsets: this ClickHouse rejects `kafka_auto_offset_reset` as a table setting, and
-- the default is EARLIEST -> attaching the MV backfills the whole topic (~250M rows). Pick one:
-- (A) runtime, no config change -- seek the consumer group to the end BEFORE creating the MV:
@sochotnicky
sochotnicky / stdin
Last active August 31, 2024 20:33
stdin
AP///////wAEabUn08IBADIcAQSlPCJ4OqWVplZQoCYNUFS37wDRwLMAlQCBgIFAgQCBwHFPSHMA
UKCgNFAIIGgIVVAhAAAaVl4AoKCgKVAwIDUAVVAhAAAaAAAA/QAyTBh4HgAKICAgICAgAAAA/ABB
U1VTIFBCMjc3CiAgAd4CAyLxTwECAxESEwQUBR+QDg8dHiMJFweDAQAAZQMMABAAjArQiiDgLRAQ
PpYAVVAhAAAYAR0AclHQHiBuKFUAVVAhAAAeAR0AvFLQHiC4KFVAVVAhAAAejArQkCBAMSAMQFUA
VVAhAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAgQ==
TEST
28971:
28971: file=libEGL.so.1 [0]; needed by eglinfo [0]
28971: file=libEGL.so.1 [0]; generating link map
28971: dynamic: 0x00007f4e31cb2b98 base: 0x00007f4e31c9e000 size: 0x0000000000015588
28971: entry: 0x00007f4e31c9e000 phdr: 0x00007f4e31c9e040 phnum: 10
28971:
28971:
28971: file=libGLESv2.so.2 [0]; needed by eglinfo [0]
28971: file=libGLESv2.so.2 [0]; generating link map
28971: dynamic: 0x00007f4e31c9cd00 base: 0x00007f4e31c8c000 size: 0x0000000000011020
@sochotnicky
sochotnicky / stdin
Last active December 4, 2022 17:09
chezmoi - support age ediff
diff --git a/chezmoi-ediff.el b/chezmoi-ediff.el
index aa252f0..a209613 100644
--- a/chezmoi-ediff.el
+++ b/chezmoi-ediff.el
@@ -30,8 +30,39 @@
;;; Code:
+(require 'chezmoi)
(require 'ediff)
@sochotnicky
sochotnicky / wl-clipboard-mode.el
Created April 7, 2022 21:35
wl-clipboard-mode.el
# -*- mode:elisp; -*-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Module for switching to using wl-clipboard for pasting/cutting text
;;
;; Mostly useful when emacs is run under wayland and especially over waypipe or
;; similar. Once wl-clipboard is used it will use WAYLAND_DISPLAY of current
;; frame to copy and paste text so that the copying/pasting is not happing on
;; remote waypipe end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@sochotnicky
sochotnicky / binyambar-bt.py
Created January 26, 2022 07:51
bin/yambar-bt.py
#!/usr/bin/python3
import re
import signal
import subprocess
import sys
import time
import pyudev
@sochotnicky
sochotnicky / homew0rm.configfootfoot.ini
Created October 1, 2021 07:52
/home/w0rm/.config/foot/foot.ini
term = foot-direct
font = Sauce Code Pro Nerd Font:pixelsize=16
dpi-aware = no
workers = 4
selection-target = both
[bell]
# urgent = yes
# Should not be needed in sway post 1.6.1 which implements xdg-activation when urgent = yes will work
command = sway_mark_urgent.py
@sochotnicky
sochotnicky / .clang-format
Created September 19, 2021 13:49
.clang-format
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: None
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Right
@sochotnicky
sochotnicky / .clang-format
Created September 19, 2021 13:45
.clang-format
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: None
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Right
@sochotnicky
sochotnicky / sway_switch_windows.py
Created September 13, 2021 07:55
sway_switch_windows.py
#!/usr/bin/python3
import sys
import json
import subprocess
import re
def get_named_windows(tree):
ret = []
if tree["name"] and tree["border"] != "none":