Skip to content

Instantly share code, notes, and snippets.

View jasonacox's full-sized avatar

Jason Cox jasonacox

View GitHub Profile
jasonacox /
Last active June 1, 2024 06:22
Set up RaspberryPi as Network Router to Powerwall Gateway

RaspberryPi - Powerwall Router

This will set up a Raspberry Pi to connect to a Tesla Powerwall Gateway (TEG) and bridge that connection to the ethernet connected LAN.

Network Configuration

 ___________________          __________________________           _______________
[ Powerwall Gateway ]        [      Raspberry Pi        ]         [      Host     ]
[       TEG         ]  WiFi  [__________________________]   LAN   [ Linux/Mac/Win ]
jasonacox /
Created March 12, 2024 06:04
Calculate Pi to a defined number of decimal places using Archimedes method.
from decimal import Decimal, getcontext
def pi_archimedes(n):
Calculate Pi using Archimedes method with n iterations to estimate Pi.
This method approximates Pi by calculating the perimeter of a polygon inscribed
within a unit circle.
Polygon edge lengths are computed using the Pythagorean theorem and the geometry of the polygons.
The number of sides of the polygon is also doubled in each iteration, as each side of the
jasonacox / Container
Created February 24, 2024 05:52
Container Architectures

Container Architectures

List of docker / containerd architectures

Architecture Description Notes
linux/amd64 64-bit x86 architecture AMD and intel CPUs
linux/arm64 64-bit ARM architecture ARM CPUs like Apple Silicon
linux/arm/v7 32-bit ARM architecture Raspberry Pi 3/4 32-bit
linux/ppc64le 64-bit PowerPC architecture
jasonacox /
Created July 31, 2021 04:36
Python script to resize all images in a directory
# Resize Images in Directory
# Provided target frame size (TARGETX, TARGETY) this script will scan current
# directory and scale up an image (keeping same ratio) to best fit. I used
# this to fix images for a photo frame that would only scale down images but
# would not scale up.
# Jason A Cox -
# 2021 July 30
jasonacox /
Last active August 17, 2020 07:06
Travis-CI for Xcode Mac, iOS and tvOS Development using AWS S3 for Build Storage

Travis-CI for Xcode with S3

This gist explains to set up your repo to have Travis CI build your Xcode projects for Mac, iOS and tvOS development. The binaries built from one stage will not persist between stages so you will need to store any build artifacts in S3 and import them between stages.


There are a few things that you will need to do in order to use S3 with a Mac build node:

Create S3 Bucket

  • Create a IAM user with permission to access S3 bucket - example:

Keybase proof

I hereby claim:

  • I am jasonacox on github.
  • I am jasonacox ( on keybase.
  • I have a public key ASA2YKK3bHIo1ZDKge3O4uxU3aNF2DDABEGovM3lFUPfQgo

To claim this, I am signing this object: