Skip to content

Commit

Permalink
deploy: 7ad15e4
Browse files Browse the repository at this point in the history
  • Loading branch information
dcb9 committed May 3, 2024
1 parent 34996b4 commit fadef6e
Show file tree
Hide file tree
Showing 30 changed files with 431 additions and 100 deletions.
36 changes: 18 additions & 18 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,24 @@ <h1 class=site-title><a href=https://dcb9.github.io/>Du, Chengbin's Blog</a></h1
<div class=meta>
<div class=date>
<span class=day>03</span>
<span class=rest>May 2024</span>
</div>
</div>
<div class=matter>
<h4 class="title small">
<a href=/posts/2024-05-03/>打造私人影院</a>
</h4>
<span class=description>
分享使用 OpenWRT + Alist(baidu cloud) + Jellyfin + TinyMediaManager 打造的私人影院
</span>
</div>
</div>
</div>
<div class=post>
<div class=post-header>
<div class=meta>
<div class=date>
<span class=day>03</span>
<span class=rest>Mar 2024</span>
</div>
</div>
Expand Down Expand Up @@ -387,24 +405,6 @@ <h4 class="title small">
</div>
</div>
</div>
<div class=post>
<div class=post-header>
<div class=meta>
<div class=date>
<span class=day>15</span>
<span class=rest>Nov 2014</span>
</div>
</div>
<div class=matter>
<h4 class="title small">
<a href=/posts/2014-11-15/>高可用的 Web 架构</a>
</h4>
<span class=description>
最近工作需要,画了一幅比较典型的高可用 Web 架构图,这中间都是开源产品
</span>
</div>
</div>
</div>
<ul class=pagination>
<li class="page-item page-prev">
</li>
Expand Down
7 changes: 4 additions & 3 deletions index.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Du, Chengbin's Blog</title><link>https://dcb9.github.io/</link><description>Recent content on Du, Chengbin's Blog</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><copyright>© Copyright Du, Chengbin</copyright><lastBuildDate>Sun, 03 Mar 2024 23:00:00 +0800</lastBuildDate><atom:link href="https://dcb9.github.io/index.xml" rel="self" type="application/rss+xml"/><item><title>常州行之龙年游龙城</title><link>https://dcb9.github.io/posts/2024-03-03/</link><pubDate>Sun, 03 Mar 2024 23:00:00 +0800</pubDate><guid>https://dcb9.github.io/posts/2024-03-03/</guid><description>活捉一只变异野生恐龙~
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Du, Chengbin's Blog</title><link>https://dcb9.github.io/</link><description>Recent content on Du, Chengbin's Blog</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><copyright>© Copyright Du, Chengbin</copyright><lastBuildDate>Fri, 03 May 2024 11:00:00 +0800</lastBuildDate><atom:link href="https://dcb9.github.io/index.xml" rel="self" type="application/rss+xml"/><item><title>打造私人影院</title><link>https://dcb9.github.io/posts/2024-05-03/</link><pubDate>Fri, 03 May 2024 11:00:00 +0800</pubDate><guid>https://dcb9.github.io/posts/2024-05-03/</guid><description>分享使用 OpenWRT + Alist(百度网盘) + Jellyfin + TinyMediaManager 打造的私人影院,这不是一个 step-by-step 的教程,而是一些 Gist + 成果展示的分享,更多搭建过程参考结尾的#参考文章
Windows 挂载 Alist webdav 到本地盘符,给 TMM 搜刮 修改注册表 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters 把 BasicAuthLevel 设置为 2
0 = Basic authentication is disabled 1 = Basic authentication is enabled for SSL web sites only 2 = Basic authentication is enabled for SSL and non-SSL web sites windows powershell $ net stop webclient windows powershell $ net start webclient windows powershell $ net use Z: http://192.</description></item><item><title>常州行之龙年游龙城</title><link>https://dcb9.github.io/posts/2024-03-03/</link><pubDate>Sun, 03 Mar 2024 23:00:00 +0800</pubDate><guid>https://dcb9.github.io/posts/2024-03-03/</guid><description>活捉一只变异野生恐龙~
2024 甲辰龙年英语为 Loong Year,弃用 Dragon 因为它与中国的龙完全不是一个物种且含义也不同。西方的龙代表着贪婪与邪恶;中国的龙与之相反代表着好运、高贵、丰收。
动车上看完了一直心心念念的梁祝
最近一周循环播放的音乐:上音何占豪作曲梁祝 时长 27min
Expand Down Expand Up @@ -96,8 +98,7 @@ API 那边的 Host 还是 IP,即 http://x.x.y.z:port/api-route,这样服务
高效地模拟线上环境 我们线上有 16 台服务器,如果我尝试在本地使用 VirtualBox 配置每个实例 512 MB内存,那么它将占用我笔记本的两倍内存(说明他笔记本只有 4G 内存),VirtualBox 需要有许多多余的开支来管理每个子操作系统,Docker 在这方面是不一样的——容器共享同一个操作系统,更有可能是同样的二进制包文件和库文件,它可以运行在一台 Docker 主机上运行好几百个容器。
老方法 我不能在本地完全地模拟线上环境,让我们来看一下通过 Vagrant 启动一台机器需要花多久:
$ time vagrant up Bringing machine &amp;#39;default&amp;#39; up with &amp;#39;virtualbox&amp;#39; provider... [default] Importing base box &amp;#39;squeeze64-ruby193&amp;#39;... ... [default] Booting VM... [default] Waiting for VM to boot. This can take a few minutes. ... real 1m32.052s 启动一个镜像需要一分半钟,如果我需要修改一个配置文件并检测是否能够正常工作,那么需要重启镜像,那又是可怕的一分半钟。
如果你配置的有错,那将是一个残忍的惩罚。(每次修改就需要一分半钟才能看到结果)
使用 Docker 后</description></item><item><title>Yii2 项目部署流程</title><link>https://dcb9.github.io/posts/2015-03-12-yii2-project-deploy/</link><pubDate>Thu, 12 Mar 2015 00:00:00 +0800</pubDate><guid>https://dcb9.github.io/posts/2015-03-12-yii2-project-deploy/</guid><description>网上现在有许多关于在 Yii2 下进行开发的文章,但对于如何把程序优雅地部署到线上介绍的还不是很多,下面我就来介绍一下我自己的部署流程。
如果你配置的有错,那将是一个残忍的惩罚。(每次修改就需要一分半钟才能看到结果)</description></item><item><title>Yii2 项目部署流程</title><link>https://dcb9.github.io/posts/2015-03-12-yii2-project-deploy/</link><pubDate>Thu, 12 Mar 2015 00:00:00 +0800</pubDate><guid>https://dcb9.github.io/posts/2015-03-12-yii2-project-deploy/</guid><description>网上现在有许多关于在 Yii2 下进行开发的文章,但对于如何把程序优雅地部署到线上介绍的还不是很多,下面我就来介绍一下我自己的部署流程。
概述 本地修改代码 -&amp;gt; 提交至版本控制仓库 -&amp;gt; master 分支有修改时自动部署到服务器
代码托管到 GitHub 原来也用过 coding.net,用了两个月发现它在许多地方表现的不是很如意,所以就迁到 GitHub 了。
修改代码 本地修改代码时不要直接修改 master 分支的代码,而是切出一个分支来做这个功能,做好之后把这个分支提交到远端仓库,功能完成之后,发起一个 Pull Request(后面就用 PR 代替),由另一个开发来检查一下代码,如果没有问题就合并到 master 分支。
Expand Down
18 changes: 18 additions & 0 deletions page/2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,24 @@ <h1 class=site-title><a href=https://dcb9.github.io/>Du, Chengbin's Blog</a></h1
<div class=post-header>
<div class=meta>
<div class=date>
<span class=day>15</span>
<span class=rest>Nov 2014</span>
</div>
</div>
<div class=matter>
<h4 class="title small">
<a href=/posts/2014-11-15/>高可用的 Web 架构</a>
</h4>
<span class=description>
最近工作需要,画了一幅比较典型的高可用 Web 架构图,这中间都是开源产品
</span>
</div>
</div>
</div>
<div class=post>
<div class=post-header>
<div class=meta>
<div class=date>
<span class=day>05</span>
<span class=rest>Nov 2014</span>
</div>
Expand Down
4 changes: 3 additions & 1 deletion posts/2014-11-15/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ <h1 class=title>高可用的 Web 架构</h1>
</div>
<div class=markdown>
<p>最近工作需要,画了一幅比较典型的高可用 Web 架构图,这中间都是开源产品</p>
<p><img src=build-high-avilability-web-architecture.png alt></p>
<p>
<img src=build-high-avilability-web-architecture.png alt>
</p>
<p>所用软件列表:</p>
<ul>
<li>HAProxy + Keepalived</li>
Expand Down
12 changes: 9 additions & 3 deletions posts/2015-03-18/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ <h1 class=title>Docker VS 虚拟机</h1>
<p>我听说了 <code>Docker</code> 多么令人惊叹,但是它并没有征服我的心,直到我提出一个实际的问题:【如果 Scout 使用 Docker 来部署,它会让我们的部署变得更顺利吗?】</p>
<p>以下是三个案例:</p>
<h3 id=高效地模拟线上环境>高效地模拟线上环境</h3>
<p><img src=0.png alt></p>
<p>
<img src=0.png alt>
</p>
<p>我们线上有 16 台服务器,如果我尝试在本地使用 <code>VirtualBox</code> 配置每个实例 512 MB内存,那么它将占用我笔记本的两倍内存(说明他笔记本只有 4G 内存),<code>VirtualBox</code> 需要有许多多余的开支来管理每个子操作系统,<code>Docker</code> 在这方面是不一样的——容器共享同一个操作系统,更有可能是同样的二进制包文件和库文件,它可以运行在一台 <code>Docker</code> 主机上运行好几百个容器。</p>
<h4 id=老方法>老方法</h4>
<p>我不能在本地完全地模拟线上环境,让我们来看一下通过 <code>Vagrant</code> 启动一台机器需要花多久:</p>
Expand Down Expand Up @@ -93,7 +95,9 @@ <h4 id=老方法>老方法</h4>
</code></pre></div><p>只需要两秒钟就完成了容器的启动和 supervisor 的启动(用来启动 Rails 应用的管理程序)</p>
<p>总之,<code>Docker</code> 能够让你在测试机上完全地模拟线上环境,它是如此的简单,让我可以真正地进行全站测试了。</p>
<h3 id=更简单快速地创建镜像>更简单快速地创建镜像</h3>
<p><img src=1.png alt></p>
<p>
<img src=1.png alt>
</p>
<h4 id=传统方法>传统方法</h4>
<p>如果你用脚本从一个基本的镜像创建一个虚拟机镜像(例如:在 <code>Ubuntu</code> 上创建 <code>Rails stack</code>),若想把这个都做的正确是非常痛苦的,除非你经常的在做这个,看看安装 <code>Ruby</code> 依赖的一些信息吧:</p>
<div class=highlight><pre tabindex=0 style=background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-go data-lang=go><span>$</span> time apt-get install -y -q ruby1.9.1 ruby1.9.1-dev rubygems1.9.1 irb1.9.1 build-essential libopenssl-ruby1.9.1 libssl-dev zlib1g-dev
Expand Down Expand Up @@ -142,7 +146,9 @@ <h4 id=传统方法>传统方法</h4>
做的如此神奇,是因为 <code>Docker</code> 使用了 <code>AuFS</code> 文件系统(union file system)</p>
<p>总之,<code>Docker</code> 让我们反复地创建一个镜像不再那么痛苦,对于已经成功的后面就不需要再等了。I&rsquo;m not perfect and Docker doesn&rsquo;t punish me when I make mistakes.</p>
<h3 id=部署镜像不更新基础设施>部署镜像,不更新基础设施</h3>
<p><img src=2.png alt></p>
<p>
<img src=2.png alt>
</p>
<p>传统的做法</p>
<p><a href=https://scoutapp.com/>Scout</a>和其它部署一样,很长的时间在运行虚拟机,使用 <code>Puppet</code> 来更新所有的基础设施,但是经常会非常的痛苦。</p>
<p>如果我们部署更新到我们的栈,<code>Puppet</code> 会在每台虚拟机运行更新,这会花去许多的时间——即使是一个小小的改变,<code>Puppet</code> 需要检查所其它所有的都检查一遍。在部署的时间会出问题:如果我们安装 <code>Memcached</code> 时网络有点问题,<code>apt-get install memcached</code> 就会执行失败。</p>
Expand Down
8 changes: 6 additions & 2 deletions posts/2016-09-04/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ <h1 class=title>Alexander Makarov 于 CLOUDWAYS 的面试</h1>
<div class=markdown>
<p>Alexander Makarov 是一个高级工程师并且他是 Yii 框架的核心贡献者之一,同时他还是 Yii 2.0 Cookbook 的作者</p>
<p>Alexander 在 Cloudways 面试中,讲述了他职业路径、对 Yii 框架的贡献以及 Yii 和其它框架的对比,最后他还给学生一些非常好的建议。</p>
<p><img src=0.jpg alt></p>
<p>
<img src=0.jpg alt>
</p>
<p>Cloudways: 跟读者分享一些你的故事吧,你是如何开始你的开发生涯的,是谁促动了你,还有截止现在你觉得自己做的最好的工作是什么?</p>
<p>Alexander: 读者们好!我是 Alexander Makarov 一名来自俄罗斯的 IT 工程师,大部分工作就是 Yii 框架和参与 PHP-FIG,最近,我全职在 stay.com 上班,只能用我的空闲时间来维护 Yii,你可能在 Github 上见过我 @samdark。</p>
<p>当我还是个孩子的时候,我的父亲配置了一台 z80 的电脑,里面运行着 sinclair basic (BASIC 的编程方言),当然还有游戏。玩游戏玩够了之后,我开始思考它们是怎么工作的,这些游戏是如何运转的。我喜欢自己明白的那种感觉,所以它决定了我需要正确地学习计算机科学。五年在大学获得了硕士学位,让我得到了一份在西门子做 DBA 和 Java/SAP 的工作,在那之后又过了 10 年,自从大学起我就使用 PHP 来做个人项目,因为它比 J2EE 在开发简单的 web 上更合适。</p>
Expand Down Expand Up @@ -92,7 +94,9 @@ <h1 class=title>Alexander Makarov 于 CLOUDWAYS 的面试</h1>
<p>Alexander: 旅游、骑车、看电影、玩游戏和做许多家庭活动</p>
<p>Cloudways: 可以给我们的读者,发一张你的工作台吗?</p>
<p>Alexander: 那就下面这张吧!</p>
<p><img src=1.jpg alt="Alexander Makarov workstation"></p>
<p>
<img src=1.jpg alt="Alexander Makarov workstation">
</p>
<p>Cloudways: 你会给即将成为一名开发者的学生哪些建议呢?</p>
<p>Alexander: 把你的时间花在学习计算机基础上,前五年你可能不会需要它,但之后如果你没有一个良好的基础就无法进步了,它会给你带来很大的区别。</p>
<p>Cloudways: 我们 Cloudways 提供一键安装 PHP 和不同的 PHP 框架,希望你去看一看,然后分享一下你对本平台的看法,我们可以做什么,以进一步提高本平台的前景和表现?</p>
Expand Down
4 changes: 3 additions & 1 deletion posts/2018-09-08/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ <h5 id=等额本息-1>等额本息</h5>
年利率 = 12 A = 12 * 0.01295 = 0.1554 = 15.54%
</code></pre>
<p>用 《<a href="https://play.google.com/store/apps/details?id=com.alago.eqnlite&hl=en_US">Equation Solver</a>》求解:</p>
<p><img src=0.jpg alt></p>
<p>
<img src=0.jpg alt>
</p>
</div>
<div class=tags>
<ul class=flat>
Expand Down
22 changes: 15 additions & 7 deletions posts/2018-11-24/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<meta charset=utf-8>
<meta http-equiv=x-ua-compatible content="IE=edge"><title>使用 Python 绘制多项式函数 - Du, Chengbin's Blog</title><meta name=viewport content="width=device-width,initial-scale=1">
<meta itemprop=name content="使用 Python 绘制多项式函数">
<meta itemprop=description content="简介 高中你就会接触到多项式和多项式函数,本章教程完全依赖多项式,也就是说,我们将会花一节课的时间去了解多项式。下面是一个 4 次多项式的例子:
<meta itemprop=description content="简介 高中你就会接触到多项式和多项式函数,本章教程完全依赖多项式,也就是说,我们将会花一节课的时间去了解多项式。下面是一个 4 次多项式的例子:
$$ p(x) = x^4 - 4 \cdot x^2 + 3 \cdot x $$
你会发觉它们跟整数有许多相似之处,本课我们将会定义多种多项式的算术操作,我们的 Polynomial 类也将提供计算多项式的推导和积分的方法,绘制多项式的图像。
多项式非常漂亮,现在最重要的是如何用 Python 类来实现它们,我们要感谢 Drew Shanon,他让我们使用他的精美的图片,将数学视为艺术!
Expand All @@ -15,7 +15,7 @@
<meta itemprop=dateModified content="2018-11-24T00:00:00+08:00">
<meta itemprop=wordCount content="1106">
<meta itemprop=keywords content="Python,Math,翻译,"><meta property="og:title" content="使用 Python 绘制多项式函数">
<meta property="og:description" content="简介 高中你就会接触到多项式和多项式函数,本章教程完全依赖多项式,也就是说,我们将会花一节课的时间去了解多项式。下面是一个 4 次多项式的例子:
<meta property="og:description" content="简介 高中你就会接触到多项式和多项式函数,本章教程完全依赖多项式,也就是说,我们将会花一节课的时间去了解多项式。下面是一个 4 次多项式的例子:
$$ p(x) = x^4 - 4 \cdot x^2 + 3 \cdot x $$
你会发觉它们跟整数有许多相似之处,本课我们将会定义多种多项式的算术操作,我们的 Polynomial 类也将提供计算多项式的推导和积分的方法,绘制多项式的图像。
多项式非常漂亮,现在最重要的是如何用 Python 类来实现它们,我们要感谢 Drew Shanon,他让我们使用他的精美的图片,将数学视为艺术!
Expand All @@ -30,7 +30,7 @@
<meta property="article:modified_time" content="2018-11-24T00:00:00+08:00">
<meta name=twitter:card content="summary">
<meta name=twitter:title content="使用 Python 绘制多项式函数">
<meta name=twitter:description content="简介 高中你就会接触到多项式和多项式函数,本章教程完全依赖多项式,也就是说,我们将会花一节课的时间去了解多项式。下面是一个 4 次多项式的例子:
<meta name=twitter:description content="简介 高中你就会接触到多项式和多项式函数,本章教程完全依赖多项式,也就是说,我们将会花一节课的时间去了解多项式。下面是一个 4 次多项式的例子:
$$ p(x) = x^4 - 4 \cdot x^2 + 3 \cdot x $$
你会发觉它们跟整数有许多相似之处,本课我们将会定义多种多项式的算术操作,我们的 Polynomial 类也将提供计算多项式的推导和积分的方法,绘制多项式的图像。
多项式非常漂亮,现在最重要的是如何用 Python 类来实现它们,我们要感谢 Drew Shanon,他让我们使用他的精美的图片,将数学视为艺术!
Expand Down Expand Up @@ -86,7 +86,9 @@ <h1 class=title>使用 Python 绘制多项式函数</h1>
</div>
<div class=markdown>
<h2 id=简介>简介</h2>
<p><img src=0.jpg alt></p>
<p>
<img src=0.jpg alt>
</p>
<p>高中你就会接触到<strong>多项式</strong><strong>多项式函数</strong>,本章教程完全依赖多项式,也就是说,我们将会花一节课的时间去了解多项式。下面是一个 4 次多项式的例子:</p>
<p>$$ p(x) = x^4 - 4 \cdot x^2 + 3 \cdot x $$</p>
<p>你会发觉它们跟整数有许多相似之处,本课我们将会定义多种多项式的算术操作,我们的 Polynomial 类也将提供计算多项式的推导和积分的方法,绘制多项式的图像。</p>
Expand Down Expand Up @@ -189,7 +191,9 @@ <h2 id=多项式函数与-python>多项式函数与 Python</h2>

