centos8的一些脚本

设置静态IP

TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens33"
UUID="467a92e5-31b8-4b56-9e21-27c67729dc24"
DEVICE="ens33"
ONBOOT="yes"
IPADDR=192.168.8.8
NETMASK=255.255.255.0
GATEWAY=192.168.8.2
DNS1=192.168.8.2

 

历史命令


#启动到控制台,用startx 启动GUI界面
systemctl set-default multi-user.target

#-------------------------------------------nvidia
#禁用nouveau
打开/etc/modprobe.d/blacklist.conf
添加 blacklist nouveau

打开 /usr/lib/modprobe.d/dist-blacklist.conf
添加两行:
blacklist nouveau
options nouveau modeset=0

  cp -r /boot /boot_bk
dracut --force /boot/initramfs-$(uname -r).img $(uname -r)

  yum install kernel-devel
  yum -y install epel-release
  yum -y install dkms

#安装nvidia驱动
  ./NVIDIA-Linux-x86_64-384.90-1080ti.run


#----------------------repo
  rm -f CentOS-Base.repo CentOS-AppStream.repo CentOS-PowerTools.repo CentOS-centosplus.repo CentOS-Extras.repo
  curl -o CentOS-Base.repo https://raw.githubusercontent.com/hackyoMa/docker-centos/8/CentOS-Base.repo
  rm -rf /var/cache/yum && yum makecache && yum -y update && yum -y autoremove

#----------------------docker
  sudo curl  https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo
  yum makecache
  sudo yum -y  install docker-ce
  yum install https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm
  yum install docker-ce
  docker images
  systemctl stop firewalld
  systemctl disable firewalld
  iptables -F && iptables -X && iptables -F -t nat && iptables -X -t nat && iptables -P FORWARD ACCEPT
  sudo systemctl enable --now docker
  systemctl start docker

  sudo groupadd docker
  sudo gpasswd -a jefnguo docker
  sudo systemctl restart docker

#--------------------vscode
  sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
  sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
  sudo dnf check-update
  sudo dnf install code

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值