??xml version="1.0" encoding="utf-8" standalone="yes"?>棒球比分雪缘:BlogJava-新手?/title><link>//www.355548.live/beginner</link><description>专注于Java技?/description><language>zh-cn</language><lastBuildDate>Wed, 24 Jun 2020 18:20:33 GMT</lastBuildDate><pubDate>Wed, 24 Jun 2020 18:20:33 GMT</pubDate><ttl>60</ttl><item><title>为啥文g的CHECKSUM中SHA512比MD5高Q?/title><link>//www.355548.live/paulwong/archive/2020/06/16/435513.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Tue, 16 Jun 2020 02:21:00 GMT</pubDate><guid>//www.355548.live/paulwong/archive/2020/06/16/435513.html</guid><wfw:comment>//www.355548.live/paulwong/comments/435513.html</wfw:comment><comments>//www.355548.live/paulwong/archive/2020/06/16/435513.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.355548.live/paulwong/comments/commentRss/435513.html</wfw:commentRss><trackback:ping>//www.355548.live/paulwong/services/trackbacks/435513.html</trackback:ping><description><![CDATA[<a target="_blank">https://stackoverflow.com/questions/2117732/reasons-why-sha512-is-superior-to-md5</a><br /><img src ="//www.355548.live/paulwong/aggbug/435513.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.355548.live/paulwong/" target="_blank">paulwong</a> 2020-06-16 10:21 <a href="//www.355548.live/paulwong/archive/2020/06/16/435513.html#Feedback" target="_blank" style="text - 棒球比分大小怎么算|վ//www.355548.live/paulwong/archive/2020/06/04/435480.htmlpaulwongpaulwongThu, 04 Jun 2020 02:38:00 GMT//www.355548.live/paulwong/archive/2020/06/04/435480.html//www.355548.live/paulwong/comments/435480.html//www.355548.live/paulwong/archive/2020/06/04/435480.html#Feedback0//www.355548.live/paulwong/comments/commentRss/435480.html//www.355548.live/paulwong/services/trackbacks/435480.html//jartto.wang/tags/git/



paulwong 2020-06-04 10:38 发表评论
]]>
d搞懂 Git-Rebase - 棒球比分大小怎么算|վ//www.355548.live/paulwong/archive/2020/06/04/435479.htmlpaulwongpaulwongThu, 04 Jun 2020 02:37:00 GMT//www.355548.live/paulwong/archive/2020/06/04/435479.html//www.355548.live/paulwong/comments/435479.html//www.355548.live/paulwong/archive/2020/06/04/435479.html#Feedback0//www.355548.live/paulwong/comments/commentRss/435479.html//www.355548.live/paulwong/services/trackbacks/435479.htmlGIT会将功能分支1上的所有COMMIT另存一个文Ӟ回退到分?原始状态,再更新至当前分支1的状态,再把另存文g的COMMIT执行一遍,成了已l合q的新的功能分支1?br />
//jartto.wang/2018/12/11/git-rebase/


paulwong 2020-06-04 10:37 发表评论
]]>
How To Run Java Jar Application with Systemd on Linux - 棒球比分大小怎么算|վ//www.355548.live/paulwong/archive/2020/05/11/435427.htmlpaulwongpaulwongMon, 11 May 2020 08:16:00 GMT//www.355548.live/paulwong/archive/2020/05/11/435427.html//www.355548.live/paulwong/comments/435427.html//www.355548.live/paulwong/archive/2020/05/11/435427.html#Feedback0//www.355548.live/paulwong/comments/commentRss/435427.html//www.355548.live/paulwong/services/trackbacks/435427.htmlhttps://computingforgeeks.com/how-to-run-java-jar-application-with-systemd-on-linux/

systemd自启动javaE序
https://www.cnblogs.com/yoyotl/p/8178363.html
------------------------------------------------------------

[Unit]
Description=TestJava
After=network.target

[Service]
Type=forking
ExecStart=/home/test/startTest.sh
ExecStop=/home/test/stopTest.sh

[Install]
WantedBy=multi-user.target

-------------------------------------------------------------
How to Autorun application at the start up in Linux
https://developer.toradex.com/knowledge-base/how-to-autorun-application-at-the-start-up-in-linux

How to automatically run program on Linux startup
https://www.simplified.guide/linux/automatically-run-program-on-startup


