kk Blog —— 通用基础


date [-d @int|str] [+%s|"+%F %T"]
netstat -ltunp
sar -n DEV 1

交换机php telnet

https://www.cnblogs.com/kongxx/archive/2005/09/29/246492.html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php

class Telnet
{
	var $sock = NULL;

	function telnet($host, $port)
	{
		$this->sock = fsockopen($host, $port);
		socket_set_timeout($this->sock,2,0);
	}

	function close()
	{
		if ($this->sock)
			fclose($this->sock);
		$this->sock = NULL;
	}

	function write($buffer)
	{
		$buffer = str_replace(chr(255),chr(255).chr(255), $buffer);
		fwrite($this->sock, $buffer);
	}

	function getc()
	{
		return fgetc($this->sock); 
	}


	function read_till($what)
	{
		$what2 = "---- More ----";
		$bufs = '';
		while (true) {
			$buf = $this->read_till_do($what);
			$bufs .= $buf;

			if ($what == (substr($buf, strlen($buf) - strlen($what)))) {
				$bufs = substr($bufs, 0, -strlen($what));
				break;
			}
			if (strpos($buf, $what2) === false)
				break;
			if ($what2 == (substr($buf, strlen($buf) - strlen($what2))))
				$bufs = substr($bufs, 0, -strlen($what2));
			$this->write(" ");
		}
		return $bufs;
	}

	function read_till_do($what)
	{
		$IAC = chr(255);
		$DONT = chr(254);
		$DO = chr(253);
		$WONT = chr(252);
		$WILL = chr(251);
		$theNULL = chr(0);

		$buf = '';
		while (1)
		{
			$c = $this->getc();

			if ($c === false)
				return $buf;
			if ($c == $theNULL)
				continue;

		//    if ($c == "1")
		//        continue;

			if ($c != $IAC) {
				$buf .= $c;

				if ($what == (substr($buf, strlen($buf) - strlen($what)))) {
					return $buf;
				} else {
					continue;
				}
			}

			$c = $this->getc();

			if ($c == $IAC) {
				$buf .= $c;
			} elseif ($c == $DO) {
				$opt = $this->getc();
		//        echo "we wont " . ord($opt) . "\n";
				fwrite($this->sock, $IAC.$WONT.$opt);
			} elseif ($c == $DONT) {
				$opt = $this->getc();
		//        echo "we wont " . ord($opt) . "\n";
				fwrite($this->sock, $IAC.$WONT.$opt);
			} elseif ($c == $WILL) {
				$opt = $this->getc();
		//        echo "we dont " . ord($opt) . "\n";
				fwrite($this->sock, $IAC.$DONT.$opt);
			} elseif ($c == $WONT) {
				$opt = $this->getc();
		//        echo "we dont " . ord($opt) . "\n";
				fwrite($this->sock, $IAC.$DONT.$opt);
			} else {
		//        echo "where are we? c=" . ord($c) . "\n";
			}
		}
	}
}

$telnet = new telnet($ip, 23);
$msg = $telnet->read_till("Password:");

$telnet->write("abc123\r\n");
$msg = $telnet->read_till("<H3C>");

$telnet->write("display cu\r\n");
$msg = $telnet->read_till("<H3C>");

$telnet->write("display vlan all\r\n");
$msg = $telnet->read_till("<H3C>");

$telnet->write("display interface Vlan-interface\r\n");
$msg = $telnet->read_till("<H3C>");

$telnet->write("display version\r\n");
$msg = $telnet->read_till("<H3C>");

$telnet->write("display device\r\n");
$msg = $telnet->read_till("<H3C>");

$telnet->write("display device manuinfo\r\n");
$msg = $telnet->read_till("<H3C>");

$telnet->write("display ip routing-table\r\n");
$msg = $telnet->read_till("<H3C>");

$telnet->write("display arp\r\n");
$msg = $telnet->read_till("<H3C>");

$telnet->write("display mac-address\r\n");
$msg = $telnet->read_till("<H3C>");

交换机开启telnet

华为与H3C交换机打开或关闭告警信息

https://blog.csdn.net/weixin_44657888/article/details/122612537

1
2
undo terminal monitor    关闭
terminal monitor  开启

1
2
undo info-center enable  关闭
info-center enable    开启

H3C & 华为

https://blog.csdn.net/qq_14829643/article/details/133721759

https://blog.csdn.net/weixin_38912654/article/details/102942423

https://blog.csdn.net/weixin_34367845/article/details/92891126

https://blog.csdn.net/u013667796/article/details/126339807

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
sys
interface vlan-interface 1
ip address 192.168.1.234 24
quit

