Work Cata
    • 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 New
    • 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 Note Insights Versions and GitHub Sync 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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # **【Linux 一條龍架站】ft.常見指令** :::info * 安裝 Linux through ubuntu server * Linux 常見指令 * 設置 MariaDB(mysql) * 設置 MongoDB * 設置 Apache2、PHP、NOIP * 設置 NFS、SAMBA ::: ## 安裝 Linux #### :+1: **下載Server版** destop版也可以,但容量差很~大 直接看網友文章~ :::spoiler [VirtualBox 安裝 Ubuntu Server 設定與教學-使用 subiquity 安裝程式](https://www.kjnotes.com/linux/102) ::: #### :+1: **系統更新** ```= sudo apt-get update sudo apt-get upgrade ``` #### :+1: **安裝基本net-tool、openssh、git、MariaDB(mysql)、MongoDB** ```= sudo apt install net-tools (=> ifconfig 可以查看ip) sudo apt-get install openssh-client sudo apt install git sudo apt install mariadb(mysql)-server sudo apt install mongodb ``` #### :+1: **安裝Python** ```= python3 --version sudo apt install python3-pip ``` > Python 套件 >sudo pip list >sudo pip install pymysql >sudo pip install selenium >sudo pip install pandas...... #### :+1: **設置root密碼** ```= sudo passwd root ``` #### :+1: **建立使用者** ```= sudo adduser newusername sudo passwd newusername - PS /etc/default/useradd (可以看到創建使用者的規則) ``` 切換到使用者,試試看能不能登入 ```= su - newusername ``` #### :+1: **刪除使用者** ```= sudo passwd sudo userdel newusername ``` #### :+1: **創群組,把使用者加入** ```= sudo groupadd groupname sudo usermod -aG groupname newusername (加到特定組別) sudo usermod -aG sudo newusername (加到sudo組,就可以擁有sudo權限) - PS cat /etc/group (查看所有GROUP訊息) - PS id <username> (查看特定用戶的身分訊息) ``` #### :+1: **刪除群組** ```= sudo groupdel groupname ``` #### :+1: **直接給予使用者root權限** ```= sudo visudo %<username> ALL=(ALL) ALL ``` #### :+1: **也可以創文件群組** 沒特別設置時,文件的群組通常是文件創建者的主要群組,但可以更改文件的群組,來控製文件的訪問權限 ```= chgrp newgroup myfile.txt - PS chown newowner:newgroup filename (一起更改文件所有者和群組) ``` #### :+1: **搭配grep** ```= sudo grep emp1 /etc/group (在 /etc/group 文件中搜尋包含 emp1 的行) ``` ```= sudo groupadd -g 1100 devb (創建一個名為 devb 的群組,同時指定群組ID(GID)為 1100) ``` #### :+1: **設立時區、語言** ```= sudo dpkg-reconfigure tzdata sudo dpkg-reconfigure locales   ( zh_TW.UTF-8 UTF-8) ``` #### :+1: **crontab 設置排程** ```= crontab-e sudo systemctl status cron (查看crontab狀態) sudo systemctl restart cron (正常修改完crontab -e是不用重啟的。) ``` ```= 30 10 * * * echo "hello world" >> /home/catalina/hello_01.txt (每天的10:30) 0 */6 * * * echo "hello world" >> /home/catalina/hello_01.txt (每六小時) 30 22 * * * python3 ~/ptt.py >> ~/cron_ptt.log 2>&1 (22:30運行Python腳本ptt.py,並輸出到cron_ptt.log) ``` ```= ps aux | grep ptt.py (確認所有python運行狀態) cat cron_ptt.log (查看log紀錄) ``` 練習 ```= mkdir scripts (/home/cata下,創建一個資料夾,專門用來放shell script 檔案) cd scripts (/home/cata/scripts) vi date_1.sh (資料夾中創建一個.sh檔案,/home/cata/scripts/date_1.sh) [進入後輸入資料,目的是獲取當前日期和時間,輸入到指定檔案] #!/bin/bash mdate=`date` echo $mdate >> /home/cata/date_1.txt (> 覆蓋 >> 附加) crontab -e (設定排程、log檔) 0 20 * * * /bin/bash /home/cata/scripts/date_1.sh >> /home/cata/scripts/date_1.log 2>&1 ``` 直接看網友文章補充~ :::spoiler [Ubuntu 排程設定 :Crontab 排程使用教學](https://jqnets.com/blog/ubuntu-%E6%8E%92%E7%A8%8B%E8%A8%AD%E5%AE%9A-%EF%BC%9Acrontab-%E6%8E%92%E7%A8%8B%E4%BD%BF%E7%94%A8%E6%95%99%E5%AD%B8/) ::: <br/> ## Linux 常見指令 #### :+1: **查看現在位置** ```= pwd ``` #### :+1: **到指定位置** ```= cd cd ..(回到上一層) cd - (回到前一步驟用的目錄) cd ~ (回到home/) ``` #### :+1: **複製資料** ```= cp <來源> <目的> (複製檔案) cp-r <來源> <目的> (複製資料夾) ``` #### :+1: **刪除資料** ```= rm <檔案> (刪除檔案) rm -r <檔案> (刪除資料夾) rm -rf <檔案> (強制刪除檔案) ``` #### :+1: **移動資料** ```= mv <原路徑> <新路徑> (移動檔案 剪下 貼上) mv <原檔名> <新檔名> (重新命名) ``` 假設home/catalina/file_1 要移去 home/josh/ => 現在在home/catalina => mv file_1 /home/josh/ => 現在在home/josh => mv /home/catalina/file_1 . #### :+1: **查看資料夾,列出子目錄和文件** ```= ls ls -l (簡稱ll,詳細列表(long listing)) ll -h or ls -h (使用容易觀看單位,KB、MB 等單位,而不是字節數) ll -lh or ls -lh (詳細列表+容易觀看單位) - PS ll AAA/BBB or ls AAA/BBB,例如: ls -lh /var/lib/mysql/test/ (可以直接查看指定位置資料夾) ``` #### :+1: **印資料夾檔案目錄到特定文件** ```= ls /bin/ > bin1.txt ``` 假設我在/home/catalina 操作ls /bin/ > bin1.txt,bin1.txt /home/catalina,而非 /bin #### :+1: **查看單一文件** ```= cat <filename> less <filename> (分頁查看) - PS history | less (查看歷史指令) ``` #### :+1: **打開單一文件** ```= vi or vim <filename> ``` >進到文件後 o 新增一行 yy 複製 30yy 複製30行 u 上一步 dd 刪除 p 貼上 G 跳到最後一行 esc + : + q! (跳出,不儲存) esc + : + wq (跳出,儲存) #### :+1: **印進檔案** ```= echo "hello linux!" > hello.txt ``` #### :+1: **複製到新檔案** ```= cat hello.txt > hello2.txt ``` #### :+1: **創建資料夾** ```= mkdir <filename> - PS mkdir /home/catalina/AAA/BBB/CCC (原本沒有的資料夾,會顯示錯誤) - PS mkdir -p /home/catalina/AAA/BBB/CCC (加了p,原本沒有的資料夾,會自動被建立) ``` #### :+1: **刪除整個資料夾** ```= sudo rm -rf /home/catalina/AAA/BBB/CCC ``` #### :+1: **清空畫面** ```= clear ``` #### :+1: **導向到log** 對的到right.log,錯的到wrong,log ```= ls hello.txt xxxx 1> right.log 2> wrong.log ``` #### :+1: **純打包 package.tar** ```= tar -cf package.tar bin* tar -tf package.tar (顯示內容) ``` #### :+1: **壓縮打包 package.tar** ```= tar -czf gzip_package.tar bin* (使用gzip技術) zip gzip_package.zip -r . tar -cjf bzip2_package.tar bin* (使用bzip技術) tar -cJf xz_package.tar bin* (使用xz技術) ``` #### :+1: **解壓縮** 安裝套件 ```= sudo apt-get install zip unzip ``` 建立資料夾,解壓縮至資料夾 ```= mkdir unzip_folder unzip gzip_package.zip -d unzip_folder ``` 練習 ```= wget {網址} (下載檔案) unzip Daily_2023_09_24.zip -d ./ (解壓縮檔案) less Daily_2023_09_24.csv (查看檔案) grep TX Daily_2023_09_24.csv | less (搜尋關於TX) grep ,TX Daily_2023_09_24.csv | less (搜尋關於,TX) ``` #### :+1: **chmod命令 => 更改文件和目錄的權限** 所有人可讀,只允許文件擁有者寫入 ```= chmod 644 [example.txt] ``` 只允許文件擁有者讀 ```= chmod 400 [example.txt] ``` 只允許文件擁有者讀+寫入 ```= chmod 600 [example.txt] ``` >文件所有者(User)具有讀取和寫入權限(rw-) >所屬組(Group)沒有權限(---) >其他用戶(Others)沒有權限(---) folder下所有文件,只允許文件擁有者讀+寫入 ```= chmod -R 700 myfolder ``` 只允許文件擁有者讀+寫入+執行 ```= chmod 771 [script.sh] ``` >文件所有者(User)具有讀取、寫入和執行權限(rwx)。 >所屬組(Group)具有讀取、寫入和執行權限(rwx)。 >其他用戶(Others)具有讀取和執行權限(r-x) #### :+1: **查詢登入紀錄** ```= last -5 查詢登入紀錄 (最近五筆) last -5 <username> 查詢登入紀錄 (特定使用者) last -s -7dyas 查詢登入紀錄 (七天內) ``` #### :+1: **查看用戶訊息** ```= w (查看目前登入的用戶訊息) w <username> (查看指定的登入紀錄、詳細訊息) sudo cat /etc/passwd (查看所有用戶的登入紀錄、詳細訊息) ``` #### :+1: **移動檔案** ```= mv my_file ../ (到上一層) ``` <br/> ## 設置 mysql(MariaDB) [參考](https://developer.aliyun.com/article/758177) #### :+1: **前面安裝好了,直接啟動** ```= sudo systemctl start mariadb ``` >查看狀態: sudo systemctl status mariadb >開機時直接啟動: sudo systemctl enable mariadb #### :+1: **切換到MariaDB(mysql)** ```= sudo mysql -uroot -p ``` #### :+1: **更改root密碼** ```= ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; ``` #### :+1: **創建使用者、使用者密碼** ```= CREATE USER 'username' IDENTIFIED BY 'password'; ``` #### :+1: **給予用戶權限** ```= GRANT ALL PRIVILEGES ON *.* TO 'username'@'%'; (所有權限) GRANT SELECT, INSERT ON mydb.* TO 'username'@'%'; select Host,User,authentication_string from mysql.user (查詢權限) ``` >ALL PRIVILEGES:執行所有操作 >SELECT:檢索數據。 >INSERT:插入新數據 >UPDATE:更新數據 >DELETE:刪除數據 >CREATE:創建新數據庫和表 >DROP:刪除數據庫和表 >ALTER:更改表結構 >GRANT OPTION:將其擁有的權限授予其他用戶 >SHOW DATABASES:查看可用的數據庫列表 >SHOW TABLES:查看特定數據庫中的表列表 >CREATE USER:創建新用戶 >SUPER:root權限 >REPLICATION CLIENT:複製客戶端狀態 >REPLICATION SLAVE:複製伺服器 >FILE:讀取和寫入系統文件 >PROCESS:查看所有正在運行的進度 >SHUTDOWN:關閉數據庫服務器 >CREATE TEMPORARY TABLES:創建臨時表 >LOCK TABLES:鎖定表,防止其他用戶對表進行更改 >EXECUTE:執行存儲過程 >REFERENCES:引用外鍵 >CREATE ROUTINE:創建儲存過程和函數 >ALTER ROUTINE:更改儲存過程和函數 >EVENT:創建和管理事件 >TRIGGER:創建觸發器 #### :+1: **如果用AWS/GCP要外部連線** 下載 putty gen ,輸入主機的外部IP產金鑰,再到AWS/GCP設定金鑰即可 直接看網友文章補充~ :::spoiler [[教學] 使用 PuTTYgen 產生 SSH 連線 RSA、DSA 公鑰與私鑰](http://www.techcoke.com/2017/01/puttygen-ssh-rsa-dsa-public-private-key-pair.html) ::: <br/> ## 設置 MongoDB [參考]([https://developer.aliyun.com/article/758177](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/)) #### :+1: **前面安裝好了,直接啟動** ```= sudo systemctl start mongodb ``` >查看狀態: sudo systemctl status mongodb >開機時直接啟動: sudo systemctl enable mongodb #### :+1: **切換到MongoDB** ```= mongo --username your_username --password your_password --authenticationDatabase admin ``` #### :+1: **創建使用者、使用者密碼** ```= mongo use admin db.createUser( { user: "root", pwd: "your_root_password", roles: [ { role: "root", db: "admin" } ] } ) ``` #### :+1: **給予用戶權限** ```= db.grantRolesToUser("catalina", [ { role: "read", db: "mydb" }, { role: "readWrite", db: "mydb" } ]) ``` >read: 讀取操作(find)。 >readWrite: 讀取+寫入操作(find、insert、update、remove) >dbAdmin: 在指定數據庫上執行管理操作,如索引、查看統計信息等 >dbOwner: 在指定數據庫上執行任何操作,類似於root權限 >userAdmin: 可以管理數據庫中的用戶,如創建和刪除用戶、更改用戶密碼 >clusterAdmin: 執行集群級別的操作,如復制集和分片集群的管理 >backup: 備份數據庫 >restore: 執行恢復數據庫 >changeStream: 使用 changeStreams 監控數據庫的變化 >readAnyDatabase: 在任何數據庫上執行讀取操作 >readWriteAnyDatabase: 在任何數據庫上執行讀取和寫入操作 >userAdminAnyDatabase: 在任何數據庫上管理用戶 >dbAdminAnyDatabase: 在任何數據庫上執行管理操作 >clusterManager: 具有集群管理權限 >restoreAnyDatabase: 恢復任何數據庫 <br/> ``` 比較 use admin // 創建用戶並為其分配 restore 角色(僅限於 mydb 資料庫) db.createUser({ user: "backupuser", pwd: "backupuser_password", roles: [ { role: "restore", db: "mydb" } ] }) ------------------------------------------------------------- use admin // 創建用戶並為其分配 restoreAnyDatabase 角色(允許在任何資料庫上執行恢復操作) db.createUser({ user: "adminuser", pwd: "adminuser_password", roles: [ { role: "restoreAnyDatabase", db: "admin" } ] }) ``` #### :+1: **更改密碼** ```= db.changeUserPassword("root", "new_password") db.auth("root", "new_password") (確認是否更改成功) ``` <br/> ## **設置 Apache2、PHP、NOIP** #### :+1: **Apache2: 配置Web 服務器** 安裝、啟動 ```= sudo apt update sudo apt install apache2 sudo service apache2 start ``` #### :+1: **PHP 安裝、啟動** ```= sudo apt install php ``` Apache 讀 css/js/php 檔要改文件 ```= /etc/apache2/httpd.conf or /etc/apache2/apache2.conf ``` ![](https://hackmd.io/_uploads/SJl8vMxyp.png) 改好後重啟 ```= sudo systemctl restart apache2 ``` #### :+1: **NOIP:設置個人化網址 [參考](https://www.jmjc.tech/article/14)** 安裝、啟動 [註冊NOIP](https://www.noip.com/) 安裝客戶端 ```= apt install make apt install make gcc ``` 建立NOIP資料夾 ```= cd ~ mkdir noip cd noip ``` 下載、解壓縮、安裝客戶端 ```= wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz tar vzxf noip-duc-linux.tar.gz cd noip-2.1.9-1 sudo make sudo make install ``` 會遇到詢問 ```= Do you wish to run something at successful update? 回答 [N] (y/N) 如果成功,會設置新的no-ip2.conf ,查看 sudo vim /usr/local/etc/no-ip2.conf 文件 ``` 啟動NOIP ```= sudo /usr/local/bin/noip2 sudo /usr/local/bin/noip2 -S (查看啟動後狀態) ``` 設置開機自動啟動NOIP ```= sudo crontab -e 最後一行加:@reboot /usr/local/bin/noip2 (如果是本機機台,每次開機都要執行一次sudo /usr/local/bin/noip2,因此設開機自動執行) ``` 關閉NOIP ```= sudo killall noip2 ``` 確認是否綁定IP成功 ```= ping -no-ip hostnanme ``` 設置動態DNS設定檔 ```= sudo apt install ddclient sudo vi /etc/ddclient.conf (進設定檔後,protocol=dyndns2 use=web, web=checkip.dyndns.com, web-skip='[NOIP設置的網址,0000.ddns.net]' server=members.dyndns.org login=group_3 password='[NOIP設置的密碼]') ``` 啟動DNS ```= sudo systemctl start ddclient ``` 如果換NOIP網址,要重新配置 NO-IP、改DNS設定檔 ```= sudo /usr/local/bin/noip2 -C sudo systemctl start ddclient ``` #### :+1: **放置 Web code 到指定位置** 以上都完成後,html/css/js 或 php 檔案放到指定位置就能成功配置了 ```= /var/www/html/index.html ``` <br/> ## **設置 NFS、SAMBA** #### **:+1: NFS: 讓遠端機台使用者們可以共享特定資料夾 [參考1](https://magiclen.org/ubuntu-server-nfs/) [參考2](https://officeguide.cc/linux-nfs-server-client-installation-configuration-tutorial-examples/)** 加載、安裝NFS ```= sudo modprobe nfs sudo modprobe nfsd sudo apt install nfs-kernel-server sudo apt-get install rpcbind ``` 啟動NFS ```= sudo systemctl start rpcbind ``` 查看狀態 ```= sudo systemctl status rpcbind ``` 查看監聽極端口 ```= sudo netstat -tulnp | grep rpc.mountd sudo netstat -tuln | grep :2049 ``` 設置防火牆 ```= sudo ufw allow from [your ip] to any port nfs ``` 設置共享資料夾及權限 ```= /home/share/ 140.137.219.56(rw,sync,no_subtree_check,crossmnt,fsid) 140.137.219.0/24(ro,sync,no_subtree_check) (ro 只讀,rw 讀寫權限) sudo exportfs -r ``` 掛載在指定的資料夾 ```= sudo mount -t nfs ip:<分享位置> <掛載位置> sudo mount -t nfs [your ip]:/home/NFS/ /home/catalina/nfs_share/ ``` 掛載成功後,可以直接使用putty連線 ```= cd /home/catalina/nfs_share ``` <br/> #### **:+1: SAMBA: 用於在不同操作系統之間(Linux/Unix系統與Windows系統)文件共享 [參考](https://hollyqood.wordpress.com/2016/12/08/virtualbox%E8%99%9B%E6%93%AC%E6%A9%9Fubuntu%E4%BD%BF%E7%94%A8samba%E5%9C%96%E6%96%87%E6%95%99%E5%AD%B8/)** 安裝SAMBA ```= sudo apt-get install samba ``` 更改設定檔 ```= sudo gedit /etc/samba/smb.conf 第一個 [global],加上 workgroup =WORKGROUP 也可以加上,可以使用Symbolic Links及禁用Unix文件 wide links = yes follow symlinks = yes unix extensions = no 第二個 [設置要分享資料夾的名稱] comment = Share path = /home/share read only = no writable = yes browseable= yes create mask = 777 directory mask = 777 valid users = username ``` 重啟 ```= sudo /etc/init.d/smbd restart ``` 查看虛擬機IP ```= ifconfig ``` 本機端電腦 ![](https://hackmd.io/_uploads/By759Xxka.png) ![](https://hackmd.io/_uploads/SJ_Y5Qg1p.png) 安裝smbclient連線 ```= sudo apt install smbclient ``` 設帳號密碼 ```= sudo smbpasswd -a <username> ``` 使用smbclient,連接到Samba共享 ```= smbclient //[your ip]/share -U <user> ``` 掛載Samba,共享到本地目錄 ```= smbclient//<ip>/<share fold> -U <user> [SAMBA] : 密碼,英文名 ``` 掛載位置 ```= sudo mount -t cifs //140.137.219.94/share /home/ivy/share -o username=ivy,password=ivy ``` 設置防火牆,不影響samba執行 ```= sudo ufw allow Samba sudo ufw status sudo ufw disable sudo ufw status ``` 重啟 ```= sudo /etc/init.d/smbd restart ``` 查看狀態 ```= systemctl status smbd (/home) ``` 查看設定檔 ```= sudo testparm (/home/share) ```

    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