| /l3/users/16-07-2018/NT-Ladm/debian3.net.nt/root :1 :2 :3 :4 :5 :6 |
|
|
#ls -all
итого 56 drwx------ 5 root root 4096 Июл 16 10:01 . drwxr-xr-x 24 root root 4096 Окт 15 2014 .. drwx------ 2 root root 4096 Июн 27 2014 .aptitude -rw------- 1 root root 1896 Окт 15 2014 .bash_history -rw-r--r-- 1 root root 10 Июн 27 2014 .bash_profile -rw-r--r-- 1 root root 630 Июн 27 2014 .bashrc -rw-r--r-- 1 root root 5268 Окт 13 2014 install -rw-r--r-- 1 root root 51 Июл 13 14:52 .l3rc drwxr-xr-x 2 root root 4096 Июл 16 10:05 .lilalo -rw-r--r-- 1 root root 140 Ноя 19 2007 .profile drwxr-xr-x 2 root root 4096 Июн 27 2014 .vim -rw------- 1 root root 5398 Июл 16 10:01 .viminfo |
|
#useradd ivan
|
|
#echo $?
0 |
|
#useradd ivan
useradd: пользователь «ivan» уже существует |
|
#echo $?
9 |
|
#useradd --help
ÐÑполÑзование: useradd [паÑамеÑÑÑ] ÐÐÐ
seradd -D
useradd -D [паÑамеÑÑÑ]
ÐаÑамеÑÑÑ:
-b, --base-dir ÐÐÐ_ÐÐТ базовÑй каÑалог Ð´Ð»Ñ Ð´Ð¾Ð¼Ð°Ñнего каÑалога новой
ÑÑÑÑной запиÑи
-c, --comment ÐÐÐÐÐÐТÐÐ ÐРполе GECOS новой ÑÑÑÑной запиÑи
-d, --home-dir ÐÐÐ_ÐÐТ домаÑний каÑалог новой ÑÑÑÑной запиÑи
-D, --defaults показаÑÑ Ð¸Ð»Ð¸ измениÑÑ Ð½Ð°ÑÑÑойки
по ÑмолÑÐ°Ð½Ð¸Ñ Ð´Ð»Ñ useradd
...
-p, --password ÐÐÐ ÐÐÑÑной запиÑи
-r, --system ÑоздаÑÑ ÑиÑÑемнÑÑ ÑÑÑÑнÑÑ Ð·Ð°Ð¿Ð¸ÑÑ
-R, --root ÐÐТ_CHROOT каÑалог, в коÑоÑÑй вÑполнÑеÑÑÑ chroot
-s, --shell ÐÐÐРновой
ÑÑÑÑной запиÑи
-u, --uid UID полÑзоваÑелÑÑкий ID новой ÑÑÑÑной запиÑи
-U, --user-group ÑоздаÑÑ Ð³ÑÑÐ¿Ð¿Ñ Ñ Ñем же именем ÑÑо и Ñ
полÑзоваÑелÑ
-Z, --selinux-user SEUSER иÑполÑзоваÑÑ Ñказанного SEUSER длÑ
полÑзоваÑелÑÑкого ÑопоÑÑÐ°Ð²Ð»ÐµÐ½Ð¸Ñ SELinux
|
|
#$LANG=
l3script: ru_RU.UTF-8=: команда не найдена |
|
#LANG=""
|
|
#useradd --help
Usage: useradd [options] LOGIN
useradd -D
useradd -D [options]
Options:
-b, --base-dir BASE_DIR base directory for the home directory of the
new account
-c, --comment COMMENT GECOS field of the new account
-d, --home-dir HOME_DIR home directory of the new account
-D, --defaults print or change default useradd configuration
-e, --expiredate EXPIRE_DATE expiration date of the new account
...
the user
-o, --non-unique allow to create users with duplicate
(non-unique) UID
-p, --password PASSWORD encrypted password of the new account
-r, --system create a system account
-R, --root CHROOT_DIR directory to chroot into
-s, --shell SHELL login shell of the new account
-u, --uid UID user ID of the new account
-U, --user-group create a group with the same name as the user
-Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping
|
|
#man useradd
|
|
#passwd ivan
Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully |
|
#userdel ivan
|
|
#echo $?
0 |
|
#useradd --help
Usage: useradd [options] LOGIN
useradd -D
useradd -D [options]
Options:
-b, --base-dir BASE_DIR base directory for the home directory of the
new account
-c, --comment COMMENT GECOS field of the new account
-d, --home-dir HOME_DIR home directory of the new account
-D, --defaults print or change default useradd configuration
-e, --expiredate EXPIRE_DATE expiration date of the new account
...
the user
-o, --non-unique allow to create users with duplicate
(non-unique) UID
-p, --password PASSWORD encrypted password of the new account
-r, --system create a system account
-R, --root CHROOT_DIR directory to chroot into
-s, --shell SHELL login shell of the new account
-u, --uid UID user ID of the new account
-U, --user-group create a group with the same name as the user
-Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping
|
|
#useradd --help
Usage: useradd [options] LOGIN
useradd -D
useradd -D [options]
Options:
-b, --base-dir BASE_DIR base directory for the home directory of the
new account
-c, --comment COMMENT GECOS field of the new account
-d, --home-dir HOME_DIR home directory of the new account
-D, --defaults print or change default useradd configuration
-e, --expiredate EXPIRE_DATE expiration date of the new account
...
the user
-o, --non-unique allow to create users with duplicate
(non-unique) UID
-p, --password PASSWORD encrypted password of the new account
-r, --system create a system account
-R, --root CHROOT_DIR directory to chroot into
-s, --shell SHELL login shell of the new account
-u, --uid UID user ID of the new account
-U, --user-group create a group with the same name as the user
-Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping
|
|
#useradd -m -s /bin/bash ivan
|
|
#passwd ivan
Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully |
|
#useradd -m -s /bin/bash petr
|
|
#passwd petr
Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully |
|
#who
root pts/0 Jul 16 09:55 (192.168.15.147) ivan pts/2 Jul 16 10:42 (192.168.15.147) petr pts/3 Jul 16 10:45 (192.168.15.147) |
|
#whoami
root |
|
#hostname
debian3 |
|
#echo ~
/root |
|
#cd /
|
|
#echo ~
/root |
|
#cd ..
|
|
#cd /ivan
l3script: cd: /ivan: No such file or directory |
|
#cd /root
|
|
#cd ..
|
|
#cd /home
|
|
#cd /ivan
l3script: cd: /ivan: No such file or directory |
|
#cd ivan
|
|
#pwd
/home/ivan |
|
#cd /
|
|
#cd
|
|
#cd /home/ivan
|
|
#cd
|
|
#ls l
ls: cannot access l: No such file or directory |
|
#ls -l
total 8 -rw-r--r-- 1 root root 5268 Oct 13 2014 install |
|
#ls -la
total 56 drwx------ 5 root root 4096 Jul 16 10:01 . drwxr-xr-x 24 root root 4096 Oct 15 2014 .. drwx------ 2 root root 4096 Jun 27 2014 .aptitude -rw------- 1 root root 1896 Oct 15 2014 .bash_history -rw-r--r-- 1 root root 10 Jun 27 2014 .bash_profile -rw-r--r-- 1 root root 630 Jun 27 2014 .bashrc -rw-r--r-- 1 root root 51 Jul 13 14:52 .l3rc drwxr-xr-x 2 root root 4096 Jul 16 10:05 .lilalo -rw-r--r-- 1 root root 140 Nov 19 2007 .profile drwxr-xr-x 2 root root 4096 Jun 27 2014 .vim -rw------- 1 root root 5398 Jul 16 10:01 .viminfo -rw-r--r-- 1 root root 5268 Oct 13 2014 install |
|
#ls -la --colour
ls: unrecognized option '--colour' Try `ls --help' for more information. |
|
#ls -la --color
total 56 drwx------ 5 root root 4096 Jul 16 10:01 . drwxr-xr-x 24 root root 4096 Oct 15 2014 .. drwx------ 2 root root 4096 Jun 27 2014 .aptitude -rw------- 1 root root 1896 Oct 15 2014 .bash_history -rw-r--r-- 1 root root 10 Jun 27 2014 .bash_profile -rw-r--r-- 1 root root 630 Jun 27 2014 .bashrc -rw-r--r-- 1 root root 51 Jul 13 14:52 .l3rc drwxr-xr-x 2 root root 4096 Jul 16 10:05 .lilalo -rw-r--r-- 1 root root 140 Nov 19 2007 .profile drwxr-xr-x 2 root root 4096 Jun 27 2014 .vim -rw------- 1 root root 5398 Jul 16 10:01 .viminfo -rw-r--r-- 1 root root 5268 Oct 13 2014 install |
|
#alias ls='ls --color'
|
|
#ls -la
total 56 drwx------ 5 root root 4096 Jul 16 10:01 . drwxr-xr-x 24 root root 4096 Oct 15 2014 .. drwx------ 2 root root 4096 Jun 27 2014 .aptitude -rw------- 1 root root 1896 Oct 15 2014 .bash_history -rw-r--r-- 1 root root 10 Jun 27 2014 .bash_profile -rw-r--r-- 1 root root 630 Jun 27 2014 .bashrc -rw-r--r-- 1 root root 51 Jul 13 14:52 .l3rc drwxr-xr-x 2 root root 4096 Jul 16 10:05 .lilalo -rw-r--r-- 1 root root 140 Nov 19 2007 .profile drwxr-xr-x 2 root root 4096 Jun 27 2014 .vim -rw------- 1 root root 5398 Jul 16 10:01 .viminfo -rw-r--r-- 1 root root 5268 Oct 13 2014 install |
|
#alias
alias ls='ls --color' |
|
#who
root pts/0 Jul 16 09:55 (192.168.15.147) ivan pts/2 Jul 16 10:42 (192.168.15.147) petr pts/3 Jul 16 10:45 (192.168.15.147) user pts/4 Jul 16 10:51 (192.168.15.147) |
|
#echo privet>/dev/pts2
|
|
#echo privet>/dev/pts/2
|
|
#mailq
|
|
#witch who
l3script: witch: command not found |
|
#wich who
l3script: wich: command not found |
|
#with who
l3script: with: command not found |
|
#which who
/usr/bin/who |
|
#ls -l /usr/bin/wh
whatis whereis which whiptail who whoami |
|
#ls -l /usr/bin/who
-rwxr-xr-x 1 root root 55888 Jan 26 2013 /usr/bin/who |
|
#which mailq
/usr/bin/mailq |
|
#ls -l /usr/bin/mailq
lrwxrwxrwx 1 root root 13 Jan 2 2013 /usr/bin/mailq -> ../sbin/exim4 |
|
#ls -l /usr/sbin/exim
exim exim_checkaccess exim_dbmbuild exim_fixdb exim_tidydb exim4 exim_convert4r4 exim_dumpdb exim_lock eximstats |
|
#ls -l /usr/sbin/exim4
-rwsr-xr-x 1 root root 973824 Jan 2 2013 /usr/sbin/exim4 |
|
#ls -l /dev/cdrom1
lrwxrwxrwx 1 root root 3 Jul 16 08:39 /dev/cdrom1 -> sr0 |
|
#ls -l /dev/sr0
brw-rw---T 1 root cdrom 11, 0 Jul 16 08:39 /dev/sr0 |
|
#mkfifo /tmp/test
|
|
#ls -l /tmp/test
prw-r--r-- 1 root root 0 Jul 16 12:03 /tmp/test |
|
#echo privet > /tmp/test
^Cl3script: /tmp/test: Interrupted system call |
|
#ls -l /dev/log
srw-rw-rw- 1 root root 0 Jul 16 08:39 /dev/log |
|
#netstat
Active Internet connections (w/o servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 debian3.net.nt:ssh 192.168.15.147:49402 ESTABLISHED tcp 0 0 debian3.net.nt:ssh 192.168.15.147:49395 ESTABLISHED tcp 0 368 debian3.net.nt:ssh 192.168.15.147:49316 ESTABLISHED tcp 0 0 debian3.net.nt:ssh 192.168.15.147:49392 ESTABLISHED Active UNIX domain sockets (w/o servers) Proto RefCnt Flags Type State I-Node Path unix 7 [ ] DGRAM 5072 /dev/log unix 3 [ ] STREAM CONNECTED 7191 ... unix 3 [ ] STREAM CONNECTED 6963 unix 3 [ ] STREAM CONNECTED 6962 unix 2 [ ] DGRAM 6961 unix 3 [ ] STREAM CONNECTED 6736 unix 3 [ ] STREAM CONNECTED 6735 unix 2 [ ] DGRAM 6734 unix 2 [ ] DGRAM 5472 unix 2 [ ] DGRAM 5097 unix 3 [ ] DGRAM 3252 unix 3 [ ] DGRAM 3251 |
|
#echo privet > /tmp/test
dfdsf |
|
#dfdsf
l3script: dfdsf: command not found |
|
#cd /home/ivan
|
|
#cd /home/petr
|
|
#cd -
/home/ivan |
|
#cd -
/home/petr |
|
#echo $allpwd
|
|
#echo $ALLPWD
|
|
#echo $OLDPWD
/home/ivan |
|
#cd ..
|
|
#cd ..
|
|
#~
l3script: /root: Is a directory |
|
#cd /root
|
|
#apt-get install tree
Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: tree 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 43.3 kB of archives. After this operation, 112 kB of additional disk space will be used. Get:1 http://ftp.ua.debian.org/debian/ wheezy/main tree amd64 1.6.0-1 [43.3 kB] Fetched 43.3 kB in 0s (368 kB/s) Selecting previously unselected package tree. (Reading database ... 28835 files and directories currently installed.) Unpacking tree (from .../tree_1.6.0-1_amd64.deb) ... Processing triggers for man-db ... Setting up tree (1.6.0-1) ... |
|
#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
|
|
#more install
|
|
#less install
|
|
#head install
#!/bin/sh hostname=`hostname` uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` ############################################################################### # # Set this variables before installation: lilalo_user=13-10-2014 |
|
#head -5 install
#!/bin/sh hostname=`hostname` uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` |
|
#tail install
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
|
|
#tail install | nl
1 step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
2 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; }'
3 step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
4 step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
5 step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
6 cd /
7 rm -rf ${temp_dir}
8 show_final_message
|
|
#tac install
show_final_message
rm -rf ${temp_dir}
cd /
step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users
step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users
step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users
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 "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }'
step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}'
step "Downloading l3prompt" ${wget} ${url_l3prompt}
...
lilalo_context="/users/${lilalo_user}/${lab}/${hostname}"
install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script
lab=NT-LNet
lilalo_user=13-10-2014
# Set this variables before installation:
#
###############################################################################
uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f`
hostname=`hostname`
#!/bin/sh
|
|
#ls -l
total 8 -rw-r--r-- 1 root root 5268 Oct 13 2014 install |
|
#cp install test
|
|
#ls
install test |
|
#which vi
/usr/bin/vi |
|
#ls -l /usr/bin/vi
lrwxrwxrwx 1 root root 20 Jun 27 2014 /usr/bin/vi -> /etc/alternatives/vi |
|
#ls -l /etc/al
aliases alternatives/ |
|
#ls -l /etc/alternatives/vi
lrwxrwxrwx 1 root root 18 Jun 27 2014 /etc/alternatives/vi -> /usr/bin/vim.basic |
|
#ls -l /usr/bin/vi
vi view vim vim.basic vim.tiny vimdiff vimtutor |
|
#ls -l /usr/bin/vi
vi view vim vim.basic vim.tiny vimdiff vimtutor |
|
#ls -l /usr/bin/vim.
vim.basic vim.tiny |
|
#ls -l /usr/bin/vim.basic
-rwxr-xr-x 1 root root 1876072 Feb 10 2013 /usr/bin/vim.basic |
|
#which wim
|
#!/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
| Время первой команды журнала | 09:05:33 2018- 7-16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Время последней команды журнала | 14:28:38 2018- 7-16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Количество командных строк в журнале | 100 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Процент команд с ненулевым кодом завершения, % | 8.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Процент синтаксически неверно набранных команд, % | 5.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Суммарное время работы с терминалом *, час | 3.01 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Количество командных строк в единицу времени, команда/мин | 0.55 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.
Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
$ l s-l bash: l: command not found |
Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
$ test 5 -lt 4 |
Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
$ 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 |
Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
# id uid=0(root) gid=0(root) Gruppen=0(root) |
Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
$ vi ~/.bashrc
|
Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
$ patch ~/.bashrc |
Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.
Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.
Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.
Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора
Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.
Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.
Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:
$ whoami
user
$ #^ Интересно, кто я?в журнале это будет выглядеть так:
$ whoami
user
| Интересно, кто я? |
Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:
$ whoami
user
$ cat > /dev/null #^ Интересно, кто я?
Программа whoami выводит имя пользователя, под которым мы зарегистрировались в системе. - Она не может ответить на вопрос о нашем назначении в этом мире.В журнале это будет выглядеть так:
$ whoami user
|
Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=
1
2
3
4
Группы команд, выполненных на разных терминалах, разделяются специальной линией.
Под этой линией в правом углу показано имя терминала, на котором выполнялись команды.
Для того чтобы посмотреть команды только одного сенса,
нужно щёкнуть по этому названию.
LiLaLo (L3) расшифровывается как Live Lab Log.
Программа разработана для повышения эффективности обучения Unix/Linux-системам.
(c) Игорь Чубин, 2004-2008