Skip to content

Instantly share code, notes, and snippets.

@mchubby
mchubby / yaml-consumer.pl
Last active October 14, 2015 09:15
A tidbit showing how to get a YAML file for later parsing (place both pure-perl modules in a vendor/ subdir)
use warnings; use strict; use 5.010;
use File::Basename "dirname";
use lib dirname(__FILE__)."/vendor"; # modify @INC
use HTTP::Tiny;
use YAML::Tiny;
my ($username, ) = @ARGV;
die("ERR-Manque arg1 (username)") unless $username;
my $url = 'http://pastebin.com/raw.php?i=PYmvwsZ2';
@mchubby
mchubby / pack Willscript WSC.py
Created December 2, 2013 18:37
I don't remember where I got this. Probably a Chinese forum.
#py3.2
#encoding=utf-8
from struct import unpack,pack
import os
from os import path
from pdb import set_trace as int3
@mchubby
mchubby / DocDb-bootloop.csv
Created December 16, 2016 20:05
DocumentDB Emulator 1.11.72.11 bootloops
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 2.
Event Name;Time MSec;Process Name;Rest
Windows Kernel/Process/Start;304,481;DocumentDB.Emulator (4124);ThreadID="-1" ProcessID="4 124" ParentID="9 336" ImageFileName="DocumentDB.Emulator.exe" PageDirectoryBase="0x1c0a6f000" Flags="None" SessionID="1" ExitStatus="259" UniqueProcessKey="0xffffb682faf75080" CommandLine=""C:\Program Files\DocumentDB Emulator\DocumentDB.Emulator.exe"" PackageFullName="" ApplicationID=""
Windows Kernel/Process/Start;835,356;DocumentDB.StartupEntryPoint (8360);ThreadID="-1" ProcessID="8 360" ParentID="4 124" ImageFileName="DocumentDB.StartupEntryPoint.exe" PageDirectoryBase="0x1f30e5000" Flags="None" SessionID="1" ExitStatus="259" UniqueProcessKey="0xffffb682fd7e6080" CommandLine=""C:\Program Files\DocumentDB Emulator\Packages\GatewayService\GatewayService.Code\DocumentDB.StartupEntryPoint.exe" "GatewayService"" PackageFullName="" ApplicationID=""
Windows Kernel/Process/Start;845,443;conhost (11132);ThreadID="-1" ProcessID="11 132" ParentID="8 360" ImageFileName="conhost.exe" Page
@mchubby
mchubby / thread2-abort.py
Last active February 20, 2017 01:02 — forked from jazzycamel/thread2.py
Simple example of threaded loop with abort handling (QMutex.tryLock) -- using standalone Qt.py (untested on PyQt4)
import sys
from random import uniform
import time
import threading
from itertools import count, islice
from vendor.Qt.Qt import QtCore, QtGui, QtWidgets
from vendor.Qt.Qt.QtWidgets import (
QApplication,
QLabel,
@mchubby
mchubby / background.js
Created March 19, 2017 23:14
insertCSS-all-testcase: manifest.json permission testcase (https://developer.chrome.com/extensions/declare_permissions)
const CSS = "body { background-color: #999; }"
// update when the extension loads initially (all tabs)
browser.tabs.query({}).then((tabs) => {
for (tab of tabs) {
initializePageAction(tab);
}
});
/*
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<title>HTML5 multiple Canvas example</title>
<script>
window.onload=function() {
var w3rcontext1=document.getElementById("w3rCanvasTag1").getContext('2d');
var w3rcontext2=document.getElementById("w3rCanvasTag2").getContext('2d');
var w3rcontext3=document.getElementById("w3rCanvasTag3").getContext('2d');
var w3rcontext4=document.getElementById("w3rCanvasTag4").getContext('2d');
@mchubby
mchubby / e.b.l.i.e.v.a.js
Last active August 19, 2017 17:54
e.b.l.i.e.v.a.js
// PreReq: Inject FileSaver.js + jszip.js
// note: pages are periodically purged, automatically
_xbl._xct.prototype.clear = function () { }
zip = JSZip()
var unbound_saver = function (blob, filename, resolve_callback) {
zip.file(filename, blob)
resolve_callback()
@namespace epub "http://www.idpf.org/2007/ops";
.bold {
font-weight: bold;
}
.italic {
font-style: italic;
}
.center {
text-align: center;
}
@mchubby
mchubby / isfunpackscripts.py
Created April 21, 2018 21:06
0x9597 ISF decryption scripts (D.O.)
# By Kelebek1@fuwa
# From https://pastebin.com/GmQyfR0h
# 0x9597 ISF decryption scripts
import os
import sys
import struct
def get_data(filename):