解决vi不能使用鼠标右键复制粘贴的问题

星期四, 2021-04-22 | Author: Lee | linux | 没有评论 1,899 views

使用最新版本的deepin 20.2的版本,使用vi编辑文件时,发生无法使用鼠标右键复制和粘贴功能,很是不方便。

一使用粘贴就会进入可视插入的模式,解除此模式也很简单 使用 :set mouse=v 即可

##在可视模式下使用鼠标搞定
:set mouse=v
 
###启动了所有模式,这样就屏蔽了鼠标右健功能
:set mouse=a

Tags: ,

centos7下yum安装PHP 7.4, 7.3 & 7.2 & 7.1

星期二, 2021-03-09 | Author: Lee | linux, php | 没有评论 1,350 views

centos7下yum安装PHP 7.4, 7.3 & 7.2 & 7.1

1.系统为centos7.9

2.使用yum安装 命令如下:

  sudo yum install epel-release
 
  sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

2.1:安装php版本

  ## Install PHP 7.4 
  yum --enablerepo=remi-php74 install php
 
  ## Install PHP 7.3 
  yum --enablerepo=remi-php73 install php
 
  ## Install PHP 7.2 
  yum --enablerepo=remi-php72 install php
 
  ## Install PHP 7.1 
  yum --enablerepo=remi-php71 install php

2.2 安装php相关常用扩展(Modules)

	### For PHP 7.4
yum --enablerepo=remi-php74 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt
 
### For PHP 7.3
yum --enablerepo=remi-php73 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt
 
### For PHP 7.2
yum --enablerepo=remi-php72 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt
 
### For PHP 7.1
yum --enablerepo=remi-php71 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt

2.3 支持mysql及php-fpm

  ## For PHP 7.4 
  yum --enablerepo=remi-php74 install php-fpm mysqlnd
 
  ## For PHP 7.3 
  yum --enablerepo=remi-php73 install php-fpm mysqlnd
 
  ## For PHP 7.2 
  yum --enablerepo=remi-php72 install php-fpm mysqlnd
 
  ## For PHP 7.1 
  yum --enablerepo=remi-php71 install php-fpm mysqlnd

2.4 查看更多可安装的模块

› 继续阅读

Tags: , ,

deepin升级后无法进入图形界面的处理办法

星期四, 2021-01-28 | Author: Lee | computer, linux | 没有评论 2,388 views

一直升级都很正常,今天遭遇无法进入图形界面

解决如下:

ssh连接进入命令行界面:

	sudo apt-get install deepin-appstore
	##注意移除data数据即可
	sudo apt-get remove deepin-appstore-data
	sudo apt-get install dde
	sudo reboot

重启后进入搞定

Tags:

centos7.x配置安装chrome+chromedriver+selenium

星期四, 2020-12-31 | Author: Lee | JAVA-and-J2EE, linux | 没有评论 7,884 views

1.系统centos7.x

下载chrome

 wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

2. 安装chrome

 yum -y install ./google-chrome-stable_current_x86_64.rpm

2.1.Installed:
google-chrome-stable.x86_64 0:87.0.4280.88-1

查看chrome版本号

  [root@localhost soft]# google-chrome --version
   Google Chrome 87.0.4280.88

3.下载对应的chromedriver(87.0.4280.88)版本要保持一致

   wget https://npm.taobao.org/mirrors/chromedriver/87.0.4280.88/chromedriver_linux64.zip
 
   #解压chromedriver_linux64.zip
 
   unzip chromedriver_linux64.zip
   mv chromedriver /usr/bin/

4. 后续使用selenium等就可以愉快的使用了

5.修复中文方块问题

中文字体问题:下载宋体simsun,或者其他字体
把文件放到

    /usr/share/fonts/simsun.ttc
   ##执行命令
   fc-cache -fv

成功后即可

Tags: , ,

docker-selenium server的安装及使用

星期二, 2020-12-22 | Author: Lee | JAVA-and-J2EE, linux | 没有评论 1,745 views

1.需要使用selenium进行访问网站获取信息及截图

在服务器上安装对应的selenium比较麻烦,有docker真是方便多了

更多使用代码见:启用远程调用Docker下应用selenium-chrome服务

2.安装docker,如果已经安装可以忽略
此处选用的是chrome,完成后访问地址:http://localhost:4444/wd/hub
顺便安装下docker的openjdk11为以后备用.

 $ curl -sSL https://get.daocloud.io/docker | sh
 $ sudo systemctl start docker
 
 $ docker run -d -p 4444:4444 -v /dev/shm:/dev/shm selenium/standalone-chrome:4.0.0-beta-1-prerelease-20201208
 
 //如果遭遇iptables nat 等失败 可以重新启动下docker再运行selenium chrome解决
 $ service iptables stop
 $ service iptables start
 $ sudo systemctl restart docker
 $ docker run -d -p 4444:4444 -v /dev/shm:/dev/shm selenium/standalone-chrome:4.0.0-beta-1-prerelease-20201208
 
 //仅仅是备用,无需安装
 $ docker pull openjdk:11

