1. 关闭SELINUX2.安装依赖包 yum -y install make gcc openssl-devel autoconf automake rpm-build redhat-rpm-config yum -y install python-devel openssl-devel kern ...
分类:
其他好文 时间:
2019-12-20 18:09:39
阅读次数:
318
概述 Go 语言中的 new 和 make 一直是新手比较容易混淆的东西,咋一看很相似。不过解释两者之间的不同也非常容易。 他们所做的事情,和应用的类型也不相同。 二者都是用来分配空间。 new 函数 new 是内建函数,函数原型为 1 官方文档描述为: The new build-in funct ...
分类:
其他好文 时间:
2019-12-20 13:37:58
阅读次数:
78
华为交换机设备组建堆叠示例(通过业务口普通线缆) [TOC] 1、配置逻辑堆叠端口并加入物理成员端口 \ 配置SwitchA的业务口GigabitEthernet0/0/27、GigabitEthernet0/0/28为物理成员端口,并加入到相应的逻辑堆叠端口。 \ 配置SwitchB的业务口Gig ...
分类:
其他好文 时间:
2019-12-20 11:57:22
阅读次数:
233
package main import ( "io/ioutil" "log" "net/http" "os" "os/signal" ) type ProxyHandler struct { } func (*ProxyHandler) ServeHTTP(w http.ResponseWrite... ...
分类:
其他好文 时间:
2019-12-19 23:31:45
阅读次数:
98
package util import ( "fmt" "hash/crc32" "math/rand" "time" ) type HttpServer struct { //目标server类 Host string Weight int } func NewHttpServer(host st ...
分类:
编程语言 时间:
2019-12-19 23:15:00
阅读次数:
103
func (this *LoadBalance) SelectByWeightBetter(ip string) *HttpServer { rand.Seed(time.Now().UnixNano()) sumList := make([]int, len(this.Servers)) //th... ...
分类:
编程语言 时间:
2019-12-19 23:14:48
阅读次数:
125
Go函数类型的使用 type myfunc func() string // 声明函数变量 func main() { fn := func() string { return "bbb" } // 声明map myMap := make(map[string]myfunc) // map赋值 my... ...
分类:
其他好文 时间:
2019-12-19 21:18:19
阅读次数:
94
一、实验环境准备 uname -a 在本机编译linux 5.0.1 X86-64内核,重新按照64位方式编译,步骤同上一篇博客。 make x86_64_defconfig make menuconfig make #编译内核 二、Socket与系统调用 1.socket Socket API编程 ...
分类:
其他好文 时间:
2019-12-19 19:04:42
阅读次数:
80
在实际的工作中我们还需要经常用到指定某个时间生成。 例如:需要找到昨天到今天此时此刻的注册用户。 那么我们需要做两件事情: 1.得到当前的时间unix时间戳。用time()函数就可以直接搞定大理石平台支架 2.那么昨天指定时间该怎么生成呢。这个时候我们就需要使用到mktime()函数。简称:make ...
分类:
Web程序 时间:
2019-12-19 16:15:41
阅读次数:
100