Archive for the '技术' Category

Nginx + Django Setup

Sunday, February 28th, 2010

Follow the below articles, it should be able to work:
http://wiki.nginx.org/NginxDjangoFastCGI
http://code.djangoproject.com/wiki/InitdScriptForLinux
http://stackoverflow.com/questions/605173/how-to-nginx-virtual-servers-fcgi-for-django
Notice fast CGI config in nginx:
fastcgi_pass_header Authorization;
fastcgi_intercept_errors off;

How to remote logon to linux X Desktop

Saturday, February 27th, 2010

There are several options.
1. VNC
http://markus.revti.com/2009/08/installing-vnc-remote-desktop-on-ubuntu-linux-vps/
2. FreeNx
https://help.ubuntu.com/community/FreeNX

Howtos: 管理员如何登陆Debian Linux的GUI界面

Tuesday, February 23rd, 2010

方法有两种,一是图形界面方式设置,一是命令行设置:
A. 图形界面方式:
GNOME桌面下:打开“系统主菜单“,选择”系统>系统管理>登录窗口”,在弹出的窗口中点“安全”选项页,选择“允许本地管理员登录“,点确定即可。完成。

nginx, 很不错的Web服务器

Friday, February 19th, 2010

nginx(发音同 engine x)是一款俄罗斯的程式设计师Igor Sysoev所开发轻量级的网页服务器、反向代理服务器以及电子邮件(IMAP/POP3)代理服务器,并在BSD-like协议下发行,可以在UNIX, GNU/Linux, BSD, Mac OS X, Solaris, 以及 Microsoft Windows等操作系统中运行。
nginx相较于Apache,lighttpd具有占有内存少,稳定性高等优势,并且依靠并发能力强,丰富的模块库以及友好灵活的配置而闻名。

How to make openvpn run at system startup

Tuesday, February 16th, 2010

Recently I met a small problem about openvpn. It cannot start automatically on Ubuntu server.
But it can be manually launched with /etc/init.d/openvpn start
After some digging, here is the trick to make openvpn can run automatically:

常用Linux命令

Monday, February 15th, 2010

*检查当前进程
top    用M可以按占用内存排序
*检查free内存
free -m
*配置服务
chkconfig  适用于Redhat
update-rc.d 适用Unbuntu
*设置清空文件缓存 (Linux下文件缓存page cache可能吃掉你很多的RAM)
sync; echo 3 > /proc/sys/vm/drop_caches

优化Apache的内存使用

Sunday, February 14th, 2010

Apache也是一个内存老虎, 在我的Ubuntu上,每个进程占用60M左右的内存.  如果服务器内存比较小, 就需要对Apache的进程数作一些控制.  比如说在一个400M内存的机器上,比较有价值的参数如下: 
KeepAliveTimeout 1

用Rsync同步备份Linux主机和Windows客户机

Thursday, February 11th, 2010

假定你有一台Linux主机,你需要定期备份上面的文件到本地的Windows客户机。比较土的解决方案是用ftp定期下载。 高级的方法是使用rsync.
rsync使用自己独特的算法可以进行增量备份下载。下面就是我的使用小结:

Marshal.ReleaseComObject Problem

Monday, November 30th, 2009

After running into some nasty errors while developing a C# project, I found that I was too aggressive in calling System.Runtime.InteropServices.Marshal.ReleaseComObject(). The specific problem is that after casting an interop interface IFoo to interop interface IBar, the Runtime Callable Wrapper (RCW) reference count is not incremented. This means that the following code is [...]

Iphone上MSN

Sunday, November 8th, 2009

今天用了以下eBuddy,可以支持多个IM网络,跟桌面上的Pidgin有一拼。
http://www.ebuddy.com/
有兴趣的桐子可以试一下