文章目录
- windows
- Ubuntu
- 安装docker
- 滴滴云修改源
- 阿里云修改源
- 安装ifconfig、ping、nethogs命令
- 生成指定大小的文件
- 设置HTTP代理
- 设置docker代理
- 尊云(centos6)安装docker
- 远程桌面xrdp
插个广告:
滴滴云,比其他都便宜,用于测试什么的没有什么大问题,但是用于生产环境要谨慎。这个是我的推广链接 https://i.didiyun.com/2bxpVi3P0N0
windows
Ubuntu
安装docker
sudo apt update \
&& sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common \
&& curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add - \
&& sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" \
&& sudo apt update \
&& sudo apt-get install -y docker-ce docker-ce-cli containerd.io \
&& sudo usermod -aG docker $USER
sudo yum install -y yum-utils device-mapper-persistent-data lvm2 \
&& sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo \
&& sudo yum makecache fast \
&& sudo yum -y install docker-ce \
&& sudo service docker start
sudo apt update \
&& sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - \
&& sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
&& sudo apt update \
&& sudo apt-get install -y docker-ce docker-ce-cli containerd.io \
&& sudo usermod -aG docker $USER
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \
&& sudo chmod +x /usr/local/bin/docker-compose \
&& base=https://github.com/docker/machine/releases/download/v0.16.0 \
&& sudo curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/usr/local/bin/docker-machine \
&& sudo chmod +x /usr/local/bin/docker-machine
滴滴云修改源
sed -i 's/archive.ubuntu/mirrors.intra.didiyun/g' /etc/apt/sources.list \
&& sed -i 's/security.ubuntu/mirrors.intra.didiyun/g' /etc/apt/sources.list \
&& apt update
阿里云修改源
sed -i 's/archive.ubuntu/mirrors.aliyun/g' /etc/apt/sources.list \
&& sed -i 's/security.ubuntu/mirrors.aliyun/g' /etc/apt/sources.list \
&& apt update
安装ifconfig、ping、nethogs命令
apt install inetutils-ping net-tools nethogs -y
生成指定大小的文件
dd if=/dev/urandom of=onebox.test bs=1MB count=1
truncate -s 1M onebox.test
fallocate -l 1000000 onebox.test
head -c 1MB /dev/urandom > onebox.test
head -c 1MB /dev/zero > onebox.test
设置HTTP代理
echo -e "export http_proxy=http://10.255.0.189:8008\nexport https_proxy=http://10.255.0.189:8008\nexport ftp_proxy=http://10.255.0.189:8008" >> .bashrc \
&& source .bashrc \
&& curl www.baidu.com \
&& sudo sed -i '/env_reset/a\Defaults env_keep+="http_proxy https_proxy ftp_proxy no_proxy"' /etc/sudoers \
&& sudo apt-get update
设置docker代理
sudo mkdir -p /etc/systemd/system/docker.service.d \
&& echo -e "[Service]\nEnvironment=\"HTTP_PROXY=http://10.255.0.189:8008\" \"HTTPS_PROXY=http://10.255.0.189:8008\" \"FTP_PROXY=http://10.255.0.189:8008\" \"NO_PROXY=localhost,127.0.0.1,docker-registry.somecorporation.com\"" | sudo tee -a /etc/systemd/system/docker.service.d/http-proxy.conf \
&& sudo systemctl daemon-reload \
&& sudo systemctl restart docker \
&& sudo docker pull hello-world
尊云(centos6)安装docker
yum update -y \
&& yum install -y https://get.docker.com/rpm/1.7.1/centos-6/RPMS/x86_64/docker-engine-1.7.1-1.el6.x86_64.rpm \
&& echo "none /sys/fs/cgroup cgroup defaults 0 0" >> /etc/fstab \
&& reboot
远程桌面xrdp
sudo apt-get install -y xrdp vnc4server xubuntu-desktop \
&& echo "xfce4-session" > ~/.xsession \
&& sudo service xrdp restart