- 博客(28)
- 资源 (12)
- 收藏
- 关注
原创 python实现UDP打洞
基于python 实现 UDP打洞在公网设置一个中间服务器111.222.111.2222from socket import *import threadingserver_addr = ('111.222.111.2222',6000)udpSerSock = socket(AF_INET,SOCK_DGRAM)udpSerSock.bind(server_addr)hostDict={} #保存登入的客户端def revMsg(): print("start rev:")
2020-06-21 20:40:09
1293
原创 python 使用代理批量下载网络图片
import csvimport numpy as npimport requestsdata=[]with open('imageURL.csv', 'r') as f: # 读取图片地址 reader = csv.reader(f) for row in reader: data.append(row)proxies = { "htt...
2019-11-12 14:23:23
518
原创 ubuntu1804搭建kamailio SIP服务器
安装kamailio服务器sudo apt install kamailio配置服务器vi /etc/kamailio/kamailio.cfg,在文件头部添加下列4行#!define WITH_MYSQL#!define WITH_AUTH#!define WITH_USRLOCDB#!define WITH_NAT#!define WITH_DEBUG修改 /etc/ka...
2019-09-29 09:41:12
743
原创 python中bool数组取反
这里写自定义目录标题python中bool数组取反操作python中bool数组取反操作由于Python中使用数字0,1 代表Flase,Ture 。所以bool数组不能像matlab一样直接进行取反操作。a=np.array([False,True,False,True,False])要想对a取反,最简单的操作是b=(a==0)print(b)[ True False True...
2019-09-26 11:21:24
3042
原创 内网穿透-p2p通讯服务器-基于n2n和udp2raw-tunnel
内网穿透-p2p通讯服务器-基于开源软件n2n和udp2raw-tunnel原本在简单的网络环境中n2n可以很好的达到p2p通讯功能,但是由于公网ip服务器(如阿里云等)可能会屏蔽掉UDP协议,使得n2n无法使用,于是通过一个非常棒的开源软件udp2raw-tunnel(https://github.com/wangyu-/udp2raw-tunnel)来将UDP伪装成TCP协议,实验证明是可行...
2019-07-10 11:22:46
3377
原创 解决repo init 错误 fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
由于repo 每次执行的时候都会去更新自己,由于下载地址被墙,导致无法更新而不能继续执行解决方法:为repo 设置国内镜像更新地址 --repo-url=https://gerrit-googlesource.lug.ustc.edu.cn/git-reposudo repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/lineageOS...
2019-01-23 16:44:20
24180
2
原创 手工从grub引导进入Ubuntu16.04
手工从grub引导进入Ubuntu16.04先确定ubuntu 根目录安装的分区,假如根分区为(hd0,1),可以Tab建提示 grub> linux (hd0,1)/vmlinuz ro root=/dev/sda1 grub>initrd (hd0,1)/initrd.img grub>boot 即可进入Ubuntu系统
2017-09-04 21:58:47
8751
转载 Matlab实现FFT变换
原文地址:http://blog.sina.com.cn/s/blog_64b236da0100vdqt.htmlFFT信号流图: 程序实现是这样: 程序流程如下图: 首先进行位逆转,其实很简单,就是把二进制的位逆转过来:Matlab的位逆转程序:function a=bitreverse(N
2016-11-21 20:17:32
35099
转载 傅里叶变换
傅里叶变换2014/08/09 · IT技术 · 113 评论 · 傅里叶, 傅里叶变换, 数学分享到: 7K原文出处: 韩昊 作 者:韩 昊知 乎:Heinrich微 博:@花生油工人知乎专栏:与时间无关的故事谨以此文献给大连海事大学的吴楠老师,柳晓鸣老师,王新年老师以及张晶泊老
2016-11-17 20:37:19
1090
1
原创 可变参数函数printf的实现(不使用va_list等内置宏定义)
一直好奇c语言中int printf( const char* format, …) 可变参数函数是怎样实现的,网上关于可变参数函数的实现基本上使用了va_list,va_start,va_end等内置宏定义,为了更深入的理解可变参数函数,决定直接使用内置汇编来实现关键操作。 1.可变参数函数的形参使用(…)来表示可变个数的参数,在实际调用时,所有的参数都会被压入栈中,需要自行从栈中读取参数,这只
2016-11-06 15:06:51
702
原创 函数调用过程-汇编代码分析
软件平台:code::block+MingwC源码main.cint add(int a,int b);void print();int main(){ int a=0; a=add(1,2) print(); return 0;}int add(int a,int b){ return a+b;}void print(){ int a
2016-08-12 12:05:18
1798
原创 C++文件读写
C++文件读写实例(BinWriter)从源文件中读取指定位置的一段数据写入到目的文件的指定位置#include <iostream>#include <fstream>using namespace std;int main(int n,char** args){ if(n<6){ cout<<"Usage: BinWriter src_filename read_o
2016-08-09 12:06:15
490
原创 宿主主机与VMware中虚拟机网络通信设置
原因VMware 默认采用NAT(网络地址转换),所以宿主主机无法直接访问VMware中的虚拟主机解决方法在宿主主机(WIN7)添加一条路由route -p add 192.168.75.0 mask 255.255.255.0 169.254.142.103192.168.75.0为虚拟主机所在子网(查看虚拟主机的ip,将最后的数字改成0即可),169.254.142.103(VMnet8的ip地
2016-08-03 16:22:47
2539
转载 C从文件读取数据初始化数据对象
#include <stdio.h>struct person{ char name[32]; int age; float weight;};struct person p[2];void main (){ FILE *fp; int i; fp=fopen("test.bin","rb"); fread(p, sizeof(struc
2016-07-19 20:12:07
1400
原创 WinSock2 实现Client端
Win32 socket 编程#define BUF_SIZE 128#include <iostream>#include<WinSock2.h>#include <WS2tcpip.h>using namespace std;#pragma comment(lib, "WS2_32.lib")int main(){ WSADATA wsd; SOCKET sSocket;
2016-07-18 15:10:22
1099
原创 ASIO网络库-Client
ASIO 客户端实现main.cpp#ifndef _WIN32_WINNT#define _WIN32_WINNT 0x0600#endif // !_WIN32_WINNT#define ASIO_STANDALONE#include <iostream>#include <asio.hpp>#include<thread>using asio::ip::tcp;void read
2016-07-18 15:04:40
793
原创 ASIO网络库-Server
Server 类实现server.h#ifndef MYSERVER_H#define MYSERVER_H#ifndef _WIN32_WINNT#define _WIN32_WINNT 0x0600#endif // !_WIN32_WINNT#ifndef ASIO_STANDALONE#define ASIO_STANDALONE#endif//ASIO_STANDALONE#in
2016-07-18 14:59:53
1887
原创 函数指针与回调函数
#include<stdio.h>void add(int a,int b){ printf("a+b=%d",a+b);}void sub(int a,int b){ printf("a-b=%d",a-b);}void docallback(void (*func)(int,int)){ func(3,1);}int main(){ void (*fu
2016-06-28 17:36:45
327
转载 MD5(C++实现)
MD5(C++实现)MD5.h//MD5.h#ifndef BZF_MD5_H#define BZF_MD5_H#include <string>#include <iostream>// a small class for calculating MD5 hashes of strings or byte arrays// it is not meant to be fast or se
2016-05-30 16:48:15
620
原创 Qt TCP文件传输
FileServer类为TCP服务端提供文件下载,Downloader为TCP客户端,连接到服务端下载文件fileserver.h#ifndef FILESERVER_H#define FILESERVER_H#include #includeclass FileServer : public QObject{ Q_OBJECTpublic: explicit
2016-05-22 19:27:29
9867
3
原创 github的使用:生成SSH Key
检查是否已经存在SSH key$ ls -al ~/.ssh# Lists the files in your .ssh directory, if they exist生成SSH key,将your_email@example.com替换成github的注册邮箱,生成的SSH key默认保存在 ~/.ssh 文件夹中$ ssh-keygen -t rsa -b 4096 -C
2016-04-27 20:30:44
360
原创 Qt UDP的使用
UDPSender 代码UDPSender.h#ifndef UDPSENDER_H#define UDPSENDER_H#include class QTimer;class QUdpSocket;class UDPSender : public QObject{ Q_OBJECTpublic: explicit UDPSender(QObject *p
2016-04-26 21:08:59
1096
原创 qt项目发布
QT自带了windows 项目发布工具windeployqt.exe默认路径为C:\Qt\Qt5.4.1\5.4\mingw491_32\bin
2016-04-26 20:58:52
446
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人