惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
有赞技术团队
有赞技术团队
www.infosecurity-magazine.com
www.infosecurity-magazine.com
大猫的无限游戏
大猫的无限游戏
爱范儿
爱范儿
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Threatpost
V
Visual Studio Blog
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - Franky
人人都是产品经理
人人都是产品经理
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
The Cloudflare Blog
N
News and Events Feed by Topic
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
酷 壳 – CoolShell
酷 壳 – CoolShell
V
V2EX
AWS News Blog
AWS News Blog
S
SegmentFault 最新的问题
T
Tailwind CSS Blog
Hugging Face - Blog
Hugging Face - Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Spread Privacy
Spread Privacy
J
Java Code Geeks
博客园 - 聂微东
T
Tor Project blog
宝玉的分享
宝玉的分享
博客园 - 叶小钗
Webroot Blog
Webroot Blog
博客园 - 【当耐特】
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
H
Heimdal Security Blog
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
MongoDB | Blog
MongoDB | Blog
I
InfoQ
Security Latest
Security Latest
Martin Fowler
Martin Fowler
Hacker News: Ask HN
Hacker News: Ask HN
P
Privacy International News Feed
C
CERT Recently Published Vulnerability Notes
Latest news
Latest news
雷峰网
雷峰网
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cisco Blogs
H
Help Net Security
L
LINUX DO - 最新话题
L
LINUX DO - 热门话题

szhshp 的第三边境研究所

