Extract an RPM Package

We can use rpm2cpio to extract an rpm package:

$ rpm2cpio ../libstdc++-4.3.0-8.x86_64.rpm | cpio -idv

This page http://www.rpm.org/max-rpm/s1-rpm-miscellania-rpm2cpio.html shows more example on how to use rpm2cpio.

Murmur Server on CentOS5

To build a Murmur server on CentOS 5, we need:

Compiler

Remove "gcc-c++" if you have this package installed.

CentOS 5 SRPM location

The CentOS 5 source RPM files are no longer hosted on mirror.centos.org. According to the README file http://mirror.centos.org/centos/5/updates/SRPMS/readme.txt, the new location is at

http://vault.centos.org/5.7/updates/SRPMS/

Upgrade CentOS to 5.6 with Ext4 Support

Upgrading CentOS 5 to 5.6 is as simple as "yum update", and then reboot.

CentOS 5.6 / RedHat RHEL 5.6 has now the production ready Ext4 filesystem. To get this, simply run

# yum install e4fsprogs

Then you can create filesystem using 

# mkfs -t ext4 /dev/sdc1

At the end of the above "mkfs", there is a message as below:

 

Install Python 2.5 on CentOS/4

If you need more recent version of python on CentOS, you have to install it yourself. Do not override the default /usr/bin/python.

 

Download the latest python 2.5 from http://www.python.org/ftp/python.

wget http://www.python.org/ftp/python/2.5.6/Python-2.5.6.tgz

 

tar zxf Python-2.5.6.tgz 
cd Python-2.5.6
./configure --prefix=/opt
make
make install

Unix date in Bash

Show yesterday's date:

$ date -d yesterday
$ date -d yesterday +%Y-%m-%d

Show the UNIX timestamp:

$ date +%s
$ date --utc +%s
$ date -d yesterday --utc +%s

Convert a date string to timestamp:

function date2stamp () {
        date --utc --date "$1" +%s

Convert a timestamp to a date string:

function stamp2date () {
        date --utc --date "1970-01-01 $1 sec" "+%Y-%m-%d %T"

Repository for Subversion over SSH Disappeared after Subversion Upgrade

This might happen for svn over ssh. After the subversion upgrade, we started to get

svn: No repository found in 'svn+ssh://...'

To fix this, go to the svn server, and do the following:

# cd /usr/bin
# ls -l svn*

If you don't see the soft link of svnserve linking to your customized "svnwrapper.sh" (or whatever file name you call it), then do this:

# mv svnserve svnserve-daemon
# ln -s /usr/local/bin/svnwrapper.sh svnserve

This should fix it.

HowTo Create A Patch File For A RPM

This article is pretty useful. One minor fix to it, is the %patch line should be 

%patch0 -p1

 

 

HowTo Create A Patch File For A RPM 

Fix NTP Configiration

I have a CentOS server that keeps changing the timezone to CDT whenever we upgrade the ntp rpm. It turned out the setting in /etc/sysconfig/clock is wrong. To have the ntp rpm upgrade stay at the desired timezone, just change the line for ZONE to the correct one.

LiveHTTPHeader in Chrome

Chrome browser has some builtin functions that may be useful if you are looking for the function similar to the Firefox addon "LiveHTTPHeader". These functions are no replacement of the "LiveHTTPHeader".

One is the "Developer Tool" found under the menu "View" -> "Developer". Click on the "Network" tab to see the list network connection it made in order to open a web page.