2009年5月5日星期二

Ubuntu 9.04 on Thinkpad X61... ...Enjoy it <3>

1. Ubuntu Tweak
Ubuntu Tweak 可以优化系统设置。你可以安装软件,优化桌面设置,配置启动程序,改变系统文件关联等。

要安装 Ubuntu Tweak,首先修改源文件。
sudo gedit /etc/apt/sources.list

添加下列行,保存。
deb http://ppa.launchpad.net/tualatrix/ubuntu jaunty main
deb-src http://ppa.launchpad.net/tualatrix/ubuntu jaunty main

打开终端,更新并安装。
sudo apt-get update
sudo apt-get install ubuntu-tweak
2. Gnome Do

Gnome Do 是允许搜索和快速启动程序的小软件,它如同 Mac 上的 QuickSilver 或是 Windows 上的 Launchy。
sudo apt-get install gnome-do
3. ThinkPad 指点杆中间滚动失效,Howto?
在/etc/hal/fdi/policy下创建mouse-wheel.fdi文件,
sudo gedit /etc/hal/fdi/policy/mouse-wheel.fdi

内容请点击右边--->Click<---

4. PDF中文遭遇乱码,Howto?
sudo apt-get install poppler-data

5. 公司的邮件需要加入网域才能收取,Howto?
sudo apt-get install likewise-open

安装之后会提醒输入域名,完成后确认,再打开Thundebird,是不是可以连上邮件服务器收取公司邮件了呢... :)

6. 磁盘管理软件
sudo apt-get install gparted

2009年5月3日星期日

Ubuntu 9.04 on Thinkpad X61... ...Enjoy it <2>

