0%

centos 安装 trojan记录

  1. 从shadowsock上复制配置
    点击齿轮图标 icon-config.png 打开单节点的配置窗口,点击 复制配置 即可复制节点配置
    ssl 的 verfiy 改为 false,我觉得应该不用改,可以验证一下

  2. 启动后我以为就是设置http_proxy为127.0.0.1:1080
    其实不是,1080是socks5的,要再下载一个privoxy

    1
    2
    yum install -y privoxy

  3. 改privoxy配置

    1
    2
    3
    4
    vim /etc/privoxy/config
    # 末尾增加下面内容,/后面是代理服务器的地址:端口,注意最后还有个.

    forward-socks5t / 127.0.0.1:1080 .
  4. 启动privoxy

    1
    systemctl start privoxy
  5. 设置http_proxy

    1
    2
    3
    export https_proxy=http://127.0.0.1:8118
    export http_proxy=http://127.0.0.1:8118
    export all_proxy=http://127.0.0.1:8118
  6. 这时再去访问openai网站

    1
    2
    3
    4
    5
    6
    7
    8
    curl https://api.openai.com/v1/chat/completions \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer YOUR_API_KEY' \
    -d '{
    "model": "gpt-3.5-turbo",
    "messages": [{"role": "user", "content": "Hello!"}]
    }'

  7. 参考
    Centos7 客户端使用Trojan代理配置

GPT-3是由OpenAI开发的自然语言处理模型,于2020年发布。以下是相关论文列表:

Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., … & Amodei, D. (2020). Language models are few-shot learners. arXiv preprint arXiv:2005.14165.
Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., & Sutskever, I. (2019). Language models are unsupervised multitask learners. OpenAI blog, 1(8), 9.
Radford, A., Narasimhan, K., Salimans, T., & Sutskever, I. (2018). Improving language understanding by generative pre-training. URL https://s3-us-west-2. amazonaws. com/openai-assets/researchcovers/languageunsupervised/language_understanding_paper. pdf.
Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., … & Amodei, D. (2020). A large-scale study of representation learning with the transformer model. arXiv preprint arXiv:2012.15723.

其中,Brown等人在第一篇论文中介绍了GPT-3的设计和实现,提出了“few-shot learning”的思路,并通过大量实验验证了该模型的优异表现;而Radford等人在第二、三篇论文中提出了基于无监督学习的预训练方法,并演示了其在多任务学习和生成领域的应用;最后一篇论文则是对GPT-3模型进行了更深入的实验研究,探究了其表示学习能力和泛化性能等方面的特点。

使用algolia来实现文章搜索
遇到的坑:

  1. 样式错乱
    这个是本地缓存问题,清掉缓存就好了

  2. 搜索结果跳转地址不对
    因为我之前配的url是hexo.xiaohuasheng.cc,结果同步到algolia后搜索,都跳到hexo.xiaohuasheng.cc了,修改了url配置也不行,一直在hexo的目录里找,以为是哪里没改全,原来是url配置已经同步到algolia了,需要修改后再同步一次

    1
    2
    3
    hexo clean
    hexo g
    hexo algolia
  3. 新文章也要同步到搜索平台才能搜到
    所以新建后要执行hexo algolia

参考:https://blog.csdn.net/qq_45173404/article/details/122861321

查kafka数据

1
2
3
4
cd /opt/Cellar/kafka/3.4.0
./bin/kafka-topics --list --bootstrap-server localhost:9092
p4015_003
bin/kafka-console-consumer --bootstrap-server localhost:9092 --topic p4015_003 --from-beginning

1
git pull origin master 显示 timeout

但网页可以访问github.com

1
2
3
4
5
ssh -vvv git@github.com

debug1: Connecting to github.com port 22.
ssh: connect to host github.com port 22: Operation timed out

1
telnet github.com 22 连不上
1
2
3
4
➜  bang-api git:(master) telnet github.com 443
Trying 198.18.0.118...
Connected to github.com.
Escape character is '^]'.

使用的IP不是一个公网IP,同事是可以的,从同事哪里要了一个正确的IP,修改hosts

1
2
3
sudo vi /etc/hosts

20.205.243.166 github.com

然后就可以了

还以为是ubuntu系统出什么问题了
无意中看到/etc/hosts,里面写了github的

1
20.205.243.166 github.com

原来在windows下使用switchhosts也会改变ubuntu的hosts
本来想删掉刷新DNS缓存的,但没找到方法,目前是找了一个可用的IP,在switchhosts里加上了新的记录,可以了

1
2
3
4
5
6
7
8
9
10
11
12
13
14
➜  bang-api git:(p1w37) git cherry-pick 3e785fc8c072e46660c2194a6c5006e93309f08f
Auto-merging app/services/batch/copy_project.go
[p1w37 957e05d996] fix #328031 并发复制项目uuid重复的问题
Date: Mon Aug 22 15:49:05 2022 +0800
1 file changed, 4 insertions(+), 1 deletion(-)
➜ bang-api git:(p1w37) git checkout hotfix_320269
Switched to branch 'hotfix_320269'
Your branch is up to date with 'origin/hotfix_320269'.
➜ bang-api git:(hotfix_320269) git log
➜ bang-api git:(hotfix_320269) git checkout p1w37
Switched to branch 'p1w37'
Your branch is ahead of 'origin/p1w37' by 1 commit.
(use "git push" to publish your local commits)
➜ bang-api git:(p1w37) git cherry-pick -n -e cce2d9d6579a734a7f644ea811c1636a9d03a199..0c2a52efdc4bc2ca8f0c051208e68831388e197e