凝思6.0.80(debian8)离线安装QTcreator5.12.3

Qt从5.15开始不再提供离线包的安装方式,查询发现debian8最高支持到qt5.12.3,本文主要就来讲下Qt5.12在凝思系统上的安装过程。安装主要分为以下几步:

①安装dbus 和 freetype
②写入bash
③安装qtCreator

首先需要准备dbus-1.13.8.tar.xz 和 freetype-2.10.0.tar.bz2两个包,安装过程均在需要使用qtcreator的用户下安装。

1.安装dbus 和 freetype

安装dubs

mkdir /home/ghostxiu/lib
tar -xf dbus-1.13.8.tar.xz
cd dbus-1.13.8
./configure --prefix=/home/ghostxiu/lib/dbus
make && make install

安装freetype

tar -xf freetype-2.10.0.tar.bz2
cd freetype-2.10.0
./configure --prefix=/home/ghostxiu/lib/freetype
make && make install

2.写入bash

将 dbus和bash的正确地址写入当前用户的bash

cd ~
vi .bashrc

在文件末尾追加

export LD_LIBRARY_PATH=/home/ghostxiu/lib/freetype/lib:/home/ghostxiu/lib/dbus/lib:$SYHHOME/lib
PATH=$SYHHOME/bin:$PATH:/home/ghostxiu/Qt5.12.3/Tools/QtCreator/bin

source使编辑生效

source .bashrc

3.安装qt5.12.3

首先下载qt离线安装包,点击跳转下载

之后启动安装器

chmod +x qt-opensource-linux-x64-5.12.3.run
./qt-opensource-linux-x64-5.12.3.run

点击next→skip→下一步(不要管用户登录的),到选择目录的地方,把目录配置为/home/ghostxiu/Qt5.12.3

下一步,选中5.12.3的桌面开发环境

然后点击下一步等待安装结束。

安装结束后,以后在终端输入

qtcreator

即可启动qtcreator

本文完。

凝思6.0.80(debian8)离线安装MySQL5.7.30

国网安全要求,电力系统必须使用国产操作系统

2021.6.21 凝思6.0.80 (此时最新)基于debian8,安装系统时选择intsall方式,除办公软件类全装,由于 80 系统配置软件过于落后(如mysql为5.5版本,gcc492,python3.4),所以只有自己升级了。本教程主要针对于mysql的升级。

由于凝思网络问题,这里使用手动升级的方式,使用deb安装包。对于凝思系统,不使用激活码不能联网,当然你可以联系他们的销售,会给你试用码。

本教程分为三步:

①卸载旧版mysql

②安装mysql5.7.5

③解决mysql配置问题

下面开始正式步骤:

1.卸载旧版Mysql

登录凝思OrDebian8服务器,获取 终端root权限后列出已安装的mysq的deb包

su
dpkg --list|grep mysql

我这边结果如下,需要依次卸载如下软件包,当然你的系统可能会有所不同,按照提示的依赖关系卸载即可,注意到mysql-common 和 libmysqlclient18:amd64也是5.5版本的,这两者不用卸载,安装新版以后,他们的版本会发生变化。

dpkg -r mysql-server
dpkg -r libmysqlclient-dev
dpkg -r mysql-server-5.5
dpkg -r mysql-client-5.5
dpkg -r mysql-server-core-5.5

卸载mysql5.5配置

dpkg --purge mysql-server-5.5

选择是,删除mysql数据,注意备份以前的数据。

致此,mysql5.5卸载完成。

2.安装Mysql5.7.30

首先去mysql社区版管网,发现debian8最高支持到mysql5.7.30,从官网下载mysql5.7.30的软件包。

点击进入下载地址

由于我这边是X86架构的工控机,所以选择AMD64版本,如果你使用ARM架构机器,可以下载ARM架构的版本。

解压mysql安装包,并按以下顺序安装:

tar -xvf mysql-server_5.7.30-1debian8_amd64.deb-bundle.tar 
dpkg -i mysql-common_5.7.30-1debian8_amd64.deb

安装mysql配置文件并设置登录信息

 dpkg-preconfigure mysql-community-server_5.7.30-1debian8_amd64.deb

此处输入数据库root用户的密码,接下来继续安装

dpkg -i libmysqlclient20_5.7.30-1debian8_amd64.deb
dpkg -i libmysqlclient-dev_5.7.30-1debian8_amd64.deb
dpkg -i libmysqld-dev_5.7.30-1debian8_amd64.deb
dpkg -i mysql-community-client_5.7.30-1debian8_amd64.deb
dpkg -i mysql-client_5.7.30-1debian8_amd64.deb
dpkg -i mysql-common_5.7.30-1debian8_amd64.deb

