May 09

If you have a dedicated server online can be connected via SSH, you are really lucky. Get tired to search for a workable proxy to access the blocked site? There is a way via the powerful SSH.

Geek to Live: Encrypt your web browsing session (with an SSH SOCKS proxy)

But, if you are a facebook application developer, you must feel very painful to debug the application. Because it requires your application can be accessed by facebook servers, at least you should have public IP address or forwarding the traffic from your router.

Anyway, the problem can be easily solved. Thanks to my friend Wang Chun, he found a way to use SSH creates a tunnel that forwards traffic from server to the client. AWESOME!!

You can use option -R to listen on the port of server and forward the traffic to client.

-R [bind_address:]port:host:hostport
    Specifies that the given port on the remote (server) host is to be forwarded to the given host and port on the local side.  This works by allocating
    a socket to listen to port on the remote side, and whenever a connection is made to this port, the connection is forwarded over the secure channel,
    and a connection is made to host port hostport from the local machine.

    Port forwardings can also be specified in the configuration file.  Privileged ports can be forwarded only when logging in as root on the remote
    machine.  IPv6 addresses can be specified by enclosing the address in square braces or using an alternative syntax:
    [bind_address/]host/port/hostport.

    By default, the listening socket on the server will be bound to the loopback interface only.  This may be overriden by specifying a bind_address.
    An empty bind_address, or the address `*', indicates that the remote socket should listen on all interfaces.  Specifying a remote bind_address will
    only succeed if the server's GatewayPorts option is enabled (see sshd_config(5)).

Don’t forget to enable ‘GatewayPorts’ in the /etc/ssh/sshd_config.
Enjoy!

Feb 28

昨天尝试了一下 slicehost 的服务,从购买到使用就花了不到5分钟时间。这是基于 Xen 技术的虚拟主机,我安装了 Ubuntu 系统,用起来很不错。

昨天申请的是 512MB 内存的方案,今天准备升级到 1GB,同样非常简单。进入它提供的Web控制台,选一下 Resize,挑选 1GB 的方案,然后立即就开始重新构建虚拟机了,这个过程不过花费10分钟,而且所有数据都不会有任何损坏,真是很舒服啊!

Jan 09

今天打开了 lighttpd 得 mod_status,发现居然 fd-Event-Handler 默认用的是 Poll,大吃了一惊。还以为他怎么也会根据平台使用 kqueue 呢。网上搜了一下,找到了配置的方法,不需要重新编译只需要在 conf 里面配置一下。

server.event-handler = “freebsd-kqueue”

当然还可以选择其他,详细的参考 lighttpd wiki 吧。