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--->

debian package arduino

GET THE HANG [ arduino ]

$ 4.2.36 2 502---> apt-cache show arduino
Package: arduino
Version: 1:1.0.1+dfsg-7
Installed-Size: 1293
Maintainer: Scott Howard 
Architecture: all
Depends: default-jre | java6-runtime, libjna-java, librxtx-java (>= 2.2pre2-3), arduino-core (= 1:1.0.1+dfsg-7)
Recommends: extra-xdg-menus, policykit-1
Description-en: AVR development board IDE and built-in libraries
 Arduino is an open-source electronics prototyping platform based on
 flexible, easy-to-use hardware and software. It's intended for artists,
 designers, hobbyists, and anyone interested in creating interactive
 objects or environments.
 .
 This package will install the integrated development environment that
 allows for program writing, code verfication, compiling, and uploading
 to the Arduino development board. Libraries and example code will also
 be installed.
Homepage: http://www.arduino.cc
Description-md5: 60f8f72e8783c6b5a72254120b680cdb
Tag: field::electronics, role::program
Section: electronics
Priority: extra
Filename: pool/main/a/arduino/arduino_1.0.1+dfsg-7_all.deb
Size: 1123728
MD5sum: fc59307fdef5add00b25d230d5534076
SHA1: 540f07f9a8fd51139e28aebad8beade339d62820
SHA256: a007e610604d3eaf297e4519427d2fc42fef098a58eab5122faf20c02405a06a

$ 4.2.36 3 503--->

IFS Internal Field Separator — GNU Bash.

$ 4.2.36 1 501---> echo $*

$ 4.2.36 2 502---> echo "$*"

$ 4.2.36 3 503---> echo $IFS

$ 4.2.36 4 504---> set $IFS=rightleftwrong
$ 4.2.36 5 505---> echo $*
=rightleftwrong
$ 4.2.36 6 506---> echo "$*"
=rightleftwrong
$ 4.2.36 7 507---> echo $IFS

$ 4.2.36 8 508---> echo $*
=rightleftwrong
$ 4.2.36 9 509---> read $*
jeff
bash: read: `=rightleftwrong': not a valid identifier
$ 4.2.36 10 510---> read $*
bash: read: `=rightleftwrong': not a valid identifier
$ 4.2.36 11 511---> read $*;
bash: read: `=rightleftwrong': not a valid identifier
$ 4.2.36 12 512--->  var1=1+2+3
$ 4.2.36 13 513---> echo $var1
1+2+3
$ 4.2.36 14 514---> IFS=+
$ 4.2.36 15 515---> echo $var1
1 2 3
$ 4.2.36 16 516---> IFS=-
$ 4.2.36 17 517---> echo $var1
1+2+3
$ 4.2.36 18 518---> IFS=" "
$ 4.2.36 19 519---> echo $var1
1+2+3
$ 4.2.36 20 520---> IFS=","
$ 4.2.36 21 521---> echo $var1
1+2+3
$ 4.2.36 22 522--->  var1=1+2,+3
$ 4.2.36 23 523---> echo $var1
1+2 +3
$ 4.2.36 24 524--->

bash -r restricted shell

$ 4.2.36 8 508---> bash -r
$ 4.2.36 1 501---> ls
Algorithms     bookmark  bugs-general  debian-howtos  firewall	kernel	  linux    README
beautifulwork  books	 config-files  Docs	      https:	language  ovlfose
$ 4.2.36 2 502---> cd ..
bash: cd: restricted
$ 4.2.36 3 503---> cd /
bash: cd: restricted
$ 4.2.36 4 504---> ./firewall/firewall.bw
bash: ./firewall/firewall.bw: restricted: cannot specify `/' in command names
$ 4.2.36 5 505---> cat config-files/dot-muttrc > check
bash: check: restricted: cannot redirect output
$ 4.2.36 6 506---> enable
enable .
enable :
enable [
enable alias
enable bg
enable bind
enable break
enable builtin
enable caller
enable cd
enable command
enable compgen
enable complete
enable compopt
enable continue
enable declare
enable dirs
enable disown
enable echo
enable enable
enable eval
enable exec
enable exit
enable export
enable false
enable fc
enable fg
enable getopts
enable hash
enable help
enable history
enable jobs
enable kill
enable let
enable local
enable logout
enable mapfile
enable popd
enable printf
enable pushd
enable pwd
enable read
enable readarray
enable readonly
enable return
enable set
enable shift
enable shopt
enable source
enable suspend
enable test
enable times
enable trap
enable true
enable type
enable typeset
enable ulimit
enable umask
enable unalias
enable unset
enable wait
$ 4.2.36 7 507---> enable
enable .
enable :
enable [
enable alias
enable bg
enable bind
enable break
enable builtin
enable caller
enable cd
enable command
enable compgen
enable complete
enable compopt
enable continue
enable declare
enable dirs
enable disown
enable echo
enable enable
enable eval
enable exec
enable exit
enable export
enable false
enable fc
enable fg
enable getopts
enable hash
enable help
enable history
enable jobs
enable kill
enable let
enable local
enable logout
enable mapfile
enable popd
enable printf
enable pushd
enable pwd
enable read
enable readarray
enable readonly
enable return
enable set
enable shift
enable shopt
enable source
enable suspend
enable test
enable times
enable trap
enable true
enable type
enable typeset
enable ulimit
enable umask
enable unalias
enable unset
enable wait
$ 4.2.36 8 508--->
$ 4.2.36 8 508---> enable --help
bash: enable: --: invalid option
enable: usage: enable [-a] [-dnps] [-f filename] [name ...]
$ 4.2.36 9 509---> enable -d
bash: enable: restricted
$ 4.2.36 10 510--->