Skip to content

Instantly share code, notes, and snippets.

View patrickshan's full-sized avatar

Patrick Shan patrickshan

View GitHub Profile
@patrickshan
patrickshan / trace_dns_drops.bt
Created October 17, 2022 10:28 — forked from xh4n3/trace_dns_drops.bt
trace_dns_drops traces DNS drops by ip_vs_in and ipt_do_table.
#!/usr/bin/env bpftrace
/*
* trace_dns_drops traces DNS drops by ip_vs_in and ipt_do_table.
*
* Background:
* 1. Before 5.9, ip_vs_in can cause UDP packets drops when IPVS RS deleted
* and source port reused, See https://github.com/kubernetes/kubernetes/issues/71514 for more details.
* 2. Misconfiguration of iptables can cause DNS drops.
*
* Usage:

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@patrickshan
patrickshan / main.go
Created May 23, 2017 23:49 — forked from lizrice/main.go
Container from scratch
package main
// @lizrice, mostly copied from @doctor_julz: https://gist.github.com/julz/c0017fa7a40de0543001
import (
"fmt"
"os"
"os/exec"
"syscall"
)
@patrickshan
patrickshan / exercise.tour.go
Created July 21, 2016 11:19 — forked from zyxar/exercise.tour.go
tour.golang exercise solutions
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)