Mar 15, 2008

Fwd: Here come anohter song Little Distraction by The Lucksmiths from Australia.



---------- Forwarded message ----------
From: xiangzhen zhou <zhouxiangzhen@gmail.com>
Date: 2008/3/16
Subject: Here come anohter song Little Distraction by The Lucksmiths from Australia.
To: Honey <allyyu7@gmail.com>


Dear Honey,
 
  Here come another wonderful song from Australia. The songer is The Lucksmiths, a indie-pop band.
  The guitar accompaniment is very clear and nice. hope you like it too.
    

      Little Distraction 

      It's a lonely, lonely, lonely night
  It's a lonely, lonely, lonely night
  I need a little distraction to come along
  A little distraction, and you're the one
  It's a lonely, lonely, lonely night
  Such a lonely, lonely, lonely night
  I need a little distraction to come along
  A little distraction, and you're the one
  To hold my hand and talk so soft
  Show me all your photographs
  Holidays in Italy
  A postcard from the earth quaked village
  *******music**************
  I need a little distraction to come along
  A little distraction, and you're the one
  I need a little distraction to come along
  A little distraction, and you're the one
 
A little distraction, you are the one....
 
Cheers
Xiangzhen

 




Mar 13, 2008

12 Bugs of Christmas

For the first bug of Christmas, my manager said to me
See if they can do it again.
.
For the second bug of Christmas, my manager said to me
Ask them how they did it and
See if they can do it again.
.
For the third bug of Christmas, my manager said to me
Try to reproduce it
Ask them how they did it and
See if they can do it again.
.
For the fourth bug of Christmas, my manager said to me
Run with the debugger
Try to reproduce it
Ask them how they did it and
See if they can do it again.
.
For the fifth bug of Christmas, my manager said to me
Ask for a dump
Run with the debugger
Try to reproduce it
Ask them how they did it and
See if they can do it again.
.
For the sixth bug of Christmas, my manager said to me
Reinstall the software
Ask for a dump
Run with the debugger
Try to reproduce it
Ask them how they did it and
See if they can do it again.
.
For the seventh bug of Christmas, my manager said to me
Say they need an upgrade
Reinstall the software
Ask for a dump
Run with the debugger
Try to reproduce it
Ask them how they did it and
See if they can do it again.
.
For the eighth bug of Christmas, my manager said to me
Find a way around it
Say they need an upgrade
Reinstall the software
Ask for a dump
Run with the debugger
Try to reproduce it
Ask them how they did it and
See if they can do it again.
.
For the ninth bug of Christmas, my manager said to me
Blame it on the hardware
Find a way around it
Say they need an upgrade
Reinstall the software
Ask for a dump
Run with the debugger
Try to reproduce it
Ask them how they did it and
See if they can do it again.
.
For the tenth bug of Christmas, my manager said to me
Change the documentation
Blame it on the hardware
Find a way around it
Say they need an upgrade
Reinstall the software
Ask for a dump
Run with the debugger
Try to reproduce it
Ask them how they did it and
See if they can do it again.
.
For the eleventh bug of Christmas, my manager said to me
Say it's not supported
Change the documentation
Blame it on the hardware
Find a way around it
Say they need an upgrade
Reinstall the software
Ask for a dump
Run with the debugger
Try to reproduce it
Ask them how they did it and
See if they can do it again.
.
For the twelth bug of Christmas, my manager said to me
Tell them it's a feature
Say it's not supported
Change the documentation
Blame it on the hardware
Find a way around it
Say they need an upgrade
Reinstall the software
Ask for a dump
Run with the debugger
Try to reproduce it
Ask them how they did it and
See if they can do it again.

From:http://wiki.woodpecker.org.cn/moin/ProgrammerJokes

Mar 8, 2008

唐僧给孙悟空的一封信

这是一首在网上流传了很久很广的一则冷笑话. 今再翻阅,仍让人捧腹.确是经典.!

 
亲爱的悟空:

师傅这封信写得很慢,因为知道你看字不快。在天庭住好一阵子了,不知你在花果山过得可好?
我们已经搬家了,不过地址没改,因为搬家时顺便把门牌带来了.

这礼拜下了两次雨,第一次下了3天,第二次下了4天。
昨天我们去买比萨,店员问道:请问要切成8片还是12片,你勤俭的师母说:切8片好了,切12片恐怕吃不完。
那间店比萨还不错,改天我们全家再一起去街口的餐馆吃牛排。

还有你观音阿姨说你要我寄去的那件外套,因为邮寄时会超重,所以我们把扣子剪下来放在那件外套的口袋里了。
哦,你嫦娥姐姐早上生了。因为我还不知道到底是男的还是女的,所以我不知道你要当阿姨还是舅舅。

最近没什么事,我会再写信给你。
                              

师傅

又及:我们本来要寄钱给你但是信已经封上了。



Mar 3, 2008

易老庄

梁启超乃近代国学之大师,其在<国学入门书要目及其读法> 有易老庄的推荐注解, 特摘录如下:

