stat Perl API

Perl API — stat()

$ls test.pl
test.pl
$cat test.pl
my $result = stat('./test.pl');
print "$result n";
$perl test.pl
1
$

Perl Explanation

Returns a 13-element list giving the status info for a file, either
the file opened  via FILEHANDLE or DIRHANDLE, or  named by EXPR. If
EXPR is omitted,  it stats $_ (not _ !). Returns  the empty list if
stat fails.

computing Theory Drop
stat() is a Unix system call  that returns useful data about a file
inode. The  semantics of stat() vary between  operating systems. As
an example, the Unix command  ls uses it to retrieve information on
(among many others):

source : http://en.wikipedia.org/wiki/Stat_(system_call)

encode_json Function

Perl API

$json_text = encode_json $perl_scalar

Perl Explanation

Converts the given  Perl data structure to a  UTF-8 encoded, binary
string

computer science Theory Drop

Scalar  processors   represent  the  simplest   class  of  computer
processors.  A  scalar processor  processes  one  datum  at a  time
(typical data items being integers or floating point numbers).[1] ,
a  scalar  processor is  classified  as  a  SISD processor  (Single
Instructions, Single Data).  In  a vector processor, by contrast, a
single  instruction   operates  simultaneously  on   multiple  data
items. The difference is analogous to the difference between scalar
and vector arithmetic.


source :http://en.wikipedia.org/wiki/Scalar_processor

Value Addition Theory

Collections From Various Sources

  1. Science being used to stand for knowledge, and “art” for the
    application of knowledge.
  2. Several sciences are often necessary to form the ground work of a
    single art.
  3. Science is knowledge which we understand so well that we can teach
    it to a computer;and if we do not fully understand something, it is
    an art to deal with it.
  4. The process of going from an art to a science means that we learn
    how to automate something

  5. We should continually be striving to transform every art into a
    science:in the process,we advance the art

<!–

–>

<!–

–>
<!– http://www.beautifulwork.org/Js/foo.js –>

tasksel – a user interface for installing tasks

Debian Command

$tasksel --list-tasks
u desktop	Debian desktop environment
u web-server	Web server
u print-server	Print server
u database-server	SQL database
u dns-server	DNS Server
u file-server	File server
u mail-server	Mail server
u ssh-server	SSH server
u laptop	Laptop
u manual	manual package selection
$tasksel --task-packages
Option task-packages requires an argument
Usage:
tasksel install 
tasksel remove 
tasksel [options]
	-t, --test          test mode; don't really do anything
	    --new-install   automatically install some tasks
	    --list-tasks    list tasks that would be displayed and exit
	    --task-packages list available packages in a task
	    --task-desc     returns the description of a task
$tasksel --task-packages ssh-server
task-ssh-server
$

Debian Explanation

tasksel shows all available tasks and allows to user to select ones
to install

computer science Theory Drop

A  task is  an execution  path through  address space.[1]  In other
words, a set of program instructions that are loaded in memory. The
address registers have been loaded  with the initial address of the
program. At the next clock  cycle, the CPU will start execution, in
accord with the program. The sense  is that some part of 'a plan is
being accomplished'. As long as the program remains in this part of
the   address  space,   the  task   can  continue,   in  principle,
indefinitely, unless the program instructions contain a halt, exit,
or return.

source : http://en.wikipedia.org/wiki/Task_(computing)

Books

Books Currently Reading
  1. Linux Programming Interface | No Starch Press .
  2. Computer Architecture | Nicholas P. Carter .
  3. Discrete Mathematics | Seymour Lipschutz, Marc Lipson
  4. Calculus Workbook FOR Dummies | Mark Ryan
  5. Pre-Algebra Essentials for DUMMIES | Mark Zegarelli

stat – display file or file system status

UNIX Command

$stat /usr/sbin/famd
  File: `/usr/sbin/famd'
  Size: 147504    	Blocks: 304        IO Block: 4096   regular file
Device: 801h/2049d	Inode: 7572257     Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2012-01-24 00:00:54.000000000 +0530
Modify: 2010-08-03 15:32:44.000000000 +0530
Change: 2012-01-24 00:00:07.000000000 +0530
 Birth: -
$

UNIX Explanation

 Display file or file system status.

/etc/dpkg/dpkg.cfg

File

$ls -l /etc/dpkg/dpkg.cfg
-rw-r--r-- 1 root root 446 Sep 14  2010 /etc/dpkg/dpkg.cfg
$

Explanation

$file /etc/dpkg/dpkg.cfg
/etc/dpkg/dpkg.cfg: ASCII English text
$

Get The Hang

$cat /etc/dpkg/dpkg.cfg
# dpkg configuration file
#
# This file can contain default options for dpkg.  All command-line
# options are allowed.  Values can be specified by putting them after
# the option, separated by whitespace and/or an `=' sign.
#

# Do not enable debsig-verify by default; since the distribution is not using
# embedded signatures, debsig-verify would reject all packages.
no-debsig

# Log status changes and actions to a file.
log /var/log/dpkg.log
$

NTP Network Time Protocol

TOPIC

NETWORK TIME PROTOCOL

Explanation

NTP  stands  for Network  Time  Protocol,  and  it is  an  Internet
protocol used to  synchronize the clocks of computers  to some time
reference.  NTP   is  an  Internet   standard  protocol  originally
developed  by  Professor  David  L.  Mills  at  the  University  of
Delaware.

source: http://www.ntp.org/ntpfaq/NTP-s-def.htm#AEN1259

Get The Hang

$ntpdate in.pool.ntp.org
13 Jan 19:15:49 ntpdate[4295]: step time server 203.200.188.4 offset -1.325297 sec
$date
Fri Jan 13 19:16:01 IST 2012
$