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 os | |
try: | |
device = os.open("/dev/ttyUSB0", os.O_RDWR) | |
while 1: | |
print(os.read(device,255)) | |
finally: | |
os.close(device) |
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
# all num is converted into float | |
def currency_format(num): | |
sol = str(float(num)).split(".") | |
sol[0] = sol[0][::-1] | |
final = "" | |
while len(sol[0]): | |
sol_r_e = sol[0][:3]#slice (get 3 characters) | |
sol[0] = sol[0][3:]#slice (decrease) | |
if len(sol_r_e) == 3 and not len(sol[0]) == 0:sol_r_e += "," | |
final += sol_r_e |
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
document.getElementsByClassName("jsx-963942478 paywallWrapper")[0].remove(); | |
document.querySelector("body").setAttribute("style", "overflow: scroll;"); |
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
from HTMLParser import HTMLParser | |
class MyHTMLParser(HTMLParser): | |
def handle_starttag(self, tag, attrs): | |
print("Start tag:", tag) | |
for attr in attrs: | |
print(" attr:", attr) | |
def handle_endtag(self, tag): | |
print("End tag :", tag) |
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 python | |
# | |
# Requires: | |
# - scapy | |
# - tcpreplay | |
import sys | |
from scapy.all import * | |
if len(sys.argv) != 6: |
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
/*HTML5Player Video Downloader using JavaScript. Proof of concept: x_*n_*x*_x_ LOL! */ | |
window.location=html5player.url_high; | |
/* | |
//or option 2: | |
obj=document.getElementsByClassName("transition")[2]; | |
obj.setAttribute("href",html5player.url_high); | |
obj.innerHTML="<h1>" + html5player.video_title + "</h1>"; | |
*/ |
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
#ch5_html_form_brute_force.py | |
from html.parser import HTMLParser | |
import urllib.request | |
import urllib.parse | |
import http.cookiejar | |
import queue | |
import threading | |
import sys | |
import os |
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 truly minimal HTTP-Tor proxy | |
import sys | |
major_version = sys.version_info.major | |
if major_version == 2: | |
import SocketServer | |
import SimpleHTTPServer | |
elif major_version == 3: | |
import http.server as SimpleHTTPServer |
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 | |
''' | |
Added some modificationss | |
1. saving line for every 1024 digits. | |
2. notify if it scored million. | |
''' | |
def calcPi(): | |
q, r, t, k, n, l = 1, 0, 1, 1, 3, 3 |