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

Содержание

Журнал

Среда (09/09/09)

/dev/ttypc
10:45:00
$cat /tmp/squid.conf
#               NOTE: Also requires icp_port option enabled to send/receive
#                     requests via this method.
#
#           options: proxy-only
#                    weight=n
#                    ttl=n
#                    no-query
#                    default
#                    round-robin
#                    carp
#                    multicast-responder
10:45:08
$cat /tmp/squid.conf | egrep "^ *$|^#
#       acl normal_service_net src 10.0.0.0/24
#       acl good_service_net src 10.0.1.0/24 10.0.2.0/24
#       tcp_outgoing_address 10.1.0.1 normal_service_net
#       tcp_outgoing_address 10.1.0.2 good_service_net
#       tcp_outgoing_address 10.1.0.3
#
#       Processing proceeds in the order specified, and stops at first fully
#       matching line.
#
#       Note: The use of this directive using client dependent ACLs is
...
#                    use 'ttl=n' to specify a IP multicast TTL to use
#                    when sending an ICP queries to this address.
#                    Only useful when sending to a multicast group.
#                    Because we don't accept ICP replies from random
#                    hosts, you must configure other group members as
#                    peers with the 'multicast-responder' option below.
#
#                    use 'no-query' to NOT send ICP queries to this
#                    neighbor.
#
10:46:16
$cat /tmp/squid.conf | egrep "^
#       Example where requests from 10.0.0.0/24 will be forwarded
#       with source address 10.1.0.1, 10.0.2.0/24 forwarded with
#       source address 10.1.0.2 and the rest will be forwarded with
#       source address 10.1.0.3.
#
#       acl normal_service_net src 10.0.0.0/24
#       acl good_service_net src 10.0.1.0/24 10.0.2.0/24
#       tcp_outgoing_address 10.1.0.1 normal_service_net
#       tcp_outgoing_address 10.1.0.2 good_service_net
#       tcp_outgoing_address 10.1.0.3
...
#                    Because we don't accept ICP replies from random
#                    hosts, you must configure other group members as
#                    peers with the 'multicast-responder' option below.
#
#                    use 'no-query' to NOT send ICP queries to this
#                    neighbor.
#
#                    use 'default' if this is a parent cache which can
#                    be used as a "last-resort" if a peer cannot be located
#                    by any of the peer-selection mechanisms.
10:46:25
$cat /tmp/squid.conf | egrep -v
cache_mgr  scherepenin@techexpert.ua
error_directory /usr/share/squid/errors/Ukrainian-utf8
hosts_file /etc/hosts
coredump_dir /var/spool/squid
10:46:47
$cat /tmp/squid.conf | egrep -v "^ *
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd
auth_param basic children 5
auth_param basic realm Welcome To TechExpert Isa Server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl localnet src 10.0.0.0/8     # RFC1918 possible internal network
...
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
extension_methods REPORT MERGE MKACTIVITY CHECKOUT
shutdown_lifetime 2 seconds
cache_mgr  scherepenin@techexpert.ua
error_directory /usr/share/squid/errors/Ukrainian-utf8
hosts_file /etc/hosts
coredump_dir /var/spool/squid
10:47:14
$#

10:47:22
$alias
alias ls='ls --color=auto'
10:47:26
$alias egrep-my='egrep -v "^ *$|^#"'

