asio制作使用ssl通信的证书

1,生成ca的key openssl genrsa -out ca.key 1024/2048 (with out password protected) openssl genrsa -des3 -out ca.key 1024/2048 (password protected) 2,根据ca的key,生成顶级证书 openssl req -new -x509 -key ca.key -out ca.pem -days 1095 输入: Country Name (2 letter code) [AU]:CA State or Province Name (full name) [Some-State]:CA

gdb 7.11

因为CentOS自带的GDB版本有点低,所以下载了最新的gdb 7.11编译以后,调试过程中提示以下错误。 Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing: 修改方式: 将源码

Linux 获取网卡信息

#include <sys/ioctl.h> #include <net/if.h> #include <unistd.h> #include <netinet/in.h> #include <string.h> int main() { struct ifreq ifr; struct ifconf ifc; char buf[2048]; int success = 0; int sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); if (sock == -1) { printf("socket error\n"); return -1; } ifc.ifc_len = sizeof(buf); ifc.ifc_buf = buf; if (ioctl(sock, SIOCGIFCONF, &ifc) == -1) { printf("ioctl error\n"); return -1; } struct ifreq* it = ifc.ifc_req; const struct ifreq* const end =