Monday, 17 August 2015

Usefull linux commands

Recursively Zip a Directory and Files on Linux

zip -r filename.zip /path/to/folder
to unzip to current directory,
unzip file.zip -d .
To get the size of directory
 du -sh dirname 

Monday, 22 December 2014

A quick way to generate lorelm ipsum text

I created a small application using appspot to generate lorelm ipsum text quickly and add free one.

http://quicklorem.appspot.com/

I think i will explain you how i created and it will be helpful for others to learn appospot's initials.

Thursday, 24 July 2014

Friday, 25 January 2013

slow ssh connection on ubuntu

Simply edit sshd_config  by typing

 >> sudo vim /etc/ssh/sshd_config

Add the line to the bottom of file

UseDNS no




Restart the ssh service


>> sudo service ssh reload

After this it will not delay for ssh login.

Tuesday, 31 July 2012

Monday, 25 June 2012

Wordpress - set the large image size in editor

The large image size will be depend on the global variable $content_width.


Even if we change the settings in the media settings to a bigger one, we have to put the width to $content_width.


  In functions.php inside the active theme folder, 
   change like this,
   


if ( ! isset( $content_width ) ) 
$content_width = 754;







Monday, 23 April 2012

Javascript array length problem

There is a problem in javascript array.length property.

var myOtherArray = [];
myOtherArray[100] = ‘one’;
and its length property would actually return 101 instead of 1.


Use this function  for correct result ,
function count(array)
{
   var c = 0;
   for(i in array) // in returns key, not object
   if(array[i] != undefined)
   c++;
   return c;
}