awesome

git配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
GIT_SSL_NO_VERIFY=true

git config --global http.sslVerify false
git config --global core.autocrlf false
git config --global core.safecrlf true
git config --global core.editor vim
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto

git config --global credential.helper store # 保存密码
git config --global user.name "xxx"
git config --global user.email "xxx"
git config --global http.proxy xxx
git config --global http.postBuffer 52428800000

git commit --amend --author="ikaven1024 <ikaven1024@gmail.com>"

拉取部分代码

1
2
git config core.sparsecheckout true   #开启sparse clone
echo "devops" >> .git/info/sparse-checkout #设置过滤条件,*表示所有,!表示匹配相反的

yum清缓存

1
yum makecache

docker代理

/usr/lib/systemd/system/docker.service:

1
Environment="HTTP_PROXY=http://10.194.209.5:3128" "NO_PROXY=localhost,127.0.0.1,docker.hikvision.com.cn"

docker配置

1
2
sudo groupadd docker
sudo usermod -aG docker $USER
1
2
3
4
5
6
7
8
9
10
11
12
13
mkdir -p /etc/docker && cat >/etc/docker/daemon.json <<-EOF
{
"host": "unix:///var/run/docker.sock tcp://0.0.0.0:2375",
"insecure-registries": ["xxx"],
"registry-mirrors": ["xxx"],
"log-level": "debug",
"log-driver": "json-file",
"log-opts": {
"max-size": "200m",
"max-file": "1"
}
}
EOF

Boot2Docker用户名密码

docker tcuser
root docker用户下执行sudo -i

k8s

1
2
kubectl cluster-info
printf "%-20s %-50s %-15s %-20s %-20s \n" NameSpace "Pod Name" Status "Pod IP" "Host IP" `kubectl get pod --output go-template --template="{{range .items}} {{.metadata.namespace}} {{.metadata.name}} {{.status.phase}} {{.status.podIP}} {{.status.hostIP}}{{end}}" --all-namespaces`

编译关键组件:

1
make WHAT='cmd/kube-apiserver cmd/kube-controller-manager cmd/kubelet cmd/kube-proxy cmd/kubectl plugin/cmd/kube-scheduler'

RBD

rbd –pool rbd –id admin -m 192.168.1.187 –key=AQA0xWtYn98iOxAAMSsJbhGwuxyFVg9aIAvFoA== ls

代码统计利器

cloc

SHELL

1
basepath=(cd `dirname 0`; pwd)

go vendor

1
2
3
go get -u -v github.com/kardianos/govendor
govendor init
govendor add +external

ansible

1
2
3
ansible localhost -m setup

ansible all -m shell -a date

dns配置

1
2
/etc/resolv.conf
nameserver xxx.xxx.xxx.xxx

screen

1
2
3
4
5
// 进入screen
su stack
script /dev/null
screen -ls
screen -x stack
显示 Gitment 评论