Nov 28

换了 SSD 觉得快了又说不出快多少么?刷刷的那是什么意思~~ :grin: :grin: 用 AppTimer 来数据化你的启动速度呗。

如图,很简单,AppTimer 就是用来测试一个程序要花多少时间启动的免费软件:

AppTimer

参数说明:

==========
Application 应用程序
你要测试的程序路径

Cmd Line 命令行
被测试程序附加参数

Log File 日志文件
测试结果文件路径,如果总是选择同一个文件,那么测试结果会追加在后面

Window Name 窗口名称
被测试程序启动后的主窗口名称。它被用来侦测程序启动或者退出。

名称不必写全,例如 “Jasc” 就可以匹配 “Jasc Paint Shop Pro” 这个窗口

Executions 执行次数
你需要连续测试这个程序启动的次数

Delay 延迟
每次测试间隔时间,单位是毫秒

Debug 调试
在日志文件中追加调试信息,例如窗口名如何被匹配的

Window Detection method 窗口侦测方式
程序有 3 种方法来判断被测程序是否启动;

Input Idle 输入: 一但被测程序开始接受输入,认为它已启动;
Window Name 窗口名: 用上面设置的窗口名来判断程序是否已启动;
Exact Match 精确匹配: 精确匹配窗口名,“Jasc” 不再匹配 “Jasc Paint Shop Pro”
Visible 可见: 设置的窗口名窗口为可见时,启动完成;

Window Close Method 窗口关闭侦测模式
程序可以用 3 种方法来判断被测程序是否关闭;

WM_CLOSE: 一个 WM_CLOSE 信息被发送到被测程序窗口;
WM_SYSYCOMMAND: 一个 WM_SYSYCOMMAND 命令发送到被测程序窗口;
ALT-F4: 组合键 ALT-F4 发送到被测程序窗口

以上均需要定义窗口名

也可以通过配置文件来测试。
======================
AppTimer 试图打开同目录下的 Config.txt 来启动测试,例如:

C:\test.exe
此处为一空行,因为测试程序无附加参数
C:\tmplog.txt
TestWindow
5
1000
1 1 0 0
1 1 0
0

以上表示,启动 test.exe,无附加参数,日志文件是 C:\tmplog.txt,测试 5 次,延迟 1 秒,使用了 Input Idle 和 Window Name 方式侦测程序启动,使用了 WM_CLOSE 和 WM_SYSCOMMAND 方式侦测程序关闭。


Nov 16

Cron Alarm Clock

Cron Service for Windows 在 Windows 系统中完全模拟 *nix 下的 Cron 功能,由于使用单个配置文件来配置所有的定时计划任务,所以你可以很方便的在不同机器之间同步这些任务,而 Windows 的计划任务则没有这么方便(复制 C:\Windows\tasks 是非官方的做法,而且未必每次都能正常工作)。而且由于它的配置文件就是个简单的文本文件,所以你可以通过它排程 PHP,PowerShell,VBScript 等任务,完全不必通过 Windows 的 ActiveX 来挂载。

Cron Service for Windows 可以工作在最新的 Windows 7 和 Windows Server 2008 上(向下兼容 Windows XP,Windows 2000),而且完全兼容 x64 版本。

程序默认安装在 C:\Program Files\IntelliAdmin\Cron 下,不会创建任何菜单和图标,它创建了一个叫 IntelliAdmin Cron Service(icronsvr) 的服务并且自动启动。

IntelliAdmin Cron Service

安装目录下有两个配置文件,第一个是 config.cfg:

[Configuration]
status_enabled=true ##是否为计划任务启用 status.log 日志
status_handler= ##启动任务计划任务时同时启动一个固定任务(可执行文件)
path= ##自定义 crontab 文件路径

第二个就是 crontab 任务定义文件了,它有点类似 Unix 的 crontab 文件格式:

格式定义如下图:

cron_param

crontab 文件范例:

*/5 * * * * c:\process.bat ##每 5 分钟执行一次 process.bat ,* 包含了每一分钟, /5 是步长,则每个 0,5,10,15,20 ... 都会执行任务;

00 01 * * 00 c:\process.bat ##每个星期天下午一点执行任务;

00 01 * 06-12 00 c:\process.bat ## 6 月到 12 月每个星期天下午一点执行任务

15,30 * * * * c:\process.bat ##每个小时的 15 分和 30 分的时候执行任务

最后提醒下 Cron 计划启动的任务有 System 权限,所以确保你需要启动的任务的安全性,这样你就必须保证 crontab 文件的安全性,要不别人编辑下这个文件就启动了一个木马你不就...... :mrgreen:


Aug 28

Unbound 是一款免费的相当轻量的 DNS 本地服务器软件,以前曾经做过介绍 Config Unbound On Windows

经过测试,原来只要改一下 Unbound 的配置文件,也可以把它当 PWX-DNS-Proxy 用!

