Skip to content

Instantly share code, notes, and snippets.

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

Tom Harvey tomharvey

💭
🎩💾🚂
View GitHub Profile
@andrewodri
andrewodri / Dockerfile
Last active July 3, 2024 21:35
Connect Fargate instance to SSM Session Manager
FROM debian:10-slim
RUN apt-get update -y && \
apt-get install -y awscli curl gnupg && \
apt-key adv --fetch-keys "https://nginx.org/keys/nginx_signing.key" && \
echo "deb http://nginx.org/packages/debian buster nginx" > /etc/apt/sources.list.d/nginx.list
RUN curl --silent --show-error --location --output /tmp/amazon-ssm-agent.deb "https://s3.us-east-1.amazonaws.com/amazon-ssm-us-east-1/latest/debian_amd64/amazon-ssm-agent.deb" && \
dpkg -i /tmp/amazon-ssm-agent.deb
@bensie
bensie / imagemagick.bash
Last active June 24, 2024 12:21
ImageMagick Static Binaries for AWS Lambda
#!/usr/bin/env bash
# Must be run on an Amazon Linux AMI that matches AWS Lambda's runtime which can be found at:
# https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html
#
# As of May 21, 2019, this is:
# Amazon Linux AMI 2018.03.0 (ami-0756fbca465a59a30)
#
# You need to prepend PATH with the folder containing these binaries in your Lambda function
# to ensure these newer binaries are used.
@josiahcarlson
josiahcarlson / async_http_client.py
Created December 25, 2011 23:24
Simple asyncore/asynchat derived http client
'''async_http_client.py
Originally written December 25, 2011 by Josiah Carlson
Released into the public domain.
This simple asynchat.async_chat subclass offers the ability to connect to http
servers to download files. The example download_file() function shows how to
use the class to download files from a remote webserver, automatically
handling redirects and errors.
@netj
netj / memusg
Last active June 25, 2024 17:39
memusg -- Measure memory usage of processes
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2010-08-16
############################################################################
# Copyright 2010 Jaeho Shin. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
@bkeepers
bkeepers / application.js
Created March 3, 2010 18:35
Get timezone offset from the browser and use it for timezones in Rails
jQuery(function() {
$.cookie('tz', (new Date()).getTimezoneOffset());
});