0%

安装Redis,但是不是最新的,笔者安装时大概是安装3.2

yum install redis

如果要安装最新的redis,需要安装Remi的软件源,官网地址:http://rpms.famillecollet.com/

yum install -y http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
yum --enablerepo=remi install redis

阅读全文 »

首先 因为使用的CentOS 所以默认使用yum安装

  1. 安装snap
    确认自己使用的CentOS版本
    cat /etc/centos-release
    如果使用的是CentOS8
    1
    2
    sudo dnf install epel-release
    sudo dnf upgrade
    如果使用的CentOS7
    sudo yum install epel-release
    sudo yum install snapd
    如果出现
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    Error: Package: snapd-selinux-2.47.1-1.el7.noarch (epel)
    Requires: selinux-policy-base >= 3.13.1-268.el7
    Installed: selinux-policy-targeted-3.13.1-266.el7_8.1.noarch (@updates)
    selinux-policy-base = 3.13.1-266.el7_8.1
    Available: selinux-policy-minimum-3.13.1-266.el7.noarch (base)
    selinux-policy-base = 3.13.1-266.el7
    Available: selinux-policy-minimum-3.13.1-266.el7_8.1.noarch (updates)
    selinux-policy-base = 3.13.1-266.el7_8.1
    Available: selinux-policy-mls-3.13.1-266.el7.noarch (base)
    selinux-policy-base = 3.13.1-266.el7
    Available: selinux-policy-mls-3.13.1-266.el7_8.1.noarch (updates)
    selinux-policy-base = 3.13.1-266.el7_8.1
    Available: selinux-policy-targeted-3.13.1-266.el7.noarch (base)
    selinux-policy-base = 3.13.1-266.el7
    You could try using --skip-broken to work around the problem
    You could try running: rpm -Va --nofiles --nodigest
    yumdownloader snapd-selinux-2.47.1-1.el7.noarch

rpm –force –nodeps -ivh

启动并且开启端口
sudo systemctl enable --now snapd.socket
为了支持旧模式,建立一个链接
sudo ln -s /var/lib/snapd/snap /snap
2. 安装CertBot
sudo snap install --classic certbot
为CertBot创建一个软链接
sudo ln -s /snap/bin/certbot /usr/bin/certbot
如果想要覆盖nginx配置
sudo certbot –nginx
如果不想覆盖nginx配置
sudo certbot certonly –nginx
测试自动更新证书功能
sudo certbot renew –dry-run
可以验证域名了

阅读全文 »

首先安装yum-utils

sudo yum install yum-utils

创建/etc/yum.repos.d/nginx.repo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

repo默认使用stable版本,如果想使用mainline开发版本

sudo yum-config-manager --enable nginx-mainline

安装nginx

sudo yum install nginx

如果有指纹效验 573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62 接受它就好了

服务管理

阅读全文 »

1 标题修饰符 ‘#’

1
# 一级标题 h1

一级标题 h1

1
## 二级标题 h2

二级标题 h2

1
### 三级标题 h3

三级标题 h3

1
#### 四级标题 h4

四级标题 h4

1
##### 五级标题 h5
阅读全文 »

查询当前所有域名

1
2
3
4
5
6
7
8
9
10
11
12
[root@iZj6cgoyl5x6opizfwaukrZ ~]# certbot certificates
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
Certificate Name: 123.com
Serial Number: 44365432b76836764e9e41b30da3a4faaba
Domains: 123.com
Expiry Date: 2020-12-30 14:26:28+00:00 (VALID: 53 days)
Certificate Path: /etc/letsencrypt/live/123.com/fullchain.pem
Private Key Path: /etc/letsencrypt/live/123.com/privkey.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

如果你想删除一个域名

1
2
sudo certbot revoke --cert-name 123.com
sudo certbot revoke --cert-path /etc/letsencrypt/live/123.com/

如果你想增加一个域名的https

1
sudo certbot -d your.new.tld --expand
阅读全文 »

卸装

  1. yum检查安装方式
    查看yum是否安装过mysql
    yum list installed mysql*
    如或显示了列表,说明系统中有MySQL
    avatar
  • yum卸装

    1
    2
    yum remove mysql-community-client mysql-community-common mysql-community-libs
    mysql-community-libs-compat mysql-community-server mysql57-community-release
  • rpm查看安装

    1
    rpm -qa | grep -i mysql

    avatar

  • rpm卸装

    1
    2
    3
    4
    5
    6
    rpm -e mysql57-community-release-el7-9.noarch
    rpm -e mysql-community-server-5.7.17-1.el7.x86_64
    rpm -e mysql-community-libs-5.7.17-1.el7.x86_64
    rpm -e mysql-community-libs-compat-5.7.17-1.el7.x86_64
    rpm -e mysql-community-common-5.7.17-1.el7.x86_64
    rpm -e mysql-community-client-5.7.17-1.el7.x86_64
  • 清理残余

    1
    whereis mysql或find / -name mysql 删除文件
  • 删除配置

    1
    2
    rm –rf /usr/my.cnf
    rm -rf /root/.mysql_sercret
  • 剩余配置检查

    1
    2
    chkconfig --list | grep -i mysql
    chkconfig --del mysqld

