diff --git a/members/MakiSonomura/notes/CLI.md b/members/MakiSonomura/notes/CLI.md new file mode 100644 index 0000000..34f9ca6 --- /dev/null +++ b/members/MakiSonomura/notes/CLI.md @@ -0,0 +1,531 @@ +# CLI + + +## Linux/Unix + + + +### 1. **File Management** + +- **`cp` (Copy)**: Copies files or directories. + ```bash + cp source_file destination_file + cp -r source_directory destination_directory # For directories + ``` + +- **`mv` (Move/Rename)**: Moves files or directories. Also used for renaming. + ```bash + mv old_file new_file + mv file /path/to/new_location/ + ``` + +- **`rm` (Remove)**: Deletes files or directories. + ```bash + rm file_name + rm -r directory_name # Use with caution, as it deletes recursively! + ``` + +- **`mkdir` (Make Directory)**: Creates a new directory. + ```bash + mkdir new_directory + ``` + +--- + +### 2. **System Monitoring** + +- **`top`**: Shows a live view of processes, including CPU and memory usage. + ```bash + top + ``` + +- **`ps` (Process Status)**: Lists active processes. Used with options to see detailed info. + ```bash + ps aux # Lists all processes with detailed information + ``` + +- **`df` (Disk Free)**: Shows the amount of disk space available on the filesystem. + ```bash + df -h # "-h" for human-readable output, like GB or MB + ``` + +- **`free`**: Displays memory usage, showing free and used memory. + ```bash + free -h # "-h" for human-readable format + ``` + +--- + +### 3. **Networking** + +- **`ping`**: Sends packets to check connectivity with a network or internet host. + ```bash + ping example.com + ``` + +- **`netstat` (Network Statistics)**: Displays network connections, routing tables, and network interfaces. + ```bash + netstat -a # Shows all active connections + ``` + +- **`curl`**: Transfers data from or to a server. Often used to test APIs or download files. + ```bash + curl https://example.com + ``` + +- **`iptables`**: Configures the Linux kernel firewall. + ```bash + sudo iptables -L # Lists current firewall rules + ``` + +--- + +### 4. **Software Installation and Updates** + +- **`apt`** (Debian-based systems): Manages packages on distributions like Ubuntu or Debian. + ```bash + sudo apt update # Updates the package list + sudo apt install package # Installs a package + ``` + +- **`yum`** (Red Hat-based systems): Package manager for Red Hat, CentOS, etc. + ```bash + sudo yum install package # Installs a package + ``` + +- **`dnf`** (Newer Red Hat-based systems): Replaces `yum` in Fedora and newer Red Hat versions. + ```bash + sudo dnf install package # Installs a package + ``` + +--- + +### 5. **Automation and Scripting** + +Shell scripting uses commands and logic within a script (usually Bash) to automate tasks. Here’s a simple example: + +```bash +#!/bin/bash +# Script to check if a directory exists + +DIR="/path/to/directory" +if [ -d "$DIR" ]; then + echo "Directory exists." +else + echo "Directory does not exist." +fi +``` +Certainly! Here’s a further list of commonly used Linux commands, with explanations and examples: + +--- + +### 6. **File Viewing and Searching** + +- **`cat` (Concatenate)**: Displays the contents of a file. + ```bash + cat file_name + ``` + +- **`less`**: Opens a file in a scrollable view, useful for reading long files. + ```bash + less file_name + ``` + +- **`grep`**: Searches for a pattern in a file or output. + ```bash + grep "search_term" file_name + ``` + +- **`find`**: Finds files or directories by name, type, or other attributes. + ```bash + find /path -name "file_name" + ``` + +- **`locate`**: Searches for files in the system (uses a database, so it’s faster than `find`). + ```bash + locate file_name + ``` + +--- + +### 7. **File Compression and Archiving** + +- **`tar`**: Archives multiple files into a single file (often `.tar`, `.tar.gz`, or `.tgz`). + ```bash + tar -czvf archive_name.tar.gz /path/to/directory # Creates a compressed archive + tar -xzvf archive_name.tar.gz # Extracts an archive + ``` + +- **`gzip`**: Compresses a single file. + ```bash + gzip file_name # Compresses to file_name.gz + gunzip file_name.gz # Decompresses + ``` + +- **`zip` and `unzip`**: Compresses and decompresses files into `.zip` format. + ```bash + zip archive_name.zip file1 file2 + unzip archive_name.zip + ``` + +--- + +### 8. **User Management** + +- **`adduser`**: Creates a new user. + ```bash + sudo adduser new_username + ``` + +- **`deluser`**: Deletes a user. + ```bash + sudo deluser username + ``` + +- **`passwd`**: Changes the password for a user. + ```bash + sudo passwd username + ``` + +- **`usermod`**: Modifies a user account, like adding to groups. + ```bash + sudo usermod -aG groupname username + ``` + +--- + +### 9. **Permissions and Ownership** + +- **`chmod`**: Changes the permissions of a file or directory. + ```bash + chmod 755 file_name # rwxr-xr-x permissions + ``` + +- **`chown`**: Changes the ownership of a file or directory. + ```bash + sudo chown username:groupname file_name + ``` + +--- + +### 10. **Text Manipulation** + +- **`echo`**: Outputs text to the terminal or a file. + ```bash + echo "Hello, world!" + echo "Text" > file_name # Writes text to file + ``` + +- **`awk`**: A powerful text processing tool used for pattern scanning and processing. + ```bash + awk '{print $1}' file_name # Prints the first column of each line + ``` + +- **`sed`**: Stream editor for editing files or streams of text, often used for substitutions. + ```bash + sed 's/old_text/new_text/g' file_name # Replaces 'old_text' with 'new_text' + ``` + +--- + +### 11. **Networking and Connections** + +- **`wget`**: Downloads files from the internet. + ```bash + wget https://example.com/file.zip + ``` + +- **`scp` (Secure Copy)**: Copies files over SSH to/from remote servers. + ```bash + scp file_name username@remote_host:/path/to/destination + ``` + +- **`ssh` (Secure Shell)**: Connects to remote servers over SSH. + ```bash + ssh username@remote_host + ``` + +--- + +### 12. **System Information** + +- **`uname`**: Displays system information. + ```bash + uname -a # Shows all system information + ``` + +- **`hostname`**: Displays or sets the hostname. + ```bash + hostname # Displays the current hostname + ``` + +- **`uptime`**: Shows how long the system has been running. + ```bash + uptime + ``` + +--- + +### 13. **Disk and File System Utilities** + +- **`mount`**: Mounts a filesystem to a specified directory. + ```bash + sudo mount /dev/sdX /mnt/point + ``` + +- **`umount`**: Unmounts a filesystem from a directory. + ```bash + sudo umount /mnt/point + ``` + +- **`fsck` (File System Check)**: Checks and repairs a filesystem. + ```bash + sudo fsck /dev/sdX + ``` + +--- + +### 14. **Date and Time Management** + +- **`date`**: Displays or sets the system date and time. + ```bash + date # Shows current date and time + ``` + +- **`cal`**: Displays a calendar for a specified month or year. + ```bash + cal 2024 # Shows the calendar for the year 2024 + ``` + +--- + +### 15. **Process Management** + +- **`kill`**: Terminates a process by ID. + ```bash + kill process_id + ``` + +- **`pkill`**: Kills processes by name. + ```bash + pkill process_name + ``` + +- **`killall`**: Kills all instances of a process. + ```bash + killall process_name + ``` + +--- + + +## Windows + +### Prerequisite + +`Windows Terminal` is a new terminal emulator that lets you run PowerShell, Command Prompt, Azure, or WSL. I recommend installing it! If you'd like installation instructions, check out the next note. + + + +### 1. **File Management** + +- **`dir`**: Lists files and directories in the current directory. + ```cmd + dir + ``` + +- **`copy`**: Copies files from one location to another. + ```cmd + copy source_file destination_file + ``` + +- **`move`**: Moves files from one location to another. Can also be used for renaming. + ```cmd + move old_file new_file + ``` + +- **`del`**: Deletes files. + ```cmd + del file_name + ``` + +- **`mkdir`**: Creates a new directory. + ```cmd + mkdir new_directory + ``` + +- **`rmdir`**: Removes an empty directory. Use `/s` to remove directories and their contents. + ```cmd + rmdir directory_name /s + ``` + +--- + +### 2. **System Information** + +- **`systeminfo`**: Displays detailed information about the system, like OS version, memory, etc. + ```cmd + systeminfo + ``` + +- **`hostname`**: Shows the computer’s hostname. + ```cmd + hostname + ``` + +- **`tasklist`**: Lists all running processes. + ```cmd + tasklist + ``` + +- **`taskkill`**: Ends a running process by name or process ID. + ```cmd + taskkill /IM process_name.exe /F + ``` + +--- + +### 3. **Networking** + +- **`ipconfig`**: Shows network information, like IP address, subnet mask, and default gateway. + ```cmd + ipconfig + ``` + +- **`ping`**: Checks connectivity to another network device or internet host. + ```cmd + ping example.com + ``` + +- **`netstat`**: Displays active connections, routing tables, and network interface statistics. + ```cmd + netstat -a + ``` + +- **`tracert`**: Shows the route taken by packets to reach a destination. + ```cmd + tracert example.com + ``` + +- **`nslookup`**: Looks up DNS information for a domain. + ```cmd + nslookup example.com + ``` + +--- + +### 4. **User Management** + +- **`net user`**: Views or manages user accounts. + ```cmd + net user # Lists all users + net user username password /add # Adds a user with specified password + ``` + +- **`net localgroup`**: Views or manages local groups. + ```cmd + net localgroup administrators # Lists members of the Administrators group + ``` + +--- + +### 5. **File Permissions and Ownership** + +- **`icacls`**: Modifies file and folder permissions. + ```cmd + icacls "file_name" /grant username:F # Grants full access + ``` + +- **`attrib`**: Views or changes file attributes (like read-only, hidden). + ```cmd + attrib +r file_name # Makes a file read-only + ``` + +--- + +### 6. **File Compression and Archiving** + +- **`compact`**: Compresses files or displays the compression status of files. + ```cmd + compact /c file_name # Compresses the file + ``` + +- **`tar` (in Windows 10+ PowerShell)**: Creates or extracts tar archives. + ```powershell + tar -cvf archive_name.tar directory_path # Creates an archive + tar -xvf archive_name.tar # Extracts an archive + ``` + +--- + +### 7. **Text Manipulation** + +- **`echo`**: Displays messages or outputs text to a file. + ```cmd + echo Hello, world! + echo Text > file_name.txt # Writes "Text" to a file + ``` + +- **`findstr`**: Searches for text within files (similar to `grep` in Linux). + ```cmd + findstr "search_term" file_name.txt + ``` + +--- + +### 8. **System Configuration and Maintenance** + +- **`chkdsk`**: Checks for disk errors and repairs them. + ```cmd + chkdsk C: /f + ``` + +- **`sfc`**: Scans and repairs system files. + ```cmd + sfc /scannow + ``` + +- **`diskpart`**: Opens a disk partitioning tool (use with caution). + ```cmd + diskpart + ``` + +--- + +### 9. **PowerShell Specific Commands** + +- **`Get-Process`**: Lists all running processes (similar to `tasklist` in CMD). + ```powershell + Get-Process + ``` + +- **`Get-Service`**: Lists all services and their statuses. + ```powershell + Get-Service + ``` + +- **`Start-Process`**: Starts a process. + ```powershell + Start-Process "notepad.exe" + ``` + +- **`Stop-Process`**: Ends a process. + ```powershell + Stop-Process -Name "process_name" -Force + ``` + +--- + +### 10. **System Date and Time** + +- **`date`**: Displays or sets the system date. + ```cmd + date # Displays current date and prompts to change it + ``` + +- **`time`**: Displays or sets the system time. + ```cmd + time # Displays current time and prompts to change it + ``` + +--- diff --git a/members/MakiSonomura/notes/GIT.md b/members/MakiSonomura/notes/GIT.md new file mode 100644 index 0000000..6028edb --- /dev/null +++ b/members/MakiSonomura/notes/GIT.md @@ -0,0 +1,153 @@ +# Git + +**Git** is a free, open-source, distributed version control system that developers use to track changes in source code during software development. Created by Linus Torvalds in 2005, Git allows developers to collaborate on projects, maintain a history of code changes, and revert to previous versions if needed. It’s widely used in both small and large development projects, from personal coding projects to large-scale software development across multiple teams. + +Git’s distributed model allows every developer to have a local copy (or "clone") of the entire codebase, including its full history, so they can work offline and synchronize changes with a central repository when they’re ready. + +## Common Git Usage + +### 1. **Initial Setup** + ```bash + git config --global user.name "Your Name" + git config --global user.email "your_email@example.com" + ``` + Configures your name and email for commits. + +### 2. **Creating a Repository** + ```bash + git init + ``` + Initializes a new Git repository in the current directory. + +### 3. **Cloning a Repository** + ```bash + git clone + ``` + Creates a local copy of a remote repository. + +### 4. **Checking Repository Status** + ```bash + git status + ``` + Shows the current status of the working directory and staging area, such as modified, staged, or untracked files. + +### 5. **Adding Changes to Staging** + ```bash + git add # Add a specific file + git add . # Add all changes in the current directory + ``` + Moves files from the working directory to the staging area in preparation for a commit. + +### 6. **Committing Changes** + ```bash + git commit -m "Commit message here" + ``` + Saves the changes from the staging area to the repository with a descriptive message. + +### 7. **Viewing Commit History** + ```bash + git log + ``` + Shows a list of past commits, each with its unique commit ID, author, date, and message. + +### 8. **Pushing Changes to a Remote Repository** + ```bash + git push origin + ``` + Uploads local changes to a remote repository. + +### 9. **Pulling Changes from a Remote Repository** + ```bash + git pull origin + ``` + Downloads changes from a remote repository and merges them into the local branch. + +### 10. **Branching** + ```bash + git branch # Creates a new branch + git checkout # Switches to the specified branch + ``` + Branching allows developers to work on new features or fixes without disturbing the main codebase. + +### 11. **Merging Branches** + ```bash + git checkout + git merge + ``` + Combines changes from one branch into another. + +### 12. **Resolving Merge Conflicts** + If there are conflicts when merging, Git will indicate which files are in conflict. Open the files, manually resolve conflicts, then add and commit the resolved files. + +### 13. **Reverting Changes** + ```bash + git revert + ``` + Creates a new commit that undoes the changes of a previous commit, keeping history intact. + +### 14. **Undoing Local Changes** + ```bash + git checkout -- # Reverts uncommitted changes to the last commit + git reset # Unstages a file from the staging area + ``` + +### Summary + +Git commands are structured for tracking changes efficiently, making collaboration smoother, and giving full control over version history. Understanding and using these common commands will streamline your development workflow and make managing codebases more efficient. + + + + +### Typical Workflow with Git +Next I will introduce you to a typical Git workflow + + +### 1. **Fork the Repository** +1. Go to the repository you want to contribute to on GitHub. +2. Click on the **Fork** button at the top right of the page. This will create a copy of the repository in your own GitHub account. + +![alt text](assets/fork.png) + +### Step 2: **Clone the Forked Repository** +Download a local copy of your forked repository so you can start making changes: +```bash +git clone +cd +``` +![alt text](assets/clone.png) + +### Step 3: **Create a New Branch for Your Changes** +Create a branch to isolate your changes. Name it descriptively, such as +`member/helloworld` +```bash +git checkout -b +``` +### Step 4: **Make Changes Locally** +Make the necessary code changes or additions in your working directory. After making changes, check which files have been modified: +![alt text](assets/status.png) + +### Step 5: **Stage and Commit Your Changes** +Add the files you want to include in your commit: +```bash +git add # Add specific file +git add . # Add all changes in directory +``` +Then commit with a descriptive message: +```bash +git commit -m "Brief description of changes" +``` +![alt text](assets/commit.png) +### Step 6: **Push Your Branch to Your Fork on GitHub** +Push your branch to the forked repository on GitHub: +```bash +git push origin +``` +### Step 7: **Open a Pull Request (PR)** +- Go to your forked repository on GitHub. +- You should see an option to Compare & pull request for the recently pushed branch. Click on it. +- Add a descriptive title and a summary of your changes. +- Select the correct branch from the original repository (usually main or master) to compare against. +- Submit the Pull Request for review. +![alt text](assets/pr.png) +### Step 8: **Wait** +If the authors recognizes your post, just wait for them to merge it, otherwise you can keep modifying it until it's merged. \ No newline at end of file diff --git a/members/MakiSonomura/notes/IDE.md b/members/MakiSonomura/notes/IDE.md new file mode 100644 index 0000000..1fe82ec --- /dev/null +++ b/members/MakiSonomura/notes/IDE.md @@ -0,0 +1,63 @@ +# IDE and Environments + + +### 1. **Windows Terminal** + +If you're not planning to use `Windows`, feel free to skip this. However, we do recommend giving it a shot! Modern Windows versions have greatly enhanced development capabilities, moving past the stereotypes of older versions. You can find the tutorial on [Install Windows Terminal](https://learn.microsoft.com/en-us/windows/terminal/install) + +### 2. **Visual Studio Code** + + +You can find all installers on [Download Visual Studio Code](https://code.visualstudio.com/download) +#### Windows +![alt text](assets/vscode.png) + +#### Linux and macOS + + + + +### 3. **Install WSL** + +[Install Ubuntu on WSL2](https://documentation.ubuntu.com/wsl/en/latest/guides/install-ubuntu-wsl2/) + + + + +### 4. **Development Environment** + + + +#### 1. **Clang/LLVM** +If you don't intend to develop LLVM, it's sufficient to install a newer, more stable version. We recommend you to install it from LLVM's download page: [LLVM Debian/Ubuntu nightly packages](https://apt.llvm.org/) +```bash +# For convenience there is an automatic installation script available that installs LLVM for you. +To install the latest stable version: +bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" + +# To install a specific version of LLVM: +wget https://apt.llvm.org/llvm.sh +chmod +x llvm.sh +sudo ./llvm.sh +To install all apt.llvm.org packages at once: +wget https://apt.llvm.org/llvm.sh +chmod +x llvm.sh +sudo ./llvm.sh all +# or +sudo ./llvm.sh all + +``` +After installation, you can run +```bash +clang-${verison} -v +llvm-config-${version} --verion +``` +![alt text](assets/llvm.png) +#### 2. **Rust** +`Rustup` is the official toolchain version manager for managing versions and targets in your host. To install it and `Rust`, you can find [Install Rust](https://www.rust-lang.org/tools/install) + + +#### 3. **Sui** + +- The official guide to install `Sui`: [Install Sui](https://docs.sui.io/guides/developer/getting-started/sui-install) +- Similar to `Rustup`, I've developed `Suiup` to manage the versions of `Sui`, and you can try it out [here](https://github.com/MakiSonomura/suiup). After you install it successfully, you can see: ![alt text](assets/suiup.png) \ No newline at end of file diff --git a/members/MakiSonomura/notes/assets/clone.png b/members/MakiSonomura/notes/assets/clone.png new file mode 100644 index 0000000..6665f2a Binary files /dev/null and b/members/MakiSonomura/notes/assets/clone.png differ diff --git a/members/MakiSonomura/notes/assets/commit.png b/members/MakiSonomura/notes/assets/commit.png new file mode 100644 index 0000000..53f8ed1 Binary files /dev/null and b/members/MakiSonomura/notes/assets/commit.png differ diff --git a/members/MakiSonomura/notes/assets/fork.png b/members/MakiSonomura/notes/assets/fork.png new file mode 100644 index 0000000..f346cfd Binary files /dev/null and b/members/MakiSonomura/notes/assets/fork.png differ diff --git a/members/MakiSonomura/notes/assets/llvm.png b/members/MakiSonomura/notes/assets/llvm.png new file mode 100644 index 0000000..6f055c9 Binary files /dev/null and b/members/MakiSonomura/notes/assets/llvm.png differ diff --git a/members/MakiSonomura/notes/assets/pr.png b/members/MakiSonomura/notes/assets/pr.png new file mode 100644 index 0000000..5ca6dec Binary files /dev/null and b/members/MakiSonomura/notes/assets/pr.png differ diff --git a/members/MakiSonomura/notes/assets/status.png b/members/MakiSonomura/notes/assets/status.png new file mode 100644 index 0000000..b556b6c Binary files /dev/null and b/members/MakiSonomura/notes/assets/status.png differ diff --git a/members/MakiSonomura/notes/assets/suiup.png b/members/MakiSonomura/notes/assets/suiup.png new file mode 100644 index 0000000..d6d2a31 Binary files /dev/null and b/members/MakiSonomura/notes/assets/suiup.png differ diff --git a/members/MakiSonomura/notes/assets/vscode.png b/members/MakiSonomura/notes/assets/vscode.png new file mode 100644 index 0000000..9ca0713 Binary files /dev/null and b/members/MakiSonomura/notes/assets/vscode.png differ diff --git a/members/MakiSonomura/notes/readme.md b/members/MakiSonomura/notes/readme.md new file mode 100644 index 0000000..e69de29