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 / 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.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 / 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
@willcharlton
willcharlton / mqtt_client_app.c
Last active January 28, 2019 21:46
TI CC3220SF-LAUNCHXL Connector to Murano MQTT
/*
* Copyright (c) 2016, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
@willcharlton
willcharlton / rpi-interfaces-wpa-supplicant
Created February 28, 2019 16:16
The `/etc/network/interfaces` file of a raspberry pi to configure `wlan0` to use the `wpa_supplicant.conf` file.
# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto wlan0
allow-hotplug wlan0
@willcharlton
willcharlton / aws-iot-mosquitto
Created May 28, 2019 19:40 — forked from lashex/aws-iot-mosquitto
Example Mosquitto CLI pub/sub using AWS IoT MQTT endpoint
The Mosquitto Pub CLI
$> mosquitto_pub --cert thing-0.pem --key thing-0.prv --cafile aws-iot-rootCA.crt -h XXXXXXXXYYYYY.iot.us-west-2.amazonaws.com -p 8883 -t 'test/thing' -m "Hello from Mosquitto"
The Mosquitto Sub CLI
$ mosquitto_sub --cert thing-0.pem --key thing-0.prv --cafile aws-iot-rootCA.crt -h XXXXXXXXYYYYY.iot.us-west-2.amazonaws.com -p 8883 -t 'test/+'
@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