Skip to content

Instantly share code, notes, and snippets.

@zircote
zircote / task.aurora.py
Created Feb 21, 2018
A proposed implementation of DiscoveryInfo in an Apache Aurora Job.
View task.aurora.py
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
View osx-10.9-setup.md

Mac from scratch

Install Software

Install from App Store

Install from Third-Party Websites

@zircote
zircote / aurora.py
Last active Jul 4, 2017
WIP DataDog check for Apache Aurora
View aurora.py
"""
Aurora Scheduler check
Collects metrics from aurora scheduler.
"""
import requests
from checks import AgentCheck, CheckException
class AuroraCheck(AgentCheck):
@zircote
zircote / telegraf.d-vault-statsd.conf
Created May 24, 2017
A InfluxDB/StatsD configuration for Hashicorp Vault
View telegraf.d-vault-statsd.conf
# Statsd Server
[[inputs.statsd]]
## Address and port to host UDP listener on
service_address = "127.0.0.1:8126"
## The following configuration options control when telegraf clears it's cache
## of previous values. If set to false, then telegraf will only clear it's
## cache when the daemon is restarted.
## Reset gauges every interval (default=true)
delete_gauges = true
@zircote
zircote / run_dynamodb_local.sh
Created Feb 8, 2015
A quick run script to get a AWS DynamoDB Local instance going
View run_dynamodb_local.sh
#!/bin/sh
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
RUN_DIR=${DIR}/.dynamodb
DYNAMODB_LOCAL="http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.tar.gz"
PORT=8000
ARGS="-inMemory -port ${PORT}"
install_dynamo_db(){
mkdir -p $1
curl -L $2 | tar xvz -C $1
@zircote
zircote / AuroraStuff.md
Last active Aug 22, 2016
My early gotchas with Apache Aurora
View AuroraStuff.md

The mustache gotcha

When using “bound” objects in an .aurora file it is an absolute that you do not have spaces in the “mustaches”.

Examples:

  • Bad: {{ profile.my_var }}
  • Good: {{profile.my_var}}

Docker Container Snafus

When running a docker container, you must ensure that all of the dependent library for the thermos_executor.pex are present in the docker container itself. The thermos_executor runs in the container not the mesos slaves environment.

@zircote
zircote / ct2ls.py
Last active Jun 23, 2016
A script to manage and import CloudTrail logs into logstash via redis
View ct2ls.py
#!/usr/bin/env python
import boto
from boto.sqs.message import RawMessage
import tempfile
import json
import logging
import argparse
import gzip
import redis
@zircote
zircote / cake-example.php
Created Mar 22, 2013
I am not familiar with cake; however based on the example I was given this should produce the desired result.
View cake-example.php
<?php
use Swagger\Annotations as SWG;
App::uses('AppController', 'Controller');
/**
* Users Controller
* @SWG\Resource(
* apiVersion="0.2",
* swaggerVersion="1.1",
* basePath="http://api.myhost.local/api",
* resourcePath="/users"
@zircote
zircote / Time Intervals.md
Last active Jan 1, 2016
Explanation of time interval definition.
View Time Intervals.md

Duration Data Type

The duration data type is used to specify a time interval. The time interval is specified in the following form "PnYnMnDTnHnMnS" where:

  • P indicates the period (required)
  • nY indicates the number of years
  • nM indicates the number of months
  • nD indicates the number of days
  • T indicates the start of a time section (required if you are going to specify hours, minutes, or seconds)
  • nH indicates the number of hours
View com.zircote.headlessvm.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>KeepAlive</key>
<false/>
<key>Label</key>
<string>com.zircote.headlessvm</string>
You can’t perform that action at this time.