Skip to content

Commit

Permalink
feat: upload codes to github page
Browse files Browse the repository at this point in the history
docs: modify Lecture0&1

Co-authored-by: MayGe <[email protected]>
Co-authored-by: hewo233 <[email protected]>
Co-authored-by: LRache <[email protected]>
  • Loading branch information
4 people committed Oct 12, 2024
1 parent e504d5f commit e46704f
Show file tree
Hide file tree
Showing 157 changed files with 2,811 additions and 652 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ jobs:
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: ${{ github.workspace }}/Lectures
path: |
${{ github.workspace }}/Lectures
${{ github.workspace }}/Others/Codes
index.html
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
23 changes: 23 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[submodule "ohmytmux"]
path = Tools/setup/config/.tmux
url = https://github.com/gpakosz/.tmux.git

[submodule "ohmyzsh"]
path = Tools/setup/pkg/ohmyzsh
url = https://github.com/ohmyzsh/ohmyzsh.git

[submodule "zsh-autosuggestions"]
path = Tools/setup/pkg/ohmyzsh/custom/plugins/zsh-autosuggestions
url = https://github.com/zsh-users/zsh-autosuggestions.git

[submodule "zsh-completions"]
path = Tools/setup/pkg/ohmyzsh/custom/plugins/zsh-completions
url = https://github.com/zsh-users/zsh-completions.git

[submodule "zsh-syntax-highlighting"]
path = Tools/setup/pkg/ohmyzsh/custom/plugins/zsh-syntax-highlighting
url = https://github.com/zsh-users/zsh-syntax-highlighting.git

[submodule "zsh-you-should-use"]
path = Tools/setup/pkg/ohmyzsh/custom/plugins/zsh-you-should-use
url = https://github.com/MichaelAquilina/zsh-you-should-use.git
486 changes: 320 additions & 166 deletions Lectures/Lecture0/Lecture0/index.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,302 changes: 818 additions & 484 deletions Lectures/Lecture1/Lecture1/index.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions Lectures/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ <h1>Welcome to NekoBytes-TheMissing</h1>
<ul>
<li><a href="Lecture0/Lecture0/index.html">Lecture 0</a></li>
<li><a href="Lecture1/Lecture1/index.html">Lecture 1</a></li>
<li><a href="Lecture2/Lecture2/index.html">Lecture 2</a></li>
<li><a href="Lecture3/Lecture3/index.html">Lecture 3</a></li>
<li><a href="Lecture4/Lecture4/index.html">Lecture 4</a></li>
<li><a href="Lecture5/Lecture5/index.html">Lecture 5</a></li>
<li><a href="Lecture6/Lecture6/index.html">Lecture 6</a></li>
<li><a href="Lecture7/Lecture7/index.html">Lecture 7</a></li>
<li><a href="Lecture8/Lecture8/index.html">Lecture 8</a></li>
<li><a href="Lecture9/Lecture9/index.html">Lecture 9</a></li>
</ul>
</body>

Expand Down
9 changes: 9 additions & 0 deletions Others/Codes/Lecture1/float.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <stdio.h>

int main(void) {
float a = 1.05;
int b = a * 100;
printf("%d\n", b);
printf("%.20f\n", a);
return 0;
}
9 changes: 9 additions & 0 deletions Others/Codes/Lecture1/hello-world.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <stdio.h>

int main(void) {
/* This is a long comment */
const int year = 2024;
// This is a short comment
printf("hello world %d!\n", year);
return 0;
}
13 changes: 13 additions & 0 deletions Others/Codes/Lecture1/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CC := gcc
CFLAGS := -Wall -Werror -Wpedantic -g -std=c11
TARGET := float hello-world

all: $(TARGET)

$(TARGET): %:%.c
$(CC) $(CFLAGS) -o $@ $<

clean:
-rm -rf $(TARGET)

.PHONY: all clean
19 changes: 19 additions & 0 deletions Others/Codes/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NekoBytes-TheMissing</title>
</head>

<body>
<h1>Welcome to NekoBytes-TheMissing</h1>
<p>Select a lecture below to get the code</p>
<ul>
<li><a href="Lecture1/">Lecture 1</a></li>
<li><a href="Lecture2/">Lecture 2</a></li>
</ul>
</body>

