ubuntu 11.10下freemind输入中文

临时要用FREEMIND画个图,但突然发现系统升级后不能在FREEMIND输入中文了,网上搜索了一下,还没有找到对应的问题。

突然想起来,会不时快捷键冲突导致的?进入freemind的工具-选项中,查看快捷键定义,果然有control+blank的冲突:切换子折叠,因此随便换了个其他快捷键,果然能用。

Posted in Linux | Tagged , | Leave a comment

google彻底被封?

google要彻底悲剧了,好像从今天开始的:

$ nslookup
> server 159.226.8.7
Default server: 159.226.8.7
Address: 159.226.8.7#53
> www.google.com
;; connection timed out; no servers could be reached
> www.google.cn
;; connection timed out; no servers could be reached
> server ns.xinnet.com.cn
Default server: ns.xinnet.com.cn
Address: 202.10.71.53#53
> www.google.com
Server: ns.xinnet.com.cn
Address: 202.10.71.53#53

** server can't find www.google.com: NXDOMAIN
> www.google.cn
Server: ns.xinnet.com.cn
Address: 202.10.71.53#53

** server can't find www.google.cn: NXDOMAIN

同时。8.8.8.8和4.4.4.4也无法访问了。

更新:已经恢复之前的断断续续状态了。

Posted in Linux, Relax | Tagged , , | 2 Comments

colorbox vs thickbox

As it has been compared in this website, we test the two js script for ‘box’ in our site too, colorbox is chosen finally.
The reason: colorbox support an image url without image extension, use the photo:”true” option, in thickbox you must use the iframe to implement this result.

Posted in Program | Tagged , , | Leave a comment

odtphp: A nice library to output openoffice odt file

Recently, I want to add a function in our data center website(Which is only Chinese version now, an English version is preparing): “output the geographic metadata to openoffice odt format”. So, the odtphp project came into my sight.

After download the 1.0.1 version, and try some tests in its code. There is no problem in the text replacing, but if I insert into the odt file an image, the OpenOffice (What I use is LibreOffice) always tell me this file need repair, although the repair result nice. Dig into another search, find this problem and solution in the author’s blog.

Use the latest version (1.3) in the author’s blog, this bug is disappeared.

There is another requirement in my site yet, maybe it is not a problem: The image file which is dynamic produced has not a extension in the url, So the code in odtphp: setImage must change its behavior here.

So I patched the code, and released it here (it’s GPL license):

wlx@wlxpc:~$ diff odf.php odtphp-1.0.1_modified_files/odf.php
111a112,113
> $filename = strtok(strrchr($value, '/'), '/.');
> $file = substr(strrchr($value, '/'), 1);
116,118d117
< $filename=md5($value);;
< $imgext=array('.gif','.jpg','.png','.swf','.psd','.bmp','.tif','.tif','.jpc','.jp2','.jpx','.jb2','.swc','.iff','.wbmp','.xbm','.ico');
< $file=$filename.$imgext[$size[2]];
287,289c286
< //$this->file->addFile($imageKey, 'Pictures/' . $imageValue);
< $this->file->addFromString('Pictures/' . $imageValue,file_get_contents($imageKey));
<
---
> $this->file->addFile($imageKey, 'Pictures/' . $imageValue);

In short, what I do: change the filenmae to a hash string (md5(source)), and save it with file_get_contents function (which could parse the url).

And, a big Thanks to you and your odtphp project: Vikas Mahajan.
Download patch file: odf.php.patch

Posted in Program | Tagged , , , , | Leave a comment

ubuntu evince中字体显示问题

现在ubuntu中默认显示中文是没有问题的,但是遇到有些使用中文字体的英文,显示效果差异就很大,开始还以为是PDF问题,后来用ADOBE READER打开显示就没有问题。
最终发现只要把/etc/fonts/conf.d/49-sansserif.conf中的中文字体替换为simsun就没有问题了。

Posted in Linux | Tagged , , , | Leave a comment

推荐:PHPFetion,飞信的PHP类实现

PHPFetion: http://code.google.com/p/php-fetion/
作者BLOG:http://blog.quanhz.com

实现原理

用PHP的socket函数发送HTTP请求,模拟登录WAP版的飞信,并模拟发送飞信。
具体实现细节可查看此文:用PHP模拟登录WAP飞信实现飞信发送,不过原文中是用curl来实现的,道理相同。

我用此类,在服务器上又可以实现天气预报的定时发送,还能发送服务器重启信息给自己。

Posted in Linux | Tagged , | Leave a comment

vmware server下调整虚拟机磁盘空间

一个WINDOWS虚拟机上的磁盘空间满了,因此需要调整服务器空间。
发现vmware下有很好的工具可以直接调整:
vmware-vdiskmanager
具体步骤如下:
1. 远程登录到虚拟机上,关机。(这个应该也有命令的)
2. sudo vmware-vdiskmanager -x 40Gb xxx.vmdk
3. 用vmrun启动此虚拟机:
vmrun -T server -h 'https://localhost:8333/sdk' -u your_user -p 'your_password' start "[standard] qikan/qikan.vmx"
4. 登录到此虚拟机上,下载一个磁盘分区调整软件,如PM。然后调整磁盘分区大小。
5. OK

Posted in Linux | Tagged , , , | Leave a comment

ubuntu升级到11.10 oneiric

升级之前还是很犹豫的,由于之前11.04版本的unity给我的感觉太差,我在11.04就一直用的是GNOME 2版本,因此害怕新版本的unity仍然不好用。
安装过程还算顺利,基本算的上平滑,能正常启动,进入图形lightdm界面很漂亮,输入密码后直接进入的是GNOME3,试用了一下感觉还是不错的。注销后选择unity进入,发现之前在11.04中添加的快捷菜单已经都自动添加到unity的工具栏上,不错。

现在已经正常使用了,整体感觉不错,比11.04进步很大。

目前遇到的问题:
1. skype关闭后不在任务栏里显示,也不在unity工具栏里显示,找不到了,但程序还在运行,只能通过kill命令来关闭了,暂时用skype就只能最小化了。
2. unity工具栏有时不稳定,可以通过命令重启unity。
unity --reset

Posted in Linux | Tagged , , | Leave a comment

gpscorrelate:可以批量更新照片gps信息的软件

出一次野外后,想着利用iphone4自带的gps信息,再把同时用单反拍的照片也加上gps信息,然后再能找个软件把所有信息都地图化管理那就好了。
搜索了一下,发现在linux下有exiv2工具可以使用,其可以调用exif信息,并可以在命令行上直接修改exif信息,再搜,发现了gpscorrelate,这不正是我想要的功能么:修改/还可以批量修改照片的exif信息! gpscorrelate有两个版本,分布是命令行版本和图形界面版本,并且在ubuntu下可以直接安装:
sudo apt-get install gpscorrelate

Posted in Linux | Tagged , , | Leave a comment

mac unison ssh-askpass 问题

mac升级到lion了,但unison突然不能用了,之前用的很好的,服务器端是ubuntu, unison 2.32.52,mac上安装的也是同一个版本,但今天同步的时候出现了错误:

ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory
Permission denied, please try again.

但是系统上并没有找到此文件,最终在此处找到答案:

http://blog.retep.org/2009/04/09/ssh-askpass-on-osx-10-5/

按照其办法操作后可行!

Posted in mac osx | Tagged , , | Leave a comment