Skip to content

Instantly share code, notes, and snippets.

Avatar
🔧
DevOps Engineer @ Workday

Eric McNiece emcniece

🔧
DevOps Engineer @ Workday
View GitHub Profile
@emcniece
emcniece / parse-crd-utilitybill.py
Created Dec 31, 2020
Parse CRD utility water bill PDF
View parse-crd-utilitybill.py
from pdfreader import SimplePDFViewer
def to_float(string):
return float(string.strip())
def extract_usage_from_pdf(file_name):
fd = open(file_name, "rb")
viewer = SimplePDFViewer(fd)
@emcniece
emcniece / simple-custom-observable.py
Last active Jun 30, 2019
Python3 RxPy 3 Custom Observable Creation Example
View simple-custom-observable.py
# Example: Custom observable creation for switchmapping.
# Library: https://github.com/ReactiveX/RxPY
# Requires: `Rx==3.0.0b4` or greater. `pip3 install --pre rx`
import rx
from rx import operators as op
import time
# Accept a value (emission), return an observable that doubles its input.
# Sleeps to simulate synchronous behaviour.
@emcniece
emcniece / docker-compose.yml
Last active Jan 7, 2019
Simple WordPress Docker Stack
View docker-compose.yml
version: '3.1'
services:
wordpress:
image: wordpress
restart: always
ports:
- 8080:80
environment:
@emcniece
emcniece / README.md
Last active Jun 19, 2018
Testing Concourse + Traefik for a text/event-stream log reading problem
View README.md

For debugging https://github.com/containous/traefik/issues/2576

Includes 2 docker-compose files: one outdated (Concourse 3.9.0, Traefik 1.5.4), the other updated (Concourse 3.14.0, Traefik 1.6.4). Both appear to work fine and not exhibit the "text/event-stream" network request problem where logs can't be displayed.

# Copy files into a directory.
# For this demo, we'll assume `contraef`.
# This directory name affects the access URL because docker-compose creates
# the stack with this name. You can change it, but watch for reoccurrences.
mkdir contraef
@emcniece
emcniece / netdata.conf
Created Apr 11, 2017
NetData Example Configuration
View netdata.conf
# netdata configuration
#
# You can download the latest version of this file, using:
#
# wget -O /etc/netdata/netdata.conf http://localhost:19999/netdata.conf
# or
# curl -o /etc/netdata/netdata.conf http://localhost:19999/netdata.conf
#
# You can uncomment and change any of the options below.
# The value shown in the commented settings, is the default value.
@emcniece
emcniece / docker-compose.yml
Last active Mar 21, 2017
Test Rgon-Proxy + Filesync
View docker-compose.yml
version: '2'
services:
nginx:
image: "nginx"
tty: true
stdin_open: true
ports:
- 80:80/tcp
- 443:443/tcp
@emcniece
emcniece / config.toml
Created Feb 25, 2017
Go-Rancher-Gen Template Tests
View config.toml
#https://github.com/CausticLab/go-rancher-gen
metadata-version = "2015-12-19"
log-level = "debug"
interval = 30
onetime = false
[[template]]
source = "/etc/rancher-gen/nginx.tmpl"
dest = "/etc/rancher-gen/nginx.conf"
check-cmd = "echo $(date)\t check >> /etc/rancher-gen/check.log"
View nginx.tmpl
# Forked from https://raw.githubusercontent.com/jwilder/nginx-proxy/master/nginx.tmpl
# For use with https://github.com/emcniece/rancher-catalog/tree/master/templates/letsencrypt-nginx-proxy/0
# This version allows Rancher itself to be available on the network, given VIRTUAL_HOST
# and VIRTUAL_PORT environment variables.
{{ $CurrentContainer := where $ "ID" .Docker.CurrentContainerID | first }}
{{ define "upstream" }}
{{ if .Address }}
{{/* If we got the containers from swarm and this container's port is published to host, use host IP:PORT */}}
View webpack.backend.config.js
var webpack = require('webpack');
var path = require('path');
var fs = require('fs');
var nodeModules = fs.readdirSync('node_modules')
.filter(function(x) {
return ['.bin'].indexOf(x) === -1;
});
module.exports = {
View gulpfile.babel.js
'use strict';
import gulp from 'gulp';
import webpack from 'webpack';
import path from 'path';
import sync from 'run-sequence';
import rename from 'gulp-rename';
import template from 'gulp-template';
import fs from 'fs';
import yargs from 'yargs';