Skip to content

Instantly share code, notes, and snippets.

View omad's full-sized avatar

Damien Ayers omad

View GitHub Profile
@omad
omad / pod-config.yaml
Last active March 30, 2021 23:59
Kubernetes: Prototype for killing hung pods in a compute Job
apiVersion: v1
kind: Pod
metadata:
labels:
test: liveness
name: liveness-exec
spec:
# Don't recreate the pod, if it was hung, we want it gone.
restartPolicy: Never
containers:
@omad
omad / find-missing-tiffs.py
Created September 24, 2021 02:38
Scan for missing Data files in S3
#!/usr/bin/env python3
#
# Generate an inventory dump with:
# print(entry)
# s3-inventory-dump --prefix baseline | tqdm > baseline-inventory.txt
import dawg
from tqdm import tqdm
from pathlib import Path
import sys
@omad
omad / environment.yaml
Created October 14, 2022 05:42
Libs for DEA Python Environment
name: dea-env
channels:
- conda-forge
dependencies:
## Python
- python=3.8
## Necessary CLI Tools
## DEA Critical Python Libraries and Tools
@omad
omad / README.md
Last active November 18, 2022 05:39
Open Data Cube PostgreSQL Database Schema

Run SchemaSpy to generate database table diagrams

Using Docker

docker run -it --rm -v "$PWD:/output" --network="host" schemaspy/schemaspy -u dra547 -host localhost -port 15432 -db datacube -t pgsql -schemas agdc,cubedash -norows -noviews -pfp -imageformat svg

If SchemaSpy is downloaded Locally

java -jar schemaspy-6.1.0.jar -o . -u dra547 -host localhost -port 15432 -db datacube -t pgsql -dp postgresql-42.5.0.jar -s agdc -norows -noviews
@omad
omad / click_experiment.py
Created November 16, 2023 01:29
Experiments with Click arguments nargs
import click
@click.command()
@click.argument("uri", type=str, nargs=-1)
@click.argument("product", nargs=1, required=False)
def cli(uri, product):
print(f"{repr(uri)}")
print(f"{repr(product)}")