台大經濟統計資料研究中心 NTU Econ Stat Data Research Center
    • 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 No publishing access yet

      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.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      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
    • Make a copy
    • 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 Make a copy 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 No publishing access yet

    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.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    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
    # User Guide - NTU BDSRC EDU System :::info - If you encounter any problem, please contact ntubdsrc@ntu.edu.tw - Change your password as soon as you log into the system. (Check out the User Setup section) ::: :::danger Do not modify any other file except it is in your folder. ::: ## Overview ### What is a terminal? Terminal is a text-based interface allowing us to interact with the operating system. We can perform any task without using the graphical interface, that colorful desktop you usually see on the screen. Different OS provides different name for terminal, you can find it with the following names: - **macOS**: terminal.app - **windows**: PowerShell, CMD - **Linux**: Terminal (right click to open if you are accessing through the desktop) ### How to Access the computing resource? There are 3 servers you can access in total (node01 is not avaliable to use currently). You can access all the EDU server via the IP address `140.112.176.246`. With this address, you will connect to `master` server by default. To access other servers, you need to specify which port you want to connect to. :::info - **Local machine**: The computers you have on hand. - **Remote machine**: The servers you access via the Internet. ::: ![image](https://hackmd.io/_uploads/SyJv83rjgx.png) ## SSH Connection SSH is a remote access protocol that allows you to connect any remote device with terminal. The problem with this method is that it does not provide graphical interface like Desktop in Windows. ```shell # In your terminal: ## SSH Syntax (for accessing master) ssh <username>@140.112.176.246 -p 2211 ## If the terminal keeps yielding some weird failing messages that do not affect the connection ssh -o LogLevel=ERROR <username>@140.112.176.246 -p 2211 ``` :::info ***After you have connected to master***, you can further access to other node if you notice that there are to much user using the same node (your program may run slower than expected). ```shell # In your terminal: (notice that you have to connect to master first) ## connect to node02 ssh node02 ## connect to node03 ssh node03 ``` ::: To end the SSH connection, you can type `exit` or use `ctrl-D` or `ctrl-C` ## User Setup ### Change Password Use `ldappasswd -x -H ldap://192.168.0.11:389 -D "uid=<username>,ou=Student,ou=<KEYWORD>,ou=Courses,dc=BDSRC,dc=edu" -W -S` command and enter the current password to change it. (where <KEYWORD> will be provided to teachers of your courses) :::danger ***Only change your password from "master"*** ::: ### Some Utilities There are several softwares you can launch on the terminal of the server. ```shell # Stata17 /homes/source/stata/stata # Stata19 (new version) /homes/source/stata19/stata # Stata19 (new version, large data) /homes/source/stata19/stata-se # Python python3 <filename>.py # Julia julia #R R ``` To start up the GUI (Graphical User Interface) version, make sure you have install X server in you computer: * Linux: usually already installed X server * Mac: install XQuartz * Windows: it is recommanded to install Mobaxterm as a terminal, since it include X server and remote file system (here is a tutorial for mobaXterm: https://blog.csdn.net/qq_44074697/article/details/118544904)![image](https://hackmd.io/_uploads/r1zE12Pixe.png) , or you have to install [VcXsrv](https://blog.csdn.net/luohaitao/article/details/147120849) ```shell # before using the gui version use "-X" to activate X server at local side ssh -X <username>@140.112.176.246 -p 2211 ssh -X node02 # Stata17/IC 2GB memory limited /homes/source/stata/xstata # Stata19/IC 2GB memory limited (new version) /homes/source/stata19/xstata # Stata19 (new version, large data) /homes/source/stata19/xstata-se ``` ### File Access Control :::danger Your files might be visible to others. To prevent this, you need to set up access control. However, if your data isn't sensitive, you can choose to ignore this. ::: 3 types of Permission: `r`(read), `w`(write), `x`(execute) #### Checking File Permissions ```shell # Example ls -l test.txt # Output -rw-rw-r-- 1 ryan ryan 0 九 2 14:58 test.txt # or you can use `getfacl` getfacl <filename> ``` For example a file's permission is `-rw-rw-r--`, you can interpret it as: - Is it a directory: `-` (it will be `d` if it's a directory) - Owner: `rw-` (you can read and write) - Group: `rw-` (people in your group can read and write) - Others: `r--` (people outside of your group can only read) :::info `rw-` can be translated into `110`, which is `6` in decimal value. So the permission of the example above can be represented as `660`. If you want to set the permission as `rwxr-x---`, you can simply type: ```shell chmod 750 <filename> ``` ::: #### Modify File Permission ```shell # Syntax chmod <setting> <target name> # Example: add execute permission for yourself. chmod u+x <filename> # Example: Take away other's rwx permission chmod o-rwx <filename> ``` #### Modify Directory Permission ```shell # Syntax chmod -R <your setting> <dir name> ``` :::info `u`: you `o`: others `g`: users in your group `+`: add `-`: remove `=`: assign ::: #### Group Control You might want to share files and directories with your project members. For convenience, you can ask us to create a group for your project by submitting the application https://forms.gle/6Ro9YciS68czZi5E9 ##### Group Basics ```shell # show all the groups you are in groups # You might want to switch between the groups # when you create a new file newgrp <group name> # Type exit when finishing your operation for that group exit ``` If you are the owner of a group, you can add/delete the group member at your own will: ```shell # add user gpasswd -a <username> <group name> # delete user gpasswd -d <username> <group name> ``` #### Further info on File Permission - https://www.redhat.com/sysadmin/linux-file-permissions-explained - https://www.geeksforgeeks.org/how-to-set-file-permissions-in-linux/ ## VS Code Remote Editing You might not want to transfer your file to the remote server every time you modify your codes in your local machine. Therefore, directly editing the files on the remote server through VS Code can be super convenient. Can go to [VScode official website](https://code.visualstudio.com/download) to download the package that is suitable to your operation system 1. Install extension *"Remote Development"*, *"Remote - SSH"* and "*Remote Explorer*" ![Screenshot 2024-09-02 at 15.54.29](https://hackmd.io/_uploads/S1gLygX2R.png) 2. Open a remote window ![Screenshot 2024-09-02 at 15.56.02](https://hackmd.io/_uploads/HJMbxlXhC.png) 3. Connect to Host ![Screenshot 2024-09-02 at 15.58.27](https://hackmd.io/_uploads/rknwgg7nC.png) 4. Add new SSH host > Configure SSH Hosts ![Screenshot 2024-09-02 at 16.05.54](https://hackmd.io/_uploads/HyxNGxQhC.png) 5. Choose which file you want to save the configuration (you can choose the first one that appears) ![Screenshot 2024-09-02 at 16.02.31](https://hackmd.io/_uploads/HyTufgXh0.png) 6. Edit the configuration ```shell # Format for master Host <master name (Whatever you like)> HostName 140.112.176.246 User <your user name> Port 2211 # Format for other nodes Host <node name (Whatever you like)> HostName node02 User <your user name> ProxyJump <master name> ``` ![image](https://hackmd.io/_uploads/rkxZ0hHige.png) 7. Establish Connection ![Screenshot 2024-09-02 at 16.15.00](https://hackmd.io/_uploads/rkd6EeQ3R.png) 8. First time for your connection (choose Linux) ![image](https://hackmd.io/_uploads/HyLXkpSsgx.png) 9. type your password ![image](https://hackmd.io/_uploads/B1nLkarsll.png) 10. open your file system ![image](https://hackmd.io/_uploads/SJQqyTHolg.png) 11. When you are using jupyter notebook (.ipynb file), make sure you select correct kernel to compile your code. ![image](https://hackmd.io/_uploads/rJhegTSogg.png) :::info for the first time you click select kernel, you have to install the extension first. ![image](https://hackmd.io/_uploads/HkZjl6riel.png) ![image](https://hackmd.io/_uploads/H11AlTBile.png) or ![image](https://hackmd.io/_uploads/S1keL2Dsxl.png) and install extension for python ![image](https://hackmd.io/_uploads/rkFG8hvixl.png) if you want to use python. Before using julia, type ``` /opt/julia-1.10.5/bin/julia -e 'using Pkg; Pkg.add("IJulia")' ``` on your terminal to install the needed package. ::: ![image](https://hackmd.io/_uploads/BJSXgpBjgl.png) ![image](https://hackmd.io/_uploads/HkEGl6rixe.png) 12. happy coding! ![image](https://hackmd.io/_uploads/SkPHg6roll.png) :::info you can install the package you want in the jupyter notebook cell by * Python:typing `!pip install <package name>` * Julia:typing `using Pkg; Pkg.add("<package name>")` * R:typing `install.packages("<package name>")` and run them. ::: ## Basic Linux Guide https://www.geeksforgeeks.org/linux-tutorial/

    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
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    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