Thursday, 30 August 2007

vnc x11vnc

x11vnc is an vnc server program to replace vnc4server/vncserver

-no any setting
-completely same syntax with vncserver:
x11vnc---start vnc server:0.....
x11vnc -kill :0---switch the display off.


Cygwin越用越好用,不仅可以作为windows上的unix like系统,还可以作为x server for windows,而且还可以在其中添加MingW的gcc,g++,装了个这东西基本其他都不用装了就能玩转linux,eclipse东西.



vmware server console

There is a bug with VMware Server 1.03:

change /etc/pam.d/vmware-auth to read as follows:

auth required shadow nullok
account required

Confirmed 8/1/07 on a fresh install on Feisty (7.04) server. VMWare Server 1.0.3 will not allow a remote login until the change to vmware-auth above is implemented

In this case, host and client all can work well and smoothly with low memory usage.Amazing.

Powered by ScribeFire.

vmware server

The ability of VMware Server to run virtual machines
"behind-the-scenes" is a great boon. This means you no longer have to
have the GUI screen open on your desktop, taking up valuable screen
real-estate. It also means that you can switch your virtual machines to another
machine that is constantly up and have your virtual machines available to you
at any time, keeping them up and running around the clock. Running the server
without a GUI interface makes it more difficult to control the machines, but
with a little effort, you can get the same functionality via the command line. You
will still want the GUI in order to change configuration options and create new
machines, however.

The vmware-cmd
program is your gateway to controlling virtual machines. The general syntax of the
vmware-cmd for use with a VMware
Server instance on the same machine is:

$ vmware-cmd [config] [option] ...

Assume you have a virtual machine of Mandriva in /var/lib/vmware/Virtual Machines/Mandriva.
To get the status of the machine—whether it's on or off—you would use:

$ vmware-cmd /var/lib/vmware/Virtual\ Machines/Mandriva/Mandriva.vmx getstate
VMControl: use vnc for unifiedDraw
getstate() = off

As you can see, the virtual machine is turned off. To start
this virtual machine you would use:

$ vmware-cmd /var/lib/vmware/Virtual\ Machines/Mandriva/Mandriva.vmx start
VMControl: use vnc for unifiedDraw
start() = 1

If you have the vmware-console running at the same time, you
would see the virtual machine start. This is an easy way to start virtual
machines at boot: simply call vmware-cmd
with the configuration of each virtual machine that you want to start and the start command in a script like /etc/rc.d/rc.local.

Prior to shutting down your machine, you can signal the
virtual machines in a similar manner by using the suspend command. This will suspend each virtual machine to disk,
allowing you to issue the start
command later to resume the machine from where you left off. Obviously,
suspending a machine will make starting it up much faster than doing a full
shutdown and start each time you have to restart the host system.

Looking at the output of vmware-cmd
will give you a lot of other options that you can play with to
manipulate virtual machines. The ability to start, suspend, and stop virtual
machines from the command line (or a script) is perhaps vmware-cmd's most useful feature.

Delivered each Tuesday, TechRepublic's free Linux NetNote
provides tips, articles, and other resources to help you hone your
Linux skills.

Powered by ScribeFire.

Tuesday, 28 August 2007

x server on windows

Thursday, 23 August 2007



Powered by ScribeFire.

Monday, 20 August 2007

ubuntu's runlevel

Ubuntu default init setting:
Modify the 3rd line from bottom to the default runlevel you like.

Here, to modify rcX.d to configure how different runlevel behaves.

Linux run levels are numbered 0 through 6. Run levels stop at six for practical and historical reasons, but it is entirely possible to have more if desired.

The following table summarizes the User Linux run levels:

* 0 System Halt
* 1 Single user
* 2 Full multi-user mode (Default)
* 3-5 Same as 2
* 6 System Reboot

Special Run Levels

