This commit is contained in:
2025-12-31 16:00:29 +00:00
commit 3688f93d5d
310 changed files with 93400 additions and 0 deletions

340
2022/02/14/move.html Normal file
View File

@@ -0,0 +1,340 @@
<!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的博客分发方案 | Mayx的博客</title>
<meta name="generator" content="Jekyll v3.9.5" />
<meta property="og:title" content="Mayx的博客分发方案" />
<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="2022-02-14T00:00:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="Mayx的博客分发方案" />
<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":"2022-02-14T00:00:00+08:00","datePublished":"2022-02-14T00:00:00+08:00","description":"无论什么资料,都有保存的价值!","headline":"Mayx的博客分发方案","mainEntityOfPage":{"@type":"WebPage","@id":"/2022/02/14/move.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://avatars0.githubusercontent.com/u/17966333"},"name":"mayx"},"url":"/2022/02/14/move.html"}</script>
<!-- End Jekyll SEO tag -->
<link rel="canonical" href="https://mabbs.github.io/2022/02/14/move.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=1767196818" />
<!--[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("Thu, 01 Jan 2026 00:00:18 +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="2022-02-14T00:00:00+08:00">14 February 2022</time> - 字数统计2342 - 阅读大约需要7分钟 - Hits: <span id="/2022/02/14/move.html" class="visitors">Loading...</span></small>
<h1 class="p-name">Mayx的博客分发方案</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, 14 Feb 2022 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封禁博客而失去信任决定建立博客分发和备份方案的过程。作者选择Gitlab作为源代码托管平台因为它支持自动推送和拉取且没有被墙Web IDE体验良好且有中文界面。部署方面作者在多个平台如Cloudflare Pages和Vercel上设置部署并提供了全站下载选项。作者还计划实现博客的自动化发布和分布式备份以提高博客的长期存续性和匿名性。最后作者提到会更换Github Pages的默认域名以解决部分地区访问问题并考虑更换评论系统。</p>
<hr />
<ul><li><a href="#起因">起因</a></li><li><a href="#方案">方案</a><ul><li><a href="#源代码托管平台的选择">源代码托管平台的选择</a></li><li><a href="#部署平台的选择">部署平台的选择</a></li></ul></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>在今年年初,<a href="/2022/01/04/banned.html">Github封禁了我的博客</a>因此我也对Github失去了信任。之前因为信任的关系我几乎不会在其他地方备份我的博客发生了这种事情之后我才明白这并不可靠虽然我有时候会把我的博客整站隔段时间手动下载下来但是这样实时性不高。其实我也不是不会做自动化方案只是因为懒就像这篇文章一样分发我在上个月就已经完成了现在才在这里写文章……</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="/2021/08/15/blog.html">研究博客平台的时候</a>已经调查过很多放静态站的平台了,所以这次进行分发的时候有了之前的经验,也简单了不少。</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>因为Github不可信于是我自然想到了用Gitlab来存放博客源代码。虽然吧Gitlab曾经也发生过用户数据丢失的问题不过反正目标也是同时放在Github和Gitlab上总不至于两个一起炸吧。其实最开始我的计划是用Github Actions进行同步不过在我进行调查之后我发现Gitlab功能还是挺强大的它支持对一个Git仓库进行自动的推送和拉取也不需要做过多的配置就只需要配置个地址和令牌就可以还是挺方便的。 </p><p>
在我做完Github与Gitlab双向同步之后我发现Gitlab还挺好用的首先Gitlab有个很棒的地方就是没被墙我有时候写文章的时候不挂梯子用Github真的是非常难受目前依我所感受防火长城会对Github先进行一下TCP RST然后刷新一下让你连上连上之后如果长连接断开或者大概5分钟的样子就再阻断然后再RST一波非常的挑战心态。有时候我写了半天然后点预览结果就阻断等半天还是连不上还要挂梯子能预览的时候就得赶紧提交万一提交的时候再阻断要是没备份就炸了。像Gitlab我就从来没遇到过类似的情况这一点还是很不错的大概是因为Gitlab不是社区而且滥用的人也少所以政府也不太关心吧。 </p><p>
另外就是Web IDE相比Github的VSCode Web IDEGitlab的要轻量很多了也不容易发生卡的情况而且其实Github的VSCode Web IDE也装不了几个插件功能上也没强到哪去。 </p><p>
还有就是翻译明明用Github的中国人/华人挺多的官方就是不出中文界面明明文档都有中文了……Gitlab可能是因为作为一个开源产品i18n做的很好虽然吧英文也不影响我使用但是毕竟作为用户体验的一项Gitlab做的确实更好。 </p><p>
不过其实我觉得Gitlab也许只是表面没那么出名毕竟不是做社区的大多数公司都用的是自建Gitlab托管代码而且很多时候Github其实是在抄Gitlab的虽然最早是Gitlab抄Github比如Actions抄CI/CD还有最近又出的一堆什么代码扫描和检查Gitlab出现的都更早。不过这说着也跑题了这个文章又不是为了专门夸Gitlab的😂。</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>源代码平台整完之后就是部署平台了除了Github和Gitlab上自己的Pages上各部署了一份另外我也在Cloudflare Pages和Vercel上面也设置了部署以后我也可能增加更多的部署和备份平台具体目前可以参考<a href="/proxylist.html">代理列表</a></p><p>
在部署的时候目前我也增加了一些新的东西比如下载全站的按钮原来我是想把源代码和生成后的代码合到一起下载不过没想到Cloudflare Pages竟然不能上传超过25MiB的文件所以没办法我只好光放下载全站的按钮。不过我也有做判断如果是Github生成的代码会放Github的下载链接因为Github Pages生成没办法使用脚本也没法打包全站代码其他部署因为支持的多所以我就写了一个脚本来进行打包一是方便在Wayback Machine保存我的全站代码二是希望能通过这种方式让有兴趣的人帮助我来备份我的博客。 </p><p>
另外为什么是生成后的代码呢因为如果用源代码要考虑很多依赖的项目会不会炸比如Ruby、Jekyll、还有各种插件和模板如果未来的某个时候它们其中有一个炸了那么感兴趣的人就没办法再构建我的博客了。 </p><p>
在此之后也算是激发了我对博客代码修改的灵感比如我改了下博客分页器现在就没那么凌乱使用select标签就更加简洁了。</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>之后我会想办法在Blogger之类的平台整个自动化发布脚本还有就是上链啥的不过上ETH这种公链的成本实在是太高了我要是想把我的博客全部上传到公链上估计得要上百万CNY了吧……而且也没法编辑回头看看能不能整个分布式社区让大家的独立博客互相备份。另外这也是我之后想做的计划的一部分我想整一个开放的匿名解决方案比如整一个“OpenAnonymous”的项目分布式在一定程度上能大幅提高追踪成本其实在社会中就像谣言一样为什么说“造谣一张嘴,辟谣跑断腿”?其实也是因为分布式的特性,对于已经散播的信息很难溯源,也很难制止。 </p><p>
总之希望作为Mayx Forever Project的载体——Mayx的博客能在我有生之年想出合理的方案存在1000年吧</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>刚才在Gitlab上发布了文章之后我不知道Github Pages这里又犯什么神经病没有给我构建所以我又想到了些东西在这里补充一下 </p><p>
Github Pages还有个地方让我比较难受那就是Github Pages的默认域名在有些运营商会被屏蔽我不知道是DNS的问题还是啥总之这样我有时候发文章之后其他人就看不到了所以现在我以后常用的域名也打算改了我目前决定使用 <a href="https://mayx.eu.org">https://mayx.eu.org</a> ,好听也好记。 </p><p>
另外还有个比较难受的地方就是我的博客目前用的评论系统是Gitalk这个是依赖Github的之前评论全炸这个我也是非常难受我之后再想想办法改一下评论系统吧。</p></main>
<small style="display: block">tags: <a rel="category tag" class="p-category" href="/search.html?keyword=Mayx"><em>Mayx</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=Github"><em>Github</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=Gitlab"><em>Gitlab</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=%E5%88%86%E5%8F%91"><em>分发</em></a> <span style="float: right;"><a href="https://gitlab.com/mayx/mayx.gitlab.io/tree/master/_posts/2022-02-14-move.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=/2022/02/14/move.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/01/16/wssocks.html">
上一篇wssocks的简单评测
</a>
</span>
<br />
<span class="next">
<a href="/2022/02/15/termux.html">
下一篇在平板上使用Termux的经历
</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: '/2022/02/14/move', // 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="/2022/02/14/move.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-01 00:00:18<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>

331
2022/02/15/termux.html Normal file
View File

@@ -0,0 +1,331 @@
<!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>在平板上使用Termux的经历 | Mayx的博客</title>
<meta name="generator" content="Jekyll v3.9.5" />
<meta property="og:title" content="在平板上使用Termux的经历" />
<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="2022-02-15T00:00:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="在平板上使用Termux的经历" />
<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":"2022-02-15T00:00:00+08:00","datePublished":"2022-02-15T00:00:00+08:00","description":"更好的利用闲置的设备吧!","headline":"在平板上使用Termux的经历","mainEntityOfPage":{"@type":"WebPage","@id":"/2022/02/15/termux.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://avatars0.githubusercontent.com/u/17966333"},"name":"mayx"},"url":"/2022/02/15/termux.html"}</script>
<!-- End Jekyll SEO tag -->
<link rel="canonical" href="https://mabbs.github.io/2022/02/15/termux.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=1767196818" />
<!--[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("Thu, 01 Jan 2026 00:00:18 +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="2022-02-15T00:00:00+08:00">15 February 2022</time> - 字数统计2076 - 阅读大约需要7分钟 - Hits: <span id="/2022/02/15/termux.html" class="visitors">Loading...</span></small>
<h1 class="p-name">在平板上使用Termux的经历</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, 15 Feb 2022 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">这篇文章描述了作者在平板电脑上使用Termux的实验经历。起初出于专业需求作者想要验证Android平板能否作为Linux环境的替代品特别关注了远程桌面和SSH解决方案。经过一年的测试发现Termux是一个可行的方案可以安装各种Linux软件如Python、Django等。然而由于硬件限制如老旧的处理器、屏幕常关导致程序无法运行、软件兼容性问题尤其是在国内使用时以及版本更新带来的问题如源问题和官网下载限制作者在使用过程中遇到不少挑战。为改善体验作者做了额外的配置如创建额外的键位和安装Linux发行版。总的来说作者认为Termux是利用闲置Android设备的有效方式使得旧设备的使用价值得到提升。</p>
<hr />
<ul><li><a href="#起因">起因</a></li><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>在去年我的同学买了一块Android的平板电脑因为我的专业主要需要使用Linux系统平时学习也需要用到电脑所以也是想做一个实验想验证一下Android系统的平板能不能在一定程度上替代电脑。虽然笔记本电脑不算很重但是如果说平板就能替代笔记本电脑那么使用的时候也会更加方便吧而且平板的续航一般也比笔记本电脑好我觉得如果实验能成功其实做一个这样的方案也不错。 </p><p>
我手头也正好有些闲置的平板不过去年因为在Alpha实验阶段所以我平时上课还是用的电脑。最终对同学进行经过一年左右的测试我感觉这个方案是个不错的选择而且随着ARM服务器的盛行也不需要担心软件包因为架构的原因不能用的问题。</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="/2021/09/28/cloudgame.html">玩云游戏</a>那样很多时候很考验心态动不动就会卡包括使用SSH的方案也差不多虽然SSH可能对网络的要求更小一点但是问题在于SSH连接的假如是内网服务器需要看一些Web项目的效果会很麻烦。所以在最终我选定了Termux来作为实际实验的方案。 </p><p>
最终体验效果还是挺不错的平时使用各种需要的东西基本上都不受限制比如Python、Django、Jupyter、Ansible之类的只要是电脑上Linux能装的软件Termux都可以装而且运行效果也还不错这也多亏了那些ARM服务器和树莓派对ARM的大力支持。不过有时候一些定制化的系统导致的一些限制也比较烦国内的定制系统很多对后台程序限制很严格而且一般屏幕一关掉程序就没法执行了导致某些情况下体验不是很好不过还好绝大多数情况这些限制都是可以调整的用的话还是可以用的。 </p><p>
接下来我打算把实验推到Beta阶段在这个阶段我打算用上我闲置的平板验证各种情况下使用平板来进行各种操作。</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的版本也比较高另外处理器也是ARM架构的但是我的平板不是新的闲置的平板Android版本也比较低处理器还是个X86架构的这导致我在一些操作中和同学的操作不一样。 </p><p>
从Termux v0.73开始它的Android兼容性要求变成了Android 7.0+可是我的平板是Android 5.0的所以我只好下载Termux v0.72用。不过这个这个版本用的时候问题好像还挺多的,最开始我为了下载包快一些换了源,但是不知道为什么用国内镜像源怎么都会出错,下载的包会直接没法运行,后来没办法就只能用官方源。不过官方源也会出点问题,在<code class="language-plaintext highlighter-rouge">/etc/apt/source.list.d/</code>中有一些已经炸掉的源,在执行<code class="language-plaintext highlighter-rouge">apt update</code>之前要把这里面所有的文件都删掉,另外删掉之后执行<code class="language-plaintext highlighter-rouge">apt upgrade</code>之后那个文件夹里面的文件又会出现,所以还得再删一次。 </p><p>
2022.06.05更新由于官网termux.net已经彻底炸了以后Android 7.0以下安装不能再安装这个需要在线下载bootstrap的版本了可以去Archive.org上下载<a href="https://archive.org/details/termux-repositories-legacy">其他人上传的离线版</a> ,另外源的话可以用<a href="https://github.com/UtermuxBlog/termux-android5-repo">这个</a>提供的源。 </p><p>
不过用官方源也不是办法在国内用还是速度慢而且Termux的源里面软件也比较少所以想了想还是装Linux发行版比较好。不过旧版的Termux不像新版那样可以安装proot-distro直接一键安装Linux发行版旧版要想用只能用AnLinux安装。结果AnLinux也还有些问题他们把资源都保存到Github上了但是Github在国内下载raw是完全没办法的结果我就只能在电脑上提前在<a href="https://github.com/EXALAB/Anlinux-Resources">AnLinux资源仓库</a>里面下载好需要的脚本和镜像,然后再传到平板上进行安装。 </p><p>
在安装了发行版之后换源安装软件就不会再出问题了在那个上面可以随便安装最新的软件包。我安装了一套Python和Jupyter都可以正常运行接下来如果可以的话就让我试试看平板使用Termux效果如何吧。</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>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">mkdir</span> ~/.termux <span class="o">&amp;&amp;</span> <span class="nb">echo</span> <span class="s2">"extra-keys = [['ESC','/','-','HOME','UP','END','PGUP'],['TAB','CTRL','ALT','LEFT','DOWN','RIGHT','PGDN']]"</span> <span class="o">&gt;</span> ~/.termux/termux.properties
</code></pre></div></div>
<p>然后重启Termux就可以在键盘上方出现需要的大多数按键感觉效果还不错。</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="/2020/03/08/oldphone.html">怎样更好的利用旧手机</a>现在如果用了Termux效果就更好了之前想要安装Web环境用的还是KSWEB的方案现在的话想安什么环境就和操作电脑和服务器一样简单了。无论如何旧设备还是用起来更好闲置确实就毫无意义了不如回收掉或者换盆啥的。</p></main>
<small style="display: block">tags: <a rel="category tag" class="p-category" href="/search.html?keyword=Termux"><em>Termux</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/2022-02-15-termux.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=/2022/02/15/termux.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/02/14/move.html">
上一篇Mayx的博客分发方案
</a>
</span>
<br />
<span class="next">
<a href="/2022/03/12/alpine.html">
下一篇Alpine的使用体验
</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: '/2022/02/15/termux', // 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="/2022/02/15/termux.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-01 00:00:18<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>