存档

‘√文章精选’ 分类的存档

Nginx+php-fcgi出现kernel: TCP: time wait bucket table overflow解决方法

2010年8月6日 没有评论

[root@viyin etc]# tail /var/log/messages
Aug 6 11:29:26 viyin : printk: 640 messages suppressed.
Aug 6 11:29:26 viyin kernel: TCP: time wait bucket
Aug 6 11:29:31 viyin kernel: printk: 299 messages suppressed.
Aug 6 11:29:31 viyin kernel: TCP: time wait bucket table overflow
Aug 6 11:29:37 viyin kernel: printk: 590 messages suppressed.
Aug 6 11:29:37 viyin kernel: TCP: time wait bucket table overflow
Aug 6 11:29:41 viyin kernel: printk: 711 messages suppressed.
Aug 6 11:29:41 viyin kernel: TCP: time wait bucket table overflow
Aug 6 11:29:46 viyin kernel: printk: 290 messages suppressed.
Aug 6 11:29:46 viyin kernel: TCP: time wait bucket table overflow

查看80连接状态
[root@viyin ~]# netstat -an | grep 80 | awk ‘{print $6}’ | sort | uniq -c | sort -rn
5539 ESTABLISHED
768 TIME_WAIT
321 FIN_WAIT1
165 FIN_WAIT2
56 LAST_ACK
32 CONNECTED
22 SYN_RECV
5 STREAM
3 LISTEN
1 33410680
修改 /etc/sysctl.conf
sysctl net.ipv4.tcp_max_tw_buckets=10000

Intel主板开启VT

2010年8月2日 2 条评论

工作原理:
  带有虚拟技术的处理器具有额外的指令集,叫做Virtual Machine Extensions,简称VMX。VMX给CPU带来了10个新的虚拟专用指令:VMPTRLD, VMPTRST, VMCLEAR, VMREAD, VMWRITE, VMCALL, VMLAUCH, VMRESUME, VMXOFF and VMXON。
在虚拟状态下有两种工作模式:root操作和非root操作。通常只有虚拟操作软件——Virtual Machine Monitor (VMM)能够运行在root操作模式下,而操作系统在虚拟机的顶层运行在非root操作模式下。运行在虚拟机顶层的软件同时也叫做“guest software”。

  要进入虚拟模式,VMM需要执行VMXON指令来调入VMM软件,VMM软件使用VMLAUNCH指令来进入每一个虚拟机,使用VMRESUME指令来退出。如果想要退出虚拟模式,可以使用VMM运行VMXOFF指令。在图中的每个guest系统可以是不同的操作系统,同时运行自身的软件。
BIOS里面打开VT功能

分类: √文章精选 标签: , , , ,

今天离职了

2010年7月22日 2 条评论

今天离职了,感谢把我介绍到公司的彭哥,感谢YMJ老大,感谢四哥,感谢翁神,感谢我的同事们,感谢你们的帮助~~!

特别说下,YMJ老大,,您太强大了,,我对您心服口服,,你对俺这小员工太照顾,,祝您事业更更强大,赚钱更更多~~

分类: √文章精选 标签:

squid常用命令

2010年7月13日 没有评论

1,初始化你在 .conf 里配置的 cache 目录
#squid/sbin/squid -z
如果有错误提示,请检查你的 cache目录的权限。
2,对你的squid.conf 排错,即验证 squid.conf 的 语法和配置。
#squid/sbin/squid -k parse
如果squid.conf 有语法或配置错误,这里会返回提示你,如果没有返回,恭喜,可以尝试启动squid。
3,在前台启动squid,并输出启动过程。
#squid/sbin/squid -N -d1
如果有到 ready to server reques,恭喜,启动成功。
然后 ctrl + c,停止squid,并以后台运行的方式启动它。
4,启动squid在后台运行。
#squid/sbin/squid -s
这时候可以 ps -A 来查看系统进程,可以看到俩个 squid 进程。
5,停止 squid
#squid/sbin/squid -k shutdown
这个不用解释吧。
6,重引导修改过的 squid.conf
#squid/sbin/squid -k reconfigure
这个估计用的时候比较多,当你发现你的配置有不尽你意的时候,可以随时修改squid.conf,然后别忘记对你的 squid.conf排错,然后再执行此指令,即可让squid重新按照你的 squid.conf 来运行。
7,把squid添加到系统启动项
编辑 /etc/rc.d/rc.local
添加如下行:  /usr/local/squid/sbin/squid -s
当然,并不是每个人都喜欢这种启动方式,你可以用你最习惯的方式;或者把它安装为服务。 阅读全文…