10:47:42
$alias
alias egrep-my='egrep -v "^ *$|^#"'
alias ls='ls --color=auto'
10:47:43
$egrep-my /tmp/squid.conf
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd
auth_param basic children 5
auth_param basic realm Welcome To TechExpert Isa Server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl localnet src 10.0.0.0/8     # RFC1918 possible internal network
...
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
extension_methods REPORT MERGE MKACTIVITY CHECKOUT
shutdown_lifetime 2 seconds
cache_mgr  scherepenin@techexpert.ua
error_directory /usr/share/squid/errors/Ukrainian-utf8
hosts_file /etc/hosts
coredump_dir /var/spool/squid
10:47:53
$alias
alias egrep-my='egrep -v "^ *$|^#"'
alias ls='ls --color=auto'
10:49:28
$who
user     ttyp0        2009-09-07 15:51 (host239.net.nt)
user     ttyp2        2009-09-09 11:00 (192.168.16.3)
user     ttyp6        2009-09-09 11:02 (192.168.16.2)
user     ttyp8        2009-09-09 11:03 (192.168.16.25)
user     ttyp3        2009-09-09 11:44 (192.168.16.25)
user     :0           2009-09-08 14:37
user     ttyp9        2009-09-08 14:37 (:0.0)
user     ttypc        2009-09-09 11:44 (:ttyp5:S.0)
10:49:32
$ls -l
итого 2683
drwxr-xr-x 2 user user      72 2009-09-07 15:54 123
-rwxr-xr-x 1 root root      13 2008-03-11 12:42 hello
-rwxr-xr-x 1 user user     225 2009-09-09 10:29 script
-rwxr-xr-x 1 user user 1568611 2009-09-08 15:22 ug-ladm.pdf
-rwxr-xr-x 1 user user 1166385 2009-09-08 15:22 ug-lnet.pdf
10:49:51
$ls -l | sed '/^.{1}/ d'
итого 2683
drwxr-xr-x 2 user user      72 2009-09-07 15:54 123
-rwxr-xr-x 1 root root      13 2008-03-11 12:42 hello
-rwxr-xr-x 1 user user     225 2009-09-09 10:29 script
-rwxr-xr-x 1 user user 1568611 2009-09-08 15:22 ug-ladm.pdf
-rwxr-xr-x 1 user user 1166385 2009-09-08 15:22 ug-lnet.pdf
10:50:32
$ls -l | sed '/^.

10:50:37
$ls -l | sed '/^.{1
итого 2683
drwxr-xr-x 2 user user      72 2009-09-07 15:54 123
-rwxr-xr-x 1 root root      13 2008-03-11 12:42 hello
-rwxr-xr-x 1 user user     225 2009-09-09 10:29 script
-rwxr-xr-x 1 user user 1568611 2009-09-08 15:22 ug-ladm.pdf
-rwxr-xr-x 1 user user 1166385 2009-09-08 15:22 ug-lnet.pdf
10:50:52
$ls -l | sed '/^.\{1\

