Skip to content

Instantly share code, notes, and snippets.

@KyleBanks
KyleBanks / docker-stats-json
Created February 10, 2017 01:27
Returns Docker stats as a JSON Object
docker stats --no-stream \
--format "{\"container\": \"{{ .Container }}\", \"memory\": { \"raw\": \"{{ .MemUsage }}\", \"percent\": \"{{ .MemPerc }}\"}, \"cpu\": \"{{ .CPUPerc }}\"}"
@edtoon
edtoon / gist:6358598
Last active December 21, 2015 20:00
example mod_vhost_dbd / wildcard hosting server
#########################
# install binary stuffs #
#########################
apt-get install apache2 apache2-prefork-dev libaprutil1-dbd-mysql unzip mysql-server
mkdir -p /usr/local/src/mod_vhost_dbd
cd /usr/local/src/mod_vhost_dbd
wget http://dbd-modules.googlecode.com/files/dbd-modules-1.0.6.zip
unzip dbd-modules-1.0.6.zip
apxs2 -c mod_vhost_dbd.c
@clauswitt
clauswitt / distance.js
Created January 13, 2012 07:11
Get the distance between two (world) coordinates - a nodejs module
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* */
/* Simple node js module to get distance between two coordinates. */
/* */
/* Code transformed from Chris Veness example code - please refer to his website for licensing */
/* questions. */
/* */
/* */
/* Latitude/longitude spherical geodesy formulae & scripts (c) Chris Veness 2002-2011 */
/* - www.movable-type.co.uk/scripts/latlong.html */