安装

  • 安装repo
    1
    https://dev.mysql.com/downloads/repo/yum/
    avatar
  • 下载并安装
    1
    2
    wget wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
    yum localinstall mysql57-community-release-el7-8.noarch.rpm
  • 检查mysql源是否安装成功
    yum repolist enabled | grep "mysql.*-community.*"
  1. 修改 vim /etc/yum.repos.d/mysql-community.repo源 ,改变默认安装的mysql版本。比如要安装5.6版本,将5.7源的enabled=1改成enabled=0。然后再将5.6源的enabled=0改成enabled=1即可。改完后保存 按ESC 后 按 shift + : 输入 wq 保存退出
  • 安装MySQL
    yum install mysql-community-server
  • 启动MySQL服务
    systemctl start mysqld
  • 开机启动
    systemctl enable mysqld
  • 修改root本地登录密码
    grep 'temporary password' /var/log/mysqld.log
阅读全文 »

今天还是决定使用AS 4.0

1
2
3
4
5
6
7
8
9
10
11
Unable to find method 'org.gradle.api.tasks.TaskInputs.property(Ljava/lang/String;Ljava/lang/Object;)Lorg/gradle/api/tasks/TaskInputs;'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

解决方法:降级gradle插件到3.6.3 降级gradle到5.6.4

也有greendao的问题


classpath ‘org.greenrobot:greendao-gradle-plugin:3.2.2’
升级至
classpath ‘org.greenrobot:greendao-gradle-plugin:3.3.0’
即可解决

修改生成apk的路径

avatar
修改输出的文件夹位置

阅读全文 »

1
2
3
4
5
6
7
8
9
10
D:\Project\AS\Label\app\src\main\java\com\tscale\ttouch\label\di\component\AppComponent.java:36: 错误: [Dagger/MissingBinding] [dagger.android.AndroidInjector.inject(T)] com.tscale.ttouch.label.ui.function.FunctionActivity cannot be provided without an @Inject constructor or an @Provides-annotated method. This type supports members injection but cannot be implicitly provided.
public interface AppComponent {
^
A binding with matching key exists in component: com.tscale.ttouch.label.di.builder.ActivityBuilder_BindFunctionActivity.FunctionActivitySubcomponent
com.tscale.ttouch.label.ui.function.FunctionActivity is injected at
com.tscale.ttouch.label.ui.fragment.setting.ad.video.ADVideoFragmentModule.provideGridLayoutManager(activity)
androidx.recyclerview.widget.GridLayoutManager is injected at
com.tscale.ttouch.label.ui.fragment.setting.ad.video.ADVideoFragment.mGridLayoutManager
com.tscale.ttouch.label.ui.fragment.setting.ad.video.ADVideoFragment is injected at
dagger.android.AndroidInjector.inject(T)

这个问题是因为FunctionActivity错误,应该为SettingActivity

阅读全文 »

今天使用dagger时遇到一个错误,提示完全不知所云

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
D:\Project\AS\Label\app\src\main\java\com\xxx\xxx\label\LabelApp.java:44: 错误: 找不到符号  
import com.xxx.xxx.label.di.component.DaggerAppComponent;
^
符号: 类 DaggerAppComponent
位置: 程序包 com.xxx.xxx.label.di.component
D:\Project\AS\Label\app\src\main\java\com\xxx\xxx\label\di\component\AppComponent.java:36: 错误: [Dagger/MapKeys] [dagger.android.AndroidInjector.inject(T)] The same map key is bound more than once for java.util.Map<java.lang.Class<? extends androidx.fragment.app.Fragment>,javax.inject.Provider<dagger.android.AndroidInjector.Factory<? extends androidx.fragment.app.Fragment>>>
public interface AppComponent {
^
@Binds @dagger.multibindings.IntoMap @dagger.android.support.FragmentKey(com.xxx.xxx.label.ui.fragment.menu.MenuFragment.class) dagger.android.AndroidInjector.Factory<? extends androidx.fragment.app.Fragment> com.xxx.xxx.label.ui.fragment.product.item.ItemInfoFragmentProvider_ProvideMenuFragmentFactory.bindAndroidInjectorFactory(com.xxx.xxx.label.ui.fragment.product.item.ItemInfoFragmentProvider_ProvideMenuFragmentFactory.MenuFragmentSubcomponent.Builder)
@Binds @dagger.multibindings.IntoMap @dagger.android.support.FragmentKey(com.xxx.xxx.label.ui.fragment.menu.MenuFragment.class) dagger.android.AndroidInjector.Factory<? extends androidx.fragment.app.Fragment> com.xxx.xxx.label.ui.fragment.product.category.CategoryFragmentProvider_ProvideMenuFragmentFactory.bindAndroidInjectorFactory(com.xxx.xxx.label.ui.fragment.product.category.CategoryFragmentProvider_ProvideMenuFragmentFactory.MenuFragmentSubcomponent.Builder)
java.util.Map<java.lang.Class<? extends androidx.fragment.app.Fragment>,javax.inject.Provider<dagger.android.AndroidInjector.Factory<? extends androidx.fragment.app.Fragment>>> is injected at
dagger.android.DispatchingAndroidInjector.<init>(injectorFactories)
dagger.android.DispatchingAndroidInjector<androidx.fragment.app.Fragment> is injected at
com.xxx.xxx.label.ui.product.ProductActivity.fragmentDispatchingAndroidInjector
com.xxx.xxx.label.ui.product.ProductActivity is injected at
dagger.android.AndroidInjector.inject(T)
component path: com.xxx.xxx.label.di.component.AppComponent → com.xxx.xxx.label.di.builder.ActivityBuilder_BindProductActivity.ProductActivitySubcomponent
2 个错误

解决方法

最后发现是一个公共对话框的provider没有导入

阅读全文 »

今天进行操作的时候突然报了一个”非法前向引用”错误

因为是头一次见,同事也帮忙看了,最奇怪的是Application报错
但是application本身没有错
最后,发现时AppConstants中出现 非法前向引用 错误,
看来还是要多检查

阅读全文 »