This file contains 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
lsof -p 66298 |
This file contains 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
-- If SET (or equivalently SET SESSION) is issued within a transaction that is later aborted, the effects of the SET command disappear when the transaction is rolled back. Once the surrounding transaction is committed, the effects will persist until the end of the session, unless overridden by another SET. | |
SET session_replication_role = 'replica'; | |
... | |
SET session_replication_role = 'origin'; |
This file contains 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
# https://earthly.dev/blog/convert-to-from-json/ | |
cat simple.json| jq -r '(map(keys) | add | unique) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] | @csv' |
This file contains 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
apk add --no-cache \ | |
python3 \ | |
py3-pip \ | |
&& pip3 install --upgrade pip \ | |
&& pip3 install --no-cache-dir \ | |
awscli \ | |
&& rm -rf /var/cache/apk/* |
This file contains 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
stty rows 50 cols 132 |
This file contains 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
import DataLoader from 'dataloader'; | |
import logger from '../../../logger'; | |
export const REDIS_KEY_DELIMITER = '\x1F'; // ASCII unit separator (31 in hex) | |
export const REDIS_NULL_VALUE = '\x00'; // ASCII NULL (0 in hex), value is set but it's null | |
export type RedisNullValueType = '\x00'; | |
export type DistributedDataLoaderOptions<K, V> = DataLoader.Options< | |
K, |
This file contains 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
SELECT tablename, | |
count(1) as count | |
FROM pg_indexes p | |
WHERE p.tablename not like 'pg_%' | |
GROUP BY p.tablename | |
ORDER BY p.tablename |
This file contains 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
SELECT | |
pg_terminate_backend(pid) | |
FROM | |
pg_stat_activity | |
WHERE | |
-- don't kill my own connection! | |
pid <> pg_backend_pid() | |
-- don't kill the connections to other databases | |
AND datname = 'database_name' | |
; |
This file contains 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
SELECT | |
relname as table_name, | |
pg_size_pretty(pg_total_relation_size(relid)) As "Total Size", | |
pg_size_pretty(pg_indexes_size(relid)) as "Index Size", | |
pg_size_pretty(pg_relation_size(relid)) as "Actual Size" | |
FROM pg_catalog.pg_statio_user_tables | |
ORDER BY pg_total_relation_size(relid) DESC; |
This file contains 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
{ | |
"editor_path": "/usr/local/bin/code", | |
"editor_argument_format": "--goto ${file}:${line}:${col}" | |
} |
NewerOlder