Cubie Truck 測試 – 改用 Ubuntu Desktop

因為 Lubuntu 的版本比較舊所以改用比較新的版本 Ubuntu Desktop
下載位置:
http://dl.cubieboard.org/software/a20-cubietruck/ubuntu-desktop/

預設登入的帳號及密碼:linaro / linaro
登入預設採用的是 Unity 介面
[@more@]Ubuntu Desktop 所採用的是 12.04 的版本,因為 Precise 屬於 LTS 的版本,所以還可以接受
CubieTruck 版本是 12.11 版本

$ sudo lsb_release -a
No LSB modules are available.
Distributor ID:    Linaro
Description:    Linaro 12.11
Release:    12.11
Codename:    precise

出現可以升級的訊息,但這裡先不升級,因為升級可能會面臨空間不足,或是其它的問題

先刪除一些個人比較不常用的套件,移除的套件純屬個人習慣
移除 ibus 輸入法架構
$ sudo apt-get remove –purge ibus ibus-gtk ibus-gtk3 ibus-pinyin ibus-pinyin-db-android ibus-pinyin-db-open-phrase libibus-1.0-0 python-ibus pinyin-database ibus-table libibus-1.0-0

移除 brasero 燒錄軟體
$ sudo apt-get remove –purge brasero brasero-cdrkit brasero-common libbrasero-media3-1

移除 empathy
$ sudo apt-get remove –purge empathy empathy-common nautilus-sendto-empathy

移除 gwibber
$ sudo apt-get remove –purge gwibber gwibber-service gwibber-service-facebook gwibber-service-identica gwibber-service-twitter libgwibber-gtk2 libgwibber2

移除 thunderbird
$ sudo apt-get remove –purge thunderbird thunderbird-globalmenu thunderbird-gnome-support

移除 transmission
$ sudo apt-get remove –purge transmission-gtk transmission-common

移除 simple-scan
$ sudo apt-get remove –purge simple-scan

移除遊戲
$ sudo apt-get remove –purge aisleriot gnome-games-data gnome-sudoku gnomine mahjongg

把用不到的套件一併清除
$ sudo apt-get autoremove

安裝 Ubuntu Desktop 傳統介面,因為不習慣使用新的介面,並不是 Unity 新的介面有什麼不好,就像 Windows 8 / 8.1 把開始功能表移除一樣
$ sudo apt-get install gnome-session-fallback

改成傳統介面

Cubie Truck 測試 – 安裝 Samba Server

安裝方式:
$ sudo apt-get install samba tdb-tools

修改設定檔 /etc/samba/smb.conf
$ grep -E -v ‘^$|^#|^;’ /etc/samba/smb.conf
[@more@]
建立使用者的 Samba 帳號及密碼
$ sudo /usr/bin/pdbedit -a linaro

啟動 Samba Server
$ sudo /etc/init.d/nmbd start
$ sudo /etc/init.d/smbd start

在 Windows 7 上測試
在檔案總管上方列輸入 IPUsername

輸入帳號及密碼

應該可以瀏覽使用者的家目錄

關閉 Banana Pi 上面的 Led 燈

Banana Pi 上的 Led 的作用主要是讓使用者能透過 Led 燈號來了解系統目前的狀態,不過因為我的 Banana Pi  是拿來當做 Server,一天 24h 開機,晚上經過放電腦的房間會發現 Led 燈號一閃一閃的,有些刺眼,所以決定把它關閉。
參考網頁:
Switch off the leds ? – Advanced users – Banana Pi Forum
Banana Pi User Defined LED | Banana Pi Blog
【转】关闭那个烦人的绿灯 – Banana PI – 树莓派创客社区 – Powered by Discuz!
Banana Pi Forums :: Topic: How to Modify The script.bin File (1/1)
Banana Pi: Onboard, User-Definable Green Led – Debian, <br> Ubuntu et al.

關閉 綠色 Led 燈
# echo none > /sys/class/leds/green:ph24:led1/trigger
開啟 綠色 Led 燈
# echo 1 >  /sys/class/leds/green:ph24:led1/brightness

