Thursday, March 09, 2006

apt-get阻止软件升级

from: http://blog.xfocus.net/index.php?op=ViewArticle&articleId=41&blogId=1

为了让fcitx在后续的upgrade中不升级,需要这么一条命令:
risker:/home/aa# echo fcitx hold|dpkg --set-selections
今后希望fcitx升级的时候,则可以简单用这么一条命令恢复:
risker:/home/aa# echo fcitx install|dpkg --set-selections
设置了hold后,upgrade的情况如下:

risker:/home/aa# apt-get upgrade
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
下列的软件包的版本将保持持不变:
fcitx (2.0.1-2 => 2.0.2-1)
共升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 1 个软件未被升级。

Tuesday, November 15, 2005

GNU EMACS字体设置

from: http://www.linuxmine.com/5088.html
下午找了些资料,试着修改一下GNU EMACS的字体显示,哈哈,这个活只是空着才搞的,其实没有太大意义。

方法是这样的,在.Xdefaults中加入下面几句,当然要把原来关于GNU EMACS的配置!掉。

Emacs.Font: fontset-small
Emacs.Fontset-0: -*-*-medium-r-normal--15-*-*-*-*-*-fontset-small,ascii:-misc-fixed-medium-r-normal--15-*-*-*-*-*-iso8859-1, chinese-gb2312:-misc-simsun-medium-r-normal--15-*-*-*-*-*-gb2312.1980-*

这样就可以很好的显示中文和非中文字体了。

simsun随便换,small可以改成big,当然下面的也要改。不过你可以同样加一组关于big的单独定义:

Emacs.Fontset-1: -*-*-medium-r-normal--15-*-*-*-*-*-fontset-small,…………
…………
(随你写,照着上面改就可以了 )

用big时把改为
Emacs.Font: fontset-big

就可以了。

改完后,xrdb -load .Xdefaults 就可以立即生效,当然可以重启X(没有这个必要,除非你愿意 )

当让这个对XEmacs效果不好,还没搞定

Happy EMACSing

Scott Violet's Blog: Customizing Ocean Gradients

from: http://weblogs.java.net/blog/zixle/archive/2005/09/customizing_oce_1.html

create the Gradients effect for panel.

Monday, November 14, 2005

The Swing HTML bookmark Parser, together with jTreetable

from http://java.sun.com/products/jfc/tsc/articles/bookmarks/
In this article the author introduces his jTreetable, and the jEditpane's dtd parsing module, based on what he provides the tool for parsing netscape's bookmark.

Saturday, November 05, 2005

Multiple Emacs Shell Buffers

Michael Tsai - Blog - Multiple Emacs Shell Buffers
it is useful when you need it, especially remote login with a telnet session.
You need to open the new shell by
> M-x eshell
When you want to open a new shell session, use
> M-x rename-buffer
to rename the current buffer name from *eshell* to something else, then after you enter the
> M-x eshell
you get a new buffer!

Open Source CMS tools

Find several very good sites for the cms softwares:
java soft: http://java-source.net/ , from where I find one good blogging software, http://www.rollerweblogger.org/page/project
php soft: http://www.opensourcecms.com/ , from where I find good comparison scores for the open source cms softwares, mainly for php.

Debian系统配制工具

都是命令行的配制工具:

rcconf
系统引导是你想要启动的服务,很有用工具。

base-config
基系统配制,第一次启动后,碰到的就是它吧,配制的方面很多哦,呵呵。

debconf Debian 包裹配制系统

dpkg-reconfigure 配制一个已经安装的包裹
很有用哦,任何安装的包裹都可以用它来配制。

apt-get install etherconf
dpkg-reconfiguration etherconf
网络的配制,包括主机名,IP,DHCP,DNS,GATEWAY,NETMASK。。。等。

如果如果你用lan上网,这几个文件很重要:
/etc/hostname主机名
/etc/network/interfaces 网络配制
/etc/resolv.conf DNS配制
如:
nameserver 202.96.104.18
nameserver 202.96.103.36

dpkg-reconfiguration xserver-xfree86
鼠标,键盘,显示器和显卡配制,能不能进X,全看它了。
或手工修改/etc/X11/XF86Config-4,作用一样。

modconf
大家肯定会在刚开始装系统时碰到那个另人望而生畏的基于表单的模块选取界面(我还曾专门写一贴,关于如何选取模块),就是它了。Debian想的非常周到,它把你须要的模块都做好了,只等你动手选了,以后忘了选或想移除模块,千万不要靠重装来解决问题,呵呵。

当然也可以手动添加了:
/etc/modules
这里写的都是你引导时要加载的内核模块,可以自己添加,
/etc/modules.conf
模块配制,这个不用自己改,
在你修改了/etc/modules后,可用update-modules来重建/etc/modules.conf和/etc/chandev.conf。

几个好用的命令:
modprobe - high level handling of loadable modules
用来加载模块
modprobe -c 显示当前正被使用的模块配制
modprobe -l 显示能匹配的模块列表,你可以找你需要的模块
modprobe modname 加载模块
modprobe -r modname 移除模块

