Category: Code

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…

Script to Convert FLV to AVI

This will convert a flv file to a avi file. I got this off It uses mencoder – so…

Building an RPM from a Spec File

Use this command to build an RPM if you have a Spec File rpmbuild -ba SPEC_FILE