#!/bin/sh
# Find ip
IP=`/sbin/ifconfig eth1 | grep 'inet addr' | awk '{ print substr($2, index($2, ":")+1)}'`
#monitor procname scriptname
monitor()
{
procname=$1
scriptname=$2
# Find proc by p...
分类:
Web程序 时间:
2014-10-12 10:46:07
阅读次数:
267
#!/bin/sh
my_ip=`/sbin/ifconfig eth1 | grep 'inet addr' | awk '{print substr($2, index($2, ":")+1)}'`
recv=""
msg="not_existing, restart ..."
MONITOR_LOG="monitor.log"
#monitor procname scriptname...
分类:
系统相关 时间:
2014-10-11 23:25:07
阅读次数:
329
#!/bin/bash
echo "IP:"
ifconfig |grep "inet addr"|grep -v 127.0.0.1|awk '{print $2}'|awk -F ':' '{print $2}'
echo "Product Name:"
dmidecode |grep Name
echo "CPU Info:"
dmidecode |grep -i cpu|grep -i v...
分类:
其他好文 时间:
2014-09-29 14:51:31
阅读次数:
199
客户端每隔8秒钟向服务端建立连接,发送内容之后关闭连接;
服务端不停的接受客户端的连接请求,收到内容之后就打印出来;
客户端从本地文件中读取内容发送给客户端;
客户端代码:client_main.cpp
#include
#include
using namespace std;
#include
#include
#include "ace/INET_Addr...
分类:
其他好文 时间:
2014-09-19 17:39:35
阅读次数:
255
#include "ace/INET_Addr.h"
//"tango.cs.wustl.edu:1234"
//"128.252.166.57:1234"
explicit ACE_INET_Addr (const char address[], int address_family = AF_UNSPEC);
ACE_INET_Addr addr("221.226...
分类:
Web程序 时间:
2014-09-18 16:37:14
阅读次数:
220
普通的UDP组件发送和接收
接收端
//server.cpp
#include
#include
#include
#include
#include
using namespace std;
#include "boost/lexical_cast.hpp"
using namespace boost;
void receive()
{
ACE_INET_Addr p...
分类:
其他好文 时间:
2014-09-17 16:50:52
阅读次数:
192
[root@localhost ~]# ifconfigeth0 Link encap:Ethernet HWaddr 00:0C:29:78:F6:12 inet addr:172.17.4.128 Bcast:172.17.4.255 Mask:255.255....
分类:
系统相关 时间:
2014-09-09 10:42:18
阅读次数:
290
USES_CONVERSION是用来转换类型的,比如我们很常见的问题: 在Socket编程时候,我们的IP地址从界面上输进去一般都使用CString类型的,可是在SOCKADDR_IN中的inet_addr却是const char *我们就不能直接用CString来用。我们就可以使用T2A()宏.....
分类:
其他好文 时间:
2014-09-01 19:04:03
阅读次数:
282
是用于多IP机器上 比如你的机器有三个ip 192.168.1.1 202.202.202.202 61.1.2.3 如果你serv.sin_addr.s_addr=inet_addr("192.168.1.1"); 然后监听100端口 这时其他机器只有connect 192....
分类:
其他好文 时间:
2014-08-27 10:49:17
阅读次数:
176
一 :获取单个网卡的IPv4地址,方法如下:方法一:$/sbin/ifconfig ethX | awk '/inet addr/ {print $2}' | cut -f2 -d ":" 方法二:$/sbin/ifconfig ethX | awk '/inet addr/ {print $2}....
分类:
其他好文 时间:
2014-08-21 19:08:44
阅读次数:
161