Skip to content

Instantly share code, notes, and snippets.

View willcharlton's full-sized avatar

Will Charlton willcharlton

  • Minneapolis, MN
View GitHub Profile
@willcharlton
willcharlton / maps_url.py
Last active July 2, 2021 10:40
Python (3) snippet to generate google maps url and timezone for a given address.
#!/usr/bin/env python3
"""
So far only tested on python3 interpreter.
Given an address, this script outputs a google maps url to the address.
"""
import requests, sys, time
from urllib.parse import quote_plus
@willcharlton
willcharlton / portsweep.py
Created September 18, 2016 03:56
Multiprocessing Port Sweep
#!/usr/bin/python2
import multiprocessing
import subprocess
import os
def pinger( job_q, results_q ):
DEVNULL = open(os.devnull,'w')
while True:
ip = job_q.get()
@willcharlton
willcharlton / wsss.py
Created January 20, 2017 21:07
Monitor Exosite Murano Solution Lua Websockets
#!/usr/bin/env python
"""
A simple client program for listening to a Murano Solution Websocket.
Author: Will Charlton
Company: Exosite
Date: 01/20/2017
"""
import logging, websocket, threading, json, sys, time
@willcharlton
willcharlton / Murano_Root_CA.cer
Created September 7, 2017 04:20
Murano Root CA
-----BEGIN CERTIFICATE-----
MIIGIjCCBAqgAwIBAgIJAKfLy05oNigQMA0GCSqGSIb3DQEBCwUAMIGdMQswCQYD
VQQGEwJVUzESMBAGA1UECAwJTWlubmVzb3RhMRQwEgYDVQQHDAtNaW5uZWFwb2xp
czEQMA4GA1UECgwHRXhvc2l0ZTEMMAoGA1UECwwDT3BzMSMwIQYDVQQDDBpFeG9z
aXRlIEludGVybmFsIENBIChwcm9kKTEfMB0GCSqGSIb3DQEJARYQcm9vdEBleG9z
aXRlLmNvbTAeFw0xNjExMjIxNzM2MDBaFw0yNjExMjAxNzM2MDBaMIGdMQswCQYD
VQQGEwJVUzESMBAGA1UECAwJTWlubmVzb3RhMRQwEgYDVQQHDAtNaW5uZWFwb2xp
czEQMA4GA1UECgwHRXhvc2l0ZTEMMAoGA1UECwwDT3BzMSMwIQYDVQQDDBpFeG9z
aXRlIEludGVybmFsIENBIChwcm9kKTEfMB0GCSqGSIb3DQEJARYQcm9vdEBleG9z
aXRlLmNvbTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANnRFk1pXkXG
@willcharlton
willcharlton / mrgwjq.sh
Created April 3, 2018 19:27
Command-line wrapper for really nice Murano CLI + GWE + JQ scripting and response parsing.
#!/usr/bin/env bash
[[ -z ${1} ]] && echo "provide device id" && exit 1
function print_timestamp_stderr() {
jqq=".${1}.timestamp"
js="echo ${1} | jq -r '${jqq}'"
echo $js
ts=$(eval $js)
CMD="python -c 'from datetime import datetime as dt; print(dt.fromtimestamp(${ts}/1000000.0))'"
@willcharlton
willcharlton / pki-integration.uml
Last active December 29, 2020 16:54
Sequence diagram for becoming a CA, an IoT Platform and securely provisioning devices.
@startuml
skinparam backgroundColor Azure
skinparam sequenceMessageAlign center
skinparam NoteBackgroundColor DarkOrange
skinparam NoteBorderColor Black
skinparam NoteFontName Lucida Console
skinparam NoteFontSize 18
@willcharlton
willcharlton / pki-integration.md
Last active May 2, 2018 17:55
PKI Integration Workshop for IoT Fuse 2018.

Introduction

Welcome to the IoT Fuse 2018 workshop on PKI Integration.

The purpose of this class is to discuss and practice using tools helpful in securing devices at the transport layer. Modern IoT Platforms, such as Murano, can utilize the device's Client Certificate (public key) to authenticate and identify the connecting device.

This allows the IoT platform to utilize the asymmetric encryption methods in TLS for provisioning and identification at the connection-level.

Though it is still common, and sometimes necessary, to add a symmetric provisioning layer on top of the TLS connection (e.g. connect, retrieve auth token in a secure/trusted environment like a manufacturing facility, use token for all subsequent connections), it is often desirable and becoming more common to allow the connecting device to present its Client Cert as its identity.

@willcharlton
willcharlton / CA.md
Last active June 8, 2022 01:14
A simple flask server that functions as a very basic Certificate Authority.

Basic Certificate Authority

This is a simple server that signs CSRs and responds with the signed Client Cert.

Instructions on how to run this server:

make setup
make serve
@willcharlton
willcharlton / pki-integration-sequence-diagram.md
Last active December 29, 2020 15:25
Sequence Diagram for PKI Integration Workshop for IoT Fuse 2018.

Main Sequence Diagram

[LI

@willcharlton
willcharlton / edged
Created August 20, 2018 18:59
SysV Init Script for ExoEdge
#!/bin/bash
# SysV init script for edged
# Installation:
# 1. cp edged /etc/init.d/
# 2. chmod 755 /etc/init.d/edged
# 3. chown root:root /etc/init.d/edged
# 4. update-rc.d edged defaults 90 90