猫言猫语

严以律己·宽以待人·自强不息·知行合一

Ubuntu 20.24 Focal 安装 VNC Server

| Ubuntu 20.24 Focal 安装 VNC Server已关闭评论

sudo sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
sudo apt update
sudo apt install -y xfce4 xfce4-goodies
sudo apt install -y tightvncserver autocutsel
[email protected]:~$ vncserver

You will require a password to access your desktops.

Password:
Verify:
Would you like to enter a view-only password (y/n)?
xauth:  file /home/vagrant/.Xauthority does not exist

New 'X' desktop is ubuntu-focal:1

Creating default startup script /home/vagrant/.vnc/xstartup
Starting applications specified in /home/vagrant/.vnc/xstartup
Log file is /home/vagrant/.vnc/ubuntu-focal:1.log
[email protected]:~/.vnc$ vi ~/.vnc/xstartup

#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession
startxfce4 &

Spring Boot 编译为 WAR 包运行

| Spring Boot 编译为 WAR 包运行已关闭评论

重点是修改 pom.xml 中的 packaging 标签,设置其值为 war。

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.6.13</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>demo</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>demo</name>
    <description>demo</description>
    <properties>
        <java.version>1.8</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

CentOS 通过 yum 安装 go 语言环境

| CentOS 通过 yum 安装 go 语言环境已关闭评论

rpm --import https://mirror.go-repo.io/centos/RPM-GPG-KEY-GO-REPO
curl -s https://mirror.go-repo.io/centos/go-repo.repo | tee /etc/yum.repos.d/go-repo.repo
yum install golang

Redis 3.2 主从模式配置

| Redis 3.2 主从模式配置已关闭评论

启动三台虚拟机,节点名称与 IP 分别如下:

node1: 192.168.56.101
node2: 192.168.56.102
node3: 192.168.56.103

在三台机器上分别安装 Redis 服务

yum install -y epel-release
yum install -y redis

修改各个节点 Redis 的配置文件,使其监听在外部网络上

vi /etc/redis.conf
bind 0.0.0.0

启动各个节点上的 Redis 服务

systemctl restart redis

登录 node2 与 node3 设置他们为 node1 的 slave

redis-cli
127.0.0.1:6379> SLAVEOF 192.168.56.101 6379
OK Already connected to specified master

这样一主两从的 Redis 主从就配置好了,在主节点上设置值后,从节点也可以看到值

使用 OpenSSL 验证 HTTPS 证书配置

| 使用 OpenSSL 验证 HTTPS 证书配置已关闭评论

openssl s_client -connect mail.neu.edu.cn:443

每一层的 depth 都要跟下面的 chain 能对应上,否则就是有问题的,靠浏览器测试不一定靠谱。

使用 xrdp 远程桌面访问 Ubuntu

| 使用 xrdp 远程桌面访问 Ubuntu已关闭评论

sudo apt install -y xrdp
sudo systemctl enable xrdp
sudo systemctl start xrdp

然后使用远程桌面客户端工具就可以链接上 Ubuntu 机器了

Ubuntu 将用户添加至 dialout 组

| Ubuntu 将用户添加至 dialout 组已关闭评论

sudo usermod -aG dialout wwx

用户在 dialout 组之后,就可以直接使用串口,不用 sudo 了。