- 博客(13)
- 收藏
- 关注
原创 golang zip 解压、压缩文件
package utils import ( "archive/zip" "fmt" "io" "io/ioutil" "log" "os" "strings" ) //压缩文件 //files 文件数组,可以是不同dir下的文件或者文件夹 //dest 压缩文件存放地址 func Compress(files []*os.File, d...
2019-05-18 21:59:23
3302
原创 golang ping IP+PORT
package utils import ( "strings" "net" "log" "time" ) //测试服务是否可用 IP:PORT func PingIPPort(host string) (result bool) { var ( ip string err error ) //获取I...
2019-05-18 21:57:19
2374
原创 golang http、https 、通过代理方式 POST
package utils import ( "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
4724
原创 golang GET http、https、代理方式
package utils import ( "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
3487
原创 golang构建函数
写代码注意事项 软件是信息流,依靠数据驱动 1. 输入数据 参数函数名+request 方便扩展,见名知意 参数合法性检查2.输出参数函数名+responsetype CheckHitResponseData struct { Fish []*CheckHitFish `json:"fish"` Sum float64 `json:"sum"` } type Che
2017-12-25 11:56:39
355
原创 ubuntu/kylin4.02sp1 mariadb 进入数据库必须使用sudo的问题
当 $ mysql -uroot -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 当$ sudo mysql -uroot -p 可以进入数据库。 问题: 以普通用户权限运行的程序没法使用数据。 解决方法;
2017-03-31 10:03:15
2616
转载 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 uftp 2: $passwd uftp 输
2017-03-20 10:07:33
543
原创 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
1101
原创 ubuntu16.04 NFS系统挂载
系统:ubuntu16.10 服务器端: step1:关闭防火墙 指令: sudo ufw disable step2:安装nfs 指令:sudoapt-get install nfs-kernel-server step3: 打开/etc/exports文件,在末尾加入:/home/daysmark/nfsdir*(rw,sync,no_root_squash)
2016-09-06 15:04:57
5696
原创 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
1542
原创 C 语言中通过脚本获取mac地址
C 语言中通过脚本获取mac地址 #include int 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
804
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人