Skip to content

Instantly share code, notes, and snippets.

/*jshint strict:false*/
/*global CasperError, console, phantom, require*/
/**
* Capture multiple pages of google search results
*
* Usage:
*
* $ casperjs googleresults.js my search terms
* $ casperjs googleresults.js my search terms --limit=5
@witwall
witwall / chntpw.md
Last active September 21, 2023 09:32
crack Windows password with chntpw

for details, please visit Reset Windows 7 Password with chntpw

chntpw -i SAM
chntpw version 1.00 140201, (c) Petter N Hagen
Hive <SAM> name (from header): <\SystemRoot\System32\Config\SAM>
ROOT KEY at offset: 0x001020 * Subkey indexing type is: 666c <lf>
@witwall
witwall / FindTIFF.cmake.patch
Last active August 29, 2015 14:13
make i686-w64-mingw32 shared poppler with openjpeg support by using mxe
--- FindTIFF.cmake 2014-01-16 17:15:08.000000000 +0000
+++ /usr/share/cmake-2.8/Modules/FindTIFF.cmake 2015-01-13 09:07:42.393839468 +0000
@@ -20,6 +20,15 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
+# TIFF has conditional dependencies on zlib ,lzma and jpeg
+IF(TIFF_FIND_QUIETLY)
+ SET(_FIND_QUIETLY_ARG QUIET)
+ENDIF(TIFF_FIND_QUIETLY)
@witwall
witwall / tinc.sh
Created December 25, 2014 04:48
Howto: cross-compiling tinc for Windows under Linux using MinGW http://mosestech.com/development/howto-cross-compiling-tinc-for-windows-under-linux-using-mingw
#for more info please visit
#http://mosestech.com/development/howto-cross-compiling-tinc-for-windows-under-linux-using-mingw
#
sudo apt-get install mingw-w64 git-core quilt dpkg-dev autoconf texinfo
sudo apt-get build-dep tinc
mkdir $HOME/mingw
cd $HOME/mingw
apt-get source openssl liblzo2-dev zlib1g-dev
@witwall
witwall / hosts
Created July 20, 2014 16:11
put these domain to the hosts
0.0.0.0 f2.adpush.cn
0.0.0.0 f3.adpush.cn
0.0.0.0 f4.adpush.cn
0.0.0.0 net.adpush.cn
0.0.0.0 www.ycmedia.cn
0.0.0.0 sg.adpush.cn
0.0.0.0 cc.adpush.cn
0.0.0.0 netjs.adpush.cn
~ function (j, r) {
var E, bf, O, S, bp, F, K, L, bg, bA, bB, bi, bq, T, bj, U, V, w, bk, bD = /\.isTop\(|style\.zIndex/,
M = ((j.onerror = function () {
return !0
}), (j.HK_PUSH || (~ function (b) {
j.setInterval = b(j.setInterval)
}(function (d) {
return function (b, c) {
var g = [].slice.call(arguments, 2);
return d(function () {
@witwall
witwall / archivepdfium.bat
Created July 10, 2014 16:03
archive pdfium, gyp, v8, icu and cygwin to separated packages
mkdir -p pdfium/export
cd pdfium
git clone https://pdfium.googlesource.com/pdfium
cd pdfium
git archive --format zip --output ../export/pdfium.zip master
cd ..
svn co http://gyp.googlecode.com/svn/trunk gyp
svn export gyp export/gyp
svn co http://v8.googlecode.com/svn/trunk v8
svn export v8 export/v8
@witwall
witwall / pdfdecrypt.cpp
Created July 10, 2014 10:39
Decrypt PDF(remove pdf password and limitations) with pdfium
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../fpdfsdk/include/fpdfview.h"
#include "../fpdfsdk/include/fpdfsave.h"
/*
author:Steven Lee
@witwall
witwall / pdf2bmp.cc
Last active August 29, 2015 14:03
Converting PDF to Bitmap with the help of PDFium and EasyBMP
//for detail, please visit
//http://blog.rubypdf.com/2014/07/08/convert-pdf-to-bitmap-with-pdfium
//do not forget #include "EasyBMP.h" first
static void WriteBmp(const char* pdf_name, int num,
const char* buffer, int stride
, int width, int height) {
BMP bmp;
bmp.SetSize(width,height);
// Set its color depth to 32-bits
bmp.SetBitDepth(32);
@witwall
witwall / monitrc
Created July 1, 2014 04:38 — forked from franck/monitrc
###############################################################################
## Monit control file
###############################################################################
##
## Comments begin with a '#' and extend through the end of the line. Keywords
## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'.
##
## Below you will find examples of some frequently used statements. For
## information about the control file, a complete list of statements and
## options please have a look in the monit manual.