Журнал лабораторных работ

Содержание

Журнал

Вторник (09/29/15)

/dev/pts/0
11:50:26
#> \*

11:50:30
#ls
*              fgconsole  ls              ping6       tempfile
bash           fgrep      lsblk           ps          touch
busybox        findmnt    lsmod           pwd         true
cat            fuser      mkdir           rbash       umount
chgrp          grep       mknod           readlink    uname
chmod          gunzip     mktemp          rm          uncompress
chown          gzexe      more            rmdir       unicode_start
chvt           gzip       mount           rnano       vdir
cp             hostname   mountpoint      run-parts   which
cpio           ip         mt              rzsh        ypdomainname
...
dd             kmod       nano            setupcon    zdiff
df             ksh        nc              sh          zegrep
dir            less       nc.traditional  sh.distrib  zfgrep
dmesg          lessecho   netcat          sleep       zforce
dnsdomainname  lessfile   netstat         ss          zgrep
domainname     lesskey    nisdomainname   stty        zless
dumpkeys       lesspipe   open            su          zmore
echo           ln         openvt          sync        znew
egrep          loadkeys   pidof           tailf       zsh
false          login      ping            tar         zsh4
11:50:31
#cd

прошло 64 минуты
12:54:32
#history
    1  ifconfig
    2  vim /etc/network/interfaces
    3  nano /etc/network/interfaces
    4  /etc/init.d/networking restart
    5  ifconfig
    6  route
    7  ping 192.168.13.253
    8  shutdown -r now
    9  exit
   10  ping ya.ru
...
  525  cd /bin
  526  ls @([^a-e]|cd)*
  527  ls @([^a-e]|[cd])*
  528  ls @([^a-e])*
  529  ls @([^a-e]|[cd])*
  530  > *
  531  > \*
  532  ls
  533  cd
  534  history
12:54:43
#ls
23423     234235232252352435  234g23        all     install    report  wetwet
23423523  234235325           234g23hgfdfh  errors  privet.sh  shadow
12:56:51
#ls
23423     234235232252352435  234g23        all     install    report  wetwet
23423523  234235325           234g23hgfdfh  errors  privet.sh  shadow
12:57:04
#cat install
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
12:57:11
#cat install | grep users
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
install_to_users_homes()
    users="$@"
    for user in $users
install_to_users_bashrc()
    users="$@"
    for user in $users
install_to_users_bash_profile()
    users="$@"
    for user in $users
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
12:57:56
#cat install | grep -c users
14
12:58:12
#cat install | grep -n users
12:install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
13:lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
85:install_to_users_homes()
88:    users="$@"
90:    for user in $users
110:install_to_users_bashrc()
112:    users="$@"
113:    for user in $users
121:install_to_users_bash_profile()
123:    users="$@"
124:    for user in $users
178:step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
179:step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
180:step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
12:58:16
#cat install | grep -n users
12:install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
13:lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
85:install_to_users_homes()
88:    users="$@"
90:    for user in $users
110:install_to_users_bashrc()
112:    users="$@"
113:    for user in $users
121:install_to_users_bash_profile()
123:    users="$@"
124:    for user in $users
178:step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
179:step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
180:step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
12:58:19
#cat install | grep -c users
14
13:00:46
#echo 'Privet $LOGNAME'
Privet $LOGNAME
13:01:29
#cat install | grep '^step'
step()
step "Installing dependencies" apt_get_install_deps
step "Downloading l3bashrc" ${wget} ${url_l3bashrc}
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
13:01:44
#cat install | grep '^$'

13:02:26
#cat install
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
13:02:34
#cat install | grep '^$'