此处需要补一个libmecab2_0.996-1.1_amd64.deb的包才能继续,可以去这里下载。然后继续执行安装:

dpkg -i libmecab2_0.996-1.1_amd64.deb
dpkg -i mysql-community-server_5.7.30-1debian8_amd64.deb 
dpkg -i mysql-server_5.7.30-1debian8_amd64.deb

这时候mysql5.7.30已经安装完成,我们可以输入以下命令查看mysql版本

mysql -V

但是重启mysql会发现重启不成功,这是为什么呢?我们将在第三部分来解决这个问题。

3. 解决mysql配置问题

查看myql配置文件路径

mysql --help | grep my.cnf

结果如下

/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf 

查看这三个文件以后,发现其中的两个文件都不存在,而另一个文件/etc/mysql/my.cnf则是一个无效连接(和另一个文件互为软连接,怀疑是新老版本交替时的配置冲突)。

复制 /etc/mysql/my.cnf 的文本内容。

Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
#
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
#
This program is also distributed with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have included with MySQL.
#
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License, version 2.0, for more details.
#
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/

并删除原文件,新建 /etc/mysql/my.cnf文件,并写入如上复制的内容。

rm -f  /etc/mysql/my.cnf 
vi  /etc/mysql/my.cnf  

可以看到,真正的配置文件,在/etc/mysql/conf.d/ 和/etc/mysql/mysql.conf.d/ 两个文件夹中,实际就是/etc/mysql/mysql.conf.d/mysqld.cnf 。

启动还是失败,发现/usr/sbin/mysqld权限不对,是凝思系统级用户权限。我也不知道他弄着用户是干嘛的,也许是安全吧。

执行赋权操作

chmod 755 /usr/sbin/mysqld

接下来就可以重启mysql,并把mysql加入启动项

systemctl restart mysql 
systemctl enable mysql

本文完。

别故里

若非心内有红尘,何需流连无妄海
味采罂粟登九霄,敢弑碎骨落云台

——————————脩于公元贰零贰零年拾壹月拾日

问修:为何而行,不看嬉戏,怎得芳心?答:宁落孤鹰,不攀燕雀。问修:何不堕尘,可以解忧?答:万千趣事,慨叹无时

利用服务器搭建Cloudreve,实现离线下载

0.环境说明:

建议服务器配置:Centos7 LNMP RAM 1G+ ,剩余磁盘空间20G+

如果嫌配置麻烦可以用宝塔等工具。

准备,①MYSQL数据库账户一个,如:

账户:pan_wolfmark_org 密码:wolfmark

②指向网盘域名的nginx网盘空间一个,宝塔的快速配置方法如下:

③php安装fileinfo插件

1.配置伪静态:

nginx方法:

location / {
 if (!-e $request_filename) {
 rewrite ^(.*)$ /index.php?s=/$1 last;
 break;
 }
 }

2.安装cloudreve:

①下载安装包到服务器:https://cloudreve.org/download.php

cd /www/wwwroot/pan.wolfmark.org
rm -f *
wget https://download.cloudreve.org/build/3620131c77c90ec59d5fce2572e7421592197ffc.zip
unzip 3620131c77c90ec59d5fce2572e7421592197ffc.zip
rm -f 3620131c77c90ec59d5fce2572e7421592197ffc.zip
chmod 777 -R /www/wwwroot/pan.wolfmark.org/application
chown www:www -R /www/wwwroot/pan.wolfmark.org/application

②访问:http://pan.wolfmark.org/CloudreveInstaller/, 查看显示为X的项并补全

安装二次验证的依赖库:

 composer require phpgangsta/googleauthenticator:dev-master
 composer require endroid/qrcode

③ php7删除putenv proc_open proc_get_status pcntl_signal 函数禁用

输入0中数据库账户密码安装
管理后台地址:
http://pan.wolfmark.org/Admin
账号:
admin@cloudreve.org
密码:
admin

3.安装aria2:

①到https://github.com/aria2/aria2/releases下载最新版:

wget https://github.com/aria2/aria2/releases/download/release-1.35.0/aria2-1.35.0.tar.gz
tar -xvf aria2-1.35.0.tar.gz
cd aria2-1.35.0
./configure
make
make install

2.配置aria2:

mkdir /etc/aria2

①下载标准配置文件:

wget --no-check-certificate -O "/etc/aria2/aria2.conf" "https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/other/Aria2/aria2.conf"

wget --no-check-certificate -O "/etc/aria2/dht.dat" "https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/other/Aria2/dht.dat"

touch  /etc/aria2/aria2.session
vi /etc/aria2/aria2.conf 

②修改aria2.session配置:

下载地址,和cloudreve后台一致:

dir=/www/wwwroot/pan.wolfmark.org/public/downloads
input-file=/etc/aria2/aria2.session
#RPC服务端口,默认是6800
rpc-listen-port=6800
#设置PRC服务的密钥,在后的配置中会用到,可以自己设定具体内容
rpc-secret=wolfmark.org
#底部添加
on-download-complete=/root/hook.sh

③添加service:

vi /lib/systemd/system/aria2.service

写入:

[Unit]
Description=aria2c

[Service]
User=root
ExecStart=/usr/local/bin/aria2c --conf-path=/etc/aria2/aria2.conf
Restart=on-abort

[Install]
WantedBy=multi-user.target

④添加hook.sh,解决权限问题:

vi /root/hook.sh
#写入
!/bin/sh
chown www:www -R /www/wwwroot/pan.wolfmark.org/public/downloads
chmod -R 777 /www/wwwroot/pan.wolfmark.org/public/downloads
chmod +x /root/hook.sh

4.其它配置:

①配置离线下载

进入 http://pan.wolfmark.org/Admin

在离线下载中填入下载目录和Token

②修改后台用户空间大小和离线下载权限:

用户组 页面修改

③重载DEAMON:

systemctl daemon-reload
systemctl enable aria2
systemctl restart aria2

科学上网V2RAY环境简单配置(SS/SSR替代品)

0.环境说明:

①Centos7 搬瓦工 VPS

②RAM 1G SSD 20G

推荐VPS:搬瓦工、Linode、魔方云、akkocloud

点击进入搬瓦工VPS购买地址

随着封锁力度的加大,SS/SSR基本已经用不了,替代品V2ray应运而生,下面开始正式安装过程。
(附:搬瓦工2020年6.58优惠码: BWH3HYATVBJW

1. 搭建v2ray

这里使用脚本安装

①时钟矫正:

yum -y install ntp
ntpdate pool.ntp.org
systemctl start ntpd

若不进行时钟矫正,则可能出现I/O错误等问题

②安装wget:

yum install wget -y  

③安装unzip:

yum install -y zip unzip

④下载脚本:

wget https://install.direct/go.sh

⑤执行安装:

chmod +x go.sh 
bash go.sh
如图所示,即V2RAY安装成功

2.V2ray操作和升级

①v2ray常用命令:

systemctl start v2ray #启动v2ray
systemctl stop v2ray #停止v2ray
systemctl restart v2ray #重启 v2ray
systemctl status v2ray #查看状态 v2ray
systemctl enable v2ray  #开机自启
systemctl disable v2ray  #禁止开启启动
 #注:修改完配置要重启 

②查看v2ray配置文件:

cat /etc/v2ray/config.json  #查看配置文件
vi  /etc/v2ray/config.json  #修改配置文件

③升级:

 bash go.sh #当有新版本时,重新执行实现升级

3.防火墙配置

打开2中配置 port 端口

防火墙配置配置方法,参考:

4.配置客户端,实现科学上网

①安卓客户端:

②windows客户端:

③Mac客户端:

④IOS客户端:

ios目前没有无免费的客户端,付费的有:Shadowrocket、pepi、i2Ray、Kitsunebi和Quantumult。

5.v2ray常见问题解决方法

一般来讲,安装完成后就已经大功告成了,但是也会出现一些奇怪的错误,比如配置运行都正常,但是客户端链接的时候报”io:read/write on closed pipe”等问题,这里就几种简单的问题做一些解释。

①时钟问题导致链接错误:

参考前文”1. 搭建v2ray”中”①时钟矫正”

②防火墙等配置错误:

查看端口开放状态(服务端)

yum install net-tools -y #安装net-tools
netstat -ntulp #检查你配置的端口是否被监听 即"port"

检查端口链接是否正常(客户端)

telnet x.wolfmark.org 11111 #x.wolfmark.org 是你的IP地址  11111 是你V2RAY开放的端口号

③配置错误:

不可否认,配置错误是会经常发生的问题:这里主要关注端口(port) 、 id、alterId

Centos 7 关闭SELINUX ,两种防火墙配置(firewalld、iptables),可解决90%的访问问题

0.环境说明:

①Centos7.X VPS (搬瓦工)

②RAM 1G SSD 20G

推荐VPS:搬瓦工、Linode、魔方云、Akkcloud

点击进入搬瓦工VPS购买地址

1.关闭SELINUX(以root权限进入)

selinux开启常会导致一些未知错误,所以建议关闭。

①查看selinux状态(Disable表示已关闭):

getenforce
sestatus #centos7支持的方式

②临时关闭selinux:

setenforce 0 
 #设置 selinux 成为permissive模式   
 #setenforce 1 设置 selinux 成为enforcing模式 

③永久关闭 :

vi /etc/selinux/config
 #将SELINUX=enforcing改为SELINUX=disabled,输入:wq保存,需重启后生效

2.iptables防火墙配置(centos7以前的版本常用)

由于centos7默认的防火墙时firewalld,所以需要先禁用,再开启iptables

①禁用firewalld,启用iptables:

systemctl stop firewalld #关闭firewalld防火墙
systemctl mask firewalld #屏蔽firewalld防火墙 
yum install iptables-services -y #安装iptables
systemctl enable iptables #设置开机启动

②iptables规则配置:

vi /etc/sysconfig/iptables #编辑防火墙配置

下面是一个完整的配置实例,配置好后保存退出:

#-A和-I参数分别为添加到规则末尾和规则最前面。
#允许本地回环接口(即运行本机访问本机)
iptables -A INPUT -i lo -j ACCEPT
# 允许已建立的或相关连的通行
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
#允许所有本机向外的访问iptables -P INPUT ACCEPT
iptables -A OUTPUT -j ACCEPT
# 允许访问22端口(一般为SSH链接地址)
iptables -A INPUT -p tcp --dport 22 -j ACCEPTiptables -A INPUT -p tcp -s 10.159.1.0/24 --dport 22 -j ACCEPT   注:-s后可以跟IP段或指定IP地址
#允许访问80端口(网页)
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
#允许FTP服务的21和20端口
iptables -A INPUT -p tcp --dport 21 -j ACCEPT
iptables -A INPUT -p tcp --dport 20 -j ACCEPT
#如果有其他端口的话,规则也类似,稍微修改上述语句就行
#允许ping
iptables -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
#禁止其他未允许的规则访问
iptables -A INPUT -j REJECT  #(注意:如果22端口未加入允许规则,SSH链接会直接断开。)
iptables -A FORWARD -j REJECT

③iptables常用命令:

service  iptables restart #centos6 重启 
service  iptables start #centos6 开启 
service  iptables stop #centos6 关闭 
service iptabes status #centos6 查看状态

systemctl status  iptables  #查看状态
systemctl stop  iptables  #关闭 
systemctl start  iptables #开启 
systemctl  restart  iptables #重启
systemctl  disable  iptables  #关闭开机启动 

3.firewalld防火墙配置(centos7默认)

①firewalld常用命令:

systemctl status  firewalld#查看状态
systemctl stop  firewalld#关闭 
systemctl start  firewalld#开启 
systemctl restart  firewalld#重启
systemctl disable  firewalld#关闭开机启动 
firewall-cmd --list-all #查看配置规则
firewall-cmd --zone=public --list-ports #显示所有打开的端口
firewall-cmd --reload #重新载入规则

②firewalld规则配置:

增加有一条80端口的TCP规则实例

 firewall-cmd --zone=public --add-port=80/tcp --permanent #(--permanent永久生效,没有此参数重启后失效)
 firewall-cmd --reload #重新载入规则 
 systemctl restart  firewalld#重启 

南窗空雪误年华

南窗有雪
绿萝垂
泥来成器
年华误
路行灯缀
踏空无

——————————脩于公元贰零贰零年贰月贰日

[mysql 别名as]select … as不能当做字段一样使用

$SELECT name AS nm1 FROM student WHERE nm1 LIKE "%Wang%";

执行会报以下错误:

[Err] 1054 - Unknown column 'nm1' in 'where clause'

原因:别名只是对字段的一种引用,不能当做字段一样使用。

变通策略:

$SELECT nm1 FROM (SELECT name AS nm1 FROM student)AS temptab WHERE nm1 LIKE "%Wang%";

重马遗佳

万家星光碗沿乱
他窗饱暖笑语多
天公神凿雾都断
一斩半城半山峦


百转不见佳人行
颠簸驰骋三千里
好友待我四海晴
千峰入云百丈低

——————————脩于公元贰零壹玖年十二月玖日

佳人不得见,幸得友人招待

三天丶别少年

三天丶别少年

当我少年时,不知红颜美 
当我少年时,不知美酒醉
当我少年时,不知蹊径幽
当我少年时,不知自醒烦
年少无所知,年少无所为
别了少年,老了容颜,蒙了双眼,跛了手脚,没了执念,碎了心愿?!

——————————脩于公元贰零壹玖年玖月叁日