2007年5月16日星期三

New Programs and Themes in Ubuntu

Wondering where you can find more programs and desktop themes for your Ubuntu system?

Where to look for new programs


Where to look for style elements for your desktop

install ubuntu-studio themes!

1.编辑 /etc/apt/sources.list 加入下面一行:

deb http://archive.ubuntustudio.org/ubuntustudio feisty main

2. 搞到密钥:

$ wget http://archive.ubuntustudio.org/ubuntustudio.gpg -O- | sudo apt-key add -

3. 升级

$ sudo apt-get update

4. 如果想gdm theme, wallpapers, icon theme, session splashes 和gtk theme 全部安装就用这条命令:

$ sudo apt-get install ubuntustudio-look

当然你也可以挑其中你感兴趣的,比如我不装gdm theme 和 session splashes 那就用这条命令:

$ sudo apt-get install ubuntustudio-theme ubuntustudio-icon-theme ubuntustudio-wallpapers

2007年5月15日星期二

星际译王的小技巧!


$sdcv tired
发现 2 条记录和 tired 相似。
-->朗道英汉字典5.0
-->tired

*[taiәd]
a. 疲累的, 疲乏的, 厌倦的
相关词组:
feel tired out

-->XDICT英汉辞典
-->tired

[ˊtaiәd]
a. 疲劳的,累的;厌倦的,厌烦的

Set Gmail as Default Mail Client in Ubuntu


Every Geek uses Gmail… it’s pretty much required. And now you can set Gmail as the default client in Ubuntu without any extra software. (Windows requires the Gmail notifier be installed)

Just go to System \ Preferences \ Preferred Applications


Under Mail Reader, select Custom, and then put this into the Command window, changing "geek" to your username.

/home/geek/open_mailto.sh

Next, you’ll need to save this shell script into your user directory ( /home/username ). [Download]

For the curious, here’s the contents of the script:

#!/bin/sh

firefox https://mail.google.com/mail?view=cm&tf=0&to=`echo $1 | sed ’s/mailto://’`

If you’d like to make the script open a new tab in an existing Firefox window, you can replace the firefox line in the script with the following:

firefox -remote "openurl(https://mail.google.com/mail?view=cm&tf=0&to=`echo $1 | sed ’s/mailto://’`,new-tab)"

Update: If you want to make the script file hidden by default, you can rename it with a . at the beginning of the file like this: .open_mailto.sh. You’ll have to change the path in the preferences, of course.

Open a terminal and type in the following command, to make the script executable:

chmod u+x ~/open_mailto.sh

Now it should be working.

To test it out… I clicked the contact link on my page… and it immediately opened in Gmail.


Note that if you aren’t logged into Gmail you’ll be prompted to login to gmail… and you’ll have to click the email link again. Seems like Gmail’s login redirector won’t open the send mail page. But then again… why aren’t you logged into Gmail?

Update: Changed to point to a script so that the mailto: tag would be removed. Thanks VERY much to Mr Linux for not just noticing, but giving me the working script.

来源

2007年5月13日星期日

howto apt!

命令 作用
apt-cache search package 搜索包
apt-cache show package 获取包的相关信息,如说明、大小、版本等
sudo apt-get install package 安装包
sudo apt-get install package - - reinstall 重新安装包
sudo apt-get -f install 强制安装?#"-f = --fix-missing"当是修复安装吧...
sudo apt-get remove package 删除包
sudo apt-get remove package - - purge 删除包,包括删除配置文件等
sudo apt-get update 更新源
sudo apt-get upgrade 更新已安装的包
sudo apt-get dist-upgrade 升级系统
sudo apt-get dselect-upgrade 使用 dselect 升级
apt-cache depends package 了解使用依赖
apt-cache rdepends package 了解某个具体的依赖?#当是查看该包被哪些包依赖吧...
sudo apt-get build-dep package 安装相关的编译环境
apt-get source package 下载该包的源代码
sudo apt-get clean && sudo apt-get autoclean 清理下载文件的存档 && 只清理无用的包
sudo apt-get check 检查是否有损坏的依赖

4 ubuntu tips for newcomes

1.改变默认设置
Ubuntu所带来的一些默认设置或许是也或许不是你所期望的。比如,默认的编辑器是Nano,如果你习惯了实用Vim它就不是最佳的设置。

