Skip to content

Instantly share code, notes, and snippets.

View leonklingele's full-sized avatar
💭
🫨

leonklingele

💭
🫨
View GitHub Profile
@magnetikonline
magnetikonline / README.md
Last active February 12, 2024 00:13
BIND - delegate a sub domain for a zone.

BIND - delegate a sub domain for a zone

The scenario:

  • DNS zone myzone.com defined in BIND.
  • Authoritative name server at 123.16.123.1.
  • Subzone sub.myzone.com with an authoritative name server at 123.16.123.10.
  • Wishing to forward sub-zone to authoritative name server.

Config

@lavalamp
lavalamp / The Three Go Landmines.markdown
Last active February 16, 2024 12:16
Golang landmines

There are three easy to make mistakes in go. I present them here in the way they are often found in the wild, not in the way that is easiest to understand.

All three of these mistakes have been made in Kubernetes code, getting past code review at least once each that I know of.

  1. Loop variables are scoped outside the loop.

What do these lines do? Make predictions and then scroll down.

func print(pi *int) { fmt.Println(*pi) }
@pinge
pinge / ubuntu_14.04_macbook_pro_retina_15_inch_mid_2014.md
Last active March 10, 2021 03:05
How to install Ubuntu 14.04.1 LTS on a MacBook Pro Retina 15" Mid 2014 (11,3)
@kachayev
kachayev / concurrency-in-go.md
Last active March 11, 2024 11:27
Channels Are Not Enough or Why Pipelining Is Not That Easy
@grugq
grugq / gist:03167bed45e774551155
Last active April 6, 2024 10:12
operational pgp - draft

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

@Belphemur
Belphemur / build_nginx.sh
Last active November 13, 2022 13:05 — forked from MattWilcox/build_nginx.sh
Compiling Nginx with LibreSSL (and http2)
#!/usr/bin/env bash
# names of latest versions of each package
export NGINX_VERSION=1.15.5
export VERSION_NGINX=nginx-$NGINX_VERSION
export VERSION_LIBRESSL=libressl-2.8.1
export VERSION_PCRE=pcre-8.42
#export NPS_VERSION=1.9.32.10
#export VERSION_PAGESPEED=v${NPS_VERSION}-beta

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns                     on recent CPU
L2 cache reference ........................... 7 ns                     14x L1 cache
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns                     20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs 4X memory

@stefanschmidt
stefanschmidt / osx-software-update-urls.txt
Created January 4, 2014 01:22
URLs of the index files used by the software update client on OS X
10.3 (Panther): http://swscan.apple.com/scanningpoints/scanningpointX.xml
10.4 (Tiger): http://swscan.apple.com/content/catalogs/index-1.sucatalog
10.5 (Leopard): http://swscan.apple.com/content/catalogs/others/index-leopard.merged-1.sucatalog
10.6 (Snow Leopard): http://swscan.apple.com/content/catalogs/others/index-leopard-snowleopard.merged-1.sucatalog
10.7 (Lion): http://swscan.apple.com/content/catalogs/others/index-lion-snowleopard-leopard.merged-1.sucatalog
10.8 (Mountain Lion): http://swscan.apple.com/content/catalogs/others/index-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog
10.9 (Mavericks): http://swscan.apple.com/content/catalogs/others/index-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog
10.9 (Mavericks incl. seeds): http://swscan.apple.com/content/catalogs/others/index-10.9seed-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog
@hgfischer
hgfischer / benchmark+go+nginx.md
Last active April 11, 2024 22:09
Benchmarking Nginx with Go

Benchmarking Nginx with Go

There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.

So, these are the different settings we are going to compare:

  • Go HTTP standalone (as the control group)
  • Nginx proxy to Go HTTP
  • Nginx fastcgi to Go TCP FastCGI
  • Nginx fastcgi to Go Unix Socket FastCGI
@aras-p
aras-p / preprocessor_fun.h
Last active April 28, 2024 15:25
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,