黃士昕
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # 重要事項 <font color="#f00"> 1. 樹莓派請勿在通電情況下插入ssd卡</font> <font color="#f00"> 2. 注意模組是否需要安裝電阻 上述情況操作不當都可能導致部件燒壞</font> # 助教 - 尤宏恩 - 環境:windows, android - 黃士昕 - 環境:Mac, iphone - 使用iphone要開啟 **"最大化相容性"** 樹莓派才可以連接的到 - 石辛睿翔 - 環境:windows, android ![](https://hackmd.io/_uploads/r15K5Utun.png) # 環境建置 ## 材料包內容 <font color="#f00"> __ </font> __若有缺漏請馬上向助教反應__ 樹莓派系統模組含: 樹梅派(Pi 4) $\times$ 1 ![](https://i.imgur.com/19wOWdS.jpg =20%x) SD卡$\times$ 1 讀卡機$\times$ 1 USB線$\times$ 1 <!-- 麵包板$\times$ 1 公對公杜邦線$\times$ N 公對母杜邦線$\times$ N 母對母杜邦線$\times$ N LED燈(四腳)$\times$ 2 LED燈(兩腳)$\times$ 2 電阻$\times$ N <!-- 按鈕$\times$ 1 ![](https://i.imgur.com/IGLxGAD.png =20%x) --> <!-- DHT11$\times$ 1 ![](https://i.imgur.com/W7BjAGj.png =20%x) 蜂鳴器$\times$ 1 ![](https://i.imgur.com/tK4aXZH.png =20%x) <!-- 遙控器$\times$ 1 ![](https://i.imgur.com/ga37ylA.png =20%x) --> <!-- 紅外線接收器$\times$ 1 ![](https://i.imgur.com/dAF2UxR.png =20%x) --> ## 樹莓派介紹 ### 命名由來 樹梅派 Raspberry Pi 的 Pi 就是指 python,一開始只打算使用 python 當 Raspberry Pi 的專屬語言,但之後各種的語言都可以在 Raspberry Pi 上面運行了。 而以樹莓為命名 Raspberry 則是為了致敬 Apple、Tangerine Computer Systems、Apricot Computers、Acorn等以水果為命字的公司。 ### 機型 而 Raspberry Pi 從推出到現在,釋出了許多機型,一開始型號分為 A、B 兩種,A 為沒有網路孔的型號價格較低。之後則推出了型號 Pi Zero,是 model A、B 閹割版,性能稍差,但體積更小;Pi Zero W 則是 Pi Zero 的無線網路版本。 __註:我們課程所使用的是 Pi 4__ | Model | Pi Zero | Pi Zero W | Pi 3 B | Pi 3 B+ | Pi 4 | |:------------:|:-------:|:---------:|:----------:|:---------------:|:---------------:| | 上市時間 | 2015.11 | 2017.2 | 2016.2 | 2018.8 | 2019.6 | | CPU | ARM11 | ARM11 | Cortex-A53 | Cortex-A53 | Cortex-A72 | | CPU時脈 | 1GHz | 1GHz | 1.2GHz | 1.4GHz | 1.5GHz | | 記憶體 | 512MB | 512MB | 1GB DDR2 | 1GB DDR2 | 1, 2, 4 GB DDR4 | | 無線網路規格 | X | 802.11n | 802.11n | 802.11 b/g/n/ac | 802.11 b/g/n/ac | ![樹莓派型號](https://i.imgur.com/9vzQjgi.jpg) ### GPIO 腳位 GPIO (General Purpose Input Output) 就是可以輸入輸出指令的地方,各接腳有編號與各自負責的工作,可以透過程式去控制他們,下圖是屬於 Raspberry Pi 的40個 pin ,各具備不同功能。 可分為以下四種類別: * I2C * UART * SPI * GPIO ![](https://i.imgur.com/qbJBZUQ.png) ### 週邊設備 註:下圖為Pi 4 ![](https://www.taiwansensor.com.tw/wp-content/uploads/2020/04/Raspberry-Pi-4-Model-B-intro.jpg) ### 使用示意圖 將放有系統的SD卡與要使用到的裝置插入 (e.g. 鍵盤、滑鼠、網路線、螢幕線、電源線...等) ![](https://projects-static.raspberrypi.org/projects/raspberry-pi-getting-started/c75872d60ab3464aadd28acbd466c0eaaa5be402/en/images/pi-plug-in.gif) 參考資料: [Raspberry Pi Introduction (樹莓派介紹)](https://hackmd.io/@combo-tw/S1EfJwQbB) [Day4 Raspberry Pi介紹](https://ithelp.ithome.com.tw/articles/10217981) [Day8 - 樹莓派的GPIO簡介](https://ithelp.ithome.com.tw/articles/10237152) ## 軟體下載及安裝 * __注意事項:請依據自己電腦的作業系統、CPU架構選擇相對應的版本__ * __開啟安裝檔遇到"您是否要允許此App變更您的裝置?"時,都按"是"__ ### Visual Studio Code * 簡稱VS Code,是一款由微軟開發且跨平台的免費原始碼編輯器 * [Visual Studio Code下載連結](https://code.visualstudio.com) * 此畫面選項全勾,其餘皆使用預設值安裝 ![](https://i.imgur.com/No0puqp.jpg) ### Raspberry Pi Imager * 是一種將Raspberry Pi OS和其他作業系統燒錄至MicroSD卡的燒錄器 * [Raspberry Pi Imager下載連結](https://www.raspberrypi.com/software/) * 皆使用預設值安裝 ### Fing * 使用Mac的同學下載即可 * Wi-Fi網路掃描工具 * [Fing下載連結](https://www.fing.com/products/fing-desktop) * 皆使用預設值安裝 ### WinRAR * 解壓縮工具 * 只有Windows才有,使用Mac的同學不需下載 * 註:MacOS直接對zip檔點兩下即可解壓縮,其他格式的壓縮檔可以去App Store找解壓縮工具 * 選擇 __64位元__ 的版本下載 * [WinRAR下載連結](https://rar.tw/product.html) * 皆使用預設值安裝 ### MobaXterm * Windows SSH客戶端軟體 * 只有Windows才有,使用Mac的同學不需下載 * 請下載 __右邊綠色__ 的 __Installer edition__ * [MobaXterm下載連結](https://mobaxterm.mobatek.net/download-home-edition.html) * 安裝步驟 1. 把壓縮檔解壓縮並進入資料夾 2. 選取安裝檔 3. 其餘皆使用預設值安裝 ![](https://i.imgur.com/TPPvb00.png) ## 樹莓派安裝&連線步驟(Windows) ### 0. 注意事項 __若為桌電請確認有網卡__ __樹莓派關機指令:`sudo halt`__ __使用者名稱請設定為任一組員的學號__ 使用MobaXterm時,若要貼上複製的指令 __直接按滑鼠右鍵即可__ ### 1. 準備清單 * 樹莓派 * 樹莓派電源或其他Type-C接頭的電源皆可 * MicroSD卡、SD轉卡(大卡) * 讀卡機 * 電腦 ### 2. 修改電腦行動熱點設定 * 等等在第5步驟燒錄記憶卡時會用到,預設的通常不太好打,因此建議修改 * 開啟 "設定" * 按 "網路和網際網路" * 按 "行動熱點" * 按 "編輯" * 設定成你想要的網路名稱及密碼 * <font color="#f00">網路頻帶選擇"2.4 GHz"</font> ![行動熱點介面](https://i.imgur.com/6FDJMvZ.jpg) ### 3. 將MicroSD卡放入讀卡機 * 請注意方向,並插上電腦 ![](https://i.imgur.com/SyFZOzm.jpg) ![](https://i.imgur.com/pio4YKf.jpg) ### 4. 格式化記憶卡 * 開啟Raspberry Pi Imager * 選擇 __64__ bit os * 選擇記憶卡 * 按 "燒錄" * 按 "是",確認刪除數據 ![燒錄器介面](https://i.imgur.com/3Qh5Iyj.jpg) ### 5. 燒錄記憶卡 * 選擇其他選項 __"Raspberry Pi OS (64-bit)"__ * 選擇記憶卡 * __請依照框框內容設定__,其餘不用更改,並按 "保存" ![燒錄器進階設定](https://i.imgur.com/auP4cbL.jpg) * 按 "燒錄" * 按 "是",確認刪除數據 * 等待一段時間(第一次燒錄會比較久) ### 6. 安裝MicroSD卡 * __請小心&注意方向!! 請小心&注意方向!! 請小心&注意方向!!__ ![樹莓派安裝畫面1](https://i.imgur.com/mvjavkC.jpg) ![樹莓派安裝畫面2](https://i.imgur.com/oljYPIJ.jpg) ### 7. 查看樹莓派IP位址 * 將樹莓派接上電源 ![接上電源圖](https://i.imgur.com/SU7qu3U.jpg) * __開啟電腦行動熱點__,等待樹莓派連上電腦(約3分鐘) * 查看樹莓派IP * 沒出現的話就把熱點重開和樹莓派電源重開 ![查看樹莓派IP](https://i.imgur.com/x4pZWsy.jpg) ### 8. SSH連線 * 開啟 "MobaXterm" * 按 "Session" * 按 "SSH" * 按 "Bookmark settings" * 如下設定 * Remote host:剛查到的IP * Specify username:你的學號 * Session name:raspberrypi ![Moba設定](https://i.imgur.com/JouiIUW.jpg) * 輸入密碼並按 "Enter"(輸入時游標不會有反應是正常的) * 按"Yes",讓MobaXterm幫你記住密碼 ### 9. 大功告成 ![大功告成](https://i.imgur.com/WrKixd6.jpg) ## 樹莓派安裝&連線步驟(MacOS) ### 0. 注意事項 __請確認手機網路為吃到飽,吃不飽的請直接來找助教__ __樹莓派關機指令:`sudo halt`__ __使用者名稱請設定為任一組員的學號__ 使用 `command` + `V` 即可貼上 由於Mac的行動熱點訊號來源無法選擇"Wi-Fi",因此連線時改為把Mac和樹莓派都連到手機熱點,並且使用"Fing"查看樹莓派IP ### 1. 準備清單 * 樹莓派 * 樹莓派電源或其他Type-C接頭的電源皆可 * MicroSD卡、SD轉卡(大卡) * 讀卡機 * 電腦 * __手機__ ### 2. 將MicroSD卡放入讀卡機 * 請注意方向,並插上電腦 ![](https://i.imgur.com/SyFZOzm.jpg) ![](https://i.imgur.com/pio4YKf.jpg) ### 3. 格式化記憶卡 * 開啟Raspberry Pi Imager * 選擇64 bit os * 選擇記憶卡 * 按 "燒錄" * 按 "是",確認刪除數據 ![燒錄器介面](https://i.imgur.com/3Qh5Iyj.jpg) ### 4. 燒錄記憶卡 * 選擇其他選項 "Raspberry Pi OS (64-bit)" * 選擇記憶卡 * __請依照框框內容設定__,其餘不用更改,並按 "保存" ![](https://i.imgur.com/kYBW9vD.jpg) * 按 "燒錄" * 按 "是",確認刪除數據 * 等待一段時間(第一次燒錄會比較久) ### 5. 安裝MicroSD卡 * __請小心&注意方向!! 請小心&注意方向!! 請小心&注意方向!!__ ![樹莓派安裝畫面1](https://i.imgur.com/mvjavkC.jpg) ![樹莓派安裝畫面2](https://i.imgur.com/oljYPIJ.jpg) ### 6. 查看樹莓派IP位址 * 將樹莓派接上電源 ![接上電源圖](https://i.imgur.com/ppHDYwi.jpg) * 開啟手機個人熱點,等待樹莓派連上手機(約3分鐘) * 沒出現的話就把行動熱點重開和樹莓派電源重開 * __電腦也要連上手機個人熱點__ * 開啟 "Fing" * <font color="#f00">要先註冊並且登入</font> * 按左側 "Device",按 "raspberrypi" ![Fing介面1](https://i.imgur.com/TAkyG1q.jpg) * 查看樹莓派IP ![Fing介面2](https://i.imgur.com/oCymIZo.jpg) ### 7. SSH連線 __由於MacOS沒有MobaXterm,因此改為使用VS Code來連線__ 詳細步驟請參考下面SSH連線的教學 ## SSH ### 介紹 SSH是Secure Shell的縮寫,取代了以前很流行但不安全的telnet,可以讓我們能從遠端主機安全地連線至某個終端機。 因為SSH加入了使用者驗證機制與把通訊連線加密,所以此連線方式降低了未經授權的不速之客使用遠端終端機以及攔截我們的通訊的風險。 ### 連線方式 這邊提供三種SSH連線的使用方式給大家,各有各的優缺點,大家任選一種使用即可,或是視情況使用不同方式。 __請先確認電腦以及樹莓派在同個網域內__,例如: * 電腦開熱點給樹莓派連 (Windows安裝教學方法) * 電腦及樹莓派皆連到手機熱點 (MacOS安裝教學方法) 1. CMD/Terminal * 開啟CMD或Terminal * 輸入 `ssh 使用者名稱@樹莓派ip` e.g. `ssh N96114239@192.168.137.10` * 輸入"yes" * 輸入密碼,完成 ![](https://i.imgur.com/zyU6Kh9.jpg) 2. VS Code * 開啟VS Code * 選取左側"延伸模組",輸入"SSH",按"安裝" ![](https://i.imgur.com/n4V7xQP.jpg) * 選取左側"遠端總管",選取"SSH Target",按"+" ![](https://i.imgur.com/z8Axqya.jpg) * 輸入SSH指令:`ssh 使用者名稱(學號)@樹梅派ip` e.g. `ssh N96114239@192.168.137.10` ![](https://i.imgur.com/UK3vJoo.jpg) * 選擇SSH設定檔要存在哪裡,這邊直接按"Enter"即可 ![](https://i.imgur.com/7zxtskQ.jpg) * 對著剛加入的連線按右鍵,看你要用現在的視窗還是新開一個視窗皆可 ![](https://i.imgur.com/JimGjO0.jpg) * <font color="#f00">注意中上方,選擇"Linux",並輸入密碼</font> * 確認左下綠色部分有顯示SSH連線的ip,選取左側"檔案總管",按"開啟資料夾",直接按"確定"即可 ![](https://i.imgur.com/9qwtGfx.jpg) * 按右上"切換面板"以顯示終端機 ![](https://i.imgur.com/ex0d9P6.jpg) * 大功告成 ![](https://i.imgur.com/7YNtAOL.jpg) 3. 其他進階軟體 * MobaXterm (Windows安裝教學方法) ### 免密碼登入 SSH 的登入方式可採用密碼登入、使用公開金鑰登入的方法。 目前主流雲端主機大廠例如 Google 的 GCE、Amazon 的 EC2 等等,因為安全性的考量,皆採用公開金鑰認證(public key authentication)登入免輸入密碼登入的方法。 為什麼使用金鑰登入比較安全? 只要提到木馬病毒的鍵盤記錄器會將鍵盤上所輸入的字母皆側錄下來,又或者在免費的公開網路有被側錄封包的風險,以安全性的角度來看,使用金鑰登入 SSH 的方式相對安全許多,前提是金鑰檔案要保管好,不能外流。 ### SSH 金鑰認證流程 在開始進行客戶端和伺服器的必要設定之前,我們先來了解一下 SSH 金鑰認證的流程,這樣一來就可以對接下來的設定有深刻的理解。 以我們為例,Client:電腦,Server:樹莓派,因為是從電腦連線至樹莓派 ![](https://i.imgur.com/QeZjAe4.png) 1. 聯繫 這個階段客戶端對伺服器進行聯繫,傳送金鑰組 (SSH key pair) 的 ID 給伺服器來進行請求授權。客戶端和伺服器會一起產生一組共用的工作階段金鑰 (session key) 來加密整個過程。 2. 加密訊息 接著,伺服器檢查該登入使用者帳號的 "authorized_keys" 檔案,是否有這個金鑰 ID,如果存在,則伺服器產生一組隨機碼,並用此公鑰加密後,回覆加密訊息給客戶端。 3. 溝通 這個階段客戶端與伺服器進行雙向溝通,過程如下: * 假如客戶端有正確的私鑰,則使用私鑰將此加密訊息解碼,還原伺服器產生的隨機碼。 * 客戶端將此還原的隨機碼與兩者共用的工作階段金鑰組成一個 MD5 的雜湊值,接著將這個 MD5 值回覆給伺服器。 * 伺服器使用兩者共用的工作階段金鑰與步驟 2 傳給客戶端時產生的隨機碼組成 MD5 的雜湊值,然後驗證客戶端傳來的 MD5 與伺服器產生的 MD5 是否相符。 如果相符,證實了客戶的私鑰正確,進行授權給客戶端連線。 4. 登入 驗證成功的客戶端此時即可登入伺服器 ### SSH 免密碼登入的設定 SSH 使用 Key 驗證,以免輸入密碼登入的設定方法主要有下列四個步驟: * 產生金鑰組 (Client端, i.e. 電腦) * 修改登入使用者的 "authorized_keys" 檔案 (Server端, i.e. 樹莓派) * 修改 SSH 設定檔 (Server端) * 檢查目錄及檔案權限 (Server端) 在前一段提到金鑰組 (SSH key pair) ,包含了一個公開金鑰 (public key) 和一個私密金鑰 (private key),我們必須產生金鑰組,並將產生的公開金鑰放到伺服器上,該登入使用者的 authorized_keys ,接著修改 SSH 設定檔,然後重啟 SSH 服務。 __簡單來說:公私鑰免密碼登入的概念就是在Server的門上開一個自己(Client)專用的鑰匙孔__ (記得這句話就可以裝懂了) ### SSH 免密碼登入流程 * 在/home/使用者名稱/下建立一個資料夾,並命名為".ssh" * 在CMD/Terminal中輸入:`ssh-keygen` * 接下來幾個問題不用輸入,一直按Enter即可,會在`C:\Users\使用者名稱\.ssh`看到公私鑰(.pub結尾的是公鑰) e.g. Windows:`C:\Users\Chen\.ssh` e.g. MacOS:`/Users/chen/.ssh/` * 在樹梅派建立".ssh"資料夾 * 將公鑰從電腦拉進樹梅派的.ssh資料夾,並將其命名為authorized_keys * 在CMD/Terminal中輸入:`ssh 使用者名稱@樹梅派ip`,測試是否可以免密碼登入 e.g. `ssh N96114239@192.168.137.10` * 註:之後若要加入其他公鑰,則將公鑰內容複製進去此檔案的下面即可 ### SSH 總結 一般來說,使用金鑰登入 SSH 而非使用密碼登入多為安全性的考量,但很多情境下使用免密碼登入也有許多便利性。 很常見的 Git 也是採用這種方式,例如 GitHub 網站,在帳號中的設定 SSH key 時也是將公鑰檔案的內容填入帳號設定中,即可使用 SSH 存取 Git 儲存庫。 參考資料: [駭客的Linux基礎入門必修課](https://www.books.com.tw/products/0010827808?sloc=main) [[Mac教學]免下載其它第三方工具,讓Mac連SSH方法](https://mrmad.com.tw/mac-ssh) [Windows 透過 ssh 指令連接遠端主機,以 Linux 為例 (不須額外安裝軟體,外加記憶連接資訊)](https://www.ruyut.com/2022/06/windows-ssh-client.html) [SSH Login 使用 Key 驗證,免密碼登入的設定方法](https://terryl.in/zh/ssh-key-login-without-password/) ## Lab 內容 1. 顯示樹莓派 Python 版本並截圖(自己查一下指令) 2. 安裝好樹莓派作業系統,並以SSH的方式連線登入(用各種方法皆可),輸入`ifconfig` 查看網路狀態並截圖

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully