我在VPS上偶尔有一些后台长期运行的第三方程序依赖X11(你不服不行)。 这时候总有一种蛋蛋的忧伤:为这么个玩意装一大坨X的包算是tm怎么回事…… 尤其这程序还需要用户输入,还得想法连上X操作。

通常的方案是用x11vnc这个神器提供VNC服务,配合Xvfb跑在framebuffer上。 不过Xvfb有些稳定性问题。研究发现更好的方案是配合Xdummy来直接用Xorg自带的dummy驱动。

  1. 安装xserver和x11vnc

    apt-get install xserver-xorg-video-dummy x11vnc
    
  2. 安装Xdummy

    wget http://www.karlrunge.com/x11vnc/Xdummy
    chmod +x Xdummy
    mv Xdummy /usr/local/bin
    
  3. 设置VNC密码(如果想直接用VNC客户端直连)

    x11vnc -storepassword
    
  4. 启动x11vnc

    x11vnc -display :0 -xdummy -bg -usepw -xkb -forever -rfbport 5900
    

然后就可以远程使用设定的VNC密码连接X了。


Mrtg + Nginx On Debian Squeeze with 1 minute interval

Wed 22 February 2012 by Keli

Quick note really:

# install nginx, mrtg, and fcgiwrap to wrap mrtg cgi since nginx doesn't support cgi directly
sudo apt-get install nginx mrtg mrtg-rrd rrdtool librrds-perl fcgiwrap

# prepare directories
sudo mkdir -p /var/www/mrtg /var/log/mrtg
sudo chown -R www-data.  /var/www/mrtg /var/log/mrtg
sudo ...
read more

F-Script injection service for Lion

Sun 11 September 2011 by Keli

Apparently the "Get Specified Text" action's output becomes rich text file in Lion which breaks the current F-Script injection service workflow. Other than that gdb stops working as well for some weird reason, which I managed to get around by using sudo to specify the user first. Opening a ...

read more

101domain is a scam

Mon 30 August 2010 by Keli

I was trying to register a domain with the .ms extension. 101domain.com was ranked the 1st place in the google search for “.ms domain registration” (turns out 101domain.com dose a great SEO job and is ranked the first place for a lot of registrar related search terms). So ...

read more

How to setup apt and CentOS repository on RHEL

Tue 05 August 2008 by Keli

Earlier today someone asked me to help with installing typical apache/mysql/php combo on a Linux server. After logging in I found that the distro is RHEL4. Obviously yum is not available there... as shitty as yum is, it's still better than the infamous rpm hell, right? So ...

read more