Skip to content

Instantly share code, notes, and snippets.


Daniel Serodio dserodio

View GitHub Profile
rgreenjr / postgres_queries_and_commands.sql
Last active Jun 13, 2021
Useful PostgreSQL Queries and Commands
View postgres_queries_and_commands.sql
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
willurd /
Last active Jun 13, 2021
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:


start new with session name:

View Search my

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.

Find all gists with a .yml extension.

Find all gists with HTML files.

wdullaer / docker-cleanup
Last active Jun 9, 2021
Cleanup unused Docker images and containers
View docker-cleanup
# Cleanup docker files: untagged containers and images.
# Use `docker-cleanup -n` for a dry run to see what would be deleted.
untagged_containers() {
# Print containers using untagged images: $1 is used with awk's print: 0=line, 1=column 1.
# NOTE: "[0-9a-f]{12}" does not work with GNU Awk 3.1.7 (RHEL6).
# Ref:
docker ps -a | tail -n +2 | awk '$2 ~ "^[0-9a-f]+$" {print $'$1'}'
citrusui /
Last active Jun 5, 2021
"Dropdowns" in Markdown
How do I dropdown?
This is how you dropdown.

<summary>How do I dropdown?</summary>
This is how you dropdown.
# SPDX-License-Identifier: MIT
## Copyright (C) 2009 Przemyslaw Pawelczyk <>
## This script is licensed under the terms of the MIT license.
# Lockable script boilerplate

Source Code Typography



Dumb quotes (also known as straight quotes) are straight and vertical. Proper typography never uses straight quotes. They are left over from the age of typewriters, and their only modern use is for coding.

josh-padnick /
Last active May 26, 2021
Manually Edit AWS Console "Switch Role" Configuration in Bash

Manually Edit AWS Console "Switch Role" Configuration in Bash


At Gruntwork, we work with multiple software teams. That means we have to modify the "Switch Role" history multiple times. But the only way to do that today is to delete your cookie and clear all AWS Console saved settings. That got old after a while, so these instructions enable you to modify the "Switch Roles" configuration directly.

The Big Picture

bvis / Jenkinsfile
Last active May 14, 2021
Jenkin pipeline definition example to be integrated with Docker Swarm cluster in our CI/CD environment
View Jenkinsfile
pipeline {
agent { node { label 'swarm-ci' } }
environment {
SLACK_CHANNEL = "#deployment-notifications"