<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Saltbo</title>
        <link>https://saltbo.cn</link>
        <description>A laboratory of saltbo</description>
        <lastBuildDate>Sat, 01 Feb 2025 07:10:23 GMT</lastBuildDate>
        <docs>http://blogs.law.harvard.edu/tech/rss</docs>
        <generator>https://github.com/webmasterish/vuepress-plugin-feed</generator>
        <atom:link href="https://saltbo.cn/feed.atom" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[基于Docker搭建开发测试环境--网络·缓存]]></title>
            <link>https://saltbo.cn/posts/docker-net-cache.html</link>
            <guid>https://saltbo.cn/posts/docker-net-cache.html</guid>
            <pubDate>Fri, 14 Jul 2017 17:00:00 GMT</pubDate>
            <description><![CDATA[Docker 网络类型 docker 有三种网络类型 bridge、host、none，默认 bridge。bridge 的意思是容器拥有独立的网络环境通…]]></description>
            <enclosure url="https://saltbo.cn/images/posts/docker-net-cache/static.saltbo.cn_1240.png">
            </enclosure>
        </item>
        <item>
            <title><![CDATA[使用buffer对象池（sync.Pool）需要着重关注引用问题]]></title>
            <link>https://saltbo.cn/posts/golang-buffer-pool.html</link>
            <guid>https://saltbo.cn/posts/golang-buffer-pool.html</guid>
            <pubDate>Sat, 09 May 2020 17:00:00 GMT</pubDate>
            <description><![CDATA[为了解决丢 body 的问题，我们只能改为使用 buffer。具体的实现如下：]]></description>
        </item>
        <item>
            <title><![CDATA[Hello Markdown Blog]]></title>
            <link>https://saltbo.cn/posts/hello-markdown.html</link>
            <guid>https://saltbo.cn/posts/hello-markdown.html</guid>
            <pubDate>Sun, 31 Dec 2000 17:00:00 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[net.http三个坑的总结]]></title>
            <link>https://saltbo.cn/posts/golang-nethttp.html</link>
            <guid>https://saltbo.cn/posts/golang-nethttp.html</guid>
            <pubDate>Sat, 21 Apr 2018 17:00:00 GMT</pubDate>
            <description><![CDATA[// For client requests Host optionally overrides the Host
// header to send. If empty, the Request.Write method uses
// the value of URL.Host. Host may contain an international
// domain name.
Host string
`]]></description>
        </item>
        <item>
            <title><![CDATA[爬小黄图的第一步--HTTP协议]]></title>
            <link>https://saltbo.cn/posts/http.html</link>
            <guid>https://saltbo.cn/posts/http.html</guid>
            <pubDate>Sat, 02 Apr 2016 17:00:00 GMT</pubDate>
            <description><![CDATA[其实爬虫就是一个根据一定的规则发送 HTTP 请求的小程序。
  现在你知道 HTTP 的重要性了吧？
  下面我们就来讲解下 HTTP 协议。
  什么？你不要听？没意思？那么如果我告诉你利用爬虫还可以爬小黄图呢？是不是已经迫不及待了呢？
  咳咳咳~
  不要乱想了！
  还是先来学 HTTP 吧！！！
  昨天已经说过了，HTTP 协议主要分为两部分，Request 和 Response，下面我们一个一个来讲解下。]]></description>
        </item>
        <item>
            <title><![CDATA[Uptoc - 将你的Hugo静态博客部署到阿里云OSS上]]></title>
            <link>https://saltbo.cn/posts/hugo-uptoc-oss.html</link>
            <guid>https://saltbo.cn/posts/hugo-uptoc-oss.html</guid>
            <pubDate>Sat, 26 Oct 2019 17:00:00 GMT</pubDate>
            <description><![CDATA[image-20191027142908681
现在只需要在你的.travis.yml 中增加如下配置就完成了]]></description>
            <enclosure url="https://saltbo.cn/images/posts/hugo-uptoc-oss/static.saltbo.cn_image-20191027124716113.png">
            </enclosure>
        </item>
        <item>
            <title><![CDATA[K8S的client-go与informer机制]]></title>
            <link>https://saltbo.cn/posts/nmg-client-go-&amp;&amp;-informer.html</link>
            <guid>https://saltbo.cn/posts/nmg-client-go-&amp;&amp;-informer.html</guid>
            <pubDate>Wed, 09 Feb 2022 17:00:00 GMT</pubDate>
            <description><![CDATA[https://github.com/kubernetes/client-go/tree/master/examples]]></description>
            <enclosure url="https://saltbo.cn/images/posts/nmg-client-go%20&amp;&amp;%20informer/prod-files-secure.s3.us-west-2.amazonaws.com_59f9c088-3594-4dc7-ba6f-9e0737d6bb22.png">
            </enclosure>
        </item>
        <item>
            <title><![CDATA[如何自定义Sidecar及设置Sidecar的日志]]></title>
            <link>https://saltbo.cn/posts/nmg-customization-sidecar.html</link>
            <guid>https://saltbo.cn/posts/nmg-customization-sidecar.html</guid>
            <pubDate>Thu, 06 Jan 2022 17:00:00 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[写在学习golang一个月后]]></title>
            <link>https://saltbo.cn/posts/learn-golang.html</link>
            <guid>https://saltbo.cn/posts/learn-golang.html</guid>
            <pubDate>Sat, 22 Apr 2017 17:00:00 GMT</pubDate>
            <description><![CDATA[由于 PHP 没有连接池，当高并发时就会有大量的数据库连接直接冲击到 MySQL 上，最终导致数据库挂掉。虽然 Swoole 有连接池，但是 Swoole 只是 PHP 的一个扩展，之前使用 Swoole 过程中就踩过很多的坑。经过我们的讨论还是觉得使用 Golang 更加可控一些。]]></description>
        </item>
        <item>
            <title><![CDATA[Shell中exec和eval的区别]]></title>
            <link>https://saltbo.cn/posts/nmg-different-of-exec-and-eval.html</link>
            <guid>https://saltbo.cn/posts/nmg-different-of-exec-and-eval.html</guid>
            <pubDate>Sat, 08 Jan 2022 17:00:00 GMT</pubDate>
            <description><![CDATA[假设command中包含export之类的命令，如果采用bash -c的方式，export的变量是无法在父级shell中获取到的。这时采用eval就可以了。和exec相同的是：进程pid没有变。但它没有替换老的shell，而是在老的shell里执行新的命令。]]></description>
        </item>
        <item>
            <title><![CDATA[基于HomeAssistant的API实现桌面灯光自动化]]></title>
            <link>https://saltbo.cn/posts/nmg-desktop-lighting-automation-by-the-api-of-home-assistant.html</link>
            <guid>https://saltbo.cn/posts/nmg-desktop-lighting-automation-by-the-api-of-home-assistant.html</guid>
            <pubDate>Sat, 09 Apr 2022 17:00:00 GMT</pubDate>
            <description><![CDATA[entity_id=$1
domain=${entity_id%.*}
service=$2]]></description>
            <enclosure url="https://saltbo.cn/images/posts/nmg-desktop%20lighting%20automation%20by%20the%20API%20of%20home-assistant/prod-files-secure.s3.us-west-2.amazonaws.com_75e7a9a0-a363-4cb0-b76d-f2a3e503e07f.png">
            </enclosure>
        </item>
        <item>
            <title><![CDATA[Istio中的Envoy配置文件]]></title>
            <link>https://saltbo.cn/posts/nmg-envoy-config-in-istio.html</link>
            <guid>https://saltbo.cn/posts/nmg-envoy-config-in-istio.html</guid>
            <pubDate>Mon, 28 Mar 2022 17:00:00 GMT</pubDate>
            <description><![CDATA[可以理解为K8S中的Endpoint]]></description>
            <enclosure url="https://saltbo.cn/images/posts/nmg-envoy%20config%20in%20istio/prod-files-secure.s3.us-west-2.amazonaws.com_688b59ac-53c3-48f2-a1be-7f89d9657acf.png">
            </enclosure>
        </item>
        <item>
            <title><![CDATA[iptables基本概念和操作]]></title>
            <link>https://saltbo.cn/posts/nmg-learn-iptables.html</link>
            <guid>https://saltbo.cn/posts/nmg-learn-iptables.html</guid>
            <pubDate>Mon, 24 Jan 2022 17:00:00 GMT</pubDate>
            <description><![CDATA[root@lima-default:~# iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8000
root@lima-default:~# iptables -t nat -vnL PREROUTING
Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 REDIRECT   tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:80 redir ports 8000
这是你会发现，你在本机访问80端口仍然不通，而在本机之外却通了。这是因为本机访问并没有走PREROUTING链。如果想要在本机也通，那么我们应该配置OUTPUT。
root@lima-default:~# iptables -t nat -I OUTPUT -d localhost -p tcp --dport 80 -j REDIRECT --to-ports 8000
root@lima-default:~# iptables -t nat -vnL OUTPUT
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    1    60 REDIRECT   tcp  --  *      *       0.0.0.0/0            127.0.0.1            tcp dpt:80 redir ports 8000
这里需要注意指定destination，否则你所有对外的请求都被转到8000端口了。]]></description>
            <enclosure url="https://saltbo.cn/images/posts/nmg-learn-iptables/prod-files-secure.s3.us-west-2.amazonaws.com_89d0f15f-c24c-40b2-97c7-d46f9c0f8d95.png">
            </enclosure>
        </item>
        <item>
            <title><![CDATA[雅思口语Part 1]]></title>
            <link>https://saltbo.cn/posts/nmg-ielts-speaking-part-1.html</link>
            <guid>https://saltbo.cn/posts/nmg-ielts-speaking-part-1.html</guid>
            <pubDate>Sat, 16 Dec 2023 17:00:00 GMT</pubDate>
            <description><![CDATA[Yeah, I think children should all have to do sports at school. because it is important to keep fit.]]></description>
        </item>
        <item>
            <title><![CDATA[阿里云数加平台尝试之简单数据统计]]></title>
            <link>https://saltbo.cn/posts/odps.html</link>
            <guid>https://saltbo.cn/posts/odps.html</guid>
            <pubDate>Sat, 13 Aug 2016 17:00:00 GMT</pubDate>
            <enclosure url="https://saltbo.cn/images/posts/odps/static.saltbo.cn_1240-20200731234928250.png">
            </enclosure>
        </item>
        <item>
            <title><![CDATA[一文了解Envoy配置文件]]></title>
            <link>https://saltbo.cn/posts/nmg-learn-envoy-config.html</link>
            <guid>https://saltbo.cn/posts/nmg-learn-envoy-config.html</guid>
            <pubDate>Wed, 23 Feb 2022 17:00:00 GMT</pubDate>
            <description><![CDATA[这时它就是一个开启了8081端口的TCP服务器，但没有任何功能
admin:
  address:
    socket_address:
      protocol: TCP
      address: 0.0.0.0
      port_value: 9901]]></description>
        </item>
        <item>
            <title><![CDATA[阿里云OSS上传服务的搭建]]></title>
            <link>https://saltbo.cn/posts/php-oss.html</link>
            <guid>https://saltbo.cn/posts/php-oss.html</guid>
            <pubDate>Sun, 03 Apr 2016 17:00:00 GMT</pubDate>
            <description><![CDATA[if (empty($GLOBALS['sources']) || empty($this->_sourceid)) {
        Output::jsonStr(Error::ERRORAUTHSOURCE_FAIL);
    }
    foreach($GLOBALS['sources'] as $key => $value) {
        if ($value['sourceid'] == $this->_sourceid) {
            $this->_bucket = $value['bucket'];
            $this->_domain = $value['domain'];
            $this->_project = $key;
        }
    }
    if (empty($this->_bucket)) {
        Output::jsonStr(Error::ERRORAUTHSOURCE_FAIL);
    }
}
`]]></description>
            <enclosure url="https://saltbo.cn/images/posts/php-oss/static.saltbo.cn_1240-20200801000327526.png">
            </enclosure>
        </item>
        <item>
            <title><![CDATA[在K8S中一个网络请求是如何到达应用的]]></title>
            <link>https://saltbo.cn/posts/nmg-network-in-k8s.html</link>
            <guid>https://saltbo.cn/posts/nmg-network-in-k8s.html</guid>
            <pubDate>Wed, 25 May 2022 17:00:00 GMT</pubDate>
            <description><![CDATA[2.2.1 通过Service访问]]></description>
            <enclosure url="https://saltbo.cn/images/posts/nmg-network%20in%20k8s/prod-files-secure.s3.us-west-2.amazonaws.com_74256f48-d6e6-4515-9fa1-02c0f7693b43.png">
            </enclosure>
        </item>
        <item>
            <title><![CDATA[基于Swoole和RabbitMQ实现的一个完整的异步任务系统]]></title>
            <link>https://saltbo.cn/posts/php-swoole-rabbitmq.html</link>
            <guid>https://saltbo.cn/posts/php-swoole-rabbitmq.html</guid>
            <pubDate>Mon, 12 Dec 2016 17:00:00 GMT</pubDate>
            <description><![CDATA[消费者代码如下：]]></description>
            <enclosure url="https://saltbo.cn/images/posts/php-swoole-rabbitmq/static.saltbo.cn_1240-20200731234430392.png">
            </enclosure>
        </item>
        <item>
            <title><![CDATA[基于Swoole和Redis实现的并发队列处理系统]]></title>
            <link>https://saltbo.cn/posts/php-swoole-redis.html</link>
            <guid>https://saltbo.cn/posts/php-swoole-redis.html</guid>
            <pubDate>Sat, 23 Apr 2016 17:00:00 GMT</pubDate>
            <description><![CDATA[但很可惜，它是一个单进程的系统。它是一直在不断的 fork，如果有任务就处理，没有任务就跳过。
这样很稳定。
但问题有两个：一是不断地 fork、pop 会浪费服务器资源，二是不支持并发！
第一个问题还好，但第二个问题就很严重。
当主系统 同时 抛过来大量的任务时，任务的处理时间就会无限的拉长。]]></description>
        </item>
    </channel>
</rss>