log_min_duration_statement = 250
log_checkpoints = on
log_connections = on
log_disconnections = on
log_lock_waits = on
log_temp_files = 0
log_autovacuum_min_duration = 0
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
# Show timestamp for history output | |
export HISTTIMEFORMAT="%d/%m/%y %T " |
How do I dropdown?
This is how you dropdown.
<details> <summary>How do I dropdown?</summary> <br> This is how you dropdown.
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://github.com/isaacs/github/issues/514#issuecomment-408216389 | |
Array.from(document.getElementsByClassName('js-details-target')).forEach(function(element){element.click()}) |
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
# Parse date | |
# $ pip install python-dateutil | |
from dateutil import parser | |
begin = parser.parse("Aug 28 1999 12:00AM") | |
end = parser.parse("2013-09-11") | |
# Print duration | |
delta = end - begin | |
print str(delta) |
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
# find the owner of an AWS access key | |
# https://stackoverflow.com/a/31275655 | |
for user in $(aws iam list-users --output text | awk '{print $NF}'); do | |
aws iam list-access-keys --user $user --output text | |
done | |
# alternative that uses jq(1) insteaed of awk(1) | |
for user in $(aws iam list-users --query 'Users[*].UserName' --output text); do |
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
#!/bin/bash | |
# "Bash strict mode" (see http://redsymbol.net/articles/unofficial-bash-strict-mode/) | |
set -euo pipefail | |
IFS=$'\n\t' | |
# Improved "strict mode" (see https://olivergondza.github.io/2019/10/01/bash-strict-mode.html) | |
trap 's=$?; echo >&2 "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR | |
debug() { | |
echo "[$(date +'%Y-%m-%dT%H:%M:%S%z')]: $*" >&2 |
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
# which package owns a file | |
dpkg-query -S /path/to/file | |
# list files in an installed package | |
dpkg-query -L $PACKAGE | |
# list files in a deb file | |
dpkg-deb -c <package_name.deb> | |
# see also apt-file(1) |