实易嵌入式智能DNS 3.1.0-RELEASE正式版发布

2010年7月15日 16hot 1 条评论

修正问题:

1、解决导入时重复记录问题
2、线路列表上下移动的问题
3、安全规则上下移动的问题
4、TXT记录安全 过滤限制了~符号的问题
5、 HTTP登录时,帐号信息不显示问题
6、添加 线路IP,停止、禁用状态不一致问题
7、在具体线路列表里,看不到改变后应用按钮问题

新增功能:

1、日志搜索功能
2、日志清空功能
3、日志导出功能
4、终端恢复默认 80端口
5、记录查找结果快速修改及分页功能
6、域名、记录备注功能
7、远程数据备份接口功能
8、产品注销注册功能
9、 重启DNS服务
10、黑名单功能(线路管理)
11、 DNSSEC 功能
12、设置系统时间功能

软件升级:

1、核心系统升级到FreeBSD-8.0最新稳定版本
2、 bind 升级到9.4-ESV最新稳定版本
3、分别支持32位和64位CPU两个版本

下载地址:

3.1.0-RELEASE 32位安装包

3.1.0-RELEASE 64位安装包

更多下载…

升级说明:

警告:

1、只能从3.0版本升级到3.1版本,不能从2.x版本升级到3.1版本

2、升级之前,务必先备份数据

1、备份数据,在“数据备份”,点击“导出数据”
2、上传升级
2.1、下载IMG文件;
2.2、在“升级系统”里,上传IMG;
2.3、其中“数字签名”,将下载描述里的MD5校验码拷贝到“粘贴数字签名”里;
2.4、上传成功后,会自动校验,升级完毕后会自动重启。
3、光盘升级
3.1、下载3.1版ISO文件,刻录光盘
3.2、重新安装系统;
3.3、启动后,登录进去,在“数据备份”,将备份文件导入,注意要选择“覆盖旧数据”;
3.4、数据导入后,将会自动重启。

分类: 实易智能DNS 标签: , ,

正则表达示全集,包括验证汉字在内(转)

2010年7月9日 16hot 没有评论

