小鱼博客

随记摘录

View My GitHub Profile

常用Linux命令

Google DDNS

curl -4qsu user:password https://domains.google.com/nic/update?hostname=domain.tld>/dev/null

网络加速

echo "net.ipv4.tcp_fastopen = 3" >> /etc/sysctl.conf
echo "net.core.default_qdisc = fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control = bbr" >> /etc/sysctl.conf
sysctl -p

CoreOS初始化

# 网络加速
echo "net.ipv4.tcp_fastopen = 3" >> /etc/sysctl.d/image.conf
echo "net.core.default_qdisc = fq" >> /etc/sysctl.d/image.conf
echo "net.ipv4.tcp_congestion_control = bbr" >> /etc/sysctl.d/image.conf
sysctl --system

# 容器配置
systemctl enable docker
mkdir -p /opt/bin/
curl -L https://github.com/docker/compose/releases/download/1.19.0/docker-compose-`uname -s`-`uname -m` -o /opt/bin/docker-compose
chmod +x /opt/bin/docker-compose

Let’t Encrypt证书续期

docker run --rm -ti -v ./letsencrypt:/etc/letsencrypt -p 80:80 deliverous/certbot -q renew

Docker Compose 的 Docker 化

echo alias docker-compose="'"'docker run \
    --rm \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v "$PWD:/rootfs/$PWD" \
    -w="/rootfs/$PWD" \
    docker/compose:1.21.2'"'" >> ~/.bashrc
source ~/.bashrc