树莓派搭配RTL-SDR搭建APRS iGate (Direwolf)

在2024年的今天,搭建iGate早就不用像十多年前手动焊接一个TNC电路加上老旧的APRS4R了,只需一个廉价的SDR即可实现

首先我们需要安装一堆的库

sudo apt-get <span class="hljs-keyword">install</span> git
sudo apt-<span class="hljs-keyword">get</span> <span class="hljs-keyword">install</span> gcc
sudo apt-<span class="hljs-keyword">get</span> <span class="hljs-keyword">install</span> g++
sudo apt-<span class="hljs-keyword">get</span> <span class="hljs-keyword">install</span> make
sudo apt-<span class="hljs-keyword">get</span> <span class="hljs-keyword">install</span> cmake
sudo apt-<span class="hljs-keyword">get</span> <span class="hljs-keyword">install</span> libasound2-dev
sudo apt-<span class="hljs-keyword">get</span> <span class="hljs-keyword">install</span> libudev-dev
sudo apt-<span class="hljs-keyword">get</span> <span class="hljs-keyword">install</span> libavahi-<span class="hljs-keyword">client</span>-dev
sudo apt-<span class="hljs-keyword">get</span> <span class="hljs-keyword">install</span> rtl-sdr

然后是Direwolf的前置Hamlib

git clone http<span class="hljs-variable">s:</span>//github.<span class="hljs-keyword">com</span>/Hamlib/Hamlib.git
<span class="hljs-keyword">cd</span> Hamlib
./bootstrap
./configure
<span class="hljs-keyword">make</span>
sudo <span class="hljs-keyword">make</span> install

和主角Direwolf

<span class="hljs-keyword">cd</span> ~
git clone http<span class="hljs-variable">s:</span>//www.github.<span class="hljs-keyword">com</span>/wb2osz/direwolf
<span class="hljs-keyword">cd</span> direwolf
git checkout dev
<span class="hljs-built_in">mkdir</span> build && <span class="hljs-keyword">cd</span> build
cmake ..
<span class="hljs-keyword">make</span> -j4
sudo <span class="hljs-keyword">make</span> install
<span class="hljs-keyword">make</span> install-<span class="hljs-keyword">conf</span>

接下来需要建立配置文件

nano sdr.conf

ADEVICE <span class="hljs-literal">null</span> <span class="hljs-literal">null</span>
CHANNEL <span class="hljs-number">0</span>
MYCALL XXXX <span class="hljs-meta">#修改成呼号+SSID</span>
IGSERVER asia.aprs2.net <span class="hljs-meta">#一般无需修改</span>
IGLOGIN XXXX <span class="hljs-number">12345</span> <span class="hljs-meta">#输入你的呼号和密码</span>

上方的密码只是一个算法,可以参考lilmatt/callpass-js

最后,通过以下代码运行

rtl_fm -f <span class="hljs-number">144.64</span>M -s <span class="hljs-number">24000</span> -g <span class="hljs-number">48</span> - | direwolf -c /sdr.conf -r <span class="hljs-number">24000</span> -D <span class="hljs-number">1</span> -

我们还可以把它设置成开机自动运行 把上述的运行命令复制到exit 0前即可

sudo nano /etc/rc.<span class="hljs-keyword">local</span>

Ubuntu下我的世界Java开全版本服教程(1.7.x-最新版本)

首先下载最新版本的服务端,这里以我常用的PaperMC为例 另外也有Spigot,Bukkit等

安装并运行PaperMC服务端

sudo apt install openjdk-<span class="hljs-number">17</span>-jre-headless dos2unix jq
wget http<span class="hljs-variable">s:</span>//pastebin.<span class="hljs-keyword">com</span>/raw/e0UDS0dE -O paper.<span class="hljs-keyword">sh</span> && dos2unix paper.<span class="hljs-keyword">sh</span> && bash paper.<span class="hljs-keyword">sh</span>
java -jar server.jar

