Raspbian Jessie 初始設定

export NODE_PATH=/usr/local/lib/node_modules
function vv() {
for id in core sdram_c sdram_i sdram_p ; do \
v=$(vcgencmd measure_volts $id)
v=${v:5}
echo -e "$id:\t$v" ; \
done
}
alias ll="ls -al"
alias free="free -h"
alias cls="clear"
alias cd..="cd .."
alias vt="vcgencmd measure_temp"
alias psm="ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head"
alias psc="ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%cpu | head"
alias t="tmux attach"
alias re="bash ~/MyNodeJS/Ptt/rescan.sh"
alias ptt="bash ~/MyShellScript/loop_Ptt.sh"
alias dcard="bash ~/MyShellScript/loop_DCard.sh"
view raw .bashrc hosted with ❤ by GitHub

基本設定

執行設定程式
sudo raspi-config

  • Expand Filesystem (擴展第二個分割區,讓記憶卡的全部可用空間都可以使用。)
  • Internationalisation Options
    • Change Locale
      • 取消 en_GB.UTF-8 UTF8
      • 選取 zh_TW.UTF8 UTF8
      • 選取 en_US.UTF8 UTF8
    • Change Timezone
      • Asia/Taipei
    • Change Wi-fi Country
      • TW Taiwan
  • Advanced Options
    • A2 Hostname (變更Hostname)

設定系統自動校時
sudo timedatectl set-ntp yes
檢查自動校時
timedatectl

view raw rpi3-init.md hosted with ❤ by GitHub

module.exports init

module.exports = function(config) {
this.config = config;
this.myMethod = function() {
console.log('Has access to this');
};
return this;
};
view raw a.js hosted with ❤ by GitHub
var myModule = require('./a.js')(config);
myModule.myMethod(); //Prints 'Has access to this'
view raw b.js hosted with ❤ by GitHub