Skip to content

Instantly share code, notes, and snippets.

@lhuard1A
lhuard1A / sleep-pod.yaml
Created November 19, 2015 16:30
Sleep POD manifest file
apiVersion: v1
kind: Pod
metadata:
name: archlinux-sleep
spec:
containers:
- name: sleep
image: l3n41c/archlinux
args:
- sleep
@lhuard1A
lhuard1A / tcp_keepalive.c
Created November 19, 2015 16:27
TCP keepalive test
# /*
this_md5="$(md5sum < "$0" | cut -d' ' -f1)"
last_md5="$(readelf -p SOURCE_FILE_HASH "${0%.c}" 2>/dev/null | awk '/\[ *0\]/ { print $3 }')"
if [ "$this_md5" != "$last_md5" ]; then
gcc -pipe -Wall -Wextra -std=gnu11 -g -march=native -O3 -DTHIS_MD5="\"$this_md5\"" -o "${0%.c}" "$0" ||
exit 1
fi
exec "${0%.c}" "$@"
exit 1
# */
#!/bin/bash
rm -f /tmp/concurrent_docker_pulls-*
declare -a childPid
readonly nbConcurrentPulls=30
for i in $(eval echo "{1..$nbConcurrentPulls}"); do
docker run l3n41c/test-$i > /tmp/concurrent_docker_pulls-$i 2>&1 &
childPid[$i]=$!
done
@lhuard1A
lhuard1A / core.go
Created September 2, 2015 16:30
How to create a GO program that cores…
package main
import (
"fmt"
)
// #include <stdlib.h>
// #include "signal.h"
import "C"
@lhuard1A
lhuard1A / remove_vxlan.sh
Created January 8, 2015 10:39
VxLAN setup
#!/bin/sh
iptables -w -t nat -D POSTROUTING -o ens192 -j MASQUERADE ! -d 192.168.0.0/16
ip route del 192.168.0.0/16 dev br0
ip addr del dev br0 192.168.$NUM_MACHINE.1/24
ip link set dev vxlan0 down
brctl delif br0 vxlan0
ip link set dev br0 down
brctl delbr br0
ip link delete vxlan0 type vxlan