分类: √linux, √文章精选 标签:

另类方式屏蔽国内IP

2010年7月11日 没有评论

很多朋友有做英文站被国内网络CC、DDOS的经历,然后就会寻求屏蔽国内访问的相关方式,经常用到的就是通过IP数据库进行分析,排除法进行筛选,不过这样做多少增加了服务器cpu的压力,如果攻击频繁,cpu资源很快就会耗尽。
如果您仅仅需要国外的流量,或者说想上面所谈到的屏蔽国内的访问量,那么下面的方式也许是一个非常简单实用的方式了

域名NS交给dnspod。分线路解析。

首先,我们添加一个默认的解析地址,(请自行对照是您网站的正确IP地址),然后我们依次添加选择3种不同线路的错误IP地址,比如 127.0.0.1,这样来自于国内的访问几乎被彻底的解析到错误的IP地址,也就是可以被另类的屏蔽掉了。

密码保护:caca代理免费测试(暂停)

2010年7月7日 要查看留言请输入您的密码。

这是一篇受密码保护的文章。您需要提供访问密码:


vbs对比更新删除

2010年7月3日 1 条评论

整理的是相当的痛苦。。。
更改这三条
echo copyfol “D:\dnf”,”D:\b” >> c:\diff.
echo sdir=”d:\dnf” >> c:\diff.vbs
echo ddir=”d:\b” >> c:\diff.vbs

