阡陌 发布的文章

阡陌

解决向 Jenkins( Windows) 添加 Git 仓库时报错的问题

向 Jenkins( Windows) 添加 Git 仓库时总是报错,当添加 HTTPS 仓库地址时报错: Failed to connect to repository : Command "C:\Program Files\Git\bin\git.exe ls-remote -h -- >https://git.***.com/gitlab/git.git HEAD" returned status code 128: stdout: stderr: fatal: unable to access 'https://git.***.com/gitlab/git.git/': OpenSSL SSL_connect: >SSL_ERROR_SYSCALL in connection to git.***.com:443 当添加 SSH 仓库地址时报错: Failed to connect to repository : Command "C:\Program Files\Git\bin\git.exe ls-remote -h -- >git@git.***.com:gitlab/git.git HEAD" returned status code 128: stdout: stderr: Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists...

Linux 逻辑卷管理 LVM

当你发现某个文件夹满到放不下新文件时,又不能放到其他文件夹和分区,应该会想到加块儿硬盘吧。可以如何将新硬盘合并到即将满了的分区呢?LVM,逻辑卷管理(Logical Volume Manager),它是 Linux 环境下对磁盘分区进行管理的一种机制,可以提高磁盘分区的灵活性。很牛的一点是,LVM 允许在不停机的情况下伸缩文件系统的大小,这在服务器上十分重...

使用 cryptsetup 加密硬盘

cryptsetup 是 linux 下的一个常用加密工具,它通过调用内核中的 dm-crypt 来实现对磁盘的加密。 它既可以加密真实的物理磁盘、分区,也可以加密用文件来虚拟的磁盘、分区。 本文介绍一下加密整个磁盘的过...

Qt 5.15.0 静态编译

配置环境 下载源码 http://download.qt.io/archive/qt/5.15/5.15.0/single/ 下载 zip 包(下载过 tar.xz 包,在 Windows 上用 7zip 解压后竟然缺少文件,而且还没有错误提示) 编译前需要安装:Perl、Python、Ruby 并确保他们的可执行路径在 Path 变量中。 Python 要安装 2.7.5 及以后的 2.7 版本,python3 是不行的。用于编译 QtWebEngine Python2.7.x 装好后把路径 C:\Python27 添加到 path,把可执行程序 python.exe 重命名为 python2.exe 安装 clang,生成 Qt 文档要用。 下载 jom https://wiki.qt.io/Jom 替代 nmake,可支持多核编译,加快编译速度。 msvc2019 版 打开 VS 自带的命令提示窗口 编译 openssl Windows 上编译需要使用 Perl 安装 perl ActivePerl (5.26、5.28)装上后配置 openssl 时用提示缺少 Win32::Console 模组,用于安装模组的 cpan 命令又需要这个模组,这也太矛盾了吧!网上也有不少人遇到这个问题,难道发布时就不测测?好奇怪呀。所以最后安装了 StrawberryPerl 5.28.2.1,一切正常。 下载 openssl 源码:https://github.com/openssl/openssl 下载 NASM 汇编编译器:https://www.nasm.us/ set path=C:\Users\Matt\AppData\Local\bin\NASM;%path% 编译静态链接库版本: perl Configure VC-WIN64A --prefix=D:\Qt\openssl-OpenSSL_1_1_1-stable\release\vc_x64_static --openssldir=D:\Qt\openssl-OpenSSL_1_1_1-stable\release\vc_x64_static no-asm no-shared # no-shared 编译成静态库 nmake nmake test 测试编译结果 Result: PASS nmake install 编译 Qt set LLVM_INSTALL_DIR=C:\Program Files\LLVM set path=D:\Qt\jom_1_1_3;%path% configure -opensource -confirm-license -static -debug-and-release -prefix "D:\Qt\kits\Qt5.15.0_MSVC2019_x64_static" -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -qt-sqlite -openssl-linked OPENSSL_PREFIX=“D:\Qt\openssl-OpenSSL_1_1_1-stable\release\vc_x64_static" -skip qtwebengine -nomake examples -nomake tests 如果想重新配置,手动删除源码根目录的 config.cache。 配置完后提示: Qt is now configured for building. Just run 'nmake'. Once everything is built, you must run 'nmake install'. Qt will be installed into 'D:\Qt\kits\Qt5.15.0_MSVC2019_x64_static'. Prior to reconfiguration, make sure you remove any leftovers from the previous build. 编译: nmake nmake install Qt is now configured for building. Just run 'jom'. Once everything is built, you must run 'jom install'. Qt will be installed into 'D:\Qt\kits\Qt5.15.0_MSVC2019_x64_static'. Prior to reconfiguration, make sure you remove any leftovers from the previous build. 编译: jom -j 12 jom install MinGW 版 打开 mingw32 版 Qt 附带的命令行工具: configure -opensource -confirm-license -static -release -platform win32-g++ -prefix "D:\Qt\build\Qt5.15.0_MinGW_x86" -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -qt-sqlite -nomake examples -nomake tests 配置完后提示: Qt is now configured for building. Just run 'mingw32-make'. Once everything is built, you must run 'mingw32-make install'. Qt will be installed into 'D:\Qt\build\Qt5.15.0_MinGW_x86'. Prior to reconfiguration, make sure you remove any leftovers from the previous build. 编译: mingw32-make -j8 mingw32-make instal...

