首页 文章 精选 留言 我的

精选列表

搜索[API模拟],共10007篇文章
优秀的个人博客,低调大师

ScummVM 2.1.0 发布,游戏模拟器

ScummVM 2.1.0已经发布,该版本增加了 16 款基于 8 个引擎的新游戏、一个 Nintendo Switch 端口和近 500 个 bug 修复程序,内容如下: 新支持的游戏有: Blade Runner Duckman: The Graphic Adventures of a Private Dick Hoyle Bridge Hoyle Children's Collection Hoyle Classic Games Hoyle Solitaire Hyperspace Delivery Boy! Might and Magic IV - Clouds of Xeen Might and Magic V - Darkside of Xeen Might and Magic - World of Xeen Might and Magic - Swords of Xeen Mission Supernova Part 1 Mission Supernova Part 2 Quest for Glory: Shadows of Darkness The Prince and the Coward Versailles 1685 此外,该版本还增强了 Android 和 iOS 端口,用户能够注意到改进的新GUI、改进的 Roland mt-32 声音仿真、新的像素自适应模式、macos 和 linux 上的文本到语音支持,以及对同步保存和从基于云的文件服务下载游戏数据的支持。此版本改进了许多现有的引擎,完整列表见: https://www.scummvm.org/frs/scummvm/2.1.0/ReleaseNotes.htm

优秀的个人博客,低调大师

模拟Internet架构的DNS解析系统

一、环境准备 主机用的centos7,建议关闭图形界面: systemctl set-default nulti-user.target init 3 准备工作:关闭所有主机的防火墙,selinux: systemctl stop firewalld systemctl disable firewalld setenforce 0 sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config 这里用到dns转发,dns主从,dns子域委派,有兴趣的可以在主从dns服务器上添加反向解析域和智能dns。 架构图如下: 二、搭建 由于主机较多,配置过程中可能会出现各种问题,从哪里配置呢? 这里从下往上配置,配置一台主机测试无问题后再配置另外一台 用ip地址的后2为表示主机 1、在12.67 建立web网站 yuminstallhttpd-y systemctlstarthttpd echowww.test.com>/var/www/html/index.html 在客户端12.6测试网站正常 2、搭建主服务器12.47 yuminstallbind-y vi/etc/named.conf#修改下列三处,注释掉相当域使用默认值,监听本地所有ip,允许其他主机查询 vi/etc/named.rfc1912.zones#在文件中添加一下几行,该文件用来专门存放域的文件,和放在/etc/named.conf作用一样 vi/var/named/test.com.zone#建立区域数据库 named-checkconf#检查配置文件 named-checkzonetest.com/var/named/test.com.zone#检查区域数据库文件 chgrpnamed/var/named/test.com.zone#修改所属组 chmod640/var/named/test.com.zone#修改权限 systemctlstartnamed #如果以上几步有问题会导致服务无法启动 3、配置12.57从服务器 yuminstallbind-y vi/etc/named.conf vi/etc/named.rfc1912.zones#在文件中添加一下几行 主从dns服务器搭建完成 digwww.test.com@192.168.12.47#在12.6客户机测试可以解析 测试从服务器能否同步,修改主dns服务器12.47版本序号,和解析记录,重启服务 systemctlrestartnamed 12.57从服务器已经更新 digxx.test.com@192.168.12.47#在12.6用12.47做dns服务器测试可以解析 4、建立test父域 com域 yuminstallbind-y vi/etc/named.conf vi/etc/named.rfc1912.zones vi/var/named/com.zone chgrpnamed/var/named/com.zone#修改所属组 chmod640/var/named/com.zone#修改权限 systemctlrestartnamed dig www.test.com @192.168.12.37 # 在客户机12.6上测试 5、搭建12.27根dns服务器 yuminstallbind-y vi/etc/named.conf 修改该文件/etc/named.conf 19、20行 vi /var/named/root.zone chgrpnamed/var/named/root.zone#修改所属组 chmod640/var/named/root.zone#修改权限 systemctlstartnamed digwww.test.com@192.168.12.27#在客户机上测试 6、搭建12.17转发dns服务器 vi/etc/named.conf#注释下列2行 //allow-query{localhost;}; //listen-onport53{127.0.0.1;}; 作为转发服务器通常要关闭下面2项 vi /var/named/named.ca 该文件原本是全世界13个根域名服务器,删除全部内容只保留这2行 systemctlrestartnamed digwww.test.com@192.168.12.17#在客户机测试 7、本地dns转发服务器12.7 systemctlstartnamed 到此已经搭建完成 修改客户端dns服务器地址, systemclt restart network 测试成功解析

