Linux ×Ô¼ìºÍ SystemTap
SystemTap ÊǼà¿ØºÍ¸ú×ÙÔËÐÐÖÐµÄ Linux Äں˵IJÙ×÷µÄ¶¯Ì¬·½·¨¡£Õâ¾ä»°µÄ¹Ø¼ü´ÊÊǶ¯Ì¬£¬ÒòΪ SystemTap ûÓÐʹÓù¤¾ß¹¹½¨Ò»¸öÌØÊâµÄÄںˣ¬¶øÊÇÔÊÐíÄúÔÚÔËÐÐʱ¶¯Ì¬µØ°²×°¸Ã¹¤¾ß¡£Ëüͨ¹ýÒ»¸öÃûΪKprobes µÄÓ¦Óñà³Ì½Ó¿Ú£¨API£©À´ÊµÏÖ¸ÃÄ¿µÄ£¬±¾ÎĽ«Ì½Ë÷Õâ¸ö API¡£ÎÒÃÇÊ×ÏÈÁ˽âÒÔÇ°µÄһЩÄں˸ú×Ù·½·¨£¬È»ºóÔÚÉîÈë̽ÌÖ SystemTap µÄ¼Ü¹¹¼°ÆäʹÓá£
Äں˸ú×Ù
SystemTap ÓëÒ»ÖÖÃûΪ DTrace µÄÀϼ¼ÊõÏàËÆ£¬¸Ã¼¼ÊõÔ´ÓÚ Sun Solaris ²Ù×÷ϵͳ¡£ÔÚ DTrace ÖУ¬¿ª·¢ÈËÔ±¿ÉÒÔÓà D ±à³ÌÓïÑÔ£¨C ÓïÑÔµÄ×Ó¼¯£¬µ«ÐÞ¸ÄΪ֧³Ö¸ú×ÙÐÐΪ£©±àд½Å±¾¡£DTrace ½Å±¾°üº¬Ðí¶à̽ÕëºÍÏà¹ØÁªµÄ²Ù×÷£¬ÕâЩ²Ù×÷ÔÚ̽Õë “´¥·¢” ʱ·¢Éú¡£ÀýÈ磬̽Õë¿ÉÒÔ±íʾ¼òµ¥µÄϵͳµ÷Óã¬Ò²¿ÉÒÔ±íʾ¸ü¼Ó¸´ÔӵĽ»»¥£¬±ÈÈçÖ´ÐÐÌض¨µÄ´úÂëÐС£Çåµ¥ 1 ÏÔʾÁË DTrace ½Å±¾µÄÒ»¸ö¼òµ¥Àý×Ó£¬Ëü¼ÆËãÿ¸ö½ø³Ì·¢³öµÄϵͳµ÷ÓõÄÊýÁ¿£¨×¢Ò⣬ʹÓÃ×ֵ佫¼ÆÊýºÍ½ø³Ì¹ØÁªÆðÀ´£©¡£¸Ã½Å±¾µÄ¸ñʽ°üº¬Ì½Õ루ÔÚ·¢³öϵͳµ÷ÓÃʱ´¥·¢£©ºÍ²Ù×÷£¨¶ÔÓ¦µÄ²Ù×÷½Å±¾£©¡£
Çåµ¥ 1. ¼ÆËãÿ¸ö½ø³ÌµÄϵͳµ÷Óõļòµ¥ DTrace ½Å±¾
syscall:::entry
{
@num[pid,execname] = count();
}
DTrace ÊÇ Solaris ×îÒýÈËעĿµÄ²¿·Ö£¬ËùÒÔÔÚÆäËû²Ù×÷ϵͳÖпª·¢Ëü²¢²»Ææ¹Ö¡£DTrace ÊÇÔÚ Common Development and Distribution License (CDDL) ֮Ϸ¢Ðеģ¬²¢ÇÒ±»ÒÆÖ²µ½ FreeBSD ²Ù×÷ϵͳÖС£
ÁíÒ»¸ö·Ç³£ÓÐÓõÄÄں˸ú×Ù¹¤¾ßÊÇ ProbeVue£¬ËüÊÇ IBM Ϊ IBM® AIX® ²Ù×÷ϵͳ 6.1 ¿ª·¢µÄ¡£Äú¿ÉÒÔʹÓà ProbeVue ̽²éϵͳµÄÐÐΪºÍÐÔÄÜ£¬ÒÔ¼°ÌṩÌض¨½ø³ÌµÄÏêϸÐÅÏ¢¡£Õâ¸ö¹¤¾ßʹÓÃÒ»¸ö±ê×¼µÄÄÚºËÒÔ¶¯Ì¬µÄ·½Ê½½øÐиú×Ù¡£Çåµ¥ 2 ÏÔʾÁË ProbeVue ½Å±¾µÄÒ»¸öÀý×Ó£¬ËüÖ¸³ö·¢³ö sync ϵͳµ÷ÓõÄÌض¨½ø³Ì¡£
Çåµ¥ 2. Ö¸³öÄĸö½ø³Ìµ÷Óà sync µÄ¼òµ¥ ProbeVue ½Å±¾
@@syscall:*:sync:entry
{
printf( "sync() syscall invoked
Ïà¹ØÎĵµ£º
×ÜÀÀ
ÓÃiptables -ADC À´Ö¸¶¨Á´µÄ¹æ
Ôò
£¬-AÌí¼Ó -Dɾ³ý -C ÐÞ¸Ä
iptables - [RI] chain rule num rule-specification[option]
ÓÃiptables - RI ͨ¹ý¹æÔòµÄ˳ÐòÖ¸¶¨
iptables -D chain rule num[option]
ɾ³ýÖ¸¶¨¹æÔò
iptables -[LFZ] [chain][option]
ÓÃiptables -LFZ Á´Ãû [Ñ¡Ïî]
iptables -[NX] chain
ÓÃ -NX ......
Ò»£¬Ó²¼þÅäÖÃ×îµÍÒªÇó£º
32루X86£©£º
¸öÈËÈÏΪÖÁÉÙ1GÄڴ棨linux ÉÏ512M ¿ÉÒÔ£¬µ«Ì«¹ýÓÚÃãÇ¿ÁË£¬ÄÇÑùÈÝÒ×ËÀ»ú»ò¿¨×¡²»¶¯£¬»áÈÃÈË×¥¿ñµÄ;
windows 512M µÄ¿Ï¶¨²»ÐУ©
10GµÄ¿ÉÓô ......
Linux °²×°ÖÐÎÄ°ü
Ê×ÏÈ£¬°²×°ÖÐÎÄ°ü£º
#yum groupinstall chinese-support
Æä´Î£¬ÐÞ¸ÄÒ»ÏÂ×Ö·û±àÂëµÄÅäÖá£
# vi /etc/sysconfig/i18n
Ð޸ĺóÄÚÈÝÈçÏ£º
LANG="zh_CN.GB18030"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en:zh_CN.GB18030"
SYSFONT="latarcyrheb-sun16"
×îºóÖØÆô·þ ......
ÒòΪ¹«Ë¾µÄ°å×ÓÉϼüÅ̲»ºÃ°´£¬ËùÒÔд¸öÍøÂç°æµÄ£¬·½±ãµ÷ÊÔ¡£
client .c
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <linux/input.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#inclu ......
Linux µÄ×Ö·û´®½ØÈ¡ºÜÓÐÓá£ÓаËÖÖ·½·¨¡£
¼ÙÉèÓбäÁ¿ var=http://www.hao.com/123.htm
.
.
Ò» # ºÅ½ØÈ¡£¬É¾³ý×ó±ß×Ö·û£¬±£ÁôÓÒ±ß×Ö·û¡£
echo ${var#*//}
ÆäÖÐ var ÊDZäÁ¿Ãû£¬# ºÅÊÇÔËËã·û£¬*// ±íʾ´Ó×ó±ß¿ªÊ¼É¾³ýµÚÒ»¸ö // ºÅ¼°×ó±ßµÄËùÓÐ×Ö·û
¼´É¾³ý http://
½á¹ûÊÇ £ºwww.hao.com/123.htm
.
.
¶ ......