This commit is contained in:
2026-01-17 09:36:00 +00:00
commit 89e46030e4
310 changed files with 93285 additions and 0 deletions

316
2023/01/01/summary.html Normal file
View File

@@ -0,0 +1,316 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>年终总结 | Mayx的博客</title>
<meta name="generator" content="Jekyll v3.9.5" />
<meta property="og:title" content="年终总结" />
<meta name="author" content="mayx" />
<meta property="og:locale" content="zh_CN" />
<meta name="description" content="&lt;/2022&gt;&lt;2023……" />
<meta property="og:description" content="&lt;/2022&gt;&lt;2023……" />
<meta property="og:site_name" content="Mayx的博客" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2023-01-01T00:00:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="年终总结" />
<meta name="google-site-verification" content="huTYdEesm8NaFymixMNqflyCp6Jfvd615j5Wq1i2PHc" />
<meta name="msvalidate.01" content="0ADFCE64B3557DC4DC5F2DC224C5FDDD" />
<meta name="yandex-verification" content="fc0e535abed800be" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"mayx"},"dateModified":"2023-01-01T00:00:00+08:00","datePublished":"2023-01-01T00:00:00+08:00","description":"&lt;/2022&gt;&lt;2023……","headline":"年终总结","mainEntityOfPage":{"@type":"WebPage","@id":"/2023/01/01/summary.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://avatars0.githubusercontent.com/u/17966333"},"name":"mayx"},"url":"/2023/01/01/summary.html"}</script>
<!-- End Jekyll SEO tag -->
<link rel="canonical" href="https://mabbs.github.io/2023/01/01/summary.html" />
<link type="application/atom+xml" rel="alternate" href="/atom.xml" title="Mayx的博客" />
<link rel="alternate" type="application/rss+xml" title="Mayx的博客(RSS)" href="/rss.xml" />
<link rel="alternate" type="application/json" title="Mayx的博客(JSON Feed)" href="/feed.json" />
<link rel="stylesheet" href="/assets/css/style.css?v=1768642553" />
<!--[if !IE]> -->
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
<!-- <![endif]-->
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Mayx的博客" />
<link rel="webmention" href="https://webmention.io/mabbs.github.io/webmention" />
<link rel="pingback" href="https://webmention.io/mabbs.github.io/xmlrpc" />
<link rel="preconnect" href="https://summary.mayx.eu.org" crossorigin="anonymous" />
<link rel="prefetch" href="https://www.blogsclub.org/badge/mabbs.github.io" as="image" />
<link rel="blogroll" type="text/xml" href="/blogroll.opml" />
<link rel="me" href="https://github.com/Mabbs" />
<script src="/assets/js/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
var lastUpdated = new Date("Sat, 17 Jan 2026 17:35:53 +0800");
var BlogAPI = "https://summary.mayx.eu.org";
</script>
<script src="/assets/js/main.js"></script>
<!--[if !IE]> -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-137710294-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-137710294-1');
</script>
<script src="/assets/js/instant.page.js" type="module"></script>
<!-- <![endif]-->
</head>
<body>
<!--[if !IE]> --><noscript><marquee style="top: -15px; position: relative;"><small>发现当前浏览器没有启用JavaScript这不影响你的浏览但可能会有一些功能无法使用……</small></marquee></noscript><!-- <![endif]-->
<!--[if IE]><marquee style="top: -15px; position: relative;"><small>发现当前浏览器为Internet Explorer这不影响你的浏览但可能会有一些功能无法使用……</small></marquee><![endif]-->
<div class="wrapper">
<header class="h-card">
<h1><a class="u-url u-uid p-name" rel="me" href="/">Mayx的博客</a></h1>
<img src="https://avatars0.githubusercontent.com/u/17966333" fetchpriority="high" class="u-photo" alt="Logo" style="width: 90%; max-width: 300px; max-height: 300px;" />
<p class="p-note">Mayx's Home Page</p>
<form action="/search.html">
<input type="text" name="keyword" id="search-input-all" placeholder="Search blog posts.." />&#160;<input type="submit" value="搜索" />
</form>
<br />
<p class="view"><a class="u-url" href="/Mabbs/">About me</a></p>
<ul class="downloads">
<li style="width: 270px; border-right: none;"><a href="/MayxBlog.tgz">Download <strong>TGZ File</strong></a></li>
</ul>
</header>
<section class="h-entry">
<small><time class="date dt-published" datetime="2023-01-01T00:00:00+08:00">1 January 2023</time> - 字数统计1103 - 阅读大约需要4分钟 - Hits: <span id="/2023/01/01/summary.html" class="visitors">Loading...</span></small>
<h1 class="p-name">年终总结</h1>
<p class="view">by <a class="p-author h-card" href="//github.com/Mabbs">mayx</a></p>
<div id="outdate" style="display:none;">
<hr /><p>
这是一篇创建于 <span id="outime"></span> 天前的文章,其中的信息可能已经有所发展或是发生改变。
</p>
</div>
<script>
daysold = Math.floor((new Date().getTime() - new Date("Sun, 01 Jan 2023 00:00:00 +0800").getTime()) / (24 * 60 * 60 * 1000));
if (daysold > 90) {
document.getElementById("outdate").style.display = "block";
document.getElementById("outime").innerHTML = daysold;
}
</script>
<hr />
<b>AI摘要</b>
<p id="ai-output">这篇文章是作者的年终总结回顾了2022年的生活和工作主要提及了记忆在生活中的重要性以及这一年解决问题的文章减少可能与记忆积累减少有关。作者提到对2022年周围环境的负面看法认为人类灭亡的风险增加并表达了对2023年能正常活下去的期望。同时作者分享了关于博客备份的成就以及这套方案在反审查方面的价值。个人生活上临近毕业作者对未来持有相对消极的态度仅期待见证可能发生的变化认为自己和其他人可能都不会有显著的改善。</p>
<hr />
<ul><li><a href="#无止尽的结局">无止尽的……?结局?</a></li><li><a href="#2022年都干了什么">2022年都干了什么</a></li><li><a href="#2023年想要做什么">2023年想要做什么</a></li><li><a href="#总结">总结</a></li></ul>
<hr />
<main class="post-content e-content" role="main"><p>&lt;/2022&gt;&lt;2023……<!--more--></p>
<h1 id="无止尽的结局">
<a href="#无止尽的结局"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 无止尽的……?结局?
</h1>
<p>本来这篇文章打算昨天就写的……结果昨天不知道什么原因发烧了😂。想着是不是感染了COVID-19不过拿抗原试纸测了一下好像也没事。emmmm本来就很糟糕的一年在最后也不忘送我一份礼物是吧😂。</p>
<h1 id="2022年都干了什么">
<a href="#2022年都干了什么"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 2022年都干了什么
</h1>
<p>2022年我感觉更加的什么都不记得了……这种问题的严重程度就像从没有经历过这些事情一样。对于电脑来说什么东西最重要呢应该是硬盘上面存储的数据吧毕竟电脑有价数据无价。而对于人来说那就是记忆了吧。在我看来所有的想法和情感都是基于记忆实时演算出来的结果不过很遗憾的是人的记忆不能备份坏了就再也找不回来了就算用日记记录也只是生成了新的记忆而已。所以虽然能知道发生了些什么不过心中却毫无波动。 </p><p>
我看了看2022年写的文章基本上都是些解决问题的方案文章也比之前写的少了大概是因为记忆的积累变少了所以也想不出更多的东西了不过这也许不是一件坏事毕竟没有记忆就没有烦恼了这也就是为什么我现在内心毫无波动吧。 </p><p>
至于2022年周围发生的事情……可能是越来越糟糕了以致于我感觉再有两年差不多人类该灭绝了🤣不过如果能在有生之年看到人类的末日也不算坏事毕竟人类已经在这个星球也存在了几十万年了按平均100年左右的寿命来算在有生之年遇到人类末日假设在2024年的概率大概有个几十万分之一吧 <del>(感觉不太清醒,算错了不要叫我“数学奇才”,还有预言如果成真了也别🔪我🤣)</del></p>
<h1 id="2023年想要做什么">
<a href="#2023年想要做什么"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 2023年想要做什么
</h1>
<p>毕竟没有过去就看不清未来当然如果就只是正常的活下去感觉也就是发生了什么去应对什么吧。2022年的Mayx Forever计划因为<a href="/2022/01/04/banned.html">Github</a>的激励完成的还是挺不错的,看看博客的<a href="/proxylist.html">代理列表</a>反代先不论镜像站也整了不少而且还在IPFS、AR和IC上整了备份尽可能保证了博客能存活的概率。不过要是说不止发生了人类灭绝的问题世界也毁灭了那当然所作的所有事情都失去了任何意义。当然如果考虑意义的话就没有意义了其实就算啥也没有死了还是啥也没有本来也看不见未来期望其他人看到也只是活着的时候在做梦罢了。不过也不是完全没意义毕竟这套方案除了在自己遇到问题保留信息之外还有反审查的的功能当我整出一套成熟的方案时其他人也可以用我曾经发现过的东西来做自己想做的事情。 </p><p>
至于其他的事情……也快到毕业的时候了,最后只要能正常的毕业那就还能继续漂流下去(不然就只能靠接单养活自己了(可能也不完全是坏事))。 </p><p>
总之接下来也没什么可期待的,我就想见证末日而已。</p>
<h1 id="总结">
<a href="#总结"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 总结
</h1>
<p>这下感觉……总之接下来无论是我还是其他人可能都不会变得更好吧。其他的我也想不出来什么了。</p></main>
<small style="display: block">tags: <a rel="category tag" class="p-category" href="/search.html?keyword=%E6%80%BB%E7%BB%93"><em>总结</em></a> <span style="float: right;"><a href="https://gitlab.com/mayx/mayx.gitlab.io/tree/master/_posts/2023-01-01-summary.md">查看原始文件</a></span></small>
<h4 style="border-bottom: 1px solid #e5e5e5;margin: 2em 0 5px;">推荐文章</h4>
<p id="suggest-container">Loading...</p>
<script>
var suggest = $("#suggest-container");
$.get(BlogAPI + "/suggest?id=/2023/01/01/summary.html&update=" + lastUpdated.valueOf(), function (data) {
if (data.length) {
getSearchJSON(function (search) {
suggest.empty();
var searchMap = {};
for (var i = 0; i < search.length; i++) {
searchMap[search[i].url] = search[i];
}
var tooltip = $('<div class="content-tooltip"></div>').appendTo('body').hide();
for (var j = 0; j < data.length; j++) {
var item = searchMap[data[j].id];
if (item) {
var link = $('<a href="' + item.url + '">' + item.title + '</a>');
var contentPreview = item.content.substring(0, 100);
if (item.content.length > 100) {
contentPreview += "……";
}
link.hover(
function(e) {
tooltip.text($(this).data('content'))
.css({
top: e.pageY + 10,
left: e.pageX + 10
})
.show();
},
function() {
tooltip.hide();
}
).mousemove(function(e) {
tooltip.css({
top: e.pageY + 10,
left: e.pageX + 10
});
}).data('content', contentPreview);
suggest.append(link);
suggest.append(' - ' + item.date + '<br />');
}
}
});
} else {
suggest.html("暂无推荐文章……");
}
});
</script>
<br />
<div class="pagination">
<span class="prev">
<a href="/2022/12/26/i2p-ssl.html">
上一篇为自己的i2p站点添加一个SSL证书
</a>
</span>
<br />
<span class="next">
<a href="/2023/02/03/mbp.html">
下一篇MacBook Pro 2022 13寸使用体验
</a>
</span>
</div>
<!--[if !IE]> -->
<link rel="stylesheet" href="/assets/css/gitalk.css">
<script src="/assets/js/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
var gitalk = new Gitalk({
clientID: '36557aec4c3cb04f7ac6',
clientSecret: 'ac32993299751cb5a9ba81cf2b171cca65879cdb',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '/2023/01/01/summary', // Ensure uniqueness and length less than 50
distractionFreeMode: false, // Facebook-like distraction free mode
proxy: "https://cors-anywhere.mayx.eu.org/?https://github.com/login/oauth/access_token"
})
gitalk.render('gitalk-container')
</script>
<!-- <![endif]-->
</section>
<!--[if !IE]> -->
<div id="landlord" style="left:5px;bottom:0px;">
<div class="message" style="opacity:0"></div>
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
<div class="live_talk_input_body">
<form id="live_talk_input_form">
<div class="live_talk_input_name_body" >
<input type="checkbox" id="load_this" />
<input type="hidden" id="post_id" value="/2023/01/01/summary.html" />
<label for="load_this">
<span style="font-size: 11px; color: #fff;">&#160;想问这篇文章</span>
</label>
</div>
<div class="live_talk_input_text_body">
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?" />
<button type="submit" class="live_talk_send_btn" id="talk_send">发送</button>
</div>
</form>
</div>
<input name="live_talk" id="live_talk" value="1" type="hidden" />
<div class="live_ico_box" style="display:none;">
<div class="live_ico_item type_info" id="showInfoBtn"></div>
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
<div class="live_ico_item type_music" id="musicButton"></div>
<div class="live_ico_item type_youdu" id="youduButton"></div>
<div class="live_ico_item type_quit" id="hideButton"></div>
<input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
<audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
<input id="duType" value="douqilai" type="hidden" />
</div>
</div>
<div id="open_live2d">召唤伊斯特瓦尔</div>
<!-- <![endif]-->
<footer>
<p>
<small>Made with ❤ by Mayx<br />Last updated at 2026-01-17 17:35:53<br /> 总字数614622 - 文章数178 - <a href="/atom.xml" >Atom</a> - <a href="/README.html" >About</a></small>
</p>
</footer>
</div>
<script src="/assets/js/scale.fix.js"></script>
<!--[if !IE]> -->
<script src="/assets/js/main_new.js"></script>
<script src="/Live2dHistoire/live2d/js/live2d.js"></script>
<script src="/Live2dHistoire/live2d/js/message.js"></script>
<!-- <![endif]-->
</body>
</html>

358
2023/02/03/mbp.html Normal file
View File

@@ -0,0 +1,358 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>MacBook Pro 2022 13寸使用体验 | Mayx的博客</title>
<meta name="generator" content="Jekyll v3.9.5" />
<meta property="og:title" content="MacBook Pro 2022 13寸使用体验" />
<meta name="author" content="mayx" />
<meta property="og:locale" content="zh_CN" />
<meta name="description" content="好用,但又不完全好用" />
<meta property="og:description" content="好用,但又不完全好用" />
<meta property="og:site_name" content="Mayx的博客" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2023-02-03T00:00:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="MacBook Pro 2022 13寸使用体验" />
<meta name="google-site-verification" content="huTYdEesm8NaFymixMNqflyCp6Jfvd615j5Wq1i2PHc" />
<meta name="msvalidate.01" content="0ADFCE64B3557DC4DC5F2DC224C5FDDD" />
<meta name="yandex-verification" content="fc0e535abed800be" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"mayx"},"dateModified":"2023-02-03T00:00:00+08:00","datePublished":"2023-02-03T00:00:00+08:00","description":"好用,但又不完全好用","headline":"MacBook Pro 2022 13寸使用体验","mainEntityOfPage":{"@type":"WebPage","@id":"/2023/02/03/mbp.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://avatars0.githubusercontent.com/u/17966333"},"name":"mayx"},"url":"/2023/02/03/mbp.html"}</script>
<!-- End Jekyll SEO tag -->
<link rel="canonical" href="https://mabbs.github.io/2023/02/03/mbp.html" />
<link type="application/atom+xml" rel="alternate" href="/atom.xml" title="Mayx的博客" />
<link rel="alternate" type="application/rss+xml" title="Mayx的博客(RSS)" href="/rss.xml" />
<link rel="alternate" type="application/json" title="Mayx的博客(JSON Feed)" href="/feed.json" />
<link rel="stylesheet" href="/assets/css/style.css?v=1768642553" />
<!--[if !IE]> -->
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
<!-- <![endif]-->
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Mayx的博客" />
<link rel="webmention" href="https://webmention.io/mabbs.github.io/webmention" />
<link rel="pingback" href="https://webmention.io/mabbs.github.io/xmlrpc" />
<link rel="preconnect" href="https://summary.mayx.eu.org" crossorigin="anonymous" />
<link rel="prefetch" href="https://www.blogsclub.org/badge/mabbs.github.io" as="image" />
<link rel="blogroll" type="text/xml" href="/blogroll.opml" />
<link rel="me" href="https://github.com/Mabbs" />
<script src="/assets/js/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
var lastUpdated = new Date("Sat, 17 Jan 2026 17:35:53 +0800");
var BlogAPI = "https://summary.mayx.eu.org";
</script>
<script src="/assets/js/main.js"></script>
<!--[if !IE]> -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-137710294-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-137710294-1');
</script>
<script src="/assets/js/instant.page.js" type="module"></script>
<!-- <![endif]-->
</head>
<body>
<!--[if !IE]> --><noscript><marquee style="top: -15px; position: relative;"><small>发现当前浏览器没有启用JavaScript这不影响你的浏览但可能会有一些功能无法使用……</small></marquee></noscript><!-- <![endif]-->
<!--[if IE]><marquee style="top: -15px; position: relative;"><small>发现当前浏览器为Internet Explorer这不影响你的浏览但可能会有一些功能无法使用……</small></marquee><![endif]-->
<div class="wrapper">
<header class="h-card">
<h1><a class="u-url u-uid p-name" rel="me" href="/">Mayx的博客</a></h1>
<img src="https://avatars0.githubusercontent.com/u/17966333" fetchpriority="high" class="u-photo" alt="Logo" style="width: 90%; max-width: 300px; max-height: 300px;" />
<p class="p-note">Mayx's Home Page</p>
<form action="/search.html">
<input type="text" name="keyword" id="search-input-all" placeholder="Search blog posts.." />&#160;<input type="submit" value="搜索" />
</form>
<br />
<p class="view"><a class="u-url" href="/Mabbs/">About me</a></p>
<ul class="downloads">
<li style="width: 270px; border-right: none;"><a href="/MayxBlog.tgz">Download <strong>TGZ File</strong></a></li>
</ul>
</header>
<section class="h-entry">
<small><time class="date dt-published" datetime="2023-02-03T00:00:00+08:00">3 February 2023</time> - 字数统计3875 - 阅读大约需要12分钟 - Hits: <span id="/2023/02/03/mbp.html" class="visitors">Loading...</span></small>
<h1 class="p-name">MacBook Pro 2022 13寸使用体验</h1>
<p class="view">by <a class="p-author h-card" href="//github.com/Mabbs">mayx</a></p>
<div id="outdate" style="display:none;">
<hr /><p>
这是一篇创建于 <span id="outime"></span> 天前的文章,其中的信息可能已经有所发展或是发生改变。
</p>
</div>
<script>
daysold = Math.floor((new Date().getTime() - new Date("Fri, 03 Feb 2023 00:00:00 +0800").getTime()) / (24 * 60 * 60 * 1000));
if (daysold > 90) {
document.getElementById("outdate").style.display = "block";
document.getElementById("outime").innerHTML = daysold;
}
</script>
<hr />
<b>AI摘要</b>
<p id="ai-output">这篇文章介绍了作者使用新款MacBook Pro 2022 13寸搭载Apple M2芯片后的使用体验。尽管之前对MacOS和苹果产品存有偏见认为其性价比不高且性能曾存在问题但M2芯片的升级让作者感到惊喜体现在性能提升、功耗控制优良以及长续航上使其符合云游戏与轻薄本的使用需求。文章还提到了MacOS的初次上手体验如触控板的便利、软件兼容性如Microsoft Remote Desktop和VSCode的使用以及MacBook在游戏性能上的不足。作者认为MacBook适合日常工作、文档处理和轻度娱乐续航表现强大但与Windows电脑相比在一些核心功能和兼容性上还有差距。</p>
<hr />
<ul><li><a href="#起因">起因</a></li><li><a href="#想买macbook的理由">想买MacBook的理由</a></li><li><a href="#macbook的使用体验">MacBook的使用体验</a><ul><li><a href="#初体验">初体验</a></li><li><a href="#应用体验">应用体验</a></li><li><a href="#游戏体验">游戏体验</a></li><li><a href="#综合体验">综合体验</a></li></ul></li><li><a href="#感受">感受</a></li></ul>
<hr />
<main class="post-content e-content" role="main"><p>好用,但又不完全好用<!--more--></p>
<h1 id="起因">
<a href="#起因"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 起因
</h1>
<p>最近家里人送了我一台搭载了Apple M2芯片的MacBook Pro 2022 13寸笔记本电脑虽然我以前没用过MacOS不过我其实本来就打算买一台的只是我打算在我现在使用的天选坏了或者彻底过时的时候再换……不过问题也不大早有早享受嘛。</p>
<h1 id="想买macbook的理由">
<a href="#想买macbook的理由"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 想买MacBook的理由
</h1>
<p>其实以前我是不喜欢买像苹果这种性价比低的产品的而且以前的MacBook确实也很烂CPU是很垃圾的Intel几款核心数少就很普通的那种电脑然后要是刷成Windows……估计花一半的价格就能买个同等性能的Windows轻薄本了。而且还有什么“梦幻单热管”之类的问题性能和寿命都非常差。不过2020年出的Apple Silicon M系列芯片还是相当厉害的性能提升是一方面功耗发热之类的表现都非常的不错不仅使用很安静续航还很长。这时候就让我回想起我以前想整的<a href="/2021/09/28/cloudgame.html">云游戏</a>+轻薄本方案了当然MacBook在轻薄本里实在是太贵了毕竟我在用游戏本的这几年里感觉游戏本还是挺不方便的重倒是还好主要是续航不太行我的游戏本开省电模式基本上用4个小时就没电了而且风扇声音也很大有时候想不插电使用效果都不太好。另外我也不怎么打游戏很多时候我其实不需要性能有多强需要的时候再租服务器还是租云电脑都是个不错的选择。</p>
<h1 id="macbook的使用体验">
<a href="#macbook的使用体验"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> MacBook的使用体验
</h1>
<h2 id="初体验">
<a href="#初体验"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 初体验
</h2>
<p>刚拿到这个MacBook之后从使用上来说倒是没有特别的不适应我不知道是苹果有优化过用户体验还是单纯因为自己用了一下上手还是挺容易的没有因为是第一次仔细使用MacOS以及Windows不一样的操作方式而不会用要硬说的话感觉也就是标题栏的关闭键在左边不太熟悉吧用两天就好了不过ctrl弄成两个还是挺不熟悉的搞了control和command两个按键导致在远程连接Windows以及使用终端时操作都挺别扭的比如复制文本在Windows上按control+c复制然后在MacOS上按command+v粘贴……不是很人性化。 </p><p>
除了系统本身的体验之外MacBook的触控板使用也非常的不错。大是一方面可以不抬手就完成移动鼠标和单击这个操作也很不错因为整个触摸板都可以按下去而且还有两段只不过重击我还没用过关于手势和快捷键估计得用很长一段时间才会熟悉吧不过还好就算不熟悉也不怎么影响使用。</p>
<h2 id="应用体验">
<a href="#应用体验"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 应用体验
</h2>
<p>刚开始使用的时候我最想安装的就是Microsoft Remote Desktop因为之前有说要配合“云”一起使用那自然是要有个能远程连接的东西。那个软件国区Apple账号还没有我还得搜教程把地域改成其他国家……安装好之后连接上我办公用的电脑效果还不错用起来的感觉就像在MacBook上安装了Windows一样不过问题就是我前面说的ctrl键问题感觉比较难受…… </p><p>
随后我就安装了VSCode之前我在Windows电脑上安装的是Notepad++我之所以不想用VSCode就单纯因为它多整了一个浏览器感觉不太爽那个Notepad++作者搞什么键政辱华啥的我都不在乎但是他声明有可能会随机修改用户数据这个我就不太能接受了无论这是不是个玩笑但是但凡有一点点这种可能性我都不太敢相信这个软件了当然MacOS本来也装不了🤣另外我还想要用Github Copilot插件所以就考虑了一下还是用VSCode吧。 </p><p>
然后在操作的过程中感觉连接不是很通畅,下了个<a href="https://github.com/yanue/V2rayU">V2rayU</a>。看着还挺不错结果导入的时候不支持自定义SNI搞得我只能自己修改配置文件感觉不太好……不过配置好了之后还是挺不错的总比自己运行V2ray然后设置代理方便吧。 </p><p>
然后就是虚拟机了毕竟MacOS支持的软件很少有时候可能无论如何都要使用Windows如果手头没个Windows就麻烦了所以还得装个Windows的虚拟机。不过我这个MacBook是8G内存的版本分配的时候只能分个4GWindows11启动大概吃掉12G现在软件吃内存也很厉害8G MacBook装虚拟机还是有点吃力了……当然为了应急吃力也还是得装吧。然后就是创建虚拟机的软件MacOS一般推荐的是Parallels Desktop不过那是个付费软件我买不起那种东西那对于ARM64架构的目前应该就VMWare Fusion Player、VirtualBox和<a href="https://github.com/utmapp/UTM">UTM</a>据说UTM基于QEMU功能更加强大我也懒得三款都测一遍了而且UTM有上架Apple Store的版本用着也更放心。 </p><p>
整虚拟机的时候为了搞Windows11的镜像我按着教程又下了个HomeBrew据说这个就相当于在MacOS上的apt一样的东西了之后安装命令行需要的软件就方便很多了。 </p><p>
另外为了能看Bilibili港澳台的动画我还需要安装Tampermonkey插件看了一眼还要2USD……看了看旁边还有一个叫做Stay的插件能提供差不多的功能还是免费的于是也装了一个。虽然也不是不能装Chrome不过对我来说只要系统自带的浏览器不是IE那种大多数网页都没法访问的情况那就不会去安装第三方的浏览器了不过Safari装插件还是挺麻烦的也没有Chrome的插件多还好油猴的脚本很多就可以代替那些插件的功能了所以装个Stay就够用了。 </p><p>
还有为了处理文档Microsoft Office试了一下要花钱还不能用E5试用的订阅没办法就只能再装个WPS Office了MacOS上的WPS Office倒是还好没有Windows上那么多广告不过好多模板还有些什么转换之类的功能还是付费的不过我一般用不上应该影响也不大。 </p><p>
最后为了能连接手机传输文件安装了一个Android文件传输MacOS居然原生不支持MTP协议实在是不太行……这个电脑就两个Type-C的USB口充电线是两边都是C口的用来连接手机还挺不错的。</p>
<h2 id="游戏体验">
<a href="#游戏体验"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 游戏体验
</h2>
<p>众所周知MacBook很不适合用来打游戏因为大多数游戏都是在Windows上编写的。不过我已经安装了Windows11ARM的虚拟机如果用来跑游戏效果会怎么样呢我从我原来用的电脑上传了一个Galgame过来打开试了一下卡的不得了不知道是因为没法调用显卡还是怎么回事感觉帧率就10fps的样子我在我原来的电脑上运行了一下试了试运行非常流畅。连运行Galgame都这么垃圾其他游戏估计更不用说了。不过这估计也是因为是虚拟机的缘故所以我想找找MacOS支持的游戏。去Apple Store下载游戏……都要花钱不过我看到我的MacBook作为Pro有个Touch Bar所以想整个Touch Bar的游戏正好看到了个打砖块试了试效果还不错。 </p><p>
当然用MacBook光看打砖块流畅那就没啥意义了所以再升点级试试三维弹球吧😝之前我在网上看到一个开源版本的三维弹球叫做<a href="https://github.com/k4zmu2a/SpaceCadetPinball">SpaceCadetPinball</a>是用Windows XP自带的那个版本逆向出来的我看了一眼是支持在MacOS上运行的于是就下载下来编译了一下效果确实不错不过我又试了一下在Windows原生的版本一样很流畅啊😂而且不知道为什么感觉开源的这个版本缓冲器不太对劲弹的没原生的舒服……这试游戏没必要针对弹球游戏吧😂。 </p><p>
不过我也不知道MacOS支持什么游戏想了想我在Epic Games上白嫖了不少游戏干脆下载下来看看都有啥支持吧。看了一圈while True:learn()居然支持然后就下载下来试了一下不过这个基本上也没啥特效啥的就是那种逻辑推理游戏也展现不出什么不过我原来的电脑运行这个游戏的时候风扇就开始高速转起来了MacBook能完全没声音应该还是证明有点东西的。 </p><p>
不过我也不一定非要考虑电脑游戏我也可以考虑一下手机游戏毕竟MacOS在M系列芯片上是可以运行iOS软件的不过系统做了一些限制不是所有都支持所以我就下了一个<a href="https://github.com/PlayCover/PlayCover">PlayCover</a>,在上面安装了公主连结 Re:Dive。效果还挺不错的完全不卡不过运行的时候可以明显感觉有点开始发热了我浏览网页看视频的时候完全不发热看来这个游戏还是挺费资源的。</p>
<h2 id="综合体验">
<a href="#综合体验"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 综合体验
</h2>
<p>经过这些天的使用我感触最深的就是这台电脑的续航了别说一天不充电感觉两三天不充电都没问题毕竟标称续航是20小时可以算是续航最强的笔记本电脑了。不过这样的话感觉就更像是大号手机/平板那样了用的时候不充电24小时不用关机感觉和手机差不多相比平板功能还是更多要是说用iPad那个东西可没有终端越狱也还是比不了MacOS。而相比Android平板我之前还在上面<a href="/2022/02/15/termux.html">试过Termux</a>不过问题和越狱差不多支持的东西还是不如MacOS虽然MacOS也不是开源的但是对我来说我感觉那个终端就像Linux那个终端差不多加上HomeBrew效果还是挺不错的另外MacBook比平板的续航更长就是重量也更重了。</p>
<h1 id="感受">
<a href="#感受"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 感受
</h1>
<p>总的来说从体验上来说还是挺不错的触控板的操作还有续航啥的都挺不错的还有虽然这款MacBook是用的2016年的模具但是我真没用过Touch Bar可能确实挺鸡肋的但是还是挺好看的Fn功能键也没有很高的使用频率不过感觉可能也就这样了只能拿来看看视频写点代码啥的有些关键性的东西以及打Galgame都还只能用我原来的Windows电脑还好这些可能不是用的特别多的情况也许调整好之后我可以把我所有的东西都迁到这个MacBook上然后关键的东西用云电脑呢。</p></main>
<small style="display: block">tags: <a rel="category tag" class="p-category" href="/search.html?keyword=Apple"><em>Apple</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=MacBook"><em>MacBook</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=%E4%BD%93%E9%AA%8C"><em>体验</em></a> <span style="float: right;"><a href="https://gitlab.com/mayx/mayx.gitlab.io/tree/master/_posts/2023-02-03-mbp.md">查看原始文件</a></span></small>
<h4 style="border-bottom: 1px solid #e5e5e5;margin: 2em 0 5px;">推荐文章</h4>
<p id="suggest-container">Loading...</p>
<script>
var suggest = $("#suggest-container");
$.get(BlogAPI + "/suggest?id=/2023/02/03/mbp.html&update=" + lastUpdated.valueOf(), function (data) {
if (data.length) {
getSearchJSON(function (search) {
suggest.empty();
var searchMap = {};
for (var i = 0; i < search.length; i++) {
searchMap[search[i].url] = search[i];
}
var tooltip = $('<div class="content-tooltip"></div>').appendTo('body').hide();
for (var j = 0; j < data.length; j++) {
var item = searchMap[data[j].id];
if (item) {
var link = $('<a href="' + item.url + '">' + item.title + '</a>');
var contentPreview = item.content.substring(0, 100);
if (item.content.length > 100) {
contentPreview += "……";
}
link.hover(
function(e) {
tooltip.text($(this).data('content'))
.css({
top: e.pageY + 10,
left: e.pageX + 10
})
.show();
},
function() {
tooltip.hide();
}
).mousemove(function(e) {
tooltip.css({
top: e.pageY + 10,
left: e.pageX + 10
});
}).data('content', contentPreview);
suggest.append(link);
suggest.append(' - ' + item.date + '<br />');
}
}
});
} else {
suggest.html("暂无推荐文章……");
}
});
</script>
<br />
<div class="pagination">
<span class="prev">
<a href="/2023/01/01/summary.html">
上一篇:年终总结
</a>
</span>
<br />
<span class="next">
<a href="/2023/02/22/cron.html">
下一篇使用CF Workers Cron触发器进行签到
</a>
</span>
</div>
<!--[if !IE]> -->
<link rel="stylesheet" href="/assets/css/gitalk.css">
<script src="/assets/js/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
var gitalk = new Gitalk({
clientID: '36557aec4c3cb04f7ac6',
clientSecret: 'ac32993299751cb5a9ba81cf2b171cca65879cdb',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '/2023/02/03/mbp', // Ensure uniqueness and length less than 50
distractionFreeMode: false, // Facebook-like distraction free mode
proxy: "https://cors-anywhere.mayx.eu.org/?https://github.com/login/oauth/access_token"
})
gitalk.render('gitalk-container')
</script>
<!-- <![endif]-->
</section>
<!--[if !IE]> -->
<div id="landlord" style="left:5px;bottom:0px;">
<div class="message" style="opacity:0"></div>
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
<div class="live_talk_input_body">
<form id="live_talk_input_form">
<div class="live_talk_input_name_body" >
<input type="checkbox" id="load_this" />
<input type="hidden" id="post_id" value="/2023/02/03/mbp.html" />
<label for="load_this">
<span style="font-size: 11px; color: #fff;">&#160;想问这篇文章</span>
</label>
</div>
<div class="live_talk_input_text_body">
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?" />
<button type="submit" class="live_talk_send_btn" id="talk_send">发送</button>
</div>
</form>
</div>
<input name="live_talk" id="live_talk" value="1" type="hidden" />
<div class="live_ico_box" style="display:none;">
<div class="live_ico_item type_info" id="showInfoBtn"></div>
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
<div class="live_ico_item type_music" id="musicButton"></div>
<div class="live_ico_item type_youdu" id="youduButton"></div>
<div class="live_ico_item type_quit" id="hideButton"></div>
<input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
<audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
<input id="duType" value="douqilai" type="hidden" />
</div>
</div>
<div id="open_live2d">召唤伊斯特瓦尔</div>
<!-- <![endif]-->
<footer>
<p>
<small>Made with ❤ by Mayx<br />Last updated at 2026-01-17 17:35:53<br /> 总字数614622 - 文章数178 - <a href="/atom.xml" >Atom</a> - <a href="/README.html" >About</a></small>
</p>
</footer>
</div>
<script src="/assets/js/scale.fix.js"></script>
<!--[if !IE]> -->
<script src="/assets/js/main_new.js"></script>
<script src="/Live2dHistoire/live2d/js/live2d.js"></script>
<script src="/Live2dHistoire/live2d/js/message.js"></script>
<!-- <![endif]-->
</body>
</html>

