DOCUMENTATION

BEAUTIFULWORK is like a blog and has different methods of
expression of knowledge.

THERE ARE LEARNING STYLES

EARLY BIRD

Here you can see a GNU/Linux or related command
in an overall round up which touches the possibility
for the command in different levels.

COCOA


Bison Tinkering

commandline session

/* Reverse polish notation calculator. */

%{
#define YYSTYPE double
#include 
%}

%token NUM

%% /* Grammar rules and actions follow */
$ 4.2.36 19 519---> bison rpcalc.y
rpcalc.y:11.1: syntax error, unexpected end of file
$ 4.2.36 20 520--->

$ 4.2.36 1 501---> vim la.y
$ 4.2.36 2 502---> bison la.y
la.y:6.1: invalid character: `#'
la.y:6.2-8: syntax error, unexpected identifier
$ 4.2.36 3 503---> mv la.y la.c
$ 4.2.36 4 504---> gcc la.c
la.c: In function ‘yylex’:
la.c:18:18: error: ‘stdin’ undeclared (first use in this function)
la.c:18:18: note: each undeclared identifier is reported only once for each function it appears in
la.c:19:7: warning: incompatible implicit declaration of built-in function ‘scanf’ [enabled by default]
la.c:19:22: error: ‘yylval’ undeclared (first use in this function)
la.c:20:14: error: ‘NUM’ undeclared (first use in this function)
la.c:23:12: error: ‘EOF’ undeclared (first use in this function)

UNCOMPRESS vmlinuz to vmlinux

commandline session

root@debian:/boot# od -A d -t x1 vmlinuz-3.2.0-3-amd64 | grep '1f 8b 08 00'
0018096 00 ff e0 1f 8b 08 00 00 00 00 00 02 03 ec fd 7b
root@debian:/boot# dd if=vmlinuz bs=1 skip=18099 | zcat > vmlinux
dd: opening `vmlinuz': No such file or directory

gzip: stdin: unexpected end of file
root@debian:/boot# dd if=vmlinuz-3.2.0-3-amd64  bs=1 skip=18099 | zcat > vmlinux

gzip: stdin: decompression OK, trailing garbage ignored
dd: writing `standard output': Broken pipe
2785976+0 records in
2785975+0 records out
2785975 bytes (2.8 MB) copied, 28.6663 s, 97.2 kB/s
root@debian:/boot# ls -l vmlinux
-rw-r--r-- 1 root root 116910060 Nov 12 23:20 vmlinux
root@debian:/boot#

HISTSIZE Tinkering

commandline session

$ 4.2.36 1 501---> echo $HISTSIZE
500
$ 4.2.36 2 502---> cat
^C
$ 4.2.36 3 503---> tac
^C
$ 4.2.36 4 504---> echo $HISTSIZE
500
$ 4.2.36 5 505---> export $HISTSIZE=1
bash: export: `500=1': not a valid identifier
$ 4.2.36 6 506---> export HISTSIZE=1
$ 4.2.36 7 500---> tic
tic: File name needed.  Usage:
	tic [-e names] [-o dir] [-R name] [-v[n]] [-V] [-w[n]] [-1aCcfGgILNrsTtUx] source-file
$ 4.2.36 8 501---> tic
tic: File name needed.  Usage:
	tic [-e names] [-o dir] [-R name] [-v[n]] [-V] [-w[n]] [-1aCcfGgILNrsTtUx] source-file
$ 4.2.36 9 502---> export HISTSIZE=500
$ 4.2.36 10 503---> echo $HISTSIZE
500
$ 4.2.36 11 504--->

BASH_ALIASES tinkering

commandline session

$ 4.2.36 6 506---> echo $BASH_ALIASES

$ 4.2.36 7 507---> echo ${BASH_ALIASES[0]}

$ 4.2.36 8 508---> echo ${BASH_ALIASES[1]}

$ 4.2.36 9 509---> echo ${BASH_ALIASES[2]}

