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
| ##### Get values by pattern and group by | |
| export keys="" | |
| for key in $(redis-cli -h hostname.com keys "pat:tern:*"); do | |
| keys="$keys"" ""$key" | |
| done | |
| redis-cli -h hostname.com mget $(echo $keys) > values_1405 | |
| cat values_1405 | sort | uniq -c |
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
| ##### single column strings CSV to comma-separated interges list (example: export data from DB and use as "in" clause in different DB) | |
| arr = [] | |
| data = File.readlines 'drivers_202002161000.csv' | |
| #data.kind_of?(Array) | |
| data.each do |el| | |
| arr.push el.to_i | |
| end | |
| str = arr.join(',') |
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 local images sorted by size: | |
| docker image ls | grep -v 'TAG' | tr -d 'MB' | tr -d 'GB' | sort -k 7 | |
| ### Remove all containers, including stopped ones | |
| docker ps -aq | xargs docker container rm |
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
| Title: Postgres DDL blocking and non-blocking operations | |
| URL: https://leopard.in.ua/2016/09/20/safe-and-unsafe-operations-postgresql#.YmRFt5NByDU | |
| ============================================================ | |
| Title: Postgres size functions (and many others) | |
| URL: https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-ADMIN-DBSIZE | |
| ============================================================ |
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 | |
| # This should run after executing tests with coverage, for example: | |
| # APP_ENV=test APP_CONF_PATH=$(pwd)/conf ginkgo -r --race -compilers=2 --cover --coverprofile=coverage.txt --coverpkg=<path-to-package1>,<path-to-package2> | |
| echo "mode: atomic" > ./output.txt; find . -name coverage.txt -exec grep -h -v "^mode" {} + >> ./output.txt | |
| go tool cover -func=./output.txt | |
| go tool cover -html=./output.txt |
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
| #/bin/bash | |
| ORGANIZATION=$1 | |
| BRANCH_NAME=$2 | |
| TOKEN=$3 | |
| FIRST_URL="https://api.github.com/orgs/$ORGANIZATION/repos?page=1" | |
| TEMP_FILE="./all_repos.txt" | |
| RESULTS_FILE="./repos_with_"$BRANCH_NAME".txt" |