Tag Archives: linux

Xftp transfer file error

Today, when doing the xftp file transfer, the following situation appeared, as shown in the figure below

Problem explanation: This is the Linux folder that needs to be uploaded has insufficient permissions, so what should we do?

 
1. The first method: select the Linux folder to upload, right-click – change permissions – check all; You can upload it again. Here is the software file, as shown in the following figure:

At that time, I couldn’t check this method. The reason I thought of was that I didn’t have permission to change the permission of this folder, so I tried to find a second method on the Internet

The second method: modify the folder permission with command: Chmod 777 software, the folder that software needs to give permission to

 

ModuleNotFoundError: No module named ‘MySQLdb‘

Install MySQL client to solve!

Install the following dependent packages in order

================================

yum install mysql-devel

yum install gcc

yum install python3-devel

pip3 install mysqlclient

================================
the two methods found before
install MySQL connector Python
or pymysql.install_ as_ Mysqldb ()
doesn’t work for me. If I use it, there will be other errors

[Solved] Job for network.service failed because the control process exited with error code. See “systemctl st

Job for network.service failed because the control process exited with error code. See “systemctl status network.service” and “journalctl -xe” for details.

1、 The xshell is down and the reconnection failed. First Ping to see if the network is connected. Second, restart the network service and find an error. Third, view the error information according to the prompt. Fourth, solutions. First, check whether the configuration file is wrong. Second, there may be a conflict with the network manager service. Just close the service directly

3. If the two methods 1 and 2 still fail, try to delete all the other irrelevant network card location files under/etc/sysconfig/network scripts to avoid unnecessary influence. 5. Verify the network

Standby for a while, found that xshell connection failed, found that network connection failed, and restart failed.

1、 The xshell is down and the reconnection failed. Ping first to see if the network is connected

[root@db01 ~]# ping www.google.com
ping: www.google.com: Unknown name or service

2、 Restart the network service and find an error

[root@db01 ~]# systemctl restart network
Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.

3、 Check the error information according to the prompt

[root@db01 ~]# systemctl status network.service
● network.service - LSB: Bring up/down networking
   Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)
   Active: failed (Result: exit-code) since 四 2021-06-03 05:23:42 CST; 23s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 8821 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

6月 03 05:23:42 db01 network[8821]: RTNETLINK answers: File exists
6月 03 05:23:42 db01 network[8821]: RTNETLINK answers: File exists
6月 03 05:23:42 db01 network[8821]: RTNETLINK answers: File exists
6月 03 05:23:42 db01 network[8821]: RTNETLINK answers: File exists
6月 03 05:23:42 db01 network[8821]: RTNETLINK answers: File exists
6月 03 05:23:42 db01 network[8821]: RTNETLINK answers: File exists
6月 03 05:23:42 db01 systemd[1]: network.service: control process exited, code=e...s=1
6月 03 05:23:42 db01 systemd[1]: Failed to start LSB: Bring up/down networking.
6月 03 05:23:42 db01 systemd[1]: Unit network.service entered failed state.
6月 03 05:23:42 db01 systemd[1]: network.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

4、 Solutions

1. Check whether the configuration file is wrong

