Monday, November 22, 2010

Sample form mail

$to = "testsimp@gmail.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "test@example";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>

Tuesday, November 16, 2010

SWftools installation

SWftools installation
=====================

http://www.swftools.org/download.html

web browser execution commands
==============================
pdftoswf.php
shell_exec('/usr/local/bin/pdf2swf -l -z -t TPT_poster.pdf -o TPT_poster.swf');
echo "Successfully converted";
?>


Testscript to pdf navigation
============================

$test=shell_exec('/usr/local/bin/pdf2swf -B /usr/local/src/swftools-0.9.1/swfs/rfxview.swf -l -z -t /home/user/public_html/dev/files/Test_File.pdf -o /home/tuser/public_html/dev/files/Test_File.swf ');
if($test) print_r($test);
echo "Conversion has been completed successfully";
?>

#/usr/local/src/swftools-0.9.1/swfs/rfxview.swf

?>





play="true" align="" loop="true" quality="high"
TYPE="application/x-shockwave-flash"
PLUGINSPAGE="[[http://www.macromedia.com/go/getflashplayer]]">

Tuesday, November 2, 2010

Port scanning script

#!/bin/bash
PORT1=21 #The port number
PORT2=22 #The port number
PORT3=25 #The port number
PORT4=53 #The port number
PORT5=80 #The port number
PORT6=3306 #The port number
read -p "Enter the Server IP/HOSTNAME : " HOSTNAME #Enter the Host Name to check the Open Ports
echo ""
echo "Checking the ping status of $HOSTNAME", Please wait....
echo ""
if ping -c2 $HOSTNAME |grep -i "time="
then
echo $HOSTNAME is up
else
echo "$HOSTNAME is down or unable to ping"
fi
echo ""
echo "Checking the port status of $HOSTNAME", Please wait....
echo ""
if nmap -p$PORT1 $HOSTNAME | grep -q open
then
echo $PORT1 is open
else
echo $PORT1 is down
fi
if nmap -p$PORT2 $HOSTNAME | grep -q open
then
echo $PORT2 is open
else
echo $PORT2 is down
fi
if nmap -p$PORT3 $HOSTNAME | grep -q open
then
echo $PORT3 is open
else
echo $PORT3 is down
fi
if nmap -p$PORT4 $HOSTNAME | grep -q open
then
echo $PORT4 is open