337
2023/02/22/cron.html Normal file
View File

@@ -0,0 +1,337 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>使用CF Workers Cron触发器进行签到 | Mayx的博客</title>
<meta name="generator" content="Jekyll v3.9.5" />
<meta property="og:title" content="使用CF Workers Cron触发器进行签到" />
<meta name="author" content="mayx" />
<meta property="og:locale" content="zh_CN" />
<meta name="description" content="Github Actions(×)Cloudflare Workers(√)" />
<meta property="og:description" content="Github Actions(×)Cloudflare Workers(√)" />
<meta property="og:site_name" content="Mayx的博客" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2023-02-22T00:00:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="使用CF Workers Cron触发器进行签到" />
<meta name="google-site-verification" content="huTYdEesm8NaFymixMNqflyCp6Jfvd615j5Wq1i2PHc" />
<meta name="msvalidate.01" content="0ADFCE64B3557DC4DC5F2DC224C5FDDD" />
<meta name="yandex-verification" content="fc0e535abed800be" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"mayx"},"dateModified":"2023-02-22T00:00:00+08:00","datePublished":"2023-02-22T00:00:00+08:00","description":"Github Actions(×)Cloudflare Workers(√)","headline":"使用CF Workers Cron触发器进行签到","mainEntityOfPage":{"@type":"WebPage","@id":"/2023/02/22/cron.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://avatars0.githubusercontent.com/u/17966333"},"name":"mayx"},"url":"/2023/02/22/cron.html"}</script>
<!-- End Jekyll SEO tag -->
<link rel="canonical" href="https://mabbs.github.io/2023/02/22/cron.html" />
<link type="application/atom+xml" rel="alternate" href="/atom.xml" title="Mayx的博客" />
<link rel="alternate" type="application/rss+xml" title="Mayx的博客(RSS)" href="/rss.xml" />
<link rel="alternate" type="application/json" title="Mayx的博客(JSON Feed)" href="/feed.json" />
<link rel="stylesheet" href="/assets/css/style.css?v=1768642553" />
<!--[if !IE]> -->
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
<!-- <![endif]-->
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Mayx的博客" />
<link rel="webmention" href="https://webmention.io/mabbs.github.io/webmention" />
<link rel="pingback" href="https://webmention.io/mabbs.github.io/xmlrpc" />
<link rel="preconnect" href="https://summary.mayx.eu.org" crossorigin="anonymous" />
<link rel="prefetch" href="https://www.blogsclub.org/badge/mabbs.github.io" as="image" />
<link rel="blogroll" type="text/xml" href="/blogroll.opml" />
<link rel="me" href="https://github.com/Mabbs" />
<script src="/assets/js/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
var lastUpdated = new Date("Sat, 17 Jan 2026 17:35:53 +0800");
var BlogAPI = "https://summary.mayx.eu.org";
</script>
<script src="/assets/js/main.js"></script>
<!--[if !IE]> -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-137710294-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-137710294-1');
</script>
<script src="/assets/js/instant.page.js" type="module"></script>
<!-- <![endif]-->
</head>
<body>
<!--[if !IE]> --><noscript><marquee style="top: -15px; position: relative;"><small>发现当前浏览器没有启用JavaScript这不影响你的浏览但可能会有一些功能无法使用……</small></marquee></noscript><!-- <![endif]-->
<!--[if IE]><marquee style="top: -15px; position: relative;"><small>发现当前浏览器为Internet Explorer这不影响你的浏览但可能会有一些功能无法使用……</small></marquee><![endif]-->
<div class="wrapper">
<header class="h-card">
<h1><a class="u-url u-uid p-name" rel="me" href="/">Mayx的博客</a></h1>
<img src="https://avatars0.githubusercontent.com/u/17966333" fetchpriority="high" class="u-photo" alt="Logo" style="width: 90%; max-width: 300px; max-height: 300px;" />
<p class="p-note">Mayx's Home Page</p>
<form action="/search.html">
<input type="text" name="keyword" id="search-input-all" placeholder="Search blog posts.." />&#160;<input type="submit" value="搜索" />
</form>
<br />
<p class="view"><a class="u-url" href="/Mabbs/">About me</a></p>
<ul class="downloads">
<li style="width: 270px; border-right: none;"><a href="/MayxBlog.tgz">Download <strong>TGZ File</strong></a></li>
</ul>
</header>
<section class="h-entry">
<small><time class="date dt-published" datetime="2023-02-22T00:00:00+08:00">22 February 2023</time> - 字数统计1960 - 阅读大约需要7分钟 - Hits: <span id="/2023/02/22/cron.html" class="visitors">Loading...</span></small>
<h1 class="p-name">使用CF Workers Cron触发器进行签到</h1>
<p class="view">by <a class="p-author h-card" href="//github.com/Mabbs">mayx</a></p>
<div id="outdate" style="display:none;">
<hr /><p>
这是一篇创建于 <span id="outime"></span> 天前的文章,其中的信息可能已经有所发展或是发生改变。
</p>
</div>
<script>
daysold = Math.floor((new Date().getTime() - new Date("Wed, 22 Feb 2023 00:00:00 +0800").getTime()) / (24 * 60 * 60 * 1000));
if (daysold > 90) {
document.getElementById("outdate").style.display = "block";
document.getElementById("outime").innerHTML = daysold;
}
</script>
<hr />
<b>AI摘要</b>
<p id="ai-output">这篇文章讲述了作者在云原神签到脚本被Github Actions禁用后选择使用Cloudflare Workers Cron触发器的原因。作者认为Workers更适合做这种简单的网络请求因为它资源消耗较少且不会像Actions那样遇到资源限制。作者分享了如何在Workers中编写签到脚本包括设置headers和获取必要的参数。此外作者建议将Cloudflare Workers用于日常签到等轻量级任务而更适合计算密集型工作的是Github Actions。作者还提到与云函数相比Workers可能具有更好的轻量化和环保优势。</p>
<hr />
<ul><li><a href="#起因">起因</a></li><li><a href="#使用cloudflare-workers-cron触发器">使用Cloudflare Workers Cron触发器</a></li><li><a href="#感想">感想</a></li></ul>
<hr />
<main class="post-content e-content" role="main"><p>Github Actions(×)Cloudflare Workers(√)<!--more--></p>
<h1 id="起因">
<a href="#起因"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 起因
</h1>
<p>前几天,我的<a href="https://github.com/Mabbs/MHYY-AutoCheckin">云·原神签到脚本</a>被Github Ban掉了其实我非常能理解这种情况实际上用Actions做签到确实太重了。毕竟启动一个Actions需要的资源还算比较多相当于开一个Docker容器然而实际上做的事情却是很简单的请求一个接口罢了。而专业的全自动签到者有更专业的选择比如<a href="https://github.com/qiandao-today/qiandao">QianDao</a>可以挂很多签到脚本而且操作非常简单只是需要服务器……而我为了能保证优质的签到水平用这种东西显然还是不够稳当服务器还会到期呢所以像这种简单的事情我觉得还是应该用Cloudflare Workers来做更好。</p>
<h1 id="使用cloudflare-workers-cron触发器">
<a href="#使用cloudflare-workers-cron触发器"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 使用Cloudflare Workers Cron触发器
</h1>
<p>其实有一说一我的Javascript并不怎么样不过至少文档我还是能看懂的Workers进行网络请求不需要用XHR这样奇怪的东西我感觉它应该是基于Node.js的看了一眼是用fetch函数去进行网络请求的 <del>(……又不是没用过,以前不还拿<a href="/2021/03/02/workers.html">Workers写反代</a>嘛……)</del> 另外又看了看Cron触发器的文档然后根据之前那个Python版因为懒得分析哪些请求有用没用了反正就三个都弄上吧……最终总算是知道怎么写了。于是代码如下</p>
<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">addEventListener</span><span class="p">(</span><span class="dl">'</span><span class="s1">scheduled</span><span class="dl">'</span><span class="p">,</span> <span class="nx">event</span> <span class="o">=&gt;</span> <span class="p">{</span>
<span class="nx">event</span><span class="p">.</span><span class="nx">waitUntil</span><span class="p">(</span>
<span class="nx">handleSchedule</span><span class="p">(</span><span class="nx">event</span><span class="p">.</span><span class="nx">scheduledTime</span><span class="p">)</span>
<span class="p">)</span>
<span class="p">})</span>
<span class="k">async</span> <span class="kd">function</span> <span class="nx">handleSchedule</span><span class="p">(</span><span class="nx">scheduledDate</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">const</span> <span class="nx">init</span> <span class="o">=</span> <span class="p">{</span>
<span class="na">headers</span><span class="p">:</span> <span class="p">{</span>
<span class="dl">'</span><span class="s1">x-rpc-combo_token</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">填入Token</span><span class="dl">'</span><span class="p">,</span>
<span class="dl">'</span><span class="s1">x-rpc-client_type</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">2</span><span class="dl">'</span><span class="p">,</span>
<span class="dl">'</span><span class="s1">x-rpc-app_version</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">3.4.0</span><span class="dl">'</span><span class="p">,</span>
<span class="dl">'</span><span class="s1">x-rpc-sys_version</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">11</span><span class="dl">'</span><span class="p">,</span>
<span class="dl">'</span><span class="s1">x-rpc-channel</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">mihoyo</span><span class="dl">'</span><span class="p">,</span>
<span class="dl">'</span><span class="s1">x-rpc-device_id</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">填入设备ID</span><span class="dl">'</span><span class="p">,</span>
<span class="dl">'</span><span class="s1">x-rpc-device_name</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">填入手机名称</span><span class="dl">'</span><span class="p">,</span>
<span class="dl">'</span><span class="s1">x-rpc-device_model</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">填入手机型号</span><span class="dl">'</span><span class="p">,</span>
<span class="dl">'</span><span class="s1">x-rpc-app_id</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">1953439974</span><span class="dl">'</span><span class="p">,</span>
<span class="dl">'</span><span class="s1">Referer</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">https://app.mihoyo.com</span><span class="dl">'</span><span class="p">,</span>
<span class="dl">'</span><span class="s1">Host</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">api-cloudgame.mihoyo.com</span><span class="dl">'</span><span class="p">,</span>
<span class="dl">'</span><span class="s1">Connection</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">Keep-Alive</span><span class="dl">'</span><span class="p">,</span>
<span class="dl">'</span><span class="s1">Accept-Encoding</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">gzip</span><span class="dl">'</span><span class="p">,</span>
<span class="dl">'</span><span class="s1">User-Agent</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">okhttp/4.9.0</span><span class="dl">'</span>
<span class="p">},</span>
<span class="p">};</span>
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">scheduledDate</span><span class="p">);</span>
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="k">await</span> <span class="nx">fetch</span><span class="p">(</span><span class="dl">"</span><span class="s2">https://api-cloudgame.mihoyo.com/hk4e_cg_cn/wallet/wallet/get</span><span class="dl">"</span><span class="p">,</span> <span class="nx">init</span><span class="p">));</span>
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="k">await</span> <span class="nx">fetch</span><span class="p">(</span><span class="dl">"</span><span class="s2">https://api-cloudgame.mihoyo.com/hk4e_cg_cn/gamer/api/getAnnouncementInfo</span><span class="dl">"</span><span class="p">,</span> <span class="nx">init</span><span class="p">));</span>
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="k">await</span> <span class="nx">fetch</span><span class="p">(</span><span class="dl">"</span><span class="s2">https://api-cloudgame.mihoyo.com/hk4e_cg_cn/gamer/api/listNotifications?status=NotificationStatusUnread&amp;type=NotificationTypePopup&amp;is_sort=true</span><span class="dl">"</span><span class="p">,</span> <span class="nx">init</span><span class="p">));</span>
<span class="p">}</span>
</code></pre></div></div>
<p>至于怎么获取Token之类的参数用HttpCanary之类的抓包就好了不过要先启动云·原神之后再抓包不然程序貌似会检验SSL证书是不是合法的然后就退出登录了……抓到之后随便点开一个请求里面就有上面的值了根据情况填到上面就行了。 </p><p>
还有Workers的配置就很简单了把代码粘到Workers里面之后在触发器里面的“Cron 触发器”中设定时间就行了一般就一天一次反正它能自动生成Cron表达式也不用自己写要不写“0 0 * * *”也行,然后就什么都不用做了。</p>
<h1 id="感想">
<a href="#感想"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 感想
</h1>
<p>写完这个签到脚本之后我觉得应该鼓励大家都去使用Workers这种方法去进行签到Cloudflare可不会因为这种东西去Ban你的东西至于Actions应该更多用于更需要计算资源的事情比如编译代码啊或者生成静态HTML还是日报之类的签到啥的确实是太浪费了而且还会Ban</p><p>
还有就是云函数啥的……不过那个貌似本质来说还是Docker它运行时是一个完整的环境不像Workers那样应该是运行在一个更加轻量的沙箱里的也许还更环保呢XD。</p></main>
<small style="display: block">tags: <a rel="category tag" class="p-category" href="/search.html?keyword=Javascript"><em>Javascript</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=Cloudflare"><em>Cloudflare</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=cron"><em>cron</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=workers"><em>workers</em></a> <span style="float: right;"><a href="https://gitlab.com/mayx/mayx.gitlab.io/tree/master/_posts/2023-02-22-cron.md">查看原始文件</a></span></small>
<h4 style="border-bottom: 1px solid #e5e5e5;margin: 2em 0 5px;">推荐文章</h4>
<p id="suggest-container">Loading...</p>
<script>
var suggest = $("#suggest-container");
$.get(BlogAPI + "/suggest?id=/2023/02/22/cron.html&update=" + lastUpdated.valueOf(), function (data) {
if (data.length) {
getSearchJSON(function (search) {
suggest.empty();
var searchMap = {};
for (var i = 0; i < search.length; i++) {
searchMap[search[i].url] = search[i];
}
var tooltip = $('<div class="content-tooltip"></div>').appendTo('body').hide();
for (var j = 0; j < data.length; j++) {
var item = searchMap[data[j].id];
if (item) {
var link = $('<a href="' + item.url + '">' + item.title + '</a>');
var contentPreview = item.content.substring(0, 100);
if (item.content.length > 100) {
contentPreview += "……";
}
link.hover(
function(e) {
tooltip.text($(this).data('content'))
.css({
top: e.pageY + 10,
left: e.pageX + 10
})
.show();
},
function() {
tooltip.hide();
}
).mousemove(function(e) {
tooltip.css({
top: e.pageY + 10,
left: e.pageX + 10
});
}).data('content', contentPreview);
suggest.append(link);
suggest.append(' - ' + item.date + '<br />');
}
}
});
} else {
suggest.html("暂无推荐文章……");
}
});
</script>
<br />
<div class="pagination">
<span class="prev">
<a href="/2023/02/03/mbp.html">
上一篇MacBook Pro 2022 13寸使用体验
</a>
</span>
<br />
<span class="next">
<a href="/2023/03/12/php-async.html">
下一篇PHP异步执行的探索
</a>
</span>
</div>
<!--[if !IE]> -->
<link rel="stylesheet" href="/assets/css/gitalk.css">
<script src="/assets/js/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
var gitalk = new Gitalk({
clientID: '36557aec4c3cb04f7ac6',
clientSecret: 'ac32993299751cb5a9ba81cf2b171cca65879cdb',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '/2023/02/22/cron', // Ensure uniqueness and length less than 50
distractionFreeMode: false, // Facebook-like distraction free mode
proxy: "https://cors-anywhere.mayx.eu.org/?https://github.com/login/oauth/access_token"
})
gitalk.render('gitalk-container')
</script>
<!-- <![endif]-->
</section>
<!--[if !IE]> -->
<div id="landlord" style="left:5px;bottom:0px;">
<div class="message" style="opacity:0"></div>
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
<div class="live_talk_input_body">
<form id="live_talk_input_form">
<div class="live_talk_input_name_body" >
<input type="checkbox" id="load_this" />
<input type="hidden" id="post_id" value="/2023/02/22/cron.html" />
<label for="load_this">
<span style="font-size: 11px; color: #fff;">&#160;想问这篇文章</span>
</label>
</div>
<div class="live_talk_input_text_body">
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?" />
<button type="submit" class="live_talk_send_btn" id="talk_send">发送</button>
</div>
</form>
</div>
<input name="live_talk" id="live_talk" value="1" type="hidden" />
<div class="live_ico_box" style="display:none;">
<div class="live_ico_item type_info" id="showInfoBtn"></div>
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
<div class="live_ico_item type_music" id="musicButton"></div>
<div class="live_ico_item type_youdu" id="youduButton"></div>
<div class="live_ico_item type_quit" id="hideButton"></div>
<input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
<audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
<input id="duType" value="douqilai" type="hidden" />
</div>
</div>
<div id="open_live2d">召唤伊斯特瓦尔</div>
<!-- <![endif]-->
<footer>
<p>
<small>Made with ❤ by Mayx<br />Last updated at 2026-01-17 17:35:53<br /> 总字数614622 - 文章数178 - <a href="/atom.xml" >Atom</a> - <a href="/README.html" >About</a></small>
</p>
</footer>
</div>
<script src="/assets/js/scale.fix.js"></script>
<!--[if !IE]> -->
<script src="/assets/js/main_new.js"></script>
<script src="/Live2dHistoire/live2d/js/live2d.js"></script>
<script src="/Live2dHistoire/live2d/js/message.js"></script>
<!-- <![endif]-->
</body>
</html>

310
2023/03/12/php-async.html Normal file
View File

