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 json | |
import requests | |
r=requests.get(url="http://servername:9200/_nodes/stats?pretty=true") | |
if r.status_code == 200: | |
nodestats=r.json() | |
for node in nodestats['nodes']: |
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 json | |
vDict=json.loads(open('verisc-enum.json').read()) | |
def dict_walker(inCollection, pre=None): | |
pre = pre[:] if pre else [] | |
#print(pre) | |
if isinstance(inCollection, dict): |
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 fcntl | |
import subprocess | |
import sys | |
import shlex | |
from threading import Timer | |
import time | |
import os | |
''' | |
python3 code to allow one to run an external command and return the output | |
''' |
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 datetime import datetime | |
from dateutil.parser import parse | |
import pytz | |
def toUTC(suspectedDate,localTimeZone="US/Pacific"): | |
'''make a UTC date out of almost anything''' | |
utc=pytz.UTC | |
objDate=None | |
if type(suspectedDate)==str: |
NewerOlder