日常のまとめ
6109 ワード
iotop -oP
cat >/etc/cni/net.d/10-calico.conf <:",
"log_level": "info",
"ipam": {
"type": "calico-ipam"
},
"policy": {
"type": "k8s"
},
"kubernetes": {
"kubeconfig": ""
}
}
EOF
dd if=/dev/zero of=test bs=1M count=1000
$ pwd
/var/lib/docker/overlay2
$ du -sh * |grep G
729G 41a07bece78bbb208445be8d8798f075313a8499a267a09765efe8c52ff10568
$ docker ps |grep -v pause|awk '{print $1}'|xargs docker inspect --format='{{json .GraphDriver.Data.MergedDir}} {{.Config.Hostname}}' |grep 41a07bece78bbb208445be8d8798f075313a8499a267a09765efe8c52ff10568
"/var/lib/docker/overlay2/41a07bece78bbb208445be8d8798f075313a8499a267a09765efe8c52ff10568/merged" ********-8678f96449-qjn9r
java -jar jenkins-cli.jar -s http://admin:****@jenkins.***.cn/ delete-job NAME
https://opsx.alibaba.com/mirror
07 20 * * * /opt/kube/bin/kubectl scale -n prod deployment/ai-airflow-schedule-master --replicas=0 && sleep 1 && /opt/kube/bin/kubectl scale -n prod deployment/ai-airflow-schedule-master --replicas=1
nslookup -q=A xxx.com 1.1.1.1
dig xxx.com
ping xxx.com
kubectl describe pv |grep /kubernetes-dynamic-pvc-913bdde6-65b0-11e9-9301-8665fb02ae94 -C 10|grep Claim
alimaven
aliyun maven
http://maven.aliyun.com/nexus/content/groups/public/
central
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
wget https://dl.k8s.io/v1.12.10/kubernetes-server-linux-amd64.tar.gz
$ EXCLAIM=cowabunga
$ echo ${EXCLAIM:0:3}
ps -A -o stat,ppid,pid,cmd | grep -e '^[Zz]'
find /proc/*/task -maxdepth 0 -type d |wc -l
find /proc/*/task -maxdepth 0 -type d |while read dir; do count=$(ls "$dir" | wc -l); echo "$dir : $count"; done
find /proc/*/fd -maxdepth 1 -type d | while read dir; do count=$(find "$dir" | wc -l); echo "$dir : $count"; done
getfattr -d -m ceph.dir.* .|grep bytes|tr -cd "[0-9]"|awk 'BEGIN{sum=0}{sum+=$1}END{print sum/1024/1024/1024}'
getfattr -d -m ceph.dir.* .|grep rfiles|tr -cd "[0-9]"
kubectl get ingress -n gray -o=jsonpath='{range .items[*]}{"
"}{.metadata.name}{":\t"}{range .spec.rules[*]}{range .http.paths[*]}{.backend.servicePort}{end}{end}{end}'
ctrl + j
# region
aws configure
# docker ECR
aws ecr get-login
# 【-e node 】
docker login -u AWS --password ****** https://******.dkr.ecr.us-west-2.amazonaws.com
openssl x509 -in ***.crt -noout -dates
| python -m json.tool
| jq
command: ["sleep","infinity"] 【 sleep 】
command: ["cat","/dev/random"]
#
echo "******" |base64 -d
#
echo "******" |base64
apk add --no-cache busybox-extras
find ./ -maxdepth 1 -type d | while read dir; do count=$(find "$dir" -type f | wc -l); echo "$dir : $count"; done
# :
ca.pem 【 】
admin.pem 【admin 】
admin-key.pem 【admin 】
# registry
reg ls -k --auth-url harbor.test.com -u admin -p **** harbor.test.com
# 【 MB】
reg manifest -k --auth-url harbor.test.com -u admin -p **** harbor.test.com/helper/test:latest |grep size|awk '{print $2}'|sed 's/.$//'|awk 'BEGIN{sum=0}{sum+=$1}END{print sum/1024/1024}'
#
apps=`/usr/local/bin/reg ls -k --auth-url harbor.test.com -u admin -p **** harbor.paas.shein.io|grep -v TAGS|grep -v Repositories|awk '{print $1":"$2}'|tr -d ","`
arr=(${apps// / })
for app in ${arr[@]} ; do /usr/local/bin/reg manifest -k --auth-url harbor.test.com -u admin -p **** harbor.test.com/${app} |grep size|awk '{print $2}'|sed 's/.$//'|awk 'BEGIN{sum=0}{sum+=$1}END{printf sum/1024/1024 }' && echo " "$app; done
pkill -SIGHUP dockerd
nslookup www.baidu.com |grep Name: -A 2|grep Address:| awk '{print $2}'
find /etc/kubernetes/ssl/ -type f -name "*.pem" | xargs grep -Hn --color=auto "Y0Q=="
for (( i=0; i < max; i++ )); do echo "output: $i"; done
# docs.docker.com Docker, Docker, nvidia-docker
# https://jaywcjlove.gitee.io/linux-command