10:51:08
$ls -l | sed 's/^.//'
[user@debian1:~]$
того 2683
rwxr-xr-x 2 user user      72 2009-09-07 15:54 123
rwxr-xr-x 1 root root      13 2008-03-11 12:42 hello
rwxr-xr-x 1 user user     225 2009-09-09 10:29 script
rwxr-xr-x 1 user user 1568611 2009-09-08 15:22 ug-ladm.pdf
rwxr-xr-x 1 user user 1166385 2009-09-08 15:22 ug-lnet.pdf
10:51:30
$ls -l | sed 's/^./chmod\
chmod того 2683
chmod rwxr-xr-x 2 user user      72 2009-09-07 15:54 123
chmod rwxr-xr-x 1 root root      13 2008-03-11 12:42 hello
chmod rwxr-xr-x 1 user user     225 2009-09-09 10:29 script
chmod rwxr-xr-x 1 user user 1568611 2009-09-08 15:22 ug-ladm.pdf
chmod rwxr-xr-x 1 user user 1166385 2009-09-08 15:22 ug-lnet.pdf
10:51:57
$ls -l | sed 's/^./chmod\ u=
chmod u=того 2683
chmod u=rwxr-xr-x 2 user user      72 2009-09-07 15:54 123
chmod u=rwxr-xr-x 1 root root      13 2008-03-11 12:42 hello
chmod u=rwxr-xr-x 1 user user     225 2009-09-09 10:29 script
chmod u=rwxr-xr-x 1 user user 1568611 2009-09-08 15:22 ug-ladm.pdf
chmod u=rwxr-xr-x 1 user user 1166385 2009-09-08 15:22 ug-lnet.pdf
10:58:32
$ls -l | sed '1d' |
chmod -v u=rwx,g=rx,o=rx 123
chmod -v u=rwx,g=rx,o=rx hello
chmod -v u=rwx,g=rx,o=rx script
chmod -v u=rwx,g=rx,o=rx ug-ladm.pdf
chmod -v u=rwx,g=rx,o=rx ug-lnet.pdf
10:59:03
$find . -ls
chmod -v u=45418 Фев 17  2008 ./.mozilla/firefox/okyhhoxh.default/Cache/2D062EC0d01
chmod -v u=45408 Фев 17  2008 ./.mozilla/firefox/okyhhoxh.default/Cache/4BAC0008d01
chmod -v u=45393 Фев 17  2008 ./.mozilla/firefox/okyhhoxh.default/Cache/ECEB3ADCd01
chmod -v u=45394 Фев 17  2008 ./.mozilla/firefox/okyhhoxh.default/Cache/FE3CDD1Ad01
chmod -v u=45409 Фев 17  2008 ./.mozilla/firefox/okyhhoxh.default/Cache/2F20A81Cd01
chmod -v u=45447 Фев 18  2008 ./.mozilla/firefox/okyhhoxh.default/Cache/866568F1d01
chmod -v u=45399 Фев 17  2008 ./.mozilla/firefox/okyhhoxh.default/Cache/CA3E8801d01
chmod -v u=45392 Фев 17  2008 ./.mozilla/firefox/okyhhoxh.default/Cache/51C2AF62d01
chmod -v u=45403 Фев 17  2008 ./.mozilla/firefox/okyhhoxh.default/Cache/F30BE45Bd01
chmod -v u=45404 Фев 17  2008 ./.mozilla/firefox/okyhhoxh.default/Cache/B698F4DFd01
...
chmod -v u=52980 Сен  8 19:30 ./.lilalo/9169226011486531189-1252424225.script
chmod -v u=53035 Сен  9 11:42 ./.lilalo/10668146982321225773-1252485710.script
chmod -v u=46550 Май 24 13:21 ./.lilalo/1653016833171326170-1243160493_1243160511_home_user_.bash__profile.diff
chmod -v u=52795 Сен  8 14:37 ./.lilalo/27021238671232831523-1252409836.script
chmod -v u=52460 Сен  9 09:37 ./.lilalo/25984240513059826809-1252308484.info
chmod -v u=53034 Сен  9 11:43 ./.lilalo/3090292573121014765-1252485683.info
chmod -v u=52468 Сен  7 16:52 ./.lilalo/2153686148271534-1252308787.info
chmod -v u=52997 Сен  9 11:02 ./.lilalo/10583301712898325778-1252478763.script
chmod -v u=53024 Сен  9 10:29 ./.lilalo/157672521297417380-1252480897_1252481193_home_user_script.diff
chmod -v u=52999 Сен  9 10:05 ./.lilalo/102752944227415917-1252479853.script
10:59:51
$ls -l | sed '1d' | sed 's/^./chmod\ u=/' | while read var1
(.\{5\}\)\(...\)\(...\)/\1,g=\2,o=\3/' | tr -d -` $var9" ; done $var2 | sed 's/\(
chmod -v u=rwx,g=rx,o=rx 123
chmod -v u=rwx,g=rx,o=rx hello
chmod -v u=rwx,g=rx,o=rx script
chmod -v u=rwx,g=rx,o=rx ug-ladm.pdf
chmod -v u=rwx,g=rx,o=rx ug-lnet.pdf
10:59:56
$ls -l | sed '1d' | sed 's/^./chmod\ u=/' | while read var1

10:59:56
$ls -l | sed 's/^./chmod\ u=/'

10:59:56
$ls -l | sed 's/^./chmod\ u=/'

прошло 26 минут
/dev/ttyp3
11:26:17
$screen
/dev/ttyp8
11:26:24
$ls -l | sed '1d' | sed 's/^./chmod\ u=/' | while read var1

11:26:24
$find . -ls | sed '1d' | sed 's/^./chmod\ u=/' | while read

11:26:24
$screen
11:28:46
$screen -x 26318
/dev/ttypc
11:29:15
$vim /tmp/file
/dev/ttyp0
11:29:48
$screen -x
/dev/ttyp2
11:29:48
$screen -x
/dev/ttyp0
11:29:58
$d
bash: d: command not found
~
~
~
~
~
~
~
~
[user@debian1:~]$
[user@debian1:~]$
[user@debian1:~]$
[user@debian1:~]$ exit
exit
[screen is terminating]
[user@debian1:~]$ screen -x
11:30:00
$ps waux | grep screen
user     27838  0.0  0.1   5564  1000 ttyp5    S+   12:26   0:00 screen
user     28077  0.0  0.1   5568  1020 ttypa    S+   12:29   0:00 screen -x
user     28178  0.0  0.1   4620   744 ttyp1    R+   12:30   0:00 grep screen
11:30:06
$kill -9 27838

11:30:20
$kill -9 28077
[user@debian1:~]$ ps waux | grep screen
user     28077  0.0  0.1   5568  1024 ttypa    S+   12:29   0:00 screen -x
user     28201  0.0  0.1   4620   740 ttyp1    R+   12:30   0:00 grep screen
/dev/ttyp6
11:30:22
$d
bash: d: command not found
/dev/ttyp0
11:30:28
$ps waux | grep scr
user      5874  0.0  0.0   4508   508 ttyp0    Ss+  Sep07   0:00 script -f -q /home/user/.lilalo//2901732167207096636-1252327917.script
user      5928  0.0  0.0   4636   428 ttyp0    S+   Sep07   0:02 script -f -q /home/user/.lilalo//2901732167207096636-1252327917.script
user     20313  0.0  0.1   4716   680 ttyp9    Ss+  Sep08   0:00 script -f -q /home/user/.lilalo//27021238671232831523-1252409836.script
user     20361  0.0  0.0   4844   472 ttyp9    S+   Sep08   0:00 script -f -q /home/user/.lilalo//27021238671232831523-1252409836.script
user     24695  0.0  0.1   4716   684 ttyp2    Ss+  11:00   0:00 script -f -q /home/user/.lilalo//72051514275509463-1252483236.script
user     24748  0.0  0.0   4844   476 ttyp2    S+   11:00   0:00 script -f -q /home/user/.lilalo//72051514275509463-1252483236.script
user     24790  0.0  0.1   4716   680 ttyp6    Ss+  11:02   0:00 script -f -q /home/user/.lilalo//8423102781779219356-1252483324.script
user     24843  0.0  0.0   4844   472 ttyp6    S+   11:02   0:00 script -f -q /home/user/.lilalo//8423102781779219356-1252483324.script
user     27747  0.0  0.1   4716   684 ttyp3    Ss+  12:26   0:00 script -f -q /home/user/.lilalo//2609922839901329913-1252488377.script
user     27800  0.3  0.0   4844   476 ttyp3    S+   12:26   0:00 script -f -q /home/user/.lilalo//2609922839901329913-1252488377.script
user     27841  2.8  0.1   4712   680 ttyp8    Ss+  12:26   0:07 script -f -q /home/user/.lilalo//6902261132183819312-1252488384.script
user     27888  0.3  0.0   4840   472 ttyp8    S+   12:26   0:00 script -f -q /home/user/.lilalo//6902261132183819312-1252488384.script
user     28288  0.0  0.1   4624   744 ttyp1    R+   12:30   0:00 grep scr
/dev/ttyp6
11:30:28
$ps aux | grep screen
user     28330  0.0  0.1   4620   744 ttyp7    R+   12:30   0:00 grep screen
/dev/ttyp0
11:30:29
$ps waux | grep screen
user     28297  0.0  0.1   4620   740 ttyp1    R+   12:30   0:00 grep screen
11:30:33
$screen -x
/dev/ttyp6
11:30:40
$ps aux | grep screen
user     28353  0.0  0.1   4624   744 ttyp7    R+   12:30   0:00 grep screen
11:30:54
$ps aux | grep screen
user     28483  0.0  0.1   5564  1000 ttypc    S+   12:31   0:00 screen
user     28484  0.0  0.0      0     0 ?        Zs   12:31   0:00 [screen] <defunct>
user     28597  0.0  0.1   4620   740 ttyp7    R+   12:31   0:00 grep screen
/dev/ttyp3
11:31:03
$ls -l | sed '1d' | sed 's/^./chmod\ u=/' | while read var1

11:31:03
$find . -ls | sed '1d' | sed 's/^./chmod\ u=/' | while read

11:31:03
$vim /tmp/file
11:31:03
$screen
/dev/ttyp2
11:31:22
$screen -x
/dev/ttyp0
11:31:29
$kill -9 28484

11:31:38
$kill -9 27839

/dev/ttyp6
11:31:44
$screen -x
/dev/ttyp0
11:31:46
$screen -x
11:31:48
$screen -wipe
/dev/ttyp6
11:31:50
$screen -x
/dev/ttyp0
11:31:51
$screen -x
11:31:55
$screen -x
/dev/ttyp6
11:31:58
$screen -x
11:32:03
$ps aux | grep screen
[user@debian1:~]$ ps aux | grep screen
user     28483  0.0  0.1   5564  1000 ttypc    S+   12:31   0:00 screen
user     28484  0.0  0.0      0     0 ?        Zs   12:31   0:00 [screen] <defunct>
user     28699  0.0  0.1   4620   744 ttyp7    R+   12:32   0:00 grep screen
user     28483  0.0  0.1   5564  1000 ttypc    S+   12:31   0:00 screen
user     28484  0.0  0.0      0     0 ?        Zs   12:31   0:00 [screen] <defunct>
user     28708  0.0  0.1   4624   744 ttyp7    R+   12:32   0:00 grep screen
11:32:04
$screen -x
11:32:05
$ps aux | grep screen
user     28483  0.0  0.1   5564  1000 ttypc    S+   12:31   0:00 screen
user     28484  0.0  0.0      0     0 ?        Zs   12:31   0:00 [screen] <defunct>
user     28733  0.0  0.1   4620   744 ttyp7    R+   12:32   0:00 grep screen
/dev/ttyp0
11:32:05
$screen -x
/dev/ttyp6
11:32:08
$pkill screen

11:32:18
$ps aux | grep screen
user     28770  0.0  0.1   4620   744 ttyp7    R+   12:32   0:00 grep screen
11:32:21
$ps aux | grep screen
user     28798  0.0  0.1   4624   744 ttyp7    R+   12:32   0:00 grep screen
11:32:34
$ps aux | grep screen
[user@debian1:~]$ ps aux | grep screen
user     28807  0.0  0.1   4624   744 ttyp7    R+   12:32   0:00 grep screen
user     28816  0.0  0.1   4620   740 ttyp7    R+   12:32   0:00 grep screen
/dev/ttyp3
11:32:37
$screen
/dev/ttyp6
11:32:37
$ps aux | grep screen
user     28930  0.0  0.1   5568   996 ttyp5    S+   12:32   0:00 screen
user     29032  0.0  0.1   4620   740 ttyp7    R+   12:32   0:00 grep screen
11:32:44
$screen -x
11:33:37
$screen -x
/dev/ttyp2
11:33:47
$screen -x
/dev/ttyp8
11:33:49
$vim /tmp/file
--- /dev/null	2009-09-07 08:26:30.044750476 +0300
+++ /tmp/file	2009-09-09 12:34:18.000000000 +0300
@@ -0,0 +1 @@
+Sergey
/dev/ttyp3
11:34:03
$screen
/dev/ttyp8
11:34:18
$LANG=c
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "c"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
/dev/ttyp3
11:34:42
$screen -x 28931
/dev/ttyp6
11:34:52
$screen -x
11:34:54
$screen -x 29134
/dev/ttyp8
11:35:02
$LANG=C

/dev/ttyp6
11:35:03
$screen -x
/dev/ttyp8
11:35:05
$cat /tmp/file
Sergey
11:35:46
$sed -i 's/Sergey/Andrey/' /tmp/file
[user@debian1:~]$ sed -i 's/Sergey/Andrey/'
sed: no input files
11:35:54
$grep -r ^LINUX$ /tmp
[user@debian1:~]$ cat /tmp/file
Andrey
/tmp/day2/file:LINUX
11:37:18
$grep -rl ^LINUX$ /tmp
[user@debian1:~]$ grep -rh ^LINUX$ /tmp
LINUX
/tmp/day2/file
прошло 13 минут
11:50:30
$vim
11:56:20
$touch 1\ 2

11:56:27
$ls -l
[user@debian1:~]$ ls
1 2  123  hello  script  ug-ladm.pdf  ug-lnet.pdf
total 2683
-rw-r--r-- 1 user user       0 Sep  9 12:56 1 2
drwxr-xr-x 2 user user      72 Sep  7 15:54 123
-rwxr-xr-x 1 root root      13 Mar 11  2008 hello
-rwxr-xr-x 1 user user     225 Sep  9 10:29 script
-rwxr-xr-x 1 user user 1568611 Sep  8 15:22 ug-ladm.pdf
-rwxr-xr-x 1 user user 1166385 Sep  8 15:22 ug-lnet.pdf
11:56:29
$echo *\ *
1 2
11:56:53
$echo 1\ 2 | sed 's/\ /_/g'
[user@debian1:~]$ echo 1\ 2
1 2
1_2
11:57:49
$touch 3\ 4
[user@debian1:~]$ for i in *\ *
> do echo $i
> done
1 2
11:58:21
$for i in *\ * ; do mv -v "$i" "`echo "$i" | sed 's/ /_/g`" ;
[user@debian1:~]$ for i in *\ * ; do echo "Iteration $i" ; done
Iteration 1 2
Iteration 3 4
one
bash: command substitution: line 1: unexpected EOF while looking for matching `''
bash: command substitution: line 2: syntax error: unexpected end of file
mv: target `' is not a directory: No such file or directory
bash: command substitution: line 1: unexpected EOF while looking for matching `''
bash: command substitution: line 2: syntax error: unexpected end of file
mv: target `' is not a directory: No such file or directory
11:59:38
$for i in *\ * ; do mv -v "$i" "`echo "$i" | sed 's/ /_/g'
`1 2' -> `1_2'
`3 4' -> `3_4'
12:00:37
$#

12:06:22
$for i in 1 2 3 4 5 ; do echo *\ * $i ; done
[user@debian1:tmp]$ for i in 1 2 3 4 5 ; do echo var $i ; done
var 1
var 2
var 3
var 4
var 5
* * 1
* * 2
* * 3
* * 4
* * 5
12:07:02
$touch 5\ 6
[user@debian1:tmp]$ echo *\ *
* *
12:07:08
$echo *\ *
5 6
12:07:11
$for i in 1 2 3 4 5 ; do echo 5 6 $i ; done
[user@debian1:tmp]$ for i in 1 2 3 4 5 ; do echo *\ *  $i ; done
5 6 1
5 6 2
5 6 3
5 6 4
5 6 5
5 6 1
5 6 2
5 6 3
5 6 4
5 6 5
прошла 61 минута
13:08:52
$egrep "(abdc|xyz)[:digit:]{3,5}" file
  3 abdc12345
  4 xyzabdc123
  5 xyzabdc1234
  6 xyzabdc12345
~
~
~
~
~
~
...
~
~
~
~
~
~
~
~
~
"file" 6L, 63C written
13:10:26