Skip to content

Instantly share code, notes, and snippets.

marwei /
Created Nov 9, 2017
How to Reset Kafka Consumer Group Offset

Kafka (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)
View vc-git-diff-word.el
;; Stolen from:
;; Improvements:
;; - Be smarter about adding --word-diff to `vc-git-diff-switches' and
;; not clobbering any existing settings.
;; - Use `defface' as the docstring for `make-face' recommends.
;; - Base face defaults on `diff-added' and `diff-removed'.
;; - Rename `vc-diff-deleted-face' to `vc-diff-removed-face' for
;; consistency with existing face naming conventions.
josephspurrier / sshclient.go
Last active May 31, 2022
Golang SSH Client
View sshclient.go
package main
import (
acdvorak /
Last active Aug 6, 2021 — forked from yubink/
tmux: run a command in all panes
# Runs the specified command (provided by the first argument) in all tmux panes
# in every window. If an application is currently running in a given pane
# (e.g., vim), it is suspended and then resumed so the command can be run.
all-panes-bg_ "$1" &
Integralist / 0.
Last active Sep 2, 2021
Clojure deftype, defrecord, defprotocol
View 0.
  • defprotocol: defines an interface
  • deftype: create a bare-bones object which implements a protocol
  • defrecord: creates an immutable persistent map which implements a protocol

Typically you'll use defrecord (or even a basic map);
unless you need some specific Java inter-op,
where by you'll want to use deftype instead.

Note: defprotocol allows you to add new abstractions in a clean way Rather than (like OOP) having polymorphism on the class itself,

rabbitt /
Last active Oct 8, 2020
PostgreSQL schema cloner (including data).
import psycopg2 as pg
from io import BytesIO
from collections import defaultdict
from contextlib import contextmanager
View gist:7918ab45d0081c806f7e
type = "SandboxFilter"
ticker_interval = 30
script_type = "lua"
filename = "<path_to_lua>"
preserve_data = true
message_matcher = 'Logger == "boundary_haproxy"'
num_buff_rows = 100
preservation_version = 1
tamastimar / nextWindow.lua
Last active Apr 12, 2021
Hammerspoon ( script to switch to next window of frontmost app in OS X
View nextWindow.lua
-- Window Manipulation
-- Bind alt-Tab to show next window of current application
hs.hotkey.bind({"alt"}, "Tab", function()
local app = hs.application.frontmostApplication()
local windows = app:allWindows()
local nextWin = nil
gubatron /
Last active Aug 5, 2022
How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent

How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent

Let's say alice is a user, with 2 or more private repositories repoN. For this example we'll work with just two repositories named repo1 and repo2

You need to be to pull from these repositories without entering a passwords probably on a server, or on multiple servers.