改变这些设置的简单办法便是使用 update-alternatives 程序,它维护着在 /etc/alternatives 目录下包括例如FTP、系统编辑器、rsh、Telnet、窗口管理器等的符号链接。观察一下 /etc/alternatives 目录便可知道有哪些程序被管理着。

要改变默认的编辑器,运行
$sudo update-alternatives --config editor
你将会看到象下面这样的这个对话设置:

There are 3 alternatives which provide `editor'.
Selection Alternative
--------------------------------------
1 /usr/bin/vim
2 /bin/ed
*+ 3 /bin/nano
Press enter to keep the default[*], or type selection number:

只要输入 1 就可以换装默认编辑器为Vim。注意在我的系统上,我没有安装Emacs或其他的编辑器;如果我安装了,这个工具也会提供其他编辑器作为选择。

只要输入 1 就可以换装默认编辑器为Vim。注意在我的系统上,我没有安装Emacs或其他的编辑器;如果我安装了,这个工具也会提供其他编辑器作为选择。
2.Sudo 和 gksudo
如果你曾经使用过一段时间的Linux,当你需要安装软件包时你可能直接的使用root来运行程序,更改你的系统配置等等。然而,Ubuntu采用了一种 不同的方式。Ubuntu安装程序没有设定一个root用户──root用户帐号仍然存在,但是它被设置了一个随机的密码。用户可以通过使用 sudo 和 gksudo 来完成管理任务。

你大概已经知道如何使用sudo──只需要运行
$sudo commandname
但是要作为root(或是其他用户)来运行一个图形界面的应用程序呢?简单──使用 gksudo 来代替 sudo。举个例子,如果你想以root身份运行Ethereal,只需要打开一个对话框(Alt-F2)并使用 gksudo ethereal 。

随便说一下,如果你真的必须以root身份工作,你可以使用
$sudo su -
这将让你以root身份登陆。如果你确实想拥有root密码,这样以便你用来直接使用root帐户(如比,不需要使用sudo),在你以root身份登陆 后运行 passwd ,并设置一个你认为合适的密码。我建议使用 pwgen 软件包来创建对于所有用户而不仅仅是root用户的安全密码。
3.如何配置 X.org
多数情况下,X.org──用来驱动你的显卡并提供图形界面基础,不管你是运行GNOME,KDE,Xfce或者其他窗口管理器──当你安装Ubuntu时也会运行,实际上,我敢打赌,很多Ubuntu用户从未关心过他们的显示环境。

但是,某些时候你需要重新配置X.org因为当Ubuntu不能发现你的显卡和显示器的时候,或者你正好购买了一张新的显卡并决定让它在 Ubuntu上运行。不管什么原因,弄清楚如何通过编辑 /etc/X11/xorg.conf 的手工方式在重新配置X环境总是有好处的。

要运行配置,在字符界面或者终端窗口中里使用
$dpkg-reconfigure xserver-xorg
接下来你将会对你的显示器和显卡,分辨率以及颜色质量等作出你希望的选择。

接着的每个设置都是不同的,在此想要给出完美配置X的建议是非常困难的,但是接受默认的设置通常都会让X正常工作。还有你需要作出配置显示器高、中、简单 三个等级的配置方式。作为一个标准,选择简单这可能是最容易的配置方式方式,否则除非你真的知道你在做什么,或者简单模式并不能让你的显示环境正常工作。

最后,不要使用 make install 当你从源代码编译完成之后──使用 CheckInstall 来代替。CheckInstall 将会创建一个Debian软件包并为你安装它,因为之后你能更容易的升级或是软出这个软件。

可以通过$apt-get install checkinstall来安装CheckInstall。在你运行 ./configure ; make 之后,只需要运行 sudo checkinstall 并且回答一些简单的问题。注意如果你在AMD64上编译软件包,CheckInstall将会选择X86_64结构而不是AMD64──这将引起软件包的 安装失败,since Ubuntu expects amd64 as the architecture rather than X86_64.

2007年5月12日星期六

如何保护笔记本的硬盘和电池

硬盘的重要性不言而喻,正确的使用与维护不但可以延长硬盘的使用寿命,更能免除因数据丢失带来的烦恼和损失。

  • 避免震动

震动是硬盘的一大死敌,强烈的震动会造成读写异常甚至是盘片或磁头的物理损伤。用户要尽量避免在颠簸较大的汽车、轮船上 使用笔记本;在硬盘长时间读写数据时最好把笔记本放在平稳桌面上;打字时注意不要重力敲击;避免挤压硬盘所在区域,如单手拿起笔记本,在笔记本上放置重物 等。当然,笔记本的优势之一就是移动办公,一些震动不可避免。所以可以在购买时留意一下带防震功能的硬盘或配备一个防震减震垫等。

  • 避免高温和其它恶劣环境

避免长时间(超过12小时)连续使用笔记本;避免放在被子、腿上使用笔记本,以免堵住通风道。潮湿、强磁场、阳光直射的环境下使用笔记本对硬盘的影响非常大。用户要尽量避免在浴室、音箱低音炮旁边等环境下使用笔记本,如果无法避免,也只能短时间内使用。

  • 避免频繁读写数据

不要长时间连续使用笔记本BT下载,不要用笔记本做资源服务器;使用Windows XP操作系统的用户,强烈建议添加至512MB内存或者更大以减少读写硬盘的机率。使用Windows Vista操作系统的用户,强烈建议添加至1GB内存或者更大以减少读写硬盘的机率。

  • 定期整理文件

系统在使用了一段时间后,硬盘就会产生较多的文件碎片,影响数据存取速度从而加速硬盘老化。用户最好能每一两个月就进行一次磁盘整理,半年左右重装一次系统,但也不要太频繁,这对提高系统速度十分有效。

笔记本电池使用时间长了,就常常充不满,甚至显示损坏,因此必须在使用时注意一些小技巧:不管你的笔记本使用锂电还是镍氢电,尽可能要将电量基本用尽后再充(电量低于5%),这是避免记忆效应的最好方法。充电时,尽量避免时间过长,一般控制在12小时以内。

使用AC外接电源时最好将电池拔掉,否则电池长时间处于发热状态对其寿命有影响。电池若长期不用,请至少二个月冲放电一 次,以保证它的活性。在保管电池时也有一个需要注意的问题。为了防止过度放电,可以在半充电状态下将锂离子保存在凉爽干燥处,然后每半年一次,再将其电量 充至一半的状态。

电池在使用了一段时间之后就会衰老,具体表现是内阻变大,在充电的时候两端电压上升得比较快,这样就容易被充电控制线路 判定为已经充满了,容量也自然是下降了。电池校正是对付衰老电池的有效方法,少数笔记本会有专用的电池校正软件。如果你的笔记本没有专用的放电软件,那么 可以按照下面的步骤进行:

  1. 将屏幕保护禁用;
  2. 在Windows电源管理中将电源使用方案设置为"一直开着";
  3. 在警报选项卡中将"电量不足警报"设置为10%,操作设置为"无操作";
  4. 将"电量严重短缺警报"设置为3%,操作为"等待";
  5. 把屏幕亮度调到最高;
  6. 确认关闭了所有的窗口,并且保存了所有之前工作的数据;
  7. 确认电池充电在80%以上后,拔掉电源和一切外接设备。

放电结束后笔记本会自动关机,之后将电源插上让笔记本充电,反复2~3遍,目的是让电池持续小电流放电,而这种放电状态在我们的日常使用中是不可能达到的,其效果与那些专用的放电软件基本一致。

2007年5月9日星期三

Ctrl-Alt-Del in Ubuntu + Beryl

For those who is running Ubuntu, there’s a package in automatix that allows you you bring up Gnome System Monitor with Ctrl-Alt-Del but since I got Beryl… that doesn’t work. I googled but can’t find anything. It took me a while sniffing around beryl manager but I finally found it.

Here’s how:

1. In the Beryl settings under “General Options”.
2. Select “General Options” > “commands” tab.
3. Expand any of the commands(0-11). Your choice.
4. In the “Command line X” field, type (where X is your choice whatever)

gnome-system-monitor

5. Now select the “Shortcuts” tab.
6. Expand “Commands”
7. Dbl-Click on “Run command X”
8. Now just assign Ctrl-Alt-Del to that. Or just any shortcut of your choice.

来源

2007年5月8日星期二

解决Mplayer声音图像不同步问题!

把“Video”标签页的“Enable frame Dropping"(允许丢帧)勾选就可以解决声音与图像不同步。

2007年5月7日星期一

Listen Tango

一套专为 Listen(一个音乐播放及管理软件)而制作的 Tango 图标主题,其安装方法详见 README 文件。

Listen Tango

图标主题下载