Systemd 入门教程Q实战篇
https://www.ruanyifeng.com/blog/2016/03/systemd-tutorial-part-two.html

Systemd 入门教程Q命令篇

//www.ruanyifeng.com/blog/2016/03/systemd-tutorial-commands.html

paulwong 2020-05-11 16:16 发表评论
]]>
How to disable IPv6 on CentOS / RHEL 7 - 棒球比分大小怎么算|վ//www.355548.live/paulwong/archive/2020/05/06/435410.htmlpaulwongpaulwongWed, 06 May 2020 04:42:00 GMT//www.355548.live/paulwong/archive/2020/05/06/435410.html//www.355548.live/paulwong/comments/435410.html//www.355548.live/paulwong/archive/2020/05/06/435410.html#Feedback0//www.355548.live/paulwong/comments/commentRss/435410.html//www.355548.live/paulwong/services/trackbacks/435410.html https://www.thegeekdiary.com/centos-rhel-7-how-to-disable-ipv6/

https://linuxconfig.org/redhat-8-enable-disable-ipv6




paulwong 2020-05-06 12:42 发表评论
]]>
How To Count Files in Directory on Linux - 棒球比分大小怎么算|վ//www.355548.live/paulwong/archive/2020/05/05/435404.htmlpaulwongpaulwongTue, 05 May 2020 09:01:00 GMT//www.355548.live/paulwong/archive/2020/05/05/435404.html//www.355548.live/paulwong/comments/435404.html//www.355548.live/paulwong/archive/2020/05/05/435404.html#Feedback0//www.355548.live/paulwong/comments/commentRss/435404.html//www.355548.live/paulwong/services/trackbacks/435404.htmlhttps://devconnected.com/how-to-count-files-in-directory-on-linux/



paulwong 2020-05-05 17:01 发表评论
]]>
搭徏React环境Q运行React目 - 棒球比分大小怎么算|վ//www.355548.live/ZouYonghui/archive/2020/04/16/435361.htmlTerry ZouTerry ZouThu, 16 Apr 2020 07:25:00 GMT//www.355548.live/ZouYonghui/archive/2020/04/16/435361.html//www.355548.live/ZouYonghui/comments/435361.html//www.355548.live/ZouYonghui/archive/2020/04/16/435361.html#Feedback0//www.355548.live/ZouYonghui/comments/commentRss/435361.html//www.355548.live/ZouYonghui/services/trackbacks/435361.html2.安装cnpm用cnpm替代npm
    地址Q//npm.taobao.org/
安装cnpm:
npm install -g cnpm --registry=https://registry.npm.taobao.org

3、用yarn替代npm
yarn的安装:
W一U方法:参考官Ҏ?https://yarn.bootcss.com/
W二U方法:cnpm install -g yarn  或?npm install -g yarn
4、搭建React开发环境的W一U方法(?现在推荐Q:
https://reactjs.org/docs/create-a-new-react-app.html
1、必要安装nodejs     注意Q安装nodejsE_版本      教程中的nodejs版本:v8.11.2            教程中的npm版本:v5.6.0
2.安装脚手架工?nbsp;  Q单文glg目生成工具Q?nbsp;  只需要安装一?/div>
npm install -g create-react-app   /  cnpm install -g create-react-app
3.创徏目   Q可能创建多ơ)
扑ֈ目要创建的目录Q?/div>
                create-react-app reactdemo
4.cd  到项目里?span style="white-space:pre">
        cd  reactdemo
                npm start             yarn startq行目
                npm run build         yarn build 生成目
5、搭建React的开发环境的W二U方法(?未来推荐Q:
        https://reactjs.org/docs/create-a-new-react-app.html
        1、必要安装nodejs     注意Q安装nodejsE_版本      教程中的nodejs版本:v8.11.2            教程中的npm版本:v5.6.0
        2.安装脚手架工具ƈ创徏目
            扑ֈ目要创建的目录执行Q?/div>
npx create-react-app reactdemo
4.cd  到项目里?span style="white-space: pre;">
        cd  reactdemo
                npm start  q行目Q调试)
                npm run build 生成目Q发布)
