2012-04-29

VNC服务器在开启compiz时不工作 | VNC server won't work with compiz

症状是VNC远程连接后,画面显示一帧就不再刷新了
(但是鼠标键盘在本机好像是有响应的)

以前讨论过这个问题
http://coolwanglu.blogspot.com/2011/01/compizfglrxvnc-problem-of-vnc-server.html

今天再次遇到了,只是现在我的电脑是ATI的卡
vino不太好用,用x11vnc的时候出现消息

29/04/2012 21:14:17 XDAMAGE is not working well... misses: 166/216
29/04/2012 21:14:17 Maybe an OpenGL app like Beryl or Compiz is the problem?
29/04/2012 21:14:17 Use x11vnc -noxdamage or disable the Beryl/Compiz app.
29/04/2012 21:14:17 To disable this check and warning specify -xdamage twice.

用 x11vnc -noxdamage -once -display :0 可以正常使用,但是由于不是增量显示的,网络压力会很大


https://bugs.launchpad.net/ubuntu/+source/fglrx-installer/+bug/772873
看到一个 workaround
是说在ATI Catalyst Control Center (Administrative)里打开 tear free 这个选项

我试了一下,果然管用。
以后不用-noxdamage也能正常使用了

另外-once这个选项太好用了


 The symptom is after a successful vnc connection, the window stopped refreshing after the first frame.
(But the keyboard and mouse seems to be responded on the remote machine)

I've discussed about the problem before:
http://coolwanglu.blogspot.com/2011/01/compizfglrxvnc-problem-of-vnc-server.html

Today I encountered this problem again when I tried to connect to my machine, but now I'm using an ATI graphics card.
vino server is not quite handy, so I used x11vnc, and I saw some useful logs:


29/04/2012 21:14:17 XDAMAGE is not working well... misses: 166/216
29/04/2012 21:14:17 Maybe an OpenGL app like Beryl or Compiz is the problem?
29/04/2012 21:14:17 Use x11vnc -noxdamage or disable the Beryl/Compiz app.
29/04/2012 21:14:17 To disable this check and warning specify -xdamage twice.

I can access my machine with 'x11vnc -noxdamage -once -display :0' without any problem, but now the screen is no longer updated incrementally, so it would hammer the network.

Then I found a workaround at:
https://bugs.launchpad.net/ubuntu/+source/fglrx-installer/+bug/772873

It says to enable the 'tear free' option in the ATI Catalyst Control Center (Administrative)

I tried, and it really worked!
Then it still works without the '-noxdamage' option

BTW, I really like the '-once' option.



2012-04-28

杂记 20120428 | Misc Notes 20120428


1. Google Chrome 强制开启GPU加速
google-chrome --ignore-gpu-blacklist

2. 删除不用的locale
安装localepurge

3. 带电源的外置硬盘不能识别

dmesg显示错误信息
device not accepting address NN, error -110
device descriptor read/64, error -110
unable to enumerate USB device on port N

参见
http://www.noah.org/wiki/USB_error_-110_in_dmesg_log
https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.15/+bug/54273

切断硬盘电源,等几秒后重新连接得以解决


1. To force enable GPU acceleration of Google Chrome
google-chrome --ignore-gpu-blacklist

2. To remove redundant locale files
Install localepurge

3. An external hard drive with it own power cannot be recognized

Messages shown in dmesg
device not accepting address NN, error -110
device descriptor read/64, error -110
unable to enumerate USB device on port N

See
http://www.noah.org/wiki/USB_error_-110_in_dmesg_log
https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.15/+bug/54273

Power off the hard drive and wait for a few seconds.
Then reconnect everything and it works well.

2012-01-07

杂记 20120107 | Misc Notes 20120107

1. 让c#程序崩溃时的堆栈信息显示行号: 把相应的pdb文件放到同一目录

2. Ubuntu 莫名启动慢,硬盘无反应
我的原因是这个https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/839595
需要在 /etc/network/interfaces 文件中删除 "auto eth0"

3 .Firefox 词典插件推荐 Dictionary Tooltip。配合我常用的dict.cn效果不错
参数
site url: http://dict.cn/mini.php?q=$$
scroll to element: word-key

4. Firefox 显示 MathML 最好安装 STIX 字体, 另推荐安装 Asana 字体

5. gnome-raw-thumbnailer 不能给 Nautilus 正确创建缩略图:
根据 https://bugs.launchpad.net/ubuntu/+source/gnome-raw-thumbnailer/+bug/852923
添加/修改文件 /usr/share/thumbnailers/raw.thumbnailer 为

[Thumbnailer Entry]
Exec=/usr/bin/gnome-raw-thumbnailer -s %s %u %o
MimeType=image/x-canon-cr2;


按自己需要另添加 MimeType 进去

6.GMail 的 Preview Pane 右边阅读区域过于狭窄
在AdBlock里添加规则
mail.google.com##.Bu:last-child

推荐使用 Element Hiding Helper



1. To show line numbers in the backtrace when a C# program crashes: put the corresponding pdb file into the same directory.

2. Ubuntu starts very slow, and seems that it's not working, but simply waiting
My issue is decribed here: https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/839595
Just delete "auto eth0" from the file /etc/network/interfaces

3. Recommended dictionary add-on for Firefox: Dictionary Tooltip, which works perfect with my favorite dict.cn
Parameters
site url: http://dict.cn/mini.php?q=$$
scroll to element: word-key

4. To get a best view of MathML in Firefox, it's recommended to install the STIX font, and Asana font as well.

5. gnome-raw-thumbnailer cannot create thumbnails for Nautilus
According to https://bugs.launchpad.net/ubuntu/+source/gnome-raw-thumbnailer/+bug/852923
Create/Modify /usr/share/thumbnailers/raw.thumbnailer as

[Thumbnailer Entry]
Exec=/usr/bin/gnome-raw-thumbnailer -s %s %u %o
MimeType=image/x-canon-cr2;


Also include all other necessary MimeTypes

6.The reading pane from the "Preview Pane" in Gmail is too narrow
Add the following rule to AdBlock
mail.google.com##.Bu:last-child

Recommend to use Element Hiding Helper

2011-11-16

杂记 20111116 | Misc Notes 20111116

1.SingleCompile 是一个不错的 vim 插件,用于快速编译运行单个文件
2.vim 命令 :cope 查看所有编译错误
3.tsocks 从网络库层面给程序包装一个透明socks代理
4.删除 Messaging Menu 不需要的条目:
mkdir -p ~/.config/indicators/messages/applications-blacklist/
从 /usr/share/indicators/messages/applications 找到不需要的文件,在上面那个目录里创建链接
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 编译出错:
参考 http://blogold.chinaunix.net/u/19834/showart_2127433.html
connobject.c142行 !(b == APR_BRIGADE_SENTINEL(b) 改为!(b == APR_BRIGADE_SENTINEL(bb)

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

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

5. linux 手动添加dns:
修改/etc/dhcp/dhclient.conf (可能还需要/etc/dhcp3/dhclient.conf),加入
prepend domain-name-servers 8.8.8.8;

6. Windows 7 godmode
建立文件夹,改名为GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}



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

链接: http://tipstank.com/2010/06/04/virtualbox-full-screen-second-monitor/

全屏后点下方自动隐藏菜单的View -> Virtual Screen 1 -> Use Host Screen 2



Link: http://tipstank.com/2010/06/04/virtualbox-full-screen-second-monitor/

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.