This file contains hidden or 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 pygeoip | |
gi = pygeoip.GeoIP('/opt/GeoIP/Geo.dat') | |
def printRecord(tgt): | |
rec = gi.record_by_name(tgt) | |
city = rec['city'] | |
#Note in older versions of pygeoip region_code is region_name | |
region = rec['region_code'] | |
country = rec['country_name'] |
This file contains hidden or 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 argparse, urllib2, re, bs4 | |
from bs4 import BeautifulSoup | |
def parseWord(word): | |
url = "http://www.wordfind.com/ends-with/{0}/".format(word) | |
urlContent = urllib2.urlopen(url).read() | |
soup = BeautifulSoup(urlContent) | |
predicate = {'href' : re.compile("/word/.*")} | |
letterCount = len(soup.find(**predicate).get_text()) |
This file contains hidden or 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 os | |
from _winreg import * | |
def returnDir(): | |
dirs=['C:\\Recycler\\','C:\\Recycled\\','C:\\$Recycle.Bin\\'] | |
for recycleDir in dirs: | |
if os.path.isdir(recycleDir): | |
return recycleDir |
This file contains hidden or 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 pip | |
from subprocess import call | |
for dist in pip.get_installed_distributions(): | |
call("pip install --upgrade " + dist.project_name, shell=True) |
This file contains hidden or 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 ftplib | |
def anonLogin(hostname): | |
try: | |
ftp = ftplib.FTP(hostname) | |
ftp.login('anonymous', '[email protected]') | |
print '\n[*] ' + str(hostname) + ' FTP Anonymous Logon Succeeded.' | |
ftp.quit() |
This file contains hidden or 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 argparse, pxssh | |
class Client: | |
def __init__(self, host, user, password): | |
self.host = host | |
self.user = user | |
self.password = password | |
self.session = self.connect() |
This file contains hidden or 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 validateFile(): | |
if len(sys.argv) == 2: | |
filename = sys.argv[1] | |
if not os.path.isfile(filename): | |
print '[-] ' + filename + ' does not exist.' | |
exit(0) | |
if not os.access(filename, os.R_OK): | |
print '[-] ' + filename + ' access denied.' | |
exit(0) | |
print '[+] Reading Vulnerabilities From: ' + filename |
This file contains hidden or 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 praw, time | |
USERNAME = "blendt" | |
PASSWORD = "MYPASSWORD" | |
WAIT = 60 | |
WAITS = str(WAIT) | |
r = praw.Reddit("Comment Deleter") | |
r.login(USERNAME, PASSWORD) |
This file contains hidden or 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
public BigInteger uniformNumber(BigInteger max) { | |
// Get the bit count of a number (rounding up) | |
double bit_count = BigInteger.Log(max, 2); | |
int length = (int)Math.Ceiling(bit_count); | |
// Grab some random int from the persisted random instance | |
int random_int = random.Next(); | |
// Generate some BigInt with at least bit_count above | |
BigInteger random_number = 0; |
This file contains hidden or 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
#This will edit all of your reddit comments to be blank and then delete them so the originals will be erased forever | |
# This gist is now deprecated, go here for the updated version: https://github.com/THEMVFFINMAN/Reddit-History-Eraser | |