假设, AI 把我代替的那一刻真的到来 | szhshp 的第三边境研究所 小傻瓜都能懂的 AstrBot QQ 机器人集成 MCP 功能实战指南 | szhshp 的第三边境研究所 《智人之上: 从石器时代到 AI 时代的信息网络简史》阅读笔记 | szhshp 的第三边境研究所 iPadOS 26 无法设置空间场景图片壁纸的解决方法 | szhshp 的第三边境研究所 《一路云海》(终) | szhshp 的第三边境研究所 《一路云海》(四): 如何不按套路旅行 | szhshp 的第三边境研究所 《一路云海》(三): In Ya Mellow Tone | szhshp 的第三边境研究所 《一路云海》(二): 关西世博参观纪实 | szhshp 的第三边境研究所 《一路云海》(一): 新的征程 | szhshp 的第三边境研究所 2025 大阪世博会 [ 3 天前-先到先得 ] 阶段 场馆预约必中独家攻略 | szhshp 的第三边境研究所 Hackathon 随想 | szhshp 的第三边境研究所 一杯双皮奶 | szhshp 的第三边境研究所 Armbian + CasaOS + NAS 配置指南 | szhshp 的第三边境研究所 Docker 构建镜像报错: error getting credentials - err: exit status 1, out: `` | szhshp 的第三边境研究所 Disqus RIP! 论过高的维护成本如何治疗固执的坏习惯 | szhshp 的第三边境研究所 炸弹猫桌游变体规则 | szhshp 的第三边境研究所 《小岛经济学》阅读笔记 | szhshp 的第三边境研究所 《金钱心理学》阅读笔记 | szhshp 的第三边境研究所 为知笔记 RIP: 迁移剩余的笔记 | szhshp 的第三边境研究所 2025 博客第十年展望 - 再见我的过去 | szhshp 的第三边境研究所 我在独立游戏里面致敬的作品 | szhshp 的第三边境研究所 《How to make thing faster》阅读笔记 | szhshp 的第三边境研究所 《The Art of Clean Code》阅读笔记 | szhshp 的第三边境研究所 《Clean Architecture: A Craftsman Guide to Software Structure and Design》阅读笔记 | szhshp 的第三边境研究所 《How AI Works》阅读笔记 | szhshp 的第三边境研究所 游戏策划废案 - Project Uranus | szhshp 的第三边境研究所 游戏策划废案 - Project X | szhshp 的第三边境研究所 人生第一款独立游戏开发复盘 | szhshp 的第三边境研究所 Trap of Life | szhshp 的第三边境研究所 如果我用手搓了个暗物质雏形 | szhshp 的第三边境研究所 《Rust Programming Language》- EX - Cheatsheet | szhshp 的第三边境研究所 新的播放器上线了 | szhshp 的第三边境研究所 Cypress - End-to-End Testing: OKTA Authentication with MFA | szhshp 的第三边境研究所 VSC x VIM - 反正多学几个快捷键没有坏处 | szhshp 的第三边境研究所 两小时 Docker 速成 - Getting Started | szhshp 的第三边境研究所 《The Joy of Javascript》- 5 - Data | szhshp 的第三边境研究所 《The Joy of Javascript》- 4 - Meta Programming | szhshp 的第三边境研究所 《The Joy of Javascript》- 3 - ADT(Algebraic Data Type) | szhshp 的第三边境研究所 Web-Automation Testing | szhshp 的第三边境研究所 《The Joy of Javascript》- 2 - Functor/Monad | szhshp 的第三边境研究所 《The Joy of Javascript》- 1 - Object/Function | szhshp 的第三边境研究所 EvalError: Possible side-effect in debug-evaluate | szhshp 的第三边境研究所 前端 QA 工具链指南 - husky,commitlint,commitizen,eslint,typescript,express | szhshp 的第三边境研究所 效率工具 & 软件推荐 | szhshp 的第三边境研究所 站点开源 Project Titan | szhshp 的第三边境研究所 cmd/powershell-命令速查-Cheatsheet | szhshp 的第三边境研究所 Git-命令速查与相关问题解决-Cheatsheet & Troubleshooting | szhshp 的第三边境研究所 Tailwind.css not included in NextJS Production | szhshp 的第三边境研究所 Github GraphQL API - Data Integration | szhshp 的第三边境研究所 尝试 Windows Terminal + z.lua | szhshp 的第三边境研究所 StrokePlus.net - Powerful Hotkey Boost | szhshp 的第三边境研究所 优雅地 Hack 一台黑苹果 | szhshp 的第三边境研究所 一杯关东煮 | szhshp 的第三边境研究所 Gitee x PicGo 管理图床 | szhshp 的第三边境研究所 Create Your Own Redux (Typescript) | szhshp 的第三边境研究所 Getting Started: Ionic + Capacitor + React + Typescript + Android | szhshp 的第三边境研究所 GraphQL: File Upload & Troubleshooting | szhshp 的第三边境研究所 吉祥航空随心飞刷票工具循环查票工具 | szhshp 的第三边境研究所 NVM Windows Portable Installation | szhshp 的第三边境研究所 NextJS x Typescript - Integration & Troubleshooting | szhshp 的第三边境研究所 全站点升级 - Project Titan | szhshp 的第三边境研究所 AWS-EC2-常见问题解决-Troubleshooting | szhshp 的第三边境研究所 Workbox-Getting Started | szhshp 的第三边境研究所 《时间简史》阅读笔记 | szhshp 的第三边境研究所 《时间的秩序》阅读笔记 | szhshp 的第三边境研究所 ESLint-常见问题解决-Troubleshooting | szhshp 的第三边境研究所 站点索引 | szhshp 的第三边境研究所 个人知识库搭建 - Hexo 实现 Github/Coding 持续集成 | szhshp 的第三边境研究所 BMOB-常见问题解决-Troubleshooting | szhshp 的第三边境研究所 React + Typescript: 开启 HMR/Hot Loader | szhshp 的第三边境研究所 Yarn & NPM | szhshp 的第三边境研究所 ESLint: Typescript + React + TSX 集成 | szhshp 的第三边境研究所 《10101》EP15:过年 2020 | szhshp 的第三边境研究所 Cmder-Usage | szhshp 的第三边境研究所 Redux-DOM not refreshed | szhshp 的第三边境研究所 React Semantic UI-CheatSheet | szhshp 的第三边境研究所 Typescript: Getting Started | szhshp 的第三边境研究所 Flutter-Getting Started | szhshp 的第三边境研究所 Typescript: Access window object with type check | szhshp 的第三边境研究所 VSC Extension Development-Create A Code Formatter Extension | szhshp 的第三边境研究所 OneNote Extension-Main API | szhshp 的第三边境研究所 TortoiseGit Win10 Icon not showing correctly | szhshp 的第三边境研究所 Mongoose: aggregate() 方法实现聚合函数 | szhshp 的第三边境研究所 React In Depth - React 源码解析 - render() & Fiber | szhshp 的第三边境研究所 MongoDB x Mongoose: 实现类似 Join 的功能 | szhshp 的第三边境研究所 Disqus 评论框改造工程-实现 Disqus 代理的 Serverless 服务 | szhshp 的第三边境研究所 GUI, CLI, Terminal, Shell, TTY, Console, Bash | szhshp 的第三边境研究所 Jest Async Best Practise: No Nested Async | szhshp 的第三边境研究所 关系型数据库与非关系型数据库优缺点分析 | szhshp 的第三边境研究所 New Edge & Chromium Error - Package is invalid: 'CRX_VERSION_NUMBER_INVALID' | szhshp 的第三边境研究所 选择 GraphQL 的 N 个理由 | szhshp 的第三边境研究所 StrokePlus - 鼠标手势神器的代码编写技巧 | szhshp 的第三边境研究所 嗨,好久不见 | szhshp 的第三边境研究所 Vue + ElementUI 集成 Vue Router | szhshp 的第三边境研究所 IE8 - Unknown Runtime Error Using innerHTML & Ajax | szhshp 的第三边境研究所 React: Handling Events | szhshp 的第三边境研究所 React-Navigation Integration with Redux | szhshp 的第三边境研究所 React: States is tricky | szhshp 的第三边境研究所 《10101》EP14:小剧场 | szhshp 的第三边境研究所 ColdFusion - Basic - arguments in cffunction | szhshp 的第三边境研究所
Ubuntu 上实现 Steam 挂卡服务 - ArchiSteamFarm | szhshp 的第三边境研究所
2018-05-26 · via szhshp 的第三边境研究所