优秀的个人博客,低调大师

Java 模拟基于UDP的Socket通信

效果图: 多线程服务器 客户端 单线程服务器 多线程服务器 import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.SocketException; public class UDPMutiThreadServer implements Runnable { DatagramPacket datagramPacket; //数据报包 byte[] data1; //存放数据的变量 public UDPMutiThreadServer(DatagramPacket datagramPacket,byte[] data1) { this.datagramPacket = datagramPacket; this.data1=data1; } public static void main(String[] args) throws SocketException { int count=0; //用于统计客户端数量 DatagramSocket datagramSocket = new DatagramSocket(1234); System.out.println("```````服务器已经启动,等待客户端发送数据````````"); while (true) { /** * 创建数据报包,用于保存收发的数据,需要定义数据包的大小和长度 */ byte[] data = new byte[1024]; DatagramPacket datagramPacket = new DatagramPacket(data,data.length); try { datagramSocket.receive(datagramPacket); } catch (IOException e) { e.printStackTrace(); } if (datagramPacket.getLength() > 0) { new Thread(new UDPMutiThreadServer(datagramPacket,data)).start(); count++; System.out.println("客户端的数量为:" + count); } } } @Override public void run() { // byte[] data=new byte[1024]; String info = new String(data1,0,datagramPacket.getLength()); System.out.println("我是服务器,客户端发送的信息是:"+ info); /** * 响应客户端数据 * * 从接收的数据包中获取客户端的地址和端口 */ InetAddress address = datagramPacket.getAddress(); int port = datagramPacket.getPort(); //定义响应数据 byte[] data2 = "服务器已经收到你的信息,谢谢!".getBytes(); //用DatagramPacket把要发送的数据进行打包 DatagramPacket datagramPacket1 = new DatagramPacket(data2,data2.length,address,port); //用datagramSocket把数据包发送给客户端 try { DatagramSocket datagramSocket= new DatagramSocket(); datagramSocket.send(datagramPacket1); } catch (IOException e) { e.printStackTrace(); } } } 客户端 import java.io.IOException; import java.net.*; public class UDPClient { public static void main(String[] args) throws IOException { /** * 向服务器发送数据 * * 定义服务器地址,端口号和数据 */ InetAddress address = InetAddress.getByName("localhost"); int port=1234; byte[] data ="我是:admin123,密码:123456546".getBytes(); /** * 定义一个DatagramPacket,把要发送的数据时行打包 */ DatagramPacket datagramPacket = new DatagramPacket(data,data.length,address,port); /** * 定义一个DatagramSocket,用于发送和接收数据 */ DatagramSocket datagramSocket = new DatagramSocket(); datagramSocket.send(datagramPacket); /** * 接收服务器发送的数据 */ //定义数据包的容量 byte[] daaa= new byte[1024]; DatagramPacket datagramPacket1 = new DatagramPacket(daaa,daaa.length); //用DatagramSocket接收数据 datagramSocket.receive(datagramPacket1); //读取数据包的内容 String info = new String(daaa,0,datagramPacket1.getLength()); System.out.println("我是客户端,你说:"+info); datagramSocket.close(); } } 单线程服务器 import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.SocketException; public class UDPServer { public static void main(String[] args) throws IOException { /** * 接收客户端数据 * * 创建服务器端的Socket,用于收发数据,需要指定端口 */ DatagramSocket datagramSocket = new DatagramSocket(1234); /** * 创建数据报包,用于保存收发的数据,需要定义数据包的大小和长度 */ byte[] data = new byte[1024]; DatagramPacket datagramPacket = new DatagramPacket(data,data.length); System.out.println("```````服务器已经启动,等待客户端发送数据````````"); /** * 用Socket收取从客户端发来的数据,并保存在Packet数据报包中 */ datagramSocket.receive(datagramPacket); String info = new String(data,0,datagramPacket.getLength()); System.out.println("我是服务器,客户端发送的信息是:"+ info); /** * 响应客户端数据 * * 从接收的数据包中获取客户端的地址和端口 */ InetAddress address = datagramPacket.getAddress(); int port = datagramPacket.getPort(); //定义响应数据 byte[] data2 = "服务器已经收到你的信息,谢谢!".getBytes(); //用DatagramPacket把要发送的数据进行打包 DatagramPacket datagramPacket1 = new DatagramPacket(data2,data2.length,address,port); //用datagramSocket把数据包发送给客户端 datagramSocket.send(datagramPacket1); } }

优秀的个人博客,低调大师

模拟WALMART网络架构-双栈冗余

SiteA and Site B 通信 SiteA: 192.168.1.X 192.168.3.X SiteB: 192.168.2.X 192.168.4.X =====MPLS Router Configuration===== R1 2 3 4 5 6 ====〉代表不同的MPLS 供应商 Step1:--MPLS域启用MPLS ip cef mpls ip mpls ldp router-id lo0 force mpls label protocol ldp int s0/0 mpls ip int s0/1 mpls ip Step2:---MPLS域 IGP通 router eigrp 80 no auto net 0.0.0.0 passive-interface f0/0 Step3:---MPLS域 PE接口启用VRF R1: ip vrf walmart rd 100:13 --->对方可以不一致,本地意义区分私网路由 route-target 100:79 -----〉对方必须一致 int f0/0 ip vrf forwarding walmart ip add R3: ip vrf walmart rd 100:31 route-target 100:79 int f0/0 ip vrf forwarding walmart ip add 验证show ip vrf detail [brief] R4:/R6: ip vrf walmart rd 200:46[200:64] route-target 200:81 int f0/0 ip vrf forwarding walmart ip add Step4:----MPLS域 MBGP R1: router bgp 100 bgp router-id 1.1.1.1 bgp log-neighbor-changes no bgp default ipv4-unicast \\起手配 neighbor 3.3.3.3 remote-as 100 neighbor 3.3.3.3 update-source Loopback0 ! ! address-family vpnv4------\\MP BGP neighbor 3.3.3.3 activate neighbor 3.3.3.3 send-community extended exit-address-family address-family ipv4 vrf walmart----- EBGP neighbor 17.1.1.7 remote-as 300 neighbor 17.1.1.7 activate exit-address-family R3: router bgp 100 bgp router-id 3.3.3.3 bgp log-neighbor-changes no bgp default ipv4-unicast neighbor 1.1.1.1 remote-as 100 neighbor 1.1.1.1 update-source Loopback0 ! ! address-family vpnv4 neighbor 1.1.1.1 activate neighbor 1.1.1.1 send-community extended exit-address-family address-family ipv4 vrf walmart----- EBGP neighbor 39.1.1.9 remote-as 300 neighbor 39.1.1.9 activate exit-address-family 验证: sh ip bgp vpnv4 vrf walmart summary R3#sh ip bgp vpnv4 all summary ============================================= R4: router bgp 200 bgp router-id 4.4.4.4 bgp log-neighbor-changes no bgp default ipv4-unicast neighbor 6.6.6.6 remote-as 200 neighbor 6.6.6.6 update-source Loopback0 ! ! address-family vpnv4 neighbor 6.6.6.6 activate neighbor 6.6.6.6 send-community extended address-family ipv4 vrf walmart neighbor 48.1.1.8 remote-as 300 neighbor 48.1.1.8 activate R6: router bgp 200 bgp router-id 6.6.6.6 bgp log-neighbor-changes no bgp default ipv4-unicast neighbor 4.4.4.4 remote-as 200 neighbor 4.4.4.4 update-source Loopback0 ! ! address-family vpnv4 neighbor 4.4.4.4 activate neighbor 4.4.4.4 send-community extended address-family ipv4 vrf walmart neighbor 61.1.1.1 remote-as 400 neighbor 61.1.1.1 activate =============================================== Step5:-CE BGP 300 /400 R7-CE#sh run | b r b router bgp 300 bgp router-id 7.7.7.7 bgp log-neighbor-changes neighbor 17.1.1.1 remote-as 100 no network 7.7.7.7 mask 255.255.255.255 R9-CE#sh run | b r b router bgp 400 bgp router-id 9.9.9.9 bgp log-neighbor-changes neighbor 39.1.1.3 remote-as 100 no network 9.9.9.9 mask 255.255.255.255 R7-CE#traceroute 9.9.9.9 source 7.7.7.7 Type escape sequence to abort. Tracing the route to 9.9.9.9 VRF info: (vrf in name/id, vrf out name/id) 1 17.1.1.1 60 msec 32 msec 52 msec 2 12.1.1.2 [MPLS: Labels 19/18 Exp 0] 44 msec 40 msec 52 msec 3 39.1.1.3 [MPLS: Label 18 Exp 0] 48 msec 52 msec 52 msec 4 39.1.1.9 48 msec 48 msec 52 msec 察看标签 R1#sh ip bgp vpnv4 vrf walmart 9.9.9.9 BGP routing table entry for 100:13:9.9.9.9/32, version 3 Paths: (1 available, best #1, table walmart) Advertised to update-groups: 2 400, imported path from 100:31:9.9.9.9/32 3.3.3.3 (metric 2809856) from 3.3.3.3 (3.3.3.3) Origin IGP, metric 0, localpref 100, valid, internal, best Extended Community: RT:100:79 mpls labels in/out nolabel/18 R1#sh ip bgp vpnv4 vrf walmart 7.7.7.7 BGP routing table entry for 100:13:7.7.7.7/32, version 4 Paths: (1 available, best #1, table walmart) Advertised to update-groups: 1 300 17.1.1.7 from 17.1.1.7 (7.7.7.7) Origin IGP, metric 0, localpref 100, valid, external, best Extended Community: RT:100:79 mpls labels in/out 18/nolabel R1#show mpls forwarding-table Local Outgoing Prefix Bytes tag Outgoing Next Hop tag tag or VC or Tunnel Id switched interface 16 Pop tag 23.1.1.0/24 0 Se0/0 point2point 17 Pop tag 2.2.2.2/32 0 Se0/0 point2point 18 Untagged 7.7.7.7/32[V] 2796 Fa0/0 17.1.1.7 19 19 3.3.3.3/32 0 Se0/0 point2point =================================内网HSRP====================== R7-CE#sh run int f1/0.1 Building configuration... Current configuration : 206 bytes ! interface FastEthernet1/0.1 encapsulation dot1Q 1 native ip address 192.168.1.251 255.255.255.0 standby 1 ip 192.168.1.1 standby 1 priority 120 standby 1 preempt standby 1 track 1 decrement 30 end R7-CE#sh run int f1/0.3 Building configuration... Current configuration : 199 bytes ! interface FastEthernet1/0.3 encapsulation dot1Q 3 ip address 192.168.3.251 255.255.255.0 standby 3 ip 192.168.3.1 standby 3 priority 120 standby 3 preempt //开启抢占 standby 3 track 1 decrement 30 \\如果接口down了优先级减30 end R8-CE#sh run int f1/0.1 Building configuration... Current configuration : 182 bytes ! interface FastEthernet1/0.1 encapsulation dot1Q 1 native ip address 192.168.1.252 255.255.255.0 standby 1 ip 192.168.1.1 standby 1 preempt //standby 1 track 1 decrement 30 R8-CE#sh run int f1/0.3 Building configuration... Current configuration : 175 bytes ! interface FastEthernet1/0.3 encapsulation dot1Q 3 ip address 192.168.3.253 255.255.255.0 standby 3 ip 192.168.3.1 standby 3 preempt //standby 3 track 1 decrement 30 end =================CE IBGP============================= R7-CE#sh run | b r r router rip version 2 network 7.0.0.0 network 78.0.0.0 no auto-summary ! router bgp 300 bgp router-id 7.7.7.7 bgp log-neighbor-changes network 192.168.1.0 network 192.168.3.0 neighbor 8.8.8.8 remote-as 300 neighbor 8.8.8.8 update-source Loopback0 neighbor 8.8.8.8 next-hop-self neighbor 17.1.1.1 remote-as 100 R8-CE#sh run | b r r router rip version 2 network 8.0.0.0 network 78.0.0.0 no auto-summary ! router bgp 300 bgp router-id 8.8.8.8 bgp log-neighbor-changes neighbor 7.7.7.7 remote-as 300 neighbor 7.7.7.7 update-source Loopback0 neighbor 7.7.7.7 next-hop-self neighbor 48.1.1.4 remote-as 200 R7-CE#sh ip bgp BGP table version is 5, local router ID is 7.7.7.7 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, x best-external, a additional-path, c RIB-compressed, Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path * i 192.168.1.0 8.8.8.8 0 100 0 i *> 0.0.0.0 0 32768 i *> 192.168.2.0 17.1.1.1 0 100 400 i * i 8.8.8.8 0 100 0 200 400 i * i 192.168.3.0 8.8.8.8 0 100 0 i *> 0.0.0.0 0 32768 i *> 192.168.4.0 17.1.1.1 0 100 400 i * i 8.8.8.8 0 100 0 200 400 i 但R7-R8不希望学习到内部路由192.168.1.0 192.168.3.0,我们可以过滤掉 IBGP 过滤内网路由 R7-CE#sh run | be ip prefix-list ip prefix-list deny seq 5 permit 192.168.1.0/24 ip prefix-list deny seq 10 permit 192.168.3.0/24 R7-CE#sh run | be route-map route-map block deny 10 match ip address prefix-list deny ! route-map block permit 20 R7: router bgp 300 neighbor 8.8.8.8 route-map block in R8: router bgp 300 neighbor 7.7.7.7 route-map block in R7-CE#sh ip bgp BGP table version is 5, local router ID is 7.7.7.7 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, x best-external, a additional-path, c RIB-compressed, Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path *> 192.168.1.0 0.0.0.0 0 32768 i * i 192.168.2.0 8.8.8.8 0 100 0 200 400 i *> 17.1.1.1 0 100 400 i *> 192.168.3.0 0.0.0.0 0 32768 i * i 192.168.4.0 8.8.8.8 0 100 0 200 400 i *> 17.1.1.1 0 100 400 i ======BUYTRIP场地 & internet========= R15: R15#sh run | b r e router eigrp 80 network 15.0.0.0 network 57.0.0.0 no auto-summary R7: ip route 0.0.0.0 0.0.0.0 61.1.1.6 R7-CE#sh run | b r b router bgp 300 redistribute eigrp 80 metric 400 network 0.0.0.0 mask 0.0.0.0 R7-CE#sh run | b r e router eigrp 80 network 57.0.0.0 redistribute bgp 300 metric 1000 100 255 1 1500 redistribute static R8: router bgp 300 bgp router-id 8.8.8.8 bgp log-neighbor-changes network 192.168.1.0 network 192.168.3.0 redistribute static metric 300 neighbor 7.7.7.7 remote-as 300 neighbor 7.7.7.7 update-source Loopback0 neighbor 7.7.7.7 next-hop-self neighbor 7.7.7.7 route-map block in neighbor 48.1.1.4 remote-as 200 EIGRP本地优化: access-list 10 permit 0.0.0.0 0.0.0.0 router ei 80 distribute-list 10 in fastEthernet 1/0 本文转自 bilinyee博客,原文链接: http://blog.51cto.com/ericfu/1963262 如需转载请自行联系原作者

资源下载

更多资源
Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册