2012年2月15日 星期三

2012年2月14日 星期二

Linx Hot keyboard

Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + L Clears the Screen, similar to the clear command
Ctrl + U Clears the line before the cursor position. If you are at the end of the line, clears the entire line.
Ctrl + H Same as backspace
Ctrl + R Let’s you search through previously used commands
Ctrl + C Kill whatever you are running
Ctrl + D Exit the current shell
Ctrl + Z Puts whatever you are running into a suspended background process. fg restores it.
Ctrl + W Delete the word before the cursor
Ctrl + K Clear the line after the cursor
Ctrl + T Swap the last two characters before the cursor
Esc + T Swap the last two words before the cursor
Alt + F Move cursor forward one word on the current line
Alt + B Move cursor backward one word on the current line
Tab Auto-complete files and folder names




Reference: http://www.howtogeek.com/howto/ubuntu/keyboard-shortcuts-for-bash-command-shell-for-ubuntu-debian-suse-redhat-linux-etc/

2012年2月13日 星期一

ON Linux

http://miracle88.homeip.net/?p=1248

2012年2月9日 星期四

Kernel

1. For centOS
{{{
Ariticle:
ftp://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/os/SRPMS/

Downlaod:
ftp://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/os/SRPMS/


}}}

2. Reference
{{{
http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/arch/x86/kernel/smp_32.c?v=2.6.25#L135

http://hira-consulting.com/wiki/index.php?__send_IPI_shortcut%28%29%2Flinux2.6


}}}

RPM

1. Extract RPM content
{{{
rpm2cpio kernel-2.6.18-8.1.8.el5.src.rpm | cpio -idmv

Reference:
http://www.cyberciti.biz/tips/how-to-extract-an-rpm-package-without-installing-it.html
}}}

2012年2月5日 星期日

Common Command

http://fecbob.pixnet.net/blog/post/34682395-linux-%E5%B8%B8%E7%94%A8%E7%9A%84%E6%8C%87%E4%BB%A4

2012年1月12日 星期四

gcc Compiler

Introduction:
The GNU C compiler is an integral part of the GNU system and was initially written by Richard Stallman. At first it only compiled C code. Later a group of volunteers started maintaining it and GCC gained the ability to support different languages such a C++, Fortran, Ada and Java


Sample:
Three file
test.c
{{{

#include "test.h"

void test(void) {
}

}}}
test.h
{{{

#ifndef TEST_H_INCLUDED
#define TEST_H_INCLUDED
void test (void);
#endif


}}}
header_test.c: include all content
{{{

#include
#include "test.h"

int main(int argc, char *argv[]) {
test();
}


}}}


Compiler order:
{{{
# Compiler the test as the object content
[Andy@localhost HEADERTEST]$ gcc -c test.c

# Linker test.o and compiler the main header file
[Andy@localhost HEADERTEST]$ gcc test.o header_test.c -o header_test

}}}





Reference:
http://stackoverflow.com/questions/672734/how-to-prevent-multiple-definitions-in-c
http://www.seas.upenn.edu/cets/answers/gcc.html

http://pages.cs.wisc.edu/~beechung/ref/gcc-intro.html

document:
http://www.google.com.tw/url?sa=t&rct=j&q=gcc+tutorial&source=web&cd=5&ved=0CEkQFjAE&url=http%3A%2F%2Fusers.encs.concordia.ca%2F~mokhov%2Fcomp444%2Ftutorials%2Fgcc.pdf&ei=ScsPT9DdGsmuiQfQlYgN&usg=AFQjCNEoLYzfKgvR2w45MaJgAV0X2E6gVQ&sig2=Jr5GLu6ZqRINbBsAjZxyzQ


http://falldog7.blogspot.com/2007/09/cc-function-definition-definitionh.html



Useful Linux command content
{{{{
-c : 只做編譯(不做連結)
-S : 輸出組譯碼
-E : 將預處理結果顯示
-o filename : 指定輸出檔名
-ansi : 程式要求依據ansi c標準
-Dmacro : 使定義巨集(marco)為有效
-Dmarco=defn : 使定義巨集(marco)為defn
-Wa,option : 將選項(option)傳給組譯器
-wl,option : 將選項(option)傳給連結器
-I : 追加include檔案的搜尋路徑
-L : 追加library檔案的搜尋路徑
-l : 指定連結的函式庫
-Wall : 顯示所有的警告訊息
-g : 編入除錯資訊(要使用GDB除錯一定要加)
-O2 : 做最佳化

Reference: http://www.wretch.cc/blog/Geniusking/7263728

}}}


Simple Link:
{{{
http://linux.vbird.org/
}}}