int getWifiClient(void* data)
{
int ret = 0, i = 0;
FILE *pp = NULL;
char cmd[512] = { 0 };
char range_num[16] = { 0 };
// char tmp_hostname[32] = { 0 };
char tmp_ip[32] = { 0 };
char tmp_mac[32] = { 0 };
xmlDocPtr doc=NULL;
xmlChar *xmlBuf=NULL;
actionPar par;
pthread_mutex_lock(&locker);
par = *(actionPar *)data;
pthread_cond_signal(&cond);
pthread_mutex_unlock(&locker);
snprintf(cmd, sizeof(cmd), "iw dev %s station dump | grep Station | cut -f 2 -s -d" " | wc -l", gs_wifi_ifname);
pp = popen(cmd, "r");
if (NULL != pp) {
while (NULL != fgets(range_num, sizeof(range_num), pp)) {
if (range_num[strlen(range_num) - 1] == '\n')
range_num[strlen(range_num) - 1] = '\0';
}
pclose(pp);
pp = NULL;
}
do{
if(0!=xmlCreateInMemory(&doc,&xmlBuf,"network")){
ret=-1;
break;
}
for(i=0; i
bzero(&cmd, sizeof(cmd));
snprintf(cmd, sizeof(cmd), "iw dev %s station dump | grep Station | cut -f 2 -s -d" " | head -n %d | tail -n 1", gs_wifi_ifname,i);
pp = popen(cmd, "r");
if (NULL != pp) {
while (NULL != fgets(tmp_mac, sizeof(tmp_mac), pp)) {
if (tmp_mac[strlen(tmp_mac) - 1] == '\n')
tmp_mac[strlen(tmp_mac) - 1] = '\0';
}
pclose(pp);
pp = NULL;
}
if(0!=addValueByPathKey(&xmlBuf,doc,"/network/mac",tmp_mac)){
ret=-1;
break;
}
bzero(&cmd, sizeof(cmd));
// snprintf(cmd, sizeof(cmd), "", "/config/dnsmasq/dnsmasq.leases", tmp_mac);
pp = popen(cmd, "r");
if (NULL != pp) {
while (NULL != fgets(tmp_ip, sizeof(tmp_ip), pp)) {
if (tmp_ip[strlen(tmp_ip) - 1] == '\n')
tmp_ip[strlen(tmp_ip) - 1] = '\0';
}
pclose(pp);
pp = NULL;
}
if(0!=addValueByPathKey(&xmlBuf,doc,"/network/ip",tmp_ip)){
ret=-1;
break;
}
}
if(-1==ret){
sendWifiErrNo(par.sockFd,ret);
}else{
ret=sendData(par.sockFd,xmlBuf,strlen(xmlBuf));
if(-1==ret){
break;
}
}
}while(0);
if(NULL !=xmlBuf){
xmlFree(xmlBuf);
}
if(NULL!=doc){
xmlFreeDoc(doc);
}
return ret;
}
nt32_t wifi_config(void)
{
int i = 0;
char if_name[64] = { 0 };
char wifi_num[64] = { 0 };
char wifi_passwd[64] = { 0 };
char tmp[1024] = { 0 };
char res[1024] = { 0 };
char cmd[1024] = { 0 };
FILE *pp = NULL;
FILE *pp_iw = NULL;
mask_ctrl_c();
wifi_config:
pp = popen("/software/bin/net-hardware", "r");
if (pp == NULL) {
SendOneLine("popen Err");
return 0;
}
while (NULL != (fgets(if_name, sizeof(if_name), pp))) {
if (if_name[strlen(if_name) - 1] == '\n')
if_name[strlen(if_name) - 1] = '\0';
bzero(&cmd, sizeof(cmd));
snprintf(cmd, sizeof(cmd),
"iwconfig %s 2>/dev/null | wc -l", if_name);
pp_iw = popen(cmd, "r");
if (pp_iw == NULL) {
SendOneLine("popen Err");
if (pp != NULL) {
pclose(pp);
}
return 0;
}
if (NULL != (fgets(res, sizeof(res), pp_iw))) {
if (pp_iw != NULL) {
pclose(pp_iw);
}
if ('0' != res[0]) {
wifi_show(if_name);
break;
}
}
else
{
if (pp_iw != NULL) {
pclose(pp_iw);
}
}
}
if (pp != NULL) {
pclose(pp);
}
for (i = 0; i < 100; i++) {
if (0 == strlen(wifi_scan[i])) {
break;
}
}
input_wifi_num:
SendString("WIFI num :");
get_input(wifi_num, sizeof(wifi_num));
if(!strcmp(wifi_num, "q"))
return 0;
if (0 != regexMatch(REG_NUM,wifi_num)) {
SendOneLine("Input Err!");
goto input_wifi_num;
}
if (wifi_num[0] == '0') {
goto wifi_config;
}
if (atoi(wifi_num) > (i - 1)) {
SendOneLine("no find WIFI !");
goto input_wifi_num;
}
snprintf(tmp, sizeof(tmp),
"Current WIFI : %s\n", wifi_scan[atoi(wifi_num)]);
SendOneLine(tmp);
input_wifi_passwd:
SendString("WIFI passwd :");
get_input(wifi_passwd, sizeof(wifi_passwd));
if(!strcmp(wifi_passwd, "q"))
return 0;
if (0 != regexMatch(REG_STR,wifi_passwd)) {
SendOneLine("Input Err!");
goto input_wifi_passwd;
}
if (0 != access(WIFI_CONFIG_PATH, W_OK)) {
snprintf(cmd, sizeof(cmd),
"mkdir -p %s", WIFI_CONFIG_PATH);
system(cmd);
}
bzero(&cmd, sizeof(cmd));
snprintf(cmd, sizeof(cmd),
"cp %s %s -rf", WIFI_DEFAULT_CONFIG, WIFI_CONFIG);
system(cmd);
bzero(&cmd, sizeof(cmd));
snprintf(cmd, sizeof(cmd),
"sed -i -e'5c\\ ssid=%s' %s",
wifi_scan[atoi(wifi_num)], WIFI_CONFIG);
system(cmd);
bzero(&cmd, sizeof(cmd));
snprintf(cmd, sizeof(cmd),
"sed -i -e'6c\\ psk=\"%s\"' %s",
wifi_passwd, WIFI_CONFIG);
system(cmd);
system("kill -9 `ps -ef | grep wpa_supplicant.conf | grep -v grep | awk '{print $2}'` 2>/dev/null");
bzero(&cmd, sizeof(cmd));
snprintf(cmd, sizeof(cmd),
"wpa_supplicant -B -c%s -i%s", WIFI_CONFIG, wifi_scan[0]);
system(cmd);
xmlDocPtr doc = xmlReadFile(SYSTEM_CONFIG, NULL, XML_PARSE_NOBLANKS);
if (NULL == doc) {
printf("Open %s Err\n",SYSTEM_CONFIG);
goto err;
}
xmlChar * xmlBuff = NULL;
delXmlNode(&xmlBuff,doc,"/root/network/wifi");
if (0 != setValueByPathKey(&xmlBuff,doc,"/root/network/wifi/status", "1")){
printf("set Value Err[1]\n");
goto err;
}
if (0 != setValueByPathKey(&xmlBuff,doc,"/root/network/wifi/ifName", wifi_scan[0])){
printf("set Value Err[1]\n");
goto err;
}
xmlSaveFormatFile (SYSTEM_CONFIG, doc, 1);
if (NULL != xmlBuff) {
xmlFree(xmlBuff);
}
if (NULL != doc) {
xmlFreeDoc(doc);
}
err:
return 0;
}
int32_t wifi_set(void)
{
int8_t tp[10] = {0};
int res;
char cmd[1024] = { 0 };
char tmp[64] = { 0 };
char ifName[64] = { 0 };
mask_ctrl_c();
retry:
SendString("1.ON\t\t2.OFF\n");
SendString(get_prompt());
if (get_input(tp, sizeof(tp)))
goto retry;
switch(state_parse(tp))
{
case S_LETTER:
if('q' == tolower(*tp))
return 0;
default:
SendOneLine("Input error, please input again");
goto retry;
case S_DIGIT1:
case S_DIGIT2:
res = atoi(tp);
if (1!= res && 2 != res){
SendOneLine("Input error, please input again");
goto retry;
}
break;
}
xmlDocPtr doc = xmlReadFile(SYSTEM_CONFIG, NULL, XML_PARSE_NOBLANKS);
if (NULL == doc) {
printf("Open %s Err\n",SYSTEM_CONFIG);
return 0;
}
getValueByPathKey(doc, "/root/network/wifi/status", tmp, sizeof(tmp));
getValueByPathKey(doc, "/root/network/wifi/ifName", ifName, sizeof(ifName));
if (0 == atoi(tmp) && (0 == strlen(ifName))) {
SendString("No WIFI Config !");
return 0;
}
if (res == 1) {
if (1 == atoi(tmp) && (0 != strlen(ifName))) {
system("kill -9 `ps -ef | grep wpa_supplicant.conf | grep -v grep | awk '{print $2}'` 2>/dev/null");
}
snprintf(cmd, sizeof(cmd),
"wpa_supplicant -B -c%s -i%s", WIFI_CONFIG, ifName);
system(cmd);
} else if (res == 2) {
system("kill -9 `ps -ef | grep wpa_supplicant.conf | grep -v grep | awk '{print $2}'` 2>/dev/null");
snprintf(cmd, sizeof(cmd),
"ifconfig %s down", ifName);
system(cmd);
bzero(&cmd, sizeof(cmd));
snprintf(cmd, sizeof(cmd),
"ifconfig %s up", ifName);
system(cmd);
}
xmlChar * xmlBuff = NULL;
delXmlNode(&xmlBuff,doc,"/root/network/wifi");
snprintf(tmp, sizeof(tmp), "%d", !(res - 1));
if (0 != setValueByPathKey(&xmlBuff,doc,"/root/network/wifi/status", tmp)){
printf("set Value Err[1]\n");
return 0;
}
if (0 != setValueByPathKey(&xmlBuff,doc,"/root/network/wifi/ifName", ifName)){
printf("set Value Err[1]\n");
return 0;
}
xmlSaveFormatFile (SYSTEM_CONFIG, doc, 1);
if (NULL != xmlBuff) {
xmlFree(xmlBuff);
}
if (NULL != doc) {
xmlFreeDoc(doc);
}
SendString("success !");
return 0;
}
int32_t route_show(void)
{
System("route");
return 0;
}
1##################################################################################################################################
wpa_supplicant.conf Wpa_supplicant是linux系统下一个非常强大的无线网卡管理程序
使用心得一
编译完成后可以发现有几个可执行程序:wpa_supplicant,wpa_cli等。wpa_supplicant是核心程序,它和wpa_cli的关系就是服务和客户端的关系:后台运行wpa_supplicant,可以使用wpa_cli来搜索、设置、和连接网络等,大部分情况下编辑好配置文件,运行wpa_supplicant就可以连通网络了,创建一个wpa_supplicant.conf,键入以下内容:
#可有可无,没有的话无法用wpa_cli terminate来关闭wpa_supplicant
ctrl_interface=/var/run/wpa_supplicant
# 确保只有root用户能读取WPA的配置,可有可无,尤其是在嵌入式设备上
ctrl_interface_group=0
# 使用wpa_supplicant来扫描和选择AP,也可以设置成0或2,但只有1才能正确工作
ap_scan=1
network={
#AP的名字
ssid="my_network"
#AP的key
psk="my_key"
} 配置文件弄好后就可以运行wpa_supplicant了。在那之前当然要先插好无线网卡,载入驱动:------------------------------------------------------
bash# insmod zd1211b.ko
bash# ifconfig eth1 up
bash# wpa_supplicant -B -ieth1 -Dzydas -c/etc/wpa_supplicant.conf
参数-B代表后台运行,-ieth1代表使用设备eth1,-Dzydas代表网卡芯片是zydas,-c指定配置文件。
接下来就可以看下网络是否连通了:
bash# iwconfig
bash# udhcpc -i eth1 -n
zd1211b的驱动使用wpa_supplicant来配置的时候会有隔段时间就锁死系统一会的情况,很奇怪。
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
使用心得二
wpa_supplicant的使用主要是配置wpa_supplicant.conf,以下是一个配置文件的例子:
#可有可无,没有的话无法用wpa_cli terminate来关闭wpa_supplicant
ctrl_interface=/var/run/wpa_supplicant
# 确保只有root用户能读取WPA的配置,可有可无,尤其是在嵌入式设备上
ctrl_interface_group=0
# 使用wpa_supplicant来扫描和选择AP,也可以设置成0或2,但只有1才能正确工作
ap_scan=1
network={
#AP的名字
ssid="my_network"
#AP的key
psk="my_key"
}
配置文件弄好后就可以运行wpa_supplicant了:
wpa_supplicant–B –i wlan0 –c /etc/tkip.conf
后台运行wpa_supplicant(自动打开wifi模块wlan0,自动搜索AP并连接),参数-B为后台运行,-i为wifi设备,-c指定wpa_supplicant配置文件
wlan0自动获取IP:
udhcpc–i wlan0
接下来就可以看下网络是否连通了:
iwconfig
udhcpc -i wlan0 -n
2####################################################################################################################################################
popen() 函数通过创建一个管道,调用 fork 产生一个子进程,执行一个 shell 以运行命令来开启一个进程。这个进程必须由 pclose() 函数关闭,而不是 fclose() 函数。pclose() 函数关闭标准 I/O 流,等待命令执行结束,然后返回 shell 的终止状态。如果 shell 不能被执行,则 pclose() 返回的终止状态与 shell 已执行 exit 一样。
3#########################################################################################################################################################
在第一次使用TortoiseSVN从服务器CheckOut的时候,会要求输入用户名和密码,这时输入框下面有个选项是保存认证信息,如果选了这个选项,那么以后就不用每次都输入一遍用户名密码了。
不过,如果后来在服务器端修改了用户名密码,则再次检出时就会出错,而且这个客户端很弱智,出错之后不会自动跳出用户名密码输入框让人更新,我找了半天也没找到修改这个用户名密码的地方。
最终,找到两种解决办法:
办法一:在TortoiseSVN的设置对话框中,选择“已保存数据”,在“认证数据”那一行点击“清除”按钮,清楚保存的认证数据,再检出的时候就会重新跳出用户名密码输入框。
如果方法一不起作用,则可以采用方法二:
Tortoise的用户名密码等认证信息都是缓存在客户端文件系统的这个目录:
C:/Documents and Settings/Administrator/Application Data/Subversion/auth
删除auth下面的所有文件夹,重新连接远程服务器进行检出,对话框就会出现!
摘自http://hi.baidu.com/buzzguo/blog/item/4a568e156445ae04972b43d4.html
4#####################################################################################################################################################
wpa_supplicant移植与使用
http://blog.csdn.net/wesleyluo/article/details/8104665
http://blog.csdn.net/wesleyluo/article/details/8104564
5#######################################################################################################################################################
ftp://192.168.27.6/rom/rom_7015/
取rom版本
6###################################################################################################################################################
svn 软件查看版本:
7###############################################################################################################################################
共享文件夹
\\192.168.27.5\zhulg\trunk\vetrix_1.5\kernel_48\net\ethernet
8###########################################################################################################################################
windows下cmd执行net use * /del /y 清除原始网络连接记录
smbd -s 配置文件
9#####################################################################################################################################################
zip unzip解压
insmode , modprobe , scp , core文件生成 , debug打印 , 有设备IP地址了,可以通过ssh连接; UNAME -A
10#################################################################################################################################################
三次握手 分片 kvm的cpu配置 ftp的使用 可以尝试anonymous作为用户名以及使用空密码:
wireless-tool工具移植 http://blog.csdn.net/jk110333/article/details/8658054
wifi驱动移植 http://blog.csdn.net/mrjy1475726263/article/details/8886939
modprobe -r iwlwifi--重要 其实是先删除
modprobe iwlwifi
ubuntu 14.04 linux下wifi驱动安装使用的一些笔记 http://blog.csdn.net/subfate/article/details/51954826 http://www.cnblogs.com/dongc/p/5750639.html
百度 wifi驱动安装/lib/firmware
驱动固件下载
wpa-supplicant移植 cp defconfig .config--重要操作
up无线网卡接口 http://www.cnblogs.com/lxmwb/p/5144363.html
ip link set wlp9s0 up##############################
ip addr del 192.168.0.1 dev eth0 鸟叔的私房菜:
[root@admin network-scripts]# ifconfig em4 down #先停止
[root@admin network-scripts]# ip link set em4 name eth4 #在修改名字
搜索:
grep network . -r -n
hostapd http://blog.csdn.net/yyplc/article/details/7301974 http://blog.csdn.net/qq_20448859/article/details/54131187
make make install cp default .config vi .config # make
linux系统里的VI是编辑文本的命令,在vi里查找相应关键字的方法为:
1./关键字 ,回车即可。此为从文档当前位置向下查找关键字,按n键查找关键字下一个位搜索置;
2.?关键字,回车即可。此为从文档挡圈位置向上查找关键字,按n键向上查找关键字;
本周工作:
1. 等保工具箱:WIFI模块无线网卡安装,网卡驱动安装,WIFI功能开发; http://lib.csdn.net/article/embeddeddevelopment/61024 http://lib.csdn.net/article/embeddeddevelopment/61024
2. 学习系统启动流程,页面基本操作;
3. 学习KVM基础知识;
下周工作:
1. 等保工具箱:WIFI功能调研开发,dhcpd功能移植;
2. 继续学习KVM;
hostapd各参数含义:
http://laoding.blog.51cto.com/980622/1697015
设置概要:
ssid: 设置名字(SSID = service set identifier) ,老版本(iwconfig)叫"essid".
hw_mode: 设置操作mode,channels.有效的值取决于硬件,通常:a, b, g
channel:设置hostapd操作的channel.
ssid很容易配置..
hw_mode需要你的硬件支持.'g'大多数都支持, 并向前兼容802.11b..
channel应该与其他AP被选择在 20mhz (4 channels)之外,或者每边10mhz (2 channels).这就意味着一个在channel 3的一个AP将干涉channel 1或者channel 5的AP.选择一个channel.通常用户的APs默认channel 6, 因此你使用channel 1或channel 11大多数情况下最佳. channels也依赖于本地规则.
这里要注意的是,如果网卡工作在5G下,虽然根据802.11a的标准,5G下的信道从60到165之间有许多许多,而使用iwlist查询到的网卡信息也说明网卡支持这些信道,但也许channel配置项只能写149以上的值。因为我国的5G信道只允许使用149以上的信道。
2 hwmode:工作在什么标准下
hwmode和channel是对应的,例如,如果channel是149,意味着网卡工作在5G下,那么hwmode不能写11g,因为11g标准定义的通信频率是不包含5G的,只有11a才可以。
hwmode的值不能乱写(这也是我今天才知道的)。合法的值有:11a 11b 11g 11na 11ng等。使用其他奇怪的值,也许在网卡服务启动的时候内核不会complain,也许网络服务开启后,并非不能正常地部署好AP,但配置也许是错误的:在我的实验中,我需要将AP配置到11n下,但由于把hwmode的值写成了11an,结果并未如我所愿,网卡其实工作在了11a标准下,此时虽然可以建立AP,可以ping通,但是11n并未启用,不符合我的需求。
原因可以用下面这段shell来说明。在解析配置文件的时候,是下面代码中第8行开始的这段case代码来解析的,从前往后依次尝试匹配11bg、11a、11b、11g,然后是11n*(也就是11na、11ng),然后是其他(用$default作为hwmode的值)。
在设备里查看:移植到开发环境里install_root目录
[root@localhost ~]# cd /
[root@localhost /]#
[root@localhost /]# ls usr/lib/libiw.so.29
usr/lib/libiw.so.29
[root@localhost /]# ls usr/sbin/iwconfig
usr/sbin/iwconfig
[root@localhost /]# ls usr/sbin/iwlist
usr/sbin/iwlist
[root@localhost /]# ls usr/sbin/wpa_supplicant
usr/sbin/wpa_supplicant
[root@localhost /]# ls usr/sbin/hostapd
usr/sbin/hostapd
[root@localhost /]#
[root@localhost /]#
该问题主要是因为无线数据传输校验中随机种子数较少导致的无线网络数据传输时延过大导致的,
用户可以通过命令cat /proc/sys/kernel/random/entropy_avail来查看具体数值,该值一般小于1000,
用户需要通过在终端中执行yum install haveged命令安装随机数生成器(haveged),
并使用systemctl enable haveged.servce命令来启动随机数生成器(haveged)已提高entropy_avail数值。这样无线网络时延将恢复到正常状态。网络不在出现以上描述的问题。
# mv /dev/random /dev/random.org
# ln -s /dev/urandom /dev/random
haveged 生成随机数
加不进br0时:
iw dev wlan0 set 4addr on
iptables -P INPUT ACCEPT
[root@localhost openSource]# cp dnsmasq-2.75/
Android.mk CHANGELOG contrib/ COPYING-v3 dnsmasq.conf.example FAQ Makefile po/ src/ VERSION
bld/ CHANGELOG.archive COPYING dbus/ doc.html logo/ man/ setup.html trust-anchors.conf
[root@localhost openSource]# cp -r dnsmasq-2.75/ ../../vetrix_1.5/openSource/
[root@localhost openSource]#
切换到12.04下之后通过apt-get install uuid-dev安装uuid之后,之前的代码中的uuid_generate,uuid_unparse函数在新的库中不存在了(和10.04中的uuid-dev不是同一个包),导致链接失败。
为了不改动原有自己已写好的程序,只有找原先的uuid lib。解决方案如下:
在中下载到util-linux_2.20.1.orig.tar.gz包,里面包含很多系统工具的目录,如包含libuuid目录。使用下面的方法安装uuid库(包括静态lib文件及动态链接文件):
tar xzvf util-linux_2.20.1.orig.tar.gz
cd util-linux-2.20.1
./configure --without-ncurses
cd libuuid
make
make install
iwlist wlp9s0 scanning | grep ESSID | awk -F ':' '{print $2}'
"kill -9 `ps -ef | grep wpa_supplicant.conf | grep -v grep | awk '{print $2}'` 2>/dev/null" ------------------------杀进程
"sed -i -e'5c\\ ssid=%s' %s", wifi_scan[atoi(wifi_num)], WIFI_CONFIG); -------------------------------替换配置文件内容
iwlist channel 2>/dev/null | grep Channel | awk '{print $2}' ------------------------------------获取信道编号
iwlist channel 2>/dev/null | grep Channel | awk '{print $2}' | wc -l---------------------------------32
iwlist channel 2>/dev/null | grep Channel | awk '{print $2}' | head -n 4 | tail -n 1-------------------
iwconfig wlp9s0 | grep IEEE | awk -F '802.11' '{print $2}' | awk '{print $1}' ------------------------获取无线工作模式
cat /etc/hostapd.conf | grep 'ssid=' | grep -v '#'| grep -v 'ignore'| awk -F 'ssid=' '{print $2}' 2>/dev/null 从文件hostapd.conf中获取内容
void get_interface_rx(char *if_name, char *buf, int buf_len)
{
FILE *pp = NULL;
char cmd[512] = { 0 };
snprintf(cmd, sizeof(cmd),
"cat /proc/net/dev | grep %s | awk '{print $2}'", if_name);
pp = popen(cmd, "r");
if (NULL != pp) {
while (NULL != fgets(buf, buf_len, pp)) {
if (buf[strlen(buf) - 1] == '\n')
buf[strlen(buf) - 1] = '\0';
}
pclose(pp);
}
}
vi命令:
5yy 复制五行
注意:编译环境应与设备环境(硬件)一致;
[root@localhost zlg]# cat /proc/cpuinfo |grep flags
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt xsaveopt xsavec xgetbv1
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt xsaveopt xsavec xgetbv1
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt xsaveopt xsavec xgetbv1
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt xsaveopt xsavec xgetbv1
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt xsaveopt xsavec xgetbv1
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt xsaveopt xsavec xgetbv1
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt xsaveopt xsavec xgetbv1
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt xsaveopt xsavec xgetbv1
[root@localhost zlg]#
[root@localhost /]# cat /proc/cpuinfo | grep glags
[root@localhost /]# cat /proc/cpuinfo | grep flags
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt xsaveopt xsavec xgetbv1
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt xsaveopt xsavec xgetbv1
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt xsaveopt xsavec xgetbv1
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt xsaveopt xsavec xgetbv1
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt xsaveopt xsavec xgetbv1
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt xsaveopt xsavec xgetbv1
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt xsaveopt xsavec xgetbv1
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt xsaveopt xsavec xgetbv1
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt xsaveopt xsavec xgetbv1
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt xsaveopt xsavec xgetbv1
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt xsaveopt xsavec xgetbv1
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt xsaveopt xsavec xgetbv1
[root@localhost /]#
KVM的基础知识:
什么叫KVM;
KVM的基本架构是什么样的;
KVM的开发工具;
虚拟化,安全产品虚拟化的含义;
hypervisior vmm
KVM的一些属性(高级配置):cpu配置;内存配置;VT-d SR-IOV技术;-------------设备直接分配给客户机;
存储配置,镜像,qemu-img -hda file fdisk -l free
KSM mmap fork写时拷贝
virtio架构 半虚拟化驱动
软件虚拟化,硬件虚拟化
svn ci a.txt -m "commit log"
[root@localhost /]# hostapd -B etc/hostapd.conf
Configuration file: etc/hostapd.conf
wlp9s0: IEEE 802.11 Configured channel (140) not found from the channel list of current mode (2) IEEE 802.11a
wlp9s0: IEEE 802.11 Hardware does not support configured channel
Could not select hw_mode and channel. (-3)
wlp9s0: interface state UNINITIALIZED->DISABLED
wlp9s0: AP-DISABLED
wlp9s0: Unable to setup interface.
wlp9s0: interface state DISABLED->DISABLED
wlp9s0: AP-DISABLED
hostapd_free_hapd_data: Interface wlp9s0 wasn't started
nl80211: deinit ifname=wlp9s0 disabled_11b_rates=0
[root@localhost /]#
[root@localhost /]#
[root@localhost /]# hostapd -B etc/hostapd.conf
Configuration file: etc/hostapd.conf
Line 138: unknown hw_mode 'n'
HT (IEEE 802.11n) in 11b mode is not allowed, disabling HT capabilities
1 errors found in configuration file 'etc/hostapd.conf'
Failed to set up interface with etc/hostapd.conf
Failed to initialize interface
[root@localhost /]#
[root@localhost /]#
wifi信道的知识:
http://blog.csdn.net/briant_ccj/article/details/50493872
http://blog.csdn.net/briant_ccj/article/details/50493872
可以看到,在2.4GHz频段,我国所提供的可用信道还是非常丰富的,在2.412-2.472GHz,共有13个信道可供选择。
再来看看5GHz频段,包含5150MHz-5825MHz的无线电频段,一共拥有201个信道,但能用的确实不多,特别是在我国,仅有5个信道(149,153,157,161,165)可用。考虑到信道就是无线数据的传输通道,也就是说,在人员密集的情况下,5个信道的体验效果肯定会受影响;不过目前来看,支持5GHz频段的设备并不多,因此目前还看不到影响(未来或许也会开放更多信道)。
iw工具下载与安装
http://blog.csdn.net/lidroid/article/details/46725675
intel 5G无线不支持 intel无线讨论论坛
获取连接到我的wifi上的设备的信息
[root@localhost /]#
[root@localhost /]# ./iw dev wlp9s0 station dump
Station b8:81:98:03:e8:be (on wlp9s0)
inactive time: 129 ms
rx bytes: 97131
rx packets: 749
tx bytes: 1648
tx packets: 13
tx retries: 2
tx failed: 0
beacon loss: 0
signal: -42 [-61, -42] dBm
signal avg: -42 [-61, -42] dBm
tx bitrate: 1.0 MBit/s
rx bitrate: 24.0 MBit/s
authorized: yes
authenticated: yes
associated: yes
preamble: long
WMM/WME: yes
MFP: no
TDLS peer: no
DTIM period: 2
beacon interval:100
short slot time:yes
connected time: 124 seconds
[root@localhost /]#
[root@localhost /]#
echo b8:81:98:03:e8:be >> /etc/hostapd.deny
b8:81:98:03:e8:be (on wlp9s0)
linux 重定向 >> > 追加 删除追加 more
连接到wifi上的设备:找mac,找ip地址
./iw dev wlp9s0 station dump | grep Station | awk '{print $2}'
arp -a | grep b8:81:98:03:e8:be | awk -F '(' '{print $2}' | awk -F ')' '{print $1}'-------------------------------替换为从dnsmasq的lease文件上读取
工具箱镜像位置
ftp://192.168.27.6/market/standard/xds-tb/
[root@localhost /]# tail -n +8 dhcpd.leases|less|awk 'BEGIN{RS=ORS="}"}{print $2,$21,"\n"}'|sed 's/}//g' | grep 00:17:a4:3a:8f:9e | awk '{print $1}'
192.168.20.242
cat > /etc/config/show_wifi_clients.sh << "EOF_DOCUMENT"
#!/bin/sh
# /etc/config/show_wifi_clients.sh
# Shows MAC, IP address and any hostname info for all connected wifi devices
# written for openwrt 12.09 Attitude Adjustment
echo "# All connected wifi devices, with IP address,"
echo "# hostname (if available), and MAC address."
echo -e "# IP address\tname\tMAC address"
# list all wireless network interfaces
# (for MAC80211 driver; see wiki article for alternative commands)
for interface in `iw dev | grep Interface | cut -f 2 -s -d" "`
do
# for each interface, get mac addresses of connected stations/clients
maclist=`iw dev $interface station dump | grep Station | cut -f 2 -s -d" "`
# for each mac address in that list...
for mac in $maclist
do
# If a DHCP lease has been given out by dnsmasq,
# save it.
ip="UNKN"
host=""
ip=`cat /tmp/dhcp.leases | cut -f 2,3,4 -s -d" " | grep $mac | cut -f 2 -s -d" "`
host=`cat /tmp/dhcp.leases | cut -f 2,3,4 -s -d" " | grep $mac | cut -f 3 -s -d" "`
# ... show the mac address:
echo -e "$ip\t$host\t$mac"
done
done
EOF_DOCUMENT
1、电脑的硬盘如果安装系统以后,想用到另一台电脑启动,多数情况是不允许的。这是因为一个主板对系统安装都是有识别记忆功能,只有同型号主板或者型号相近的主板可以成功启动,否则都是被拒绝的。
如何添加Samba用户
Window系统连上我们的开发机Linux,自然需要在Samba里添加一个新用户。
linux-06bq:/usr/local/services/samba/bin # ./smbpasswd -a sunjing
New SMB password:
Retype new SMB password:
Failed to add entry for user sunjing.
百度给出的结论是”添加的Samba用户首先必须是Linux用户”,一下子豁朗开郎。
linux-06bq:/etc/samba # useradd sunjing
linux-06bq:/usr/local/services/samba/bin # ./smbpasswd -a sunjing
New SMB password:
Retype new SMB password:
Added user sunjing.
[root@localhost sql]# smbpasswd -a root samba登不上执行一下这个
New SMB password:
Retype new SMB password:
[root@localhost sql]#
[root@localhost sql]#
vi /etc/resolv.conf
创建DNS解析服务器
# Generated by NetworkManager
nameserver 114.114.114.114-------------------------------------------------------------------------------------------------------------------
nameserver 8.8.8.8----------------------------------------------------------------------------------------------------------------------
百度搜索 yum 源
163 yum源
[root@localhost /]# yum install gcc
Loaded plugins: langpacks
One of the configured repositories failed (Fedora 21 - x86_64),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Disable the repository, so yum won't use it by default. Yum will then
just ignore the repository until you permanently enable it again or use
--enablerepo for temporary usage:
yum-config-manager --disable fedora
4. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=fedora.skip_if_unavailable=true
Cannot retrieve metalink for repository: fedora/21/x86_64. Please verify its path and try again
[root@localhost /]# cd /etc/yum
yum/ yum.repos.d/
[root@localhost /]# cd /etc/yum.repos.d/---------------------------------------------------------------------------------------------
[root@localhost yum.repos.d]# ls
fedora.repo fedora-updates.repo fedora-updates-testing.repo
[root@localhost yum.repos.d]# wget
--2017-09-20 22:52:43--
Resolving mirrors.163.com (mirrors.163.com)... failed: Name or service not known.
wget: unable to resolve host address ‘mirrors.163.com’
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# ping
ping: unknown host
[root@localhost yum.repos.d]# ping 192.168.27.5
PING 192.168.27.5 (192.168.27.5) 56(84) bytes of data.
64 bytes from 192.168.27.5: icmp_seq=1 ttl=64 time=0.519 ms
64 bytes from 192.168.27.5: icmp_seq=2 ttl=64 time=0.259 ms
^C
--- 192.168.27.5 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.259/0.389/0.519/0.130 ms
[root@localhost yum.repos.d]# vi /etc/r
rc0.d/ rc2.d/ rc4.d/ rc6.d/ reader.conf.d/ request-key.conf rmt rpc rsyncd.conf rsyslog.d/ rwtab.d/
rc1.d/ rc3.d/ rc5.d/ rc.d/ redhat-release request-key.d/ rolekit/ rpm/ rsyslog.conf rwtab
[root@localhost yum.repos.d]# vi /etc/re
reader.conf.d/ redhat-release request-key.conf request-key.d/
[root@localhost yum.repos.d]# vi /etc/re
reader.conf.d/ redhat-release request-key.conf request-key.d/
[root@localhost yum.repos.d]# vi /etc/resolv.cnf
[root@localhost yum.repos.d]# ping 192.168.27.5
PING 192.168.27.5 (192.168.27.5) 56(84) bytes of data.
64 bytes from 192.168.27.5: icmp_seq=1 ttl=64 time=0.445 ms
^C
--- 192.168.27.5 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.445/0.445/0.445/0.000 ms
[root@localhost yum.repos.d]# route add default gw 192.168.27.1----------------------------------------------------添加路由
[root@localhost yum.repos.d]# ping
ping: unknown host --------------------------------------------------------------------------------DNS解析有问题
[root@localhost yum.repos.d]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.27.1 0.0.0.0 UG 0 0 0 enp1s0
default 192.168.27.1 0.0.0.0 UG 1024 0 0 enp1s0
192.168.27.0 0.0.0.0 255.255.255.0 U 0 0 0 enp1s0
[root@localhost yum.repos.d]# ping 192.168.27.5
PING 192.168.27.5 (192.168.27.5) 56(84) bytes of data.
64 bytes from 192.168.27.5: icmp_seq=1 ttl=64 time=0.293 ms
64 bytes from 192.168.27.5: icmp_seq=2 ttl=64 time=0.253 ms
^C
--- 192.168.27.5 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.253/0.273/0.293/0.020 ms
[root@localhost yum.repos.d]# vi /etc/resolv.conf-------------------------------------------------------------------------------------------------------
[root@localhost yum.repos.d]# ping
PING 1stcncloud163.xdwscache.ourwebpic.com (101.227.175.217) 56(84) bytes of data.
64 bytes from 101.227.175.217: icmp_seq=1 ttl=54 time=29.3 ms
64 bytes from 101.227.175.217: icmp_seq=2 ttl=54 time=29.9 ms
^C
--- 1stcncloud163.xdwscache.ourwebpic.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 29.338/29.653/29.968/0.315 ms
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# wget ----------------------------------------------------------------
--2017-09-20 22:57:41--
Resolving mirrors.163.com (mirrors.163.com)... 123.58.190.234, 123.58.190.235, 123.58.190.236, ...
Connecting to mirrors.163.com (mirrors.163.com)|123.58.190.234|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1108 (1.1K) [application/octet-stream]
Saving to: ‘fedora-163.repo’
100%[======================================================================================================================================================================================>] 1,108 --.-K/s in 0s
2017-09-20 22:57:41 (11.4 MB/s) - ‘fedora-163.repo’ saved [1108/1108]
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# ls
fedora-163.repo fedora.repo fedora-updates.repo fedora-updates-testing.repo
[root@localhost yum.repos.d]# yum clean all-------------------------------------------------------------------------------------------
Loaded plugins: langpacks
Repository fedora is listed more than once in the configuration
Repository fedora-debuginfo is listed more than once in the configuration
Repository fedora-source is listed more than once in the configuration
Cleaning repos: fedora updates
Cleaning up everything
[root@localhost yum.repos.d]# yum makecache------------------------------------------------------------------- ---------------------
Loaded plugins: langpacks
Repository fedora is listed more than once in the configuration
Repository fedora-debuginfo is listed more than once in the configuration
Repository fedora-source is listed more than once in the configuration
fedora/21/x86_64/metalink | 3.0 kB 00:00:00
[Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
fedora | 3.8 kB 00:00:00
updates/21/x86_64/metalink | 3.1 kB 00:00:00
updates | 4.7 kB 00:00:00
(1/10): fedora/21/x86_64/group_gz | 232 kB 00:00:00
(2/10): updates/21/x86_64/group_gz | 230 kB 00:00:00
(3/10): updates/21/x86_64/updateinfo | 1.1 MB 00:00:07
(4/10): updates/21/x86_64/prestodelta | 2.1 MB 00:01:04
(5/10): fedora/21/x86_64/other_db | 7.7 MB 00:01:47
(6/10): updates/21/x86_64/other_db | 3.1 MB 00:00:41
(7/10): updates/21/x86_64/primary_db | 8.4 MB 00:02:21
(8/10): updates/21/x86_64/filelists_db | 12 MB 00:10:07
(9/10): fedora/21/x86_64/primary_db | 17 MB 00:13:19
(10/10): fedora/21/x86_64/filelists_db | 25 MB 00:17:53
Metadata Cache Created
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# cd ..
[root@localhost etc]# ls
abrt cifs-utils dnsmasq.d groff issue.net mailcap oddjob popt.d rolekit sos.conf udisks2
adjtime cockpit dracut.conf group jwhois.conf mail.rc oddjobd.conf ppp rpc ssh updatedb.conf
aliases cron.d dracut.conf.d group- kdump.conf makedumpfile.conf.sample oddjobd.conf.d prelink.conf.d rpm ssl usb_modeswitch.conf
alternatives cron.daily dumpdates grub2.cfg kernel man_db.conf openldap printcap rsyncd.conf ssmtp usb_modeswitch.d
anacrontab cron.deny e2fsck.conf grub.d krb5.conf mcelog openlmi profile rsyslog.conf sssd vconsole.conf
at.deny cron.hourly environment gshadow ld.so.cache mime.types opt profile.d rsyslog.d statetab virc
audisp cron.monthly ethertypes gshadow- ld.so.conf mke2fs.conf os-release protocols rwtab statetab.d wgetrc
audit crontab exports gss ld.so.conf.d modprobe.d PackageKit rc0.d rwtab.d stunnel X11
autofs.conf cron.weekly exports.d gssproxy lftp.conf modules-load.d pam.d rc1.d samba sudoers xattr.conf
autofs_ldap_auth.conf crypto-policies favicon.png host.conf libaudit.conf motd pam_pkcs11 rc2.d sasl2 sudoers.d xdg
auto.master crypttab fedora-release hostname libnl mtab passwd rc3.d security sysconfig xinetd.d
auto.master.d csh.cshrc filesystems hosts libreport multipath passwd- rc4.d selinux sysctl.conf yum
auto.misc csh.login firewalld hosts.allow libuser.conf nanorc passwdqc.conf rc5.d services sysctl.d yum.conf
auto.net dbus-1 fonts hosts.deny locale.conf netconfig pcmcia rc6.d sestatus.conf systemd yum.repos.d
auto.smb default fprintd.conf idmapd.conf localtime NetworkManager Pegasus rc.d setuptool.d system-release
avahi depmod.d fstab init.d login.defs networks pinforc reader.conf.d shadow system-release-cpe
bash_completion.d dhcp gcrypt inittab logrotate.conf nfsmount.conf pkcs11 redhat-release shadow- tcsd.conf
bashrc DIR_COLORS gdbinit inputrc logrotate.d nsswitch.conf pki request-key.conf shells terminfo
binfmt.d DIR_COLORS.256color gdbinit.d ipa lvm nsswitch.conf.bak plymouth request-key.d skel tmpfiles.d
certmonger DIR_COLORS.lightbgcolor gnupg iproute2 machine-id ntp pm resolv.conf slp.conf trusted-key.key
chkconfig.d dnsmasq.conf GREP_COLORS issue magic ntp.conf polkit-1 rmt smartmontools udev
[root@localhost etc]# cd yum.repos.d/
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
安装GCC
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# yum -y install gcc
安装 autoconf automake
yum -y install gcc gcc-c++ autoconf automake 单独整
yum -y install autoconf automake
yum -y install subversion
yum –y install libglib2.0-dev
编译QEMU时需要
yum install glib 不用加-y Loaded plugins: langpacks
yum install glib2-devel
重新安装libxml2和libxml2-devel包
yum install libxml2
yum install libxml2-devel -y
yum install ant
yum install pixman-devel.x86_64
yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
yum -y install samba
yum install openssl-devel
yum install glibc-static
yum install -y mysql-server mysql
yum install -y mysql-devel ---------------还要加上cp /lib64/mysql/libmysqlclient.* /usr/lib64
yum install -y popt-devel
yum install -y libvirt-devel
yum install -y libuuid-devel
yum install -y uuid-devel
yum install libtool
install libsysfs-dev
include lib bin 3.18.24
/usr/bin/ld: cannot find -lzmq
/usr/bin/ld: cannot find -lRockeyARM
[root@localhost /]# vi /etc/resolv.conf
[root@localhost /]#
[root@localhost /]#
[root@localhost /]#
[root@localhost /]#
[root@localhost /]#
[root@localhost /]#
[root@localhost /]#
[root@localhost /]# ping
ping: unknown host
[root@localhost /]#
[root@localhost /]#
[root@localhost /]# ip route show
192.168.27.0/24 dev enp1s0 proto kernel scope link src 192.168.27.132
[root@localhost /]#
[root@localhost /]#
[root@localhost /]# route add default gw 192.168.27.1
[root@localhost /]# ip route show
default via 192.168.27.1 dev enp1s0
default via 192.168.27.1 dev enp1s0 proto static metric 1024
192.168.27.0/24 dev enp1s0 proto kernel scope link src 192.168.27.132
[root@localhost /]#
[root@localhost /]#
[root@localhost /]# ping
PING 1stcncloud163.xdwscache.ourwebpic.com (101.227.175.217) 56(84) bytes of data.
64 bytes from 101.227.175.217: icmp_seq=1 ttl=55 time=29.1 ms
64 bytes from 101.227.175.217: icmp_seq=2 ttl=55 time=28.7 ms
64 bytes from 101.227.175.217: icmp_seq=3 ttl=55 time=29.2 ms
^C
--- 1stcncloud163.xdwscache.ourwebpic.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 28.724/29.031/29.222/0.219 ms
[root@localhost /]#
[root@localhost /]#
[root@localhost /]#
[root@localhost /]#
[root@localhost /]#
[root@localhost /]#
[jifeng@jifeng01 ~]$ ssh-copy-id -i ~/.ssh/id_rsa.pub jifeng@jifeng03
28
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
5f:20:1a:77:96:99:4a:f2:5d:a1:1d:68:b6:91:5a:e7.
Please contact your system administrator.
Add correct host key in /home/jifeng/.ssh/known_hosts to get rid of this message.
Offending key in /home/jifeng/.ssh/known_hosts:2
RSA host key for jifeng03 has changed and you have requested strict checking.
Host key verification failed.
[root@localhost local]# cd ~
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# cd .ssh/
[root@localhost .ssh]# ls
known_hosts
[root@localhost .ssh]#
[root@localhost .ssh]#
[root@localhost .ssh]# vi known_hosts 删除ssh记录
[root@localhost .ssh]#
[root@localhost .ssh]#
[root@localhost .ssh]#
[root@localhost /]# service sshd stop
Redirecting to /bin/systemctl stop sshd.service
[root@localhost /]# service sshd start
Redirecting to /bin/systemctl start sshd.service
[root@localhost /]#
[root@localhost /]#
[root@localhost /]#
[root@localhost /]#
[root@localhost /]#
[root@localhost /]#
[root@localhost /]#
[root@localhost /]#
[root@localhost /]# ps aux | grep sshd
root 1032 0.0 0.0 140432 3496 ? Ss 01:10 0:51 sshd: root@pts/0,pts/1,pts/2
root 12898 0.0 0.0 113000 2340 pts/0 S+ 19:56 0:00 grep --color=auto sshd
[root@localhost /]#
[root@localhost /]#
[root@localhost /]#
[root@localhost /]#
[root@localhost /]# us
usb-devices usb_modeswitch useradd userhelper usernetctl usleep
usbhid-dump usb_modeswitch_dispatcher userdel usermod users
[root@localhost /]# /usr/sbin/sshd
[root@localhost /]#
[root@localhost /]#
[root@localhost /]# ps aux | grep sshd
root 1032 0.0 0.0 140432 3496 ? Ss 01:10 0:51 sshd: root@pts/0,pts/1,pts/2
root 15741 0.0 0.0 83068 2512 ? Ss 19:58 0:00 /usr/sbin/sshd
root 15817 0.0 0.0 113000 2288 pts/0 S+ 19:58 0:00 grep --color=auto sshd
[root@localhost /]#
$ mv -vn /lib/* /lib/ 不覆盖导入
libvirt编译安装错误提示及解决方法(2012-11-27 09:18:06)转载▼标签: 杂谈 分类: Linux学习
(1)
checking libxml2 xml2-config >= 2.6.0 ... configure: error: Could not find libxml2 anywhere (see config.log for details).
#apt-cache search libxml2
# apt-get install libxml++2.6-2
# apt-get install libxml++2.6-dev
(2)
configure: error: You must install the GnuTLS library in order to compile and run libvirt
# apt-get install gnutls-bin(可省)
# apt-get install libgnutls-dev
(3)
configure: error: You must install device-mapper-devel/libdevmapper >= 1.0.0 to compile libvirt
# apt-get install libdevmapper-dev libdevmapper
(4)
configure: error: libnl-devel >= 1.1 is required for macvtap support
# apt-get install libnl-dev
(5)
# ./configure --prefix=/usr --libdir=/usr/lib64 --localstatedir=/var --sysconfdir=/etc --with-hal=yes --with-udev=yes
checking for UDEV... no
configure: error: You must install libudev-devel >= 145 to compile libvirt
# apt-cache search libudev-dev
libudev-dev - libudev development files
# apt-get install libudev-dev
(6)
configure: error: You must install libpciaccess-devel >= 0.10.0 to compile libvirt
# apt-cache search libpciaccess-dev
libpciaccess-dev - Generic PCI access library for X - development files
# apt-get install libpciaccess-dev
(7)
configure: error: You must install python-devel to build Python bindings
sudo apt-get install python-dev
注:有时依然不能用virsh nodedev-dumpxml pci_0000_00_19_0
#./configure --prefix=/usr --libdir=/usr/lib64 --localstatedir=/var --sysconfdir=/etc --with-hal=yes --with-udev=yes --with-polkit=yes
....
checking for POLKIT... no
configure: error: You must install PolicyKit >= 0.6 to compile libvirt
# apt-get install libpolkit-agent-1-0 libpolkit-backend-1-0 libpolkit-gobject-1-0 libpolkit-gtk-1-0
ssh连接失败
[root@localhost /]#
[root@localhost /]#
[root@localhost /]#
[root@localhost /]#
[root@localhost /]# scp -v /usr/sbin/smbd root@192.168.27.132:/
Executing: program /usr/bin/ssh host 192.168.27.132, user root, command scp -v -t /
OpenSSH_6.6.1, OpenSSL 1.0.1k-fips 8 Jan 2015
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for *
debug1: Connecting to 192.168.27.132 [192.168.27.132] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1
ssh_exchange_identification: read: Connection reset by peer
lost connection
[root@localhost /]#
[root@localhost /]#
[root@localhost /]# scp -v /usr/sbin/smbd root@192.168.27.132:/
Executing: program /usr/bin/ssh host 192.168.27.132, user root, command scp -v -t /
OpenSSH_6.6.1, OpenSSL 1.0.1k-fips 8 Jan 2015
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for *
debug1: Connecting to 192.168.27.132 [192.168.27.132] port 22.
debug1: connect to address 192.168.27.132 port 22: Connection refused
ssh: connect to host 192.168.27.132 port 22: Connection refused
lost connection
[root@localhost /]# /usr/bin/ssh
前提是,你的smb.conf配置没有错误。你再看一下有没有启动smb,network服务?或者,你有没有把你的linux防火墙关掉?删除你的iptables的防火墙规则:
iptables -F
再使一下。
[root@localhost samba]#
[root@localhost samba]#
[root@localhost samba]# pdbedit -a root 另外增加samba账户密码的方法
new password:
retype new password:
Unix username: root
NT username:
Account Flags: [U ]
User SID: S-1-5-21-1054802581-2998188271-1527530512-1000
Primary Group SID: S-1-5-21-1054802581-2998188271-1527530512-513
Full Name: root
Home Directory: \\localhost\root
HomeDir Drive:
Logon Script:
Profile Path: \\localhost\root\profile
Domain: LOCALHOST
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: Thu, 07 Feb 2036 00:06:39 KST
Kickoff time: Thu, 07 Feb 2036 00:06:39 KST
Password last set: Thu, 21 Sep 2017 23:19:39 KST
Password can change: Thu, 21 Sep 2017 23:19:39 KST
Password must change: never
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
[root@localhost samba]#
对比链接库关系,确认并不是完全拷过来的,又安装了一次
[root@localhost usr]#
[root@localhost usr]# cd /usr/lib64
[root@localhost lib64]# ls -l |grep zmq
-rw-r--r-- 1 root root 15683994 12月 1 2016 libzmq.a
-rwxr-xr-x 1 root root 945 12月 1 2016 libzmq.la
lrwxrwxrwx 1 root root 15 12月 5 2016 libzmq.so -> libzmq.so.5.0.0
lrwxrwxrwx 1 root root 15 12月 5 2016 libzmq.so.5 -> libzmq.so.5.0.0
-rwxr-xr-x 1 root root 5614430 12月 1 2016 libzmq.so.5.0.0
[root@localhost lib64]#
[root@localhost lib64]#
将rom文件提交到27。6服务器上--------------------------------------------------------------------------和 yum install expect
[root@localhost build]# ./putrom.exp vetrix_11114.rom
spawn ftp 192.168.27.6
Connected to 192.168.27.6 (192.168.27.6).
220 Welcome to Vetrix FTP server
Name (192.168.27.6:root): cmo
331 Please specify the password.
Password:
230-Vetrix Public FTP Server
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> prom
Interactive mode off.
ftp> bin
200 Switching to Binary mode.
ftp> cd /rom/rom_7015
250 Directory successfully changed.
ftp> mput vetrix_11114.rom
local: vetrix_11114.rom remote: vetrix_11114.rom
227 Entering Passive Mode (192,168,27,6,81,153).
150 Ok to send data.
226 File receive OK.
565435344 bytes sent in 47.6 secs (11873.02 Kbytes/sec)
ftp> by
221 Goodbye.
[root@localhost build]# vi putrom.exp
[root@localhost build]#
[root@localhost build]#
[root@localhost build]# vi putrom.exp
[root@localhost build]#
[root@localhost build]#
把rom文件封装成iso镜像文件---------------------------------------------------------------------------其中装了两个yum install mkisofs
[root@localhost vetrix_1.5]#
[root@localhost vetrix_1.5]# ls
build engineSrc install_root kernel_48 openSource rootfs tools webSrc
[root@localhost vetrix_1.5]# cd tools/
[root@localhost tools]# ls
dtool
[root@localhost tools]# cd dtool/
[root@localhost dtool]# ls
mkdvd.sh putiso.exp Vetrix-DVD-x86_64 Vetrix-DVD-x86_64-7015_11104.iso
[root@localhost dtool]# cd Vetrix-DVD-x86_64/
[root@localhost Vetrix-DVD-x86_64]# ls
isolinux market vetrix_11104.rom
[root@localhost Vetrix-DVD-x86_64]# --------------------------------------------------------------然后把rom文件拷贝到这里
[root@localhost Vetrix-DVD-x86_64]# cd ..
[root@localhost dtool]# ls
mkdvd.sh putiso.exp Vetrix-DVD-x86_64 Vetrix-DVD-x86_64-7015_11104.iso
[root@localhost dtool]# ------------------------------------------------------------------------------最后执行mkdvd。sh
[root@localhost build]#
[root@localhost build]# ./cleanrom.sh 执行脚本删除rom文件,后make去编译
hostname - 用以显示或设置系统的主机名称。[1]
/wifi/status
/wifi/ssid
/wifi/password
/wifi/broadcastFlag
/wifi/channel
/wifi/hwmode
/wifi/bandwidth
ctrl + alt +. 重启
yum -y install gcc
wget
xz -d dnsmasq-2.76.tar.xz
tar xvf dnsmasq-2.76.tar
cd dnsmasq-2.76
make install
制作iso可启动U盘,用ULtraISO软件:打开iso文件(可替换rom文件)然后启动写入硬盘映像,ok
安装vetrix系统:响了之后按delete键(进不去修改putty的115200)进入bios(应该插上U盘自己进啊),配置pcI里面的SR-IOV(enable了)然后选择usb重启,就开始安装vetrix系统了,
adm admin@8888,格式化---------就可以按照文档来了;(把显示器键盘都插到设备上)
int getWifiChannel(void* data)
{
int ret = 0, i = 0;
FILE *pp = NULL;
char cmd[512] = { 0 };
char range_num[16] = { 0 };
char tmp[16] = { 0 };
// int range[48] = { 0 };
snprintf(cmd, sizeof(cmd), "iwlist channel 2>/dev/null | grep Channel | awk '{print $2}' | wc -l");
pp = popen(cmd, "r");
if (NULL != pp) {
while (NULL != fgets(range_num, sizeof(range_num), pp)) {
if (range_num[strlen(range_num) - 1] == '\n')
range_num[strlen(range_num) - 1] = '\0';
}
pclose(pp);
pp = NULL;
}
for(i=0; i
bzero(&cmd, sizeof(cmd));
snprintf(cmd, sizeof(cmd), "iwlist channel 2>/dev/null | grep Channel | awk '{print $2}' | head -n %d | tail -n 1", i);
pp = popen(cmd, "r");
if (NULL != pp) {
while (NULL != fgets(tmp, sizeof(tmp), pp)) {
if (tmp[strlen(tmp) - 1] == '\n')
tmp[strlen(tmp) - 1] = '\0';
}
pclose(pp);
pp = NULL;
}
// range[i] = atoi(tmp);
}
return ret;
}
int getWifiMode(void* data)
{
int ret = 0;
FILE *pp = NULL;
char cmd[512] = { 0 };
char tmp[16] = { 0 };
char *mode = NULL;
snprintf(cmd, sizeof(cmd), "iwconfig %s | grep IEEE | awk -F '802.11' '{print $2}' | awk '{print $1}'", gs_wifi_ifname);
pp = popen(cmd, "r");
if (NULL != pp) {
while (NULL != fgets(tmp, sizeof(tmp), pp)) {
if (tmp[strlen(tmp) - 1] == '\n')
tmp[strlen(tmp) - 1] = '\0';
}
pclose(pp);
pp = NULL;
}
mode = tmp;
while(*mode != '\0')
{
// *mode;
mode++;
}
return ret;
}
BIOS里面把 VT-D (该选项需要硬件厂商在BIOS里面加上)打开,然后重启即可了。
Makefile: autoscan configure—scan configgure—in aclocal aclocal.m4 makefile.am automake
autoconf configure makefile.in makefile
debug打印:-------------------------------------------------------------------------------------------------------------------------
[root@localhost /]# cd disk/
[root@localhost disk]# ls
disk_system
[root@localhost disk]# cd disk_system/
[root@localhost disk_system]# ls
export import log mirror Syslog tomcat vm vmInfo
[root@localhost disk_system]#
[root@localhost disk_system]# cd log/
[root@localhost log]# ls
update.log vetrixLogLocal0-20171001 vetrixLogLocal6-20171001 web.log.2017-09-26 web.log.2017-09-28 web.log.2017-09-30 web.log.2017-10-10
vetrixLogLocal0 vetrixLogLocal6 web.log web.log.2017-09-27 web.log.2017-09-29 web.log.2017-10-09 web.log.2017-10-11
[root@localhost log]# cat vetrixLogLocal0
Oct 9 17:24:22 localhost license: msg=虚机申请授权码 product=IDS ip=127.0.0.1
Oct 9 17:27:23 localhost license: msg=虚机申请授权码 product=IDS ip=127.0.0.1
Oct 12 10:37:55 localhost system: 系统被重启
Oct 12 10:39:02 localhost network: 创建桥[br0]
Oct 12 10:39:03 localhost network: 创建桥[br0]成功
Oct 12 10:39:03 localhost network: 创建桥[br1]
Oct 12 10:39:03 localhost network: 创建桥[br1]成功
Oct 12 10:39:03 localhost network: 修改桥[br0]下接口为[Eth0]
Oct 12 10:39:03 localhost network: 修改桥[br0]接口为[Eth0]成功
Oct 12 10:39:03 localhost network: 配置接口[br0]主ip地址192.168.27.87/24
Oct 12 10:39:03 localhost network: 配置接口[br0]ip地址成功
Oct 12 14:16:02 localhost network: 添加DNS地址成功
Oct 12 14:16:29 localhost network: 编辑DNS地址成功
Oct 12 14:16:45 localhost network: 删除DNS地址成功
Oct 12 14:17:08 localhost network: 编辑DNS地址成功
Oct 12 14:17:22 localhost network: 删除DNS地址成功
Oct 12 14:31:25 localhost network: dhcp服务已开启
Oct 12 14:31:25 localhost network: 修改DNS成功
Oct 12 14:32:17 localhost network: dhcp服务已关闭
Oct 12 14:33:03 localhost network: dhcp服务已开启
Oct 12 14:33:03 localhost network: 修改DNS成功
Oct 12 14:34:08 localhost network: dhcp服务已关闭
[root@localhost log]#
[root@localhost log]#
[root@localhost log]# de
deallocvt debug debugfs declare delpart depmod
[root@localhost log]# debug virt show
current debug status: off
[root@localhost log]# debug virt on
[root@localhost log]#
[root@localhost log]# tail -f vetrixLogLocal0
Oct 12 14:16:29 localhost network: 编辑DNS地址成功
Oct 12 14:16:45 localhost network: 删除DNS地址成功
Oct 12 14:17:08 localhost network: 编辑DNS地址成功
Oct 12 14:17:22 localhost network: 删除DNS地址成功
Oct 12 14:31:25 localhost network: dhcp服务已开启
Oct 12 14:31:25 localhost network: 修改DNS成功
Oct 12 14:32:17 localhost network: dhcp服务已关闭
Oct 12 14:33:03 localhost network: dhcp服务已开启
Oct 12 14:33:03 localhost network: 修改DNS成功
Oct 12 14:34:08 localhost network: dhcp服务已关闭
Oct 12 16:19:40 localhost license: ROCKEY-ARM not found, Dongle_Enum(1) = F0000001
数据库开关:
设备上把防火墙关上
[root@localhost log]# iptables -P INPUT ACCEPT
[root@localhost /]# iptables -L -------------------------------------------------------------查看iptables规则
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT all -- anywhere anywhere
VETRIX_FIREWALL_INPUT all -- anywhere anywhere
Chain FORWARD (policy ACCEPT)
target prot opt source destination
VETRIX_POLICY all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain VETRIX_FIREWALL_INPUT (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere multiport dports 8006,ndmp,safetynetp,40001,40002,40003,40004,40011
ACCEPT udp -- anywhere anywhere multiport dports 40010
VETRIX_FIREWALL_INPUT_br0 all -- anywhere anywhere
Chain VETRIX_FIREWALL_INPUT_br0 (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT icmp -- anywhere anywhere icmp echo-request
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp dpt:hbci
Chain VETRIX_POLICY (1 references)
target prot opt source destination
[root@localhost /]#
替换文件:
[root@localhost engineSrc]# scp virt/main/virt root@192.168.27.87:~/
root@192.168.27.87's password:
virt 100% 1874KB 1.8MB/s 00:00
[root@localhost engineSrc]#
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# systemctl stop virtd
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# mv virt /software/bin/
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# systemctl start virtd
[root@localhost ~]#
[root@localhost ~]#
[root@localhost log]# cd ~/
[root@localhost ~]# systemctl stop virtd
[root@localhost ~]# mv virt /software/bin/
[root@localhost ~]# systemctl start virtd
[root@localhost ~]#
debug打印,文件替换,xml格式,数据库查看,makefile生成,
能ping通 登不上页面netstat查看 ip后加端口号:8088
A能ping通B,B不能ping通A,把A的防火墙关掉 iptables -P INPUT ACCEPT
bin程序打包(边文斌)制作市场镜像,创建虚拟机,科莱打包工具发送报文
创建虚拟机:是不是分引擎与数据两个;硬盘sata 最后配一个名称三个ip,最后一个IP加上https://
I/O透传(VT-D) I/O虚拟化(SR-IOV) 虚拟交换机
C2000不支持vt-d,所以io透传创建虚机失败提示一个宏
笔记本电脑与设备直连验证dnsmasq, 串口直连,有ip直接连接
ipconfig/all
ipconfig/release
ipconfig/renew
term里初始化,清库
命令行下换rom包:
[root@localhost /]# cd config/rom/
[root@localhost rom]#
[root@localhost rom]#
[root@localhost rom]#
[root@localhost rom]#
[root@localhost rom]# wget ftp://192.168.27.29/vetrix_11154.rom ---------------------------------------------------------------
--2017-10-17 20:20:51-- ftp://192.168.27.29/vetrix_11154.rom
=> ‘vetrix_11154.rom’
Connecting to 192.168.27.29:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD not needed.
==> SIZE vetrix_11154.rom ... 493422216
==> PASV ... done. ==> RETR vetrix_11154.rom ... done.
Length: 493422216 (471M) (unauthoritative)
vetrix_11154.rom 100%[=================================================================================================================================>] 470.56M 5.35MB/s in 92s
2017-10-17 20:22:23 (5.13 MB/s) - ‘vetrix_11154.rom’ saved [493422216]
[root@localhost rom]# upgrade vetrix_11154.rom
system-B begin upgrade ......
2162978 blocks
system-B upgrade completed !
[root@localhost rom]#
[root@localhost rom]#
[root@localhost /]# cat config/dnsmasq/dnsmasq.leases
1508395794 50:7b:9d:02:1d:23 192.168.27.133 USER-20170421BK 01:50:7b:9d:02:1d:23
通过ip获取hostname
[root@localhost trunk]# cat gethost.c
#include
#include
#include
#include
#include
#include
#include
int main(int argc, char **argv)
{
char *ptr,**pptr;
struct hostent *hptr;
char str[32];
char ipaddr[16];
struct in_addr *hipaddr = (struct in_addr *)malloc(sizeof(struct in_addr));
ptr = argv[1];
printf("0:%s\n",ptr);
if(!inet_aton(ptr,hipaddr))
{
printf("error1\n");
return 1;
}
if( (hptr = gethostbyaddr(hipaddr,4,AF_INET) ) == NULL)
{
h_errno;
printf("err2 %s\n",ptr);
switch(h_errno)
{
case HOST_NOT_FOUND:printf("111\n");break;
// case NO_ADDRESS:
// case NO_DATA:printf("112\n");break;
// case NO_RECOVERY:printf("113\n");break;
case TRY_AGAIN:printf("115\n");break;
}
return 1;
}
printf("hostname:%s\n",hptr->h_name);
for(pptr = hptr->h_aliases; *pptr != NULL; pptr++ )
printf("%s\n",*pptr);
switch( hptr->h_addrtype)
{
case AF_INET:
case AF_INET6:
pptr = hptr->h_addr_list;
for(;*pptr!=NULL;pptr++)
printf("address:%s\n",inet_ntop(hptr->h_addrtype,*pptr,str,sizeof(str)));
break;
default:
printf("default \n");
break;
}
return 0;
}
[root@localhost trunk]#
---------------------------------------------------------------------------------------------------------------------------------------------------------
configure 先执行一下这个 haveged
make
make install
make clean
---------------------------------------------------------------------------------------------------------------------------------------------------------
迟思堂主人李迟
迟思堂主人李迟
迟思堂主人李迟
迟思堂主人李迟
Anker—工作学习笔记http://www.cnblogs.com/Anker/category/916306.html
迟思堂主人李迟
Anker—工作学习笔记http://www.cnblogs.com/Anker/category/916306.html
迟思堂主人李迟
Anker—工作学习笔记http://www.cnblogs.com/Anker/category/916306.html
迟思堂主人李迟
Anker—工作学习笔记http://www.cnblogs.com/Anker/category/916306.html
迟思堂主人李迟
Anker—工作学习笔记http://www.cnblogs.com/Anker/category/916306.html
迟思堂主人李迟
Anker—工作学习笔记http://www.cnblogs.com/Anker/category/916306.html
迟思堂主人李迟
迟思堂主人李迟
迟思堂主人李迟
-----------------------------------------------------------------------------------------------------------------------------------------------------------
ln -s 建立链接,下面删除链接
rm -rf symbolic_name 注意不是rm -rf symbolic_name/
那么上面我就是rm -rf /local/linkwork
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
[root@localhost /]# lspci--------------------------------------------------------------------------------------
00:00.0 Host bridge: Intel Corporation Atom processor C2000 SoC Transaction Router (rev 02)
00:01.0 PCI bridge: Intel Corporation Atom processor C2000 PCIe Root Port 1 (rev 02)
00:02.0 PCI bridge: Intel Corporation Atom processor C2000 PCIe Root Port 2 (rev 02)
00:03.0 PCI bridge: Intel Corporation Atom processor C2000 PCIe Root Port 3 (rev 02)
00:0b.0 Co-processor: Intel Corporation Atom processor C2000 nCPM (rev 02)
00:0e.0 Host bridge: Intel Corporation Atom processor C2000 RAS (rev 02)
00:0f.0 IOMMU: Intel Corporation Atom processor C2000 RCEC (rev 02)
00:13.0 System peripheral: Intel Corporation Atom processor C2000 SMBus 2.0 (rev 02)
00:14.0 Ethernet controller: Intel Corporation Ethernet Connection I354 (rev 03)
00:14.1 Ethernet controller: Intel Corporation Ethernet Connection I354 1.0 GbE Backplane (rev 03)
00:14.2 Ethernet controller: Intel Corporation Ethernet Connection I354 (rev 03)
00:14.3 Ethernet controller: Intel Corporation Ethernet Connection I354 (rev 03)
00:16.0 USB controller: Intel Corporation Atom processor C2000 USB Enhanced Host Controller (rev 02)
00:17.0 SATA controller: Intel Corporation Atom processor C2000 AHCI SATA2 Controller (rev 02)
00:18.0 SATA controller: Intel Corporation Atom processor C2000 AHCI SATA3 Controller (rev 02)
00:1f.0 ISA bridge: Intel Corporation Atom processor C2000 PCU (rev 02)
00:1f.3 SMBus: Intel Corporation Atom processor C2000 PCU SMBus (rev 02)
02:00.0 Ethernet controller: Marvell Technology Group Ltd. Device 2b38
[root@localhost /]#
[root@localhost /]#
[root@localhost /]# ethtool -i mlan0 -----------------------------------------------------------------------------
driver: wlan_pcie
version:
firmware-version:
bus-info: 0000:02:00.0
supports-statistics: no
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no
[root@localhost /]#
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
添加内存条
用转义字符:\" 字符串中有“”
字符串数组怎么创建 指针数组
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
如何让你的linux程序在后台静默执行?
#!/bin/bash
/usr/local/services/main &
执行脚本:
./run.sh &
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CentOS 7的服务systemctl脚本存放在:/usr/lib/systemd/,有系统(system)和用户(user)之分,需要开机不登陆就能运行的程序,存在系统服务里,即:/usr/lib/systemd/system目录下
每一个服务以.service结尾,一般会分为3部分:[Unit]、[Service]和[Install],我写的这个服务用于开机运行tomcat项目:
[plain] view plain copy
1.vim /usr/lib/systemd/system/tomcat.service
[plain] view plain copy
1.[Unit]
2.Description=tomcatapi
3.After=network.target
4.
5.[Service]
6.Type=forking
7.PIDFile=/usr/local/tomcat/tomcat.pid
8.ExecStart=/usr/local/tomcat/bin/startup.sh
9.ExecReload=
10.ExecStop=/usr/local/tomcat/bin/shutdown.sh
11.PrivateTmp=true
12.
13.[Install]
14.WantedBy=multi-user.target
[Unit]部分主要是对这个服务的说明,内容包括Description和After,Description用于描述服务,After用于描述服务类别;
[Service]部分是服务的关键,是服务的一些具体运行参数的设置,这里Type=forking是后台运行的形式,PIDFile为存放PID的文件路径,ExecStart为服务的运行命令,ExecReload为重启命令,ExecStop为停止命令,PrivateTmp=True表示给服务分配独立的临时空间,注意:[Service]部分的启动、重启、停止命令全部要求使用绝对路径,使用相对路径则会报错;
[Install]部分是服务安装的相关设置,可设置为多用户的
服务脚本按照上面编写完成后,以754的权限保存在/usr/lib/systemd/system目录下,这时就可以利用systemctl进行测试了
最后用以下命令将服务加入开机启动即可:
1.systemctl enable tomcat
sysctl命令
内核与模块管理
sysctl命令被用于在内核运行时动态地修改内核的运行参数,可用的内核参数在目录/proc/sys中。它包含一些TCP/ip堆栈和虚拟内存系统的高级选项, 这可以让有经验的管理员提高引人注目的系统性能。用sysctl可以读取设置超过五百个系统变量。
systemctl 是管制服务的主要工具
设备里查看:
[root@localhost /]#
[root@localhost /]# ls lib/systemd/system/wifi-client.service
lib/systemd/system/wifi-client.service
[root@localhost /]#
[root@localhost /]# ls usr/lib/systemd/system/wifi-client.service
usr/lib/systemd/system/wifi-client.service
[root@localhost /]#
[root@localhost /]# ls software/bin/wifi_client
software/bin/wifi_client
[root@localhost /]#
代码修改rootfs里内容:
[root@localhost /]# ls /lib/systemd/system/winbind.service
/lib/systemd/system/winbind.service
[root@localhost /]#
[Unit]
Description=--wifi--
After=virtd.service
[Service]
ExecStart=/software/bin/wifi_client
Restart=always
[Install]
WantedBy=multi-user.target
~
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
BIOS里boot看不到option 硬盘,换了一根线,就ok了。 115200 9600 delete boot 选择 保存退出
--------------------------------------------------------------------------------------------------------------------------------------------------------------
解决15编译器编译失败问题,cd /usr/local/lib/ ls -alh 与5编译器对比查看链接库的关系并修改;链接到.bak文件
--------------------------------------------------------------------------------------------------------------------------------------------------------------
查询一: SELECT * FROM test WHERE data=NULL
查询二: SELECT * FROM test WHERE data<>NULL
ignore有则忽略 update有则更新
--------------------------------------------------------------------------------------------------------------------------------------------------------
modprobe和insmod类似,都是用来动态加载驱动模块的,区别在于modprobe可以解决load module时的依赖关系,它是通过/lib/modules/#uname -r/modules.dep(.bb)文件来查找依赖关系的;而insmod不能解决依赖问题。
popen与system的区别
wifi引擎:
engineSrc/configure.ac 生成makefile的
engineSrc/virt/Makefile.am 上一级makefile
engineSrc/virt/main/Makefile.am -------------用wifi的东西,链接他的库
svn add 包括:
engineSrc/virt/wifi/Makefile.am
engineSrc/virt/wifi/wifi.c
engineSrc/virt/wifi/wifi.h
wifi客户端:
engineSrc/configure.ac 生成makefile
engineSrc/cli/Makefile.am 上一级makefile
svn add 包括:
engineSrc/cli/wifi_client/Makefile.am ---------------包含需要的库
engineSrc/cli/wifi_client/wifi_client.c
dnsmasq移植:
openSource/Makefile
svn add 添加:
dnsmasq目录
openSource/Makefile
openSource/dnsmasq-2.75
openSource/dnsmasq-2.75/Android.mk
openSource/dnsmasq-2.75/CHANGELOG
openSource/dnsmasq-2.75/CHANGELOG.archive
openSource/dnsmasq-2.75/COPYING
openSource/dnsmasq-2.75/COPYING-v3
openSource/dnsmasq-2.75/FAQ
openSource/dnsmasq-2.75/Makefile
openSource/dnsmasq-2.75/po/es.po
........
openSource/dnsmasq-2.75/src/poll.c
openSource/dnsmasq-2.75/src/rfc2131.c
openSource/dnsmasq-2.75/src/tftp.c
openSource/dnsmasq-2.75/src/util.c
openSource/dnsmasq-2.75/trust-anchors.conf
驱动ko加载:
设备里查看:
[root@localhost /]# ls lib/modules/3.18.48/kernel/drivers/virtio/virtio_
virtio_balloon.ko.xz virtio_mmio.ko.xz
[root@localhost /]# ls lib/modules/3.18.48/kernel/drivers/virtio/
把编译的文件放到这里
[root@localhost wlan_src]# pwd
/home/zhulg/zlg/vetrix_1.5/kernel_48/drivers/wlan_src
[root@localhost wlan_src]#
要修改的makefile
kernel_48/drivers/Makefile (工作副本)
obj-y += soc/
obj-$(CONFIG_VIRTIO) += virtio/
obj-y += wlan_src/
250多个ip地址,linux的限制
ping 1.1.1.1 -I br1----------------------------------------------------------------------从br1口去ping
i++ 与 ++i的区别
waf:
Web应用防护系统(也称:网站应用级入侵防御系统。英文:Web Application Firewall,简称: WAF)。利用国际上公认的一种说法:Web应用防火墙是通过执行一系列针对HTTP/HTTPS的安全策略来专门为Web应用提供保护的一款产品。
kvm驱动:
[root@localhost kvm]# pwd
/lib/modules/3.18.48/kernel/arch/x86/kvm
[root@localhost kvm]# ls
kvm-amd.ko.xz kvm-intel.ko.xz kvm.ko.xz
[root@localhost kvm]#
[root@localhost openvswitch]# lsmod | grep kvm
kvm_intel 143293 0
kvm 426536 1 kvm_intel
[root@localhost openvswitch]#
ovs驱动:
[root@localhost openvswitch]# pwd
/lib/modules/3.18.48/kernel/net/openvswitch
[root@localhost openvswitch]# ls
lib openvswitch.ko.xz
[root@localhost openvswitch]#
[root@localhost openvswitch]# lsmod | grep openvswitch
openvswitch 77073 0
geneve 12680 1 openvswitch
gre 12777 1 openvswitch
libcrc32c 12426 1 openvswitch
vxlan 39023 2 ixgbe,openvswitch
[root@localhost openvswitch]#
DPDK驱动多机上才有:
[root@localhost vfio]# pwd
/lib/modules/3.18.48/kernel/drivers/vfio
[root@localhost vfio]# ls
pci vfio_iommu_type1.ko.xz vfio.ko.xz
[root@localhost vfio]# lsmod | grep vfio
vfio_iommu_type1 17118 0
vfio_pci 35526 0
vfio 22412 3 vfio_iommu_type1,vfio_pci
[root@localhost vfio]#
虚拟接口对与命名空间namespace:
ip netns add namespace1
ip netns add namespace2
ip netns list
ip link add vpair1 type veth peer name vpair2
ip link list
ip link set vpair1 netns namespace1
ip link set vpair2 netns namespace2
ip netns exec namespace1 ip link list
ip netns exec namespace2 ip link list
clone flag
pid ipc network
lxc
----------------------------------------------------------------------------------------------------------------------------------------------
dpdk:
VT-D vfio/uio (中断 iommu) iommu cmdline
top %100 轮询
大规模网络数据包
柔性数组成员
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
linux命令---------------- nm lsof 杨叶飞
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[root@localhost /]# ovs-vsctl port-to-br vpair45_1
ovs-vsctl: no port named vpair45_1
[root@localhost /]# ovs-vsctl list-ports vswitch0
[root@localhost /]# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.00900b40ef2b no Eth0
[root@localhost /]#ovs-vsctl --help
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
流表编排:ovs1 --新增---交换机 入接口 指令为接口 出接口-------------单向,再配一条出入接口相反,即成双向;
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
半虚拟化驱动,i/o虚拟化 virtio vhost_net
qemu-kvm /dev/kvm/ ioctl 创建虚机 qemu-kvm进程 调度 共享内核资源 vcpu线程
--------------------------------------------------------------------------------------------------------------------------------------------------------------
venus 硬件码规格:
ProductCode:Vetrix-10000-S1
ProductName:Vetrix安全云管理系统
logo:venus
000101:未知服务器或未知工控机(支持sriov的设备)
000201:未知工控机(不支持sriov的设备)
服务器:
DELL:010101
工控机:
新汉C206: 020201
新汉G850: 020202
立华双路EP:020101
新汉单路EP:020102
该硬件号在/etc/hardware/hardware.config里面
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
badblocks -v /dev/sda1 > sda1.txt ----------------------------查看硬盘损坏,检测读写速率 time dd
&& 条件判断 通配符 * 后台执行 & 管道 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------