Tools/README.md

166 lines
7 KiB
Markdown
Raw Normal View History

2018-10-22 22:45:40 +08:00
# Tools
Something about scripts
2018-10-10 16:22:16 +08:00
# Linux reinstall useage
2021-10-04 10:45:14 +08:00
## Features:
2022-11-04 23:26:01 +08:00
- "InstallNET.sh" will give you a clean, safe, official Linux system, and help you escape of your server providers' monitoring.
- The operation is easy, several minutes installation will be complated.
- Support Debian 8+, Ubuntu 14.04+, CentOS 6.
- Support major cloud providers, especially support Oracle Cloud ARM machine.
- You can modify architecture, mirror, firmware, ssh port, password etc.
- Friendly to low memory machine(recommend RAM above 256MB).
2022-11-05 20:36:23 +08:00
- Ubuntu 22.04 has cancelled net boot start features, so this program don't support Ubuntu 22.04 and above reinstallation(source: https://www.reddit.com/r/Ubuntu/comments/uroape/is_there_a_netbootiso_equivalent_for_2204_jammy/).
2018-10-10 16:22:16 +08:00
## Download:
2022-11-04 23:04:10 +08:00
<pre><code>wget --no-check-certificate -qO InstallNET.sh 'https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh' && chmod a+x InstallNET.sh</code></pre>
2022-11-04 23:08:21 +08:00
## Fully useage sample
2022-11-05 12:44:41 +08:00
<pre><code>bash InstallNET.sh -d/u/c(os type) 11(os version) -v 64(os bit) -port "your server port" -p "your server password" -a(auto install)/m(manually in VNC) -firmware(with hardware drivers) --mirror 'a valid url for OS image source' --cdimage 'cn'(this option is only for Debian)</code></pre>
2022-11-04 23:08:21 +08:00
## Parameters Descriptions
2021-10-04 10:53:47 +08:00
**-d** : Debian
2018-10-10 16:31:31 +08:00
<br />
2021-10-04 10:46:30 +08:00
<br />
2021-10-04 10:56:07 +08:00
2021-10-04 10:53:47 +08:00
**-u**: Ubuntu
2018-10-10 16:31:31 +08:00
<br />
2021-10-04 10:46:30 +08:00
<br />
2021-10-04 10:56:07 +08:00
2021-10-04 10:53:47 +08:00
**-c**: CentOS
2018-10-10 16:31:31 +08:00
<br />
2021-10-04 10:46:30 +08:00
<br />
2021-10-04 10:56:07 +08:00
2022-11-05 12:44:41 +08:00
**32/i386 or 64/amd64 or arm64**: OS bit
2018-10-10 16:31:31 +08:00
<br />
2021-10-04 10:46:30 +08:00
<br />
2021-10-04 10:56:07 +08:00
2022-11-04 22:59:01 +08:00
**--mirror**: OS install files resource, you can select one which nearest for actual location of your server to upspeed installation.
2021-10-04 10:45:49 +08:00
<br />
<br />
2021-10-04 10:56:07 +08:00
2022-11-04 22:59:01 +08:00
for Debian, official recommend mirror lists are here:
2021-10-04 10:58:24 +08:00
<br />
2022-11-05 10:47:55 +08:00
<pre><code>https://www.debian.org/mirror/list.html</code></pre>
2021-10-04 10:45:49 +08:00
<br />
2021-10-04 10:58:56 +08:00
2022-11-04 22:59:01 +08:00
for Ubuntu, official recommend mirror lists are here:
2021-10-04 10:58:24 +08:00
<br />
2022-11-05 10:47:55 +08:00
<pre><code>https://launchpad.net/ubuntu/+cdmirrors</code></pre>
2021-10-04 10:47:48 +08:00
<br />
2021-10-04 10:58:56 +08:00
2022-11-04 22:59:01 +08:00
for CentOS, official recommend mirror lists are here:
2021-10-04 10:58:24 +08:00
<br />
2021-10-04 10:53:47 +08:00
<pre><code>https://www.centos.org/download/mirrors/</code></pre>
2021-10-04 10:45:14 +08:00
<br />
2021-10-04 10:55:28 +08:00
2022-11-04 22:59:01 +08:00
**-firmware or -firmware --cdimage 'cn'**: specify hardware drivers for Debian, if your server location is in mainland China, you can prefer it to mirror of 'University of Science and Technology of China(https://mirrors.ustc.edu.cn/debian-cdimage/)' for downloading more quickly, default mirror is from http://cdimage.debian.org/cdimage/.
2021-10-04 10:53:47 +08:00
<br />
<br />
2021-10-04 10:55:28 +08:00
2022-11-04 22:48:27 +08:00
**-port**: you can pre-specify ssh port of system, range is 1~65535, **default is '22'**.
2021-10-04 10:53:47 +08:00
<br />
<br />
2021-10-04 10:55:28 +08:00
2021-10-04 12:39:29 +08:00
**-p**: you can pre-specify ssh password of system, **default is 'LeitboGi0ro'**.
2021-10-04 10:45:14 +08:00
<br />
2021-10-04 10:56:54 +08:00
<br />
2021-10-04 10:45:14 +08:00
2022-11-04 23:08:21 +08:00
## Quickly start
2018-10-10 16:22:16 +08:00
### Debian 8
<pre><code>bash InstallNET.sh -d 8 -v 64 -a</code></pre>
### Debian 9
<pre><code>bash InstallNET.sh -d 9 -v 64 -a</code></pre>
2022-11-04 22:48:27 +08:00
### Debian 10
2021-10-04 10:45:14 +08:00
<pre><code>bash InstallNET.sh -d 10 -v 64 -a</code></pre>
2022-11-04 23:08:21 +08:00
### Debian 11 (prefer mirror manually with firmware, recommend for servers which are locating in mainland China)
2021-10-04 11:21:30 +08:00
Tsinghua University:
<br />
2022-11-04 22:48:27 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -firmware --mirror 'https://mirrors.tuna.tsinghua.edu.cn/debian/' --cdimage 'cn'</code></pre>
2021-10-04 11:21:30 +08:00
Netease, Inc:
<br />
2022-11-04 22:48:27 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -firmware --mirror 'http://mirrors.163.com/debian/' --cdimage 'cn'</code></pre>
2021-10-04 11:22:19 +08:00
Tencent Cloud:
2021-10-04 11:21:30 +08:00
<br />
2022-11-04 22:48:27 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -firmware --mirror 'http://mirrors.cloud.tencent.com/debian/' --cdimage 'cn'</code></pre>
2021-10-04 11:21:30 +08:00
Alibaba Cloud:
<br />
2022-11-04 22:48:27 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -firmware --mirror 'http://mirrors.aliyun.com/debian/' --cdimage 'cn'</code></pre>
2022-11-04 23:08:21 +08:00
### Debian 11 (prefer mirror manually with firmware, recommend for servers which are locating outside of mainland China)
2021-10-04 11:07:09 +08:00
Japan:
<br />
2022-11-04 23:28:02 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -firmware --mirror 'http://ftp.riken.jp/Linux/debian/debian/'</code></pre>
2021-10-04 11:14:37 +08:00
HongKong:
<br />
2022-11-04 22:48:27 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -firmware --mirror 'http://ftp.hk.debian.org/debian/'</code></pre>
2021-10-04 11:14:37 +08:00
Singapore:
<br />
2022-11-04 22:48:27 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -firmware --mirror 'http://ftp.sg.debian.org/debian/'</code></pre>
2021-10-04 11:14:37 +08:00
South Korea:
<br />
2022-11-05 22:45:37 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -firmware --mirror 'http://debian-mirror.sakura.ne.jp/debian/'</code></pre>
2022-11-04 22:48:27 +08:00
Taiwan:
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -firmware --mirror 'http://ftp.tw.debian.org/debian/'</code></pre>
2021-10-04 11:07:09 +08:00
America:
<br />
2022-11-04 22:48:27 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -firmware --mirror 'http://ftp.us.debian.org/debian/'</code></pre>
2021-10-04 11:14:37 +08:00
Canada:
2021-10-04 11:07:09 +08:00
<br />
2022-11-04 22:48:27 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -firmware --mirror 'http://ftp.ca.debian.org/debian/'</code></pre>
2021-10-04 11:14:37 +08:00
British:
2021-10-04 11:07:09 +08:00
<br />
2022-11-04 22:48:27 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -firmware --mirror 'http://ftp.uk.debian.org/debian/'</code></pre>
2021-10-04 11:14:37 +08:00
Germany:
2021-10-04 11:07:09 +08:00
<br />
2022-11-04 22:48:27 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -firmware --mirror 'http://ftp.de.debian.org/debian/'</code></pre>
2021-10-04 11:14:37 +08:00
France:
2021-10-04 11:07:09 +08:00
<br />
2022-11-04 22:48:27 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -firmware --mirror 'http://ftp.fr.debian.org/debian/'</code></pre>
2021-10-04 11:14:37 +08:00
Russia:
<br />
2022-11-04 22:48:27 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -firmware --mirror 'http://ftp.ru.debian.org/debian/'</code></pre>
2021-10-04 11:14:37 +08:00
Australia:
<br />
2022-11-04 22:48:27 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -firmware --mirror 'http://ftp.au.debian.org/debian/'</code></pre>
2021-10-04 11:14:37 +08:00
2018-10-10 16:22:16 +08:00
### Ubuntu 16.04
<pre><code>bash InstallNET.sh -u 16.04 -v 64 -a</code></pre>
### Ubuntu 18.04
<pre><code>bash InstallNET.sh -u 18.04 -v 64 -a</code></pre>
2021-10-04 10:45:14 +08:00
### Ubuntu 20.04
<pre><code>bash InstallNET.sh -u 20.04 -v 64 -a</code></pre>
2018-10-10 16:22:16 +08:00
### Cent OS 6
2021-10-06 14:05:38 +08:00
<pre><code>bash InstallNET.sh -c 6.10 -v 64 -a</code></pre>
2018-10-10 16:24:37 +08:00
## Default Configurations
### Time zone
2022-11-04 22:48:27 +08:00
Asia Tokyo
### Default User name
2018-10-10 16:24:37 +08:00
root
2022-11-04 22:48:27 +08:00
### Default Password
2021-10-04 12:25:12 +08:00
LeitboGi0ro
2022-11-04 22:48:27 +08:00
### Default Port
2021-10-04 11:00:51 +08:00
22
2018-10-10 16:33:05 +08:00
<br />
2018-10-10 16:33:23 +08:00
<br />
2022-11-04 23:08:21 +08:00
<b>After system installation, you must change passwords immediately if you assigned default password(LeitboGi0ro)!</b>
2018-10-22 22:45:40 +08:00
<br />
2018-10-22 22:46:24 +08:00
<br />
2018-10-22 22:45:40 +08:00
2022-11-05 20:47:22 +08:00
# .bashrc
.bashrc is a script file system which contains a series of configurations for the terminal session. when the user logs in. The file itself includes highlight settingup for different files.
how to use?
## Delete default .bashrc
<pre><code>rm -rf ~/.bashrc</code></pre>
## Download .bashrc and reboot your system
2022-11-05 20:51:57 +08:00
<pre><code>wget --no-check-certificate -qO ~/.bashrc 'https://raw.githubusercontent.com/leitbogioro/Tools/master/.bashrc' && chmod a+x .bashrc
2022-11-05 20:52:40 +08:00
<br />
<br />reboot</code></pre>
2022-11-05 20:47:22 +08:00
2018-10-22 22:45:40 +08:00
# GroupPolicy import and export
2022-11-04 22:48:27 +08:00
This ".bat" script can only run in Windows. Although only one group-policy rule in Windows can be exported at a time and not support a global one and also have no GUI entrance to import another backuped group policy which exported from another computer. It can help you import or export GroupPolicy conveniently.
2018-10-22 22:45:40 +08:00
## Attentions
2018-10-22 22:57:50 +08:00
<ul>
<li>Compatible with all versions of Windows.</li>
<li>Only support the group-policy rules which exported by this script.</li>
<li>If you want to export group-policy rules. Folder which included group-policy files corresponds to current OS version strictly. Not support export rules which is different from current OS version.</li>
<li>Export operation is irreversible, be cautious to run it</li>
2018-10-22 22:58:22 +08:00
<li>I provided a suggested rules file about Windows Server 2016.</li>
<li>You should run it on desktop.</li>
2018-10-22 22:57:50 +08:00
</ul>