Skip to content

Instantly share code, notes, and snippets.

View mmontagna's full-sized avatar

Marco Montagna mmontagna

  • San Francisco, CA
View GitHub Profile
@mmontagna
mmontagna / redis_usage.py
Created April 10, 2019 01:58 — forked from sherin/redis_usage.py
redis space usage report grouped by prefixes on keys
#!/usr/bin/env python
# production friendly
# slow if there are too many keys but the script will print partial outputs
# usage is an approximation for complex objects
import math
import redis
import urlparse
import os
@mmontagna
mmontagna / memusg
Created July 26, 2017 19:06 — forked from netj/memusg
memusg -- Measure memory usage of processes
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2010-08-16
############################################################################
# Copyright 2010 Jaeho Shin. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
@mmontagna
mmontagna / loggly-format.conf
Created November 18, 2016 00:11 — forked from okhwaja/loggly-format.conf
Loggly syslog tag regex for docker containers
$template LogglyFormat,"<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% [<token>@<port> tag=\"%syslogtag:R,ERE,1,ZERO,0:docker\/([^[]+)\[--end%\"] %msg%\n"
@mmontagna
mmontagna / 0_reuse_code.js
Created December 21, 2015 03:50
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console