Skip to content

Instantly share code, notes, and snippets.


David Karchmer dkarchmer

View GitHub Profile
dkarchmer /
Last active Aug 17, 2020
Instructions for Installing a CentOS v7.7 based image with Docker and Docker Compose

CentOS 7.7 with Docker Compose

Assumes using CentOS-7-x86_64-Minimal-1908.iso as image but any CentOS 7.7 image should be fine. Installing Docker, Docker Compose with the AWS Client to access ECR images

Install CentOS

After installing CentOS image,

sudo yum check-update
dkarchmer /
Last active Aug 17, 2020
Installing Docker Compose on Ubuntu to run from ECR docker repos

Ubuntu 19.10 with Docker Compose

Installing Ubuntu 19.10 with latest docker, docker-compose.

Install Ubuntu

Install latest Ubuntu 19.10 and then upgrade to latest

sudo apt-get update
dkarchmer / WSL2-Ubuntu.txt
Last active Dec 15, 2021
Windows 10 WSL Ubuntu Setup
View WSL2-Ubuntu.txt
sudo apt-get update
sudo apt-get upgrade
# Store Github credentials
git config --global credential.helper store
git clone ...
# Install Python
sudo apt-get install -y python
sudo apt-get install python3.8
dkarchmer /
Last active Mar 2, 2021
Windows 10 Setup


  • Docker for Windows
  • Visual Studio Code (or IDE of choice), but VSCode supports WSL2 very well.
  • Github Desktop (optional)
  • Evernote (Personal)
  • Slack App, Notion App, Twist App (optional)
  • Chrome and/or Firefox and set as default

Choco should be used to manage packages

dkarchmer / init.el
Created Oct 30, 2019
Emacs .emacs.d/init.el file with Python configuration
View init.el
;; .emacs.d/init.el
;; ===================================
;; MELPA Package Support
;; ===================================
;; Enables basic packaging support
(require 'package)
;; Adds the Melpa archive to the list of available repositories
(add-to-list 'package-archives
dkarchmer / 8kbuttons.ino
Last active Feb 20, 2019
PODuino with multi-LED button
View 8kbuttons.ino
/* This project implements a multi-color (LED) button with the following specification:
* - Button starts as off, representing everything is good
* - A click changes the button to green and represents a request to start filling up a new order
* - The warehouse control can send a "receive" event, which turns color to light blue
* - Clicking button for more than 3sec resets button to off
* - Double click sets the button to red
dkarchmer /
Last active Feb 8, 2019
Configuration Instructions for an IOTile Access Point

IOTile Access Point

Configuration Instructions


  • bled112 dongle on your machine
  • Create a Python virtual environment (Python 2.7 or 3.6)
  • Install:
import argparse
import time
import sys
from iotile.core.hw import HardwareManager
def build_parser():
parser = argparse.ArgumentParser(description="Print broadcast readings from a specific device")
parser.add_argument('-d', '--dev', type=lambda x: int(x, 0), help="Optional, the UUID of the device you want to see broadcasts from (0x21 for example)")
parser.add_argument('-i', '--interval', type=float, default=1.0, help="The minimum interval in seconds between two reported readings (only applies when -d is given), defaults to 1s")
dkarchmer /
Last active Jan 31, 2019
IOTile Core Tools Tutorial

IOTile Core Tools


The public facing documentation for the IOTile Core Tools is, but things change a little when you have access to a real device.

With a BLED112 dongle, and access to the proper packages, you can communicate with a real device.

After installation, the iotile operations can be run from the OS command-line, or by using the IOTile Shell.

dkarchmer /
Created Sep 7, 2017
Serverless function snippet to return an S3 file
def get(event, context):
response = _get_error_responce('Incorrect URL format: Use /foobar/<a>/<b>/?type=<url/file>')
if 'queryStringParameters' in event and 'pathParameters' in event:
if event['pathParameters'] and 'a' in event['pathParameters'] and 'b' in event['pathParameters']:
a = event['pathParameters']['a']
b = event['pathParameters']['b']