Skip to content

Instantly share code, notes, and snippets.

View iomonad's full-sized avatar
🍋
λ

iomonad iomonad

🍋
λ
  • 12:24 (UTC +03:00)
View GitHub Profile
@iomonad
iomonad / README.md
Created November 4, 2021 22:11 — forked from bodokaiser/README.md
Guide How-To use Device Tree Overlays on Archlinux.

Device Tree Overlays on Archlinux

Dependencies

base-devel

You require a working archlinuxarm operarting system and the development tools:

$ pacman -S base-devel
@iomonad
iomonad / deps.edn
Created September 26, 2021 10:52 — forked from souenzzo/deps.edn
Clojure version of "java quickstart" from gsheets. https://developers.google.com/sheets/api/quickstart/java
;; run with
;; clj -Sdeps '{:deps {gdocs {:git/url "https://gist.github.com/souenzzo/df540002607b15378f8014237e499fdd" :sha "fee00617c75fc24c74931aa4200f74666c5b66b6"}}}' -m gdocs
{:paths ["."]
:deps {org.clojure/clojure {:mvn/version "1.10.0"}
com.google.api-client/google-api-client {:mvn/version "1.28.0"}
com.google.oauth-client/google-oauth-client-jetty {:mvn/version "1.28.0"}
com.google.apis/google-api-services-sheets {:mvn/version "v4-rev566-1.25.0"}}}

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)
; A REPL-based, annotated Seesaw tutorial
; Please visit https://github.com/daveray/seesaw for more info
;
; This is a very basic intro to Seesaw, a Clojure UI toolkit. It covers
; Seesaw's basic features and philosophy, but only scratches the surface
; of what's available. It only assumes knowledge of Clojure. No Swing or
; Java experience is needed.
;
; This material was first presented in a talk at @CraftsmanGuild in
; Ann Arbor, MI.
@iomonad
iomonad / 00_destructuring.md
Created February 21, 2021 19:26 — forked from john2x/00_destructuring.md
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@iomonad
iomonad / expng.ex
Created November 27, 2020 08:47 — forked from zabirauf/expng.ex
PNG format Parser in Elixir
defmodule Expng do
defstruct [:width, :height, :bit_depth, :color_type, :compression, :filter, :interlace, :chunks]
def png_parse(<<
0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A,
_length :: size(32),
"IHDR",
width :: size(32),
height :: size(32),
@iomonad
iomonad / virtualbox_ports.png
Created September 23, 2020 12:45 — forked from snb/virtualbox_ports.png
virtualbox serial console
virtualbox_ports.png
@iomonad
iomonad / nginx-tuning.md
Created May 23, 2020 11:56 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@iomonad
iomonad / gist:69c91e51175382ea607c097ee390d566
Created March 26, 2020 17:27 — forked from chrisdone/gist:02e165a0004be33734ac2334f215380e
Build and run minimal Linux / Busybox systems in Qemu

Common

export OPT=/opt
export BUILDS=/some/where/mini_linux
mkdir -p $BUILDS

Linux kernel

@iomonad
iomonad / gist:a8a6a3b029bd9ea2400c807e4dac7952
Created October 8, 2019 13:51 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
  1. General Background and Overview