Skip to content

Instantly share code, notes, and snippets.

View rsampaio's full-sized avatar

Rodrigo Sampaio Vaz rsampaio

View GitHub Profile
@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);
anonymous
anonymous / README.md
Created June 23, 2015 23:31

To use this stuff:

Triggering an amino build

  • export USER and AMINO_PASSWORD env vars
  • Customize cedar-config.json appropriately (ie: fill in appropriate branches)
  • Run trigger-build, and record the build uuid.

Watching build logs (ensure heroics gem is installed first)

irb

@talwai
talwai / servefile.sh
Created January 23, 2015 19:57
One-shot HTTP webserver to serve file contents using netcat
{ echo -ne "HTTP/1.0 200 OK\r\nContent-Length: $(wc -c <some.file)\r\n\r\n"; cat some.file; } | nc -l 8080