Run level 0 is the system halt condition. Nearly all modern X86 computers will power off automatically when run level 0 is reached. Older X86 computers, and various different architectures will remain powered on and display a message referring to the halt condition.

Run Level 1 is known as ’single user’ mode. A more apt description would be ‘rescue’, or ‘trouble-shooting’ mode. In run level 1, no daemons (services) are started. Hopefully single user mode will allow you to fix whatever made the transition to rescue mode necessary.

(You can boot into single user mode typically by using your boot loader, lilo or grub, to add the word ’single’ to the end of the kernel command line).

Run levels 2 through 5 are full multi-user mode and are the same in a default User Linux (Debian) system. It is a common practice in other Linux distributions to use run level 3 for a text console login and run level 5 for a graphical login.

Run level 6 is used to signal system reboot. This is just like run level 0 except a reboot is issued at the end of the sequence instead of a power off.

In the interests of completeness, there is also a runlevel ‘S’ that the system uses on it’s way to another runlevel. Read the man page for the init command (”For manpage click here”) for more information, but you can safely skip this for all practical purposes.

Run Levels Location

Like everything else in a Linux system, run levels are defined by files in the file system. All the run level files are found in the /etc directory according to the following table:

/etc/rc0.d Run level 0
/etc/rc1.d Run level 1
/etc/rc2.d Run level 2
/etc/rc3.d Run level 3
/etc/rc4.d Run level 4
/etc/rc5.d Run level 5
/etc/rc6.d Run level 6

Each defined run level should have an rcX.d directory where X is the run level number. The contents of the rcX.d directory determines what happens at that run level.

Change run levels in Debian and Ubuntu Linux

Before we change run levels it might help to find out which run level is current. Use the ‘runlevel’ command to tell you two things: The last run level, and the current run level. Here is the command and the output shown together due to the sparsity of the output:

# runlevel N 2

The ‘N’ stands for none, meaning there has been no run level change since powering up.

The init system controls run levels, but then again, the init system pretty much controls everything. The init system will be looked at in detail in a future article.

The primary command used to change run levels is ‘telinit’.

#telinit 3

telinit takes one argument on the command line. As always, see the man page for full details. Normally the argument will be one of: 0,1,2,3,4,5,6, or the letter ‘S’. As you may have guessed, the numbers correspond to the run level you wish to move to. Using the ‘S’, for single-user, is the same as the number 1, but don’t do it; the ‘S’ runlevel is intended for use by the UserLinux (Debian)system.

A note of caution is warranted here. You can easily use the telinit command to reboot (run level 6), or shutdown (run level 0) the system, but it is not recommended. Certain programs need special processing for an orderly shutdown. Bypassing the expected shutdown sequence can have dire effects on your data. Older _Unix_ systems are especially sensitive to shutdown/bootup operations.

The preferred method for a serious runlevel change is ’shutdown’. There are easier mnemonics, but in a running system they all point to the ’shutdown’ command. You can use the ‘halt’, or ‘poweroff’ command to stop a system and the ‘reboot’ command to restart your system. In each case they call the ’shutdown’ command with different parameters.

If you wanted runlevel 3 to be the default, then you need to edit /etc/inittab.

# The default runlevel.


You’d change the ‘2′ to a ‘3′. Next time you reboot, your system will start in runlevel 3. There will be no display manager running in runlevel 3, because you turned it off. Therefore, runlevel 3 will become text only, and it will be the default. If that’s what you want to do.

Adding a new service

You can only add a new service to the boot sequence if a script in /etc/init.d exists. In that case the following command will install it with default settings (foo being the name of a script in /etc/init.d).

#update-rc.d foo default

Removing a service

A service may only be removed after the script in /etc/init.d as deleted already. If so, the following command will remove its references (foo being the name of a script in /etc/init.d).

#update-rc.d foo remove