@@ -0,0 +1,310 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>PHP异步执行的探索 | Mayx的博客</title>
<meta name="generator" content="Jekyll v3.9.5" />
<meta property="og:title" content="PHP异步执行的探索" />
<meta name="author" content="mayx" />
<meta property="og:locale" content="zh_CN" />
<meta name="description" content="看来异步总是个难以解决的问题啊……" />
<meta property="og:description" content="看来异步总是个难以解决的问题啊……" />
<meta property="og:site_name" content="Mayx的博客" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2023-03-12T00:00:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="PHP异步执行的探索" />
<meta name="google-site-verification" content="huTYdEesm8NaFymixMNqflyCp6Jfvd615j5Wq1i2PHc" />
<meta name="msvalidate.01" content="0ADFCE64B3557DC4DC5F2DC224C5FDDD" />
<meta name="yandex-verification" content="fc0e535abed800be" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"mayx"},"dateModified":"2023-03-12T00:00:00+08:00","datePublished":"2023-03-12T00:00:00+08:00","description":"看来异步总是个难以解决的问题啊……","headline":"PHP异步执行的探索","mainEntityOfPage":{"@type":"WebPage","@id":"/2023/03/12/php-async.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://avatars0.githubusercontent.com/u/17966333"},"name":"mayx"},"url":"/2023/03/12/php-async.html"}</script>
<!-- End Jekyll SEO tag -->
<link rel="canonical" href="https://mabbs.github.io/2023/03/12/php-async.html" />
<link type="application/atom+xml" rel="alternate" href="/atom.xml" title="Mayx的博客" />
<link rel="alternate" type="application/rss+xml" title="Mayx的博客(RSS)" href="/rss.xml" />
<link rel="alternate" type="application/json" title="Mayx的博客(JSON Feed)" href="/feed.json" />
<link rel="stylesheet" href="/assets/css/style.css?v=1768642553" />
<!--[if !IE]> -->
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
<!-- <![endif]-->
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Mayx的博客" />
<link rel="webmention" href="https://webmention.io/mabbs.github.io/webmention" />
<link rel="pingback" href="https://webmention.io/mabbs.github.io/xmlrpc" />
<link rel="preconnect" href="https://summary.mayx.eu.org" crossorigin="anonymous" />
<link rel="prefetch" href="https://www.blogsclub.org/badge/mabbs.github.io" as="image" />
<link rel="blogroll" type="text/xml" href="/blogroll.opml" />
<link rel="me" href="https://github.com/Mabbs" />
<script src="/assets/js/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
var lastUpdated = new Date("Sat, 17 Jan 2026 17:35:53 +0800");
var BlogAPI = "https://summary.mayx.eu.org";
</script>
<script src="/assets/js/main.js"></script>
<!--[if !IE]> -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-137710294-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-137710294-1');
</script>
<script src="/assets/js/instant.page.js" type="module"></script>
<!-- <![endif]-->
</head>
<body>
<!--[if !IE]> --><noscript><marquee style="top: -15px; position: relative;"><small>发现当前浏览器没有启用JavaScript这不影响你的浏览但可能会有一些功能无法使用……</small></marquee></noscript><!-- <![endif]-->
<!--[if IE]><marquee style="top: -15px; position: relative;"><small>发现当前浏览器为Internet Explorer这不影响你的浏览但可能会有一些功能无法使用……</small></marquee><![endif]-->
<div class="wrapper">
<header class="h-card">
<h1><a class="u-url u-uid p-name" rel="me" href="/">Mayx的博客</a></h1>
<img src="https://avatars0.githubusercontent.com/u/17966333" fetchpriority="high" class="u-photo" alt="Logo" style="width: 90%; max-width: 300px; max-height: 300px;" />
<p class="p-note">Mayx's Home Page</p>
<form action="/search.html">
<input type="text" name="keyword" id="search-input-all" placeholder="Search blog posts.." />&#160;<input type="submit" value="搜索" />
</form>
<br />
<p class="view"><a class="u-url" href="/Mabbs/">About me</a></p>
<ul class="downloads">
<li style="width: 270px; border-right: none;"><a href="/MayxBlog.tgz">Download <strong>TGZ File</strong></a></li>
</ul>
</header>
<section class="h-entry">
<small><time class="date dt-published" datetime="2023-03-12T00:00:00+08:00">12 March 2023</time> - 字数统计1312 - 阅读大约需要4分钟 - Hits: <span id="/2023/03/12/php-async.html" class="visitors">Loading...</span></small>
<h1 class="p-name">PHP异步执行的探索</h1>
<p class="view">by <a class="p-author h-card" href="//github.com/Mabbs">mayx</a></p>
<div id="outdate" style="display:none;">
<hr /><p>
这是一篇创建于 <span id="outime"></span> 天前的文章,其中的信息可能已经有所发展或是发生改变。
</p>
</div>
<script>
daysold = Math.floor((new Date().getTime() - new Date("Sun, 12 Mar 2023 00:00:00 +0800").getTime()) / (24 * 60 * 60 * 1000));
if (daysold > 90) {
document.getElementById("outdate").style.display = "block";
document.getElementById("outime").innerHTML = daysold;
}
</script>
<hr />
<b>AI摘要</b>
<p id="ai-output">这篇文章主要探讨了PHP实现异步执行的挑战和尝试。作者在ThinkPHP项目中遇到需要立即返回数据并继续后台耗时操作的问题。以前采用的file_get_contents函数虽然解决了返回速度慢的问题但涉及到使用危险的函数和服务器配置限制。作者对于使用消息队列、Swoole框架及popen函数等方法持保留态度认为它们可能带来安全风险或超出项目规模。
作者发现fastcgi_finish_request函数可以输出内容并结束请求但需注意与session管理和PHP-FPM的交互。存在问题包括对Apache环境的限制、进程数量限制以及在TP框架下无法使用return。作者总结到PHP处理多线程问题有困难对于频繁遇到这类问题的项目可能需要考虑使用其他语言。</p>
<hr />
<ul><li><a href="#起因">起因</a></li><li><a href="#探索异步的方法">探索异步的方法</a></li><li><a href="#感想">感想</a></li></ul>
<hr />
<main class="post-content e-content" role="main"><p>看来异步总是个难以解决的问题啊……<!--more--></p>
<h1 id="起因">
<a href="#起因"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 起因
</h1>
<p>最近我在写一个ThinkPHP框架为基础的代码时遇到了一个问题我希望在执行完一个操作后立马返回数据然后在后台继续运行一个比较耗时的东西。我以前写的一个<a href="/2021/02/23/picbotpro.html">图片机器人</a>其实也遇到过这种问题为了解决返回很慢的问题我采用了“离弦之箭”——使用file_get_contents函数请求自己并且使用timeout参数来防止页面挂起另外接收的部分使用<code class="language-plaintext highlighter-rouge">ignore_user_abort(true)</code><code class="language-plaintext highlighter-rouge">set_time_limit(0)</code>保证在请求结束时让程序依然继续运行。不过我用的是TP框架啊不知道用那两个函数会不会出问题还有这个“timeout”到底填多少比较合适也不确定所以就想试试别的方法。</p>
<h1 id="探索异步的方法">
<a href="#探索异步的方法"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 探索异步的方法
</h1>
<p>对于正规的情况来说直接去网上搜如何让PHP异步执行代码估计大多会说使用什么消息队列或者用什么Swoole框架吧或者简单点用popen函数来fork一个进程或者用什么fsockopen貌似原理和我用file_get_contents函数差不多其实吧我觉得从本质来说那个所谓的Swoole框架已经不算PHP的东西了我觉得它更像是一个能通过http请求的popen函数通过某种方式也一样是在本地去调用PHP脚本只是可能用了些什么比如线程啥的特性提高了性能而已。 </p><p>
我看完这些选择之后很不满意我不希望代码里出现popen这样的函数说实话这是个危险的函数绝大多数情况下服务器应该要禁用这种函数的毕竟如果因为某些原因被人上传了PHP木马他们可以直接用这个函数去执行命令了。至于什么乱七八糟的异步框架想不想学是一方面主要是我的项目还没有达到用这种东西的规模。那难不成我只能继续用之前图片机器人的那个“离弦之箭”的办法了吗 </p><p>
后来我找到了一个很不错的函数,叫做<a href="https://www.php.net/manual/zh/function.fastcgi-finish-request.php">fastcgi_finish_request</a>它可以在程序结束前把要输出的东西输出并且结束请求不过使用它以后看文档说明好像说推荐再执行一下session_write_close函数不然在这个程序执行完成前session会被锁住没法操作。 </p><p>
不过这个函数只能在使用PHP-FPM的时候使用如果是像Apache那样使用模块的方式运行PHP估计就用不了了当然目前大多数环境应该都用的是Nginx+PHP-FPM吧我反正是很少见到有人用Apache虽然听说那样性能似乎会更好 </p><p>
还有一个问题就是如果这个需要运行的脚本的时间太长了以至于同时运行这个脚本的进程数量超过了pm.max_children那么PHP-FPM就不能接受新的请求了这也是一个缺陷。 </p><p>
另外在这种情况下我使用了TP框架还会遇到一个问题那就是我不能使用return返回内容了毕竟return了之后就不能执行其他函数了啊所以就只能提前用echo之类的东西输出执行完fastcgi_finish_request和所有需要长时间运行的代码后就只能return空值或者直接exit吧。</p>
<h1 id="感想">
<a href="#感想"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 感想
</h1>
<p>看来用PHP来做异步果然是难事啊不如说大多数程序想要处理好多线程的问题都挺难的吧也许如果项目经常遇到这种问题应该考虑用其他语言来编写了呢。</p></main>
<small style="display: block">tags: <a rel="category tag" class="p-category" href="/search.html?keyword=PHP"><em>PHP</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=%E5%BC%82%E6%AD%A5"><em>异步</em></a> <span style="float: right;"><a href="https://gitlab.com/mayx/mayx.gitlab.io/tree/master/_posts/2023-03-12-php-async.md">查看原始文件</a></span></small>
<h4 style="border-bottom: 1px solid #e5e5e5;margin: 2em 0 5px;">推荐文章</h4>
<p id="suggest-container">Loading...</p>
<script>
var suggest = $("#suggest-container");
$.get(BlogAPI + "/suggest?id=/2023/03/12/php-async.html&update=" + lastUpdated.valueOf(), function (data) {
if (data.length) {
getSearchJSON(function (search) {
suggest.empty();
var searchMap = {};
for (var i = 0; i < search.length; i++) {
searchMap[search[i].url] = search[i];
}
var tooltip = $('<div class="content-tooltip"></div>').appendTo('body').hide();
for (var j = 0; j < data.length; j++) {
var item = searchMap[data[j].id];
if (item) {
var link = $('<a href="' + item.url + '">' + item.title + '</a>');
var contentPreview = item.content.substring(0, 100);
if (item.content.length > 100) {
contentPreview += "……";
}
link.hover(
function(e) {
tooltip.text($(this).data('content'))
.css({
top: e.pageY + 10,
left: e.pageX + 10
})
.show();
},
function() {
tooltip.hide();
}
).mousemove(function(e) {
tooltip.css({
top: e.pageY + 10,
left: e.pageX + 10
});
}).data('content', contentPreview);
suggest.append(link);
suggest.append(' - ' + item.date + '<br />');
}
}
});
} else {
suggest.html("暂无推荐文章……");
}
});
</script>
<br />
<div class="pagination">
<span class="prev">
<a href="/2023/02/22/cron.html">
上一篇使用CF Workers Cron触发器进行签到
</a>
</span>
<br />
<span class="next">
<a href="/2023/04/05/ai.html">
下一篇:关于最近人工智能的探索
</a>
</span>
</div>
<!--[if !IE]> -->
<link rel="stylesheet" href="/assets/css/gitalk.css">
<script src="/assets/js/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
var gitalk = new Gitalk({
clientID: '36557aec4c3cb04f7ac6',
clientSecret: 'ac32993299751cb5a9ba81cf2b171cca65879cdb',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '/2023/03/12/php-async', // Ensure uniqueness and length less than 50
distractionFreeMode: false, // Facebook-like distraction free mode
proxy: "https://cors-anywhere.mayx.eu.org/?https://github.com/login/oauth/access_token"
})
gitalk.render('gitalk-container')
</script>
<!-- <![endif]-->
</section>
<!--[if !IE]> -->
<div id="landlord" style="left:5px;bottom:0px;">
<div class="message" style="opacity:0"></div>
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
<div class="live_talk_input_body">
<form id="live_talk_input_form">
<div class="live_talk_input_name_body" >
<input type="checkbox" id="load_this" />
<input type="hidden" id="post_id" value="/2023/03/12/php-async.html" />
<label for="load_this">
<span style="font-size: 11px; color: #fff;">&#160;想问这篇文章</span>
</label>
</div>
<div class="live_talk_input_text_body">
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?" />
<button type="submit" class="live_talk_send_btn" id="talk_send">发送</button>
</div>
</form>
</div>
<input name="live_talk" id="live_talk" value="1" type="hidden" />
<div class="live_ico_box" style="display:none;">
<div class="live_ico_item type_info" id="showInfoBtn"></div>
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
<div class="live_ico_item type_music" id="musicButton"></div>
<div class="live_ico_item type_youdu" id="youduButton"></div>
<div class="live_ico_item type_quit" id="hideButton"></div>
<input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
<audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
<input id="duType" value="douqilai" type="hidden" />
</div>
</div>
<div id="open_live2d">召唤伊斯特瓦尔</div>
<!-- <![endif]-->
<footer>
<p>
<small>Made with ❤ by Mayx<br />Last updated at 2026-01-17 17:35:53<br /> 总字数614622 - 文章数178 - <a href="/atom.xml" >Atom</a> - <a href="/README.html" >About</a></small>
</p>
</footer>
</div>
<script src="/assets/js/scale.fix.js"></script>
<!--[if !IE]> -->
<script src="/assets/js/main_new.js"></script>
<script src="/Live2dHistoire/live2d/js/live2d.js"></script>
<script src="/Live2dHistoire/live2d/js/message.js"></script>
<!-- <![endif]-->
</body>
</html>

317
2023/04/05/ai.html Normal file
View File

@@ -0,0 +1,317 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>关于最近人工智能的探索 | Mayx的博客</title>
<meta name="generator" content="Jekyll v3.9.5" />
<meta property="og:title" content="关于最近人工智能的探索" />
<meta name="author" content="mayx" />
<meta property="og:locale" content="zh_CN" />
<meta name="description" content="最近人工智能发展的还真是不错啊……" />
<meta property="og:description" content="最近人工智能发展的还真是不错啊……" />
<meta property="og:site_name" content="Mayx的博客" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2023-04-05T00:00:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="关于最近人工智能的探索" />
<meta name="google-site-verification" content="huTYdEesm8NaFymixMNqflyCp6Jfvd615j5Wq1i2PHc" />
<meta name="msvalidate.01" content="0ADFCE64B3557DC4DC5F2DC224C5FDDD" />
<meta name="yandex-verification" content="fc0e535abed800be" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"mayx"},"dateModified":"2023-04-05T00:00:00+08:00","datePublished":"2023-04-05T00:00:00+08:00","description":"最近人工智能发展的还真是不错啊……","headline":"关于最近人工智能的探索","mainEntityOfPage":{"@type":"WebPage","@id":"/2023/04/05/ai.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://avatars0.githubusercontent.com/u/17966333"},"name":"mayx"},"url":"/2023/04/05/ai.html"}</script>
<!-- End Jekyll SEO tag -->
<link rel="canonical" href="https://mabbs.github.io/2023/04/05/ai.html" />
<link type="application/atom+xml" rel="alternate" href="/atom.xml" title="Mayx的博客" />
<link rel="alternate" type="application/rss+xml" title="Mayx的博客(RSS)" href="/rss.xml" />
<link rel="alternate" type="application/json" title="Mayx的博客(JSON Feed)" href="/feed.json" />
<link rel="stylesheet" href="/assets/css/style.css?v=1768642553" />
<!--[if !IE]> -->
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
<!-- <![endif]-->
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Mayx的博客" />
<link rel="webmention" href="https://webmention.io/mabbs.github.io/webmention" />
<link rel="pingback" href="https://webmention.io/mabbs.github.io/xmlrpc" />
<link rel="preconnect" href="https://summary.mayx.eu.org" crossorigin="anonymous" />
<link rel="prefetch" href="https://www.blogsclub.org/badge/mabbs.github.io" as="image" />
<link rel="blogroll" type="text/xml" href="/blogroll.opml" />
<link rel="me" href="https://github.com/Mabbs" />
<script src="/assets/js/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
var lastUpdated = new Date("Sat, 17 Jan 2026 17:35:53 +0800");
var BlogAPI = "https://summary.mayx.eu.org";
</script>
<script src="/assets/js/main.js"></script>
<!--[if !IE]> -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-137710294-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-137710294-1');
</script>
<script src="/assets/js/instant.page.js" type="module"></script>
<!-- <![endif]-->
</head>
<body>
<!--[if !IE]> --><noscript><marquee style="top: -15px; position: relative;"><small>发现当前浏览器没有启用JavaScript这不影响你的浏览但可能会有一些功能无法使用……</small></marquee></noscript><!-- <![endif]-->
<!--[if IE]><marquee style="top: -15px; position: relative;"><small>发现当前浏览器为Internet Explorer这不影响你的浏览但可能会有一些功能无法使用……</small></marquee><![endif]-->
<div class="wrapper">
<header class="h-card">
<h1><a class="u-url u-uid p-name" rel="me" href="/">Mayx的博客</a></h1>
<img src="https://avatars0.githubusercontent.com/u/17966333" fetchpriority="high" class="u-photo" alt="Logo" style="width: 90%; max-width: 300px; max-height: 300px;" />
<p class="p-note">Mayx's Home Page</p>
<form action="/search.html">
<input type="text" name="keyword" id="search-input-all" placeholder="Search blog posts.." />&#160;<input type="submit" value="搜索" />
</form>
<br />
<p class="view"><a class="u-url" href="/Mabbs/">About me</a></p>
<ul class="downloads">
<li style="width: 270px; border-right: none;"><a href="/MayxBlog.tgz">Download <strong>TGZ File</strong></a></li>
</ul>
</header>
<section class="h-entry">
<small><time class="date dt-published" datetime="2023-04-05T00:00:00+08:00">5 April 2023</time> - 字数统计2705 - 阅读大约需要8分钟 - Hits: <span id="/2023/04/05/ai.html" class="visitors">Loading...</span></small>
<h1 class="p-name">关于最近人工智能的探索</h1>
<p class="view">by <a class="p-author h-card" href="//github.com/Mabbs">mayx</a></p>
<div id="outdate" style="display:none;">
<hr /><p>
这是一篇创建于 <span id="outime"></span> 天前的文章,其中的信息可能已经有所发展或是发生改变。
</p>
</div>
<script>
daysold = Math.floor((new Date().getTime() - new Date("Wed, 05 Apr 2023 00:00:00 +0800").getTime()) / (24 * 60 * 60 * 1000));
if (daysold > 90) {
document.getElementById("outdate").style.display = "block";
document.getElementById("outime").innerHTML = daysold;
}
</script>
<hr />
<b>AI摘要</b>
<p id="ai-output">这篇文章讲述了人工智能特别是LLM大型语言模型领域近期的发展以ChatGPT和相关模型如Alpaca为例。作者提到开源社区如GitHub上的llama.cpp项目让AI技术更加亲民即使是在资源有限的设备上也能体验到。斯坦福大学的Finetune技术使得AI模型性能提升而成本较低的LoRA方法使得AI训练更加普及作者还分享了自己的实践经验如使用不同设备运行不同规模的模型。此外作者对开源社区的AI发展持乐观态度希望未来能在低成本情况下提高效率但也表达了对技术被商业化和不平等竞争的担忧。</p>
<hr />
<ul><li><a href="#起因">起因</a></li><li><a href="#关于llama衍生的模型体验">关于LLaMA衍生的模型体验</a></li><li><a href="#让m2芯片发挥更大的作用">让M2芯片发挥更大的作用</a></li><li><a href="#感想">感想</a></li></ul>
<hr />
<main class="post-content e-content" role="main"><p>最近人工智能发展的还真是不错啊……<!--more--></p>
<h1 id="起因">
<a href="#起因"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 起因
</h1>
<p>最近ChatGPT为代表的人工智能发展的越来越好了而且因为它对生产力的提升使得了解AI的人也越来越多了。虽然我也不算是对AI很感兴趣但是我在Github Copilot刚出的时候就已经用上了到现在一直在用不过毕业了以后估计就用不了了吧😂。不过那时候Copilot毕竟专业性比较高知道的人也比较少不像现在ChatGPT能在各行各业使用甚至还有基于类似模型的Vtuber比如<a href="https://www.twitch.tv/vedal987">Neuro-sama</a>,所以即使是普通人使用它,都能够减轻自己的工作压力,所以现在的人们都在讨论它。 </p><p>
当然在这之前还有一些很厉害的画图AI比如使用了Stable Difusion的NovalAI以及Midjourney啥的不过因为我对画图并不感兴趣所以它发展的有多好也基本上和我没有关系。其实除了这些能够AIGC的模型之外在那之前还有下围棋的AlphaGO啥的那个我就更不感兴趣了相信大多数人也不感兴趣所以总的来看也就只有现在才能证明AI发展到了能够让大家觉得能干涉到更多人的地步吧。 </p><p>
也正因为现在以ChatGPT为代表的LLM的发展开源社区也开始搞起来一些有意思的东西。不过LLM的训练成本比较高所以现在开源社区在这一块的发展也许得感谢比如Facebook的<a href="https://github.com/facebookresearch/llama">LLaMA</a>之类基础的模型才能让大家能用较低的成本去训练属于自己的AI吧。</p>
<h1 id="关于llama衍生的模型体验">
<a href="#关于llama衍生的模型体验"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 关于LLaMA衍生的模型体验
</h1>
<p>在刚开始LLaMA被Facebook开源的时候GitHub上就出现了<a href="https://github.com/ggerganov/llama.cpp">llama.cpp</a>这个项目因为我没钱买显卡手头只有笔记本电脑上的一张非常垃圾的GTX1650Ti 4GiB显存的显卡多亏了这个项目可以让我这种没显卡的人也能体验LLM的乐趣。而且这个项目使用起来非常简单不像很多AI项目还要装什么TensorFlow啊还是什么PyTorch啥的那些东西不仅大还非常的挑版本这个项目运行的时候就什么都不用考虑对使用者来说非常的友好像清华那个<a href="https://github.com/THUDM/ChatGLM-6B">ChatGLM-6B</a>我就完全跑不了它要想正常体验得要有8GiB的显存我就没法整这种东西了。 </p><p>
我体验了那个最开始的LLaMA-7B的模型效果其实不怎么样根本没法流畅对话不过也能理解因为它应该相当于是把一堆数据堆到一起的东西吧也没有针对对话进行训练。不过很快斯坦福大学对这个模型进行了Finetune制作出了<a href="https://github.com/tatsu-lab/stanford_alpaca">Alpaca</a>当然这个仓库里面的东西是纯粹的菜谱和食材把他们加工成模型得要整一堆A100的显卡跑几个小时这个我可整不来不过还好有人根据这个原材料加工成了完整的模型现在去🤗上就能下载的到比如去<a href="https://huggingface.co/chavinlo/alpaca-native">这个仓库</a>就能下载到训练好的模型,在<a href="https://huggingface.co/Pi3141/alpaca-native-7B-ggml">这里</a>可以下载到已经经过量化直接可以给llama.cpp使用的版本不过现在llama.cpp升级了得要按照说明在仓库里执行那个Python脚本进行转换才能正常使用</p><p>
我运行这些东西是在我的Macbook Pro上它只有8GiB的内存所以只能跑7B70亿参数的模型不过就这个模型也已经非常厉害了虽然只能说英文但是流畅程度上下文关系的能力都非常不错而且常见的知识都能正确回答效果让我很满意。不过8GiB内存实在是太小了想跑点别的也没办法……不过16GiB内存的电脑我还是能找得到的我找了台CPU是i7-11700K的台式机跑了下<a href="https://huggingface.co/Pi3141/gpt4-x-alpaca-native-13B-ggml">使用GPT-4对话数据微调的13B模型</a>速度比M2芯片跑的速度感觉慢了至少5倍吧Macbook生成的速度基本上能达到对话的语速台式机跑的速度那就是一个一个词往出蹦这下就能感受到M2芯片的计算能力还是强大啊4大核+4小核比8核16线程还要厉害苹果的产品属实有点东西😝不过这个13B的模型也确实厉害有些7B的模型回答有错误的部分这个13B的都能正确回答如果我能整个16GiB的Macbook可能就能完整体验了吧可惜苹果家的内存比金子都贵实在是买不起啊…… </p><p>
斯坦福的这种Finetune方法成本还是有点高所以后来又有人研究出了一个叫<a href="https://arxiv.org/pdf/2106.09685.pdf">LoRA</a>的办法去Finetune模型据说只要一张普通的显卡就可以进行不需要一堆高级显卡也能跑不过再低级的显卡也不是我这GTX1650Ti能碰瓷的所以我也只能看看别人训练的模型啦。在看的时候我发现了一个用的中文训练集跑的模型项目<a href="https://github.com/ymcui/Chinese-LLaMA-Alpaca">Chinese-LLaMA-Alpaca</a>看起来还挺有意思的不过他们似乎担心什么版权问题只放出了LoRA权重没有完整的模型就相当于是没有面饼的泡面只有料包好在他们倒是给了去哪里找面饼。不过泡面的这个过程对我来说也挺难的合并它需要13-15GiB的可用内存16GiB的内存肯定不够用所以得找一台32GiB内存的电脑不会有人组非2次方倍数内存的电脑吧……我手头没有还好从网上找了台免费的云主机整了个32GiB内存的才成功的把这碗面泡出来了。虽然泡面的步骤不多也不算特别难只是我是觉得干嘛同一碗面泡那么多次不如我提前泡好直接放网上所以我也在🤗上上传了最终合并并量化的模型<a href="https://huggingface.co/Mabbs/chinese-Alpaca-lora-7b-ggml">在这里</a>就能下载到直接就能拿来用的模型了。至于运行的参数就按照之前仓库的操作就行了。</p>
<h1 id="让m2芯片发挥更大的作用">
<a href="#让m2芯片发挥更大的作用"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 让M2芯片发挥更大的作用
</h1>
<p>在我玩完那个llama.cpp项目之后我觉得让M2芯片光用CPU算好浪费啊毕竟这个芯片里面还有神经网络引擎和GPU啊这些哪个都比CPU算更好吧不过想要调那些东西进行人工智能计算貌似只能用苹果的Core ML框架。这两天我在Github看到一个苹果官方发布的<a href="https://github.com/apple/ml-stable-diffusion">Core ML Stable Diffusion</a>看起来还挺有意思的我倒是也想在我的Macbook上跑一下正好🤗开发了一个示例<a href="https://apps.apple.com/app/diffusers/id1666309574">Diffusers</a>可以拿来试试看可惜8GiB内存还是限制了它的发挥跑是能跑速度也挺快的就是模型没法换因为内存也只能跑小的模型跑出来可以说真的就是那种抽象的不能再抽象的东西吧……不过不管怎么说这还是发挥了一下神经网络引擎和GPU的作用吧不然感觉苹果做了这些东西就没啥作用了😂。</p>
<h1 id="感想">
<a href="#感想"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 感想
</h1>
<p>从这次体验来看我对开源社区的AI发展感觉还是挺有信心的虽然相比于ChatGPT之类的来说可能还没办法当作生产力不过毕竟它比较平民化至于知识量少的问题如果开发者们能加把油能让这些模型对接网络那也许就可以在很低成本的情况代替OpenAI的ChatGPT吧也能避免他们服务器出问题之类的原因导致生产力的下降吧。不过开源这种事情还是有点……毕竟还是不希望这些东西被人拿去商业化更不希望出现国外一开源国内就自研这种糟糕情况也许开源产品比不上人家的商业产品也是正常的。</p></main>
<small style="display: block">tags: <a rel="category tag" class="p-category" href="/search.html?keyword=AI"><em>AI</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=LLM"><em>LLM</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD"><em>人工智能</em></a> <span style="float: right;"><a href="https://gitlab.com/mayx/mayx.gitlab.io/tree/master/_posts/2023-04-05-ai.md">查看原始文件</a></span></small>
<h4 style="border-bottom: 1px solid #e5e5e5;margin: 2em 0 5px;">推荐文章</h4>
<p id="suggest-container">Loading...</p>
<script>
var suggest = $("#suggest-container");
$.get(BlogAPI + "/suggest?id=/2023/04/05/ai.html&update=" + lastUpdated.valueOf(), function (data) {
if (data.length) {
getSearchJSON(function (search) {
suggest.empty();
var searchMap = {};
for (var i = 0; i < search.length; i++) {
searchMap[search[i].url] = search[i];
}
var tooltip = $('<div class="content-tooltip"></div>').appendTo('body').hide();
for (var j = 0; j < data.length; j++) {
var item = searchMap[data[j].id];
if (item) {
var link = $('<a href="' + item.url + '">' + item.title + '</a>');
var contentPreview = item.content.substring(0, 100);
if (item.content.length > 100) {
contentPreview += "……";
}
link.hover(
function(e) {
tooltip.text($(this).data('content'))
.css({
top: e.pageY + 10,
left: e.pageX + 10
})
.show();
},
function() {
tooltip.hide();
}
).mousemove(function(e) {
tooltip.css({
top: e.pageY + 10,
left: e.pageX + 10
});
}).data('content', contentPreview);
suggest.append(link);
suggest.append(' - ' + item.date + '<br />');
}
}
});
} else {
suggest.html("暂无推荐文章……");
}
});
</script>
<br />
<div class="pagination">
<span class="prev">
<a href="/2023/03/12/php-async.html">
上一篇PHP异步执行的探索
</a>
</span>
<br />
<span class="next">
<a href="/2023/05/22/rpi-win.html">
下一篇使用树莓派安装Windows的尝试
</a>
</span>
</div>
<!--[if !IE]> -->
<link rel="stylesheet" href="/assets/css/gitalk.css">
<script src="/assets/js/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
var gitalk = new Gitalk({
clientID: '36557aec4c3cb04f7ac6',
clientSecret: 'ac32993299751cb5a9ba81cf2b171cca65879cdb',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '/2023/04/05/ai', // Ensure uniqueness and length less than 50
distractionFreeMode: false, // Facebook-like distraction free mode
proxy: "https://cors-anywhere.mayx.eu.org/?https://github.com/login/oauth/access_token"
})
gitalk.render('gitalk-container')
</script>
<!-- <![endif]-->
</section>
<!--[if !IE]> -->
<div id="landlord" style="left:5px;bottom:0px;">
<div class="message" style="opacity:0"></div>
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
<div class="live_talk_input_body">
<form id="live_talk_input_form">
<div class="live_talk_input_name_body" >
<input type="checkbox" id="load_this" />
<input type="hidden" id="post_id" value="/2023/04/05/ai.html" />
<label for="load_this">
<span style="font-size: 11px; color: #fff;">&#160;想问这篇文章</span>
</label>
</div>
<div class="live_talk_input_text_body">
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?" />
<button type="submit" class="live_talk_send_btn" id="talk_send">发送</button>
</div>
</form>
</div>
<input name="live_talk" id="live_talk" value="1" type="hidden" />
<div class="live_ico_box" style="display:none;">
<div class="live_ico_item type_info" id="showInfoBtn"></div>
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
<div class="live_ico_item type_music" id="musicButton"></div>
<div class="live_ico_item type_youdu" id="youduButton"></div>
<div class="live_ico_item type_quit" id="hideButton"></div>
<input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
<audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
<input id="duType" value="douqilai" type="hidden" />
</div>
</div>
<div id="open_live2d">召唤伊斯特瓦尔</div>
<!-- <![endif]-->
<footer>
<p>
<small>Made with ❤ by Mayx<br />Last updated at 2026-01-17 17:35:53<br /> 总字数614622 - 文章数178 - <a href="/atom.xml" >Atom</a> - <a href="/README.html" >About</a></small>
</p>
</footer>
</div>
<script src="/assets/js/scale.fix.js"></script>
<!--[if !IE]> -->
<script src="/assets/js/main_new.js"></script>
<script src="/Live2dHistoire/live2d/js/live2d.js"></script>
<script src="/Live2dHistoire/live2d/js/message.js"></script>
<!-- <![endif]-->
</body>
</html>

322
2023/05/22/rpi-win.html Normal file
View File

