Skip to content

Instantly share code, notes, and snippets.

Working from home

Jose Diaz-Gonzalez josegonzalez

Working from home
View GitHub Profile
View gist:f2ed447447eaf24e8d16c699c6d9c97d
"$DOCKER_BIN" -D system info
"$DOCKER_BIN" container attach
"$DOCKER_BIN" container commit
"$DOCKER_BIN" container cp
"$DOCKER_BIN" container create
"$DOCKER_BIN" container exec
"$DOCKER_BIN" container inspect
"$DOCKER_BIN" container kill
"$DOCKER_BIN" container list
"$DOCKER_BIN" container logs
View gist:e5d7b9f4f5f7b27ccb9bcc2bd325724a
root@www-1:~# dokku mysql:create derp
Waiting for container to be ready
=====> MySQL container created: derp
=====> Container Information
Config dir: /var/lib/dokku/services/mysql/derp/config
Data dir: /var/lib/dokku/services/mysql/derp/data
Dsn: mysql://mysql:ce362a4b40b9da7b@dokku-mysql-derp:3306/derp
Exposed ports: -
Id: 239ea302762c4c4f489d2c2f3837514fb5eb3a8cbd14a76aa6eab298bc0fa722
Internal ip:
josegonzalez /
Created Mar 7, 2017 — forked from iserko/
A simple script to migrate all keys from one Redis to another
#!/usr/bin/env python
import argparse
import redis
def connect_redis(conn_dict):
conn = redis.StrictRedis(host=conn_dict['host'],
return conn

Keybase proof

I hereby claim:

  • I am josegonzalez on github.
  • I am savant ( on keybase.
  • I have a public key ASBouJt4s02dheQkrfrsCQNKqsaHzxuhBpjL1RxtoMoEjQo

To claim this, I am signing this object:

josegonzalez /
Last active Jun 9, 2016
Chrome extension for a Real AWS Status Page:

Real AWS Status Page

Install the Chrome extension from this github repo to see the real status of any service that AWS says is "ok".

josegonzalez /
Last active Sep 4, 2016
docker hosted dokku
# add your public ssh keys to data/ssh
mkdir -p data/{apps,config,ssh,storage}
# build the image and tag it
docker build -t dokku/dokku:dokku-test .
# run the image
docker run \
-p "2222:22" \
-v $PWD/data/apps:/apps \
josegonzalez / docker_sleep
Last active Aug 29, 2015
wait until a docker container has no more incoming traffic
View docker_sleep
#!/usr/bin/env python
# Returns once a container no longer has open connections
# Only works for containers using internal dns
# Sleeps 2 seconds between checks
# Usage:
# # wait until all traffic drains from a container before killing it
# docker_sleep $CONTAINER_ID $MAX_WAIT
View APC_WPDB.php
* APC-based WordPress Database Access Abstraction Object
* Extends the wpdb class in order to cache queries in APC
* Falls back to non-APC database when requesting an admin resource or
* the query modifies the database.
* Using something like Memcached might be better as we can namespace
View StatsD.php
class StatsD {
// StastD::timing("www.php.sql_query", 645);
public static function __callStatic($name, $arguments) {
if (!in_array($name, array('counter', 'gauge', 'timing'))) {
throw new Exception("Invalid function");
if (empty($arguments[0])) return false;

This choropleth encodes unemployment rates from 2008 with a quantize scale ranging from 0 to 15%. A threshold scale is a useful alternative for coloring arbitrary ranges.