Skip to content

Instantly share code, notes, and snippets.

View pathcl's full-sized avatar

Luis San Martin pathcl

View GitHub Profile
@pathcl
pathcl / fixnan.sh
Created August 27, 2015 20:49
fixnan cacti
#!/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
@pathcl
pathcl / googlesearch.py
Last active August 28, 2015 14:23
googlesearch.py
#!/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
#!/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,