Skip to content

Commit

Permalink
feat: add image remote url and add linux auth content
Browse files Browse the repository at this point in the history
  • Loading branch information
mx52jing committed Apr 30, 2024
1 parent fc8e697 commit ef10da7
Show file tree
Hide file tree
Showing 32 changed files with 216 additions and 28 deletions.
6 changes: 4 additions & 2 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ export default {
{ text: 'Bash实用方法', link: '/hand-notes/Linux/practice-method'},
{ text: '图片压缩和格式转换', link: '/hand-notes/Linux/图片压缩和格式转换'},
{ text: '计算升级版本号', link: '/hand-notes/Linux/计算升级版本号'},
{ text: '文件压缩', link: '/hand-notes/Linux/文件压缩'},
{ text: '用户操作相关', link: '/hand-notes/Linux/用户操作相关'},
{ text: '权限相关', link: '/hand-notes/Linux/权限相关'},
]
},
{
Expand Down Expand Up @@ -171,8 +174,7 @@ export default {
collapsible: false,
collapsed: false,
items: [
{ text: 'Bash 基础知识', link: '/knowledge-deposition/Linux/Bash基础知识'},
{ text: '文件压缩', link: '/knowledge-deposition/Linux/文件压缩'},
{ text: 'Bash基础知识', link: '/knowledge-deposition/Linux/Bash基础知识'},
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/algorithm/LeetCode刷题/206-反转链表.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ layout: doc
> 最终的反转结果就是`绿色箭头`所展现的,图示如下:

![双指针](/image/algorithm/reverse-linklist.png)
![双指针](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/algorithm-related/leetcode-206-reverse-linklist.png)

**代码实现:**

Expand Down
16 changes: 8 additions & 8 deletions docs/hand-notes/Charles/修改请求或响应.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ layout: doc

- 打开`Charles`,请求接口后,选中要修改的接口,`右键`,点击`Breakpoints`

![install](/image/Charles/breakpoints.png)
![breakpoints](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/breakpoints.png)

- 打开`Charles``Proxy` => `Breakpoint Settings`

![install](/image/Charles/breakpoint-settings.png)
![breakpoint-settings](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/breakpoint-settings.png)

- 打开后展示如下,这里可以看到添加的要拦截的接口,想拦截哪个接口就`双击`哪个

![install](/image/Charles/open-breaking-settings.png)
![open-breaking-settings](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/open-breaking-settings.png)

- 双击后打开窗口如下

![install](/image/Charles/edit-breakpoint.png)
![edit-breakpoint](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/edit-breakpoint.png)


:::tip
Expand All @@ -35,24 +35,24 @@ layout: doc

- 响应数据返回后会自动锁定到如下图,等待修改`Response`,点击`Edit Response`

![install](/image/Charles/edit-response.png)
![install](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/edit-response.png)

- 修改完毕后,点击`Excute`即可

## 修改响应文件内容

- 点击`Charles``Tools` => `Map Local`

![map-local](/image/Charles/map-local.png)
![map-local](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/map-local.png)

- 勾选`Enable Map Local`,添加拦截的文件路径

![map-local-settings](/image/Charles/map-local-settings.png)
![map-local-settings](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/map-local-settings.png)

- 填写文件路径`Path`,如`/a/b.txt`,然后选择本地替换文件路径

- 其他`Host``Port`等想限制也可以填写

![mapping-edit](/image/Charles/mapping-edit.png)
![mapping-edit](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/mapping-edit.png)


34 changes: 17 additions & 17 deletions docs/hand-notes/Charles/抓包配置.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,42 @@ layout: doc

- 打开`Charles`,选择`Help` => `SSL Proxying` => `Install Charles Root Certificate`,安装完成后,会启动`钥匙串访问`

![install](/image/Charles/install.jpg)
![install](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/install.jpg)

### 查找证书

-`钥匙串访问`程序中,找到刚才的证书`Charles Proxy CA`

![install](/image/Charles/proxyCA.png)
![install](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/proxyCA.png)

### 信任证书

- 选中该证书,`右键` => `显示简介` => `信任` => 在`使用此证书时`选项中选择`始终信任`

![install](/image/Charles/getInfo.png)
![install](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/getInfo.png)


![install](/image/Charles/always-trust.png)
![install](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/always-trust.png)

:::tip
**上述操作完成后,关闭窗口,此时会提示输入`电脑密码`,按照提示输入即可**
:::

### 设置支持`HTTPS`

![HTTPS](/image/Charles/ssl-setting.jpg)
![HTTPS](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/ssl-setting.jpg)

![HTTPS](/image/Charles/enable-ssl.jpg)
![HTTPS](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/enable-ssl.jpg)

![HTTPS](/image/Charles/add-ssl-port.jpg)
![HTTPS](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/add-ssl-port.jpg)

### 查看IP

- 使用`Charles`查看电脑`IP`

![local-ip](/image/Charles/local-ip.jpg)
![local-ip](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/local-ip.jpg)

![local-ip](/image/Charles/ip-address.jpg)
![local-ip](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/ip-address.jpg)



Expand All @@ -56,27 +56,27 @@ layout: doc
:::

### IOS

------
#### 进入`WIFI`设置

- 进入`设置` => `无线局域网`,找到当前手机链接的`wifi`,点击后面的`info icon`进入`wifi`详情


![install](/image/Charles/wifi-info.png)
![wifi-info](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/wifi-info.png)

#### 设置代理`IP`

- `WIFI`详情滑动到最下面,找到`HTTP Proxy`

![install](/image/Charles/http-proxy.png)
![http-proxy](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/http-proxy.png)

- 进入,选择`手动(Manual)`,设置`Server``port`

- `Server`就是刚才查看的`本机IP`

- `port`一直都是`8888`

![install](/image/Charles/configure-proxy.png)
![configure-proxy](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/configure-proxy.png)


#### 下载证书
Expand All @@ -86,21 +86,21 @@ layout: doc

- 电脑端展示

![install](/image/Charles/connect-from.png)
![connect-from](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/connect-from.png)

- 手机端下载确认

![install](/image/Charles/download.png)
![download](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/download.png)

#### 信任证书

- 证书下载完成后,点击`设置` => `通用` => `VPN和设备管理`,找到刚才的证书,并下载

![install](/image/Charles/device-manage.png)
![device-manage](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/device-manage.png)

- 点击`下载`

![install](/image/Charles/install-profile.png)
![install-profile](https://raw.githubusercontent.com/mx52jing/image-hosting/main/images/Charles/install-profile.png)


- 完成上述步骤就可以进行抓包了
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,29 @@ tar -zcvf a.tar.gz [file1, file2, dir1, dir2...]
```shell
tar -zxvf filename.tar.gz
```

### 解压`.rar`文件

> 先下载`rar`包,下载完成后可以使用`rar`命令和`unrar`命令
```shell
brew install rar
```

#### unrar

:::tip
参数:

- `e`:将文件解压缩到当前目录(会把所有的文件列出来,去掉了外层文件夹)

- `l/lb`:列出档案
- `x`:将文件解压到当前目录(解压包含了文件中的文件夹)
:::

```shell
unrar e xxx.rar dir/ // 会把所有的文件列出来,去掉了外层文件夹
unrar x xxx.rar // (推荐使用这个)解压包含了文件中的文件夹
unrar l xxx.rar // 列出xxx.rar内的文件结构
unrar lb xxx.rar // 列出xxx.rar内的文件结构
```
114 changes: 114 additions & 0 deletions docs/hand-notes/Linux/权限相关.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
layout: doc
---

# 权限相关

## 权限的作用

-`文件来`说最高权限是`x(可执行)`

-`目录`来讲最高权限是`w(可写)`,对目录有了`w`权限,就可以做任何事情

## 权限详情

| 权限项 ||| 执行 |
|:----:|:-----:|:-----:|:-----:|
| 字符表示 | r | w | x |
| 数字表示 | 4 | 2 | 1 |

### 文件权限

| 权限 | 含义 | 示例 |
|:---:|:-----------------------------:|:--------------------------:|
|r| 读取文件内容 | `cat``more``head``tail` |
|w| 编辑、新增、修改文件内容,`不能删除文件`,除非对目录有`写权限` | `vim``echo` |
|x|可执行| ./xxx.sh |

### 文件夹(目录)权限

| 权限 | 含义 | 示例 |
|:---:|:----------------------------------------:|:----------------------:|
|r| 可以查看目录下的文件名 | `ls``ll``la` |
|w| 具有`修改目录结构`的权限。如`新建``删除``重命名`此目录下的文件和目录 | `touch``rm``mv``cp` |
|x| 可进入目录 | `cd` |

### 权限位

执行`la`,查看权限,例如:`drwx------`

```shell
➜ js-project la
total 72
drwxr-xr-x@
drwxr-xr-x@
-rw-r--r--@
```

`权限位`总共十位

-`1`位表示`文件类型`
- `d`:文件夹
- `l`:软链接文件
- `-`:普通文件

-`2-4`位表示`文件拥有者权限`
- `r`:可读
- `w`:可写
- `x`:可执行
- `-`:什么权限都没有

-`5-7`位表示`文件所属群组权限`
- `r`:可读
- `w`:可写
- `x`:可执行
- `-`:什么权限都没有

-`8-10`位表示`其他人的权限`
- `r`:可读
- `w`:可写
- `x`:可执行
- `-`:什么权限都没有

## 修改权限


### `chmod`

> 改变`文件权限`
```shell
chmod [选项] 模式 文件名
chmod [ugoa] [+-=] [rwx] 文件/目录
```
:::tip
- `u`:代表所有者
- `g`:代表所属组
- `o`:代表其他人
- `a`:所有
- `+`:增加权限
- `-`:去除权限
- `=`:赋予权限
:::

> 例如:
```shell
chmod a+/-x filename // 给所有人增加/移除x(可执行)权限
```

### `chown`

> 改变`文件拥有者`
```shell
chown 用户名 文件名
```

### `chgrp`

> 改变`文件所属群组`
```shell
chgrp 组名 文件名
```
46 changes: 46 additions & 0 deletions docs/hand-notes/Linux/用户操作相关.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
layout: doc
---

# 用户操作相关

## 查看用户列表

```shell
cat /etc/passwd
```

## 切换用户

```shell
su username
```

## root用户才有的操作

:::warning
以下操作只有`root`账号才可以可用
:::

### 添加新用户

```shell
adduser username
```

### 给已创建的用户user设置密码

```shell
passwd username
```

### 为用户添加权限

```shell
gpasswd -h 查看操作
```

- `-a`:添加用户到组

- `-d`:从组删除用户

Binary file removed docs/public/image/Charles/add-ssl-port.jpg
Binary file not shown.
Binary file removed docs/public/image/Charles/always-trust.png
Binary file not shown.
Binary file removed docs/public/image/Charles/breakpoint-settings.png
Binary file not shown.
Binary file removed docs/public/image/Charles/breakpoints.png
Binary file not shown.
Binary file removed docs/public/image/Charles/configure-proxy.png
Binary file not shown.
Binary file removed docs/public/image/Charles/connect-from.png
Binary file not shown.
Binary file removed docs/public/image/Charles/device-manage.png
Binary file not shown.
Binary file removed docs/public/image/Charles/download.png
Binary file not shown.
Binary file removed docs/public/image/Charles/edit-breakpoint.png
Binary file not shown.
Binary file removed docs/public/image/Charles/edit-response.png
Binary file not shown.
Binary file removed docs/public/image/Charles/enable-ssl.jpg
Binary file not shown.
Binary file removed docs/public/image/Charles/getInfo.png
Binary file not shown.
Binary file removed docs/public/image/Charles/http-proxy.png
Binary file not shown.
Binary file removed docs/public/image/Charles/install-profile.png
Binary file not shown.
Binary file removed docs/public/image/Charles/install.jpg
Binary file not shown.
Binary file removed docs/public/image/Charles/ip-address.jpg
Binary file not shown.
Binary file removed docs/public/image/Charles/local-ip.jpg
Binary file not shown.
Binary file removed docs/public/image/Charles/map-local-settings.png
Binary file not shown.
Binary file removed docs/public/image/Charles/map-local.png
Binary file not shown.
Binary file removed docs/public/image/Charles/mapping-edit.png
Binary file not shown.
Binary file removed docs/public/image/Charles/open-breaking-settings.png
Binary file not shown.
Binary file removed docs/public/image/Charles/proxyCA.png
Binary file not shown.
Binary file removed docs/public/image/Charles/ssl-setting.jpg
Binary file not shown.
Binary file removed docs/public/image/Charles/wifi-info.png
Binary file not shown.
Binary file removed docs/public/image/algorithm/reverse-linklist.png
Binary file not shown.

0 comments on commit ef10da7

Please sign in to comment.