安装 Composer

Composer 是 PHP 用来管理依赖(dependency)关系的工具。你可以在自己的项目中声明所依赖的外部工具库(libraries),Composer 会帮你安装这些依赖的库文件。类似于 Centos 的 yum、Ubuntu 的 apt、python 的 pip ...

使 DiscuzX 3.4 论坛支持代码高亮的改造方法

这里使用了 highlight.js,它的特点: 支持 196 种语言,242 种样式(绝大多数用不上) 自动语言探测(正确率似乎一般) 支持使用任意 HTML 标记 兼容任意 js 框架 只需要知道它足够牛就OK了。 可以通过 CDN 加速服务器引用: <link href="https://cdn.bootcdn.net/ajax/libs/highlight.js/11.2.0/styles/default.min.css" rel="stylesheet"> <script src="https://cdn.bootcdn.net/ajax/libs/highlight.js/11.2.0/highlight.min.js"></script> 如果需要裁剪定制一些语言,可以直接在官网下载页面(https://highlightjs.org/download/)操作: 下载后将 highlight.min.js 和样式表 default.min.css (也可以换用其他样式表)上传到服务...

在 C++ Builder 中使位图背景透明的方法

本文提供一种使用 Graphics::TBitmap 的方法使位图背景透明化,直接上代码: Graphics::TBitmap *bm = new Graphics::TBitmap; bm->Transparent = true; bm->TransparentMode = tmFixed; bm->TransparentColor = clWhite; MForm->ImageList1->GetBitmap(2, bm); this->Canvas->Draw(10, 100, bm); delete bm; TransparentMode:设置透明模式 tmAuto:使用图片左下角像素的颜色作为透明颜色 tmFixed:使用 TransparentColor 属性指定的颜色作为透明...

【工程师必装软件系列】搜索利器 Everything

简介 相信还有不少人在用 Windows 资源管理器自带的搜索功能,哪怕你的电脑配置再高,蜗牛一样的搜索速度在你的海量资料文件面前显得相形见绌。何以解忧? Everything 是 Windows 系统上的一款小巧、灵活、强大、免费的搜索工具,它能够基于文件名快速定文件和文件夹位置。 它的大小只有 2MB 多点,估计是用 VC 开发的吧。可以限定搜索范围为某个盘或某个文件夹,支持正则表达式等高级搜索。此外它还有HTTP文件服务器与FTP文件服务器(不支持上传功能),可以支持通过网络检索文件。 相信我,当你用过之后一定会惊讶于它的搜索速度:“它怎么就这么快?...