Category Archives: How to Fix

Solve Linux docker pull error get https://registry-1.docker.io/v2/ : Net / http: TLS handshake timeout

Solution:

Step 1: through dig @ 114.114.114.114 registry-1 docker.io Find available IP address

The IP address is not fixed and may change, so you need to try several more times (several IP)

Step 2: modify/etc/hosts docker.io The relevant domain name is resolved to other available IP addresses

Step 3: after saving the configuration file, try again many times to download the image successfully

Step 4: verify success

Reprinted: https://www.cnblogs.com/python-wen/p/11224555.html

java.lang.IllegalStateException : unable to read meta data for class

Recently, in the refactoring project,
another colleague modified the feign interface’s class, which led to an error at startup

It’s true that idea global search doesn’t have this. Later, I thought that there was one under resources of feign module spring.factories File, which defines the class address of automatic assembly when starting, enable autoconfiguration { }The feign interface needs to be updated

Nginx redirects the interfac /API to another interface/API

Recently, there is a problem with the project. When the client accesses the background, the path is missing. The background will definitely report an error of 404. However, at present, the client has no way to correct this error in a short time, so it can only modify it in the background java.xxxx.com/abc/auth/queryUserById . JSON
actual request – java.xxxx.com/auth/queryUserById .json

With spring cloud experience, you can see from this path that nginx and gateway are used

I have checked some methods on the Internet, mainly redirecting the request in nginx, but my request is post request. After redirection, it becomes get, and some parameters are lost

Finally, I tried many times. Finally, this situation can only be solved by reverse proxy

Location/auth/{
omit : http://xxx.xxxx.xxx : XXX (IP): port/auth /;
omit

}

This solves, but still wants to make complaints about the path of Tucao, and the mistake is too low.

Idea can’t submit code to GitHub when using git — too much code / file leads to submission failure

My code is more than 1G. When I submit to GitHub, it is always stuck at 28%, and then push fail. Some attachments over 50/100M will report an error to large On the Internet, some people say that hosts should be set if it is blocked, others say that buffe is not enough, and git should be used to enlarge the character area, but none of mine can

The ultimate solution:

1. Forcibly release the binding relationship between GITS of the project, and operate in idea settings
2. Delete the. Git folder (hidden file) of the project, and I also delete the large files (save some messy non code files)
3. Re submit the code to git management in VCs, which can be committed locally in batches, and then submitted to the remote warehouse
4. Upload completed

This method is the same as the computer crash forced shutdown restart, may lose data, delete. Git file will delete the original submission record, this should be careful

ZABBIX server startup error resolution

The following error is reported when starting ZABBIX server:

29171:20180714:084911.367 cannot start alert manager service: Cannot bind socket to "/var/run/zabbix/zabbix_server_alerter.sock": [13] Permission denied.
29142:20180714:084911.368 One child process died (PID:29171,exitcode/signal:1). Exiting ...
29225:20180714:084923.611 cannot start preprocessing service: Cannot bind socket to "/var/run/zabbix/zabbix_server_preprocessing.sock": [13] Permission denied.
 29213:20180714:084923.613 server #18 started [poller #2]
 29195:20180714:084923.614 One child process died (PID:29225,exitcode/signal:1). Exiting ...
 29195:20180714:084925.615 syncing history data...
 29195:20180714:084925.615 syncing history data done
 29195:20180714:084925.615 syncing trend data...
 29195:20180714:084925.615 syncing trend data done
 29195:20180714:084925.615 Zabbix Server stopped. Zabbix 3.4.10 (revision 81503).

The above is just a partial error log pasted.
The above reason is that SELinux starts
sestatus

SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          disabled
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28

The solution is as follows:
VIM/etc/SELinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 

Modify SELinux = disabled modify configuration file to close permanently.
setenforce 0 : temporarily shut down SELinux.
SELinux can also be set to allow ZABBIX access, which is not very troublesome, but SELinux can not be used basically. If you want to know, you can search for it by yourself. Here, I just want to make more statements.

Reproduced in: https://www.cnblogs.com/Cherry-Linux/p/9308490.html

RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling `cublasCreate(handle)`

RuntimeError: CUDA error: CUBLAS_ STATUS_ ALLOC_ FAILED when calling cublasCreate(handle)
Exception raised from createCublasHandle at … \aten\src\ATen\cuda\ CublasHandlePool.cpp : 8 (most recent call first):

record the bug of dcgan in Python training..
It took a long time to find out that the last line of the discriminator did not add sigmoid, which caused the tag to go beyond the range [0,1], so an error was reported.

Esp32 / 8266 uses arduinoota function to show no response from device

Similar problems appear:
sending invitation to 192.168.1.202
13:55:25 [error]: no response from device
13:55:25 [error]: no response from device

We need to turn off the firewall of win10.
If you don’t turn off the firewall, you need to set it instead of setting arduinoide
espota.exe
through the network,
in appdata, local, arduino15, packages, esp32, hardware, esp32, 1.0.4, tools\ espota.exe
This position.
If you don’t know which location, turn on the notification and there will be a notification when you intercept.

