Posts under category 文字

systemctl .service file for vncserver under CentOS 7.7

People can do almost everything vis ssh under Linux, no exception for CentOS. But in some cases, using a X Windows improves efficiency greatly.

Tiger VNC server is a good server end package for VNC protocal under CentOS.
Tonight, just an hour ago, I encountered a disaster due to an unprofessional systemctl script privided by Tiger VNC server devolopers.

I’m tired so I shall not record the details.
If you are suffering problems while you are deploying autostart VNC server via systemctl, like:

  1. New main PID <pid> does not belong to service, and PID file is not owned by root. Refusing.;
  2. Enabled multiple vnc ports for no reason;
  3. Can not input password when the vnc client in locked screen;
    ....

Just try a .service file as fllow:
Do !NOT! forget to change USERNAME to your own user.

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=forking

# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/sbin/runuser -l <USERNAME> -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l <USERNAME> -c "/usr/bin/vncserver :1"
ExecStartPost=/bin/sh -c '/usr/bin/cat /home/<USERNAME>/.vnc/%H%i.pid > /tmp/vnc-server.pid'
PIDFile=/tmp/vnc-server.pid
ExecStop=/sbin/runuser -l <USERNAME> -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

[Install]
WantedBy=multi-user.target

Unnamed document

Getting 500 Internal error on /admin/application_settings
https://gitlab.com/gitlab-org/gitlab-foss/issues/56403

Gitlab WEB-IDE: Error while loading project data. please try again.
https://gitlab.com/gitlab-org/gitlab-foss/issues/45657

Gogs迁移到Gitlab -- 利用Gitea作为中介完美迁移

在一段时间以来,我一直使用轻量级的Gogs作为私有代码仓库。最近一段时间苦于Gogs缺少CI、任务管理等一系列功能,准备将Gogs迁移到Gitlab。

网上找过很多迁移方法只能迁移仓库,issues信息会全部丢失。因此我探索了一个可以完整迁移repos、issues的办法,在此简单记录迁移过程,不做详细教程。如果你希望从本文中获得帮助,请确保拥有以下知识储备:

  1. 能够完成Gogs的备份;
  2. 能够完成Gogs与Gitea的升级、降级;
  3. 了解Gitea的Access Tokens的使用;
  4. 能够安装Gitlab(或熟悉Gitlab的使用)。

- Read More -

t检验与点二列相关的异同

t检验、点二列相关
两者侧重点不同,前者重在检验两列数据的均值差异,即宏观上是否来自同一总体,后者关注两列数据的相关程度。
相同点在都是一个二分数据将一列等距或等比数据分类,且两者数值可以通过公式相互转换。

- Read More -

走火入魔四

通过一定方式制造出了人造生命体,并将一个天然生命体的记忆信息转存到这个新意义上的人造生命体,他们有着完全一样的思考方式、此时此刻同样的感受。这两个生命体是同一个生命吗?

- Read More -