2011年12月2日 星期五

install gcc-4.1 under Ubuntu

目前系統gcc版本是4.4.3

nelson@swdev:~/eMbedded/crosstoolchain/crosstool-0.43$ gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)

此版本編譯cross toolchain都會遇到麻煩

像是
http://blog.chinaunix.net/space.php?uid=20543672&do=blog&id=94333
 所提到的
*** buffer overflow detected ***: arm-9tdmi-linux-gnu-ar terminated

所以需要改裝gcc 4.1版本


ubuntu上安裝挺簡單的

sudo apt-get install gcc-4.1

primesw@swdev:~$ sudo apt-get install gcc-4.1
[sudo] password for primesw:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-2.6.32-34-generic linux-headers-2.6.32-34
  linux-headers-2.6.32-34-server
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  cpp-4.1 gcc-4.1-base
Suggested packages:
  gcc-4.1-locales gcc-4.1-multilib gcc-4.1-doc libmudflap0-dev
The following NEW packages will be installed:
  cpp-4.1 gcc-4.1 gcc-4.1-base
0 upgraded, 3 newly installed, 0 to remove and 142 not upgraded.
Need to get 3,360kB of archives.
After this operation, 7,528kB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
  gcc-4.1-base cpp-4.1 gcc-4.1
Install these packages without verification [y/N]? y
Get:1 http://cn.archive.ubuntu.com/ubuntu/ lucid/universe gcc-4.1-base 4.1.2-27u                                                                                        buntu1 [209kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu/ lucid/universe cpp-4.1 4.1.2-27ubuntu                                                                                        1 [2,550kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu/ lucid/universe gcc-4.1 4.1.2-27ubuntu                                                                                        1 [600kB]
Fetched 3,360kB in 28s (119kB/s)
Selecting previously deselected package gcc-4.1-base.
(Reading database ... 282346 files and directories currently installed.)
Unpacking gcc-4.1-base (from .../gcc-4.1-base_4.1.2-27ubuntu1_amd64.deb) ...
Selecting previously deselected package cpp-4.1.
Unpacking cpp-4.1 (from .../cpp-4.1_4.1.2-27ubuntu1_amd64.deb) ...
Selecting previously deselected package gcc-4.1.
Unpacking gcc-4.1 (from .../gcc-4.1_4.1.2-27ubuntu1_amd64.deb) ...
Processing triggers for man-db ...
Setting up gcc-4.1-base (4.1.2-27ubuntu1) ...

Setting up cpp-4.1 (4.1.2-27ubuntu1) ...
Setting up gcc-4.1 (4.1.2-27ubuntu1) ...



就可以在/usr/bin下看到嚕
ls /usr/bin/gcc*
/usr/bin/gcc  /usr/bin/gcc-4.1  /usr/bin/gcc-4.4  /usr/bin/gccbug-4.1



接下來需要做soft link

sudo rm /usr/bin/gcc
sudo ln -s /usr/bin/gcc-4.1 /usr/bin/gcc

之後使用gcc -v
 就可以發現版本換嚕

gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.1.3 --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --with-tune=generic --enable-checking=release x86_64-linux-gnu
Thread model: posix
gcc version 4.1.3 20080704 (prerelease) (Ubuntu 4.1.2-27ubuntu1)

透過Facebook分享

demo-arm.sh

cp demo-arm.sh nelson-arm.sh

vim nelson-arm.sh

修改
TARBALLS_DIR=$HOME/eMbedded/downloads
RESULT_TOP=$HOME/eMbedded/crosstool

./nelson-arm.sh

+ /home/nelson/eMbedded/crosstoolchain/crosstool-0.43/build/arm-unknown-linux-gnu/gcc-4.1.0-glibc-2.3.2/glibc-2.3.2/configure --prefix=/usr --build=x86_64-unknown-linux-gnu --host=arm-unknown-linux-gnu --without-cvs --disable-sanity-checks --with-headers=/home/nelson/eMbedded/crosstool/gcc-4.1.0-glibc-2.3.2/arm-unknown-linux-gnu/arm-unknown-linux-gnu/include --enable-hacker-mode
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-unknown-linux-gnu
checking sysdep dirs... sysdeps/arm/elf sysdeps/unix/sysv/linux/arm sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix/arm sysdeps/unix sysdeps/posix sysdeps/arm/fpu sysdeps/arm sysdeps/wordsize-32 sysdeps/ieee754/flt-32 sysdeps/ieee754/dbl-64 sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for pwd... /bin/pwd
checking for arm-unknown-linux-gnu-gcc... gcc
checking version of gcc... 4.4.3, bad
checking for gnumake... no
checking for gmake... no
checking for make... make
checking version of make... 3.81, ok
configure: error:
*** These critical programs are missing or too old: gcc
*** Check the INSTALL file for required versions.

Ref:
http://blog.chinaunix.net/space.php?uid=12072359&do=blog&id=2960855


修改此檔案
vim build/arm-unknown-linux-gnu/gcc-4.1.0-glibc-2.3.2/glibc-2.3.2/configure
2275c2275
<     3.[2-9]*|4.[01]*)
---
>     3.[2-9]*|4.*)


 
vim nelson-arm.sh
加上--nounpack

./nelson-arm.sh

In file included from /usr/include/fcntl.h:205,
                 from /home/nelson/eMbedded/crosstoolchain/crosstool-0.43/build/arm-unknown-linux-gnu/gcc-4.1.0-glibc-2.3.2/gcc-3.3.6/gcc/system.h:208,
                 from /home/nelson/eMbedded/crosstoolchain/crosstool-0.43/build/arm-unknown-linux-gnu/gcc-4.1.0-glibc-2.3.2/gcc-3.3.6/gcc/collect2.c:30:
In function ‘open’,
    inlined from ‘collect_execute’ at /home/nelson/eMbedded/crosstoolchain/crosstool-0.43/build/arm-unknown-linux-gnu/gcc-4.1.0-glibc-2.3.2/gcc-3.3.6/gcc/collect2.c:1575:
