Skip to content

Instantly share code, notes, and snippets.

View tomharvey's full-sized avatar
💭
🎩💾🚂

Tom Harvey tomharvey

💭
🎩💾🚂
View GitHub Profile
@tomharvey
tomharvey / devcontainer.json
Created February 17, 2024 09:29
Python AWS CDK Development Environment for VSCode
{
// Give this a name that is useful to you. This will be shown in the VS Code
// Maybe use your app name, your company name or something else that makes sense to you.
"name": "My awesome developement environment",
// This specifies that we want to use a pre-built Python 3.11 container
// which is based on the Debian Bullseye OS.
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
// The features are pre-installed capabilities that you can use in your development environment:
"features": {
import boto3
s3_client = boto3.client('s3')
def is_bucket_empty(bucket_name):
try:
response = s3_client.list_objects(
Bucket=bucket_name,
MaxKeys=1,
@tomharvey
tomharvey / Vagrantfile
Last active January 25, 2022 22:13
A Vagrantfile to start an Ubuntu Docker Host with the docker socket exposed on 192.168.56.10:2375
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
HOSTNAME='dockerhost.local'
FROM ubuntu:focal
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential libreadline-dev curl unzip git libssl-dev libz-dev
RUN curl -R -O http://www.lua.org/ftp/lua-5.3.5.tar.gz && \
tar -zxf lua-5.3.5.tar.gz && \
cd lua-5.3.5 && \
make linux test && \
@tomharvey
tomharvey / shoryuken.config
Last active August 23, 2019 13:40
File to start shoryuken in AWS Beanstalk environment - Puma with Ruby 2.5.
# .ebextensions/shoryuken.config
# Based on the conversation in https://github.com/phstc/shoryuken/issues/48
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_shoryuken":
mode: "000777"
content: |
APP_DEPLOY_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_deploy_dir)
LOG_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_log_dir)
PID_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_pid_dir)
@tomharvey
tomharvey / base-network.cform
Created July 26, 2016 14:23
cloud formation file to create the base services required for AWS work.
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Underlying VPC config and shared infra support services",
"Parameters" : {
"SSHLocation" : {
"Description" : "IP Address allowed to SSH into the bastion server",
"Type" : "String",
"MinLength" : "9",
+// Description:
+// Gives you a Tom style motivation
+//
+// Dependencies:
+// None
+//
+// Configuration:
+// None
+//
+// Commands:
@tomharvey
tomharvey / gist:7236167
Created October 30, 2013 16:59
Excessive list of units
pieces
barrels
british thermal unit
carat
centigram
centimeters
clean yield Kilogram
content kilogram
content tons
cubic centimeters