View cloudFormation template
AWSTemplateFormatVersion: '2010-09-09'
Description: >
AWS CloudFormation template to create a new VPC
or use an existing VPC for ECS deployment
in Create Cluster Wizard. Requires exactly 1
Instance Types for a Spot Request.
Parameters:
EcsClusterName:
Type: String
Description: >
View json_schema_to_django_model.py
"""
Json Schema to Django Model
"""
import json
import argparse
import logging
import os
def determine_model_name(model_id=None, filename=None):
View tickets.py
class TicketMachine(object):
def __init__(self, route1_name, route1_child, route1_adult, route2_name, route2_child, route2_adult):
self.routes = [
{'name': route1_name, 'child_fare': route1_child, 'adult_fare': route1_adult},
{'name': route2_name, 'child_fare': route2_child, 'adult_fare': route2_adult}
]
self.selected_route = None
View european_venues2.sql
and
(metadata like "%Camp Nou%" or
metadata like "%Wembley%" or
metadata like "%Croke Park%" or
metadata like "%Twickenham%" or
metadata like "%Signal Iduna Park%" or
metadata like "%Stade de France%" or
metadata like "%Santiago Bernabéu%" or
metadata like "%Luzhniki%" or
View european_venues.sql
(metadata like "%Camp Nou%" or
metadata like "%Wembley%" or
metadata like "%Croke Park%" or
metadata like "%Twickenham%" or
metadata like "%Signal Iduna Park%" or
metadata like "%Stade de France%" or
metadata like "%Santiago Bernabéu%" or
metadata like "%Luzhniki%" or
metadata like "%San Siro%" or
metadata like "%Atatürk Olympic%" or
View restart es cluster
def restart_elasticsearch():
"""
Restart es from one place using this command
Restart one node at a time, starting with master
Wait till cluster is in yellow state before doing the next one
Usage:
fab restart_elasticsearch -H rad@search1.int.fanxchange.com
"""
first_host = env.hosts[0]
if '@' in first_host:
View gist:46a6d50176a3855df95975f43a705be5
#!/usr/bin/env python
"""
Broker API log parser
https://help.datadoghq.com/hc/en-us/articles/209064386-How-to-collect-metrics-or-events-with-a-Custom-Log-Parser
"""
import datetime
import re
View mock_api_routes.py
def orbital_mocker_api():
request_data = request.data
logging.debug("Orbital Mock API Request headers are: {}".format(request.headers))
logging.info("Orbital Mock got {} Request: {}".format(request.method, request_data))
data = '' # Response value
response_type = ''
if '<Request><Profile>' in request_data:
View dbcopy.sh
#!/bin/bash
DBUSER=tempuser
DBPASS=tempuser
DB_OLD=nightly_test
DB_NEW=nightly_ttest
DBHOST=db2.int.fanxchange.com #localhost
while [[ $# > 0 ]]
do
View routes.py snippet
@your_app.route('/maxmind_alert', methods=['GET'])
def post_maxmind_alert():
"""
Get maxmind alerts
https://www.maxmind.com/en/alert_url
CARDER_EMAIL Email on order was flagged as high-risk email, as it was associated with another high-risk order
HIGH_RISK_IP IP address has been marked as a high-risk IP
HOSTING_PROVIDER IP is from High Risk Hosting Provider
POSTAL_VELOCITY IP address had high velocity of orders (e.g. different zipcodes on same IP address)
UPDATED_INFORMATION The transaction would be rated as higher risk based on updated information or analysis