Skip to content

Instantly share code, notes, and snippets.

@dtanner
dtanner / kafka-cert-options.md
Last active September 15, 2023 16:33
kafka certificate options

Does this remind anyone else of the Emo Philips Northern Conservative Baptist Great Lakes Region Council of 1912 joke?

Format Base64 Encoded Java Client Compatible Kcat Compatible Benthos Compatible YAML Config Compatible
JKS File
PKCS12 File
PKCS8 PEM String
PKCS8 PEM Unencrypted File
PKCS1 Encrypted PEM File
PKCS8 Encrypted PEM File (MD5 DES-CBC)
#!/usr/bin/awk -f
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff
# My copy here is written in awk instead of C, has no compelling benefit.
# Public domain. @thingskatedid
# Run as awk -v x=xyz ... or env variables for stuff?
# Assumptions: the data is evenly spaced along the x-axis
# TODO: moving average
@mamund
mamund / setAuth0JWT.js
Last active November 27, 2023 14:42
auth0 JWT in Postman API Testing
/************************************************
Retrieve a JWT from Auth0 for Postman
2020-05-15 : @mamund @greatwebapis
NOTES:
1) create API definition in Auth0 with
"client_credential" (machine-to-machine)
2) pull the following from Auth0 API config:
- domain
@enricofoltran
enricofoltran / main.go
Last active October 3, 2024 14:08
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@ErikAugust
ErikAugust / spectre.c
Last active August 2, 2024 01:59
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active October 10, 2024 15:09
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@s4nchez
s4nchez / BarelyMagical.kt
Created August 22, 2017 07:50
A simple wrapper around utterlyidle
import com.googlecode.utterlyidle.*
import com.googlecode.utterlyidle.servlet.ApplicationServlet
import javax.servlet.http.HttpServlet
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse
class Application(bindings: List<Binding>): HttpHandler {
val matcher = BindingMatcher(bindings = bindings)
override fun handle(request: Request): Response {

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

@tednaleid
tednaleid / gist:c4ed5ec8e047f1adb13c1dd333bbb2e2
Created March 24, 2017 05:29
shell commands for finding and deleting duplicate files based on md5sum of the file
# RUN AT YOUR OWN RISK, UNDERSTAND THE COMMANDS AND DO NOT RUN BLINDLY
This will find all the duplicate photos in a `raw_photos` directory.
create md5sum of all files (after `brew install coreutils`):
find raw_photos -type f -exec gmd5sum "{}" + > files.md5
then sort that and you can find the files where the md5sum (the first field) is repeated for spot-checking and comparison
@zacharycarter
zacharycarter / wclwn.md
Last active August 19, 2024 03:44
Binding to C Libraries with Nim