首页
统计
关于
Search
1
C语言:获取程序运行消耗的时间(gettimeofday)
81 阅读
2
QT-利用Qcamera查看USB摄像头参数(数据帧格式+分辨率)
77 阅读
3
一切从头开始
60 阅读
4
Linux 查看硬盘通电时间
31 阅读
5
QT--程序收不到组播数据
23 阅读
编程语言
C/C++
PHP
Go
分享
随笔
Linux
登录
Search
标签搜索
C++
QT
Linux
C
程序执行时间
函数执行时间
Git
GDAL
247
累计撰写
14
篇文章
累计收到
0
条评论
首页
栏目
编程语言
C/C++
PHP
Go
分享
随笔
Linux
页面
统计
关于
搜索到
14
篇与
的结果
2023-05-25
解决SMTP 发信暴露服务器源IP的方法
我们以 CentOS、阿里云邮件推送 为例:第一步 需要安装 Haproxy:yum -y install haproxy然后清空 haproxy.cfg 文件内容cd /etc/haproxy/haproxy.cfg然后将下面内容粘贴到 haproxy.cfg 中globalulimit-n 51200defaultslog globalmode tcpoption dontlognulltimeout connect 1000mstimeout client 150000mstimeout server 150000mslisten statusbind 0.0.0.0:1080mode httplog globalstats refresh 30sstats uri /admin?statsstats realm Private landsstats auth admin:passwordstats hide-versionfrontend ssinbind *:465default_backend ssoutbackend ssoutserver server1 11.22.33.44 maxconn 204800// 如果是普通模式,那这里就填25,如果是SSL模式,就需要填465bind *:465//这里的IP需要改成SMTP地址的IP,ping一下SMTP域名即可得到地址server server1 11.22.33.44 maxconn 204800修改完成后,执行重启命令,并设为开机启动service haproxy restartchkconfig haproxy on第二步 修改 Web 服务器的发信 Hosts 地址!在 Web 服务器上输入echo "22.33.44.55 smtpdm.aliyun.com" >> /etc/hosts然后重启网卡service network restart现在去发邮件试一下,是不是隐藏掉了源站的 IP。
2023年05月25日
19 阅读
0 评论
0 点赞
2023-05-23
一键测试脚本bench.sh
总结一下 bench.sh 的特点:1、显示各种系统信息;2、取自 Speedtest 世界多处的数据中心的测试点,网络测试比较全面;3、支持 IPv6 下载测速;4、IO 测试(顺序写入 1GB 数据)三次,并显示其平均值。使用方法使用root用户登录,运行以下命令:命令1wget -qO- bench.sh | bash或者curl -Lso- bench.sh | bash
2023年05月23日
15 阅读
0 评论
0 点赞
2023-05-19
QT-利用Qcamera查看USB摄像头参数(数据帧格式+分辨率)
运行环境检查:首先检查自己的QT版本及系统环境是否支持Qcamera:Qcamera是multimedia模块中的接口函数,multimedia模块在QT5.3之后是自带的。在windows环境下可直接使用,在LINUX 环境下需要手动安装multimedia模块。代码片段:pro文件包含:QT += multimedia multimediawidgets示例#include "mainwindow.h" #include "ui_mainwindow.h" //相机相关的头文件 #include <QCamera> #include <QCameraInfo> #include <QVideoProbe> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); m_camera = new QCamera(this);//初始化摄像头设备 QVideoProbe *m_pProbe = new QVideoProbe; if(m_pProbe != nullptr) { m_pProbe->setSource(m_camera); // Returns true, hopefully. connect(m_pProbe, SIGNAL(videoFrameProbed(QVideoFrame)),this, SLOT(slotOnProbeFrame(QVideoFrame)),Qt::QueuedConnection); }//其中SIGNAL(videoFrameProbed(QVideoFrame)为VideoProbe模块自带的信号 m_camera->setCaptureMode(QCamera::CaptureViewfinder);//设置捕捉模式为视频 m_camera->setViewfinder(ui->centralWidget);//设置 摄像头画面的显示位置 m_camera->start();//开启摄像头 //查询摄像头支持的分辨率 QList<QSize> sizes = m_camera->supportedViewfinderResolutions(); qDebug() << "viewfinderResolutions sizes.len = " << sizes.length(); foreach (QSize size, sizes) { qDebug() << "Resolutions size = " << size; } //摄像头参数初始化,根据需求用户自定义摄像头分辨率,也可以用来设置摄像头数据类型 QCameraViewfinderSettings set; set.setResolution(VIDEO_WIDTH, VIDEO_HEIGHT);//设置分辨率 //set.setPixelFormat(QVideoFrame::Format_YUYV); //设置像素格式 Android上只支持NV21格式 m_camera->setViewfinderSettings(set); //包含头文件QCameraInfo QList<QCameraInfo> cameras = QCameraInfo::availableCameras();//获取可用摄像头设备列表 foreach (const QCameraInfo &cameraInfo, cameras) { qDebug()<<"检测到设备:"<<cameraInfo.deviceName();//摄像头的设备名称 } } //图像触发的槽函数 void MainWindow::slotOnProbeFrame(const QVideoFrame &frame) { QVideoFrame cloneFrame(frame);//类拷贝操作,fram -> clonframe cloneFrame.map(QAbstractVideoBuffer::ReadOnly); //视频缓冲区数据映射到系统内存 //unsigned char rgb_buffer[VIDEO_WIDTH*VIDEO_HEIGHT*3]; qDebug()<<"设备数据格式:"<< cloneFrame.pixelFormat()<<endl; cloneFrame.unmap(); } MainWindow::~MainWindow() { delete ui; }
2023年05月19日
77 阅读
0 评论
0 点赞
2023-05-19
gowatch--Go 程序热编译工具
Go 程序热编译工具,提升开发效率通过监听当前目录下的相关文件变动,进行实时编译安装使用使用 go insall 命令安装 gowatchgo install github.com/silenceper/gowatch@latest安装完成之后,即可使用gowatch命令,在当前文件执行:gowatch命令行参数-o : 非必须,指定build的目标文件路径-p : 非必须,指定需要build的package(也可以是单个文件)-args: 非必须,指定程序运行时参数,例如:-args='-host=:8080,-name=demo'-v: 非必须,显示gowatch版本信息-h: 非必须,帮助信息
2023年05月19日
20 阅读
0 评论
0 点赞
2023-05-18
解决使用git每次提交和拉取代码都要输入帐号密码的问题
1、首先,在git.bash文件中输入命令:git config --global credential.helper store2、然后你会发现你的C:\Users\用户名.gitconfig文件(或者是类似名称的)会多出以下代码:[credential] helper = store**3、使用git pull或者git push命令后,根据提示输入帐号和密码后,这时你的本地生成一个类似C:\Users\用户名.git-credentials文件,用于记录帐号密码。4、完成以上几步,下次就不用再次输帐号密码了。
2023年05月18日
2 阅读
0 评论
0 点赞
1
2
3