This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # List all the enabled Google Cloud APIs | |
| gcloud services list --enabled |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This command keeps the last 5 revisions and deletes the rest. | |
| # --quiet - do not prompt for (Y/n) | |
| # Replace <name> with the name of of the Cloud Run service | |
| # | |
| # Depending on the count of unused revisions this operation will | |
| # take a few minutes to complete. | |
| gcloud run revisions list --service=<name> --format="value(metadata.name)" | tail -n +6 | xargs -n1 gcloud run revisions delete --quiet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Drop all connections except the one running this query | |
| SELECT pg_terminate_backend(pid) | |
| FROM pg_stat_activity | |
| WHERE datname = 'measure' | |
| AND pid <> pg_backend_pid(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| git describe --tags --abbrev=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rclone mount <remote-name>:<bucket-name> <local-dir> \ | |
| --daemon \ | |
| --devname <device-name> \ | |
| --allow-other \ | |
| --vfs-cache-mode full \ | |
| --vfs-cache-max-size 10G \ | |
| --log-level INFO \ | |
| --log-file /tmp/rclone-vfs-remote-mount.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # "test" is the input | |
| printf "test" | openssl dgst -sha256 -binary | openssl base64 | |
| # output - n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| brew list --installed-on-request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # syntax | |
| # gh repo view <repo> --json createdAt | |
| # example | |
| gh repo view measure-sh/measure --json createdAt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -------------- | |
| -- query cache | |
| -------------- | |
| -- see full details of query cache entries | |
| SELECT | |
| substring(query, 1, 30), | |
| result_size, | |
| tag, | |
| stale, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # syntax - assuming a `docker-compose.yml` file is present at $(PWD) | |
| docker compose logs --no-log-prefix -f <compose-service-name> | agrind '(*) AND NOT ("string-one" OR "string-two")' | |
| # example | |
| docker compose logs --no-log-prefix -f my-compose-service | agrind '(*) AND NOT ("ping" OR "traces export")' | |
| # combine angle grinder with tailspin | |
| docker compose logs --no-log-prefix -f my-compose-service | agrind '(*) AND NOT ("ping" OR "traces export")' | tspin -ce |