If you want to remove a service without removing the start/stop script as well, you may consider using the file-rc package and editing the runlevel configuration file /etc/runlevel.conf. When using the SysV method you should rename the start/stop script, then call update-rc.d and then rename the start/stop script back to its old name.

Some of the content for this article source from here

Thursday, 16 August 2007

VMware fusion, amazing. similar to Xming.

最近又安装Mac OS X来玩,这次主要是为了试试VMware Fusion这个东西.以前大费周折地用VMware+rdesktop才在Ubuntu运行起了Windows的原生程序,据说在Fusion下只是点几下鼠标而已.


系统概况:Mac OS X 10.4.9+VMware Fusion with Deepin XP


要使Fusion里的虚拟Windows XP运行在原生模式下,必须让虚拟机切换到“Unity”模式,这样虚拟机就在后台工作了,你根本不用理会它的存在。

你可以直接点Applications,它会调用Windows XP的开始菜单,用这个可以方便打开Windows程序。





这次开起来了Windows Media Player,没什么好讲的,效果还是不错。

这次把 QQ开起来了,再注意到右侧,就是Lauch工具了,好像只要是exe和指向exe的快捷方式都会出现在这里,方便启动相关程序。


回顾LDCN以前的相关文章,那种方法好麻烦啊,期待VMware Fusion登陆Linux平台。


Powered by ScribeFire.



search mp3 or some document with intitle is so efficient.

Powered by ScribeFire.

sonicstage: non_unicode program sucks

For me, the sonicstage is absolutely a piece of junk.

1.v3.x doesn't support NW-S series.
2.v4.0 big bug about errors "selected music file cannot be played back sonicstage", which always happen when you restart sonicstage.
the Chinese Characters can not be shown properly in sonicstage, but on player, no problem. this is what I can stand for, and I have to, because Sonicstage can import *.m3u playlist files, so even in sonicstage can not recognize Chinese correctly, it doesn't matter.
3.v4.2 and 4.3, Chinese character can be shown correctly, but on Player, all are rubbish codes.
4. All the version can not import files including Chinese.

Conclusion, have to use Chinese Windows OS.

从这里找到一个完全可以替换sonicstage的软件:SWex.它是unicode的程序,所以可以任意文件名drag and drop;并且可以同时在软件和player里显示中文。

但是奇怪的是:mp3的tag,最好只用一个程序去修改,或者是Explorer或者是foobar,如果混用,结果就会使得mp3的size变大一些,这样的mp3 copy到player里就会使得音调改变。

而且,当传输完毕后,不要立刻plug off,看player上的显示,体质了accesss图示,再plug off,否则很容易出现no data的error on player。

Powered by ScribeFire.

Wednesday, 8 August 2007

c program with input and output argument


每一C 程序都必须有一main()函数, 可以根据自己的爱好把它放在程序的某个地方。有些程序员把它放在最前面,
而另一些程序员把它放在最后面, 无论放在哪个地方,以下几点说明都是适合的。

1. main() 参数

在Turbo C2.0启动过程中, 传递main()函数三个参数: argc, argv和env。

* argc: 整数, 为传给main()的命令行参数个数。
* argv: 字符串数组。

在DOS 3.X 版本中, argv[0] 为程序运行的全路径名; 对DOS 3.0

以下的版本, argv[0]为空串("") 。 argv[1] 为在DOS命令行中执行程序名后的第一个字符串;argv[2] 为执行程序名后的第二个字符串; argv[argc]为NULL。
*env: 安符串数组。env[] 的每一个元素都包含ENVVAR=value形式的字符串。其中ENVVAR为环境变量如PATH或87。value为ENVVAR的对应值如C:\DOS, C:\TURBOC(对于PATH)或YES(对于87)。

Turbo C2.0启动时总是把这三个参数传递给main()函数, 可以在用户程序中说明(或不说明)它们,如果说明了部分(或全部)参数, 它们就成为main()子程序的局部变量。

