关于作者

用户名:kerberos
笔名:kerberos
地区:
行业:其他

日历  

快速登录

+ 用户名:
+ 密 码:

在线留言



访问统计:
文章个数:9
评论个数:33
留言条数:4




Powered by BlogDriver 2.1

自由之城

 

文章

换 blog 了

这个 blog 的模板很恶心,固定宽度的。我又不会改它的 CSS 使之适应宽度。所以换到

http://kerberos.cublog.cn 了。 欢迎大家访问。:)

- 作者: kerberos 2008年04月11日, 星期五 18:27  回复(0) |  引用(0) 加入博采

换 blog 了

这个 blog 的模板很恶心,固定宽度的。我又不会改它的 CSS 使之适应宽度。所以换到

http://kerberos.cublog.cn 了。 欢迎大家访问。:)

- 作者: kerberos 2008年04月11日, 星期五 18:27  回复(0) |  引用(0) 加入博采

换 blog 了

这个 blog 的模板很恶心,固定宽度的。我又不会改它的 CSS 使之适应宽度。所以换到

http://kerberos.cublog.cn 了。 欢迎大家访问。:)

- 作者: kerberos 2008年04月11日, 星期五 18:26  回复(0) |  引用(0) 加入博采

在 Linux 下用wine 运行 sourceinsight
为了在 Linux 下跑 SourceInsight, 特地 emerge  了一个 wine-0.98。 效果还不错,
一些方便的配置,收藏之。

EasyWine论坛 » 『 Wine讨论 』 » wine 里的字体设定方法
deman

wine 里的字体设定方法

 参考 http://moto.debian.org.tw/viewtopic.php?t=7164 wsun013
 
 1.
 修改/加入 ~/.wine/user.reg
 
 [Software\\Wine\\WineBrowser]
 "Browsers"="firefox"
 
 [Software\\Wine\\X11 Driver]
 "ClientSideAntiAliasWithRender"="N"
 
 
 [Software\\Wine\\Fonts\\Replacements] 1123127854
 @="AR PL ShanHeiSun Uni"
 "Arial"="AR PL ShanHeiSun Uni"
 "Fixedsys"="AR PL ShanHeiSun Uni"
 "Microsoft Sans Serif"="AR PL ShanHeiSun Uni"
 "MingLiU"="AR PL ShanHeiSun Uni"
 "MS UI Gothic"="AR PL ShanHeiSun Uni"
 "PMingLiU"="AR PL ShanHeiSun Uni"
 "Simsun"="AR PL ShanHeiSun Uni"
 "Songti"="AR PL ShanHeiSun Uni"
 "System"="AR PL ShanHeiSun Uni"
 "Tahoma"="AR PL ShanHeiSun Uni"
 "Terminal"="AR PL ShanHeiSun Uni"
 
 
 
 第一段为 wine 所使用的 web browser, 在 console 能用的script 皆
 可以写入, eg. 在console 下我打 firefox 可以开启firefox, 那就在
 里面填入 firefox; 同理, 填入opera 将会把url pass 到opera 这个 script/binary
 
 第二段是wine 的defualt 有开antialias, 但小弟我不喜欢看糊的字
 所以手动加入这一段
 
 第三段是 Font 的替代, 因为win32的UI 大多为这几样
 
 
 2.
 修改/加入 ~/.wine/system.reg
 [System\\CurrentControlSet\\Hardware Profiles\\Current\\Software\\Fonts]
 "LogPixels"=dword:00000082
 
 这里是改变dialog window buttom的字体大小
 
 
 3.
 修改/加入 ~/.wine/windows的dir/win.ini
 [Desktop]
 menufontsize=13
 messagefontsize=13
 statusfontsize=13
 IconTitleSize=13
 
 这边是改变其他字体的大小

- 作者: kerberos 2006年03月7日, 星期二 15:44  回复(1) |  引用(0) 加入博采

Debian 上安装 Subversion 服务器
在 Debian 安装 Subversion 服务器,需要达到以下的几个具体要求:
  1. 所有访问 Subversion 的链接必须使用 https 协议来访问,不通过 https 访问 Subversion 应该被拒绝。
  2. 不允许匿名用户访问 Subversion.
  3. 根据不用的用户组来设定不同的 Subversion 权限。
一、安装软件
使用 Sarge 的包管理工具 aptitude 安装以下几个包:
  1. subversion-tools
  2. libapache2-svn
  3. apache2-utils
  4. apache2-mpm-worker
