Typecho 使用 ChatGPT 为博客自动生成简介/摘要

安装插件

idealclover/AISummary-Typecho 安装插件就不多说了,就丢到插件目录里,重命名

设置插件

提升词

我所用的提升词如下: 你的任务是生成文章的摘要。请你根据以下文章内容生成 100 字内的摘要,內容尽量针对 seo 优化,请不要带有链接,除了你生成的摘要内容,请不要输出其他任何无关内容。

模型

一般来说gpt-3.5-turbo-16k够用了,或者 gpt4 也行

CSS

.aisummary {
  background-color: #f0f0f0;
  padding: 20px;
  border-radius: 5px;
  margin-bottom: 20px;
}

.aisummary p {
  font-size: 16px;
  line-height: 1.5;
  color: #333;
}

.aisummary a {
  color: #007bff;
  text-decoration: none;
}

.aisummary a:hover {
  text-decoration: underline;
}

自动同步到简介

<script>window.addEventListener("load",(function(){var t=document.getElementById("ai"),e=document.querySelector('meta[name="description"]');t&&e&&e.setAttribute("content",t.textContent)}));</script>

`测试过 google 可用,bing 未知,至少我的没有成功

Tyepcho 博客添加 Open Graph 图片

在 Typecho 中使用:

<meta property="og:image" content="//example.org/og/?title=<?php $this->title(); ?>&des=<?php $this->description(); ?>"/>
<?php

function og($title, $des) {
    $img = imagecreatefrompng('./bg.png');
    $black = imagecolorallocate($img, 0, 0, 0);
    $title_font = './ZhanKuKuaiLeTi2016XiuDingBan-1.ttf';
    $desc_font = './ZhanKuKuaiLeTi2016XiuDingBan-1.ttf';
    $title_lines = explode("\n", wordwrap($title, 30, "\n", true));
    $desc_lines = explode("\n", wordwrap($des, 60, "\n", true));
    $title_y = 60;
    $desc_y = 200;

    foreach ($title_lines as $line) {
        imagettftext($img, 55, 0, 10, $title_y, $black, $title_font, $line);
        $title_y += 65;
    }

    foreach ($desc_lines as $line) {
        imagettftext($img, 25, 0, 10, $desc_y, $black, $desc_font, $line);
        $desc_y += 30;
    }

    header('Content-Type: image/png');
    imagepng($img);
    imagedestroy($img);
}

// Retrieve title and description from URL parameters
$title = isset($_GET['title']) ? $_GET['title'] : 'Default Title';
$des = isset($_GET['des']) ? $_GET['des'] : 'Default Description';

// Example usage:
og($title, $des);
?>

Ubuntu 搭建欧卡 2/美卡联机服务器 详细教程

理论上适用於美卡和欧卡,但是本文基于欧卡,美卡请自行探索~ 两款游戏经常打折,最低价 11,日常 30 多 高于 30 不建议买,另外,DLC 也是建议打折再买,可以省下不少钱

steamcmd 安装

From

sudo add-apt-repository multiverse; sudo dpkg --add-architecture i386; sudo apt update 
sudo apt install steamcmd
steamcmd
login anonymous

这里需要注意: 欧卡 id: 1948160 美卡 id: 2239530 这里以欧卡为例 app_update 1948160

安装后 cd 到游戏目录 cd '/Steam/steamapps/common/Euro Truck Simulator 2 Dedicated Server'

到这里,安装的部分就告一段落了

获取配置文件

在游戏中按~这个键,输入export_server_packages 然后打开Documents\Euro Truck Simulator 2 找到server_packages.dat,server_packages.sii 复制到save

启动

cd '/Steam/steamapps/common/Euro Truck Simulator 2 Dedicated Server/bin/linux_x64/'
chmod -xxx server_launch.sh
./server_launch.sh

公开列表

如果想让服务器公开到运联列表(默认是只能搜索数字的) 在这部折腾好久,最后发现欧卡的搜索有点问题,我打开的选择性模组然后就搜不到啦~ server_config.sii: 确保mods_optioning: false不然搜不到,并且show_server: true打开

打开 steam: https://steamcommunity.com/dev/managegameservers 欧卡 id: 1948160 美卡 id: 2239530 把获取到的 key 放到server_config.siiserver_logon_token

管理员

建议把自己设置为管理员 获取自己 steam id 的步骤: 打开 steam,点击右上角用户名,在左上角标题下面那行小字就是 id 啦 最后在server_config.sii:

moderator_list: 1
 moderator_list[0]: 你的 steamid

“`开始快乐的卡车生涯吧~ 说实话 tmp 更好玩