Setup
bin/kafka-topics.sh \
--zookeeper zookeeper.example.com:2181 \
--create \
#include <linux/bpf.h> | |
#include <linux/in.h> | |
#include <linux/if_ether.h> | |
#include <linux/ip.h> | |
#define SEC(NAME) __attribute__((section(NAME), used)) | |
SEC("dropper_main") | |
int dropper(struct xdp_md *ctx) { | |
int ipsize = 0; |
/* | |
* xdp_manglepong.c - sample XDP program | |
* Copyright (C) 2019 Matteo Croce <mcroce@redhat.com> | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, |
#!/usr/bin/env python | |
# | |
# A script that runs the commands to perform Netflix's | |
# "Linux Performance Analysis in 60,000 Milliseconds" | |
# | |
# (http://techblog.netflix.com/2015/11/linux-performance-analysis-in-60s.html) | |
# | |
import subprocess | |
import datetime | |
import argparse |
... | |
func faviconHandler(w http.ResponseWriter, r *http.Request) { | |
http.ServeFile(w, r, "relative/path/to/favicon.ico") | |
} | |
... | |
func main() { | |
http.HandleFunc("/favicon.ico", faviconHandler) | |
} |
$ go tool dist list | |
android/386 | |
android/amd64 | |
android/arm | |
android/arm64 | |
darwin/386 | |
darwin/amd64 | |
darwin/arm | |
darwin/arm64 | |
dragonfly/amd64 |
# -------- | |
# Hardware | |
# -------- | |
# Opcode - operational code | |
# Assebly mnemonic - abbreviation for an operation | |
# Instruction Code Format (IA-32) | |
# - Optional instruction prefix | |
# - Operational code |
bpf filter: "ip" | |
(000) ldh [12] | |
(001) jeq #0x800 jt 2 jf 3 | |
(002) ret #96 | |
(003) ret #0 | |
(000) ldh [12] | |
Load half word at packet offset 12 | |
Offset 12 is the eth type. |
// | |
// This is just a collection of syscalls that are used by libsctp linux implementation. | |
// Although it supports message-oriented workflow, it can't be wrapped into a net.PacketConn. | |
// | |
package main | |
import ( | |
"log" | |
"syscall" |