Skip to content

Instantly share code, notes, and snippets.

View philwo's full-sized avatar
🌻
Available

Philipp Wollermann philwo

🌻
Available
View GitHub Profile
@philwo
philwo / netdelay.sh
Last active July 10, 2023 06:20
Simulate limited bandwidth / latency on localhost
#!/bin/bash
set -euo pipefail
bandwidth="1000mbit"
latency="200ms"
jitter="50ms"
correlation="25%"
case "$1" in
@philwo
philwo / test.c
Last active August 7, 2020 13:56
symlink benchmark tool
#include <dirent.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
//const char *target = "shortlink";
@philwo
philwo / Dockerfile
Created May 19, 2020 04:43
Bootstrapping Bazel inside Docker (works on arm64)
FROM ubuntu:18.04
RUN uname -a
RUN cat /etc/lsb-release
ENV DEBIAN_FRONTEND="noninteractive"
RUN apt-get update && \
apt-get install -y \
openjdk-11-jdk-headless \
build-essential \
@philwo
philwo / README.md
Created November 11, 2019 14:18
How to build TensorFlow 2.0 on Ubuntu 18.04 (x86_64) with Bazelisk

This is how I managed to build TensorFlow 2.0 on Ubuntu 18.04 (x86_64) with Bazelisk:

$ sudo apt update
$ sudo apt full-upgrade
$ sudo apt install curl

# Install Bazelisk.
$ sudo curl -Lo /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.1.0/bazelisk-linux-amd64
$ sudo chmod +x /usr/local/bin/bazel
#!/bin/bash
set -euo pipefail
unset IFS
args=()
found="no"
function add_env_flags() {
java_binary(
name = "repro",
main_class = "Repro",
srcs = ["Repro.java"],
)

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@philwo
philwo / net_namespace-mutex.patch
Created November 7, 2017 23:32
Experimental patch to speed up network namespace destruction under high concurrency load
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 1fe58167d39a6fb907be443765693e328a1e6b7e..506e6d32fda4ae5071fec1ea397117d161982cb4
100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -426,7 +426,9 @@ static void cleanup_net(struct work_struct *work)
* This needs to be before calling the exit() notifiers, so
* the rcu_barrier() below isn't sufficient alone.
*/
+ mutex_unlock(&net_mutex);
@philwo
philwo / BUILD
Created November 30, 2016 14:20
Bazel benchmark for sandboxing performance
# Benchmarks for sandbox performance
#
# Run with 'bazel build :gen_main' and measure the time it takes.
# Creates 15000 input files.
inputs = ["input_%s" % i for i in range(15000)]
genrule(
name = "gen_inputs",
outs = inputs,
cmd = "date | tee $(OUTS) > /dev/null",
@philwo
philwo / dashboard.py
Created November 23, 2012 07:14
Clover Grappelli Dashboard Configuration
# -*- coding: utf-8 -*-
#
# Copyright 2012 Philipp Wollermann
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#