同意eula

<span class="hljs-built_in">echo</span> <span class="hljs-string">"eula=true"</span> > eula.txt

然后下载以下三个插件的最新版本: ViaVersion ViaBackwards ViaRewind

<span class="hljs-keyword">cd</span> plugins
curl -s http<span class="hljs-variable">s:</span>//api.github.<span class="hljs-keyword">com</span>/repos/ViaVersion/ViaVersion/releases/latest | <span class="hljs-keyword">grep</span> -<span class="hljs-keyword">o</span> <span class="hljs-string">"https://.*\.jar"</span> | wget -qi -
curl -s http<span class="hljs-variable">s:</span>//api.github.<span class="hljs-keyword">com</span>/repos/ViaVersion/ViaBackwards/releases/latest | <span class="hljs-keyword">grep</span> -<span class="hljs-keyword">o</span> <span class="hljs-string">"https://.*\.jar"</span> | wget -qi -
curl -s http<span class="hljs-variable">s:</span>//api.github.<span class="hljs-keyword">com</span>/repos/ViaVersion/ViaRewind/releases/latest | <span class="hljs-keyword">grep</span> -<span class="hljs-keyword">o</span> <span class="hljs-string">"https://.*\.jar"</span> | wget -qi -

再次启动

<span class="hljs-keyword">java </span>-<span class="hljs-keyword">jar </span>server.<span class="hljs-keyword">jar</span>

以1.7.10版本进入的截图: 

最后,祝各位新年快乐 最近实在繁忙,抱歉~

JS实现评论表情包及站外链接提醒

评论表情包

OSS文件已删除,请自行替换! 替换textarea成评论框的ID

<span class="hljs-tag"><<span class="hljs-name">span</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"sticker_box"</span>></span><span class="hljs-tag"></<span class="hljs-name">span</span>></span>
<span class="hljs-tag"><<span class="hljs-name">a</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">"toggleStickerBox()"</span> <span class="hljs-attr">a</span>=<span class="hljs-string">"#"</span>></span>表情<span class="hljs-tag"></<span class="hljs-name">a</span>></span>
<span class="hljs-tag"><<span class="hljs-name">script</span>></span><span class="javascript"><span class="hljs-keyword">const</span> stickers = [
        <span class="hljs-comment">//这里填你的图片</span>
      <span class="hljs-string">'001'</span>, <span class="hljs-string">'002'</span>, <span class="hljs-string">'003'</span>, <span class="hljs-string">'004'</span>, <span class="hljs-string">'005'</span>, <span class="hljs-string">'006'</span>, <span class="hljs-string">'007'</span>, <span class="hljs-string">'008'</span>
    ];
    <span class="hljs-keyword">const</span> stickerBox = <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'sticker_box'</span>);
    stickers.forEach(<span class="hljs-function"><span class="hljs-params">sticker</span> =></span> {
      <span class="hljs-keyword">const</span> button = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">'button'</span>);
      button.className = <span class="hljs-string">'sk'</span>;
      button.onclick = <span class="hljs-function"><span class="hljs-keyword">function</span>() </span>{
        sticker01(sticker);
      };

      <span class="hljs-keyword">const</span> img = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">'img'</span>);
      <span class="hljs-comment">//这里填图片目录</span>
      img.src = <span class="hljs-string">`//oss.wuminboke.site/sticker/<span class="hljs-subst">${sticker}</span>.webp`</span>;
      img.style.height = <span class="hljs-string">'50px'</span>;
      img.style.width = <span class="hljs-string">'50px'</span>;
      img.loading = <span class="hljs-string">"lazy"</span>;

      button.appendChild(img);
      stickerBox.appendChild(button);
    });
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">toggleStickerBox</span>() </span>{
      <span class="hljs-keyword">const</span> divToToggle = <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'sticker_box'</span>);
      divToToggle.style.display = divToToggle.style.display === <span class="hljs-string">'none'</span> ? <span class="hljs-string">'block'</span> : <span class="hljs-string">'none'</span>;
    }
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">sticker01</span>(<span class="hljs-params">stickernum</span>) </span>{
      <span class="hljs-keyword">const</span> textarea1 = <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'textarea'</span>);
      <span class="hljs-comment">//这里填图片目录</span>
      textarea1.value += <span class="hljs-string">`<img src="//oss.wuminboke.site//sticker/<span class="hljs-subst">${stickernum}</span>.webp" height="100px" width="100px">`</span>;
    }</span><span class="hljs-tag"></<span class="hljs-name">script</span>></span>

