Wednesday, March 27, 2013

Working with GhostScript : Convert PDF to images using ghostscript


Ghostscript is an interpreter for PostScript™ and (PDF) files, lets see how we can use it convert PDF to images.

-Install Ghostscript (I am using ubunutu, so I can perform)
sudo apt-get install ghostscript

- run these script via console to make images from pdf

gs -dUseCropBox -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dAdjustWidth=0 -dNOPROMPT -sDEVICE=jpeg -dSAFER -dBATCH -dNOPAUSE -r140 -dJPEGQ=80  -dFirstPage='1' -dLastPage='8' -sOutputFile=/tmp/output/image-%d.jpg /tmp/downloads/sample.pdf

You can see output like this :


and your output folders will list your images :




FYI - Params :
-dFirstPage and -dLastPage specifies page limits , which is optional
-sOutputFile [output file] [input file]




:)


Wednesday, March 6, 2013

How to add force quit option in ubutnu 12.04

Just got updated my ubuntu version to 12.04 , One of my favorite tool was missing there -Force Quit .
Followed these step and I restored it there in panel

1- create a file named 'Force_Quit.desktop' and contents should be like this

[Desktop Entry]
Name=Force Quit
Comment=Force Kill an Unresponsive Running Application or Window
Exec=xkill
Icon=gnome-panel-force-quit
Terminal=false
Type=Application
StartupNotify=true

2- Place it applications folder , you can open application folder directly using these command
    nautilus ~/.local/share/applications/
3- Drag and drop 'Force_Quit.desktop' file in to Unity launcher.

Thats it !








Tuesday, May 8, 2012

How to check if a controller exists using Zend Framework

Have you ever wondered how to check if a controller/action exist in zend FM from any side of app ? Here is the code

        $front = Zend_Controller_Front::getInstance();
        $dispatcher = $front->getDispatcher();

        $test = new Zend_Controller_Request_Http();
        $test->setParams(array(
            'action' => 'index',
            'controller' => 'content',

                )
        );

        if($dispatcher->isDispatchable($test)) {
            echo "yes-its a controller";
            //$this->_forward('about-us', 'content'); // Do whatever you want
        } else {
            echo "NO- its not a Controller";
        }



Tuesday, March 20, 2012

cool js beautifier

Hi,

Just fond a good js beautifier at http://jsbeautifier.org/ , you can use it for extracting minified js too ,
Njoy

Wednesday, February 15, 2012

facebook heatmap

Here is how facebook heat-map look like ..



more on -

http://mashable.com/2011/11/30/social-profile-eye-tracking/

Monday, February 13, 2012

WordPress Plugins that Boost up your Blog

Search Regex
Redirection
Bing 404
WordPress SEO
Hyper Cache
FB Open Graph
404 Email Notifier
SlideShare
Smart YouTube
YARRP
WP Optimize
WP-DBManager
Debug Queries
Auto Post Thumbnail
Regenerate Thumbnails
Google XML Sitemaps
XML Video Sitemap
Date in a Nice Tone

.. more you can find on -- http://www.labnol.org/software/must-have-wordpress-plugins/14034/

Friday, February 3, 2012

Add custom domains to Your openshift account


Hurray !!


It is now possible to use rhc-ctl-app -a appname -c add-alias --alias www.mydomain.com

and then in your DNS management for mydomain.com you can add a cname to point www.mydomain.com to app-namespace.rhcloud.com.