请注意: 一旦想说明这些参数, 则必须按argc, argv, env 的顺序, 如以下的例子:

main(int argc)
main(int argc, char *argv[])
main(int argc, char *argv[], char *env[])

其中第二种情况是合法的, 但不常见, 因为在程序中很少有只用argc, 而不用argv[]的情况。以下提供一样例程序EXAMPLE.EXE, 演示如何在main()函数中使用三个参数:

/*program name EXAMPLE.EXE*/

main(int argc, char *argv[], char *env[])

int i;

printf("These are the %d command- line arguments passed to main:\n\n", argc);

for(i=0; i<=argc; i++)

printf("argv[%d]:%s\n", i, argv[i]);

printf("\nThe environment string(s)on this system are:\n\n");

for(i=0; env[i]!=NULL; i++)

printf(" env[%d]:%s\n", i, env[i]);
如果在DOS 提示符下, 按以下方式运行EXAMPLE.EXE:

C:\example first_argument "argument with blanks" 3 4 "last but one"

注意: 可以用双引号括起内含空格的参数, 如本例中的: " argument with blanks"和"Last but one")。


The value of argc is 7

These are the 7 command-linearguments passed to main:



argv[2]:argument with blanks



argv[5]:last but one



The environment string(s) on this system are:

env[1]: PROMPT=$P$G


env[2]: PATH=C:\DOS;C:\TC /*视具体设置而定*/

应该提醒的是: 传送main() 函数的命令行参数的最大长度为128 个字符 (包括参数间的空格),

这是由DOS 限制的。

latex template

\documentclass{report}%\documentclass[12pt]{report}%seems only 12pt is an option for the class of report, others do not work, so not every number is meaningful and useful for the whole article.

\setlength{\parindent}{0pt} % indent of paragraph

\setlength{\parskip}{10pt} % distance between paragraphs



%% Because here macro:geometry is used, so the following 4 setting is invalid




\usepackage{setspace} %linespace

\onehalfspacing % or \doublespacing \setstretch{3}


\title{The Template of Latex Report}