13:02:39
#cat install | grep -c '^$'
31
13:02:46
#cat install | grep -v '^$'
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
13:03:17
#cat install | grep -v '^$'
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
13:04:48
#cat install | grep -v '^[abc]'
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l3bashrc" ${wget} ${url_l3bashrc}
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
rm -rf ${temp_dir}
show_final_message
13:06:14
#cat install | grep '^[^abc]'
#!/bin/sh
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
###############################################################################
#
# Set this variables before installation:
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
...
step "Downloading l3bashrc" ${wget} ${url_l3bashrc}
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
rm -rf ${temp_dir}
show_final_message
13:14:40
#cat install | grep '^[[:upper:]]'
Usage:
USAGE
Installation is successfully completed.
Now restart your shell or relogin
Your current lilalo context is ${lilalo_context}/USER
If you use xgu.ru backend, your labs will be available at
Use commands
For further information see http://xgu.ru/lilalo/ (in Russian).
Thank you gor using LiLaLo.
Happy Labbing!
FINAL_MESSAGE
13:15:07
#cat install | grep '^[[:alnum:]]'
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
lilalo_rc=.l3rc
lilalo_home=.lilalo
url_lilalo="http://xgu.ru/lilalo"
url_l3bashrc="${url_lilalo}"/l3bashrc
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
13:15:27
#cat install | grep '^[[:alpha:]A-L]'
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
lilalo_rc=.l3rc
lilalo_home=.lilalo
url_lilalo="http://xgu.ru/lilalo"
url_l3bashrc="${url_lilalo}"/l3bashrc
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
13:15:54
#cat install | grep '^.[[:alpha:]A-L]'
hostname=`hostname`
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
lilalo_user=13-10-2014
lab=NT-LNet
install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
lilalo_rc=.l3rc
lilalo_home=.lilalo
url_lilalo="http://xgu.ru/lilalo"
url_l3bashrc="${url_lilalo}"/l3bashrc
...
step "Downloading l3prompt" ${wget} ${url_l3prompt}
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
cd /
rm -rf ${temp_dir}
show_final_message
13:16:58
#cat install | grep '^.[f-k]'
lilalo_user=13-10-2014
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
lilalo_rc=.l3rc
lilalo_home=.lilalo
wget=wget
whiteC='\033[1;37m'
show_usage()
show_final_message()
If you use xgu.ru backend, your labs will be available at
Thank you gor using LiLaLo.
mkdir -p ${temp_dir}
show_final_message
13:17:13
#cat install | grep 'xgu.ru'
url_lilalo="http://xgu.ru/lilalo"
If you use xgu.ru backend, your labs will be available at
http://xgu.ru/l3/${lilalo_context}
For further information see http://xgu.ru/lilalo/ (in Russian).
13:19:26
#cat install | grep 'xgu.ru'
xguaru
url_lilalo="http://xgu.ru/lilalo"
If you use xgu.ru backend, your labs will be available at
http://xgu.ru/l3/${lilalo_context}
For further information see http://xgu.ru/lilalo/ (in Russian).
13:19:30
#cat install | grep 'xgu\.ru'
url_lilalo="http://xgu.ru/lilalo"
If you use xgu.ru backend, your labs will be available at
http://xgu.ru/l3/${lilalo_context}
For further information see http://xgu.ru/lilalo/ (in Russian).
13:19:35
#cat install | grep 'ht+p'

13:20:31
#cat install | grep 'ht+p'

13:20:33
#cat install | grep -E 'ht+p'
url_lilalo="http://xgu.ru/lilalo"
http://xgu.ru/l3/${lilalo_context}
For further information see http://xgu.ru/lilalo/ (in Russian).
13:21:28
#cat install | egrep 'ht+p'
url_lilalo="http://xgu.ru/lilalo"
http://xgu.ru/l3/${lilalo_context}
For further information see http://xgu.ru/lilalo/ (in Russian).
13:21:55
#ls -l `which egrep`
-rwxr-xr-x 1 root root 175456 Май 13  2012 /bin/egrep
13:22:19
#ls -l `which grep`
-rwxr-xr-x 1 root root 175488 Май 13  2012 /bin/grep
13:22:22
#man grep
13:23:09
#man grep
13:23:46
#cat install | egrep 'htt?p'
url_lilalo="http://xgu.ru/lilalo"
http://xgu.ru/l3/${lilalo_context}
For further information see http://xgu.ru/lilalo/ (in Russian).
13:24:20
#cat install | egrep 'ht{2}p'
url_lilalo="http://xgu.ru/lilalo"
http://xgu.ru/l3/${lilalo_context}
For further information see http://xgu.ru/lilalo/ (in Russian).
13:24:49
#cat install | egrep 'ht{2,}p'
url_lilalo="http://xgu.ru/lilalo"
http://xgu.ru/l3/${lilalo_context}
For further information see http://xgu.ru/lilalo/ (in Russian).
13:25:03
#cat install | egrep 'ht{2,5}p'
url_lilalo="http://xgu.ru/lilalo"
http://xgu.ru/l3/${lilalo_context}
For further information see http://xgu.ru/lilalo/ (in Russian).
13:26:29
#cat install | egrep 'if (witch)? apt-get'

13:27:24
#cat install | egrep 'if'
    if which apt-get >& /dev/null
        if echo $answer | grep -q ^[yY]
    shift
13:27:52
#cat install | egrep 'if (which)? apt-get'
    if which apt-get >& /dev/null
