Howto

共 127 篇文章。

A script to update site periodically through CVSup(R)

Development

The script I am using for updating my own website(s) is not quite complex, it is here:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#!/bin/sh
# Detect and update the files
#
# $Phantasm$

CVSROOT="/home/ncvs"
SUPFILE="/home/delphij/cvsup/supfile-delphijweb"
LOCKFILE="/home/delphij/cvsup/cvsup-lock"

if [ -f ${CVSROOT}/CVSROOT/commitlogs/have_updates ]
then
	rm ${CVSROOT}/CVSROOT/commitlogs/have_updates
	cvsup -1gL 2 ${SUPFILE}
fi

Of course you need some CVSROOT scripts to get it work, but the idea is not too complex.

参与评论

How to remove a whole tree from CVS?

Development

Sometimes CVS is very nasty when operating. For example, when you want to remove a whole tree (including zillion sub-directories and files) you may have to enter commit log (at least, confirm) for every directory, if you are going to do a “cvs ci” in the top level directory.

It is possible to solve this problem with simple Unix(R) commands:

阅读全文… ( 本文约 111 字,阅读大致需要 1 分钟 )

Solving issue appeared after Windows XP SP2

Security

Windows XP SP2 is an important update and have introduced many security improvements. However, after installing Windows XP SP2, some graphical identity systems will be rendered to be useless.

The root cause is that these systems makes use of a special MIME type: x-xbitmap, or so called “XBM”.

XBM is originally developed by the X community. Presently it is uncommon on the web. However, banks like China Merchant Bank utilizies this format for authentication.

阅读全文… ( 本文约 130 字,阅读大致需要 1 分钟 )

Useful sed(1) regular expressions

Cheatsheets

Source code cleanup:

sed -i '' -E s/\ \	/\	/g *.c *.h
sed -i '' -E s/^\ \ \ \ \ \ \ \ /\	/g *.c *.h
sed -i '' -E s/\	\ \ \ \ \ \ \ \ /\	\	/g *.c *.h
sed -i '' -E s/\ +\$//g *.c *.h
阅读全文… ( 本文约 76 字,阅读大致需要 1 分钟 )

Two Powerful UNIX(R) command lines

Cheatsheets

Top ten established HTTP connection from IP to our box: (IP=127.0.0.1)

netstat -na | grep “127\.0\.0\.1\.80 " | grep ESTABLISHED | cut -c43- |cut -f1-4 -d’.’ | sort | uniq -c | sort -nr | head -10

Merge FreeBSD-CURRENT changes to delphijfork:
retag `cvs -d /home/fcvs rdiff -rHEAD -rDELPHIJ_FORK_LASTMERGE src | grep Index: | awk ‘{print $2;}’ | grep src`

参与评论

How to debug a live FreeBSD kernel?

Kernel

To quote Matthew Dillon:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
    You can actually run gdb on a live kernel like this:

    gdb -k /dev/mem /path/to/kernel.debug

    You can then use the 'proc' command to switch to a process (give it a
    pid), and do a stack backtrace.  That part only really works if the
    process is blocked on something (i.e. not running).

    But you can also dig around kernel globals and various data structures
    and that can be quite useful on a live system.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>
参与评论

Resolution of Windows Update 0x80000007d Exception

Cheatsheets

A Dell Latitude D600 computer with Windows 2003 Server Enterprise Edition is experiencing problem when installing Windows Update from website. By downloading the hotfix, and trying to install it, it fails with “Data Error, 0x8000007d”

阅读全文… ( 本文约 109 字,阅读大致需要 1 分钟 )