npx介绍Q?/div>
npm v5.2.0引入的一条命令(npxQ,引入q个命o的目的是Z提升开发者用包内提供的命o行工L体验?/div>
详情Q?/div>
        npx create-react-app reactdemoq条命o会时安?create-react-app 包,命o完成后create-react-app 会删掉,不会出现?global 中。下ơ再执行Q还是会重新临时安装?/div>
npx 会帮你执行依赖包里的二进制文件?/div>
        再比?npx http-server 可以一句话帮你开启一个静态服务器


Terry Zou 2020-04-16 15:25 发表评论
]]>Spring中的ApplicationListener的用详解案例(观察者模? - 棒球比分大小怎么算|վ//www.355548.live/ZouYonghui/archive/2020/04/09/435329.htmlTerry ZouTerry ZouThu, 09 Apr 2020 06:47:00 GMT//www.355548.live/ZouYonghui/archive/2020/04/09/435329.html//www.355548.live/ZouYonghui/comments/435329.html//www.355548.live/ZouYonghui/archive/2020/04/09/435329.html#Feedback0//www.355548.live/ZouYonghui/comments/commentRss/435329.html//www.355548.live/ZouYonghui/services/trackbacks/435329.html1、ApplicationContext
Spring的核心,Context我们通常解释Z下文环境。ApplicationContext则是应用的容器?Spring把BeanQobjectQ放在容器中Q需要用通过getҎ取出来。在ApplicationContext接口的众多实现类中,?个是我们l常用到的(见表1-1Q,q且使用q?个实现类也基本能满我们Java EE应用开发中的绝大部分需求?/div>
?-1 ApplicationContext接口的常用实现类介绍
ClassPathXmlApplicationContext
从类路径ClassPath中寻找指定的XML配置文gQ找到ƈ装蝲完成ApplicationContext的实例化工作。例如: //装蝲单个配置文g实例化ApplicationContext容器
ApplicationContext cxt = new ClassPathXmlApplicationContext("applicationContext.xml");
//装蝲多个配置文g实例化ApplicationContext容器
String[] configs = {"bean1.xml","bean2.xml","bean3.xml"};
ApplicationContext cxt = new ClassPathXmlApplicationContext(configs);
FileSystemXmlApplicationContext
从指定的文gpȝ路径中寻找指定的XML配置文gQ找到ƈ装蝲完成ApplicationContext的实例化工作。例如://装蝲单个配置文g实例化ApplicationContext容器
ApplicationContext cxt = new FileSystemXMLApplicationContext("beans.xml");
//装蝲多个配置文g实例化ApplicationContext容器
String[] configs = {"c:/beans1.xml","c:/beans2.xml"};
ApplicationContext cxt = new FileSystemXmlApplicationContext(configs);
XmlWebApplicationContext
从Web应用中寻找指定的XML配置文gQ找到ƈ装蝲完成ApplicationContext的实例化工作。这是ؓWeb工程量n定制的,使用WebApplicationContextUtilscȝgetRequiredWebApplicationContextҎ可在JSP与Servlet中取得IoC容器的引?/div>
2、ApplicationEvent
是个抽象c,里面只有一个构造函数和一个长整型的timestamp。其源码如下

public abstract class ApplicationEvent extends EventObject {
 
    /** use serialVersionUID from Spring 1.2 for interoperability */
    private static final long serialVersionUID = 7099057708183571937L;
 
    /** System time when the event happened */
    private final long timestamp;
 
    /**
     * Create a new ApplicationEvent.
     * 
@param source the object on which the event initially occurred (never {@code null})
     
*/
    public ApplicationEvent(Object source) {
        super(source);
        this.timestamp = System.currentTimeMillis();
    }
 
    /**
     * Return the system time in milliseconds when the event happened.
     
*/
    public final long getTimestamp() {
        return this.timestamp;
    }
}

3、ApplicationListener

是一个接口,里面只有一个onApplicationEventҎ。如果在上下文中部v一个实CApplicationListener接口的bean,那么每当在一个ApplicationEvent发布?ApplicationContextӞ调用ApplicationContext.publishEvent()ҎQ这个bean得到通知。类gOberver设计模式?/span>
其源码如下:

public interface ApplicationListener<E extends ApplicationEvent> extends EventListener {
    /**
     * Handle an application event.
     * 
@param event the event to respond to
     
*/
    void onApplicationEvent(E event);
 
}
下面举个例子
自定义事件NotifyEvent:
import org.springframework.context.ApplicationEvent;

public class NotifyEvent  extends ApplicationEvent  {
    private String email;
    private String content;
    public NotifyEvent(Object source){
        super(source);
    }

    public NotifyEvent(Object source,String email,String content){
        super(source);
        this.email = email;
        this.content = content;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
}

定义监听器NotifyListener:
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Configuration;

@Configuration
public class NotifyListener implements ApplicationListener<NotifyEvent>{
    @Override
    public void onApplicationEvent(NotifyEvent event) {
        System.out.println("邮g地址Q? + event.getEmail());
        System.out.println("邮g内容Q? + event.getContent());
    }
}

单元试cListenerTestQ?/span>
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.web.context.WebApplicationContext;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = ServerLauncher.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class ListenerTest {
    @Autowired
    private WebApplicationContext webApplicationContext;

    @Test
    public void testListener(){
        NotifyEvent event = new NotifyEvent("object","abc@qq.com","This is the content");
        webApplicationContext.publishEvent(event);
    }
}


Terry Zou 2020-04-09 14:47 发表评论
]]>JENKINS TOURIAL - 棒球比分大小怎么算|վ//www.355548.live/paulwong/archive/2020/04/07/435324.htmlpaulwongpaulwongTue, 07 Apr 2020 02:29:00 GMT//www.355548.live/paulwong/archive/2020/04/07/435324.html//www.355548.live/paulwong/comments/435324.html//www.355548.live/paulwong/archive/2020/04/07/435324.html#Feedback0//www.355548.live/paulwong/comments/commentRss/435324.html//www.355548.live/paulwong/services/trackbacks/435324.htmlhttps://huongdanjava.com/jenkins-2



paulwong 2020-04-07 10:29 发表评论
]]>
Deploy artifacts into Maven Repository in Jenkins - 棒球比分大小怎么算|վ//www.355548.live/paulwong/archive/2020/04/06/435321.htmlpaulwongpaulwongMon, 06 Apr 2020 06:13:00 GMT//www.355548.live/paulwong/archive/2020/04/06/435321.html//www.355548.live/paulwong/comments/435321.html//www.355548.live/paulwong/archive/2020/04/06/435321.html#Feedback0//www.355548.live/paulwong/comments/commentRss/435321.html//www.355548.live/paulwong/services/trackbacks/435321.htmlhttps://huongdanjava.com/deploy-artifacts-into-maven-repository-in-jenkins.html



paulwong 2020-04-06 14:13 发表评论
]]>
MAVENU服-Nexus Repository Manager - 棒球比分大小怎么算|վ//www.355548.live/paulwong/archive/2020/04/06/435320.htmlpaulwongpaulwongMon, 06 Apr 2020 06:08:00 GMT//www.355548.live/paulwong/archive/2020/04/06/435320.html//www.355548.live/paulwong/comments/435320.html//www.355548.live/paulwong/archive/2020/04/06/435320.html#Feedback0//www.355548.live/paulwong/comments/commentRss/435320.html//www.355548.live/paulwong/services/trackbacks/435320.html

