/l3/users/2014-11-nt-voip/nt-voip/debian1/root :1 :2 :3 :4 |
|
#pkill -u user
|
#screen -ls
|
#screen -x
|
#ââ
|
#ipconfig
bash: ipconfig: command not found |
## ifconfig
|
#ifconfig
eth0 Link encap:Ethernet HWaddr 88:51:fb:4d:80:df inet addr:192.168.12.1 Bcast:192.168.12.255 Mask:255.255.255.0 inet6 addr: fe80::8a51:fbff:fe4d:80df/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:60357 errors:0 dropped:4 overruns:0 frame:0 TX packets:35003 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:30415386 (29.0 MiB) TX bytes:3140226 (2.9 MiB) Interrupt:18 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:168 errors:0 dropped:0 overruns:0 frame:0 TX packets:168 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:10480 (10.2 KiB) TX bytes:10480 (10.2 KiB) |
#cat
|
#cat /etc/network/interfaces
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet static address 192.168.12.1 netmask 255.255.255.0 gateway 192.168.12.254 |
#alias exit='echo no exit'
|
#ping 192.168.12.253
PING 192.168.12.253 (192.168.12.253) 56(84) bytes of data. 64 bytes from 192.168.12.253: icmp_req=1 ttl=64 time=1.83 ms 64 bytes from 192.168.12.253: icmp_req=2 ttl=64 time=0.652 ms 64 bytes from 192.168.12.253: icmp_req=3 ttl=64 time=0.725 ms 64 bytes from 192.168.12.253: icmp_req=4 ttl=64 time=0.710 ms 64 bytes from 192.168.12.253: icmp_req=5 ttl=64 time=0.714 ms 64 bytes from 192.168.12.253: icmp_req=6 ttl=64 time=0.825 ms 64 bytes from 192.168.12.253: icmp_req=7 ttl=64 time=0.717 ms 64 bytes from 192.168.12.253: icmp_req=8 ttl=64 time=1.05 ms 64 bytes from 192.168.12.253: icmp_req=9 ttl=64 time=0.727 ms ... 64 bytes from 192.168.12.253: icmp_req=17 ttl=64 time=0.645 ms 64 bytes from 192.168.12.253: icmp_req=18 ttl=64 time=0.716 ms 64 bytes from 192.168.12.253: icmp_req=19 ttl=64 time=0.715 ms 64 bytes from 192.168.12.253: icmp_req=20 ttl=64 time=0.680 ms 64 bytes from 192.168.12.253: icmp_req=21 ttl=64 time=0.712 ms 64 bytes from 192.168.12.253: icmp_req=22 ttl=64 time=0.710 ms ^C --- 192.168.12.253 ping statistics --- 22 packets transmitted, 22 received, 0% packet loss, time 20999ms rtt min/avg/max/mdev = 0.637/0.793/1.836/0.251 ms |
#cat /etc/network/interfaces
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet static address 192.168.12.1 netmask 255.255.255.0 gateway 192.168.12.254 |
#cat /etc/network/interfaces
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet static address 192.168.12.1 netmask 255.255.255.0 gateway 192.168.12.254 |
#sed -i s/192.168.12.1/192.168.10.1/ /etc/network/interfaces
|
#cat /etc/network/interfaces
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet static address 192.168.10.1 netmask 255.255.255.0 gateway 192.168.10.254 |
#cat /etc/network/interfaces
# |
#cat /etc/network/interfaces
1/192.168.10.1/ /etc/network/interfaces |
#cat /etc/network/interfaces
1/192.168.10.1/ /etc/network/interfaces |
#cat /etc/network/interfaces
^C |
##cat /etc/network/interfaces
|
## ctrl-a ctrl-a <= switch between the screens
|
#route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.12.254 0.0.0.0 UG 0 0 0 eth0 192.168.12.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 |
#ping 192.168.10.254
PING 192.168.10.254 (192.168.10.254) 56(84) bytes of data. From 192.168.12.1 icmp_seq=2 Destination Host Unreachable From 192.168.12.1 icmp_seq=3 Destination Host Unreachable From 192.168.12.1 icmp_seq=5 Destination Host Unreachable From 192.168.12.1 icmp_seq=6 Destination Host Unreachable From 192.168.12.1 icmp_seq=8 Destination Host Unreachable From 192.168.12.1 icmp_seq=9 Destination Host Unreachable From 192.168.12.1 icmp_seq=11 Destination Host Unreachable From 192.168.12.1 icmp_seq=12 Destination Host Unreachable From 192.168.12.1 icmp_seq=14 Destination Host Unreachable From 192.168.12.1 icmp_seq=15 Destination Host Unreachable ^C --- 192.168.10.254 ping statistics --- 17 packets transmitted, 0 received, +10 errors, 100% packet loss, time 16088ms pipe 2 |
#ping 192.168.10.253
PING 192.168.10.253 (192.168.10.253) 56(84) bytes of data. From 192.168.12.1 icmp_seq=2 Destination Host Unreachable From 192.168.12.1 icmp_seq=3 Destination Host Unreachable From 192.168.12.1 icmp_seq=4 Destination Host Unreachable From 192.168.12.1 icmp_seq=5 Destination Host Unreachable From 192.168.12.1 icmp_seq=6 Destination Host Unreachable From 192.168.12.1 icmp_seq=8 Destination Host Unreachable From 192.168.12.1 icmp_seq=9 Destination Host Unreachable From 192.168.12.1 icmp_seq=10 Destination Host Unreachable From 192.168.12.1 icmp_seq=11 Destination Host Unreachable From 192.168.12.1 icmp_seq=12 Destination Host Unreachable From 192.168.12.1 icmp_seq=14 Destination Host Unreachable From 192.168.12.1 icmp_seq=15 Destination Host Unreachable ^C --- 192.168.10.253 ping statistics --- 17 packets transmitted, 0 received, +12 errors, 100% packet loss, time 16087ms pipe 3 |
#ping 192.168.12.254
PING 192.168.12.254 (192.168.12.254) 56(84) bytes of data. From 192.168.12.1 icmp_seq=1 Destination Host Unreachable From 192.168.12.1 icmp_seq=2 Destination Host Unreachable From 192.168.12.1 icmp_seq=3 Destination Host Unreachable From 192.168.12.1 icmp_seq=4 Destination Host Unreachable From 192.168.12.1 icmp_seq=5 Destination Host Unreachable From 192.168.12.1 icmp_seq=6 Destination Host Unreachable From 192.168.12.1 icmp_seq=7 Destination Host Unreachable From 192.168.12.1 icmp_seq=8 Destination Host Unreachable From 192.168.12.1 icmp_seq=9 Destination Host Unreachable ^C --- 192.168.12.254 ping statistics --- 12 packets transmitted, 0 received, +9 errors, 100% packet loss, time 11063ms pipe 3 |
#ifconfig
eth0 Link encap:Ethernet HWaddr 88:51:fb:4d:80:df inet addr:192.168.12.1 Bcast:192.168.12.255 Mask:255.255.255.0 inet6 addr: fe80::8a51:fbff:fe4d:80df/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:109103 errors:0 dropped:4 overruns:0 frame:0 TX packets:68571 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:48725191 (46.4 MiB) TX bytes:6005247 (5.7 MiB) Interrupt:18 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:616 errors:0 dropped:0 overruns:0 frame:0 TX packets:616 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:50911 (49.7 KiB) TX bytes:50911 (49.7 KiB) |
#ifdown eth0
RTNETLINK answers: No such process |
#ifconfig
lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:661 errors:0 dropped:0 overruns:0 frame:0 TX packets:661 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:54657 (53.3 KiB) TX bytes:54657 (53.3 KiB) |
#ifup eth0
|
#ifconfig
eth0 Link encap:Ethernet HWaddr 88:51:fb:4d:80:df inet addr:192.168.10.1 Bcast:192.168.10.255 Mask:255.255.255.0 inet6 addr: fe80::8a51:fbff:fe4d:80df/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:4 overruns:0 frame:0 TX packets:4 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:334 (334.0 B) Interrupt:18 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:671 errors:0 dropped:0 overruns:0 frame:0 TX packets:671 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:55551 (54.2 KiB) TX bytes:55551 (54.2 KiB) |
#isc-dhcp-server
bash: isc-dhcp-server: command not found |
## install два l
|
#sed -i s/eth1/eth0/ /etc/default/isc-dhcp-server
sed: can't read /etc/default/isc-dhcp-server: No such file or directory |
#/#grep INTER
bash: /#grep: No such file or directory |
#et#
bash: et#: command not found |
## Ð²Ñ Ð½Ðµ поÑÑавили ÑÑеÑÐ²ÐµÑ Ð¶Ðµ
|
#ÑÑаÐ#ÑÑавÑÑе
|
#apt-get install isc-dhcp-server
Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: isc-dhcp-server-ldap The following NEW packages will be installed: isc-dhcp-server 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 935 kB of archives. After this operation, 2,075 kB of additional disk space will be used. ... Preconfiguring packages ... Selecting previously unselected package isc-dhcp-server. (Reading database ... 128692 files and directories currently installed.) Unpacking isc-dhcp-server (from .../isc-dhcp-server_4.2.2.dfsg.1-5+deb70u6_amd64.deb) ... Processing triggers for man-db ... Setting up isc-dhcp-server (4.2.2.dfsg.1-5+deb70u6) ... Generating /etc/default/isc-dhcp-server... Starting ISC DHCP server: dhcpdcheck syslog for diagnostics. ... failed! failed! invoke-rc.d: initscript isc-dhcp-server, action "start" failed. |
#sed -i s/eth1/eth0/ /etc/default/isc-dhcp-server
|
#grep INTER /etc/default/isc-dhcp-server
INTERFACES="" |
#vi /etc/dhcp/dhcpd.conf
--- /tmp/l3-saved-4095.26395.10967 2014-11-24 15:04:31.370777495 +0200 +++ /etc/dhcp/dhcpd.conf 2014-11-24 15:06:12.690776367 +0200 @@ -1,107 +1,11 @@ -# -# Sample configuration file for ISC dhcpd for Debian -# -# - -# The ddns-updates-style parameter controls whether or not the server will -# attempt to do a DNS update when a lease is confirmed. We default to the -# behavior of the version 2 packages ('none', since DHCP v2 didn't -# have support for DDNS.) ddns-update-style none; - # option definitions common to all supported networks... -option domain-name "example.org"; -option domain-name-servers ns1.example.org, ns2.example.org; - +option domain-name "unix.nt"; +option domain-name-servers 192.168.12.254; default-lease-time 600; max-lease-time 7200; - -# If this DHCP server is the official DHCP server for the local -# network, the authoritative directive should be uncommented. -#authoritative; - -# Use this to send dhcp log messages to a different log file (you also -# have to hack syslog.conf to complete the redirection). log-facility local7; - -# No service will be given on this subnet, but declaring it helps the -# DHCP server to understand the network topology. - -#subnet 10.152.187.0 netmask 255.255.255.0 { -#} - -# This is a very basic subnet declaration. - -#subnet 10.254.239.0 netmask 255.255.255.224 { -# range 10.254.239.10 10.254.239.20; -# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org; -#} - -# 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; -# 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 { -# range 10.5.5.26 10.5.5.30; -# option domain-name-servers ns1.internal.example.org; -# option domain-name "internal.example.org"; -# option routers 10.5.5.1; -# option broadcast-address 10.5.5.31; -# default-lease-time 600; -# max-lease-time 7200; -#} - -# Hosts which require special configuration options can be listed in -# host statements. If no address is specified, the address will be -# allocated dynamically (if possible), but the host-specific information -# will still come from the host declaration. - -#host passacaglia { -# hardware ethernet 0:0:c0:5d:bd:95; -# filename "vmunix.passacaglia"; -# server-name "toccata.fugue.com"; -#} - -# Fixed IP addresses can also be specified for hosts. These addresses -# should not also be listed as being available for dynamic assignment. -# Hosts for which fixed IP addresses have been specified can boot using -# BOOTP or DHCP. Hosts for which no fixed address is specified can only -# be booted with DHCP, unless there is an address range on the subnet -# to which a BOOTP client is connected which has the dynamic-bootp flag -# set. -#host fantasia { -# hardware ethernet 08:00:07:26:c0:a5; -# fixed-address fantasia.fugue.com; -#} - -# You can declare a class of clients and then do address allocation -# based on that. The example below shows a case where all clients -# in a certain class get addresses on the 10.17.224/24 subnet, and all -# other clients get addresses on the 10.0.29/24 subnet. - -#class "foo" { -# match if substring (option vendor-class-identifier, 0, 4) = "SUNW"; -#} - -#shared-network 224-29 { -# subnet 10.17.224.0 netmask 255.255.255.0 { -# option routers rtr-224.example.org; -# } -# subnet 10.0.29.0 netmask 255.255.255.0 { -# option routers rtr-29.example.org; -# } -# pool { -# allow members of "foo"; -# range 10.17.224.10 10.17.224.250; -# } -# pool { -# deny members of "foo"; -# range 10.0.29.10 10.0.29.230; -# } -#} +subnet 192.168.10.0 netmask 255.255.255.0 { + range 192.168.10.100 192.168.10.200; + option routers 192.168.10.254; +} |
#/etc/init.d/isc-dhcp-srver
bash: /etc/init.d/isc-dhcp-srver: No such file or directory |
#/etc/init.d/isc-dhcp-server
Usage: /etc/init.d/isc-dhcp-server {start|stop|restart|force-reload|status} |
#/etc/init.d/isc-dhcp-server restart
Stopping ISC DHCP server: dhcpd failed! Starting ISC DHCP server: dhcpd. |
#ifconfig
eth0 Link encap:Ethernet HWaddr 88:51:fb:4d:80:df inet addr:192.168.10.1 Bcast:192.168.10.255 Mask:255.255.255.0 inet6 addr: fe80::8a51:fbff:fe4d:80df/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:21819 errors:0 dropped:4 overruns:0 frame:0 TX packets:16484 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:9318556 (8.8 MiB) TX bytes:1498600 (1.4 MiB) Interrupt:18 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:715 errors:0 dropped:0 overruns:0 frame:0 TX packets:715 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:58331 (56.9 KiB) TX bytes:58331 (56.9 KiB) |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.10.254 0.0.0.0 UG 0 0 0 eth0 192.168.10.0 * 255.255.255.0 U 0 0 0 eth0 |
#cat /etc/resolv.conf
nameserver 192.168.12.254 search unix.nt |
#find /var/ -name \*leases\*
/var/lib/dhcp/dhclient.leases /var/lib/dhcp/dhcpd.leases~ /var/lib/dhcp/dhclient.eth0.leases /var/lib/dhcp/dhcpd.leases |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default switch.unix.nt 0.0.0.0 UG 0 0 0 eth0 192.168.10.0 * 255.255.255.0 U 0 0 0 eth0 |
#apt-cache search asterisk
asterisk - Open Source Private Branch Exchange (PBX) asterisk-config - Configuration files for Asterisk asterisk-dahdi - DAHDI devices support for the Asterisk PBX asterisk-dbg - Debugging symbols for Asterisk asterisk-dev - Development files for Asterisk asterisk-doc - Source code documentation for Asterisk asterisk-mobile - Bluetooth phone support for the Asterisk PBX asterisk-modules - loadable modules for the Asterisk PBX asterisk-mp3 - MP3 playback support for the Asterisk PBX asterisk-mysql - MySQL database protocol support for the Asterisk PBX ... linphone-dbg - Debugging symbols for linphone and its libraries op-panel - switchboard type application for the Asterisk PBX libopenr2-3 - MFC/R2 (telephony) call setup library python-asterisk - Asterisk Manager API interface module for Python libsipwitch-dev - secure peer-to-peer SIP VoIP server - development files libsipwitch1 - secure peer-to-peer SIP VoIP server - development files libsipwitch1-dbg - secure peer-to-peer SIP VoIP server - development files sipwitch - secure peer-to-peer VoIP server for the SIP protocol sipwitch-cgi - secure peer-to-peer SIP VoIP server - CGI XML-RPC interface python-starpy - Asterisk (AMI) protocols for Twisted Python |
#/etc/asterisk
bash: /etc/asterisk: Is a directory |
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |
#ps aux | grep [a]sterisk
asterisk 12463 2.5 0.1 760524 30304 ? Ssl 16:37 0:00 /usr/sbin/asterisk -p -U asterisk asterisk 12464 0.0 0.0 13916 772 ? S 16:37 0:00 astcanary /var/run/asterisk/alt.asterisk.canary.tweet.tweet.tweet 12463 |
#netstat -lnp | grep asterisk
tcp 0 0 127.0.0.1:5038 0.0.0.0:* LISTEN 12463/asterisk tcp 0 0 0.0.0.0:2000 0.0.0.0:* LISTEN 12463/asterisk udp 0 0 0.0.0.0:4520 0.0.0.0:* 12463/asterisk udp 0 0 0.0.0.0:4569 0.0.0.0:* 12463/asterisk udp 0 0 0.0.0.0:5000 0.0.0.0:* 12463/asterisk udp 0 0 0.0.0.0:5060 0.0.0.0:* 12463/asterisk unix 2 [ ACC ] STREAM LISTENING 28592 12463/asterisk /var/run/asterisk/asterisk.ctl |
#asterisk -r
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 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. ========================================================================= Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian1 (pid = 12463) debian1*CLI> core show version Asterisk 1.8.13.1~dfsg1-3+deb7u3 built by pbuilder @ pungenday on a x86_64 running Linux on 2014-01-04 01:03:48 UTC ... switches sysinfo taskprocessors threads translation uptime version warranty debian1*CLI> core abort clear ping reload restart set show stop waitfullybooted debian1*CLI> sip show peers Name/username Host Dyn Forcerport ACL Port Status 0 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 0 offline] debian1*CLI> quit |
#mv /etc/asterisk/extensions.conf{,.bak}
|
#mv /etc/asterisk/sip.conf{,.bak}
|
#gedit /etc/asterisk/sip.conf
(gedit:12722): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.W8EZPX': No such file or directory (gedit:12722): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory (gedit:12722): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.14J8PX': No such file or directory (gedit:12722): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory (gedit:12722): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.7DW9PX': No such file or directory (gedit:12722): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory |
#asterisk -r
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 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. ========================================================================= Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian1 (pid = 12808) debian1*CLI> sip show peers Name/username Host Dyn Forcerport ACL Port Status 1101 (Unspecified) D N 0 Unmonitored 1102 (Unspecified) D N 0 Unmonitored 2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline] debian1*CLI> /etc/init.d/asterisk restart Disconnected from Asterisk server |
#cat /etc/asterisk/sip.conf
[general] context=default [1101] type=friend secret=1234 host=dynamic [1102] type=friend secret=1234 host=dynamic |
#less /var/log/asterisk/messages
|
#cat /etc/asterisk/sip.conf
[general] context=default [1101] type=friend secret=1234 host=dynamic [1102] type=friend secret=1234 host=dynamic |
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |
#history | grep dhc
124 isc-dhcp-server 125 apt-get instal isc-dhcp-server 127 sed -i s/eth1/eth0/ /etc/default/isc-dhcp-server 132 #apt-get instal <!--- # здесь была ошибка isc-dhcp-server 133 #apt-get install isc-dhcp-server 135 apt-get install isc-dhcp-server 136 sed -i s/eth1/eth0/ /etc/default/isc-dhcp-server 137 grep INTER /etc/default/isc-dhcp-server 138 vi /etc/default/isc-dhcp-server 139 vi /etc/dhcp/dhcpd.conf 140 /etc/init.d/isc-dhcp-srver 141 /etc/init.d/isc-dhcp-server 142 /etc/init.d/isc-dhcp-server restart 161 history | grep dhc |
#asterisk -r
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 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. ========================================================================= Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian1 (pid = 13150) debian1*CLI> sip show peers Name/username Host Dyn Forcerport ACL Port Status 1101 (Unspecified) D N 0 Unmonitored 1102 (Unspecified) D N 0 Unmonitored 2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline] debian1*CLI> exuit No such command 'exuit' (type 'core show help exuit' for other possible commands) debian1*CLI> exit |
#exuit
bash: exuit: command not found |
#asterisk -rx 'sip show peers'
Name/username Host Dyn Forcerport ACL Port Status 1101 (Unspecified) D N 0 Unmonitored 1102 (Unspecified) D N 0 Unmonitored 2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline] |
#asterisk -rvvv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 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. ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': == Found == Parsing '/etc/asterisk/extconfig.conf': == Found Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian1 (pid = 13150) Verbosity was 0 and is now 3 debian1*CLI> sip show peers Name/username Host Dyn Forcerport ACL Port Status 1101 (Unspecified) D N 0 Unmonitored 1102 (Unspecified) D N 0 Unmonitored 2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline] debian1*CLI> quit Executing last minute cleanups |
#vim /etc/d
|
#vim /etc/d
|
#vim /etc/dhcp/dhc
|
#vim /etc/dhcp/dhc
|
#vim /etc/default/isc-dhcp-server
|
#history | grep 192.168
31 ifconfig eth0 192.168.12.1/24 32 ip route add default via 192.168.12.254 34 ping 192.168.12.1 35 ping 192.168.12.252 36 ping 192.168.12.253 37 ping 192.168.12.254 113 ping 192.168.12.253 116 ping 192.168.10.254 117 ping 192.168.10.253 118 ping 192.168.12.254 167 history | grep 192.168 |
#уcat /etc/asterisk/extensions.conf
cat: /etc/asterisk/extensions.conf: No such file or directory |
#cat /etc/asterisk/extensions.conf
cat: /etc/asterisk/extensions.conf: No such file or directory |
#grep default /etc/asterisk/sip.conf
context=default |
#asterisk -rvv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 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. ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': == Found == Parsing '/etc/asterisk/extconfig.conf': == Found Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian1 (pid = 13150) ... -- Remote UNIX connection -- Remote UNIX connection disconnected debian1*CLI> dialplan reload Dialplan reloaded. -- Remote UNIX connection -- Remote UNIX connection disconnected -- Remote UNIX connection -- Remote UNIX connection disconnected debian1*CLI> exit Executing last minute cleanups |
#cat /etc/asterisk/extensions.conf
cat: /etc/asterisk/extensions.conf: No such file or directory |
#/etc/asterisk/extensions.conf
bash: /etc/asterisk/extensions.conf: No such file or directory |
#asterisk -r
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 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. ========================================================================= Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian1 (pid = 13150) Verbosity is at least 3 debian1*CLI> dialplan reload ... -- Called SIP/1102 -- SIP/1102-00000007 is ringing -- SIP/1102-00000007 answered SIP/1101-00000006 -- Remotely bridging SIP/1101-00000006 and SIP/1102-00000007 == Spawn extension (default, 1102, 1) exited non-zero on 'SIP/1101-00000006' -- Remote UNIX connection -- Remote UNIX connection disconnected -- Remote UNIX connection -- Remote UNIX connection disconnected debian1*CLI> exit |
[general] context=default [1101] type=friend secret=1234 host=dynamic [1102] type=friend secret=1234 host=dynamic
1/192.168.10.1/ /etc/network/interfaces
nameserver 192.168.12.254 search unix.nt
l3cd=/users/2014-11-nt-voip/nt-voip/debian1/root
Время первой команды журнала | 14:14:02 2014-11-23 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 17:17:22 2014-11-24 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 100 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 19.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 12.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 3.50 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.48 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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