Skip to content

Instantly share code, notes, and snippets.

View angeloped's full-sized avatar

Angeloped angeloped

  • Philippines
View GitHub Profile
@angeloped
angeloped / serial_monitor.py
Last active May 29, 2019 08:50
A simple low-level I/O serial monitor using Python os.open() on Linux.
import os
try:
device = os.open("/dev/ttyUSB0", os.O_RDWR)
while 1:
print(os.read(device,255))
finally:
os.close(device)
@angeloped
angeloped / currency_formatter.py
Last active June 24, 2019 12:41
A currency formatter written in Python.
# 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
@angeloped
angeloped / bypass_subscription.js
Last active June 24, 2019 12:42
This is the script for MIT Tech Review articles subscription bypass. Happy hacking!
document.getElementsByClassName("jsx-963942478 paywallWrapper")[0].remove();
document.querySelector("body").setAttribute("style", "overflow: scroll;");
@angeloped
angeloped / MyHTMLParser.py
Created July 4, 2019 03:21
A simple HTML parser with HTMLParser module for Python 2.X.
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)
@angeloped
angeloped / remove_banner.js
Created July 24, 2019 10:40
Remove powered by weebly.com banner javascript.
document.getElementById("signup-link-href").remove();
@angeloped
angeloped / udpflood_scapy.py
Created July 27, 2019 19:49 — forked from nextrevision/udpflood_scapy.py
Send a flood of UDP packets to a specific UDP port
#!/usr/bin/env python
#
# Requires:
# - scapy
# - tcpreplay
import sys
from scapy.all import *
if len(sys.argv) != 6:
@angeloped
angeloped / download_HTML5Player_content.js
Last active August 16, 2019 10:48
HTML5Player Video Downloader using JavaScript. Proof of concept: xDxNxXxD
/*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>";
*/
@angeloped
angeloped / ch5_html_form_brute_force.py
Created September 5, 2019 14:33 — forked from ismailakkila/ch5_html_form_brute_force.py
ch5_html_form_brute_force.py
#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
@angeloped
angeloped / proxy_http-tor.py
Last active September 12, 2019 03:28
A truly minimal HTTP-Tor proxy.
# 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
@angeloped
angeloped / pi.py
Last active September 13, 2019 06:41 — forked from markhamilton1/pi.py
pi is a Python script that computes each digit of the value of pi. As long as this script runs it continues to generate digits. As a matter of full disclosure, I did not write this. I am posting it here as a means of preserving the algorithm and making it available to others.
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