Nexus Repository Manager is a tool that allows us to store and use libraries we need in projects such as Maven project…

Nexus Repository ManagerIn this tutorial, I summarize the tutorials of Huong Dan Java on the Nexus Repository Manager for your reference.


Installation

In this tutorial, I will guide you how to install Nexus Repository Manager.


Configuration

In order to create a new Maven Repository in the Nexus Repository Manager, you can refer to this tutorial.

We need to define a Role to define User rights in the Nexus Repository Manager.

To be able to do anything in the Nexus Repository Manager, you need to create and use the User.


Manipulation

Nexus Repository Manager supports us UI to upload any artifact to the Repository.

In addition to the UI, we can also use the RESTful API to upload an artifact.



paulwong 2020-04-06 14:08 发表评论
]]>
List sessions / active connections on MariaDB server - 棒球比分大小怎么算|վ//www.355548.live/paulwong/archive/2020/04/02/435313.htmlpaulwongpaulwongThu, 02 Apr 2020 07:38:00 GMT//www.355548.live/paulwong/archive/2020/04/02/435313.html//www.355548.live/paulwong/comments/435313.html//www.355548.live/paulwong/archive/2020/04/02/435313.html#Feedback0//www.355548.live/paulwong/comments/commentRss/435313.html//www.355548.live/paulwong/services/trackbacks/435313.htmlUsing a command

