## 2011-11-16

### 杂记 20111116 | Misc Notes 20111116

1.SingleCompile 是一个不错的 vim 插件，用于快速编译运行单个文件
2.vim 命令 :cope 查看所有编译错误
3.tsocks 从网络库层面给程序包装一个透明socks代理
mkdir -p ~/.config/indicators/messages/applications-blacklist/

5.vim 的 wildmode 和 wildemenu 可以定制 vim 自动匹配（例如文件名）的模式
6.easytags 可以让vim根据tags进行语法高亮
7.让vim可以像Visual Studio一样在输入行末的分号或者右大括号时可以自动格式化代码
function! WL_auto_format()
let curline = getline('.')
let curcol = col('.')
if match(curline[curcol :], '\S') == -1 " current char is curline[curcol-1]
let c = curline[curcol-1]
if c == ';'
execute "normal \=$" elseif c == '}' execute "normal =%%" endif endif endfunction autocmd Filetype c imap ; ;:call WL_auto_format()a autocmd Filetype c imap } }:call WL_auto_format()a autocmd Filetype cpp imap ; ;:call WL_auto_format()a autocmd Filetype cpp imap } }:call WL_auto_format()a  1.SingleCompile is an addon of vim, which makes it easy to compile-and-run a single file 2.:cope, to view all the compilation errors in vim 3.tsocks, an application the wraps network functions of another application, that goes through a socks proxy 4.Remove entries in Messaging Menu： mkdir -p ~/.config/indicators/messages/applications-blacklist/ then link unwanted items from /usr/share/indicators/messages/applications 5.wildmode and wildemenu: determine how vim will autocomplete (e.g. file names) 6.easytags let vim highlight all the tags 7.Make vim auto formatting codes when ';' or '}' is pressed at the end of a line, like Visual Studio function! WL_auto_format() let curline = getline('.') let curcol = col('.') if match(curline[curcol :], '\S') == -1 " current char is curline[curcol-1] let c = curline[curcol-1] if c == ';' execute "normal \=$"
elseif c == '}'
execute "normal =%%"
endif
endif
endfunction

autocmd Filetype c imap ; ;:call WL_auto_format()a
autocmd Filetype c imap } }:call WL_auto_format()a
autocmd Filetype cpp imap ; ;:call WL_auto_format()a
autocmd Filetype cpp imap } }:call WL_auto_format()a


## 2011-08-03

### 杂记 20110803 | Misc notes 20110803

1. Linux 查看程序访问的文件(类似filemon/processexplorer):
strace -e trace=file foo

2. mod_python 编译出错：

3. virtualbox 修改 host key: file -> preferences -> input

4. live meseenger 显示所有好友离线： 去控制面板->添加删除程序->修复live meseenger

5. linux 手动添加dns：

prepend domain-name-servers 8.8.8.8;

6. Windows 7 godmode

1. Monitor files accessed by a process on Linux (like filemon/processexplorer)
strace -e trace=file foo

2. cannot compile mod_python
from http://blogold.chinaunix.net/u/19834/showart_2127433.html
at connobject.c line 142 change !(b == APR_BRIGADE_SENTINEL(b) to !(b == APR_BRIGADE_SENTINEL(bb)

3. Change host key in virtualbox: file -> preferences -> input

4. All contacts in live messenger appear offline: control panel -> add/remove programs -> repair live messenger
Some says deleting appdata also works

5. Manually add dns on Linux
In /etc/dhc/dchlient.conf (probably also /etc/dhcp3/dhclient.conf), add a line
prepend domain-name-servers 8.8.8.8;

6. God mode in Windows 7
Create a folder and rename it to GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}

## 2011-07-20

### VirtualBox 在副屏上全屏显示 | Show VirtualBox in fullscreen on a secondary screen

Turn on fullscreen mode, in the auto-hide menu at the bottom, follow View -> Virtual Screen 1 -> Use Host Screen 2

## 2011-07-19

### 杂记 | Misc Notes

1. fontregister: Windows 下没有管理员权限时安装字体的小工具
2. 在Windows下Putty用Linux字体时可能需要选上Cleartype选项
3. x11vnc: 可以在终端开一个vnc server连接到一个已有的X会话上去
4. pomodoro: 工作25分钟，休息5分钟。一个有趣的工作模式
5. network-manager的共享网络模式(shared to other computers)似乎变的好用了（以前我这完全不能用)
6. Firefox添加书签时没有“在边栏显示”的选项，但是去书签管理看属性还是有的。

