然后原来的一元机就换系统了……

0x00.修改主机名

1
2
3
4
5
6
7
8
9
[root@txy ~]# hostnamectl set-hostname txy.yuangezhizao.cn
[root@txy ~]# cat /etc/hosts
127.0.0.1 txy.yuangezhizao.cn txy.yuangezhizao.cn
127.0.0.1 localhost.localdomain localhost
127.0.0.1 localhost4.localdomain4 localhost4

::1 txy.yuangezhizao.cn txy.yuangezhizao.cn
::1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6

0x01.更新

1
yum update

0x02.软件

  1. nfs-utils:暂时10G免费
    腾讯云文件系统
    腾讯云文件系统
  1. htop
  2. git
  3. axel:多线程下载工具
  4. COSFShttps://github.com/tencentyun/cosfs
    直接在本地是相当爽了,可惜 Win 享受不到
    直接在本地是相当爽了,可惜 Win 享受不到

0x03.挂载第三方存储

  1. 腾讯云文件存储即CFS
  2. 腾讯云对象存储即COS
    白嫖的一年资源包
    白嫖的一年资源包
    最终效果可以说是相当爽了
    最终效果可以说是相当爽了

0x04.编译安装python373环境

  1. 查看现有位置

    1
    2
    [root@txy ~]# whereis python
    python: /usr/bin/python /usr/bin/python2.7 /usr/lib/python2.7 /usr/lib64/python2.7 /etc/python /usr/include/python2.7 /usr/share/man/man1/python.1.gz
  2. 安装编译工具

    1
    yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel

这里面有一个包很关键libffi-devel,因为只有3.7才会用到这个包,如果不安装这个包的话,在make阶段会出现如下的报错:# ModuleNotFoundError: No module named '_ctypes'

  1. 下载源码包
    奇怪的是我用IDM本地多线程下载的包,传上去解压的时候会报错,查了下说是包不完整需要重下,无奈……
    ==
    只能wget龟速下载了……

    1
    wget --no-check-certificate https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz
  2. 解压

    1
    2
    tar -zxvf Python-3.7.0.tgz
    cd Python-3.7.0
  3. 编译

    1
    2
    sudo ./configure --prefix=/usr/local/python3
    sudo make && make install
  4. 安装pip3

    1
    2
    curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
    python3 get-pip.py
  5. 升级pip3

    1
    2
    3
    [root@txy ~]# pip3 install --upgrade pip
    Looking in indexes: http://mirrors.tencentyun.com/pypi/simple
    Requirement already up-to-date: pip in /usr/local/python3/lib/python3.7/site-packages (19.1.1)
  6. 创建软链接(python3&pip3

    1
    2
    3
    4
    5
    6
    sudo ln -s /usr/local/python3/bin/python3 /usr/bin/python3
    sudo ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3
    [root@txy ~]# python -V
    Python 2.7.5
    [root@txy ~]# python3 -V
    Python 3.7.3

这样就可以通过python命令使用Python 2python3来使用Python 3

  1. 更改yum配置
    1
    2
    3
    vim /usr/bin/yum 
    vim /usr/libexec/urlgrabber-ext-down
    vim /bin/yum-config-manager

#! /usr/bin/python修改为#! /usr/bin/python2
10. 修改默认为Python 3
/usr/bin中的python备份,然后创建python3的软链接,这样默认的Python版本就替换为Python 3了。

1
2
[root@txy ~]# sudo mv /usr/bin/python /usr/bin/python.bak
[root@txy ~]# sudo ln -s /usr/local/python3/bin/python3 /usr/bin/python
  1. 加入环境变量
    vim ~/.bash_profile
    PATH=$PATH:$HOME/bin:/usr/local/python3/bin

0x05.安装Docker

  1. 卸载旧版本

    1
    2
    3
    4
    5
    6
    7
    8
    sudo yum remove docker \
    docker-client \
    docker-client-latest \
    docker-common \
    docker-latest \
    docker-latest-logrotate \
    docker-logrotate \
    docker-engine
  2. 使用源安装
    sudo yum install -y yum-utils device-mapper-persistent-data lvm2
    sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

  3. 安装
    sudo yum install docker-ce docker-ce-cli containerd.io

  4. 启动
    sudo systemctl start docker

  5. 测试
    sudo docker run hello-world
    输出如下:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    [root@txy ~]# docker run hello-world
    Unable to find image 'hello-world:latest' locally
    latest: Pulling from library/hello-world
    1b930d010525: Pull complete
    Digest: sha256:6f744a2005b12a704d2608d8070a494ad1145636eeb74a570c56b94d94ccdbfc
    Status: Downloaded newer image for hello-world:latest

    Hello from Docker!
    This message shows that your installation appears to be working correctly.

    To generate this message, Docker took the following steps:
    1. The Docker client contacted the Docker daemon.
    2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
    3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
    4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

    To try something more ambitious, you can run an Ubuntu container with:
    $ docker run -it ubuntu bash

    Share images, automate workflows, and more with a free Docker ID:
    https://hub.docker.com/

    For more examples and ideas, visit:
    https://docs.docker.com/get-started/
  6. 加速器
    curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://e6d6fb48.m.daocloud.io

  7. 自启
    sudo systemctl enable docker

0x06. 测速工具speedtest-cli

pip3 install speedtest-cli

1
2
3
4
5
6
7
8
9
10
[root@txy ~]# speedtest-cli
Retrieving speedtest.net configuration...
Testing from Tencent cloud computing (<rm>)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Beijing Unicom (Beijing) [1.69 km]: 28.199 ms
Testing download speed................................................................................
Download: 86.21 Mbit/s
Testing upload speed......................................................................................................
Upload: 1.27 Mbit/s