Yuri's profile/tmpBlogListsSkyDrive Tools Help

/tmp

April 10

修理SkyDrive

好吧,我就不说Microsoft Live家族代码质量与用户体验的坏话了,不过SkyDrive缓慢的更新速度实在让人抓墙,过了大半年才添几个file list layout,还不能在Perference里设置default样式,View Details时文件列表挤在一团。还好我们有GreaseMonkey神器,可以自己动手。

http://userscripts.org/scripts/review/46056 <-- 需要的同学请自取。

From blog
March 08

调试Firefox Extension的方法

Mozilla Developer Center介绍了几个开发过程中的常用扩展,除此以外调试过程中常用以下两个方法:

1. 在console下用命令行启动Firefox,比如Mac OS下输入

/Applications/firefox.app/Contents/MacOS/firefox

这样在插件的*.js里用 dump(foo + "\n"); 就可以在console下打印log了。

还有一个叫DebugLogger的插件,可以按不同的extensions输出log,不至于混在一起。使用方法参见 http://mozmonkey.com/debuglogger/

2. 安装Venkman,启动该扩展后选择菜单Debug,去掉勾选Exclude Browser Files,Loaded Scripts和Open Windows窗口会列出已安装的其它扩展的js和XUL文件,设置breakpoint可以单步调试扩展了。

March 05

修改Better GMail 2扩展

Updated, 原作者升级了插件到Better Gmail 2到0.7.3.2(https://addons.mozilla.org/en-US/firefox/addon/6076),修正了大部分失效的scripts,请无视我的修改版。:)

From twitter:
  • 手工更新了Better Gmail 2三个过期的、失效无法忍的脚本(add row highlights, folders4gmail, hide spam count),取了个版本0.7.3.1。
  • Better Gmail 2的0.7.3不知为啥打了两个相同的jar包。。。把自己用的版本里folders4gmail改成了默认folders全展开,这样看邮件列表目录下zh-kernel组未读邮件数目方便^_^
  • Better Gmail 2选中的一个user script的作者是华人,不过他写的script对新版GMail无效了。。。他的blog http://amoszhang.com/blog/
  • 改了下hide invite box的user script,GMail里可以把Invite隐藏了,不知道Google怎么想的,一直不肯去掉Invite Box。

下载:

我的GMail截图:)

September 14

HOWTO: Compiling and Installing PHP 5 and GD on Leopard

PHP 5.2.6 that bundled with Mac OS 10.5.4 is broken and has no GD supporting so I have to compile it myself to enable the GD library. I love to maintain the lib packages by Macports instead of building from source codes, but I prefer to install the application such as MySQL from the official img file. The article "Enabling, Compiling and Installing PHP 5 on Mac OS X Leopard" pretty meet my requirement. But when I executed "make" command the compiler reported two errors: Undefined symbols: "_iconv_close" blahblahblah... and another error is about OpenSSL lib. Just modify the configure command like this to fix:

./configure \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--with-apxs2=/usr/sbin/apxs \
--with-ldap=/usr \
--with-kerberos=/usr \
--enable-cli \
--with-zlib-dir=/usr \
--enable-exif \
--enable-ftp \
--enable-mbstring \
--enable-mbregex \
--enable-sockets \
--with-iodbc=/usr \
--with-curl=/usr \
--with-config-file-path=/etc \
--sysconfdir=/private/etc \
--with-mysql-sock=/var/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-mysql=/usr/local/mysql \
--with-xmlrpc \
--with-xsl=/usr \
--without-pear \
--with-libxml-dir=/usr \
--with-iconv=shared,/opt/local \
--with-openssl=shared,/opt/local \
--with-pdo-mysql=/usr/local/mysql/bin/mysql_config \
--with-gd \
--with-jpeg-dir=/opt/local \
--with-png-dir=/opt/local \
--with-freetype-dir=/opt/local

Then 'make clean' and 'make' again and it will be compiled smoothly.


August 03

HOWTO: 通过SSH Tunnel反向连接控制局域网内Window电脑

主控端:一台有公网IP,开放了SSH服务的Linux/Windows主机(Windows安装OpenSSH可参见http://pigtail.net/LRP/printsrv/cygwin-sshd.html)。
被控端:局域网内一台开放了远程桌面管理(3389端口)的Windows主机。
 
被控端的局域网不能在防火墙上开放端口映射,装上Hamachi之类的免费VPN也不能穿墙,只好用反向连接的方法:
1. 被控端Windows下载Tunnelier(http://dl.bitvise.com/Tunnelier-Inst.exe)并安装运行。Putty也可以,但是没有断线重连功能,参见http://www.megasecurity.org/papers/How to Bypass Your Corporate Firewall Using SSH Tunneling.pdf
2. 在Login标签栏中,Host填写主控端的公网IP或域名如xxx.3322.org,Username、Initial method(登录授权方式)根据具体情况填写。

3. 在S2C Fwding标签栏中,Add一个记录,Listen Interface填写0.0.0.0,即本机IP。List. Port填写3389。Destination Host是要将对监听IP的访问转发到的目标主机IP,因为我只想控制本台Windows主机,所以填写localhost。Dest. Port填写3389,即转发到目标Windows主机的3389端口。
勾选上Accept server-side port forwading。


4. 点击Save Profile As,保存配置。
5. 点击Login,输入密码。连接成功的话SSH Tunnel就建立起来了。
6. 在主控端上,用Linux的Terminal Server Client或Windows的远程桌面连接localhost,就可以控制远程的Windows主机了。

** Tunnelier可以设置如果断线自动重连,不过还是不太保险。研究研究Putty的代码,加上用MSN机器人或IRC bot来远程控制的功能,会更靠谱。

 

Yuri

Occupation
Location
Interests
Shut up and code!
Advanced Programming in the UNIX(R) Environment (2nd Edition)
Programming Perl
Public folders