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
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: |
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 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 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 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 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/osascript | |
set inputVolume to input volume of (get volume settings) | |
if inputVolume = 0 then | |
set inputVolume to 20 | |
else | |
set inputVolume to 0 | |
end if | |
set volume input volume inputVolume |
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
def genMeteorID(): | |
return('%024x' % random.randrange(16**24)) |
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
def to_unicode_or_bust(obj, encoding='utf-8'): | |
if isinstance(obj, basestring): | |
if not isinstance(obj, unicode): | |
obj = unicode(obj, encoding) | |
return obj |
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 requests | |
import json | |
r=requests.get(url="http://elasticsearchservernamegoeshere:9200/_nodes/stats?pretty=true") | |
nodestats=r.json() | |
for node in nodestats['nodes']: | |
nodename=nodestats['nodes'][node]['name'] | |
threadpool=nodestats['nodes'][node]['thread_pool'] | |
for pool in threadpool: | |
threads=threadpool[pool]['threads'] | |
rejected=threadpool[pool]['rejected'] |
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
Input: A json file with iocs of IP address, category and score like: | |
{ | |
"2.3.4.5" : { | |
"P2P" : "55" | |
}, | |
"1.2.3.4" : { | |
"Brute_Forcer" : "117", | |
"Scanner" : "117" | |
} | |
} |
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/env python | |
import re | |
import json | |
import requests | |
from datetime import datetime | |
from dateutil.parser import parse | |
def apachetime(s): | |
""" |
OlderNewer