/usr/include/bits/fcntl2.h:51: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments
make[1]: *** [collect2.o] Error 1
make[1]: Leaving directory `/home/nelson/eMbedded/crosstoolchain/crosstool-0.43/build/arm-unknown-linux-gnu/gcc-4.1.0-glibc-2.3.2/build-gcc-core/gcc'
make: *** [all-gcc] Error 2

vim +1575 build/arm-unknown-linux-gnu/gcc-4.1.0-glibc-2.3.2/gcc-3.3.6/gcc/collect2.c

第三個參數地方加上0777
記得要用,隔開

解法

摘錄部份重點
这纯属软件bug,因为使用open函数的时候,如果在第二个参数中使用了 O_CREAT,就必须添加第三个参数:创建文件时赋予的初始权限。而在gcc-3.3.6/gcc/的collect2.c文件中有漏掉第三个参数的错误,而gcc-4.3对语法错误的检查严格是出了名的(4.1就不会因此错误退出),所以就退出了。


nelson@swdev:~/eMbedded/crosstoolchain/crosstool-0.43$ ./nelsonbuild

arm-unknown-linux-gnu-ar  rc ./libgcc.a libgcc/./_udivsi3.o libgcc/./_divsi3.o libgcc/./_umodsi3.o libgcc/./_modsi3.o libgcc/./_dvmd_lnx.o libgcc/./_muldi3.o libgcc/./_negdi2.o libgcc/./_lshrdi3.o libgcc/./_ashldi3.o libgcc/./_ashrdi3.o libgcc/./_ffsdi2.o libgcc/./_clz.o libgcc/./_cmpdi2.o libgcc/./_ucmpdi2.o libgcc/./_floatdidf.o libgcc/./_floatdisf.o libgcc/./_fixunsdfsi.o libgcc/./_fixunssfsi.o libgcc/./_fixunsdfdi.o libgcc/./_fixdfdi.o libgcc/./_fixunssfdi.o libgcc/./_fixsfdi.o libgcc/./_fixxfdi.o libgcc/./_fixunsxfdi.o libgcc/./_floatdixf.o libgcc/./_fixunsxfsi.o libgcc/./_fixtfdi.o libgcc/./_fixunstfdi.o libgcc/./_floatditf.o libgcc/./_clear_cache.o libgcc/./_trampoline.o libgcc/./__main.o libgcc/./_exit.o libgcc/./_absvsi2.o libgcc/./_absvdi2.o libgcc/./_addvsi3.o libgcc/./_addvdi3.o libgcc/./_subvsi3.o libgcc/./_subvdi3.o libgcc/./_mulvsi3.o libgcc/./_mulvdi3.o libgcc/./_negvsi2.o libgcc/./_negvdi2.o libgcc/./_ctors.o libgcc/./_divdi3.o libgcc/./_moddi3.o libgcc/./_udivdi3.o libgcc/./_umoddi3.o libgcc/./_udiv_w_sdiv.o libgcc/./_udivmoddi4.o libgcc/./unwind-dw2.o libgcc/./unwind-dw2-fde-glibc.o libgcc/./unwind-sjlj.o libgcc/./unwind-c.o libgcc/./_eprintf.o libgcc/./_bb.o libgcc/./__gcc_bcmp.o
*** buffer overflow detected ***: arm-unknown-linux-gnu-ar terminated
======= Backtrace: =========
/lib/libc.so.6(__fortify_fail+0x37)[0x2ad5bb56a217]
/lib/libc.so.6(+0xfe0d0)[0x2ad5bb5690d0]
/lib/libc.so.6(+0xfd539)[0x2ad5bb568539]
/lib/libc.so.6(_IO_default_xsputn+0xcc)[0x2ad5bb4e0d1c]
/lib/libc.so.6(_IO_padn+0xe8)[0x2ad5bb4d47f8]
/lib/libc.so.6(_IO_vfprintf+0x2afc)[0x2ad5bb4b2e9c]
/lib/libc.so.6(__vsprintf_chk+0x99)[0x2ad5bb5685d9]
/lib/libc.so.6(__sprintf_chk+0x7f)[0x2ad5bb56851f]
arm-unknown-linux-gnu-ar[0x409144]
arm-unknown-linux-gnu-ar[0x407361]
arm-unknown-linux-gnu-ar[0x4099d5]
arm-unknown-linux-gnu-ar[0x4107ef]
arm-unknown-linux-gnu-ar[0x403fff]
arm-unknown-linux-gnu-ar[0x4044bd]
arm-unknown-linux-gnu-ar[0x404ef9]
/lib/libc.so.6(__libc_start_main+0xfd)[0x2ad5bb489c4d]
arm-unknown-linux-gnu-ar[0x401e69]
======= Memory map: ========
00400000-00465000 r-xp 00000000 08:01 4167281                            /home/nelson/eMbedded/crosstool/gcc-4.1.0-glibc-2.3.2/arm-unknown-linux-gnu/bin/arm-unknown-linux-gnu-ar
00664000-00665000 r--p 00064000 08:01 4167281                            /home/nelson/eMbedded/crosstool/gcc-4.1.0-glibc-2.3.2/arm-unknown-linux-gnu/bin/arm-unknown-linux-gnu-ar
00665000-00666000 rw-p 00065000 08:01 4167281                            /home/nelson/eMbedded/crosstool/gcc-4.1.0-glibc-2.3.2/arm-unknown-linux-gnu/bin/arm-unknown-linux-gnu-ar
00666000-0066a000 rw-p 00000000 00:00 0
00ad1000-019cb000 rw-p 00000000 00:00 0                                  [heap]
2ad5bb249000-2ad5bb269000 r-xp 00000000 08:01 33562306                   /lib/ld-2.11.1.so
2ad5bb269000-2ad5bb26b000 rw-p 00000000 00:00 0
2ad5bb26b000-2ad5bb26c000 r--p 00000000 08:01 796839                     /usr/lib/locale/en_US.utf8/LC_MESSAGES/SYS_LC_MESSAGES
2ad5bb26c000-2ad5bb273000 r--s 00000000 08:01 797675                     /usr/lib/gconv/gconv-modules.cache
2ad5bb273000-2ad5bb2b2000 r--p 00000000 08:01 796833                     /usr/lib/locale/en_US.utf8/LC_CTYPE
2ad5bb2b2000-2ad5bb2bc000 rw-p 00000000 00:00 0
2ad5bb468000-2ad5bb469000 r--p 0001f000 08:01 33562306                   /lib/ld-2.11.1.so
2ad5bb469000-2ad5bb46a000 rw-p 00020000 08:01 33562306                   /lib/ld-2.11.1.so
2ad5bb46a000-2ad5bb46b000 rw-p 00000000 00:00 0
2ad5bb46b000-2ad5bb5e5000 r-xp 00000000 08:01 33563969                   /lib/libc-2.11.1.so
2ad5bb5e5000-2ad5bb7e4000 ---p 0017a000 08:01 33563969                   /lib/libc-2.11.1.so
2ad5bb7e4000-2ad5bb7e8000 r--p 00179000 08:01 33563969                   /lib/libc-2.11.1.so
2ad5bb7e8000-2ad5bb7e9000 rw-p 0017d000 08:01 33563969                   /lib/libc-2.11.1.so
2ad5bb7e9000-2ad5bb7f0000 rw-p 00000000 00:00 0
2ad5bb7f0000-2ad5bb806000 r-xp 00000000 08:01 33554487                   /lib/libgcc_s.so.1
2ad5bb806000-2ad5bba05000 ---p 00016000 08:01 33554487                   /lib/libgcc_s.so.1
2ad5bba05000-2ad5bba06000 r--p 00015000 08:01 33554487                   /lib/libgcc_s.so.1
2ad5bba06000-2ad5bba07000 rw-p 00016000 08:01 33554487                   /lib/libgcc_s.so.1
7fffa4b04000-7fffa4b1c000 rw-p 00000000 00:00 0                          [stack]
7fffa4bfc000-7fffa4bfd000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
make[2]: *** [libgcc.a] Aborted
make[2]: *** Deleting file `libgcc.a'
make[2]: Leaving directory `/home/nelson/eMbedded/crosstoolchain/crosstool-0.43/build/arm-unknown-linux-gnu/gcc-4.1.0-glibc-2.3.2/build-gcc-core/gcc'
make[1]: *** [libgcc.a] Error 2
make[1]: Leaving directory `/home/nelson/eMbedded/crosstoolchain/crosstool-0.43/build/arm-unknown-linux-gnu/gcc-4.1.0-glibc-2.3.2/build-gcc-core/gcc'
make: *** [all-gcc] Error 2

將系統的gcc版本換成4.1版本
參考

install gcc-4.1 under Ubuntu



ln -s nelson-arm.sh nelsonbuild
./nelsonbuild

這樣編譯
還是有一樣的問題

修改nelsonbuild
拿掉--nounpack

重新來一次

哇靠
上面的修改都不用
就成功了

+ /home/nelson/eMbedded/crosstool/gcc-4.1.0-glibc-2.3.2/arm-unknown-linux-gnu/bin/arm-unknown-linux-gnu-gcc -static hello.c -o arm-unknown-linux-gnu-hello-static
+ /home/nelson/eMbedded/crosstool/gcc-4.1.0-glibc-2.3.2/arm-unknown-linux-gnu/bin/arm-unknown-linux-gnu-gcc hello.c -o arm-unknown-linux-gnu-hello
+ test -x /home/nelson/eMbedded/crosstool/gcc-4.1.0-glibc-2.3.2/arm-unknown-linux-gnu/bin/arm-unknown-linux-gnu-g++
+ cat
+ /home/nelson/eMbedded/crosstool/gcc-4.1.0-glibc-2.3.2/arm-unknown-linux-gnu/bin/arm-unknown-linux-gnu-g++ -static hello2.cc -o arm-unknown-linux-gnu-hello2-static
+ /home/nelson/eMbedded/crosstool/gcc-4.1.0-glibc-2.3.2/arm-unknown-linux-gnu/bin/arm-unknown-linux-gnu-g++ hello2.cc -o arm-unknown-linux-gnu-hello2
+ echo testhello: C compiler can in fact build a trivial program.
testhello: C compiler can in fact build a trivial program.
+ test '' = 1
+ test '' = 1
+ test '' = 1
+ test 1 = ''
+ echo Done.
Done.







gcc版本要換成4.1是關鍵阿


透過Facebook分享

usb2.0-ser! driver安裝

安裝usb to rs232裝置

driver從此處下載
http://www.winchiphead.com/download/CH341/CH341SER.ZIP
or
https://drive.google.com/file/d/0B2dgGdZOVJXgSFdVbHVDRWViaWs/view?usp=sharing

解壓縮後
執行以下檔案
CH341SER\DRIVER\SETUP

安裝成功

Ref:
http://www.computerhope.com/forum/index.php?topic=81904.0

透過Facebook分享

2011年11月23日 星期三

2011年11月21日 星期一

upgrade firefox from 3.6 to 8.0 under 10.04

   sudo add-apt-repository ppa:mozillateam/firefox-stable
   sudo apt-get update
   sudo apt-get upgrade



透過Facebook分享

2011年11月17日 星期四

mac燒錄iso檔案

應用程式>工具程式>磁碟工具程式
點選燒錄並選擇iso檔案

Ref:
http://blog.xuite.net/smarthbk/blog/24682407

透過Facebook分享

如何在MAC的home目錄下mkdir

cd /home

nelsonchungteki-MacBook-Pro:home nelsonchung$ mkdir nelsonchung
mkdir: nelsonchung: Operation not supported



sudo vim /etc/auto_master
comment out /home like this
#/home                  auto_home       -nobrowse,hidefromfinder

reboot the system

重開機後就可以mkdir嚕
但是要寫入資料會有問題
預設權限是755
用sudo chmod -R 777 xxx
可以解決

Ref:
https://discussions.apple.com/thread/2073807?threadID=2073807&tstart=0

透過Facebook分享

2011年11月9日 星期三

升級snow leopard到Lion (10.7)

Follow http://www2.p2d2d.com:81/index.php/osx-lion-cracked-version-bt-seed-download.html

bt種子下载

下載完成後
滑鼠右鍵(兩根手指點擊觸碰盤)點選該檔案
顯示套件內容
刪除Contents>_MASReceipt
點擊 "安裝 Mac OS X Lion"
開始進行安裝

會需要重新開機
安裝大約需要35分鐘

重新開機後就成功嚕

透過Facebook分享

2011年11月3日 星期四

如何將tcpdump移植到arm嵌入式系統

Follow http://read-and-thinking.blogspot.com/2009/06/tcpdumparm.html

下載
libpcap-1.1.1
tcpdump-4.1.1

build licpcap-1.1.1

 1. 修改configure file
註解掉6901~6905
#if test -z "$with_pcap" && test "$cross_compiling" = yes; then
# { { echo "$as_me:$LINENO: error: pcap type not determined when cross-compiling; use --with-pcap=..." >&5
#echo "$as_me: error: pcap type not determined when cross-compiling; use --with-pcap=..." >&2;}
# { (exit 1); exit 1; }; }
#fi

註解掉7237~7241
# if test $ac_cv_linux_vers = unknown ; then
# { { echo "$as_me:$LINENO: error: cannot determine linux version when cross-compiling" >&5
#echo "$as_me: error: cannot determine linux version when cross-compiling" >&2;}
# { (exit 1); exit 1; }; }
# fi

./configure --host=arm-none-linux


確認Makefile的CC不是gcc而是你的cross compile的名字
就代表ok嚕
接下來
make

產生libpcap.so.1.1.1

就代表成功嚕

