Tag Archives: linux

[robot_launch.launch] is neither a launch file in package [kinova_gazebo] nor is

Problem Description:

[robot_launch.launch] is neither a launch file in package [kinova_gazebo] nor is [kinova_gazebo] a launch file name
The traceback for the exception was written to the log file

terms of settlement:

The error indicates that the corresponding package is not installed in the ROS system. In this case, go to the top of the project file and use catkin_ The make command compiles the file. If it is executed again at this time, an error will still be reported. Then add another statement:

source devel/setup.bash

Will devel/ setup.bash Add to the system, and then run

Common errors in k8s initialization_ [WARNING NumCPU]_ [WARNING SystemVerification]_ WARNING Hostname

Common errors in k8s initialization

[init] Using Kubernetes version: v1.20.5
[preflight] Running pre-flight checks
    1    [WARNING NumCPU]: the number of available CPUs 1 is less than the required 2
    2    [WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
    3    [WARNING SystemVerification]: this Docker version is not on the list of validated versions: 20.10.5. Latest validated version: 19.03
    4    [WARNING Hostname]: hostname "k8s" could not be reached
    5    [WARNING Hostname]: hostname "k8s": lookup k8s on 192.168.0.1:53: no such host

Solution:
1. Adjust the number of CPU cores to the current number of cores + 1 (self adaptation)
2. Change the settings to make the container runtime and kubelet use SYSTEMd as CGroup driver https://blog.whsir.com/post-5312.html
3. Re install docker, and the latest verification version of docker is 19.03
4. Configure domain name resolution/etc/hosts
5. Refer to 4

Error in exporting MySQL database from Linux mysqldump:got error :1045

Command to export MySQL database in Linux

mysqldump –uroot –proot985 –all-databases > abc.sql

ABC is the database name and the password is root985. An error is reported at this time mysqldump:got error :1045

terms of settlement:

Add double quotation marks to the password on the command line

mysqldump –uroot –p“root985” –all-databases > abc.sql

Solution to the problem of multiple parameters when using pipeline under Linux

When doing the project today, we encountered a problem, that is, how to use the pipeline under the Linux command. We will certainly use the simple pipeline, just like this form

<span style="font-size:18px;">ls -a | grep *test</span>

Today’s problem is a bit complicated. It is to scan the system log in real time, from the last line after scanning to the end of the file, and match keywords. If they match, an alarm will be given. I use awk with grep command to achieve

Awk command is used to select log segment output as the input of grep command

awk 'NR>= beginLineNum&& NR<endLineNum logFileName  | grep -nE  pattern ;

But how to get the total row number of the current log becomes a problem. The command to get the total row number is

wc -l logFileName

But the result after WC is to be placed in the position of Ender linenum, which can not be realized by | method. After query, it is found that it can be realized by using the ‘` symbol (` symbol is the key under the ESC key on the keyboard)

So the way to do it is

awk 'NR>= beginLineNum&& NR<`wc -l logfileName` logFileName  | grep -nE  pattern ;

When executing commands in Linux, the commands in ‘will be executed first, and then other commands will be executed

“As standard input, the return value of the command inside is input into the command outside.

Centos7 network is unreachable

A friend’s centos7 can’t connect to the network normally after it is installed on the virtual machine. I also have this problem. I try to reallocate the address with dhclient, but the system prompts that dhclient is running. I have no choice but to try other methods. After studying it, you can refer to this scheme and try it out. The steps are as follows:

 

1

CD/etc/sysconfig/network scripts/enter the directory of configuration files related to the network to be modified

 

2、 Look at the table of contents

At this time, you will find that there is no ifcfg-eth0 file mentioned in the tutorial. Just open the first ifcfg eno file.

If you can’t find a new tutorial, you can’t create one

3、 VI ifcfg eno1677736

4、 Press the letter I to enter the editing state, and change onboot to yes. Press the ESC key, colon, and then add the letter WQ to save and exit (refer to VI usage)

5、 Service network restart (this command is to restart the network service). If it doesn’t work after the restart, there should be no problem after restarting the Linux system

 

Configuring NFS server in Linux

1、 Install services for NFS

sudo apt-get install nfs-kernel-server rpcbind

(by the way, you can start the SSH service sudo apt get install openssh server)

2、 NFS profile

Open profile

sudo vim /etc/exports

Add server folder path

/home/zwz/linux/nfs *(rw,sync,no_root_squash)

As above, my path is/home/ZWZ/Linux/NFS

3、 Restart NFS service

sudo /etc/init.d/nfs-kernel-server restart

4、 Experimental test

1. Copy files to the NFS folder (such as zimage)
2. The client can use the corresponding NFS command to try.

CONDA error notwritableerror: the current user does not have write permissions

Just after installing anaconda and preparing CONDA create environment, we encountered the following error

NotWritableError: The current user does not have write permissions to a required path.
  path: /home/NAME/.conda/envs/.conda_envs_dir_test
  uid: 1000
  gid: 1000

If you feel that permissions on this path are set incorrectly, you can manually
change them by executing

  $ sudo chown 1000:1000 /home/NAME/.conda/envs/.conda_envs_dir_test

In general, it's not advisable to use 'sudo conda'.

According to the prompt he gave, the operation failed, so use the following command to change the permissions of CONDA related folder, – R recursively applied to subfolders

sudo chmod 777 -R ~/anaconda3/
sudo chmod 777 -R ~/.conda/

If the problem is solved for the time being, we will not report the above mistakes

Maybe it’s the redundant problem caused by using sudo sh ana… When installing anaconda.

A solution to the problem of “straight ‘\ 357’ in program” when compiling GCC

Link: http://blog.chinaunix.net/uid-23089249-id-61541.html

I took a few header files from my colleagues. It’s OK to compile them with GCC, but there are a lot of them when I compile them with arm linux GCC!

SerialPort.h:1: error: stray ‘\357’ in program

SerialPort.h:1: error: stray ‘\273’ in program

SerialPort.h:1: error: stray ‘\277’ in program

After looking at these errors, I found that some characters in the file are not supported by the compiler. If you look for these characters one by one, it will take a long time! The simplest solution:

Put the files in the windows system, open these files with Notepad, and then save them as. The code is Asni, and then compile them with the compiler under Linux. Generally, they can pass!

Experience:

The first time: unknown;

Second time: when compiling QT program, prompt this error; solve it according to the above method.

Ioremap function and iounmap() function

Original post address: http://blog.chinaunix.net/uid-21289517-id-1828602.html

void * __ ioremap(unsigned long phys_ Addr, signed long size, signed long flags)
entry: phys_ Addr: the initial IO address to be mapped;

Size: the size of the space to be mapped;

Flags: marks related to permissions of IO space to be mapped;

Function: map an IO address space to the virtual address space of the kernel for easy access;

*void ioremap(unsigned long offset, unsigned long size);

Parameter:
offset: physical address
size: the size of the space to be mapped

Return value: page mapping, return virtual address


Iounmap() function to unmap the virtual address;
for example: iounmap (gpsetl0);