Skip to content

Instantly share code, notes, and snippets.

Daniel Serodio dserodio

Block or report user

Report or block dserodio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
"""Replace 'name' tag with 'Name' and 'application' with 'Application'
import boto3
def uppercaseTagKeys(arn, name, application=None):
tags = {}
if name:
tags['Name'] = name
dserodio / Dockerfile
Last active Apr 12, 2019
Dockerfile for multi-stage build of a Ruby app which needs Node at build time (credits:
View Dockerfile
# Dockerfile for a multi-stage build of a Ruby app which needs Node at build time
# Thanks to for sharing
FROM ruby:2.5.1 as builder
RUN curl -sL | bash - &&\
curl -sS | apt-key add - &&\
echo "deb stable main" | tee /etc/apt/sources.list.d/yarn.list
dserodio /
Created Nov 12, 2018
Using Google Text to Speech (TTS) in Linux CLI
# gTTS (Google Text-to-Speech), a Python library and CLI tool to interface with Google Translate's text-to-speech API
pipsi install gTTS
sudo apt install mpg123
say() {
gtts-cli "$@" | mpg123 -
dserodio /
Created Nov 12, 2018
Misc bash snippets
# use /etc/tcp to make TCP connections in plain bash
exec 3<>/dev/tcp/
echo -e "GET / HTTP/1.1\r\nhost:\r\nConnection: close\r\n\r\n" >&3
cat <&3
dserodio /
Created Sep 24, 2018
Config. AWS PostgreSQL RDS to use pgbadger

Set the following properties in RDS:

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
dserodio /
Created Aug 23, 2018
Sane `docker stats` for ECS #docker
# `docker stats` in Docker 17.06.2, used in ECS at the moment, shows container IDs instead of names
# see
docker stats $(docker ps --format={{.Names}})
dserodio /
Created Aug 9, 2018 — forked from citrusui/
"Dropdowns" in Markdown
How do I dropdown?
This is how you dropdown.

<summary>How do I dropdown?</summary>
This is how you dropdown.
View collapse_all_files_in_diff.js
"""Handle SIGINT (aka Ctrl+C)"""
import sys
import signal
signal.signal(signal.SIGINT, lambda signal_number, current_stack_frame: sys.exit(1))
dserodio /
Last active Jun 3, 2019
AWS snippets
# find the owner of an AWS access key
for user in $(aws iam list-users --output text | awk '{print $NF}'); do
aws iam list-access-keys --user $user --output text
# alternative that uses jq(1) insteaed of awk(1)
for user in $(aws iam list-users --query 'Users[*].UserName' --output text); do
You can’t perform that action at this time.