(“/^[\xa1-\xff]+$/”这是一个纯中文字符串
正则表达式用于字符串处理、表单验证等场合,实用高效。现将一些常用的表达式 收集于此,以备不时之需。

匹配中文字符的正则表达式: [\u4e00-\u9fa5]
评注:匹配中文还真是个头疼的事,有了这个表达式就好办了

匹配双字节字符(包括汉字在内):[^\x00-\xff]
评注:可以用来计算字符串的长度(一个双字节字符长度计2,ASCII字符计 1)

匹配空白行的正则表达式:\n\s*\r
评注:可以用来删除空白行

匹配HTML标记的正则表达式:<(\S*?)[^>]*>.*?|<.*? />
评注:网上流传的版本太 糟糕,上面这个也仅仅能匹配部分,对于复杂的嵌套标记依旧无能为力

匹配首尾空白字符的正则表达式:^\s*|\s*$
评注:可以用来删除行首行尾的空白字符(包括空格、制表符、换页符等等),非常有用的表 达式

匹配Email地址的正则表达式:\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
评注:表单验 证时很实用

匹配网址URL的正则表达式:[a-zA-z]+://[^\s]*
评注:网上流传的版本功能很有限,上面这个基本可以满足需求

匹配帐号是否合法(字母开头,允许5-16字节,允许字母数字下划线):^[a-zA-Z][a-zA-Z0-9_]{4,15}$
评注: 表单验证时很实用

匹配国内电话号码:\d{3}-\d{8}|\d{4}-\d{7}
评注:匹配形式如 0511-4405222 或 021-87888822

匹配腾讯QQ号:[1-9][0-9]{4,}
评注:腾讯QQ号从10000开始

匹配中国邮政编码:[1-9]\d{5}(?!\d)
评注:中国邮政编码为6位数字

匹配身份证:\d{15}|\d{18}
评注:中国的身份证为15位或18位

匹配ip地址:\d+\.\d+\.\d+\.\d+
评注:提取ip地址时有用

匹配特定数字:
^[1-9]\d*$    //匹配正整数
^-[1-9]\d*$   //匹配负整数
^-?[1-9]\d*$    //匹配整数
^[1-9]\d*|0$  //匹配非负整数(正整数 + 0)
^-[1-9]\d*|0$   //匹配非正整数(负整数 + 0)
^[1-9]\d*\.\d*|0\.\d*[1-9]\d*$   //匹配正浮点数
^-([1-9]\d*\.\d*|0\.\d*[1-9]\d*)$   //匹配负浮点数
^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$  //匹配浮点数
^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0$    //匹配非负浮点数(正浮点数 + 0)
^(-([1-9]\d*\.\d*|0\.\d*[1-9]\d*))|0?\.0+|0$   //匹配非正浮点数(负浮点数 + 0)
评注:处理大量数据时有用,具体应用时注意修正

匹配特定字符串:
^[A-Za-z]+$  //匹配由26个英文字母组成的字符串
^[A-Z]+$  //匹配由26个英文字母 的大写组成的字符串
^[a-z]+$  //匹配由26个英文字母的小写组成的字符串
^[A-Za-z0-9]+$  //匹配由数字和 26个英文字母组成的字符串
^\w+$  //匹配由数字、26个英文字母或者下划线组成的字符串
评注:最基本也是最常用的一些表达式

分类: 开发 标签:

使用enca转换文件编码

2010年7月8日 16hot 没有评论

安装enca:

# cd /usr/ports/converters/enca
# make install clean

对一个目录下的文件进行转换编码:

# find . -type f | grep -E -v “.svn|.gif|.jpg|.png” | xargs enca -L zh_CN -x UTF-8

分类: BSD/linux, Shell 标签: , ,

实易嵌入式智能DNS 3.1.0版功能说明

2010年6月23日 16hot 1 条评论

修正问题:

1、解决导入时重复记录问题
2、线路列表上下移动的问题
3、安全规则上下移动的问题
4、TXT记录安全 过滤限制了~符号的问题
5、 HTTP登录时,帐号信息不显示问题
6、添加 线路IP,停止、禁用状态不一致问题
7、在具体线路列表里,看不到改变后应用按钮问题

新增功能:

1、日志搜索功能
2、日志清空功能
3、日志导出功能
4、终端恢复默认 80端口
5、记录查找结果快速修改及分页功能
6、域名、记录备注功能
7、远程数据备份接口功能
8、产品注销注册功能
9、 重启DNS服务
10、黑名单功能
11、 DNSSEC 功能
12、设置系统时间功能

软件升级:

1、核心系统升级到FreeBSD-8.0最新稳定版本
2、bind 升级到9.4-ESV最新稳定版本
3、分别支持32位和64位CPU两个版本

下载地址:

3.1.0-BETA3 32位安装包

3.1.0-BETA3 64位安装包

更多下载…

How to compile 32bit applications on FreeBSD-amd64

2010年6月18日 16hot 没有评论

With sufficient disk space, its straight forward. I set up a fake root
directory, extract a minimal i386 FreeBSD system into it. The attached
script is used to start a 32bit chroot-ed environment, either to run
a command or start a shell. I have successfully built a large number
of 32-bit ports on a amd64 bit server this way.

Let me know if you have more questions.
Mark

————– next part ————–

#!/bin/sh -e

# start-i386 [cmd ..]
# from http://www.nabble.com/i386-package-building-on-an-amd64-system-t4441068.html

ROOT=/b/jails/i386
REVISION=”6.2″
BRANCH=”stable”
OSVERSION=602112

UNAME_s=”FreeBSD”
UNAME_m=”i386″
UNAME_p=”i386″
UNAME_r=$REVISION-$BRANCH
UNAME_v=”$UNAME_s $UNAME_r #6: Sun Sep 23 11:41:48 PDT 2007 root at osprey.kermodei.com:/usr/src/sys/i386/compile/OSPREY”

export UNAME_s UNAME_r UNAME_v UNAME_m UNAME_p OSVERSION ROOT

if [ -r $ROOT/dev/zero ]
then
echo dev already mounted
else
mount -t devfs dev $ROOT/dev
fi
ln -sf ld-elf.so.1 $ROOT/libexec/ld-elf32.so.1
echo “libpthread.so.2 libthr.so.2
libpthread.so libthr.so” > ${ROOT}/etc/libmap.conf
cp ${ROOT}/etc/libmap.conf ${ROOT}/etc/libmap32.conf
mkdir -p ${ROOT}/usr/local/bin

cp /usr/local/bin/bsdmake ${ROOT}/usr/local/bin
cp /etc/make.conf ${ROOT}/etc/
cp /etc/resolv.conf ${ROOT}/etc/
cp /etc/hosts ${ROOT}/etc/

HOME=/root
export HOME

if [ $# = 0 ] ; then
exec chroot $ROOT /bin/csh
else
echo “$@” | exec chroot $ROOT /bin/sh
fi

http://lists.freebsd.org/pipermail/freebsd-amd64/2007-November/010466.html

分类: BSD/linux 标签:

php-excel,用PHP导出excel文件

2010年6月7日 16hot 没有评论

php-excel是一个PHP导出excel文件的类库。导出的是XML文件,用office2003,openoffice3都可以正常打开。

官方网站:

http://code.google.com/p/php-excel/

简单的例子:

<?php

// load library
require ‘php-excel.class.php’;

// create a simple 2-dimensional array
$data = array(
1 => array (‘Name’, ‘呵呵’),
array(‘Schwarz’, ‘Oliver’),
array(‘Test’, ‘Peter’)
);

// generate file (constructor parameters are optional)
$xls = new Excel_XML(‘GB2312′, true, ‘My Test Sheet’);
$xls->addArray($data);
$xls->generateXML(‘my-test’);

?>

分类: PHP 标签: , ,

在 svn 的 post-commit hook 中使用 Gmail SMTP(转)

2010年6月3日 16hot 没有评论

Subversion 的 post-commit hook 是個很方便的功能,可以讓你在 commit 程式到 Repository 後,自動去做一些事。其中最有用的就是把 commit log 寄給相關的 developer。

在人人都有 Gmail 且 Gmail 也支援 SMTP 寄信的情況下,透過 Gmail 來寄出 commit log 應該是個好 idea。只不過, 目前的 mailer.py 並不支援 Gmail 的 TLS,所以下面的修改,就是要要將 mailer.py 修改成支援 TLS。

如果你是使用 Debian 或是 Ubuntu,請用 sudo apt-get install subversion-tools 將相關的 Subversion 工具裝到你的系統中。mailer.py 就在 /usr/share/subversion/hook-scripts/mailer 的目錄下。打開 mailer.py 找到 SMTPOutput class 中的 finish() menthod 將他改成(紅色是修改的部分):

def finish(self):
server = smtplib.SMTP(self.cfg.general.smtp_hostname)
if self.cfg.is_set(‘general.smtp_username’):
server.ehlo()
server.starttls()
server.ehlo()
server.login(self.cfg.general.smtp_username,
self.cfg.general.smtp_password)
server.sendmail(self.from_addr, self.to_addrs, self.buffer.getvalue())
server.close()

然後將,mailer.conf 的 [general] section 修改成下面的設定,並且放在你的 (svn repository)/conf 下:

[general]
smtp_hostname = smtp.gmail.com:587
smtp_username = your_gmail_account@gmail.com
smtp_password = your_gmail_password

這樣就成了。

分类: BSD/linux, 转载 标签:

FreeBSD设置音量

2010年6月1日 16hot 没有评论

换了笔记本后,发现音量很小,听起来特别吃力,google了下:

设置音量的命令:

mixer -s vol 55 设置音量为55
mixer -s pcm 55 设置pcm为55
mixer -s vol -1 设置音量减1

另外还有遇到只能用耳机,笔记本喇叭没声音的问题。通过设置sysctl来解决:

sysctl -w hw.snd.default_unit=1

分类: BSD/linux 标签:

chroot-symlinks

2010年5月31日 16hot 没有评论

A typical scenario is one where “DefaultRoot ~” is used to restrict users to their home directories, and where the administrator would like to have a shared upload directory, say /var/ftp/incoming, in each user’s home directory. Symbolic links would normally be used to provide an arrangement like this. As mentioned above, though, when chroot(2) is used (which is what the DefaultRoot directive does), symlinks that point outside the new root (the user’s home directory in this case) will not work. To get around this apparent limitation, it is possible on modern operating systems to mount directories at several locations in the filesystem.

To have an exact duplicate of the /var/ftp/incoming directory available in /home/bob/incoming and /home/dave/incoming, use one of these commands:

    * Linux (as of the 2.4.0 kernel):

mount --bind /var/ftp/incoming /home/bob/incoming
  mount --bind /var/ftp/incoming /home/dave/incoming

    * BSD (as of 4.4BSD):

mount_null /var/ftp/incoming /home/bob/incoming
  mount_null /var/ftp/incoming /home/dave/incoming

    * Solaris:

mount -F lofs /var/ftp/incoming /home/bob/incoming
  mount -F lofs /var/ftp/incoming /home/dave/incoming

The same technique can be used for <Anonymous> directories, which also operate in a chroot()ed environment.

As usual, more information can be found by consulting the man pages for the appropriate command for your platform. The commands for other flavors of Unix will be added as needed.

In order to have these tricks persist, to survive a system reboot, the /etc/fstab (or /etc/vfstab) file may need to have these mounts added. Consult your local fstab(5) (or vfstab(4) for Solaris) man pages for more information.

http://www.proftpd.org/localsite/Userguide/linked/chroot-symlinks.html

分类: BSD/linux 标签: , , ,

统计状态说明

2010年5月30日 16hot 没有评论

The Statistics File

The statistics file generated by BIND 9 is similar, but not identical, to that generated by BIND 8.

The statistics dump begins with a line, like:

+++ Statistics Dump +++ (973798949)

The number in parentheses is a standard Unix-style timestamp, measured as seconds since January 1, 1970. Following that line are a series of lines containing a counter type, the value of the counter, optionally a zone name, and optionally a view name. The lines without view and zone listed are global statistics for the entire server. Lines with a zone and view name for the given view and zone (the view name is omitted for the default view).

The statistics dump ends with the line where the number is identical to the number in the beginning line; for example:

— Statistics Dump — (973798949)

The following statistics counters are maintained:

success The number of successful queries made to the server or zone. A successful query is defined as query which returns a NOERROR response with at least one answer RR.
referral The number of queries which resulted in referral responses.
nxrrset The number of queries which resulted in NOERROR responses with no data.
nxdomain The number of queries which resulted in NXDOMAIN responses.
failure The number of queries which resulted in a failure response other than those above.
recursion The number of queries which caused the server to perform recursion in order to find the final answer.

Each query received by the server will cause exactly one of success, referral, nxrrset, nxdomain, or failure to be incremented, and may additionally cause the recursion counter to be incremented.

分类: 16hot 杂记 标签: