Skip to content

Instantly share code, notes, and snippets.

@jewzaam
jewzaam / demo-tracking.md
Created August 11, 2026 12:46
Demo Tracking - TLDR

Demo Tracking — TLDR

A shared Google Drive folder hosts demo recordings (videos, screen captures). This system watches that folder, identifies which demos haven't been viewed yet, and tracks them until watched.

How It Works

  1. Fetch — list all files in the demo folder using gws
  2. Identify unwatched — files missing viewedByMeTime in the API response have never been opened
  3. Track — unwatched demos surface in a human-readable list; watched ones move to a completed log so they're never re-raised
@jewzaam
jewzaam / ap_dir_str_notes.md
Last active October 6, 2025 13:52
AP Directory Structure Notes

Directory Structure Notes

I have one "Data" directory everything is put into. Under that I have a directory per camera. I have subdirectories for bias (if I use them) and darks and a subdirectory per telescope / lens. Inside each of the telescope / lens directories I have folders for each stage of a target's lifecycle, ordered by prefixing with a number so I can't miss a step. I use 2 digits so I could slot in something new if needed without changing anything else.

  • 00 Dark Library: special case directory at the camera level (not individual telescope / lens).
  • 10 Need Blink: anything I have not yet done a visual inspection of yet.
  • 20 Add to Data Log: I keep a spreadsheet of all the data I have with goals per filter. Adding the data to the logs after blink makes it easy to decide what I want to shoot next.
  • 30 Need FLATS: anything for which I don’t have flats. This usually happens if I have a new flat exposure time and need to take the flat darks.
  • 40 Need DARKS: anything for which I do
@jewzaam
jewzaam / grafana
Created August 12, 2020 21:02
Fire up local grafana for remote prometheus using oc to get bearer token etc.
#!/bin/bash
DEFAULT_PORT=3000
PORT=${1:-$DEFAULT_PORT}
CONTAINER_ENGINE=${CONTAINER_ENGINE:-docker}
SA_NAME=prometheus-k8s
SA_NAMESPACE=openshift-monitoring
SA_TOKEN=$(oc -n $SA_NAMESPACE sa get-token $SA_NAME)
@jewzaam
jewzaam / nmalik-prometheus.yaml
Last active July 23, 2020 16:59
install prometheus from operatorhub.io catalog source
---
apiVersion: project.openshift.io/v1
kind: Project
metadata:
name: nmalik-prometheus
---
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: operatorhubio-catalog
@jewzaam
jewzaam / alertmanager.yaml
Created June 5, 2020 17:16
example alertmanager configuration
global:
resolve_timeout: 5m
pagerduty_url: https://events.pagerduty.com/v2/enqueue
route:
receiver: "null"
group_by:
- job
routes:
- receiver: "null"
group_by:
@jewzaam
jewzaam / yaml2json
Created March 27, 2020 13:23
convert yaml to json
python -c 'import json, sys, yaml ; y=yaml.safe_load(sys.stdin.read()) ; print(json.dumps(y))'
@jewzaam
jewzaam / python-crd-rbac.py
Created March 17, 2020 21:24
Script to grant RBAC to dedicated-admins for CRDs
import re
from kubernetes import client, config
from kubernetes.client import ApiClient
# based on initial 4.3.0 installation using 3 tiers of crd name possible:
# oc get crds -o json | jq -r '.items[].metadata.name' | sed 's/.*\(\.[^.]*\.[^.]*\.[^.]*\)$/\1/g' | sed 's/^[^.]*\(\.[^.]*\.[^.]*\)/\1/g' | sort -u
RE_DENYLIST = [
r".*\.authorization\.openshift\.io",
@jewzaam
jewzaam / script
Last active August 25, 2020 12:29
info from grpc catalogsource
# Useful link for how to discover API's: https://github.com/operator-framework/operator-registry/issues/33#issuecomment-473671805
# get tools
go get github.com/fullstorydev/grpcurl/...
go install github.com/fullstorydev/grpcurl/cmd/grpcurl
# constants for what we're investigating
NAMESPACE=openshift-marketplace
LOCAL_PORT=50051
REMOTE_PORT=50051
@jewzaam
jewzaam / dump-grv
Created March 6, 2020 16:03
Dump all Group/Resource/Verb in an OCP cluster
#!/bin/bash
# /api
GROUP=""
for VERSION in `oc get --raw /api | jq -r .versions[] | sort`;
do
echo "- apiGroups:"
echo " - $GROUP"
for RESOURCE in `oc get --raw /api/${VERSION} | jq -r .resources[].name | sort`;
@jewzaam
jewzaam / gpg-sop.md
Last active October 22, 2019 18:51
sre gpg sop

6.1. GPG (PGP)

As an ops person, you need a GPG key associated with your @redhat.com email address and distributed to a public keyserver such as pgp.mit.edu.

More information on specific steps can currently be found starting here, or via a web search: https://www.gnupg.org/gph/en/manual/c14.html

If you are creating a new GPG key, make sure it's 4096 bits long. If you're sure you want to re-use an existing key, you may do so. 4096 bits is preferred,