This file contains 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
curator --config /etc/elasticsearch/curator.conf /etc/elasticsearch/index_prod_rollover.curator | |
2018-09-26 20:05:22,005 DEBUG curator.cli run:108 Client and logging options | |
validated. | |
2018-09-26 20:05:22,005 DEBUG curator.cli run:112 default_timeout = 30 | |
2018-09-26 20:05:22,005 DEBUG curator.cli run:116 action_file: | |
/etc/elasticsearch/index_prod_rollover.curator | |
2018-09-26 20:05:22,009 DEBUG curator.cli run:118 action_config: {'actions': {1: | |
{'action': 'rollover', 'description': "Rollover the index associated with index 'name', which should be in the |
This file contains 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 json | |
import sys | |
def load_json(file_path): | |
try: | |
fh = open(str(file_path), 'r') | |
data = json.load(fh) | |
fh.close() | |
return data |
This file contains 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
#AAPL | |
#get one year historical | |
#arrange the data in an array format | |
import numpy as np | |
from yahoo_finance import Share | |
apple = Share('AAPL') | |
happle = apple.get_historical('2015-11-25', '2016-11-25') | |
This file contains 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/python2.7 | |
import cgi | |
import html | |
import boto.ses | |
import cgitb; cgitb.enable() #for troubleshooting | |
print("Content-Type: text/html") | |
def getdata(): |
This file contains 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
#imports | |
import os | |
import sys | |
from bottle import route, run, request, post | |
import csv | |
from geopy.distance import great_circle | |
#output results | |
def return_results(usr_loc): |
This file contains 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 boto | |
from boto import ec2 | |
from boto.ec2 import connection | |
conn=boto.ec2.connect_to_region("us-west-2") | |
ec2_conn=boto.ec2.connection | |
reservations = conn.get_all_instances() | |
for res in reservations: | |
for inst in res.instances: | |
if 'Name' in inst.tags: |
This file contains 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 random | |
import time | |
import math | |
print("Welcome to ATV Road Trip!!!") | |
time.sleep(1) | |
stuck=0 | |
print("Good luck because your gonna need it...") | |
time.sleep(1) | |
first_round=0 | |
second_round=0 |
This file contains 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 os | |
import boto3 | |
# note, in part 2 we will move these to a separate .env file so they | |
# aren't accidentally published in a public repository. | |
os.environ["AWS_ACCESS_KEY_ID"] = "this will be changed" | |
os.environ["AWS_SECRET_ACCESS_KEY"] = "this will be changed" | |
os.environ["AWS_DEFAULT_REGION"] = "us-west-2" | |
#next is elk stack |
This file contains 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 random | |
print "Let's play a guessing game." | |
guess = int(input("Pick a number between 1 and 100:")) | |
if guess > 100: | |
print "out of range" | |
sys.exit(0) | |
gennum = random.randint(1,100) | |
def checkguess(): | |
global guess |
This file contains 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 random | |
print "This is the coin flip guessing game!!!" | |
print "I am going to flip a coin 100 times," | |
print "Can you guess how many time the coint will land on heads?" | |
guess = int(input("Your Guess>>>")) | |
flips = 0 | |
heads = 0 | |
while flips < 100: | |
if random.randint(0,1) ==1: |
NewerOlder