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

Содержание

Журнал

Понедельник (03/15/10)

/dev/tty2
13:38:50
#apt-get install cowsay
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  filters
The following NEW packages will be installed:
  cowsay
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 19.8kB of archives.
After this operation, 295kB of additional disk space will be used.
Get:1 http://ftp.ua.debian.org lenny/main cowsay 3.03-9.2 [19.8kB]
Fetched 19.8kB in 0s (29.7kB/s)
Selecting previously deselected package cowsay.
(Reading database ... 22148 files and directories currently installed.)
Unpacking cowsay (from .../cowsay_3.03-9.2_all.deb) ...
Processing triggers for man-db ...
Setting up cowsay (3.03-9.2) ...
13:39:37
#echo fuck | /usr/games/cowsay
 ______
< fuck >
 ------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
/dev/tty3
13:41:46
#date
Mon Mar 15 08:41:52 EDT 2010
/dev/tty3
13:44:36
#vim ~/.bashrc
--- /tmp/l3-saved-3915.18579.6813	2010-03-15 08:44:52.000000000 -0400
+++ /root/.bashrc	2010-03-15 08:45:07.000000000 -0400
@@ -14,4 +14,4 @@
 # alias rm='rm -i'
 # alias cp='cp -i'
 # alias mv='mv -i'
-. /root/.lilalo/l3bashrc && _l3_start
+#. /root/.lilalo/l3bashrc && _l3_start
прошло 40 минут
/dev/tty1
14:25:01
#ssh 192.168.15.2
root@192.168.15.2's password:
Linux linux2 2.6.26-2-686 #1 SMP Tue Mar 9 17:35:51 UTC 2010 i686
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Mar 15 15:20:51 2010 from 192.168.16.3
l3-agent is already running: pid=6059; pidfile=/root/.lilalo/l3-agent.pid
14:25:47
#screen -x
/dev/tty2
14:27:49
#ps axw | grep l3
 2496 ?        Ss     0:00 l3-agent
 2630 pts/1    S+     0:00 grep l3
14:28:00
#ls -la /tmp/
total 16
drwxrwxrwt  4 root root 4096 2010-03-15 09:27 .
drwxr-xr-x 21 root root 4096 2010-03-15 05:57 ..
drwxrwxrwt  2 root root 4096 2010-03-15 09:23 .ICE-unix
drwxrwxrwt  2 root root 4096 2010-03-15 09:23 .X11-unix
14:30:08
#kill 2496

14:30:27
#ps axw | grep l3
 2496 ?        Ss     0:00 l3-agent
 2668 pts/1    S+     0:00 grep l3
14:30:30
#kill -9 2496
bash: kill: (2496) - No such process
14:30:41
#ps axw | grep l3
 2684 pts/1    S+     0:00 grep l3
14:30:48
#ls -l
total 0
14:30:52
#pwd
/root
14:30:55
#cd /tmp/; wget http://xgu.ru/lilalo/install
--2010-03-15 09:31:24--  http://xgu.ru/lilalo/install
Resolving xgu.ru... 212.26.146.51
Connecting to xgu.ru|212.26.146.51|:80... ^C
14:31:46
#wget http://xgu.ru/lilalo/install
--2010-03-15 09:32:05--  http://xgu.ru/lilalo/install
Resolving xgu.ru... 212.26.146.51
Connecting to xgu.ru|212.26.146.51|:80... ^C
14:32:07
#зштп нфюкг
bash: зштп: command not found
14:32:10
#ping ya.ru
PING ya.ru (93.158.134.8) 56(84) bytes of data.
^C
--- ya.ru ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1014ms
14:32:17
#ping ya.ru
PING ya.ru (77.88.21.8) 56(84) bytes of data.
^C
--- ya.ru ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
14:32:18
#ping ya.ru
PING ya.ru (213.180.204.8) 56(84) bytes of data.
^C
--- ya.ru ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
14:32:19
#ping ya.ru
PING ya.ru (93.158.134.8) 56(84) bytes of data.
^C
--- ya.ru ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
14:32:20
#ping ya.ru
PING ya.ru (77.88.21.8) 56(84) bytes of data.
^C
--- ya.ru ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
14:32:41
#ps axw | grep 3l
 2814 pts/1    S+     0:00 grep 3l
/dev/tty2
14:33:19
#ps axw | grep 3l

14:33:34
#vim ~/.bashrc
/dev/tty1
14:35:05
#htop