Meta

目录

  • Ubuntu 上实现 ASF 服务 (2020.04)
  • 环境
  • ASF 服务搭建
    • 主要步骤
    • 安装 .NET 框架
      • Add Microsoft repository key and feed
      • Install the .NET Core SDK
      • Troubleshooting: Unable to locate package dotnet-sdk-2. 2
      • Install the ASP.NET Core runtime
    • ASF 下载
    • 添加配置
      • 使用参考示例来新建配置
      • 自动生成配置
    • 执行 ASF
      • 初步测试
    • 后台自动执行
      • 关于 Grandchild Process 的保持运行
      • 关闭后台执行的进程
  • Troubleshooting
    • ASF process is already running for this working directory, aborting!
    • We don’t have anything to idle on this account!
  • 参考文献

Ubuntu 上实现 ASF 服务 (2020.04)

你竟然都进来了这篇文章, 那么我默认你知道 ASF 的功能, 知道 ASF 的潜在价值, 也默认你知道需要折腾一番了

环境

  • AWS EC2 Ubuntu 16.04
  • ASF 4.2

ASF 服务搭建

主要步骤

官方指导

In general, here is what we’ll do in the next few minutes:

  1. Install .NET Core prerequisites.
  2. Download latest ASF release in appropriate OS-specific variant.
  3. Extract the archive into new location (and chmod +x ArchiSteamFarm if you’re on Linux/OS X).
  4. Configure ASF.
  5. Launch ASF and see the magic.

安装 .NET 框架

.NET 这版本经常会改变, 所以主要还是要参考 MS 的 安装指导页面, 找到 Ubuntu 16.04 / Linux Mint 18 对应的最新版本.

切记要在查看最新版本的时候选成你自己的环境所需要的版本。

Add Microsoft repository key and feed

wget -q packages-microsoft-prod.deb https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb

Install the .NET Core SDK

sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-2.2

Troubleshooting: Unable to locate package dotnet-sdk-2. 2

截止 2020. 04, .net 已经 3.1 版本, 并且 2.2 版本已经不再维护, 但是我们依然要安装 V2.2

If you receive an error message similar to Unable to locate package {the . NET Core package}, run the following commands.

sudo dpkg --purge packages-microsoft-prod && sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install {the . NET Core package}

If that doesn’t work, you can run a manual install with the following commands.

sudo apt-get install -y gpg
wget -O- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
wget https://packages.microsoft.com/config/ubuntu/18.04/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
sudo chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg
sudo chown root:root /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get install -y apt-transport-https
sudo apt-get update
sudo apt-get install {the . NET Core package}

Install the ASP.NET Core runtime

sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install aspnetcore-runtime-3.1

ASF 下载

跑到他们 Github 从找到最近一次 release , 然后复制对应下载链接, 使用 wget 下载到服务器, 然后解压.

