This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
charset utf-8; | |
server_name ifels.cn www.ifels.cn 121.40.133.140; | |
access_log /home/ifels/log/ifels.blog/access.log; | |
error_log /home/ifels/log/ifels.blog/error.log info; | |
root /home/ifels/work/github/ifels.blog/public/; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
通过nginx反向代理go语言写的http服务器 | |
1. nginx 配置 | |
#列出所有服务器地址,nginx 自动均衡分发请求到各个服务器。 | |
upstream frontends { | |
ip_hash; | |
server 192.168.199.1:8088; | |
server 192.168.199.2:8089; | |
} | |
server { | |
listen 80; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ctrl + w + h 光标 focus 左侧树形目录 | |
ctrl + w + l 光标 focus 右侧文件显示窗口 | |
ctrl + w + w 光标自动在左右侧窗口切换 | |
ctrl + w + r 移动当前窗口的布局位置 | |
o 在已有窗口中打开文件、目录或书签,并跳到该窗口 | |
go 在已有窗口 中打开文件、目录或书签,但不跳到该窗口 | |
t 在新 Tab 中打开选中文件/书签,并跳到新 Tab | |
T 在新 Tab 中打开选中文件/书签,但不跳到新 Tab | |
i split 一个新窗口打开选中文件,并跳到该窗口 | |
gi split 一个新窗口打开选中文件,但不跳到该窗口 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
第一步,在/etc/yum.repos.d/目录下创建一个源配置文件mongodb.repo: | |
cd /etc/yum.repos.d/ | |
vim mongodb.repo | |
填写如下内容: | |
[mongodb] | |
name=MongoDB Repository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
第一步,在/etc/yum.repos.d/目录下创建一个源配置文件nginx.repo: | |
cd /etc/yum.repos.d/ | |
vim nginx.repo | |
填写如下内容: | |
[nginx] | |
name=nginx repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
分隔符文本对象 | |
a) or ab | A pair of (parentheses) | |
i) or ib | Inside of (parentheses) | |
a} or aB | A pair of {braces} | |
i} or iB | Inside of {braces} | |
a] | A pair of [brackets] | |
i] | Inside of [brackets] | |
a> | A pair of <angle brackets> | |
i> | Inside of <angle brackets> | |
a’ | A pair of 'single quotes' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"os" | |
"path/filepath" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function receive (prod) | |
local status, value = coroutine.resume(prod) | |
return value | |
end | |
function send (x) | |
coroutine.yield(x) | |
end | |
function producer () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"io" | |
"net/http" | |
"os/exec" | |
) | |
var ( | |
BUF_LEN = 1024 |