作者 Hongli Lai 看着像是华人,可惜没找到文章的中文版本,于是就很土鳖地手翻了一遍。文章的措辞很口语化,因此意译为主。点击这里可以阅读原文。
在构建 Docker 容器时,我们需要注意子进程的“僵尸化”问题(PID 1 Zombie Reaping Problem)。这会导致不可预知的和看起来匪夷所思的问题。本文解释了这个问题,也解释了如何去解决,并提供了一种预构建方案:Baseimage-docker 。
作者 Hongli Lai 看着像是华人,可惜没找到文章的中文版本,于是就很土鳖地手翻了一遍。文章的措辞很口语化,因此意译为主。点击这里可以阅读原文。
在构建 Docker 容器时,我们需要注意子进程的“僵尸化”问题(PID 1 Zombie Reaping Problem)。这会导致不可预知的和看起来匪夷所思的问题。本文解释了这个问题,也解释了如何去解决,并提供了一种预构建方案:Baseimage-docker 。
if (typeof absolutePosition == "undefined") { | |
// Discovered here: http://stackoverflow.com/a/32623832/867154 | |
// Many thanks to @RoboCat! | |
function absolutePosition (el) { | |
var found, left = 0, top = 0, width = 0, height = 0, offsetBase = absolutePosition.offsetBase; | |
if (!offsetBase && document.body) { | |
offsetBase = absolutePosition.offsetBase = document.createElement('div'); | |
offsetBase.style.cssText = 'position:absolute;left:0;top:0'; |
替换上你的ID, Token, domain, sub_domain
就可以运行了。(ID,Token) 可以从 API 鉴权方式升级为 Token 获得。
脚本会在后台一直运行,初始化时会根据 sub_domain
查询是否已经创建,每隔30秒检查一遍IP,如果修改了就更新IP。
以 Archlinux 为例,按照如下步骤操作即可设置开机启动这个 DDNS 服务。
sudo wget -O /usr/local/bin/dnspod_ddns.py https://gist.github.com/billryan/239778f0821937939c8c140bdddd6840/raw/dnspod_ddns.py
sudo chmod +x /usr/local/bin/dnspod_ddns.py
sudo wget -O /etc/systemd/system/dnspod-ddns.py.service https://gist.github.com/billryan/239778f0821937939c8c140bdddd6840/raw/dnspod-ddns.service
sudo systemctl start dnspod-ddns
<?php | |
namespace App\ActiveRecord; | |
class PostRepository | |
{ | |
private $cache; | |
public function __construct(Cache $cache) | |
{ | |
// Any set() / get() cache implementation. |
package main | |
import ( | |
"bytes" | |
"crypto/aes" | |
"crypto/cipher" | |
b64 "encoding/base64" | |
"errors" | |
"fmt" | |
"log" |
mholt [9:10 AM] | |
When using http.Get(), is it really necessary to read the full response body just to close it later? | |
[9:10] | |
The docs keep saying `Caller should close resp.Body when done reading from it.` and I keep seeing code like this: | |
``` | |
io.Copy(ioutil.Discard, resp.Body) | |
resp.Body.Close() | |
``` |