站外链接提醒

wuminboke.site替换成自己域名可直接使用

<span class="hljs-tag"><<span class="hljs-name">script</span>></span><span class="javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">links</span>()</span>{<span class="hljs-keyword">const</span> t=<span class="hljs-built_in">document</span>.querySelectorAll(<span class="hljs-string">"#post-body a"</span>),e=[<span class="hljs-string">"#"</span>],n=[{<span class="hljs-attr">url</span>:<span class="hljs-string">"github.com"</span>,<span class="hljs-attr">tag</span>:<span class="hljs-string">" - Github"</span>},{<span class="hljs-attr">url</span>:<span class="hljs-string">"t.me"</span>,<span class="hljs-attr">tag</span>:<span class="hljs-string">" - Telegram"</span>},{<span class="hljs-attr">url</span>:<span class="hljs-string">"wuminboke.site"</span>,<span class="hljs-attr">tag</span>:<span class="hljs-string">""</span>}];<span class="hljs-keyword">for</span>(<span class="hljs-keyword">let</span> u=<span class="hljs-number">0</span>;u<t.length;u++){<span class="hljs-keyword">const</span> l=t[u],o=l.href;<span class="hljs-keyword">if</span>(e.includes(o))<span class="hljs-keyword">continue</span>;<span class="hljs-keyword">const</span> i=n.find((<span class="hljs-function"><span class="hljs-params">t</span>=></span>o.includes(t.url)));l.innerText+=i?i.tag:<span class="hljs-string">" - 站外链接"</span>}}links();</span><span class="hljs-tag"></<span class="hljs-name">script</span>></span>

Docker部署Home Assistant并接入米家与ESPHome

安装Home Assistant

docker run -d \
  -<span class="ruby">-name homeassistant \
</span>  -<span class="ruby">-privileged \
</span>  -<span class="ruby">-restart=<span class="hljs-keyword">unless</span>-stopped \
</span>  -<span class="ruby">e TZ=MY_TIME_ZONE \
</span>  -<span class="ruby">v /<span class="hljs-symbol">PATH_TO_YOUR_CONFIG:</span>/config \
</span>  -<span class="ruby">v /run/<span class="hljs-symbol">dbus:</span>/run/<span class="hljs-symbol">dbus:</span>ro \
</span>  -<span class="ruby">-network=host \
</span>  ghcr.io/home-assistant/home-assistant:stable

From home-assistant.io/installation/linux

IP:8123

这里省略初始化过程,简单点击几个按钮即可

安装HACS

docker exec -it homeassistant bash
wget -O - https:<span class="hljs-regexp">//g</span>et.hacs.xyz | bash -
<span class="hljs-keyword">exit</span>
reboot

点击右下角的齿轮图标,选择 设备与服务,然后点击 添加集成 在弹出的页面中搜索 HACS,并选择进行安装。 按提示输入 GitHub 授权码完成登录。

安装Xiaomi Miot Atuo

在左侧菜单中点击 HACS,搜索 Xiaomi Miot Auto,然后选择下载安装 下载完成后,重启 Home Assistant

接入米家设备

