QQ登录

点击进入授权页面

查看: 661|回复: 0

给大家几个日常工具,一行命令搞定基础环境建设

[复制链接]

6

主题

6

帖子

43

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
43
发表于 2018-12-7 20:52:37 | 显示全部楼层 |阅读模式
本文来自V2EX 经过原作者同意转载
原文链接:https://www.v2ex.com/t/514417#reply51

1.安装 MySQL
# curl -s xabc.io/mysql | bash
2.安装 Redis
# curl -s xabc.io/r | bash
3.安装 OpenResty 也就是 Nginx
# curl -s xabc.io/o | bash
4.安装 Java 环境,即 JDK8 和 Tomcat8
# curl -s xabc.io/j | bash
5.安装 PHP7 环境
# curl -s xabc.io/php | bash
6.安装 Influxdb 时序数据库
# curl -s xabc.io/influxdb | bash
7.安装编译环境
# curl -s xabc.io/base | bash
8.生成 Nginx server {} 段配置

自己搭建适合自己的

什么是运维外挂? 无论在哪里,一行命令"武器"下载到手边
当你登录一台新主机 # curl xabc.io/v|sh 一行命令创建自己习惯的 vimrc 环境,网络版的类 alias 用法,这就是运维外挂,加速你的操作,建设你企业的共享部署资源,节约你宝贵的时间
原理
  • 准备域名资源和一台云主机部署一个 OpenResty Web 服务器
  • 数据资源上 CDN 随时随地快速下载[ 可选(也可将数据资源放在上面服务器) ]
  • 写一段 Lua 代码解析请求参数执行 Key-Value 结构的指令返回请求数据