mkdir ASF
wget https://github.com/JustArchiNET/ArchiSteamFarm/releases/download/3.4.1.8/ASF-generic.zip
mv ASF-generic.zip ASF
cd ASF
unzip ASF-generic.zip

这时候可能要跑一遍 chmod +x ArchiSteamFarm 来确保这个文件有可执行权限

添加配置

可有两种方法修改 / 添加配置

使用参考示例来新建配置

进入 /config 文件夹, 新建一个配置文件

vim xxx.json

下方有一个我所使用的配置, 需要将下方注释的三行修改掉, 同时记得将下面的注释也一起删掉:

{

    "AcceptGifts": false,
    "AutoSteamSaleEvent": false,
    "BotBehaviour": 0,
    "CustomGamePlayedWhileFarming": null,
    "CustomGamePlayedWhileIdle": null,
    "DismissInventoryNotifications": false,
    "Enabled": false,  ##### 本地测试通过后改成 true
    "FarmingOrder": 0,
    "FarmOffline": false,
    "GamesPlayedWhileIdle": [],
    "HandleOfflineMessages": false,
    "HoursUntilCardDrops": 3,
    "IdlePriorityQueueOnly": false,
    "IdleRefundableGames": true,
    "LootableTypes": [
        1,
        3,
        5
    ],
    "MatchableTypes": [
        5
    ],
    "PasswordFormat": 0,
    "Paused": false,
    "RedeemingPreferences": 0,
    "SendOnFarmingFinished": false,
    "SendTradePeriod": 0,
    "ShutdownOnFarmingFinished": false,
    "SteamLogin": null,  ##### 改成你的账号
    "SteamMasterClanID": 0,
    "SteamParentalPIN": "0",
    "SteamPassword": null,  ##### 改成你的密码
    "SteamTradeToken": null,
    "SteamUserPermissions": {},
    "TradingPreferences": 0,
    "UseLoginKeys": true

}

自动生成配置

真是够偷懒的

官方提供了 Config Generator

进去设置一下 bot 然后就可以下载一个 json 文件, 然后用各种魔法上传到 config 文件夹就行

执行 ASF

初步测试

本地先测试一下:

./ArchiSteamFarm.sh

如果你之前有过邮箱来收取验证码的话,它会要求你输入验证码。

后台自动执行

chmod +x ./ArchiSteamFarm.sh
sh -c './ArchiSteamFarm.sh &'

上面这段语句, 开启了一个子进程执行 sh , 并且在 sh 里面继续执行了 ./ArchiSteamFarm &

因此, ASF 就跑到了 Grandchild Process 之中, 也就是 ** 孙子进程 **

虽然是在后台执行,但是他依然会在 CLI 里面要求你提供对应的邮箱验证码。

然后再关闭 Terminal 就不会关闭 ASF, 使其可以在后台运行.

关于 Grandchild Process 的保持运行

有几种情况在一个进程关闭的时候令其子进程一同关闭:

  1. Terminal 消失的时候, 发送一个 SIGHUP 信号给 Controlling Process
  2. Shell 关闭的时候, 发送一个 HUP 信号给所有的 Job

可以用下面几个方法让其保持运行:

  1. NOHUP 的子进程, 会忽略父进程的关闭请求, 并且继续执行, 这个方法阻断的上面第二种 Shell 关闭 HUP 型号
  2. 使用 disown 强行忽略关闭请求, 这个可以将 job 移出 Shell 的 job list, 从而阻断后续的关闭
  3. Double Forking: 当前 Shell 执行一个子进程, 并且子进程立刻执行孙子进程, 当前进程并不了解孙子进程

在这种情况之下就不会关闭孙子进程

关闭后台执行的进程

使用 ps 查看进程号, 然后 kill [pid] 即可

Troubleshooting

ASF process is already running for this working directory, aborting!

已经有一个进程在跑 ASF 了, 需要重新执行的话, 执行 ps -ef | grep Arch 找一下已经执行的进程,然后 kill {pio} 强行关闭

We don’t have anything to idle on this account!

看到这个错误信息代表已经跑成功了

只是这个账号下面已经没有可以挂卡的游戏了, 等下次你买的新游戏他还会帮你挂起来的。

参考文献