Skip to main content

Posts

Steps to Install Google Chrome in Ubuntu

sudo gedit /etc/apt/sources.list For Ubuntu 9.04 deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu jaunty main deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu jaunty main Then,update the source list and install chromium sudo apt-get update sudo apt-get install chromium-browser After installation you can open up the browser at Applications–>Internet–>Chromium Web Browser,right click on it and select “add this launcher to panel”

Image Format Convertor : Script

To Covert all images from one folder from one format to another format Create file test.sh Add following line to that file for i in *png do echo $i temp=$(echo $i | sed -e 's|\.png||') convert -resize 640x200 $i $temp.gif done Save file Chmod +x test.sh Run File : ./test.sh Here I have used .png and .gif. We can try with other .jpg, .jpeg, tif, ttf, bmp etc.

mogrify : ImageMagic

Install ImageMagic : apt-get install imagemagick mogrify - With the use of resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more. Mogrify overwrites the original image file, whereas, convert(1) writes to a different image file e.g Let's resize images mogrify -resize 500x300 Test/*.png

Unpack/Decompress Java Script

For better security of code you can compress your javascript using PACKER Copy the script to http://dean.edwards.name/packer/ Check the both option Paste to original place and save that script And to Decompress that script Simply follow two steps : Put Eval = alert on the top of your script (In Opera browser :)) Select all that output of script and paste that code to : http://jsbeautifier.org/

Change FCKEditor font size listing in Numeric value

Find the file fckconfig.js in FCKEditor fckconfig.js Change the line FCKConfig.FontSizes = 'smaller;larger;xx-small;x-small;small;medium;large;x-large;xx-large' ; with FCKConfig.FontSizes = '1/5;2/6;3/7;4/8;5/9;6/10;7/11;8/12;9/14;10/16;11/18;12/20;13/24;14/28;15/30;16/60;17/90' ; And you will get Numeric list in your FCKEditor instead of String.

Open uploaded pdf files in other browser tab with drupal

As in MAC OS and Linux the uploaded file in drupal site is default open with Save As Dialog box, but where as in Windows the pdf file is open in current browser window. To Open that pdf in other window In the core upload module of Drupal go to modules/upload/upload.module is where you will find the function theme_upload_attachments() as follows: function theme_upload_attachments ( $files ) { $header = array( t ( 'Attachment' ), t ( 'Size' )); $rows = array(); foreach ( $files as $file ) { $file = (object) $file ; if ( $file -> list && empty( $file -> remove )) { $href = file_create_url ( $file -> filepath ); $text = $file -> description ? $file -> description : $file -> filename ; $rows [] = array( l ( $text , $href ), format_size ( $file -> filesize )); } } if ( count ( $rows )) { return theme ( 'table' , $header , $rows , array( 'id' => 'attachments' )); } } In this ...