自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(13)
  • 收藏
  • 关注

原创 golang zip 解压、压缩文件

package utilsimport ( "archive/zip" "fmt" "io" "io/ioutil" "log" "os" "strings")//压缩文件//files 文件数组,可以是不同dir下的文件或者文件夹//dest 压缩文件存放地址func Compress(files []*os.File, d...

2019-05-18 21:59:23 3190

原创 golang ping IP+PORT

package utilsimport ( "strings" "net" "log" "time")//测试服务是否可用 IP:PORTfunc PingIPPort(host string) (result bool) { var ( ip string err error ) //获取I...

2019-05-18 21:57:19 2291

原创 golang http、https 、通过代理方式 POST

package utilsimport ( "bytes" "encoding/json" "io/ioutil" "net/http" "crypto/tls" "log" "net/http/cookiejar" "net/url" "time")func Post(url string, arg interf...

2019-05-18 21:55:42 4651

原创 golang GET http、https、代理方式

package utilsimport ( "crypto/tls" "encoding/json" "io/ioutil" "log" "net/http" "net/url" "time")func GET(url string, reply interface{}) (err error) { var ( ...

2019-05-18 21:54:01 3398

原创 golang构建函数

写代码注意事项 软件是信息流,依靠数据驱动1. 输入数据 参数函数名+request方便扩展,见名知意参数合法性检查2.输出参数函数名+responsetype CheckHitResponseData struct { Fish []*CheckHitFish `json:"fish"` Sum float64 `json:"sum"`}type Che

2017-12-25 11:56:39 310

原创 mysql数据迁移

mysql 插入大量数据

2017-09-21 16:28:32 932

原创 线程与协程(golang goroutine)

线程协程备注调度方式抢占式(内核进行调度)用户程序自己调度

2017-03-31 10:25:17 1840

原创 ubuntu/kylin4.02sp1 mariadb 进入数据库必须使用sudo的问题

当$ mysql -uroot -pEnter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)当$ sudo mysql -uroot -p  可以进入数据库。问题: 以普通用户权限运行的程序没法使用数据。解决方法;

2017-03-31 10:03:15 2559 1

转载 ubuntu 16.04 搭建vsftp

第一步:$sudo apt-get install vsftpd第二步:新建目录/home/uftp作为用户主目录sudo mkdir /home/uftp第三步:新建用户uftp,制定用户主目录和所用shell,并设置密码1: $ sudo useradd -d /home/uftp -s /bin/bash uftp2: $passwd uftp 输

2017-03-20 10:07:33 509

原创 Ubuntu16.10下安装php的ssh2扩展

sudo apt-get install libssh2-1-dev  sudo  apt-get install php-ssh2 测试新安装的PHP的SSH2扩展运行php -m |grep ssh2重启sudo service apache2 restart

2016-09-14 09:12:35 1062

原创 ubuntu16.04 NFS系统挂载

系统:ubuntu16.10服务器端:step1:关闭防火墙指令: sudoufw disable step2:安装nfs指令:sudoapt-get install nfs-kernel-serverstep3:打开/etc/exports文件,在末尾加入:/home/daysmark/nfsdir*(rw,sync,no_root_squash)

2016-09-06 15:04:57 5639

原创 C语言测试 IP port 是否可达

#include #include #include #include #include     /* inet(3) functions */#define bool int#define false 0#define true 1/*日期:2016-7-18 * 作者:zhangyc * 函数名: checkIPandPort * 功能: 测

2016-07-19 17:06:15 1453

原创 C 语言中通过脚本获取mac地址

C 语言中通过脚本获取mac地址#includeint main(){FILE *fp;char buffer[80];fp=popen("LANG=C ifconfig| awk '/HWaddr/{ print $5 }'","r");fgets(buffer,sizeof(buffer),fp);printf("%s",buff

2016-07-19 17:04:57 772

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除