Skip to content

Instantly share code, notes, and snippets.

@mikehikes
mikehikes / add_qemu_for_aarch64_lambda_funcs_fedora_35.sh
Created November 2, 2021 14:48
Bash script to install dependencies to compile lambda functions for aarch64 in an x86_64 environment
#!/bin/bash
# AWS Lambda can now compile functions to run on the aarch64 architecture.
# However, to build the functionally locally on an x86_64 processor, qemu and
# various dependencies must be installed to emulate the Graviton 2 processor
# your x86 machine.
# The following script -> which requires sudo permissions <- installs these dependencies
# as tested on Fedora 35.
@mikehikes
mikehikes / README.md
Created November 10, 2021 16:32
Example of Golang custom AWS lambda runtime

Golang custom AWS lambda runtime

This gist has an example SAM template.yaml file and a main.go to demonstrate how to write Golang binaries that operate within the AWS Lambda Custom Runtime environment.

From the AWS documentation on custom runtimes, all the examples in each respective shell script/language are provided as non-terminating loop-type processes. The reason why this is the case is quite unclear. When writing a non-custom runtime function, such as a python program in a "regular" lambda function, the function is written to run and then terminate.

When writing a custom runtime, however, the script or binary should be written to run in perpetuity, continuously checking the next invocation for a new event. If a new event is not available, then the program execution is frozen - and then restarted upon the invocation of a new lambda function.

@mikehikes
mikehikes / environment.yml
Created April 8, 2022 13:12
An environment.yml file for tensorflow on the apple m1 which can run the TF object detection API
# Known to work on Apple M1 (as of April 2022)
# Creates environment known as tf-m1
# Includes jupyter-lab (which is not necessarily needed - added as convenience)
# Config file intended to be loaded via miniconda
# Satisfactory configuratioin to implement https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf2.md
# Prerequisites: https://developer.apple.com/metal/tensorflow-plugin/
# To create new environment with miniconda: conda env create -f environment.yml
# Note 1: no guarantee that versions in this file are the latest and greatest versions
# Note 2: Change the USERNAME prefix at the end of the file to whichever user account in MacOS you are using.
@mikehikes
mikehikes / gist:a805c915d946157bd3a33c69028f4557
Created December 1, 2024 14:49
marta.fail system prompt - 20241201
# MARTA Alert Processing System
You are processing transit service alerts from MARTA (Metropolitan Atlanta Rapid Transit Authority). Your role is to convert unstructured alert text into structured JSON data ONLY.
## Primary Rules
IMPORTANT: ONLY OUTPUT JSON DATA - NO EXPLANATORY TEXT OR MARKDOWN
1. Output ONLY valid JSON - no explanatory text
2. Use ONLY the reference data provided in this prompt