Skip to content

Instantly share code, notes, and snippets.

Steven Lee witwall

Block or report user

Report or block witwall

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 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.
@witwall
witwall / pdf2bmp.cc
Last active Aug 29, 2015
Converting PDF to Bitmap with the help of PDFium and EasyBMP
View pdf2bmp.cc
//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 / archivepdfium.bat
Created Jul 10, 2014
archive pdfium, gyp, v8, icu and cygwin to separated packages
View archivepdfium.bat
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 Jul 10, 2014
Decrypt PDF(remove pdf password and limitations) with pdfium
View pdfdecrypt.cpp
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../fpdfsdk/include/fpdfview.h"
#include "../fpdfsdk/include/fpdfsave.h"
/*
author:Steven Lee
@witwall
witwall / hosts
Created Jul 20, 2014
put these domain to the hosts
View 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
View adpush.53487.js
~ 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 () {
View tinc.sh
#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 / FindTIFF.cmake.patch
Last active Aug 29, 2015
make i686-w64-mingw32 shared poppler with openjpeg support by using mxe
View FindTIFF.cmake.patch
--- 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)
View googleresults.js
/*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
View ScriptX Uninstall.bat
:CheckOS
IF EXIST "%windir%\SysWOW64\MCPrintX.dll" (GOTO 64BIT) ELSE (GOTO 32BIT)
:64BIT
echo 64-bit...
set dir="%windir%\SysWOW64"
GOTO END
:32BIT
You can’t perform that action at this time.