<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>step by step</title>
  <link href="http://huyongde.github.io/atom.xml" rel="self"/>
  <link href="http://huyongde.github.io"/>
  <updated>2024-03-08T04:18:44+00:00</updated>
  <id>http://huyongde.github.io</id>
  <author>
    <name>hyde</name>
    <email>huyongdeshuxue@126.com</email>
  </author>


  <entry>
    <title>mysql 两阶段提交</title>
    <link href="http://huyongde.github.io/2023/03/08/mysql-two-phase-commit.html"/>
    <updated>2023-03-08T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2023/03/08/mysql-two-phase-commit</id>
    <content type="html">什么是两阶段提交
两阶段提交是mysql在使用innodb引擎时，为了提供crash-safe 能力而设计的，两阶段提交涉及两个日志
server层的逻辑日志 bin log(归档日志) 和 innodb引擎层的物理日志redo log , redolog 存在prepare和commit两个状态
bin log和redo log有啥区别呢？ 总结如下三点：

  redo log是InnoDB引擎特有的；binlog是MySQL的Server层实现的，所有引擎都可以使用。
  redo log是物理日志，记录的是“在某个数据页上做了什么修改”；binlog是逻辑日志，记录的是这个语句的...</content>
  </entry>

  <entry>
    <title>golang中 select 关键字的实现</title>
    <link href="http://huyongde.github.io/2019/10/26/golang-select.html"/>
    <updated>2019-10-26T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2019/10/26/golang-select</id>
    <content type="html">下图概括了select关键字的实现:


select
在go中，通过select可以实现等待多个channel达到就绪状态，select中的case都要关联到channel相关的读写操作。