更改其中的这三条语句。
d:\dnf 为源目录。 d:\b 目的目录(需要更新还原的目录)。

  1. @echo off
  2. del /f /q  c:\diff.vbs
  3. echo Option Explicit >> c:\diff.vbs
  4.  
  5. echo sub copyfol(sDir,Ddir) >> c:\diff.vbs
  6.  
  7. echo   dim fso,fol,fs,f1, objfile >> c:\diff.vbs
  8. echo   dim arrFiles(),arrSize(),arrModified() >> c:\diff.vbs
  9. echo   dim i >>c:\diff.vbs
  10. echo   if right(ddir,1)^<^>"\" then ddir =ddir ^& "\" >> c:\diff.vbs
  11. echo   if right(sdir,1)^<^>"\" then sdir =sdir ^& "\" >> c:\diff.vbs
  12. echo   Set fso = CreateObject("Scripting.FileSystemObject") >> c:\diff.vbs
  13.  
  14. echo   if not (fso.FolderExists(sdir))  then >> c:\diff.vbs
  15. echo       msgbox "找不到文件夹:" ^& sdir >> c:\diff.vbs
  16. echo       exit sub >> c:\diff.vbs
  17. echo   end if >> c:\diff.vbs
  18. echo   if not (fso.FolderExists(ddir))  then >> c:\diff.vbs
  19. echo        msgbox "找不到文件夹:" ^& sdir >> c:\diff.vbs
  20. echo        exit sub >> c:\diff.vbs
  21. echo   end if >> c:\diff.vbs
  22.  
  23.  
  24. echo   set fol=fso.GetFolder(ddir) >> c:\diff.vbs
  25. echo   set fs=fol.files >> c:\diff.vbs
  26. echo   i=0 >> c:\diff.vbs
  27. echo   redim arrFiles(fs.count-1) >> c:\diff.vbs
  28. echo   redim arrSize(fs.count-1) >> c:\diff.vbs
  29. echo   redim arrModified(fs.count-1) >> c:\diff.vbs
  30. echo   for each f1 in fs >> c:\diff.vbs
  31. echo      arrfiles(i)=f1.name >> c:\diff.vbs
  32. echo      arrSize(i)=f1.size >> c:\diff.vbs
  33. echo      arrModified(i)=f1.DateLastModified >> c:\diff.vbs
  34. echo      i=i+1 >> c:\diff.vbs
  35. echo   next >> c:\diff.vbs
  36.  
  37. echo   set fol=fso.GetFolder(sdir) >> c:\diff.vbs
  38. echo   set fs=fol.files >> c:\diff.vbs
  39. echo   for i = 0 to ubound(arrfiles) >> c:\diff.vbs
  40.  
  41.  
  42. echo       dim delfile   >> c:\diff.vbs
  43. echo       delfile=false >> c:\diff.vbs
  44. echo       for each f1 in fs >> c:\diff.vbs
  45. echo           if strcomp(arrfiles(i),f1.name,vbTextCompare)=0 then     >> c:\diff.vbs         
  46. echo               if arrsize(i)^<^> f1.size or arrModified(i)^<^>f1.DateLastModified then >> c:\diff.vbs
  47. echo                  fso.copyfile f1.path, ddir ^& arrfiles(i),true        >> c:\diff.vbs
  48. echo               end if >> c:\diff.vbs
  49. echo              delfile=true '如果文件存在 >> c:\diff.vbs
  50. echo               exit for >> c:\diff.vbs
  51. echo            end if >> c:\diff.vbs
  52. echo        next >> c:\diff.vbs
  53. echo        if not delfile then      >> c:\diff.vbs             
  54. echo            set objfile=fso.getfile(ddir ^&arrfiles(i)) >> c:\diff.vbs
  55. echo            objfile.Delete (true) >> c:\diff.vbs
  56. echo         end if       >> c:\diff.vbs   
  57. echo    next >> c:\diff.vbs
  58.  
  59. echo   for each f1 in fs >> c:\diff.vbs
  60. echo       delfile=false >> c:\diff.vbs
  61. echo       for i=0 to ubound(arrfiles) >> c:\diff.vbs
  62. echo          if strcomp(f1.name,arrfiles(i),vbtextcompare)=0 then >> c:\diff.vbs
  63. echo             delfile=true >> c:\diff.vbs
  64. echo             exit for >> c:\diff.vbs
  65. echo          end if >> c:\diff.vbs
  66. echo        next  >> c:\diff.vbs
  67. echo         if right (ddir,1)^<^>"\" then ddir=ddir ^&"\" >> c:\diff.vbs
  68. echo        if not delfile then          >> c:\diff.vbs
  69. echo           f1.copy ddir,true >> c:\diff.vbs
  70. echo        end if >> c:\diff.vbs
  71. echo   next >> c:\diff.vbs
  72.  
  73. echo   dim fols >> c:\diff.vbs
  74. echo   set fol=Fso.GetFolder(sdir) >> c:\diff.vbs
  75. echo   set fols=fol.SubFolders >> c:\diff.vbs
  76. echo   for each f1 in fols >> c:\diff.vbs
  77. echo      if not (fso.FolderExists(ddir ^& f1.name)) then  >> c:\diff.vbs
  78. echo         fso.CreateFolder(ddir ^& f1.name) >> c:\diff.vbs
  79. echo      end if >> c:\diff.vbs
  80. echo      copyfol sdir ^& f1.name ,ddir ^& f1.name >> c:\diff.vbs
  81. echo   next >> c:\diff.vbs
  82. echo end sub >> c:\diff.vbs
  83.  
  84.  
  85. echo copyfol "D:\dnf","D:\b"  >> c:\diff.vbs
  86.  
  87. echo dim sdir,ddir  >> c:\diff.vbs
  88. echo '源目录  >> c:\diff.vbs
  89. echo sdir="d:\dnf"  >> c:\diff.vbs
  90. echo '目的目录  >> c:\diff.vbs
  91. echo ddir="d:\b"  >> c:\diff.vbs
  92. echo function comparefile(sdir,ddir)  >> c:\diff.vbs
  93. echo   dim Fso,dFol,dfs,sf1,f1  >> c:\diff.vbs
  94. echo   set Fso=CreateObject("Scripting.FileSystemObject")  >> c:\diff.vbs
  95. echo   if not(Fso.folderexists(sdir)) then  >> c:\diff.vbs
  96. echo       msgbox chr(34) ^&sdir ^&chr(34) ^&"文件夹不存在,请确认!",64  >> c:\diff.vbs
  97. echo       exit function  >> c:\diff.vbs
  98. echo   end if  >> c:\diff.vbs
  99. echo   if not(Fso.folderexists(ddir)) then  >> c:\diff.vbs
  100. echo       msgbox chr(34) ^&ddir ^&"""文件夹不存在,请确认!",64  >> c:\diff.vbs
  101. echo       exit function  >> c:\diff.vbs
  102. echo   end if  >> c:\diff.vbs
  103. echo   if right(sdir,1)^<^>"\" then sdir=sdir ^&"\"  >> c:\diff.vbs
  104. echo   set dFol=fso.getfolder(ddir)  >> c:\diff.vbs
  105. echo   set dfs=dfol.files  >> c:\diff.vbs
  106. echo   for each f1 in dfs  >> c:\diff.vbs
  107. echo       if fso.fileexists(sdir ^& f1.name)  then  >> c:\diff.vbs
  108. echo           set sf1=fso.GetFile(sdir ^& f1.name)  >> c:\diff.vbs
  109. echo           if f1.DateLastModified ^<^>sf1.DateLastModified or f1.size^<^>sf1.size then >> c:\diff.vbs
  110. echo               f1.delete  >> c:\diff.vbs
  111. echo           end if  >> c:\diff.vbs
  112. echo         else  >> c:\diff.vbs
  113. echo           f1.Delete(true)  >> c:\diff.vbs
  114. echo         end if  >> c:\diff.vbs
  115. echo     next  >> c:\diff.vbs
  116. echo   dim fols  >> c:\diff.vbs
  117. echo   set fols=dfol.subfolders  >> c:\diff.vbs
  118. echo   for each f1 in fols  >> c:\diff.vbs
  119. echo       if not fso.folderexists(sdir ^&f1.name) then  >> c:\diff.vbs
  120. echo             f1.delete true  >> c:\diff.vbs
  121. echo       else     >> c:\diff.vbs
  122. echo           comparefile sdir ^& f1.name,f1.path  >> c:\diff.vbs
  123. echo       end if  >> c:\diff.vbs
  124. echo   next  >> c:\diff.vbs
  125. echo end function  >> c:\diff.vbs
  126. echo comparefile sdir,ddir  >> c:\diff.vbs
  127.  
  128. start c:\diff.vbs

@echo off
del /f /q c:\diff.vbs
echo Option Explicit >> c:\diff.vbs

echo sub copyfol(sDir,Ddir) >> c:\diff.vbs

echo dim fso,fol,fs,f1, objfile >> c:\diff.vbs
echo dim arrFiles(),arrSize(),arrModified() >> c:\diff.vbs
echo dim i >>c:\diff.vbs
echo if right(ddir,1)^<^>“\” then ddir =ddir ^& “\” >> c:\diff.vbs
echo if right(sdir,1)^<^>“\” then sdir =sdir ^& “\” >> c:\diff.vbs
echo Set fso = CreateObject(“Scripting.FileSystemObject”) >> c:\diff.vbs

echo if not (fso.FolderExists(sdir)) then >> c:\diff.vbs
echo msgbox “找不到文件夹:” ^& sdir >> c:\diff.vbs
echo exit sub >> c:\diff.vbs
echo end if >> c:\diff.vbs
echo if not (fso.FolderExists(ddir)) then >> c:\diff.vbs
echo msgbox “找不到文件夹:” ^& sdir >> c:\diff.vbs
echo exit sub >> c:\diff.vbs
echo end if >> c:\diff.vbs

echo set fol=fso.GetFolder(ddir) >> c:\diff.vbs
echo set fs=fol.files >> c:\diff.vbs
echo i=0 >> c:\diff.vbs
echo redim arrFiles(fs.count-1) >> c:\diff.vbs
echo redim arrSize(fs.count-1) >> c:\diff.vbs
echo redim arrModified(fs.count-1) >> c:\diff.vbs
echo for each f1 in fs >> c:\diff.vbs
echo arrfiles(i)=f1.name >> c:\diff.vbs
echo arrSize(i)=f1.size >> c:\diff.vbs
echo arrModified(i)=f1.DateLastModified >> c:\diff.vbs
echo i=i+1 >> c:\diff.vbs
echo next >> c:\diff.vbs

echo set fol=fso.GetFolder(sdir) >> c:\diff.vbs
echo set fs=fol.files >> c:\diff.vbs
echo for i = 0 to ubound(arrfiles) >> c:\diff.vbs

echo dim delfile >> c:\diff.vbs
echo delfile=false >> c:\diff.vbs
echo for each f1 in fs >> c:\diff.vbs
echo if strcomp(arrfiles(i),f1.name,vbTextCompare)=0 then >> c:\diff.vbs
echo if arrsize(i)^<^> f1.size or arrModified(i)^<^>f1.DateLastModified then >> c:\diff.vbs
echo fso.copyfile f1.path, ddir ^& arrfiles(i),true >> c:\diff.vbs
echo end if >> c:\diff.vbs
echo delfile=true ‘如果文件存在 >> c:\diff.vbs
echo exit for >> c:\diff.vbs
echo end if >> c:\diff.vbs
echo next >> c:\diff.vbs
echo if not delfile then >> c:\diff.vbs
echo set objfile=fso.getfile(ddir ^&arrfiles(i)) >> c:\diff.vbs
echo objfile.Delete (true) >> c:\diff.vbs
echo end if >> c:\diff.vbs
echo next >> c:\diff.vbs

echo for each f1 in fs >> c:\diff.vbs
echo delfile=false >> c:\diff.vbs
echo for i=0 to ubound(arrfiles) >> c:\diff.vbs
echo if strcomp(f1.name,arrfiles(i),vbtextcompare)=0 then >> c:\diff.vbs
echo delfile=true >> c:\diff.vbs
echo exit for >> c:\diff.vbs
echo end if >> c:\diff.vbs
echo next >> c:\diff.vbs
echo if right (ddir,1)^<^>“\” then ddir=ddir ^&”\” >> c:\diff.vbs
echo if not delfile then >> c:\diff.vbs
echo f1.copy ddir,true >> c:\diff.vbs
echo end if >> c:\diff.vbs
echo next >> c:\diff.vbs

echo dim fols >> c:\diff.vbs
echo set fol=Fso.GetFolder(sdir) >> c:\diff.vbs
echo set fols=fol.SubFolders >> c:\diff.vbs
echo for each f1 in fols >> c:\diff.vbs
echo if not (fso.FolderExists(ddir ^& f1.name)) then >> c:\diff.vbs
echo fso.CreateFolder(ddir ^& f1.name) >> c:\diff.vbs
echo end if >> c:\diff.vbs
echo copyfol sdir ^& f1.name ,ddir ^& f1.name >> c:\diff.vbs
echo next >> c:\diff.vbs
echo end sub >> c:\diff.vbs

echo copyfol “D:\dnf”,”D:\b” >> c:\diff.vbs

echo dim sdir,ddir >> c:\diff.vbs
echo ‘源目录 >> c:\diff.vbs
echo sdir=”d:\dnf” >> c:\diff.vbs
echo ‘目的目录 >> c:\diff.vbs
echo ddir=”d:\b” >> c:\diff.vbs
echo function comparefile(sdir,ddir) >> c:\diff.vbs
echo dim Fso,dFol,dfs,sf1,f1 >> c:\diff.vbs
echo set Fso=CreateObject(“Scripting.FileSystemObject”) >> c:\diff.vbs
echo if not(Fso.folderexists(sdir)) then >> c:\diff.vbs
echo msgbox chr(34) ^&sdir ^&chr(34) ^&”文件夹不存在,请确认!”,64 >> c:\diff.vbs
echo exit function >> c:\diff.vbs
echo end if >> c:\diff.vbs
echo if not(Fso.folderexists(ddir)) then >> c:\diff.vbs
echo msgbox chr(34) ^&ddir ^&”"”文件夹不存在,请确认!”,64 >> c:\diff.vbs
echo exit function >> c:\diff.vbs
echo end if >> c:\diff.vbs
echo if right(sdir,1)^<^>“\” then sdir=sdir ^&”\” >> c:\diff.vbs
echo set dFol=fso.getfolder(ddir) >> c:\diff.vbs
echo set dfs=dfol.files >> c:\diff.vbs
echo for each f1 in dfs >> c:\diff.vbs
echo if fso.fileexists(sdir ^& f1.name) then >> c:\diff.vbs
echo set sf1=fso.GetFile(sdir ^& f1.name) >> c:\diff.vbs
echo if f1.DateLastModified ^<^>sf1.DateLastModified or >> c:\diff.vbs

f1.size^<^>sf1.size echo then >> c:\diff.vbs
echo f1.delete >> c:\diff.vbs
echo end if >> c:\diff.vbs
echo else >> c:\diff.vbs
echo f1.Delete(true) >> c:\diff.vbs
echo end if >> c:\diff.vbs
echo next >> c:\diff.vbs
echo dim fols >> c:\diff.vbs
echo set fols=dfol.subfolders >> c:\diff.vbs
echo for each f1 in fols >> c:\diff.vbs
echo if not fso.folderexists(sdir ^&f1.name) then >> c:\diff.vbs
echo f1.delete true >> c:\diff.vbs
echo else >> c:\diff.vbs
echo comparefile sdir ^& f1.name,f1.path >> c:\diff.vbs
echo end if >> c:\diff.vbs
echo next >> c:\diff.vbs
echo end function >> c:\diff.vbs
echo comparefile sdir,ddir >> c:\diff.vbs