解决 Eee PC 900HA 硬盘烦人的咔哒声
EPC 刚买回来时就发现硬盘有噪声了,知道是磁头归位导致的。但机子带的硬盘是希捷的,查了一下貌似没办法从硬件上设置 APM 值,就搞来了 Windows 版的 hdparm 凑合用着。

但用 hdparm 有个问题,就是从休眠状态恢复过来时,只能手动执行设置 APM 参数,比较麻烦。这两天想倒腾一下 EPC 上的系统,顺便也把这个问题解决了。这次搜索 Seagate APM,发现了 quietHDD 这个软件,可以在系统启动后和从休眠、待机状态中恢复后自动设置 APM 和 AAM 值。用着感觉很不错,问题就算是解决了。

PS,我的 Asus WL-500gP 路由器外接的是一块从笔记本中换下来的东芝硬盘,可能也是默认的 APM 值低,总是咔咔响。我的解决办法是写了一个 access-hdd 丢到 /opt/bin 中,并使它在系统初始化时运行,内容如下:

  1. #!/bin/sh
  2.  
  3. while true
  4. do
  5.     ls /opt/tmp/empty > /dev/null
  6.     sleep 5
  7. done
Current language: Chinese (Simplified)
The mails from 126.com seems to be rejected by php.net
I remember that I tested the forwarding email address after I got a CVS account at php.net, and it worked fine. But today when I test it again, I found the mails sending from 126.com was rejected by php.net for the reason "4.7.1 our policy says no mail from your domain". And then I sent two mails from hotmail and yahoo, all succeeded.

Maybe the spam mails from domain 126.com are a little much. But I still intend to use this forwarding email address for the programs such as PEAR packages.
Current language: English · also available in: Chinese (Simplified)
解决 gnome-power-manager 没有低电量提示的问题
首先,我得说一下我是 Linux 新手,这个解决方法只是能用而已。

gnome-power-manager 没低电量提示的问题困扰了我将近半个月的时间,期间曾按网上大多数人提供的方法修改 gconf 配置中的 /apps/gnome-power-manager/general/use_time_for_policy 的值为 false,让 gnome-power-manager 使用电量百分比作为判断依据,但没有效果。

后来仔细得浏览了一下这个页面,发现 Joakim Andersson 所写的回复,非常明确得指出了问题所在。但继续往后浏览,发现有管理者说这个问题已于去年9月修复。而这个页面讨论的似乎是 Ubuntu 库里的版本,经过检验发现我这 Arch Linux 里装的 gnome-power-manager 虽然是最新的 2.24.4 版,但是这个问题依然没有解决。

运行 gconf-editor,修改 /apps/gnome-power-manager/general/debug 的值为 true,开启额外的调试信息输出。执行

$ gnome-power-manager --verbose

观察其详细信息,会发现当电量百分比低于设定值时,会有一句

profile is not accurate. Not doing policy action

这就是 bugs 反应页面里提到的那个原因。

到 gnome 的 ftp 里下载一份 2.24.4 版本的 gnome-power-manager,解压缩。经过搜索,发现上面提到的那个除错信息在 src/gpm-cell-array.c 的 gpm_cell_array_emit_system_action() 函数内

  1. static gboolean
  2. gpm_cell_array_emit_system_action (GpmCellArray    *cell_array,
  3.                    GpmWarningsState warnings_state)
  4. {
  5.     gfloat accuracy;
  6.     GpmCellUnit *unit;
  7.  
  8.     g_return_val_if_fail (GPM_IS_CELL_ARRAY (cell_array), FALSE);
  9.  
  10.     /* do we trust the profile enough to make a decision? */
  11.     unit = &(cell_array->priv->unit);
  12.     if (unit->kind == GPM_CELL_UNIT_KIND_PRIMARY) {
  13.         accuracy = gpm_profile_get_accuracy_average (cell_array->priv->profile,
  14.                                  unit->is_discharging);
  15.         if (accuracy < GPM_PROFILE_GOOD_TRUST) {
  16.             egg_debug ("profile is not accurate. Not doing policy action");
  17.             return FALSE;
  18.         }
  19.     }
  20.  
  21.     /* we are not primary, or we are primary with a trusted profile */
  22.     if (warnings_state == GPM_WARNINGS_ACTION) {
  23.         egg_debug ("** EMIT: charge-action");
  24.         g_signal_emit (cell_array, signals [CHARGE_ACTION], 0, unit->percentage);
  25.     } else if (warnings_state == GPM_WARNINGS_CRITICAL) {
  26.         egg_debug ("** EMIT: charge-critical");
  27.         g_signal_emit (cell_array, signals [CHARGE_CRITICAL], 0, unit->percentage);
  28.     } else if (warnings_state == GPM_WARNINGS_LOW) {
  29.         egg_debug ("** EMIT: charge-low");
  30.         g_signal_emit (cell_array, signals [CHARGE_LOW], 0, unit->percentage);
  31.     }
  32.     return TRUE;
  33. }

