搜索此博客

2009年7月21日星期二

X41任务1——Track Point(HAL与sysfs)

一、滚动


新的发行版,比如说Ubuntu 8.10和Fedora 10已经开始使用udev和HAL来配置输入设备了,不再需要修改xorg.conf了。以root身份创建“/etc/hal/fdi/policy/mouse-wheel.fdi”:
 <match key="info.product" string="TPPS/2 IBM TrackPoint">
<merge key="input.x11_options.EmulateWheel" type="string">true</merge>
<merge key="input.x11_options.EmulateWheelButton" type="string">2</merge>
<merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
<merge key="input.x11_options.YAxisMapping" type="string">4 5</merge>
<merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
<merge key="input.x11_options.EmulateWheelTimeout" type="string">200</merge>
</match>

立即生效,重启就没了。装了sysfsutils的话就可以每次重启都配置一次。其他的设定:






















































































Name Type Default Notes
sensitivityInteger128Sensitivity
speedInteger97Cursor speed
inertiaInteger6Described as "negative inertia." It acts more like friction. High values cause the cursor to snap backward when the Trackpoint is released
reachInteger10Backup for Z-axis press
draghysInteger255Drag hysteresis (how hard it is to drag with Z-axis pressed)
mindragInteger20Minimum amount of force needed to trigger dragging
threshInteger8Minimum value for a Z-axis press
upthreshInteger255Used to generate a 'click' on Z-axis
ztimeInteger38How sharp of a press
jenksInteger135Minimum curvature for double click
press_to_selectBoolean0Press to select
skipbackBoolean0Supress movement after drag release
ext_devBoolean0Disable external device

2009年7月19日星期日

X41任务0——搬回家

终于拥有Thinkpad了,兴奋!30000日元入手X41一台,Dothan 1.5的,1G内存。英文键盘,带底座。成色还行,顶面有些划痕,锁扣那有粘过的痕迹。电池8芯的,显示能用3.5小时,估计不能这么抗用,有时间校准一下。现在正在TX线电车打字,键盘手感很好(输入法太别扭)。果然,现在直接跳到1个小时了。原计划是要买X40来着,可是怎么都找不到Dothan版的,就选了这台。据说X41比较费电啊。打算今晚回去装Ubuntu了。不知道Ubuntu对Thinkpad支持怎么样,这些特色功能还能不能用了,比如说电池校准啥的。

X41,真漂亮啊,薄薄的机身。现在是放在腿上,感觉底下温温的(汗,到站了)。

到家了,电池校准中,怕装了Ubuntu不能校准了。不知道写点什么了,总之很兴奋,听着键盘的声音,看着硬盘灯在闪。

我的辐射2装上了不能运行,难道欺负日文系统?

晚上开始整Ubuntu!

2009年7月14日星期二

“瓦奇沙西刀”原来是这个



终于从英文网站上找到了起沙西瓜刀的英文发音了——“wakizashi”——也就是“わきざし”。再用日文输入法打成汉字是“脇差”。再去Wiki查“胁差”,终于(又“终于”一回,汗)让我查到!原来是鬼子武士自解剖专用以及当备用刀,或者百姓自卫用的武器。

英文版游戏里叫“Wakizashi Blade”,4-12伤害,ST要求2。





用 split 命令分割文件

今天看了个syslog,40M的gz,用vim愣是打不开。俺的内存是1G的啊。用gzip解开,640多MB。网上若干同仁(估计是互相抄的)都说用dd,1次只能拆一段,而且还得自己算偏移量。正常的方法应该用split命令。manpage我就不抄了,写几个例子。

  • split -l 10000 bigfile
  • split -b 10M bigfile
  • zcat bigfile.gz | splite -a 3 -d - BIG

文件名后面的是前缀,-a是后缀,-d表示序号按数字排,默认是字母。-l是按行数分割,-b是按字节数。

“ls *.tmp”是啥意思?

想列出目录里所有“.tmp”结尾的文件,很自然就会想到“ls *.tmp”,觉得ls就是干这个用的。到最近才忽然明白,这样做虽然能达到目(通常情况下),但实际并不是这么回事!

启发我的问题是这样的。当时目录里充满的垃圾文件,我用rm去删除,“rm *.tmp”,但是根本不起作用,shell提示说命令行超长了。bash的命令行最大长度是4096byte。当输入“rm *.tmp”时,bash会先进行通配符展开。把“*.tmp”展开,也就是把所有“.tmp”文件的文件名链接到“rm”后面。一旦文件有多,文件名又长,整个命令行就超标了,bash拒绝接受!

解决问题的方法:

  1. echo *.tmp | xargs rm
  2. find –name '*.tmp' –delete

要注意的是,“rm *.tmp”和“echo *.tmp | xargs rm”不会删除“.tmp”的子目录,删子目录需要“-r”,而find会删除子目录,除非加上“-type f”参数。

对于“echo *.tmp | xargs rm”,我还是有疑问的。难道echo *.tmp就不会有通配符展开的问题了吗?不知道,echo是bash内建的命令,而且反正echo也是把匹配的文件名写出来而已,也许真的不用展开。

好了,现在回到“ls *.tmp”的话题上来。和上面一样,命令执行时先通配符展开——好了,实际上我要做的事情并不是ls做的,而是bash,通配符展开的时候“.tmp”文件就已经被bash找出来了。最终执行的命令应该象是这样“ls 1.tmp 2.tmp 3.tmp … …”。

删日记了

删了不少日记,觉的自己写的太幼稚了。

Thinkpad X40 CPU电压/板载内存一览

Banias

型号 CPU电压 板载内存
11J ULV 256MB
13J ULV 256MB
15J ULV 256MB
1CJ ULV 256MB
1EE ULV 256MB
1EJ ULV 256MB
1EW ? ?
3EJ ULV 256MB
4VJ ULV 256MB
4WJ ULV 256MB
5FJ LV 256MB
5ZJ LV 256MB
67J LV 256MB
6EJ LV 256MB
71J ULV 512MB
7FJ LV 256MB
7FW ? ?
7VE ? ?
7VJ ? ?
7VW ? ?
A1I ULV 256MB
A3J ULV 256MB
A6J ULV 256MB
AEJ ULV 256MB
AFE ULV 256MB
AFJ ULV 256MB
AJ1 ? ?
BJ1 ULV 256MB
E8J ? ?
KJ1 ? ?

Dothan

型号 CPU电压 板载内存
11I ULV 256MB
12I ULV 256MB
13I ULV 256MB
14I ULV 256MB
15I ULV 256MB
16I ULV 256MB
17I ULV 256MB
21I ULV 256MB
22I ULV 256MB
23I ULV 256MB
24I ULV 256MB
25I ULV 256MB
26I ULV 256MB
27I ULV 256MB
A2I LV 512MB
B4J ULV 256MB
BBJ ULV 256MB
BRE ULV 256MB
BRJ ULV 256MB
BTJ ULV 256MB
G1J LV 512MB
GDE LV 512MB
GDJ LV 512MB
GGJ LV 512MB
K5J LV 512MB
K9J LV 512MB
KCE LV 512MB
KCJ LV 512MB
KFJ LV 512MB
M4J ULV 256MB
M5E ULV 256MB
M5J ULV 256MB
M7J ULV 256MB
MAJ ULV 256MB
Q2J LV 512MB
Q3E LV 512MB
Q3J LV 512MB
Q5J LV 512MB
Q6J LV 512MB