27 Aug

/bin/sh: bad interpreter: Permission denied

The mentioned error occurrs when the /tmp is mounted with noexec permission. First step to ensure that the tmp is mounted with noexec permission is to check the /etc/fstab.

cat  /etc/fstab

/dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
/dev/VolGroup00/LogVol04 /home                   ext3    defaults        1 2
proc                    /proc                   proc    defaults        0 0
sysfs                   /sys                    sysfs   defaults        0 0
/dev/VolGroup00/LogVol01 /tmp                    ext3 loop,noexec,nosuid,rw    defaults        1 2
/dev/VolGroup00/LogVol02 /usr                    ext3    defaults        1 2
/dev/VolGroup00/LogVol05 /var                    ext3    defaults        1 2
/dev/VolGroup00/LogVol03 swap                    swap    defaults        0 0
#/dev/tmppart           /tmp                     ext3 loop,noexec,nosuid,rw 0 0

If it is mounted with noexec permission, then our requirement to mount the same with execute permission.

Edit the /etc/fstab file. Remove the entry noexec from it.

Now the modified entry should look like,

/dev/VolGroup00/LogVol01 /tmp                    ext3 loop,nosuid,rw    defaults        1 2

Now we need to remount the partition


This will mount the /tmp with exec permission.

Once the script execution is over, remount the /tmp back to noexec.

15 Aug

How To remote backup with rsync

This is probably the simply way to backup data to other server using a secure protocoal an minimum bandwidh.

BckServer.com – Is the backup server
Server1.com – Is the server you want to backup

Login to the server you want to backup

1. Creating a key with the ssh-keygen utility:

# ssh-keygen -t rsa -N ” (these are two single quotes)

2. Copy RSA encryption key to the backup server:

# scp ~/.ssh/id_rsa.pub username@BckServer.com:keys/server1
# ssh username@BckServer.com mergekeys

Now you can backup a folder without prompting for a password:

# rsync -avz -e ssh /etc/folder username@BckServer.com :folder_on_server1

Rsync configuration Examples:

Back up entire server:

rsync -avz –exclude=/proc -e ssh / username@bckserver.com:folder_on_server1

Back up home directories:

rsync -avz -e ssh /home username@bckserver.com:folder_on_server1

Back up specific users:

rsync -avz -e ssh ~user1 ~user2 ~user3 username@bckserver.com:folder_on_server1

Put it on crontab:

# nano /etc/crontab

Add this line:

13 3 * * * root rsync -avz -e ssh /home username@bckserver.com:folder_on_server1

Save and Exit

15 Aug

Automated RED5 Installation

The following steps are intended to automate the installation of Red 5 versions 0.5 , 0.6.3 and 0.7.0 .

Download the red5 installer script ,

Note: Do not download the script to some location where every one can access it as someone may execute it and overwrite an old installation !

Make it executable,

Execute the script,

When the script is executed, it would ask for the red5 version to be installed. There are 3 choices as of now.. 0.7.0 , 0.6.3 and 0.5
Make the choice by entering the digits 1, 2 or 3 . Pressing any other key will select the latest version , 0.70 .

# ./red5_install

Hello ,Please choose the RED5 version : (1,2,3 or 4)

1. RED5 0.7.0
2. RED5 0.6.3
3. RED5 0.5
Press Any other key to install 1. RED5 0.7.0

After the version is selected, the process is automated . If everything goes well, you will see something similar to the following as the last line,

2010-01-23 02:54:24,834 [main] INFO org.springframework.cache.ehcache.EhCacheManagerFactoryBean – Shutting down EHCache CacheManager
2010-01-23 02:54:24,842 [main] INFO org.mortbay.log – Started SelectChannelConnector@
2010-01-23 02:54:24,968 [main] INFO org.mortbay.log – Started SslSocketConnector@
2010-01-23 02:54:24,969 [main] INFO org.red5.server.Standalone – Startup done in: 36346 ms

You can exit from this screen by entering the key combination of control and c (^c).

If the installation goes fine , then red5 would be installed in /usr/local/red and it can be started by executing,


./red5.sh >/dev/null 2>&1 &


nohup sh red5.sh &