13:28:00
#cat install | egrep 'if (which )?apt-get'
    if which apt-get >& /dev/null
13:28:18
#cat install | egrep 'if (which |locate )?apt-get'
    if which apt-get >& /dev/null
13:29:20
#vi install
--- /tmp/l3-saved-7671.19769.6348	2015-09-29 14:29:42.820319806 +0300
+++ install	2015-09-29 14:30:16.068319799 +0300
@@ -41,6 +41,8 @@
 {
     return 0
     if which apt-get >& /dev/null
+    if locate apt-get >& /dev/null
+    if apt-get >& /dev/null
     then 
         apt-get install -y $apt_get_install_this
     else
13:30:16
#cat install | egrep 'if (which |locate )?apt-get'
    if which apt-get >& /dev/null
    if locate apt-get >& /dev/null
    if apt-get >& /dev/null
13:31:19
#cat install | egrep '^(.)(.).\2\1$'
potop
rotor
13:31:33
#cat install | grep '^(.)(.).\2\1$'
grep: Неверная ссылка назад
прошло 14 минут
13:45:40
#ps lax | awk '$11~/?/'
awk: line 1: regular expression compile failed (missing operand)
?
13:47:16
#ps lax | awk '$11~/\?/'
4     0     1     0  20   0  10648   832 -      Ss   ?          0:04 init [2]
1     0     2     0  20   0      0     0 -      S    ?          0:00 [kthreadd]
1     0     3     2  20   0      0     0 -      S    ?          0:00 [ksoftirqd/0]
1     0     5     2  20   0      0     0 -      S    ?          0:00 [kworker/u:0]
1     0     6     2 -100  -      0     0 -      S    ?          0:00 [migration/0]
5     0     7     2 -100  -      0     0 -      S    ?          0:03 [watchdog/0]
1     0     8     2   0 -20      0     0 -      S<   ?          0:00 [cpuset]
1     0     9     2   0 -20      0     0 -      S<   ?          0:00 [khelper]
5     0    10     2  20   0      0     0 -      S    ?          0:00 [kdevtmpfs]
1     0    11     2   0 -20      0     0 -      S<   ?          0:00 [netns]
...
1     0  3332     2  20   0      0     0 -      S    ?          0:01 [flush-202:0]
1     0  3377     1  20   0  49300 11992 -      Ss   ?         16:57 l3-agent
0     0  5939     1  39  19  20608  6360 -      RN   ?        1306:15 john shadow
1     0  7371     2  20   0      0     0 -      S    ?          0:01 [kworker/0:0]
4     0  7393  2261  20   0  71292  3772 -      Ss   ?          0:02 sshd: root@pts/0
4     0  7471  2261  20   0  71292  3616 -      Ss   ?          0:00 sshd: ivan [priv]
5  1001  7473  7471  20   0  71292  1868 -      S    ?          0:00 sshd: ivan@pts/2
4     0  7555  2261  20   0  71292  3620 -      Ss   ?          0:00 sshd: petr [priv]
5  1002  7557  7555  20   0  71292  1864 -      S    ?          0:00 sshd: petr@pts/3
1     0  9305     2  20   0      0     0 -      S    ?          0:00 [kworker/0:1]
13:47:25
#ps lax | awk '$11!~/\?/'
F   UID   PID  PPID PRI  NI    VSZ   RSS WCHAN  STAT TTY        TIME COMMAND
4     0  2285     1  20   0  18368   968 -      Ss+  tty1       0:00 /sbin/getty 38400 tty1
4     0  2286     1  20   0  18368   972 -      Ss+  tty2       0:00 /sbin/getty 38400 tty2
4     0  2287     1  20   0  18368   968 -      Ss+  tty3       0:00 /sbin/getty 38400 tty3
4     0  2288     1  20   0  18368   976 -      Ss+  tty4       0:00 /sbin/getty 38400 tty4
4     0  2289     1  20   0  18368   960 -      Ss+  tty5       0:00 /sbin/getty 38400 tty5
4     0  2290     1  20   0  18368   972 -      Ss+  tty6       0:00 /sbin/getty 38400 tty6
4     0  7395  7393  20   0  22208  3004 -      Ss   pts/0      0:00 -bash
0  1001  7474  7473  20   0  24696  3332 -      Ss+  pts/2      0:00 -bash
0  1002  7558  7557  20   0  24892  3520 -      Ss+  pts/3      0:00 -bash
0     0  7639  7395  20   0  18164   844 -      S+   pts/0      0:00 script -f -c l3script -q /root/.lilalo//3214919816900022178-1443510370.script
1     0  7670  7639  20   0  18168   472 -      S+   pts/0      0:00 script -f -c l3script -q /root/.lilalo//3214919816900022178-1443510370.script
0     0  7671  7670  20   0  21980  2556 -      Ss   pts/4      0:02 l3script
0     0  8770  7671  20   0   7728   324 -      T    pts/4      0:00 cat
4     0  9942  7671  20   0  10536   840 -      R+   pts/4      0:00 ps lax
0     0  9943  7671  20   0   6764   608 -      S+   pts/4      0:00 awk $11!~/\?/
13:48:09
#ps lax | awk '$12~/0{2}/'

13:48:44
#man awk
13:50:29
#ls
23423     234235232252352435  234g23        all     install    report  wetwet
23423523  234235325           234g23hgfdfh  errors  privet.sh  shadow
13:51:05
#vi shell.sh
--- /dev/null	2015-09-25 17:23:02.067999996 +0300
+++ shell.sh	2015-09-29 14:52:01.456319790 +0300
@@ -0,0 +1,2 @@
+#!/bin/bash
+
13:52:01
#cat /etc/passwd | awk -F: '$3>=1000'
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
user:x:1000:1000:user,,,:/home/user:/bin/bash
ivan:x:1001:1001::/home/ivan:/bin/bash
petr:x:1002:1002::/home/petr:/bin/bash
13:52:28
#cat /etc/passwd | awk -F: '$3>=1000{print $1}'
nobody
user
ivan
petr
13:52:36
#less /etc/login.defs
13:53:46
#grep '[^#]UID_MIN' /etc/login.defs
#SYS_UID_MIN              100
13:54:05
#grep 'UID_MIN' /etc/login.defs
UID_MIN                  1000
#SYS_UID_MIN              100
13:54:12
#grep '^UID_MIN' /etc/login.defs
UID_MIN                  1000
13:54:18
#grep '^UID_MIN' /etc/login.defs | awk '{print $2}'
1000
13:56:01
#bash shell.sh
1000
13:56:06
#vi shell.sh
--- /tmp/l3-saved-7671.19732.3945	2015-09-29 14:56:07.960319809 +0300
+++ shell.sh	2015-09-29 14:57:43.420319801 +0300
@@ -1,4 +1,4 @@
 #!/bin/bash
 
 uid=$(grep '^UID_MIN' /etc/login.defs | awk '{print $2}')
-echo $uid
+
13:57:43
#grep '^UID_MIN' /etc/login.defs
UID_MIN                  1000
13:59:43
#vi shell.sh
--- /tmp/l3-saved-7671.26563.25283	2015-09-29 14:59:44.660319808 +0300
+++ shell.sh	2015-09-29 14:59:59.640319809 +0300
@@ -1,5 +1,5 @@
 #!/bin/bash
 
 uid=$(grep '^UID_MIN' /etc/login.defs | awk '{print $2}')
-users=$(awk -F: '$3>=$uid{print $1}')
+users=$(awk -F: '$3>=$uid{print $1}' /etc/passwd)
 echo $users
13:59:59
#bash shell.sh

14:00:01
#vi shell.sh
14:00:32
#$uid

14:00:34
#grep '^UID_MIN' /etc/login.defs | awk '{print $2}'
1000
14:00:47
#$uid
l3script: 1000: команда не найдена
14:00:50
#echo $uid
1000
14:00:56
#awk -F: '$3>=$uid' /etc/passwd

14:01:17
#awk -F: '$3>=1000' /etc/passwd
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
user:x:1000:1000:user,,,:/home/user:/bin/bash
ivan:x:1001:1001::/home/ivan:/bin/bash
petr:x:1002:1002::/home/petr:/bin/bash
14:01:23
#man awk
14:02:05
#awk -F: '$3>=ENVIRON[$uid]' /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
...
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
libuuid:x:100:101::/var/lib/libuuid:/bin/sh
Debian-exim:x:101:103::/var/spool/exim4:/bin/false
user:x:1000:1000:user,,,:/home/user:/bin/bash
sshd:x:102:65534::/var/run/sshd:/usr/sbin/nologin
ivan:x:1001:1001::/home/ivan:/bin/bash
petr:x:1002:1002::/home/petr:/bin/bash
14:03:12
#awk -F: '{print ENVIRON[uid]}'
^C
14:03:36
#awk -F: '{print ENVIRON[uid]}' /etc/passwd

14:03:40
#echo $uid
1000
14:04:14
#vi shell.sh
--- /tmp/l3-saved-7671.2097.26647	2015-09-29 15:04:27.884319808 +0300
+++ shell.sh	2015-09-29 15:05:41.172319808 +0300
@@ -1,5 +1,5 @@
 #!/bin/bash
 
 uid=$(grep '^UID_MIN' /etc/login.defs | awk '{print $2}')
-users=$(awk -F: '$3>=1000{print $1}' /etc/passwd)
+users=$(awk -F: '$3>=1000 && $3!=65534 {print $1}' /etc/passwd)
 echo $users
14:05:41
#bash shell.sh
user ivan petr
14:05:43
#vi shell.sh
--- /tmp/l3-saved-7671.29757.23044	2015-09-29 15:05:46.288319809 +0300
+++ shell.sh	2015-09-29 15:07:57.244319801 +0300
@@ -2,4 +2,7 @@
 
 uid=$(grep '^UID_MIN' /etc/login.defs | awk '{print $2}')
 users=$(awk -F: '$3>=1000 && $3!=65534 {print $1}' /etc/passwd)
-echo $users
+for user in $users
+   do
+     usermod -s ${1:/bin/bash} $user
+   done
14:07:57
#vi /etc/passwd
--- /tmp/l3-saved-7671.31013.2770	2015-09-29 15:08:02.384319809 +0300
+++ /etc/passwd	2015-09-29 15:08:10.812319809 +0300
@@ -21,4 +21,4 @@
 user:x:1000:1000:user,,,:/home/user:/bin/bash
 sshd:x:102:65534::/var/run/sshd:/usr/sbin/nologin
 ivan:x:1001:1001::/home/ivan:/bin/bash
-petr:x:1002:1002::/home/petr:/bin/bash
+petr:x:1002:1002::/home/petr:/bin/sh
14:08:10
#bash shell.sh
Использование: usermod [параметры] ПОÐ
, --comment КОММЕНТАРИЙ     новое значение поля GECOS
  -d, --home ДОМ_КАТ            новый домашний каталог учётной записи
  -e, --expiredate ДАТА_УСТ     установить дату окончания действия
                                учётной записи в ДАТА_УСТ
  -f, --inactive НЕАКТИВНОСТЬ   установить период неактивности пароля после
                                устаревания учётной записи равным НЕАКТИВНОСТЬ
  -g, --gid ГРУППА              принудительно назначить первичную ГРУППУ
  -G, --groups ГРУППЫ           список дополнительных ГРУПП
  -a, --append                  добавить пользователя в дополнительные
...
                                имеющимся (не уникальным) UID
  -p, --password ПАРОоль для
                                учётной записи
  -R, --root КАТ_CHROOT         каталог, в который выполняется chroot
  -s, --shell ОБОолочка для учётной
                                записи
  -u, --uid UID                 новый UID для учётной записи
  -U, --unlock                  разблокировать учётную запись
  -Z, --selinux-user SEUSER     новое пользовательское сопоставление
                                SELinux для учётной записи
14:08:14
#vi /etc/passwd
14:08:21
# 23 ivan:x:1001:1001::/home/ivan:/bin/bash
  2
  3 uid=$(grep '^UID_MIN' /etc/login.defs | awk '{print $2}')
  4 #     usermod -s ${1:/bin/bash} $user4 {print $1}' /etc/passwd)
    echo $user
  9    done
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"shell.sh" 9L, 217C записано
14:08:43
#bash shell.sh
user
ivan
petr
14:08:44
#vi shell.sh
--- /tmp/l3-saved-7671.7571.16364	2015-09-29 15:08:48.396319809 +0300
+++ shell.sh	2015-09-29 15:09:05.008319801 +0300
@@ -4,6 +4,5 @@
 users=$(awk -F: '$3>=1000 && $3!=65534 {print $1}' /etc/passwd)
 for user in $users
    do
-#     usermod -s ${1:/bin/bash} $user
-echo $user
+     usermod -s ${1:'/bin/bash'} $user
    done
14:09:05
#bash shell.sh
Использование: usermod [параметры] ПОÐ
, --comment КОММЕНТАРИЙ     новое значение поля GECOS
  -d, --home ДОМ_КАТ            новый домашний каталог учётной записи
  -e, --expiredate ДАТА_УСТ     установить дату окончания действия
                                учётной записи в ДАТА_УСТ
  -f, --inactive НЕАКТИВНОСТЬ   установить период неактивности пароля после
                                устаревания учётной записи равным НЕАКТИВНОСТЬ
  -g, --gid ГРУППА              принудительно назначить первичную ГРУППУ
  -G, --groups ГРУППЫ           список дополнительных ГРУПП
  -a, --append                  добавить пользователя в дополнительные
...
                                имеющимся (не уникальным) UID
  -p, --password ПАРОоль для
                                учётной записи
  -R, --root КАТ_CHROOT         каталог, в который выполняется chroot
  -s, --shell ОБОолочка для учётной
                                записи
  -u, --uid UID                 новый UID для учётной записи
  -U, --unlock                  разблокировать учётную запись
  -Z, --selinux-user SEUSER     новое пользовательское сопоставление
                                SELinux для учётной записи
14:09:06
#vi shell.sh
14:09:16
#bash shell.sh /bin/bash
shell.sh: line 7: 1: '/bin/bash': ошибка синтаксиса: ожидается операнд (error token is "'/bin/bash'")
14:09:34
#bash shell.sh /bin/bash
usermod: изменения не внесены
usermod: изменения не внесены
14:09:36
#cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
...
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
libuuid:x:100:101::/var/lib/libuuid:/bin/sh
Debian-exim:x:101:103::/var/spool/exim4:/bin/false
user:x:1000:1000:user,,,:/home/user:/bin/bash
sshd:x:102:65534::/var/run/sshd:/usr/sbin/nologin
ivan:x:1001:1001::/home/ivan:/bin/bash
petr:x:1002:1002::/home/petr:/bin/bash
14:10:57
#awk 'ivan' /etc/passwd

14:11:21
#grep 'ivan' /etc/passwd
ivan:x:1001:1001::/home/ivan:/bin/bash
14:11:31
#grep '^ivan.*bash$' /etc/passwd
ivan:x:1001:1001::/home/ivan:/bin/bash
14:11:49
#grep '^ivan.*zsh$' /etc/passwd

14:14:10
#bash shell.sh /bin/bash

Файлы

  • /etc/passwd
  • install
  • /etc/passwd
    >
    root:x:0:0:root:/root:/bin/bash
    daemon:x:1:1:daemon:/usr/sbin:/bin/sh
    bin:x:2:2:bin:/bin:/bin/sh
    sys:x:3:3:sys:/dev:/bin/sh
    sync:x:4:65534:sync:/bin:/bin/sync
    games:x:5:60:games:/usr/games:/bin/sh
    man:x:6:12:man:/var/cache/man:/bin/sh
    lp:x:7:7:lp:/var/spool/lpd:/bin/sh
    mail:x:8:8:mail:/var/mail:/bin/sh
    news:x:9:9:news:/var/spool/news:/bin/sh
    uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
    proxy:x:13:13:proxy:/bin:/bin/sh
    www-data:x:33:33:www-data:/var/www:/bin/sh
    backup:x:34:34:backup:/var/backups:/bin/sh
    list:x:38:38:Mailing List Manager:/var/list:/bin/sh
    irc:x:39:39:ircd:/var/run/ircd:/bin/sh
    gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
    nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
    libuuid:x:100:101::/var/lib/libuuid:/bin/sh
    Debian-exim:x:101:103::/var/spool/exim4:/bin/false
    user:x:1000:1000:user,,,:/home/user:/bin/bash
    sshd:x:102:65534::/var/run/sshd:/usr/sbin/nologin
    ivan:x:1001:1001::/home/ivan:/bin/bash
    petr:x:1002:1002::/home/petr:/bin/bash
    
    install
    >
    #!/bin/sh
    hostname=`hostname`
    uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
    ###############################################################################
    #
    # Set this variables before installation:
    lilalo_user=13-10-2014
    lab=NT-LNet
    install_l3bashrc_for_this_users=${users:-"root user"}  # users who will use l3agent and l3script
    lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
    #
    ###############################################################################
    lilalo_rc=.l3rc
    lilalo_home=.lilalo
    url_lilalo="http://xgu.ru/lilalo"
    url_l3bashrc="${url_lilalo}"/l3bashrc
    url_l3agent="${url_lilalo}"/l3-agent
    url_l3config_pm="${url_lilalo}"/l3config.pm
    url_l3config="${url_lilalo}"/l3-config
    url_l3prompt="${url_lilalo}"/l3prompt
    url_perl_modules=${url_lilalo}/
    perl_modules="Term-VT102 Text-Iconv"
    apt_get_install_this="perl make libmodule-build-perl libc6-dev gcc"
    wget=wget
    uname -a | egrep -qi '(bsd|darwin)' && wget=fetch
    normC='\033[0;39m'
    whiteC='\033[1;37m'
    redC='\033[0;31m'
    greenC='\033[0;32m'
    apt_get_install_deps()
    {
        return 0
        if which apt-get >& /dev/null
        then
            apt-get install -y $apt_get_install_this
        else
            echo "Please install this dependencies manually:"
            echo $apt_get_install_this
            echo "Have you installed this already (y/n)?"
            echo y | read answer
            if echo $answer | grep -q ^[yY]
            then
                true
            else
                echo Please install the dependencies and rerun the script
                exit 1
            fi
        fi
    }
    step()
    {
        msg="$1"
        shift
        printf "${whiteC}""$msg""...${normC}\n"
    #    eval "$@" 2>&1 | sed 's/^/|\ \ \ /' && printf "Ok\n" || printf "Failed\n"
        eval "$@" 2>&1 > log 2>&1 && \
        {
              cat log | sed 's/^/|\ \ \ /'
              printf "${greenC}""Ok\n""${normC}"
        } || \
        {
            cat log | sed 's/^/|\ \ \ /'
            printf "${redC}""Failed\n""${normC}"
        }
    }
    get_user_home()
    {
        uname -a | egrep -qi '(freebsd|darwin)' && pw user show "$@"| awk -F: '{print $9}' || getent passwd "$@"| awk -F: '{print $6}'
    }
    install_to_users_homes()
    {
        . l3bashrc
        users="$@"
        set -x
        for user in $users
        do
            user_home=`get_user_home "$user"`
            mkdir -p ${user_home}/${lilalo_home}
            mkdir /etc/lilalo/
            cp l3config.pm /etc/lilalo/
            cp l3-agent /usr/local/bin
            cp l3-config /usr/local/bin
            ln -s `which bash` /usr/local/bin/l3script
            chmod 755 /usr/local/bin/l3-{agent,config}
            cp l3bashrc ${user_home}/${lilalo_home}
            cp l3prompt ${user_home}/${lilalo_home}
            chmod 755 ${user_home}/${lilalo_home}/l3prompt
            chown -R $user ${user_home}/${lilalo_home}
            echo l3cd=${lilalo_context}/$user > ${user_home}/${lilalo_rc}
            chown -R $user ${user_home}/${lilalo_rc}
        done
        set +x
    }
    install_to_users_bashrc()
    {
        users="$@"
        for user in $users
        do
            user_home=`get_user_home "$user"`
            grep -q lilalo ${user_home}/.bashrc 2> /dev/null\
            || echo "[ \$0 == l3script ] && . ${user_home}/.lilalo/l3bashrc && _l3_start" >> ${user_home}/.bashrc; chown -R ${user} ${user_home}/.bashrc
        done
    }
    install_to_users_bash_profile()
    {
        users="$@"
        for user in $users
        do
            user_home=`get_user_home "$user"`
            grep -q l3-agent ${user_home}/.bash_profile 2> /dev/null \
            || { echo >> ${user_home}/.bash_profile ; cat ${user_home}/.bash_profile | sed '1s/^/l3-agentX/' | tr X '\n' > /tmp/$$$$l3 ; mv /tmp/$$$$l3 ${user_home}/.bash_profile; chown -R ${user} ${user_home}/.bash_profile; }
        done
    }
    show_usage()
    {
        cat <<USAGE
    Usage:
        $0
    USAGE
    }
    show_final_message()
    {
        cat <<FINAL_MESSAGE
    Installation is successfully completed.
    Now restart your shell or relogin
    to start script writing.
    Your current lilalo context is ${lilalo_context}/USER
    If you use xgu.ru backend, your labs will be available at
    http://xgu.ru/l3/${lilalo_context}
    Use commands
     $ l3cd ${lilalo_context%/*/*}/MY-NEW-CONTEXT/${hostname}/USER
     $ l3pwd
    to change and to know your current context.
    For further information see http://xgu.ru/lilalo/ (in Russian).
    Thank you gor using LiLaLo.
    Happy Labbing!
    (don't forget to restart bash or relogin)
    FINAL_MESSAGE
    }
    temp_dir=/tmp/lilalo-install-temp-$$
    mkdir -p ${temp_dir}
    cd ${temp_dir}
    step "Installing dependencies" apt_get_install_deps
    step "Downloading l3bashrc" ${wget} ${url_l3bashrc}
    step "Downloading l3prompt" ${wget} ${url_l3prompt}
    step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
    step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
    step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }'
    step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
    step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
    step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
    cd /
    rm -rf ${temp_dir}
    show_final_message
    

    Статистика

    Время первой команды журнала11:50:26 2015- 9-29
    Время последней команды журнала14:14:10 2015- 9-29
    Количество командных строк в журнале101
    Процент команд с ненулевым кодом завершения, % 7.92
    Процент синтаксически неверно набранных команд, % 0.99
    Суммарное время работы с терминалом *, час 1.33
    Количество командных строк в единицу времени, команда/мин 1.27
    Частота использования команд
    cat42|===========================| 27.27%
    grep34|======================| 22.08%
    awk14|=========| 9.09%
    egrep12|=======| 7.79%
    vi11|=======| 7.14%
    bash9|=====| 5.84%
    ls6|===| 3.90%
    ps4|==| 2.60%
    man4|==| 2.60%
    echo3|=| 1.95%
    =1000'2|=| 1.30%
    locate2|=| 1.30%
    $uid2|=| 1.30%
    =$uid'1|| 0.65%
    >1|| 0.65%
    history1|| 0.65%
    cd1|| 0.65%
    \*1|| 0.65%
    231|| 0.65%
    =ENVIRON[$uid]'1|| 0.65%
    less1|| 0.65%
    =1000{print1|| 0.65%
    ____
    *) Интервалы неактивности длительностью 30 минут и более не учитываются

    Справка

    Для того чтобы использовать LiLaLo, не нужно знать ничего особенного: всё происходит само собой. Однако, чтобы ведение и последующее использование журналов было как можно более эффективным, желательно иметь в виду следующее:
    1. В журнал автоматически попадают все команды, данные в любом терминале системы.

    2. Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.

    3. Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
      $ l s-l
      bash: l: command not found
      

    4. Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
      $ test 5 -lt 4
      Обратите внимание на то, что код завершения команды может быть отличен от нуля не только в тех случаях, когда команда была выполнена с ошибкой. Многие команды используют код завершения, например, для того чтобы показать результаты проверки

    5. Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
      $ find / -name abc
      find: /home/devi-orig/.gnome2: Keine Berechtigung
      find: /home/devi-orig/.gnome2_private: Keine Berechtigung
      find: /home/devi-orig/.nautilus/metafiles: Keine Berechtigung
      find: /home/devi-orig/.metacity: Keine Berechtigung
      find: /home/devi-orig/.inkscape: Keine Berechtigung
      ^C
      

    6. Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
      # id
      uid=0(root) gid=0(root) Gruppen=0(root)
      

    7. Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
      $ vi ~/.bashrc
      2a3,5
      >    if [ -f /usr/local/etc/bash_completion ]; then
      >         . /usr/local/etc/bash_completion
      >        fi
      

    8. Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
      $ patch ~/.bashrc
      В данном случае изменения применяются к файлу ~/.bashrc

    9. Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.

      Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.

    10. Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.

    11. Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора

    12. Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.

    13. Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.

    14. Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:

      $ whoami
      
      user
      
      $ #^ Интересно, кто я?
      
      в журнале это будет выглядеть так:
      $ whoami
      
      user
      
      Интересно, кто я?

    15. Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:

      $ whoami
      
      user
      
      $ cat > /dev/null #^ Интересно, кто я?
      
      Программа whoami выводит имя пользователя, под которым 
      мы зарегистрировались в системе.
      -
      Она не может ответить на вопрос о нашем назначении 
      в этом мире.
      
      В журнале это будет выглядеть так:
      $ whoami
      user
      
      Интересно, кто я?
      Программа whoami выводит имя пользователя, под которым
      мы зарегистрировались в системе.

      Она не может ответить на вопрос о нашем назначении
      в этом мире.
      Для разделения нескольких абзацев между собой используйте символ "-", один в строке.

    16. Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=

    17. Содержимое файла может быть показано в журнале. Для этого его нужно вывести с помощью программы cat. Если вывод команды отметить симоволами #!, содержимое файла будет показано в журнале в специально отведённой для этого секции.
    18. Для того чтобы вставить скриншот интересующего вас окна в журнал, нужно воспользоваться командой l3shot. После того как команда вызвана, нужно с помощью мыши выбрать окно, которое должно быть в журнале.
    19. Команды в журнале расположены в хронологическом порядке. Если две команды давались одна за другой, но на разных терминалах, в журнале они будут рядом, даже если они не имеют друг к другу никакого отношения.
      1
          2
      3   
          4
      
      Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.

    О программе

    LiLaLo (L3) расшифровывается как Live Lab Log.
    Программа разработана для повышения эффективности обучения Unix/Linux-системам.
    (c) Игорь Чубин, 2004-2008

    $Id$