Skip to content

Instantly share code, notes, and snippets.

View scalp42's full-sized avatar
πŸ‘¨β€πŸŽ¨

Anthony Scalisi scalp42

πŸ‘¨β€πŸŽ¨
View GitHub Profile
@scalp42
scalp42 / Dockerfile
Created February 11, 2016 20:27 — forked from ipmb/Dockerfile
Example wheel upload to simple PyPI on S3
FROM ubuntu:14.04
ENV BUCKET your-s3-bucket
RUN apt-get update && apt-get install -y wget \
build-essential python-dev \
libssl-dev libffi-dev \
libpcre3-dev \
libmemcached-dev \
libpq-dev \
@scalp42
scalp42 / Terraform-Blue-Green-AWS.md
Created January 29, 2016 19:28 — forked from ryan0x44/Terraform-Blue-Green-AWS.md
Blue-Green AWS Auto Scaling Deployments with Terraform

A quick note on how I'm currently handling Blue/Green or A/B deployments with Terraform and AWS EC2 Auto Scaling.

In my particular use case, I want to be able to inspect an AMI deployment manually before disabling the previous deployment.

Hopefully someone finds this useful, and if you have and feedback please leave a comment or email me.

Overview

I build my AMI's using Packer and Ansible.

@scalp42
scalp42 / Rakefile
Created January 8, 2016 21:29 — forked from kenjiskywalker/Rakefile
serverspec read chef json file
require 'rubygems'
require 'rake'
require 'rspec/core/rake_task'
require 'json'
require 'chef/run_list'
json_files = Dir::glob("../chef/nodes/*.json")
Chef::Config[:cookbook_path] = '../chef/site-cookbooks/'
Chef::Config[:role_path] = '../chef/roles/'
@scalp42
scalp42 / HAProxyListenExample
Created December 29, 2015 02:56 — forked from fenneh/HAProxyListenExample
HAProxy HTTP Check with Head & User Agent type
listen justFenWEB
bind 192.168.100.100:80
mode tcp ## Drops from Layer 7 to Layer 4 routing as defined in defaults
option tcplog
balance source ## To maintain sessions
option httpchk HEAD / HTTP/1.0\r\nHost:\ www.justfen.com\r\nUser-Agent:\ HAProxy01 ## Used for checking HTTP health of web server
rspidel ^Set-cookie:\ IP= ## Will hide internal IP
server APP01 APP01.justfen.com:80 check
server APP03 APP03.justfen.com:80 check
@scalp42
scalp42 / logtee.bash
Created December 28, 2015 23:17 — forked from solidsnack/logtee.bash
Log STDOUT and STDERR to both syslog and the console.
#!/bin/bash
set -o errexit -o pipefail -o nounset
# Log STDOUT and STDERR to both syslog and the console.
exec 3>&1
exec 4>&2
exec 1> >(tee >(logger -p user.info) 1>&3)
exec 2> >(tee >(logger -p user.notice) 2>&4)
"$@"
@scalp42
scalp42 / docker-cli-debug.sh
Created December 17, 2015 20:55 — forked from chasebolt/docker-cli-debug.sh
copy and paste this one-liner into a terminal of the docker host you want to debug. this will dump all the cli api calls between the client and docker host. requires root and the app socat.
mv /var/run/docker.sock /var/run/docker.sock.orig && socat -v UNIX-LISTEN:/var/run/docker.sock,group=docker,perm=0660,reuseaddr,fork UNIX-CONNECT:/var/run/docker.sock.orig; mv /var/run/docker.sock.orig /var/run/docker.sock

Log agregation for Docker containers in Mesos / Marathon cluster

This article will describe several alternatives for grathing Docker container logs in the distributed environment of__Apache Marathon / Mesos__ cluster, like Syslog, Container linking, Docker REST API, embedded logging piping stdout/stderr and Mesos APIs for that. We'll go though a problem statement, different alternatives and descibe the challenges related to each of them.

tl;dr: Docker REST API combined with intelligent 'docker inspect' hooks do a great job.

Background

At elastic.io we are building an integration platform for developers, with the best possible environment to code, test and run integration jobs or flows. Integration flow is a sequence of of integration components that are connected to each other. Each integration component is a individual process running in a Docker container that communicates via persistent RabbitMQ queue with the next component. We provide tooling and monitoring on to

@scalp42
scalp42 / gist:c08c1fd0fe41ce2c8e63
Created November 10, 2015 21:21 — forked from mingderwang/gist:971c9d303c65cd876381
install mesosphere on ubuntu 14.04 manually with scripts
$ cat install.sh
## add mesosphere repo and keys
export DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
export CODENAME=$(lsb_release -cs)
echo "deb http://repos.mesosphere.io/${DISTRO} ${CODENAME} main" | sudo tee /etc/apt/sources.list.d/mesosphere.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv E56151BF
## update repos
@scalp42
scalp42 / tinder-api-documentation.md
Created October 27, 2015 13:51 — forked from rtt/tinder-api-documentation.md
Tinder API Documentation

Tinder API documentation

http://rsty.org/

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)

Note: this was written in April/May 2014 and the API may have changed since

API Details

@scalp42
scalp42 / batch-delete-gmail-emails.js
Created October 4, 2015 05:01 — forked from gene1wood/batch-delete-gmail-emails.js
A Google Apps Script script to bulk delete large amounts of email in Gmail while avoiding the error #793 which Gmail encounters normally
# This script, when used with Google Apps Scripts will delete 500 emails and can be triggered to run every minute without user interaction enabling you to bulk delete email in Gmail without getting the #793 error from Gmail.
# Configure the search query in the code below to match the type of emails you want to delete
# Browser to https://script.google.com/.
# Start a script and paste in the code below.
# After you past it in, save it and click the little clock looking button. This is for your triggers. You can set up how frequently you want the script to run (I did mine for every minute).
# Source : # https://productforums.google.com/d/msg/gmail/YeQVDuPIQzA/kpZPDDj8TXkJ
function batchDeleteEmail() {
var batchSize = 100 // Process up to 100 threads at once