2009年1月5日星期一

使用Python创建Ftp服务器

准备环境
1. 安装 python 编译器2.4+ ,点我下载
2. 下载Medusa0.5.4.tar.gz模块,点我下载,然后在cmd下执行 "python setup.py install"安装medusa模块

创建脚本 ftp_serv.py
该脚本允许匿名用户或者用户名anonymous密码anonymous的用户从端口21访问D盘根目录下的ftproot文件夹

=======ftp_serv.py begin=============
import asyncore
from medusa import ftp_server, filesys, logger

def StartServer():
ftpServ = ftp_server.ftp_server( ftp_server.anon_authorizer( "D:\\ftproot"),
ip = '', port = 21,
logger_object=logger.file_logger("log.txt")
)
asyncore.loop()

if __name__ == "__main__":
print "Starting FTP Server.."
StartServer()
print "Server is running..."
========ftp_serv.py end============

脚本编写完毕后,退出,双击运行,大功告成,如图


参考帖子:
http://blog.csdn.net/jiangnanandi/archive/2008/10/22/3124047.aspx
http://wiki.huihoo.com/index.php?title=Medusa

AutoHotkey打开Lotus Notes的邮箱,并替换图标


环境:AutoHotkey Version 1.0.47.06

一 目的
1. 启动Lotus Notes,输入密码(此处以123456为例)
2. 打开notes的邮箱(邮箱的快捷键先为alt+B ,然后键入数字1)

二 脚本如下:
======begin=======
run, notes.exe
WinActivate, Lotus Notes;;防止窗口不激活
winwait, 工作台 ;;等待工作台加载成功(至少title显示出来)
sleep, 1000 ;;保险起见,再等1秒(视网速)
WinActivate, 输入口令 ;;等待密码框加载成功(至少title显示出来)
send, password{enter};;模拟键入密码、回车
sleep, 500
Send !B;;模拟键入Alt+B
sleep, 500
Send {1};;模拟键入1,进入邮箱界面
return
=======end======

三 替换notes的桌面图标
1. 用AutoHotKey的compiler编译成.exe文件,放到系统的启动项里
2. 将"快捷方式发"送到桌面,在"快捷方式发"->"属性"->"更改图标"里面查找路径为: %SystemDrive%\Lotus\Notes\notes.exe
3. 大功告成


四 参考帖子:
版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://xbeta.blogbus.com/logs/3777446.html

2009年1月4日星期日

Firefox-CHMreader-快捷键冲突解决


最近在公司读chm的文档,用Windows自带的chm阅读器发现字体太小,完全没法阅读。





于是开始找第三方chm阅读器,无意中发现Firefox的插件CHM reader居然也能阅读chm而且还是中国人写的,于是马上装了一个,发现使用 文件-> Open CHM files.. 就能阅读了,而且能使用FF默认的ctrl+鼠标滚轮 放大字体,以及保存书签的功能,真得挺方便。但是随后问题来了。。FF3.0 默认的快捷键 ctrl+E是 搜索,这个与 CHM reader默认的 “查看”->'侧栏'->'CHM reader'打开CHM目录的快捷键冲突,导致无法使用

幸好有google,现将解决方式贴上

============
1.下载 Keyconfig ,地址为

http://mozilla.dorando.at/

单击 Keyconfig.xpi,然后顺着步骤让它自动安装完吧。
2. 然后把 Firefox 关了(*注意不是重启*)。

这个插件默认没有提供像上下左右键一样功能的属性选项,所以,我们要手动加入一些选项。打开 prefs.js 文件

对于 Windows2000,XP 的用户,用记事本打开 %AppData%\Mozilla\Firefox\Profiles\[profile]\ 目录下的 prefs.js
(%AppData% 一般是 C:\Documents and Settings\[User Name]\Application Data\ 这个目录,好像是个环境变量?)

对于Linux用户,这个文件是 ~/.mozilla/firefox/[profile]/prefs.js

在文件的末尾添加:
代码
user_pref("keyconfig.main.xxx_key_PageUp", "!][][][goDoCommand('cmd_scrollPageUp');");
user_pref("keyconfig.main.xxx_key_ScrollPageDown", "!][][][goDoCommand('cmd_scrollPageDown');");
user_pref("keyconfig.main.xxx_key_ScrollLineUp", "!][][][goDoCommand('cmd_scrollLineUp');");
user_pref("keyconfig.main.xxx_key_ScrollLineDown", "!][][][goDoCommand('cmd_scrollLineDown');");
user_pref("keyconfig.main.xxx_key_ScrollLeft", "!][][][goDoCommand('cmd_scrollLeft');");
user_pref("keyconfig.main.xxx_key_ScrollRight", "!][][][goDoCommand('cmd_scrollRight');");
user_pref("keyconfig.main.xxx_key_ScrollTop", "!][][][goDoCommand('cmd_scrollTop');");
user_pref("keyconfig.main.xxx_key_ScrollBottom", "!][][][goDoCommand('cmd_scrollBottom');");
user_pref("keyconfig.main.xxx_key_findTypeLinks", "!][][][goDoCommand('cmd_findTypeLinks');");
3. 打开 Firefox,在 Tools ->Keyconfig进行配置,找到冲突的ctrl+E,将其'禁用'后,按 "应用"键.
大功告成。


参考帖子地址:
http://board.mozest.com/viewthread.php?tid=14074