Skip to content

Instantly share code, notes, and snippets.

View alexanderdean's full-sized avatar

Alexander Dean alexanderdean

View GitHub Profile
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.

Custom unstructured event and context functionality: draft specification

0. Introduction

This draft specification covers the enrichment and storage processes for:

  1. Custom unstructured events
  2. Custom untructured context

Custom unstructured events are well-documented as part of the Snowplow Tracker Protocol. Custom unstructured context is less well documented - essentially is looks like this:

#!/usr/bin/env ruby
# == Simple Daemon
#
# A simple ruby daemon that you copy and change as needed.
#
# === How does it work?
#
# All this program does is fork the current process (creates a copy of
# itself) then exits, the fork (child process) then goes on to run your
# daemon code. In this example we are just running a while loop with a
// Alias. Worth keeping in because it's so verbose.
var encodeWrapper = window.encodeURIComponent;
// IMPORTANT!!
// ------------------------------------------
// This is how simple it is to build the final URL:
image.src = configCollectorUrl + '?' + request;
// See below for how each piece (configCollectorUrl and request) are built...
/**

itemViewTrack

Details

Reference: snowplow/snowplow#113
Idea from: https://github.com/kingo55

Summary

This is a new feature to track views of products on ecommerce sites, or suggested articles on a media site, similar to how Google AdWords tracks ad views in different positions on a page.

@alexanderdean
alexanderdean / fetch_and_combine.py
Created November 15, 2012 08:31 — forked from larsyencken/fetch_and_combine.py
Aggregating CloudFront logs
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# fetch_and_combine.py
#
"""
Scans CloudFront logs in an S3 bucket for any that are new. Combines log files
into a single local file per hour. If logs for multiple CloudFront
distributions are present, combines them all.