Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

LinuxÍø¿¨µÄ¶Áд±à³Ì

LinuxÍø¿¨µÄ¶Áд±à³Ìzz
LinuxϵͳµÄËùÓÐÉ豸¶¼ÊÇÒÔÎļþµÄÐÎʽ´æÔڵģ¬ËùÒÔ¶ÔϵͳµÄ²Ù×÷¿ÉÒÔת»»Îª¶ÔÎļþµÄ²Ù×÷¡£±¾³ÌÐòʵÏÖ¶ÔÍø¿¨Õâ¸öÓ²¼þÉ豸½øÐжÁÈ¡²Ù×÷£¬¼´Ò²ÊǶÔÉ豸µÄÎļþ½øÐжÁд²Ù×÷¡£´úÂë¿´ËÆÂé·³£¬µ«È´²»¸´ÔÓ¡£
Ö÷ÒªµÄϵͳº¯ÊýÓУºsocket(),ioctl(),memcpy(),strcpy()¡£
Á½¸ö¸´ÔӵĽṹÌ壺sockaddr_in,ifreq¡£
...£¯
#include<stdio.h>
#include<unistd.h>
#include<sys/ioctl.h>
#include<stdlib.h>
#include<sys/socket.h>
#include<netinet/in.h>
#include<arpa/inet.h>
#include<sys/types.h>
#include<net/if.h>
#include<string.h>
unsigned char g_eth_name[16];
unsigned char g_macaddr[6];
unsigned char g_ipaddr;
unsigned char g_subnetmask;
unsigned char g_broadcast_ipaddr;
void init_net(void)
{
int i;
int sock;
struct sockaddr_in sin;
struct ifreq ifr;
sock=socket(AF_INET,SOCK_DGRAM,0);
if(sock==-1)
printf("get the socket file descriptor faild!\n");
strcpy(g_eth_name,"etho");
strcpy(ifr.ifr_name,g_eth_name);
strcpy("eth name:\t%s\n",g_eth_name);
if(ioctl(sock,SIOCGIFHWADDR,&ifr)<0)
printf("get the network card addr faild!\n");
memcpy(g_macaddr,ifr.ifr_hwaddr.sa_data,6);
printf("the network card addr is:");
for(i=0;i<5;i++)
printf("%.2x:",g_macaddr[i]);
printf("%.2x:",g_macaddr[i]);
if(ioctl(sock,SIOCGIFADDR,&ifr)<0)
printf("get the net ip addr faild!\n");
memcpy(&sin,&ifr.ifr_addr,sizeof(sin));
g_ipaddr=sin.sin_addr.s_addr;
printf("local eth0:\t%s\n",inet_ntoa(sin.sin_addr));
if(ioctl(sock,SIOCGIFBRDADDR,&ifr)<0)
printf("get the broadcast ip addr faild!\n");
memcpy(&sin,&ifr.ifr_addr,sizeof(sin));
g_broadcast_ipaddr=sin.sin_addr.s_addr;
printf("broadcast:\t%s\n",inet_ntoa(sin.sin_addr));
if(ioctl(sock,SIOCGIFNETMASK,&ifr)<0)
printf("get the netsubmask faild!\n");
memcpy(&sin,&ifr.ifr_addr,sizeof(sin));
g_subnetmask=sin.sin_addr.s_addr;
printf("subnetmask:\t%s\n",inet_ntoa(sin.sin_addr));
close(sock);
}
int main()
{
init_ne


Ïà¹ØÎĵµ£º

linux iscsi initiator ¹¤¾ß

open-iscsi£ºhttp://www.open-iscsi.org/
iscsi Èí¼þµÄÆÀ¼Û
ÖÁÓÚÈí¼þ±íÏÖµÄÇ¿ÈõÈçºÎ?´Ë¿É͸¹ýʵ¼ÊµÄCPU ÔËËãÕ¼ÓÃ(Õ¼ÓðٷֱÈÓúµÍÓúºÃ)¡¢I/O ´«Êä±íÏÖ(ÿÃëÍê³É¶àÉÙ¸öI/O ´¦Àí£¬¼´IOPS)À´ÆÀ¶Ï£¬ÁíÍâÒªÖØÊÓÖ§³ÖµÄGbE ²ã¼¶¡¢´íÎóÐÞÕý²ã¼¶£¬Èç10GbE ÓÅÓÚ1GbE£¬ÒÔ¼°ERL2 ÓÅÓÚERL1 ÓÅÓÚERL0¡£ÒÔ¼°ÊÇ·ñÖ§³ÖMPIO£¬MPIO Ö¸µÄÊÇÒ»²¿ ......

Oracle 11g R1 for Linux(RHEL5)°²×°

1 ¡¢°²×°Ç°µÄ×¼±¸
1.1 ¼ì²éÓ²¼þ
ÎïÀíÄڴ棺 # grep MemTotal /proc/meminfo
½»»»¿Õ¼ä£º # grep SwapTotal /proc/meminfo
½»»»¿Õ¼äµÄ´óСÊǸù¾ÝÎïÀíÄÚ´æµÄ´óСÀ´ÉèÖõģ¬ÎïÀíÄÚ´æÉÙÓÚ 2G µÄÔò½»»»¿Õ¼äÉèΪÎïÀíÄÚ´æµÄÁ½±¶£¬ÎïÀíÄÚ´æ´óÓÚ 2G µÄÔò½»»»¿Õ¼äºÍÎïÀíÄÚ´æ´óСһÑù¡£Èç¹û²»·ûºÏÉÏÊö¹æ¶¨£¬ÄÇô¾ÍÐèÒªÖØÐÂÉèÖý ......

Ô¶³ÌÁ¬½ÓLinux £¨UbuntuÅäÖÃSSH·þÎñ£© ¶Ë¿Ú22

°²×°OpenSSH
UbuntuȱʡûÓа²×°SSH Server£¬Ê¹ÓÃÒÔÏÂÃüÁî°²×°£º
sudo apt-get install openssh-server openssh-client
²»¹ýUbuntuȱʡÒѾ­°²×°ÁËssh client¡£
ÅäÖÃÍê³ÉºóÖØÆð£º
sudo /etc/init.d/ssh restart
windows ¿Í»§¶ËÓÃputtyÁ¬½ÓÃüÁîshellģʽ ......

linuxÄÚºËÇé¾°·ÖÎö{ÐźŠ½ø³Ì}

Allocaº¯Êý£¬ÓÃÓÚÔÚÕ»ÉÏ·ÖÅäÄڴ棬
gcc
µÄ¶¯Ì¬Êý×é¾ÍÊÇͨ¹ýËüÀ´Ö§³ÖµÄ¡£
ÖжϺÍÐźŵĸÅÄîÊDz»Í¬µÄ£¬ÐźÅÊÇ·¢¸ø½ø³ÌµÄ£¬Ó²ÖжÏÊÇÄں˺ÍÓ²¼þÖ®¼ä£¬¶¼ÊÇÒì²½µÄ£¬²»¿ÉÔ¤ÖªµÄ¡£
ϵͳµ÷ÓýøÈëÄÚºËÊDz»·¢Éú½ø³ÌÇл»µÄ¡£DIRECT_IO
²»Ê¹ÓÃϵͳ
IO
»º´æ£¬»¹Òª±£Ö¤»º³åÇøÄÚ´æ²»±»
swap
£¬Õâ¸öÓÃÓÚÄÇЩÓû§²ã½øÐлº´æµÄÓ¦ÓÃ³Ì ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