《易经》
    此书为孔子以前之哲学书,孔子为之注解,虽奥衍难究,然总须一读。吾希望学者将《系辞传》、《文言传》熟读成诵,其卦象传六十四条,则用别纸钞出,随时省览。
    后世说《易》者言人人殊,为修养有益起见,则程颐之《程氏易传》差可读。
    说《易》最近真者,吾独推焦循,其的著《雕菰楼易学》三书(《易通释》、《易图略》、《易章句》)皆称精诣,学者如欲深通此经,可取读之,否则可以不必。

 

《老子》
    道家最精要之书,希望学者将此区区五千言熟读成诵。
    注释书未有极当意者,专读白文自行寻索为妙。

 

《庄子》
    内篇七篇及杂篇中之《天下篇》最当精读。
    注释有郭庆藩之《庄子集释》差可。

 

于今之青年,达原文诵读功底者估摸极少. 依梁公之言专读白文,知悉其精要即可.

附:梁公生平之介要.

Feb 29, 2008

Linux中十大超级命令


Linux中有非常多很有用的命令,比如ps, top, vmstat等等,这些是应用比较广泛的,广为人知的。还有一些命令,非常有用,但是应用并不是十分广泛,如果充分利用这些命令,有时可以完成一些复杂的任务,起到很奇妙的效果。今天就来介绍几个这样的命令:

Could the command-line tools you've forgotten or never knew save time and some frustration?

One incarnation of the so called 80/20 rule has been associated with software systems. It has been observed that 80% of a user population regularly uses only 20% of a system's features. Without backing this up with hard statistics, my 20+ years of building and using software systems tells me that this hypothesis is probably true. The collection of linux command-line programs is no exception to this generalization. Of the dozens of shell-level commands offered by Linux, perhaps only ten commands are commonly understood and utilized, and the remaining majority are virtually ignored.

Which of these dogs of the linux shell have the most value to offer? I'll briefly describe ten of the less popular but useful Linux shell commands, those which I have gotten some mileage from over the years. Specifically, I've chosen to focus on commands that parse and format textual content.

The working examples presented here assume a basic familiarity with command-line syntax, simple shell constructs and some of the not-so-uncommon linux commands. Even so, the command-line examples are fairly well commented and straightforward. Whenever practical, the output of usage examples is presented under each command-line execution.

The following eight commands parse, format and display textual content. Although not all provided examples demonstrate this, be aware that the following commands will read from standard input if file arguments are not presented.

  • Head/Tail

显示一个文件指定的前面或者后面多少行,也可以用来实时显示文件的动态情况。比较适合用来跟踪日至文件的变化情况。

As their names imply, head and tail are used to display some amount of the top or bottom of a text block. head presents beginning of a file to standard output while tail does the same with the end of a file. Review the following commented examples:

## (1) displays the first 6 lines of a file
head -6 readme.txt
## (2) displays the last 25 lines of a file
tail -25 mail.txt

Here's an example of using head and tail in concert to display the 11th through 20th line of a file.

# (3)
head -20 file | tail -10

Manual pages show that the tail command has more command-line options than head. One of the more useful tail option is -f. When it is used, tail does not return when end-of-file is detected, unless it is explicitly interrupted. Instead, tail sleeps for a period and checks for new lines of data that may have been appended since the last read.

## (4) display ongoing updates to the given
## log file

tail -f /usr/tmp/logs/daemon_log.txt

Imagine that a dæmon process was continually appending activity logs to the /usr/adm/logs/daemon_log.txt file. Using tail -f at a console window, for example, will more or less track all updates to the file in real time. (The -f option is applicable only when tail's input is a file).

If you give multiple arguments to tail, you can track several log files in the same window.

## track the mail log and the server error log
## at the same time.

tail -f /var/log/mail.log /var/log/apache/error_log

  • tac–Concatenate in Reverse

反过来显示一个指定的文件或者输入,同cat反过来记忆比价有效。

What is cat spelled backwards? Well, that's what tac's functionality is all about. It concatenates file order and their contents in reverse. So what's its usefulness? It can be used on any task that requires ordering elements in a last-in, first-out (LIFO) manner. Consider the following command line to list the three most recently established user accounts from the most recent through the least recent.

# (5) last 3 /etc/passwd records - in reverse
$ tail -3 /etc/passwd | tac
curly:x:1003:100:3rd Stooge:/homes/curly:/bin/ksh
larry:x:1002:100:2nd Stooge:/homes/larry:/bin/ksh
moe:x:1001:100:1st Stooge:/homes/moe:/bin/ksh

  • nl–Numbered Line Output

nl简单的一个行过滤器,可以在文件的前面标注上行号,并可以从指定的行号开始,还可以指定分割符号等等,请看下面的描述和例子。
nl is a simple but useful numbering filter. I displays input with each line numbered in the left margin, in a format dictated by command-line options. nl provides a plethora of options that specify every detail of its numbered output. The following commented examples demonstrate some of of those options:

# (6) Display the first 4 entries of the password
# file - numbers to be three columns wide and
# padded by zeros.
$ head -4 /etc/passwd | nl -nrz -w3
001root:x:0:1:Super-User:/:/bin/ksh
002daemon:x:1:1::/:
003bin:x:2:2::/usr/bin:
004sys:x:3:3::/:
#
# (7) Prepend ordered line numbers followed by an
# '=' sign to each line — start at 101.
$ nl -s= -v101 Data.txt
101=1st Line …
102=2nd Line …
103=3rd Line …
104=4th Line …
105=5th Line …
…….

  • fmt–format

fmt可以用来给指定的文件限制宽度,使显示起来符合规则,好看些。另外还有些特殊的参数可以使用,参考下面的描述。
The fmt command is a simple text formatter that focuses on making textual data conform to a maximum line width. It accomplishes this by joining and breaking lines around white space. Imagine that you need to maintain textual content that was generated with a word processor. The exported text may contain lines whose lengths vary from very short to much longer than a standard screen length. If such text is to be maintained in a text editor (like vi), fmt is the command of choice to transform the original text into a more maintainable format. The first example below shows fmt being asked to reformat file contents as text lines no greater than 60 characters long.

# (8) No more than 60 char lines
$ fmt -w 60 README.txt > NEW_README.txt
#
# (9) Force uniform spacing:
# 1 space between words, 2 between sentences
$ echo "Hello World. Hello Universe." |
fmt -u -w80
Hello World. Hello Universe.

  • fold–Break Up Input

fold有点类似于fmt地用法,但是用法更加特殊,参考下面的描述。
fold is similar to fmt but is used typically to format data that will be used by other programs, rather than to make the text more readable to the human eye. The commented examples below are fairly easy to follow:

# (10) format text in 3 column width lines
$ echo oxoxoxoxo | fold -w3
oxo
xox
oxo
# (11) Parse by triplet-char strings -
# search for 'xox'
$ echo oxoxoxoxo | fold -w3 | grep "xox"
xox
# (12) One way to iterate through a string of chars
$ for i in $(echo 12345 | fold -w1)
> do
> ### perform some task …
> print $i
> done
1
2
3
4
5

上面的例子似乎不那么有效,更加有效的方法是:

for i in `seq 5`; do print $i;done

seq(1) allows to define start, stop, step and more.

  • tr

tr is a simple pattern translator. Its practical application overlaps a bit with other, more complex tools, such as sed and awk [with larger binary footprints]. tr is quite useful for simple textual replacements, deletions and additions. Its behavior is dictated by "from" and "to" character sets provided as the first and second argument. The general usage syntax of tr is as follows:

# (13) tr usage
tr [options] "set1″ ["set2″] <> output

Note that tr does not accept file arguments; it reads from standard input and writes to standard output. When two character sets are provided, tr operates on the characters contained in "set1″ and performs some amount of substitution based on "set2″.

  • pr

相对于tr或者其他命令,pr命令主要用于打印的格式。
pr shares features with simpler commands like nl and fmt, but its command-line options make it ideal for converting text files into a format that's suitable for printing. pr offers options that allow you to specify page length, column width, margins, headers/footers, double line spacing and more.

Aside from being the best suited formatter for printing tasks, pr also offers other useful features. These features include allowing you to view multiple files vertically in adjacent columns or columnizing a list in a fixed number of columns.

  • Miscellaneous

The following two commands are specialized parsers used to pick apart file path pieces.

Basename/Dirname
The basename and dirname commands are useful for presenting portions of a given file path. Quite often in scripting situations, it's convenient to be able to parse and capture a file name or the containing-directory name portions of a file path. These commands reduce this task to a simple one-line command. (There are other ways to approach this using the Korn shell or sed "magic", but basename and dirname are more portable and straightforward).

basename is used to strip off the directory, and optionally, the file suffix parts of a file path. Consider the following trivial examples:

:# (14) Parse out the Java Class name
$ basename
/usr/local/src/java/TheClass.java .java
TheClass
# (15) Parse out the file name.
$ basename srcs/C/main.c
main.c

dirname is used to display the containing directory path, as much of the path as is provided. Consider the following examples:

# (16) absolute and relative directory examples
$ dirname /homes/curly/.profile
/homes/curly
$ dirname curly/.profile
curly
#
# (17) From any korn-shell script, the following
# line will assign the directory from where
# the script was launched
SCRIPT_HOME="$(dirname $(whence $0))"
#
# (18)
# Okay, how about a non-trivial practical example?
# List all directories (under $PWD that contain a
# file called 'core'.
$ for i in $(find $PWD -name core )^
> do
> dirname $i
> done | sort -u
bin
rje/gcc
src/C

至此,这几个命令就介绍完了,希望能给你的工作带来帮助,如果要更详细地用法,可以参考man命令的帮助。

作者:RickyZhu From:Ricky's Space RickyZhu Blog

Tag:

不错,作者有很好的Linux的功底.特全文转载.