# 系统相关配置

***

## 1. 新版MacOS允许任何源安装或运行

```bash
zhaojun@zhaojun-macOS ~ $ sudo spctl --master-disable
```

## 2. winrar破解

文件名：`rareg.key`

```bash
RAR registration dataFederal Agency for Education1000000 PC usage licenseUID=b621cca9a84bc5deffbf6412612250ffbf533df6db2dfe8ccc3aae5362c06d54762105357d5e3b1489e751c76bf6e0640001014be50a52303fed29664b0741457e567d04159ad8defc3fb6edf32831fd1966f72c21c0c53c02fbbb2f91cfca671d9c482b11b8ac3281cb21378e85606494da349941fae9ee328f12dc73e90b6356b921fbfb8522d6562a6a4b97e8ef6c9ffb866be1e3826b5aa126a4d2bfe9336ad63003fc0e71c307fc2c6064416495d4c55a0cc82d402110498da970812063934815d81470829275
```

## 3. ubuntu设置路由重启生效

文件名：`/etc/rc.local`

```bash
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
route add -net 10.188.0.0/16 gw 182.125.102.1
exit 0
```

## 4. install Atom in Ubuntu via PPA

* Add PPA

```bash
sudo add-apt-repository ppa:webupd8team/atom
```

* Update and install Atom editor

```bash
sudo apt update; sudo apt install atom
```

* (Optional) To remove Atom text editor

```bash
sudo apt remove --purge atom
```

## 5. install Python in Ubuntu

```bash
sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

version=2.7.14
cd ~/Downloads/
wget https://www.python.org/ftp/python/$version/Python-$version.tgz

tar -xvf Python-$version.tgz
cd Python-$version

./configure
make
sudo checkinstall
```

## 6. 安装/卸载 .deb 文件

安装/卸载 .deb 文件

```
sudo dpkg -i 软件包名.deb

sudo apt-get remove 软件包名
```

## 7. Ubuntu 16.04安装Java JDK

> Java JDK有两个版本，一个开源版本Openjdk，还有一个oracle官方版本jdk。下面记录在Ubuntu 16.04上安装Java JDK的步骤。

### 1) 安装openjdk

* 更新软件包列表

```bash
$ sudo apt-get update
```

* 安装openjdk-8-jdk

```bash
$ sudo apt-get install openjdk-8-jdk
```

* 查看java版本

```bash
$ java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-2ubuntu1.16.04.3-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)0
```

### 2) 安装oracle Java JDK

* 首先，安装依赖包

```bash
$ sudo apt-get install python-software-properties
```

* 添加仓库源

```bash
$ sudo add-apt-repository ppa:webupd8team/java
```

* 更新软件包列表

```bash
$ sudo apt-get update
```

* 安装java JDK

```
$ sudo apt-get install oracle-java8-installer
```

* 如果你同时安装了以上两个版本，你可以自由的在这两个版本之间切换。

```bash
$ sudo update-alternatives --config java
```

* 前面带星号的是当前正在使用的java版本，键入编号选择使用哪个版本。编辑`.bashrc`，在文件尾添加java环境变量：

```bash
$ sudo vim .bashrc
```

* 如果使用oracle java

```bash
export JAVA_HOME="/usr/lib/jvm/java-8-oracle"
```

* 如果使用openjdk

```bash
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
```

## 8. Ubuntu ProxyChains使用方法

* 安装ProxyChains

```bash
$ sudo apt install proxychains
```

* 启动Shawdowsocks，并连接
* 编辑/etc/proxychains.conf，在最后的ProxyList里加入Shawdowsocks的代理设置：

```bash
$ sudo vim /etc/proxychains.conf
socks5    127.0.0.1    1080
```

* 编辑/usr/bin/proxychains修改 `LD_PRELOAD=libproxychains.so.3`为（根据自己系统里的libproxychains.so.3设置）

```bash
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libproxychains.so.3
```

* 使用方法，只需要在运行程序的命令前加上proxychains即可。以Dropbox为例，在命令行环境下运行：

```bash
proxychains dropbox start -i
```

> 优点：ProxyChains只会影响指定运行程序

## 9. Ubuntu设置超级密码

```bash
$ sudo passwd
Password: <---输入安装时的密码
Enter new UNIX password: <---新的Root用户密码
Retype new UNIX passord: <---重复新的Root用户密码
passwd: 已成功更新密码
```

## 10. 查看Ubuntu版本

```bash
$ sudo lsb_release -a
$ uname -r
$ df -hl   <----文件系统
```

## 11. Ubuntu设置SSH

```bash
$ sudo apt-get install openssh-server
$ sudo ps -e |grep ssh
$ sudo service ssh start
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://zhaojunhhhu.gitbook.io/learn/chapter3/config.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
