摘要:
注意上图的:分组字节流 宽窄 字符串 然后就可以搜索数据包中包含 "cloud" 的字段 阅读全文
摘要:
程序可以去github上下载,也可以下载源码编译,这里不赘述。 客户端: 启动: windows: frpc.exe -c frpc_af1.ini 配置文件 frpc_af1.ini: [common]server_addr = xxx.xxx.xxx.xxxserver_port = 7003 阅读全文
摘要:
一、背景 可能由于机器突然断过电,或者系统问题。部署的Gitlab在某天运行时突然不正常,具体表现在通过浏览器进首页时报错(错误码为500),访问其中一个仓库错误码为503。如下: 后来发现无法备份,备份到某个仓库的时候会终止。 查了一圈有人说是由于断电导致某个文件损坏了,继而引发的问题。 版本: 阅读全文
摘要:
背景: 想实现一个判断当前系统有没有外网的方法,想到了两种思路: 1)实现一个ICMP协议。但是这个需要root权限才能运行。可以参考:https://www.cnblogs.com/xcywt/p/16070814.html 2)通过ping指令,解析ping的结果来判断有没有网。 代码: 0)命 阅读全文
摘要:
背景: 想实现一个在没外网的时候就自动重启路由器的功能。 又不想用ping命令,因为在代码里调用system("ping"); 可能会比较耗时,得单开线程。于是找了个实现ICMP协议的代码。 参考:https://blog.csdn.net/qivan/article/details/7237051 阅读全文
摘要:
直接上代码: #include <iostream> #include <string> #include <vector> #include <fstream> bool ReadFile(std::string& strFile, std::vector<char>& buffer) { std 阅读全文
摘要:
记录一下位操作: /* index:[0, 7] */ bool SetOrCleanBit(unsigned char& data, int index, bool enable) { if (index < 0 || index > 7) { return false; } if (enable 阅读全文
摘要:
直接上代码: #include <termio.h> #include <stdio.h>#include <unistd.h> #include <fcntl.h> int scanKeyboard() { int in; struct termios new_settings; struct t 阅读全文
摘要:
以下是shell自动备份用的: 主要功能: 1)将pathSrc目录中的文件拷贝到pathDst目录中去。 具体步骤:先查询源目录和目标目录中的文件,分别存在fileSrc和fileDst中。 -> 来两个循环,比较。不在fileDst的就拷贝过去。再判断一下是否拷贝成功。 2)将pathSrc中的 阅读全文
摘要:
因为工作需要,了解了一下MQTT。顺便记下来,现在还不会用。 一、概述 MQTT(Message Queuing Telemetyr Transport 消息队列遥测传输协议):基于发布/订阅(Publish/Subscribe)模式的轻量级通讯协议,该协议构建于TCP/IP协议之上。 MQTT运行 阅读全文