1. fontregister: a tool that allows you to register new fonts in Windows without admin privilege.
2. In putty on Windows, you may need to choose the "Cleartype" option when using Linux fonts
3. x11vnc: to create a vnc server that connects to a existing X session
4. pomodoro: work for 25 minutes, then rest for 5 minutes. A good way of time managing.
5. The "shared to other computers" mode in network-manager works well now.
6. In recent Firefox, there's no "load this bookmark in the sidebar" option when you add a new bookmark. However you can still find it, by checking the properties of an existing bookmark in the bookmark manager.

## 2011-05-03

### 杂记 | Misc Notes

system settings -> region and language -> layouts -> options -> alt/win key behaior -> meta is mapped to win keys

2.python的urllib记得是直接直接支持https的，但是不能验证证书（据说以后会实现的）。于是我找到了m2cypto这个模块，里面包装了urllib，证书有问题时会抛异常，但是证书没问题时会卡死。。。后来想了想，还是调用wget比较靠谱

3.gnome 3的控制面板里找不到startup applications了，但是可以直接运行gnome-session-properties

4.maximus：一个小软件，可以去掉最大化窗口的标题栏，配合gnome shell很不错。

1. By deault press the winkey once in gnome-shell will call up the main menu, this is not a big problem, but some shortcuts 'winkey + somekey' I set are not functional. For example 'f' and 'space' do not work, however 't' works, weird. To solve it:
system settings -> region and language -> layouts -> options -> alt/win key behaior -> meta is mapped to win keys

2. The urllib in python support https links, but it does not validate the certificates (some say that this will be implemented in the future). So I found the m2cypto module, it wraps urllib, and an exception will be thrown when there is problem with the certificate, however it sometimes went stuck when nothing wrong... Later I realized that it would be good just to call 'wget'

3. I cannot find 'Startup Application' in the gnome control center, but I can still run gnome-session-properties

4. maximus: a small tool that eliminate the title bar of maximized windows, looks quite good with gnome-shell.

5. Through the files /usr/share/gnome-shell/js/ui/dateMenu.js & panel.js we can hack the top bar of gnome shell, for example I renamed 'Activities', customized the datetime format, and removed the accessibility icon.

## 2011-04-27

### 路径环境变量中的陷阱 | Traps in path related environment variables

CFLAGS="-I#/include"
LDFLAGS="-L#/lib"
PATH="#/bin"
LD_LIBRARY_PATH="#/lib"
LIBRARY_PATH="#/lib"
MANPATH="#/man"
C_INCLUDE_PATH="#/include"
CPLUS_INCLUDE_PATH="#/include"
PKG_CONFIG_PATH="#/lib/pkgconfig"

It was all because of C_INCLUDE_PATH, usually it is empty, so if I prepend something in the way mentioned above, it'll become "#/include:". The trailing ':' will actually be interpreted as a 'current directory' in the end, that is '.'. And it also happen for a staring ':' and a '::' in the middle.

On the other hand, for programs utilizing automake, we often see a parameter '-I.', which is often appears in the beginning in order to make '.' the first searched directory for header files. However if '.' appears in C_INCLUDE_PATH, gcc will then consider it a 'system standard path', and therefore ignore the parameter '-I.'. In this way the order of searching directories is changed, then issues may appear.
I found this when I was compiling binutils, where the file 'config.h' appears in many directories, such that the order of searching directories is quite important.

To resolve it, simple but trouble, just to check whether the original variable is empty before prepend anything, in order to avoid a trouble-making ':'.

## 2011-04-26

### 杂记 | Misc Notes

1. tidy, csstidy，两个小工具，可以优化html和css
2. perl安装模块： perl -MCPAN -e shell
3. python安装模块： easy_install 或 pip
4. gcc 查看本机CPU类型 gcc -v -mtune=native
5. bash 里面二重替换变量： eval B="$"$A, 举例来说如果A=X,X=100，那么这个语句之后B=100
6. Linux From Scratch: 详解从无到有编译一套Linux，值得一看

1. tidy & csstidy: 2 small tools for optimizing html and css files
2. to install perl modules: perl -MCPAN -e shell
3. to install python modules: use easy_install or pip
4. to view how gcc detects local cpu: gcc -v -mutune=native
5. to recursively substitute variables in bash: eval B="$"$A, for example when A=X and X=100, then the previous statement results in B=100
6. Linux From Scratch: describing how to build a complete Linux from nothing, worth reading.

