- (Maybe/Probably) Suspend boost reporting job
-
ut site in maintenance mode(?) - Manual run of boost etl job
- Switch Production k8s endpoints to
boost02- external-reporting-compute-database
- external-reporting-database
| -- other generic comment | |
| /* :meta | |
| foo: bar | |
| columns: | |
| - foo | |
| - bar | |
| - quux | |
| - quuux | |
| params: |
| select c.table_schema | |
| , c.constraint_name | |
| , c.table_name | |
| , k.column_name | |
| , u.table_schema as foreign_table_schema | |
| , u.table_name as foreign_table_name | |
| , u.column_name as foreign_column_name | |
| from information_schema.table_constraints as c | |
| join information_schema.key_column_usage as k | |
| on c.constraint_name = k.constraint_name |
The idea here is you set yourself up with an entry in your ~/.ssh/config with a LocalForward to the Postgres port on the host you want to connect to. (The SSH connection itself might be to the same host or a remote bastion. LocalForward is a honey badger.) Then, create or add to your ~/.pg_service.conf file with a service name that matches the host name from your SSH config. See examples below, and just edit the included dummy values to suit your environment. Note that matching the host names between the two config files is the key to making this work nicely.
(Which port you choose to forward is arbitrary, but it's a good idea NOT to use the default Postgres port of 5432, to avoid any potential conflict with any Postgres service you might have running locally.)
Once you have that configured, the teeny but mighty bash script below will create an [auto-closing SSH tunnel](https://www.g-loaded.e
Code from google/open-location-code is not usable in my environment. So I made a simple wrapper.
- npm open-location-code is a bit outdated
- there is also janne/pluscodes is fairly awesome - has one dependency, doesn't do grid refinement to 11 digits
encode and decode are only methods in index. They ruturn false instead of throwing error
yarn add gist:70446302e9c04d29713c96cb94c55e3f
| import os | |
| from argparse import ArgumentParser | |
| from pathlib import Path | |
| import records | |
| from dotenv import load_dotenv | |
| from sh import psql | |
| from sqlalchemy.exc import ProgrammingError | |
| load_dotenv() |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Ansi 0 Color</key> | |
| <dict> | |
| <key>Alpha Component</key> | |
| <real>1</real> | |
| <key>Blue Component</key> | |
| <real>0.0</real> |
| import responder | |
| api = responder.API() | |
| @api.route("/") | |
| def hmm(req, resp): | |
| resp.media = {"status": "ok"} | |
| #!/usr/bin/env bash | |
| # invoke with `watch -n 5` | |
| hostname | |
| uptime | cut -d ',' -f 4-6 | |
| free -h | |
| echo '' | |
| psql -U postgres -c 'select count(*) as conns, state from pg_stat_activity group by 2;' | |
| psql -U postgres -c 'select pid, locktype, mode, granted from pg_locks where not granted;' |
| #!/bin/bash | |
| # get name from namer, copy to clipboard and echo to console | |
| http -b https://us-central1-whereami-map.cloudfunctions.net/namer | tr -d '\n' |pbcopy | |
| pbpaste | |
| echo |