14:35:41
# 2 [ 0.0%] Load average: 0.06 0.03 0.01
root@192.168.15.2's password:
Linux linux2 2.6.26-2-686 #1 SMP Tue Mar 9 17:35:51 UTC 2010 i686
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Mar 15 15:25:47 2010 from 192.168.14.1
l3-agent is already running: pid=6059; pidfile=/root/.lilalo/l3-agent.pid
14:36:02
#screen -x
/dev/tty2
14:44:24
#apt-get install dhcp3
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package dhcp3
14:45:08
#apt-get install dhcp3-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  dhcp3-server-ldap
The following NEW packages will be installed:
  dhcp3-server
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 333kB of archives.
After this operation, 782kB of additional disk space will be used.
0% [Connecting to ftp.ua.debian.org (62.149.27.59)]^C
14:45:19
#cat /etc/resolv.conf
search unix.nt
nameserver 10.0.35.1
14:45:38
#ping ya.ru
PING ya.ru (213.180.204.8) 56(84) bytes of data.
^C
--- ya.ru ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 3999ms
14:45:45
#route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.14.0    *               255.255.255.0   U     0      0        0 eth0
default         192.168.14.254  0.0.0.0         UG    0      0        0 eth0
14:45:51
#ping 10.0.35.1
PING 10.0.35.1 (10.0.35.1) 56(84) bytes of data.
64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.182 ms
64 bytes from 10.0.35.1: icmp_seq=2 ttl=63 time=0.184 ms
^C
--- 10.0.35.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.182/0.183/0.184/0.001 ms
14:46:16
#ping ya.ru
PING ya.ru (77.88.21.8) 56(84) bytes of data.
^C
--- ya.ru ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
14:46:20
#ping ya.ru
PING ya.ru (213.180.204.8) 56(84) bytes of data.
^C
--- ya.ru ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1012ms
14:46:27
#ping ya.ru
PING ya.ru (93.158.134.8) 56(84) bytes of data.
^C
--- ya.ru ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
14:46:28
#ping ya.ru
PING ya.ru (77.88.21.8) 56(84) bytes of data.
^C
--- ya.ru ping statistics ---
13 packets transmitted, 0 received, 100% packet loss, time 12013ms
14:46:42
#ping ya.ru
PING ya.ru (213.180.204.8) 56(84) bytes of data.
64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=49 time=53.5 ms
64 bytes from ya.ru (213.180.204.8): icmp_seq=2 ttl=49 time=54.2 ms
^C
--- ya.ru ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 53.511/53.877/54.244/0.433 ms
14:46:44
#apt-get install dhcp3-server
 │                                                                                                                           │
 │ Non-authoritative version of DHCP server                                                                                  │
 │                                                                                                                           │
 │ The version 3 DHCP server is non-authoritative by default.                                                                │
 │                                                                                                                           │
 │ This means that if a client requests an address that the server knows nothing about and the address is incorrect for      │
 │ that network segment, the server will _not_ send a DHCPNAK (which tells the client it should stop using the address). If  │
 │ you want to change this behavior, you must explicitly state in dhcpd.conf what network segments your server is            │
 │ authoritative for using the 'authoritative' statement.                                                                    │
 │                                                                                                                           │
...
 └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Selecting previously deselected package dhcp3-server.
(Reading database ... 22213 files and directories currently installed.)
Unpacking dhcp3-server (from .../dhcp3-server_3.1.1-6+lenny4_i386.deb) ...
Processing triggers for man-db ...
Setting up dhcp3-server (3.1.1-6+lenny4) ...
Generating /etc/default/dhcp3-server...
Starting DHCP server: dhcpd3check syslog for diagnostics. failed!
 failed!
invoke-rc.d: initscript dhcp3-server, action "start" failed.
14:46:56
#vim /etc/dhcp3/dhcpd.conf
--- /tmp/l3-saved-2599.2187.32184	2010-03-15 09:47:12.000000000 -0400
+++ /etc/dhcp3/dhcpd.conf	2010-03-15 09:50:29.000000000 -0400
@@ -41,11 +41,11 @@
 # This declaration allows BOOTP clients to get dynamic addresses,
 # which we don't really recommend.
 
