脚本记录

树莓派替换国内源

sudo vim /etc/apt/sources.list
:%s/ports.ubuntu.com/mirrors.aliyun.com/g

:%s/archive.ubuntu.com/mirrors.aliyun.com/g
:wq
sudo apt update

sudo sed -i "s@http://.*archive.ubuntu.com@http://mirrors.aliyun.com@g" /etc/apt/sources.list
sudo sed -i "s@http://.*security.ubuntu.com@http://mirrors.aliyun.com@g" /etc/apt/sources.list


sudo sed -i -e 's%http://archive.ubuntu.com/ubuntu%mirror://mirrors.ubuntu.com/mirrors.txt%' -e 's/^deb-src/#deb-src/' /etc/apt/sources.list

测试mirror
curl -s http://mirrors.ubuntu.com/CN.txt | xargs  -I {} sh -c 'echo `curl -r 0-102400 -s -w %{speed_download} -o /dev/null {}/ls-lR.gz` {}' |sort -g -r |head -1| awk '{ print $2  }'

修改主机名称

sudo hostnamectl set-hostname <newhostname>
vim /etc/hosts

生成rsa

ssh-keygen -t rsa -b 4096 -C "suglow006@gmail.com"
ssh-copy-id -i ~/.ssh/id_rsa.pub suglow006@192.168.31.244

remote-docker

https://code.visualstudio.com/docs/containers/ssh

windows启动ssh-agent

sc config ssh-agent start=auto
net start ssh-agent

docker 去除sudo

sudo cat /etc/group | grep docker
如果不存在docker组,可以添加sudo groupadd docker
添加当前用户到docker组,sudo gpasswd -a ${USER} docker
重启docker服务,sudo service docker restart
如果权限不够,sudo chmod a+rw /var/run/docker.sock

wgetrc

http_proxy=127.0.0.1:8080
https_proxy=127.0.0.1:8080
check_certificate = off
wget --no-check-certificate

docker 镜像

sudo vim /etc/docker/daemon.json

{
  "registry-mirrors": ["https://registry.docker-cn.com",
  "http://hub-mirror.c.163.com",
  "https://docker.mirrors.ustc.edu.cn",
  "https://c0tc5sed.mirror.aliyuncs.com"]
}

llvm 编译

-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DCMAKE_BUILD_TYPE=Release

github token

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

aliyun ddns

https://github.com/risfeng/aliyun-ddns-shell

文档更新时间: 2022-06-15 01:50   作者:suglow