而经过搜索 CHARGE_LOW,发现似乎低电量的信号只能由这个函数发出,但很明显当 accuracy < GPM_PROFILE_GOOD_TRUST 时,就直接 return FALSE 了,所以不管 use_time_for_policy 是 true 还是 false,只要 accuracy 的值不够高,低电量提示就不可能出现。知道了这些,下面的工作就好办了,把涉及到 profile 准确度的几行注释掉,同时保证 /apps/gnome-power-manager/general/use_time_for_policy 的值为 false,程序就能正常工作了。

将定义 accuracy 变量的语句和为 unit 赋值的语句下方的 if 语句都注释掉

  1. static gboolean
  2. gpm_cell_array_emit_system_action (GpmCellArray    *cell_array,
  3.                    GpmWarningsState warnings_state)
  4. {
  5.     // gfloat accuracy;
  6.     GpmCellUnit *unit;
  7.  
  8.     g_return_val_if_fail (GPM_IS_CELL_ARRAY (cell_array), FALSE);
  9.  
  10.     /* do we trust the profile enough to make a decision? */
  11.     unit = &(cell_array->priv->unit);
  12.     /*
  13.     if (unit->kind == GPM_CELL_UNIT_KIND_PRIMARY) {
  14.         accuracy = gpm_profile_get_accuracy_average (cell_array->priv->profile,
  15.                                  unit->is_discharging);
  16.         if (accuracy < GPM_PROFILE_GOOD_TRUST) {
  17.             egg_debug ("profile is not accurate. Not doing policy action");
  18.             return FALSE;
  19.         }
  20.     }
  21.     */

然后编译安装。经过测试,低电量提示可以正常显示了。


参考:
1. Bug #135548 in gnome-power-manager...
2. Brian Jones - Re: Autoconf problems?
3. Charles Wilson - Re: 'can not find install-sh' when running configure
4. Re: difficulties with gnome-doc-utils.make
5. automake: 7.3.9.1 required file `./ltmain.sh' not found
6. Automake(1) - 一蓑烟雨任平生 Le blogspot de Leizhige - CSDNBlog
Current language: Chinese (Simplified)
路由器刷了新的 oleg 固件有无线信号了
去年 8 月买来 Asus WL-500gP v2 后,刷 oleg 固件就没无线信号,用官方的就有。在网上各处都问了一下,没有解决办法,因为基本没有遇到这个问题的。因为那时电脑还比较少,可以不用无线,就用了一学期 oleg 固件,来做下载。但现在电脑多了,就必须得开无线了。

昨天把 Eee PC 上的系统也配置得差不多了,考虑将来移动用的话 Subversion 版本库还是有个统一的地存放比较好,就又想起来这个路由器了。随便去 oleg 首页看了一下,还是去年 3 月的。想去论坛看看有没有什么别的消息,居然看到了一帖 New oleg firmware wersion,仔细看了看,原来在 Google Code 上有 oleg firmware 的项目,而且更新得比较勤快。下载后刷上,无线信号出来了~~~
Current language: Chinese (Simplified)
HP 的扫描软件
今天凌晨比较仔细的研究了一下 HP LaserJet 3052 一体机的扫描。以前就发现了扫描后再打印,比直接复印出来的东西质量差很多,主要是背景色不是纯白色的,字比较模糊。

这个型号的一体机配套的软件有个位于开始菜单中的扫描程序 (hppscan3.exe),使用很简便,扫描时颜色、分辨率、纸张尺寸以及输出文件的质量都可设置。但经过试验发现这个程序最后的图像处理部分非常弱,生成的图像都不干净 (字迹锐利度不够,有杂点)。

用 IrfanView 把这个机器选为 TWAIN 源扫描,默认会蹦出 HP 扫描 (hpqscnvw.exe) 这个程序进行扫描图像的预览和处理。处理时发现只要把中间色拖到 -100 (这块只考虑文档的灰度扫描),有了加深的效果,再打印就比较接近直接复印的了。
Current language: Chinese (Simplified)
More entries: [1] [2] [3] [4] [5] [6] [7] ... [16]
« Previous page · Next page »