Skip to content

Instantly share code, notes, and snippets.

@saimon789
saimon789 / pgCursorPagination.py
Created November 14, 2025 21:51 — forked from arshamalh/pgCursorPagination.py
Cursor pagination in PostgreSQL and Python
# Written by Arsham Arya
# I'm not sure it's the best way,
# So any contribution makes me and other readers happy :)
from psycopg2.pool import ThreadedConnectionPool
import config
_CONNECTION_POOL = None
@saimon789
saimon789 / contact_book.py
Created November 14, 2025 21:51 — forked from arshamalh/contact_book.py
simple Tkinter contact book.
from tkinter import *
from tkinter import messagebox
root = Tk()
root.geometry("480x170")
root.title("Raha Contacts books")
Name = StringVar()
Number = StringVar()
Address = StringVar()
@saimon789
saimon789 / docker-compose.yaml
Created November 14, 2025 21:46 — forked from arshamalh/docker-compose.yaml
Docker compose file for Jaeger all-in-one with OpenTelemetry collector support
version: '3.8'
services:
jaeger:
image: jaegertracing/all-in-one:1.51 # At least 1.35 if you want to have enabled collector
container_name: jaeger
environment:
- COLLECTOR_ZIPKIN_HOST_PORT=:9411
- COLLECTOR_OTLP_ENABLED=true
ports: # Some ports are optional or deprecated, but we still let them be here as it's a general snippet
- "5775:5775/udp" # agent accept zipkin.thrift over compact thrift protocol (deprecated, used by legacy clients only)
@saimon789
saimon789 / config.py
Created November 14, 2025 21:46 — forked from arshamalh/config.py
Python best way to import environment variables for development and production
"""
Written by Arsham Arya
I'm not sure it's the best way,
So any contribution makes everyone happy!
"""
from os import environ
# pip install python-dotenv
from dotenv import dotenv_values
@saimon789
saimon789 / benchmark-commands.txt
Created December 20, 2024 14:59 — forked from jkreps/benchmark-commands.txt
Kafka Benchmark Commands
Producer
Setup
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3
Single thread, no replication
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196
@saimon789
saimon789 / Makefile
Created July 7, 2024 14:30 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@saimon789
saimon789 / docker-registry-delete-image.txt
Created March 26, 2024 13:54 — forked from DavidPesticcio/docker-registry-delete-image.txt
remove images from docker registry v2.4
How to delete an image tag/image from docker registry v2.4
1) Re/Start registry with delete option enabled
Edit the config.yml
storage:
delete:
enabled: true

Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.

  1. List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe

Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.

  1. Reset the consumer offset for a topic (preview)