Skip to content

Instantly share code, notes, and snippets.

@shentonfreude
shentonfreude / dynamodb_read_backoff.py
Created December 11, 2015 17:00
Wrap boto3 dynamodb in an exponential backoff to avoid ProisionedThroughputExceededException
#!/usr/bin/env python
# An exponential backoff around Boto3 DynamoDB, whose own backoff eventually
# fails on long multipage scans. We'd like to use this as a wrapper somehow,
# see: https://gist.github.com/numberoverzero/cec21b8ca715401c5662
from time import sleep
import boto3
from boto3.dynamodb.conditions import Attr
@giantryansaul
giantryansaul / install_jupyter_notebook_on_aws.md
Created December 14, 2015 05:35
Run Jupyter from an amazon free tier AWS server

Installing Jupyter notebook to AWS

This is an early draft of this guide, which currently does not include any screenshots. I may be making a lot of assumptions about what you do or do not know in this guide and so I welcome any constructive criticism to help make it more useful. Please feel free to fork this guide and annotate it where it does not work, I would welcome any pull requests to improve this documentation.

Setup amazon linux server (free tier)

  • From Amazon's EC2 page, go to Launch Instance
  • Choose an Amazon Linux 64-bit server and continue
  • Select t2.micro (this is the free tier)
  • Continue to the Add Storage page and adjust this up to 30GB if you're so inclined (default is 8GB, which is plenty)
  • Tag your instance with a name like "notebook"
@oscarmorrison
oscarmorrison / missing-image.html
Created June 4, 2016 03:38
html backup image
<img src="img/missing-image.png" onerror="javascript:this.src='img/default.png'">
@giannisp
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active March 1, 2024 14:39
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
@ericrobskyhuntley
ericrobskyhuntley / README.md
Last active March 22, 2020 00:26 — forked from rgdonohue/README.md
Batch Geocoding Script with GeoPy
.-"-._( ) )
/ , , 66\
`======\ )_\\=\_o)=
`~~"~ `"