内网服务越堆越多,日志全靠 tail 和 grep,出问题得挨个容器找。想找个开源可观测平台,ELK 太重,Loki 查询语法劝退,最后选了 OpenObserve(下称 O2)–单容器、Rust 写的、资源占用小。两天时间从零部署,再用 Vector 把 Nginx Proxy Manager 的访问日志接进去,全流程记一下。

阅读全文 »

hexo 博客想接 twikoo 评论,前后端折腾了一晚上。前端好接,后端在大陆能访问才是真问题。Vercel 部署的后端在大陆连不上,换 Netlify 立刻就通了。完整过程记一下,省得下次再踩。

阅读全文 »

把内网几台机器的 HTTPS 反代统一收到 Nginx Proxy Manager (NPM)。之前手写 nginx + acme.sh 续期用了四年,撑到 5+ 域名开始漏续期,换成 NPM。

阅读全文 »

系统

系统方面,目前经基本测试,最好选择ubuntu 22 LTS。
图省事的话,可以直接选择desktop 22 LTS版本,英伟达驱动基本自动能装好,
硬件设备:intel 14、3090 24GB

测试驱动是否安装成功

1
nvidia-smi

应该显示类似输出

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.107.02 Driver Version: 550.107.02 CUDA Version: 12.4 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 3090 Off | 00000000:01:00.0 Off | N/A |
| 0% 44C P8 26W / 350W | 109MiB / 24576MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| 0 N/A N/A 1304 G /usr/lib/xorg/Xorg 86MiB |
+-----------------------------------------------------------------------------------------+

驱动

1.参考英伟达官方教程
2.参考英伟达CUDA Toolkit
3.参考英伟达cuDNN

阅读全文 »

初现

将mbp 重置后安装Xcode,调试模拟器没问题,真机debug出现process launch failed: Unspecified。各种尝试无果后(清理项目、重装Xcode、卸载app、重启手机)后检查证书发现开发者证书不被信任。

方案

后根据这篇文章 下载apple 开发者证书,后得到解决。

目前的Apple全球开发者关系认证中间证书WWDRCA(也就是我们上面下载的那个)将于2023年2月7日到期。Apple发布了新的WWDRCA,更新后的证书过期时间为2030年2月20日,新证书将用于签署2021年1月28日后为苹果开发者项目颁发的新软件签名证书。

Apple证书列表:

https://www.apple.com/certificateauthority/

一般只要下载特定中间证书就行了,如果不能确认,可以把前缀为Worldwide Developer Relations的全部下载下来,再一个个安装。直到iphone 开发证书变为可信证书。

ACME 自动申请及管理证书

安装acme.sh

执行以下命令,acme.sh 会安装到 ~/.acme.sh 目录下。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
curl  https://get.acme.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 671 100 671 0 0 680 0 --:--:-- --:--:-- --:--:-- 679
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 112k 100 112k 0 0 690k 0 --:--:-- --:--:-- --:--:-- 693k
[Fri 30 Dec 01:03:32 GMT 2016] Installing from online archive.
[Fri 30 Dec 01:03:32 GMT 2016] Downloading https://github.com/Neilpang/acme.sh/archive/master.tar.gz
[Fri 30 Dec 01:03:33 GMT 2016] Extracting master.tar.gz
[Fri 30 Dec 01:03:33 GMT 2016] Installing to /home/user/.acme.sh
[Fri 30 Dec 01:03:33 GMT 2016] Installed to /home/user/.acme.sh/acme.sh
[Fri 30 Dec 01:03:33 GMT 2016] Installing alias to '/home/user/.profile'
[Fri 30 Dec 01:03:33 GMT 2016] OK, Close and reopen your terminal to start using acme.sh
[Fri 30 Dec 01:03:33 GMT 2016] Installing cron job
no crontab for user
no crontab for user
[Fri 30 Dec 01:03:33 GMT 2016] Good, bash is found, so change the shebang to use bash as preferred.
[Fri 30 Dec 01:03:33 GMT 2016] OK
[Fri 30 Dec 01:03:33 GMT 2016] Install success!

安装成功后执行 source ~/.bashrc 以确保脚本所设置的命令别名生效。

如果安装报错,那么可能是因为系统缺少 acme.sh 所需要的依赖项,acme.sh 的依赖项主要是 netcat(nc),我们通过以下命令来安装这些依赖项,然后重新安装一遍 acme.sh:

1
apt -y install netcat socat
阅读全文 »

同步 + rpc

  • http

    1
    geth --datadir /mnt/eth/data --rpc --rpcaddr 0.0.0.0 --rpcport 28545 --rpcapi personal???db,eth,net,web3
  • ws

    1
    geth --datadir ./geth-data --dev --ws --ws.port 13334 --ws.api eth,net,web3,miner,personal --verbosity 3

--dev 开发模式
--allow-insecure-unlock 允许本地解锁,线上需关闭
--verbosity 3 日志等级 默认3

常用命令

1
geth attach ./geth-data/geth.ipc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
> eth.accounts // 查看账户

> eth.accounts[0] // 查看特定钱包地址

> eth.getBalance(eth.accounts[0]) // 查询eth 余额

> eth.sendTransaction({from: eth.accounts[0] , to: eth.accounts[1], value: web3.toWei(10, "ether")}) // 转账

> eth.blockNumber // 查询区块高度

> personal.newAccount("password") //创建用户

> miner.start() //开始当前用户挖矿

> miner.stop() //停止当前用户挖矿

> eth.getTransaction("txid") // 根据txID查询交易

> eth.getTransactionReceipt("txid") //根据txID 查询交易结果

> personal.unlockAccount(eth.accounts[1]) // 解锁用户

近日将DS214play 淘汰换成 DS216+ii,终于可以docker愉快的玩耍

这里选用数据库用PostgreSql,Drone 的原话是推荐使用PostgreSql。

We strongly recommend using postgres instead of mysql. The system has been optimized for features not found in mysql.

所以,这里我们gitea同样也使用 Postgres 一个数据库搞定

阅读全文 »

dump 数据库

1
mysqldump -u[user] -p[password] [db] [filePath]

复制数据库

本地复制

1
mysqldump -u[user] -p[password] [db] | mysql -h127.0.0.1 -u[user] -p[password] [db]

本地中转 复制到远程

1
ssh [root]@[ip] "mysqldump -u[user] -p[password] [db]" | ssh -C [root]@[ip] "mysql -h127.0.0.1 -u[user] -p[password] [db]"
0%