## 2011-04-18

### solarized 颜色主题 | the solarized color theme

http://ethanschoonover.com/solarized

https://github.com/altercation/solarized

sigurdga的fork: gnome-terminal
https://github.com/sigurdga/gnome-terminal-colors-solarized

seebi的fork: dircolors, tmux
https://github.com/seebi/solarized

https://github.com/coolwanglu/gnome-terminal-colors-solarized

https://github.com/coolwanglu/guake-colors-solarized

1.guake和gnome-terminal用的gconf类似，手工copy一下就行。不过我打算写个脚本，顺便学学git
2.terminal的主题一定要配合dircolors一起用，否则ls出来会很难看
3.vim里有多种选项可以配置主题
4.原来gnome terminal那个是16色的port，我fork并改出一个256色的，另外加入了guake的支持
5.256色是终端不使用这个主题时的临时方法，所以我原来的理解有问题，于是分离出一个单独的guake源

Although I've already mentioned this theme in the previous misc notes, but now I've decided to introduce it again in this separated article.

Actually I saw the name of this theme in a configuration file mentioned in linuxtoy, I found it quite beautiful, then I took some googling.

The contrast of this theme is relatively low, or more precisely, low contrast in lightness, but the colors are still well distinguishable due to the different hue values used.
Another wonderful point of this theme is that, the colors are carefully chosen, such that the foreground colors can always show a good appearance no matter on a dark or light background, cool!

