星期四, 1月 17, 2013

Raspberry Pi 筆記

第一步,更新:
sudo apt-get update
sudo apt-get upgrade -y

安裝並轉用 vim:
sudo apt-get install vim
sudo update-alternatives --config editor

設定 reverse tunnel:
sudo apt-get install autossh
# allow connect to SSH via port 65522 on server.tld
autossh -NfR 65522:localhost:22 user@server.tld
# add the above line with @reboot prefix in crontab
crontab -e

安裝 VNC:
sudo apt-get install tightvncserver
# run it once to set password
tightvncserver
# start vnc server with display 0 at 1920x1080 resolution
vncserver :0 -geometry 1920x1080 -depth 24

安裝 Firefox:
sudo apt-get install iceweasel

安裝 Chrome:
# Install ttf fonts
sudo apt-get install ttf-mscorefonts-installer ttf-wqy-zenhei
# Install Chromium (Open Source version of Chrome)
sudo apt-get install chromium-browser

播放 MP3:
sudo apt-get install alsa-utils ntpdate mpg123 python-virtualenv libshout3 libshout3-dev pkg-config python-dev
sudo modprobe snd_bcm2835
sudo amixer cset numid=3 1
mpg123 filename.mp3

設立 AirPrint:
sudo apt-get install avahi-daemon avahi-discover libnss-mdns cups cups-pdf python-cups
sudo usermod -aG lpadmin pi
# add "Allow from @Local" to Location section of / , /admin and /admin/conf
sudo vim /etc/cups/cupsd.conf
# add mine types for AirPrint
sudo echo '#
# "$Id: $"
#
# AirPrint type
image/urf urf string(0,UNIRAST<00>)
#
# End of "$Id: $".
#
' | sudo tee /usr/share/cups/mime/airprint.types > /dev/null
sudo echo '#
# "$Id: $"
#
# AirPrint
# Updated list with minimal set 25 Sept
image/urf application/pdf 100 pdftoraster
#
# End of "$Id: $".
#
' | sudo tee /usr/share/cups/mime/airprint.convs > /dev/null
sudo service cups restart
### go to https://raspberrypi:631/ and setup the printer
# download and run the airprint-generate script
wget https://raw.github.com/tjfontaine/airprint-generate/master/airprint-generate.py
chmod 0755 airprint-generate.py
sudo ./airprint-generate.py -d /etc/avahi/services
sudo service avahi-daemon restart

設定時區:
sudo dpkg-reconfigure tzdata

播放 H.264 / MP4 影片:
omxplayer filename.mp4

### Key bindings
# Key   Action
#  1    Increase Speed
#  2    Decrease Speed
#  j    Previous Audio stream
#  k    Next Audio stream
#  i    Previous Chapter
#  o    Next Chapter
#  n    Previous Subtitle stream
#  m    Next Subtitle stream
#  s    Toggle subtitles
#  q    Exit OMXPlayer
# Space Pause/Resume
#  p    Pause/Resume
#  -    Decrease Volume
#  +    Increase Volume
# Left  Seek -30
# Right Seek +30
# Down  Seek -600
#  Up   Seek +600

暫停/繼續一個 process:
kill -STOP <pid>
kill -CONT <pid>

(將會持續更新...)

2 則留言:

Unknown 說...

最近我有賣一台Raspberry Pi來玩
想說是否有沒有辦法設定
所有登入程式網路都要透過Proxy
網路都找不到相關方法(只有暫時CMD)

我主要目的是要
不同網域->squid{Raspbery Pi}->Proxy Server[Hinet proxy]
不知道有沒有方法?

Ho Wang 說...

試試 export http_proxy='http://proxy.hinet.net:80/'

如果你的 squid 要經過另一個 proxy 的話,可以試試在設定中加入 cache_peer proxy.hinet.net parent 80 0 no-query no-digest default