@@ -0,0 +1,322 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>使用树莓派安装Windows的尝试 | Mayx的博客</title>
<meta name="generator" content="Jekyll v3.9.5" />
<meta property="og:title" content="使用树莓派安装Windows的尝试" />
<meta name="author" content="mayx" />
<meta property="og:locale" content="zh_CN" />
<meta name="description" content="树莓派能不能作为迷你主机使用呢?" />
<meta property="og:description" content="树莓派能不能作为迷你主机使用呢?" />
<meta property="og:site_name" content="Mayx的博客" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2023-05-22T00:00:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="使用树莓派安装Windows的尝试" />
<meta name="google-site-verification" content="huTYdEesm8NaFymixMNqflyCp6Jfvd615j5Wq1i2PHc" />
<meta name="msvalidate.01" content="0ADFCE64B3557DC4DC5F2DC224C5FDDD" />
<meta name="yandex-verification" content="fc0e535abed800be" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"mayx"},"dateModified":"2023-05-22T00:00:00+08:00","datePublished":"2023-05-22T00:00:00+08:00","description":"树莓派能不能作为迷你主机使用呢?","headline":"使用树莓派安装Windows的尝试","mainEntityOfPage":{"@type":"WebPage","@id":"/2023/05/22/rpi-win.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://avatars0.githubusercontent.com/u/17966333"},"name":"mayx"},"url":"/2023/05/22/rpi-win.html"}</script>
<!-- End Jekyll SEO tag -->
<link rel="canonical" href="https://mabbs.github.io/2023/05/22/rpi-win.html" />
<link type="application/atom+xml" rel="alternate" href="/atom.xml" title="Mayx的博客" />
<link rel="alternate" type="application/rss+xml" title="Mayx的博客(RSS)" href="/rss.xml" />
<link rel="alternate" type="application/json" title="Mayx的博客(JSON Feed)" href="/feed.json" />
<link rel="stylesheet" href="/assets/css/style.css?v=1768642553" />
<!--[if !IE]> -->
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
<!-- <![endif]-->
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Mayx的博客" />
<link rel="webmention" href="https://webmention.io/mabbs.github.io/webmention" />
<link rel="pingback" href="https://webmention.io/mabbs.github.io/xmlrpc" />
<link rel="preconnect" href="https://summary.mayx.eu.org" crossorigin="anonymous" />
<link rel="prefetch" href="https://www.blogsclub.org/badge/mabbs.github.io" as="image" />
<link rel="blogroll" type="text/xml" href="/blogroll.opml" />
<link rel="me" href="https://github.com/Mabbs" />
<script src="/assets/js/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
var lastUpdated = new Date("Sat, 17 Jan 2026 17:35:53 +0800");
var BlogAPI = "https://summary.mayx.eu.org";
</script>
<script src="/assets/js/main.js"></script>
<!--[if !IE]> -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-137710294-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-137710294-1');
</script>
<script src="/assets/js/instant.page.js" type="module"></script>
<!-- <![endif]-->
</head>
<body>
<!--[if !IE]> --><noscript><marquee style="top: -15px; position: relative;"><small>发现当前浏览器没有启用JavaScript这不影响你的浏览但可能会有一些功能无法使用……</small></marquee></noscript><!-- <![endif]-->
<!--[if IE]><marquee style="top: -15px; position: relative;"><small>发现当前浏览器为Internet Explorer这不影响你的浏览但可能会有一些功能无法使用……</small></marquee><![endif]-->
<div class="wrapper">
<header class="h-card">
<h1><a class="u-url u-uid p-name" rel="me" href="/">Mayx的博客</a></h1>
<img src="https://avatars0.githubusercontent.com/u/17966333" fetchpriority="high" class="u-photo" alt="Logo" style="width: 90%; max-width: 300px; max-height: 300px;" />
<p class="p-note">Mayx's Home Page</p>
<form action="/search.html">
<input type="text" name="keyword" id="search-input-all" placeholder="Search blog posts.." />&#160;<input type="submit" value="搜索" />
</form>
<br />
<p class="view"><a class="u-url" href="/Mabbs/">About me</a></p>
<ul class="downloads">
<li style="width: 270px; border-right: none;"><a href="/MayxBlog.tgz">Download <strong>TGZ File</strong></a></li>
</ul>
</header>
<section class="h-entry">
<small><time class="date dt-published" datetime="2023-05-22T00:00:00+08:00">22 May 2023</time> - 字数统计1767 - 阅读大约需要6分钟 - Hits: <span id="/2023/05/22/rpi-win.html" class="visitors">Loading...</span></small>
<h1 class="p-name">使用树莓派安装Windows的尝试</h1>
<p class="view">by <a class="p-author h-card" href="//github.com/Mabbs">mayx</a></p>
<div id="outdate" style="display:none;">
<hr /><p>
这是一篇创建于 <span id="outime"></span> 天前的文章,其中的信息可能已经有所发展或是发生改变。
</p>
</div>
<script>
daysold = Math.floor((new Date().getTime() - new Date("Mon, 22 May 2023 00:00:00 +0800").getTime()) / (24 * 60 * 60 * 1000));
if (daysold > 90) {
document.getElementById("outdate").style.display = "block";
document.getElementById("outime").innerHTML = daysold;
}
</script>
<hr />
<b>AI摘要</b>
<p id="ai-output">这篇文章主要讲述了作者尝试在树莓派4B上安装Windows系统的过程包括使用Windows on R工具和不同存储卡的尝试但遇到了安装失败和性能问题如WinPE安装不能成功、Windows性能差尤其是读写速度和驱动缺失、CPU占用高等。尽管Linux系统在官方支持下运行流畅但作者认为树莓派在性能、驱动支持和视频播放等生产力方面表现不佳更适合用作物联网开发板而非普通电脑。文章最后对树莓派4B及后续版本的发展方向提出了疑问。</p>
<hr />
<ul><li><a href="#起因">起因</a></li><li><a href="#给树莓派安装windows">给树莓派安装Windows</a></li><li><a href="#在树莓派上的windows体验">在树莓派上的Windows体验</a></li><li><a href="#linux的生产力对比">Linux的生产力对比</a></li><li><a href="#感想">感想</a></li></ul>
<hr />
<main class="post-content e-content" role="main"><p>树莓派能不能作为迷你主机使用呢?<!--more--></p>
<h1 id="起因">
<a href="#起因"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 起因
</h1>
<p>前段时间家里人送给了我一个树莓派4B-8GiB内存版因为手头用着MacBook Pro看到这个比我之前用的树莓派3B好了不少的东西就开始想它能不能和用着一样是ARM架构的Mac Mini M2那样使用当然想给树莓派安装黑苹果那就是天方夜谭了毕竟macOS里用到的很多东西也不完全只是ARM想想也知道既然是苹果自己研发的芯片里面肯定是有一些比如专有的指令集什么的树莓派应该算是公版的ARM吧肯定有些指令是没有的……不过我还是愿意仿个macOS试试看我在网上看好像<a href="https://twisteros.com">TwisterOS</a>仿macOS的效果最好而且它是基于树莓派官方系统开发的所以应该也没啥兼容性的问题另外它其他的主题比如仿Windows的做的也不错但仿Windows还不如给它装一个真正的Windows毕竟网上是有能够给树莓派安装Windows ARM版的办法的。</p>
<h1 id="给树莓派安装windows">
<a href="#给树莓派安装windows"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 给树莓派安装Windows
</h1>
<p>最开始我想给树莓派安装Windows的时候手头没有Windows的电脑但是给树莓派安装Windows所用的软件<a href="https://worproject.com">Windows on R</a>貌似用到了Windows上的一些东西。不过他们提供了一种可以先给卡里安装WinPE然后再安装系统的办法最开始我是先尝试的那种方案我可以先用一张安装了树莓派官方系统启动树莓派然后用<a href="https://github.com/Botspot/wor-flasher">WoR-flasher</a>给另外一张卡安装WinPE以及系统镜像。操作很简单照着README做就行了不过不知道是为什么尝试了好几次每次安装到一半就卡住然后报错安装失败然后连WinPE都进不去了…… </p><p>
我怀疑是通过这种方式安装可能有什么问题而且当时安装到时候卡是32GiB大小的虽然官网上说32GiB是足够的不过也许还是有什么问题所以后来我重新买了一张64GiB的卡片并且用Windows去运行Windows on Raspberry imager给卡里安装了Windows 11不过很奇怪的是还是运行不了……换了好几个系统镜像都不行后来才发现原来是我自作多情每次启动的时候都把频率调成2.2GHz所以不能启动默认的1.5GHz或者调高到2.0GHz都没有问题😥,因为这个问题尝试了好多次……</p>
<h1 id="在树莓派上的windows体验">
<a href="#在树莓派上的windows体验"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 在树莓派上的Windows体验
</h1>
<p>安装好之后就可以尝试验证树莓派的生产力了不过结果让我很失望……首先是我用的TF卡是UHS-1写速度貌似是10MiB/s读速度商家宣传是130MiB/s不过实际上我也不太清楚随机读写估计就更慢了……这样的速度加载东西实在是有够慢……另外目前<a href="https://github.com/worproject/RPi-Windows-Drivers">在树莓派上使用的Windows驱动</a>里并没有无线网卡和核显的驱动所以体验也很差移动窗口之类的操作CPU都占用了不少我本来还想着考虑能不能比Macbook开虚拟机效果好一些不过目前来看这个结果应该是只差不好吧……虽然价格上树莓派和Mac Mini M2差了4倍不过体验这么差的话估计当生产力是没机会了。</p>
<h1 id="linux的生产力对比">
<a href="#linux的生产力对比"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> Linux的生产力对比
</h1>
<p>相比之下用树莓派官方的系统感觉要流畅不少毕竟官方系统的所有驱动都是正常工作的应该也能使用硬件解码只是有些桌面版的程序没有比如MS Office还有像7-Zip、WinSCP、XShell之类的软件 <del>其实macOS也不行🤣</del> ……用Wine怎么样呢其实我觉得应该好不到哪里毕竟大多数Windows的程序都是x86_64指令集Wine想要运行这些软件照样得靠QEMU翻译只不过可能调用的一些Windows的API可以原生执行而已除了这些之外我还试了试用Chromium播放Bilibili的视频结果也令人大失所望360p的视频都不能流畅播放更别说1080p了当然也不排除是因为Bilibili的视频用了硬件解码器不能解码的编码方式虽然相比树莓派3B来说确实至少可以流畅浏览网页了但是连视频都不能流畅播放那看来想当生产力还很远呢。</p>
<h1 id="感想">
<a href="#感想"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 感想
</h1>
<p>果然树莓派还是没有办法当作普通的电脑来用啊更不用说生产力了同样的价格至少还能组个能打游戏的电脑。尽管性能比树莓派3B好不少但毕竟用的还是很低级的芯片也许它就应该当作物联网的开发板来使用吧但很奇怪的是如果是这样树莓派3B就足够了吧何必开发树莓派4B以及带键盘的树莓派400呢还有就是树莓派CM4他们不会真以为自己的芯片速度很快吧🤣</p></main>
<small style="display: block">tags: <a rel="category tag" class="p-category" href="/search.html?keyword=%E6%A0%91%E8%8E%93%E6%B4%BE"><em>树莓派</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=Windows"><em>Windows</em></a> <span style="float: right;"><a href="https://gitlab.com/mayx/mayx.gitlab.io/tree/master/_posts/2023-05-22-rpi-win.md">查看原始文件</a></span></small>
<h4 style="border-bottom: 1px solid #e5e5e5;margin: 2em 0 5px;">推荐文章</h4>
<p id="suggest-container">Loading...</p>
<script>
var suggest = $("#suggest-container");
$.get(BlogAPI + "/suggest?id=/2023/05/22/rpi-win.html&update=" + lastUpdated.valueOf(), function (data) {
if (data.length) {
getSearchJSON(function (search) {
suggest.empty();
var searchMap = {};
for (var i = 0; i < search.length; i++) {
searchMap[search[i].url] = search[i];
}
var tooltip = $('<div class="content-tooltip"></div>').appendTo('body').hide();
for (var j = 0; j < data.length; j++) {
var item = searchMap[data[j].id];
if (item) {
var link = $('<a href="' + item.url + '">' + item.title + '</a>');
var contentPreview = item.content.substring(0, 100);
if (item.content.length > 100) {
contentPreview += "……";
}
link.hover(
function(e) {
tooltip.text($(this).data('content'))
.css({
top: e.pageY + 10,
left: e.pageX + 10
})
.show();
},
function() {
tooltip.hide();
}
).mousemove(function(e) {
tooltip.css({
top: e.pageY + 10,
left: e.pageX + 10
});
}).data('content', contentPreview);
suggest.append(link);
suggest.append(' - ' + item.date + '<br />');
}
}
});
} else {
suggest.html("暂无推荐文章……");
}
});
</script>
<br />
<div class="pagination">
<span class="prev">
<a href="/2023/04/05/ai.html">
上一篇:关于最近人工智能的探索
</a>
</span>
<br />
<span class="next">
<a href="/2023/06/30/nucleic-acid.html">
下一篇基于ThinkPHP5.1核酸检测登记系统的设计与开发
</a>
</span>
</div>
<!--[if !IE]> -->
<link rel="stylesheet" href="/assets/css/gitalk.css">
<script src="/assets/js/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
var gitalk = new Gitalk({
clientID: '36557aec4c3cb04f7ac6',
clientSecret: 'ac32993299751cb5a9ba81cf2b171cca65879cdb',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '/2023/05/22/rpi-win', // Ensure uniqueness and length less than 50
distractionFreeMode: false, // Facebook-like distraction free mode
proxy: "https://cors-anywhere.mayx.eu.org/?https://github.com/login/oauth/access_token"
})
gitalk.render('gitalk-container')
</script>
<!-- <![endif]-->
</section>
<!--[if !IE]> -->
<div id="landlord" style="left:5px;bottom:0px;">
<div class="message" style="opacity:0"></div>
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
<div class="live_talk_input_body">
<form id="live_talk_input_form">
<div class="live_talk_input_name_body" >
<input type="checkbox" id="load_this" />
<input type="hidden" id="post_id" value="/2023/05/22/rpi-win.html" />
<label for="load_this">
<span style="font-size: 11px; color: #fff;">&#160;想问这篇文章</span>
</label>
</div>
<div class="live_talk_input_text_body">
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?" />
<button type="submit" class="live_talk_send_btn" id="talk_send">发送</button>
</div>
</form>
</div>
<input name="live_talk" id="live_talk" value="1" type="hidden" />
<div class="live_ico_box" style="display:none;">
<div class="live_ico_item type_info" id="showInfoBtn"></div>
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
<div class="live_ico_item type_music" id="musicButton"></div>
<div class="live_ico_item type_youdu" id="youduButton"></div>
<div class="live_ico_item type_quit" id="hideButton"></div>
<input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
<audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
<input id="duType" value="douqilai" type="hidden" />
</div>
</div>
<div id="open_live2d">召唤伊斯特瓦尔</div>
<!-- <![endif]-->
<footer>
<p>
<small>Made with ❤ by Mayx<br />Last updated at 2026-01-17 17:35:53<br /> 总字数614622 - 文章数178 - <a href="/atom.xml" >Atom</a> - <a href="/README.html" >About</a></small>
</p>
</footer>
</div>
<script src="/assets/js/scale.fix.js"></script>
<!--[if !IE]> -->
<script src="/assets/js/main_new.js"></script>
<script src="/Live2dHistoire/live2d/js/live2d.js"></script>
<script src="/Live2dHistoire/live2d/js/message.js"></script>
<!-- <![endif]-->
</body>
</html>

1218
2023/06/30/nucleic-acid.html Normal file

File diff suppressed because it is too large Load Diff

332
2023/07/09/bitmo.html Normal file
View File

@@ -0,0 +1,332 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>分享一种无人值守的新型诈骗手段 | Mayx的博客</title>
<meta name="generator" content="Jekyll v3.9.5" />
<meta property="og:title" content="分享一种无人值守的新型诈骗手段" />
<meta name="author" content="mayx" />
<meta property="og:locale" content="zh_CN" />
<meta name="description" content="差点就被骗子骗了🤣,还是主动上钩的……" />
<meta property="og:description" content="差点就被骗子骗了🤣,还是主动上钩的……" />
<meta property="og:site_name" content="Mayx的博客" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2023-07-09T00:00:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="分享一种无人值守的新型诈骗手段" />
<meta name="google-site-verification" content="huTYdEesm8NaFymixMNqflyCp6Jfvd615j5Wq1i2PHc" />
<meta name="msvalidate.01" content="0ADFCE64B3557DC4DC5F2DC224C5FDDD" />
<meta name="yandex-verification" content="fc0e535abed800be" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"mayx"},"dateModified":"2023-07-09T00:00:00+08:00","datePublished":"2023-07-09T00:00:00+08:00","description":"差点就被骗子骗了🤣,还是主动上钩的……","headline":"分享一种无人值守的新型诈骗手段","mainEntityOfPage":{"@type":"WebPage","@id":"/2023/07/09/bitmo.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://avatars0.githubusercontent.com/u/17966333"},"name":"mayx"},"url":"/2023/07/09/bitmo.html"}</script>
<!-- End Jekyll SEO tag -->
<link rel="canonical" href="https://mabbs.github.io/2023/07/09/bitmo.html" />
<link type="application/atom+xml" rel="alternate" href="/atom.xml" title="Mayx的博客" />
<link rel="alternate" type="application/rss+xml" title="Mayx的博客(RSS)" href="/rss.xml" />
<link rel="alternate" type="application/json" title="Mayx的博客(JSON Feed)" href="/feed.json" />
<link rel="stylesheet" href="/assets/css/style.css?v=1768642553" />
<!--[if !IE]> -->
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
<!-- <![endif]-->
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Mayx的博客" />
<link rel="webmention" href="https://webmention.io/mabbs.github.io/webmention" />
<link rel="pingback" href="https://webmention.io/mabbs.github.io/xmlrpc" />
<link rel="preconnect" href="https://summary.mayx.eu.org" crossorigin="anonymous" />
<link rel="prefetch" href="https://www.blogsclub.org/badge/mabbs.github.io" as="image" />
<link rel="blogroll" type="text/xml" href="/blogroll.opml" />
<link rel="me" href="https://github.com/Mabbs" />
<script src="/assets/js/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
var lastUpdated = new Date("Sat, 17 Jan 2026 17:35:53 +0800");
var BlogAPI = "https://summary.mayx.eu.org";
</script>
<script src="/assets/js/main.js"></script>
<!--[if !IE]> -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-137710294-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-137710294-1');
</script>
<script src="/assets/js/instant.page.js" type="module"></script>
<!-- <![endif]-->
</head>
<body>
<!--[if !IE]> --><noscript><marquee style="top: -15px; position: relative;"><small>发现当前浏览器没有启用JavaScript这不影响你的浏览但可能会有一些功能无法使用……</small></marquee></noscript><!-- <![endif]-->
<!--[if IE]><marquee style="top: -15px; position: relative;"><small>发现当前浏览器为Internet Explorer这不影响你的浏览但可能会有一些功能无法使用……</small></marquee><![endif]-->
<div class="wrapper">
<header class="h-card">
<h1><a class="u-url u-uid p-name" rel="me" href="/">Mayx的博客</a></h1>
<img src="https://avatars0.githubusercontent.com/u/17966333" fetchpriority="high" class="u-photo" alt="Logo" style="width: 90%; max-width: 300px; max-height: 300px;" />
<p class="p-note">Mayx's Home Page</p>
<form action="/search.html">
<input type="text" name="keyword" id="search-input-all" placeholder="Search blog posts.." />&#160;<input type="submit" value="搜索" />
</form>
<br />
<p class="view"><a class="u-url" href="/Mabbs/">About me</a></p>
<ul class="downloads">
<li style="width: 270px; border-right: none;"><a href="/MayxBlog.tgz">Download <strong>TGZ File</strong></a></li>
</ul>
</header>
<section class="h-entry">
<small><time class="date dt-published" datetime="2023-07-09T00:00:00+08:00">9 July 2023</time> - 字数统计1882 - 阅读大约需要6分钟 - Hits: <span id="/2023/07/09/bitmo.html" class="visitors">Loading...</span></small>
<h1 class="p-name">分享一种无人值守的新型诈骗手段</h1>
<p class="view">by <a class="p-author h-card" href="//github.com/Mabbs">mayx</a></p>
<div id="outdate" style="display:none;">
<hr /><p>
这是一篇创建于 <span id="outime"></span> 天前的文章,其中的信息可能已经有所发展或是发生改变。
</p>
</div>
<script>
daysold = Math.floor((new Date().getTime() - new Date("Sun, 09 Jul 2023 00:00:00 +0800").getTime()) / (24 * 60 * 60 * 1000));
if (daysold > 90) {
document.getElementById("outdate").style.display = "block";
document.getElementById("outime").innerHTML = daysold;
}
</script>
<hr />
<b>AI摘要</b>
<p id="ai-output">这篇文章分享了一种新型的无人值守诈骗手法,骗子创建虚假的接码平台,并通过带有网站名、用户名和密码的诱人信息诱导用户登录。受害者登录后发现网站看似正常,提供了充值、提现等功能,但其实充值和提现需要安全密钥,且对免费账户有限制。诈骗者设计巧妙,通过转账功能一步步诱导用户,如充值、转账以及账户升级的假象,增加了被骗者的参与感。作者最终识破网站为假,怀疑其为国人开发的诈骗平台,并指出这类诈骗手法利用了人们的好奇心和财务冲动,效率高且设计逼真,可能会导致许多人受骗。</p>
<hr />
<ul><li><a href="#起因">起因</a></li><li><a href="#落入圈套">落入圈套</a></li><li><a href="#产生怀疑">产生怀疑</a></li><li><a href="#感想">感想</a></li></ul>
<hr />
<main class="post-content e-content" role="main"><p>差点就被骗子骗了🤣,还是主动上钩的……<!--more--></p>
<h1 id="起因">
<a href="#起因"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 起因
</h1>
<p>今天因为某些原因从网上随便搜了一个公共的接码平台用,接完自己要用的短信之后突然瞥到这么一条信息:</p>
<blockquote>
<p>NEW BlTMØ L0GlN || www.Bitmo.vip || Username:Huzhou Pa**word:4894688 BaIance:65.77BTC………</p>
</blockquote>
<p>我没怎么注意这条信息的意思但是既然有网站名用户名和密码自然会不由自主的想去登录一下啦然后就会看到账户里有巨额的财产。我登录的时候账户里面还有67BTC换算下来大概有<strong>1400wCNY</strong>的样子。</p>
<h1 id="落入圈套">
<a href="#落入圈套"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 落入圈套
</h1>
<p>刚开始我打开这个网站的时候还没意识到这是个诈骗网站还以为是哪个交易所不过既然登录上来了自然想看看登录账号后的网站都有些啥功能首先看到的就是些充值、提现、转账和开票之类的功能看上去好像还挺像回事的不过试了几下除了转账之外的其他功能其实是没法用的充值和开票需要用到安全密钥而提现除了需要用到安全密钥外系统说账户因为1年没提现了所以提现功能被禁用了但是仍然可以转账:</p>
<blockquote>
<p>Withdrawal to your registered ฿itcoin wallet address has been disabled because you havent withdrawn for more than 365 days. To reactivate withdrawal you need to contact customer care and provide your secure key you created during account registration. </p><p>
You will still be able to carry out transfers and transactions from your account balance to other BITMO VIP members without your secure key for the next 6 months.</p>
</blockquote>
<p>于是我想都没想就注册了一个账户想着既然有这个功能就给自己转点钱呗。注册好账户以后发现我是免费账户除了开通VIP外什么功能都用不了而开通VIP至少要充0.004BTC进去大约相当于800多CNY。当然VIP我是不可能开的我打算先试试转钱到我的账户中。 </p><p>
在转账的过程中一次最多只能转出0.2BTC而且同一个IP似乎只能转一次。我试着转了0.2BTC到我的账户中想不到还成功了😨毕竟0.2BTC也相当于4w多CNY呢于是我换了一个IP又转了一次也成功了不过第三次会失败貌似免费账户最多只能接受0.4BTC。随后我登录到我的账户上看了一眼我以为转完之后我会直升VIP6结果系统显示免费账户不能接受转账必须开通VIP才可以</p>
<blockquote>
<p>Hello MAYX, the user HUZHOU has recently tried to transfer 0.40000 ฿TC ($ 12088.33) to your account. Our system witheld the transfer because free-trial accounts cannot send or receive Bitcoin through our service. Once you make an investment in any of our VIP plans, our system will automatically add the 0.40000 ฿TC ($ 12088.33) to your VIP account balance.</p>
</blockquote>
<h1 id="产生怀疑">
<a href="#产生怀疑"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 产生怀疑
</h1>
<p>这时候我开始怀疑这个网站的身份了我看了一眼帮助显示这个平台是一个2014年创立的平台可是我搜了一下域名的WHOIS发现它是2023-05-28创建的……也就不可能存在有大佬在一年或者更早存这么多钱进去了。Google搜索了一下这个平台也没有相关的结果看来是诈骗网站没错了。毕竟就算是最低的VIP也要不少钱充进去能把那0.4BTC拿到的概率只能说是0%……可惜错失了一次发财的机会啊🤣。 </p><p>
之后看了看它的源代码,里面怎么还有中文🤣,原来是国人开发的诈骗网站。仔细看了看结果发现其他功能的报错都是硬编码的,根本就没有请求服务器😅。</p>
<h1 id="感想">
<a href="#感想"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 感想
</h1>
<p>前两次收到的诈骗邮件<a href="/2019/06/10/cheat.html">富婆找对象</a><a href="/2021/11/28/spam.html">被拍糟糕视频</a>两个可以说是真的傻子才会相信,因为内容太离谱了,能上当的人太少了,而且我发完邮件他们还得回复,效率也很低下。这次遇到的这个诈骗就好多了,让被骗的人很有参与感,而且建好网站之后什么都不用做,只要等着有人打钱就好,效率非常高,而且做的还挺像回事,估计被骗的人不会少。 </p><p>
不过之后想想也是,这种短信大概率就是那种群发的垃圾短信,实际上主动登录的人应该也不多吧😂。</p></main>
<small style="display: block">tags: <a rel="category tag" class="p-category" href="/search.html?keyword=%E9%AA%97%E5%AD%90"><em>骗子</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=%E8%AF%88%E9%AA%97"><em>诈骗</em></a> <span style="float: right;"><a href="https://gitlab.com/mayx/mayx.gitlab.io/tree/master/_posts/2023-07-09-bitmo.md">查看原始文件</a></span></small>
<h4 style="border-bottom: 1px solid #e5e5e5;margin: 2em 0 5px;">推荐文章</h4>
<p id="suggest-container">Loading...</p>
<script>
var suggest = $("#suggest-container");
$.get(BlogAPI + "/suggest?id=/2023/07/09/bitmo.html&update=" + lastUpdated.valueOf(), function (data) {
if (data.length) {
getSearchJSON(function (search) {
suggest.empty();
var searchMap = {};
for (var i = 0; i < search.length; i++) {
searchMap[search[i].url] = search[i];
}
var tooltip = $('<div class="content-tooltip"></div>').appendTo('body').hide();
for (var j = 0; j < data.length; j++) {
var item = searchMap[data[j].id];
if (item) {
var link = $('<a href="' + item.url + '">' + item.title + '</a>');
var contentPreview = item.content.substring(0, 100);
if (item.content.length > 100) {
contentPreview += "……";
}
link.hover(
function(e) {
tooltip.text($(this).data('content'))
.css({
top: e.pageY + 10,
left: e.pageX + 10
})
.show();
},
function() {
tooltip.hide();
}
).mousemove(function(e) {
tooltip.css({
top: e.pageY + 10,
left: e.pageX + 10
});
}).data('content', contentPreview);
suggest.append(link);
suggest.append(' - ' + item.date + '<br />');
}
}
});
} else {
suggest.html("暂无推荐文章……");
}
});
</script>
<br />
<div class="pagination">
<span class="prev">
<a href="/2023/06/30/nucleic-acid.html">
上一篇基于ThinkPHP5.1核酸检测登记系统的设计与开发
</a>
</span>
<br />
<span class="next">
<a href="/2023/08/01/auth.html">
下一篇如何让Python脚本接收OAuth2.0的Code
</a>
</span>
</div>
<!--[if !IE]> -->
<link rel="stylesheet" href="/assets/css/gitalk.css">
<script src="/assets/js/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
var gitalk = new Gitalk({
clientID: '36557aec4c3cb04f7ac6',
clientSecret: 'ac32993299751cb5a9ba81cf2b171cca65879cdb',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '/2023/07/09/bitmo', // Ensure uniqueness and length less than 50
distractionFreeMode: false, // Facebook-like distraction free mode
proxy: "https://cors-anywhere.mayx.eu.org/?https://github.com/login/oauth/access_token"
})
gitalk.render('gitalk-container')
</script>
<!-- <![endif]-->
</section>
<!--[if !IE]> -->
<div id="landlord" style="left:5px;bottom:0px;">
<div class="message" style="opacity:0"></div>
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
<div class="live_talk_input_body">
<form id="live_talk_input_form">
<div class="live_talk_input_name_body" >
<input type="checkbox" id="load_this" />
<input type="hidden" id="post_id" value="/2023/07/09/bitmo.html" />
<label for="load_this">
<span style="font-size: 11px; color: #fff;">&#160;想问这篇文章</span>
</label>
</div>
<div class="live_talk_input_text_body">
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?" />
<button type="submit" class="live_talk_send_btn" id="talk_send">发送</button>
</div>
</form>
</div>
<input name="live_talk" id="live_talk" value="1" type="hidden" />
<div class="live_ico_box" style="display:none;">
<div class="live_ico_item type_info" id="showInfoBtn"></div>
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
<div class="live_ico_item type_music" id="musicButton"></div>
<div class="live_ico_item type_youdu" id="youduButton"></div>
<div class="live_ico_item type_quit" id="hideButton"></div>
<input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
<audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
<input id="duType" value="douqilai" type="hidden" />
</div>
</div>
<div id="open_live2d">召唤伊斯特瓦尔</div>
<!-- <![endif]-->
<footer>
<p>
<small>Made with ❤ by Mayx<br />Last updated at 2026-01-17 17:35:53<br /> 总字数614622 - 文章数178 - <a href="/atom.xml" >Atom</a> - <a href="/README.html" >About</a></small>
</p>
</footer>
</div>
<script src="/assets/js/scale.fix.js"></script>
<!--[if !IE]> -->
<script src="/assets/js/main_new.js"></script>
<script src="/Live2dHistoire/live2d/js/live2d.js"></script>
<script src="/Live2dHistoire/live2d/js/message.js"></script>
<!-- <![endif]-->
</body>
</html>

458
2023/08/01/auth.html Normal file
View File

