#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/ioctl.h> #include <net/if.h> #include <arpa/inet.h> #include <linux/netlink.h> #include <linux/rtnetlink.h> …
linux下的ioctl函数原型如下: #include <sys/ioctl.h> int ioctl(int handle, int cmd, [int *argc, int argv]) 函数成功返回0,失败返回-1. 其相关命令接口如下: 类别 Request 说明 数据类型 套 接 口 SIOCATMARK SIOCSPGRP SIOCGPGRP 是否位于带外标记 设置套接口的进程ID 或进程组ID 获取套接口的进程ID 或进程组ID int int int 文 件 FIONBIO…
Linux下Wireshark普通用户不能获取网络接口问题 1.安装setcap, setcap 是libcap2-bin包的一部分,一般来说,这个包默认会已经装好. sudo apt-get install libcap2-bin 2.创建Wireshark组.这一步在安装Wireshark的时候,也会完成 sudo groupadd wireshark sudo gpasswd -a yoso wireshark //yoso是用户名 sudo chgrp wireshark /usr/bi…
linux下的CPU.内存.IO.网络的压力测试  要远程测试其实很简单了,把结果放到一个微服务里直接在web里查看就可以了,或者同步到其他服务器上 一.对CPU进行简单测试: 1.通过bc命令计算特别函数 例:计算圆周率 echo "scale=5000; 4*a(1)" | bc -l -q MATH LIBRARY        If bc is invoked with the -l option, a math library is preloaded and the def…
linux下的CPU.内存.IO.网络的压力测试 https://www.cnblogs.com/zhuochong/p/10185881.html 一.对CPU进行简单测试: 1.通过bc命令计算特别函数 例:计算圆周率 echo "scale=5000; 4*a(1)" | bc -l -q MATH LIBRARY        If bc is invoked with the -l option, a math library is preloaded and the def…
linux下生成core dump文件方法及设置    from:http://www.cppblog.com/kongque/archive/2011/03/07/141262.html core dump的概念: A core dump is the recorded state of the working memory of a computer program at a specific time, generally when the program has terminated a…
详解Linux下iptables中的DNAT与SNAT设置 这篇文章主要介绍了Linux下iptables中的DNAT与SNAT设置,是Linux网络配置中的基础知识,需要的朋友可以参考下   原文连接:http://www.jb51.net/LINUXjishu/402441.html DNAT(Destination Network Address Translation,目的地址转换) 通常被叫做目的映谢.而SNAT(Source Network Address Translation,源…
 Linux下Tomcat端口.进程以及防火墙设置 1,查看tomcat进程: #ps -aux | grep tomcat(或者ps -ef | grep tomcat都行) 可以看到现在运行着两个tomcat进程,一个进程的pid为9974,另一个pid为23422.  2,根据进程查看端口号: #sudo netstat -naop | grep 23422 这是查看pid为23422的进程占用的端口号: 可以看到9300和9399端口号被占用,其中9399是tomact Server的S…
转: Linux下同时启动两个Tomcat进行设置 解压tar.gz:tar -zxvf apache-tomcat-6.0.41.tar.gz 至相应的路径下,可解压至两个不同的路径或者相同的路径下不同的文件夹,不需要安装,直接部署程序即可. 接下来修改tomcat文件夹conf目录下的server.xml文件: <Server port="8015" shutdown="SHUTDOWN">     <!--APR library loader…
获取本机网络信息 在pro文件中加入如下代码 QT += network widget.h中的代码如下 #ifndef WIDGET_H #define WIDGET_H #include <QWidget> #include <QLabel> #include <QPushButton> #include <QLineEdit> #include <QGridLayout> #include <QMessageBox> #inclu…