Tools/README.md

241 lines
10 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.
2022-11-06 15:27:44 +08:00
- Friendly to low memory machine(recommend RAM above 256MB), <b>If your machine RAM is less than 768MB, before Debian 11 and above version installation, you may should not bash it with "-firmware" or "-firmware --cdimage" parameters because it won't let machine installation go into low memory mode and causes installation failed!</b>
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/).
2022-11-06 15:13:54 +08:00
- South Korea debian official mirror(http://ftp.kr.debian.org/debian/) is usually crashed down, so I change mirror of Kyoto University to replace it. Japan debian mirror is from https://www.riken.jp/, a science research organization in Japan. America debian mirror is from Massachusetts Institute of Technology: https://web.mit.edu/.
2022-11-12 20:24:19 +08:00
- Completely modified debian, such as support terminal files colorful displaying, permanently change dns server, disable expired certificates, add on a cute welcome introduction, pre-install many complements in preseeding progress, now enjoy a newly, comfortable, graceful debian experience!
![1](1.jpg)
2022-11-12 19:41:31 +08:00
- Change name server for Debian permanently is provided by "resolvconf", related configuration files has been wittened. you just need to logging in new installed system, and run:
<pre><code>echo "O" | apt install resolvconf -y</code></pre>
to make changes validating!
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-06 15:14:57 +08:00
<pre><code>bash InstallNET.sh -d/u/c(os type) 11(os version) -v 64(os bit) -port "your server port" -pwd "your server password" -a(auto install)/m(manually in VNC) -mirror "a valid url for OS image source" -firmware(with hardware drivers) --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-06 15:14:57 +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-06 15:15:28 +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
2022-11-06 15:14:57 +08:00
**-pwd**: 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-06 15:13:54 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "https://mirrors.tuna.tsinghua.edu.cn/debian/" -firmware --cdimage "cn"</code></pre>
2022-11-12 19:41:31 +08:00
<br />
for low memory(less than 768MB) machines, you can bash:
2022-11-12 19:44:19 +08:00
<br />
<br />
2022-11-12 19:41:31 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "https://mirrors.tuna.tsinghua.edu.cn/debian/" -dnserv "cn"</code></pre>
<br />
2021-10-04 11:21:30 +08:00
Netease, Inc:
<br />
2022-11-12 19:46:29 +08:00
<br />
2022-11-06 15:13:54 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://mirrors.163.com/debian/" -firmware --cdimage "cn"</code></pre>
2022-11-12 19:41:31 +08:00
<br />
for low memory(less than 768MB) machines, you can bash:
<br />
2022-11-12 19:46:29 +08:00
<br />
2022-11-12 19:41:31 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://mirrors.163.com/debian/" -dnserv "cn"</code></pre>
<br />
2021-10-04 11:22:19 +08:00
Tencent Cloud:
2021-10-04 11:21:30 +08:00
<br />
2022-11-12 19:46:29 +08:00
<br />
2022-11-06 15:13:54 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://mirrors.cloud.tencent.com/debian/" -firmware --cdimage "cn"</code></pre>
2022-11-12 19:46:29 +08:00
<br />
for low memory(less than 768MB) machines, you can bash:
<br />
2022-11-12 19:50:04 +08:00
<br />
2022-11-12 19:46:29 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://mirrors.cloud.tencent.com/debian/" -dnserv "cn"</code></pre>
<br />
2021-10-04 11:21:30 +08:00
Alibaba Cloud:
<br />
2022-11-12 19:46:29 +08:00
<br />
2022-11-06 15:40:23 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://mirrors.aliyun.com/debian/" -firmware --cdimage 'cn'</code></pre>
2022-11-12 19:41:31 +08:00
<br />
for low memory(less than 768MB) machines, you can bash:
<br />
2022-11-12 19:50:04 +08:00
<br />
2022-11-12 19:41:31 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://mirrors.aliyun.com/debian/" -dnserv "cn"</code></pre>
<br />
2022-11-12 19:46:29 +08:00
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-06 15:40:23 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.riken.jp/Linux/debian/debian/" -firmware</code></pre>
2022-11-12 19:41:31 +08:00
<br />
for low memory(less than 768MB) machines, you can bash:
<br />
2022-11-12 19:51:37 +08:00
<br />
2022-11-12 19:52:55 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.riken.jp/Linux/debian/debian/"</code></pre>
2022-11-12 19:41:31 +08:00
<br />
2021-10-04 11:14:37 +08:00
HongKong:
<br />
2022-11-12 19:50:04 +08:00
<br />
2022-11-06 15:40:23 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.hk.debian.org/debian/" -firmware</code></pre>
2022-11-12 19:41:31 +08:00
<br />
for low memory(less than 768MB) machines, you can bash:
<br />
2022-11-12 19:50:04 +08:00
<br />
2022-11-12 19:41:31 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.hk.debian.org/debian/"</code></pre>
<br />
2021-10-04 11:14:37 +08:00
Singapore:
<br />
2022-11-12 19:50:04 +08:00
<br />
2022-11-06 15:40:23 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.sg.debian.org/debian/" -firmware</code></pre>
2022-11-12 19:41:31 +08:00
<br />
for low memory(less than 768MB) machines, you can bash:
<br />
2022-11-12 19:50:04 +08:00
<br />
2022-11-12 19:41:31 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.sg.debian.org/debian/"</code></pre>
<br />
2021-10-04 11:14:37 +08:00
South Korea:
<br />
2022-11-12 19:50:04 +08:00
<br />
2022-11-06 15:40:23 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://studenno.kugi.kyoto-u.ac.jp/debian/" -firmware</code></pre>
2022-11-12 19:41:31 +08:00
<br />
for low memory(less than 768MB) machines, you can bash:
<br />
2022-11-12 19:50:04 +08:00
<br />
2022-11-12 19:41:31 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://studenno.kugi.kyoto-u.ac.jp/debian/"</code></pre>
<br />
2022-11-04 22:48:27 +08:00
Taiwan:
<br />
2022-11-12 19:50:04 +08:00
<br />
2022-11-06 15:40:23 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.tw.debian.org/debian/" -firmware</code></pre>
2021-10-04 11:07:09 +08:00
America:
<br />
2022-11-12 19:50:04 +08:00
<br />
2022-11-06 15:40:23 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://debian.csail.mit.edu/debian/" -firmware</code></pre>
2022-11-12 19:41:31 +08:00
<br />
for low memory(less than 768MB) machines, you can bash:
<br />
2022-11-12 19:50:04 +08:00
<br />
2022-11-12 19:41:31 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://debian.csail.mit.edu/debian/"</code></pre>
<br />
2021-10-04 11:14:37 +08:00
Canada:
2021-10-04 11:07:09 +08:00
<br />
2022-11-12 19:50:04 +08:00
<br />
2022-11-06 15:40:23 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.ca.debian.org/debian/" -firmware</code></pre>
2021-10-04 11:14:37 +08:00
British:
2021-10-04 11:07:09 +08:00
<br />
2022-11-12 19:50:04 +08:00
<br />
2022-11-06 15:40:23 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.uk.debian.org/debian/" -firmware</code></pre>
2021-10-04 11:14:37 +08:00
Germany:
2021-10-04 11:07:09 +08:00
<br />
2022-11-12 19:50:04 +08:00
<br />
2022-11-06 15:40:23 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.de.debian.org/debian/" -firmware</code></pre>
2021-10-04 11:14:37 +08:00
France:
2021-10-04 11:07:09 +08:00
<br />
2022-11-12 19:50:04 +08:00
<br />
2022-11-06 15:40:23 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.fr.debian.org/debian/" -firmware</code></pre>
2021-10-04 11:14:37 +08:00
Russia:
<br />
2022-11-12 19:50:04 +08:00
<br />
2022-11-06 15:40:23 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.ru.debian.org/debian/" -firmware</code></pre>
2021-10-04 11:14:37 +08:00
Australia:
<br />
2022-11-12 19:50:04 +08:00
<br />
2022-11-06 15:40:23 +08:00
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.au.debian.org/debian/" -firmware</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>