$ 4.2.36 10 510---> alias lst ls
bash: alias: lst: not found
bash: alias: ls: not found
$ 4.2.36 11 511---> alias ls lst
bash: alias: ls: not found
bash: alias: lst: not found
$ 4.2.36 12 512---> alias /bin/ls
ls     lsblk  lsmod
$ 4.2.36 12 512---> alias /bin/ls
ls     lsblk  lsmod
$ 4.2.36 12 512---> alias /bin/ls lst
bash: alias: /bin/ls: not found
bash: alias: lst: not found
$ 4.2.36 13 513---> alias test=/usr/bin/io
ionice  iostat
$ 4.2.36 13 513---> alias test=/usr/bin/iostat
$ 4.2.36 14 514---> test
Linux 3.2.0-3-amd64 (debian) 	Friday 09 November 2012 	_x86_64_	(1 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          19.07    0.12    4.94    3.26    0.00   72.61

Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
sda              13.67       103.73        55.99    1929671    1041664

$ 4.2.36 15 515---> echo ${BASH_ALIASES[0]}

$ 4.2.36 16 516---> echo ${BASH_ALIASES[1]}

$ 4.2.36 17 517---> echo ${BASH_ALIASES[2]}

$ 4.2.36 18 518---> echo ${BASH_ALIASES[3]}

$ 4.2.36 19 519---> echo $BASH_ALIASES

$ 4.2.36 20 520--->

sudo and a bash builtin command

commandline session

$ 4.2.36 37 537---> cd /var/log/gdm3/
bash: cd: /var/log/gdm3/: Permission denied
$ 4.2.36 38 538---> cd /var/log/gdm3/
bash: cd: /var/log/gdm3/: Permission denied
$ 4.2.36 39 539---> sudo sh -c 'cd /var/log/gdm3/'
$ 4.2.36 40 540---> sudo cd /var/log/gdm3
sudo: cd: command not found
$ 4.2.36 41 541---> sudo cd /var/log/gdm3
sudo: cd: command not found
$ 4.2.36 42 542---> sudo cd /var/log/gdm3
sudo: cd: command not found
$ 4.2.36 43 543---> sudo sh -c 'cd /var/log/gdm3/'
$ 4.2.36 44 544---> pwd
/home/jeffrin
$ 4.2.36 45 545---> sudo sh -c 'cd /var/log/gdm3/'
$ 4.2.36 46 546---> pwd
/home/jeffrin
$ 4.2.36 47 547---> sudo sh -c 'cd /var/log/gdm3/;pwd'
/var/log/gdm3
$ 4.2.36 48 548---> pwd
/home/jeffrin
$ 4.2.36 49 549---> sudo sh -c 'cd /var/log/gdm3/;du -h'
17M	.
$ 4.2.36 50 550--->

mapfile is a bash builtin command

commandline session

$ 4.2.36 1 501---> mapfile
^C
$ 4.2.36 2 502---> man mapfile
No manual entry for mapfile
$ 4.2.36 3 503---> mapfile --help
bash: mapfile: --: invalid option
mapfile: usage: mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]
$ 4.2.36 4 504---> mapfile
god
is
love
$ 4.2.36 5 505---> echo $MAPFILE
god
$ 4.2.36 6 506---> echo $MAPFILE[0]
god [0]
$ 4.2.36 7 507---> echo $MAPFILE
god
$ 4.2.36 8 508---> echo $MAPFILE1

$ 4.2.36 9 509---> echo $MAPFILE
god
$ 4.2.36 10 510---> echo $MAPFILE
god
$ 4.2.36 11 511---> echo ${MAPFILE[1]}
is
$ 4.2.36 12 512---> echo ${MAPFILE[2]}
love
$ 4.2.36 13 513---> echo ${MAPFILE[0]}
god
$ 4.2.36 14 514--->

PERCEPTION MODEL

DATA PROCESSING INFORMATION
Knowledge representation Organize Routing
Statistical values Plotting graph Visualizing
Documented knowledge Compilation Expanding
Raw data Search Finding
Statistical values Data analysis Fortelling

snmpd and php script

GET THE HANG [ SNMPD AND PHP ]

