Skip to content

Instantly share code, notes, and snippets.

@averagesecurityguy
averagesecurityguy / pdf_flatedecode.py
Last active October 2, 2024 19:10
Decompress FlateDecode Objects in PDF
#!/usr/bin/env python3
# This script is designed to do one thing and one thing only. It will find each
# of the FlateDecode streams in a PDF document using a regular expression,
# unzip them, and print out the unzipped data. You can do the same in any
# programming language you choose.
#
# This is NOT a generic PDF decoder, if you need a generic PDF decoder, please
# take a look at pdf-parser by Didier Stevens, which is included in Kali linux.
# https://tools.kali.org/forensics/pdf-parser.
#
@SeijiEmery
SeijiEmery / gist:c483196ea317eab3a328
Last active January 5, 2017 00:29
Lightweight js vec3 impl with experimental dynamic type checking
// Defines a better type querry function that enables object prototypes to define their own type repr
$typeof = function(value) {
return value.__proto__.type || typeof(value);
}
// Switch to 'release' (or any other value) to disable expensive typechecking.
releaseMode = 'debug';
@datagrok
datagrok / gist:2199506
Last active August 22, 2024 14:21
Virtualenv's `bin/activate` is Doing It Wrong
@jsocol
jsocol / gist:1568904
Created January 6, 2012 04:03
Bookmarklet to add inline full-size images to Reddit.
javascript: (function () {
var things = document.querySelectorAll("div.thing");
for (var j = things.length - 1; j > 0; j--) {
var thing = things[j],
entry = thing.querySelectorAll("div.entry")[0],
thumb = thing.querySelectorAll("a.thumbnail")[0],
img = new Image;
img.style.display = 'block';
if (thumb) {
var href = thumb.href;
/*****************************************************************************
* Copyright (c) 2011 Kenneth Waters
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
@edwardgeorge
edwardgeorge / setup.py
Created July 11, 2011 22:22
python libxml2 binding package for easy installation with pip/easy_install into a virtualenv
import os
import shutil
import subprocess
import sys
import tarfile
import urllib2
LIBXML2_PREFIX = "libxml2"
LIBXSLT_PREFIX = "libxslt"
LIBXML2_FTPURL = "ftp://xmlsoft.org/libxml2/"