@@ -0,0 +1,458 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>如何让Python脚本接收OAuth2.0的Code | Mayx的博客</title>
<meta name="generator" content="Jekyll v3.9.5" />
<meta property="og:title" content="如何让Python脚本接收OAuth2.0的Code" />
<meta name="author" content="mayx" />
<meta property="og:locale" content="zh_CN" />
<meta name="description" content="越简单,就越复杂。" />
<meta property="og:description" content="越简单,就越复杂。" />
<meta property="og:site_name" content="Mayx的博客" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2023-08-01T00:00:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="如何让Python脚本接收OAuth2.0的Code" />
<meta name="google-site-verification" content="huTYdEesm8NaFymixMNqflyCp6Jfvd615j5Wq1i2PHc" />
<meta name="msvalidate.01" content="0ADFCE64B3557DC4DC5F2DC224C5FDDD" />
<meta name="yandex-verification" content="fc0e535abed800be" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"mayx"},"dateModified":"2023-08-01T00:00:00+08:00","datePublished":"2023-08-01T00:00:00+08:00","description":"越简单,就越复杂。","headline":"如何让Python脚本接收OAuth2.0的Code","mainEntityOfPage":{"@type":"WebPage","@id":"/2023/08/01/auth.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://avatars0.githubusercontent.com/u/17966333"},"name":"mayx"},"url":"/2023/08/01/auth.html"}</script>
<!-- End Jekyll SEO tag -->
<link rel="canonical" href="https://mabbs.github.io/2023/08/01/auth.html" />
<link type="application/atom+xml" rel="alternate" href="/atom.xml" title="Mayx的博客" />
<link rel="alternate" type="application/rss+xml" title="Mayx的博客(RSS)" href="/rss.xml" />
<link rel="alternate" type="application/json" title="Mayx的博客(JSON Feed)" href="/feed.json" />
<link rel="stylesheet" href="/assets/css/style.css?v=1768642553" />
<!--[if !IE]> -->
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
<!-- <![endif]-->
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Mayx的博客" />
<link rel="webmention" href="https://webmention.io/mabbs.github.io/webmention" />
<link rel="pingback" href="https://webmention.io/mabbs.github.io/xmlrpc" />
<link rel="preconnect" href="https://summary.mayx.eu.org" crossorigin="anonymous" />
<link rel="prefetch" href="https://www.blogsclub.org/badge/mabbs.github.io" as="image" />
<link rel="blogroll" type="text/xml" href="/blogroll.opml" />
<link rel="me" href="https://github.com/Mabbs" />
<script src="/assets/js/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
var lastUpdated = new Date("Sat, 17 Jan 2026 17:35:53 +0800");
var BlogAPI = "https://summary.mayx.eu.org";
</script>
<script src="/assets/js/main.js"></script>
<!--[if !IE]> -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-137710294-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-137710294-1');
</script>
<script src="/assets/js/instant.page.js" type="module"></script>
<!-- <![endif]-->
</head>
<body>
<!--[if !IE]> --><noscript><marquee style="top: -15px; position: relative;"><small>发现当前浏览器没有启用JavaScript这不影响你的浏览但可能会有一些功能无法使用……</small></marquee></noscript><!-- <![endif]-->
<!--[if IE]><marquee style="top: -15px; position: relative;"><small>发现当前浏览器为Internet Explorer这不影响你的浏览但可能会有一些功能无法使用……</small></marquee><![endif]-->
<div class="wrapper">
<header class="h-card">
<h1><a class="u-url u-uid p-name" rel="me" href="/">Mayx的博客</a></h1>
<img src="https://avatars0.githubusercontent.com/u/17966333" fetchpriority="high" class="u-photo" alt="Logo" style="width: 90%; max-width: 300px; max-height: 300px;" />
<p class="p-note">Mayx's Home Page</p>
<form action="/search.html">
<input type="text" name="keyword" id="search-input-all" placeholder="Search blog posts.." />&#160;<input type="submit" value="搜索" />
</form>
<br />
<p class="view"><a class="u-url" href="/Mabbs/">About me</a></p>
<ul class="downloads">
<li style="width: 270px; border-right: none;"><a href="/MayxBlog.tgz">Download <strong>TGZ File</strong></a></li>
</ul>
</header>
<section class="h-entry">
<small><time class="date dt-published" datetime="2023-08-01T00:00:00+08:00">1 August 2023</time> - 字数统计3672 - 阅读大约需要12分钟 - Hits: <span id="/2023/08/01/auth.html" class="visitors">Loading...</span></small>
<h1 class="p-name">如何让Python脚本接收OAuth2.0的Code</h1>
<p class="view">by <a class="p-author h-card" href="//github.com/Mabbs">mayx</a></p>
<div id="outdate" style="display:none;">
<hr /><p>
这是一篇创建于 <span id="outime"></span> 天前的文章,其中的信息可能已经有所发展或是发生改变。
</p>
</div>
<script>
daysold = Math.floor((new Date().getTime() - new Date("Tue, 01 Aug 2023 00:00:00 +0800").getTime()) / (24 * 60 * 60 * 1000));
if (daysold > 90) {
document.getElementById("outdate").style.display = "block";
document.getElementById("outime").innerHTML = daysold;
}
</script>
<hr />
<b>AI摘要</b>
<p id="ai-output">这篇文章讨论了在Windows环境下让Python脚本接收OAuth2.0授权码Code的几种方法。作者尝试了以下几种方式
1. **URI Scheme**: 通过注册伪协议如mayx://并在Python脚本中解析回调URL来获取Code但这种方法可能被杀毒软件阻拦且不是所有平台都支持。
2. **HTTP服务监听**: 使用Flask创建一个简单的web服务来接收Code虽然简单但可能占用过多资源且已被弃用。
3. **Socket实现**: 用socket进行TCP连接来处理请求但初次访问时有问题且代码复杂。
4. **http.server模块**: 使用Python内置的HTTP服务器模块实现了基本功能更小且稳定但仍有程序结束前端口未释放的问题后来通过AI得到了解决。
作者在寻找最合适的方案时遇到困难感慨了解更多信息有时也带来困扰但最终还是AI有效地解决了问题。</p>
<hr />
<ul><li><a href="#起因">起因</a></li><li><a href="#解决方法">解决方法</a><ul><li><a href="#1-使用uri-scheme">1. 使用URI Scheme</a></li><li><a href="#2-使用http服务监听">2. 使用http服务监听</a><ul><li><a href="#使用flask实现">使用Flask实现</a></li><li><a href="#使用socket实现">使用socket实现</a></li><li><a href="#使用httpserver实现">使用http.server实现</a></li></ul></li></ul></li><li><a href="#感想">感想</a></li></ul>
<hr />
<main class="post-content e-content" role="main"><p>越简单,就越复杂。<!--more--></p>
<h1 id="起因">
<a href="#起因"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 起因
</h1>
<p>最近我在写一个在Windows上运行的Python脚本需要做一个类似于第三方登录的功能。一般来说像这种东西都是使用的OAuth2.0来做认证我接入的平台没有悬念的也是使用的这个东西其中的重点就是获取到第三方网站的授权码Code然后用它换取用户信息。于是我就在想怎么做比较好呢</p>
<h1 id="解决方法">
<a href="#解决方法"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 解决方法
</h1>
<h2 id="1-使用uri-scheme">
<a href="#1-使用uri-scheme"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 1. 使用URI Scheme
</h2>
<p>我看VSCode在实现类似功能的时候似乎用到了URI Scheme就是在系统中注册一个伪协议然后通过这个伪协议来调用程序实现获取Code方法很简单首先先在注册表里导入</p>
<div class="language-ini highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="err">Windows</span> <span class="err">Registry</span> <span class="err">Editor</span> <span class="err">Version</span> <span class="err">5.00</span>
<span class="nn">[HKEY_CLASSES_ROOT\mayx]</span>
<span class="err">"URL</span> <span class="err">Protocol"="D:\\mayx.exe"</span>
<span class="err">@="MayxProtocol"</span>
<span class="nn">[HKEY_CLASSES_ROOT\mayx\DefaultIcon]</span>
<span class="err">@="D:\\mayx.exe,1"</span>
<span class="nn">[HKEY_CLASSES_ROOT\mayx\shell]</span>
<span class="nn">[HKEY_CLASSES_ROOT\mayx\shell\open]</span>
<span class="nn">[HKEY_CLASSES_ROOT\mayx\shell\open\command]</span>
<span class="err">@="\"D:\\mayx.exe\"</span> <span class="err">\"%1\""</span>
</code></pre></div></div>
<p>然后编写一个Python脚本并用Pyinstaller打包</p>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">sys</span>
<span class="k">print</span><span class="p">(</span><span class="n">sys</span><span class="p">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
</code></pre></div></div>
<p>最后将回调地址填为“mayx://get”这样认证完成之后就会像这样调用程序“D:\mayx.exe mayx://get?code=something”再用urllib简单做个解析就完成了。 </p><p>
这样看起来是不是非常的简单看起来确实是挺简单的可惜坑比较大第一个是像上述这样的注册表有些杀毒软件会拒绝导入因为像“shell\open\command”这种东西被病毒啥的滥用的地方太多了除非软件通过了数字签名或者某些认证否则正常情况下根本没法导入。二是不是所有的第三方平台都支持伪协议的方式调用不过我试了一下我用的那个平台倒是支持😂除了杀毒软件比较讨厌之外其他的倒还好。</p>
<h2 id="2-使用http服务监听">
<a href="#2-使用http服务监听"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 2. 使用http服务监听
</h2>
<p>很多跨平台的程序像有些主要在Linux上运行的某些程序就喜欢在获取Code的时候启动一个简单的web服务。其实用这个方法的话可能还更方便一点不容易出问题。</p>
<h3 id="使用flask实现">
<a href="#使用flask实现"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 使用Flask实现
</h3>
<p>最开始我想着要不然就用Flask来实现这个功能吧实现起来也简单写起来就几行</p>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">from</span> <span class="nn">flask</span> <span class="kn">import</span> <span class="n">Flask</span><span class="p">,</span> <span class="n">request</span>
<span class="n">code</span> <span class="o">=</span> <span class="s">""</span>
<span class="n">app</span> <span class="o">=</span> <span class="n">Flask</span><span class="p">(</span><span class="n">__name__</span><span class="p">)</span>
<span class="o">@</span><span class="n">app</span><span class="p">.</span><span class="n">route</span><span class="p">(</span><span class="s">'/getcode'</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">get</span><span class="p">():</span>
<span class="k">global</span> <span class="n">code</span>
<span class="n">code</span> <span class="o">=</span> <span class="n">request</span><span class="p">.</span><span class="n">args</span><span class="p">.</span><span class="n">get</span><span class="p">(</span><span class="s">"code"</span><span class="p">)</span>
<span class="n">shutdown</span> <span class="o">=</span> <span class="n">request</span><span class="p">.</span><span class="n">environ</span><span class="p">[</span><span class="s">"werkzeug.server.shutdown"</span><span class="p">]</span>
<span class="n">shutdown</span><span class="p">()</span>
<span class="k">return</span> <span class="s">"OK"</span>
<span class="n">app</span><span class="p">.</span><span class="n">run</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s">"127.0.0.1"</span><span class="p">,</span><span class="n">port</span><span class="o">=</span><span class="mi">8000</span><span class="p">)</span>
<span class="k">print</span><span class="p">(</span><span class="n">code</span><span class="p">)</span>
</code></pre></div></div>
<p>看起来也确实很简单功能实现的也很完美但是有个问题是总感觉用Flask做这么简单的事情实在是大材小用打包成程序也要占不少空间另外就是这个方法已经被弃用了感觉就是很不爽。那要说不爽的话怎么才爽呢</p>
<h3 id="使用socket实现">
<a href="#使用socket实现"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 使用socket实现
</h3>
<p>我想起来之前期末时写的期末作业<a href="https://github.com/Mabbs/socket-bbs">socket-bbs</a>这就是用socket实现的一个简单的论坛那我这么简单的功能想来用socket实现不是很好吗于是就写了一个这段代码没有测试因为这个方法不能用所以把代码删了这是重新做的</p>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">socket</span>
<span class="kn">import</span> <span class="nn">urllib.parse</span>
<span class="n">server</span> <span class="o">=</span> <span class="n">socket</span><span class="p">.</span><span class="n">socket</span><span class="p">(</span><span class="n">socket</span><span class="p">.</span><span class="n">AF_INET</span><span class="p">,</span><span class="n">socket</span><span class="p">.</span><span class="n">SOCK_STREAM</span><span class="p">)</span> <span class="c1">#打开一个网络连接
</span><span class="n">server</span><span class="p">.</span><span class="n">bind</span><span class="p">((</span><span class="s">'127.0.0.1'</span><span class="p">,</span><span class="mi">8000</span><span class="p">))</span> <span class="c1">#绑定要监听的端口
</span><span class="n">server</span><span class="p">.</span><span class="n">listen</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span> <span class="c1"># 设置最大的连接数量为5
</span><span class="n">code</span> <span class="o">=</span> <span class="s">""</span>
<span class="k">while</span> <span class="bp">True</span><span class="p">:</span>
<span class="n">sock</span><span class="p">,</span> <span class="n">addr</span> <span class="o">=</span> <span class="n">server</span><span class="p">.</span><span class="n">accept</span><span class="p">()</span> <span class="c1"># 建立客户端连接
</span> <span class="n">data</span> <span class="o">=</span> <span class="n">sock</span><span class="p">.</span><span class="n">recv</span><span class="p">(</span><span class="mi">8192</span><span class="p">).</span><span class="n">decode</span><span class="p">(</span><span class="s">'utf-8'</span><span class="p">).</span><span class="n">split</span><span class="p">(</span><span class="s">'</span><span class="se">\r\n</span><span class="s">'</span><span class="p">)</span><span class="c1">#接收TCP数据数据以字符串的形式返还
</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">data</span><span class="p">[</span><span class="mi">0</span><span class="p">]:</span>
<span class="n">sock</span><span class="p">.</span><span class="n">close</span><span class="p">()</span> <span class="c1"># 关闭连接
</span> <span class="k">continue</span>
<span class="n">url</span> <span class="o">=</span> <span class="n">urllib</span><span class="p">.</span><span class="n">parse</span><span class="p">.</span><span class="n">urlparse</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="n">split</span><span class="p">()[</span><span class="mi">1</span><span class="p">])</span>
<span class="k">if</span> <span class="n">url</span><span class="p">.</span><span class="n">path</span> <span class="o">==</span> <span class="s">'/getcode'</span><span class="p">:</span>
<span class="n">query</span> <span class="o">=</span> <span class="n">urllib</span><span class="p">.</span><span class="n">parse</span><span class="p">.</span><span class="n">parse_qs</span><span class="p">(</span><span class="bp">self</span><span class="p">.</span><span class="n">data</span><span class="p">)</span>
<span class="n">code</span> <span class="o">=</span> <span class="n">query</span><span class="p">[</span><span class="s">"code"</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span>
<span class="n">sock</span><span class="p">.</span><span class="n">send</span><span class="p">((</span><span class="s">"HTTP/1.0 200 OK"</span> <span class="o">+</span> <span class="s">'</span><span class="se">\r\n</span><span class="s">'</span><span class="p">).</span><span class="n">encode</span><span class="p">(</span><span class="s">'utf-8'</span><span class="p">))</span>
<span class="n">sock</span><span class="p">.</span><span class="n">send</span><span class="p">((</span><span class="s">"Content-Type: text/html; charset=utf-8"</span> <span class="o">+</span> <span class="s">'</span><span class="se">\r\n</span><span class="s">'</span><span class="p">).</span><span class="n">encode</span><span class="p">(</span><span class="s">'utf-8'</span><span class="p">))</span>
<span class="n">sock</span><span class="p">.</span><span class="n">send</span><span class="p">(</span><span class="s">'</span><span class="se">\r\n</span><span class="s">'</span><span class="p">.</span><span class="n">encode</span><span class="p">(</span><span class="s">'utf-8'</span><span class="p">))</span>
<span class="n">sock</span><span class="p">.</span><span class="n">send</span><span class="p">(</span><span class="s">"OK"</span><span class="p">.</span><span class="n">encode</span><span class="p">(</span><span class="s">'utf-8'</span><span class="p">))</span> <span class="c1">#发送TCP数据
</span> <span class="n">sock</span><span class="p">.</span><span class="n">close</span><span class="p">()</span> <span class="c1"># 关闭连接
</span> <span class="k">break</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">sock</span><span class="p">.</span><span class="n">send</span><span class="p">((</span><span class="s">"HTTP/1.0 404 Not Found"</span> <span class="o">+</span> <span class="s">'</span><span class="se">\r\n</span><span class="s">'</span><span class="p">).</span><span class="n">encode</span><span class="p">(</span><span class="s">'utf-8'</span><span class="p">))</span>
<span class="n">sock</span><span class="p">.</span><span class="n">send</span><span class="p">((</span><span class="s">"Content-Type: text/html; charset=utf-8"</span> <span class="o">+</span> <span class="s">'</span><span class="se">\r\n</span><span class="s">'</span><span class="p">).</span><span class="n">encode</span><span class="p">(</span><span class="s">'utf-8'</span><span class="p">))</span>
<span class="n">sock</span><span class="p">.</span><span class="n">send</span><span class="p">(</span><span class="s">'</span><span class="se">\r\n</span><span class="s">'</span><span class="p">.</span><span class="n">encode</span><span class="p">(</span><span class="s">'utf-8'</span><span class="p">))</span>
<span class="n">sock</span><span class="p">.</span><span class="n">send</span><span class="p">(</span><span class="s">"Not Found"</span><span class="p">.</span><span class="n">encode</span><span class="p">(</span><span class="s">'utf-8'</span><span class="p">))</span> <span class="c1">#发送TCP数据
</span> <span class="n">sock</span><span class="p">.</span><span class="n">close</span><span class="p">()</span> <span class="c1"># 关闭连接
</span><span class="k">print</span><span class="p">(</span><span class="n">code</span><span class="p">)</span>
</code></pre></div></div>
<p>看起来是不是复杂多了?其实大多数时候工作的好像挺正常的,但是不知道为什么莫名其妙第一次访问的时候会卡住,改了半天头都大了,于是就只好放弃这种方法了……</p>
<h3 id="使用httpserver实现">
<a href="#使用httpserver实现"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 使用http.server实现
</h3>
<p>这时候我突然想到我平时用来传文件用的python自带的模块http.server既然这个模块是自带的大小应该大不到哪去吧随后我就写了一个</p>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">from</span> <span class="nn">http.server</span> <span class="kn">import</span> <span class="n">BaseHTTPRequestHandler</span><span class="p">,</span> <span class="n">ThreadingHTTPServer</span>
<span class="kn">import</span> <span class="nn">urllib.parse</span>
<span class="n">code</span> <span class="o">=</span> <span class="s">""</span>
<span class="k">class</span> <span class="nc">Resquest</span><span class="p">(</span><span class="n">BaseHTTPRequestHandler</span><span class="p">):</span>
<span class="n">timeout</span> <span class="o">=</span> <span class="mi">5</span>
<span class="k">def</span> <span class="nf">do_GET</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="n">url</span> <span class="o">=</span> <span class="n">urllib</span><span class="p">.</span><span class="n">parse</span><span class="p">.</span><span class="n">urlparse</span><span class="p">(</span><span class="bp">self</span><span class="p">.</span><span class="n">path</span><span class="p">)</span>
<span class="k">if</span> <span class="n">url</span><span class="p">.</span><span class="n">path</span> <span class="o">==</span> <span class="s">"/getuser"</span><span class="p">:</span>
<span class="bp">self</span><span class="p">.</span><span class="n">send_response</span><span class="p">(</span><span class="mi">200</span><span class="p">)</span>
<span class="bp">self</span><span class="p">.</span><span class="n">send_header</span><span class="p">(</span><span class="s">"Content-type"</span><span class="p">,</span> <span class="s">"text/html"</span><span class="p">)</span> <span class="c1"># 设置服务器响应头
</span> <span class="n">code</span> <span class="o">=</span> <span class="n">urllib</span><span class="p">.</span><span class="n">parse</span><span class="p">.</span><span class="n">parse_qs</span><span class="p">(</span><span class="n">url</span><span class="p">.</span><span class="n">query</span><span class="p">)[</span><span class="s">"code"</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span>
<span class="n">buf</span> <span class="o">=</span> <span class="s">'''OK'''</span>
<span class="bp">self</span><span class="p">.</span><span class="n">wfile</span><span class="p">.</span><span class="n">write</span><span class="p">(</span><span class="n">buf</span><span class="p">.</span><span class="n">encode</span><span class="p">())</span>
<span class="bp">self</span><span class="p">.</span><span class="n">server</span><span class="p">.</span><span class="n">shutdown</span><span class="p">()</span>
<span class="k">else</span><span class="p">:</span>
<span class="bp">self</span><span class="p">.</span><span class="n">send_response</span><span class="p">(</span><span class="mi">404</span><span class="p">)</span>
<span class="bp">self</span><span class="p">.</span><span class="n">send_header</span><span class="p">(</span><span class="s">"Content-type"</span><span class="p">,</span> <span class="s">"text/html"</span><span class="p">)</span> <span class="c1"># 设置服务器响应头
</span> <span class="bp">self</span><span class="p">.</span><span class="n">end_headers</span><span class="p">()</span>
<span class="n">buf</span> <span class="o">=</span> <span class="s">'''Not Found'''</span>
<span class="bp">self</span><span class="p">.</span><span class="n">wfile</span><span class="p">.</span><span class="n">write</span><span class="p">(</span><span class="n">buf</span><span class="p">.</span><span class="n">encode</span><span class="p">())</span>
<span class="n">host</span> <span class="o">=</span> <span class="p">(</span><span class="s">"127.0.0.1"</span><span class="p">,</span> <span class="mi">8000</span><span class="p">)</span>
<span class="n">server</span> <span class="o">=</span> <span class="n">ThreadingHTTPServer</span><span class="p">(</span><span class="n">host</span><span class="p">,</span> <span class="n">Resquest</span><span class="p">)</span>
<span class="k">print</span><span class="p">(</span><span class="s">"Starting server, listen at: %s:%s"</span> <span class="o">%</span> <span class="n">host</span><span class="p">)</span>
<span class="n">server</span><span class="p">.</span><span class="n">serve_forever</span><span class="p">()</span>
<span class="n">server</span><span class="p">.</span><span class="n">socket</span><span class="p">.</span><span class="n">close</span><span class="p">()</span>
<span class="k">print</span><span class="p">(</span><span class="n">code</span><span class="p">)</span>
</code></pre></div></div>
<p>最后打包试了一下功能正常虽然还是大了点不过比Flask小😁。其实我在写这个代码的时候最开始不知道要在最后加上<code class="language-plaintext highlighter-rouge">server.socket.close()</code>一开始写的时候总是遇到程序执行完之前端口必定不会释放令人很烦直接搜也没什么好的结果不过问了下ChatGPT立马就解决了🤣它说</p>
<blockquote>
<p>当你调用<code class="language-plaintext highlighter-rouge">server.shutdown()</code>来停止服务器时它会停止接收新的连接并关闭已有的连接。但是由于Python的socket库的设计socket对象并不会立即释放端口。相反它会在一段时间内处于TIME_WAIT状态以确保在网络中所有挂起的数据都被正确传递或丢弃。这是一种网络协议的要求称为”TCP TIME_WAIT”状态。</p>
</blockquote>
<p>AI还真是方便啊……</p>
<h1 id="感想">
<a href="#感想"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 感想
</h1>
<p>解决这么一个小问题却一时半会拿不下最合适的方案这难道就是了解太多的副作用吗😝不过最终来看还是AI厉害一下子就解决了我的问题。</p></main>
<small style="display: block">tags: <a rel="category tag" class="p-category" href="/search.html?keyword=Python"><em>Python</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=%E6%9C%8D%E5%8A%A1%E5%99%A8"><em>服务器</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=OAuth"><em>OAuth</em></a> <span style="float: right;"><a href="https://gitlab.com/mayx/mayx.gitlab.io/tree/master/_posts/2023-08-01-auth.md">查看原始文件</a></span></small>
<h4 style="border-bottom: 1px solid #e5e5e5;margin: 2em 0 5px;">推荐文章</h4>
<p id="suggest-container">Loading...</p>
<script>
var suggest = $("#suggest-container");
$.get(BlogAPI + "/suggest?id=/2023/08/01/auth.html&update=" + lastUpdated.valueOf(), function (data) {
if (data.length) {
getSearchJSON(function (search) {
suggest.empty();
var searchMap = {};
for (var i = 0; i < search.length; i++) {
searchMap[search[i].url] = search[i];
}
var tooltip = $('<div class="content-tooltip"></div>').appendTo('body').hide();
for (var j = 0; j < data.length; j++) {
var item = searchMap[data[j].id];
if (item) {
var link = $('<a href="' + item.url + '">' + item.title + '</a>');
var contentPreview = item.content.substring(0, 100);
if (item.content.length > 100) {
contentPreview += "……";
}
link.hover(
function(e) {
tooltip.text($(this).data('content'))
.css({
top: e.pageY + 10,
left: e.pageX + 10
})
.show();
},
function() {
tooltip.hide();
}
).mousemove(function(e) {
tooltip.css({
top: e.pageY + 10,
left: e.pageX + 10
});
}).data('content', contentPreview);
suggest.append(link);
suggest.append(' - ' + item.date + '<br />');
}
}
});
} else {
suggest.html("暂无推荐文章……");
}
});
</script>
<br />
<div class="pagination">
<span class="prev">
<a href="/2023/07/09/bitmo.html">
上一篇:分享一种无人值守的新型诈骗手段
</a>
</span>
<br />
<span class="next">
<a href="/2023/09/06/satellite.html">
下一篇:关于卫星通信的一些看法
</a>
</span>
</div>
<!--[if !IE]> -->
<link rel="stylesheet" href="/assets/css/gitalk.css">
<script src="/assets/js/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
var gitalk = new Gitalk({
clientID: '36557aec4c3cb04f7ac6',
clientSecret: 'ac32993299751cb5a9ba81cf2b171cca65879cdb',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '/2023/08/01/auth', // Ensure uniqueness and length less than 50
distractionFreeMode: false, // Facebook-like distraction free mode
proxy: "https://cors-anywhere.mayx.eu.org/?https://github.com/login/oauth/access_token"
})
gitalk.render('gitalk-container')
</script>
<!-- <![endif]-->
</section>
<!--[if !IE]> -->
<div id="landlord" style="left:5px;bottom:0px;">
<div class="message" style="opacity:0"></div>
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
<div class="live_talk_input_body">
<form id="live_talk_input_form">
<div class="live_talk_input_name_body" >
<input type="checkbox" id="load_this" />
<input type="hidden" id="post_id" value="/2023/08/01/auth.html" />
<label for="load_this">
<span style="font-size: 11px; color: #fff;">&#160;想问这篇文章</span>
</label>
</div>
<div class="live_talk_input_text_body">
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?" />
<button type="submit" class="live_talk_send_btn" id="talk_send">发送</button>
</div>
</form>
</div>
<input name="live_talk" id="live_talk" value="1" type="hidden" />
<div class="live_ico_box" style="display:none;">
<div class="live_ico_item type_info" id="showInfoBtn"></div>
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
<div class="live_ico_item type_music" id="musicButton"></div>
<div class="live_ico_item type_youdu" id="youduButton"></div>
<div class="live_ico_item type_quit" id="hideButton"></div>
<input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
<audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
<input id="duType" value="douqilai" type="hidden" />
</div>
</div>
<div id="open_live2d">召唤伊斯特瓦尔</div>
<!-- <![endif]-->
<footer>
<p>
<small>Made with ❤ by Mayx<br />Last updated at 2026-01-17 17:35:53<br /> 总字数614622 - 文章数178 - <a href="/atom.xml" >Atom</a> - <a href="/README.html" >About</a></small>
</p>
</footer>
</div>
<script src="/assets/js/scale.fix.js"></script>
<!--[if !IE]> -->
<script src="/assets/js/main_new.js"></script>
<script src="/Live2dHistoire/live2d/js/live2d.js"></script>
<script src="/Live2dHistoire/live2d/js/message.js"></script>
<!-- <![endif]-->
</body>
</html>

320
2023/09/06/satellite.html Normal file
View File

@@ -0,0 +1,320 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>关于卫星通信的一些看法 | Mayx的博客</title>
<meta name="generator" content="Jekyll v3.9.5" />
<meta property="og:title" content="关于卫星通信的一些看法" />
<meta name="author" content="mayx" />
<meta property="og:locale" content="zh_CN" />
<meta name="description" content="卫星通信也许并不困难😁" />
<meta property="og:description" content="卫星通信也许并不困难😁" />
<meta property="og:site_name" content="Mayx的博客" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2023-09-06T00:00:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="关于卫星通信的一些看法" />
<meta name="google-site-verification" content="huTYdEesm8NaFymixMNqflyCp6Jfvd615j5Wq1i2PHc" />
<meta name="msvalidate.01" content="0ADFCE64B3557DC4DC5F2DC224C5FDDD" />
<meta name="yandex-verification" content="fc0e535abed800be" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"mayx"},"dateModified":"2023-09-06T00:00:00+08:00","datePublished":"2023-09-06T00:00:00+08:00","description":"卫星通信也许并不困难😁","headline":"关于卫星通信的一些看法","mainEntityOfPage":{"@type":"WebPage","@id":"/2023/09/06/satellite.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://avatars0.githubusercontent.com/u/17966333"},"name":"mayx"},"url":"/2023/09/06/satellite.html"}</script>
<!-- End Jekyll SEO tag -->
<link rel="canonical" href="https://mabbs.github.io/2023/09/06/satellite.html" />
<link type="application/atom+xml" rel="alternate" href="/atom.xml" title="Mayx的博客" />
<link rel="alternate" type="application/rss+xml" title="Mayx的博客(RSS)" href="/rss.xml" />
<link rel="alternate" type="application/json" title="Mayx的博客(JSON Feed)" href="/feed.json" />
<link rel="stylesheet" href="/assets/css/style.css?v=1768642553" />
<!--[if !IE]> -->
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
<!-- <![endif]-->
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Mayx的博客" />
<link rel="webmention" href="https://webmention.io/mabbs.github.io/webmention" />
<link rel="pingback" href="https://webmention.io/mabbs.github.io/xmlrpc" />
<link rel="preconnect" href="https://summary.mayx.eu.org" crossorigin="anonymous" />
<link rel="prefetch" href="https://www.blogsclub.org/badge/mabbs.github.io" as="image" />
<link rel="blogroll" type="text/xml" href="/blogroll.opml" />
<link rel="me" href="https://github.com/Mabbs" />
<script src="/assets/js/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
var lastUpdated = new Date("Sat, 17 Jan 2026 17:35:53 +0800");
var BlogAPI = "https://summary.mayx.eu.org";
</script>
<script src="/assets/js/main.js"></script>
<!--[if !IE]> -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-137710294-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-137710294-1');
</script>
<script src="/assets/js/instant.page.js" type="module"></script>
<!-- <![endif]-->
</head>
<body>
<!--[if !IE]> --><noscript><marquee style="top: -15px; position: relative;"><small>发现当前浏览器没有启用JavaScript这不影响你的浏览但可能会有一些功能无法使用……</small></marquee></noscript><!-- <![endif]-->
<!--[if IE]><marquee style="top: -15px; position: relative;"><small>发现当前浏览器为Internet Explorer这不影响你的浏览但可能会有一些功能无法使用……</small></marquee><![endif]-->
<div class="wrapper">
<header class="h-card">
<h1><a class="u-url u-uid p-name" rel="me" href="/">Mayx的博客</a></h1>
<img src="https://avatars0.githubusercontent.com/u/17966333" fetchpriority="high" class="u-photo" alt="Logo" style="width: 90%; max-width: 300px; max-height: 300px;" />
<p class="p-note">Mayx's Home Page</p>
<form action="/search.html">
<input type="text" name="keyword" id="search-input-all" placeholder="Search blog posts.." />&#160;<input type="submit" value="搜索" />
</form>
<br />
<p class="view"><a class="u-url" href="/Mabbs/">About me</a></p>
<ul class="downloads">
<li style="width: 270px; border-right: none;"><a href="/MayxBlog.tgz">Download <strong>TGZ File</strong></a></li>
</ul>
</header>
<section class="h-entry">
<small><time class="date dt-published" datetime="2023-09-06T00:00:00+08:00">6 September 2023</time> - 字数统计1757 - 阅读大约需要6分钟 - Hits: <span id="/2023/09/06/satellite.html" class="visitors">Loading...</span></small>
<h1 class="p-name">关于卫星通信的一些看法</h1>
<p class="view">by <a class="p-author h-card" href="//github.com/Mabbs">mayx</a></p>
<div id="outdate" style="display:none;">
<hr /><p>
这是一篇创建于 <span id="outime"></span> 天前的文章,其中的信息可能已经有所发展或是发生改变。
</p>
</div>
<script>
daysold = Math.floor((new Date().getTime() - new Date("Wed, 06 Sep 2023 00:00:00 +0800").getTime()) / (24 * 60 * 60 * 1000));
if (daysold > 90) {
document.getElementById("outdate").style.display = "block";
document.getElementById("outime").innerHTML = daysold;
}
</script>
<hr />
<b>AI摘要</b>
<p id="ai-output">这篇文章主要讨论了卫星通信的常见应用如GPS导航、卫星电视、业余无线电通信、卫星电话如华为Mate 60 Pro和星链网络。作者强调了卫星通信的基本原理即通过无线电波与远距离的卫星进行单向或多向通信。文章还提到了华为卫星电话的特点如能否实现免外置天线使用和隐藏天线的设计猜测。作者认为将卫星电话功能引入智能手机可能更多是出于营销策略实际使用场景有限如信号覆盖和成本效益都不如常规网络。最后作者对6G卫星网络的设想持怀疑态度认为它不会显著改变通信速度。总体上卫星通信虽然看起来高端但其实技术上并不是什么难题。</p>
<hr />
<ul><li><a href="#起因">起因</a></li><li><a href="#关于卫星通信">关于卫星通信</a></li><li><a href="#关于华为卫星电话的看法">关于华为卫星电话的看法</a></li><li><a href="#感想">感想</a></li></ul>
<hr />
<main class="post-content e-content" role="main"><p>卫星通信也许并不困难😁<!--more--></p>
<h1 id="起因">
<a href="#起因"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 起因
</h1>
<p>前段时间华为出了一款可以打卫星电话的手机——Mate 60 Pro。我虽然对华为不怎么感兴趣对于它能把3年前的芯片卖到7K+CNY的营销水平也不感兴趣但是对于卫星通信我还是挺感兴趣的所以今天我就想说说我了解到的一些关于卫星通信的东西。</p>
<h1 id="关于卫星通信">
<a href="#关于卫星通信"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 关于卫星通信
</h1>
<p>其实卫星通信在我们身边非常的常见最常见的应该就是GNSS了现在不仅手机可以通过卫星来导航连各种各样的物联网设备也可以做到。不过这和卫星电话还是有点区别因为卫星电话是双向通信但是导航卫星是单向通信手机通过卫星广播的位置信息以及一些信号差分等方式来计算出当前的坐标所以连接导航卫星并不需要很长的天线因为它不需要发射信号。 </p><p>
和这个类似的还有卫星电视虽然卫星电视也不需要双向通信但是可能因为它带宽比较大然后稳定性要求比较高所以大多需要一个接收锅来接收卫星信号。不过也许我说的是错的以前在智能手机不太流行的时候有一种能在小型设备上观看的卫星电视叫做CMMB那个就是在手机上拉出一条天线就可以看电视了不过我不太确定这个是通过卫星还是通过地面中继的方式工作的也许两个都有我记得这个似乎在房间里面也能收到信号不太确定这小小的天线是不是真的能连接到卫星。 </p><p>
除了这些之外还有一些搞业余无线电之类的人可以从国际空间站上通过SSTV之类的方式发送比如在太空中拍的图片啥的不过我不太了解这些😂就不多说了。 </p><p>
至于双向通信可能日常遇见的比较少,可能比较常见的就是有些电视台会使用卫星来转发信号之类的,还有就是打国际长途的时候似乎也是通过卫星来转发的。当然做这些操作的设备一般天线都非常大。 </p><p>
小的倒也不是没有有些比较高级的车上面会搭载车载卫星电话在紧急救援的时候就可以使用当然普通的卫星电话也不大只不过一般都会带折叠天线价格倒是也还好便宜的也有2K多。除了卫星电话之外可能最知名的就是星链了那个也是使用的是卫星锅来上网不过因为是近地卫星而且数量众多所以速度要比通讯卫星的速度快得多。 </p><p>
除此之外我之前还看过一位大佬<a href="https://blog.aoaoao.me/p/amateur-satellite/">用卫星和世界各地的人通信</a>,不过那个天线比较大,还要手动操作😂。</p>
<h1 id="关于华为卫星电话的看法">
<a href="#关于华为卫星电话的看法"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 关于华为卫星电话的看法
</h1>
<p>综上所述,华为新出的卫星电话能不使用外置天线就能使用卫星电话似乎确实挺厉害的?不过因为我没用过普通的卫星电话所以不太清楚,如果普通的卫星电话不需要转手机来寻星,那华为的卫星电话可能算不了什么,毕竟那么大个直板机,把自己当天线也不是什么难事。不过如果普通的卫星电话也需要瞄准卫星才能通信,那华为应该还是有点水平的。 </p><p>
我看过几个这个手机拆解视频,不过到处都没有看到明显的天线痕迹,卫星电话应该需要一个比较大的天线吧……那它能把天线藏到哪里呢?我想那个巨大的均热板会不会是天线呢?本来就是铜的,当个天线可能也是正常的吧,不过我毕竟在云,也不能完全确定😂。
至于在智能手机上增加卫星电话的功能……其实我觉得这是个莫名其妙的行为可能主要还是为了营销从价格上来说3K买个卫星电话+3K买个SOC是骁龙8gen2的手机例如红米K60 Pro也比华为Mate 60 Pro便宜而且灵活性和手机性能都更好我不知道增加了这个卫星电话功能对手机成本的增加到底有多少如果很多的话我想除了脑子有病的厂商才会去干这件事毕竟绝大多数的情况都用不到卫星电话很多时候没有移动信号的时候同样也接收不到卫星信号比如埋在废墟中或者在电梯中等除此之外还只能使用中国电信的SIM卡才能使用还要开通套餐还只能使用天通卫星去远一点的海上旅个游是不是又得买别的卫星电话😅。当然如果成本很低比如确实就是均热板另外加个芯片就能用那我觉得还行就是销售价格太贵不过是公司想多赚点嘛这能理解😆。 </p><p>
至于有些人说的布局6G那就更扯了如果真的6G是卫星网络那不可能不加天线我相信没人会想瞄着卫星上网吧而且卫星网络无论如何都没办法做的比地面基站更快总不至于6G比5G还慢吧🤣。</p>
<h1 id="感想">
<a href="#感想"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 感想
</h1>
<p>卫星通信看似高级,不过本质其实就只是和飞的比较快(同步卫星可能不需要考虑这个吧……),离得比较远 <del>(几万公里其实还挺远的🤣)</del> 的无线电台通信罢了再简单点拿个激光笔都能和几公里外的人通信所以这真不是啥难事想想人类都能和飞了不知多远的旅行者1号通信是不是觉得其实还好呢</p></main>
<small style="display: block">tags: <a rel="category tag" class="p-category" href="/search.html?keyword=%E5%8D%AB%E6%98%9F"><em>卫星</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=%E9%80%9A%E4%BF%A1"><em>通信</em></a> <span style="float: right;"><a href="https://gitlab.com/mayx/mayx.gitlab.io/tree/master/_posts/2023-09-06-satellite.md">查看原始文件</a></span></small>
<h4 style="border-bottom: 1px solid #e5e5e5;margin: 2em 0 5px;">推荐文章</h4>
<p id="suggest-container">Loading...</p>
<script>
var suggest = $("#suggest-container");
$.get(BlogAPI + "/suggest?id=/2023/09/06/satellite.html&update=" + lastUpdated.valueOf(), function (data) {
if (data.length) {
getSearchJSON(function (search) {
suggest.empty();
var searchMap = {};
for (var i = 0; i < search.length; i++) {
searchMap[search[i].url] = search[i];
}
var tooltip = $('<div class="content-tooltip"></div>').appendTo('body').hide();
for (var j = 0; j < data.length; j++) {
var item = searchMap[data[j].id];
if (item) {
var link = $('<a href="' + item.url + '">' + item.title + '</a>');
var contentPreview = item.content.substring(0, 100);
if (item.content.length > 100) {
contentPreview += "……";
}
link.hover(
function(e) {
tooltip.text($(this).data('content'))
.css({
top: e.pageY + 10,
left: e.pageX + 10
})
.show();
},
function() {
tooltip.hide();
}
).mousemove(function(e) {
tooltip.css({
top: e.pageY + 10,
left: e.pageX + 10
});
}).data('content', contentPreview);
suggest.append(link);
suggest.append(' - ' + item.date + '<br />');
}
}
});
} else {
suggest.html("暂无推荐文章……");
}
});
</script>
<br />
<div class="pagination">
<span class="prev">
<a href="/2023/08/01/auth.html">
上一篇如何让Python脚本接收OAuth2.0的Code
</a>
</span>
<br />
<span class="next">
<a href="/2023/09/24/rpi-ubuntu.html">
下一篇在树莓派4B上安装Ubuntu以及各种操作
</a>
</span>
</div>
<!--[if !IE]> -->
<link rel="stylesheet" href="/assets/css/gitalk.css">
<script src="/assets/js/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
var gitalk = new Gitalk({
clientID: '36557aec4c3cb04f7ac6',
clientSecret: 'ac32993299751cb5a9ba81cf2b171cca65879cdb',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '/2023/09/06/satellite', // Ensure uniqueness and length less than 50
distractionFreeMode: false, // Facebook-like distraction free mode
proxy: "https://cors-anywhere.mayx.eu.org/?https://github.com/login/oauth/access_token"
})
gitalk.render('gitalk-container')
</script>
<!-- <![endif]-->
</section>
<!--[if !IE]> -->
<div id="landlord" style="left:5px;bottom:0px;">
<div class="message" style="opacity:0"></div>
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
<div class="live_talk_input_body">
<form id="live_talk_input_form">
<div class="live_talk_input_name_body" >
<input type="checkbox" id="load_this" />
<input type="hidden" id="post_id" value="/2023/09/06/satellite.html" />
<label for="load_this">
<span style="font-size: 11px; color: #fff;">&#160;想问这篇文章</span>
</label>
</div>
<div class="live_talk_input_text_body">
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?" />
<button type="submit" class="live_talk_send_btn" id="talk_send">发送</button>
</div>
</form>
</div>
<input name="live_talk" id="live_talk" value="1" type="hidden" />
<div class="live_ico_box" style="display:none;">
<div class="live_ico_item type_info" id="showInfoBtn"></div>
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
<div class="live_ico_item type_music" id="musicButton"></div>
<div class="live_ico_item type_youdu" id="youduButton"></div>
<div class="live_ico_item type_quit" id="hideButton"></div>
<input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
<audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
<input id="duType" value="douqilai" type="hidden" />
</div>
</div>
<div id="open_live2d">召唤伊斯特瓦尔</div>
<!-- <![endif]-->
<footer>
<p>
<small>Made with ❤ by Mayx<br />Last updated at 2026-01-17 17:35:53<br /> 总字数614622 - 文章数178 - <a href="/atom.xml" >Atom</a> - <a href="/README.html" >About</a></small>
</p>
</footer>
</div>
<script src="/assets/js/scale.fix.js"></script>
<!--[if !IE]> -->
<script src="/assets/js/main_new.js"></script>
<script src="/Live2dHistoire/live2d/js/live2d.js"></script>
<script src="/Live2dHistoire/live2d/js/message.js"></script>
<!-- <![endif]-->
</body>
</html>

