设置IE与Firefox浏览器的远程DNS解析功能

firefox:
URL地址栏输入 about:config
在 过滤器 一栏,输入 network.proxy.socks_remote_dns
然后双击 network.proxy.socks_remote_dns ,使“值”为True

IE:
修改注册表,路径为 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Linkage
双击右侧的Bind,将第二行的\Device\NdisWanIp,剪切并粘贴到第一行。
嫌麻烦可以把下列代码保存为IE_DNS.vbs,然后双击,重启IE浏览器,
也可借助SocksCap或FreeCap等工具。

  1. Const HKLM = &H80000002
  2. sComputer = "."   ' use "." for local computer
  3. Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _
  4.          & sComputer & "\root\default:StdRegProv")
  5. sKeyPath = "SYSTEM\CurrentControlSet\Services\Tcpip\Linkage"
  6. sValueName = "Bind"
  7. oReg.GetMultiStringValue HKLM, sKeyPath, sValueName, arValues
  8. arValuesNew = Array()
  9. For i = 0 To UBound(arValues)
  10.    If i = 0 Then
  11.       If LCase(arValues(i)) = "\device\ndiswanip" Then
  12.          Exit For
  13.       Else
  14.          ReDim Preserve arValuesNew(0)
  15.          arValuesNew(0) = "\Device\NdisWanIp"
  16.       End If
  17.    End If
  18.    If LCase(arValues(i)) <> "\device\ndiswanip" Then
  19.       iCountNew = UBound(arValuesNew) + 1
  20.       ReDim Preserve arValuesNew(iCountNew)
  21.       arValuesNew(iCountNew) = arValues(i)
  22.    End If
  23. Next
  24. If UBound(arValuesNew) > -1 Then
  25.    oReg.SetMultiStringValue HKLM, sKeyPath, sValueName, arValuesNew
  26. End If

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

perl ping检测脚本

我的第一个用于生产环境的perl脚本,虽然不是很优秀,但也迈出了扎实的一步 :)
领导有任务,给一批IP列表,ping每一台机器,如果没有响应就发邮件通知,通知的邮件需要分开,不能通知一个列表,得一封一封的通知.
用到email::send模块,因为需要用到Gmail

  1. #!/usr/bin/perl
  2. use warnings;
  3. use strict;
  4. use Email::Send;
  5. use Email::Send::Gmail;
  6. use Email::Simple::Creator;
  7. my @list = qw/
  8. 1.1.1.1
  9. 2.2.2.2
  10. 3.3.3.3
  11. /;
  12. foreach my $re (@list){
  13.         my $p = `ping $re -c 3`;
  14.         if($p=~/100% packet loss/){
  15.                 my $email = Email::Simple->create(
  16.                 header => [
  17.                 From    => 'monitor@a.com',
  18.                 To      => 'monitor@b.com',
  19.                 Subject => "$re 100% packet loss",
  20. ],
  21. body => "$re the server is down!\n",
  22.  );
  23.                 my $sender = Email::Send->new(
  24.                 { mailer => 'Gmail',
  25.                 mailer_args => [
  26.                 username => 'monitor@a.com',
  27.                 password => 'xxx',
  28.                 ]
  29.                 }
  30. );
  31.         eval { $sender->send($email) };
  32.         die "Error sending email: $@" if $@;
  33.         }
  34. }

收藏_FTP参数解释

CWD – change working directory 更改目录
DELE – delete a remote file 删除文件
LIST – list remote files 列目录
MKD – make a remote directory 新建文件夹
NLST – name list of remote directory
PWD – print working directory 显示当前工作目录
RETR – retrieve a remote file 下载文件
RMD – remove a remote directory 删除目录
RNFR – rename from 重命名
RNTO – rename to 重命名
STOR – store a file on the remote host 上传文件
ABOR – abort a file transfer 取消文件传输
CWD – change working directory 更改目录
DELE – delete a remote file 删除文件
LIST – list remote files 列目录
MDTM – return the modification time of a file 返回文件的更新时间
MKD – make a remote directory 新建文件夹
NLST – name list of remote directory
PASS – send password
PASV – enter passive mode
PORT – open a data port 打开一个传输端口
PWD – print working directory 显示当前工作目录
QUIT – terminate the connection 退出
RETR – retrieve a remote file 下载文件
RMD – remove a remote directory
RNFR – rename from # RNTO – rename to
SITE – site-specific commands
SIZE – return the size of a file 返回文件大小
STOR – store a file on the remote host 上传文件
TYPE – set transfer type 设置传输类型
USER – send username 发送用户名

Directadmin到期 更换license的步骤

  1. cd /usr/local/directadmin/scripts
  2. ./getLicense.sh 你的client_ID 新的DA_LicenseIP
  3. service directadmin restart

for english people:
how to fix the expired issue for directadmin,
when you trying to log into your DA control panel and it showing:
License has expired, it means you need to start a new subscription.
log into your DA server by ssh,
cd in your DA path ( default is /usr/local/directadmin/scripts)
run the getLicense.sh with your client id and new license , new IP address.
Eg, ./getLicense.sh Your_Client_ID Your_new_DA_Licnese NewIP
./getLicense.sh 112233 123456 1.2.3.4
finally,just type command to restart the DA service,
service directadmin restart

2 12»