检查windows与linux系统的安装日期

  1. #xp,windows2003,windows7
  2. 开始,运行,cmd
  3. systeminfo|find "初始安装日期"
  4.  
  5. #Linux
  6. tune2fs -l /dev/hdd1|grep 'Filesystem created'

vmware workstation 8 开启嵌套虚拟

在vmware workstation 8里安装虚拟机,在这基础上再虚拟一次,实现多次虚拟。
从性能上这样做没什么意义,但是利用有限的资源来模拟网络拓扑或规划,或者做一些网络测试就很有用了。

  1. 打开某个要开启的嵌套虚拟功能的虚拟机的配置文件,文件名以*.vmx为例
  2. 添加一行
  3. vhv.allow = "TRUE"
  4. 保存退出

未开启前:

  1. [root@xen ~]# perl -ne 'print if /vmx/||/svm/' /proc/cpuinfo
  2. [root@xen ~]#

开启后:

  1. [root@xen ~]# perl -ne 'print if /vmx/||/svm/' /proc/cpuinfo
  2. flags           : fpu tsc msr pae cx8 apic mtrr cmov pat clflush mmx fxsr sse sse2 nx mmxext fxsr_opt 3dnowext 3dnow nonstop_tsc pni popcnt svm abm sse4a misalignsse 3dnowprefetch
  3. flags           : fpu tsc msr pae cx8 apic mtrr cmov pat clflush mmx fxsr sse sse2 nx mmxext fxsr_opt 3dnowext 3dnow up nonstop_tsc pni popcnt svm abm sse4a misalignsse 3dnowprefetch
  4. flags           : fpu tsc msr pae cx8 apic mtrr cmov pat clflush mmx fxsr sse sse2 nx mmxext fxsr_opt 3dnowext 3dnow up nonstop_tsc pni popcnt svm abm sse4a misalignsse 3dnowprefetch
  5. flags           : fpu tsc msr pae cx8 apic mtrr cmov pat clflush mmx fxsr sse sse2 nx mmxext fxsr_opt 3dnowext 3dnow up nonstop_tsc pni popcnt svm abm sse4a misalignsse 3dnowprefetch

asp实现301重定向

不带www的域名,301重定向到带www的域名
以我博客的域名为例:

  1. <%
  2. if request.ServerVariables("SERVER_NAME")="baiqiuyi.com" then 
  3. Response.Status="301 Moved Permanently" 
  4. Response.AddHeader "Location", "http://www.baiqiuyi.com"
  5. Response.End
  6. end if
  7. %>

所有绑定的域名,都会301重定向

  1. <%@ Language=VBScript %>
  2. <%
  3. Response.Status="301 Moved Permanently"
  4. Response.AddHeader "Location","http://www.baiqiuyi.com/"
  5. %>

dig的windows版

dig的windows

忍受不了windows的nslookup,连打这个命令都很陌生~
还是linux的dig好用,也习惯点。
下载dig for windows的版本
http://members.shaw.ca/nicholas.fong/dig/dig-files3.zip
在D盘创建一个新文件夹dig,然后解压到里面

  1. cd /d D:\dig
  2.  
  3. 检测文件的完整性
  4.  
  5. D:\dig>sha1sum *
  6. 489a8ca7c7851088ade58c404ddde1a926559003  cygwin1.dll
  7. 57487baeaa0eb2848557b7ca54ed9183eafc73fa  dig.exe
  8. 97dbd755d67a5829c138a4708be7a4f26ed0894c  host.exe
  9. d22e4b8956e1831ff0f9d07620ec19bf171f0c29  libbind9.dll
  10. 81588f0be7d3c6b320edc314532d9f2d0a105594  libdns.dll
  11. e0bd7187bbc01003abfe7472e64b68cd1bdb6bab  libeay32.dll
  12. f445362e728a902796ec6871a79c6307054974e4  libisc.dll
  13. b3255c0e4808a703f95c217a91ffcd6940e680c9  libisccfg.dll
  14. dfbde4f9e25fd49a0846e97fd813d6876dc94067  liblwres.dll
  15. 61b8f573db448ae6351ae3475c2e7c482d81533c  msvcr70.dll
  16. da39a3ee5e6b4b0d3255bfef95601890afd80709  resolv.conf
  17. 4a578ecd09a2d0c8431bdd8cf3d5c5f3ddcddfc9  sha1sum.exe
  18. 9d9ec0e2cf59e14d9db618d10b55b881bb7d195b  whois.exe
  19.  
  20. 我的电脑,右键属性,高级,系统变量
  21. 修改
  22. 变量名:PATH
  23. 变量值:c:\windows\system32;d:\dig
  24. #system32后面的分号不能有空格!
  25.  
  26. 测试:
  27. C:\Documents and Settings\Administrator>dig google.com
  28.  
  29. ; <<>> DiG 9.3.2 <<>> google.com
  30. ;; global options:  printcmd
  31. ;; Got answer:
  32. ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 797
  33. ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
  34.  
  35. ;; QUESTION SECTION:
  36. ;google.com.                    IN      A
  37.  
  38. ;; ANSWER SECTION:
  39. google.com.             300     IN      A       66.249.89.99
  40. google.com.             300     IN      A       66.249.89.104
  41.  
  42. ;; Query time: 109 msec
  43. ;; SERVER: 8.8.4.4#53(8.8.4.4)
  44. ;; WHEN: Thu Sep 16 23:31:02 2010
  45. ;; MSG SIZE  rcvd: 60

vb发送Gmail邮件

使用vb来发送Gmail邮件,配合windows2003的performance来做进程监控,很实用也很方便,进程控制也可以,脚本的主要作用是发送邮件通知,触发动作可由performance来完成.

  1. Set iMsg = CreateObject("CDO.Message")
  2. Set iConf = CreateObject("CDO.Configuration")
  3. Set Flds = iConf.Fields
  4. schema = "http://schemas.microsoft.com/cdo/configuration/"
  5. Flds.Item(schema & "sendusing") = 2
  6. Flds.Item(schema & "smtpserver") = "smtp.gmail.com" 
  7. Flds.Item(schema & "smtpserverport") = 465
  8. Flds.Item(schema & "smtpauthenticate") = 1
  9. Flds.Item(schema & "sendusername") = "YourEmailAddress"
  10. Flds.Item(schema & "sendpassword")"YourPassWord"
  11. Flds.Item(schema & "smtpusessl") = 1
  12. Flds.Update
  13. With iMsg
  14. .To = "Recipients"
  15. .From = "YourName <YourEmailAddress>"
  16. .Subject = "Email Title"
  17. .HTMLBody = "YourMessageGoesHere"
  18. .Sender = "YourName"
  19. .Organization = "YourName"
  20. .ReplyTo = "Recipients"
  21. Set .Configuration = iConf
  22. SendEmailGmail = .Send
  23. End With
  24.  
  25. set iMsg = nothing
  26. set iConf = nothing
  27. set Flds = nothing
3 123»