Skip to content

Instantly share code, notes, and snippets.

@meconlin
meconlin / gist:7158212
Created October 25, 2013 17:10
example - new aggregations - from es branch for 1.0
QUERY
{
"aggregations" : {
"terms" : {
"terms" : {
"field" : "value"
}
---
# ^^^ 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.
@meconlin
meconlin / cloudbess_jenkins_npm_bower_build_and_test
Created May 13, 2014 14:16
Cloudbees : Jenkins script for building mobile ang client
curl -s -o use-node https://repository-cloudbees.forge.cloudbees.com/distributions/ci-addons/node/use-node
NODE_VERSION=0.10.26 \
source ./use-node
npm install
npm install grunt
npm install grunt-cli
export PATH=$PATH:node_modules/grunt-cli/bin/
npm install bower
export PATH=$PATH:node_modules/bower/bin/
bower install
@meconlin
meconlin / cloudbees_jenkins_django_mysql
Created May 13, 2014 14:17
Cloudbees Jenkins build script for django and mysql
mkdir -p ~/mysql
cat > ~/.my.cnf <<EOF
[mysqld]
datadir=/home/jenkins/mysql/data
user=jenkins
socket=/home/jenkins/mysql/mysql.sock
EOF
export MYSQL_HOME=~/mysql
mysql_install_db
export PATH=/usr/local/bin:/usr/local/packer:$PATH
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
export GIT_PS1_SHOWDIRTYSTATE=1
export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[01;33m\]$(__git_ps1)\[\033[01;34m\] \$\[\033[00m\] '
@meconlin
meconlin / email template example
Created August 4, 2015 15:40
Mallorys email template example
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Confirm Your CarLingo Account</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
@meconlin
meconlin / gist:5a66c5532578aaf9a73e
Last active August 29, 2015 14:27
AWS SNS node sdk make it happen
var AWS = require('aws-sdk')
var sns = new AWS.SNS();
var inner_message = { name:"mymessage", other:"this is other" };
inner_message = JSON.stringify(inner_message);
var payload =
{
"default": inner_message,
};
payload = JSON.stringify(payload);
@meconlin
meconlin / gist:aec0405da73cac6a436a
Created August 21, 2015 01:35
AWS SWF : node launch of a simple workflow
// -- ------------------------------------------
// SWF - sending work to a workflow
//
var swf = new AWS.SWF();
var params = {
domain: 'FTPToS3Domain', /* required */
workflowId: 'STRING_VALUE', /* required */
workflowType: { /* required */
name: 'FTPToS3WorkFlow.run', /* required */
version: '1.7' /* required */
@meconlin
meconlin / unzip-csv-awk-aws-datapipeline.json
Created September 21, 2015 15:24
aws data pipeline unzip from s3 -> to s3 filtering csv via awk
{
"objects": [
{
"directoryPath": "#{myS3OutputLoc}/",
"name": "S3OutputLocation",
"id": "S3OutputLocation",
"type": "S3DataNode"
},
{
"period": "1 day",
@meconlin
meconlin / gist:eb0fc77c9cdedd760a7e
Created September 21, 2015 15:25
aws datapipeline create, upload, init cli example
aws datapipeline create-pipeline --name vin-reference-unzip --unique-id vin-reference-unzip
# returned : df-0757905EU1V52FPMH4U
aws datapipeline put-pipeline-definition --pipeline-id df-0757905EU1V52FPMH4U --pipeline-definition file:///Users/mark/workspace/buycheck_etl/aws-datapipeline/dataone-unzip-vin-reference.json
aws datapipeline activate-pipeline --pipeline-id df-0757905EU1V52FPMH4U
aws datapipeline list-pipelines