Skip to content

Instantly share code, notes, and snippets.

Daniel Miller millerdev

Block or report user

Report or block millerdev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@millerdev
millerdev / steps.md
Last active Sep 10, 2018
Update to new version of PostgreSQL in docker
View steps.md

Upgrade to new version of Postgres in Docker

This example upgrades PostgreSQL 9.4 to 9.6

See also https://github.com/docker-library/postgres/issues/37#issuecomment-277621597

Note: you will need compatible pg_dumpall and psql binaries in your path (outside of docker), probably at least at the version you're migrating from. If you don't have those on your local machine, you can use the one in the docker container. Something like this

@millerdev
millerdev / bucket_domains.py
Last active Mar 27, 2019
Categorize CommCare HQ domains needing couch -> sql migration of forms and cases
View bucket_domains.py
#!/usr/bin/env python
# coding: utf-8
"""
Categorize CommCare HQ domains needing couch -> sql migration of forms and cases
This script requires a domains.csv file, which can be obtained by following
these steps:
1. Download Excel file containing domains using CouchDB for forms and cases
from https://www.commcarehq.org/hq/admin/domains/?es_use_sql_backend=F
@millerdev
millerdev / delete_gmail.py
Last active Jul 1, 2019
Permanently bulk-delete messages from gmail
View delete_gmail.py
#! /usr/bin/env python3
"""Permanently delete messages from Gmail
WARNING: THIS SCRIPT CAN DO GREAT DAMAGE TO YOUR GMAIL ACCOUNT.
USE AT YOUR OWN RISK!
Setup guide:
1. Create and activate a new virtualenv with Python 3
@millerdev
millerdev / rm-future.py
Last active Aug 23, 2019
Remove __future__ imports from Python files
View rm-future.py
#! /usr/bin/env python
"""Remove __future__ imports from Python files
Acts on *.py files in the current directory and all subdirectories.
Only removes lines in which all imported names are in KNOWN_FUTURES.
Public URL of this script:
https://gist.github.com/millerdev/f71648c1a9690cfca7c8b7c049867cfc
"""
View sentry-events.py
#! /usr/bin/env python
"""Download events form Sentry as CSV
https://gist.github.com/millerdev/3d0a541f90b9817c3be5dd9bffed288e
"""
import sys
import csv
from argparse import ArgumentParser
import requests
You can’t perform that action at this time.