Skip to content

Instantly share code, notes, and snippets.

@ilian
ilian / docker-compose.yml
Last active November 12, 2023 15:57 — forked from MatthiasWinzeler/docker-compose.yml
cilium 1.14.3 w/ etcd and docker plugin
# git clone https://github.com/cilium/cilium
# cd cilium
# git checkout v1.14.3
## build docker plugin since there is no dockerhub image for 1.14.3 for it
# docker buildx build -f images/cilium-docker-plugin/Dockerfile -t cilium-docker-plugin-local .
# docker compose up
## in other shell:
# docker network create my_network --ipam-driver cilium --driver cilium
# docker run --rm --net my_network -it alpine
@ilian
ilian / x1c9-interrupt-issues.md
Last active January 23, 2022 08:48
Issues when running low-latency applications on X1C9

How to reproduce consistently

  1. Run watch -d -n 0.1 cat /proc/interrupts and find on what core periodic acpi interrupts happen
  2. Pin a latency-sensitive application on that CPU core using taskset -c $CORE $APP where $CORE is the cpu number found in step 1. Observe that there are periodic interruptions in the real-time app (every ~0.5 seconds).

How to reproduce (seems random)

  1. Run watch -d -n 0.1 cat /proc/interrupts and find on what core a lot of interrupts happen when holding your finger on the touchpad
  2. Pin a latency-sensitive application on that CPU core using taskset -c $CORE $APP where $CORE is the cpu number found in step 1

Options to mitigate

  • Pin the application on a different core
@ilian
ilian / gist:dec050b63070af5ff8b114e4d362c0c8
Last active December 19, 2021 18:49
Notes on source-based routing

Our goal is to route a packet from a particular interface or source address range to the desired interface, even if that interface is not our default interface.

Source based routing with ip rule

We have virtual machines bridged to the virbr1 interface and we want to route trafic of these VMs to a virtual network that is accessible via tun0. Assuming default NAT routing has been set up for the VM instances, we can route the traffic as follows:

ip rule add dev virbr1 table 100
ip route add default dev tun0 table 100
@ilian
ilian / gist:f707dbee180f09ae116c161e2a09f028
Created September 6, 2021 20:13
Wine build dependencies for Fedora 23
mkdir -p ~/wine-dirs/wine-build
git clone git://source.winehq.org/git/wine.git ~/wine-dirs/wine-source
sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install mingw32-gcc mingw64-gcc pulseaudio-libs-devel dbus-libs fontconfig-devel freetype-devel gnutls-devel libjpeg-turbo-devel libpng-devel libtiff-devel mesa-libGL-devel libunwind-devel libxml2-devel libxslt-devel libFAudio-devel gstreamer1-devel gstreamer1-plugins-base-devel mpg123-devel SDL2-devel libXcursor-devel libXi-devel libXxf86vm-devel libXrandr-devel libXinerama-devel libXcomposite-devel mesa-libOSMesa-devel libv4l-devel jxrlib-devel
cd wine-dirs/wine-build
../wine-source/configure --enable-win64