Here are some links, and note that the repositories may provide more than what I mention here (those I don't use or never heard about)

Homepage：
http://ethanschoonover.com/solarized

Main git repository: vim,emacs,mutt,gimp palette,Xresources
https://github.com/altercation/solarized

sigurdga's fork: gnome-terminal
https://github.com/sigurdga/gnome-terminal-colors-solarized

seebi's fork: dircolors, tmux
https://github.com/seebi/solarized

My fork: 256color for gnome-terminal and guake
https://github.com/coolwanglu/gnome-terminal-colors-solarized

My fork: Guake
https://github.com/coolwanglu/guake-colors-solarized

Notes:
1.guake uses a similar gconf schema with gnome-terminal, so a copy&paste works. Well I have planned to write a script for this, and learn some git by the way.
2.the theme for gnome-terminal should be used along with dircolors, otherwise the output of 'ls' would be a mess
3.there are some options for the vim theme
4.The gnome-terminal port above is a 16colors version, so I forked and made a 256colors version, also I added support for guake.
5.The '256color' version is a workaround for terminal applications, when this theme is not used in the terminal, so I did not understand it correctly. Now I've created a separated repository for Guake.

### gmail 修改姓名显示 | change display name in gmail

mail settings -> accounts and import -> send email as -> edit info

When sending email, I want my Chinese name displayed with my email address, but by default the first name appears first, to change this:

mail settings -> accounts and import -> send email as -> edit info

## 2011-04-17

### 杂记 | Misc Notes

1. Firefox 全屏时显示地址栏和标签栏，设置browser.fullscreen.autohide=false

2. 禁用一个upstart的服务: echo "manual" >> xxx.conf，natty的upstart版本支持了override文件，于是可以 echo "manual" >> xxx.override

3. bootchart小工具可以分析开机时各程序启动，资源占用等情况，另有pybootchartgui可以将结果转换成图片查看

4. colortest 用于测试终端对颜色支持情况

5. synapse 一个 gnome-do 替代品，不依赖mono，重启compiz也不会崩溃

7. solarized 一个很不错的颜色主题，可以用于vim mutt terminal等等，很不错。也有对gnome-teriminal的移植，但是我这里显示效果不是很好

8. Terminus 一个很不错的终端字体，适用于小字号

1. To show the location bar and tab bar when Firefox is in fullscreen mode, set browser.fullscreen.autohide=false

2. To disable an upstart service: echo "manual" >> xxx.conf. Staring from Natty, upstart has supported the override files, so we may use: echo "manual" >> xxx.override

3. bootchart is a small tool to visualize the performance (of programs, resources) in the boot process, and pybootchartgui is available to convert result into images.

4. colortest is something useful to test the color capabilities of terminals

5. synapse is an alternate of gnome-do, which does not depend on mono, and does not crash when restarting compiz

6. vimperator: has been using it again, now it's much better than before, with many convenient shortcuts, while keeping the old interfaces. It conflicts with the key binds in gmail and google reader, but can be resolved by pressing ctrl+z

7. solarized is a great color scheme for vim mutt terminal etc. There's also a port for gnome-terminal, which unfortunately does not look good on my machine

8. Terminus is a good font family for terminals, best in small font sizes.

## 2011-04-16

### Mutt 初探 | My first attempt at Mutt

1.取消命令需要按Ctrl+g
2.默认w3m不能很好的识别编码，解决方法是在~/.mailcap里加入一行
text/html; /usr/bin/w3m -I %{charset} -dump -T text/html '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html

3.需要用smime_keys init建立需要的有关smime证书的目录，然后信任的根证书放在mutt的变量smime_ca_location里。我放到了~/.smime/ca-bundle.crt
4.mailto的配置，gnome有个小bug，preferred application选了mutt后不能默认勾上run in terminal，导致mutt不能正常运行。解决办法就是选custom，勾上run in terminal再选mutt
5.搜到了muttator，里面说mutt如何如何不好，呵呵。这个thunderbird插件也挺有趣的，回头再看看。
6.在全屏的guake里开一个tmux，然后再在tmux里开mutt，太爽了。

/usr/share/doc/mutt/*
http://crunchbanglinux.org/wiki/howto/howto_setup_mutt_with_gmail_imap
http://wiki.muttqq:s.org/?UserStory/GMailOverIMAP
https://github.com/redondos/mutt
http://therandymon.com/woodnotes/mutt/using-mutt.html
http://muttrcbuilder.org

http://equiraptor.com/smime_mutt_how-to.html
http://wiki.cacert.org/EmailCertificates
http://gagravarr.org/writing/openssl-certs/email.shtml
http://gagravarr.org/writing/openssl-certs/others.shtml
http://wiki.mutt.org/?MuttGuide/UseGPG
http://kb.wisc.edu/middleware/page.php?id=4091

I've heard about Mutt long before, but in whichever tutorial there were always super long configuration files about mutt, fetchmail/getmail and sendmail, quite scaring...

Recently I've made up my mind to learn this so-called the best email client, after minutes of searching I found out that there had been no need to configure sendmail, and since mutt had already supported retrieving emails (I use gmail only), I only need to configure mutt itself.

I spent two days before I completed my muttrc, after that I learned more things through using it. Now I've been familiar with most basic operations, indeed Mutt is a great email client!

I've put my .muttrc on my github page.

And something more:

1.To cancel a command, press ctrl+g
2.By default w3m cannot recognize the encodings well, to resolve this, add a line in ~/.mailcap:
text/html; /usr/bin/w3m -I %{charset} -dump -T text/html '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html
pay attention on the parameter "-I %{charset}"
3.Use 'smime_keys init' to create directories needed for smime handling, then put trusted certificates in the 'smime_ca_location' (a variable in mutt). I put mine in ~/.smime/ca-bundle.crt
4.About mailto handling, there's a bug in GNOME that 'run in terminal' is not ticked by default in preferred application (when you select mutt), which causes mutt not be able to run correctly. To resolve this, select 'custom program', tick 'run in terminal', then select (back) 'mutt'
5.I found 'muttator' when I was searching for something about mutt, there is an article on its homepage about why Mutt sucks, quite interesing. I might try this addon of Thunderbird later.
6.Now I'm using mutt inside tmux, which is run in a fullscreen guake, so cool!

/usr/share/doc/mutt/*
http://crunchbanglinux.org/wiki/howto/howto_setup_mutt_with_gmail_imap
http://wiki.muttqq:s.org/?UserStory/GMailOverIMAP
https://github.com/redondos/mutt
http://therandymon.com/woodnotes/mutt/using-mutt.html
http://muttrcbuilder.org

http://equiraptor.com/smime_mutt_how-to.html
http://wiki.cacert.org/EmailCertificates
http://gagravarr.org/writing/openssl-certs/email.shtml
http://gagravarr.org/writing/openssl-certs/others.shtml
http://wiki.mutt.org/?MuttGuide/UseGPG
http://kb.wisc.edu/middleware/page.php?id=4091

### latex 转义字符 | esapce characters in latex

\begin{eqnarray}  a &=& b \\  [a] &=& [b] \\\end{eqnarray}

The following Latex code won't compile:

\begin{eqnarray}  a &=& b \\  [a] &=& [b] \\\end{eqnarray}

and the reason is that [a] is recognized as the length parameter of \\. So [ should be escaped, if written as {[} there won't be error any more.

## 2011-04-05

### X11 鼠标主题中的诡异名字 | Weird names in X11 cursor themes.

http://fedoraproject.org/wiki/Artwork/EchoCursors/NamingSpec

I used to change mouse cursor theme, and often I would like to peek at the contents in the packages. Well I always see weird names such as '00008160000006810000408080010102'.

I've got no idea about this kind of names. Recently as I'm making a cursor theme converter, I googled for a while, then found something useful at:

http://fedoraproject.org/wiki/Artwork/EchoCursors/NamingSpec

It says these names are hashes, but the reasons are not mentioned.

## 2011-04-03

### 最近发现的小技巧 | Tips I found recently

1. compiz 可以用alt+中键调整窗口大小，特别适合用窄边框的我，在也不用在那一个像素周围纠结了。
2. 软件 auto-apt， 可以自动安装 ./configure 报出的缺失的依赖包
3. 软件 simple-ccsm, 调节compiz特效一步到位，省时省力

1. In compiz, we can adjust the size of the windows by pressing alt+ , which is quite suitable for people like me who are using thin window borders. Now I'm free from struggling at that 1 pixel.
2. The software 'auto-apt' can install those missing packages reported by ./configure
3. The software 'simple-ccsm' can set the effects of compiz within one-click.

### [转] That mysterious J

// 原文链接： http://blogs.msdn.com/b/oldnewthing/archive/2006/05/23/604741.aspx
// 解决困扰我好久的问题 :)

In e-mail from Microsoft employees, you may find a stray J like this one at the end of a message from Rico Mariani. Some of you might see it; others might not. What's the deal with the J?

The J started out its life as a smiley-face. The WingDings font puts a smiley face where the letter J goes. Here, let me try: J results in J. As the message travels from machine to machine, the font formatting may get lost or mangled, resulting in the letter J appearing when a smiley face was intended. (Note that this is not the same as the smiling face incorporated into Unicode as U+263A, which looks like this: ☺. Some of you might see it; others might not.)

I recall a story (possibly apocryphal) of somebody who regularly exchanged a lot of e-mail with Microsoft employees and who as a result started signing their own messages with a J, figuring this was some sort of Microsoft slang. The Microsoft employees who got the J-messages scratched their heads until they were able to figure out how their correspondent arrived at this fabulous deduction.

And now, the mysterious J has come full circle, because some people use it ironically, intentionally just writing a J without setting the font, in the same way people making fun of "leet" writing may "accidentally" type "1"s (or even more absurdly, the word "one") into a row of exclamation points.

### Green Apparatus 转换为 Linux 鼠标指针主题的修正 | Fix converting Green Apparatus to Linux mouse cursor theme

Green Apparatus 是一个经典的 CursorXP 鼠标主题，有这很有创意的动画和很棒的美工。虽然 CursorXP 是给 Windows 的，但是网上有个 sd2xc 脚本可以把 CursorXP 主题转换成 X11 主题，很不错。

Green Apparatus is a great CursorXP theme, the artwork is awesome and the animation is creative. Although CursofXP is for Windows only, there has been a script called sd2xc which can convert them into X11 themes.

I used this theme long before, I found the fix at http://d.hatena.ne.jp/tksmashiw/20080421. Recently I want to tweak my machine again, and I remembered this theme and that website. I found that web site had not been updated for a long time, so I note the steps here.

So what we need to do
unpack GreenApparatus.CurXPTheme, which is actually a zip archive
edit scheme.ini, in the [Wait] section, change the 2nd line to Frames=107, then in the [Wait_Script] section, change the 2nd line to 27-107,40
repack, and convert with sd2sc

Thanks to the original author again.

## 2011-03-28

### guake 类quake的下拉终端 | guake: a quake-alike drop-down terminal

[Update] 刚看了一下guake源码，原来还有很多隐藏的gconf可以调整。现在把resizer也去了，完美了~

I really need a handy terminal in my daily life, I want it to appear as soon as I call it, and I want it to disappear when I do not need it any more. gnome-terminal itself is good, I've been using it, but maybe it is not quite suitable for this task, as it's too slow to call it, and I've considered to bind a shortcut super+t to call it, but it will not be convenient when I run something on it, hide it and want to see the result later.

The I recalled guade, I had tried it before, but without a deeper look. This time I went through the settings and make it a really handy terminal. Basically I adjusted the transparent background, hide the tar bar and scroll bar, make to auto-disappear when losing focus, and at last I bind the shortcut calling/hiding it to be super+.

Then my life changed! It really likes those terminals in those fps game in quake style, and it dos make feeling communicating with the core of the system.

[Update] I found several hidden gconf settings after a quick browse of its source code. Now I've hidden the resizer, making guake perfect!

### tesseract 一个ocr软件 | tesseract: an ocr application

Recent I needed to write a bot for some automation works, I needed to break some captchas, then I thought about an ocr appliction. I found a number of them from google, then I pick up tesseract among them. It looks good, and is really good as I have been using it.

### vim 让背景透明 | make transparent background in vim

gnome-terminal 背景默认是透明的了（至少是ubuntu下），guake也可以弄成透明的，但是vim我用了colorscheme torte，结果背景是一坨黑，很不爽。

The background color of gnome-terminal has already been transparent, and so has guade. But (maybe since) I use 'colorscheme torte' for vim, the background is a huge black block, ugly...

So I check the help page in vim and found the command should be 'hi Normal ctermbg=None', it's no use if put below the 'colorscheme' scheme in .vimrc, I have to change the color file. So I move the torte.vim in to my ~/.vim/colors, changed its name，and changed ctermbg to be 'NONE' at the line containing 'Normal'. Then it's done (of course you need to load this new scheme file in vimrc)

Besides, gvim will show an error dialog if I set guibg to be NONE, don't know why but ok for me as usually I don't use gvim.

## 2011-02-14

### Windows 7 不能自动给移动硬盘分配盘符 | Windows 7 won't assign a volume letter for removable hard disks automatically

Symptom:
A new volume won't appear in 'my computer' after plugging in a removable hard disk, but it shows that a new usb device has been plugged in.
A volume letter can be manually assigned through the disk management in computer management console, then the removable disk can be used normally.

Solution:

## 2011-01-22

In default installation, after plugged in an ipad, a dialog will show saying something wrong with dbus.

The package ifuse would be necessary for accessing ipad, but the one in the official repository is not new enough.

According the the web page of ifuse, just to add the ppa ppa:pmcenery/ppa, then perform an upgrade.

## 2011-01-21

### ios 游戏修改 | Cheating games in iOS

It was said in several web pages that game files can be modified only in jailbroken ios, but today I found that this is not true.

We can explorer the files for apps with iphone explorer, and this is enough. I've successfully modified savegames of megajump and run as hell.

I'm not sure if we can modified the binary files of the games, seems to be ok.

But maybe we can not lock any variables.

## 2011-01-05

### 启用compiz和fglrx时的vnc问题 | Problem of vnc server with compiz and fglrx enabled

A problem that has been bothering me for nearly two years.

So the problem is, when trying to remotely connect to the vnc server enabled on my computer, I can see only the first screenshot, without further update, the mouse pointer is moving, but keyboard events are not responded.
I thought at first this must be something wrong with the network, or maybe "view only" is set on the server, however on my computer I see that mouse and keyboard are working properly, so it's only the problem of screen updating.

I didn't know the reason all the time until now. Recently I have a new Ubuntu installed on my computer, in the first few days vnc server was working well, and I had thought that this problem had been solved in this new version of Ubuntu. However vnc failes again these days, and I begin trying to remember what I have changed in the system. In the end I found that I've enabled fglrx and disabled radeon. And vnc come back to alive after switching back to radeon.

Later I found that it's indeed a bug, see https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/353126, which also affects the nvidia proprietary driver. I was using nvidia cards before, but I had always been using its proprietary driver, and that's why I didn't find the cause before.

## 2011-01-02

### ubuntu 10.10 ptrace权限的变动 | change in behavior of ptrace in ubuntu 10.10

Recent some one has posted a bug in scanmem, that the program can no longer attach to other processes without run as root. At the moment I was still using ubuntu 10.04, where I couldn't reproduce the bug. Now I've been using 10.10 and I did confirm that bug. So I think this must be something changed in ubuntu. After a brief searching, I found the reason at https://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#ptrace%20Protection, so that was changed intended, in order to protect the processes.

The key value is the sysctl value "/proc/sys/kernel/yama/ptrace_scope", which is 0 by default before, but now 1 by default.

So in the future scanmem will need to run as root.

And this is quite a good news for ubuntu.