ping

Docker容器化技术(下)

瘦欲@ 提交于 2019-12-06 11:16:44
Docker容器化技术(下) 一、Dockerfile基础命令 1.1.FROM - 基于基准镜像 FROM centos #制作基准镜像(基于centos) FROM scratch #不依赖任何基准镜像base image FROM tomcat:9.022-jdk8-openjdk 尽量使用官方的Base Image 1.2.LABEL&MAINTAINER - 说明信息 MAINTAINER xxx.com LABEL version = "1.0" LABEL description = "xxx啥作用" 1.3.WORKDIR - 设置工作目录 WORKDIR /usr/local WORKDIR /usr/local/newdir #自动创建 尽量使用绝对路径 1.4.ADD&COPY - 复制文件 ADD hello / #f复制到根路径 ADD test.tar.gz / #添加根目录并解压 ADD 除了复制,还具备添加远程文件的功能,+网址,类似wget 1.5.ENV - 设置环境常量 ENV JAVA_HOME /usr/local/openjdk8 RUN ${JAVA_HOME}/bin/java -jar test.jar 尽量使用环境常量,可提高程序维护性 二、Dockerfile执行指令 RUN&CMD&ENTRYPOINT RUN

How to add time stamp in the beginning of batch file result

泪湿孤枕 提交于 2019-12-06 11:04:29
How can I add time stamp in the beginning of batch file results? Here's my current code: set dt=%date:~10,4%%date:~4,2%%date:~7,2% set tm=%time:~0,2%%time:~3,2%%time:~6,2% ping www.google.com -t -l 1 >PingLog_%dt%-%tm%.txt I want to the result to be similar to this: [hh:mm:ss] Reply from 120.89.12.38: bytes=1 time=1ms TTL=59 npocmaka Small edit to add formatting: It's tested and works well here - though the time format on this PC is 24 hour time, which makes it work well. @echo off setlocal enableDelayedExpansion set dt=%date:~10,4%%date:~4,2%%date:~7,2% set tm=%time:~0,2%%time:~3,2%%time:~6,2

C++ Boost.asio Ping

戏子无情 提交于 2019-12-06 10:46:49
问题 I'm trying to make a program that will list all of the IP addresses of devices on a network. One of the main components of this is being able to ping devices. This program must work on Linux, Windows and Mac, so I chose the Boost library. I managed to find this example in the documentation: http://www.boost.org/doc/libs/1_47_0/doc/html/boost_asio/example/icmp/ping.cpp I am fairly experienced at C++ when using OpenGL 3.1 and Shaders but when I run this program it pings over and over (454+) and

Why is CapEff all zeros in /proc/$PID/status

孤街浪徒 提交于 2019-12-06 10:06:18
I removed the setuid bit from the ping binary and added cap_net_raw+p instead as follows: $ chmod 755 /bin/ping $ setcap cap_net_raw+p /bin/ping Then I ran ping in one terminal and checked the /proc/$PID/status of the running process from another: $ ps aux | grep ping user 5468 0.0 0.0 14948 1792 pts/20 S+ 11:14 0:00 ping www.google.com user 5471 0.0 0.0 14224 896 pts/2 S+ 11:14 0:00 grep --color=auto ping $ cat /proc/5468/status | grep Cap CapInh: 0000000000000000 CapPrm: 0000000000002000 CapEff: 0000000000000000 CapBnd: 0000003fffffffff CapAmb: 0000000000000000 If ping is currently running

【实战演练】Packet Tracer玩转CCNA实验07-静态路由配置

放肆的年华 提交于 2019-12-06 09:55:16
【实战演练】Packet Tracer玩转CCNA实验07-静态路由配置 实验:配置静态路由 #本文欢迎转载,转载请注明出处和作者。* 前面实验的01~06,已经将基本的二层通信说完了。其中04、05的单臂路由与SVI,已经将使用单台路由器与三次交换机的三层路由也说明了。 但是,由于路由都集中在单台设备,并且还都是直连路由,根本无法体验到到底查询路由表,设置路由条目,到底是怎样的情况。 因此,此节开始讲述三层路由相关的知识。 实验:配置静态路由 拓扑图如下,其中引入了一个概念,就是lo的loopback环回接口。这种是路由器的逻辑接口,相当于在路由器上面虚拟出来的本地直连接口。 由于是虚拟出来的逻辑接口,不会占用物理端口,因此,一般,这种接口是用于配置来用于路由器的管理地址的,作为管理用途。 这里引入,是因为省略还需要在R1、R3两侧分别还要接入PC,然后在PC上面IP、子网掩码与配置网关,然后在路由器的接口上还要配置地址,所以直接采用loopback地址,模拟路由器上面接了PC终端。 当然如果改为在R1、R3两侧分别接入PC1、PC2,然后分配两个不同网段的IP地址,并且参照单臂路由,在R1、R3上面分别为PC1、PC2设置网关,也是可以的。 1、预配置 R1: en conf t host R1 int se2/0 ip add 12.1.1.1 255.255.255.0

实验二 认识Packet Tracer软件

