2011年10月21日

好用的看logcat log程式

Monkey Log Viewer
它可幫你找出特定的TAG,並且指定那行的字型的顏色和背景.
DEBUG 好用多了.
http://code.google.com/p/monkeylogviewer/

2011年6月23日

Building and decode Android apk


Android 的程式安裝檔在編譯的過程中會打包成副檔名apk的檔案,其中包含足夠的資訊及資料以便可以在實體裝置或模擬器上使用。Android apk 檔其實就是個 zip 壓縮檔,所以只要在副檔名最後加上 .zip 使它變成一個 zip 壓縮檔即可開啟。主要有五個部分﹕

2011年5月20日

Adb 可經由網路連線

Debugging considerations


When debugging applications that use USB accessory or host features, you most likely will have USB hardware connected to your Android-powered device. This will prevent you from having an adb connection to the Android-powered device via USB. You can still access adb over a network connection. To enable adb over a network connection:

2011年2月24日

利用ELF header保護程式

If you want to prevent your binary program from being executed on other platform, you can try this way.

2011年1月28日

Android input binary tool

Android 有個小程式可以模擬鍵盤操作
用法如下:
輸入字串
adb shell input text "ANDROID"
如果要輸入WiFi密碼是還不錯用,有些符號不行,如"#"
點擊螢幕上任一點
Input touchscreen tap x y
滑動至另一點
Input touchscreen swipe x1 y 1 x2 y2
輸入 keyevent
adb shell input keyevent 29    # for key 'A'

2010年6月3日

調用freopen,把標準輸出導向

Debug的時候,把標準輸出導向是一個不錯的選擇,尤其寫daemon或service的時候。

http://www.cplusplus.com/reference/clibrary/cstdio/freopen/

2010年5月24日

查看usb device firmware 版本

#lsusb -d 04f2: -v | grep bcdDevice
其中04f2 為 device id,各家不同.

2010年5月4日

virtual user input


如果想模擬使用者操作滑鼠、鍵盤等輸入裝置,可利用二種方式:xdotool或uinput,以下分別介紹。

2010年4月26日

GDBM /NDBM 資料庫

GDBM - The GNU database manager,一套簡單的資料庫管理函數。

dbm 是 UNIX 上一套古老的常見資料庫處理介面,而 ndbm 則是改良 dbm 缺失而設計的,兩者的介面差異頗大。gdbm 則是根據ndbm 的介面設計的,兩者間非常相似, ndbm 的函數名稱皆以 dbm_ 開頭,而 gdbm 為了加以區別,則以 gdbm_ 開頭,並且利用hash 表存放鍵值,大幅節省搜尋時間,除此之外,皆可對應。其資料庫主要利用每一筆資料都有一對"鍵值"及"內容"。利用鍵值做三個動作{storing 儲存,retrieval 擷取,deletion 刪除}資料。

2010年3月31日

script for fdisk Command

實務經驗,在遇到帶有儲存裝置(ide/sd/sata..)的產品會用到劃分割區

利用fdisk劃二個分割區,並設定system format  為 ext2

2010年3月16日

linux kernel 下 MBR Boot flag 發揮功用

By 柯允行 2010-03-16


1前言
   這是一篇介紹如何在MSDOS MBR下利用Boot flag 80h 來引導 kernel 載入 root file system.

Tar file format


By 柯允行 2010-03-16


1前言
   這是一篇介紹tar file format,tar 為 linux 常用備份資料的工具.本文不是指令教學,而是希望能介紹其檔案構造.
   tar file主要是把多個檔案包裝成一個檔案,一般會搭配一種壓縮法如gzip或bzip2,再對這個檔案壓縮成壓縮檔.其中把多個檔案包裝成一個檔案才是tar file format的範疇.概念下圖:

2010年3月5日

改變USB HUB掃描各個PORT的順序


By 柯允行 2010-03-05


1前言
   這是一篇介紹如何在 改變USB HUB掃描各個PORT的順序
2案由
   假設硬體工程式設計的USB架構如下:

2010年3月2日

Bash script debug tool

The Bash Debugger Project 專為bash script 提供一個類似gdb語法的除錯環境. 幾乎所有gdb指令皆可使用. 此外它(bashdb) 還可以和emacs以及ddd搭配使用.
說明文件可參照http://bashdb.sourceforge.net/bashdb.html

2010年2月22日

時間量測

一般在效能調整上常用到時間量測,以下示範kernel space 及 user space 的用法.

2010年2月2日

openssl實作md5 checksum

openssl 為實用的加解密函式庫,以下為實作md5/sha/sha1 checksum的範例.

2009年10月7日

Setting NFS between PC and target board


Install NFS server in Ubuntu
Package
                nfs-kernel-server
                nfs-common