</html>
File renamed without changes.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ NekoBytes-TheMissing
├── Others/ // 其他杂项,比如辅助阅读资源、课程示例代码
```

## 项目说明
## 项目任务说明
对应模块的任务说明请**参考对应目录**下的 README 文档。
### Labs

课程实验,包含Linux、tools、C语言,每个实验都有对应的README文档提供指引。目录下实验为Linux环境下的`tar.gz`压缩格式。
Expand Down
Binary file removed Tools/setup.7z.001
Binary file not shown.
Binary file removed Tools/setup.7z.002
Binary file not shown.
Binary file removed Tools/setup.7z.003
Binary file not shown.
Binary file removed Tools/setup.7z.004
Binary file not shown.
Binary file removed Tools/setup.7z.005
Binary file not shown.
102 changes: 102 additions & 0 deletions Tools/setup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Setup Tool

这是一个用于初始化 Ubuntu 系统的 Bash 脚本,能够自动完成开发环境的安装与配置。脚本支持静默模式、卸载模式,并通过日志记录操作。

## 特性

- 自动更新系统及更换镜像源
- 支持安装常用编程工具和开发环境
- 安装并配置 `oh-my-zsh``oh-my-tmux`
- 支持 `unsnap` 并安装 `flatpak`
- 支持静默模式和卸载功能

## 使用方法

### 1. 克隆仓库获取工具

```bash
git clone https://github.com/E1PsyCongroo/NekoBytes-TheMissing.git
cd NekoBytes-TheMissing/Tools
tar xvf setup.tar.gz
```

### 2. 运行脚本

> [!INFO]
> WSL 请使用 common_wsl.sh
默认情况下,脚本将以详细模式运行,输出到终端并记录在一个日志文件中(文件名为当前日期)。

```bash
bash common.sh
```

你可以通过 --help 选项来查看可用的命令和参数。

```bash
bash common.sh --help
```

### 3. 可选参数

--help, -h: 显示帮助信息。
--quiet, -q: 以静默模式运行脚本(只输出错误信息到终端,标准输出记录到日志文件)。
--uninstall: 卸载脚本安装的软件和配置。

### 4. 示例

详细模式执行初始化

```bash
bash common.sh
```

静默模式执行初始化

```bash
bash common.sh --quiet
```

卸载安装的软件和配置

```bash
bash common.sh --uninstall
```

### 5. 日志记录

每次运行脚本,都会将输出日志保存在以当前日期命名的 .log 文件中。日志文件会记录脚本的每个操作步骤,便于排查问题。

```bash
# 日志文件示例
2023-09-15.log
```

## 脚本功能

1. 更新系统及安装 curl:
脚本会自动运行 apt update,并安装 curl 工具。
2. 更换 Ubuntu 镜像源:
通过执行 chsrc 脚本更换镜像源,提升软件包的下载速度。
3. 删除 Snap 并安装 Flatpak:
脚本将删除 Snap 并改用 Flatpak 安装 Firefox 和其他软件包。
4. 安装编程工具:
自动安装常用的开发工具和 CLI 工具,包括 build-essential, git, vim, tmux, zsh, tldr 等。
5. 安装并配置 Oh-My-Zsh:
将 oh-my-zsh 安装到用户的 home 目录,并切换默认 Shell 为 zsh。
6. 安装 Nerd Font 字体:
自动下载并安装 JetBrains Mono 字体以支持更多终端样式。
7. 配置 Oh-My-Tmux:
脚本会将 tmux 配置文件复制到用户目录,完成终端管理工具的设置。
8. 卸载功能:
支持卸载脚本安装的软件和配置,包括 oh-my-zsh、oh-my-tmux。

## 注意事项

- 该脚本需要 sudo 权限执行,以安装和卸载系统软件。
- 默认安装的开发环境包括了 zsh, tmux 等工具,如果你不需要某些工具,可以自行修改脚本。
- 在执行脚本前,请确保系统已更新并有足够的磁盘空间。

## 许可

该项目遵循 MIT License。
Binary file added Tools/setup/chsrc
Binary file not shown.
Loading

0 comments on commit e46704f

Please sign in to comment.