Skip to content

Instantly share code, notes, and snippets.

Taking care of my kid

Matt Wright mattupstate

Taking care of my kid
Block or report user

Report or block mattupstate

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
mattupstate /
Last active Aug 29, 2015
Naive attempt at porting Oat ( to Python
import warnings
from collections import OrderedDict
from itertools import chain
from inflection import pluralize
class Adapter(object):
View logstash.conf
input {
file {
path => [ "/var/log/*.log", "/var/log/messages", "/var/log/syslog" ]
start_position => "beginning"
output {
elasticsearch_http {
host => ""
mattupstate / docker-regsitry.conf
Created Nov 6, 2014
An example Nginx config for a private Docker registry to enable unauthenticated, read-only access on non-volatile HTTP methods
View docker-regsitry.conf
upstream docker-registry {
server hostname1:port;
server hostname2:port;
server {
listen 80;
server_name docker.your.domain;
rewrite ^ https://$server_name$request_uri? permanent;
mattupstate / nginx_status_decoder.lua
Last active Aug 29, 2015
heka Nginx status decoder and filter
View nginx_status_decoder.lua
Parses a payload containing the contents of the output from the Nginx `stub_status`
module. See:
- payload_keep (bool, optional, default false)
Always preserve the original log line in the message payload.
mattupstate / linux_netstats.lua
Created Nov 13, 2014
A heka decoder for data available in /proc/net/dev
View linux_netstats.lua
Parses a payload containing the contents of a `cat /proc/net/dev | tail -n +3` call into a Heka
- payload_keep (bool, optional, default false)
Always preserve the original log line in the message payload.
mattupstate / output.rst
Created May 19, 2015
uWSGI heka.statmetric message
View output.rst
Timestamp:2015-05-19 23:11:38.372266224 +0000 UTC
Payload:users-frontend-machine1.counters.uwsgi.worker.1.delta_requests.rate 0.000000 1432077098

users-frontend-machine1.counters.uwsgi.worker.1.delta_requests.count 0 1432077098 users-frontend-machine1.counters.uwsgi.worker.2.delta_requests.rate 0.000000 1432077098 users-frontend-machine1.counters.uwsgi.worker.2.delta_requests.count 0 1432077098

* Converts the amount of milliseconds into a string based time code.
* @param milliseconds
* @param delimiter
* @param withHours
* @return The time code as a string.
function getTimeCode( milliseconds:Number, delimeter:String = ":", withHours:Boolean = false ):String
var posHours:Number = Math.floor( milliseconds / 1000 / 60 / 60 );
function run( buildFile:File, targetName:String, parameters:Array = null ):void
var file:File = new File( "C:/windows/system32/cmd.exe" );
var args:Vector.<String> = new Vector.<String>();
args.push( "/c" );
args.push( "ant" );
if( parameters )
View gist:458254
import flash.display.Bitmap;
import flash.display.Sprite;
public class CenteredImage extends Sprite
private var _image:Bitmap;
public function CenteredImage( image:Bitmap )
View gist:464799
<target name="compile">
<java jar="${FLEX_HOME}/lib/mxmlc.jar" dir="${FLEX_HOME}/frameworks" fork="true" failonerror="true">
<arg value="${basedir}/src/Project.swf" />
<arg value="-output=${basedir}/bin/Project.swf" />
<arg value="-source-path=${basedir}/src" />
<arg value="-library-path+=${basedir}/lib" />
You can’t perform that action at this time.