- 博客(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
3276
原创 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
2337
原创 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
4702
原创 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
3459
原创 golang构建函数
写代码注意事项 软件是信息流,依靠数据驱动1. 输入数据 参数函数名+request方便扩展,见名知意参数合法性检查2.输出参数函数名+responsetype CheckHitResponseData struct { Fish []*CheckHitFish `json:"fish"` Sum float64 `json:"sum"`}type Che
2017-12-25 11:56:39
332
原创 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
2597
转载 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
529
原创 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
1077
原创 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
5682
原创 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
1518
原创 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
788
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人