build tcpdump-4.1.1


 1. 修改configure
註解掉 4411~4415

# if test $ac_cv_linux_vers = unknown ; then
# { { echo "$as_me:$LINENO: error: cannot determine linux version when cross-compiling" >&5
#echo "$as_me: error: cannot determine linux version when cross-compiling" >&2;}
# { (exit 1); exit 1; }; }
# fi

./configure --host=arm-none-linux

檢查是否成功的方式與上述相同

確認成功後
make
產生tcpdump
就代表成功嚕

可以用file看一下

file tcpdump
tcpdump: ELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared libs), not stripped





透過Facebook分享

2011年10月27日 星期四

GMAIL沒辦法顯示網頁

MIS又在搞鬼了

使用DHCP自動取得IP
會幫你設定DNS Server
看到192.168.10.10

gmail.com無法顯示頁面
wireshark看到192.168.10.10不解析domain name
造成網頁顯示無法正常的關鍵

Ubuntu環境下
右上角連線符號按下滑鼠右鍵
點擊編輯連線
選擇有線/無線網路  (看你目前使用哪種網路)
選擇該網路後 按下編輯 (位於右方)
輸入密碼後
切到IPv4設定
方法
切換:"自動(DHCP)"到"只用自動(DHCP)位址"
DNS伺服器
填入 168.95.1.1 (中華電信)
or 8.8.8.8 (google public dns server)

就可以正常顯示gmail登入畫面嚕

透過Facebook分享

2011年10月25日 星期二

利用echo發出聲音

MacBook Pro ok.
nelsonchungteki-MacBook-Pro:~ nelsonchung$ echo $'\07'



Ref:
http://blog.longwin.com.tw/2011/10/shell-done-sound-alert-2011/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tsungblog+%28Tsung%27s+Blog%29

透過Facebook分享

2011年10月4日 星期二

2011年9月29日 星期四

2011年9月28日 星期三

/bin, /sbin, /usr/bin, /usr/sbin 擺放binary的原則

系統有四個地方可以放置binary

/bin, /sbin, /usr/bin, /usr/sbin

所編譯出來的binary file, 怎麼放比較適合呢

可以用使用者以及系統管理者來做分類
/bin: 使用者與系統管理者必備
/sbin: 使用者非必備, 系統管理者必備
/usr/bin: 使用者非必備
/usr/sbin: 系統管理者非必備


Ref:
建構嵌入式LINUX系統
ISBN: 986-7794-30-3

透過Facebook分享

2011年9月23日 星期五

binutils

GNU toolchain包含三個部份
1. gcc
2. glibc
3. binutils

這邊談到binutils會包含到幾下幾個程式
1. as: GNU assembler
2. ld: GNU linker
3. gasp: GNU assembler pre-preocessor
4. ar: 用來建立與操作靜態函式庫的內容
5. nm: 表列目的檔中的符號
6. objcopy: 複製及轉議目的檔
7. objdump: 顯示與目的檔之內容有關的資訊
8. ranlib: 為靜態函式庫的內容產生索引
9. readelf: 顯示與ELF格式目的檔之內容有關的資訊
10. size: 列印目的檔中各區段的大小
11. strings: 印出目的檔中的可印字符
12. strip: 除去目的檔中的符號
13. c++filt: 將因為C++函式的重複載入而損毀的低階組合語言標籤轉換成使用者層級的名稱
14. addr2line: 將所指定的位址轉換成原碼檔案中的列號

Ref:
建構嵌入式LINUX系統
ISBN: 986-7794-30-3

透過Facebook分享

2011年9月21日 星期三

將Ubuntu遠端程式的畫面顯示在local端

使用 ssh -X acount@ipaddress 登入遠端 以firefox為例 登入後 type firefox 就可以在local顯示遠端的firefox嚕

透過Facebook分享

2011年9月20日 星期二

分享Google Reader的文章到Google+

沒看到Google Reader內有工具可以直接分享 這篇文章http://davidvielmetter.com/tricks/share-google-reader-items-on-google-plus/可以用拖拉的方式將 Google Reader內的文章標題拖拉到Google+的訊息串

透過Facebook分享

2011年9月14日 星期三

Install Asterisk - Voip Sip Server

add key
add repository

install asterisk
正在設定 libvpb0
This is the numeric code for the region your phone system will be operating in (eg. 61 for Australia or 33 for France). It is used to configure the default regional standards that Voicetronix telephony hardware should comply with.
ITU-T telephone code:
61
確定

按照設定值61

install asterisk-dahdi


Ref:
https://wiki.asterisk.org/wiki/display/AST/Asterisk+Packages?focusedCommentId=18415792&#AsteriskPackages-InstallingAsterisk

透過Facebook分享

install 32bit adobe reader under 64bit ubuntu

使用
sudo dpkg -i --force-architecture AdobeReader_cht-8.1.7-1.i386.deb

裝成功
可以用

透過Facebook分享

checkgmail失效 改用gmailwatcher

checkgmail不知道為什麼都無法登入

改用gmailwatcher

安裝方式

sudo add-apt-repository ppa:loneowais/ppa
sudo apt-get update
sudo apt-get install gmailwatcher

Ref:
http://www.webupd8.org/2010/09/gmailwatcher-gmail-notifier-especially.html

透過Facebook分享

2011年9月13日 星期二

mount under 11.04

掛載位於Ubuntu下分享出來的目錄到Ubuntu local

指令要改成

sudo mount -t cifs //172.18.1.2/Release /media/ReleaseServer -o username=xxx,password=ooo,codepage=cp950,iocharset=utf8

 用以下指令也行

sudo mount //172.18.1.2/Release /media/ReleaseServer -o username=xxx,password=ooo,codepage=cp950,iocharset=utf8

變方便了?

拿掉codepage and ischarset也行

sudo mount //172.18.1.2/Release /media/ReleaseServer -o username=xxx,password=ooo

透過Facebook分享

2011年9月9日 星期五

7z壓縮與解壓縮指令


7z壓縮指令
7z a -mx=9 -mmt 壓縮檔名 被壓縮的資料夾或檔名

7z解壓縮指令
7z x 壓縮檔名 -o輸出資料夾

-o與輸出資料夾中間不要有空格
不然
7z會回報
Error:
Incorrect command line

Ref:
http://moto.debian.tw/viewtopic.php?f=23&t=11927
man 7z

透過Facebook分享

2011年8月31日 星期三

殺掉關不掉的程式

aMsn一直不給我關掉
很奇怪

我用ps -x找出aMsn的PID

然後用kill
sudo kill PID

Ref:
http://www.pcnet.idv.tw/pcnet/linux/linux_command.htm#049ps

透過Facebook分享

2011年8月26日 星期五

[影片]賈伯斯的驚奇歷程:從Apple II到iPad

[影片]賈伯斯的驚奇歷程:從Apple II到iPad: 賈伯斯辭去蘋果CEO代表了一個世代的終結,讓我們用一段5分鐘長的影片重溫賈伯斯超潮迭起的生涯歷程,以及至今仍為人樂道的經典片段。


值得珍藏

透過Facebook分享

2011年8月24日 星期三

如何編譯rapidsvn source code

首頁:http://rapidsvn.tigris.org/




Pre-build:
build subversion source
sudo apt-get source subversion
sudo apt-get build-dep subversion
sudo ./configure
sudo make
sudo make install


build wxWidgets
http://www.wxwidgets.org/downloads/
安裝步驟教學
http://wiki.wxpython.org/InstallingOnUbuntuOrDebian


你需要到這裡註冊帳號
http://subversion.tigris.org/servlets/ProjectDocumentList

svn checkout http://rapidsvn.tigris.org/svn/rapidsvn/trunk
需要用到上面註冊好的帳號密碼

切換到rapidsvn目錄

./configure
make
sudo make install

rapidsvn會產生到src下

過程message應該沒有人有興趣


透過Facebook分享

2011年8月23日 星期二

svn log get by date

一般
svn log path
會將完整的log顯示出來(Linux上RapidSVN就是這樣做)
造成每次看log的時候都會很慢
尤其當log內容很多的時候

其實大部分的時候
是需要看看最近改了些什麼
所以就可以用svn log帶上日期的方式去get某一部份的log資料
這樣就會快上許多(ToriseSVN就是這麼做)

command:
svn log http://x.x.x.x/svn/wimax/mt7119/branches/aa623a_BaaaaBaaaaa -r {2011-07-05}:{2011-08-23}

這是一個貢獻opensource的好機會
1. 提供patch給RapidSVN
2. create a project enhance RapidSVN (如果提供patch給RapidSVN沒人理的話)

Ref:
http://svn.haxx.se/users/archive-2006-08/0737.shtml

透過Facebook分享

2011年8月21日 星期日

Aerosmith - I Don't Want to Miss a Thing

http://youtu.be/_J9GWsF_BAo



I could stay awake just to hear you breathing

Watch you smile while you are sleeping

While you're far away and dreaming

I could spend my life in this sweet surrender

I could stay lost in this moment forever

Every moment spent with you is a moment I treasure



I don't wanna close my eyes

I don't wanna fall asleep

Cause I'd miss you, baby

And I don't wanna miss a thing

Cause even when I dream of you

The sweetest dream will never do

I'd still miss you, baby

And I don't wanna miss a thing



Lying close to you feeling your heart beating

And I'm wondering what you're dreaming

Wondering if it's me you're seeing

Then I kiss your eyes and thank God we're together

And I just wanna stay with you

In this moment forever, forever and ever



I don't wanna close my eyes

I don't wanna fall asleep

Cause I'd miss you, baby

And I don't wanna miss a thing

Cause even when I dream of you

The sweetest dream will never do

I'd still miss you, baby

And I don't wanna miss a thing



I don't wanna miss one smile

I don't wanna miss one kiss

Well, I just wanna be with you

Right here with you, just like this

I just wanna hold you close