二、配置软件包
在 Apache2 安装完成以后,系统应该自动启动 apache2 来接受 http 访问,使用浏览器浏览服务器,应该可以看到 apache2 的 Welcome 页面。
由于我们需要 SSL 的支持,所以在这里,我们还需要对 Apache2 进行 SSL 的配置:
  1. 运行命令 a2enmod ssl 。打开 apache2 的 SSL 支持。
  2. 编辑 /etc/apache2/ports.conf 文件。 在此文件中,缺省只有 Listen 80,也就是apache 只接受 80 端口的普通 http 访问。我们再添加一项 "Listen 443",443 是 https 的端口。
  3. 编辑 /etc/apache2/sites-available/default 文件,把 “NameVirtualHost *" 改为 "NameVirtualHost *:80" , "<VirtualHost *>" 改为 "<VirtualHost *:80>"。
  4. 运行命令 apache2-ssl-certificate, 根据提示回答问题, 生成 SSL 的证书,自动被放置在 /etc/apache2/ssl/。
  5. 在 /etc/apache2/sites-available/ 下建立一个新的文件,名字可以叫做 ssl . 这个文件可以拷贝 /etc/apache2/sites-availbale/default 获得。 但是要修改 VirtualHost 和 NameVirtualHost 的端口为 443。 在这个文件中加入以下两行:"SSLEngine On" 和 "SSLCertificateFile /etc/apache2/ssl/apache.pem"。
  6. 使用 a2ensite ssl 来使我们的 ssl 虚拟主机生效。
  7. /etc/init.d/apache2 force-reload 重新启动 apache2 的系统服务。
  8. 使用其他机器的浏览器来登陆本服务器,注意要使用 https 协议来测试我们的 apache 服务器是否接受 https 连接。
  9. 使用 a2enmod dav_svn 来加载 subversion 模块。
  10. subversion 模块的配置文件在 /etc/apache2/mods-available/dav_svn.conf 中。 为了限制非 SSL 用户登陆,我们可以使用如下一句 "SSLRequireSSL" 来限制。 为了禁止匿名用户登陆,加上 "Require valid-user" 一句。
三、FAQ
Q: 为什么的我的 SSL 虚拟主机无法启动?
A: 在 Debian 上安装服务器和配置使相当简单的,如果你按照以上步骤执行了,应该没有问题。 需要注意的就是在执行 apache2-ssl-certificate 的时候,其中有一项使询问你的主机名,这一点,必须和你的主机相一致。

四、我的配置文件
/etc/apache2/ports.conf

Listen 80
Listen 443


/etc/apache2/mods-available/dav_svn.conf


DAV svn
SSLRequireSSL
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /pub/repos/svn/etc/svnpasswd
AuthzSVNAccessFile /pub/repos/svn/etc/svnauthz
Require valid-user



/etc/apache2/sites-available/default

NameVirtualHost *:80

..............................
..............................


/etc/apache2/sites-available/ssl

NameVitualHost *:443

SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.pem
...................................
...................................


- 作者: kerberos 2006年02月27日, 星期一 15:31  回复(0) |  引用(0) 加入博采

请大家介绍一个比较稳定的易用的免费的Blog站点

受不了 blogchina 了, 太难看难用了。 MSN 就算了吧。

- 作者: kerberos 2006年02月20日, 星期一 23:28  回复(1) |  引用(0) 加入博采

Connect to E680i on linux

Linux: gentoo
Kernel: 2.6.15

Confirm your kernel support usblan, acm modem and usbnet zaurus feature.
In my linux config files: /usr/src/linux/.config files:
CONFIG_USB_BELKIN=y
CONFIG_USB_NET_ZAURUS = m
CONFIG_USB_ACM = m

Connect the e680i on the computer with usb link.
# modprobe cdc_acm

Thus you can find the Motorola modem device on you /dev directory. My device file name  is /dev/ttyACM0. If you can't find the device name, you can use "dmesg" command to find more information.

#dmesg
usb 2-2: new full speed USB device using uhci_hcd and address 6
cdc_acm 2-2:1.0: ttyACM0: USB ACM device

#echo at+mode=99 > /dev/ttyACM0

The e680 will switch to usbd mode. and config the ip address. Maybe the usblan driver on window can send the ip address to e680i, so it can get the ip address "169.254.142.2". The e680i usblan driver on linux is "Zaurus" witch is the standard driver. I found that the files on e680i /etc/hotplug/network_fd.agent can setup the ip address as 192.168.1.2 . so we can config the usblan's ip as "192.168.1.1" on our PC.

#modprobe zaurus

Load the zaurus usb net driver.

