tony 发布的文章

一、chrony服务端配置

1. 安装chrony软件包

dnf -y install chrony

2. 修改chrony.conf配置文件

时钟源推荐使用阿里云的时钟服务器(ntp.aliyun.com)

# file:/etc/chrony.conf
# 1. 修改pool参数,指定同步时钟源,并加速同步过程
pool ntp.aliyun.com iburst

# 2. 修改allow参数,允许那些网段可以同步
allow 0.0.0.0/0

# 3. 修改local stratum参数,开启本地授时服务
local stratum 10

3. 启动服务并设置开机自启

systemctl enable --now chronyd

4. 放开防火墙

firewall-cmd --permanent --add-service=ntp
firewall-cmd --reload

5. 检查端口侦听状态

ss -ulwn

-u 仅显示UDP协议

-l 仅列出正在监听的端口

-w 显示元数据

-n 显示端口号而非服务名

# 检查打开123端口的进程
lsof -i :123
COMMAND   PID   USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
chronyd 19300 chrony    7u  IPv4 1786893      0t0  UDP *:ntp 

6. 检查时钟源状态

chronyc sources
# 列出详细参数说明
chronyc sources -v
210 Number of sources = 2

  .-- Source mode  '^' = server, '=' = peer, '#' = local clock.
 / .- Source state '*' = current synced, '+' = combined , '-' = not combined,
| /   '?' = unreachable, 'x' = time may be in error, '~' = time too variable.
||                                                 .- xxxx [ yyyy ] +/- zzzz
||      Reachability register (octal) -.           |  xxxx = adjusted offset,
||      Log2(Polling interval) --.      |          |  yyyy = measured offset,
||                                \     |          |  zzzz = estimated error.
||                                 |    |           \
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^* 203.107.6.88                  2  10   377   606  -1309us[-2369us] +/-   16ms
^+ 116.62.13.223                 2   9   377   134   +230us[ +230us] +/-   18ms

二、chrony客户端配置

1. 安装chrony软件包

dnf -y install chrony

2. 修改chrony.conf配置文件

# file:/etc/chrony.conf
# 1. 修改pool参数,指定同步时钟源,并加速同步过程
pool ntp.aliyun.com iburst

3. 启动服务并配置开机自启

systemctl enable --now chronyd

4. 检查客户端服务状态

chronyc sources

在服务端可以看到连接的客户端情况

chronyc clients

其他检查命令

timedatectl status
systemctl status chronyd

在服务器端查看服务端IP地址

ip -br a

-br 是-brief的缩写,意思是概要输出,简单输出结果,便于快速查看