点击左下角的齿轮图标,选择 设备与服务,然后点击 设备 点击添加设备,搜索 Xiaomi Miot Auto,并选择 Add devices using Mi Account 进行账号集成。 输入小米账号(即米家 APP 我的页面顶部的数字) 和密码。 在设备连接模式下,选择Auto

验证

回到设备页面,随便点击一个米家设备 中间的控制菜单必须有等于或多余1个控制项

安装ESPHome

这里以ESP32+DHT11温湿度传感器为例 于使用 Docker 部署,无法直接通过 Home Assistant 添加插件

docker <span class="hljs-built_in">run</span> -d  --name=<span class="hljs-string">"ESPHome"</span> -e TZ=Asia/Shanghai   -v /<span class="hljs-built_in">home</span>/esphome:/<span class="hljs-built_in">config</span>  -v /<span class="hljs-built_in">run</span>/udev:/<span class="hljs-built_in">run</span>/udev  --privileged  --restart=always  --net=host esphome/esphome

IP:6052

安装ESPHome到ESP32

点击右下角的NEW DEVICE,然后点击 OPEN ESPHOME WEB 在新页面中选择CONNECT,选择ESP32,并点击INSTALL进行安装, 安装完成后,进行WIFI配置,注意 ESP32 只支持 2.4GHz的WIFI 回到 ESPHome 页面,点击ADOPT 当出现安装页面时,直接点击右下角的STOP,我们将使用另一种更快的方法

接线

DHT11(有孔那面,由左到右) VCC DATA NC GND

VCC > 3.3V DATA > D2 NC GND > GND P.S: 这里需要注意,必须在VCC与DATA中串一个4.7kΩ的电阻

编译固件

以下配置基于我的需求,请根据实际情况进行相应修改

<span class="hljs-attr">substitutions:</span>
<span class="hljs-attr">  name:</span> esphome-web-xxxxxx
<span class="hljs-attr">  friendly_name:</span> ESPHome Web xxxxxx

<span class="hljs-attr">esphome:</span>
<span class="hljs-attr">  name:</span> ${name}
<span class="hljs-attr">  friendly_name:</span> ${friendly_name}
<span class="hljs-attr">  min_version:</span> <span class="hljs-number">2024.6</span><span class="hljs-number">.0</span>
<span class="hljs-attr">  name_add_mac_suffix:</span> <span class="hljs-literal">false</span>
<span class="hljs-attr">  project:</span>
<span class="hljs-attr">    name:</span> esphome.web
<span class="hljs-attr">    version:</span> dev

<span class="hljs-attr">esp32:</span>
<span class="hljs-attr">  board:</span> esp32dev
<span class="hljs-attr">  framework:</span>
<span class="hljs-attr">    type:</span> arduino

<span class="hljs-comment"># Enable logging</span>
<span class="hljs-attr">logger:</span>

<span class="hljs-comment"># Enable Home Assistant API</span>
<span class="hljs-attr">api:</span>

<span class="hljs-comment"># Allow Over-The-Air updates</span>
<span class="hljs-attr">ota:</span>
<span class="hljs-attr">- platform:</span> esphome

<span class="hljs-comment"># Allow provisioning Wi-Fi via serial</span>
<span class="hljs-attr">improv_serial:</span>

<span class="hljs-attr">wifi:</span>
  <span class="hljs-comment"># Set up a wifi access point</span>
<span class="hljs-attr">  ap:</span> {}

<span class="hljs-comment"># In combination with the `ap` this allows the user</span>
<span class="hljs-comment"># to provision wifi credentials to the device via WiFi AP.</span>
<span class="hljs-attr">captive_portal:</span>

<span class="hljs-attr">dashboard_import:</span>
<span class="hljs-attr">  package_import_url:</span> github://esphome/example-configs/esphome-web/esp32.yaml@main
<span class="hljs-attr">  import_full_config:</span> <span class="hljs-literal">true</span>

