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


A UNIX Command
$cat hello.pl
# Prints the message using two different delimeters.
print "Hello, world!n";
print qq=Did you say "Hello?"n=;

$perl hello.pl
Hello, world!
Did you say "Hello?"
$

UNIX Explanation
"print"  is  categorized  under  Input/Output Functions.
Prints the message using two different delimeters.

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


A UNIX Parameter
$cat /proc/sys/net/ipv4/tcp_retries2
15
$

Parameter Definition
How  many  times  to   retry  before  killing  alive  TCP
connection. RFC1122 says that  the limit should be longer
than 100 sec.  It is too small number.  The default value
of 15 corresponds to ~ 13 - 30 minutes, depending on RTO.

Parameter Code Internals


snippet 1
{
.procname = "tcp_retries2",
.data = &sysctl_tcp_retries2,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec
},

snippet 2
if (retransmits_timed_out(sk, sysctl_tcp_retries1, 0, 0)) {
/* Black hole detection */
tcp_mtu_probing(icsk, sk);

dst_negative_advice(sk);
}

retry_until = sysctl_tcp_retries2;
if (sock_flag(sk, SOCK_DEAD)) {
const int alive = (icsk->icsk_rto < TCP_RTO_MAX); retry_until = tcp_orphan_retries(sk, alive); do_reset = alive || !retransmits_timed_out(sk, retry_until, 0, 0); if (tcp_out_of_resources(sk, do_reset)) return 1; }

Related From Research Paper
A tool  for TCP  stack testing and  TCP/IP fingerprinting
(a.k.a.   OS  detection)   is  introduced.   While  tools
presently exist  to do either  OS detection[1, 2]  or TCP
stack testing[3, 4], the  methods they employ are limited
by  the  techniques  and  analysis  performed,  sometimes
resulting in incorrect re- sults or no results at all. We
introduce   synscan,  a  tool   whose  objective   is  to
fingerprint     every      aspect     of     a     TCP/IP
implementation.    synscan   is    not    meant   as    a
proof-of-concept tool; rather, it  is a robust and useful
tool which can  be used in addition to  others for TCP/IP
stack  testing and OS  de- tection.  synscan incorporates
most  of the  techiques used  by the  existing  tools and
introduces  a number  of new  ones.  synscan's  s primary
advantage is that each test begins with a TCP SYN segment
(hence the name)  to an open port, giving  it the ability
to   test  and  fingerprint   even  the   most  fortified
hosts. Conclusive data from  large network scans and com-
parisons  to   results  from  existing   tools  are  also
reported.

source:
SYNSCAN: Towards Complete TCP/IP Fingerprinting
                       Greg Taleck
                    
                    NFR Security, Inc.
               5 Choke Cherry Rd, Suite 200
                   Rockville, MD 20850