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
# Dockerfile for a multi-stage build of a Ruby app which needs Node at build time | |
# | |
# Thanks to https://github.com/gomex for sharing | |
FROM ruby:2.5.1 as builder | |
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - &&\ | |
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - &&\ | |
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list |
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
# gTTS (Google Text-to-Speech), a Python library and CLI tool to interface with Google Translate's text-to-speech API | |
# https://github.com/pndurette/gTTS | |
pipsi install gTTS | |
sudo apt install mpg123 | |
say() { | |
gtts-cli "$@" | mpg123 - | |
} |
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 |