爷青回——运用Docker来部署Emulatorjs

人一忙就容易变懒,距离上次更新博文已经超过一年,在这一年里,无需赘言,我们都经历了太多。我逐渐感受到成长给人留下的印记,不但不再有什么个人追求,对于横空而来的各种负担,我们都习惯了坦然面对,连呻吟都是多余了。

Anyway,前段时间通过frps自托管了两台主机,内存插到满,一台装了个Kali,顺道部署了和孩子一起玩的Minecraft服务,另一台装了Ubuntu Server以后一直闲置,在逛一个叫做awesome-selfhosted的github的时候,发现了一个很不错的publisher,叫linuxserver,这个组织维护着大量docker镜像,主要为自建服务的用户提供方便,他们的一个容器瞬间引起了我的注意。

碉堡了有没有

于是立即着手pull,拖下来这个镜像以后,研究了一番文档,按照官方给的docker-cli运行:

docker run -d \
--name=emulatorjs \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Asia/Shanghai \
-e SUBFOLDER=/ #optional \
-p 3000:3000 \
-p 80:80 \
-p 4001:4001 #optional \
-v /path/to/config:/config \
-v /path/to/data:/data \
--restart unless-stopped \
lscr.io/linuxserver/emulatorjs:latest

跑起来了,注意那个80:80如果你没有国内备案主机的话,需要修改端口,登上3000的后台,要我通过内建的IPFS服务下载前端的美术素材,点了Download没有反应,一直卡在下载NDS.mp4这个文件,一开始怀疑是IPFS的问题,又去研究容器内科学上网,折腾一番以后容器里已经可以curl到科学IP,可是还是卡这个下载,于是用netstat看容器里的链接情况,连接各种peers没有问题,又在容器内部试了下IPFSdaemon的自测功能,发现可以抓下文件,映射的两个目录data和config也都通过chmod改了权限,PUID/PGID也调整过了,这就很费解么?去discord提问,无解,搜了半天发现只有一个人提问遇到有类似问题,但是似乎答案也不明确。继续回去爬官方文档,直到发现:

Umask for running applications
For all of our images we provide the ability to override the default umask settings for services started within the containers using the optional -e UMASK=022 setting. Keep in mind umask is not chmod it subtracts from permissions based on it's value it does not add. Please read up here before asking for support.

这段说明似乎每一个linuxserver的发行里都有,从来没有特别注意过,由于不是linux专业用户,对于这些复杂概念也没有了解,本着死马活马都能吃的原则,在docker-cli里加入这行参数,下载成功!Voila~~~

接下来是补充,这个容器本身没有身份校验的模块,如果担心好事者搞乱你辛苦肝来RPG的存档,你可以尝试自己在docker内置的nginx里加两行验证。

对于几乎在每一台客户端都部署retrogaming然而极少玩耍的我而言,这个host的意义是显而易见的,你终于可以整合你的碎片时间,交替利用各种不同的terminal,肝完对于过去,对于现在,包括将来而言都极为奢侈的RPG大作。

感谢linuxserver和原作ethanobrien,愿你和我永远年轻。

Vaping e-cig online sale now banned in China

The recent order came from the bureau of tobacco monopoly in China urges taobao and other online biz platform to ban the shop from selling vaping related goodies.

Although it’s not clear if such monopoly bureau has the power to urge taobao, or to ban a non-tobacco product, the emerging of this smoking alternative clearly hit the tobacco consuming market and as a consequence, the revenue of the industry and the government.

The government tried to pose as this order is meant to protect the youth from getting vaping device, they surely forget to say what they have done on traditional tobacco prevention. And they quote the example took place in several states of the U.S, “abusing vaping could be fatal” as they cited, ignoring the people were actually vaping the THC.

It’s just another example that i found irony on our government, for this time, i choose to quit smoking burning cigarettes, for the clear reason and with a much stronger determination.

Twilight Zone Review S01E01

 

Basically my hunches on s01e01 the Comedian are like the hidden referring to Amusing Ourselves to Death: Public Discourse in the Age of Show Business, and maybe Death Note (actually it’s easier for Wassen by just saying their names). With all due respect, but i will say this adaption from the original episode is not quite successful. Like if the plot is meant to have a moral ending at a cost of logical integrity, Why not try introducing JC Wheeler at the very end ? Everything would be back to normal after his vanish, and Samir would learn his lesson too, and alive. Maybe I am just too smart to be a screenplay critic.