Skip to content

Instantly share code, notes, and snippets.

View icedraco's full-sized avatar
🐲
Rawr

IceDragon icedraco

🐲
Rawr
View GitHub Profile
@icedraco
icedraco / url-extractor.py
Created November 27, 2014 09:50
Simple regexp-driven URL extractor that looks for anchor tags in an HTML file and returns the HREF contents back
#!/usr/bin/python
### Simple RegExp-Driven URL Extractor (20141012.0118) by IceDragon
#
import re, sys, os
RE_ANCHOR_DQUOTES = re.compile('<a [^>]*href="([^"]*)"[^>]*>')
RE_ANCHOR_SQUOTES = re.compile("<a [^>]*href=s([^']*)s[^>]*>")
@icedraco
icedraco / url-extract-photobucket.py
Created November 27, 2014 09:52
Retrieves a library/album page from a given PhotoBucket URL and extracts all the URLs to the full images
###--# PhotoBucket URL Extractor 0.1 [20140730-2207]
#
# This script retrieves a library/album page from a given URL using urllib2 and
# extracts all the URLs to the full images featured in that page. The URLs are
# printed to stdout and can later be redirected through the shell.
#
# Author: IceDragon <icedragon at quickfox org>
import urllib2
import re
@icedraco
icedraco / gyazo-image-extractor.html
Created November 27, 2014 09:53
A standalone JavaScript-powered page that bypasses Gyazo pages and lets you see just the image without the extra nonsense
<!DOCTYPE html>
<html>
<head>
<title>Gyazo Image Extractor</title>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script>
var AUTOUPDATE_TIMEOUT = null;
function getImageUrl(input) {
var result = "";
@icedraco
icedraco / calling-bytecode.c
Created November 27, 2014 09:54
An example of running bytecode from within a C program
#include <string.h>
#include <sys/mman.h>
int main(void) {
char rawr[] = "Rawr!\n";
char bytecode[] = {
0x60, // pusha
0xb8, 0x04, 0x00, 0x00, 0x00, // mov eax, 4
0xbb, 0x01, 0x00, 0x00, 0x00, // mov ebx, 1
0xb9, /* for rawr */ 0,0,0,0, // mov ecx, 0
@icedraco
icedraco / android-hosts-patcher.py
Created November 27, 2014 11:22
A small bash script for Android that adds entries to the /etc/hosts file (particularly, to block Skype ads)
#!/system/xbin/bash
# This script helps block access to specific addresses via an Android phone.
# NOTE: This script must be run as root!
#
# Author: IceDragon <icedragon@quickfox.org>
hosts="
mobileads.msn.com
track.mobiyield.com
"
@icedraco
icedraco / cellgen.asm
Created November 27, 2014 11:23
Cellphone dictionary generator done in x86 assembly
;;; Cellphone Permutation Generator v1.0
;
; This is part of the Israeli cellphone permutation generator. This file
; implements the _start() function and provides a couple of functions, among
; which there's the generator.
;
; print(int fd, char* str)
; Prints a string to STDOUT
;
; int generate(int prefixDigit, char* filename)
@icedraco
icedraco / metrodan-bus-tracker.py
Created November 27, 2014 11:24
An SL4A (Android) Python script that polls the MetroDan station page and keeps track of ETAs for specific routes. The script notifies of ETA changes using Android's speech synthesis API.
###--# MetroDan Bus Tracker / Announcer 0.5.1a
# (c) 2013-2014 by IceDragon - All rights reserved
#
# This script Polls MetroDan "real-time" bus website and keeps the user
# informed of the buses they are interested in via Speech To Text.
#
# This script is still work-in-progress.
#
# Author: IceDragon <icedragon at quickfox org>
#
@icedraco
icedraco / PolynomDiagnostics.java
Created November 27, 2014 11:27
A generator/diagnostics class for the polynom validator. It was written in order to test a polynom calculator assignment at the university...
/**
* Polynom validator diagnostics class
*
* This class is responsible for checking the polynom validator, bringing up
* potentially suspicious polynoms that have either passed or failed, but
* possibly shouldn't have.
*
* Since the probability to hit those is very small, out of 1000 tests, the
* user will only have to check a few of those to make sure those random
* polynom strings are, indeed, valid (or invalid).
@icedraco
icedraco / web-crawler.sh
Created November 27, 2014 11:29
A web crawler done in BASH. Written for a friend at the Information Systems Engineering department.
#!/bin/bash
###
# A small script that recursively crawls a URL and fetches e-mail addresses from
# all the pages it can find. Written for a friend studying BASH for his Systems
# Engineering degree.
#
# Author: IceDragon <icedragon@quickfox.org>
# Contact: http://www.icerealm.org/contact
#
@icedraco
icedraco / path-compare.py
Created November 27, 2014 11:32
A small Python script that uses MD5 hashing to find duplicate files in different paths/collections. Originally made to weed through porn imagery...
##
# Path Compare Utility (20120729)
#
# A script example to help sort through different porn collections and weed out
# duplicate files between them!
#
# Syntax: python path-compare.py <target_path> <src_path> [src_path] [src_path] ...
#
# NOTE: There are some functions here that aren't used in main(). I left them
# there to be used through ipython or some other interactive shell.