Visual slam Lesson 6: curve fitting with g2o, error: cmake error at CMakeList.txt (find_ package) By not providing“FindG2O.cmake“

When compiling with KDevelop, my CMakeList.txt There’s an error in the file. It’s mine CMakeList.txt The code in the file is as follows:

the errors are as follows:

The solution is as follows:
you need to CMakeList.txt Modify the following code in the file:
1. First of all, you need to find the location of your g2o installation: find the g2o folder – right click the properties to see

Add


list (APPEND CMAKE_ MODULE_ PATH ${PROJECT_ SOURCE_ DIR}/cmake)


Amend to read

list(APPEND CMAKE_ MODULE_ Path/home/fan/desktop/g2o master/cmake_ modules)

Among them,

/Home/fan/desktop/g2o master/cmake_ Modules// where to install your own g2o files

2. Add an extra set

set(G2O_ ROOT /usr/local/include/g2o)

After completing the above steps, there will be no problem with the build and it can be executed smoothly.
The code is as follows

cmake_ minimum_ required(VERSION 2.8)
project(go)
set(CMAKE_ BUILD_ TYPE Release)
set(CMAKE_ CXX_ FLAGS “-std=c++14 -O3”)
list(APPEND CMAKE_ MODULE_ Path/home/fan/desktop/g2o master/cmake_ modules)
set(G2O_ ROOT /usr/local/include/g2o)

find_ package(OpenCV REQUIRED)
include_ directories(${OpenCV_ INCLUDE_ DIRS})

find_ package(G2O REQUIRED)
include_ directories(${G2O_ INCLUDE_ DIRS})

include_ directories(“/usr/include/eigen3”)

add_ executable(go main.cpp )
target_ link_ libraries(go ${OpenCV_ LIBS} ${G2O_ CORE_ LIBRARY} ${G2O_ STUFF_ LIBRARY})

How to Solve mybatis returns null when querying Oracle database with char type field

When my colleagues were learning mybatis, they encountered a problem that when they used char type fields as query criteria, they could not find the data all the time, while other types could.

The database used is Oracle, the query condition field type is char (50), and the Java code corresponds to string type.

Later, after investigation, it is because in Oracle, if the content length of char type field is not enough, it will automatically make up the length in the form of space. For example, if the value of the field name char (5) is SGL, Oracle will automatically make up the length with spaces, and the final value is SGL.

1.Solution:

Method 1: first use the trim() function to remove the spaces on both sides of the value, and then use it as a condition query

select * from data where data.name=#{name}

Change to:

select * from data where trim(data.name)=#{name}

Method 2: change the field type char() to varchar2(). In general, char () is only used when all values are of the same length, such as gender field. When 0 is used to represent male and 1 is used to represent female, char (1) can be used. If the length of the value is not fixed, it is better not to use char () type.

2.Learn more about mybatis returning null

Leave the mybatis framework aside and go back to the original JDBC query. When the char type of Oracle is used as the condition to query the data, the data can only be found when the value is exactly the same.

To create a test table:

create table t_user(

user_name char(5)

);

insert into t_user (user_name)values('sgl');

select '"'||user_name||'"' from  t_user;

–The query result is “SGL”, which shows that Oracle automatically fills in two spaces

Query data through Preparedstatement of JDBC

conn=getConnection();

ps=conn.prepareStatement("select * from t_user where user_name=?");

ps.setString(1,"sgl");

ResultSet rs = ps.executeQuery();

The data cannot be found through the above method, because the query condition value “SGL” and the database median value “SGL” are not equal.

If the value is “SGL”, the data can be found:

conn=getConnection();

ps=conn.prepareStatement("select * from t_user where user_name=?");

ps.setString(1,"sgl "); -- Add two spaces less than 5 digits in length

ResultSet rs = ps.executeQuery();

If you use the trim () method, you can also query the data, such as:

conn=getConnection();

ps=conn.prepareStatement("select * from t_user where trim(user_name)=?"); -- De-space the user_name in the database first, then compare

ps.setString(1,"sgl");

ResultSet rs = ps.executeQuery();

Now go back to mybatis and query the SQL in my colleague’s mapper file as follows:

select * from data where data.name=#{name}

The main method is as follows:

public static void main(String[] args) {
    ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
    DataService d = (DataService) ctx.getBean("dataServiceImpl");
    Data data = d.selectByName("sgl");
    System.out.println(data);
}

In fact, by looking at the source code or changing the log to the debug level, you can see that at the bottom of mybatis, the query statement will be precompiled with Preparedstatement, and then the parameters will be set in. For example, the following is the log printed by mybatis:

==> Preparing: select * from data where data.name=?

==> Parameters: sgl(String)

According to the previous JDBC query, we know the reason, so it’s easy to understand the problem in mybatis.

In addition, under mysql, when the value of char type field is insufficient, it doesn’t seem to automatically fill the value with spaces. However, when the value length is not fixed, char type is not recommended.