分类 服务器技术 下的文章

老高的测试环境中机器很多,每次登录都要输入密码很烦人,下面的脚本可以批量导入公钥到指定多个ip中,使用后记得把文件删除掉!

sshpass在macos下可能不好搞定,brew因为安全问题默认不给安装,可以通过别人写好的脚本来安装,其他系统自己想办法!很简单。 brew install https://raw.githubusercontent.com/kadwanev/bigboybrew/master/Library/Formula/sshpass.rb

阅读剩余部分

alpine

注:如果有@test或者@edge,可以先add后在sed

sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories

ubuntu

sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list && \
     sed -i 's/security.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list

感谢ustc

brew 以及 homebrew-core

# 替换brew.git:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

# 替换homebrew-core.git:

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

bottles

# 对于bash用户:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

# 对于zsh用户
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc

重置

# 重置brew.git:
cd "$(brew --repo)"
git remote set-url origin https://github.com/Homebrew/brew.git

# 重置homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://github.com/Homebrew/homebrew-core.git

老高才入坑qnap(威联通),在ssh到NAS后,发现没有常用的zsh、git、sudo,这可让用惯了centos,debian系统的老高情何以堪。

一番查阅后,老高发现原来QNAP所使用的系统QTS可以使用Entware,也就是opkg最为包管理系统,这不就简单了,老高以前在OpenWrt上用的就是这个玩意儿!

本篇内容可以让你学会如何在QNAP上安装Entware-ng,以及zsh,git,sudo还有ohmyzsh等常用工具,并且保证他们不会被系统还原!

阅读剩余部分

老高于今年(2019)初收到了搬瓦工要停止OPENVZ的旧版服务器,同时列表中auto renew的选项被强制置灰。9.9刀的绝版服务器就这样被印上了大大的字,而且还是两台!😂

跑数据库的那台机器4月到期,于是把数据库先迁移了,跑在一台内存1G的机器上,由于上面还跑了一个git服务和ss,剩余内存也就400MB左右。下来就剩web服务器了,一看8月到期,先就这样吧!

于是就一晃到了今天。。。

阅读剩余部分