Skip to main content

Posts

不能启用触摸板的临时办法 | A workaround of enabling touchpad

症状是 touchpad 可以识别,按笔记本上的启用/禁止触摸板键,屏幕上也有正确提示,但是触摸板就是不能工作。 一个可能的原因就是在windows里面禁用了,重启进ubuntu以后就出这个问题。 另外发现在禁用的情况下,按住笔记本上那个键(我这里是Fn+F7)就可以用,松开就不行。 在网上搜到的gconf的键值,观察了一下,只有按住的时候是enabled,否则是disabled了。 临时解决方案是: gconftool-2 -t bool -s /desktop/gnome/peripherals/touchpad/touchpad_enabled "True" 运行以后笔记本上的启用/禁止键也能正常工作了。 这个估计是Xorg或者GNOME的bug。 The symptom is that although my touchpad is recognized, and when I press the enable/disable key on my keyboard, there's right notification on the screen, but my touchpad just is not working. One possible reason is that I've disabled it in Windows, then I restarted my machine and entered Ubuntu. Another thing I found is that only when holding the enable/disable key can I use the touchpad. I found the corresponding key in gconf, and indeed I observed that the key is enabled only when the enable/disable key is being held. A workaround is to run the following command. gconftool-2 -t bool -s /desktop/gnome/peripherals/touchpad/touchpad_enabled ...

Windows Server 2008 R2中配置游戏手柄 | Configuring gamepads in Windows Server 2008 R2

Windows Server 2008 R2 中似乎并没有游戏控制器的相关配置,以至我新买的手柄一直不能正确配置。 在 http://www.win2008r2workstation.com/win2008r2/game-controllers 中提供了一个游戏控制器的控制面板文件,包含了32位和64位的版本。按提示安装后就可以在控制面板里找到了,与之前Windows游戏控制器的配置无异。 Seems that the configuration dialog of gamepads is missing in Windows Server 2008 R2, which made my new gamepad not working all the time. Several necessary files for gamepad configurations are provided in http://www.win2008r2workstation.com/win2008r2/game-controllers including 32bit and 64bit versions. Just follow the instructions to install it, and then it can be found in the Control Panel, which is exactly the same as the gamepad configuration in previous versions of Windows.

在Google Reader中显示标记Like的条目 | Display liked items in Google Reader

转自:http://lifehacker.com/5317004/display-just-the-items-you-liked-in-google-reader 访问如下链接即可: http://www.google.com/reader/view/user/-/state/com.google/like From: http://lifehacker.com/5317004/display-just-the-items-you-liked-in-google-reader Just visit the following URL: http://www.google.com/reader/view/user/-/state/com.google/like

指定excel输出csv文件的分隔符 | Specify the separator in csv file outputted by Excel

Excel 导入csv文件时候可以指定分隔符,但是输出是没有明显的选项,只是txt用空格,csv用逗号。 查了一下,这个需要去控制面板,区域语言选项,“格式”标签选高级,在数字里面就可以调整分隔符了。 这个还真是不直观,太隐蔽了。。。 In Excel the separator can be specified when import a csv file using the wizard, but there's no such an option when exporting, the only choices are txt and csv, where the space and comma are used as separator respectively. And I found on the Internet that, to change the symbol, go to the control panel, then "regional and language options". In the advanced options under the "format" tab, there's a "number" tab, where you can change the "list separator". This option is hidden so well...

ptrace 在 linux 和 freebsd 下的若干区别 | Several differences of ptrace between Linux and FreeBSD

最近要把一个程序移植到Debian-kfreebsd上,并不如想象中的顺利。 主要是ptrace在两个平台上不太一样。 首先是宏定义,linux底下都叫PTRACE_*,freebsd上都是PT_*。这个也许不算什么 然后是ptrace函数的参数,主要是value这个,linux下面是long很好用,但是freebsd下是int,这样64位的时候就有些问题。 但是freebsd的ptrace有个更好用的操作PT_IO,可以自定义读写长度,而linux底下没有,要自己搞。 最后一个,花了我很长时间才解决的,是CONTINUE这个操作,linux下面addr这个参数是被忽略的,直接从中断的地方继续;但是freebsd下面则可以利用这个参数指定从哪里继续,如果希望从中断的地方继续,则指定为1即可。 目前只遇到这些,从这些方面来看,还是freebsd的接口更好用一些。 Recently I've been porting a software from Linux to Debian-kfreebsd, but it's not as easy as I had expected. The problem is the interface of ptrace is not exactly the same between linux and kfreebsd. The first is the names of the macros, which are PTRACE_* under linux and PT_* under freebsd. Secondly the function `ptrace' is not the same, the parameter `value' is `long' under Linux, but `int' under freebsd, so it seems that there'll be a problem on 64 bit freebsd. However, there's another operation called PT_IO under freebsd, using which we can specify the number of bytes we ...

并行运行多进程的Bash脚本 | A srcipt for running processes in parallel in Bash

原文: http://pebblesinthesand.wordpress.com/2008/05/22/a-srcipt-for-running-processes-in-parallel-in-bash/ 技巧是控制了最大并发数目,当前并发数过大时,等待有进程退出才开始下一个。 我现在正在写的脚本里正需要这个,借鉴过来 #!/bin/bash NUM=0 QUEUE="" MAX_NPROC=2 # default REPLACE_CMD=0 # no replacement by default USAGE="A simple wrapper for running processes in parallel. Usage: `basename $0` [-h] [-r] [-j nb_jobs] command arg_list -h Shows this help -r Replace asterix * in the command string with argument -j nb_jobs Set number of simultanious jobs [2] Examples: `basename $0` somecommand arg1 arg2 arg3 `basename $0` -j 3 \"somecommand -r -p\" arg1 arg2 arg3 `basename $0` -j 6 -r \"convert -scale 50% * small/small_*\" *.jpg" function queue { QUEUE="$QUEUE $1" NUM=$(($NUM+1)) } function regeneratequeue { OLDREQUEUE=$QUEUE QUEUE="" NUM=0 for PID in $OLDREQUEUE do if [ -d /proc/$PID ] ; then QUEUE="$QUEUE $PID" NUM=$(($NUM+1)) fi done } function che...