Category: Code

git push

Command to push the current repository in git to a online server git push

Sort by Line Length

Sort file by line length. Original Article… cat /etc/passwd | awk ‘{print length, 0}’ | sort -n | awk ‘{1=””;…

Change shell

Change shell command chsh

Random Password in PHP

A simple way to create a random password in PHP $password = substr(md5(time()), 0, rand(4,8));

Finding the Factorial using Recursion

Finding the Factorial using Recursion in javascript. function factorial(x) { if(x

Download Multiple URLs

Command to download a series of urls with zero padding files… for ((i=1;i

Remove www From URL using .htaccess in Apache

This htaccess code will remove the ‘www’ part from the url. It uses the mod_rewrite module of apache to re-write…

Remove a Folder from Git

Remove a given folder from a Git repository… git rm -r cache/

Remove SVN Info from a Folder

This command removes the SVN data from a folder. find -name .svn -exec rm -rf {} \;

Zero Padding In Linux Commands

This is how you zero pad a numerical variable in bash. for ((x=1;x<=31;x+=1)); do echo `printf “%02d” $x`; done Original…