Thursday, 19 June 2014

Mobile redirection with Javascript

Put this in default page that will load and with script tags.

<script>
if( /Android|webOS|iPhone|iPod|BlackBerry|Symbian|IEMobile/i.test(navigator.userAgent) ) {
window.location = "mobile";
}
</script>

Wednesday, 18 June 2014

Sending mail from CentOS

Actually sending mail from a CentOS server/Desktop install is pretty easy. You can do that in many ways but I like this way because it is simpler.

Before sending the mail, the content of your mail if you store at some place would be better. assume like I have stored my message /tmp/body file.

Then I will sent my message as

mail -s "This is subject of message" raja@raja.com < /tmp/message

thats it. check for your mail in inbox/spam/junk box.

Create Bootable Linux ISO from DD command


I have tried many times to create a Bootable USB linux from ISO but failed almost 20 times. After a lot of googling I have found as this is the proper command

dd if=/path/to/ISO.iso of=/dev/sda bs=4M;sync

Thats it. Note: at of=/dev/sda dont give anything after your device. for example If your USB mounted as /dev/sdb1 then at of you should give as of=/dev/sdb only.