方法很简单,安装完 Unbound 后,打开安装目录下的 service.conf 文件,修改(添加)以下两行内容:(注意,此方法只适用于 Unbound 1.4.12 及其以下版本,新版的官方给出了直接参数支持的方法,详见文末

# Enable UDP, "yes" or "no".
do-udp: no

# Enable TCP, "yes" or "no".
do-tcp: yes

这样就强制 Unbound 只监听 TCP 的 53 端口了。

优点: Unbound 是一款专业的 DNS 服务器软件,标准功能和稳定性比 PWX-DNS-Proxy 强,查询速度较快,内存占用也比 PWX-DNS-Proxy 少;

缺点: 没有 PWX-DNS-Proxy 那样可以自定义某些网站使用特定的 DNS 服务器功能,而且由于关闭了 UDP 端口监听,nslookup 命令使用默认格式不能查询域名了,必须加 -vc 参数。

更新:在 forward-zone 中可以设置怎样的域名用哪个服务器查询,类似:

# forward-zone:
# name: "."
# forward-addr: 8.8.4.4
# forward-addr: 192.168.2.1@5355 # forward to port 5355.
# forward-zone:
# name: "cn"
# forward-host: 202.96.134.133

顺便说下,路由器是 Tomato,DD-WRT 那样使用 DNSMasq 的,可以把 Unbound 或者 PWX-DNS-Proxy 的查询服务器设置为路由器 IP,利用 DNSMasq 来进行更加灵活的配置。

2011-09-19 更新,新版的 Unbound 1.4.13 应该如此配置 DNS-Over-TCP:

# if yes, perform prefetching of almost expired message cache entries.
prefetch: yes

# Enable IPv4, "yes" or "no".
do-ip4: yes

# Enable IPv6, "yes" or "no".
do-ip6: no

# Enable UDP, "yes" or "no".
do-udp: yes

# Enable TCP, "yes" or "no".
do-tcp: yes

# upstream connections use TCP only (and no UDP), "yes" or "no"
# useful for tunneling scenarios, default no.
tcp-upstream: yes

注意 do-udp 一定要是 yes,但是实际上游查询会使用 tcp;还有一个切记先用 -vc 的 nslookup 确定你的上游 DNS 服务器支持 TCP 查询,国内的貌似全关了 :mrgreen:

Unbound 1.4.13 下载


May 23

Windows 7 下面的网络连接图标实在是不直观,以下两个小软件可以把 Windows 7 的网络连接图标恢复成 XP 或者 Vista 那个状态,2个蓝色小灯,有流量就会闪。右键菜单可以快捷的到达网络设置,比Win7那个右键菜单也好用。

一个是: Network Activity Indicator for Windows 7

另一个: Network Activity Indicator

注意:这个需要 .NET Framework 4.0 支持。



Mar 26

About Unbound

Unbound is a validating, recursive, and caching DNS resolver.

The C implementation of Unbound is developed and maintained by NLnet Labs. It is based on ideas and algorithms taken from a java prototype developed by Verisign labs, Nominet, Kirei and ep.net.

Unbound is designed as a set of modular components, so that also DNSSEC (secure DNS) validation and stub-resolvers (that do not run as a server, but are linked into an application) are easily possible.

First step, download Unbound ZIP files from:

http://www.unbound.net/downloads/unbound-1.4.12.zip

then extract all files to d://Unbound,

Next step,you must edit next two files so you can let it work fine on windows.

server.conf:

# Unbound configuration file on windows.
# See example.conf for more settings and syntax
server:
    directory: “d:Unbound”
    # file to read root hints from.
    # get one from ftp://FTP.INTERNIC.NET/domain/named.cache
    root-hints: “named.cache”

    # the log file, “” means log to stderr.
    # Use of this option sets use-syslog to “no”.
    logfile: “unbound.log”

    # verbosity level 0-4 of logging
    verbosity: 0

    # on Windows, this setting makes reports go into the Application log
    # found in ControlPanels - System tasks - Logs
    use-syslog: no

    # if yes, perform prefetching of almost expired message cache entries.
    prefetch: yes

    # Enable IPv4, “yes” or “no”.
    do-ip4: yes

    # Enable IPv6, “yes” or “no”.
    do-ip6: no

    # Enable UDP, “yes” or “no”.
    do-udp: yes

    # Enable TCP, “yes” or “no”.
    do-tcp: yes

Unbound.reg:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINESOFTWAREUnbound]
“CronAction”=”"D:Unboundanchor-update.exe" “
“InstallLocation”=”D:Unbound”
“ConfigFile”=”D:Unboundservice.conf”
“CronTime”=dword:00015180
“Start Menu Folder”=”Unbound”

Now you can run unbound-service-install.exe ,after this you will get a high performance local DNS resolver with validating, recursive, and caching(memory) function.


[1/2]  1 2 >