Skip to content

Instantly share code, notes, and snippets.

View zdyxry's full-sized avatar
🖖
Focusing

Yiran Zhou zdyxry

🖖
Focusing
View GitHub Profile
@stewartpark
stewartpark / oom-killer.yml
Last active April 21, 2023 23:04
Userspace Early OOM Killer for Kubernetes Nodes
---
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: oom-killer
namespace: kube-system
labels:
k8s-app: oom-killer
spec:
selector:
@leolara
leolara / publisher.go
Last active April 29, 2023 04:30
Example in Go of how to close a channel written by several goroutines
// Package gochannels example of how to close a channel written by several goroutines
package gochannels
import (
"math/big"
"sync"
)
// Publisher write sequences of big.Int into a channel
type Publisher struct {
@kdrag0n
kdrag0n / README.md
Last active July 29, 2023 04:46
Fast, polling-free approach to kill and wait for all processes to exit. Rust + Tokio, pidfd + epoll + timer
@beriberikix
beriberikix / QEMU_cheat_sheat.md
Last active December 21, 2023 22:12
QEMU cheat sheet for the most basic setup

Create system drive

qemu-img create -f qcow2 alpine.qcow2 16G

Install image

Linux

@nerdalert
nerdalert / Netfilter-IPTables-Diagrams.md
Last active April 9, 2024 09:18
Linux NetFilter, IP Tables and Conntrack Diagrams

Linux NetFilter, IP Tables and Conntrack Diagrams

IPTABLES TABLES and CHAINS

IPTables has the following 4 built-in tables.

1) Filter Table

Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.

@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active April 10, 2024 21:00
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
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