Skip to content

Instantly share code, notes, and snippets.

View pchaigno's full-sized avatar

Paul Chaignon pchaigno

View GitHub Profile
@pchaigno
pchaigno / Vagrantfile
Last active December 29, 2023 07:00
OVS + Floodlight from sources in a VM
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network :forwarded_port, guest: 8080, host: 8888
config.vm.provider "virtualbox" do |vb|
vb.memory = 2048
@pchaigno
pchaigno / bridge.sh
Last active October 16, 2023 21:21
Use Linux bridge to connect Docker containers to the same subnet as the host
#!/bin/bash
BRIDGE_NAME=dbridge
PHYS_IF=eth0
SUBNET=192.168.1.0
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
sudo brctl addbr $BRIDGE_NAME
sudo brctl addif $BRIDGE_NAME $PHYS_IF
sudo ifconfig $BRIDGE_NAME up

status

My name is r-lyeh and I code videogames :neckbeard:

This repo is meant to be a semi-conclusive list of projects in which the author is / has participated in.

A few notes:

  • The tools below are Public Domain.
Task Time required Assigned to Current Status Finished
Calendar Cache > 5 hours - in progress - [x] ok?
Object Cache > 5 hours - in progress [x] item1
[ ] item2
Object Cache > 5 hours - in progress
  • item1
  • item2
Object Cache > 5 hours - in progress
  • item1
  • item2
  • works
  • works too
@pchaigno
pchaigno / packetdrop-xfrm.py
Last active October 1, 2021 14:02
Script to trace packet drops from Linux's xfrm layer
#!/usr/bin/python
# Copyright (c) Isovalent, 2021.
# Licensed under the Apache License, Version 2.0 (the "License")
from bcc import BPF
import ctypes as ct
import time
import socket
import struct
@pchaigno
pchaigno / lock-down-gke.yaml
Created July 21, 2020 06:40
CiliumClusterwideNetworkPolicy to lock down GKE nodes with the host firewall.
apiVersion: "cilium.io/v2"
kind: CiliumClusterwideNetworkPolicy
description: "Lock down nodes on GKE. USE AT YOUR OWN RISK."
metadata:
name: "lock-down-gke"
spec:
nodeSelector:
matchLabels:
type: worker
ingress:
@pchaigno
pchaigno / Dockerfile
Created July 17, 2016 14:38
Simple linear program with PuLP
FROM ubuntu:16.04
MAINTAINER Paul Chaignon <paul.chaignon@gmail.com>
RUN apt update
RUN apt install -y python-pip glpk-utils coinor-cbc
RUN pip install pulp
RUN apt build-dep -y python-matplotlib
RUN pip install --no-cache-dir pylab
ADD . /lp
@pchaigno
pchaigno / minimize-pkt-losses.lua
Last active January 16, 2020 13:06
A MoonGen script that attemps to achieve the highest throughput supported by DUT while minimizing packet losses.
local mg = require "moongen"
local lm = require "libmoon"
local memory = require "memory"
local device = require "device"
local stats = require "stats"
local limiter = require "software-ratecontrol"
local pcap = require "pcap"
function configure(parser)
parser:description("Attemps to achieve the highest throughput supported by DUT while minimizing packet losses.")
@pchaigno
pchaigno / find-shared.py
Created April 14, 2018 15:02
Linguist: finds shared interpreters, filenames, extensions, etc. between any 2 languages.
#!/usr/bin/env python
import yaml
import sys
with open("lib/linguist/languages.yml", 'r') as stream:
try:
languages = yaml.load(stream)
except yaml.YAMLError as exc:
print(exc)
@pchaigno
pchaigno / Dockerfile
Last active March 18, 2016 14:36
Dockerfile to run Trinity in a container - based on https://github.com/ewindisch/trinity-docker
FROM ubuntu
RUN apt-get update
RUN apt-get install -qy git build-essential
WORKDIR /opt
RUN git clone https://github.com/kernelslacker/trinity
WORKDIR /opt/trinity
RUN ./configure