user-interface vty 0 4
authentication-mode password
set authentication password simple abc123
screen-length 0       配置终端显示行数
# screen-length 0  temporary
idle-timeout 60       配置连接超时分钟数

# user privilege level 3  # 华为3328F
quit

ip route-static 0.0.0.0 0.0.0.0 192.168.1.254
super password level 3 simple abc123

telnet server enable
protocol inbound [ssh|telnet|all] 配置VTY用户界面支持的协议

display user-interface

H3C S1600

H3C S1600系列以太网交换机 用户手册-6W208

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
sys
interface vlan-interface 1
ip address 192.168.1.234 24
ip gateway 192.168.1.254
quit

user-interface vty 0 4
set authentication password simple abc123 # VTY用户认证
idle-timeout 30       # 设置连接用户超时中断时间的可选取的分钟的取值
quit

password simple abc123

# telnet 默认是开启的
ip telnet shutdown
undo ip telnet shutdown

锐捷S2910-24GT4SFP-L

https://blog.csdn.net/qq_45371244/article/details/129667289

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Ruijie>

Ruijie>enable    ---进入特权模式

Ruijie#config    ---进入全局配置模式

Ruijie(config)#interface Vlan 1    ---进入Vlan 1端口

Ruijie(config-if-VLAN 1)#ip address 192.168.1.1 255.255.255.0    ---给Vlan 1配置管理IP

Ruijie(config-if-VLAN 1)#exit    ---退回到全局模式


2.配置Telent密码

(1)用Telnet模式登录时使用密码登录交换机配置

Ruijie(config)#line vty 0 4    ---进入Telnet密码配置模式,0 4表示允许共5个用户(即用户0至用户5一共五位用户)同时使用Telnet模式登入到交换机

Ruijie(config-line)#login    ---启动密码登录

Ruijie(config-line)#password ruijie    ---设置密码为ruijie

Ruijie(config-line)#exit    ---退回到全局模式

Ruijie(config)#enable password ruijie    ---设置enable登录密码为ruijie

Ruijie(config)#end    ---退出到特权模式

Ruijie#write    ---确认配置正确,保存已经设置好的配置


username admin password ruijie    ---设置远程登录的用户名为admin密码为ruijie

Ruijie#show interfaces vlan 1

博达

https://wenku.baidu.com/view/0aa095b501d276a20029bd64783e0912a2167c99.html?_wkts_=1729989536547

https://www.cnblogs.com/rivanwang/p/14704184.html

S2548GX 博达路由器console线 与 思科/华为 不通用。

需要 RLC0301

1
2
3
4
5
6
7
Switch> enable
Switch# config
Switch# show configuration
Switch# show interface vlan 1

Switch_config# username admin password abc123
Switch_config# terminal length 0

查看vlan mac

1
2
3
4
5
6
7
8
<suncables9306>display interface Vlanif main

<Quidway>display interface Vlan-interface 1

<H3C>display interface Vlan-interface 1

Ruijie#show interfaces vlan 1
Switch#show interface vlan 1

S1728GWR-4P怎么登陆web管理界面

https://support.huawei.com/enterprise/zh/knowledge/EKB1000067306

在地址栏中输入Web网管客户端的默认URL(Universal Resource Locator)地址:http://192.168.0.1%EF%BC%8C%E5%B9%B6%E6%8C%89%E2%80%9CEnter%E2%80%9D%E9%94%AE%EF%BC%8C%E5%87%BA%E7%8E%B0%E2%80%9CUser Login”用户登录对话框。如图1所示。(ip地址不对的话换192.168.1.253)

默认用户名和密码分别为admin、Admin@123。 (不行的话换admin admin试试)

ffmpeg分离MP3文件报错

https://blog.csdn.net/weixin_44736603/article/details/121537824

使用ffmpeg视频中分离出MP3文件报错

Automatic encoder selection failed for output stream #0:0. Default encoder for format mp3 (codec mp3) is probably disabled. Please choose an encoder manually. Error selecting an encoder for stream 0:0

问题原因在于只有mp3的解码库,没有mp3编码库导致的,需要添加libmp3lame第三方库。

添加libmp3lame库方式

下载压缩包 https://sourceforge.net/projects/lame/files/lame/

解压 ,进入lame-3.100目录下,在终端打开

依次执行

1
2
3
./configure --enable-shared
make
make install

安装ffmpeg时, –enable-libmp3lame引入libmp3lame

1
2
3
./configure --enable-shared --enable-libmp3lame
make
# make install

安装完毕之后

1
2
3
4
5
6
7
vim /etc/ld.so.conf

添加
/usr/local/lib/

再执行
ldconfig