Skip to content

Instantly share code, notes, and snippets.


Martin Krasser krasserm

View GitHub Profile
krasserm /
Created June 23, 2022 04:19 — forked from squadbox/
A script to control Nvidia GPU fan speed on headless (non-X) linux nodes
# This script will enable or disable fixed gpu fan speed
# Description: A script to control GPU fan speed on headless (non-X) linux nodes
# Original Script by Axel Kohlmeyer <>
# Modified for newer drivers and removed old work-arounds
View gist:9c9651a9423f9d8e2381d1922f9d88ed
import java.nio.ByteBuffer
import java.util.concurrent.TimeUnit
import org.apache.kafka.clients._
import org.apache.kafka.common.metrics.{MetricConfig, Metrics, MetricsReporter}
import org.apache.kafka.common.protocol.ApiKeys
import org.apache.kafka.common.record.{CompressionType, MemoryRecords}
import org.apache.kafka.common.requests.{ProduceRequest, RequestSend}
import org.apache.kafka.common.utils.SystemTime

Keybase proof

I hereby claim:

  • I am krasserm on github.
  • I am krasserm ( on keybase.
  • I have a public key whose fingerprint is B785 7B59 B25E 2385 5450 DE4C F23C A996 D0CF F605

To claim this, I am signing this object:

krasserm /
Last active March 27, 2017 10:13
Akka Persistence Plugins
View akka-persistence-es.scala
import akka.persistence._
object EventsourcingExample extends App {
class EventsourcedProcessor extends Processor {
var events: List[Any] = Nil
var awaitStack: List[Actor.Receive] = Nil
def receive = {
case Persistent(event, _) if recoveryRunning ⇒ update(event)
krasserm / example1.scala
Last active December 17, 2015 23:58
Eventsourced processors in a parent-child relationship
View example1.scala
import scala.concurrent.duration._
import akka.util.Timeout
import org.eligosource.eventsourced.core._
import org.eligosource.eventsourced.journal.leveldb.LeveldbJournalProps
krasserm / parwrite.scala
Created February 3, 2013 11:07
Journal parallel writes prototype
View parwrite.scala
package example
import scala.concurrent._
import scala.concurrent.duration._
import akka.pattern.ask
import akka.util.Timeout
object Parwrite extends App {
krasserm / es-ext-01.scala
Last active December 12, 2015 00:18
Event sourcing and external servce integration (blog post snippets)
View es-ext-01.scala
case class Order(id: Int = -1, details: String,
creditCardNumber: String,
creditCardValidation: Validation = Validation.Pending)
sealed trait Validation
object Validation {
case object Pending extends Validation
case object Success extends Validation
case object Failure extends Validation
krasserm / play-01.scala
Created February 23, 2012 08:30
JAXB-based XML and JSON APIs
View play-01.scala
object Application extends Controller with JaxbSupport {
val paths: String = // colon-separated list of packages containing JAXB-annotated classes ...
val config: JSONConfiguration = // ...
// can be used for JAXB-based JSON and XML processing
implicit val context = new JSONJAXBContext(config, paths)