ACQUIRING KNOWLEDGE WITH EXAMPLES


A UNIX Command
$perl scalar.pl
The variable $fred contains Fred here.
Sum is 66.
$cat scalar.pl
$fred = "Fred here";
$barney = 56;
$sum = 10 + $barney;
print 'The variable $fred' . " contains $fred.n";
print "Sum is $sum.n";

$cat scalar.pl
$fred = "Fred here";
$barney = 56;
$sum = 10 + $barney;
print 'The variable $fred.' . " contains $fred.n";
print "Sum is $sum.n";

$perl scalar.pl
The variable $fred. contains Fred here.
Sum is 66.
$cat scalar.pl
$fred = "Fred here";
$barney = 56;
$sum = 10 + $barney;
print "The variable $fred." . " contains $fred.n";
print "Sum is $sum.n";

$perl scalar.pl
The variable Fred here. contains Fred here.
Sum is 66.
$

UNIX Explanation
Various operations on scalar (string) variables.

source: http://sandbox.mc.edu/~bennet/perl/leccode/var1_pl.html

Connected From This

HTTP

The   Hypertext   Transfer    Protocol   (HTTP)   is   an
application-level      protocol      for     distributed,
collaborative,  hypermedia information  systems. It  is a
generic, stateless,  protocol which can be  used for many
tasks beyond its use  for hypertext, such as name servers
and   distributed  object  management   systems,  through
extension  of  its   request  methods,  error  codes  and
headers. A feature of  HTTP is the typing and negotiation
of  data  representation, allowing  systems  to be  built
independently of the data being transferred.

source : http://www.w3.org/Protocols/Specs.html

Connected From This

A UNIX Command
$httperf --hog --server www.youtube.com
httperf --hog --client=0/1 --server=www.youtube.com --port=80 --uri=/ --send-buffer=4096 --recv-buffer=16384 --num-conns=1 --num-calls=1
Maximum connect burst length: 0

Total: connections 1 requests 1 replies 1 test-duration 0.787 s

Connection rate: 1.3 conn/s (787.4 ms/conn, <=1 concurrent connections)
Connection time [ms]: min 787.4 avg 787.4 max 787.4 median 787.5 stddev 0.0
Connection time [ms]: connect 33.0
Connection length [replies/conn]: 1.000

Request rate: 1.3 req/s (787.4 ms/req)
Request size [B]: 68.0

Reply rate [replies/s]: min 0.0 avg 0.0 max 0.0 stddev 0.0 (0 samples)
Reply time [ms]: response 326.2 transfer 428.2
Reply size [B]: header 576.0 content 114914.0 footer 2.0 (total 115492.0)
Reply status: 1xx=0 2xx=1 3xx=0 4xx=0 5xx=0

CPU time [s]: user 0.32 system 0.16 (user 40.1% system 19.8% total 59.9%)
Net I/O: 143.3 KB/s (1.2*10^6 bps)

Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
$

$httperf --hog --server www.beautifulwork.org
httperf --hog --client=0/1 --server=www.beautifulwork.org --port=80 --uri=/ --send-buffer=4096 --recv-buffer=16384 --num-conns=1 --num-calls=1
Maximum connect burst length: 0

Total: connections 1 requests 1 replies 1 test-duration 0.818 s

Connection rate: 1.2 conn/s (818.4 ms/conn, <=1 concurrent connections)
Connection time [ms]: min 818.4 avg 818.4 max 818.4 median 818.5 stddev 0.0
Connection time [ms]: connect 60.2
Connection length [replies/conn]: 1.000

Request rate: 1.2 req/s (818.4 ms/req)
Request size [B]: 74.0

Reply rate [replies/s]: min 0.0 avg 0.0 max 0.0 stddev 0.0 (0 samples)
Reply time [ms]: response 322.8 transfer 435.5
Reply size [B]: header 338.0 content 40114.0 footer 2.0 (total 40454.0)
Reply status: 1xx=0 2xx=1 3xx=0 4xx=0 5xx=0

CPU time [s]: user 0.34 system 0.18 (user 42.0% system 21.5% total 63.5%)
Net I/O: 48.4 KB/s (0.4*10^6 bps)

Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
$

UNIX Explanation
httperf is a tool  to measure web server performance.  It
speaks  the  HTTP  protocol  both  in  its  HTTP/1.0  and
HTTP/1.1  flavors  and   offers  a  variety  of  workload
generators.  While running, it keeps track of a number of
performance metrics  that are  summarized in the  form of
statistics that  are printed  at the end  of a  test run.
The  most basic  operation of  httperf is  to  generate a
fixed number of HTTP GET requests and to measure how many
replies (responses) came back from the server and at what
rate the responses arrived.

Installation
1. apt-get install apache2
2. apt-get install libapache2-mod-perl2
3. apt-get install libapache2-mod-mono

configuration
1. /etc/apache2/sites-available/
2. a2ensite default
3. mkdir -p /srv/www/default/public_html
4. mkdir /srv/www/default/logs
5. put a sample .aspx file in "/srv/www/default/public_html"
6. /etc/init.d/apache2 restart

Testing
1. Browser URL --- 127.0.0.1/<your .aspx file>
A UNIX Command
$perl hello-again.pl
Greetings, small planet nWhat's cooking?
$cat hello-again.pl
print 'Greetings, small planet n';
print "What's cooking?n";

$

UNIX Explanation
Shows how single quotes differ from double quotes
in hello-again.pl

source : http://sandbox.mc.edu/~bennet/perl/leccode/index.html

A Windows Command




<%
response.write("My first ASP script!")
%>




source : http://www.w3schools.com/asp/default.asp

Copyright © 2009,  2010,  2011,  2012,  2013, 2014     BeautifulWork Project    e-mail:  ahiliation@yahoo.co.in
BeautifulWork Project comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.