Skip to content

Instantly share code, notes, and snippets.

View udhos's full-sized avatar
👾
Wondering

udhos

👾
Wondering
  • São Paulo, Brazil
View GitHub Profile
@udhos
udhos / LICENSE
Created November 14, 2024 02:16 — forked from shaneutt/LICENSE
Golang: Demonstrate creating a CA Certificate, and Creating and Signing Certs with the CA
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@udhos
udhos / tls-client.go
Created November 12, 2024 23:20 — forked from michaljemala/tls-client.go
SSL Client Authentication Golang sample
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)
@udhos
udhos / main.go
Created January 13, 2024 02:35 — forked from fl64/main.go
golang prometheus exporter example
package main
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"log"
"math/rand"
"net/http"
"time"
@udhos
udhos / Go, Containers, and the Linux Scheduler.md
Last active November 10, 2023 06:17
Go, Containers, and the Linux Scheduler

Go, Containers, and the Linux Scheduler

https://www.riverphillips.dev/blog/go-cfs/

GOMAXPROCS should be set to the number of CPU cores that the container is allowed to use, if you’re allocating fractional CPU round down, unless you’re allocating less than 1 CPU core in which case round up. GOMAXPROCS=max(1, floor(CPUs)) can be used to calculate the value. If you find it easier Uber has open sourced a library automaxprocs to calculate this value for you from your container’s cgroups automatically.

golang/go#33803

https://github.com/uber-go/automaxprocs

@udhos
udhos / grace.go
Created October 28, 2023 21:22 — forked from silkeh/grace.go
Golang graceful restart with TCP connections
package main
import (
"encoding/json"
"flag"
"io/ioutil"
"log"
"net"
"os"
"os/signal"
@udhos
udhos / nginx resolver in stream.md
Created June 28, 2023 13:31
nginx resolver in stream
@udhos
udhos / golang internal package.md
Created May 31, 2023 03:42
golang internal package