-#subnet 10.254.239.32 netmask 255.255.255.224 {
-#  range dynamic-bootp 10.254.239.40 10.254.239.60;
+subnet 192.168.14.0 netmask 255.255.255.0 {
+  range 192.168.14.100 192.168.14.200;
 #  option broadcast-address 10.254.239.31;
 #  option routers rtr-239-32-1.example.org;
-#}
+}
 
 # A slightly different configuration for an internal subnet.
 #subnet 10.5.5.0 netmask 255.255.255.224 {
14:50:29
#/etc/init.d/dhcp3-server start\
>
14:50:39
#/etc/init.d/dhcp3-server start
Starting DHCP server: dhcpd3.
14:54:40
#/etc/init.d/dhcp3-server stop
Stopping DHCP server: dhcpd3 failed!
14:54:40
#/etc/init.d/dhcp3-server start
Starting DHCP server: dhcpd3.
14:54:46
#netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 *:sunrpc                *:*                     LISTEN
tcp        0      0 *:57619                 *:*                     LISTEN
tcp        0      0 *:ssh                   *:*                     LISTEN
tcp        0      0 localhost:smtp          *:*                     LISTEN
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN
udp        0      0 *:799                   *:*
udp        0      0 *:46240                 *:*
udp        0      0 *:bootps                *:*
udp        0      0 *:sunrpc                *:*
raw        0      0 *:icmp                  *:*                     7
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   Path
unix  2      [ ACC ]     STREAM     LISTENING     5618     /var/run/acpid.socket
14:56:35
#netstat -ln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:57619           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
udp        0      0 0.0.0.0:799             0.0.0.0:*
udp        0      0 0.0.0.0:46240           0.0.0.0:*
udp        0      0 0.0.0.0:67              0.0.0.0:*
udp        0      0 0.0.0.0:111             0.0.0.0:*
raw        0      0 0.0.0.0:1               0.0.0.0:*               7
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   Path
unix  2      [ ACC ]     STREAM     LISTENING     5618     /var/run/acpid.socket
14:56:42
#netstat -lnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1884/portmap
tcp        0      0 0.0.0.0:57619           0.0.0.0:*               LISTEN      1895/rpc.statd
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2149/sshd
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      2416/exim4
tcp6       0      0 :::22                   :::*                    LISTEN      2149/sshd
udp        0      0 0.0.0.0:799             0.0.0.0:*                           1895/rpc.statd
udp        0      0 0.0.0.0:46240           0.0.0.0:*                           1895/rpc.statd
udp        0      0 0.0.0.0:67              0.0.0.0:*                           2934/dhcpd3
udp        0      0 0.0.0.0:111             0.0.0.0:*                           1884/portmap
raw        0      0 0.0.0.0:1               0.0.0.0:*               7           2934/dhcpd3
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   PID/Program name    Path
unix  2      [ ACC ]     STREAM     LISTENING     5618     2138/acpid          /var/run/acpid.socket
15:05:15
#apt-get install nmap
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libpcap0.8
The following NEW packages will be installed:
  libpcap0.8 nmap
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 1143kB of archives.
After this operation, 3936kB of additional disk space will be used.
...
Get:2 http://ftp.ua.debian.org lenny/main nmap 4.62-1 [1049kB]
Fetched 1143kB in 2s (560kB/s)
Selecting previously deselected package libpcap0.8.
(Reading database ... 22226 files and directories currently installed.)
Unpacking libpcap0.8 (from .../libpcap0.8_0.9.8-5_i386.deb) ...
Selecting previously deselected package nmap.
Unpacking nmap (from .../archives/nmap_4.62-1_i386.deb) ...
Processing triggers for man-db ...
Setting up libpcap0.8 (0.9.8-5) ...
Setting up nmap (4.62-1) ...
15:06:19
#nmap
Nmap 4.62 ( http://nmap.org )
Usage: nmap [Scan Type(s)] [Options] {target specification}
TARGET SPECIFICATION:
  Can pass hostnames, IP addresses, networks, etc.
  Ex: scanme.nmap.org, microsoft.com/24, 192.168.0.1; 10.0.0-255.1-254
  -iL <inputfilename>: Input from list of hosts/networks
  -iR <num hosts>: Choose random targets
  --exclude <host1[,host2][,host3],...>: Exclude hosts/networks
  --excludefile <exclude_file>: Exclude list from file
HOST DISCOVERY:
...
  --send-eth/--send-ip: Send using raw ethernet frames or IP packets
  --privileged: Assume that the user is fully privileged
  --unprivileged: Assume the user lacks raw socket privileges
  -V: Print version number
  -h: Print this help summary page.
EXAMPLES:
  nmap -v -A scanme.nmap.org
  nmap -v -sP 192.168.0.0/16 10.0.0.0/8
  nmap -v -iR 10000 -PN -p 80
SEE THE MAN PAGE FOR MANY MORE OPTIONS, DESCRIPTIONS, AND EXAMPLES
15:06:21
#nmap 192.168.14.0
Starting Nmap 4.62 ( http://nmap.org ) at 2010-03-15 10:06 EDT
Note: Host seems down. If it is really up, but blocking our ping probes, try -PN
Nmap done: 1 IP address (0 hosts up) scanned in 0.258 seconds
15:06:29
#ping 192.168.14.101
PING 192.168.14.101 (192.168.14.101) 56(84) bytes of data.
^C
--- 192.168.14.101 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1014ms
15:06:46
#ping 192.168.14.100
PING 192.168.14.100 (192.168.14.100) 56(84) bytes of data.
64 bytes from 192.168.14.100: icmp_seq=1 ttl=128 time=0.130 ms
^C
--- 192.168.14.100 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.130/0.130/0.130/0.000 ms
15:06:48
#ping 192.168.14.101
PING 192.168.14.101 (192.168.14.101) 56(84) bytes of data.
^C
--- 192.168.14.101 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
15:06:50
#cat /var/lib/
apt/                 dpkg/                libuuid/             nfs/                 usbutils/
aptitude/            exim4/               logrotate/           tex-common/          vim/
dhcp3/               initramfs-tools/     misc/                ucf/                 x11/
dictionaries-common/ initscripts/         mlocate/             urandom/
15:06:50
#cat /var/lib/dhcp3/dhc
dhclient.leases  dhcpd.leases     dhcpd.leases~
15:06:50
#cat /var/lib/dhcp3/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-V3.1.1
lease 192.168.14.100 {
  starts 1 2010/03/15 14:01:29;
  ends 1 2010/03/15 14:11:29;
  cltt 1 2010/03/15 14:01:29;
  binding state active;
  next binding state free;
  hardware ethernet 00:07:e9:0c:45:65;
  uid "\001\000\007\351\014Ee";
...
lease 192.168.14.100 {
  starts 1 2010/03/15 14:05:03;
  ends 1 2010/03/15 14:15:03;
  cltt 1 2010/03/15 14:05:03;
  binding state active;
  next binding state free;
  hardware ethernet 00:07:e9:0c:45:65;
  uid "\001\000\007\351\014Ee";
  client-hostname "comp1";
}
15:07:12
#cat /var/lib/dhcp3/dhcpd.leases~
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-V3.1.1
15:07:23
#cat /var/lib/dhcp3/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-V3.1.1
lease 192.168.14.100 {
  starts 1 2010/03/15 14:01:29;
  ends 1 2010/03/15 14:11:29;
  cltt 1 2010/03/15 14:01:29;
  binding state active;
  next binding state free;
  hardware ethernet 00:07:e9:0c:45:65;
  uid "\001\000\007\351\014Ee";
...
lease 192.168.14.100 {
  starts 1 2010/03/15 14:05:03;
  ends 1 2010/03/15 14:15:03;
  cltt 1 2010/03/15 14:05:03;
  binding state active;
  next binding state free;
  hardware ethernet 00:07:e9:0c:45:65;
  uid "\001\000\007\351\014Ee";
  client-hostname "comp1";
}
15:07:25
#cat /var/lib/dhcp3/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-V3.1.1
lease 192.168.14.100 {
  starts 1 2010/03/15 14:01:29;
  ends 1 2010/03/15 14:11:29;
  cltt 1 2010/03/15 14:01:29;
  binding state active;
  next binding state free;
  hardware ethernet 00:07:e9:0c:45:65;
  uid "\001\000\007\351\014Ee";
...
lease 192.168.14.100 {
  starts 1 2010/03/15 14:05:03;
  ends 1 2010/03/15 14:15:03;
  cltt 1 2010/03/15 14:05:03;
  binding state active;
  next binding state free;
  hardware ethernet 00:07:e9:0c:45:65;
  uid "\001\000\007\351\014Ee";
  client-hostname "comp1";
}
15:07:26
#apt-get install asterisk asterisk-config
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  asterisk-sounds-main ca-certificates debhelper gettext html2text intltool-debian libasound2 libc-client2007b
  libcompress-raw-zlib-perl libcompress-zlib-perl libcurl3 libdigest-hmac-perl libdigest-sha1-perl libfile-remove-perl libgsm1
  libiksemel3 libio-compress-base-perl libio-compress-zlib-perl libio-stringy-perl libltdl3 libmail-box-perl
  libmail-sendmail-perl libmailtools-perl libmime-types-perl libobject-realize-later-perl libogg0 libperl5.10 libpq5 libpri1.0
  libradiusclient-ng2 libsensors3 libsnmp-base libsnmp15 libspeex1 libspeexdsp1 libsqlite0 libssh2-1 libsys-hostname-long-perl
  libsysfs2 libtonezone1 liburi-perl libuser-identity-perl libvorbis0a libvorbisenc2 libvpb0 mlock module-assistant
...
Setting up libmime-types-perl (1.24-1) ...
Setting up libmailtools-perl (2.03-1) ...
Setting up libobject-realize-later-perl (0.18-1) ...
Setting up liburi-perl (1.35.dfsg.1-1) ...
Setting up libuser-identity-perl (0.92-2) ...
Setting up libmail-box-perl (2.082-2) ...
Setting up libsys-hostname-long-perl (1.4-2) ...
Setting up libmail-sendmail-perl (0.79-5) ...
Setting up module-assistant (0.10.11.0) ...
Setting up vpb-driver-source (4.2.38.1-1) ...
прошло 34 минуты
15:41:50
#mv /etc/asterisk/sip.conf /etc/asterisk/sip.conf.SAVE

прошло 30 минут
16:12:27
#vim /etc/asterisk/sip.conf.SAVE
16:13:04
#cat /etc/asterisk/sip.conf.SAVE | grep xlite
;[xlite1]
16:13:09
#cat /etc/asterisk/sip.conf.SAVE | grep -x xlite

16:13:15
#cat /etc/asterisk/sip.conf.SAVE | grep -p xlite
grep: invalid option -- p
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
16:13:18
#cat /etc/asterisk/sip.conf.SAVE | grep -x xlite

16:13:26
#cat /etc/asterisk/sip.conf.SAVE | grep gene
[general]
;progressinband=never           ; If we should generate in-band ringing always
                                ; You can turn it off on a per peer basis if the general
                                ; one peer only without enabling in the general section.
;callevents=no                  ; generate manager events when sip ua
; This setting is available in the [general] section as well as in device configurations.
; This has to be enabled in the general section for all devices to work. You can then
16:15:24
#egrep ^'[a-z]'|^'[gen' /etc/asterisk/sip.conf.SAVE
bash: ^[gen: command not found
^C
16:15:42
#egrep ^'[a-z]'|^[gen /etc/asterisk/sip.conf.SAVE
bash: ^[gen: command not found
^C
16:15:53
#egrep ^'[a-z]'|^\[gen /etc/asterisk/sip.conf.SAVE
bash: ^[gen: command not found
^C
16:15:56
#egrep ^'[a-z]'|^\'[gen' /etc/asterisk/sip.conf.SAVE
>
16:16:03
#egrep ^'[a-z]'|^\'[gen' /etc/asterisk/sip.conf.SAVE
>
16:16:05
#egrep ^'[a-z]|^\[gen' /etc/asterisk/sip.conf.SAVE
[general]
context=default                 ; Default context for incoming calls
allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
bindport=5060                   ; UDP Port to bind to (SIP standard port is 5060)
bindaddr=0.0.0.0                ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
16:16:17
#egrep ^'[a-z]|^\[gen' /etc/asterisk/sip.conf.SAVE > /etc/asterisk/sip.conf

16:16:29
#cat /etc/asterisk/sip.conf
[general]
context=default                 ; Default context for incoming calls
allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
bindport=5060                   ; UDP Port to bind to (SIP standard port is 5060)
bindaddr=0.0.0.0                ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
16:17:31
#cat /etc/asterisk/sip.conf.SAVE | sed '/xlite/,/p;d'
sed: -e expression #1, char 12: unterminated address regex
16:17:55
#cat /etc/asterisk/sip.conf.SAVE | sed '/xlite//p;d'
sed: -e expression #1, char 8: unknown command: `/'
16:17:58
#cat /etc/asterisk/sip.conf.SAVE | sed '/xlite/p;d'
;[xlite1]
16:18:00
#cat /etc/asterisk/sip.conf.SAVE | sed '/xlite/,/mailbox/p;d'
;[xlite1]
; Turn off silence suppression in X-Lite ("Transmit Silence"=YES)!
; Note that Xlite sends NAT keep-alive packets, so qualify=yes is not needed
;type=friend
;regexten=1234                  ; When they register, create extension 1234
;callerid="Jane Smith" <5678>
;host=dynamic                   ; This device needs to register
;nat=yes                        ; X-Lite is behind a NAT router
;canreinvite=no                 ; Typically set to NO if behind NAT
;disallow=all
;allow=gsm                      ; GSM consumes far less bandwidth than ulaw
;allow=ulaw
;allow=alaw
;mailbox=1234@default,1233@default      ; Subscribe to status of multiple mailboxes
16:18:45
#cat /etc/asterisk/sip.conf.SAVE | sed '/xlite/,/mailbox/p;d' >> /etc/asterisk/sip.conf

16:18:56
#vim /etc/asterisk/sip.conf
--- /tmp/l3-saved-2599.14609.19742	2010-03-15 11:19:03.000000000 -0400
+++ /etc/asterisk/sip.conf	2010-03-15 11:20:14.000000000 -0400
@@ -4,17 +4,16 @@
 bindport=5060			; UDP Port to bind to (SIP standard port is 5060)
 bindaddr=0.0.0.0		; IP address to bind to (0.0.0.0 binds to all)
 srvlookup=yes			; Enable DNS SRV lookups on outbound calls
-;[xlite1]
-; Turn off silence suppression in X-Lite ("Transmit Silence"=YES)!
-; Note that Xlite sends NAT keep-alive packets, so qualify=yes is not needed
-;type=friend
-;regexten=1234			; When they register, create extension 1234
-;callerid="Jane Smith" <5678>
-;host=dynamic			; This device needs to register
-;nat=yes			; X-Lite is behind a NAT router
-;canreinvite=no			; Typically set to NO if behind NAT
-;disallow=all
-;allow=gsm			; GSM consumes far less bandwidth than ulaw
-;allow=ulaw
-;allow=alaw
-;mailbox=1234@default,1233@default	; Subscribe to status of multiple mailboxes
+
+[xlite1]
+type=friend
+regexten=101			; When they register, create extension 1234
+callerid="Vlad Myravka" <101>
+host=dynamic			; This device needs to register
+#nat=yes			; X-Lite is behind a NAT router
+#canreinvite=no			; Typically set to NO if behind NAT
+disallow=all
+allow=gsm			; GSM consumes far less bandwidth than ulaw
+allow=ulaw
+allow=alaw
+#mailbox=1234@default,1233@default	; Subscribe to status of multiple mailboxes
16:20:50
#ps axuw | grep aster
asterisk  7237  0.0  0.2  31156 10112 ?        Ssl  10:41   0:00 /usr/sbin/asterisk -p -U asterisk
root      7580  0.0  0.0   3116   724 pts/1    S+   11:22   0:00 grep aster
16:22:13
#asterisk -r
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
This package has been modified for the Debian GNU/Linux distribution
Please report all bugs to http://bugs.debian.org/asterisk
=========================================================================
Connected to Asterisk 1.4.21.2~dfsg-3+lenny1 currently running on linux1 (pid = 7237)
linux1*CLI> sip reload
[Mar 15 11:22:22] WARNING[7269]: config.c:768 process_text_line: Unknown directive 'nat=yes' at line 13 of /etc/asterisk/sip.conf
[Mar 15 11:22:22] WARNING[7269]: config.c:768 process_text_line: Unknown directive 'canreinvite=no' at line 14 of /etc/asterisk/sip.conf
[Mar 15 11:22:22] WARNING[7269]: config.c:768 process_text_line: Unknown directive 'mailbox=1234@default,1233@default' at line 19 of /etc/asterisk/sip.conf
linux1*CLI> quit
16:23:35
#asterisk -rvv
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
This package has been modified for the Debian GNU/Linux distribution
Please report all bugs to http://bugs.debian.org/asterisk
=========================================================================
...
  Def. Username:
  SIP Options  : (none)
  Codecs       : 0xe (gsm|ulaw|alaw)
  Codec Order  : (gsm:20,ulaw:20,alaw:20)
  Auto-Framing:  No
  Status       : Unmonitored
  Useragent    :
  Reg. Contact :
linux1*CLI> quit
Executing last minute cleanups
16:25:16
#vim /etc/asterisk/sip.conf
16:29:27
#vim /etc/asterisk/sip.conf
/dev/tty3
16:29:43
#asterisk -r
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
This package has been modified for the Debian GNU/Linux distribution
Please report all bugs to http://bugs.debian.org/asterisk
=========================================================================
...
Name/username              Host            Dyn Nat ACL Port     Status
NOKIA                      (Unspecified)    D          0        Unmonitored
1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 1 offline]
linux1*CLI> sip show registry
Host                            Username       Refresh State                Reg.Time
linux1*CLI> sip show registry
Host                            Username       Refresh State                Reg.Time
linux1*CLI> sip show registry
Host                            Username       Refresh State                Reg.Time
linux1*CLI> quit
16:31:01
#vim /etc/asterisk/sip.conf
--- /tmp/l3-saved-7746.1151.1167	2010-03-15 11:33:23.000000000 -0400
+++ /etc/asterisk/sip.conf	2010-03-15 11:33:53.000000000 -0400
@@ -5,7 +5,7 @@
 bindaddr=0.0.0.0		; IP address to bind to (0.0.0.0 binds to all)
 srvlookup=yes			; Enable DNS SRV lookups on outbound calls
 
-[NOKIA]
+[101]
 type=friend
 regexten=101			; When they register, create extension 1234
 secret=101
/dev/tty2
16:31:26
#;secret=101
Asterisk 1.4.21.2~dfsg-3+lenny1, Copyright (C) 1999 - 2008 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
This package has been modified for the Debian GNU/Linux distribution
Please report all bugs to http://bugs.debian.org/asterisk
=========================================================================
...
linux1*CLI> sip show peers
Name/username              Host            Dyn Nat ACL Port     Status
101/101                    192.168.14.101   D          5060     Unmonitored
1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 0 offline]
linux1*CLI>
linux1*CLI>
linux1*CLI>
linux1*CLI>
linux1*CLI> quit
Executing last minute cleanups
/dev/tty3
16:33:53
#vim /etc/asterisk/sip.conf
--- /tmp/l3-saved-7746.31562.14276	2010-03-15 11:34:53.000000000 -0400
+++ /etc/asterisk/sip.conf	2010-03-15 11:35:45.000000000 -0400
@@ -5,7 +5,7 @@
 bindaddr=0.0.0.0		; IP address to bind to (0.0.0.0 binds to all)
 srvlookup=yes			; Enable DNS SRV lookups on outbound calls
 
-[101]
+[NOKIA]
 type=friend
 regexten=101			; When they register, create extension 1234
 secret=101
16:35:45
#vim /etc/asterisk/sip.conf
--- /tmp/l3-saved-7746.8035.17344	2010-03-15 11:36:20.000000000 -0400
+++ /etc/asterisk/sip.conf	2010-03-15 11:36:28.000000000 -0400
@@ -5,7 +5,7 @@
 bindaddr=0.0.0.0		; IP address to bind to (0.0.0.0 binds to all)
 srvlookup=yes			; Enable DNS SRV lookups on outbound calls
 
-[NOKIA]
+[101]
 type=friend
 regexten=101			; When they register, create extension 1234
 secret=101
/dev/tty1
16:38:22
#vi ~/.bashrc
/dev/tty2
16:38:32
#quit
bash: quit: command not found
/dev/tty1
16:39:33
#bash
linux2:~# l3script
16:39:40
#exit
exit
linux2:~# exit
exit
16:39:49
#exit
exit
Connection to 192.168.15.2 closed.
16:39:51
#vim ~/.bashrc
--- /tmp/l3-saved-2530.11794.1749	2010-03-15 11:40:02.000000000 -0400
+++ /root/.bashrc	2010-03-15 11:40:34.000000000 -0400
@@ -14,4 +14,4 @@
 # alias rm='rm -i'
 # alias cp='cp -i'
 # alias mv='mv -i'
-. /root/.lilalo/l3bashrc && _l3_start
+[ $0 == 3lscript ] && . /root/.lilalo/l3bashrc && _l3_start

Вторник (03/16/10)

/dev/tty2
09:56:58
#vim /etc/asterisk/extensions.conf
--- /tmp/l3-saved-5049.26482.3669	2010-03-16 04:57:16.000000000 -0400
+++ /etc/asterisk/extensions.conf	2010-03-16 04:58:07.000000000 -0400
@@ -5,4 +5,5 @@
 exten => 4000,n,PlayBack(demo-thanks)
 exten => 4000,n,Hangup
 
-exten => _1XX,1,Dial(SIP/${EXTEN})
+exten => _1XX,1,Dial(SIP/${EXTEN},30)
+exten => _1XX,n,Playback(vm-isunavail)
09:58:07
#vim /etc/asterisk/extensions.conf

Файлы

  • /etc/asterisk/sip.conf
  • /etc/resolv.conf
  • /var/lib/dhcp3/dhcpd.leases
  • /var/lib/dhcp3/dhcpd.leases~
  • /etc/asterisk/sip.conf
    >
    [general]
    context=default                 ; Default context for incoming calls
    allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
    bindport=5060                   ; UDP Port to bind to (SIP standard port is 5060)
    bindaddr=0.0.0.0                ; IP address to bind to (0.0.0.0 binds to all)
    srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
    
    /etc/resolv.conf
    >
    search unix.nt
    nameserver 10.0.35.1
    
    /var/lib/dhcp3/dhcpd.leases
    >
    # The format of this file is documented in the dhcpd.leases(5) manual page.
    # This lease file was written by isc-dhcp-V3.1.1
    lease 192.168.14.100 {
      starts 1 2010/03/15 14:01:29;
      ends 1 2010/03/15 14:11:29;
      cltt 1 2010/03/15 14:01:29;
      binding state active;
      next binding state free;
      hardware ethernet 00:07:e9:0c:45:65;
      uid "\001\000\007\351\014Ee";
      client-hostname "comp1";
    }
    lease 192.168.14.100 {
      starts 1 2010/03/15 14:01:31;
      ends 1 2010/03/15 14:11:31;
      cltt 1 2010/03/15 14:01:31;
      binding state active;
      next binding state free;
      hardware ethernet 00:07:e9:0c:45:65;
      uid "\001\000\007\351\014Ee";
      client-hostname "comp1";
    }
    lease 192.168.14.100 {
      starts 1 2010/03/15 14:05:03;
      ends 1 2010/03/15 14:15:03;
      cltt 1 2010/03/15 14:05:03;
      binding state active;
      next binding state free;
      hardware ethernet 00:07:e9:0c:45:65;
      uid "\001\000\007\351\014Ee";
      client-hostname "comp1";
    }
    
    /var/lib/dhcp3/dhcpd.leases~
    >
    # The format of this file is documented in the dhcpd.leases(5) manual page.
    # This lease file was written by isc-dhcp-V3.1.1
    

    Статистика

    Время первой команды журнала13:38:50 2010- 3-15
    Время последней команды журнала09:58:07 2010- 3-16
    Количество командных строк в журнале100
    Процент команд с ненулевым кодом завершения, %26.00
    Процент синтаксически неверно набранных команд, % 5.00
    Суммарное время работы с терминалом *, час 1.28
    Количество командных строк в единицу времени, команда/мин 1.30
    Частота использования команд
    cat18|=============| 13.53%
    ping15|===========| 11.28%
    vim13|=========| 9.77%
    grep11|========| 8.27%
    egrep7|=====| 5.26%
    apt-get6|====| 4.51%
    ps6|====| 4.51%
    sed5|===| 3.76%
    d'5|===| 3.76%
    /etc/init.d/dhcp3-server4|===| 3.01%
    asterisk3|==| 2.26%
    netstat3|==| 2.26%
    screen2|=| 1.50%
    /etc/asterisk/sip.conf2|=| 1.50%
    ^\'[gen'2|=| 1.50%
    nmap2|=| 1.50%
    ls2|=| 1.50%
    wget2|=| 1.50%
    ^\[gen'2|=| 1.50%
    kill2|=| 1.50%
    exit2|=| 1.50%
    cowsay1|| 0.75%
    quit1|| 0.75%
    cd1|| 0.75%
    echo1|| 0.75%
    mv1|| 0.75%
    ^[gen1|| 0.75%
    ^'[gen'1|| 0.75%
    pwd1|| 0.75%
    ^\[gen1|| 0.75%
    route1|| 0.75%
    >1|| 0.75%
    зштп1|| 0.75%
    vi1|| 0.75%
    htop1|| 0.75%
    bash1|| 0.75%
    21|| 0.75%
    ssh1|| 0.75%
    secret=1011|| 0.75%
    date1|| 0.75%
    ____
    *) Интервалы неактивности длительностью 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$