Archive for July, 2011

To Find and Remove Files that has updated x days ago

Thursday, July 28th, 2011

Where X is the number of days

find . -mtime +X -exec ls -l {} \;

to remove these files

find . -mtime +X -exec rm -f {} \;

Splitting a Large Mailbox into multiple files

Wednesday, July 20th, 2011

By using formail – we can split a large mailbox into multiple small one easily.

+skip
Skip the first skip messages while splitting.

-total
Output at most total messages while splitting.

 

The following command will output the first 10 messages into mailbox.1 and the next 10 messages to the mailbox.2, etc etc.

cat mailbox | formail -10 -s > mailbox.1
cat mailbox | formail +10 -10 -s >mailbox.2
cat mailbox | formail +20 -10 -s >mailbox.3

 

Extending a Logical Volume

Sunday, July 17th, 2011

There are two steps to extend a logical volume.

1. To Extend the logical volume

lvextend -L+1G /dev/VolGroup00/LogVol06

2. To Expand the File System

resize2fs /dev/VolGroup00/LogVol06

To Display how much un-assigned Volume Group

vgdisplay

— Volume group —
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 9
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 7
Open LV 7
Max PV 0
Cur PV 1
Act PV 1
VG Size 232.50 GB
PE Size 32.00 MB
Total PE 7440
Alloc PE / Size 3934 / 122.94 GB
Free PE / Size 3506 / 109.56 GB
VG UUID lXSKxs-552n-VZ03-NsYv-c3qV-FZ3W-ONeIGD

NFS Client Failed

Thursday, July 14th, 2011

If you are trying to mount a nfs volume and failed, check the following service is running.

service portmap start

 

 

Compiling PHP with mysql support on x64 platform

Tuesday, July 12th, 2011

In order to compile PHP on a 64 bit platform, you will need to include the following configure option
–with-libdir=lib64

iPhone App install to client (UAT)

Friday, July 8th, 2011

http://diaryofacodemonkey.ruprect.com/2011/03/18/ad-hoc-app-distribution-with-xcode-4/

Compile OpenSSL with SNI Support

Monday, July 4th, 2011

In order to allow 1 IP Address to serve multiple SSL Websites – we will need to compile OpenSSL with SNI support

./config enable-tlsext shared
make
make install

Setting HTTPS for Apache 2.x using Godaddy SSL Certificate

Monday, July 4th, 2011

Generating csr
openssl genrsa -aes128 2048 > www.domain.com.key
openssl req -utf8 -new -key www.domain.com.key -out www.domain.com.csr

Remove Passphrase
openssl rsa -in www.domain.com.key -out www.domain.com.key2