#ifconfig -a

Confirm the zaurus usbnet interface name. On my laptop is "usb0"

#ifconfig usb0 192.168.1.1

#telnet 192.168.1.2
Trying 192.168.1.2...
Connected to e680i.
Escape character is '^]'.

MontaVista Linux Consumer Electronics Edition 3.0
Linux/armv5tel 2.4.20_mvlcee30-mainstone


(none) login:



Login as root. You can enter the e680i .

Have fun.

- 作者: kerberos 2006年02月20日, 星期一 22:54  回复(0) |  引用(0) 加入博采

Build native application on E680
Build native application on E680

Motorola E680/E680i mobile is based on Montavista Hardhat Linux
and Trolltech Qt embedded. All application on E680/E680i are based
on EZX libraries not Qt embedded directly. Motorola doesn't release
the SDK of EZX libraries, So if wanna develop applications for
E680/E680i, We must build a development envorienment from scratch.

With dynamic link technique, Linux can replace the library that the
applications depended if have the same function symbol in ELF format.
Imagine that we write a dynamic library with so name libm, and
keep the sin() function's implementation empty. If a application is
linked to our libm when it is compiled, when it run, library loader
of linux will search library path to load libm. Even this application
is linked to our dirty libm when it is compiled, but when it run with
the correct libm, It will get the correct result. Thus we can build
the dirty libezx libraries with the same function symbols and empty
implementation to build the application, when this application run
on E680/E680i, it will work in the abstract.

Fortunately, Liuto from CCMOVE forum provide a part of EZX SDK for
Motorola A760/A768. I think that Motorola's EZX libraries for
E680/E680i is compatible with A768/A780 in function declaration. So
we can use that header files for A760/A768 and libezx libraries on
E680 system to build the native application for E680/E680i. And
I can run a simple application based with EZX libraries on E680
successfully.

The particular steps are followed:
1. Build the qt-x11-free-2.3.6 to get the moc and uic tools for qt.
2. Build the gcc cross compilers for xscale with VFP patched.
3. Use the qt header files and Other libraries headers in ezx libraries
provided by liuto as our qt header files for cross building.
4. Copy the libezx libraries from E680 system directories
/usr/lib/ezx/lib/libezx* and /usr/lib/libezx* as our qt and EZX
libraries for building.
5. Install tmake tools to product the Makefile for our application.
After install tmake, we must modify the template file to support build
application for E680. I copied the template file from directory
"qws/linux-arm-g++" to "qws/linux-e680-g++" and modifed the tmake.conf
line 54.
"TMAKE_LIBS_QT_THREAD = -lqte-mt-xscale-r -lezxappbase-xscale-r -lezxappsdk-xscale-r -lezxjpeg-xscale-r -lezxtapi-xscale-r -lezxfunlight-xscale-r"
instead of "TMAKE_LIBS_QT_THREAD = -lqte-mt"
This step is only expediently product the correct LDFLAGS to link EZX libraries.

6. Set up the building envorienment. Here is my .bashrc in my home
directory:
PATH=/usr/local/arm/bin:/home/kerberos/e680/gnu_toolchain/qt-x11-2.3.6/bin:$PATH
QTDIR=/home/kerberos/e680/gnu_toolchain/qt-embedded-2.3.6
TMAKEPATH=/home/kerberos/e680/tmake/lib/qws/linux-e680-g++
export PATH QTDIR TMAKEPATH
Finally, we make the envorienment variables effect use command . ~/.bashrc

7. Here is my test program:
test.pro:

TEMPLATE = app
CONFIG += qt thread release warn_off
TARGET = testezx

HEADERS +=

SOURCES += test.cpp
LIBS +=



test.cpp:
[CODE]
#include <ZApplication.h>
#include <ZMainWidget.h>
#include <ZMultiLineEdit.h>
#include <qlineedit.h>
#include <ZScrollView.h>
#include <qframe.h>
#include <ZPushButton.h>
#include <qpushbutton.h>

int main (int argc, char** argv)
{
        QWidget* cst;
        ZScrollView* sv;
        ZMultiLineEdit* ml;

        ZApplication app (argc, argv);
        ZMainWidget* w = new ZMainWidget (true,0);
        sv = new ZScrollView (w, "sv");
        w->setContentWidget (sv);
        sv->show ();

        /*
        QPushButton* bt = new QPushButton ("Hello E680!", sv->viewport());
        sv->addChild (bt, 0, 0, true);
        bt->show ();
        */

        ml = new ZMultiLineEdit (sv->viewport(), true, 6);
        sv->addChild (ml, 0, 0, true);
        ml->show ();

        cst = w->getCSTWidget();

        QPushButton* mybt = new QPushButton ("quit button", cst);
        mybt->show();

        QObject::connect ( mybt, SIGNAL(click()), qApp, SLOT (slotQuickQuit()) );

        app.setMainWidget (w);
        w->showWithInputMethod(IMID_ENGLISH_KB);
        app.showMainWidget (w);
        return app.exec();
}