Feel your heart so close to mine

And stay here in this moment

For all the rest of time



Don't wanna close my eyes

Don't wanna fall asleep

Cause I'd miss you, baby

And I don't wanna miss a thing

Cause even when I dream of you

The sweetest dream will never do

Cause I'd still miss you, baby

And I don't wanna miss a thing



I don't wanna close my eyes

I don't wanna fall asleep

Cause I'd miss you, baby

And I don't wanna miss a thing

Cause even when I dream of you

The sweetest dream will never do

I'd still miss you, baby

And I don't wanna miss a thing



Don't wanna close my eyes

Don't wanna fall asleep, yeah

I don't wanna miss a thing

透過Facebook分享

2011年8月19日 星期五

安裝多個firefox在Ubuntu上

你可以到這邊下載
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/  - 升級包
ftp://ftp.mozilla.org/pub/firefox/releases/ - 安裝檔

 Ref:
http://liunian.info/mutiple-version-firefox.html

將下載好的firefox-3.6.20.tar.bz2, firefox-4.0.tar.bz2 解壓縮好

進入各個目錄後 下這個重要的command
./firefox -profilemanager -no-remote


cd firefox-3.6.20/
./firefox -profilemanager -no-remote
建立設定檔
下一步
輸入新設定檔案名稱  firefox-3.6.20
選擇資料夾(使用者設定,偏好設定都會存在在此)
按下完成
啟動Firefox




透過Facebook分享

2011年8月18日 星期四

Windows環境安裝IE6, 8 (for 測試)

Ref:
http://blog.miniasp.com/post/2009/03/28/Useful-tools-Internet-Explorer-Collection.aspx

使用工具為Internet Explorer Collection



透過Facebook分享

2011年8月16日 星期二

vimdiff比對檔案 忽略空白

vimdiff a.txt b.txt
:set diffopt+=iwhite

Ref:
http://zh-tw.w3support.net/index.php?db=so&id=1265410

透過Facebook分享

製作/apply patch

 製作patch
 diff -ruN FolderA FolderB &gt; difference.patch
也可適用於file
diff -ruN FileA FileB &gt; difference.patch

Apply patch
patch -p0 &lt; difference.patch

example:
&lt;script src='http://pastie.org/2379091.js'&gt;&lt;/script&gt;
http://pastie.org/2379091

html mode Ref:
http://www.reality.hk/articles/2004/08/31/268/



透過Facebook分享

2011年8月15日 星期一

pastie test on blogger

失效了?
<script src='http://pastie.org/2373978.js'></script>

透過Facebook分享

bootchart for embedded - bootchart-lite

安裝java
安裝ant
<script src='http://pastie.org/2373889.js'></script>

download bootchart 

build bootchart
<script src='http://pastie.org/2373891.js'></script>

使用bootchart.jar去產生png ok

<script src='http://pastie.org/2373911.js'></script>

先前問題:
使用sudo apt-get install bootchart
所安裝出來的工具bootchart
直接產生png目前會有問題
錯誤訊息如下
http://pastie.org/2373917


Ref:
http://blog.csdn.net/magicyu2/article/details/6292440

透過Facebook分享

2011年8月14日 星期日

面對人生不同的挑戰 你應該要有多種態度去面對

換工作這三個月
我太習慣用理性的方式去解決問題
下意識或是習慣性以為可以用這種方式去解決所有問題

人生歷練不夠豐富
我還沒有辦法用多種態度去處理多種情況
到不是覺得自己不行做到
只是現在的我太習慣用一種態度去處理
習慣到我不知道該用不同種態度去面對不同的問題




透過Facebook分享

2011年8月12日 星期五

使用vimdiff做合併

vimdiff a.txt b.txt

移動到差異的地方
(目前是在a.txt)
使用do可以將b.txt的差異複製到a.txt
使用dp可以將a.txt的差異複製到b.txt
如果要兩個檔案之間互相切換, 請按下Ctrl , 接著按兩下w

Ref:
http://www.ibm.com/developerworks/cn/linux/l-vimdiff/

透過Facebook分享

2011年8月11日 星期四

2011年8月10日 星期三

word的追蹤修訂與接受修改功能

word的追蹤修訂功能
最常用於修改文件上
通常一份好的文件總是需要不斷review
確認每次不同的地方
就可以使用追蹤修訂功能

打開word
工具-&amp;gt;追蹤修訂 (Ctrl+Shift+E)
進行編輯
就會以紅色的部份來呈現修改

如果修改完
該怎麼辦?
總不能以亂亂的內容交出去吧

有提供一個彙整的功能

檢視-&amp;gt;工具列-&amp;gt;檢閱
在word上方的工具列就會顯示"檢閱"工具



功能分別為:
上一個, 下一個, 接受變更, 拒絕變更/刪除註解.

此時選擇接受變更.
就會將所有的變更一次更新.

Ref:
http://support.microsoft.com/kb/305216/zh-tw

透過Facebook分享

2011年8月9日 星期二

用vim來排版

用vim開啟檔案
按下v進入選取模式

用上下鍵來選取範圍

最後按下=

就會自動排版

非常的方便

透過Facebook分享

vim+ctag - 快速追蹤function def來源

Ref:
http://stenlyho.blogspot.com/2008/11/ubuntuvim-plugin-ctagstaglist.html


Ctrl+] : 跳到游標所指function的implement 位置 ,注意游標要在function的第一個字。
Ctrl+t : 返回到剛剛的位置。

透過Facebook分享

2011年8月8日 星期一

拼裝的藝術:vim 之 IDE 進化實錄

我喜歡他介紹vim+ctags的部份
可以增強你看code的速度

PDF 版本下載

Ref:
http://linuxtoy.org/archives/vim-evolution-from-editor-to-ide.html

透過Facebook分享

2011年8月5日 星期五

可以回台灣嚕

颱風離台灣越來越遠
不會因為颱風的關係飛機無法落地台灣


期待明天看到台灣的夜景

所以我決定要選擇一個靠窗的位置坐

透過Facebook分享

2011年8月4日 星期四

如何一次讀取script的所有參數

你可以使用$@

$1得到第一個輸入參數
$2得到第二個輸入參數

你想要得到所有的
$@
@ 可以想成all
應該就會很好理解

Reference:
http://www.twbsd.org/cht/book/ch24.htm

透過Facebook分享

2011年7月30日 星期六

吃飯需要一種氣氛

主管先回台灣了
我在這邊多留一個禮拜

少個人可以講話

今天就讓寫程式來排解我一天的寂寞感

從昨天晚上開始
不管看什麼都有一種異鄉客的寂寞感
晚上從客戶公司下班後
走路回宿舍
看到一滴雨 覺得寂寞
看到路旁落在的樹葉 覺得寂寞
看到黑黑的天空 覺得寂寞
看不見皎潔的月亮 更是一種寂寞

早上睡起來就決定今天就在宿舍寫程式來打發打發時間吧
中午自己煮了水餃來吃
Edison不知道今天是星期六
沒有阿姨來煮飯
所以跑到宿舍落了空
我把我的水餃分給他吃
他在炒個菜
一起吃
他一離開
剩下吃光的空盤 又覺得寂寞起來


下午繼續來寫代碼吧
感到一個段落
想去看個電影
就跑去土豆網看線上電影

哇賽
看到一個革命家的故事
又是覺得寂寞啦
快轉趕快把電影看完
不然整個寂寞又要佔據我的心啦

晚餐時間到
跑去吃一個叫做樊家的炒飯
十塊錢人民幣
沒有台灣的好吃
也不管好不好吃
因為我也不知道我怎麼吃完那個炒飯的
因為我整個都放空

寂寞阿寂寞

吃完回來
跟老婆小孩skype
心情好上許多

我想我只能在待一個禮拜就要回去了
這種感覺真的不是好受阿

透過Facebook分享

2011年7月16日 星期六

出差西安

來西安已經是第二個星期六嚕
double說要待一個月以上
所以要回到台灣
最快也是七月底八月初的時候

這邊的網路有對google作一些處理
所以gmail收得很慢
youtube, facebook and blogspot是不能夠用的

double給了我自由門
讓我可以看得到facebook, blogspot
不過也是要有時間才能夠用

來了兩個禮拜
我上了一次facebook
po了這一篇文章到blogspot

希望大家一切都安好

這邊的環境還不錯
西安是中國西部重點的開發城市
這邊雖然算郊區
但是到市中心大約一個小時的車程

還沒去看兵馬俑
但是有去過奧運級的游泳池
西安是許多朝代的古都 像是唐,漢, 秦.....
來這邊是應該找找時間去看看古蹟

上個禮拜看了中樓跟鼓樓
是古城門負責眺望遠方的重要地標

有出去再跟大家分享分享吧

透過Facebook分享

2011年6月30日 星期四

busybox make menuconfig fail

 切到busybox目錄下
make menuconfig
居然無法啟動menu 視窗

message

  HOSTCC  scripts/kconfig/lxdialog/checklist.o
