Skip to content

Instantly share code, notes, and snippets.

View keeth's full-sized avatar

Keith Grennan keeth

View GitHub Profile
keeth / Dockerfile
Created April 5, 2023 16:48
Multi-arch BigTable emulator docker image
View Dockerfile
FROM python:3-slim
RUN apt-get update -qqy && apt-get install -qqy curl netcat &&\
curl -o google-cloud-cli.tar.gz &&\
tar -xf google-cloud-cli.tar.gz &&\
rm google-cloud-cli.tar.gz &&\
/google-cloud-sdk/ --quiet --usage-reporting=false --screen-reader=false --command-completion=false --path-update=false &&\
/ &&\
apt-get clean
View ubuntu 22 docker user data
apt update
apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt install -y docker-ce
usermod -aG docker ubuntu
keeth / whitewater.ts
Created December 30, 2022 15:26
Scrape weather conditions from whitewater website
View whitewater.ts
import { JSDOM } from 'jsdom';
import fetch from "node-fetch";
export type WhitewaterConditions = {
weather: string;
overnightSnowCm: number;
baseTempDegC: number;
const WEB_URL = '';
keeth / index.js
Last active November 4, 2022 19:04
CSP report rate-limiting proxy (cloud function)
View index.js
const { createClient } = require("redis");
const fetch = require("node-fetch");
const TTL = 60; // seconds
const client = createClient({
url: process.env.REDIS_URL,
keeth /
Last active October 28, 2023 00:57
New Mac Setup Commands
# homebew
/bin/bash -c "$(curl -fsSL"
# bash-it
chsh -s /bin/bash
echo 'export BASH_SILENCE_DEPRECATION_WARNING=1' >> ~/.bash_profile
git clone --depth=1 ~/.bash_it
keeth / isNetworkError.js
Last active February 20, 2020 20:30
Is it a fetch network error? (for the purpose of retrying on failure).
View isNetworkError.js
github/fetch: TypeError: Network request failed
Chrome: TypeError: Failed to fetch
Firefox: TypeError: NetworkError when attempting to fetch resource.
Safari: TypeError: The Internet connection appears to be offline.
const isNetworkError = e =>
keeth /
Created October 10, 2019 21:52
Monitor packet loss to a particular host and send statistics to Cloudwatch
import threading
import time
import logging
logging.basicConfig(level=logging.INFO, format='[%(levelname)s %(asctime)s %(name)s] %(message)s')
logger = logging.getLogger('pingmon')
import boto3

Keybase proof

I hereby claim:

  • I am keeth on github.
  • I am keeth ( on keybase.
  • I have a public key ASCgC0494QvYPRo5H-dPDtqY-Z6mIsW_Z8Hk9PhsfnWhQAo

To claim this, I am signing this object:

keeth / cacti.yml
Last active September 17, 2019 02:05
Non-interactive install of Cacti 1.1.23 + Spine 1.1.23 on Ubuntu Server LTS 16.04 EC2 (via Cloud Init / Terraform)
View cacti.yml
content: |
keeth / 01-next-js.config
Last active October 27, 2021 18:37
Next.js on Elastic Beanstalk, run 'next build' or 'npm run build' from .eb-extensions
View 01-next-js.config
command: "PATH=$NODE_HOME/bin:$PATH $NODE_HOME/bin/npm run build"