Skip to content

Instantly share code, notes, and snippets.

View jaapterwoerds's full-sized avatar

Jaap ter Woerds jaapterwoerds

  • Lambda Lab Software
  • Amsterdam area, the Netherlands
View GitHub Profile
# https://github.com/rama-nallamilli/kafka-prometheus-monitoring
# https://github.com/Yolean/kubernetes-kafka/blob/master/prometheus/10-metrics-config.yml
lowercaseOutputName: true
rules:
- pattern : kafka.network<type=Processor, name=IdlePercent, networkProcessor=(.+)><>Value
- pattern : kafka.network<type=RequestMetrics, name=RequestsPerSec, request=(.+)><>OneMinuteRate
- pattern : kafka.network<type=SocketServer, name=NetworkProcessorAvgIdlePercent><>Value
- pattern : kafka.server<type=ReplicaFetcherManager, name=MaxLag, clientId=(.+)><>Value
- pattern : kafka.server<type=BrokerTopicMetrics, name=(.+), topic=(.+)><>OneMinuteRate
@jmatsushita
jmatsushita / README
Last active November 8, 2024 16:52
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
###
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places.
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of
###. things to watch out for:
### - Check out the `nix-darwin` instructions, as they have changed.
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026
###
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
@costa
costa / write-ingester-certs.sh
Created February 6, 2019 12:57
a starter script for client+server kafka rest proxy certificates+keystores
#!/bin/bash -e
INGESTER_DOMAIN_NAME="${INGESTER_DOMAIN_NAME:-$1}"
echo "CAUTION should be run from a secure directory"
if test -z "$INGESTER_DOMAIN_NAME"
then echo "needs INGESTER_DOMAIN_NAME"
exit 1
else echo "INGESTER_DOMAIN_NAME=$INGESTER_DOMAIN_NAME"
@jdegoes
jdegoes / fpmax.scala
Created July 13, 2018 03:18
FP to the Max — Code Examples
package fpmax
import scala.util.Try
import scala.io.StdIn.readLine
object App0 {
def main: Unit = {
println("What is your name?")
val name = readLine()
@friedbrice
friedbrice / denotational-semantics.md
Last active May 18, 2018 05:57
Denotational Semantics in a nutshell.

Denotational Semantics in a Nutshell

First off, I am not a programming language theorist, so please comment below if I say anything that's completely off-base or misleading. I'll be happy to make the necessary corrections.

Clears throat

Operational and Logical Semantics

@OneCricketeer
OneCricketeer / kafka-jmx-exporter.yml
Created March 2, 2018 05:24
Kafka JMX Patterns
# https://github.com/rama-nallamilli/kafka-prometheus-monitoring
# https://github.com/Yolean/kubernetes-kafka/blob/master/prometheus/10-metrics-config.yml
lowercaseOutputName: true
rules:
- pattern : kafka.network<type=Processor, name=IdlePercent, networkProcessor=(.+)><>Value
- pattern : kafka.network<type=RequestMetrics, name=RequestsPerSec, request=(.+)><>OneMinuteRate
- pattern : kafka.network<type=SocketServer, name=NetworkProcessorAvgIdlePercent><>Value
- pattern : kafka.server<type=ReplicaFetcherManager, name=MaxLag, clientId=(.+)><>Value
- pattern : kafka.server<type=BrokerTopicMetrics, name=(.+), topic=(.+)><>OneMinuteRate
@thbkrkr
thbkrkr / list.rb
Last active July 25, 2023 07:54
Kafka JMX MBeans list
com.sun.management:type=DiagnosticCommand
com.sun.management:type=HotSpotDiagnostic
java.lang:name=CodeCacheManager,type=MemoryManager
java.lang:name=Code Cache,type=MemoryPool
java.lang:name=Compressed Class Space,type=MemoryPool
java.lang:name=G1 Eden Space,type=MemoryPool
java.lang:name=G1 Old Generation,type=GarbageCollector
java.lang:name=G1 Old Gen,type=MemoryPool
java.lang:name=G1 Survivor Space,type=MemoryPool
java.lang:name=G1 Young Generation,type=GarbageCollector
@awesomebytes
awesomebytes / ipython_to_file.md
Created March 16, 2016 10:38
Save iPython session to a python file as code

Save an iPython session commands/code to a file

You must use the magic method %save:

In [1]: %save?
Type:       Magic function
String Form:<bound method CodeMagics.save of <IPython.core.magics.code.CodeMagics object at 0x7fb5d25bb1d0>>
Namespace:  IPython internal
File: /usr/lib/python2.7/dist-packages/IPython/core/magics/code.py
@Fristi
Fristi / FreeActor.scala
Last active April 25, 2019 13:12
Free Monad operating on Akka actors
package nl.mdj.fpinscala
import akka.actor.{Actor, ActorRef, ActorSystem, Props}
import akka.pattern.ask
import akka.util.Timeout
import nl.mdj.fpinscala.KeyValueStore.{KvS, ListKeys}
import scala.concurrent.duration._
import scala.concurrent.{ExecutionContext, Await, Future}
import scalaz.std.list._
@colestanfield
colestanfield / gist:fac042d3108b0c06e952
Created August 8, 2014 22:55
sbt-assembly merge strategy for aop.xml files
// Create a new MergeStrategy for aop.xml files
val aopMerge: MergeStrategy = new MergeStrategy {
val name = "aopMerge"
import scala.xml._
import scala.xml.dtd._
def apply(tempDir: File, path: String, files: Seq[File]): Either[String, Seq[(File, String)]] = {
val dt = DocType("aspectj", PublicID("-//AspectJ//DTD//EN", "http://www.eclipse.org/aspectj/dtd/aspectj.dtd"), Nil)
val file = MergeStrategy.createMergeTarget(tempDir, path)