Create extensions for browsers in minutes using JavaScript only!

http://kangoextensions.com/

Faster, Easier, Cheaper
--- You only need to have just basic knowledge of JavaScript in order to develop extensions. There is no need to be familiar with a lot of different technologies and programming languages.


Single Code base
--- Using Kango write single code which works in the same way with all major browsers: Firefox, Chrome, Internet Explorer, Safari, Opera.


Powerful API
---Kango provides developer-friendly API increasing development rate up to 6x times (cross-domain requests, user interface, browser events, tabs management, etc.).


User Interface
---Add your own dynamically modifiable button to browser, HTML popup or options page by just a couple of lines of code.


Alteration of content
---Kango provides full access to DOM and have built-in support for Greasemonkey-style user scripts.


Background scripts
---Send queries to server, process data and do any other complex tasks in the background (asynchronously).

CATool

一、简介

CATool是 鱼漂[admin.net(#)163.com] 使用DOS命令编写的,一个简单的,生成供Apache使用的数字证书的小工具,CATool运行在Windows操作系统上;此工具已内置openssl,并使用它来生成数字证书。

CATool参考了另外一个Bash写的脚本 ( http://www.openssl.org/contrib/ssl.ca-0.1.tar.gz ),并增加了部分功能。(如果您在Windows中安装Cygwin的话,仍然可以在Windows下使用ssl.ca-0.1.tar.gz,如果没有安装Cygwin,请在Windows下使用CATool).

CATool调用openssl来生成数字证书,生成的证书可以给Windows或Unix(Linux)下的Apache使用,以支持Apahce的HTTPS。

您可以在 http://www.eit.name/catool/ 找到CATool的最新版本和用法。

此外,openssl官网的工具增强版也可以此下载


201404:第二次更新,更新openssl的版本(Win7下运行正常),避免对vc7运行库的依赖,增加客户端证书签发功能.linux下官方版本增强.

在编写脚本时,通常有单实例运行的需求;比如某个监控脚本,希望同时间只能有一个脚本进程在运行,避免影响业务或是误判断。
一般的做法是通过ps+grep+wc来判断有几个进程在运行,如果超过一个以上则退出,但此方法不够严谨,一方面grep匹配可能有误判,另一方面可能有两个同时刻启动的可能;
还有做法是在脚本最前面,创建一个文件或目录来标识,脚本退出后再清理这个文件,此方法在脚本运行到一半被kill或重启后,由于未执行清理而导致下次运行时判断会失败,就无法再次运行了;

操作系统提供了原子操作级别的文件锁机制,可以在脚本启动时加锁,退出时解锁,同时脚本被意外中断后,文件锁也会被OS释放以避免无法运行,很好的解决了上面的所有问题。

按上面的思路,分别用perl, bash验证了一下,基本符合预期:
(Bash下,不同flock的命令参数可能有所区别。)

Bash:

#!/bin/bash
# Author: tomzhou(admin.net#163.com)

sFile=$0
rMode=$1

#Setting
lFile="/tmp/monitor.tomzhou.lock"


#Locking
touch "$lFile"
if [ "$rMode" != "-r" ]; then
        flock --timeout=0 "$lFile" "$sFile" -r
     #flock -x -w 0 "$lFile" -c "$sFile -r"
     if [ "$?" -ne "0" ]; then
                      echo "Script is running."
                      exit 1
          fi
          exit 0
fi


echo "doing....."
sleep 10
echo "done"


Perl:

#!/usr/bin/perl
# Author: tomzhou(admin.net#163.com)

use Fcntl ':flock';
use Cwd qw(abs_path);
use File::Basename qw(dirname);

#Setting

#Locking
open my $tmpSelFile,'<',$0 or die "Con't open self:$!";
flock $tmpSelFile, LOCK_EX | LOCK_NB or die("Script is running!");


print("doing\n");
sleep(10);
print("done\n");


#Close file
close($tmpSelFile);

分页: 1/1 第一页 1 最后页 [ 显示模式: 摘要 | 列表 ]