Skip to content

Instantly share code, notes, and snippets.

View Zatte's full-sized avatar

Mikael Rapp Zatte

  • Kvantic.com
  • Stockholm
View GitHub Profile
@Zatte
Zatte / ReaderFanOut.go
Last active November 30, 2023 15:46
A GoLang fanout reader / Multi reader to have multiple consumers process the same io.Reader without buffering
// ReaderFanOut allows multiple consumers of one io.Reader.
// all consumers are run concurrently (in go threads) but will process
// the reading sequentially; this means that if a consumer stops consuming
// the reader it will block other consumers.
// If a consumer returns the it's reader is automatically drained to avoid
// stalling other consumers. If any consumer returns a non nil error the
// context for all other consumers is cancelled and the first error is returned.
func ReaderFanOut(
ctx context.Context,
source io.Reader,
@lucndm
lucndm / Host
Created December 21, 2019 06:24
Proxmox GPU passthrough to LXC Container
Note : Proxmox 6.1
VI : /etc/apt/sources.list
# security updates
deb http://security.debian.org jessie/updates main contrib
# PVE pve-no-subscription repository provided by proxmox.com,
# NOT recommended for production use
deb http://download.proxmox.com/debian jessie pve-no-subscription
@enricofoltran
enricofoltran / main.go
Last active July 25, 2024 03:38
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"