Skip to content

Instantly share code, notes, and snippets.

View summerwind's full-sized avatar
📡

Moto Ishizawa summerwind

📡
View GitHub Profile
@summerwind
summerwind / README.md
Created May 30, 2018 08:28
Generic XDP on Ubuntu 18.04

Generic XDP on Ubuntu 18.04

Start VM instance with Vagrant.

$ vagrant up
$ vagrant ssh

Install packages.

@summerwind
summerwind / python.sh
Created June 15, 2017 00:47
python command wrapper for Container Linux
#!/bin/sh
if [ "${CONTAINER}" = "1" ]; then
/usr/local/bin/python $@
else
docker run \
-it --rm \
-v /:/host \
-v /opt:/opt \
-v /home:/home \
@summerwind
summerwind / template.json
Last active June 17, 2019 19:58
Example of vboxmanage command in Packer template
{
"builders": [
{
"type": "virtualbox-ovf",
"source_path": "ubuntu-16.04-server-cloudimg-amd64.ova",
"vboxmanage": [
["storageattach", "{{.Name}}", "--storagectl", "IDE", "--port", "0", "--device", "0", "--type", "dvddrive", "--medium", "files/cloud.iso"],
["modifyvm", "{{.Name}}", "--nic1", "nat" ],
["modifyvm", "{{.Name}}", "--uart1", "0x3F8", "4"],
["modifyvm", "{{.Name}}", "--uartmode1", "file", "console.log"]
@summerwind
summerwind / build-a-os-image-with-packer-and-qemu.md
Last active April 10, 2024 19:32
Build a OS image with Packer and QEMU

Build a OS image with QEMU and Ubuntu Cloud Image

Prerequirements

  • Packer
  • QEMU
  • Docker

Build an image of cloud-init settings

@summerwind
summerwind / h2sniff.py
Last active February 16, 2018 20:13
HTTP/2 frame sniffer
#!/usr/bin/python
# This code is modified version of sslsniff.
# https://github.com/iovisor/bcc/blob/master/tools/sslsniff.py
#
# Licensed under the Apache License, Version 2.0 (the "License")
from __future__ import print_function
import ctypes as ct
from bcc import BPF
@summerwind
summerwind / keybase.md
Created October 19, 2016 12:28
Keybase proof

Keybase proof

I hereby claim:

  • I am summerwind on github.
  • I am summerwind (https://keybase.io/summerwind) on keybase.
  • I have a public key ASATIxoWXCkM5L81IMSEDYZcOcVMlBNCpH3_qNuQdkes_wo

To claim this, I am signing this object:

@summerwind
summerwind / xdp_load_balancer.c
Last active January 30, 2023 15:04
XDP based load balancer with L3DSR support
#define KBUILD_MODNAME "load_balancer"
#include <uapi/linux/bpf.h>
#include <linux/in.h>
#include <linux/if_ether.h>
#include <linux/if_packet.h>
#include <linux/if_vlan.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
BPF_HASH(counter, uint32_t, long);
@summerwind
summerwind / README.md
Last active June 22, 2016 01:57
L3DSR Test Client

L3DSR Test Client

This code is tested on Ubuntu 16.04.

Setup

Install scapy.

$ sudo apt-get install scapy
@summerwind
summerwind / kube-vagrant-setup.sh
Last active September 13, 2017 21:35
Kubernetes を Vagrant でセットアップするコマンド。
export KUBERNETES_PROVIDER=vagrant
export KUBERNETES_MEMORY=2048
export NUM_MINIONS=2
export KUBE_LOGGING_DESTINATION=elasticsearch
export KUBE_ENABLE_CLUSTER_LOGGING=true
export KUBE_ENABLE_NODE_LOGGING=true
curl -sS https://get.k8s.io | bash
#cd kubernetes
#./cluster/kube-up.sh
@summerwind
summerwind / dump.md
Last active September 19, 2015 13:05
H2O のプロセスが暴走する

strace

epoll_wait(4, {{EPOLLERR|EPOLLHUP, {u32=12250816, u64=12250816}}}, 256, 49) = 1
epoll_wait(4, {{EPOLLERR|EPOLLHUP, {u32=12250816, u64=12250816}}}, 256, 49) = 1
epoll_wait(4, {{EPOLLERR|EPOLLHUP, {u32=12250816, u64=12250816}}}, 256, 49) = 1
epoll_wait(4, {{EPOLLERR|EPOLLHUP, {u32=12250816, u64=12250816}}}, 256, 49) = 1
epoll_wait(4, {{EPOLLERR|EPOLLHUP, {u32=12250816, u64=12250816}}}, 256, 49) = 1
epoll_wait(4, {{EPOLLERR|EPOLLHUP, {u32=12250816, u64=12250816}}}, 256, 49) = 1
epoll_wait(4, {{EPOLLERR|EPOLLHUP, {u32=12250816, u64=12250816}}}, 256, 49) = 1
epoll_wait(4, {{EPOLLERR|EPOLLHUP, {u32=12250816, u64=12250816}}}, 256, 49) = 1