Create a Subdomain in Apache2

August 27, 2013

Let’s say you have a domain mywebsite.com and you want to add a subdomain blog.mywebsite.com. Here’s how to do it.

Create an apache config file:

touch /etc/apache2/site-available/blog.mywebsite.com
vi /etc/apache2/site-available/blog.mywebsite.com

Linux Screen Tutorial

August 23, 2013

Screen is a Linux tool to run multiple virtual terminal from a command line. It is useful when you need to run long processes and you need to close your SSH client. Screen is really life saver.

Start

Start a new Screen

$ screen

Remove Empty Directories Recursively in Linux

July 9, 2013

find . -type d -empty -delete

Remove Files Recursively in Linux

July 9, 2013

Do you ever try rm -r *.bak and wonder why it is not working like it is supposed to? From the man page (man rm), the definition for -r is :

r, -R, --recursive
              remove directories and their contents recursively

Simple String Replacement Tool in Linux

June 24, 2013

First install mysql client (replace utility is one of a tool in MySQL package).

apt-get install mysql-client