Category: Code

Watch for Ubuntu 9.10 Launch

This script will run check for ubuntu launch once every 5 mins and let you know if there is an launch.

Replacing in Found Files

Replace one string by another in all file found by find. find . -name *whatyouwant* -exec perl -pi.bak -e ‘s/TEXT_TO_REPLACE/TEXT_TO_REPLACE_IT_WITH/g’…

Regular Expression Twitter Linker

Regular expression to link twitter users… Replace this ‘@(\w+)’ With this ‘<a href=”http://twitter.com/\1″>@\1</a>’

Object Or Array Check in JavaScirpt

Test whether an object is an object or an array if(Object.prototype.toString.apply(arr) === ‘[object Array]’) alert(“Array”) Original Article

A Shell Scirpt to Mount ISO files

A Shell Scirpt to Mount ISO files – call it using the command moustiso.sh ImageFile.iso. You need a folder called…

Delete Leading Whitespace

Delete leading whitespace (spaces/tabs/etc) from beginning of each line ruby -pe ‘gsub(/^\s+/, “”)’ < file.txt

Django server on custom Port

Running Django server on a custom Port python manage.py runserver 8001

Install LAMP Stack on Ubuntu/Debian

Install LAMP Stack on Ubuntu/Debian using apt-get sudo apt-get install openssh-server openssh-client apache2 libapache2-mod-php5 php5-cli php5-common php5-cgi mysql-client mysql-common mysql-server…

Start a new Django Project

Command to start a new Django project… django-admin.py startproject [PROJECT_NAME] cd [PROJECT_NAME] python manage.py startapp [PROJECT_NAME]

Double space a file using Ruby

Double space a file with Ruby using the command ruby -pe ‘puts’ < file.txt