In gnulamp you will find all LAMP tutorials you need, from Linux,perl,php,databases,linux,SQL,sed,awk and more... all the tutorials are free!. We are Constantly adding more stuff and making the site and tutorials more user friendly.

IP Multicast

Internet Protocol (IP) multicast is a bandwidth-conserving technology that reduces traffic by simultaneously delivering a single stream of information to thousands of corporate recipients and homes. Applications that take advantage of multicast include videoconferencing, corporate communications, distance learning, and distribution of software, stock quotes, and news.

IP Multicast delivers source traffic to multiple receivers without adding any additional burden on the source or the receivers while using the least network bandwidth of any competing technology. High-bandwidth applications, such as MPEG video, may require a large portion of the available network bandwidth for a single stream. In these applications, the only way to send to more than one receiver simultaneously is by using IP Multicast.

PERL

perl subroutine to send email..

$mailprogram should be your mailprogram, ie
$mailprogram = "/usr/sbin/sendmail";
&Email($title,$message); 
sub Email {
my ($title, $message) = @_;
open (MAIL,"¦$mailprogram -t");
print MAIL "To: name\@example.com\n";
print MAIL "From: script\@example.com\n";
print MAIL "Subject: $title\n\n";
print MAIL "$message \n";
close(MAIL);
}
Wanna count the number of times ABC appears in text?
my $numtimes = 0;
$numtimes++ while ($text =~ /b ABC b/gx));

GMT time Example
$now = time();
print "The local time is      ", scalar(localtime($now)), "\n";
print "GMT is ", scalar(gmtime($now)), "\n";
How do I print out in color?
If you know that user have an ANSI terminal that understands color, you can use the Term::ANSIColor module from CPAN:
use Term::ANSIColor;
print color("blue"), "BLUE!\n", color("reset");
print color("red"), "RED!\n", color("reset");

Or like this:

use Term::ANSIColor qw(:constants);
print RED, "Stop!\n", RESET;
print GREEN, "Go!\n", RESET;

Linux Tips

VSIZE (Virtual memory SIZE) - The amount of memory the process is currently using. This includes the amount in RAM and the amount in swap.

RSS (Resident Set Size) - The portion of a process that exists in physical memory (RAM). The rest of the program exists in swap. If the computer has not used swap, this number will be equal to VSIZE.

What Network Services are Running?
$ netstat -atup

$ netstat -ap|grep LISTEN|less
This can be helpful to determine the services running.

Need stats on dropped UDP packets?
$ netstat -s -u

TCP
$ netstat -s -t

summary of everything
$ netstat -s

looking for error rates on the interface?
$ netstat -i

Listening interfaces?
$ netstat -l

Databases

SQL Indexes
Table scan –
Indexes usually faster than table scan

Clustered index
–One per table
–Primary key is usually clustered index
–Data is physically ordered by index
–Not good for data updated frequently (table must be reordered)

Non-clustered index
–All other indexes on table
–Unique or non-unique
–Data not physically ordered
Home