2018年2月

个性化Shell命令提示符及颜色

一键命令

echo "PS1='\[\e[1;32;40m\][\t \u@\h \W]\$ \[\e[0m\]'" >> ~/.bashrc && source ~/.bashrc

先贴个我的配置:

PS1='\[\e[1;32;40m\][\t \u@\h \W]\$ \[\e[0m\]'

显示样式:

[11:14:57 root@centos7 /]#

其他样式:

PS1='\[\e[1;32;40m\][\u@\h:\t \W]\$ \[\e[0m\]'

显示样式:

[root@centos7:11:11:25 ~]$ 

Shell命令提示符及颜色是由.bashrc里面的PS1环境变量控制的,所以我们修改PS1即可。

- 阅读剩余部分 -

nginx端口映射tcp

添加到

/etc/nginx/nginx.conf

添加内容:

stream {
    upstream ssr {
        hash $remote_addr consistent;
        server 127.0.0.1:31905 weight=5 max_fails=3 fail_timeout=30s;
    }
    server {
       listen 4008;
       proxy_connect_timeout 1s;
       proxy_timeout 3s;
       proxy_pass ssr;
    }
}

监听4008,映射到127.0.0.1:31905,名字ssr