Skip to content

Instantly share code, notes, and snippets.

View shanemcd's full-sized avatar

Shane McDonald shanemcd

View GitHub Profile
@shanemcd
shanemcd / Dockerfile
Created April 19, 2018 16:43
Example showing how to run a Node Server using the Node SCL
FROM centos:7
RUN yum install -y centos-release-scl-rh
RUN yum-config-manager --enable rhel-server-rhscl-7-rpms
RUN yum install -y scl-utils rh-nodejs8
RUN curl -Lo app.js https://gist.githubusercontent.com/conifertw/3719759/raw/9031d13eef36686f39b1e453dfc6529064cbaf61/gistfile1.js
RUN sed -i 's/127.0.0.1/0.0.0.0/g' app.js
@shanemcd
shanemcd / scratch_server.go
Created July 15, 2023 20:10 — forked from jschaf/scratch_server.go
A Go web server from scratch using syscalls
package main
// Simple, single-threaded server using system calls instead of the net library.
//
// Omitted features from the go net package:
//
// - TLS
// - Most error checking
// - Only supports bodies that close, no persistent or chunked connections
// - Redirects
@shanemcd
shanemcd / ssh_config_inventory.py
Created April 29, 2025 12:21
Dynamic Ansible inventory plugin for ssh config
# Drop in ~/.ansible/plugins/inventory/ssh_config_inventory.py
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import os
import subprocess
from ansible.plugins.inventory import BaseInventoryPlugin
from ansible.errors import AnsibleParserError
#!/bin/env bash
if [ $# -lt 1 ]; then
echo "Usage:"
echo " autoreload directory"
exit 1
fi
last_reload=`date +%s`