About Conky
自用Thinkpad X61(7673IFC),1024x768的屏,所以不能加太多显示内容,只配置了-->日期/时间-天气(当天)-System(版本号/在线 时间/电池电量/温度/CPU&RAM信息...)-File System(屏小,就留了个Root盘的空间信息)-Network(无线网卡/有线网卡)<-- 步骤: 1 安装Conky 代码: sudo apt-get install conky 2 download我的配置文件conkyrc_X61改名为.conkyrc放到 主目录(/home/用户名/)下,别忘了前面的.号,是隐藏文件 3 安装配置中用到的字体,Radio Space和Weather fonts,怎么装字体?? :em06
给点提示:
代码:
sudo mkdir /usr/share/fonts/ttf
sudo cp /存放ttf字体的路径/* /usr/share/fonts/ttf
cd /usr/share/fonts/ttf
sudo chmod 744 *
sudo mkfontscale
sudo mkfontdir
sudo fc-cache -f -v
exit

4 安装天气插件 在你的主目录(/home/用户名/)下建立一个文件夹conkyrc,然后把conkyForecast.py拷贝进去,记得要执行
代码:
chmod +x conkyForecast.py

Tips: 我在上海,故配置里的天气预报就是上海的咯,其他地区配置方法:
打开yahoo的天气网址:http://weather.yahoo.com/
在Enter city or zip code:中输入你的城市(只有一些大城市,小城市可以选择较近的),搜索。然后在地址栏中获取你城市的代码,是CHXX开头的一个8字节串。然后编辑配置文件,
代码:
gedit ~/.conkyrc
将其中的CHXX0116替换掉你所在城市的代码
5 一切完成之后运行看看,终端
代码:
conky

是不是很完美呢? 如果有什么小问题可以修改下下 :)
6 让conky虽系统启动,创建一个文件,起名conky.sh。用gedit打开。粘贴如下内容:
代码:
#!/bin/bash
sleep 20 && conky -c /home/用户名/.conkyrc
在startup app里设置开机启动就可以了
详细见论坛发帖:http://forum.ubuntu.org.cn/viewtopic.php?f=24&t=200513
附件下载:http://forum.ubuntu.org.cn/download/file.php?id=63921
附图:

2009年5月2日星期六

Lenovo ThinkPad 购买指南

Lenovo ThinkPad 购买指南
转自未名空间

看到版上众多新 id 踊跃支持 Lenovo 国货,又正处于 MITBBS 市场化改革的大潮中,我老竟然也一夜之间从有产阶级变成了裤衩男,只好出来挣点衣服钱,大家看了觉得好的尽管给我砸包子,觉得好就多砸点,不好就少砸点 kaka

Abstract

This post introduces several basic concepts on Lenovo ThinkPad purchase, and proposes the best way to buy Thinkpad at the minimum cost. Please note that case may vary by your situation. This post is organized as follows: Section I introduces the basic concepts and current research on ThinkPad purchase, Section II gives a real case study to show how to operate. Section III concludes the post.

Section I Introduction and Current Research

1、Public Coupon Code。可以不时从 fatwallet/dealsea 上找到。

2、Employer Purchase Program (EPP): www.lenovo.com/ibmepp
Contractor Purchase Program (CPP): www.lenovo.com/cpp
这两个 Program 都是 15% off anytime。Warranty 20% off plus tax free (超值),$95可以加到3年

EPP 需要IBM员工编号和Last Name,不是每个人都有,但是版上有个著名的"992299"的 CPP Code,效果是一样的。
EPP/CPP 一般不能跟public coupon 一起用,但前几天有一个"USEHOLIDAY" 10% coupon 买 X 系列可以和CPP叠加(super sweet)。

3、FatWallet 的 Fatcash:在 www.fatwallet.com 注册,然后点上面的商家链接过去,在点开的窗口内完成交易,就可以拿FatCash3个月后 Available,可以选check/PayPal支付。最初是 7%,前段时间 3.5%,最近又回到了 6%,不知道 Lenovo在想什么,PC 利润这么薄,还给这么高的回扣。
(补充:刚才楼下有人说 EPP/CPP 不qualify Fatcash,我今年8月还可以,至于新的请自己确认)

4、American Express Tailormade Program,俗称裁缝。以前最高有15%rebate,我前段时间拿过5%,现在没有了,但将来也许又会出现。
必须是 American Express 原发的卡,不能是什么Citi Amex之类。只要是用注册了的卡买的,就自动qualify裁缝店rebate。

5、其它Saving: 属于 Money 版讨论的话题了
比如 HSBC HouseHold 卡,2% anything. Discover卡有段时间是5%之类。

6、Extra warranty: 有人讨论过,几大信用卡公司原则上都提供一年以下的double warranty,就是说你买一年,第二年坏了信用卡公司管修。但是实际上操作起来还是Amex比较容易。曾经有人说过用Amex买的电脑,在3年左右坏 了,然后Amex退钱的case,应持怀疑态度看待。因为信用卡的extended warranty是最多 1 + 1 extra year。

7、传说有人用学校的税号打电话到Lenovo改order变成免税,这属于非法逃税,大家不要贪蝇头小利。


Section II Case Study

1、准备工作:注册 FatWallet/Lenovo/American Express TailorMade 帐号
2、Goto Fatwallet.com,找到Lenovo的链接,点击打开新Lenovo窗口。
3、如果有EPP,可以在地址栏输入:www.lenovo.com/ibmepp,输入 Code CPP 输入 www.lenovo.com/cpp,输入 Code 这样可以 qualify FatCash, Confirmed

如果你的public coupon 比CPP/EPP好,例如20%,则没必要进入CPP/EPP但有时候需要比较一下二者的价格,据说public coupon的discount有时候是把原价升高了。

4、在这个窗口里完成配置
一些个人意见:
不打游戏的话,独立显卡都是浪费钱,Vista Aero跑集成显卡足够了Never waste money upgrade CPU. 从1.6G升到1.8G,做Office/Internet/Email你要是能感觉到区别我就服了你。除非你是做CPU测量的。低频还更省电。 Bluetooth必要,将来接鼠标什么都,甩掉讨厌的尾巴,真正的无线

T系列:推荐SxGA+ 4:3屏幕,不推荐XGA,不推荐T61的14"Widescreen,分辨率低,不对称,设计的人估计脑壳进了水15.4"Wide SXGA+, Good, 但是有点重,体格强壮的话你会喜欢的推荐上7200rpm硬盘,但同价位的话也可以考虑 5400rpm 的大容量有点闲钱的话,Wireless N 的网卡不错,马上主流了

X系列:x61s推荐Ultralight 屏,上8-cell电池的话,不如上x61,因为电池一上,x61s的重量优势全没了。嫌屏幕和键盘小的,外接键盘和Monitor都很便宜,接上就可以跟Desktop一样工作,兼顾x系列的便携和在家工作的需要

Warranty: 产品的质量可以从 Warranty 的价格看出来,就好象反驳百慕大三角的神秘主义可以从保险公司的船舶保费看出来一样。ThinkPad 一贯质量优良,因此只需要$125左右就可以加到3年,CPP/EPP下只要$95。如果你的投资大于$1000,我想应该加上。Laptop现在越来越 成了易耗品,Lenovo接手后价格大幅下降,确实不排除某些部件降低了质量等级的怀疑,但是Anyway,ThinkPad系列的质量仍然是值得称道 的,而且大家也确实能用得起了。好像大家在这上面争论很多,但Lenovo不是慈善机构 You get what you paid for.

5、Apply Coupon
CPP/EPP 一般不能combine public coupon,但是前段时间有个"USEHOLIDAY"的10% extra saving 买 X 系列可以和 CPP 一起用,可以试试看。

6、推荐用Amex Checkout,或者你的更高 cash back 的卡,比如 dealsea 首页5% everything for 3 months 的 Citi Master。

A Saving Sample: 15% CPP + 6% FatCash + 10% USEHOLIDAY + 5% Credit Card Total: 36%这些都是 Extra Saving

Section III Conclusion

1、Lenovo 的订单都是可以打电话改配置的。
2、XP和Vista价格是一样的,不过学校一般有免费的版本,所以我都是省下钱,只买Home Edition自己升级。
3、内存买1G,将来自己升, XP 1G well enough, vista 2G, 4G is wasting money unless you use 64-bit windows system
4、Warranty 保修期内任何时候都可以补买。
5、推荐上Vista,虽然有一些小问题,但是慢慢都会改过来的,大势所趋,我的x61s跑Vista Buz 就挺好;
6、购买 Warranty 是免税的,ThinkPad 的Warranty便宜,CPP/EPP下只要$95就可以加到3年。
7、 正式的 Invoice 可以电话要到,需要Fax。

罗罗嗦嗦说这么多,无非也是想鼓励大家买 Lenovo 支持国货,最近争论特别多,可是咱国家出个品牌真不容易,对咱们海外的人来说也有面子,不让人老美总认为中国人只会做鞋子内裤。自己的品牌就像自己的孩 子,谁家的孩子都会犯毛病,日本的丰田本田说远的当年二战时产的汽车都是垃圾,近的,TOYOTA的Prius原来也是毛病多多,都是国人支持捧起来的。 退一万步讲,ThinkPad的起点已经很高了,Lenovo 整合不容易,拖着大堆美国 IBM 员工 5 年内不能解雇,供应链整合也需要时间,希望大家宽容一点,不要一上来就是一个大标题“天杀的Lenovo”之类。

就算在美国住一辈子,拿绿卡当公民,人家也只会叫你 American Chinese,而不是 Chinese American,包括你的孩子。

一句话,请大家支持国货。

Debian Linux新手Apt-get/dpkg简明入门

Debian是最早的Linux发行版之一。它能引起公众注意就因为它让安装与卸载软件非常简单。在其他发行版还陷在依赖性的泥潭里时,Debian用户因为有更好的包管理系统而免受这些困扰。

所有基于Debian的发行都使用这个包管理系统。Deb包可以把一个应用的文件包在一起,大体就如同Windows上的安装文件。这里要介绍的就是如何使用安装包处理软件来达到我们的目的。

用apt-get的第一步就是引入必需的软件库,Debian的软件库也就是所有Debian软件包的集合,它们存在互联网上的一些公共站点上。把它们的 地址加入,apt-get就能搜索到我们想要的软件。/etc/apt/sources.list是存放这些地址列表的配置文件,其格式如下:

deb [web或ftp地址] [发行版名字][main/contrib/non-free]

比如Ubuntu是一个基于Debian的发行,它的Sources.list可以是这样的:

deb http://in.archive.ubuntu.com/ubuntu breezy main restrcted

你可以自己加上自己的地址。apt-get.org 上面有一些不错的地址列表。

设好地址之后,就要把本机上的软件库跟网上的库同步(只是软件描述信息,不包含软件本身)。这样,本机上就有了一个可用的软件的清单,命令如下:

# apt-get update

运行成功之后,你就可以搜到在你的发行版中有哪些软件了,命令是apt-cache,运行这个命令是在本机是检索,而不连到网上。如:

# apt-cache search baseutils

这个命令可以列出baseutils这个软件包的情况,有还是没有,还有版本等。

看到库里有这个软件包后,就可以安装它:

# apt-get install baseutils

这时我们就可以看到apt-get的威力了。如果baseutils依赖于某个另外的软件,或者一个运行库xyz.0.01.so,apt-get会自动 下载这个包(或含有这个库的软件包)。这叫做自动依赖性处理。通常,如果你只用Debian软件库内的软件,是不会发生找不到包或包版本不对的情况的,除 非用的是正在开发的Testing或Unstable版本。

卸载软件:

# apt-get remove baseutils

如果想看一下库里有多少软件:

# apt-cache stats
Total package names : 22502 (900k)
Normal packages: 17632
Pure virtual packages: 281
Single virtual packages: 1048
Mixed virtual packages: 172
Missing: 3369
...

把本机所有软件升级到最新版:

# apt-get upgrade

最后是最强力的--把整个发行版都升到新版本:

# apt-get dist-upgrade

升级时注意那些影响系统起动的东西,比如升级了内核,升级了grub或lilo等,这之后你应当重新运行grub或是lilo,让它们指向正确的位置,否则升级之后会工作不正常的。

用apt-get安装软件时,它会从网上(在sources.list里指的那个站点)下载所用的软件包,这个包将存在本机上,目录是:/var /cache/apt/archives/。时间长了,这里会变得非常巨大,占用大量的硬盘空间。要想清理这个目录,可以运行:

# apt-get clean

还有一个自动清理功能,它只清除那些没用的或者是不完整的软件包:

# apt-get autoclean

这样在重装某软件时就依然能使用已经下载好的,而不是再到网上去下载。

dpkg - 底层一些的包管理工具

用上apt(高级包管理工具)之后,一般是不需要处理单个的deb文件的。如果需要,就要用dpkg命令。比如想自己装gedit:

# dpkg -i gedit-2.12.1.deb

卸载:

# dpkg -r gedit

这里只写名字即可。还可以加上--purge(-P)标志:

# dpkg -P gedit

这会连同gedit的配置文件一起删除,只用-r的话是不删除配置文件的。

如果不想安装一个deb包,但想看一下它里面有什么文件:

# dpkg -c gedit-2.12.1.deb

如果想多看点信息:

# dpkg -I gedit-2.12.1.deb

也可以用通配符来列出机器上的软件:

# dpkg -l gcc*

这会列出所有gcc开头的软件包:
Desired=Unknown/Install/Remove/Purge/Hold
Status=Not/Installed/Config-files/Unpacked/Failed-config/.
/ Err?=(none)/Hold/Reinst-required/X=both-problems
/ Name Version Description
+++-===============-==============-========================
ii gcc 4.0.1-3 The GNU C compiler
ii gcc-3.3-base 3.3.6-8ubuntu1 The GNU Compiler Colletio
un gcc-3.5 none (no description available)

其中,第1个 i 表示希望安装,第2个 i 表示已经安装,第3个字段是问题(如果有)(这3个字的含义可以看上面那3行,desired, status, err),后面是名字,版本和描述。un就表示,Unknown, not-installed。

如果想看某包是否已经安装:

# dpkg -s gedit

如果想看某软件都有哪些文件,都装到了什么地方:

# dpkg -L gedit

如果只想看其中的某些文件,就加上Grep:

# dpkg -L gedit grep png

当然还有aptitude和Aptitude,前者是终端上运行的带菜单的工具,后者是X窗口上运行的图形化的程序。

还有,列出某包的详情:apt-cache show gedit
一些强制的命令:dpkg --force-help

原文地址: http://linuxhelp.blogspot.com/2005/12/concise-apt-get-dpkg-primer-for-new.html
Debian is one of the earliest Linux distribution around. It caught the public's fancy because of the ease of installing and uninstalling applications on it. When many other linux distributions were bogged down in dependency hell, Debian users were shielded from these problems owing to Debian's superior package handling capablities using apt-get.

All Linux distributions which claim their roots in the Debian distribution use this versatile package manager. For the uninitiated, Debian uses the deb package format for bundling together files belonging to an application. You can look at it as something like a setup installer (Eg: Installshield) in windows counterpart.

Here I will explain how to go about using this package handling utility to get the results that you desire.

The first step needed to use apt-get to your advantage is including the necessary repositories. Repositories are merely collections of softwares which are stored in a public location on the internet. By including the web address of these repositories, you are directing apt-get to search these locations for the desired software. You use the /etc/apt/sources.list file to list the addresses of the repositories. It takes the following format:
deb  [web address] [distribution name][maincontribnon-free]
For example, in Ubuntu a debian based distribution, it could be something like this:
deb http://in.archive.ubuntu.com/ubuntu breezy main restrcted
You can add any repository you like. apt-get.org contains an excellent collection of repositories to suite all tastes.

Once you have set the repositories, the next step is to sync the local software database with the database on the repositories. This will cache a copy of the list of all the remotely available softwares to your machine. This is achieved by running the following command:
# apt-get update
An advantage of this is you now have the power to search for a particular program to see if it is available for your version of distribution using the apt-cache command. And you don't need a net connection to do this. For example,
# apt-cache search baseutils
... will tell me if the package baseutils is available in the repository or not by searching the locally cached copy of the database.

Once you have figured that the package (in our case baseutils) is available, then installing it is as simple as running the following command:
# apt-get install baseutils
The real power of apt-get is realised now. If the baseutils package depends on the availability of a version of the library say, "xyz1.5.6.so". Then apt-get will download the library (or package containing the library) from the net and install it before installing baseutils package. This is known as automatic dependency resolution.

And removing a package is as simple as running the command:
# apt-get remove baseutils
Get statistics about the packages available in the repositories by running the command :
# apt-cache stats
Total package names : 22502 (900k)
Normal packages: 17632
Pure virtual packages: 281
Single virtual packages: 1048
Mixed virtual packages: 172
Missing: 3369
...
To upgrade all the softwares on your system to the latest versions, do the following:
# apt-get upgrade
And finally the king of them all - upgrading the whole distribution to a new version can be done with the command:
# apt-get dist-upgrade
Saving valuable hard disk space
Each time you install an application using apt-get, the package is actually cached in a location on your hard disk. It is usually stored in the location /var/cache/apt/archives/ . Over a period of time, all the cached packages will eat up your valuable hard disk space. You can clear the cache and release hard disk space by using the following command:
# apt-get clean
You could also use autoclean where in, only those packages in the cache which are found useless or partially complete are deleted.
# apt-get autoclean
dpkg - The low level Package management utility
As I said earlier, Debian based distributions use the Deb package format. Usually normal users like you and me are shielded from handling individual deb packages. But if you fall into a situation where you have to install a deb package you use the dpkg utility.
Lets assume I have a deb package called gedit-2.12.1.deb and I want to install it on my machine. I do it using the following command:
# dpkg -i gedit-2.12.1.deb
To remove an installed package, run the command:
# dpkg -r gedit
The main thing to note above is I have used only the name of the program and not the version number while removing the software.
You may also use the --purge (-P) flag for removing software.
# dpkg -P gedit
This will remove gedit along with all its configuration files. Where as -r (--remove) does not delete the configuration files.

Now lets say I do not want to actually install a package but want to see the contents of a Deb package. This can be achieved using the -c flag:
# dpkg -c gedit-2.12.1.deb
To get more information about a package like the authors name,the year in which it was compiled and a short description of its use, you use the -I flag:
# dpkg -I gedit-2.12.1.deb
You can even use wild cards to list the packages on your machine. For example, to see all the gcc packages on your machine, do the following:
# dpkg -l gcc*

Desired=Unknown/Install/Remove/Purge/Hold
Status=Not/Installed/Config-files/Unpacked/Failed-config/.
/ Err?=(none)/Hold/Reinst-required/X=both-problems
/ Name Version Description
+++-===============-==============-========================
ii gcc 4.0.1-3 The GNU C compiler
ii gcc-3.3-base 3.3.6-8ubuntu1 The GNU Compiler Colletio
un gcc-3.5 none (no description available)
un gcc-3.5-base none (no description available)
un gcc-3.5-doc none (no description available)
ii gcc-4.0 4.0.1-4ubuntu9 The GNU C compiler
...
In the above listing, the first 'i' denotes desired state which is install. The second 'i' denotes the actual state ie gcc is installed. The third column gives the error problems if any. The fourth, fifth and sixth column gives the name, version and description of the packages respectively. And gcc-3.5 is not installed on my machine. So the status is given as 'un' which is unknown not-installed.

To check if an individual package is installed, you use the status -s flag:
# dpkg -s gedit
Two days back, I installed beagle (a real time search tool based on Mono) on my machine. But I didn't have a clue about the location of the files as well as what files were installed along with beagle. That was when I used the -L option to get a list of all the files installed by the beagle package.
# dpkg -L beagle
Even better, you can combine the above command with grep to get a listing of all the html documentation of beagle.
# dpkg -L beagle | grep html$
These are just a small sample of the options you can use with dpkg utility. To know more about this tool, check its man page.
If you are alergic to excessive command line activities, then you may also use dselect which is a curses based menu driven front-end to the low level dpkg utility.

GUI front-ends for apt-get
Related Content


Apt-get报错解决方法

某此升级软件出错之后,apt-get就开始罢工,总提示下面的错误
dpkg: parse error, in file `/var/lib/dpkg/available' near line 10442 package `iso-cods':
missing version
E: Sub-process /usr/bin/dpkg returned an error code (2)

怎么解决呢,去报错提示的文件夹下面将old文件替换掉出错文件即可,比如我这个就是把/var/lib/dpkg/下的available-old替换掉available这个文件,再运行apt-get就不会报错了,have a try, enjoy it!