<span class="hljs-comment"># Sets up Bluetooth LE (Only on ESP32) to allow the user</span>
<span class="hljs-comment"># to provision wifi credentials to the device.</span>
<span class="hljs-attr">esp32_improv:</span>
<span class="hljs-attr">  authorizer:</span> none

<span class="hljs-comment"># To have a "next url" for improv serial</span>
<span class="hljs-attr">web_server:</span>

<span class="hljs-comment"># Example configuration entry</span>
<span class="hljs-attr">sensor:</span>
<span class="hljs-attr">  - platform:</span> dht
<span class="hljs-attr">    pin:</span> GPIO2 
<span class="hljs-attr">    temperature:</span>
<span class="hljs-attr">      name:</span> <span class="hljs-string">"Temperature"</span>
<span class="hljs-attr">    humidity:</span>
<span class="hljs-attr">      name:</span> <span class="hljs-string">"Humidity"</span>
<span class="hljs-attr">    update_interval:</span> <span class="hljs-number">60</span>s
pip <span class="hljs-keyword">install</span> esphome 
esphome compile <span class="hljs-number">0</span>.yaml <span class="hljs-comment">#修改成上方的yaml文件</span>

编译后的固件位于.pioenvs\esphome-web-8ffb98\firmware.bin

ESP32的IP:80 OTA Update>选择firmware.bin文件>Update

接入ESPHome

点击左下角的齿轮图标,选择 设备与服务,然后点击设备 点击添加设备,选择ESPHome,并在主机字段中输入 ESP32 的 IP 地址(注意:这里输入的是 ESP32 的 IP,而非 ESPHome 服务端的 IP) 再后回到设备页面,应该会看到设备名为 ESPHome Web xxxxxx

Armbian安装Qbittorrent Nox最新版并添加进程守护

cat << EOF > <span class="hljs-regexp">/etc/</span>apt/sources.list
deb <span class="hljs-string">http:</span><span class="hljs-comment">//ftp.de.debian.org/debian bullseye main</span>
EOF

echo <span class="hljs-string">'deb http://download.opensuse.org/repositories/home:/nikoneko:/test/Raspbian_11/ /'</span> | sudo tee <span class="hljs-regexp">/etc/</span>apt<span class="hljs-regexp">/sources.list.d/</span><span class="hljs-string">home:</span><span class="hljs-string">nikoneko:</span>test.list
curl -fsSL <span class="hljs-string">https:</span><span class="hljs-comment">//download.opensuse.org/repositories/home:nikoneko:test/Raspbian_11/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_nikoneko_test.gpg > /dev/null</span>
sudo apt update

apt --fix-broken install qbittorrent-nox -y

cat << EOF > <span class="hljs-regexp">/etc/</span>systemd<span class="hljs-regexp">/system/</span>qbittorrent-nox.service
[Unit]
Description=qBittorrent Command Line Client
After=network.target
[Service]
Type=forking
User=root
ExecStart=<span class="hljs-regexp">/usr/</span>bin/qbittorrent-nox -d --webui-port=<span class="hljs-number">8080</span>
ExecStop=<span class="hljs-regexp">/usr/</span>bin/kill -w qbittorrent-nox
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF

systemctl enable qbittorrent-nox
systemctl start qbittorrent-nox

qbittorrent-nox <span class="hljs-keyword">default</span>

The WebUI administrator username is: admin The WebUI administrator password was not set. A temporary password is provided for this session: xxxxxxxx You should set your own password in program preferences.

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

安装插件

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

设置插件

提升词

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

模型

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

CSS

<span class="hljs-selector-class">.aisummary</span> {
  <span class="hljs-attribute">background-color</span>: <span class="hljs-number">#f0f0f0</span>;
  <span class="hljs-attribute">padding</span>: <span class="hljs-number">20px</span>;
  <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">5px</span>;
  <span class="hljs-attribute">margin-bottom</span>: <span class="hljs-number">20px</span>;
}

