Skip to content

Instantly share code, notes, and snippets.

View redherringbone's full-sized avatar

redherringbone

View GitHub Profile
import time
import subprocess
import sys
import xml.etree.ElementTree as ET
import base64
import os
import shutil
import csv
import logging
import logging.handlers
# https://github.com/maaaaz/nmaptocsv/blob/master/nmaptocsv.py
# http://www.idiotinside.com/2015/09/18/csv-json-pretty-print-python/
# only find open ports
# https://github.com/d1b/python-nmap-xml-output-parser/blob/master/shows_hosts_with_open_port_and_service_desc.py
import time
import subprocess
import sys
import xml.etree.ElementTree as ET
import base64
import os
@redherringbone
redherringbone / gist:004b185b03ce8ec331e75d04ad290e60
Created November 11, 2016 10:01
Python Elasticsearch delete index
#python elasticsearch delete index
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search
es = Elasticsearch()
for index in es.indices.get('*'):
print index
es.indices.delete(index="logstash-2016.11.09")