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 pyVim import connect | |
from pyVmomi import vim | |
import ssl | |
import tools.cli as cli | |
# Monkey patch for SSL :-) | |
ssl._create_default_https_context = ssl._create_unverified_context |
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
# Attempts to get procs on a given VM (uuid) | |
# Through pyvmomi and vmware-tools | |
# | |
from pyVim import connect | |
from pyVmomi import vim | |
import ssl | |
import tools.cli as cli | |
import atexit |
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 pyVim import connect | |
from pyVmomi import vim | |
import pandas as pd | |
import ssl | |
import tools.cli as cli | |
import atexit | |
import json | |
# Monkey patch SSL |
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
#!/bin/bash | |
rddToolBin="/usr/bin/rrdtool" | |
rmBin="/bin/rm" | |
chownBin="/bin/chown" | |
userThatOwnsDb="www-data" | |
dbList="someRRd.rrd" | |
rm -fr /var/www/dump | |
rm -fr /var/www/restore |
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 python2.7 | |
# You need to have installed google module | |
# i.e. | |
# easy_install google | |
# https://pypi.python.org/pypi/google | |
try: | |
import re | |
import sys |
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/python | |
""" | |
Usage: check_ssl_certificate -H <host> -p <port> [-m <method>] | |
[-c <days>] [-w <days>] | |
-h show the help | |
-H <HOST> host/ip to check | |
-p <port> port number | |
-m <method> (SSLv2|SSLv3|SSLv23|TLSv1) defaults to SSLv23 | |
-c <days> day threshold for critical |
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 python3 | |
from nmap import PortScanner | |
netws = [ | |
'a.b.c.d/24', | |
'a.b.c.d/23', | |
] | |
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 python3 | |
import os | |
while True: | |
line = input('> ') | |
line_array = line.split() | |
pid = os.fork() | |
if not pid: | |
os.execvp(line_array[0], line_array) |
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 python3 | |
# Please install pyVmomi first. | |
# i.e. | |
# pip install pyvmomi | |
# | |
from pyVim import connect | |
from pyVmomi import vmodl | |
from pyVmomi import vim | |
import re |
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 asyncio | |
import aiohttp | |
@asyncio.coroutine | |
def get_status(url): | |
code = '000' | |
try: | |
res = yield from asyncio.wait_for(aiohttp.request('GET', url), 4) | |
code = res.status |