This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| import json | |
| import signal | |
| import sys | |
| import urllib2 #prep for get request on authcache service | |
| import pymysql | |
| import logging | |
| sqs = boto3.resource('sqs', region_name='us-east-1') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask | |
| from flask import json | |
| from flask import request | |
| from boto3.session import Session | |
| import json | |
| import logging | |
| app = Flask(__name__) | |
| session = Session( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'sinatra' | |
| require 'redis' | |
| require 'json' | |
| configure do | |
| $redis = Redis.new(host: "localhost", port: "6379") | |
| end | |
| get '/' do | |
| content_type :json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'pagerduty' | |
| check1=`redis-cli -h REDIS_HOST llen REDIS_QUEUE1`.to_i | |
| check2=`redis-cli -h REDIS_HOST llen REDIS_QUEUE2`.to_i | |
| pagerduty = Pagerduty.new("PD_API_KEY") | |
| queue = case check1 | |
| when 0..20 then "Pass" | |
| else incident = pagerduty.trigger("Queue size is #{check1}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #set -x | |
| #DEBUG=echo | |
| # Runs via cron to shut down the instance if it's not in use for 5 minutes | |
| # Starts checks after it's been up more than 500secs | |
| # Won't kick you out if you're ssh'ed in and it's idle. | |
| # crontab -l|grep idle | |
| # */6 * * * * /root/bin/idle.sh >/dev/null 2>&1 | |
| until $(awk '$1>500{exit 1}' /proc/uptime) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = (robot) -> | |
| robot.respond /(.*) sara$/i, (msg) -> | |
| msg.http('http://catfacts-api.appspot.com/api/facts?number=1') | |
| .get() (error, response, body) -> | |
| # passes back the complete reponse | |
| response = JSON.parse(body) | |
| if response.success == "true" | |
| sara_message = response.facts[0] | |
| msg.send sara_message.replace /cat/g, "sara" | |
| else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Ansible EC2 external inventory script settings | |
| # | |
| [ec2] | |
| # to talk to a private eucalyptus instance uncomment these lines | |
| # and edit edit eucalyptus_host to be the host name of your cloud controller | |
| #eucalyptus = True | |
| #eucalyptus_host = clc.cloud.domain.org |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import sys | |
| import os | |
| import argparse | |
| import re | |
| from time import time | |
| import boto | |
| from boto import ec2 | |
| from boto import rds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ######################### ElasticSearch Configuration ######################## | |
| # This file is managed by Chef, do not edit manually, your changes *will* be overwritten! | |
| # | |
| # Please see the source file for context and more information: | |
| # | |
| # https://github.com/elasticsearch/elasticsearch/blob/master/config/elasticsearch.yml | |
| # | |
| # To set configurations not exposed by this template, set the | |
| # `node.elasticsearch[:custom_config]` attribute in your node configuration, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| import numpy as np | |
| # Define the diff function to show the changes in each field | |
| def report_diff(x): | |
| return x[0] if x[0] == x[1] else '{} ---> {}'.format(*x) | |
| # Read in the two files but call the data old and new and create columns to track | |
| old = pd.read_excel('sample-address-old.xlsx', 'Sheet1', na_values=['NA']) | |
| new = pd.read_excel('sample-address-new.xlsx', 'Sheet1', na_values=['NA']) |
NewerOlder