3.使用selenium即可

<dependency>
	<groupId>org.seleniumhq.selenium</groupId>
	<artifactId>selenium-java</artifactId>
</dependency>

Tags: , ,

页面展示HTML的原代码不解析

星期六, 2020-11-07 | Author: Lee | html5, JAVA-and-J2EE | 没有评论 1,235 views

1.页面需要展示原文本,不需要解析,但是碰到有 html标签的部分需要注意

2.使用如下几种方式

2.1 使用 xmp标签 现在在html5中已经废弃,不建议再使用但是也最简单,无需转化

	<xmp>
		这里的代码将原样输出:
		<script>这里是脚本</script>
	</xmp>

2.2 使用 code 标签或者 pre标签,需要替换尖括号对应的转义符

如下转义即可

	var info= "<script>这里是脚本</script>";
	//替换一个  
	info = info.replace('<', '&lt;').replace('>', '&gt;');
	//全局替换 //g是重点,如果替换的为‘/’,需要转义,吧/</g替换为'/\//g'
	info = info.replace(/</g, '&lt;').replace(/>/g, '&gt;');
	<code>
		这里的代码将原样输出:
		&lt;script&gt;这里是脚本&lt;/script&gt;
	</code>
	<--pre>
		这里的代码将原样输出:
		&lt;script&gt;这里是脚本&lt;/script&gt;
	<--/pre>

2.3 使用 textarea标签

	<textarea>
		这里的代码将原样输出:
		<script>这里是脚本</script>
	</textarea>

Tags:

Lombok注解的类在eclipse下寻找getter/setter调用的办法

星期一, 2020-11-02 | Author: Lee | JAVA-and-J2EE | 没有评论 2,667 views

现在用Lombok已经是很普遍了,这里不去争好不好用,只解决个人遇到的不方便之处.

stackoverflow上对应的解决方法原文地址:

https://stackoverflow.com/questions/42644923/eclipse-with-lombok-search-for-getter-and-setter-usages

1.在面板处开启 outline 的选项,可以看到对应的 get和set方法,已经支持 @Setter 和@Getter 、@Data注解

2.右键 选择 “Open Call Hierarchy” 即可看到调用的情况

3.图示如下:

Right-click on the method in the Outline view, and use “Open Call Hierarchy”.

An other way to do it is to right-click on the annotation (@Setter for instance), and use “Open Call Hierarchy” on it

Tags:

Map不同实现对null值的限制不同

星期五, 2020-10-23 | Author: Lee | JAVA-and-J2EE | 没有评论 2,001 views

Map不同实现对null值的限制不同,罗列如下:

key value 线程安全
HashTable 不可为null 不可为null 线程安全
ConcurrentHashMap 不可为null 不可为null 线程安全
TreeMap 不可为null 可为null 线程不安全
HashMap 可为null 可为null 线程不安全

HashTable由于实现上使用key的hashcode()方法,所以key不能为null。ConcurrentHashMap需要使用key的hashcode(),TreeMap使用key的compare()方法排序,所以key不能为null。

Tags:

vertx升级到3.9.2的mysql client的变动

星期五, 2020-10-02 | Author: Lee | JAVA-and-J2EE | 没有评论 1,781 views

0. 应用有半年多没有动了,今天发现接口的数据丢失,未查到原因,重启应用解决,后续可能会放弃此应用 待定,先升个级

1.vertx升级到3.9.2 发现编译出错 调整修改

更多使用文档参加:https://vertx.io/docs/vertx-mysql-client/java/

 client
  .query("SELECT * FROM users WHERE id='sara'")
  .execute(ar -> {
  if (ar.succeeded()) {
    RowSet<Row> result = ar.result();
    System.out.println("Got " + result.size() + " rows ");
  } else {
    System.out.println("Failure: " + ar.cause().getMessage());
  }
 
  // Now close the pool
  client.close();

Tags:

guava-retrying延迟重试使用

星期三, 2020-09-30 | Author: Lee | JAVA-and-J2EE | 没有评论 2,542 views

0.很好用,但还是放弃使用了,主要guava依赖的版本原因,在guava-29和28版本中无法使用

项目git地址:https://github.com/rholder/guava-retrying

1.用法的几个类 列出如下:

    <dependency>
      <groupid>com.github.rholder</groupid>
      <artifactid>guava-retrying</artifactid>
      <version>2.0.0</version>
    </dependency>

› 继续阅读

Tags:

Search

文章分类

Links

Meta