Option 1

show status where variable_name = 'threads_connected'; 

Columns

  • Variable_name - Name of the variable shown
  • Value - Number of active connections

Rows

  • One row: Only one row is displayed

Sample results

Option 2

show processlist; 

Columns

  • Id - The connection identifier
  • User - The MariaDB user who issued the statement
  • Host - Host name and client port of the client issuing the statement
  • db - The default database (schema), if one is selected, otherwise NULL
  • Command - The type of command the thread is executing
  • Time - The time in seconds that the thread has been in its current state
  • State - An action, event, or state that indicates what the thread is doing
  • Info - The statement the thread is executing, or NULL if it is not executing any statement
  • Progress - The total progress of the process (0-100%)

Rows

  • One row: represents one active connection
  • Scope of rows: total of active connections

Sample results

Using a query

Option 3

select id, user, host, db, command, time, state, 
info, progress from information_schema.processlist;

Columns

  • Id - The connection identifier
  • User - The MariaDB user who issued the statement
  • Host - Host name and client port of the client issuing the statement
  • db - The default database (schema), if one is selected, otherwise NULL
  • Command - The type of command the thread is executing
  • Time - The time in seconds that the thread has been in its current state
  • State - An action, event, or state that indicates what the thread is doing
  • Info - The statement the thread is executing, or NULL if it is not executing any statement
  • Progress - The total progress of the process (0-100%)
  • memory_used - Amount of memory used by the active connection

Rows

  • One row: represents one active connection
  • Scope of rows: total of active connections

Sample results

Using the GUI

Option 4

Click on the Client Connections option of the Management tab (left navigation pane)

This action will show the Client Connections screen containing the current active connections



paulwong 2020-04-02 15:38 发表评论
]]>
Finding slow queries in MongoDB - 棒球比分大小怎么算|վ//www.355548.live/paulwong/archive/2020/03/27/435309.htmlpaulwongpaulwongFri, 27 Mar 2020 15:35:00 GMT//www.355548.live/paulwong/archive/2020/03/27/435309.html//www.355548.live/paulwong/comments/435309.html//www.355548.live/paulwong/archive/2020/03/27/435309.html#Feedback0//www.355548.live/paulwong/comments/commentRss/435309.html//www.355548.live/paulwong/services/trackbacks/435309.htmlDatabase Profiling

MongoDB Profiler is a db profiling system that can help identify inefficient

or slow queries and operations.

Levels of profiles available are:

Level

Setting

0

Off. & No profiling

1

On & only includes slow operations

2

On & Includes all operations


We can enable it by setting the Profile level value using the following
command in mongo shell :

"db.setProfilingLevel(1)"

By default, mongod records slow queries to its log, as defined by slowOpThresholdMs.

NOTE

Enabling database profiler puts negative impact on MongoDB’s performance.

It’s better to enable it for specific intervals & minimal on Production Servers.

We can enable profiling on a mongod basis but This setting will not propagate
across a replica set and sharded cluster.

We can view the output in the system.profile collection in mongo shell using show profile command, or using following:

db.system.profile.find( { millis : { $gt : 200 } } )

Command returns operations that took longer than 200 ms. Similarly we
can change the values as per our need.

Enabling profile for an entire mongod instance.

For the purpose of development in testing, we can enable database profiling/settings for an 
entire mongod instance. The profiling level will be applied to all databases.

 

NOTE:

We can't enable the profiling settings on a mongos instance. To enable the profiling in

shard clusters, we have to enable/start profiling for each mongod instance in cluster.

 

Query for the recent 10 entries

db.system.profile.find().limit(10).sort( { ts : 1 } ).pretty()

 

Collection with the slowest queries(No. Of queries)

db.system.profile.group({key: {ns: true}, initial: {count: 0}, reduce: function(obj,prev){ prev.count++;}})

 

Collection with the slowest queries(No. Of millis spent)

db.system.profile.group({key: {ns: true}, initial: {millis: 0}, reduce: function(obj, prev){ prev.millis += obj.millis;}})

 

Most recent slow query

db.system.profile.find().sort({$natural: -1}).limit(1)

 

Single slowest query(Right now)

db.system.profile.find().sort({millis: -1}).limit(1)



]]>
{ganrao}