Skip to content

Instantly share code, notes, and snippets.

View pathcl's full-sized avatar

Luis San Martin pathcl

View GitHub Profile
#!/usr/bin/env python
import threading, paramiko
cmd = "someCommand"
outlock = threading.Lock()
def workon(host):
try:
@pathcl
pathcl / gist:d5c71db64e9cedb6979e
Created May 13, 2015 12:56
google-hacks-scanner.py
#!/usr/bin/env python
import re
import sys
import google
import urllib2
if len(sys.argv) < 2:
print sys.argv[0] + ": <dict>"
sys.exit(1)
tarro$ cat google-scan.py
#!/usr/bin/env python
import re
import sys
import google
import urllib2
if len(sys.argv) < 2:
print sys.argv[0] + ": <dict>"
#!/usr/bin/env python
"""
vSphere Python SDK program for listing all ESXi datastores and their
associated devices
"""
import argparse
import atexit
from pyVim import connect
from pyVmomi import vmodl
#!/usr/bin/env python
import csv
import sys
import os
import json
import webbrowser
import httplib2
from oauth2client.file import Storage
from oauth2client.client import flow_from_clientsecrets
from oauth2client.tools import run
#!/usr/bin/env python
import csv
import sys
import os
try:
import gdata.spreadsheet.service
except ImportError, e:
errMsg = "please install gdata see http://goo.gl/Eg22wF :C"
print >> sys.stderr, errMsg
#!/usr/bin/env python
"""
vSphere Python SDK program for connecting a Vmware host
"""
import atexit
from pyVim import connect
service_instance = connect.SmartConnect(host='host',
user='user',
#!/usr/bin/env python
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.poolmanager import PoolManager
import ssl
class FixSSL(HTTPAdapter):
def init_poolmanager(self, connections, maxsize, block=False):
self.poolmanager = PoolManager(num_pools=connections,
maxsize=maxsize,
block=block,
@pathcl
pathcl / gist:3f71ae09457f01f3ad2b
Created July 24, 2015 15:29
session-counter.py
#!/usr/bin/env python
import requests
import warnings
import fixssl
import time
warnings.filterwarnings("ignore")
urls = [
@pathcl
pathcl / powerOn-by-uuid.py
Created August 7, 2015 15:03
Power on machines by uuid on VMware
#!/usr/bin/env python
# PowerOn machines based on uuid
from pyVim import connect
from tools import cli
from tools import tasks
from pyVmomi import vim
import ssl