讓開機時立即生效
# sed -i ‘/^exit 0/iecho none > /sys/class/leds/green:ph24:led1/trigger’ /etc/rc.local
開機時還原
# sed -i ‘/green/s/^/#/’ /etc/rc.local[@more@]另外一種方式:
安裝所須套件 git / pkg-config / libusb
# apt-get install git pkg-config libusb-1.0-0 libusb-1.0-0-dev -y

建立掛載目錄
# mkdir /mnt/mmcblk0p1

掛載第一個分割區
# mount /dev/mmcblk0p1 /mnt/mmcblk0p1

下載 sunxi-tools tool
# git clone git://github.com/linux-sunxi/sunxi-tools.git
Cloning into ‘sunxi-tools’…
remote: Counting objects: 1075, done.
remote: Total 1075 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (1075/1075), 368.20 KiB | 36 KiB/s, done.
Resolving deltas: 100% (577/577), done.

切換目錄
# cd sunxi-tools

進行編譯
# make

備份原檔
# cp /mnt/mmcblk0p1/script.bin /root/script.bin.source

修改 /mnt/mmcblk0p1/script.bin 檔案
要先利用 bin2fex 工具將 script.bin 檔案轉換成 fex 檔案
# /root/sunxi-tools/bin2fex /mnt/mmcblk0p1/script.bin > /root/script.fex
fexc-bin: script.bin: version: 0.1.2
fexc-bin: script.bin: size: 50908 (86 sections)

開始修改 /mnt/mmcblk0p1/script.fex 檔案
# sed -i ‘s/leds_used = 1/leds_used = 0/’ /root/script.fex
# sed -i ‘s/leds_trigger_1 = “heartbeat”/leds_trigger_1 = “”/’ /root/script.fex

將 script.fex 轉換回 script.bin
# /root/sunxi-tools/fex2bin /root/script.fex > /root/script.bin

複製修改完的檔案回 /mnt/mmcblk0p1 目錄
# cp /root/script.bin /mnt/mmcblk0p1

取消掛載目錄
# umount /mnt/mmcblk0p1

刪除用來臨時掛載的目錄
# rm -rf /mnt/mmcblk0p1

大功告成!不過我比較喜歡用第一種方式,不用去更動系統的內部設定
至於 紅色和藍色的 Led 似乎不是使用 led_para 來做控制,所以並沒有找到相關的資料可以把它們關閉。

讓綠色的 Led 燈一閃一閃
# vim leds.sh
#!/bin/bash

echo none >  /sys/class/leds/green:ph24:led1/trigger
while true; do
   echo 1 >  /sys/class/leds/green:ph24:led1/brightness
   sleep 1
   echo 0 >  /sys/class/leds/green:ph24:led1/brightness
   sleep 1
done

執行
# sh leds.sh

Ubuntu Linux 開機後 NumLock 燈亮

Ubuntu Linux 預設開機後 NumLock 的燈是不亮的,造成有時候輸入數字時的不方便。
解決之道:
參考網頁:
NumLock – Community Help Wiki

1. 安裝 numlockx 套件
$ sudo apt-get install -y numlockx

2. 執行測試看看 NumLock 燈會不會亮
$ /usr/bin/numlockx on

3. 如果沒有問題的話,設定開機時執行
$ sudo sed -i ‘s|^exit 0.*$|# Numlock enablen[ -x /usr/bin/numlockx ] && numlockx onnnexit 0|’ /etc/rc.local

$ sudo tail -4 /etc/rc.local
# Numlock enable
[ -x /usr/bin/numlockx ] && numlockx on

exit 0

解決 Internet Explorer 瀏覽網頁時,出現”此網站的安全性憑證有問題”

使用  Internet Explorer 瀏覽網頁時,有時會出現”此網站的安全性憑證有問題
[@more@]使用 解決 Firefox 連線時出現憑證錯誤訊息 這一篇文章下載下來的憑證

1. 在憑證上按滑鼠右鍵,選擇 安裝憑證(I)

2. 選擇 開啟

3. 選擇 下一步

4. 選擇 下一步

5. 選擇 完成

6. 最後按 確定