- You have Ghostscript installed, right? Otherwise
sudo apt-get install ghostscript
- This is important and installs the headers (
iapi.h
etc) which are required but don't come with the default Ghostscript package:sudo apt-get install libgs-dev
- I also needed
sudo apt-get install gs-esp
- For me the pre compiled version of ImageMagick never accepted Ghostscript, so let's remove it:
sudo apt-get --purge remove imagemagick
- Get the source of ImageMagick, untar it,
cd ImageMagick-xx
./configure --with-gslib=yes
[and what else you need]- Confirm in the output near the bottom
gslib yes yes
and notgslib yes no
make
make install
- Run
convert -list configure | grep DELEGATES
=>DELEGATES bzlib djvu freetype gs jpeg jng jp2 lcms png tiff x11 xml zlib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install ffmpeg ghostscript libgs-dev build-essential autoconf automake autopoint chrpath cm-super-minimal debhelper dh-autoreconf dh-strip-nondeterminism doxygen doxygen-latex gir1.2-rsvg-2.0 graphviz libbz2-dev libcairo-script-interpreter2 libcairo2-dev libcdt5 libcgraph6 libclang1-3.6 libdjvulibre-dev libexif-dev libfftw3-bin libfftw3-dev libfftw3-long3 libfftw3-quad3 libfile-stripnondeterminism-perl libfontconfig1-dev libfreetype6-dev libgdk-pixbuf2.0-dev libglib2.0-dev libgvc6 libgvpr2 libharfbuzz-dev libharfbuzz-gobject0 libice-dev libilmbase-dev libjasper-dev libjbig-dev libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev libjs-jquery liblcms2-dev libllvm3.6v5 liblqr-1-0-dev liblzma-dev libobjc-5-dev libobjc4 libopenexr-dev libpango1.0-dev libpathplan4 libpcre3-dev libpcre32-3 libpcrecpp0v5 libperl-dev libpixman-1-dev libpng12-dev libpotrace0 libptexenc1 libpthread-stubs0-dev librsvg2-bin librsvg2-dev libsigsegv2 libsm-dev libsynctex1 libtexlua52 libtexluajit2 libtiff5-dev libtif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
private function parseRawData2($str) | |
{ | |
if (preg_match_all( | |
"/<div class=\"result-link\">.+<h3>.+<a href=\"([^\s]*)\".+title=\"(.*)\" class.+>.+<div class=\"excerpt\">(.+)<\/div>/Usi", | |
$str, | |
$m | |
)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo adduser existingUser www-data | |
sudo chown -R www-data:www-data /var/www | |
sudo chmod -R g+rwX /var/www |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ubuntu | |
#install phantomjs 2.1.1 | |
#32bit | |
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-i686.tar.bz2 | |
#64bit | |
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 | |
mkdir -p /usr/local/share/phantomjs | |
tar -xjvf phantomjs-2.1.1-linux-*.tar.bz2 --strip-components=1 -C /usr/local/share/phantomjs/ | |
ln -sf /usr/local/share/phantomjs/bin/phantomjs /usr/local/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#deb cdrom:[Ubuntu 18.04 LTS _Bionic Beaver_ - Release amd64 (20180426)]/ bionic main restricted | |
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to | |
# newer versions of the distribution. | |
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted | |
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted | |
## Major bug fix updates produced after the final release of the | |
## distribution. | |
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert PhantomJs cookies to NetScape HTTP cookie file format | |
// NOTE: It dose not create NetScape HTTP cookie file, this function return only cookie file contents | |
// NOTE: PhantomJs do not store "host only" cookie param, all cookies will have "host only" param set to false (line 15) | |
// I use this function to export PhantomJs cookies to CURL cookiejar file | |
// This is modified version of EditThisCookie cookie_helpers.js cookiesToString function | |
// USAGE: phantomJsCookiesToNetScapeString(phantom.cookies); | |
var phantomJsCookiesToNetScapeString = function(cookies) { | |
var string = ""; | |
string += "# Netscape HTTP Cookie File\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = 'http://localhost/index.php'; //change me | |
$user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:7.0.1) Gecko/20100101 Firefox/7.0.1'; | |
$ch = curl_init(); | |
curl_setopt($ch,CURLOPT_URL,$url); | |
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); | |
curl_setopt($curl,CURLOPT_USERAGENT,$user_agent); | |
$result=curl_exec($ch); | |
curl_close($ch); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
just for urgent needed, dont spam this. | |
Just copy this script into web console and run the function. | |
If you want to download the image, just edit downloadFile=true | |
Note: | |
- workflow: get all image src or div background-image, then filter it as our needs | |
- you can edit this file to scrape another website if you want. just change my regex or remove it | |
Usage: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$data = json_decode(file_get_contents('php://input')); | |
$url = null; | |
if($data){ | |
$request_type = 'JSON'; | |
$url = isset($data->target_url)?$data->target_url:null; | |
}elseif(isset($_POST)){ | |
$request_type = 'POST'; | |
$data = isset($_POST)?$_POST:null; |