insmod - install loadable kernel module
给正在运行的内核安装一个可加载模块。
rmmod
从正在运行的内核卸载模块。
lsmod
列出已加载的模块。
modinfo modname
显示每个模块的信息,很有趣。

apt-setup
配制apt源,就是安装时的你看到的那个,帮助你写/etc/apt/source.list

apt-get install aptconf
dpkg-reconfigure aptconf
配制apt,如禁用哪个apt源,自定义添加apt源(就象是个储藏室)等,找的是你的source.list,好玩。

apt-get install timezoneconf
dpkg-reconfigure timezoneconf
配制时区,日期,和时间。

apt-get install localeconf
dpkg-reconfigure localeconf
配制locale,不用我说了吧。

locale
查看本地的locale

dpkg-reconfigure locales
功能同localeconf

cpanel,别人提醒的,呵呵,凑个数
中文图形配制工具。

呵呵,我怎么知道的呢?
呵呵,apt-cache search debconf

Saturday, October 22, 2005

Sensei's Library: KGS Issue - Asian Fonts

Sensei's Library: KGS Issue - Asian Fonts
This article provides a detailed solution for chinese and CJK charactor's display problem in Java.

Friday, October 21, 2005

Icons - borrowed from Eclipse

create the following shell bash file for the eclipse icons

#!/bin/sh

CVSROOT=:pserver:anonymous@dev.eclipse.org:/home/eclipse
export CVSROOT

mkdir -p eclipse
cd eclipse
cvs -q co org.eclipse.debug.ui/icons
cvs -q co org.eclipse.pde.ui/icons
cvs -q co org.eclipse.jdt.ui/icons
cvs -q co org.eclipse.vcm.ui/icons
cvs -q co org.eclipse.team.ui/icons
cvs -q co org.eclipse.ant.ui/icons
cvs -q co org.eclipse.help.ui/icons
cvs -q co org.eclipse.ui/icons
cvs -q co org.eclipse.ui.views/icons
cvs -q co org.eclipse.ui.console/icons
cd ..
rm -f ~/public_html/eclipse-icons.zip
find eclipse -name "*.gif" -print | zip ~/public_html/eclipse-icons.zip -@

Use JavaMail in the Geronimo application server

Use the eclipse for the ide, and use maven as the site building engine. Update the mavenide in eclipse, using the following update site:
http://mevenide.codehaus.org/release/eclipse/update/site.xml

String code in Java

How to read the UTF-8 string correctly, if currently locale is not UTF-8:
Use the getBytes:
strInput.getBytes("UTF-8")
And you can wrap it in the input stream, for example:
new ByteArrayInputStream(strInput.getBytes("UTF-8"))

Thursday, October 20, 2005

成为Eclipse热键高手(zz)

几个相关的小窍门:

  锁定命令行窗口:在命令行视图中(Window Show View Other Basic Console),试试看用滚动锁定按钮来锁定控制台输出不要滚屏。

  使用Ant视图:在我的Java或Debug模式下,我喜欢显示出Ant视图,这样我就可以迅速的运行Ant任务。通过Window  Show View  Other  Ant可以找到该视图。把Ant视图放在屏幕的一角, 通过“添加编译文件(Add Buildfiles)”按钮来添加build.xml文件。在3.1版本中,甚至支持Ant调试脚本语言。

  自动遍历一个集合:for + Control-Space: 如果你还不知道,那么你应该记住Control-Space是自动完成功能。在Eclipse中,你还可以自动完成结构。在一个数组或集合范围内,试试看输入“for”然后按下Control-Space键。Eclipse会问你你想要遍历哪一个集合然后自动完成循环代码。

  使用分级布局:在包浏览视图(Package Explorer view)中默认的布局(扁平式)方式让我困惑,它把包的全名显示在导航树(navigation tree)中。我更喜欢我源码的包和文件系统视图,在Eclipse中叫做分级布局(Hierarchical Layout)。要切换到这种模式,点击包浏览视图中向下的按钮,选择布局(Layout),然后选择分级(Hierarchial)。

  一次显示多个文件:你可以一次浏览多个文件。把不在激活状态的编辑窗口拖到激活窗口的底部或侧边的滚动条上,就可以打开该编辑窗口。这是我能描述该窍门的最好方式了。

  同时打开两个Eclipse:要将改动从一个CVS分支上合并到另外一个上,我喜欢通过同时打开两个工作目录(Workspace)不同Eclipse来实现。这样我可以通过比较CVS上的最新版本看到所有的变化(右键单击工程,然后选择Compare with  Lastest from HEAD)然后把每一个变化都合并到另外一个CVS分支上。启动多个Eclipse的最简单的方法是利用Eclipse Launcher。

  Implementors插件:安装一个能够跳到一个接口的实现的插件。如果你是个dependency injection 粉丝,或者正在基于编写优良的接口工作,那么你需要一个这样的插件来加速代码导航。 你可以在SourceForge找到这个插件。