In file included from scripts/kconfig/lxdialog/checklist.c:24:
scripts/kconfig/lxdialog/dialog.h:31:20: error: curses.h: 沒有此一檔案或目錄
In file included from scripts/kconfig/lxdialog/checklist.c:24:
scripts/kconfig/lxdialog/dialog.h:128: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘use_colors’
scripts/kconfig/lxdialog/dialog.h:129: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘use_shadow’
scripts/kconfig/lxdialog/dialog.h:131: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘attributes’
scripts/kconfig/lxdialog/dialog.h:143: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/dialog.h:146: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/dialog.h:147: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/dialog.h:148: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/dialog.h:149: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/dialog.h:151: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/checklist.c:31: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/checklist.c:59: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/checklist.c:95: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/checklist.c: In function ‘dialog_checklist’:
scripts/kconfig/lxdialog/checklist.c:117: error: ‘WINDOW’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:117: error: (Each undeclared identifier is reported only once
scripts/kconfig/lxdialog/checklist.c:117: error: for each function it appears in.)
scripts/kconfig/lxdialog/checklist.c:117: error: ‘dialog’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:117: error: ‘list’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:117: warning: left-hand operand of comma expression has no effect
scripts/kconfig/lxdialog/checklist.c:121: warning: implicit declaration of function ‘endwin’
scripts/kconfig/lxdialog/checklist.c:122: warning: implicit declaration of function ‘fprintf’
scripts/kconfig/lxdialog/checklist.c:122: warning: incompatible implicit declaration of built-in function ‘fprintf’
scripts/kconfig/lxdialog/checklist.c:122: error: ‘stderr’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:140: error: ‘COLS’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:141: error: ‘LINES’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:143: warning: implicit declaration of function ‘draw_shadow’
scripts/kconfig/lxdialog/checklist.c:143: error: ‘stdscr’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:145: warning: implicit declaration of function ‘newwin’
scripts/kconfig/lxdialog/checklist.c:146: warning: implicit declaration of function ‘keypad’
scripts/kconfig/lxdialog/checklist.c:146: error: ‘TRUE’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:148: warning: implicit declaration of function ‘draw_box’
scripts/kconfig/lxdialog/checklist.c:148: error: ‘attributes’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:149: warning: implicit declaration of function ‘wattrset’
scripts/kconfig/lxdialog/checklist.c:150: warning: implicit declaration of function ‘mvwaddch’
scripts/kconfig/lxdialog/checklist.c:152: warning: implicit declaration of function ‘waddch’
scripts/kconfig/lxdialog/checklist.c:156: warning: implicit declaration of function ‘print_title’
scripts/kconfig/lxdialog/checklist.c:159: warning: implicit declaration of function ‘print_autowrap’
scripts/kconfig/lxdialog/checklist.c:166: warning: implicit declaration of function ‘subwin’
scripts/kconfig/lxdialog/checklist.c:190: warning: implicit declaration of function ‘print_item’
scripts/kconfig/lxdialog/checklist.c:194: warning: implicit declaration of function ‘print_arrows’
scripts/kconfig/lxdialog/checklist.c:197: warning: implicit declaration of function ‘print_buttons’
scripts/kconfig/lxdialog/checklist.c:199: warning: implicit declaration of function ‘wnoutrefresh’
scripts/kconfig/lxdialog/checklist.c:201: warning: implicit declaration of function ‘doupdate’
scripts/kconfig/lxdialog/checklist.c:204: warning: implicit declaration of function ‘wgetch’
scripts/kconfig/lxdialog/checklist.c:211: error: ‘KEY_UP’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:211: error: ‘KEY_DOWN’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:221: error: ‘FALSE’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:222: warning: implicit declaration of function ‘scrollok’
scripts/kconfig/lxdialog/checklist.c:223: warning: implicit declaration of function ‘wscrl’
scripts/kconfig/lxdialog/checklist.c:232: warning: implicit declaration of function ‘wrefresh’
scripts/kconfig/lxdialog/checklist.c:282: warning: incompatible implicit declaration of built-in function ‘fprintf’
scripts/kconfig/lxdialog/checklist.c:283: warning: implicit declaration of function ‘delwin’
scripts/kconfig/lxdialog/checklist.c:287: error: ‘KEY_LEFT’ undeclared (first use in this function)
scripts/kconfig/lxdialog/checklist.c:288: error: ‘KEY_RIGHT’ undeclared (first use in this function)
make[2]: *** [scripts/kconfig/lxdialog/checklist.o] Error 1
make[1]: *** [menuconfig] Error 2
make: *** [menuconfig] Error 2

需要安裝此套件

sudo apt-get install libncurses5-dev

就ok


透過Facebook分享

git checkout 某一個版本

一般用git checkout -b
可以建立分支
並且由目前此分支最新的code所branch出去

但是
如果有以下需求該怎麼辦

主幹版本已經有16, 17, 18
目前最新是18
如何得到16所出來的分支呢

git log
可以得到commit number
使用下列command

git branch branchname commitnumber

透過Facebook分享

git checkout 某一個版本


透過Facebook分享

2011年6月27日 星期一

svn commit 只commit一個檔案

先將commit的message寫入一個檔案名為msg

svn commit -F msg filename

Ref:
http://notes.hubin411.com/svnbook/svn.ref.svn.c.commit.html

透過Facebook分享

ubuntu 7-zip 壓縮檔案

ubuntu 7-zip 壓縮檔案 @ 小弟弟 :: 痞客邦 PIXNET ::: "- 已使用 Google 工具列寄出"

Install 7-zip under ubuntu



語法:
7z a -mx=9 -mmt 壓縮檔名 被壓縮的資料夾或檔名

透過Facebook分享

7z壓縮率比rar好

今天壓縮一個資料夾
原始大小為987.8MB

用rar壓縮後為900MB
用7-zip壓縮後為843MB

可到7-zip繁體中文網站下載

命令行介面亦有 Linux/Unix 版

透過Facebook分享

2011年6月24日 星期五

防止Ubuntu重開機會清除/tmp下的資料

需要修改rcS

sudo vim /etc/default/rcS

將TMPTIME改成-1
ex.
TMPTIME=-1

以後重新開機就不會刪除/tmp下的資料嚕

透過Facebook分享

2011年6月21日 星期二

tcpdump - 分析封包流向與運作狀態

一般你可以使用wireshark來監控網路設備的流向

但是如果在嵌入式系統端
沒有這樣強大的工具

你可以使用tcpdump來達到

tcpdump -i eth0

監控eth0的網路狀態
Ref:
http://linux.vbird.org/linux_server/0140networkcommand.php#tcpdump

透過Facebook分享

2011年6月19日 星期日

Zim - A Desktop wiki

Zim web page


#add repository
sudo add-apt-repository ppa:gwibber-daily/ppa
#do update
sudo apt-get update
#install
sudo apt-get install zim

與先前使用的

wikidpad 去除wiki語法


比較起來好用
1. 插入link方便, (zim有button, wikidpad要用[//]
2. 多檔案編輯方便, 編輯框可以對不同檔案內容進行拖拉(目前版本會當)


目前版本為
nelsonchung@ubuntu:~$ zim -v
zim 0.43

Copyright 2008, 2009 Jaap Karssenberg

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.




透過Facebook分享

2011年6月14日 星期二

頻譜分析儀 初步練習調整 freq and span

 R3162 SPECTRUM ANALYZER

打開下方Power

需要設定兩個東西
1. FREQ


wifi落在 2.4GHz
所以可以設定 24000 ~ 24080
每一個channel的差異在5MHz

2. SPAN

設定100

透過Facebook分享

Linux 反覆執行特定程式並顯示狀態

如果你像我一樣需要短時間內密集的做一件事情
ex.
定時更新無線網路的狀況
sudo iwlist scanning

每次手動key也是挺麻煩的

你可以使用watch

ex.
watch -d 'sudo iwlist scannng'

Ref:

Linux 定時執行程式 並 監看結果 - watch


透過Facebook分享

[Show Desktop] Mac版的「顯示桌面」圖示,按一下、將全部視窗縮到最小!

[Show Desktop] Mac版的「顯示桌面」圖示,按一下、將全部視窗縮到最小!: "- 已使用 Google 工具列寄出"

Common+F3

透過Facebook分享

PrintScreen 快速鍵 on Mac

Command+Shift+3

檔案會存在桌面

Ref:
http://blog.roodo.com/aoiten/archives/13688221.html

透過Facebook分享

Mac OS X 鍵盤快速鍵

BraveSheng's Records: Mac OS X 鍵盤快速鍵: "- 已使用 Google 工具列寄出"

Mac OS X 常用快速鍵

透過Facebook分享

Mac OS X 鍵盤快速鍵

BraveSheng's Records: Mac OS X 鍵盤快速鍵: "- 已使用 Google 工具列寄出"

Mac OS X 常用快速鍵

透過Facebook分享

Mac OS X 鍵盤快速鍵

BraveSheng's Records: Mac OS X 鍵盤快速鍵: "- 已使用 Google 工具列寄出"

Mac OS X 常用快速鍵

透過Facebook分享

顯示makefile執行指令過程

寫了一個makefile
用make執行

想要顯示執行過程中的所有動作



看來預設都會將make所執行過程都顯示出來

那android為什麼要用showcommands的方式才能將執行過程顯示出來呢?

Ref.
make介紹
第五章makefile

透過Facebook分享

2011年6月10日 星期五

抓取Ubuntu samba網芳的資料有問題

Ubuntu Server放置含有subversion資料的資料
透過samba分享出來

直接抓取有權限問題

主要因為跨檔案系統
ex. ext4, samba, ...
造成權限不保留的問題

建議將server端的資料做tar
然後在copy tar file到local端

透過Facebook分享

Mac 搜尋網路上的電腦 (網路芳鄰)

打開Finder
使用快速鍵
command+k

鍵入
smb://192.168.40.61

如果你知道該台電腦的ip address

Ref:
http://www.mobile01.com/topicdetail.php?f=482&t=1575892&p=1

透過Facebook分享

2011年6月9日 星期四

如何安裝Vim Plugin - ctags及taglist 與教學使用

史丹利部落格: Ubuntu安裝Vim Plugin ctags及taglist: "- 已使用 Google 工具列寄出"

今天看到主管使用ctags來trace code
真的是快阿

燃起我強大的學習慾望

決定也要使用ctags的技術來加快自己看code的速度

follow上述文章裝法

1. 安裝ctags
sudo apt-get install exuberant-ctags

2. 安裝taglist
下載taglist
http://vim-taglist.sourceforge.net/
解壓縮後
進行安裝
cp -a doc/ ~/.vim
cp -a plugin/ ~/.vim

3. 修改vimrc
sudo vim /etc/vim/vimrc
按下G到最後一行加上
map <f9> :Tlist<CR>

如何製作tag檔
到你要看code的目錄下
ctags -R

會產生tags檔案

開啟*.c之後
按下F9就會顯示tag list

如果要找某個fuction implement的地方
在該function使用處按下Ctrl+]

回到function使用處的地方按下Ctrl+t

這邊有介紹for java的jtags


透過Facebook分享

iwlist scanning 無法掃描到附近所有的無線設備

iwlist scanning無法掃描到附近所有的無線網路設備
也有人遇到一樣的問題

這篇文章有解
要使用sudo iwlist scanning

透過Facebook分享

make -DDBG

是什麼意思阿?
-D後面帶著參數代表flag的意思 通常會跟code是否開啟某一個功能有關

像是上述例子就會把DBG(Debug)功能打開

此外
-l 帶上搜尋路徑

Ref:
http://hi.baidu.com/shidagis/blog/item/24c24e181ca593ac4bedbcb0.html

透過Facebook分享

日流量破350

紀錄一下

透過Facebook分享

wget ftp data

Ref:
http://redhat.ecenter.idv.tw/bbs/showthread.php?threadid=39222

使用wget 抓取ftp 資料

embedded system上也常用

embedded system上有wget
pc端有ftp server
透過network進行資料傳輸

pc端 我開放/home/nelsonchung底下資料

透過Facebook分享

使用NetStumbler來監控網路環境

軟體 - NetStumbler v0.4.0 無線網路工具軟體 - 史萊姆論壇: "- 已使用 Google 工具列寄出"

你可以使用NetStrumbler來監控週遭無線網路的環境

包含channel, vendor, channel, type, snr, noise.

透過Facebook分享

使用NetStumbler來監控網路環境

軟體 - NetStumbler v0.4.0 無線網路工具軟體 - 史萊姆論壇: "- 已使用 Google 工具列寄出"

你可以使用NetStrumbler來監控周遭無線網路的環境

包含channel, vendor, channel, type, snr, noise.

透過Facebook分享

使用NetStumbler來監控網路環境

軟體 - NetStumbler v0.4.0 無線網路工具軟體 - 史萊姆論壇: "- 已使用 Google 工具列寄出"

你可以使用NetStrumbler來監控周遭無線網路的環境

包含channel, vendor, channel, type, snr, noise.

透過Facebook分享

cp 隱藏檔一起複製

cp -a A/ B/

這樣就可以整個A目錄(包含A)一起複製到B目錄下
也包含隱藏檔案

如果你是用
cp -a A/* B/


就會把A目錄下的資料(不包含A)複製到B目錄下
不包含隱藏黨按

透過Facebook分享

2011年6月8日 星期三

ssh -X 遠端操作X11視窗

使用ssh -X serverip

local端會出現X11軟體

這時候如果在原終端機打入firefox
X11裡面就會出現firefox

如果不行
需要在遠端電腦
編輯此檔案 /etc/ssh/ssh_config

ForwardAgent yes
ForwardX11 yes
ForwardX11Trusted yes

透過Facebook分享

2011年6月4日 星期六

這次臨時版 打包花了3個小時

許久沒有這種熱情
果然工作中如果有興趣在裡面  就會很容易可以燃燒自己的小宇宙

與老婆吃完宵夜
開始進行打包
不是太順利
反覆打包好幾次才算ok
準備進入第四個小時

保持這種熱情 我相信我會更厲害

透過Facebook分享

2011年6月3日 星期五

busybox教學 - 如何enable/disable vi 使用menuconfig


busybox教學 - 如何enable/disable vi


原來可以使用make menuconfig

進入busybox folder
make menuconfig
選擇Editors->vi
Exit後存檔

在make就可以嚕

透過Facebook分享

安裝libdvdcss2的時候發生問題

安裝libdvdcss2的時候發生問題

nelsonchung@ubuntu:~$ sudo apt-get install libdvdcss2.
[sudo] password for nelsonchung:
正在讀取套件清單... 完成
正在重建相依關係
正在讀取狀態資料... 完成
無法取得套件 libdvdcss2,但它卻被其它的套件引用了。
這意味著這個套件可能已經消失了、被廢棄了,或是只能由其他的來源取得
E: 套件 libdvdcss2 沒有可安裝的候選版本.


詢問癮科技的Max得到下列解答
http://chinese.engadget.com/2011/05/09/engadget-readers-about--kubuntu-apps/
只要加入medibuntu的source就ok了

How to add on Ubuntu 10.04
可以參考medibuntu的網站
add the repository
http://medibuntu.org/repository.php


執行下列command

安裝some applications(官方建議)



最後安裝libdvdcss2



透過Facebook分享

設定Macbuntu的Exposé功能

Apple的

Exposé

功能就是可以讓你在凌亂的桌面快速地將視窗排列整齊

Macbuntu也有實做這個功能

預設是將滑鼠移動到畫面右下角(很右下角喔)

就會顯示

如果你想要修改方式

可以參考此篇

透過Facebook分享

check multi-gmail account under Ubuntu - checkgmail

如果你有多個gmail帳號需要check收信的狀況
又想要在Ubuntu下

checkgmail可以幫你一把

sudo apt-get install checkgmail

執行 網際網路->CheckGMail
你可以設定第一個帳號

如果你想要設定第二個帳號
請打開Terminal
type
checkgmail -profile=gmailxxxxx
就可以設定第二個帳號嚕

設定完成就可以同時檢查兩個gmail的信嚕

Reference:
http://checkgmail.sourceforge.net/

透過Facebook分享

掛載位於Ubuntu下分享出來的目錄到Ubuntu local

參考

掛載位於Windws XP下分享出來的目錄到Ubuntu local

 


同樣的command
sudo mount.cifs //remotepath /localpath -o username=Username,password=Password,codepage=cp950,iocharset=utf8
也可用

透過Facebook分享

iwpriv 設參數到wifi chip

Ref: http://linux.about.com/library/cmd/blcmdl8_iwpriv.htm

可以利用iwpriv設參數到wifi chip
格式
iwpriv wifiinterface privatecmd parameter

ex.
iwpriv wl0 set Channel=0

透過Facebook分享

Mac的Home鍵在哪裡

'Home' Button in mac - MacRumors Forums: "- 已使用 Google 工具列寄出"

瀏覽網頁
很多時候會需要回到網頁最上面
windows下有home鍵可以使用

可是在mac book pro上
沒有home的按鍵
要怎麼達到相同的功能呢

使用
fn+left arrow = home key
fn + right arrow = end key
fn + top arrow = 向上捲動
fn + botton arrorw = 向下捲動

透過Facebook分享

掛載位於Windws XP下分享出來的目錄到Ubuntu local

Linux 下幾種網芳/Samba 目錄的 mount 方式 | Vixual: "- 已使用 Google 工具列寄出"

參考上述網站

只有這個可以成功掛載
sudo mount.cifs //remotepath /localpath -o username=Username,password=Password,codepage=cp950,iocharset=utf8


使用下列方式
sudo mount -t cifs //remotepath /localpath -o username=Username,password=Password,codepage=cp950,iocharset=utf8
會失敗
error message


使用下列方式
sudo mount -t ntfs //remotepath /localpath -o username=Username,password=Password,codepage=cp950,iocharset=utf8
error message

透過Facebook分享

2011年6月2日 星期四

你的skype還有無法登入的問題嗎

話說大部份skype用戶最近都遇上無法使用的問題 - 解決skype無法登入問題

有些人重新安裝就ok
有些人卻不行

有個人更慘
到今天2011/06/02下午五點之前都還是不行
求救於skype也還沒得到解法

由於他的環境是windows 7
64bit

他做了以下的事情就可以了
給大家參考

打開registry註冊表
用search的方式
keyword為skype
只要找到就刪除

然後就可以登入正常使用了
還可以用skype out打手機給我

透過Facebook分享

如何在Mac下用快速鍵達到全選網址的功能

使用firefox and safari瀏覽網頁的時候
常有需要直接敲link的時候

每次都要把滑鼠移動到網址列
感覺非常不方便

應該有快速鍵可以直接使用吧

你可以利用command+l
l: 小寫的L
就可以達到這個功能喔

透過Facebook分享

ARP: Address Resolution Protocol

ARP stands for Address Resolution Protocol, which is used to find the media access control address of a network neighbour for a given IPv4 Address.


用arp -a尋找鄰居

透過Facebook分享

安裝FileZilla Server卻無法登入

在Windows XP下安裝FileZilla Server
另外一台網域內的電腦卻無法登入
連ping都不行
出現
"Request timeout for icmp_seq 1"

發現原來是Windows XP的內建防火牆搞的鬼

打開控制台->Windows防火牆->一般
選擇關閉

就可以ping通嚕
使用ftp 192.168.1.4
ok

透過Facebook分享

2011年5月28日 星期六

2011年的生日 老婆的精心傑作



老婆的心血

甜蜜與幸福真的是需要用心與時間去琢磨出來了

很感動

也跟老婆一起擁有第一個apple產品 - iPod nano

因為是線上訂購的關係
有雷射標籤

甜蜜的話就留給我們嚕

透過Facebook分享

2011年5月26日 星期四

vim 換行自動對齊功能

【軟件應用】vim 換行自動對齊_Glaivelee --- LIFE NOT IF ELSE_百度空間: "set number

- 已使用 Google 工具列寄出"

在home目錄下
vim .vimrc

set autoindent
set smartindent

另外我加上
set number
可以顯示行號

透過Facebook分享

wikidpad 去除wiki語法

wikidpad裡面加上*
會有字體變粗變大的效果

但是有些linux command會用到*卻會造成放大的困擾



這時候你需要這個部份的前後加上

就可以保持原始command 的格式嚕

Ref.
wikidpad's help - TextFormatting

擷取部份說明
++++ Preformatted blocks

You can use \<<\pre and >> to enclose blocks which have no special formatting (wiki words, italics) as the default escaping blocks but are shown in HTML as monospaced blocks and have exactly the same formatting as written in the source text.

This is helpful especially for programming source code.

透過Facebook分享

2011年5月25日 星期三

利用 netsh 指令修改網路介面參數 - 設定靜態網路資訊

利用 netsh 指令修改網路介面參數 @ 暉獲無度的步烙閣 :: 隨意窩 Xuite日誌: "- 已使用 Google 工具列寄出"

Under Windows XP

你可以利用netsh指令來設定network interface 相關參數
ex.
ip address, netowrk mask, gateway

透過以下指令
netsh interface ip set address name="區域連線 5" source=static addr=192.168.1.5 mask=255.255.255.0
netsh interface ip set address name="區域連線 5" gateway=192.168.1.10 gwmetric=none
方法非常的固定
如果亂下可以會有以下error產生

D:\tools\burntool_256>netsh interface ip set address name="區域連線 5" addr=192.
168.1.3 gateway=192.168.1.1
提供給這個命令的語法不正確。請查閱說明以取得正確的語法。

D:\tools\burntool_256>netsh set address name="區域連線 5" source=static addr=192
.168.1.5 mask=255.255.255.0 gateway=192.168.1.1
找不到下列命令: set address "name=區域連線 5" source=static addr=192.168.1.5 mas
k=255.255.255.0 gateway=192.168.1.1。

透過Facebook分享

echo 換行

使用-e
"" 雙引號內再加上\n

ex.
echo -e "[Nelson]run dnrd_mas script \n"

也可以加上\t

透過Facebook分享

DNRD intro. from README

簡單來說
DNRD負責將hosts 傳送來的dns request, pass到不同的DNS Server.
並且將DNS Server處理好的dns reply, pass回到hosts.
因此hosts就可以知道domain name要對應什麼ip address.

-s 可以允許你設定要forward 到哪些 DNS Server.

-s ipaddr(:domain)
--server=ipaddr(:domain)
Add a forward DNS server. If multiple -s options are given, dnrd treats the first as a primary DNS server and the rest as backup servers. If the primary DNS server times out, it is deactivated and the next specified server (that is active) is used until the previous gets reactivated.

你也可以把dnrd自己當作一個簡單的DNS Server.
這個時候你要利用
-m來做設定

預設會讀取/usr/local/etc/dnrd/master
如果此檔案不存在
就會讀取/etc/hosts
當然你也可以設定其他lcoal位置
-m (off|hosts)
--master=(off|hosts)
dnrd can act as the primary name server for a number of hosts. By default, it will read in /usr/local/etc/dnrd/master to determine how this is done. If that file doesn't exist, it will act as the primary server for the hosts found in /etc/hosts. This option allows you to override the default behavior. Setting it to off turns off all primary server functionality. Setting it to hosts causes dnrd to act as the primary server for hosts in /etc/hosts regardless of whether it could find /usr/local/etc/dnrd/master.

透過Facebook分享

2011年5月24日 星期二

如何編輯redmine中的wiki page

你可以參考readmine的官方網頁介紹

紀錄目前常用的

1. 顯示issue
#issuenumber

2. 內部連結
[[內部連結]]

透過Facebook分享

替blogger 加上 Facebook 官方的推文按鈕

Jax 的工作紀錄: Blogger 的標題加上 Facebook 官方的推文按鈕

- 已使用 Google 工具列寄出"

可以參考上篇文章
他的方法可以在Blogger的標題上加上FB的推文按鈕

我是想放在文章下方

找到


在這之前加上


在找/body
在這之前加上


看預覽按鈕測試是否沒有問題

透過Facebook分享

2011年5月23日 星期一

DNRD - Domain Name Relay Daemon

DNRD - Domain Name Relay Daemon: "- 已使用 Google 工具列寄出"

Domain Name Relay Daemon is a cacheing, forwarding DNS proxy server.
特色
1. 有caching功能
2. 備份DNS server資料
3. 提供簡易的routing: 不同domain可以設定不同的forward
4. 預防cache poisoning
5. Force authorative or unauthorative answers for specified domains
6. 分享/etc/hosts內容
7. DNS 黑名單支援
8. TCP支援

運行在 openbsd, freebsd, and linux

透過Facebook分享

2011年5月20日 星期五

開啓不需要登入賬號密碼的samba目錄

修改/etc/samba/smb.conf

加上security = share

填入要分享的資料夾

[Tools]
   comment = Tools
   path = /home/nelsonchung/Tools
   browseable = yes
   guest ok = yes
   public  = yes
   writable = no


存檔案
sudo service smbd restart

最後要注意一件事情
就是你分享出來的目錄權限要755喔

不然windows在開啟的時候會有以下問題
無法存取. 你可能沒有使用這個網路資源的權限. 請聯絡這個伺服器的系統管理員. 了解你是否有存取的權限.
找不到網路名稱.
Reference:
http://linux.vbird.org/linux_server/0370samba.php#server_share

透過Facebook分享

阿禎學洋洋哥哥唱生日快樂歌


透過Facebook分享

兩姐弟在玩巧虎切切組


透過Facebook分享

弟弟醜醜

弟弟醜醜


姊姊也跟著一起醜醜

透過Facebook分享

阿禎今天要表演的是床前明月光


透過Facebook分享

Androind-x86 run acer aspire one

Follow

Build Android-x86 - live cdrom image


build出一個image

燒成cd image
在acer aspire one 小筆電上測試
可以正常開機



下一步
1. 如何debug(輸出debug message)
2. 如何外接gps設備

透過Facebook分享

2011年5月19日 星期四

將checkgmail增加繁體中文介面

只要修改checkgmail中的語言部份就可以

checkout source code
svn co https://checkgmail.svn.sourceforge.net/svnroot/checkgmail checkgmail

修改checkgmail/checkgmail

重新啟動checkgmail就會有繁體中文

修改的過程要注意
如果有做翻譯上的更新
需要手動刪除
~/.checkgmail/lang.xml
執行checkgmail時會自動產生此檔案

上patch
svn diff > add_translation_traditional_chinese.diff

寄信給
checkgmail-announce@lists.sourceforge.net

內容
Dear All,

I add the translation of checkgmail to "traditional chinese"(繁體中文)
And, I wish the author of checkgmail can add this part to this product.
Checkgmail is very good tool for me to check gmail automatically under Ubuntu.

Here is the diff file and lang.xml.
Please see the attachment - add_translation_traditional_chinese.tar.gz.

透過Facebook分享

使用wikidpad插入外部連結

在編輯框

[http://nelsonchunglife.blogspot.com | NelsonChung's blog]

在按下Switch Editor/Preview按鈕後
就會顯示
NelsonChung's blog的超連結

Reference:
wikidpad's help文件中 UrlLinking章節

透過Facebook分享

Build Android-x86 - live cdrom image

Follow 

Build Android-x86 - live usb image

這次要build一個cdrom image


有比較快ㄝ
我想應該是因為之前有build live usb image 的關係

build出來的檔案可以在以下path找到
~/android-x86/out/target/product/

以下是我build出來目錄的資料


下一步就是要在acer aspire one上測試嚕

透過Facebook分享

Build Android-x86 - live usb image

官網-http://www.android-x86.org/

軟體環境架設
http://source.android.com/source/initializing.html

repo, git不能使用在某些受限的網路環境中
http://pastie.org/1891296

開始build


相當順利build出usb image

透過Facebook分享

2011年5月18日 星期三

手動配置網路ip位址 under Ubuntu

一般網路環境都是採用DHCP自動分配IP位置
所以Ubuntu的使用者使用network manager搭配DHCP來使用一般都沒有連上網路的問題

如果你的ip分享器 or route是沒有DHCP功能
or是採用VLAN功能就必須要手動配置IP address

Ubunut下要如何手動配置ip資訊呢
1. 將network manager的Auto eth0斷線
2. 打開終端機
sudo ifconfig eth0 192.168.1.3
配置完後訊息如下



如果你可以經由ping的方式
ex ping 192.168.1.1

那就代表你可以存取192.168.1.1這台主機的資訊

透過Facebook分享

使用wikidpad編輯內容

教學影片

按下 "Open wiki word" 按鈕
or Ctrl+o

編輯好內容

在wikidpad左邊project頁面按下滑鼠右鍵
選擇Append wiki word

在此對話框type
剛剛你編輯的wiki keyword
就會幫你加到主頁面

透過Facebook分享

使用wikidpad插入圖片

使用Edit->Insert->File URL

選擇local圖片

之後編輯框會出現

file:/home/nelsonchung/Docs/images/tagtag.png

按下Switch Editor/Preview按鈕

就會載入圖片

透過Facebook分享

如何讓wireshark只顯示某個ip address相關的封包呢

YouTube - Wireshark - IP Address, TCP/UDP Port Filters: "- 已使用 Google 工具列寄出"

youtube有影片介紹



wireshark在Filter的地方key
ip.addr == 192.168.1.2
按下Apply

Reference:

解析網路封包軟體


透過Facebook分享

Wikidpad

It is a tool to record data with wikitype.

有以下需求, 你就可以考慮使用wikidpad


wikidPad is a Wiki-like notebookfor storing your thoughts, ideas, todo lists, contacts, or anythingelse you can think of to write down.


How to install under Ubuntu
需要安裝python and wxpython
sudo apt-get install python
sudo apt-get install python-wxgtk2.8

下載wikidpad source

unzip WikidPad-2.0_1-src.zip
執行wikidpad
python WikidPad.py

透過Facebook分享

2011年5月17日 星期二

如何查詢windows下command的功能

如何查詢windows下command的功能
就像是linux下man的功能呢?

請在command之後接上/?

ex.
XCOPY /?



透過Facebook分享

show log by using rabbitvcs

gedti->RabbitVCS->RabbitVCS Svn->版本庫游覽器

鍵入URL
下方會顯示該URL的內容


點選其中一個目錄or檔案
按下滑鼠右鍵
點選"顯示日誌"

透過Facebook分享

TortoiseSVN for Ubuntu Linux: The real alternative

TortoiseSVN for Ubuntu Linux: The real alternative: "- 已使用 Google 工具列寄出"

原來Ubuntu下也有好用的GUI Subversion client

RabbitVCS官網

如何在Ubuntu下安裝

有apt-get install and tarball的兩種方法

以下是使用tarball的方法




cd clients
cd gedit
sudo cp rabbitvcs-plugin.py rabbitvcs.gedit-plugin /usr/lib/gedit-2/plugins

enable rabbitvcs under gedit
http://blog.rabbitvcs.org/archives/183

打開gedit->編輯->偏好設定->外掛程式->RabbitVCS
勾選之後
gedit上方工具列就可以看到嚕

透過Facebook分享

2011年5月12日 星期四

使用tar查看壓縮檔的內容

tar -zvtf file.tar.gz

Reference:
http://www.cyberciti.biz/faq/list-the-contents-of-a-tar-or-targz-file/

透過Facebook分享

2011年5月11日 星期三

busybox教學 - 如何enable/disable vi

下載busybox (目前使用1.18.4)

解壓縮後

cd busybox-1.18.4.
vim .config


搜尋字串CONFIG_VI=y
拿掉#

重新build一次就ok


./busybox 就可以看到目前支援的功能

Currently defined functions:
        [, [[, arp, arping, ash, awk, basename, bunzip2, bzcat, cat, chmod, chroot, cksum, clear, cmp, cp, crond, crontab, cut, date, dd, df, dhcprelay,
        dirname, dmesg, du, echo, egrep, env, expr, false, fgrep, free, ftpget, ftpput, getopt, getty, grep, gunzip, gzip, halt, head, hostid, hostname,
        id, ifconfig, ifdown, ifup, init, insmod, ip, ipaddr, ipcalc, ipcs, iplink, iproute, kill, killall, killall5, klogd, linuxrc, ln, login, logread,
        ls, lsmod, md5sum, mkdir, mkfifo, mknod, mktemp, modprobe, mount, mv, nameif, nc, netstat, nice, nslookup, pidof, ping, poweroff, printf, ps,
        pwd, reboot, rm, rmmod, route, run-parts, sed, seq, setconsole, setsid, sh, sleep, sort, split, start-stop-daemon, stat, stty, sum, swapoff,
        swapon, switch_root, sync, syslogd, tail, tar, tee, telnetd, test, tftp, top, touch, tr, traceroute, true, tty, udhcpc, udhcpd, umount, uname,
        uniq, usleep, vconfig, vi, wc, which, whoami, yes, zcat

透過Facebook分享

diff

用diff可以產生兩個檔案的差異
並輸出patch

diff -Naur a.txt b.txt > ok.patch

-N: new file
-a: treat all files as text
-u: Output NUM (default 3) lines of unified context.
-r: recursive

透過Facebook分享

遠端管理 VirtualBox 的神兵利器-RemoteBox

遠端管理 VirtualBox 的神兵利器-RemoteBox: "- 已使用 Google 工具列寄出"

RemoteBox是ViutualBox的前端管理工具

可以幫你遠端或近端管理其他主機鎖執行的VirtualBox程式

是透過http協定與其他VirtualBox主機溝通

詳細的介紹可以參考遠端管理 VirtualBox 的神兵利器-RemoteBox

官網-http://remotebox.knobgoblin.org.uk/

download path: http://remotebox.knobgoblin.org.uk/downloads/RemoteBox-0.8.tar.bz2

目前only支援Linux平台

你需要額外安裝這些套件

sudo apt-get install libgtk2-perl libsoap-lite-perl rdesktop

否則會有下列error message while you run remotebox



下載完後

解壓縮執行remotebox

透過Facebook分享

2011年5月10日 星期二

解析網路封包軟體

wireshark 解析有線網路封包
ominpeek 解析無線網路封包
是位於windows上的軟體


那linux的呢?

Ref. - http://jonny.ubuntu-tw.net/2008/03/ubuntuwireshark.html

原來wireshark在linux上早就很有名氣

使用wireshark就可以擷取有線以及無線設備的網路封包嚕

記得啟動時要使用sudo wireshark
否則看不到設備

sudo apt-get install wireshark.

透過Facebook分享

busybox 1.6 沒有vi

沒有vi
我沒有辦法透過busybox vi在機器上寫一些shellscript

但是有wget


所以我可以在pc端 install ftp server.

然後用telnet登入機器後
使用wget來抓

chmod +x sipclient.sh

./sipclient.sh

我覺得更值得學習的方法

應該是將新版busybox的vi功能加到現有的busybox上

busybox 1.6



busybox 1.18

透過Facebook分享

vsftpd ftp server, window 下登入fail

Follow

安裝ftp server -vsftpd

在Ubuntu上安裝vsftpd ftp server

卻無法讓window xp上的ftp client - FileZilla登入成功

FileZilla錯誤訊息如下



使用ie輸入方式
fftp://nelsonchung:password@192.168.1.2
看到/下的所有東西
包含bin, boot, cdrom, dev, etc/home,host, lib, lost+found, media, mnt, opt, proc, proj, rot, sbin, selinux, srv, sys, tmp, usr, var


我想應該是差在這裡
因為權限問題被拒絕

我用ftp localhost方式登入看到的卻是/home/nelsonchung下的資料

是否應該設定一下預設目錄
設定以下資料

# You may restrict local users to their home directories.  See the FAQ for
# the possible risks in this before using chroot_local_user or
# chroot_list_enable below.
chroot_local_user=YES
local_root=/home/$USER/
到/etc/vsftpd.conf
sudo service vsftpd restart
無效

修改
sudo vim /etc/passwd
找到你的帳號 
就像下方
nelsonchung:x:1000:1000:Administrator,,,:/home/nelsonchung:/bin/bash
修改成
nelsonchung:x:1000:1000:Administrator,,,:/home/nelsonchung/minus:/bin/bash

重新啟動ftp server
sudo service vsftpd restart

localhost登入
ftp localhost
確實可以改變目錄

但是在window環境下
ftp://nelsonchung:password@192.168.1.2
看到/下的所有東西
包含bin, boot, cdrom, dev, etc/home,host, lib, lost+found, media, mnt, opt, proc, proj, rot, sbin, selinux, srv, sys, tmp, usr, var

目前環境是內部網路
不能對外通

不知道有沒有差異
Reference:

透過Facebook分享

安裝ftp server -vsftpd

sudo apt-get install vsftpd



可以使用netstat -tul來看是否有ftp service
如果有看到以下資料

Proto Recv-Q Send-Q Local Address           Foreign Address         State    
tcp        0      0 *:ftp                   *:*                     LISTEN

就代表ok

編輯相關設定在/etc/vsftpd.conf

Reference:
http://blog.udn.com/nigerchen/2261345
http://linux.vbird.org/linux_server/0410vsftpd.php

透過Facebook分享

2011年5月9日 星期一

TUGZip - 可以用來解壓縮 zip and rar

TUGZip - 可以從此處下載

用來解壓縮 zip and rar

可以取代 winrar

透過Facebook分享

想辦法架設android gps 開發環境

最近苦於沒有android gps開發環境

導致一些網路詢問有關android gps問題時

無法即時回應問題

歡迎大家推薦適合的平台給我作為參考

希望可以盡早把環境的架設好

透過Facebook分享

查詢 / 更換 XP 序號

憂藍夢境‧部落格 » 查詢 / 更換 XP 序號: "- 已使用 Google 工具列寄出"

要做windows update and install ie8

想說要確認一下自己的xp現在的序號是否為正版

使用此工具-keyfinder-20b3

驗證ok

Ref.

如何修改 XP、Vista 序號? (Keyfinder v2.0 Beta 3)


透過Facebook分享

2011年5月6日 星期五

Ubuntu安裝dos2unix工具

Ubuntu安裝dos2unix工具: "sudo apt-get install tofrodos

- 已使用 Google 工具列寄出"

想不到Ubuntu下居然沒有辦法找到這個套件dos2unix

參考此篇文章安裝tofrodos試看看

安裝玩後

設定

sudo ln -s /usr/bin/todos /usr/bin/unix2dos
sudo ln -s /usr/bin/fromdos /usr/bin/dos2unix

就可以嚕

透過Facebook分享

doxygen 文件產生器

doxygen | Tsung's Blog: "- 已使用 Google 工具列寄出"

build 時發生error

make[2]: doxygen: Command not found
make[2]: *** [doc] Error 127

udo apt-get install doxygen
[sudo] password for nelsonchung:
正在讀取套件清單... 完成
正在重建相依關係
正在讀取狀態資料... 完成
以下套件是被自動安裝進來的,且已不再會被用到了:
openoffice.org-l10n-common openoffice.org-l10n-zh-tw
使用 'apt-get autoremove' 來將其移除。
下列的額外套件將被安裝:
lacheck lmodern luatex tex-common texlive-base texlive-binaries texlive-common texlive-doc-base texlive-extra-utils texlive-luatex
建議套件:
doxygen-doc doxygen-gui auctex perl-tk dvidvi fragmaster latexmk xindy purifyeps
下列【新】套件將會被安裝:
doxygen lacheck lmodern luatex tex-common texlive-base texlive-binaries texlive-common texlive-doc-base texlive-extra-utils texlive-luatex
升級 0 個,新安裝 11 個,移除 0 個,有 0 個未被升級。
需要下載 48.6MB 的套件檔。
此操作完成之後,會多佔用 114MB 的磁碟空間。
是否繼續進行 [Y/n]?

透過Facebook分享