[/CODE]
8. Build the demo sources use the command: tmake test.pro > Makefile; make
If success, your will get the testezx program.

9. Copy the testezx program to E680 and use the command: . /home/native/.profile
to setup the runtime envorienment for our program. Then run it, a simple
window will apperence on E680 with English soft keyboard and a multiline edit
control.

Good lucky everyone :).


Resources:
1. qt-x11-free-2.3.6.tar.gz
2. EZX.rar
3. tmake-1.8.5
4. xscale-gcc-vfp-3.3.tar.gz
5. E680 :)

I havn't any space to host that files :(, so I can't provide the download link.

- 作者: kerberos 2005年05月18日, 星期三 22:12  回复(4) |  引用(0) 加入博采

构建E680的开发环境
最近买了个E680的水货手机。本来我手里手机很多了,不过没有一个是Linux的,觉得比较可惜,这可是我的职业 :)。听说E680水货比较便宜,而且在"移动天使"(http://bbs2.ccmove.com/)上的fans正DIY地热火朝天,比较眼热。 冲着E680的DIY性能,我决定买了一个。

在“移动天使”论坛上,大部分DIY的程序是从OPIE拿过来的,所以在E680上必须加载另外一个QT库和OPIE的库,比较浪费资源。幸亏liuto大侠拿到了EZX的SDK,我赶紧下载下来了。很可惜,是A760系列的SDK,E680上没法用。

幸好liuto的ezx SDK有一些头文件,象Moto这种大公司,开发上应该保持连续性。所以我猜测EZX SDK的头文件应该变化不大,这样我就可以使用A760的EZX SDK 的头文件配合E680上的qt,ezx的库文件进行程序的交叉编译了。 果然,我成功了。

下面就是具体步骤:
所需要的资源:
1. xscale-gcc-vfp-3.3.tar.gz
2. ezx-sdk.tar.gz qt-2.3.tar.gz Other_lib_headers.tar.gz
3. tmake-1.8.5
说明:
1. 本来我手头上有一份 montavista 的gcc交叉编译环境,但是它没有包含VFP的支持,需要自己编译一份。在“移动天使”的2号ftp上(ftp://hbsztvu.cn) 9====工具====/编程工具 下有编译好的GCC。
2. 在移动天使的3好服务器上有EZX.rar,这是A760系列的开发包,不能直接用在E680上,不过没有关系,我们只需要这个包里面的ezx-sdk.tar.gz 和 qt-2.3.tar.gz 中的一些头文件。
3. 这个是Trolltech (qt的开发商)公司的一个为Qt项目生成Makefile的工具。当然你也可以使用自己的qmake (在Qt 3.x中使用 qmake, 而在qt 3.0 以前一直是使用tmake的).我懒得编译Qt了,所以直接使用了tmake,tmake是用perl写的,呵呵,不用编译。


步骤:
1. 安装 xscale-gcc-vfp-3.3.tar.gz:
#tar xvzf -C / xscale-gcc-vfp-3.3.tar.gz
gcc 的编译器就装在了/usr/local/arm下。
2. 解开 ezx-sdk 和 qt-2.3 的包

3. 去Trolltech (http://www.trolltech.com) 的网站上去down tmake,安装。

4. 创建一个目录比如我的:
mkdir /home/kerberos/e680/
cd /home/kerberos/e680
tar xvzf /qt-2.3.tar.gz的路径/qt-2.3.tar.gz
qt 的目录是 qt-2.3.6
tar xvzf /ezx-sdk.tar.gz的路径/ezx-sdk.tar.gz
tar xvzf /Other_lib_headers的路径/Other_lib_headers.tar.gz
ezx-sdk 的目录是 ezx, Other_lib_headers 的目录是other

5. 拷贝头文件:
把ezx-sdk 和 other_lib_headers 解开的包的头文件拷贝到qt的头文件目录中:
cp ezx/include/* other/include/* qt-2.3.6/include

6. 拷贝E680上的库文件:
首先要把E680的的一些库文件拷贝出来,方便的方法是telnet到E680以后,使用samba协议拷贝
\\169.254.142.2\system\usr\lib\ezx\lib\ 的库到qt-2.3.6的lib目录下
\\169.254.142.2\system\usr\lib\libezx* 到qt-2.3.6的lib目录下
拷贝过程中要注意,不要拷贝符号链接的库。:) 只有版本号最长的文件名的库才是真正的库文件。

7. 安装tmake:
随便把tmake解开到某个目录中,比如我的在/home/kerberos/e680/tmake-1.8
由于生成Makefile文件需要一些设置,我们这样来做:
cd tmake-1.8/lib/qws
cp linux-arm-g++ linux-e680-g++ -r
vim linux-e680-g++/tmake.conf
来修改tmake.conf文件,具体改这么几行:
54 行: TMAKE_LIBS_QT_THREAD = -lqte-mt
改成 TMAKE_LIBS_QT_THREAD = -lqte-mt-xscale-r -lezxappbase-xscale-r -lezxappsdk-xscale-r -lezxjpeg-xscale-r -lezxtapi-xs cale-r -lezxfunlight-xscale-r
这样是为了连接 EZX库

8. 设置环境变量:
修改 /home/kerberos/.barshrc (你的可能在不同的用户目录下)
增加以下几行:
PATH=/usr/local/arm/bin:$PATH
QTDIR=/home/kerberos/e680/qt-2.3.6
TMAKEPATH=/home/kerberos/e680/tmake-1.8/lib/qws/linux-e680-g++
export PATH TMAKEPATH QTDIR


使环境变量生效:
source /home/kerberos/.bashrc

9. 测试程序:

cd /home/kerberos/e680/
mkdir test
cd test
编辑一个工程文件: testezx.pro
=====================以下是文件内容:
TEMPLATE = app
CONFIG += qt thread release warn_off
TARGET = testezx

HEADERS +=

SOURCES += test.cpp
LIBS +=
================文件内容结束

编辑源文件:
===================== test.cpp 文件内容如下:
[CODE]
#include <ZApplication.h>
#include <ZMainWidget.h>
#include <ZMultiLineEdit.h>
#include <qlineedit.h>
#include <ZScrollView.h>
#include <qframe.h>
#include <ZPushButton.h>
#include <qpushbutton.h>

int main (int argc, char** argv)
{
        QWidget* cst;
        ZScrollView* sv;
        ZMultiLineEdit* ml;

        ZApplication app (argc, argv);
        ZMainWidget* w = new ZMainWidget (true,0);
        sv = new ZScrollView (w, "sv");
        w->setContentWidget (sv);
        sv->show ();

        /*
        QPushButton* bt = new QPushButton ("Hello E680!", sv->viewport());
        sv->addChild (bt, 0, 0, true);
        bt->show ();
        */

        ml = new ZMultiLineEdit (sv->viewport(), true, 6);
        sv->addChild (ml, 0, 0, true);
        ml->show ();

        cst = w->getCSTWidget();

        QPushButton* mybt = new QPushButton ("quit button", cst);
        mybt->show();

        QObject::connect ( mybt, SIGNAL(click()), qApp, SLOT (slotQuickQuit()) );

        app.setMainWidget (w);
        w->showWithInputMethod(IMID_ENGLISH_KB);
        app.showMainWidget (w);
        return app.exec();
}
[/CODE]
==================test.cpp文件内容结束

编译程序:
tmake testezx.pro > Makefile
make

10. 运行程序:
把 testezx 拷贝到SD卡上,telnet 到小E上。运行:
. /home/native/.profile
注意 点后面有一个空格的。
./testezx
你就看见一个空的窗口和一个英文键盘了。


基本上还是我没有拿到小E时候的思路,呵呵,看来我的感觉越来越灵敏了。:)


- 作者: kerberos 2005年05月18日, 星期三 12:09  回复(27) |  引用(0) 加入博采

firefox提高页面加载速度 (转自linuxsir.org)

五步大幅提高firefox页面加载速度。
五步大幅提高firefox页面加载速度。
转自linuxsir.org的simonhuan的大作:
1.在地址栏输入: about:config
2."network.http.pipelining" 设置为 "true"
3."network.http.proxy.pipelining" 设置为 "true"
4."network.http.pipelining.maxrequests" 设置成 30
5. 单击右键,新建一个整数,命名为"nglayout.initialpaint.delay", 值为"0"

限制:如果是拨号上网,就算了。

现在都用 fastfox extension 了。

- 作者: kerberos 2005年01月28日, 星期五 10:11  回复(0) |  引用(0) 加入博采