<span class="hljs-selector-class">.aisummary</span> <span class="hljs-selector-tag">p</span> {
  <span class="hljs-attribute">font-size</span>: <span class="hljs-number">16px</span>;
  <span class="hljs-attribute">line-height</span>: <span class="hljs-number">1.5</span>;
  <span class="hljs-attribute">color</span>: <span class="hljs-number">#333</span>;
}

<span class="hljs-selector-class">.aisummary</span> <span class="hljs-selector-tag">a</span> {
  <span class="hljs-attribute">color</span>: <span class="hljs-number">#007bff</span>;
  <span class="hljs-attribute">text-decoration</span>: none;
}

<span class="hljs-selector-class">.aisummary</span> <span class="hljs-selector-tag">a</span><span class="hljs-selector-pseudo">:hover</span> {
  <span class="hljs-attribute">text-decoration</span>: underline;
}

自动同步到简介

<span class="hljs-tag"><<span class="hljs-name">script</span>></span><span class="javascript"><span class="hljs-built_in">window</span>.addEventListener(<span class="hljs-string">"load"</span>,(<span class="hljs-function"><span class="hljs-keyword">function</span>()</span>{<span class="hljs-keyword">var</span> t=<span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">"ai"</span>),e=<span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">'meta[name="description"]'</span>);t&&e&&e.setAttribute(<span class="hljs-string">"content"</span>,t.textContent)}));</span><span class="hljs-tag"></<span class="hljs-name">script</span>></span>

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

Tyepcho博客添加Open Graph图片

在Typecho中使用:

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

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

    <span class="hljs-keyword">foreach</span> ($title_lines <span class="hljs-keyword">as</span> $line) {
        imagettftext($img, <span class="hljs-number">55</span>, <span class="hljs-number">0</span>, <span class="hljs-number">10</span>, $title_y, $black, $title_font, $line);
        $title_y += <span class="hljs-number">65</span>;
    }

    <span class="hljs-keyword">foreach</span> ($desc_lines <span class="hljs-keyword">as</span> $line) {
        imagettftext($img, <span class="hljs-number">25</span>, <span class="hljs-number">0</span>, <span class="hljs-number">10</span>, $desc_y, $black, $desc_font, $line);
        $desc_y += <span class="hljs-number">30</span>;
    }

    header(<span class="hljs-string">'Content-Type: image/png'</span>);
    imagepng($img);
    imagedestroy($img);
}

<span class="hljs-comment">// Retrieve title and description from URL parameters</span>
$title = <span class="hljs-keyword">isset</span>($_GET[<span class="hljs-string">'title'</span>]) ? $_GET[<span class="hljs-string">'title'</span>] : <span class="hljs-string">'Default Title'</span>;
$des = <span class="hljs-keyword">isset</span>($_GET[<span class="hljs-string">'des'</span>]) ? $_GET[<span class="hljs-string">'des'</span>] : <span class="hljs-string">'Default Description'</span>;

<span class="hljs-comment">// Example usage:</span>
og($title, $des);
<span class="hljs-meta">?></span></span>

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

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

steamcmd安装

From

sudo<span class="hljs-built_in"> add-apt-repository </span>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

启动

<span class="hljs-keyword">cd</span> <span class="hljs-string">'/Steam/steamapps/common/Euro Truck Simulator 2 Dedicated Server/bin/linux_x64/'</span>
chmod -xxx server_launch.<span class="hljs-keyword">sh</span>
./server_launch.<span class="hljs-keyword">sh</span>

公开列表

如果想让服务器公开到运联列表(默认是只能搜索数字的) 在这部折腾好久,最后发现欧卡的搜索有点问题,我打开的选择性模组然后就搜不到啦~ 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:

<span class="hljs-attribute">moderator_list</span>: 1
 <span class="hljs-attribute">moderator_list[0]</span>: 你的steamid

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