Skip to content

Instantly share code, notes, and snippets.

View riskybacon's full-sized avatar

Jeff Bowles riskybacon

View GitHub Profile

Keybase proof

I hereby claim:

  • I am riskybacon on github.
  • I am riskybacon (https://keybase.io/riskybacon) on keybase.
  • I have a public key ASD28UD8EzzCEL0DqihjPp-IXU6gdg27VYK2mT4VZCeuoAo

To claim this, I am signing this object:

@riskybacon
riskybacon / watch_dir.sh
Created May 27, 2016 18:55
Watch a directory for changes to files and execute commands on events
#!/bin/bash
#
# Copyright (c) 2016 Jeff Bowles
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
@riskybacon
riskybacon / Log.h
Last active November 7, 2022 13:28
C++ Logging with NDEBUG support
#ifndef LOG_HPP_
#define LOG_HPP_
//
// Logging with the C++ builder pattern.
//
// This allows one to log the appropriate file (like stdout or stderr) using:
//
// Debug() << "Some" << "stuff" << "to log" << std::endl;
// Error() << "Print an error" << std::endl;
// Info() << "Some info" << std::endl;
@riskybacon
riskybacon / self-signed-sert.sh
Last active February 15, 2016 23:01
Creating a Certificate Authority and a Self-Signed SSL Cert
mkdir /path/to/ssl/certs
cd /path/to/ssl/certs
# Fill in with an appropriate subject line
export SUBJECT="/C=US/ST=Some State/L=Some City/CN=server.domain.name"
# Days until the certs expire. Usually 365. Put the expiration
# date on a shared calendar that will remind your team a month,
# a week and a day in advance of that expiration. Put in details
# about which cert is expiring and what the cert is used for
@riskybacon
riskybacon / simple_libuv_webserver.c
Last active August 13, 2022 16:38
A very simple libuv based web server. Requires
//
// simple_libuv_webserver.c
//
// Incredibly simple libuv web server. It's practically useless
// and only has one response: hello world
//
// The goal is to get an understanding of libuv and event-driven
// network programming in C
//
// Uses libuv-1.7.3 and http-parser-2.5.0