Skip to content

Instantly share code, notes, and snippets.


Clay Smith smithclay

View GitHub Profile
smithclay / rinkelby
Created Oct 16, 2017
rinkelby faucet
View rinkelby
smithclay / faucet.txt
Created Sep 3, 2017
View faucet.txt
smithclay /
Created Jul 28, 2017
Recipe for Getting Strange Binaries Running in AWS Lambda

Recipe for running strange binaries in AWS Lambda

In general, the command ldd and the environment variable LD_LINKER_PATH is your best friend when running new, untested binaries in Lambda. My process (which I want to get around to automating one day, maybe using Packer), goes like this:

  1. Run an EC2 instance with the official AWS Lambda AMI.
  2. Get binary you want to run in AWS Lambda running on the instance (either by installing from a package manager or compiling). 
  3. Run ldd -v ./the-binary. Note all of the shared libraries it requires. You’ll need to remember these.
  4. Copy the binary to your local machine. Upload the binary with your AWS Lambda function code that runs the ldd command inside the handler function using the process execution library from your language of choice. In node, this works just fine: console.log(require('child_process').execSync('ldd -v ./the-binary'))
  5. Note any shared libraries that are missing in the function output. Copy those over from the EC2 instance to a direct
smithclay /
Created Jul 19, 2017
Multi-Cloud New Relic Blog Post: Terraform Configuration of AWS, Azure and GCP Load Balancers with Instance Groups (Autoscaling enabled)
variable "aws_region" {
description = "EC2 Region for the VPC"
default = "us-west-2"
variable "aws_availability_zones" {
default = "us-west-2a,us-west-2b,us-west-2c"
description = "List of availability zones, use AWS CLI to find your "
smithclay / index.js
Created Jun 16, 2017
"Hello World" AWS Lambda + Terraform Example
View index.js
// 'Hello World' nodejs6.10 runtime AWS Lambda function
exports.handler = (event, context, callback) => {
console.log('Hello, logs!');
callback(null, 'great success');
smithclay /
Created May 24, 2017
Concurrently execute a lambda function for warming purposes
# This attempts to concurrently execute an AWS Lambda function. WIP.
# After execution, roughly NUM_EXECUTION containers will be ready
# to accept requests.
# More advanced strategies are out there. Check out @lambdacult on twitter, for example.
smithclay /
Last active Nov 10, 2019
ubuntu bootstrap for user mode linux: minimal
# This script creates a user-mode linux machine based on Ubuntu.
# Created by Clay Smith, May 2017
# based on:
# and
set -x
smithclay /
Created Sep 15, 2015
Mac OS X Defaults, September 2015
#!/usr/bin/env bash
# ~/.osx —
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
smithclay /
Created Jul 15, 2015
keybase verification

Keybase proof

I hereby claim:

  • I am smithclay on github.
  • I am smithclay ( on keybase.
  • I have a public key whose fingerprint is B53D 2B26 60A5 DF27 33B3 A5D0 C707 37A6 5A56 EC97

To claim this, I am signing this object: