2013年8月26日 星期一

Debian支援簡體中文

  1. locale -a 看目前支援的語言
  2. dpkg-reconfigure locales 新增所需的語言
  3. apt-get install ttf-arphic-uming 新增所需的字型

使用root帳號開啟Chromium

  1. vim /etc/chromium/default
  2. CHROMIUM_FLAGS="--user-data-dir"

64bits Linux裝PPS

在網路上找到一篇文章,照著裝就可以了^^

getlibs自動轉換,捉取相關32 bit程式庫的套件

安裝deb檔方法

  1. dpkg -i xxx.deb
  2. dpkg --force all -i xxx.deb

iwconfig連接WiFi

  1. ifconfig wlan0 up
  2. iwconfig wlan0 essid wifiap
  3. dhclient wlan0
wifiap為AP名,設置為無加密AP

2013年8月16日 星期五

USB3.0 Speed

Low-speed:   1.5Mbps
Full-speed:    12Mbps
High-speed:   480Mbps
Super-speed: 5Gbps

2013年8月15日 星期四

Compiler Android發生JDK版本錯誤問題

由於預設的安裝路徑已經找不到"sun-java6-jdk"可以安裝了~~~
手動下載安裝又很麻煩~~~
就使用預設的"openjdk-6-jre"來用~~~
apt-get install openjdk-6-jre
雖然安裝很方便,但compiler時會有問題~~~

會出現下面的錯誤
Your version is: java version "1.6.0_27"
The correct version is: Java SE 1.6

直接把確認版本的code mask即可~~~
目前compiler後還沒有問題發生~~~

在你BSP路徑下的build/core/main.mk

# Check for the correct version of java
#java_version := $(shell java......
#ifneq ($(shell java......
#......
#......
#$(info......
#$(error stop)
#endif

安裝Android開發環境

參考Initializing a Build Environment http://source.android.com/source/initializing.html

看system、driver、指令相關的執行或錯誤訊息

  1. dmesg
  2. 直接到/var/log底下去看log檔案
    有dmesg、syslog等

2013年8月12日 星期一

Linux SSH加密

  1. ssh-keygen (ssh-keygen -t  rsa -C "???@???)
    ssh-keygen [-t rsa|dsa] 可選rsa或dsa
  2. 在~/.ssh目錄會得到id_rsa(私鑰)及id_rsa.pub(公鑰)
如果出現Permissions 0644 for '/home/ewrwer/.ssh/id_rsa' are too open的錯誤時,請將id_rsa檔案權限設為"600"。

可以將私鑰copy至其他電腦使用,如出現問題,請下ssh-add ~/.ssh/id_rsa

2013年8月7日 星期三

編譯時發生open with O_CREAT in second argument needs 3 arguments

錯誤訊息如下:
inlined from ‘collect_execute’ at /home/fae/Workspace/MTK/Projects/4120_SDK/toolchain/buildroot/toolchain_build_mipsel/gcc-3.4.2/gcc/collect2.c:1535:20:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:24: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments

修改collect2.c
原:redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT);
改:redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT, 0777);

編譯時發生'makeinfo' is missing on your system錯誤

  1. apt-get install texinfo
  2. makeinfo --version查看版本
    makeinfo (GNU texinfo) 4.13

    Copyright (C) 2008 Free Software Foundation, Inc.
  3. 修改configure支援4.13版本
    if ${MAKEINFO} --version \
    | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])' >/dev/null 2>&1; then

    if ${MAKEINFO} --version \
    | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|4\.[1-9][0-9]*|[5-9])' >/dev/null 2>&1; then
P.S. 也可直接換回舊版,4.12版本,較不會有問題

在Linux中取代Source Insight瀏覽source code

原本在Windows中使用source insight,不過source insight真的是太複雜了,功能太多。
後來試SlickEdit,簡單多了,好用,而且有Linux跟Windows兩個版本~~~
不過電腦實在是跑不動呀!每次都要泡杯茶,喝完,才看得到結果~~~
這就是目前的福利,哈 ^^
網路上很多人都用VIM+Cscope+Ctags,自己也來試試...
  1. 安裝
    apt-get install vim
    apt-get install cscope
    apt-get install exuberabt-ctags
  2. 使用vim
    code_complete : function parameter complete, code snippets, and much more
    http://www.vim.org/scripts/script.php?script_id=1764
    下載放置到/usr/share/vim/vim73/plugin增加額外的功能
    taglist.vim : Source code browser (supports C/C++, java, perl, python, tcl, sql, php, etc) http://www.vim.org/scripts/script.php?script_id=273
    下載放置到/usr/share/vim/vim73/plugin及/usr/share/vim/vim73/doc

    $vim test.txt
    分為指令模式與編輯模式
    透過"i"或是"a"鍵進入編輯模式
    在編輯模式按"Esc"鍵回指令模式

    $vim -t ??? 顯示包含??? tag的文件

    指令模式:
    "i" 進入編輯模式,由游標處開始編輯,後面的字隨即向後退
    "a" 進入編輯模式,游標後移後開始編輯
    ":q" 離開vim
    ":w" 存檔
    ":wq" 存檔後離開vim
    ":q!" 忽略修改,強制離開
    ":/" 搜尋文字,"n"搜尋下一個
    "yy" 複製當前游標所在列
    "dd" 刪除當前所在列
    ":ta ???" 顯示包含??? tag的文件
    ":set tags=" 定義tag文件的路徑
    ":TlistToggle" 顯示或關閉taglist視窗
    ":TlistOpen" 開啟taglist視窗
    ":TlistClose" 關閉taglist視窗
    ":cs add cscope.out" 增加cscope.out
    ":cs help" cscope help
    "p" 貼上

    編輯模式:
    "Esc" 返回指令模式

    配置文件
    /etc/vim/vimrc
  3. 使用cscope
    $cd到source code目錄
    $cscope -R
    -R Recurse directories for files
    -C Ignore letter case when searching
    -V Print the version number
    輸入後會跳至cscope視窗,上方為搜尋結果顯示視窗,下方為搜尋關鍵字輸入視窗
    可透由"Tab"鍵切換
    在cscope中按下"Ctrl"+"c"切換是否區分大小寫模式
    搜尋結果視窗:
    "Enter" 進入檔案編輯
    尋找關鍵字區域:
    "Ctrl"+"c" 忽略大小寫
    "Ctrl"+"d" 離開Cscope
  4. 使用ctags
    $cd到source code目錄
    $ctags -R
    $cscope
    當找到某個關鍵字的檔案時,可利用
    按下"Ctrl"+"]"跳到該函式被宣告的地方
    按下"Ctrl"+"t"回到原來的地方
  5. 可以透由底下方式結合使用
    find . -name "*.cc" -o -name "*.c"-o -name "*.h" > cscope.files
    cscope -bkq -i cscope.files
    ctags -R
  6. taglist視窗指令
    "Enter" 跳到指標下tag所定義的位置
    "Space" 顯示指標下tag的定義
    "+" 打開折疊
    "-" 收起折疊
    "*" 打開所有折疊
    "=" 收起所有折疊
    "x" taglist視窗放大縮小
    "[[" 跳到前一个文件
    "]]" 跳到後一个文件
    <F1> Help
    "Ctrl"+"w"+"w" 切換taglist與VIM視窗
寫成bash檔
filetree.sh
#!/bin/bash
if [ "$1" = "-h" ] || [ "$1" = "-H" ] || [ "$1" == "--h" ] || [ "$1" == "--H" ] || [ "$1" == "-help" ] || [ "$1" == "--help" ]; then
echo "filetree"
else
sudo ctags -R
sudo cscope -Rbkq
echo "---THE END---"
fi
exit 0

2013年8月6日 星期二

lubuntu開機時顯示waiting for network configuration,開機變慢

sudo leafpad /etc/network/interfaces
只留下
auto lo
iface lo inet loopback

在Linux上安裝開發環境常用的library

  1. bison
    Bison is a general-purpose parser generator that converts an annotated context-free grammar into a deterministic LR or generalized LR (GLR) parser employing LALR(1) parser tables.
  2. flex
    Flex is a fast lexical analyzer generator.
  3. gpp
    GPP is a generic preprocessor with customizable syntax.
  4. gcc
  5. g++
    G++ is a generic preprocessor with customizable syntax.
  6. make
  7. gawk
  8. gettext
  9. texinfo
  10. zlib1g-dev
    Zlib is a library implementing the deflate compression method found in gzip and pkzip. this package includes the development support files.
  11. libncurses5-dev
    The ncurses library routines are a terminal-independent method of updating character screens with reasonable optimization.
  12. patch
  13. gzip
  14. bzip2
  15. unzip
  16. build-essential 

2013年8月5日 星期一

Lubuntu如何使用Bluetooth透過手機上網

  1. 到Bluetooth Manager透由Bluetooth Network與你的3G電話連接。
  2. 透由"dhclient bnep0"設定Bluetooth Network走dhcp。
  3. 檢查"vi /etc/resolv.conf"看是否有設定DNS server(nameserver 8.8.8.8)。
    可以透由"vi /etc/resolvconf/update.d看到假設沒有設可以使用default,可安裝"djbdns"。
  4. 然後就可以上網了。
如何自動使用DHCP,不需要每次都輸入dhclient bnep0
編輯interfaces
vi /etc/network/interfaces
增加下面的設定
auto bnep0
iface bnep0 inet dhcp
會造成開機時一直再確認網路,導致開機變慢

restart network
/etc/init.d/networking restart

2013年8月2日 星期五

如何在Lubuntu收Microsoft Exchange mail

開了VirtualBox跑Linux後,實在沒辦法在開Microsoft Office,又需要收mail,實在麻煩~~~
最後還是在Linux收mail了 ^^
  1. 下載Thunderbird
  2. 在Thunderbird,找到Add-ons Manager
  3. 搜尋ExQuilla for Microsoft Exchange 21.0
  4. 安裝ExQuilla
  5. 找到Tools>ExQuilla for Microsoft Exchange>Add Microsoft Exchange Account...
  6. 鍵入相關訊息
  7. 在Microsoft Exchange EWS URL使用
    https://twmail.xxx.com/EWS/Exchange.asmx
    原https://twmail.xxx.com/owa改為上面的,把owa替換掉
  8. 就可以收發了
  9. 選擇帳號>settings可以選擇要收到Local Folders或是留在exchange server上

如何獲得Linux版本資訊

  1. 使用lsb_release -a
    $ lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 13.04
    Release: 13.04
    Codename: raring
  2. 使用uname -r
    $ uname -r
    3.8.0-27-generic
  3. 使用uname -a
    $ uname -a
    Linux xxx-lubuntu 3.8.0-27-generic #40-Ubuntu SMP Tue Jul 9 00:19:35 UTC 2013 i686 i686 i686 GNU/Linux
  4. 使用cat /etc/issue*
    $ cat /etc/issue*
    Ubuntu 13.04 \n \l

    Ubuntu 13.04