Skip to content

Instantly share code, notes, and snippets.

@anfredette
anfredette / tc-bpf-behavior.md
Last active October 3, 2024 15:00
Analysis of tc-bpf behavior

tc-bpf behavior

tc is a utility provided by iproute2 that can be used to interact with the Linux Traffic Control (TC) Subsystem. Support was added in kernel version 4.1 to allow BPF programs to be loaded as TC classifiers (or filters) and actions.

This document describes testing done on the behavior of adding and removing BPF programs using the tc-bpf tool.

The main goal was to understand how tc-bpf behaves in order to determine whether it could be added as an option for bpfd. The specific initial goals documented here were to understand how BPF programs can be added and deleted, and also how to control the order of execution of multiple programs added to the same interface and qdisc.

Setup

@tonyklawrence
tonyklawrence / gist:b477dcf624577ab154ed3b51cea60e27
Last active July 10, 2024 03:43
Docker containers using VLAN network on Synology DSM 6.X
First we need to create the VLAN on the Synology from the command line:
See: https://nielshagoort.com/2016/03/30/synology-vlan-tagging/
Then add Network to Docker using maclvan driver
See: https://docs.docker.com/engine/userguide/networking/get-started-macvlan/#macvlan-8021q-trunk-bridge-mode-example-usage
Details...
@joongh
joongh / toeplitz_based_hash.py
Last active July 30, 2024 16:57
Python implementation of Toeplitz-based hash function. It is implemented to understand how the Toeplitz-based hash function works.
#!/usr/bin/env python
#-*- coding: utf-8 -*-
# Test data including the secret key, ip, port numbers and the hash values
# as the result is from "Intel Ethernet Controller 710 Series Datasheet".
KEY=[]
def reset_key():
global KEY
@ziadoz
ziadoz / install.sh
Last active November 7, 2024 19:48
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE`
@basuke
basuke / drive.py
Created September 2, 2012 22:49
Create the GPX file from origin and destination using the GoogleMap Direction API. You can use this output for simulate the location apps in Xcode.
#
# python drive.py "origin" ["waypoint" ... ] "destination"
#
# i.e. python drive.py "Union Square, San Francisco" "Ferry Building, San Francisco" 'Bay Bridge' SFO
import sys, json, urllib2, md5, os.path, pprint
from math import radians, sin, cos, atan2, pow, sqrt
from urllib import quote_plus
from xml.sax.saxutils import escape
from optparse import OptionParser