Figure out what verion of postgres your homebrew data directory currently has:
$ cat /usr/local/var/postgres/PG_VERSION
9.6| module HashExtension | |
| def all_keys | |
| each_with_object([]) do |(k, v), keys| | |
| keys << k | |
| keys.concat(v.select { |el| el.is_a?(Hash) }.flat_map(&:all_keys)) if v.is_a? Array | |
| keys.concat(v.all_keys) if v.is_a? Hash | |
| end | |
| end | |
| def all_values_for(key) |
| #!/bin/bash | |
| # *********************************************************** # | |
| # Ideal path to minimise downtime is: | |
| # - [recommended] perform `VACUUM (VERBOSE, ANALYZE);` on db | |
| # * to improve speed of db generally | |
| # - [recommended] create manual snapshot | |
| # * to improve speed of upgrade process's automated snapshots | |
| # - put site in maintenance mode | |
| # - perform VACUUM; of postgres DB (this can be done before too but may place heavy load on db) |
| # find and replace search path in ADP dump file | |
| gunzip -3 -f adp_gamma_dump.psql.gz | |
| fgrep 'search_path' adp_gamma_dump.psql -m1 | |
| sed -i -e "s/SELECT pg_catalog.set_config('search_path', '', false)/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true)/" adp_gamma_dump.psql | |
| fgrep 'search_path' adp_gamma_dump.psql -m1 | |
| gzip adp_gamma_dump.psql |
| # helper to capture certain errors and expectation failures | |
| # and retry until timeout reached. | |
| # Idea taken from: | |
| # https://github.com/makandra/spreewald | |
| # | |
| module PatienceHelper | |
| RETRY_ERRORS = %w[ | |
| Capybara::ElementNotFound | |
| Spec::Expectations::ExpectationNotMetError | |
| RSpec::Expectations::ExpectationNotMetError |
| read AWS_ACCESS_KEY_ID ARN URL AWS_SECRET_ACCESS_KEY <<<$(kubectl --context <context> -n <namespace> get secret <secret> -o json | jq -r '.data[] | @base64d'); printf "$AWS_ACCESS_KEY_ID\n$ARN\n$URL\n$AWS_SECRET_ACCESS_KEY" |
In fee calculator app root dir create a virtual env for a specific version of python (I am using 3.8.3, latest at time of writing), and give it a name.
$ cd .../laa-fee-calcultor
| # place in ~/.pryrc | |
| if defined?(Pry) | |
| Pry.config.color = true | |
| Pry.config.prompt_name = 'Pry:' + File.basename(Dir.pwd) | |
| Pry.commands.alias_command 'wami', 'whereami' | |
| Pry.commands.alias_command 'c', 'continue' | |
| Pry.commands.alias_command 's', 'step' | |
| Pry.commands.alias_command 'n', 'next' |
Add this after github action step you want to interactively debug
- uses: actions/checkout@v3
- name: Setup tmate session