[root@db01 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
NAME=ens33
UUID=b5672928-cbbb-4428-a752-8bd9c14098e7
····
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.10.102
PREFIX=24
GATEWAY=192.168.10.2
DNS1=114.114.114.114
DNS2=8.8.8.8
DNS3=119.29.29.29
[root@db01 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:0c:29:3f:0f:29 brd ff:ff:ff:ff:ff:ff
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:3a:15:b7 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
    link/ether 52:54:00:3a:15:b7 brd ff:ff:ff:ff:ff:ff

2. There may be a conflict with the NetworkManager service. Just close the service directly

[root@db01 ~]# systemctl stop NetworkManager
[root@db01 ~]# systemctl restart network

3. If both methods 1 and 2 fail after verification, try to delete all other irrelevant network card location files under/etc/sysconfig/network scripts to avoid unnecessary influence

[root@db01 network-scripts]# ls
ifcfg-ens33      ifdown-ipv6      ifdown-tunnel  ifup-isdn    ifup-TeamPort
ifcfg-ens33.bak  ifdown-isdn      ifup           ifup-plip    ifup-tunnel
ifcfg-lo         ifdown-post      ifup-aliases   ifup-plusb   ifup-wireless
ifdown           ifdown-ppp       ifup-bnep      ifup-post    init.ipv6-global
ifdown-bnep      ifdown-routes    ifup-eth       ifup-ppp     network-functions
ifdown-eth       ifdown-sit       ifup-ib        ifup-routes  network-functions-ipv6
ifdown-ib        ifdown-Team      ifup-ippp      ifup-sit
ifdown-ippp      ifdown-TeamPort  ifup-ipv6      ifup-Team

5、 Verification Network

[root@db01 ~]# ping www.google.com
PING www.baidu.com (39.156.66.14) 56(84) bytes of data.
64 bytes from 39.156.66.14 (39.156.66.14): icmp_seq=1 ttl=128 time=55.8 ms
64 bytes from 39.156.66.14 (39.156.66.14): icmp_seq=2 ttl=128 time=42.8 ms
^C
--- www.baidu.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 42.825/49.312/55.800/6.491 ms
[root@db01 ~]# 

[Solved] Win10 and Linux address reading format is different (CV2. Error: opencv (4.2.0)/Io/opencv…)

img = cv2.resize(img, (512, 1024))
cv2.error: OpenCV(4.2.0) /io/opencv/modules/imgproc/src/resize. cpp:4045 : error: (-215:Assertion failed) ! ssize.empty() in function ‘resize’

The code can run normally in win10, but the above error is reported in Linux. My analysis is due to the different address reading formats between win10 and Linux.

img   = cv2.imread(item['path'])
#item['path']:'./data/TuSimple/LaneDetection\clips/0313-2/42120/20.jpg'

There is a ‘\’ in the address of item [‘path ‘], which results in an error in Linux operation
so change the’ \ ‘in the address of item [‘path’] to ‘/’

item['path']=item['path'].replace('\\', '/')#Add this code
img   = cv2.imread(item['path'])

Resolving yum source-related issues: Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again

Loaded plug-ins: fastestmirror
Loading mirror speeds from cached hostfile
One of the configured repositories failed (none),
and yum doesn’t have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work “fix” this:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Run the command with the repository temporarily disabled
        yum --disablerepo=<repoid> ...

 4. Disable the repository permanently, so yum won't use it by default. Yum
    will then just ignore the repository until you permanently enable it
    again or use --enablerepo for temporary usage:

        yum-config-manager --disable <repoid>
    or
        subscription-manager repos --disable=<repoid>

 5. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again


Follow the prompts to correct the source.

cd /etc/yum.repos.d
vi epel.repo 

The revised contents are as follows:

[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://mirrors.aliyun.com/epel/7/$basearch
#metalink=https://mirrors.aliyun.com/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
baseurl=http://mirrors.aliyun.com/epel/7/$basearch/debug
#metalink=https://mirrors.aliyun.com/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl=http://mirrors.aliyun.com/epel/7/SRPMS
#metalink=https://mirrors.aliyun.com/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

Execute the following command:

yum clean all
yum makecache
yum update
yum install -y git

Yum installation and use returned to normal.

[Solved] Login with Ubuntu graphical interface, error sorry, that didn’t work.please try again

Sorry, that didn’t work.please try again

Today, I just finished installing Ubuntu 20.04. After setting the root password, I found that the root login would report such an error:
sorry, that didn’t work.please try again

In fact, there is no problem with the command line login, which indicates that it is not the password, but the desktop environment.

vi /etc/pam.d/gdm-autologin
#Note "auth requied pam_succeed_if.so user != root quiet success"

vi /etc/pam.d/gdm-password
#Note "auth requied pam_succeed_if.so user != root quiet success"

libxx.so: undefined reference, vector.reserve(n) [How to Solve]

background: Trying to avoid reallocation using the STL: std::vector.reserve(n).
declared static std::vector<int> sample_num in class AngleCal, and want to do it in AngleCal::AngleCal() sample_num.reserve(300) (assumming 300 is the size or, alternatively an upper bound on the size)


However, when compiling this AngleCal.cpp into libanglecal.so, the compiler gives the following error.
[build] /usr/bin/ld: ../lib/libanglecal.so: undefined reference to `hitcrt::AngleCal::if_first_detection’
[build] /usr/bin/ld: ../lib/libanglecal.so: undefined reference to `hitcrt::AngleCal::sample_num’
[build] /usr/bin/ld: ../lib/libanglecal.so: undefined reference to `hitcrt::AngleCal::i’
Solution: A static member is shared by all objects of the class. All static data is initialized to zero when the first object is created, if no other initialization is present. We can’t put it in the class definition but it can be initialized outside the class as done in the following example by redeclaring the static variable, using the scope resolution operator :: to identify which class it belongs to.

#include <iostream>
 
using namespace std;

class Box {
   public:
      static int objectCount;
      
      // Constructor definition
      Box(double l = 2.0, double b = 2.0, double h = 2.0) {
         cout <<"Constructor called." << endl;
         length = l;
         breadth = b;
         height = h;
         
         // Increase every time object is created
         objectCount++;
      }
      double Volume() {
         return length * breadth * height;
      }
      
   private:
      double length;     // Length of a box
      double breadth;    // Breadth of a box
      double height;     // Height of a box
};

// Initialize static member of class Box
int Box::objectCount = 0;

int main(void) {
   Box Box1(3.3, 1.2, 1.5);    // Declare box1
   Box Box2(8.5, 6.0, 2.0);    // Declare box2

   // Print total number of objects.
   cout << "Total objects: " << Box::objectCount << endl;

   return 0;
}

The running results are as follows

Constructor called.
Constructor called.
Total objects: 2

Static decorated class members must be initialized outside the class before they can be manipulated.

above.

Unbuntu 18.04 unable to install mkcramfs

Problem description

In the morning, I received user feedback and applied to add mkcramfs and libxml dev to the offline source
which was strange. After asking the user, the user gave a screenshot of the question:

Problem analysis

Firstly, the first step is to get the user node information and login mode, and the path of the command in the screenshot
after logging in, the user problem is reproduced, and the error is indeed reported; Try the following:

1、apt-get install mkcramfs

Report an error, indicating that there is no such package

2、apt-get install libxml2-dev

I still report an error. I feel strange. I suspect that there is something wrong with the source.
3. Check the source configuration of the user’s machine and find that there is no/etc/apt/source.list file, only/etc/apt/source.text; The reason is that the MV of the last step is not executed when the user installs the offline source document.
4. Modify the source information and update it

mv /etc/apt/source.text /etc/apt/source.list
apt-get update

5. After trying to install the previous two packages, it is found that libxml2 dev is installed normally, and mkcramfs cannot be installed

Problem solving

For all the relevant information on the Internet, it is found that some Ubuntu can’t install mkcramfs in APT get mode, so they need to download the package to the local and then install it.
1. Find the corresponding package in the offline source, and then download it:

2. Install it in dpkg-i mode
3. Verify it by performing the user’s previous operation; Problem solving:

Summary

Some Ubuntu can’t install mkcramfs in APT get mode, so you need to download the package to the local and then install it
extension: there may be other packages with this situation, which can be used as a reference for subsequent analysis

Jenkins docker push to harbor to report error

Jenkins docker push to harbor private service error solution

Jenkins reported an error

When using docker push to private service in jenkinsfile, an error is reported. The error information is as follows:

unauthorized: unauthorized to access repository: ocp/eureka-server, action: push: unauthorized to access repository: ocp/eureka-server, action: push

This is because Jenkins uses the pseudo user of Jenkins when pushing the image. Since you need to log in to push, you should first generate config.json in the current user

The current user uses docker login to generate config.json

The current user logs in with the following command

docker login ip:port

After entering the user name and you, a config.json file is generated in the. Docker directory of the current user’s root directory, as follows:

[wangxianfeng@hs ~]$ cat /root/.docker/config.json 
{
        "auths": {
                "harbor.aiuyo.com:643": {
                        "auth": "d2FuZ3hpYW5mZW5nOlhpYW5mZW5nOTk="
                }
        }
}

Copy. Docker to/var/lib/Jenkins directory

    after logging in with root, copy the/user name /. Docker/directory to/var/lib/Jenkins, and modify the folder permission chown – R Jenkins. Jenkins. Docker to/var/lib/Jenkins

     

    cp -r /root/.docker/ /var/lib/jenkins/
    cd /var/lib/jenkins/
    chown -R jenkins.jenkins .docker

    I am for this reason. After modification, it can be pushed

About LCM spy running error in LCM v1.4.0

I am a little white, but recently in the Linux system running LCM spy encountered a variety of error messages. Finally, after collecting all kinds of information on the Internet and a little bit of my imagination, I successfully solved the problem, so I want to share it with you and leave a file for myself, so as not to be at a loss when I encounter the same problem in the future.

First, follow the official LCM guidelines   Before installing LCM, be sure to download its recommended default JDK. This automatic download is the latest version of Java (I don’t know much about Java, but it also seems to download javac). Bloggers download Java 11 by default. Note: Java 8 can’t run make successfully, at least the blogger failed.

Default JDK installation steps:

$ sudo apt update
$ sudo apt install default-jdk

Then follow the steps to install according to the official website (cmake may say that some files in other languages cannot be found, but you can try to run make first)

$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install

If there is no error in make and make install, please check whether there is an LCM Java folder and whether there is lcm.jar in the folder under build. This is very important, because it determines whether you can run LCM spy

Next, you need to download Java 8 and change the default version of Java to Java 8. The method is as follows (the first and second behaviors download Java 8, and the third behavior change the version)

$ sudo apt-get update
$ sudo apt-get install openjdk-8-jdk
$ sudo update-alternatives --config java

Then select the number corresponding to Java 8 in the pop-up window and press enter:

Next, you need to move the lcm.jar to the Java folder. Note: the specific address varies from person to person. Please check the address of the Java folder in usr. Bloggers provide their own examples:

$ sudo cp ~/lcm-1.4.0/build/lcm-java/lcm.jar /usr/share/java/

In this way, you can find the LCM. Jar file in the Java folder. If there is no accident, you can run LCM spy and LCM logplayer GUI in any path.

——————————————————————————————————————————

PS:

1. Two versions of Java are needed because during the installation of LCM v1.4.0, Java related files only support Java 11 (maybe Java 10), but not Java 8. However, the operation of LCM spy does not support Java 11, because Java 11 has deleted an option named “xincgc” in Java 8, so it needs to change the Java version to Java 8 to run successfully;

2. A Java application notes in the official website   Bloggers did not run successfully, so they have to manually copy LCM. Jar to the Java folder. If you are interested, you can also try whether the official website tutorial is useful.

Solutions to the problem of vulnerable missing firmware in Ubuntu

Question: potentially missing firmware/lib/firmware/RTL_ NIC/rtl8125a-3.fw for module r8169
solution:
1. Enter the following address, the firmware file is very comprehensive, and find the version suitable for you

https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/rtl_nic/

2. Switch to the directory that just reported that there is no firmware, and there are few files in the download area

cd /lib/firmware/rtl_nic/
sudo wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/rtl_nic/rtl8125a-3.fw

3. Check again

sudo update-initramfs -u

“21442;” 32771e; https://www.cnblogs.com/magikos/p/Possible-missing-firmware.html

[Solved] Linux error: SSH_exchange_identification: read: Connection reset by peer

Linux error SSH_exchange_identification: read: Connection reset by peer

Problem Description:

ssh_ exchange_ identification: read: Connection reset by peer

 

Cause of the problem:

check whether SSH connection restriction is enabled
VIM/etc/hosts. Allow
VIM/etc/hosts. Deny

 

resolvent:

if SSH connection restriction is enabled, add the IP of the source address to hosts.allow
effective in real time, no need to restart the service