plt.plot(X,F)
plt.show()
</code></pre></div><p><img src=1.png alt></p>
</code></pre></div><p>
<img src=1.png alt>
</p>
<p>还可以定义多项式的加法和减法,我们需要做的就是对两个多项式的相同指数的系数做加法或减法。</p>
<p>若有以下多项式函数</p>
<p>$$ f(x) = \sum_{k=0}^{n}a_k \cdot x^k $$</p>
Expand Down Expand Up @@ -289,7 +293,9 @@ <h2 id=多项式函数与-python>多项式函数与 Python</h2>
plt.plot(X, F_diff, label=<span style=color:#a31515>&#34;F_diff&#34;</span>)
plt.legend()
plt.show()
</code></pre></div><p><img src=2.png alt></p>
</code></pre></div><p>
<img src=2.png alt>
</p>
<p>添加求微分到 Polynomial 类非常简单,数学的定义如下:</p>
<p>$$ f'(x) = \sum_{k=0}^{n}k \cdot a_k \cdot x^{k-1} $$</p>
<p></p>
Expand Down Expand Up @@ -373,7 +379,9 @@ <h2 id=多项式函数与-python>多项式函数与 Python</h2>
plt.plot(X, F_derivative, label=<span style=color:#a31515>&#34;F_der&#34;</span>)
plt.legend()
plt.show()
</code></pre></div><p><img src=3.png alt></p>
</code></pre></div><p>
<img src=3.png alt>
</p>
<p>再来几组:</p>
<div class=highlight><pre tabindex=0 style=background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-python data-lang=python>p = Polynomial(1, 1, 1, 1, 1)
p2 = Polynomial(1, 2, 3)
Expand Down
Loading

0 comments on commit fadef6e

Please sign in to comment.