Skip to content

Instantly share code, notes, and snippets.

View josephlewis42's full-sized avatar

Joseph Lewis III josephlewis42

View GitHub Profile
@josephlewis42
josephlewis42 / stackdriver-faker.js
Created May 4, 2018 16:09
Create fake HTTP style logs to test Stackdriver using Google Cloud Functions
/**
Copyright 2018 Google LLC.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
// Compile with: gcc prog.c -lpthread
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
const int NUM_THREADS = 5;
// typically you'd set this to whatever your real work is
const int num_digits = 10;
const int digits[num_digits] = {1,2,3,4,5,6,7,8,9,10};
@josephlewis42
josephlewis42 / redact.py
Created September 12, 2015 18:08
A first pass redaction script for basic information
#!/usr/bin/env python3
'''redact.py
A very dumb redaction script that will remove basic versions of the following:
- Email addresses
- Links
- US city/state/zip combinations
- US phone numbers
- pure www.blah.com version sites
@josephlewis42
josephlewis42 / webserver.py
Created September 12, 2015 18:00
A simple python HTTP webserver that displays and reads a form
#!/usr/bin/python
import SimpleHTTPServer
import SocketServer
import logging
import cgi
import sys
# we choose where the server will listen, in this case http://localhost:8001