查系統重啟紀錄
cat /var/log/syslog | grep shutdown
查 rpi hardware/firmware資訊
vcgencmd measure_clock <clock>
<clock> = arm, core, h264, isp, v3d, uart, pwm, emmc, pixel, vec, hdmi, dpi
vcgencmd measure_volts <id>
option: core, sdram_c, sdram_i, sdram_p
vcgencmd measure_temp
vcgencmd codec_enable <codec>
option: H264, MPG2, WVC1, MPG4, MJPG, WMV9
vcgencmd get_config [config|int|str]
query all setting: vcgencmd get_config int
vcgencmd version query firmware version
vcgencmd otp_dump
28: serial number
30: revision
mac address was generated from serial number
refer with ifconfig and cat /proc/cpuinfo
Benchmark: sysbench
cpu
sysbench --test=cpu --cpu-max-prime=10000 --num-threads=4 run
memory
sysbench --test=memory --memory-block-size=1K --memory-total-size=10G --num-threads=4 run
把記憶體當硬碟用(ramdisk/ramfs/tmpfs)
第一代:ramdisk,固定大小。
第二代:ramfs,可變大小,無需格式化,使用vfs即可操作。
第三代:tmpfs,可用SWAP
系統已運作... uptime
handy@handy-dell ~/solarpi/dev $ uptime
17:51:14 up 6:40, 2 users, load average: 1.31, 1.39, 1.40
17:51:14指目前系統時間
6:40 指系統已運作6小時40分
查系統登入使用者 w
handy@handy-dell ~/solarpi/dev $ w
17:51:28 up 6:40, 2 users, load average: 1.24, 1.37, 1.40
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
handy tty8 :0 11:10 6:40m 4:59 0.61s cinnamon-session --session cinnamon
handy pts/2 :0 11:11 1.00s 0.23s 0.01s w
確認檔案/資料匣版本 tar + sha1sum
先把整個資料匣用tar打包,再用sha1或md5去算校驗值
tar不想看囉嗦的訊息的話,就不要verbose參數(反正也不會看),這樣下:
$ tar cf solarpi.tar solarpi
然後再做驗証,整個流程如下:
pi@raspberrypi:~ $ ls
democode Downloads Pictures Scratch Templates
Desktop mcs Public solarpi temp.log
Documents Music python_games solarpi-data Videos
pi@raspberrypi:~ $ tar cf solarpi.tar solarpi
pi@raspberrypi:~ $ ls
democode Downloads Pictures Scratch solarpi.tar Videos
Desktop mcs Public solarpi Templates
Documents Music python_games solarpi-data temp.log
pi@raspberrypi:~ $ sha1sum solarpi.tar
15111cd212489dfe3527fb5d5d88bf01f6414c47 solarpi.tar
pi@raspberrypi:~ $ md5sum solarpi.tar
7fd244e1870d74ad82437aa449fad356 solarpi.tar