Skip to content

Instantly share code, notes, and snippets.

View sreimers's full-sized avatar

Sebastian Reimers sreimers

View GitHub Profile
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
#include <stdio.h>
#include <signal.h>
#include <fcntl.h>
#include <errno.h>
#include <poll.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
@sreimers
sreimers / stack_traces.c
Created September 3, 2016 16:31 — forked from jvranish/stack_traces.c
An example of catching exceptions and printing stack traces in C on Windows, Linux and OS X
/* compile with:
on linux: gcc -g stack_traces.c
on OS X: gcc -g -fno-pie stack_traces.c
on windows: gcc -g stack_traces.c -limagehlp
*/
#include <signal.h>
#include <stdio.h>
#include <assert.h>
@sreimers
sreimers / CoreOs2JiffyBox.md
Created September 25, 2016 16:44 — forked from andreasheil/CoreOs2JiffyBox.md
CoreOS und JiffyBox

CoreOS und JiffyBox

JiffyBox erstellen

  1. Klick auf Neue JiffyBox erstellen
  2. Distribution ist egal (wird später überschrieben)
  3. Kennwort ist auch egal (wird ja auch überschrieben)
  4. Warten bis die JiffyBox erstellt ist
@sreimers
sreimers / README.md
Created March 9, 2017 14:32 — forked from psi-4ward/README.md
CoreOS mdadm RAID1 for ROOT

CoreOS mdadm RAID1 for ROOT

  • Setup SoftwareRAID for the CoreOS root partition without data-loss.
  • Only for ext4!
  • The Trick is to use the right volume label and fs-types :)
  • We assume CoreOS is on /dev/sdaX and the second RAID Device is /dev/sdb
  • Drawback: only / gets mirrored, Node goes down when sda fails
  1. Boot into any recovery system like Grml
  2. If not already done: install CoreOS
From 49834b7afd0fe31660108271ef7657a34caa6a6d Mon Sep 17 00:00:00 2001
From: "Alfred E. Heggestad" <alfred.heggestad@gmail.com>
Date: Sat, 7 Oct 2017 15:49:44 +0200
Subject: [PATCH] main: keep fd handlers in list
Experimental code in order to try to solve
sockets for Windows. On windows the "int fd" is actually
of type "SOCKET fd" and the range goes from 0 to very large.
ref #61
/* compile with:
on linux: gcc -g stack_traces.c
on OS X: gcc -g -fno-pie stack_traces.c
on windows: gcc -g stack_traces.c -limagehlp
*/
#include <signal.h>
#include <stdio.h>
#include <assert.h>