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
View kafka-cert-options.md

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)
@katef
katef / plot.awk
Last active September 13, 2023 22:47
View plot.awk
#!/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 May 5, 2021 09:46
auth0 JWT in Postman API Testing
View setAuth0JWT.js
/************************************************
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 August 20, 2023 08:59
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
View main.go
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@ErikAugust
ErikAugust / spectre.c
Last active August 22, 2023 03:14
Spectre example code
View spectre.c
#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 September 28, 2023 16:01
Falsehoods programmers believe about time, in a single list
View falsehoods-programming-time-list.md

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
View BarelyMagical.kt
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 {
View thread-pools.md

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
View gist:c4ed5ec8e047f1adb13c1dd333bbb2e2
# 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