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 | |
''' Creates wordlists from web scraping. BeautifulSoup requierd (pip install beautifulsoup) ''' | |
import sys | |
import os | |
import robotparser | |
from BeautifulSoup import BeautifulSoup as bs | |
import urllib2 | |
from urlparse import urlparse |
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 sys, string, re | |
""" | |
Brute.py script to statistically break simple replacement ciphers. | |
Named after Ceasars killer. | |
Called with | |
python brute.py -m 'some text to break' | |
or | |
python brute.py -f filewithcypher.txt |
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 requests | |
import time | |
COURSE_NAME = "Kompilatorteknik" | |
""" Byt ut COURSE_NAME till kursen du letar efter. Botten crawlar sedan och hojtar till om den hittar din kurs labbanmälningsformulär. | |
Kommer även skriva ner datan till fil om ditt sökord inte fungerade och du vill kolla för hand. | |
GLÖM EJ ÄNDRA PATH TILL FILEN DU VILL SKRIVA TILL""" | |
f = open("/path/to/file/sites.txt", "a") |
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 urllib | |
import requests | |
from BeautifulSoup import BeautifulSoup | |
""" CHANGE PATH TO DIRECTORY IN WHICH TO SAVE FILES AND ALL IS WELL""" | |
PATH = "path/to/file" | |
url = "http://brasscockroach.com/h4ll0w33n2007/manga/Amigara-Full/Amigara-0.html" | |
img_url = "http://brasscockroach.com/h4ll0w33n2007/manga/Amigara-Full/" | |
r = requests.get(url) | |
count = 0 |
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
""" | |
Why is division by two slower than bitshift in python? | |
Should the "compiler" represent this in the same way. | |
> python shiftordivide.py | |
Divided mean time took 0.027 | |
Shift mean time took 0.008 | |
>pypy shiftordivide.py --OJit | |
Divided mean time took 0.034 |
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 numpy as np | |
import matplotlib.pyplot as plt | |
import sys | |
def main(): | |
if len(sys.argv) == 1 or "-h" in sys.argv or "--help" in sys.argv: | |
print "python lagrange.py <x1.y1> .. <x_k.y_k>" | |
print "Example:" | |
print "python lagrange.py 0.1 2.4 4.5 3.2" |
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 getpass | |
import imaplib | |
import ConfigParser | |
import httplib | |
import urllib | |
import pastebin | |
import emailfilter | |
#Add filters here | |
email_filters = [emailfilter.ExampleFilter(), emailfilter.SwedishKeywordFilter()] |
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 time,sys | |
from random import randint | |
class node(): | |
def __init__(self, child1, child2, data): | |
self.left = child1 | |
self.right = child2 | |
self.data = data | |
def __str__(self): | |
return str(self.data) |
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
""" A small script to crawl a website with some songs on it and put it in a JSON file format.""" | |
import requests, re, json | |
re.DEBUG = True | |
URL = "http://www.hedin.mobi/sangbok/lista.php" | |
if __name__ == "__main__": | |
r = requests.get(URL) | |
reg = re.compile(r"<h2>(.+?)</h2><p>Melodi:(.*?)</p><p>(.+?)</p>") | |
songs = reg.findall(r.content.replace("\r\n", '').decode('iso8859-1')) | |
song_list = [] |
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 serial | |
import time | |
import sys | |
from os import system | |
class JoystickReader(): | |
def __init__(self): | |
try : |
OlderNewer