首页
在线工具
统计
友链
Search
1
暴力破解忘记的zip,rar, pdf等文件密码
3,217 阅读
2
typecho添加打赏功能
1,759 阅读
3
躲避校园网客户端的检测实现移动热点开启
1,299 阅读
4
摸鱼人日历
1,282 阅读
5
创建自签名 ssl 证书
983 阅读
随笔杂记
Web建设
运维茶点
编程之路
网络配置指南
Huawei
网络安全
资源下载
生活中的点滴
登录
Search
标签搜索
HCNA
Python
Huawei
Linux
web
PC
Blog
windows
Network
Docker
HCNP
LOVE
Virus
eNSP
Zabbix
DNS
typecho
MySQL
k8s
HTTPS
TanHaX
累计撰写
76
篇文章
累计收到
76
条评论
首页
栏目
随笔杂记
Web建设
运维茶点
编程之路
网络配置指南
Huawei
网络安全
资源下载
生活中的点滴
页面
在线工具
统计
友链
搜索到
76
篇与
的结果
2023-06-04
使用 pyi-set_version 为 Python EXE 文件添加版本信息的方法
在开发软件时,为了方便用户了解软件的版本信息,我们通常会在软件的可执行文件(EXE 文件)中添加版本号等信息。而在 Python 开发中,我们可以使用 pyi-set_version 工具来为 EXE 文件添加版本信息。1. 要使用 pyi-set_version ,您需要先安装PyInstaller。您可以使用pip来安装它。在命Windows 终端(cmd)中输入以下命令:pip install pyinstaller2. 准备我们的 本版内容文件 可以引荐我之前的发布的模板 从 PyInstaller-pyi-grab_version 生成的可执行文件中提取版本信息3. 我们需要在 Windows终端 中进入您要添加版本的程序目录下,执行以下命令操作:pyi-set_version file_version_info.txt yourprogramname.exe打开程序的属性在详细信息就可以查看我们添加的版本信息了。
2023年06月04日
614 阅读
1 评论
3 点赞
2023-06-04
从 PyInstaller-pyi-grab_version 生成的可执行文件中提取版本信息
1. 要使用pyi-grab_version,您需要先安装PyInstaller。您可以使用pip来安装它。在Windows 终端(cmd)中输入以下命令:pip install pyinstaller2. 我们需要在 Windows终端 中进入您要获取版本的程序目录下,执行以下命令操作。pyi-grab_version yourprogramname.exe3.当命令执行完成后,会在目录下生成一个file_version_info.txt名称的文件。# UTF-8 # # For more details about fixed file info 'ffi' see: # http://msdn.microsoft.com/en-us/library/ms646997.aspx VSVersionInfo( ffi=FixedFileInfo( # filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4) # Set not needed items to zero 0. filevers=(1, 0, 0, 0), prodvers=(1, 0, 0, 0), # Contains a bitmask that specifies the valid bits 'flags'r mask=0x16, # Contains a bitmask that specifies the Boolean attributes of the file. flags=0x0, # The operating system for which this file was designed. # 0x4 - NT and there is no need to change it. OS=0x40004, # The general type of file. # 0x1 - the file is an application. fileType=0x1, # The function of the file. # 0x0 - the function is not defined for this fileType subtype=0x0, # Creation date and time stamp. date=(0, 0) ), kids=[ StringFileInfo( [ StringTable( '080404b0', [StringStruct('CompanyName', 'Smilinghan'), StringStruct('FileDescription', 'Smilinghan-PC'), StringStruct('FileVersion', '1.0.0.0'), StringStruct('InternalName', 'Smilinghan-PC.exe'), StringStruct('LegalCopyright', 'Copyright (C) 2023-2023 by Smilinghan (nihaotang.com)'), StringStruct('OriginalFilename', 'Smilinghan-PC'), StringStruct('ProductName', 'Smilinghan-PC'), StringStruct('ProductVersion', '1.0.0.0')]) ]), VarFileInfo([VarStruct('Translation', [2050, 1000])]) ] )
2023年06月04日
520 阅读
0 评论
1 点赞
2023-05-28
静态路由与BFD联动
1. 配置思路:网络的需求是R2能够访问10.9.9.0/24,而且在网络正常时,R2将到达10.9.9.0/24的数据包转发给Rl,而且当Rl发生故障时,或者Rl与R2之间的某段链路发生故障时,R2自动将数据包的转发路径进行切换,将到达该网段的数据包转发给R3。并且在RI及R2上部署BFD来检测双方直连接口的P连通性。预防某个链路发生故障能感知到(静态路由无法感知到网络拓扑的变化并作出动态响应)。BFD ( BidirectionalForwarding Detection,双向转发检测)就是这类技术之一。实际上,BFD是一种实现网络可靠性的机制,它可被用于快速检测网络中的链路状况、IP可达性等。BFD可以与多种协议或机制进行联动,以确保它们更加可靠地工作,例如静态路由、OSPF、IS-IS、BGP、 VRRP、PIM 及MPLS LSP等。需注意的是,在R1的 BFD会话中,discriminator local 需与R2的 discriminatorremote 相同,而它的discriminator remote需与R2的discriminator local相同。另外,BFD会话的名称只具有本地意义,双方无需相同。R2:配置浮动静态路由ip route-static 10.9.9.0 24 10.1.12.1 ip route-static 10.9.9.0 24 10.1.23.1 preference 80激活BFD功能bfd quit创建一个BFD 会话,会话名称为R1(该名称可自定义),对端P地址为10.1.12.1bfd r2 bind peer-ip 10.1.12.1配置该BFD会话的本地标识符discriminator local 20配置该 BFD会语的远端标识符discriminator remote 10提交配置commit quit将下一跳为R1的静态路由与BFD会话 r2 进行联动ip route-static 10.9.9.0 24 10.1.12.1 track bfd-session r2配置浮动静态路由,下一跳为R3ip route-static 10.9.9.0 24 10.1.23.3 preference 80R1:bfd quit bfd r1 bind peer-ip 10.1.12.2 discriminator local 10 discriminator remote 20 commit在完成上述配置后,我们可以通过以下命令来对配置进行验证。 display bfd session all 查看路由的BFD状态.
2023年05月28日
358 阅读
0 评论
7 点赞
2023-05-26
ACL 基本配置示例
1. 配置步骤:配置好基本的接口 IP 。在路由器 Router上创建ACL,注意: 必须首先进入系统视图,然后执行命令 aclacl-number。对于基本ACL,acl-number 的值必须在2000~2 999的范围内,我们这里确定为2000。另外,我们假设网管人员的PC (IP地址为 172.16.0.2)已经使用Telnet方式登录上了路由器Router。创建了基本 ACL 2000 后,我们便可以使用 rule 命令来制定相应的规则。首先,我们制定一条规则,其含义是允许(permit)源IP地址为 172.16.0.2 的IP报文。然后再制定一条规则,其含义是拒绝(deny)源IP地址为任意地址的P报文。最后,我们在VTY上应用 ACL 2000 。acl 2000 rule permit source 172.16.0.2 0 rule deny source any quit user-interface vty 0 4 acl 2000 inbound quit在完成上述配置后,我们可以通过以下命令来对配置进行验证。display acl 2000 来查看ACL 2000的配置。{dotted startColor="#e28d8d" endColor="#a9c7e5"/}1. ACL 命令:ACL分为基本ACL和高级ACL等类型。基本ACL只能基于P报文的源P地址、报文分片标记和时间段信息来定义规则。基本ACL规则的命令具有如下的结构。rule [rule-id] {deny / permit} [source {source-address source-wildcard | any}lfragment | logging | time-range time-name]2. 命令中各个组成项的解释如下:命令说明rule表示这是一条规则。rule-id表示这条规则的编号。deny / permit这是一个二选一选项,表示与这条规则相关联的处理动作。deny表示“拒绝”:permit表示“允许”。source表示源IP地址信息。source-address表示具体的源IP地址。source-wildcard表示与 source-address相对应的通配符。source-wildcard和source-address的结合使用,可以确定出一个IP地址的集合。极端情况下,该集合中可以只包含一个IP地址。通配符source-wildcard的使用方法,是与 8.3.11小节中wildcard-mask 的使用方法完全一样的,所以这里不再赘述。any表示源P地址可以是任何地址。fragment表示该规则只对非首片分片报文有效。logging表示需要将匹配上该规则的P报文进行日志记录。time-range time-name表示该规则的生效时间段为time-name,具体的使用方法这里不做描述。
2023年05月26日
274 阅读
0 评论
4 点赞
2023-05-25
DHCP 中继代理配置示例
1. 配置步骤要在R1上配置 DHCP中继服务,必须首先进入系统视图,然后执行命令dhepenable,使能DHCP功能。接下来我们在R1的各个接口下使能 DHCP中继功能,使用的命令是 dhcp selectrelay。命令 dhcp relay server-ip 172.10.1.1用来配置DHCP Server的IP地址。R1:dhcp enable interface GigabitEthernet 0/0/0 ip address 192.168.1.1 26 dhcp select relay dhcp relay server-ip 172.10.1.1 quit interface GigabitEthernet 0/0/1 ip address 192.168.1.65 26 dhcp select relay dhcp relay server-ip 172.10.1.1 quit interface GigabitEthernet 0/0/2 ip address 192.168.1.129 26 dhcp select relay dhcp relay server-ip 172.10.1.1 quit在完成上述配置后,我们可以通过以下命令来对配置进行验证。 display this 查看相关的DHCP中继配置,注意:需要进入接口才使用该命令。
2023年05月25日
327 阅读
0 评论
8 点赞
2023-05-24
DHCP Server配置示例
1. 配置步骤:(1) 要在R1上使能 DHCP功能,必须先进入系统视图,然后执行命令 dhcp enable。(2) 我们在R1上创建3个不同的全局地址池,分别用于为3个不同部门的PC分配IP地址。DHCP Server 分配P地址时,可以使用基于全局地址池的服务方式,也可以使用基于接口地址池的服务方式。(3) 创建全局地址池的命令是 ip pool ip-pool-name, ip-pool-name 表示地址池名称,它可以是字母、数字、下划线等符号的组合。(4) 我们将配置 DHCP Server全局地址池中分配给网关的IP地址。命令 gateway-list ip-address 可以用来指定PC在获取到P地址后进行网络通信时应该使用的网关P地址。(5) 接下来,我们可以使用命令 lease {day day [ hour hour [ minute minmute ] ] | unlimited } 来配置IP地址的租约期。默认情况下,租约期是1天,我们这里将它配置成1个小时。(6) 我们还需要在R1的各个接口下配置基于全局地址池的服务方式,使用的命令是 dhcp select global。R1:dhcp enable ip pool department1 network 192.168.1.1 mask 26 gateway-list 192.168.1.1 lease day 0 hour 1 quit ip pool department2 network 192.168.1.64 mask 26 gateway-list 192.168.1.65 lease day 0 hour 1 quit ip pool department3 network 192.168.1.128 mask 26 gateway-list 192.168.1.129 lease day 0 hour 1 quit interface GigabitEthernet 0/0/0 ip address 192.168.1.1 26 dhcp select global quit interface GigabitEthernet 0/0/1 ip address 192.168.1.65 26 dhcp select global quit interface GigabitEthernet 0/0/2 ip address 192.168.1.129 26 dhcp select global quit 在完成上述配置后,我们可以通过以下命令来对配置进行验证。1) display ip pool namepool-name used ,查看地址池的配置情况以及已经分配的地址情况。
2023年05月24日
367 阅读
0 评论
3 点赞
2023-05-23
链路聚合配置示例(Smart Link)
1. 配置思路创建Smart Link组,将相应的端口加入Smart Link 组,并指定端口角色。使能 Flush帧发送功能。使能 Flush帧接收功能。使能Smart Link回切功能。使能 Smart Link功能。2.配置步骤2. 由于Smart Link 协议是与STP协议互斥的,所以在配置Smart Link之前需要先进入相应的接口视图,并使用stp disable命令来取消STP功能。3. 在Switch A上创建Smart Link组1,并使用port命令将GE1/0/1配置为SmartLink组1的主端口,将 GE1/0/2配置为Smart Link组1的从端口。4. 使用flush send命令使能Smart Link组1发送Flush帧的功能,携带的控制VLAN编号是10,密码是“hauwei”。5. 使用restore enable命令配置回切功能,使用timer wtr命令设定回切时间为 30 秒。6. 使用命令smart-link enable来使能 Smart Link组1的功能。Switch A:interface GigabitEthernet 0/0/1 stp disable quit interface GigabitEthernet 0/0/1 stp disable quit smart-link group 1 port GigabitEthernet 0/0/1 master port GigabitEthernet 0/0/1 slave flush send control-vlan 10 password simple huawei restore enable timer wtr 30 smart-link enable Switch B:interface GigabitEthernet 0/0/2 smart-link flush receive control-vlan 10 password simple huawei quit interface GigabitEthernet 0/0/1 smart-link flush receive control-vlan 10 password simple huawei quit Switch C:interface GigabitEthernet 0/0/2 smart-link flush receive control-vlan 10 password simple huawei quit interface GigabitEthernet 0/0/1 smart-link flush receive control-vlan 10 password simple huawei quit 在完成上述配置后,我们可以通过以下命令来对配置进行验证。 display smart-linkgroup 命令来查看相关信息。
2023年05月23日
470 阅读
0 评论
3 点赞
2023-05-23
三层交换接口基础配置示例
1. 配置思路(1) 在交换机上S1创建VLAN (注意,在S2和S3上无需创建VLAN)。(2) 配置交换机S1的端口。(3) 在交换机S1上创建VLANIF 接口并配置P地址,实现不同VLAN之间的三层互通。2. 配置步骤S1创建VLAN 10 和 VLAN 20:vlan batch 10 20 interface GigabitEthernet 0/0/1 port link-type access port default vlan 10 quit vlan batch 10 20 interface GigabitEthernet 0/0/1 port link-type access port default vlan 10 quit interface GigabitEthernet 0/0/2 port link-type access port default vlan 20 quit PC:将PC1的IP地址配置为192.168.100.11/24,并将其缺省网关地址配置为S1上VLANIF 10的IP地址192.168.100.1/24。将PC4的P地址配置为192.168.200.11/24,并将其缺省网关地址配置为S1上 VLANIF 20的P地址192.168.200.1/24。配置完成后,在PC1上执行命令“ping 192.168.200.11”。S1上配置VLANIF接口。interface Vlanif 10 ip address 192.168.100.1 24 quit interface Vlanif 20 ip address 192.168.200.1 24 quit在完成上述配置后,我们可以通过以下命令来对配置进行验证。 display vlan vlan-id verbose 查看VLAN的配置情况。 display port vlan 查看所有VLAN所包含的端口信息。 display ip interface brief vlanif vlan-id 查看VLANIF接口情况。
2023年05月23日
391 阅读
0 评论
3 点赞
2023-05-22
OSPF基础配置示例
1. 配置步骤:要在路由器上配置OSPF,必须首先进入系统视图,然后执行 ospf [ process-id |router-id router-id ]命令以使能OSPF进程,并进入OSPF 视图。执行ospf命令时,如果不输入process-id(该参数表示OSPF进程编号)的值,则process-id默认取值为1。router-id是一个32比特的二进制数,也经常表示为点分十进制数。如果在执行ospf命令时不指定router-id,则路由器会根据某种规则自动生成一个值来作为router-id。R1:ospf router-id 11.1.1.1 area 0 network 12.0.0.0 0.255.255.255 network 13.0.0.0 0.255.255.255 quit area 1 network 172.16.0.0 0.0.0.255 network 1.0.0.0 0.255.255.255 quit interface GigabitEthernet 2/0/0 ip address 172.16.0.1 24 quit interface GigabitEthernet 2/0/1 ip address 1.0.0.1 8 quit interface GigabitEthernet 0/0/1 ip address 13.0.0.1 8 interface GigabitEthernet 0/0/0 ip address 12.0.0.1 8 quit R2:ospf router-id 22.2.2.2 area 0 network 12.0.0.0 0.255.255.255 network 23.0.0.0 0.255.255.255 quit area 2 network 2.0.0.0 0.255.255.255 network 10.0.0.0 0.255.255.255 quit interface GigabitEthernet 2/0/1 ip address 12.0.0.2 8 quit interface GigabitEthernet 2/0/0 ip address 23.0.0.1 8 quit interface GigabitEthernet 0/0/0 ip address 2.0.0.1 8 quit interface GigabitEthernet 0/0/1 ip address 10.0.0.0 8 quit R3:ospf router-id 33.3.3.3 area 0 network 13.0.0.0 0.255.255.255 network 23.0.0.0 0.255.255.255 quit area 3 network 192.168.0.0 0.0.0.255 network 3.0.0.0 0.255.255.255 quit interface GigabitEthernet 2/0/0 ip address 192.168.0.1 24 quit interface GigabitEthernet 2/0/1 ip address 3.0.0.1 8 quit interface GigabitEthernet 0/0/1 ip address 13.0.0.2 8 quit interface GigabitEthernet 0/0/0 ip address 23.0.0.2 8 quit 在完成上述配置后,我们可以通过以下命令来对配置进行验证。 display ospf [ process-id ] peer 查看路由器的邻居信息。 display ospf [ process-id ] routing 查看路由器的OSPF 路由表。
2023年05月22日
681 阅读
4 评论
8 点赞
2023-05-22
静态路由基础配置示例
R1:基础配置:interface GigabitEthernet 0/0/1 ip address 192.168.1.254 24 quit interface GigabitEthernet 0/0/2 ip address 10.0.0.1 30 interface GigabitEthernet 0/0/0 ip address 23.0.0.2 30 quit静态配置:ip route-static 192.168.2.254 24 10.0.0.2 ip route-static 0.0.0.0 0 0.0.0.0 10.0.0.2R2:基础配置:interface GigabitEthernet 0/0/1 ip address 192.168.2.254 24 quit interface GigabitEthernet 0/0/0 ip address 10.0.0.2 30静态配置:ip route-static 192.168.1.254 24 10.0.0.1 ip route-static 0.0.0.0 0.0.0.0 23.0.0.1R3:基础配置:interface GigabitEthernet 0/0/1 ip address 23.0.0.1 30 quit使用 display iprouting-table 命令查看其P路由表。
2023年05月22日
274 阅读
0 评论
0 点赞
1
...
3
4
5
...
8