為{幸葍}努か 提交于 2019-12-06 09:54:41
实验二 认识Packet Tracer软件 一、Packet Tracher 介绍 Packet Tracer是Cisco公司针对CCNA认证开发的一个用来设计、配置和故障排除网络的模拟软件。 Packer Tracer模拟器软件比Boson功能强大,比Dynamips操作简单,非常适合网络设备初学者使用。 二 、实验任务 1、安装Packer Tracer; 2、利用一台型号为2960的交换机将2pc机互连组建一个小型局域网; 3、分别设置pc机的ip地址; 4、验证pc机间可以互通。 三、实验设备 Switch_2960 1台;PC 2台;直连线 四、实验拓扑图 五、实验命令 PC1 IP: 192.168.1.2 Submask: 255.255.255.0 Gateway: 192.168.1.1 PC2 IP: 192.168.1.3 Submask: 255.255.255.0 Gateway: 192.168.1.1 PC1 ping PC2 Reply PC2 ping PC1 Reply PC2 ping Gateway Timeout 六、实验过程以及结果 PC1 ping PC2 2. PC2 ping PC1 来源: CSDN 作者: 划过的梦神 链接: https://blog.csdn.net/Anne999/article/details

华为路由器ACL简单配置

让人想犯罪 __ 提交于 2019-12-06 09:21:23
ACL(Access Control List)访问控制列表,是由一系列规则组成的集合。 先来看下拓扑图吧~ lo0就是LoopBack0,路由器上的逻辑接口,可以模拟一台主机 配置目的: AR1上的lo0可以ping通AR3上的lo0,而lo1不可以ping通AR3上的lo0 一、 首先最基本的配置,接口IP、静态路由,使这两条链路是通的。过程,此处省略n个字。 结果,两个逻辑接口都可以ping通AR3上的逻辑接口 二、配置acl 方法有很多,这里记录两种,老师讲的,一种基本ACL,一种高级ACL 基本的ACL就是简单的阻止一个特定的source发来的数据 1、基本ACL 添加一条规则,5 是这条规则的序号,一般规则之间有步长,为以后可能添加的规则预留位置 (source 源地址 反掩码)这里,因为10.0.1.1的掩码是255.255.255.255,所以反掩码为0 进入相应地接口视图,调用规则 现在用10.0.1.1去ping 10.0.2.1 就不通啦 2、高级ACL 如果AR3只是不想让10.0.1.1 ping它,而其他的数据包都可以接收,那么就要用到高级ACL 结果: ping不通。 来源: CSDN 作者: fanf_zhang 链接: https://blog.csdn.net/flyfish5/article/details/50224445

命名ACL的基本用法

旧巷老猫 提交于 2019-12-06 09:13:49
实例三:命名标准ACL的基本用法 1.在R1上配置1条静态路由到192.168.100.0/24网络,1条静态路由到192.168.200.0/24网络。 2.在R2上配置1条静态路由到200.200.200.0/24网络。 3.在R2上创建名permit-net100的标准ACL访问控制列表,规则设为:允许192.168.100.0/24网络访问,禁止192.168.200.0/24网络访问,并应用在R2的F0/0的出口方向上。 代码如下: en conf t hostname R1 interface f0/0 ip address 200.200.200.254 255.255.255.0 no shutdown exit interface f0/1 ip address 192.168.12.1 255.255.255.0 no shutdown exit ip route 192.168.100.0 255.255.255.0 f0/1 ip route 192.168.200.0 255.255.255.0 f0/1 end en conf t hostname R2 interface f0/0 ip address 192.168.12.2 255.255.255.0 no shutdown exit interface f0/1 ip address 192

标准ACL的基本用法

狂风中的少年 提交于 2019-12-06 09:13:40
实例一:标准ACL的基本用法 1.限制PC1访问服务器 2.访问控制列表应用在R2的S0/2/0的in方向 代码如下: R1配置 en conf t hostname R1 int f0/0 ip address 192.168.1.254 255.255.255.0 no shutdown exit int f0/1 ip address 192.168.2.254 255.255.255.0 no shutdown exit int s0/2/0 ip address 192.168.3.254 255.255.255.0 no shutdown clock rate 64000 exit router rip version 2 network 192.168.1.0 network 192.168.2.0 network 192.168.3.0 exit end R2配置 en conf t hostname R2 int s0/2/0 ip address 192.168.3.253 255.255.255.0 ip access-group 101 in no shutdown exit int f0/0 ip address 192.168.4.254 255.255.255.0 no shutdown exit access-list 1 deny 192.168

Check if Port is open on Android/Java

人盡茶涼 提交于 2019-12-06 09:11:12
问题 I would like to check if a port is open, or a server is running on it. I already tried it in multiple ways, like with "/system/bin/ping" and "InetAdress", but if im right I cant ping a specified port with these :/ This time i made it with the idea DatagramSockets like so: try { String messageStr="Hello!"; int server_port = 25565; DatagramSocket s = new DatagramSocket(); InetAddress local = InetAddress.getByName("11.11.11.11"); int msg_length=messageStr.length(); byte[] message = messageStr