Skip to content

Instantly share code, notes, and snippets.

View higebu's full-sized avatar
🏠
Working from home

Yuya Kusakabe higebu

🏠
Working from home
View GitHub Profile
request = function()
wrk.connect(wrk.thread.addr)
return wrk.format()
end
@higebu
higebu / elm.md
Last active May 7, 2019 13:57
elm
@higebu
higebu / Makefile
Created January 19, 2019 13:07
Simple XDP example
LLVM_PREFIX ?= /usr/bin
CLANG ?= $(LLVM_PREFIX)/clang
LLC ?= $(LLVM_PREFIX)/llc
INCLUDEFLAGS = -I/usr/include
all: xdp_prog.elf
clean:
-$(RM) *.elf
@higebu
higebu / hex2pcap.sh
Created December 19, 2018 08:40
hex stream to pcap
#!/bin/bash
hex=$1 # hex stream of packet like 0abcdef...
out=$2 # output file name
echo "$1" | xxd -r -p - - | od -Ax -tx1 - | text2pcap - $2
@higebu
higebu / install_bcc_on_stretch.sh
Last active November 8, 2018 06:49
Install iovisor/bcc on Debian Stretch
#!/bin/bash
apt-get -t stretch-backports install -y linux-image-amd64 linux-headers-amd64
apt-get -t stretch-backports install -y debhelper cmake libllvm6.0 llvm-6.0-dev libclang-6.0-dev \
libelf-dev bison flex libedit-dev clang-format-6.0 python python-netaddr \
python-pyroute2 luajit libluajit-5.1-dev arping iperf netperf ethtool \
devscripts zlib1g-dev libfl-dev
git clone https://github.com/iovisor/bcc.git
pushd bcc
@higebu
higebu / build.sh
Last active August 14, 2018 14:37
Build XDP program on Debian buster
#!/bin/bash
if [ ! -f $1 ]; then
exit 1
fi
kbuilddir=/usr/src/linux-source-4.17
NOSTDINC_FLAGS="-nostdinc -isystem $(gcc -print-file-name=include)"
clang -S $NOSTDINC_FLAGS \
@higebu
higebu / gobpf_on_debian_buster.md
Created July 27, 2018 07:36
gopbf on debian buster
  • Use go 1.10+
  • Install packages
sudo apt install libbpfcc libbpfcc-dev bpfcc-tools
  • go get gobpf
@higebu
higebu / install_nltrace.md
Created July 18, 2018 05:12
Install nltrace
sudo apt install libnl-3-dev libnl-genl-3-dev libnl-nf-3-dev
git clone https://github.com/socketpair/nltrace.git
cd nltrace
make
package main
import (
"fmt"
"net"
"github.com/vishvananda/netlink"
)
func main() {