374
2023/09/24/rpi-ubuntu.html Normal file
View File

@@ -0,0 +1,374 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>在树莓派4B上安装Ubuntu以及各种操作 | Mayx的博客</title>
<meta name="generator" content="Jekyll v3.9.5" />
<meta property="og:title" content="在树莓派4B上安装Ubuntu以及各种操作" />
<meta name="author" content="mayx" />
<meta property="og:locale" content="zh_CN" />
<meta name="description" content="明明在普通的电脑上也能完成这些操作……😥" />
<meta property="og:description" content="明明在普通的电脑上也能完成这些操作……😥" />
<meta property="og:site_name" content="Mayx的博客" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2023-09-24T00:00:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="在树莓派4B上安装Ubuntu以及各种操作" />
<meta name="google-site-verification" content="huTYdEesm8NaFymixMNqflyCp6Jfvd615j5Wq1i2PHc" />
<meta name="msvalidate.01" content="0ADFCE64B3557DC4DC5F2DC224C5FDDD" />
<meta name="yandex-verification" content="fc0e535abed800be" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"mayx"},"dateModified":"2023-09-24T00:00:00+08:00","datePublished":"2023-09-24T00:00:00+08:00","description":"明明在普通的电脑上也能完成这些操作……😥","headline":"在树莓派4B上安装Ubuntu以及各种操作","mainEntityOfPage":{"@type":"WebPage","@id":"/2023/09/24/rpi-ubuntu.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://avatars0.githubusercontent.com/u/17966333"},"name":"mayx"},"url":"/2023/09/24/rpi-ubuntu.html"}</script>
<!-- End Jekyll SEO tag -->
<link rel="canonical" href="https://mabbs.github.io/2023/09/24/rpi-ubuntu.html" />
<link type="application/atom+xml" rel="alternate" href="/atom.xml" title="Mayx的博客" />
<link rel="alternate" type="application/rss+xml" title="Mayx的博客(RSS)" href="/rss.xml" />
<link rel="alternate" type="application/json" title="Mayx的博客(JSON Feed)" href="/feed.json" />
<link rel="stylesheet" href="/assets/css/style.css?v=1768642553" />
<!--[if !IE]> -->
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
<!-- <![endif]-->
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Mayx的博客" />
<link rel="webmention" href="https://webmention.io/mabbs.github.io/webmention" />
<link rel="pingback" href="https://webmention.io/mabbs.github.io/xmlrpc" />
<link rel="preconnect" href="https://summary.mayx.eu.org" crossorigin="anonymous" />
<link rel="prefetch" href="https://www.blogsclub.org/badge/mabbs.github.io" as="image" />
<link rel="blogroll" type="text/xml" href="/blogroll.opml" />
<link rel="me" href="https://github.com/Mabbs" />
<script src="/assets/js/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
var lastUpdated = new Date("Sat, 17 Jan 2026 17:35:53 +0800");
var BlogAPI = "https://summary.mayx.eu.org";
</script>
<script src="/assets/js/main.js"></script>
<!--[if !IE]> -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-137710294-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-137710294-1');
</script>
<script src="/assets/js/instant.page.js" type="module"></script>
<!-- <![endif]-->
</head>
<body>
<!--[if !IE]> --><noscript><marquee style="top: -15px; position: relative;"><small>发现当前浏览器没有启用JavaScript这不影响你的浏览但可能会有一些功能无法使用……</small></marquee></noscript><!-- <![endif]-->
<!--[if IE]><marquee style="top: -15px; position: relative;"><small>发现当前浏览器为Internet Explorer这不影响你的浏览但可能会有一些功能无法使用……</small></marquee><![endif]-->
<div class="wrapper">
<header class="h-card">
<h1><a class="u-url u-uid p-name" rel="me" href="/">Mayx的博客</a></h1>
<img src="https://avatars0.githubusercontent.com/u/17966333" fetchpriority="high" class="u-photo" alt="Logo" style="width: 90%; max-width: 300px; max-height: 300px;" />
<p class="p-note">Mayx's Home Page</p>
<form action="/search.html">
<input type="text" name="keyword" id="search-input-all" placeholder="Search blog posts.." />&#160;<input type="submit" value="搜索" />
</form>
<br />
<p class="view"><a class="u-url" href="/Mabbs/">About me</a></p>
<ul class="downloads">
<li style="width: 270px; border-right: none;"><a href="/MayxBlog.tgz">Download <strong>TGZ File</strong></a></li>
</ul>
</header>
<section class="h-entry">
<small><time class="date dt-published" datetime="2023-09-24T00:00:00+08:00">24 September 2023</time> - 字数统计4134 - 阅读大约需要13分钟 - Hits: <span id="/2023/09/24/rpi-ubuntu.html" class="visitors">Loading...</span></small>
<h1 class="p-name">在树莓派4B上安装Ubuntu以及各种操作</h1>
<p class="view">by <a class="p-author h-card" href="//github.com/Mabbs">mayx</a></p>
<div id="outdate" style="display:none;">
<hr /><p>
这是一篇创建于 <span id="outime"></span> 天前的文章,其中的信息可能已经有所发展或是发生改变。
</p>
</div>
<script>
daysold = Math.floor((new Date().getTime() - new Date("Sun, 24 Sep 2023 00:00:00 +0800").getTime()) / (24 * 60 * 60 * 1000));
if (daysold > 90) {
document.getElementById("outdate").style.display = "block";
document.getElementById("outime").innerHTML = daysold;
}
</script>
<hr />
<b>AI摘要</b>
<p id="ai-output">这篇文章介绍了作者在树莓派4B上安装Ubuntu的经历。一开始尝试安装Windows 11并使用ESXi-Arm Fling遭遇问题如内存卡浪费和存储限制。由于对Windows的不满意作者决定安装Ubuntu过程中遇到了登录密码设置的困扰软件提示不明确。尽管如此最终成功安装了Ubuntu并编译并运行了PiFmAdv项目但初始遇到编译问题。作者还尝试了通过QEMU-KVM在树莓派上跑Windows虚拟机对比了与裸机的性能发现虚拟机表现不佳。此外虽然尝试让树莓派运行x86程序如postjson工具但由于性能受限效果并不理想。总结全文作者表示树莓派除了FM电台功能其他操作在普通电脑上也能完成质疑购买它的意义但也提到挖掘其潜力的过程满足了自己的探索欲望。</p>
<hr />
<ul><li><a href="#起因">起因</a></li><li><a href="#用树莓派整点什么">用树莓派整点什么</a><ul><li><a href="#整点fm电台">整点FM电台</a></li><li><a href="#整点大语言模型llama">整点大语言模型LLaMA</a></li><li><a href="#整点qemu-kvm-windows虚拟机">整点QEMU-KVM Windows虚拟机</a></li><li><a href="#让树莓派运行x86程序">让树莓派运行x86程序</a></li></ul></li><li><a href="#感想">感想</a></li></ul>
<hr />
<main class="post-content e-content" role="main"><p>明明在普通的电脑上也能完成这些操作……😥<!--more--></p>
<h1 id="起因">
<a href="#起因"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 起因
</h1>
<p>自从上次我给我的树莓派4B-8GiB内存版<a href="/2023/05/22/rpi-win.html">安装了Windows11</a>以后我感觉这个东西上是真的鸡肋速度慢而且兼容性还差指令集有缺失连很多需要用到加密库的软件都不能正常运行……后来我就重装了一个ESXi-Arm Fling但是装这个也有个问题就是它不能使用TF卡存储东西我还特地为了Windows买了个64GiB的TF卡结果装虚拟机还用不了😂U盘我也只有一个32GiB的ESXi-Arm Fling如果想要正常的存储配置信息就至少需要占用掉3*4GiB的空间这样虚拟机就只能使用20GiB的空间……真的全都是垃圾20GiB能开几个虚拟机啊开了也没啥能用的。所以这个树莓派就一直在吃灰。 </p><p>
后来我又想整点活想着干脆安装个Ubuntu好了反正放着也是吃灰也错过了最佳卖树莓派的机会就用起来吧安装Ubuntu的时候居然也是各种碰壁😓一开始我用树莓派镜像烧录器闭着眼睛直接选了Ubuntu Server系统我还以为它可以像安装树莓派系统那样第一次启动的时候让我设置密码结果烧录完之后引导就直接让登录了我连密码都不知道要怎么登录啊😥网上搜了一下有默认密码输进去之后显示需要让我更改密码结果这个需要更改的密码怎么设置都不能生效😰后来去Ubuntu官网看了一眼才知道原来需要在烧录中选择高级设置手动设置密码才行……网上这些教程都是垃圾这个软件也一样🤬啥提示都没有不看文档就只能靠猜了😢。 </p><p>
最后终于把Ubuntu安装好了可以开始整活了😁。</p>
<h1 id="用树莓派整点什么">
<a href="#用树莓派整点什么"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 用树莓派整点什么
</h1>
<h2 id="整点fm电台">
<a href="#整点fm电台"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 整点FM电台
</h2>
<p>安装好Ubuntu后我最先想干的事情还是整<a href="/2022/03/27/radio.html">FM电台</a>,毕竟这真的就是树莓派唯一和其他设备不一样的地方了啊,于是我就编译了一下<a href="https://github.com/miegl/PiFmAdv">PiFmAdv</a>并运行,结果不知道为什么一运行树莓派就直接死机……于是我退而求其次,选择了<a href="https://github.com/markondej/fm_transmitter">fm_transmitter</a>这个倒是能运行不过操作和树莓派3B区别相当大首先编译得要用<code class="language-plaintext highlighter-rouge">make GPIO21=1</code>然后杜邦线也要插到第40个接口具体如下图打x的位置</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>,--------------------------------.
| ooooooooooooooooooox J8 +======
| 1ooooooooooooooooooo PoE | Net
| Wi 1o +======
| Fi Pi Model 4B V1.4 oo |
| ,----. +---+ +====
| |D| |SoC | |RAM| |USB3
| |S| | | | | +====
| |I| `----' +---+ |
| |C| +====
| |S| |USB2
| pwr |hd| |hd| |I||A| +====
`-| |---|m0|---|m1|----|V|-------'
</code></pre></div></div>
<p>CPU和GPU也全部需要定频运行另外设置频率不能超过93 MHz……我调了半天才能正常运行……还有就是不像之前PiFmAdv那个项目可以使用立体声感觉树莓派4B还不如3B…… </p><p>
不过我写着写着感觉好像不太对劲看了一眼我上次写电台的那篇文章的时间比PiFmAdv最后一次更新还要早看了一眼提交发现人家已经把问题解决了难怪我运行不起来原来是代码没用最新的🤣刚刚更新了一下代码之后再运行已经没有任何问题了立体声啥的都能正常使用了。不过Makefile还是没改……aarch64的系统运行依然会出问题😥……其实改起来也很简单把Makefile里面的两个参数换成</p>
<pre><code class="language-Makefile"> CFLAGS = $(STD_CFLAGS) -march=armv8-a -ffast-math -DRASPI=4
TARGET = pi4
</code></pre>
<p>就可以正常编译了。</p>
<h2 id="整点大语言模型llama">
<a href="#整点大语言模型llama"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 整点大语言模型LLaMA
</h2>
<p>因为我的树莓派有8GiB内存之前我在我的8GiB内存的<a href="/2023/04/05/ai.html">MacBook Pro上跑LLaMA</a>都没问题那在树莓派上跑个LLaMA应该也没问题所以就想试试看。跑起来非常简单<a href="https://github.com/ggerganov/llama.cpp">llama.cpp</a>拉下来然后直接编译就行了但是实际跑起来速度非常慢大概1token要1-2秒……根本用不成不过现在的llama.cpp已经非常完善了支持各种各样的硬件加速无论是在我的MacBook上还是用N卡、A卡甚至手机使用OpenCL似乎都可以进行硬件加速。这些都能得到很不错的速度那树莓派呢树莓派用的好像是博通的叫什么VideoCore的显卡我搜了一下貌似没有办法使用OpenCL……不过搜的过程中发现似乎可以<a href="https://qengineering.eu/install-vulkan-on-raspberry-pi.html">装Vulkan</a>虽然llama.cpp不能使用Vulkan不过ncnn框架似乎可以使用Vulkan跑个waifu2x也算不浪费这个树莓派的GPU啊只是安了半天发现不连接屏幕貌似安了也识别不了……所以还是算了吧……</p>
<h2 id="整点qemu-kvm-windows虚拟机">
<a href="#整点qemu-kvm-windows虚拟机"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 整点QEMU-KVM Windows虚拟机
</h2>
<p>当时我在树莓派上安装Windows11的时候听说在虚拟机上运行的效果要比裸机安装效果更好我听到之后认为这是胡说八道哪有虚拟机比裸机运行效果好的啊不过树莓派嘛……说不定会有因为驱动不完整之类的情况毕竟如果是在虚拟机里安装系统外面的Linux系统可以使用无线网卡而直接安装Windows是不能使用无线网卡的所以这次我也打算试试看反正树莓派上使用虚拟机是可以使用KVM加速的所以试试也没关系。 </p><p>
安装QEMU也很简单直接执行</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>apt <span class="nb">install </span>qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virtinst virt-manager qemu-system-arm qemu-efi-aarch64 seabios vgabios
</code></pre></div></div>
<p>就可以了安装系统的话也很简单首先去下载Windows所需要的驱动<a href="https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/">virtio-win</a>然后下载Windows ARM版的安装光盘这个去MSDN I tell you下载就行了之后下载一个VNC客户端用来连接虚拟机的屏幕然后创建硬盘</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>qemu-img create <span class="nt">-f</span> vhdx <span class="nt">-o</span> <span class="nv">subformat</span><span class="o">=</span>fixed system.vhdx 30G
</code></pre></div></div>
<p>准备好这些以后就可以启动虚拟机了,启动的命令如下:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>qemu-system-aarch64 <span class="nt">-M</span> virt-2.12 <span class="nt">-smp</span> 4 <span class="nt">-m</span> 4G <span class="nt">-cpu</span> host <span class="nt">-enable-kvm</span> <span class="nt">-bios</span> /usr/share/qemu-efi-aarch64/QEMU_EFI.fd <span class="nt">-device</span> ramfb <span class="nt">-device</span> qemu-xhci,id<span class="o">=</span>xhci <span class="nt">-usb</span> <span class="nt">-device</span> usb-kbd <span class="nt">-device</span> usb-mouse <span class="nt">-device</span> usb-tablet <span class="nt">-k</span> en-us <span class="nt">-device</span> virtio-balloon <span class="nt">-device</span> virtio-rng <span class="nt">-device</span> virtio-blk,drive<span class="o">=</span>system <span class="nt">-drive</span> <span class="k">if</span><span class="o">=</span>none,id<span class="o">=</span>system,format<span class="o">=</span>raw,media<span class="o">=</span>disk,file<span class="o">=</span>system.vhdx <span class="nt">-device</span> usb-storage,drive<span class="o">=</span><span class="nb">install</span> <span class="nt">-drive</span> <span class="k">if</span><span class="o">=</span>none,id<span class="o">=</span><span class="nb">install</span>,format<span class="o">=</span>raw,media<span class="o">=</span>cdrom,file<span class="o">=</span>win10.iso <span class="nt">-device</span> usb-storage,drive<span class="o">=</span>drivers <span class="nt">-drive</span> <span class="k">if</span><span class="o">=</span>none,id<span class="o">=</span>drivers,media<span class="o">=</span>cdrom,file<span class="o">=</span>virtio-win.iso <span class="nt">-device</span> virtio-net,disable-legacy<span class="o">=</span>on,netdev<span class="o">=</span>net0 <span class="nt">-netdev</span> user,id<span class="o">=</span>net0,hostfwd<span class="o">=</span>tcp::3389-:3389 <span class="nt">-vnc</span> :1
</code></pre></div></div>
<p>然后就能像正常安装Windows系统那样安装了其中需要注意的一点是安装的时候会读不到硬盘需要加载光盘中的驱动其他缺失的驱动光盘里基本上都有直接安装就行。另外第一次重启前最好把<code class="language-plaintext highlighter-rouge">-device usb-storage,drive=install -drive if=none,id=install,format=raw,media=cdrom,file=win10.iso</code>删掉安装好之后可以打开远程桌面就可以直接使用树莓派的IP去连接Windows系统还能有完整的分辨率和音频支持。 </p><p>
既然装好了虚拟机那么我就应该验证一下虚拟机是不是真的比物理机安装效果更好了。具体怎么验证呢我又找了一个树莓派4B-4GiB内存版在上面安装直接安装同版本的Windows ARM版然后把两个树莓派的频率都调为1.8GHz在两个Windows系统上下载了7-Zip ARM版跑一遍基准测试结果裸机安装的总体评分为6.1GIPS左右虚拟机是5.1GIPS左右这很明显裸机还是更强嘛虚拟机唯一的优势就是可以用无线网络罢了说到网络我也测了一下这个速度在同样使用有线网络的情况下虚拟机因为用的是user模式效果很差连50Mbps都跑不到而裸机可以超过100Mbps。至于qemu怎么使用其他网络模式我也不太会整起来好像还挺麻烦的。总的来看树莓派安装QEMU-KVM运行Windows实在是不怎么样……一样是个垃圾。</p>
<h2 id="让树莓派运行x86程序">
<a href="#让树莓派运行x86程序"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 让树莓派运行x86程序
</h2>
<p>既然安装了QEMU那就该玩玩跨指令集的东西了当然跨指令集是没办法使用KVM了而且树莓派不像MacBook的Rosetta 2那样有硬件加速效果肯定会非常差不过我已经做好了觉悟还是想整个玩玩。怎么整呢非常简单只要运行</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>apt <span class="nb">install </span>qemu-user-binfmt
</code></pre></div></div>
<p>就好了那到底是什么软件让我想大费周章的让树莓派运行x86程序呢其实是一个叫做<a href="http://cdn.ouapi.com/postjson_linux.zip">postjson</a>的接口测试工具似乎是拿Go写的但是没有开源也没有ARM64的二进制文件所以就只好用QEMU啦试了一下还真能运行而且就像Rosetta 2那样直接当作原生的程序运行就可以效果挺不错不过CPU占用非常高一运行一个CPU核心就占满了😂也就是勉强能用的水平吧。</p>
<h1 id="感想">
<a href="#感想"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 感想
</h1>
<p>搞了这么多东西之后发现树莓派除了那个FM电台不能在普通电脑上操作其他不是和普通的电脑一样吗🤣那买树莓派还有什么意义不如买个二手手机不过有了树莓派就感觉越垃圾越想挖掘它的作用这可能就是它存在的意义吧🤣。</p></main>
<small style="display: block">tags: <a rel="category tag" class="p-category" href="/search.html?keyword=%E6%A0%91%E8%8E%93%E6%B4%BE"><em>树莓派</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=Ubuntu"><em>Ubuntu</em></a> <span style="float: right;"><a href="https://gitlab.com/mayx/mayx.gitlab.io/tree/master/_posts/2023-09-24-rpi-ubuntu.md">查看原始文件</a></span></small>
<h4 style="border-bottom: 1px solid #e5e5e5;margin: 2em 0 5px;">推荐文章</h4>
<p id="suggest-container">Loading...</p>
<script>
var suggest = $("#suggest-container");
$.get(BlogAPI + "/suggest?id=/2023/09/24/rpi-ubuntu.html&update=" + lastUpdated.valueOf(), function (data) {
if (data.length) {
getSearchJSON(function (search) {
suggest.empty();
var searchMap = {};
for (var i = 0; i < search.length; i++) {
searchMap[search[i].url] = search[i];
}
var tooltip = $('<div class="content-tooltip"></div>').appendTo('body').hide();
for (var j = 0; j < data.length; j++) {
var item = searchMap[data[j].id];
if (item) {
var link = $('<a href="' + item.url + '">' + item.title + '</a>');
var contentPreview = item.content.substring(0, 100);
if (item.content.length > 100) {
contentPreview += "……";
}
link.hover(
function(e) {
tooltip.text($(this).data('content'))
.css({
top: e.pageY + 10,
left: e.pageX + 10
})
.show();
},
function() {
tooltip.hide();
}
).mousemove(function(e) {
tooltip.css({
top: e.pageY + 10,
left: e.pageX + 10
});
}).data('content', contentPreview);
suggest.append(link);
suggest.append(' - ' + item.date + '<br />');
}
}
});
} else {
suggest.html("暂无推荐文章……");
}
});
</script>
<br />
<div class="pagination">
<span class="prev">
<a href="/2023/09/06/satellite.html">
上一篇:关于卫星通信的一些看法
</a>
</span>
<br />
<span class="next">
<a href="/2023/10/21/game.html">
下一篇在MacBook玩游戏的各种方法
</a>
</span>
</div>
<!--[if !IE]> -->
<link rel="stylesheet" href="/assets/css/gitalk.css">
<script src="/assets/js/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
var gitalk = new Gitalk({
clientID: '36557aec4c3cb04f7ac6',
clientSecret: 'ac32993299751cb5a9ba81cf2b171cca65879cdb',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '/2023/09/24/rpi-ubuntu', // Ensure uniqueness and length less than 50
distractionFreeMode: false, // Facebook-like distraction free mode
proxy: "https://cors-anywhere.mayx.eu.org/?https://github.com/login/oauth/access_token"
})
gitalk.render('gitalk-container')
</script>
<!-- <![endif]-->
</section>
<!--[if !IE]> -->
<div id="landlord" style="left:5px;bottom:0px;">
<div class="message" style="opacity:0"></div>
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
<div class="live_talk_input_body">
<form id="live_talk_input_form">
<div class="live_talk_input_name_body" >
<input type="checkbox" id="load_this" />
<input type="hidden" id="post_id" value="/2023/09/24/rpi-ubuntu.html" />
<label for="load_this">
<span style="font-size: 11px; color: #fff;">&#160;想问这篇文章</span>
</label>
</div>
<div class="live_talk_input_text_body">
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?" />
<button type="submit" class="live_talk_send_btn" id="talk_send">发送</button>
</div>
</form>
</div>
<input name="live_talk" id="live_talk" value="1" type="hidden" />
<div class="live_ico_box" style="display:none;">
<div class="live_ico_item type_info" id="showInfoBtn"></div>
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
<div class="live_ico_item type_music" id="musicButton"></div>
<div class="live_ico_item type_youdu" id="youduButton"></div>
<div class="live_ico_item type_quit" id="hideButton"></div>
<input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
<audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
<input id="duType" value="douqilai" type="hidden" />
</div>
</div>
<div id="open_live2d">召唤伊斯特瓦尔</div>
<!-- <![endif]-->
<footer>
<p>
<small>Made with ❤ by Mayx<br />Last updated at 2026-01-17 17:35:53<br /> 总字数614622 - 文章数178 - <a href="/atom.xml" >Atom</a> - <a href="/README.html" >About</a></small>
</p>
</footer>
</div>
<script src="/assets/js/scale.fix.js"></script>
<!--[if !IE]> -->
<script src="/assets/js/main_new.js"></script>
<script src="/Live2dHistoire/live2d/js/live2d.js"></script>
<script src="/Live2dHistoire/live2d/js/message.js"></script>
<!-- <![endif]-->
</body>
</html>