实现local cmd = {        f = [[salt \* saltutil.refresh_pillar]],        a = [[[ -e /root/.ssh/authorized_keys ]&&chattr -ai /root/.ssh/authorized_keys&&sed -i '/ywgx/d;/xabc/d' /root/.ssh/authorized_keys||mkdir -p /root/.ssh;echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDHZyWeFOHuHtLgsGLNx4sCYVXv/FfFi3ZcTSOSyX2oRgRm4xflPDgJHGSlCjtP2IluM6gG+o9+fS0WpcQkiaabe4wJVf5/hdFvJY7BgG4SslmdYGGtXKqFKXLq0pkuQQTnitBYQvAwEjBuHYB0KuuJG1XSss3ubzTZzoveeIVOJgamoGgm42D2G0ZOAH7ovRj3eFvjJImepaSJEDUe1SbNHoptSQvLMV+y5LDNb7xxRUk4hH09o/f2O9jxPbxL8f9nP94ZoT2XjVhvKRKVz51AHs9pNTry7ge4MSI5hlWSwjiFO+jJLuIiGdRGVxEzToMOkPBaH3HXs1pJHu+/9fqCwvgW4+Wp7FTBhPmX/9VSjGpO+uwlj3zRZHyDxs3Enup+Bok/WH9e5GLQj/KzWQD6s/6s0/9UC9YfZRU7E+uRvXf21zpAkmaGGQsOv5FV7ZqciYRn66dq65ahx2xmi4hkBoTrdP595lRPuQEOW1ziTI08pxU9eZA/f/s4AsQL/IHU9LkiA8gqGXlembuBxL20OietQTLn5AYev6rmU0m4IZ1yKu2AzT5gaG//8XuSGzT0o8ppvSgIalDBnS+W/2xQCc0xGY7yX51MIdc+E7edWw14VqL0ESXIHZfB7uOGOAMjfMP3GIoHOIatI+rsd8D30sKEEBXDYAgwu2yZgskGmw== ywgx" >> /root/.ssh/authorized_keys;echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDT36lNbtc7eqPC6KrrGoOJm43cGrTkLBfNJPuUVR7odSMBn53P5vjuG4BVeXP/yhiVAjerPrh/03e5xOoI5X1UD56H52XpXLoMkGGAR6uSRSNzjSgt1XBFREWBnOgsuw71ubltsfHKPBjnkwnMRePLD5aoMeTyvylhAxTMMLm3GPSCCTMII8bmuxTx8k1IJ8oW078ak6LeBOFFl/SOFiMeWSvqA21fi8gUMhWte3NN4trNUIDPdSprOZx1Yk4nnZh5jkrVv5iZX3DtrsaVhYegwK06VBRiycqDj32d1kOWyFBdhWHADMMoD4UAHnFxn+5igeRyS2yI9XFgQTQDaWw+cLvYe4wYr+pJ66Vk4v5f1AeOg/F4UewhJ4Sr/2AtZJOxgAhPv7gdyf4aDePfxlZwuUD+chMbntOZzUuaI5rU8uh4lWaNCG0eGvH0ul3pjS2p4FKJ378XKi87DcqGQLZJytjbMqc8NalTl/AbbMgjZbB8ZHpZAl2G1gq1uicAjMsm0j0nLmvAb6vPe9lQTp0Jb09yddM3VX9XtF15yz1Si1COu1I5nldEGc12nBFLxIRBEk6vaDZYo5gY14rdrWuiZ85j5I0vEUbiuFF3lzf+j0iHg3UgZcuYo5QFBiApyyWt1wDvHKnLE3FZVj0uSzscmZ5/4rk06ZAwCdwjzAXZCQ== xabc" >> /root/.ssh/authorized_keys;chmod 600 /root/.ssh/authorized_keys;chattr +ai /root/.ssh/authorized_keys]],        c = [[rm -rf /usr/local/{qcloud,aegis};touch /usr/local/{qcloud,aegis};chattr +ai /usr/local/{qcloud,aegis};sed -i '/qcloud/d' /etc/rc.local;hostnamectl --static set-hostname central-]]..ngx.var.remote_addr..[[;yum -y install wget;wget -q https://s.xabcloud.com/matrix/xabc.sh -O /etc/profile.d/xabc.sh;chmod 644 /etc/profile.d/xabc.sh;yum -y update;yum -y install epel-release gcc gcc-c++ make vim pcre-devel libffi-devel openssl-devel python-devel libevent-devel postgresql-devel readline-devel perl-ExtUtils-Embed iptables iptables-services inotify-tools bzip2 unzip rsync;yum -y install python-pip;yum -y erase sudo;yum clean all;wget -q https://s.xabcloud.com/file/vim.tgz -O -|tar xzf - -C ~;[ -d /root/.pip ]||mkdir -p /root/.pip;wget -q https://s.xabcloud.com/file/pip.conf -O /root/.pip/pip.conf;pip install pip==9.0.3;pip install --upgrade Cython redis pyinotify pyOpenSSL salt-pepper;pip uninstall -y urllib3 chardet;pip install functions gunicorn tornado tornadio2 tornado_jinja2 sqlalchemy_utils psycopg2-binary Pillow paramiko sqlalchemy influxdb futures flask yapf mako setproctitle ujson;pip install --upgrade requests;wget -q https://s.xabcloud.com/file/salt-latest.repo -O /etc/yum.repos.d/salt-latest.repo;yum -y install salt-master salt-minion salt-ssh;systemctl enable salt-master.service;wget -q https://s.xabcloud.com/matrix/master -O /etc/salt/master;[ -d /srv/zero/2 ]||mkdir -p /srv/zero/2;wget -q https://s.xabcloud.com/matrix/node-8.11.3.tgz -O -|tar xzf - -C /srv/zero/2;ln -fs /srv/zero/2/node/bin/npm /usr/bin/npm;ln -fs /srv/zero/2/node/bin/node /usr/bin/node;[ -d /srv/zero/1 ]||mkdir -p /srv/zero/1;wget -q https://s.xabcloud.com/matrix/matrix.tgz -O -|tar xzf - -C /srv/zero/1;[ -d /srv/zero ]||mkdir -p /srv/zero;[ -d /srv/salt/user ]||mkdir -p /srv/salt/user;wget -q https://s.xabcloud.com/matrix/R.tgz -O -|tar xzf - -C /srv/zero;wget -q https://s.xabcloud.com/matrix/O.tgz -O -|tar xzf - -C /srv/zero;chmod 700 /srv/zero/2/redis/bin/*;ln -fs /srv/zero/2/redis/bin/redis-cli /usr/bin/;chown root.nobody /srv/zero/0/openresty/nginx/sbin/nginx;chmod +xs /srv/zero/0/openresty/nginx/sbin/nginx;chattr -ai /etc/{passwd,shadow,group,gshadow,services};yum install -y postgresql-server;service postgresql initdb;service postgresql start;service salt-master start;chkconfig postgresql on;chattr +ai /etc/{passwd,shadow,group,gshadow,services};[ -e /etc/ssh/ssh_host_dsa_key ]||ssh-keygen -q -t dsa -P '' -f /etc/ssh/ssh_host_dsa_key;chmod 311 /etc/rc.d/rc.local;chkconfig rpcbind off &>/dev/null;systemctl disable salt-minion.service;pip uninstall -y urllib3;pip install requests -U;wget -q https://s.xabcloud.com/matrix/build.tgz -O -|tar xzf - -C /srv/salt;rm -fr /var/log /var/cache/salt/minion /root/.bash_history;]]..[[printf "\033[1;32;40m%s\033[0m\n" "Login  和 Central 机器在同一个内网请在 Login  机器执行 # curl -s xabc.io/l-`ip -o -f inet addr|grep -v 'lo '|grep -E 'inet 10.|inet 172.1[6-9].|inet 172.2[0-9].|inet 172.3[0-1].|inet 192.168.'|head -1|awk '{print $4}'|cut -d/ -f1`-hz|sh 继续完成对 Login 的基础部署";]]..[[printf "\033[1;32;40m%s\033[0m\n\n" "Master 和 Central 机器在同一个内网请在 Master 机器执行 # curl -s xabc.io/m-`ip -o -f inet addr|grep -v 'lo '|grep -E 'inet 10.|inet 172.1[6-9].|inet 172.2[0-9].|inet 172.3[0-1].|inet 192.168.'|head -1|awk '{print $4}'|cut -d/ -f1`-hz|sh 继续完成对 Master 的基础部署";]]..[[printf "\033[1;32;40m%s\033[0m\n" "Login  和 Central 机器不在同一内网请在 Login  机器执行 # curl -s xabc.io/l-]]..ngx.var.remote_addr..[[-hz|sh 继续完成对 Login 的基础部署";]]..[[printf "\033[1;32;40m%s\033[0m\n" "Master 和 Central 机器不在同一内网请在 Master 机器执行 # curl -s xabc.io/m-]]..ngx.var.remote_addr..[[-hz|sh 继续完成对 Master 的基础部署";printf "\033[1;32;31m%s\033[0m\n" "特别说明 hz 这个字段代表网络区域信息,可根据实际情况改成自己机器所在区域字符信息,如bj"]],        m = [[wget -q https://s.xabcloud.com/file/salt-latest.repo -O /etc/yum.repos.d/salt-latest.repo;wget -q https://s.xabcloud.com/file/influxdb.repo -O /etc/yum.repos.d/influxdb.repo;yum -y update;yum -y install epel-release net-tools Cython rsync gcc gcc-c++ make vim python-devel psmisc openssl-devel libevent-devel libffi-devel iptables iptables-services inotify-tools unzip;yum -y install python-pip;yum -y install salt-api salt-master salt-minion rsync ansible;yum clean all;chattr -ai /etc/salt/master;wget -q https://s.xabcloud.com/matrix/master -O /etc/salt/master;systemctl enable salt-master.service;systemctl enable salt-minion.service;systemctl enable salt-api.service;yum -y localinstall https://s.xabcloud.com/file/influxdb-1.6.0.x86_64.rpm;mkdir -p /srv/zero]],        ssl = [[ssl_certificate ssl/xabcloud.com.pem;]].."\n"..[[ssl_certificate_key ssl/xabcloud.com.key;]].."\n"..[[ssl_session_cache shared:SSL:10m;]].."\n"..[[ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256::!MD5;]].."\n"..[[ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;]].."\n"..[[ssl_prefer_server_ciphers on;]].."\n"..[[ssl_session_timeout 10m;]],        l = [[wget -q https://s.xabcloud.com/file/salt-latest.repo -O /etc/yum.repos.d/salt-latest.repo;yum -y update;yum install -y epel-release gcc make vim lrzsz iptables iptables-services unzip pssh python-devel salt-minion;yum -y install python-pip;yum -y erase sudo;yum clean all;systemctl enable salt-minion.service]],        x = [[cat /etc/issue /etc/centos-release 2>/dev/null|grep -q "Ubuntu"&&OS="Debian";cat /etc/issue /etc/centos-release 2>/dev/null|grep -q "release"&&OS="RedHat";if [ "$OS" = "RedHat" ];then rm -f /var/lib/rpm/__db*;rpm --rebuilddb;yum install -y yum-utils;yum clean all;yum-complete-transaction --cleanup-only;yum history redo last;package-cleanup --dupes;package-cleanup --problems;yum clean metadata;yum makecache;yum clean expire-cache;fi;if [ "$OS" = "Debian" ];then dpkg --configure -a;apt-get --fix-broken install;apt-key update;apt-get -f -y install --allow-unauthenticated --force-yes;apt-get clean;cd /var/lib/apt&&rm -rf lists;mkdir -p /var/lib/apt/lists/partial;apt-get clean;apt-get update;fi]],        e = [[wget -q https://s.xabcloud.com/file/xabc.sh -O /etc/profile.d/xabc.sh;chmod 644 /etc/profile.d/xabc.sh]],        j = [[echo doing...;wget -q https://s.xabcloud.com/src/java.tgz -O -|tar xzf - -C /tmp;tar xzf /tmp/java/files/jdk.tgz -C /opt;tar xzf /tmp/java/files/tomcat.tgz -C /opt;mv /tmp/java/files/*.sh /etc/profile.d/;rm -rf /tmp/java/;echo "/opt/{jdk,tomcat}"]],        influxdb = [[echo doing...;cat /etc/issue /etc/centos-release 2>/dev/null|grep -q "Ubuntu"&&OS="Debian";cat /etc/issue /etc/centos-release 2>/dev/null|grep -q "release"&&OS="RedHat";if [ "$OS" = "RedHat" ];then yum -y localinstall https://s.xabcloud.com/file/influxdb-1.6.0.x86_64.rpm;wget -q https://s.xabcloud.com/file/influxdb.repo -O /etc/yum.repos.d/influxdb.repo;fi;if [ "$OS" = "Debian" ];then wget -q https://s.xabcloud.com/file/influxdb_1.6.0_amd64.deb;dpkg -i influxdb_1.6.0_amd64.deb;rm -f influxdb_1.6.0_amd64.deb;fi]],        n = [[hostnamectl --static set-hostname]],        o = [[echo doing...;cat /etc/issue /etc/centos-release 2>/dev/null|grep -q "Ubuntu"&&OS="Debian";cat /etc/issue /etc/centos-release 2>/dev/null|grep -q "release"&&OS="RedHat";wget -q https://s.xabcloud.com/src/openresty.tgz -O -|tar xzf - -C /tmp;mv /tmp/openresty/files/openresty-$OS /opt/openresty;mv /tmp/openresty/files/salt-openresty.sh /etc/profile.d/;rm -rf /tmp/openresty/;wget -q https://s.xabcloud.com/file/nginx.conf -O /opt/openresty/nginx/conf/nginx.conf;chmod +xs /opt/openresty/nginx/sbin/nginx;echo "/opt/openresty"]],        p = ngx.var.remote_addr,        q = [[echo doing...;find / -empty -mtime +7 ! -path "/proc/*" -a ! -path "/sys/*" -a ! -path "/etc/*" ! -path "/boot/*" -type f -a -name "*.log" -delete;for i in $(find `du -s /* --exclude={proc,etc,sys,boot}|sort -nr|head -7|awk '{print $2}'|tr '\n' ' '` -type f -a -name "*.log" ! -name ".xabc.log" -o -name "catalina.out");do echo $i;> $i;done]],        r = [[echo doing...;cat /etc/issue /etc/centos-release 2>/dev/null|grep -q "Ubuntu"&&OS="Debian";cat /etc/issue /etc/centos-release 2>/dev/null|grep -q "release"&&OS="RedHat";wget -q https://s.xabcloud.com/src/redis.tgz -O -|tar xzf - -C /tmp;mv /tmp/redis/files/redis-$OS /opt/redis;rm -rf /tmp/redis/;mkdir -p /opt/redis/conf;wget -q https://s.xabcloud.com/file/redis.conf -O /opt/redis/conf/redis.conf;chmod 700 /opt/redis/bin/*;echo "/opt/redis"]],        t = [[ip -o -f inet addr|grep -v 'lo '|grep -E 'inet 10.|inet 172.1[6-9].|inet 172.2[0-9].|inet 172.3[0-1].|inet 192.168.'|head -1|awk '{print $4}'|cut -d/ -f1]],        u = [[ip -o -f inet addr|grep -v 'lo '|grep -Po '(?<=inet ).*(?=\/)'|awk '/^10\.|^172\.|^192\./'|head -1]],        y = [[ip -o -f inet addr|grep -v 'lo '|grep -Po '(?<=inet ).*(?=\/)'|grep -E '^10\.|^172\.1[6-9]\.|^172\.2[0-9]\.|^172\.3[0-1]\.|^192\.168\.'|head -1]],        v = [[wget -q https://s.xabcloud.com/file/vim.tgz -O -|tar xzf - -C ~]],        b = [[cat /etc/issue /etc/centos-release 2>/dev/null|grep -q "Ubuntu"&&OS="Debian";cat /etc/issue /etc/centos-release 2>/dev/null|grep -q "release"&&OS="RedHat";if [ "$OS" = "RedHat" ];then yum -q -y install vim wget bzip2 unzip rsync;fi;if [ "$OS" = "Debian" ];then apt-get -q -y install vim wget bzip2 unzip rsync;fi]],        i = [[wget -q https://s.xabcloud.com/ywgx/vim.tgz -O -|tar xzf - -C ~;wget -q https://s.xabcloud.com/ywgx/.gitconfig -O ~/.gitconfig]],        z = [[[ -e /root/.ssh/authorized_keys ]&&chattr -ai /root/.ssh/authorized_keys&&sed -i '/ywgx/d;/xabc/d' /root/.ssh/authorized_keys||mkdir -p /root/.ssh;echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDHZyWeFOHuHtLgsGLNx4sCYVXv/FfFi3ZcTSOSyX2oRgRm4xflPDgJHGSlCjtP2IluM6gG+o9+fS0WpcQkiaabe4wJVf5/hdFvJY7BgG4SslmdYGGtXKqFKXLq0pkuQQTnitBYQvAwEjBuHYB0KuuJG1XSss3ubzTZzoveeIVOJgamoGgm42D2G0ZOAH7ovRj3eFvjJImepaSJEDUe1SbNHoptSQvLMV+y5LDNb7xxRUk4hH09o/f2O9jxPbxL8f9nP94ZoT2XjVhvKRKVz51AHs9pNTry7ge4MSI5hlWSwjiFO+jJLuIiGdRGVxEzToMOkPBaH3HXs1pJHu+/9fqCwvgW4+Wp7FTBhPmX/9VSjGpO+uwlj3zRZHyDxs3Enup+Bok/WH9e5GLQj/KzWQD6s/6s0/9UC9YfZRU7E+uRvXf21zpAkmaGGQsOv5FV7ZqciYRn66dq65ahx2xmi4hkBoTrdP595lRPuQEOW1ziTI08pxU9eZA/f/s4AsQL/IHU9LkiA8gqGXlembuBxL20OietQTLn5AYev6rmU0m4IZ1yKu2AzT5gaG//8XuSGzT0o8ppvSgIalDBnS+W/2xQCc0xGY7yX51MIdc+E7edWw14VqL0ESXIHZfB7uOGOAMjfMP3GIoHOIatI+rsd8D30sKEEBXDYAgwu2yZgskGmw== ywgx" >> /root/.ssh/authorized_keys;echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDT36lNbtc7eqPC6KrrGoOJm43cGrTkLBfNJPuUVR7odSMBn53P5vjuG4BVeXP/yhiVAjerPrh/03e5xOoI5X1UD56H52XpXLoMkGGAR6uSRSNzjSgt1XBFREWBnOgsuw71ubltsfHKPBjnkwnMRePLD5aoMeTyvylhAxTMMLm3GPSCCTMII8bmuxTx8k1IJ8oW078ak6LeBOFFl/SOFiMeWSvqA21fi8gUMhWte3NN4trNUIDPdSprOZx1Yk4nnZh5jkrVv5iZX3DtrsaVhYegwK06VBRiycqDj32d1kOWyFBdhWHADMMoD4UAHnFxn+5igeRyS2yI9XFgQTQDaWw+cLvYe4wYr+pJ66Vk4v5f1AeOg/F4UewhJ4Sr/2AtZJOxgAhPv7gdyf4aDePfxlZwuUD+chMbntOZzUuaI5rU8uh4lWaNCG0eGvH0ul3pjS2p4FKJ378XKi87DcqGQLZJytjbMqc8NalTl/AbbMgjZbB8ZHpZAl2G1gq1uicAjMsm0j0nLmvAb6vPe9lQTp0Jb09yddM3VX9XtF15yz1Si1COu1I5nldEGc12nBFLxIRBEk6vaDZYo5gY14rdrWuiZ85j5I0vEUbiuFF3lzf+j0iHg3UgZcuYo5QFBiApyyWt1wDvHKnLE3FZVj0uSzscmZ5/4rk06ZAwCdwjzAXZCQ== xabc" >> /root/.ssh/authorized_keys;chmod 600 /root/.ssh/authorized_keys;chattr +ai /root/.ssh/authorized_keys;wget -q https://s.xabcloud.com/file/vim.tgz -O -|tar xzf - -C /root;wget -q https://s.xabcloud.com/file/xabc.sh -O /etc/profile.d/xabc.sh;wget -q https://s.xabcloud.com/file/sa.tgz -O -|tar xzf - -C /opt]],        s = [[[ -d /srv/salt/src ]||mkdir -p /srv/salt/src;cd /srv/salt/src;for i in influxdb.tgz java.tgz node.tgz openresty.tgz redis.tgz;do wget https://s.xabcloud.com/src/$i -O -|tar xzf -;done]],}if ngx.re.find(ngx.var.http_user_agent or 'curl','curl') then        for k,v in pairs(cmd) do                html = html..k.." : "..cmd[k].."\n"        end        html = string.sub(html,1,-2)else        html = [[<!DOCTYPE html><html><header style='text-align:center;font-size:168%'>]]..cmd['p']..[[</header>]]        for k,v in pairs(cmd) do                html = html.."<section><abbr style='color:red;font-size:128%'>"..k.."</abbr> <tt style='color:green'>"..cmd[k].."</tt></section>"        end        html = html..[[</html>]]endngx.say(html)部署
以上 Lua 代码逻辑可写在 cmd.lua 文件, ... 省略部分配置
server{        listen 80;        server_name xabc.io www.xabc.io;        location /{                default_type text/html;                content_by_lua_file lua/cmd.lua;        }}server{        listen 443 ssl http2;        server_name xabc.io www.xabc.io;        ssl_certificate ssl/xabc.io.pem;        ssl_certificate_key ssl/xabc.io.key;        ssl_session_cache shared:SSL:10m;        ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256::!MD5;        ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;        ssl_prefer_server_ciphers on;        ssl_session_timeout 10m;        location /{                default_type text/html;                content_by_lua_file lua/cmd.lua;        }}效果
  • # curl xabc.io/o|sh 在业务机器部署 OpenResty 环境,上面我们准备的资源是以最新版本的 OpenResty 静态编译了 pcre-8.42 openssl-1.0.2o zlib-1.2.11,同时支持 CentOS 和 Ubuntu( 会根据所执行机器的操作系统自动选择对应的二进制文件包 )
  • # curl xabc.io/j|sh 在业务机器部署 Java 环境( JDK8 和 Tomcat8 )
  • # curl xabc.io/r|sh 在业务机器部署 Redis ( 同时支持 CentOS 和 Ubuntu )
  • # curl xabc.io/y|sh 获取本地机器内网 IP
  • # curl xabc.io/p 获取本地机器公网出口 IP
  • # curl xabc.io/v|sh 同步一份简约的 .vimrc 环境
  • # curl xabc.io/q|sh 清理磁盘日志
  • # curl xabc.io/influxdb|sh 部署 Influxdb ( 这是原版官方提供的二进制包 )
建议默认设置 alias curl='curl -s' 执行效果更简洁一些
$ cat /etc/profile.d/xabc.sh TMOUT=3600alias vi=vimalias ls='ls --color'alias ll='ls -l'alias curl='curl -s'export HISTTIMEFORMAT="%F %T "export PS1='\[\033[01;36m\]\u@\H\[\033[01;31m\] \W\$\[\033[00m\] '



回复

使用道具 举报

*滑动验证:
您需要登录后才可以回帖 登录 | 立即注册  

本版积分规则

快速回复 返回顶部 返回列表