Skip to content

Instantly share code, notes, and snippets.

View lanerjo's full-sized avatar

Lance Zukel lanerjo

View GitHub Profile
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
@lanerjo
lanerjo / json_comparitor.py
Created July 16, 2018 18:58
Quickly compare 2 json files for differences
import json
import sys
def load_json(file_path):
try:
fh = open(str(file_path), 'r')
data = json.load(fh)
fh.close()
return data
#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')
@lanerjo
lanerjo / email.py
Last active September 29, 2016 01:27
#!/usr/bin/python2.7
import cgi
import html
import boto.ses
import cgitb; cgitb.enable() #for troubleshooting
print("Content-Type: text/html")
print
def getdata():
@lanerjo
lanerjo / test.py
Last active August 24, 2016 00:50
#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):
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:
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
@lanerjo
lanerjo / AWS_Jenkins_Launcher.py
Created August 6, 2016 22:54
Connect to AWS and install Jenkins via Bash
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
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
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: