- 设备B0 IP: 10.0.0.90
- 设备A IP: 10.0.0.80, 192.168.0.50
- 设备C IP: 192.168.0.51
┌────┐ ┌───┐
│ │ │ │ ┌──────────┐
│ B0 │◄───────►│ A ├────────►│ Internet │
#include <stdio.h> | |
#include <time.h> | |
#ifdef _WIN32 | |
#include <windows.h> | |
#endif | |
#ifdef __linux__ | |
#include <unistd.h> | |
#endif | |
#include <sys/time.h> |
#include <stdint.h> | |
#include <stdio.h> | |
#include <zlib.h> | |
// gcc fcs.c -lz | |
#define CRC_POLY UINT32_C(0xEDB88320) | |
uint32_t crc_ether(const uint8_t *data, size_t len) { | |
uint32_t accum = ~UINT32_C(0); | |
for (size_t n = 0; n < len; ++n) { | |
accum ^= data[n]; |
/** | |
* | |
* usage: ./list_ksz9031_reg ethx phyid | |
* ethX is Ethernet Interface name, such as, eth0, eth1... | |
* phyid is PHY's physical address, such as, 0. | |
* | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> |
#!/bin/python3 | |
""" | |
1. 加密文件的各字节与0xa3异或运算 | |
2. filetype.guess_extension()获取解密后的文件类型 | |
3. 根据id从网易云音乐获取歌曲信息 | |
3.1 该API使用简单,但存在被封ip的情况 | |
[收藏这些API,获取网易云音乐数据超轻松 - 云+社区 - 腾讯云](https://cloud.tencent.com/developer/article/1543945) | |
https://music.163.com/api/song/detail/?id={864489955}&ids=%5B{864489955}%5D | |
获取的json文件关键词可能有所不同,如歌手关键词可能上ar或artist,还有可能存在返回的json为空的情况 | |
3.2 使用POST方法获取,该方法实现较为麻烦 |
import sympy | |
from sympy import Symbol, Matrix, cos, sin, latex | |
import http.server | |
import socketserver | |
# 欧拉角$\varepsilon_x, \varepsilon_y, \varepsilon_z | |
# 绕x轴旋转角 | |
Ex = Symbol('varepsilon_x', real=True) | |
# 绕y轴旋转角 |
import ipaddress | |
import json | |
import urllib | |
from flask import Flask | |
from flask import request | |
from flask import jsonify, render_template_string | |
""" | |
# 获取客户端IP | |
一个简单的demo, |