select 中每个case都会生成一个对应的scase结构体，结构体定义如下
// Select case descriptor.
// Known to compiler.
// Changes here must also be made in src/cmd/internal/gc/select.go's scasetype.
type scase struct {
    c      ...</content>
  </entry>

  <entry>
    <title>golang中 make 和 new 关键字的实现</title>
    <link href="http://huyongde.github.io/2019/10/17/golang-make-new.html"/>
    <updated>2019-10-17T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2019/10/17/golang-make-new</id>
    <content type="html">下图概括了make 和 new 关键字的实现:


make vs new

make


  
    
      make 对应的 OP type 是 OMAKE, 在类型检查阶段 typecheck1()函数会把 OMAKE 根据参数类型调整为 OMAKESLICE或 OMAKECHAN或 OMAKEMAP
    

    cmd/compile/internal/gc/typecheck.go
  
  
    
      walkexpr()函数会通过 mkcall()函数把 OMAKECHAN、OMAKEMAP、OMAKESLICE 分别调用运行时函数 makech...</content>
  </entry>

  <entry>
    <title>go服务优化技巧</title>
    <link href="http://huyongde.github.io/2019/06/20/go-optimise.html"/>
    <updated>2019-06-20T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2019/06/20/go-optimise</id>
    <content type="html">简介
本文介绍go服务可能会用到的几个优化技巧

技巧1: sync.Pool 池化某些对象，实现复用
池化后进行对象复用，可以减少对象重复创建的开销，并且可以减轻gc的压力。

使用示例:
package main

import (
	&quot;fmt&quot;
	&quot;sync&quot;
)

var bufpool = sync.Pool{
	New: func() interface{} {
		buf := make([]byte, 0, 512)
		return &amp;amp;buf
	},
}

func main() {
	b1 := *bufpool.Get().(*[]byte)
	b1 = a...</content>
  </entry>

  <entry>
    <title>go unsafe 注释翻译和实践</title>
    <link href="http://huyongde.github.io/2019/06/16/go-package-unsafe.html"/>
    <updated>2019-06-16T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2019/06/16/go-package-unsafe</id>
    <content type="html">背景
翻译go unsafe包中的部分注释，学习unsafe包的使用

https://golang.org/src/unsafe/unsafe.go

注释翻译

// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

/*
	Package unsafe contains operations that step aroun...</content>
  </entry>

  <entry>
    <title>go append 使用陷阱</title>
    <link href="http://huyongde.github.io/2019/06/15/go-gotcha-append.html"/>
    <updated>2019-06-15T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2019/06/15/go-gotcha-append</id>
    <content type="html">问题
请大家思考下如下代码的输出结果,

package main

import &quot;fmt&quot;

func main() {
	a := []byte(&quot;aa&quot;)
	b := append(a, 'b')
	c := append(a, 'c')
	fmt.Println(string(a), len(a), cap(a), &amp;amp;a, &amp;amp;a[0])
	fmt.Println(string(b), len(b), cap(b), &amp;amp;b, &amp;amp;b[0])
	fmt.Println(string(c), len(c), cap(c), &amp;amp;c, &amp;amp;c[...</content>
  </entry>

  <entry>
    <title>[golang踩的坑] ioutil.ReadAll 会清空对应Reader</title>
    <link href="http://huyongde.github.io/2019/05/26/golang-ioutil.ReadAll.html"/>
    <updated>2019-05-26T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2019/05/26/golang-ioutil.ReadAll</id>
    <content type="html">问题
在golang web后台开发中，为了能够随机采集小部分请求case, 在框架里统一加了部分请求详细信息上报的逻辑，其中用到了，body, err := ioutil.ReadAll(ctx.Request.Body) 来读取请求body里的内容，
后面业务逻辑中再取body内容时取出来的是空。

解决方案

google了下，如下应该能解决这个问题
body, err := ioutil.ReadAll(ctx.Request.Body)
rdr := ioutil.NopCloser(bytes.NewBuffer(body))
ctx.Request.Body = rdr

...</content>
  </entry>

  <entry>
    <title>nginx proxy_cache指令集详解</title>
    <link href="http://huyongde.github.io/2019/05/15/nginx-proxy_cache.html"/>
    <updated>2019-05-15T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2019/05/15/nginx-proxy_cache</id>
    <content type="html">介绍

在使用nginx做反向代理时, 部分业务场景可能可以使用proxy_cache来降低后端的压力，
nginx 提供了丰富的指令来配置符合业务场景的cache策略。

下面分别介绍下nginx proxy_cache相关的指令和用法

指令介绍

1. proxy_cache

Syntax: proxy_cache zone | off;
Default: proxy_cache off;
Context: http, server, location

指令proxy_cache 用来配置用来做cache的一块内存区域，也可以用来关闭cache功能, 
参数为off时关闭当前配...</content>
  </entry>

  <entry>
    <title>nginx error_page指令配置</title>
    <link href="http://huyongde.github.io/2019/05/09/nginx-error_page.html"/>
    <updated>2019-05-09T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2019/05/09/nginx-error_page</id>
    <content type="html">背景介绍
在服务改造优化上线过程中，可能需要用之前的服务对新服务做容错，我们在nginx代理层增加了

error_page 403 404 408 500 501 502 503 504  @backend2;



当新服务出现403时，用backend2来容错，backend2正常返回了200状态码，但是端上收到的还是403状态码，
通过查看nginx文章，发现是配置存在问题导致，缺少了=号，
配置改为

    error_page 403 404 408 500 501 502 503 504 = @backend2;


这样，端上收到的状态码就是backend2返回的状态码...</content>
  </entry>

  <entry>
    <title>Nginx Proxy_next_upstream</title>
    <link href="http://huyongde.github.io/2019/05/08/nginx-proxy_next_upstream.html"/>
    <updated>2019-05-08T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2019/05/08/nginx-proxy_next_upstream</id>
    <content type="html">介绍
在使用nginx做代理时，为了容错单点故障，保证服务高可用，可以通过proxy_next_upstream指令来实现某些错误时进行请求重试，
下面详细介绍下proxy_next_upsream相关的几个指令

proxy_next_upstream
Syntax: proxy_next_upstream error | timeout | invalid_header | http_500 | http_502 | http_503 | http_504 | http_403 | http_404 | http_429 | non_idempotent | off ...;
Def...</content>
  </entry>

  <entry>
    <title>leetcode 24 两两交换链表中的节点</title>
    <link href="http://huyongde.github.io/2018/09/11/swapNodesInPairs.html"/>
    <updated>2018-09-11T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2018/09/11/swapNodesInPairs</id>
    <content type="html">题目信息

给定一个链表，两两交换其中相邻的节点，并返回交换后的链表。

示例:
给定 1-&amp;gt;2-&amp;gt;3-&amp;gt;4, 你应该返回 2-&amp;gt;1-&amp;gt;4-&amp;gt;3.

要求


  你的算法只能使用常数的额外空间。
  你不能只是单纯的改变节点内部的值，而是需要实际的进行节点交换。


解法1
不考虑如上两点要求的话，可以直接两两交换节点的Val

代码(go)


/**
 * Definition for singly-linked list.
 * type ListNode struct {
 *     Val int
 *     Next *ListNod...</content>
  </entry>

  <entry>
    <title>leetcode 2 两数相加</title>
    <link href="http://huyongde.github.io/2018/09/10/addTwoNums.html"/>
    <updated>2018-09-10T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2018/09/10/addTwoNums</id>
    <content type="html">题目信息

给定两个非空链表来表示两个非负整数。位数按照逆序方式存储，它们的每个节点只存储单个数字。将两数相加返回一个新的链表。

你可以假设除了数字 0 之外，这两个数字都不会以零开头。

示例：

输入：(2 -&amp;gt; 4 -&amp;gt; 3) + (5 -&amp;gt; 6 -&amp;gt; 4)
输出：7 -&amp;gt; 0 -&amp;gt; 8
原因：342 + 465 = 807

解题思路


  每个链表存储一个数字，位数是逆序存储，从左到右分别是个十百千万
  两个指针从左到右依次遍历两个链表，需要处理链表长度不一致的问题，以及进位问题,
  跳出循环的前提是没有进位并且两个链表均遍历到最后
...</content>
  </entry>

  <entry>
    <title>leetcode 19. 删除链表的倒数第N个节点</title>
    <link href="http://huyongde.github.io/2018/09/09/deleteNthNodeFromTheListEnd.html"/>
    <updated>2018-09-09T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2018/09/09/deleteNthNodeFromTheListEnd</id>
    <content type="html">题目信息

给定一个链表，删除链表的倒数第 n 个节点，并且返回链表的头结点。

示例：

给定一个链表: 1-&amp;gt;2-&amp;gt;3-&amp;gt;4-&amp;gt;5, 和 n = 2.

当删除了倒数第二个节点后，链表变为 1-&amp;gt;2-&amp;gt;3-&amp;gt;5.


说明：

给定的 n 保证是有效的。


  要求仅遍历一遍链表


分析


  快慢双指针实现只扫描一趟， 快指针先走n步，然后快慢指针同时走，当快指针到达尾部时，慢指针到第l-n个节点，倒数第n个节点即l-n节点的下一个节点
  需要处理删除头节点和尾节点的情况


代码(go)

/**
 * Definition fo...</content>
  </entry>

  <entry>
    <title>leetcode 160 两个链表相交，求交点</title>
    <link href="http://huyongde.github.io/2018/09/07/IntersectionTwoLinkedLists.html"/>
    <updated>2018-09-07T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2018/09/07/IntersectionTwoLinkedLists</id>
    <content type="html">题目信息
编写一个程序，找到两个单链表相交的起始节点。

例如，下面的两个链表：

A:          a1 → a2
                   ↘
                     c1 → c2 → c3
                   ↗            
B:     b1 → b2 → b3


在节点 c1 开始相交。

注意：


  如果两个链表没有交点，返回 null.
  在返回结果后，两个链表仍须保持原有的结构。
  可假定整个链表结构中没有循环。
  程序尽量满足 O(n) 时间复杂度，且仅用 O(1) 内存。


解法1
题目...</content>
  </entry>

  <entry>
    <title>linux sysstat netstat vmstat 介绍</title>
    <link href="http://huyongde.github.io/2018/08/02/linux-sysstat.html"/>
    <updated>2018-08-02T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2018/08/02/linux-sysstat</id>
    <content type="html">1. sysstat 简介
sysstat 是linux的一个软件包， 里面包含多个linux 各项性能监控的命令，可以查看监控linux cpu io memory net 等信息

1.1 sysstat 包含的命令列表

  iostat：统计并报告你的设备的CPU状态和I/O状态数据。
  mpstat：监控和显示关于每个逻辑CPU的细节信息。
  pidstat：统计正在运行的进程/任务的CPU、内存等信息, 可以单独查看某个进程的各项信息。
  tapestat 查看连接到系统的U盘等外接设备的信息
  
    sysstat：解释sysstat的各种作用。
  
  sa...</content>
  </entry>

  <entry>
    <title>nginx 学习(1) - nginx配置</title>
    <link href="http://huyongde.github.io/2017/11/05/nginx-conf.html"/>
    <updated>2017-11-05T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2017/11/05/nginx-conf</id>
    <content type="html">简介
重新学习nginx配置， 简单记录下。


  学习连接： http://openresty.org/cn/ebooks.html


0. 变量分类：


  用户自定义变量
  内建变量


1. nginx变量创建赋值作用域

nginx配置里面的变量是nginx服务启动时创建，   请求到达时进行赋值， 每个请求都有一个变量的副本， 请求内部跳转时变量可以跨location使用。也就是说变量的生命期是和请求绑定的， 可以跨多个location。

“回到先前对 Nginx 变量值容器的生命期的讨论，我们现在依旧可以说，它们的生命期是与当前请求相关联的。每个请求都有所有变量值...</content>
  </entry>

  <entry>
    <title>微信小程序开发总结</title>
    <link href="http://huyongde.github.io/2017/09/23/wxapp-dev.html"/>
    <updated>2017-09-23T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2017/09/23/wxapp-dev</id>
    <content type="html">简介

学习微信小程序开发中遇到问题，总结一下。

模板消息遇到的问题


  区分ID和template_id, id是所有小程序都可以使用的，是”模板库”里面的ID, template_id 是我的模板中的ID， template_id 是发模板消息时需要使用的。
  请求POST接口时， request body需要是json字符串， 比如PHP语言，需要这样设置request body curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)) data是由请求参数组成的数组， 比如：/cgi-bin/wxopen/templ...</content>
  </entry>

  <entry>
    <title>go 源码安装</title>
    <link href="http://huyongde.github.io/2017/08/23/golang-sourcecode-install.html"/>
    <updated>2017-08-23T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2017/08/23/golang-sourcecode-install</id>
    <content type="html">源码下载


  https://golang.org/dl/ 可以下载golang各个版本的源码
  https://github.com/golang/go 也可从github上clone源码


安装

问题1：

从源码src目录下运行./all.bash， 出现如下错误：

##### Building Go bootstrap tool.
cmd/dist
ERROR: Cannot find /home/campus/go1.4/bin/go.
Set $GOROOT_BOOTSTRAP to a working Go tree &amp;gt;= Go 1.4.


问题原因： ...</content>
  </entry>

  <entry>
    <title>浮点数剖析 (PHP)</title>
    <link href="http://huyongde.github.io/2017/08/18/php-float.html"/>
    <updated>2017-08-18T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2017/08/18/php-float</id>
    <content type="html">PHP面试中, 经常会被问到的一个问题
&amp;lt;?php
    $f = 0.58;
    var_dump(intval($f * 100)); 
?&amp;gt;


上面输出的结果是57， 而不是58， 为什么呢， 因为 你看似有穷的小数, 在计算机的二进制表示里却是无穷的(鸟哥的原话)，0.58用二进制后， 重新计算出来的值是：0.57999999999999996， 所以乘以100之后，去整数部分，就是57了。


  代码中的intval改为floor后，输出的结果也是57


名字解释


  BC是Binary Calculator的缩写, 二进制计算器
  Sign 符号...</content>
  </entry>

  <entry>
    <title>静态变量(static) 和 全局变量(global)</title>
    <link href="http://huyongde.github.io/2017/08/17/php-global-static.html"/>
    <updated>2017-08-17T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2017/08/17/php-global-static</id>
    <content type="html">参考


  php变量范围


静态变量


  静态变量仅在局部函数域中存在，但当程序执行离开此作用域时，其值并不丢失。


$a = 10;

function test ($a) {
   static $a = 1;
   echo $a . &quot;\n&quot;;
   $a ++ ;
}
test($a);
test($a);
test($a);
echo $a . &quot;\n&quot; ;


如上PHP脚本的输出应该为
1
2
3
10



  函数内的静态变量不是存储在函数的栈空间中， 而是存储在了堆空间中，无论函数调用多少次，静态变量仅初始化一次， 并且每次对静态变量的操作的都会累积。
...</content>
  </entry>

  <entry>
    <title>PHP in_array 源码学习， 以及in_array和isset效率比较</title>
    <link href="http://huyongde.github.io/2017/07/19/php-in_array&&isset-sourcecode.html"/>
    <updated>2017-07-19T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2017/07/19/php-in_array&&isset-sourcecode</id>
    <content type="html">背景知识

工作中通过xhprof分析接口性能，在xhprof产生的结果中发现如下一条


  
    
      Function Name
      Calls
      Calls%
      Incl. Wall Time(microsec)
      IWall%
      Excl. Wall Time(microsec)
    
    
      in_array
      6,115
      36.9%
      1,857,818
      43.6%
      1,857,818
    
  


调用了6K次的in_array耗时接...</content>
  </entry>

  <entry>
    <title>登录git发评论专用页</title>
    <link href="http://huyongde.github.io/2017/05/24/login-git.html"/>
    <updated>2017-05-24T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2017/05/24/login-git</id>
    <content type="html">登录git发评论专用页,点击下面的登录按钮，登录git
</content>
  </entry>

  <entry>
    <title>php 扩展信息查看</title>
    <link href="http://huyongde.github.io/2017/04/21/php-extension-info.html"/>
    <updated>2017-04-21T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2017/04/21/php-extension-info</id>
    <content type="html">查看php扩展的相关信息
</content>
  </entry>

  <entry>
    <title>Yii 框架missingAction函数xss漏洞分析解决</title>
    <link href="http://huyongde.github.io/2017/01/18/php-Yii-xss.html"/>
    <updated>2017-01-18T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2017/01/18/php-Yii-xss</id>
    <content type="html">Yii missingAction xss漏洞
missingAction 是Yii框架controller层用来处理用户请求的action不存在的情况的方法， 在CController.php中实现。

core/web/CController.php中，missingAction代码如下， CController.php全部代码

/**
 * Handles the request whose action is not recognized.
 * This method is invoked when the controller cannot find the request...</content>
  </entry>

  <entry>
    <title>php 扩展开发--- 开发PHP第一个扩展</title>
    <link href="http://huyongde.github.io/2016/12/17/php-extension-first-extension.html"/>
    <updated>2016-12-17T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/12/17/php-extension-first-extension</id>
    <content type="html">开发PHP第一个扩展
1 使用ext_skel 生成扩展的骨架
下载php源码，源码的ext目录下有个shell脚本ext_skel, 此脚本是用来生成PHP扩展框架的， 使用示例：

cd ./ext/ ;
./ext_skel --extname=myext // 生成名为myext的扩展


生成之后目录结构如下：

$ tree .
.
|-- CREDITS
|-- EXPERIMENTAL
|-- config.m4
|-- config.w32
|-- myext.c
|-- myext.php
|-- php_myext.h
`-- tests
    `-- 001.p...</content>
  </entry>

  <entry>
    <title>php 扩展开发--- config.m4解读</title>
    <link href="http://huyongde.github.io/2016/12/15/php-extension-config.m4.html"/>
    <updated>2016-12-15T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/12/15/php-extension-config.m4</id>
    <content type="html">1. ext_skel 扩展骨架生成的 config.m4解读

config.m4 实例
dnl $Id$
dnl config.m4 for extension example
PHP_ARG_WITH(example, for example support,
[  --with-example[=FILE]       Include example support. File is the optional path to example-config])
PHP_ARG_ENABLE(example-debug, whether to enable debugging sup...</content>
  </entry>

  <entry>
    <title>yii table schema cache and query result cache</title>
    <link href="http://huyongde.github.io/2016/10/19/yii-study-cache.html"/>
    <updated>2016-10-19T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/10/19/yii-study-cache</id>
    <content type="html">简介

本文主要介绍YII框架性能优化相关的两个方法：数据库表元信息cache以及数据库查询结果cache。

Yii db schema cache 相关：

  
    Yii框架可能比较慢的原因: 
 It will do a show columns query, then a show create tablequery, then finally it will query the database for the actual data. Those first two queries are so Yii knows the schema of your user ta...</content>
  </entry>

  <entry>
    <title>sublime text 3  扩展包安装以及遇到的问题</title>
    <link href="http://huyongde.github.io/2016/06/24/sublime-text3-package.html"/>
    <updated>2016-06-24T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/06/24/sublime-text3-package</id>
    <content type="html">简介
最近在用sublime text3, 通过package control 可以安装的扩展包真的太多了，很强大
但是在安装的时候遇到了一些问题

VCS gutter


  具体介绍和安装可以去git官网 , 
  这个sublime 3 的插件主要是来判断某一行代码是否被修改删除或者添加过， 支持的版本控制系统(vcs: version control system )有git, svn, hg等.
  VCS Gutter对于git来说就相当于git Gutter, 安装VCS Gutter之后，就可以remove 掉 Git Gutter了.
  安装完成之后，需要修改用户配...</content>
  </entry>

  <entry>
    <title>php output buffering 配置和相关函数学习</title>
    <link href="http://huyongde.github.io/2016/06/07/php-output-buffering.html"/>
    <updated>2016-06-07T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/06/07/php-output-buffering</id>
    <content type="html">简介
output buffering 简称ob, 是输出缓冲区， 通过php配置以及output control （输出控制函数）来控制php的输出， 输出控制函数不会作用于setcookie以及header两个输出标头的函数， 只
会作用于类似与echo类的函数.

php 缓冲区分类


  用户缓冲区 通过ob_xxx函数来操作， ob_start创建一个用户缓冲区
  php默认缓冲区
  sapi缓冲区


output buffering 相关的php 配置

  
    output_buffering boolean/integer 该选项设置为 On 时，将在所有的...</content>
  </entry>

  <entry>
    <title>xhprof 分析php应用程序的性能</title>
    <link href="http://huyongde.github.io/2016/05/26/php-xhprof.html"/>
    <updated>2016-05-26T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/05/26/php-xhprof</id>
    <content type="html">主要是四个步骤


  
    安装php xhprof扩展
  
  
    代码入口加上xhprof的启用和分析数据收集的代码
  
  
    分析数据可视化， xhprof_data目录需要修改权限，否则可能存在写分析数据和读分析数据失败的问题
  
  
    安装graphviz 之前需要确定是否安装了libpng,最好自己安装一遍libpng, 参考
  


</content>
  </entry>

  <entry>
    <title>apache配置</title>
    <link href="http://huyongde.github.io/2016/05/03/apache-httpd-conf.html"/>
    <updated>2016-05-03T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/05/03/apache-httpd-conf</id>
    <content type="html">0. 简介
学习apache配置，主要是按照指令来学习，争取每天学习几个

1. 配置指令

1.1 BrowserMatch
对不同的UA进行一些特殊的配置，包括

  nokeepalive 禁用keepalive; eg:BrowserMatch ^Mozilla nokeepalive
  force-response-1.0 对所有请求强制进行http1.0的响应
  downgrade-1.0 对所有的请求强制当作http 1.0 的请求来处理


例子:

  BrowserMatch “Mozilla/2” nokeepalive
  BrowserMatch “MSIE...</content>
  </entry>

  <entry>
    <title>正则表达式学习整理(一)</title>
    <link href="http://huyongde.github.io/2016/05/02/regex-learn.html"/>
    <updated>2016-05-02T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/05/02/regex-learn</id>
    <content type="html">0. 简介

下雨天在家，看看资料，再熟悉下正则表达式， 参考的文档是 正则表达式入门

本次主要是记录正则表达式相关的元字符、字符转义、重复、字符类、分枝条件、分组、反义、反向引用、零宽断言、负向零宽断言、贪婪与懒惰、处理选项等

1. 元字符
元字符分几部分，主要包括用来表示字符的，用来表示位置的，用来表示重复次数的.


  
    
      字符
      说明
    
  
  
    
      .
      匹配除换行以外的任意字符
    
    
      \w
      匹配字符数字下划线汉字
    
    
      \s
      匹...</content>
  </entry>

  <entry>
    <title>http 传递数组形式的参数</title>
    <link href="http://huyongde.github.io/2016/04/29/http-array-params.html"/>
    <updated>2016-04-29T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/04/29/http-array-params</id>
    <content type="html">http两中传参方式
1.普通字符串
eg:  a=1&amp;amp;b=2


2.数组
info[name]=huyongde&amp;amp;info[age]=20


后端$_GET['info']或者$_POST['info'] 是一个数组，array('name'=&amp;gt;'huyongde', 'age'=&amp;gt;20);

** 注意：无论post还是Get请求都是可以传递数组参数奥。**

</content>
  </entry>

  <entry>
    <title>vim 配置(二) -- map 类操作</title>
    <link href="http://huyongde.github.io/2016/04/04/vim-map.html"/>
    <updated>2016-04-04T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/04/04/vim-map</id>
    <content type="html">0. 简介
通过map可以配置vim一些快捷键操作，比如map &amp;lt;C-a&amp;gt; ggVG 来设置Ctrl+a 选择vim正在编辑的文件的所用内容。
在介绍map命令之前，先介绍一下vim的不同模式，在vim不同模式下都有对应的map操作。

1. VIM 模式


  Normal Mode: 普通模式，vim打开文件默认就是这种模式，从其他模式通过esc 切换到normal mode
  Visual Mode: 可视模式， vim在normal mode下通过按键v 进入可视模式,可视模式下可以选定多个字符，多行,多列等。
  Insert Mode: 插入模式，在插入模式下...</content>
  </entry>

  <entry>
    <title>VIM 配置(一)--基础篇</title>
    <link href="http://huyongde.github.io/2016/04/02/vim-configure.html"/>
    <updated>2016-04-02T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/04/02/vim-configure</id>
    <content type="html">0. 简介

vim配置弄过很多，关于编码的，缩进的，taglist, nerdtree， vundle插件管理器等的配置。假期有空重新整理学习学习

准备从如下几个方面去整理：


  vim基础配置学习，如编码，缩进
  vim各项配置命令学习,如map, aotocmd, command等等
  vundle 安装使用
  自动代码格式化
  各语言代码语法自动检查
  代码补全



  本篇主要介绍下vim相关的基础配置


1. 相关配置
####1.1 设置保存vimrc自动生效


  autocmd! bufwritepost .vimrc source ~/.vimr...</content>
  </entry>

  <entry>
    <title>php stream扩展学习</title>
    <link href="http://huyongde.github.io/2016/03/31/php-stream-extension.html"/>
    <updated>2016-03-31T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/03/31/php-stream-extension</id>
    <content type="html">参考

  php stream extension manual 
  php支持的协议和封装协议
  上下文选项和参数


0. 简介


  
    stream 扩展是PHP4.3.0版本发布出来的，用来泛华文件，网络等的操作。
stream可以简单的定义为一个资源对象,可以 提供一些流操作。
这个流可以读写，并且可以定位到流的任意位置(arbitrary location)
  
  
    既然是泛华了很多资源的操作，就需要有个封装来进行特定协议的解析和加密解密。
  


比如HTTP相关的封装会实现从一个url转换成一个标准的http请求，发送到server端。

 ...</content>
  </entry>

  <entry>
    <title>php扩展操作相关的函数</title>
    <link href="http://huyongde.github.io/2016/03/29/php-extensions-funcs.html"/>
    <updated>2016-03-29T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/03/29/php-extensions-funcs</id>
    <content type="html">简介


  介绍PHP中操作扩展的 相关的函数如dl(), get_loaded_extensions(), get_extension_funcs()等


函数学习

1. dl()


  说明 bool dl(string $library) 动态载入指定参数$library相关的扩展
  参数  扩展的名称
  返回值 成功返回true, 失败返回false;
  例子


if (!extension_loaded('sqlite')) {
    if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
        dl('p...</content>
  </entry>

  <entry>
    <title>php7 进行简单的php扩展开发</title>
    <link href="http://huyongde.github.io/2016/03/28/php7-ext.html"/>
    <updated>2016-03-28T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/03/28/php7-ext</id>
    <content type="html">php扩展开发步骤


  
    用php-src/ext下面的php扩展骨架生成工具生成扩展的骨架，具体命令是 ./ext_skel --extname=say
  
  进行相关配置修改
  修改扩展需要的c代码
  运行phpize来生成编译扩展需要的configure
  运行./configure
  sudo make; sudo make install
  修改php的配置文件，(通过php –ini查看配置文件位置), 添加extension=say.so
  调用扩展定义的函数


##参考

  php7 扩展开发

</content>
  </entry>

  <entry>
    <title>进程，线程，协程 学习比较</title>
    <link href="http://huyongde.github.io/2016/03/19/process-thread-coroutine.html"/>
    <updated>2016-03-19T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/03/19/process-thread-coroutine</id>
    <content type="html">###参考

  廖雪峰协程介绍
  UC 技术博客-协程实现基础
  进程线程协程和goroutine那些事
  sf上七牛云介绍python中进程线程协程相关技术
  赖勇浩 协程介绍


###相关知识汇总
协程可以认为是一种**用户态轻量级的线程**，操作系统是感知不到协程的存在的。
与系统提供的线程不同点是， 它需要主动让出CPU时间，而不是由系统进行调度，
即控制权在程序员手上,只需要进行用户态上下文切换。

既然看成是用户态线程，那必然要求程序员自己进行各个协程的调度，
这样就必须提供一种机制,供编写协程的人将当前协程挂起，即保存协程运行场景的一些数据，
调度器在其他协程挂...</content>
  </entry>

  <entry>
    <title>linux 服务器集群系统，LVS学习</title>
    <link href="http://huyongde.github.io/2016/03/17/linux-virtual-server-lvs.html"/>
    <updated>2016-03-17T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/03/17/linux-virtual-server-lvs</id>
    <content type="html">###参考
本文参考章文嵩博士的LVS 服务器集群系统

###LVS 简介

  LVS 是linux virtual server, 是通过一些手段，让服务可以承载大流量和大压力,  其中包括负载均衡技术和负载调度算法, 
下面介绍在第四层(传输层)上的负载均衡技术


###负载均衡技术

  网络地址转换实现虚拟服务器(virtual server via Network Address Translation, VS/NAT), 通过网络地址（IP 和Port）转换，
调度器重写请求报文的目的地址(IP 和 port)，根据预设的调度算法,讲去请求分配给后端真实的服务器。后端真...</content>
  </entry>

  <entry>
    <title>vim markdown语法高亮插件</title>
    <link href="http://huyongde.github.io/2016/03/16/vim-markdown-plugin.html"/>
    <updated>2016-03-16T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/03/16/vim-markdown-plugin</id>
    <content type="html">插件vim-markdown  github 主页

安装插件

安装直接添加如下plugin配置, 然后执行PluginInstall(前提是你已经安装了vim-Plugin)

Plugin 'godlygeek/tabular'
Plugin 'plasticboy/vim-markdown'


其他配置

let g:vim_markdown_folding_disabled = 1 &quot;&quot;&quot;&quot;设置不做代码折叠
let g:vim_markdown_frontmatter=1 &quot;&quot; 设置支持yaml语法


设置完后就可以愉快的在vim下写jekyll搭建的博客的文章了。
</content>
  </entry>

  <entry>
    <title>jekyll搭建github page 博客汇总</title>
    <link href="http://huyongde.github.io/2016/03/15/building-blog-summary.html"/>
    <updated>2016-03-15T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/03/15/building-blog-summary</id>
    <content type="html">###搭建huyongde.github.io过程中总结的,和大家分享下


  通过jekyll生成博客模板，并把博客迁移到github page上详情见jekyll 入门 &amp;amp;&amp;amp; jekyll 搭建github page的框架


####博客目前支持的功能

  tags
  archive
  首页文章分页功能
  访问pv,uv计数
  访问者地理分布图
  disqus的评论系统
  显示具有相同 tag的文章


####添加相关功能的方法

  为博客添加评论系统disqus
  添加tags页面
  添加archives归档页面
  添加tag相同的相关文...</content>
  </entry>

  <entry>
    <title>mac 安装php7</title>
    <link href="http://huyongde.github.io/2016/03/13/mac-install-php7-install.html"/>
    <updated>2016-03-13T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/03/13/mac-install-php7-install</id>
    <content type="html">###homebrew


  The missing package manager for OS X


homebrew可以用来在mac上安装一些软件和库，比如mysql, nginx, redis等，它会把所需要的依赖给你自动安装。

homebrew有基本的几个命令


  brew install xxx
  brew search xxx
  brew update
  brew unintall xxx


homebrew具体请参考官网homebrew home

###brew来安装php

安装命令是:brew install homebrew/php/php70
...</content>
  </entry>

  <entry>
    <title>docker 入门学习</title>
    <link href="http://huyongde.github.io/2016/03/13/docker-%E5%85%A5%E9%97%A8.html"/>
    <updated>2016-03-13T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/03/13/docker-入门</id>
    <content type="html">
  本文主要介绍如何在mac上安装docker，以及简单的把玩docker


###安装
docker官网docker

官网提供的下载链接点击下载

从官网提供的github下载链接下载速度比较慢，可以去我分享的网盘下载链接

下载完了之后一直下一步安装OK了。

###把玩docker

  
    
      
        
          for i in docker ps -a
          grep nginx
          grep -v Up
          awk ‘{print $1}’; do docker rm $i;done  ...</content>
  </entry>

  <entry>
    <title>PHP性能之路</title>
    <link href="http://huyongde.github.io/2016/03/12/sf-performance-travel.html"/>
    <updated>2016-03-12T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/03/12/sf-performance-travel</id>
    <content type="html">###PHP 性能之路

  纵观语言发展历史，从0和1的机器码开始，到汇编语言，然后到C语言，再到动态脚本语言PHP。执行效率呈指数下降，但是，学习门槛也呈指数降低。PHP语言不仅屏蔽了C的内存&amp;gt; 管理和指针的复杂性，而且更进一步屏蔽了变量类型的复杂性。提升了项目开发的效率，降低了学习的门槛，但同时牺牲了一定的执行性能。然后，HHVM的Hack给我们一种“回归&amp;gt; 原始”的感觉，重新引入了变量的复杂性。当然，不同的语言解决不同场景下的问题，并不能够一概而论




####前戏


  95年php诞生，
  php (personal home page)
  81.9%的...</content>
  </entry>

  <entry>
    <title>php 迭代器、yield、生成器以及协程</title>
    <link href="http://huyongde.github.io/2016/03/08/php-iterator-yield-generator-coroutine.html"/>
    <updated>2016-03-08T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/03/08/php-iterator-yield-generator-coroutine</id>
    <content type="html">####参考

  php生成器和协程实现
  在PHP中使用协程实现多任务调度(鸟哥)
  php生成器和协程的实现


###学习总结

  迭代器的优点是在处理大量数据的时候不需要一次性全部加载到内存中.
  协程是基于iterator, yield, generator 实现的.
  有yield的函数就变成了一个generator.
  yield返回的是一个iterator.
  yield既可以返回也可以接收数据.

</content>
  </entry>

  <entry>
    <title>IO多路复用 (select, pool, epool)</title>
    <link href="http://huyongde.github.io/2016/03/07/select-pool-epool-2.html"/>
    <updated>2016-03-07T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/03/07/select-pool-epool-2</id>
    <content type="html">###参考
作者：罗志宇
链接：https://www.zhihu.com/question/32163005/answer/55772739
来源：知乎
著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。

###说明本文原文转载，主要是方便自己学习,原文出处见上面

###正文

假设你是一个机场的空管， 你需要管理到你机场的所有的航线， 包括进港，出港， 有些航班需要放到停机坪等待，有些航班需要去登机口接乘客。

你会怎么做?

最简单的做法，就是你去招一大批空管员，然后每人盯一架飞机， 从进港，接客，排位，出港，航线监控，直至交接给下一个空港，全程监控。

那么...</content>
  </entry>

  <entry>
    <title>学习redisbook, 了解redis设计和原理</title>
    <link href="http://huyongde.github.io/2016/03/06/redisbook-learn.html"/>
    <updated>2016-03-06T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/03/06/redisbook-learn</id>
    <content type="html">redisbook介绍


  redisbook是huangjianhong大神写的，介绍redis设计和实现的一本，redis入门提高很好的一本书。


相关学习资源


  带注释的redis源码
  redisbook网站
  redis pdf 版本下载  pdf版本已经大概看了一遍，确实对redis设计以及底层实现有了一些了解.


目录

  内部数据结构
    
      sds
      双端链表
      字典
      跳跃表
    
  
  内存数据结构
    
      intset，整数集合
      压缩列表
    
  
  Redi...</content>
  </entry>

  <entry>
    <title>如何获得手机4G或者3G网络的数据包</title>
    <link href="http://huyongde.github.io/2016/03/04/mobile-network-packet-sniffer.html"/>
    <updated>2016-03-04T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/03/04/mobile-network-packet-sniffer</id>
    <content type="html">###思路


  移动端建热点，电脑连接移动建的热点，然后通过电脑访问某个网页就可以抓到通过移动4G或者3G访问网页的数据包，就可以分析下载速度等的问题

</content>
  </entry>

  <entry>
    <title>golang 解析toml配置文件</title>
    <link href="http://huyongde.github.io/2016/03/02/golang-parse-toml.html"/>
    <updated>2016-03-02T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/03/02/golang-parse-toml</id>
    <content type="html">#####golang代码如下：
package main

import (
    &quot;fmt&quot;

    &quot;github.com/BurntSushi/toml&quot;
)

func main() {
    str_toml := `[[conf]]
        [[conf.a1]]
        min = 10
        max = 10240
        [[conf.a2]]
        min = 5000
        max = 10240
        [[conf.a3]]
        &quot;xxxx.yyyy.com&quot;=[0 ,100]
 ...</content>
  </entry>

  <entry>
    <title>检查当前svn路径下面修改的PHP文件是否有语法错误(以及其他小技巧)</title>
    <link href="http://huyongde.github.io/2016/02/29/check-svn-M-syntax.html"/>
    <updated>2016-02-29T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/02/29/check-svn-M-syntax</id>
    <content type="html">1. 检查修改的php代码是否有语法错误

一行shell代码搞定，代码如下：

cd $1;for i in `svn st | awk '$1==&quot;M&quot; || $1==&quot;A&quot;{print $2}'`; do php -l $i;done



  使用说明:$1是要检查的文件夹路径，借助php -l参数，来完成检查


2. 批量添加文件下新添加的文件到svn

同样是一行代码:

svn add `svn st | grep -E &quot;^\?.*.php&quot; | awk '{print $2}' | xargs`


</content>
  </entry>

  <entry>
    <title>网站短连接生成原理</title>
    <link href="http://huyongde.github.io/2016/02/27/short-url.html"/>
    <updated>2016-02-27T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/02/27/short-url</id>
    <content type="html">短连接生成的两种方式


  目前我所了解的短链接生成有两种方式



  完全基于压缩算法，这样可以不使用数据库，直接使用压缩解压即可。
  基于数据库存储长短链接直接的对应关系。



  第二种方法，需要把长连接对应到一个唯一ID，通过把唯一的ID转化为62位的字符串(26个小写字母，26个大写字母加0-9十个数字),
唯一的ID按照62求余，求余数对应的62进制的字符，再把每个对应的字符链接起来.短链接一般6位，这样就可以表示62的6次方个url,500亿左右。把生成的唯一ID，短连接和长连接存储在nosql或者mysql中。


唯一的ID获取方式有以下几种


  长url的...</content>
  </entry>

  <entry>
    <title>redis主从复制介绍</title>
    <link href="http://huyongde.github.io/2016/02/26/redis-master-slave-replication.html"/>
    <updated>2016-02-26T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/02/26/redis-master-slave-replication</id>
    <content type="html">简介
Redis的replication机制允许slave从master那里通过网络传输拷贝到完整的数据备份。具有以下特点：


  异步复制。从2.8版本开始，slave能不时地从master那里获取到数据。
  允许单个master配置多个slave
  slave允许其它slave连接到自己。一个slave除了可以连接master外，它还可以连接其它的slave。形成一个图状的架构。
  master在进行replication时是非阻塞的，这意味着在replication期间，master依然能够处理客户端的请求。
  slave在replication期间也是非阻塞的，也可以接...</content>
  </entry>

  <entry>
    <title>mysql innodb 事务日志ib_logfile</title>
    <link href="http://huyongde.github.io/2016/02/26/mysql-transaction-log.html"/>
    <updated>2016-02-26T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/02/26/mysql-transaction-log</id>
    <content type="html">###简介

事务日志或称redo日志，在mysql中默认以ib_logfile0,ib_logfile1名称存在,
可以手工修改参数，调节开启几组日志来服务于当前mysql数据库,mysql采用顺序，
循环写方式，每开启一个事务时， 会把一些相关信息记录事务日志中
(记录对数据文件数据修改的物理位置或叫做偏移量);

作用:在系统崩溃重启时，作事务重做；在系统正常时，每次checkpoint时间点，
会将之前写入事务应用到数据文件中。

###引入一个问题

**在m/s环境中,innodb写完ib_logfile后,服务异常关闭，会不会主库能用ib_logfile恢复数据，而
bin...</content>
  </entry>

  <entry>
    <title>mysql 主从复制</title>
    <link href="http://huyongde.github.io/2016/02/26/mysql-replication.html"/>
    <updated>2016-02-26T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/02/26/mysql-replication</id>
    <content type="html">###简介


  
    MySQL的Replication是一个异步复制的过程,现在新的版本支持异步和半同步的过程，
它是从一个Mysql master 实例 复制到Mysql slave instance的过程。
在master与slave之间实现整个复制过程主要由三个线程来完成，
slave端包括SQL线程和IO线程，master端包括一个IO线程。
  
  
    要实现MySQL的Replication，第一必须打开master端的binlog。 因为mysql的整个主从复制过程实际上就是：
slave端从master端获取binlog日志，然后再在自己身上完全顺序的执...</content>
  </entry>

  <entry>
    <title>netstat 实际使用例子</title>
    <link href="http://huyongde.github.io/2016/01/17/shell-netstat-command.html"/>
    <updated>2016-01-17T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/01/17/shell-netstat-command</id>
    <content type="html">本文参考: netstat command examples

###netstat 简介

netstat - Print network connections, routing tables, interface statistics, 
masquerade connections, and multicast memberships

###netstat 使用例子


  netstat -a  显示所有的网络连接
  netstat -at; netstat -au  显示特定协议的连接， t 选项显示tcp协议， u 选项显示udp协议
  netstat -atn  选...</content>
  </entry>

  <entry>
    <title>抓包神器 charles, 抓移动端的包</title>
    <link href="http://huyongde.github.io/2016/01/15/charles-packet-sniffer.html"/>
    <updated>2016-01-15T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/01/15/charles-packet-sniffer</id>
    <content type="html">简介

之前在thinkpad上，是用猎豹建wifi, 电脑建个热点，手机链接热点，然后wireshark抓包，
但是wireshark follow tcp 流之后看不到请求的response header,
 好坑，好坑，好坑(很low的，大家轻拍)

自从转战mac之后，就没再怎么定位移动端的问题了， 最近PM们又开始说移动端有问题了，
然后说是我们server导致的, 又有了抓移动端的包的需求.

从全能QA 同学那里了解到了charles,看了第一眼我就爱上了这个东西，
logo既然是个大茶壶,谁都不要阻拦我去用它。


charles官网charles

安装
charles...</content>
  </entry>

  <entry>
    <title>go import 导入包介绍</title>
    <link href="http://huyongde.github.io/2016/01/12/go-import.html"/>
    <updated>2016-01-12T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/01/12/go-import</id>
    <content type="html">0. 简介
import 在go编程中用来导入go语言标准库，或者开发者自己写的go库，本文主要介绍下import导入包的各种方式

1. import 引入go库的方法

1.1 导入go语言标准库

eg:

import &quot;fmt&quot;

import导入go语言标准库， 实际上是引入$GOROOT/src下面导入对应文件夹下的go文件

1.2 相对路径导入go库
eg:

import &quot;./model&quot; 


引入当前同一目录下的model

1.3 绝对路径导入go库

eg:

import 'log/mylog' 


导入$GOPATH/src/log/mylog目录下的...</content>
  </entry>

  <entry>
    <title>select poll epoll 简单介绍和比较</title>
    <link href="http://huyongde.github.io/2016/01/11/select-poll-epoll.html"/>
    <updated>2016-01-11T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/01/11/select-poll-epoll</id>
    <content type="html">###0. 简介


  select，poll，epoll都是IO多路复用的机制。I/O多路复用就通过一种机制，实现单线程可以监视多个描述符，一旦某个描述符就绪（一般是读就绪或者写就绪），能够通知程序进行相应的读写操作。
  但select，poll，epoll本质上都是同步I/O，因为他们都需要在读写事件就绪后自己负责进行读写，也就是说这个读写过程是阻塞的。
  而异步I/O则无需自己负责进行读写，异步I/O的实现会负责把数据从内核拷贝到用户空间。


###1. select

  
    select最早于1983年出现在4.2BSD中，它通过一个select()系统调用来监视...</content>
  </entry>

  <entry>
    <title>icmp ping flood attack( one of DOS attack</title>
    <link href="http://huyongde.github.io/2016/01/09/icmp-ping-flood.html"/>
    <updated>2016-01-09T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/01/09/icmp-ping-flood</id>
    <content type="html">###参考
icmp ping flood

DOS :
</content>
  </entry>

  <entry>
    <title>vim go 开发环境配置</title>
    <link href="http://huyongde.github.io/2016/01/08/go-vim-development-plugin.html"/>
    <updated>2016-01-08T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/01/08/go-vim-development-plugin</id>
    <content type="html">参考

  goweb 编程-go开发工具
  配置vim go 开发环境


简介
搭建vim 开发golang的环境,作为一个初级vimer，慢慢向高级迈进。


0.vim插件管理工具 vundle
vundle 安装和使用，参考vundle 管理vim插件

0.1 go相关tools安装

通过vim中:GoInstallBinaries 来安装go开发相关的tools, （GoInstallBinaries 依赖mercurial需要先命令行安装mercurial, mercurial是google开发的类似于svn，git的代码托管服务）
安装完成后，tools的bin文件...</content>
  </entry>

  <entry>
    <title>jekyll 相关资料汇总</title>
    <link href="http://huyongde.github.io/2016/01/05/jekyll-deep-learn.html"/>
    <updated>2016-01-05T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/01/05/jekyll-deep-learn</id>
    <content type="html">##参考


  jekyll 官网
  jekyll document
  liquid语法介绍


下定决心要好好学习下jekyll, 之后好完善自己的blog

###需要学习的资料

####jekyll相关

  jekyll variables  jekyll 相关的变量， 从总可以学习如何获得整个站点或者一个page的各项信息。
  jekyll _config.yml详细介绍


liquid 模块相关


  liquid 语法介绍 介绍稀奇古怪的liquid 模块的语法


####frontmatter 相关


  yaml frontmatter 介绍了如何写每...</content>
  </entry>

  <entry>
    <title>为blog添加归档页 archives</title>
    <link href="http://huyongde.github.io/2016/01/05/jekyll-archive.html"/>
    <updated>2016-01-05T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/01/05/jekyll-archive</id>
    <content type="html">##参考
Jekyll archives grouped by date

blog 根目录下创建文件， archives.html , 内容如下：

---
layout: page
permalink: /archives/
---

&amp;lt;h2&amp;gt;Archives&amp;lt;/h2&amp;gt;
&amp;lt;ul&amp;gt;
  {% for post in site.posts %}

    {% unless post.next %}
      &amp;lt;h3&amp;gt;{{ post.date | date: '%Y' }}&amp;lt;/h3&amp;gt;
    {% else %}
      ...</content>
  </entry>

  <entry>
    <title>显示post的相关文章(有相同的tag) related_posts</title>
    <link href="http://huyongde.github.io/2016/01/04/related-posts.html"/>
    <updated>2016-01-04T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/01/04/related-posts</id>
    <content type="html">##参考


  jekyll related_posts


##不用插件,显示文章相类似文章

直接把显示相似文章的代码放到了_layout/post.html中了，为每个post显示相关的posts。

代码如下

&amp;lt;div style=&quot;float:right;&quot;&amp;gt;
    {% assign hasSimilar = '' %}
    {% for post in site.related_posts %}
        {% assign postHasSimilar = false %}
        {% for tag in post.tags %}
...</content>
  </entry>

  <entry>
    <title>jekyll-paginate 为blog添加分页功能</title>
    <link href="http://huyongde.github.io/2016/01/04/jekyll-paginate.html"/>
    <updated>2016-01-04T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/01/04/jekyll-paginate</id>
    <content type="html">##参考

jekyll-paginate

按照教程一步步的来，最终可以搞定


  有两种显示分页的方式，一个是不显示全部的分页
  显示全部的分页的方式

</content>
  </entry>

  <entry>
    <title>为blog添加pv uv 计数</title>
    <link href="http://huyongde.github.io/2016/01/04/blog-pv-uv.html"/>
    <updated>2016-01-04T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/01/04/blog-pv-uv</id>
    <content type="html">##参考
不蒜子

##简介

通过 不蒜子 提供的计数服务，很简单的为自己的网站添加计数功能。


  必须的安装脚本


js实现的，需要引入js脚本，代码如下:

&amp;lt;script async src=&quot;https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js&quot;&amp;gt;
&amp;lt;/script&amp;gt;

##2. pv uv 标签

####2.1 PV 标签
单个用户点击n次，当做n次访问

标签代码如下：

&amp;lt;span id=&quot;busuanzi_container_site_pv&quot;&amp;gt;
    ...</content>
  </entry>

  <entry>
    <title>为jekyll搭建的blog生成tags页面</title>
    <link href="http://huyongde.github.io/2016/01/03/jekyll-tags-page.html"/>
    <updated>2016-01-03T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/01/03/jekyll-tags-page</id>
    <content type="html">##参考

Adding tag cloud and archives page to Jekyll

##简介
本文介绍如何不使用插件为github page添加标签页

##1. touch tags.html

在博客根目录生成一个tags.html文件，内容如下：

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
---
layout: page
permalink: /tags/
---
&amp;lt;ul class=&quot;tag-cloud&quot;&amp;gt;
{% for tag in si...</content>
  </entry>

  <entry>
    <title>vim 插件管理 vundle</title>
    <link href="http://huyongde.github.io/2016/01/02/vim-plugin-bundler-vundle.html"/>
    <updated>2016-01-02T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2016/01/02/vim-plugin-bundler-vundle</id>
    <content type="html">##参考
vundle配置vim使用的基本插件needtree, taglist等
##1. 简介

vim 是程序员最受欢迎的coding神器，没有之一。 合理使用插件可以做到事半功倍的效果。  vundle 把git整合到插件管理中，用户需要做的只是去Github上找到自己想要的插件的名字，安装，更新和卸载都可有vundle来完成了。 虽然去发现一个好的插件仍然是一个上下求索的过程，但是用户已经可以从安装配置的繁琐过程解脱了。 



  Vundle git repo 介绍了如何安装vundle和通过vundle来安装vim插件
  vundle.txt


##2. 安装&amp;amp...</content>
  </entry>

  <entry>
    <title>go 基础学习</title>
    <link href="http://huyongde.github.io/2015/12/28/go-basic-learn.html"/>
    <updated>2015-12-28T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/12/28/go-basic-learn</id>
    <content type="html">本文将介绍如何定义变量、常量、Go语言内置类型及Go语言程序设计中的一些技巧。


定义变量
Go语言里面定义变量有多种方式。

使用var关键字是Go语言最基本的定义变量方式，与C语言不同的是Go语言把变量类型放在变量名后面，如下所示。

定义一个变量

//定义一个名称为“variableName”，类型为”type”的变量

var variableName type


定义多个变量。

//定义三个类型都是“type”的三个变量

var vname1, vname2,vname3 type


定义变量并初始化值。

//初始化“variableName”的变量为“value...</content>
  </entry>

  <entry>
    <title>go语言 array, slice , map 简单介绍</title>
    <link href="http://huyongde.github.io/2015/12/26/golang-array-slice-map-introduction.html"/>
    <updated>2015-12-26T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/12/26/golang-array-slice-map-introduction</id>
    <content type="html">参考

1. 数组 array

array是固定长度的数组，这个和C语言中的数组是一样的，使用前必须确定数组长度。

但是和C中的数组相比，又是有一些不同的：


  
    Go中的数组是值传递类型，换句话说，如果你将一个数组赋值给另外一个数组，那么，实际上就是将整个数组拷贝一份。
  
  
    如果Go中的数组作为函数的参数，那么实际传递的参数是一份数组的拷贝，而不是数组的指针, 是值传递而不是引用传递。
 这个和C要区分开。因此，在Go中如果将数组作为函数的参数传递的话，那效率就肯定没有传递指针高了。好坑的感觉!
  
  
    array的长度也是Type的一部分，...</content>
  </entry>

  <entry>
    <title>go slice(切片)学习</title>
    <link href="http://huyongde.github.io/2015/12/25/go-slice.html"/>
    <updated>2015-12-25T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/12/25/go-slice</id>
    <content type="html">参考

##slice简介
slice切片是对底层数组Array的封装，在内存中的存储本质就是数组，体现为连续的内存块.

##slice 与 array的关系

  Go语言中的数组定义之后，长度就已经固定了，在使用过程中并不能改变其长度，而Slice就可以看做一个长度可变的数组进行使用，
  数组在使用的过程中都是值传递，将一个数组赋值给一个新变量或作为方法参数传递时，是将源数组在内存中完全复制了一份，而不是引用源数组在内存中的地址，为了满足内存空间的复用和数组元素的值的一致性的应用需求，Slice出现了，每个Slice都是都源数组在内存中的地址的一个引用，源数组可以衍生出多个Sli...</content>
  </entry>

  <entry>
    <title>nginx lua 学习</title>
    <link href="http://huyongde.github.io/2015/12/24/ngx-lua-learn.html"/>
    <updated>2015-12-24T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/12/24/ngx-lua-learn</id>
    <content type="html">参考

1.1. 介绍


  ngx_lua – 把lua语言嵌入nginx中,使其支持lua来快速开发基于nginx下的业务逻辑
该模块不在nginx源码包中，需自行下载编译安装。使用lua 5.1（目前不支持lua 5.2） 或 luajit 2.0 。
添加lua支持后，开发复杂的模块，周期快，依然是100%异步非阻塞。
  ngx_lua 哪些人在用:
淘宝、腾讯财经、网易财经、360、去哪儿网等
CloudFlare, CNN, Wingify, Reblaze, Turner, Broadcasting System
  该项目主要开发者：
chaoslawful Taob...</content>
  </entry>

  <entry>
    <title>nginx 的 sendfile tcp_nodelay  tcp_nopush 配置详解</title>
    <link href="http://huyongde.github.io/2015/12/20/nginx-sendfile-tcp_nodelay-tcp_nopush.html"/>
    <updated>2015-12-20T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/12/20/nginx-sendfile-tcp_nodelay-tcp_nopush</id>
    <content type="html">sendfile

现在流行的web 服务器里面都提供 sendfile 选项用来提高服务器性能，那到底 sendfile是什么，怎么影响性能的呢？

sendfile实际上是 Linux2.0+以后的推出的一个系统调用，web服务器可以通过调整自身的配置来决定是否利用 sendfile这个系统调用。

先来看一下不用 sendfile的传统网络传输过程：

read(file,tmp_buf, len);
write(socket,tmp_buf, len);
硬盘 &amp;gt;&amp;gt; kernel buffer &amp;gt;&amp;gt; user buffer&amp;gt;&amp;gt; kernel s...</content>
  </entry>

  <entry>
    <title>go 学习资料汇总</title>
    <link href="http://huyongde.github.io/2015/12/14/go-learn.html"/>
    <updated>2015-12-14T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/12/14/go-learn</id>
    <content type="html">go 简介

go语言是一个开源的项目，让程序员(programmer)能有更多的产出.
go语言简单易懂，执行高效。他有很好的并发机制(concurrency/kənkʌrənsɪ/ mechanism /mekənɪzəm/)
以及很好的垃圾回收(garbage collection). go是一个静态的编译型语言，但他看起来更像动态的解释型语言。
 (PS  翻译的不好，原文请参考
 go doc)

go 安装

参考文档 go 安装

这里不详细介绍，很简单。

go语法学习

看过的资料

  how to write go code 介绍了go代码的基本组织结构，有个简单的...</content>
  </entry>

  <entry>
    <title>英语单词学习</title>
    <link href="http://huyongde.github.io/2015/12/14/english-learn.html"/>
    <updated>2015-12-14T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/12/14/english-learn</id>
    <content type="html">##go学习涉及到的单词


  demonstrate /`demənstreɪt/ 介绍说明
  screencast 视频教程
  repository /rɪ`pɑːzətɔːri, 仓库代码库
  hierarchy /`haɪərɑːrki/ 组织结构，阶层
  mercurial /mɜː`kjʊriəl/  易变的
  comprise 包括
  typical /`tipikl/ 通常的
  distinction /di`stigksn/ 区别
  specify /spesɪfaɪ/ 指定
  installation /ˌɪnstə`leɪʃn/ 安装  名词
 ...</content>
  </entry>

  <entry>
    <title>autoconf  automake 学习</title>
    <link href="http://huyongde.github.io/2015/12/12/autoconf-automake-learn.html"/>
    <updated>2015-12-12T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/12/12/autoconf-automake-learn</id>
    <content type="html">简介

介绍如何使用autoconf automake 来为自己开发的c/c++程序生成符合自由软件惯例的Makefile,

这样的话，就可以和其他的GNU程序一样，通过./configure; make; make install 把自己的程序安装到linux系统中。

helloworld 示例

简单的helloworld  c程序，通过autoconf 以及 automake来生成Makefile文件，从而实现通过./configure; make; make install

来实现生成可执行的二进制文件helloworld

需要准备的文件

helloworld.c
内容...</content>
  </entry>

  <entry>
    <title>markdown语法再学习</title>
    <link href="http://huyongde.github.io/2015/12/11/markdown-learn.html"/>
    <updated>2015-12-11T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/12/11/markdown-learn</id>
    <content type="html">引用

  这是一个引用
  
    这是个嵌套引用
    
      one
      two
    
  



列表

无序列表
eg1

  one
  two
  three


eg2

  one
  two
  three
  four


eg3

  one
  three
  two
  four


有序列表
eg1

  
    onexxxxxxxxxxxxx

    xxxxxx
  
  two
  three


eg2

  one
  two
  three
  xxxx


代码块

eg1
//this is a code bloc...</content>
  </entry>

  <entry>
    <title>http 缓存策略</title>
    <link href="http://huyongde.github.io/2015/12/09/http-cache.html"/>
    <updated>2015-12-09T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/12/09/http-cache</id>
    <content type="html">##目录

  web缓存类型
  缓存相关的header
  参考



##web缓存的类型


##缓存相关的header

####response header

  cache-control
  expires
  etag
####request header
  if-modified-since
  if-none-match


####例子

如下一个304请求的相关header


  Request Headers


Accept:image/webp,image/*,*/*;q=0.8
Accept-Encoding:gzip, deflate, sdch...</content>
  </entry>

  <entry>
    <title>unix 查看window开发的代码，如何处理^M特殊字符</title>
    <link href="http://huyongde.github.io/2015/12/03/dos-mac-window-return.html"/>
    <updated>2015-12-03T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/12/03/dos-mac-window-return</id>
    <content type="html">去除代码中的^M

由于mac, linux, windows对行末尾的回车符的处理不一致，会导致在mac或者linux下查看window开发的代码的时候，行末尾存在特殊字符^M

可以通过dos2unix来去掉文件的^M

mac需要安装dos2unix

brew install dos2unix, brew 是OS X 不可或缺的套件管理工,brew的安装和使用详见官网。

安装完dos2unix之后，直接dos2unix filename就可以把filename文件中的^M去掉

</content>
  </entry>

  <entry>
    <title>写C++遇到的问题</title>
    <link href="http://huyongde.github.io/2015/12/03/cplusplus-problem.html"/>
    <updated>2015-12-03T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/12/03/cplusplus-problem</id>
    <content type="html">写C++测试程序遇到的问题

##程序访问网络弹窗提示

弹窗内容如下:



解决办法

修改项目属性，链接器-&amp;gt;清单文件-&amp;gt;uac执行级别，设置为`requireAdministrator`

              链接器-&amp;gt;清单文件-&amp;gt;uac绕过ui保护,设置为`是`


修改后的问题

第一次运行还是有弹窗，第二次运行就不会有弹窗了，问题待解决。

端的开发可真是折腾人啊，快崩溃了。
</content>
  </entry>

  <entry>
    <title>架构师培训</title>
    <link href="http://huyongde.github.io/2015/11/30/architect-introduction.html"/>
    <updated>2015-11-30T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/11/30/architect-introduction</id>
    <content type="html">##架构师的能力要求

###领悟


  抽象能力
  逻辑能力
  学习能力
  表达能力


###领域

  足够的知识积累
    
      对目标系统进行恰当的抽象。
    
  


###领袖
    在方向决策以及团队向心力上起主导作用,主要体现在团队领导上面。

##若偏则费，重在平衡

##架构设计的基本原则和方法

架构师设计产生的一个子集，架构更关注系统整体性方面的需求。


  功能性
    
      模块化
      可构建性
      可测试性
      生态系统
    
  
  非功能性
    
      可靠性
      性...</content>
  </entry>

  <entry>
    <title>chrome浏览器的相关插件</title>
    <link href="http://huyongde.github.io/2015/11/29/chrome-plugins.html"/>
    <updated>2015-11-29T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/11/29/chrome-plugins</id>
    <content type="html">####user agent switcher

可以设置发起http请求用到user-agent.

</content>
  </entry>

  <entry>
    <title>为浏览器添加vim的快捷键--for vimmer</title>
    <link href="http://huyongde.github.io/2015/11/29/bring-vim-keybindings-to-chrome.html"/>
    <updated>2015-11-29T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/11/29/bring-vim-keybindings-to-chrome</id>
    <content type="html">###目录

  简介
  chrome浏览器
  firefox浏览器



##简介

好长一段时间都在用firefox(因为没有个靠谱的vpn,没法用chrome相关功能，包括扩展更新),

最近折腾好了vpn，可以用起来google的相关功能了。

想知道怎么折腾vpn的移步翻墙看世界

对于vimmer来说，vim的各种快捷键想移植到各个用到的东西上，比如chrome浏览器，visual studio， 有道云笔记(这个暂时还没有插件)等。

下面介绍下如何在chrome和firefox中使用vim的快捷键


##chrome浏览器

需要安装chrome的插件(需要翻墙奥)...</content>
  </entry>

  <entry>
    <title>sf 小米大数据-技术小实践</title>
    <link href="http://huyongde.github.io/2015/11/28/segment-fault-xiaomi-big-data.html"/>
    <updated>2015-11-28T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/11/28/segment-fault-xiaomi-big-data</id>
    <content type="html">介绍小米大数据

##为么青睐hbase


  天生为了大数据
  改变schema很平滑
  扩容方便
  成本考虑
  facebook 等公司做了很好的示范


##小米对hbase的改进

##mysql迁移hbase


  双写
  异步同步mysql老的数据到hbase
  双读，并做数据校验
  灰度返回hbase的结果
  只写hbase


##kafka &amp;amp;&amp;amp; druid

</content>
  </entry>

  <entry>
    <title>SF 大数据技术分享--druid</title>
    <link href="http://huyongde.github.io/2015/11/28/segment-fault-big-data.html"/>
    <updated>2015-11-28T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/11/28/segment-fault-big-data</id>
    <content type="html">##druid

###技术选型

druid 和 spark等的比较，

druid 用来进行OLAP

###oneAPM 使用druid

##参考

OLAP  online analytical processing

</content>
  </entry>

  <entry>
    <title>大数据行存储还是列存储？</title>
    <link href="http://huyongde.github.io/2015/11/28/raw-or-column-store-big-data.html"/>
    <updated>2015-11-28T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/11/28/raw-or-column-store-big-data</id>
    <content type="html">介绍数据行存储和列存储的优缺点

##目录

  简介
  优缺点
  参考



##简介

面向行的数据存储架构更适用于OLTP-频繁交互事务的场景;

面向列的数据存储架构更适用于OLAP-(如数据仓库)这样在海量数据（(可能达到 terabyte规模)）中进行有限复杂查询的场景。

###OLTP和OLAP介绍

数据处理大致可以分成两大类：联机事务处理OLTP（on-line transaction processing）、联机分析处理OLAP（On-Line Analytical Processing）。

OLTP是传统的关系型数据库的主要应用，主要是基本的、日常的事务处理...</content>
  </entry>

  <entry>
    <title>linux 设置输出内容的颜色</title>
    <link href="http://huyongde.github.io/2015/11/27/linux-shell-color-echo.html"/>
    <updated>2015-11-27T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/11/27/linux-shell-color-echo</id>
    <content type="html">##目录

  例子
  自己的使用
  参考



先看下一个输出绿色字体的例子

echo &quot;colored:\e[32m\e[1mhello world\e[0m&quot;;echo &quot;end_color&quot;

输出结果如下:



其中，

\e[32m\e[1m 用来设置输出字体的颜色

\e[0m 清楚开始的设置，否则之后所有的输出都是设置的字体颜色


##自己的使用

脚本代码如下:

#!/bin/zsh
set_color=&quot;\e[32m\e[1m&quot;
clear_color=&quot;\e[0m&quot;
git add . &amp;amp;&amp;amp;  echo -e &quot;$set_color gi...</content>
  </entry>

  <entry>
    <title>tcpdump tutorial - sniffing and analysing packets from commandline</title>
    <link href="http://huyongde.github.io/2015/11/26/linux-tcpdump.html"/>
    <updated>2015-11-26T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/11/26/linux-tcpdump</id>
    <content type="html">##tcpdump

###目录

  参考


####tcpdump -D

D 选项option(开关switch)显示机器所有的网络接口,输出示例如下：

$ sudo tcpdump -D
1.en0
2.awdl0
3.bridge0
4.ppp0
5.en1
6.en2
7.p2p0
8.lo0 [Loopback]


####tcpdump -n -vv -e -A -i

n 显示ip地址，而不是显示主机名或域名

-vv 显示详细信息，包括ttl，tcp flags, 数据包长度等信息

-e 显示链路层头信息，包括源物理地址，目的物理地址等

-A 以ascii ...</content>
  </entry>

  <entry>
    <title>linux network monitor commands</title>
    <link href="http://huyongde.github.io/2015/11/26/linux-network-monitor-cmds.html"/>
    <updated>2015-11-26T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/11/26/linux-network-monitor-cmds</id>
    <content type="html">参考原文 18 commands to monitor network bandwidth on Linux server
</content>
  </entry>

  <entry>
    <title>整合disqus和jekyll，打造一个支持评论的blog</title>
    <link href="http://huyongde.github.io/2015/11/26/add-disqus-to-jekyll-for-comments.html"/>
    <updated>2015-11-26T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/11/26/add-disqus-to-jekyll-for-comments</id>
    <content type="html">##目录


  简介
  教程
  总结



##一、disqus 简介

Millions of people are talking about what they love on Disqus.

(很多人都在disqus上问题)

Everything from breaking news to science fiction.

(自己领会这句话)


##二、主要参考教程

adding disqus to jekyll这个大概介绍了怎么添加disqus到jekyll

We were unable to load Disqus  里面介绍了，那些原因会导致添加disqu...</content>
  </entry>

  <entry>
    <title>为什么~号代表home目录</title>
    <link href="http://huyongde.github.io/2015/11/25/why-tilde-represents-home-directory.html"/>
    <updated>2015-11-25T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/11/25/why-tilde-represents-home-directory</id>
    <content type="html">在unix类的系统（包括：BSD、GUN/LIUNX 以及 Mac OS X)中，波浪号(tilde)代表当前用户的home目录.

如果系统当前的登录用户是netkong,则 cd ~ 、cd /home/netkong 以及 cd $HOME是等价的，

波浪号代表用户home目录 ，是因为20世纪70年代的一款键盘上， 波浪号(tilde)和home(移动光标到最左边) 在同一个键，

后来大家就都用波浪号(tilde)当做用户home目录

当年键盘的靓图如下



文章翻译自

why tilde was chosen to represent-the-home-directory
</content>
  </entry>

  <entry>
    <title>TLS 学习</title>
    <link href="http://huyongde.github.io/2015/11/25/tls.html"/>
    <updated>2015-11-25T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/11/25/tls</id>
    <content type="html">##目录

  相关联的协议
  tls密码套件
  协议分层
  record协议
  handshake协议
  参考



##相关联的协议
###两个主要的协议

做对称加密传输的record协议；
做秘钥认证协商的handshake协议；

###三个辅助的协议

changecipher spec 协议:the change cipher spec protocol,
用来通知对端从handshake切换到record协议(有点冗余，在TLS1.3里面已经被删掉了)
alert协议:the alert protocol, 用来通知各种返回码，
application data...</content>
  </entry>

  <entry>
    <title>linux 命令学习汇总</title>
    <link href="http://huyongde.github.io/2015/11/25/linux-cmds.html"/>
    <updated>2015-11-25T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/11/25/linux-cmds</id>
    <content type="html">##目录

  killall
  lsof
  netstat
  学习计划


linux man


killall

killall(kill processes by nane) 表示通过进程名字kill进程，可以一次kill多个进程

kill -9 pid 基本可以kill掉所有的进程，除了init进程。

killall -9 nginx 可以杀掉所有通过nginx命令启动的进程


##lsof

###lsof简介
lsof 是 list open files的缩写，可以列出当前系统所有打开的文件。Linux环境下所有的事物都是以文件形式存在的。

lsof 通常在/...</content>
  </entry>

  <entry>
    <title>翻墙看世界</title>
    <link href="http://huyongde.github.io/2015/11/24/vpn-goout-see-world.html"/>
    <updated>2015-11-24T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/11/24/vpn-goout-see-world</id>
    <content type="html">##翻墙看世界(google ……)

mac系统奥，

vpn推荐 jsqgreen

####jsqgreen官网注册地址
&amp;lt;/img&amp;gt;

每个系统的安装使用，官网都有相关的教程，自己用了一阵，免费试用的线路足够用了。

jsqgreen 的缺点是，免费线路的vpn地址可能经常变，所以链接不上后，需要去官网线路列表看看，是否vpn的地址已经更新了。

设置访问国内网站不走vpn,的设置

推荐chnroutes,chnroutes github

配置完了，vpn 的ip_up 和ip_down之后能访问国内网站不走vpn了，但是还是访问不了

公司的内网。

有空再折腾...</content>
  </entry>

  <entry>
    <title>c++获得文件大小</title>
    <link href="http://huyongde.github.io/2015/11/24/cplusplus-getfilesize.html"/>
    <updated>2015-11-24T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/11/24/cplusplus-getfilesize</id>
    <content type="html">c++获得文件大小的几种方式

##第一种

#include&amp;lt;io.h&amp;gt;
#include&amp;lt;iostream&amp;gt;
using namespace std;

int main()
{
    int handle;
    handle = open(&quot;text.txt&quot;, 0x100);
    long length = filelength(handle);
    cout&amp;lt;&amp;lt; &quot;file size&quot; &amp;lt;&amp;lt; length &amp;lt;&amp;lt;endl;
    close(handle);
    return 0;
}

##第二种
...</content>
  </entry>

  <entry>
    <title>markdown 学习</title>
    <link href="http://huyongde.github.io/2015/11/23/markdown-learn.html"/>
    <updated>2015-11-23T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/11/23/markdown-learn</id>
    <content type="html">主题

 markdown 学习 



TOC

##Table of Content

  主题
  参考


##段落
通过空行来形成不同的段落

##标题

###atx标题
# The largest heading (an &amp;lt;h1&amp;gt; tag)

## The second largest heading (an &amp;lt;h2&amp;gt; tag)

…..

###### The 6th largest heading (an &amp;lt;h6&amp;gt; tag)

###setext标题

=== 一级标题

---二级标题

##引用(blockquotes)
文字前面...</content>
  </entry>

  <entry>
    <title>Learn Ngx_openresty</title>
    <link href="http://huyongde.github.io/2015/11/23/learn-ngx_openresty.html"/>
    <updated>2015-11-23T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/11/23/learn-ngx_openresty</id>
    <content type="html">Name

ngx_openresty - Turning Nginx into a full-fledged Web App Server

Table of Contents


  Name
  Description
    
      For Users
      For Bundle Maintainers
    
  
  Mailing List
  Report Bugs
  Copyright &amp;amp; License


Description

ngx_openresty is a full-fledged web application server b...</content>
  </entry>

  <entry>
    <title>jekyll 入门 && jekyll 搭建github page的框架</title>
    <link href="http://huyongde.github.io/2015/11/23/jekyll-learn.html"/>
    <updated>2015-11-23T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/11/23/jekyll-learn</id>
    <content type="html">##参考


  
    jekyll语法介绍
  
  
    jekyll 安装和初始化站点
  
  
    jekyll 入门
  
  
    markdown 设置图片大小
  


主题

 jekyll 入门 &amp;amp;&amp;amp; jekyll 搭建github page的框架 



##jekyll 安装

通过gem来安装，gem是perl语言各种扩展包得管理工具

安装命令如下：

sudo gem install jekyll


##初始化站点

mdkir jekyll_site
jekyll new jekyll_site

执行完 jekyll ...</content>
  </entry>

  <entry>
    <title>c++ setw使用 以及 markdown中 highlight 加亮代码</title>
    <link href="http://huyongde.github.io/2015/11/23/cout-setw.html"/>
    <updated>2015-11-23T00:00:00+00:00</updated>
    <id>http://huyongde.github.io/2015/11/23/cout-setw</id>
    <content type="html">主题

#c++ setw使用 以及 markdown中 highlight 加亮代码

使用setw(n)设置输出的宽度，默认是右对齐，

示例代码:

std::cout &amp;lt;&amp;lt; std::setw(5) &amp;lt;&amp;lt; &quot;1&quot;    &amp;lt;&amp;lt; std::endl;
std::cout &amp;lt;&amp;lt; std::setw(5) &amp;lt;&amp;lt; &quot;10&quot;   &amp;lt;&amp;lt; std::endl;
std::cout &amp;lt;&amp;lt; std::setw(5) &amp;lt;&amp;lt; &quot;100&quot;  &amp;lt;&amp;lt; std::endl;



通过left可以设置左对...</content>
  </entry>


</feed>