$ 4.2.36 28 528---> php snmp.php
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/suhosin.so' - /usr/lib/php5/20100525/suhosin.so: cannot open shared object file: No such file or directory in Unknown on line 0
STRING: "Linux debian 3.2.0-3-amd64 #1 SMP Mon Jul 23 02:45:17 UTC 2012 x86_64"
OID: iso.3.6.1.4.1.8072.3.2.10
Timeticks: (2932) 0:00:29.32
STRING: "Me "
STRING: "debian"
STRING: "Sitting on the Dock of the Bay"
INTEGER: 72
Timeticks: (10) 0:00:00.10
OID: iso.3.6.1.6.3.10.3.1.1
OID: iso.3.6.1.6.3.11.3.1.1
OID: iso.3.6.1.6.3.15.2.1.1
OID: iso.3.6.1.6.3.1
OID: iso.3.6.1.2.1.49
OID: iso.3.6.1.2.1.4
OID: iso.3.6.1.2.1.50
OID: iso.3.6.1.6.3.16.2.2.1
STRING: "The SNMP Management Architecture MIB."
STRING: "The MIB for Message Processing and Dispatching."
STRING: "The management information definitions for the SNMP User-based Security Model."
STRING: "The MIB module for SNMPv2 entities"
STRING: "The MIB module for managing TCP implementations"
STRING: "The MIB module for managing IP and ICMP implementations"
STRING: "The MIB module for managing UDP implementations"
STRING: "View-based Access Control Model for SNMP."
Timeticks: (10) 0:00:00.10
Timeticks: (10) 0:00:00.10
Timeticks: (10) 0:00:00.10
Timeticks: (10) 0:00:00.10
Timeticks: (10) 0:00:00.10
Timeticks: (10) 0:00:00.10
Timeticks: (10) 0:00:00.10
Timeticks: (10) 0:00:00.10
Timeticks: (2758738) 7:39:47.38
Hex-STRING: 07 DC 0A 1A 02 06 23 00 2B 05 1E
INTEGER: 1536
STRING: "BOOT_IMAGE=/boot/vmlinuz-3.2.0-3-amd64 root=UUID=26cca090-8a72-4443-859f-7a67b7188357 ro printk.time=1 initcall_debug quiet
"
Gauge32: 2
Gauge32: 145
INTEGER: 0
$ 4.2.36 29 529--->

CODE RELATED


$a = snmp2_walk("127.0.0.1", "public", "");

foreach ($a as $val) {
    echo "$valn";
}

Bash -a option

GET THE HANG [ -a option ]

$ 4.1.5 1 387---> vim cond-a.sh
$ 4.1.5 2 388---> sh cond-a.sh
cond-a.sh: 3: Syntax error: end of file unexpected (expecting "then")
$ 4.1.5 3 389---> vim cond-a.sh
$ 4.1.5 4 390---> sh cond-a.sh
cond-a.sh: 4: Syntax error: end of file unexpected (expecting "fi")
$ 4.1.5 5 391---> vim cond-a.sh
$ 4.1.5 6 392---> sh cond-a.sh
[: 4: -a: unexpected operator
$ 4.1.5 7 393---> vim cond-a.sh
$ 4.1.5 8 394---> sh cond-a.sh
yes
$ 4.1.5 9 395---> ls a.out
ls: cannot access a.out: No such file or directory
$ 4.1.5 10 396---> pwd
/home/jeffrin
$ 4.1.5 11 397---> vim cond-a.sh
$ 4.1.5 12 398---> sh cond-a.sh
yes
$ 4.1.5 13 399---> vim cond-a.sh
$ 4.1.5 14 400---> cat cond-a.sh
if [ test -a ./a.out ]
then
echo yes
fi
$ 4.1.5 15 401---> vim cond-a.sh
$ 4.1.5 16 402---> sh cond-a.sh
test: 1: -a: unexpected operator
cond-a.sh: 5: 2: not found
$ 4.1.5 17 403---> vim cond-a.sh
$ 4.1.5 18 404---> sh cond-a.sh
cond-a.sh: 5: 0: not found
$ 4.1.5 19 405---> > a.out
$ 4.1.5 20 406---> sh cond-a.sh
cond-a.sh: 5: 0: not found
$ 4.1.5 21 407---> vim cond-a.sh
$ 4.1.5 22 408---> sh cond-a.sh
test: 1: -a: unexpected operator
$ 4.1.5 23 409---> vim cond-a.sh
$ 4.1.5 24 410---> sh cond-a.sh
test: 1: -a: unexpected operator
$ 4.1.5 25 411---> vim cond-a.sh
$ 4.1.5 26 412---> sh cond-a.sh a.out
yes
$ 4.1.5 27 413---> sh cond-a.sh a.outg
yes
$ 4.1.5 28 414---> sh cond-a.sh a.outg
yes
$ 4.1.5 29 414---> vim cond-a.sh
$ 4.1.5 30 415---> sh cond-a.sh a.outg
yes
$ 4.1.5 31 416---> vim cond-a.sh
$ 4.1.5 32 417---> sh cond-a.sh a.out
yes
$ 4.1.5 33 418---> sh cond-a.sh a.outj
yes
$ 4.1.5 34 419---> test -a a.out
$ 4.1.5 35 420---> echo $?
0
$ 4.1.5 36 421---> rm a.out
$ 4.1.5 37 422---> test -a a.out
$ 4.1.5 38 423---> echo $?
1
$ 4.1.5 39 424--->