常用配置

阿里NTP

ntp.aliyun.com
ntp1.aliyun.com
ntp2.aliyun.com
ntp3.aliyun.com
ntp4.aliyun.com
ntp5.aliyun.com
ntp6.aliyun.com
ntp7.aliyun.com

阿里DNS

nameserver 223.5.5.5
nameserver 223.6.6.6

vimrc

set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set fencs=utf8,gbk,gb2312,gb18030
set termencoding=utf-8
set encoding=utf-8
set enc=utf8

set autoindent     " 换行自动缩进
set shiftwidth=4   " 自动缩进时的宽度
set ts=4           " tabstop的宽度
set expandtab      " tab换成空格
set softtabstop=4  " 退格键
"set paste          " 粘贴时不自动换行
hi comment ctermfg=6 " 改变comment 文字高亮问题,参考 https://blog.csdn.net/gz109/article/details/18733365

" 显示行尾空格和tab
highlight ExtraWhitespace ctermbg=red guibg=darkgreen
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$\| \+\ze\t/

常用操作

删除行首的空格
:%s/^\s\+
删除行尾的空格
:%s/\s\+$

s3cmd config

生成配置

s3cmd --configure \
        --access_key=<access_key> \
        --secret_key=<secret_key> \
        --region=<region> \
        --host=<endpoint> \
        --host-bucket=<endpoint> \
        --no-ssl

最小配置

[default]
access_key = <access_key>
secret_key = <secret_key>
bucket_location = <region>
host_base = <endpoint>
host_bucket = <endpoint>
use_https = False
signature_v2 = False # false represent s3v4

pip 安装

get-pip.py

curl http://qinius.echosoul.cn/get-pip.py | /usr/bin/python

pip 本地配置文件

  • linux 目录 ~/.pip/pip.conf
  • windows 地址栏 %APPDATA%目录下新建pip目录,创建pip.ini文件
[global]
index-url=https://pypi.douban.com/simple/
extra-index-url=http://mirrors.aliyun.com/pypi/simple/
        https://pypi.tuna.tsinghua.edu.cn/simple/
        http://pypi.mirrors.ustc.edu.cn/simple/
timeout=20
[install]
trusted-host=pypi.douban.com
        mirrors.aliyun.com
        pypi.tuna.tsinghua.edu.cn
        pypi.mirrors.ustc.edu.cn
[freeze]
timeout = 10

docker 加速配置

{
    "registry-mirrors": [
		"https://9dqq20h8.mirror.aliyuncs.com",
		"https://docker.mirrors.ustc.edu.cn"
	],
    "graph": "/mydata/lib/docker",
    "bip": "172.20.0.1/24"
}

repos

centos

##################################################
# /etc/yum.repos.d/aliyun.repo

[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=0

[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=0

[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=0

[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://mirrors.aliyun.com/epel/7/$basearch
gpgcheck=0
##################################################
[base]
name=CentOS-6
failovermethod=priority
baseurl=http://mirrors.sohu.com/centos/6.10/os/x86_64/

ubuntu

##################################################
# add below to /etc/apt/sources.list

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main
deb http://openresty.org/package/ubuntu trusty main
##################################################

##################################################
# add below to /etc/apt/sources.list

deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main
deb http://openresty.org/package/ubuntu xenial main
##################################################

debian

##################################################
# debian10
# add below to /etc/apt/sources.list

deb https://mirrors.aliyun.com/debian  stable main contrib non-free
deb https://mirrors.aliyun.com/debian  stable-updates main contrib non-free
##################################################

NeoKylin

##################################################
# NeoKylin Linux Server 7.0
# /etc/yum.repos.d/ns7-mips.repo
[ns7-mips64el-os]
name=NeoKylin Linux Advanced Server 7 - Os
baseurl=http://download.cs2c.com.cn/neokylin/server/releases/7.0/ls_64/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-neokylin-release
enabled=1

[ns7-mips64el-extras]
name=NeoKylin Linux Advanced Server 7 - Addons
baseurl=http://download.cs2c.com.cn/neokylin/server/everything/7.0/ls_64/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-neokylin-release
enabled=1

[ns7-mips64el-updates]
name=NeoKylin Linux Advanced Server 7 - Updates
baseurl=http://download.cs2c.com.cn/neokylin/server/updates/7.0/ls_64/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-neokylin-release
enabled=1
##################################################

Kylin

##################################################
# Kylin Linux Server V10
# /etc/yum.repos.d/ns7-mips.repo
[ns7-mips64el-os]
name=NeoKylin Linux Advanced Server 7 - Os
baseurl=http://download.cs2c.com.cn/neokylin/server/releases/v10/ls_64/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-neokylin-release
enabled=1

[ns7-mips64el-extras]
name=NeoKylin Linux Advanced Server 7 - Addons
baseurl=http://download.cs2c.com.cn/neokylin/server/everything/v10/ls_64/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-neokylin-release
enabled=1

[ns7-mips64el-updates]
name=NeoKylin Linux Advanced Server 7 - Updates
baseurl=http://download.cs2c.com.cn/neokylin/server/updates/v10/ls_64/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-neokylin-release
enabled=1

gem源配置

$ gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
$ gem sources -l
https://gems.ruby-china.com
# 确保只有 gems.ruby-china.com

参考这里

linux 发行版

git

git config color.ui true
git config push.default simple
git config core.editor vim
git config user.name "PoplarYang"
git config user.email "echohiyang@foxmail.com"
git config --add core.filemode false # 不追踪文件权限的更改

网卡配置

TYPE=Ethernet
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static

IPADDR=2.3.4.5
NETMASK=255.255.255.0
GATEWAY=1.1.1.1
DNS=8.8.8.8

go加速器

go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.io,direct

# 设置不走 proxy 的私有仓库,多个用逗号相隔(可选)
go env -w GOPRIVATE=*.corp.example.com

# 设置不走 proxy 的私有组织(可选)
go env -w GOPRIVATE=example.com/org_name
posted @ 2020-04-03 22:26  hiyang  阅读(225)  评论(0)    收藏  举报