Skip to content

Instantly share code, notes, and snippets.

View bebehei's full-sized avatar

Benedikt Heine bebehei

View GitHub Profile
@kishmakov
kishmakov / Makefile
Last active May 9, 2024 14:35
Shared libraries and Address Sanitizer (ASAN)
SAN_CMP := -fno-omit-frame-pointer -fsanitize=address
SAN_STAT := -static-libstdc++ -static-libasan
BIN_CMP := -std=c++11 -c -I. main.cpp -O -g3 -o main.o
LIB_CMP := -std=c++11 my.cpp -o libmy.so -shared -fPIC -g3
RUN := LD_LIBRARY_PATH=. ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer)
PRELOAD := LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.1
lib-gcc:

Experimental Docker Libnetwork DHCP Driver

The DHCP driver is intended for users to be able to integrate Docker IP address management with their existing IPAM strategies that use DHCP for dynamic address assignment. DHCP enables users to allocate addresses in an organized fashion that will prevent overlapping IP address assignment by associating a unique MAC address from the container eth0 Ethernet interface to an IP address as determined by the DHCP pools defined in the DHCP configuration.

This driver only provides the DHCP client functionality. It does not include a DHCP server. The default driver offers single-host IPAM or for distributed multi-host orchestrated IPAM see the libnetwork overlay driver.

Getting Started

@JadenGeller
JadenGeller / TupleMacro.c
Last active February 26, 2018 10:39
C Macro Tuple
#include <stdio.h>
#define LEFT_(X, Y) X
#define LEFT(T) LEFT_ T
#define RIGHT_(X, Y) Y
#define RIGHT(T) RIGHT_ T
#define SUM(TUPLE) LEFT(TUPLE) + RIGHT(TUPLE)
int main(int argc, char *argv[]) {
printf("%i\n", SUM((3, 4))); // -> 7
@bebehei
bebehei / siteadd.sh
Created May 4, 2014 14:51
LNMP dedicated user per webiste
#!/bin/bash
# siteadd.sh script is used to add Unix-Accounts with surrounding setup for
# php-fpm, mysql and nginx to host a websie with a dedicated user-account
die(){
echo -e "\033[31m${@}\033[0m" >&2;
exit 1;
}
anonymous
anonymous / night-before-opsmas.txt
Created December 24, 2013 07:19
Twas the night before Opsmas..
'Twas the night before Christmas, when all through the racks
Not a server was alerting, not even Compaqs.
The backups were written to tapes with care
In hopes that later the data would be there.
The machines were nestled all snug in their sleds
Whilst visions of vengeance danced in their heads;
And oncall in his three-wolf and I in my rack.
Had just settled down for some syn and some ack.
@vodik
vodik / SOS.md
Last active May 8, 2024 18:21
_Never_ -Sy when installing!

Once upon a time there was a user that wanted to install firefox.

The user tried to do pacman -S firefox but it didn't work. The all mighty pacman reported that firefox-3.2.4-1.i686.pkg.tar.gz could not be found on his mirror. So the user tried pacman -Sy firefox. It worked and the user rejoiced since he could once again go and troll /h/.

But all was not good. The user had made a grave error!

See, when the user told the almighty pacman to -Sy firefox, pacman did

@vasi
vasi / speed.py
Created October 30, 2012 02:52
Test fetching IMAP messages in parallel
import re
import logbook
from pprint import pprint
import time
import sys
import threading
import Queue
import multiprocessing
@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active May 21, 2024 06:35
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup