安装
curl -fsSL https://code-server.dev/install.sh | sh
编辑配置文件,放开监听端口
vi ~/.config/code-server/config.yaml
ufw allow
开机启动
sudo systemctl enable --now code-server@$USER
手工启动
code-server
在控制台添加函数
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
}
if(!filename) filename = 'console.json'
var blob = new Blob([data], {type: 'text/json'}),
e = document.createEvent('MouseEvents'),
a = document.createElement('a')
a.download = filename
a.href = window.URL.createObjectURL(blob)
a.dataset.downloadurl = ['text/json', a.download, a.href].join(':')
e.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null)
a.dispatchEvent(e)
}
})(console)
执行导出
console(temp1,1.txt)
rclone安装
curl https://rclone.org/install.sh | sudo bash
oracle cloud客户密钥申请
获取存储桶信息及区域
查看存储桶详细,获取“名称空间”(Namespace)
区域即存储桶所在区域,比如韩国春川(ap-chuncheon-1)
rclone配置
按照客户密钥及存储桶信息生成配置。在ubuntu环境下,rclone的配置文件位于"~/.config/rclone/rclone.conf",在一个环境配置好后,可直接复制文件到相应位置
rclone config
按提示依次输入信息,输入完后配置项及说明如下如下:
#cloud为rclone config中输入到配置名称
[cloud]
type = s3
provider = Other
access_key_id =
secret_access_key =
# 替换Namespace及ap-chuncheon-1
endpoint = https://Namespace.compat.objectstorage.ap-chuncheon-1.oraclecloud.com
acl = private
region = ap-chuncheon-1
bucket_acl = private
挂载/卸载本地目录
挂载(cloud为配置到名称)
rclone mount cloud:/ 本地目录 --copy-links --allow-other --allow-non-empty --umask 000 --daemon
卸载
fusermount -qzu 本地目录
其他常用操作
不挂载查看文件
rclone ls cloud:/
cdn.bootcss.com域名已变更
安装MongoDB
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
apt-get update
apt-get install -y mongodb-org
systemctl start mongod
备份还原数据库
备份
mongodump --port 27017 --db leanote -o /data/leanoteBackUp/
还原
mongorestore -h 127.0.0.1:27017 -d leanote /developer/data/leanoteBackUp/leanote -u=root -p=xxxx
rndc生成配置文件
rndc-confgen > /etc/rndc.conf
密钥覆盖到 /etc/rndc.key
named配置文件调整
刷新域名
rndc freeze example.com
rndc thaw example.com
#!/bin/bash
echo root:password |sudo chpasswd root
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config;
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
sudo service sshd restart
安装
yum -y install bind bind-chroot bind-utils
生成更新密钥
//采用HMAC-MD5
dnssec-keygen -a HMAC-MD5 -b 128 -n USER dnskey
//采用HMAC-SHA1,go-nsupdate不支持HMAC-MD5
dnssec-keygen -a HMAC-SHA1 -T KEY -b 128 -n USER dnskey
调整监听端口及密文
vi /etc/named.conf
key "dnskey" {
algorithm hmac-md5;
//algorithm hmac-sha1;
secret "secret_key";
}
添加域名
vi /etc/named.rfc1912.zones
zone "test.cn" IN {
type master;
file "named.test";
allow-update { key dnskey; };
};
添加域名配置并修改信息
cp /var/named/named.localhost /var/named/named.test
重启named
systemctl restart named
客户端更新
nsupdate -y dnskey:secret_key
//nsupdate默认为hmac-md5,非该类型要指定加密方式
//nsupdate -y hmac-sha1: dnskey:secret_key
> server x.x.x.x
> update add test.cn 86400 A 3.3.3.3
> send
> quit
//go-nsupdate 更新
./go-nsupdate -i enp0s3 --server=x.x.x.x --interface-family=ipv4 --tsig-algorithm=hmac-sha1 --tsig-name=dnskey --tsig-secret=secret_key --zone=test.cn a1.test.cn -v
核对记录
dig @X.X.X.X test.cn
查看日