376
2023/10/21/game.html Normal file
View File

@@ -0,0 +1,376 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>在MacBook玩游戏的各种方法 | Mayx的博客</title>
<meta name="generator" content="Jekyll v3.9.5" />
<meta property="og:title" content="在MacBook玩游戏的各种方法" />
<meta name="author" content="mayx" />
<meta property="og:locale" content="zh_CN" />
<meta name="description" content="我倒要看看是谁在说Mac打游戏是疯子😡" />
<meta property="og:description" content="我倒要看看是谁在说Mac打游戏是疯子😡" />
<meta property="og:site_name" content="Mayx的博客" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2023-10-21T00:00:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="在MacBook玩游戏的各种方法" />
<meta name="google-site-verification" content="huTYdEesm8NaFymixMNqflyCp6Jfvd615j5Wq1i2PHc" />
<meta name="msvalidate.01" content="0ADFCE64B3557DC4DC5F2DC224C5FDDD" />
<meta name="yandex-verification" content="fc0e535abed800be" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"mayx"},"dateModified":"2023-10-21T00:00:00+08:00","datePublished":"2023-10-21T00:00:00+08:00","description":"我倒要看看是谁在说Mac打游戏是疯子😡","headline":"在MacBook玩游戏的各种方法","mainEntityOfPage":{"@type":"WebPage","@id":"/2023/10/21/game.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://avatars0.githubusercontent.com/u/17966333"},"name":"mayx"},"url":"/2023/10/21/game.html"}</script>
<!-- End Jekyll SEO tag -->
<link rel="canonical" href="https://mabbs.github.io/2023/10/21/game.html" />
<link type="application/atom+xml" rel="alternate" href="/atom.xml" title="Mayx的博客" />
<link rel="alternate" type="application/rss+xml" title="Mayx的博客(RSS)" href="/rss.xml" />
<link rel="alternate" type="application/json" title="Mayx的博客(JSON Feed)" href="/feed.json" />
<link rel="stylesheet" href="/assets/css/style.css?v=1768642553" />
<!--[if !IE]> -->
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
<!-- <![endif]-->
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Mayx的博客" />
<link rel="webmention" href="https://webmention.io/mabbs.github.io/webmention" />
<link rel="pingback" href="https://webmention.io/mabbs.github.io/xmlrpc" />
<link rel="preconnect" href="https://summary.mayx.eu.org" crossorigin="anonymous" />
<link rel="prefetch" href="https://www.blogsclub.org/badge/mabbs.github.io" as="image" />
<link rel="blogroll" type="text/xml" href="/blogroll.opml" />
<link rel="me" href="https://github.com/Mabbs" />
<script src="/assets/js/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
var lastUpdated = new Date("Sat, 17 Jan 2026 17:35:53 +0800");
var BlogAPI = "https://summary.mayx.eu.org";
</script>
<script src="/assets/js/main.js"></script>
<!--[if !IE]> -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-137710294-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-137710294-1');
</script>
<script src="/assets/js/instant.page.js" type="module"></script>
<!-- <![endif]-->
</head>
<body>
<!--[if !IE]> --><noscript><marquee style="top: -15px; position: relative;"><small>发现当前浏览器没有启用JavaScript这不影响你的浏览但可能会有一些功能无法使用……</small></marquee></noscript><!-- <![endif]-->
<!--[if IE]><marquee style="top: -15px; position: relative;"><small>发现当前浏览器为Internet Explorer这不影响你的浏览但可能会有一些功能无法使用……</small></marquee><![endif]-->
<div class="wrapper">
<header class="h-card">
<h1><a class="u-url u-uid p-name" rel="me" href="/">Mayx的博客</a></h1>
<img src="https://avatars0.githubusercontent.com/u/17966333" fetchpriority="high" class="u-photo" alt="Logo" style="width: 90%; max-width: 300px; max-height: 300px;" />
<p class="p-note">Mayx's Home Page</p>
<form action="/search.html">
<input type="text" name="keyword" id="search-input-all" placeholder="Search blog posts.." />&#160;<input type="submit" value="搜索" />
</form>
<br />
<p class="view"><a class="u-url" href="/Mabbs/">About me</a></p>
<ul class="downloads">
<li style="width: 270px; border-right: none;"><a href="/MayxBlog.tgz">Download <strong>TGZ File</strong></a></li>
</ul>
</header>
<section class="h-entry">
<small><time class="date dt-published" datetime="2023-10-21T00:00:00+08:00">21 October 2023</time> - 字数统计2869 - 阅读大约需要9分钟 - Hits: <span id="/2023/10/21/game.html" class="visitors">Loading...</span></small>
<h1 class="p-name">在MacBook玩游戏的各种方法</h1>
<p class="view">by <a class="p-author h-card" href="//github.com/Mabbs">mayx</a></p>
<div id="outdate" style="display:none;">
<hr /><p>
这是一篇创建于 <span id="outime"></span> 天前的文章,其中的信息可能已经有所发展或是发生改变。
</p>
</div>
<script>
daysold = Math.floor((new Date().getTime() - new Date("Sat, 21 Oct 2023 00:00:00 +0800").getTime()) / (24 * 60 * 60 * 1000));
if (daysold > 90) {
document.getElementById("outdate").style.display = "block";
document.getElementById("outime").innerHTML = daysold;
}
</script>
<hr />
<b>AI摘要</b>
<p id="ai-output">这篇文章讲述了在MacBook上玩游戏的各种方式1. 原生游戏例如专为Mac设计的应用和开源游戏2. iOS游戏通过Decrypt IPA Store下载并在Mac上使用特定软件运行3. 利用Rosetta 2运行x86游戏比如通过Steam和Epic Games Launcher4. 基于脚本的Galgame游戏如使用工具如XP3Player、ONSPlayer或Ren'Py5. 在网页上运行的游戏如RPG Maker MV6. 通过Wine或者其他基于Wine的工具运行Windows游戏如Game Porting Toolkit和Whisky7. 虚拟机不推荐如UTM8. 云游戏服务依赖网络和服务器性能。作者强调了MacBook虽然不是专门设计用于游戏但有多种方法可以让用户在上面玩游戏。</p>
<hr />
<ul><li><a href="#起因">起因</a></li><li><a href="#在macbook玩游戏的方法">在MacBook玩游戏的方法</a><ul><li><a href="#原生游戏">原生游戏</a></li><li><a href="#ios游戏">iOS游戏</a></li><li><a href="#使用rosetta-2的x86游戏">使用Rosetta 2的x86游戏</a></li><li><a href="#基于脚本的galgame游戏">基于脚本的Galgame游戏</a></li><li><a href="#在网页上运行的游戏">在网页上运行的游戏</a></li><li><a href="#使用wine游玩windows游戏">使用Wine🍷游玩Windows游戏</a></li><li><a href="#使用虚拟机游玩windows游戏">使用虚拟机游玩Windows游戏</a></li><li><a href="#云游戏方案">云游戏方案</a></li></ul></li><li><a href="#感想">感想</a></li></ul>
<hr />
<main class="post-content e-content" role="main"><p>我倒要看看是谁在说Mac打游戏是疯子😡<!--more--></p>
<h1 id="起因">
<a href="#起因"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 起因
</h1>
<p>自从<a href="/2023/02/03/mbp.html">用了MacBook Pro</a>以后我用我以前Windows笔记本的次数越来越少了。虽然性能可能比不上但是安静和超长续航的体验还是相当不错的。但是我也不是完全不玩游戏的人有时候闲了也有打游戏的需求那我如何在不使用Windows系统的情况下打游戏呢</p>
<h1 id="在macbook玩游戏的方法">
<a href="#在macbook玩游戏的方法"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 在MacBook玩游戏的方法
</h1>
<h2 id="原生游戏">
<a href="#原生游戏"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 原生游戏
</h2>
<p>一般来说如果想发挥MacBook的全部能力那自然是完完全全为Mac设计不需要任何转换等方法的游戏最好了这类游戏一般在Mac App Store就能找到和下载只是绝大多数都不是免费的我也就下过一款<a href="https://apps.apple.com/us/app/ibreakout/id1582094533">TouchBrickOut</a>的打砖块游戏这是真真正正为Mac设计的不仅原生还要Touch Bar。当然对于大多数游戏来说不会为Mac专门设计毕竟Mac的游戏玩家比较少。但是能在Mac上原生运行的游戏除了为Mac设计以外就是开源游戏了。毕竟源代码都有了想在哪里编译都可以。对于我玩的游戏来说有几款正好符合这一点比如<a href="https://github.com/ppy/osu">osu!lazer</a>,还有之前玩过的<a href="https://github.com/k4zmu2a/SpaceCadetPinball">三维弹球</a></p>
<h2 id="ios游戏">
<a href="#ios游戏"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> iOS游戏
</h2>
<p>因为M系列芯片基于ARM架构所以我的MacBook也可以玩iOS的游戏。这类游戏一般也能直接在Mac App Store上下载到比如我玩过的<a href="https://apps.apple.com/us/app/%E8%8D%AF%E6%B0%B4%E5%88%B6%E4%BD%9C%E5%B8%88/id950654598">药水制作师</a>。但其实有很多iOS游戏在Mac App Store上都搜索不到应该是开发者设置了规则不允许在Mac上使用。对于这类游戏可以在<a href="https://decrypt.day/">Decrypt IPA Store</a>上下载,并且使用<a href="https://github.com/PlayCover/PlayCover">PlayCover</a>安装。对我来说,我一般玩<a href="https://decrypt.day/app/id1423525213">公主连结Re:Dive</a>,以及一些模拟器,比如<a href="https://apps.apple.com/us/app/xp3player/id1064060287">XP3Player</a><a href="https://apps.apple.com/us/app/onsplayer/id1388250129">ONSPlayer</a>其实这两款软件可以在Mac App Store上下载但是都要花钱……所以我就去网上找的ipa文件然后在PlayCover上安装了</p>
<h2 id="使用rosetta-2的x86游戏">
<a href="#使用rosetta-2的x86游戏"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 使用Rosetta 2的x86游戏
</h2>
<p>在M系列芯片出来以前其实也有不少Mac上的游戏但是这类游戏可能在M芯片的Mac出来之前就已经开发好了想让开发者为M芯片做适配显然不大可能。不过macOS有Rosetta 2可以让开发者不需要任何改动的情况下就让游戏在M系列芯片Mac上运行。这类游戏非常多基本上在Steam和Epic Games上下载的游戏都是x86的像我用的Epic Games Launcher以及在上面下载的游戏<a href="https://launcher.store.epicgames.com/zh-CN/p/while-true-learn">while True:learn()</a>都是这样的,不过我玩的这些对性能要求都非常低,所以即使用了转译,但是玩起来并不会卡。</p>
<h2 id="基于脚本的galgame游戏">
<a href="#基于脚本的galgame游戏"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 基于脚本的Galgame游戏
</h2>
<p>很多Galgame都是用一些专用的脚本引擎工具写出来的例如T Visual Presenter、NScripter还有RenPy等等因为是脚本所以通常来说很容易跨平台毕竟它们没有太多依赖系统本身的东西只要能写出对应平台的解析器脚本都能运行。像上述提到的XP3Player、ONSPlayer还有<a href="https://apps.apple.com/us/app/renpyviewer/id1547796767">RenPyViewer</a>就可以运行很多基于脚本的游戏。不过很多RenPy游戏都有发行macOS版本所以一般不需要安装RenPyViewer。只是有可能它们都是基于x86开发的可能需要用Rosetta 2转译……</p>
<h2 id="在网页上运行的游戏">
<a href="#在网页上运行的游戏"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 在网页上运行的游戏
</h2>
<p>浏览器作为跨平台最强的解决方法自然游戏也不例外能在网页上运行的游戏也很多像RPG Maker MV制作的游戏基本上都可以在浏览器上运行。我看到有一个<a href="https://amemei-lists.top/posts/49e03169/">网站</a>就收集了很多这种游戏他们之前还把游戏放在了GitHub上。不过Github对<a href="https://docs.github.com/zh/site-policy/acceptable-use-policies/github-sexually-obscene-content">Sexually Obscene Content</a>内容是不容忍的所以他们在GitHub上的东西就消失了……不过我搜了一下还有一些漏网之鱼<a href="https://github.com/jjbR18">这个账号</a>还有这样的游戏可以玩🤣有效性只限我写文章之前的时间说不定哪天被GitHub发现就没了。其实对于这种网页上可以运行的游戏来说最好下载下来虽然RPG Maker MV的游戏可以在线玩但是加载那么多资源尤其这些文件还是在境外对国内玩家非常的不友好😆所以如果想在Mac上玩可以下载下来然后在终端那个目录下执行<code class="language-plaintext highlighter-rouge">python3 -m http.server</code>,就可以打开 <a href="http://127.0.0.1:8000">http://127.0.0.1:8000</a> 下开始游戏了。不过Safari的效果不太行很多游戏连声音都没有想玩还是下载Chrome之类的浏览器比较好。</p>
<h2 id="使用wine游玩windows游戏">
<a href="#使用wine游玩windows游戏"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 使用Wine🍷游玩Windows游戏
</h2>
<p>除了相对比较原生的办法不太优雅的办法就是用基于Wine的各种东西了。其实我之前不太想在MacBook上使用Wine的因为一般如果是Linux系统在ARM芯片上运行的话需要用QEMU User模式模拟x86然后再运行Wine效率极其低下还不如用虚拟机呢虽然听过Crossover不过我当时以为它是按这种方式的而且还要收费😂。不过macOS不太一样它有Rosetta 2加持效率比QEMU User模式高太多了虽然是两次翻译但是毕竟有黑科技还算是能玩。尤其是前段时间出的Game Porting Toolkit据说很厉害所以前几天我根据<a href="https://www.applegamingwiki.com/wiki/Game_Porting_Toolkit">这个教程</a>安装了一个编译的时候第一次听到我的MacBook风扇转😂。试了试效果确实不错找了个Unity3D的游戏可以满帧率运行。虽然很不错不过我又去网上搜了搜发现我是**,有个开源的软件<a href="https://github.com/Whisky-App/Whisky">Whisky</a>不需要编译任何东西就可以使用Wine和GPTk而且配置也很简单还能使用DXVK而且因为是已经编译好的不需要安装依赖也不需要源码之类的东西我通过上面教程安装的大小要4个多GiB但是这个就只要1个多GiB还不需要考虑乱七八糟的东西。 </p><p>
经过我的实测GPTk其实就是D3DMetal兼容性更好一些效率也更高但是占内存很大DXVK似乎效率低一些但是占内存比较小因为我的MacBook只有8GiB内存而且我玩的游戏在哪个上面都能跑满帧率 <del>反正3A大作我也不可能在MacBook上玩估计M2的水平也玩不了……不如说我基本上不玩3A大作🤣</del> 所以我在玩游戏一般还是会用DXVK多一些除非打不开才会用D3DMetal。</p>
<h2 id="使用虚拟机游玩windows游戏">
<a href="#使用虚拟机游玩windows游戏"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 使用虚拟机游玩Windows游戏
</h2>
<p>因为我的MacBook只有8GiB内存而且硬盘也只有256GiB跑虚拟机压力实在是太大了我以前试过<a href="https://github.com/utmapp/UTM">UTM</a>但是玩不了游戏随便什么游戏都会卡的动不了当然也可能是UTM的显卡驱动不太行不过现在的话我也不想尝试其他虚拟机了所以我只能说强烈不推荐使用虚拟机玩游戏。</p>
<h2 id="云游戏方案">
<a href="#云游戏方案"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 云游戏方案
</h2>
<p>这种方案直接就不在本机运行了,流畅程度全看网络和连接的主机性能。我以前也写过一篇<a href="/2021/09/28/cloudgame.html">关于云游戏的体验</a>,在这里就不多赘述了。</p>
<h1 id="感想">
<a href="#感想"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 感想
</h1>
<p>这么看来MacBook玩游戏的方法挺多的嘛谁说一定要Windows才能打游戏呢我觉得说在macOS上打游戏的人是精神病的人自己才是精神病吧谁也没有说买MacBook就是专门拿来打游戏的那些人就是觉得买Mac亏估计还很穷吧🤣。 </p><p>
顺便一说,有个叫<a href="https://www.applegamingwiki.com/wiki/Home">AppleGamingWiki</a>的网站上记录了一些比较大的游戏在M系列芯片上的兼容性如果真的有想在Mac上打游戏的想法也可以去这个Wiki上参考一下。</p></main>
<small style="display: block">tags: <a rel="category tag" class="p-category" href="/search.html?keyword=Apple"><em>Apple</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=MacBook"><em>MacBook</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=%E6%B8%B8%E6%88%8F"><em>游戏</em></a> <span style="float: right;"><a href="https://gitlab.com/mayx/mayx.gitlab.io/tree/master/_posts/2023-10-21-game.md">查看原始文件</a></span></small>
<h4 style="border-bottom: 1px solid #e5e5e5;margin: 2em 0 5px;">推荐文章</h4>
<p id="suggest-container">Loading...</p>
<script>
var suggest = $("#suggest-container");
$.get(BlogAPI + "/suggest?id=/2023/10/21/game.html&update=" + lastUpdated.valueOf(), function (data) {
if (data.length) {
getSearchJSON(function (search) {
suggest.empty();
var searchMap = {};
for (var i = 0; i < search.length; i++) {
searchMap[search[i].url] = search[i];
}
var tooltip = $('<div class="content-tooltip"></div>').appendTo('body').hide();
for (var j = 0; j < data.length; j++) {
var item = searchMap[data[j].id];
if (item) {
var link = $('<a href="' + item.url + '">' + item.title + '</a>');
var contentPreview = item.content.substring(0, 100);
if (item.content.length > 100) {
contentPreview += "……";
}
link.hover(
function(e) {
tooltip.text($(this).data('content'))
.css({
top: e.pageY + 10,
left: e.pageX + 10
})
.show();
},
function() {
tooltip.hide();
}
).mousemove(function(e) {
tooltip.css({
top: e.pageY + 10,
left: e.pageX + 10
});
}).data('content', contentPreview);
suggest.append(link);
suggest.append(' - ' + item.date + '<br />');
}
}
});
} else {
suggest.html("暂无推荐文章……");
}
});
</script>
<br />
<div class="pagination">
<span class="prev">
<a href="/2023/09/24/rpi-ubuntu.html">
上一篇在树莓派4B上安装Ubuntu以及各种操作
</a>
</span>
<br />
<span class="next">
<a href="/2023/12/10/openfyde.html">
下一篇rpi4-openfyde的使用体验
</a>
</span>
</div>
<!--[if !IE]> -->
<link rel="stylesheet" href="/assets/css/gitalk.css">
<script src="/assets/js/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
var gitalk = new Gitalk({
clientID: '36557aec4c3cb04f7ac6',
clientSecret: 'ac32993299751cb5a9ba81cf2b171cca65879cdb',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '/2023/10/21/game', // Ensure uniqueness and length less than 50
distractionFreeMode: false, // Facebook-like distraction free mode
proxy: "https://cors-anywhere.mayx.eu.org/?https://github.com/login/oauth/access_token"
})
gitalk.render('gitalk-container')
</script>
<!-- <![endif]-->
</section>
<!--[if !IE]> -->
<div id="landlord" style="left:5px;bottom:0px;">
<div class="message" style="opacity:0"></div>
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
<div class="live_talk_input_body">
<form id="live_talk_input_form">
<div class="live_talk_input_name_body" >
<input type="checkbox" id="load_this" />
<input type="hidden" id="post_id" value="/2023/10/21/game.html" />
<label for="load_this">
<span style="font-size: 11px; color: #fff;">&#160;想问这篇文章</span>
</label>
</div>
<div class="live_talk_input_text_body">
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?" />
<button type="submit" class="live_talk_send_btn" id="talk_send">发送</button>
</div>
</form>
</div>
<input name="live_talk" id="live_talk" value="1" type="hidden" />
<div class="live_ico_box" style="display:none;">
<div class="live_ico_item type_info" id="showInfoBtn"></div>
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
<div class="live_ico_item type_music" id="musicButton"></div>
<div class="live_ico_item type_youdu" id="youduButton"></div>
<div class="live_ico_item type_quit" id="hideButton"></div>
<input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
<audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
<input id="duType" value="douqilai" type="hidden" />
</div>
</div>
<div id="open_live2d">召唤伊斯特瓦尔</div>
<!-- <![endif]-->
<footer>
<p>
<small>Made with ❤ by Mayx<br />Last updated at 2026-01-17 17:35:53<br /> 总字数614622 - 文章数178 - <a href="/atom.xml" >Atom</a> - <a href="/README.html" >About</a></small>
</p>
</footer>
</div>
<script src="/assets/js/scale.fix.js"></script>
<!--[if !IE]> -->
<script src="/assets/js/main_new.js"></script>
<script src="/Live2dHistoire/live2d/js/live2d.js"></script>
<script src="/Live2dHistoire/live2d/js/message.js"></script>
<!-- <![endif]-->
</body>
</html>

318
2023/12/10/openfyde.html Normal file
View File

