標籤:android des style blog class tar
Raspberry Pi 入手好一段時間了,原意是想擼 linux,但是後來一整年都在忙孩子房子戶口本子的事,這玩意也就擱了一年塵。
最近終於被生活折騰到了尾聲,開始找一些東西來折騰折騰。
一、什麼是 Rsapbbery Pi
Raspberry Pi 是一款信用卡大小,基於 Linux 的卡片電腦,700MHz CPU,B Pi 升級為 512(A Pi 256 記憶體)。UK pi 定價 B Pi 35 刀(A Pi 25 刀),天朝版 B Pi 約 300 軟妹B。
Raspberry Pi 基金的定位是提供給學生的學習機,沒想到發行之後在 Geek 手上大放異彩。
總結來說 Raspberry Pi 的特點:
1. 便宜,出廠價約等於成本價,目前盈利僅滿足於基金會日常運作
2. 麻雀雖小,五髒俱全,號稱世界上最小電腦
3. 可塑性強,Raspberry Pi 提供的僅僅是一個原型,看看 Geek 都用它來做什麼:
- Web 服務器:http://www.penguintutor.com/linux/raspberrypi-webserver
- 家庭自動化:http://www.instructables.com/id/Raspberry-Pi-GPIO-home-automation/
- BitTorrent 伺服器:http://blog.snapdragon.cc/raspberry-pi-as-bittorrent-server/
- Web Cam 伺服器:http://www.raspberrypi.org/archives/tag/webcam
- 天氣預報站:http://blog.retep.org/2012/07/30/installing-a-usb-weather-station-on-a-raspberry-pi-part-1/
- BitCoin Wallet:https://bitcointalk.org/index.php?topic=93724.0
- QuadCopter:http://hackaday.com/2012/12/01/raspberry-pi-quadcopter/
- VoIP PBX:http://www.raspberry-asterisk.org/
- XMBC 多媒體中心:http://hackaday.com/2012/11/19/raspberry-pi-reaches-critical-mass-as-xbmc-hardware/
- 有聲書籍播放器:http://hackaday.com/2012/11/01/one-button-audiobook-player-made-from-a-raspberry-pi/
- Arduino Shields:http://www.cooking-hacks.com/index.php/documentation/tutorials/raspberry-pi-to-arduino-shields-connection-bridge
- NAS 伺服器:http://elinux.org/R-Pi_NAS
- Apple Time Machine 支援:http://www.andadapt.com/2012/09/06/raspberry-pi-raspbian-hfs-afp-and-time-machine/
- Tor 中繼:http://lifehacker.com/5953155/use-a-raspberry-pi-as-a-tor-relay-and-help-others-browser-anonymously
- 家用 VPN 伺服器:http://wellsb.com/post/29412820494/raspberry-pi-vpn-server
- GPS 跟蹤器(帶 3G 支援):http://www.milos.ivanovic.co.nz/blog/252
- Advice Machine(無用但很酷):http://hackaday.com/2012/09/26/machine-offers-cheap-advice-charges-more-for-something-profound/
- 類比輸入:http://hackaday.com/2012/09/14/a-truly-professional-raspi-analog-input/
- 超級電腦:http://www.southampton.ac.uk/~sjc/raspberrypi/
- Kindle 作為顯示屏:http://www.ponnuki.net/2012/09/kindleberry-pi/
- PIC Programmer:http://holdenc.altervista.org/rpp/
- PenTesting/Hacking:http://blog.pwnieexpress.com/post/24967860602/raspberry-pwn-a-pentesting-release-for-the-raspberry
- Android 系統:http://www.raspberrypi.org/archives/1700
- 檢查網路狀態:https://wiki.bitlair.nl/Pages/Projects/Netlight
- Solar 資料記錄器:http://www.briandorey.com/post/Raspberry-Pi-Solar-Data-Logger.aspx
- 把我發到太空:http://www.daveakerman.com/?p=592
- 咖啡:http://moccapi.blogspot.co.uk/2012/03/idea.html
- 製作一個酷坦克:http://blog.ianrenton.com/raspberry-tank-build-diary/
- 電子相框:http://www.cjb.im/2012/06/raspberry-pi-wireless-display-using.html
- 添加 WiFi:http://pingbin.com/2012/12/setup-wifi-raspberry-pi/
- OpenSource Kiosk:http://pikiosk.tumblr.com/
- Node JS:http://elsmorian.com/post/23474168753/node-js-on-raspberry-pi
- 流量監視:http://www.thepowerbase.com/2012/12/integreen-brings-open-source-traffic-monitoring-to-italy/
- 超頻:http://www.jeremymorgan.com/tutorials/raspberry-pi/how-to-overclock-raspberry-pi/
二、準備
硬體:
1.Raspberry Pi,建議 B 型(512 記憶體 + 網卡插槽),國產 Pi 方便
2.tf 卡 + tf 轉 sd 卡套,建議 class10,速度好一些
3.sd 讀卡機,用於燒卡
4.電源線 5v,通過 MicroUSB 或 GPIO 頭
5.網線一條
6.usb 無限網卡一個(可選),注意型號,相容列表 http://elinux.org/RPi_VerifiedPeripherals#USB_Wi-Fi_Adapters
軟體:
1.Win32DiskImager 用來燒卡
2.作業系統鏡像 地址為 http://www.raspberrypi.org/downloads
- NOOBS 新手包,包括了幾個 OS,可以隨時切換
- Raspbian 基於 Debian,官方推薦
- OpenELEC/RaspBMC 多媒體中心
- Arch
- Risc OS
3.ssh 用戶端
- PuTTY,For PC
- ServerAuditor,For IPad
- Irssi ConnectBot,For Android 手機
三、系統安裝
- 下載鏡像,推薦 Raspbian
- 用讀卡機把 tf 卡插到 PC 上,用 Win32DiskImager 把鏡像燒到 tf 卡
- 把讀卡機插到 Raspberry Pi 的 sd 卡槽,接上網線,電源線,系統就會自動啟動
- 取得 Raspberry Pi 的 ip 地址,可以進路由器查,也可以用 arp 工具掃
- Raspbian 已經預設安裝 ssh 服務並啟動,直接用 ssh 用戶端串連到 Raspberry Pi,使用者名稱和密碼是 pi,raspberry
四、系統初始化
1.開啟 Raspberry Pi 進階設定面板:sudo raspi-config
- Expand Filesystem:擴充 sd 卡可用空間(建議)
- Change User Passwork:修改使用者密碼,看個人喜好
- Enable Boot To Desktop/Scratch:選擇預設啟動高案頭 GUI /命令列介面
- Internationlisation Options:
- Change Locale:修改編碼,選擇 en_US.UTF-8、zh_CN.UTF-8、zh_CN.GBK
- Change Timezone:修改時區,選擇 Asia/Shanghai
- Change Keuboard Layout:修改鍵盤配置,選擇 English(US)
2.升級系統和軟體 upgrade,update,一個漫長的等待...
3.時間同步,Raspberry Pi 沒有系統時鐘,靠網路同步時間
安裝 ntpdate,在 rc.local 檔案添加開機同步時間命令,儲存退出
4.安裝遠端桌面,需要安裝 xrdp,然後就可以用 windows 的遠端桌面來直接遠程,登入名稱就是 pi,raspberry
linux 下的案頭意義並不大(耗效能),偶爾用來配置些東西(比如無線網卡)還是挺方便的
五、接下來擼什麼
ftp 服務
web 服務(mono + jexus)
nginx,lvs,keepalived ...
redis,memcached,mongoDB,hdfs ...
golang,lua ...