[root@node51 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:56:b5:7c:b0 brd ff:ff:ff:ff:ff:ff
    altname enp11s0
    inet 192.168.0.51/24 brd 192.168.0.255 scope global noprefixroute ens192
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:feb5:7cb0/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
[root@node51 ~]# ip -br a
lo               UNKNOWN        127.0.0.1/8 ::1/128 
ens192           UP             192.168.0.51/24 fe80::250:56ff:feb5:7cb0/64 

1. 软件简述

官网:[https://www.scootersoftware.com/]

Scooter Software推出的文件比较工具,主要用途是对比两个文件夹或者文件,并将差异以颜色标示。

Beyond Compare是一款著名的文件比较工具,它支持文件夹、文件、FTP站点的比较,并且可以高效地找出不同点。此外,Beyond Compare还可以进行文本编辑、代码合并、文件同步等功能,是程序员进行版本控制和开发过程中必不可少的工具之一。

Beyond Compare的界面简洁、易用,一般用户很快就能熟悉。左右两个窗口显示文件的内容,可以通过不同的颜色和图标表示文件不同的状态。

用户可以自定义比较规则,比如仅比较文件大小、仅仅比较文件名等,而且Beyond Compare的比较速度非常快,在文件比较、代码合并等操作中得到广泛应用。

它是目前功能最全面的文件对比工具,当然这款软件肯定是收费的。

提示:Beyond Compare为收费软件,提供有30天试用版,国内经销商提供的参考价格为259元(标准版)、469元(专业版)。

2. UI截图

image-20250322110236035.png

3. 目录比较

image-20250322112829955.png

4. 文本文件对比

image-20250322112907554.png

5. Excel文件对比

v2-0b791bb45b32d28e389e1b5ded423431_1440w.jpg

总的来说,Beyond Compare是一款非常强大的文件比较工具,对于程序员和开发者非常实用。它不仅可以快速找出文件不同之处,还可以进行文件编辑、代码合并、文件同步等功能,方便用户在开发过程中快速迭代。

原文地址: [https://zhuanlan.zhihu.com/p/634642572]

一、环境准备

  1. 下载mingw
    MinGW官网:https://www.mingw-w64.org/downloads/
    GitHub下载地址:https://github.com/niXman/mingw-builds-binaries/releases

    在下载页面找到MinGW-W64-builds关键字
  2. 将mingw路径添加到Path环境变量
    系统->高级系统设置->环境变量->用户或系统变量Path->"D:\software\mingw64\bin"
    安装验证

    PS C:\Users\tony> gcc -v
    Using built-in specs.
    COLLECT_GCC=D:\software\mingw64\bin\gcc.exe
    COLLECT_LTO_WRAPPER=D:/software/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/14.2.0/lto-wrapper.exe
    Target: x86_64-w64-mingw32
    Configured with: ../../../src/gcc-14.2.0/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/c/buildroot/x86_64-1420-posix-seh-msvcrt-rt_v12-rev1/mingw64 --enable-host-shared --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --enable-libstdcxx-filesystem-ts=yes --disable-libssp --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/c/buildroot/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/c/buildroot/prerequisites/x86_64-w64-mingw32-static --with-mpc=/c/buildroot/prerequisites/x86_64-w64-mingw32-static --with-isl=/c/buildroot/prerequisites/x86_64-w64-mingw32-static --with-pkgversion='x86_64-posix-seh-rev1, Built by MinGW-Builds project' --with-bugurl=https://github.com/niXman/mingw-builds LD_FOR_TARGET=/c/buildroot/x86_64-1420-posix-seh-msvcrt-rt_v12-rev1/mingw64/bin/ld.exe --with-boot-ldflags='-pipe -fno-ident -L/c/buildroot/x86_64-1420-posix-seh-msvcrt-rt_v12-rev1/mingw64/opt/lib -L/c/buildroot/prerequisites/x86_64-zlib-static/lib -L/c/buildroot/prerequisites/x86_64-w64-mingw32-static/lib  -Wl,--disable-dynamicbase -static-libstdc++ -static-libgcc'
    Thread model: posix
    Supported LTO compression algorithms: zlib
    gcc version 14.2.0 (x86_64-posix-seh-rev1, Built by MinGW-Builds project)
  3. 安装vscode
  4. 安装vscode插件
  5. C/C++ for Visual Studio Code
    2025-02-25T02:12:04.png
  6. VSCode C/C++ Runner
    2025-02-25T02:12:26.png
  7. 编写helloworld.c

    #include <stdio.h>
    
    int main(){
     printf("Hello World! \n");
    
     return 0;
    }
  8. 编译运行
    2025-02-25T02:14:28.png

安装条件

  • Maven需要本机安装Java环境、必须包含JAVA_HOME环境变量

安装步骤

  1. 从官网下载maven安装包,解压后放在D:\software\apache-maven-x.x.x目录;
  2. 添加MAVEN_HOME环境变量;修改path环境变量,新增%MAVEN_HOME%\bin;
    2025-02-10T09:34:30.png
  3. 命令行测试

    mvn -v 
    # 输出版本信息即可,如果错误,请仔细检查环境变量即可!
    # 友好提示,如果此处错误,绝大部分原因都是java_home变量的事,请仔细检查!!
  4. 修改配置文件
    主要有三个配置需要修改:1.本地仓库位置;2.添加国内镜像源;3.Maven默认编译项目的jdk版本
    4.1. 配置本地仓库位置

    <!-- conf/settings.xml 55行 -->
    <localRepository>D:\repository</localRepository>

    4.2. 添加国内镜像源

    <!--在mirrors节点(标签)下添加中央仓库镜像 160行附近-->
    <mirror>
     <id>alimaven</id>
     <name>aliyun maven</name>
     <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
     <mirrorOf>central</mirrorOf>
    </mirror>

    4.3. 配置jdk17版本项目构建

    <!--在profiles节点(标签)下添加jdk编译版本 268行附近-->
    <profile>
     <id>jdk-17</id>
     <activation>
       <activeByDefault>true</activeByDefault>
       <jdk>17</jdk>
     </activation>
     <properties>
       <maven.compiler.source>17</maven.compiler.source>
       <maven.compiler.target>17</maven.compiler.target>
       <maven.compiler.compilerVersion>17</maven.compiler.compilerVersion>
     </properties>
    </profile>
  5. idea配置本地Maven

    idea工具默认自带Maven配置软件,但是因为没有修改配置,建议替换成本地配置好的maven!
    file -> settings -> build -> build tool -> maven