Author Archives: Curu Wong

Using libcurl: follow redirect and get header only

Let’s look at a sample code first(I use the WWW::Curl perl module here, the idea is the same for other language). #!/usr/bin/perl use warnings; use strict; use WWW::Curl::Easy; my $url = ‘http://search.cpan.org/CPAN/authors/id/L/LO/LORN/LWP-Curl-0.09.tar.gz'; my $resp_body; #Get file length via HTTP HEAD … Continue reading

Posted in Perl, Programming | Tagged , , | Leave a comment

add utf8 subject support to mailwatch 1.0.5

In mailwatch v1.0.5, if the subject of a message is utf8 encoded, it can’t display correctly on the message list page. All the non-ascii characters will be replaced with question mark. For example. the subject “我爱Linux” will appears as “??Linux”. … Continue reading

Posted in Email, System Administration | Tagged | Leave a comment

Apache options directive trap

When configuring the Apache HTTP server, we use the Options directive to control which server features are available in a particular directory. We may, for example, write a config like this: <Directory /usr/share/nagios> Options +ExecCGI Indexes FollowSymLinks … </Directory> With … Continue reading

Posted in System Administration, Web | Tagged , | Leave a comment

Build the Linux kernel for other host

Building the linux kernel is time and resource consuming, especially when you do this in a VM guest. fortunately, We can choose a fast Linux machine to take the burden of building, then install the kernel to the target Linux … Continue reading

Posted in System Administration | Tagged , , | Leave a comment

Install from source or use rpm, this is a question

Install software packages from prebuilt rpm is not always simple and good. If we need more configure option and consistent behavior, build from source Continue reading

Posted in System Administration | Tagged , | Leave a comment

Shorewall: allow communication between VPN clients

If you setup Linux as a PPTP or L2TP/IPSec VPN server, every client connection will have a corresponding pppx interface on the server. You may have a shorewall interface config like this: /etc/shorewall/interfaces #zone interface boradcast options l2tp ppp+ – … Continue reading

Posted in System Administration, VPN | Tagged , , , | Leave a comment

Fedora 15 下安装 Openfetion 2.2

本文简要描述在Fedora 15系统下编译安装Openfetion 2.2的办法 在Linux下编译安装软件,做多了就会知道,常见问题无非就是缺少依赖的库(头文件或者共享库)。下面给出的命令假设你以普通用户登录系统,并且这个用户具有sudo成root的权限。 1. 安装所需软件开发包 sudo yum install cmake libnotify-devel gstreamer-devel \ NetworkManager-develgtk2-devel openssl-devel libXScrnSaver-devel

Posted in Linux Desktop | Tagged , , | 1 Comment

Create new KVM guest from template

Most of us don’t like to install guest OS repeatedly, instead, we often install one guest OS, then do some setup and customization. After that, we make a backup of the disk image(We use it as a template). If we … Continue reading

Posted in Programming, Python, System Administration, Virtualization | Tagged | 3 Comments

A convenient Bash function to backup configuration file

For sysadmins, it’s a good practice to backup configuration files before changing them. We normally do it via cp. eg: cp named.conf named.conf.bak cp named.conf named.conf.orig I personally like to use the date time as the file name suffix, so … Continue reading

Posted in Programming, System Administration | Tagged , | Leave a comment

Install fedora 15 from usb

This assumes that the capacity your USB drive is no less than 4GB. Install grub4dos to the USB. Use grubinst to install grub4dos MBR to the USB, then copy the grldr file in grub4dos package to the root directory of … Continue reading

Posted in Linux Desktop | Tagged , | Leave a comment