ivan tsai
    • 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
    # 快速配置方法 主要使用 docker 配置,按照官方步驟可以使用 docker image 或是更進階一點的使用 docker-compose 1). 安裝 docker === 在 linux 中執行以下命令,安裝docker ``` apt-get install docker.io ``` 可以使用 ```docker info``` 查看目前 docker 資訊與版本 >Note > >docker 通常會要求 sudo 權限 >可以透過以下方法來配置 >1. ```sudo groupadd docker``` >2. ```sudo gpasswd -a ${USER} docker``` 將當前user加入docker群組 >3. ```sudo systemctl restart docker``` 重新啟動docker(其餘系統可能會影響,須注意) >4. ```sudo chmod a+rw /var/run/docker.sock``` 增加訪問和執行權限 2). docker-compose === 在 linux 中執行以下指令,安裝 docker-compose 其中```1.24.1```為版本號碼 ``` curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose ``` >note >若未安裝curl套件可以利用以下方法安裝 >``` >apt-get install curl >``` 安裝完畢後需要給 docker-compose 一些權限 ``` chmod +x /usr/local/bin/docker-compose ``` 3.) cgroup配置 === 因為```judgehost```需要cgroup功能所以需要到host```/etc/default/grub```此檔案 將其內容做以下更改 ``` GRUB_CMDLINE_LINUX_DEFAULT="quiet cgroup_enable=memory swapaccount=1" ``` 4.) docker-compose快速配置方法(使用官方image) === 在工作目錄底下,建立檔案<font color="#f00">```filename.yaml(有掛volume)```</font> 內容包含以下程式碼(以 domjudge:7.2.0 為範例): ```clike= version: "3" volumes: dj-domserver720: #mount direction或是已存在資料的volume services: # 資料庫會根據配置domjudge的版本不同而有不同版本的需求,可以根據自己的配置而更改,此範例使用 mariadb:10.5.7 dj-mariadb720: image: mariadb:10.5.7 environment: # 資料庫密碼等設定 - MYSQL_ROOT_PASSWORD=rootpw - MYSQL_DATABASE=domjudge - MYSQL_USER=domjudge - MYSQL_PASSWORD=djpw networks: #配置網路 - dj-db720 ports: # 定義本機port與container間的對應關係host:container - 13312:3312 command: # 完成此image設定後要執行的指令,這裡將連線數增加為1000 --max-connections=1000 dj-domserver720: # domjudge 主要執行的地方,可以根據需求選擇不同版本的 domjudge image 檔 image: domjudge/domserver:7.2.0 volumes: # mount cgroup 與主要工作目錄位置 - /sys/fs/cgroup:/sys/fs/cgroup:ro - your_work_dir/domjudge_edu/opt/domjudge:/opt/domjudge environment: # 環境設定:時區/資料庫基本資料 - CONTAINER_TIMEZONE=Asia/Taipei - MYSQL_ROOT_PASSWORD=rootpw - MYSQL_DATABASE=domjudge - MYSQL_USER=domjudge - MYSQL_PASSWORD=djpw networks: # 所連結到的網路(database/judgehost) dj-db720: dj-judgedaemons720: depends_on: # 依賴的services,需先等依賴的目標建置好後才會建置此 image 檔 - phpmyadmin720 - dj-mariadb720 ports: - 9292:80 links: # 可以存取 link 到的 services - dj-mariadb720:mariadb restart: always # 自動重啟 dj-judgehost720: #judgehost主要執行的地方,版本需與domserver相同 image: domjudge/judgehost:7.2.0 privileged: true #給予root權限 container_name: judgedaemon-720 volumes: #將container內容mount到host工作目錄 - /sys/fs/cgroup:/sys/fs/cgroup:ro - /your_work_dir/judgehost720:/opt/domjudge environment: # 基本參數設定 - CONTAINER_TIMEZONE=Asia/Taipei - DAEMON_ID=0 - JUDGEDAEMON_PASSWORD=uWttAwgXaAhH6G7W networks: # 配置網路 - dj-judgedaemons720 depends_on: # 依賴於domserver,domserver啟動好後才會執行judgehost的image - dj-domserver720 links: # 透過此網路連結到domserver - dj-domserver720:domserver restart: always # 開機時重新啟動 phpmyadmin720: image: phpmyadmin/phpmyadmin container_name: myadmin720 ports: - 9992:80 networks: - dj-db720 environment: - PMA_ARBITRARY=1 - PMA_HOST=dj-mariadb720 links: - dj-mariadb720:db networks: # 定義網路連結方式 default: dj-db720: # 允許連接到同一橋接網絡的容器進行通信,並隔絕其他容器的網路連線 driver: bridge dj-judgedaemons720: driver: bridge phpmyadmin720: driver: bridge ``` 從 github pull 修改過的 domjudge 與 judgehost 內容到工作目錄底下 <font color="#f00">```git clone https://github.com/ivantsai62/domjudge_edu.git```</font> <font color="#f00">```git clone https://github.com/ivantsai62/judgehost720.git```</font> 透過docker-compose一鍵建立mariaDB, domserver, judgehost, phpmyadmin <font color="#f00">```docker-compose -f filename.yaml -p your_project_name up```</font> 架好後會有 admin 預設密碼顯示在 terminal 中,會如以下畫面: ![](https://i.imgur.com/VnIIhbT.png) 或是到<font color="#f00">```domserver/etc/initial_admin_password.secret```</font>查看 admin 預設密碼 *即可以開始使用!* >Note > >在 container 上掛 volume,好處是可以讓多個 container 對應到同一>個volume且為實體。 >即使 container 消失,volume 內的實體內容也不會直接消失不見,且可以直接修改內容,不用進到 container 內做修改。 <br>

    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