@@ -0,0 +1,318 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>rpi4-openfyde的使用体验 | Mayx的博客</title>
<meta name="generator" content="Jekyll v3.9.5" />
<meta property="og:title" content="rpi4-openfyde的使用体验" />
<meta name="author" content="mayx" />
<meta property="og:locale" content="zh_CN" />
<meta name="description" content="什么样的系统用户体验更好呢?" />
<meta property="og:description" content="什么样的系统用户体验更好呢?" />
<meta property="og:site_name" content="Mayx的博客" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2023-12-10T00:00:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="rpi4-openfyde的使用体验" />
<meta name="google-site-verification" content="huTYdEesm8NaFymixMNqflyCp6Jfvd615j5Wq1i2PHc" />
<meta name="msvalidate.01" content="0ADFCE64B3557DC4DC5F2DC224C5FDDD" />
<meta name="yandex-verification" content="fc0e535abed800be" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"mayx"},"dateModified":"2023-12-10T00:00:00+08:00","datePublished":"2023-12-10T00:00:00+08:00","description":"什么样的系统用户体验更好呢?","headline":"rpi4-openfyde的使用体验","mainEntityOfPage":{"@type":"WebPage","@id":"/2023/12/10/openfyde.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://avatars0.githubusercontent.com/u/17966333"},"name":"mayx"},"url":"/2023/12/10/openfyde.html"}</script>
<!-- End Jekyll SEO tag -->
<link rel="canonical" href="https://mabbs.github.io/2023/12/10/openfyde.html" />
<link type="application/atom+xml" rel="alternate" href="/atom.xml" title="Mayx的博客" />
<link rel="alternate" type="application/rss+xml" title="Mayx的博客(RSS)" href="/rss.xml" />
<link rel="alternate" type="application/json" title="Mayx的博客(JSON Feed)" href="/feed.json" />
<link rel="stylesheet" href="/assets/css/style.css?v=1768642553" />
<!--[if !IE]> -->
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
<!-- <![endif]-->
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Mayx的博客" />
<link rel="webmention" href="https://webmention.io/mabbs.github.io/webmention" />
<link rel="pingback" href="https://webmention.io/mabbs.github.io/xmlrpc" />
<link rel="preconnect" href="https://summary.mayx.eu.org" crossorigin="anonymous" />
<link rel="prefetch" href="https://www.blogsclub.org/badge/mabbs.github.io" as="image" />
<link rel="blogroll" type="text/xml" href="/blogroll.opml" />
<link rel="me" href="https://github.com/Mabbs" />
<script src="/assets/js/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
var lastUpdated = new Date("Sat, 17 Jan 2026 17:35:53 +0800");
var BlogAPI = "https://summary.mayx.eu.org";
</script>
<script src="/assets/js/main.js"></script>
<!--[if !IE]> -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-137710294-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-137710294-1');
</script>
<script src="/assets/js/instant.page.js" type="module"></script>
<!-- <![endif]-->
</head>
<body>
<!--[if !IE]> --><noscript><marquee style="top: -15px; position: relative;"><small>发现当前浏览器没有启用JavaScript这不影响你的浏览但可能会有一些功能无法使用……</small></marquee></noscript><!-- <![endif]-->
<!--[if IE]><marquee style="top: -15px; position: relative;"><small>发现当前浏览器为Internet Explorer这不影响你的浏览但可能会有一些功能无法使用……</small></marquee><![endif]-->
<div class="wrapper">
<header class="h-card">
<h1><a class="u-url u-uid p-name" rel="me" href="/">Mayx的博客</a></h1>
<img src="https://avatars0.githubusercontent.com/u/17966333" fetchpriority="high" class="u-photo" alt="Logo" style="width: 90%; max-width: 300px; max-height: 300px;" />
<p class="p-note">Mayx's Home Page</p>
<form action="/search.html">
<input type="text" name="keyword" id="search-input-all" placeholder="Search blog posts.." />&#160;<input type="submit" value="搜索" />
</form>
<br />
<p class="view"><a class="u-url" href="/Mabbs/">About me</a></p>
<ul class="downloads">
<li style="width: 270px; border-right: none;"><a href="/MayxBlog.tgz">Download <strong>TGZ File</strong></a></li>
</ul>
</header>
<section class="h-entry">
<small><time class="date dt-published" datetime="2023-12-10T00:00:00+08:00">10 December 2023</time> - 字数统计2109 - 阅读大约需要7分钟 - Hits: <span id="/2023/12/10/openfyde.html" class="visitors">Loading...</span></small>
<h1 class="p-name">rpi4-openfyde的使用体验</h1>
<p class="view">by <a class="p-author h-card" href="//github.com/Mabbs">mayx</a></p>
<div id="outdate" style="display:none;">
<hr /><p>
这是一篇创建于 <span id="outime"></span> 天前的文章,其中的信息可能已经有所发展或是发生改变。
</p>
</div>
<script>
daysold = Math.floor((new Date().getTime() - new Date("Sun, 10 Dec 2023 00:00:00 +0800").getTime()) / (24 * 60 * 60 * 1000));
if (daysold > 90) {
document.getElementById("outdate").style.display = "block";
document.getElementById("outime").innerHTML = daysold;
}
</script>
<hr />
<b>AI摘要</b>
<p id="ai-output">这篇文章分享了作者将树莓派4B安装和使用openFyde的体验。作者出发点是寻找适合普通用户而非专业硬件爱好者的系统因此排除了服务器版和部分GNU/Linux发行版。在选择ChromeOS或其本土化版本FydeOS时由于官方不支持树莓派作者选择了openFyde尽管安装过程复杂需要先格式化TF卡并刷入镜像且视频播放受限于硬件只支持H264解码。有趣的是虽然Linux子系统表现尚可但Android子系统存在交互设计问题如无滚轮、复制粘贴不便等。尽管性能有限尤其是视频播放不流畅但openFyde以其简洁、易于安装和对普通用户相对友好的界面被作者认为是让树莓派更适合普通用户的选择。</p>
<hr />
<ul><li><a href="#起因">起因</a></li><li><a href="#系统的选择">系统的选择</a></li><li><a href="#安装与使用体验">安装与使用体验</a></li><li><a href="#总结">总结</a></li></ul>
<hr />
<main class="post-content e-content" role="main"><p>什么样的系统用户体验更好呢?<!--more--></p>
<h1 id="起因">
<a href="#起因"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 起因
</h1>
<p>最近玩树莓派感觉有点玩腻了毕竟我不是搞硬件的人树莓派的GPIO接口对我来说毫无意义当作PC或者服务器的话性能又太差了兼容性也不太行这么看来新出的树莓派5一样对我来说毫无意义和4B一样都是垃圾。但是毕竟那个东西也挺贵的闲置也不太好因此我想在上面装上适合普通人使用的系统然后送给家里的人使用。</p>
<h1 id="系统的选择">
<a href="#系统的选择"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 系统的选择
</h1>
<p>首先服务器版的系统肯定不需要考虑了谁会用一个满是命令行的系统啊在我看来普通人使用的系统只能在Windows, MacOS, Android, ChromeOS里面选了任何GNU/Linux发行版的桌面版在我看来都不太适合普通人使用<a href="/2023/05/22/rpi-win.html">Windows之前已经试过了</a>可以说基本上没法用就是纯粹的垃圾。MacOS显然还没有什么方案可以安装至于仿MacOS的TwisterOS对于普通人来说使用难度也很大安装软件都是难事Android虽然也不是不能用但是作为桌面端系统效果还是不太行所以我觉得可能也就只有ChromeOS可以考虑一用了。 </p><p>
不过官方的ChromeOS要支持的设备才能刷树莓派显然不在其中要么就刷ChromiumOS但是那个要登谷歌账号在国内使用也不太好。幸好国内有一家对ChromeOS做了本地化的公司开发了FydeOS我看了一下如果想在树莓派上安装就只能安装FydeOS for You但那个是收费的每年要120CNY太贵了我肯定是不会考虑的。还好还有一个替代品那就是openFyde两个系统我也不太清楚有什么区别可能是云服务有所不同吧对于树莓派来说安装<a href="https://github.com/openFyde/overlay-rpi4-openfyde">rpi4-openfyde</a>就可以了另外想要安装的话最好选文件名中包含“archero”的那个才能使用Android子系统。</p>
<h1 id="安装与使用体验">
<a href="#安装与使用体验"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 安装与使用体验
</h1>
<p>第一次安装的时候我是直接把镜像用Raspberry Pi Imager刷进去的我以为它和其他的树莓派系统一样刷进去之后再配置其他东西结果并不是那个镜像是个安装包想要用的话需要先格式化TF卡然后找一个U盘把系统刷进去然后把U盘和TF卡都插入树莓派才能安装就和安装ESXi一样。 </p><p>
安装之后拔掉U盘重启就可以创建用户使用了首先作为浏览器为基础的系统我平时用浏览器可能也就是看看Bilibili吧之前我使用树莓派官方系统的浏览器看Bilibili效果非常差看看装了openFyde的效果怎么样结果令人失望效果还是一样的差主要应该还是没有硬件解码的问题吧……树莓派4B的GPU好像只支持硬件解码H264而树莓派5更是卧龙凤雏只支持H265真是有够逆天。这么说来FydeOS for You可是要每年120CNY呢这个水平的性能他们有自己测过吗就这样也能收费吗至于其他不涉及视频的网页倒是还算流畅不过毕竟GPU很垃圾有一些特殊情况还是会卡。 </p><p>
除了浏览器之外可能用的比较多的就是Android子系统了吧要是想轻度办公的话应该需要一个Office用浏览器的Office也不太好所以先安装个WPS Office试试看这个从Fyde的应用商店里就能直接安装还挺方便的。不过安装好之后效果感觉不太行首先这个Android子系统居然不支持滚轮复制粘贴都要像手机那样长按而且很多时候比如新建文档它会开两个窗口原来新建文档的窗口不会关掉……这可不像是能让人用的样子啊……而且整体使用也比浏览器卡使用起来并不顺畅。另外输入法也不是默认开启的要在设置里设置体验也不太行。 </p><p>
我试了一下那个应用商店上面的应用要么就是网页链接要么就是Android程序要么就是浏览器插件Android程序从我用了WPS Office来看不怎么抱有希望了放网页链接的我感觉有点无语😓其他系统的浏览器都能把网页当作应用这个系统反倒是直接当超链接跳过去了……至于浏览器插件那个只要是能安装浏览器就都能用吧没啥特别的。 </p><p>
虽然普通人可能用不上这个系统还有一个Linux子系统具体是什么Linux我没细看不过好像是使用容器启动的。我试了一下效果还行只是不知道为什么不能使用全部内存我使用的是8GiB的树莓派但是分配给Linux的只有6GiB存储也是分配的默认10GiB。明明都是Linux系统为什么ChromeOS要限制子系统的资源呢</p>
<h1 id="总结">
<a href="#总结"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 总结
</h1>
<p>总的用下来树莓派4B的性能可能真的就只能看看网页了连视频都不能流畅播放安装Android应用效果也很差不过有时候限制多并不是一件坏事毕竟对普通人来说如果这个性能让人不要抱有更多的希望反倒是提高了用户体验呢。虽然如果是用比如Ubuntu之类的系统能做的事情应该更多但很多情况不是普通人应该关心的事情尤其这个芯片还是ARM指令集的即使某些应用提供了Linux版也不一定能在树莓派上安装尤其这个安装很多时候也不是双击就能搞定的openFyde至少能做到真想安装Android应用的时候双击还是能安装的卡虽卡了点但是一般情况不会出现让普通人看了会看不懂的情况已经算很不错了。 </p><p>
因此我觉得如果让普通人使用树莓派安装openFyde是最好的选择了。</p></main>
<small style="display: block">tags: <a rel="category tag" class="p-category" href="/search.html?keyword=%E6%A0%91%E8%8E%93%E6%B4%BE"><em>树莓派</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=openfyde"><em>openfyde</em></a> <span style="float: right;"><a href="https://gitlab.com/mayx/mayx.gitlab.io/tree/master/_posts/2023-12-10-openfyde.md">查看原始文件</a></span></small>
<h4 style="border-bottom: 1px solid #e5e5e5;margin: 2em 0 5px;">推荐文章</h4>
<p id="suggest-container">Loading...</p>
<script>
var suggest = $("#suggest-container");
$.get(BlogAPI + "/suggest?id=/2023/12/10/openfyde.html&update=" + lastUpdated.valueOf(), function (data) {
if (data.length) {
getSearchJSON(function (search) {
suggest.empty();
var searchMap = {};
for (var i = 0; i < search.length; i++) {
searchMap[search[i].url] = search[i];
}
var tooltip = $('<div class="content-tooltip"></div>').appendTo('body').hide();
for (var j = 0; j < data.length; j++) {
var item = searchMap[data[j].id];
if (item) {
var link = $('<a href="' + item.url + '">' + item.title + '</a>');
var contentPreview = item.content.substring(0, 100);
if (item.content.length > 100) {
contentPreview += "……";
}
link.hover(
function(e) {
tooltip.text($(this).data('content'))
.css({
top: e.pageY + 10,
left: e.pageX + 10
})
.show();
},
function() {
tooltip.hide();
}
).mousemove(function(e) {
tooltip.css({
top: e.pageY + 10,
left: e.pageX + 10
});
}).data('content', contentPreview);
suggest.append(link);
suggest.append(' - ' + item.date + '<br />');
}
}
});
} else {
suggest.html("暂无推荐文章……");
}
});
</script>
<br />
<div class="pagination">
<span class="prev">
<a href="/2023/10/21/game.html">
上一篇在MacBook玩游戏的各种方法
</a>
</span>
<br />
<span class="next">
<a href="/2023/12/24/android.html">
下一篇如何在Linux容器内运行Android
</a>
</span>
</div>
<!--[if !IE]> -->
<link rel="stylesheet" href="/assets/css/gitalk.css">
<script src="/assets/js/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
var gitalk = new Gitalk({
clientID: '36557aec4c3cb04f7ac6',
clientSecret: 'ac32993299751cb5a9ba81cf2b171cca65879cdb',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '/2023/12/10/openfyde', // Ensure uniqueness and length less than 50
distractionFreeMode: false, // Facebook-like distraction free mode
proxy: "https://cors-anywhere.mayx.eu.org/?https://github.com/login/oauth/access_token"
})
gitalk.render('gitalk-container')
</script>
<!-- <![endif]-->
</section>
<!--[if !IE]> -->
<div id="landlord" style="left:5px;bottom:0px;">
<div class="message" style="opacity:0"></div>
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
<div class="live_talk_input_body">
<form id="live_talk_input_form">
<div class="live_talk_input_name_body" >
<input type="checkbox" id="load_this" />
<input type="hidden" id="post_id" value="/2023/12/10/openfyde.html" />
<label for="load_this">
<span style="font-size: 11px; color: #fff;">&#160;想问这篇文章</span>
</label>
</div>
<div class="live_talk_input_text_body">
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?" />
<button type="submit" class="live_talk_send_btn" id="talk_send">发送</button>
</div>
</form>
</div>
<input name="live_talk" id="live_talk" value="1" type="hidden" />
<div class="live_ico_box" style="display:none;">
<div class="live_ico_item type_info" id="showInfoBtn"></div>
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
<div class="live_ico_item type_music" id="musicButton"></div>
<div class="live_ico_item type_youdu" id="youduButton"></div>
<div class="live_ico_item type_quit" id="hideButton"></div>
<input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
<audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
<input id="duType" value="douqilai" type="hidden" />
</div>
</div>
<div id="open_live2d">召唤伊斯特瓦尔</div>
<!-- <![endif]-->
<footer>
<p>
<small>Made with ❤ by Mayx<br />Last updated at 2026-01-17 17:35:53<br /> 总字数614622 - 文章数178 - <a href="/atom.xml" >Atom</a> - <a href="/README.html" >About</a></small>
</p>
</footer>
</div>
<script src="/assets/js/scale.fix.js"></script>
<!--[if !IE]> -->
<script src="/assets/js/main_new.js"></script>
<script src="/Live2dHistoire/live2d/js/live2d.js"></script>
<script src="/Live2dHistoire/live2d/js/message.js"></script>
<!-- <![endif]-->
</body>
</html>

317
2023/12/24/android.html Normal file
View File

@@ -0,0 +1,317 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>如何在Linux容器内运行Android | Mayx的博客</title>
<meta name="generator" content="Jekyll v3.9.5" />
<meta property="og:title" content="如何在Linux容器内运行Android" />
<meta name="author" content="mayx" />
<meta property="og:locale" content="zh_CN" />
<meta name="description" content="原生运行Android肯定比虚拟机好" />
<meta property="og:description" content="原生运行Android肯定比虚拟机好" />
<meta property="og:site_name" content="Mayx的博客" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2023-12-24T00:00:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="如何在Linux容器内运行Android" />
<meta name="google-site-verification" content="huTYdEesm8NaFymixMNqflyCp6Jfvd615j5Wq1i2PHc" />
<meta name="msvalidate.01" content="0ADFCE64B3557DC4DC5F2DC224C5FDDD" />
<meta name="yandex-verification" content="fc0e535abed800be" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"mayx"},"dateModified":"2023-12-24T00:00:00+08:00","datePublished":"2023-12-24T00:00:00+08:00","description":"原生运行Android肯定比虚拟机好","headline":"如何在Linux容器内运行Android","mainEntityOfPage":{"@type":"WebPage","@id":"/2023/12/24/android.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://avatars0.githubusercontent.com/u/17966333"},"name":"mayx"},"url":"/2023/12/24/android.html"}</script>
<!-- End Jekyll SEO tag -->
<link rel="canonical" href="https://mabbs.github.io/2023/12/24/android.html" />
<link type="application/atom+xml" rel="alternate" href="/atom.xml" title="Mayx的博客" />
<link rel="alternate" type="application/rss+xml" title="Mayx的博客(RSS)" href="/rss.xml" />
<link rel="alternate" type="application/json" title="Mayx的博客(JSON Feed)" href="/feed.json" />
<link rel="stylesheet" href="/assets/css/style.css?v=1768642553" />
<!--[if !IE]> -->
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
<!-- <![endif]-->
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Mayx的博客" />
<link rel="webmention" href="https://webmention.io/mabbs.github.io/webmention" />
<link rel="pingback" href="https://webmention.io/mabbs.github.io/xmlrpc" />
<link rel="preconnect" href="https://summary.mayx.eu.org" crossorigin="anonymous" />
<link rel="prefetch" href="https://www.blogsclub.org/badge/mabbs.github.io" as="image" />
<link rel="blogroll" type="text/xml" href="/blogroll.opml" />
<link rel="me" href="https://github.com/Mabbs" />
<script src="/assets/js/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
var lastUpdated = new Date("Sat, 17 Jan 2026 17:35:53 +0800");
var BlogAPI = "https://summary.mayx.eu.org";
</script>
<script src="/assets/js/main.js"></script>
<!--[if !IE]> -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-137710294-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-137710294-1');
</script>
<script src="/assets/js/instant.page.js" type="module"></script>
<!-- <![endif]-->
</head>
<body>
<!--[if !IE]> --><noscript><marquee style="top: -15px; position: relative;"><small>发现当前浏览器没有启用JavaScript这不影响你的浏览但可能会有一些功能无法使用……</small></marquee></noscript><!-- <![endif]-->
<!--[if IE]><marquee style="top: -15px; position: relative;"><small>发现当前浏览器为Internet Explorer这不影响你的浏览但可能会有一些功能无法使用……</small></marquee><![endif]-->
<div class="wrapper">
<header class="h-card">
<h1><a class="u-url u-uid p-name" rel="me" href="/">Mayx的博客</a></h1>
<img src="https://avatars0.githubusercontent.com/u/17966333" fetchpriority="high" class="u-photo" alt="Logo" style="width: 90%; max-width: 300px; max-height: 300px;" />
<p class="p-note">Mayx's Home Page</p>
<form action="/search.html">
<input type="text" name="keyword" id="search-input-all" placeholder="Search blog posts.." />&#160;<input type="submit" value="搜索" />
</form>
<br />
<p class="view"><a class="u-url" href="/Mabbs/">About me</a></p>
<ul class="downloads">
<li style="width: 270px; border-right: none;"><a href="/MayxBlog.tgz">Download <strong>TGZ File</strong></a></li>
</ul>
</header>
<section class="h-entry">
<small><time class="date dt-published" datetime="2023-12-24T00:00:00+08:00">24 December 2023</time> - 字数统计1590 - 阅读大约需要5分钟 - Hits: <span id="/2023/12/24/android.html" class="visitors">Loading...</span></small>
<h1 class="p-name">如何在Linux容器内运行Android</h1>
<p class="view">by <a class="p-author h-card" href="//github.com/Mabbs">mayx</a></p>
<div id="outdate" style="display:none;">
<hr /><p>
这是一篇创建于 <span id="outime"></span> 天前的文章,其中的信息可能已经有所发展或是发生改变。
</p>
</div>
<script>
daysold = Math.floor((new Date().getTime() - new Date("Sun, 24 Dec 2023 00:00:00 +0800").getTime()) / (24 * 60 * 60 * 1000));
if (daysold > 90) {
document.getElementById("outdate").style.display = "block";
document.getElementById("outime").innerHTML = daysold;
}
</script>
<hr />
<b>AI摘要</b>
<p id="ai-output">这篇文章介绍了如何在Linux容器中使用Waydroid和redroid两种方法来运行Android系统虽然Waydroid性能较强但存在依赖于Wayland且不支持ARMT架构程序的问题需要额外安装工具。redroid支持多实例和不同安卓版本但遇到了ARM兼容库的问题特别是对Intel CPU支持不足。作者认为由于真机运行和虚拟机在性能上已经足够且Linux用户群相对较小所以容器内运行Android的需求较少。</p>
<hr />
<ul><li><a href="#起因">起因</a></li><li><a href="#试用waydroid">试用Waydroid</a></li><li><a href="#试用redroid">试用redroid</a></li><li><a href="#总结">总结</a></li></ul>
<hr />
<main class="post-content e-content" role="main"><p>原生运行Android肯定比虚拟机好<!--more--></p>
<h1 id="起因">
<a href="#起因"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 起因
</h1>
<p>前段时间我在树莓派上安装了<a href="/2023/12/10/openfyde.html">openFyde</a>后来发现原来它的ArcHero安卓子系统是基于anbox开发的和ChromeOS的安卓子系统有一些区别至于区别在哪我也不是特别清楚。不过既然它的安卓子系统和Linux直接安装的没啥区别那不如我试试看在普通的Linux上安装容器化的安卓系统效果怎么样</p>
<h1 id="试用waydroid">
<a href="#试用waydroid"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 试用Waydroid
</h1>
<p>最开始我测试的是<a href="https://github.com/waydroid/waydroid">Waydroid</a>因为听说anbox的升级版就是Waydroid据说性能比anbox强所以想试试看安装挺简单的执行个脚本之后用apt就能安装。不过我的测试平台是Ubuntu Server 20.04LTSWaydroid之所以叫这个名字是因为它要基于Wayland显示服务器运行可我是无界面的系统要怎么用它啊Waydroid好像没有无头模式这种东西不过我搜了一下weston实现了Wayland协议而且支持无头模式用法也很简单安装好weston之后执行<code class="language-plaintext highlighter-rouge">weston --backend=headless-backend.so</code>就可以了。 </p><p>
不过默认安装好的Waydroid不能运行ARM架构的程序似乎是因为libhoudini之类的库是有版权的所以不能直接集成不过还好有人开发了一个<a href="https://github.com/casualsnek/waydroid_script">工具包</a>可以给Waydroid安装包括libhoudini在内的多个因为版权等原因不能直接在项目里使用的程序而且操作起来也很简单体验还不错。 </p><p>
至于怎么查看界面因为是无头模式启动的所以没有界面只能通过adb查看不过我试了一下scrcpy不知道为什么不能用但是用Airtest就能看到界面就挺奇怪的……还有就是分辨率很低不过这个应该改weston的启动参数就可以改分辨率了吧但因为后来发现Waydroid不能开多个实例感觉有点废物就没有在继续研究了。 </p><p>
不过总的来看如果是在桌面版的Linux上而且界面是使用Wayland协议的效果应该会比较好好像Ubuntu22.04以上的系统默认会使用Wayland在这个系统上面使用Waydroid效果应该比在Windows上使用WSA的效果还要好。毕竟这可不是虚拟机运行而是使用容器技术原生运行的如果有机会的话还是值得一用的。</p>
<h1 id="试用redroid">
<a href="#试用redroid"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 试用redroid
</h1>
<p>因为Waydroid不能开多个实例所以我搜了一下有没有类似技术而且能开多个实例的结果就找到了<a href="https://github.com/remote-android">redroid</a>。安装也很简单执行几个命令修改下内核模块然后直接用docker pull个镜像就可以用而且这个切换版本比Waydroid简单Waydroid想换别的安卓版本要自己整镜像不然就只能用基于Android 11的LineageOSredroid可以按镜像的版本号选择希望使用的安卓版本而且我测试了一下redroid是可以使用scrcpy连接的看起来效果还不错。 </p><p>
但是我试了一下运行一些ARM的安卓程序会出现闪退的情况我以为是因为没有ARM兼容库的问题但是文档上写的镜像里面已经自带了libndk……这么看来可能是因为libndk的兼容性不太行啊另外libndk好像是给AMD的CPU使用的我用的CPU是Intel的Intel应该用libhoudini才对然而我找了半天也没有找到怎么让redroid使用libhoudini……真是令人失望啊。</p>
<h1 id="总结">
<a href="#总结"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 总结
</h1>
<p>看来在容器内运行Android系统的需求还是太少了很多问题都没人解决……不过想想也是那些搞云手机的大多直接拿真机运行Android用兼容层的性能损耗也很大而服务器级别的ARM芯片也不便宜…… </p><p>
另外就是使用Linux的人也很少而且像那些在Windows上玩安卓游戏的人都是用的虚拟机性能也都够用了毕竟那么高功率的桌面端CPU怎么样都比超低功率的手机CPU强啊所以容器内运行Android的需求比较少可能也很正常吧……</p></main>
<small style="display: block">tags: <a rel="category tag" class="p-category" href="/search.html?keyword=Linux"><em>Linux</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=Android"><em>Android</em></a> <span style="float: right;"><a href="https://gitlab.com/mayx/mayx.gitlab.io/tree/master/_posts/2023-12-24-android.md">查看原始文件</a></span></small>
<h4 style="border-bottom: 1px solid #e5e5e5;margin: 2em 0 5px;">推荐文章</h4>
<p id="suggest-container">Loading...</p>
<script>
var suggest = $("#suggest-container");
$.get(BlogAPI + "/suggest?id=/2023/12/24/android.html&update=" + lastUpdated.valueOf(), function (data) {
if (data.length) {
getSearchJSON(function (search) {
suggest.empty();
var searchMap = {};
for (var i = 0; i < search.length; i++) {
searchMap[search[i].url] = search[i];
}
var tooltip = $('<div class="content-tooltip"></div>').appendTo('body').hide();
for (var j = 0; j < data.length; j++) {
var item = searchMap[data[j].id];
if (item) {
var link = $('<a href="' + item.url + '">' + item.title + '</a>');
var contentPreview = item.content.substring(0, 100);
if (item.content.length > 100) {
contentPreview += "……";
}
link.hover(
function(e) {
tooltip.text($(this).data('content'))
.css({
top: e.pageY + 10,
left: e.pageX + 10
})
.show();
},
function() {
tooltip.hide();
}
).mousemove(function(e) {
tooltip.css({
top: e.pageY + 10,
left: e.pageX + 10
});
}).data('content', contentPreview);
suggest.append(link);
suggest.append(' - ' + item.date + '<br />');
}
}
});
} else {
suggest.html("暂无推荐文章……");
}
});
</script>
<br />
<div class="pagination">
<span class="prev">
<a href="/2023/12/10/openfyde.html">
上一篇rpi4-openfyde的使用体验
</a>
</span>
<br />
<span class="next">
<a href="/2024/01/01/summary.html">
下一篇:年终总结
</a>
</span>
</div>
<!--[if !IE]> -->
<link rel="stylesheet" href="/assets/css/gitalk.css">
<script src="/assets/js/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
var gitalk = new Gitalk({
clientID: '36557aec4c3cb04f7ac6',
clientSecret: 'ac32993299751cb5a9ba81cf2b171cca65879cdb',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '/2023/12/24/android', // Ensure uniqueness and length less than 50
distractionFreeMode: false, // Facebook-like distraction free mode
proxy: "https://cors-anywhere.mayx.eu.org/?https://github.com/login/oauth/access_token"
})
gitalk.render('gitalk-container')
</script>
<!-- <![endif]-->
</section>
<!--[if !IE]> -->
<div id="landlord" style="left:5px;bottom:0px;">
<div class="message" style="opacity:0"></div>
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
<div class="live_talk_input_body">
<form id="live_talk_input_form">
<div class="live_talk_input_name_body" >
<input type="checkbox" id="load_this" />
<input type="hidden" id="post_id" value="/2023/12/24/android.html" />
<label for="load_this">
<span style="font-size: 11px; color: #fff;">&#160;想问这篇文章</span>
</label>
</div>
<div class="live_talk_input_text_body">
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?" />
<button type="submit" class="live_talk_send_btn" id="talk_send">发送</button>
</div>
</form>
</div>
<input name="live_talk" id="live_talk" value="1" type="hidden" />
<div class="live_ico_box" style="display:none;">
<div class="live_ico_item type_info" id="showInfoBtn"></div>
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
<div class="live_ico_item type_music" id="musicButton"></div>
<div class="live_ico_item type_youdu" id="youduButton"></div>
<div class="live_ico_item type_quit" id="hideButton"></div>
<input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
<audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
<input id="duType" value="douqilai" type="hidden" />
</div>
</div>
<div id="open_live2d">召唤伊斯特瓦尔</div>
<!-- <![endif]-->
<footer>
<p>
<small>Made with ❤ by Mayx<br />Last updated at 2026-01-17 17:35:53<br /> 总字数614622 - 文章数178 - <a href="/atom.xml" >Atom</a> - <a href="/README.html" >About</a></small>
</p>
</footer>
</div>
<script src="/assets/js/scale.fix.js"></script>
<!--[if !IE]> -->
<script src="/assets/js/main_new.js"></script>
<script src="/Live2dHistoire/live2d/js/live2d.js"></script>
<script src="/Live2dHistoire/live2d/js/message.js"></script>
<!-- <![endif]-->
</body>
</html>