Skip to content

Instantly share code, notes, and snippets.

View jethrocarr's full-sized avatar

Jethro Carr jethrocarr

View GitHub Profile
#!/bin/bash -x
#
# Local startup customisations. Everything logs to syslog
#
(
exec 1> >(logger -s -t rc-local) 2>&1
# Remove the eth0 default route
/sbin/route del default eth0
@jethrocarr
jethrocarr / gist:c56cecbf111af8c29791f89a2c30b978
Last active July 30, 2017 08:04
Tiny HTTP server to respond OK on port 9000 - handy for health checks on embedded boxes!
/**
* Based on http://tinyhack.com/2014/03/12/implementing-a-web-server-in-a-single-printf-call/
*/
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/stat.h>