\author{Cross Zheng\\

PhotoPhysics Research Centre\\

London South Bank University\\



% \date{17 Apr 1984}



%\fontsize{10}{15}%12pt type, with 15pt leading; compared with \large, the latter is easier.

%% the number for size of font is depending on the 'large','huge',etc,. Not each number is meaningful and useful.

% \maketitle%The title of the ``article'' with date, not suitable for report,
%% only \title,\author,\thanks,\date are the optional parameters.
%% for report, \titlepage is suitable.


Here I just list the commands I always use to decorate my reports...\emph{Cross Zheng}



without DOUBLE SLASH only emptyline

without emptyline only DOUBLE SLASH \\

DOUBLE SLASH plus emptyline\\

From above we know that DOUBLE SLASH is for newline within a paragrah,

while emptyline is for new paragraph.\\










\emph{ So DOUBLE SLASH is for new line and an empty line is for new paragraph}\\

above sentence is emphasized.




\chapter{First Chapter}

\section{Some Formats can be used in paragraph}


You may want to write things \textsf{in a sans-serif font},

or \texttt{in a typewriter font}, or \textsl{in a slanted font}

(which is \emph{slightly different} than italics).

Sometimes it pays \textsc{to write things in small capitals}.

You can next go to \textbf{bold and then \textsl{bold and slanted} and

then back to just bold} again.

\subsection{Three ways to emphasize the words}

{\em emphasize Part 1}\\%\\ + emptyline makes a new paragraph, only \\ just newline,andempty line

\emph{emphasize Part 2}\\


emphasize Part 3


%\indent % Empty line between paragraphs

\subsection{Itemize and enumerate}


The following is itemize

\begin{itemize} %\setlength{\itemsep}{-\itemsep} %here is for modification of distance between items

\item some days where nothing goes right?

\item times when you just cannot get a decent telephone connection?

\item years when drought follows drought?

\item long periods when gusts of wind come thick and fast?


The following is enumerate


\item start with a bar of some length;

\item then remove its middle third to leave two separate thirds;

\item then remove the middle thirds of these to leave four separate ninths;

\item then remove the middle thirds of these to obtain eight separate twenty-sevenths;

\item and so on.


\subsection{Figure and Table}

\begin{figure}[htp]%[htp] is for absolute position where the figure should appear. otherwize the figure will be on the top of the page.


\includegraphics[width=0.5\textwidth]{figu.jpg} %%for pdflatex,JPEG is ok. but for dvi, EPS works.

\caption{steps in the construction of a Cantor set.}



Construct the tabular set in the following manner:

\begin{table}[htp]%[htp] is for absolute position where the figure should appear. otherwize the figure will be on the top of the page.


\begin{tabular}[t]{|c|c|} %\begin{tabular}[t]{|l|ccccc|c|} here [t] is vertical alignment,{|l|ccccc|c|} is column alignment.

%\multicolumn{2}{c}{USAMTS Scores Round 1}\\ % some kind of same with previous line,just caption here.


Object & Dimension \\


point & 0 \\

The item and enum, \S\ref{itemandenum} & AAAAAAA \\

line & 1 \\

Math and Equation, \S\ref{me} & BBBBBB \\

plane & 2 \\

How to quote, \S\ref{reftoqutote} & CCCCCCC \\

solid & 3 \\



\caption{common Euclidean and fractal objects and their fractal





\section{Math and Equation}


Here will list some different style of the maths:

\subsection{Embedded Math}


\(3\times 3\times 3 + math display style\) \\% \( and \) for math display

alternatively,it can be like this


3\times 3\times 3


\( N\propto d^{-2} \) a math in para. also it can be embedded in para like this


\frac{4A}{\pi d^2}


\subsection{Various Equations}


The followings are equations:\\

the relation between \(N \) and \( d \) involves a fractional exponent \( D \):


N\propto d^{-D}.



Such an object of the fraction \( D \). Here D is math style.


s = \frac{\delta+\theta^{2}_{3}}{\left(a+b\right)}

% s = \left(a+b\right)/\deta




s = (\delta+\theta)/\left(a+b\right)*

% s = \left(a+b\right)/\deta



If any format is unclear, one way is to use TeXnicCenter to generate the codes,

the other way is just to google.

\section{Ref to quote}


The Ref mechanism is very powerful. Even section can be quoted in another

para or table easily, no matter the appearing sequence.

In the table~\ref{T:tab1}, three sections are quoted from different

positions\footnote{The sequence is disorder, but the quote still works


Here I used footnote as another reference style.\\

Of course, the Figure~\ref{F:fig1} and Table~\ref{T:tab1} can be quoted as

normal functions. But Reference is quoted in another way by ``cite'', here~\cite{ref2}.


\begin{thebibliography}{99}% The thebibliography environment produces a bibliography or reference list. In the article style, this reference list is labeled "References"; in the report style, it is labeled "Bibliography".

\addcontentsline{toc}{section}{References}% Add a chapter title to the contents page.

\bibitem{ref1} B.~B.~Mandelbrot, \emph{The fractal geometry of

nature}, 1983 .

\bibitem{ref2} H.~Kornberg, \emph{J.\ Irreducible Results}.

\bibitem{ref3} L.~F.~Richardson, somewhere and sometime in the




Monday, 6 August 2007

what's latex

  • TeX 是什么?

    TeX 是一个排版系统。用 TeX,你可以把你的文章做成书那种效
    果。你可以把它打印出来,或者送到出版社投稿。TeX 非常适合用来

  • 排版 Word 也可以啊!TeX 跟 Word, WordPerfect 有什么不一

    Word 和 WordPerfect 是“字处理程序”(word processor),它
    画出表格…… 马上就可以看到效果。屏幕上显示出来是什么效果,
    印出来基本上就是那个效果。而 TeX 不是,你输入的都是文本文件,

  • 那样的话 TeX 还不如 Word 呢!

    Word 这样所见即所得的程序写科技论文是很累的。这会使你的脑
    子总是想着专业排版人员考虑的问题,比如 “这个单词使用什
    么字体呢?”,“这行应该缩进多少呢?” 这样就没有什么时
    间用来思考语言和内容了。所以 TeX 被设计为“WYTIWYG (所

    用TeX写文章,他想的是 “这一段是否应该属于上一节呢?”,
    呢?”,“这个概念读者是否容易理解呢?”…… 你告诉 TeX 的
    是:“这是一章开始”,“这个单词应该强调”, “这里是一段
    体楷体小四”, “左右缩进各一英寸,右边不要对齐,换用小一号

    TeX 就是你优雅而聪明的秘书。你写论文的时候,能专注于逻辑

  • 你比较一下 Word 和 LaTeX 生成的的PDF文档就可以发现:

  • 远远看去,LaTeX 文档格式更加均称,黑白程度均匀,而
    Word 文档是黑一块的白一块,字符密度不均匀。
  • 仔细看看,你就知道原因了。 Word 文档里上下两行经常有
  • Chelsea VS Manchester United

    Powered by ScribeFire.

    Thursday, 2 August 2007


    clipped from

    A 鸡蛋 10个
    盐 15克
    B 五香粉 1大匙(15ml)
    八角 12克
    花椒 7.5克
    干姜 12克
    酱油 120ml
    冰糖 1大匙


    Blogger Icon changing

    Have you wondered how these little icons appear next to the web addresses, like the one you see above? When you visit the sites or bookmark them, these icons will make these URLs stand out. These are “Favicons” or “Favorite Icons”.

    You would first need to have an icon which you would like to use, bearing the extension .ico format. If you search your hard disk, you might find some icons which are generic. I would suggest that you create one to represent your own unique identity. There are quite a number of free icon editor software which you can download from the net.

    As for myself, I went to site, and downloaded a very small program called Imagicon which can transform images into .ico format. I created an image using Photoshop. You can use any image or pictures if you do not wish to create one. Next, run the program. It is rather simple to use. While you can create icons in 2 sizes – 16x16 and 32x32 – I would think a 16x16 icon is preferable since it is readable in most older browsers.

    If you do not wish to download any software, you may also try creating an icon online. Just enter the keywords “online icon generator” into your Google search bar, and you should be able to find several programs that you can try.

    Once you have created an icon, save it into your hard disk. The next step of attaching the icon is a little tricky. Ideally, all you need to do is to save it in the root directory of your blog site. Nevertheless, there is no way this can be done. For one, if you try to upload an icon image, Blogger will reject it. Two, any file that is uploaded will not go into the Blogger root directory.

    The only method to use will be to upload the icon into some web folder, and create a link. A lot of us do not have personal websites. I created one using Google Page Creator. You can also use the free Google Groups to host your file. For more information on how you can upload files on either of these 2 platforms, you may read the article on Using Google Page Creator and Google Groups.

    Once you have done that, take note of the URL of your icon. If you are using Google Page Creator, hovering your mouse over the link, you will see that the file is stored under a directory which looks like this
    where “yourname” is your Gmail account name, and “iconname” is the file name. Copy this URL.

    Go back to your Blogger dashboard and under the Template tab, go to “Edit HTML”. Near the top you will see a line like this:-

    Copy and insert the following code below the above line:-

    <#link rel="shortcut icon" href="URL of your icon file"/#>

    p.s. # should be deleted when you put the codes in your HTML CODES.

    Remember to type in the “URL of your icon file”.

    Save the template. When you refresh your blog site, you should see your nice little Favicon next to the blog address.

    From site:

    My photo
    London, United Kingdom

    Facebook & Twitter