Category Archives: Linux

[Solved] ldd reports an error: not found (the arm version of gdb is exsited)

1. Linaro-gdb cannot be used in the cross-compilation environment.

Reference: https://stackoverflow.com/questions/25314983/ldd-says-not-found-even-though-library-is-in-my-ld-library-path

In the cross-compilation environment, gdb reports an error and lacks libncurses.so.5. But using ldconfig -p | grep libncurses.so.5 can be found.

It may be caused by a conflict between 32-bit and 64-bit. The library is 64-bit, but the program is 32-bit. You can use file to confirm separately.

$ file libpmsfdcwrt.so
libpmsfdcwrt.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped

$ file
/lib64/libz.so.1.2.3 /lib64/libz.so.1.2.3: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped

 

Solution: Download the 64-bit version of gdb to solve it (from the official website).

[Solved] Git Clone Error: The requested URL returned error: 403 error

Error reason:
the GIT client has cached the wrong password. The account password is confused with the local storage and is incorrect; Generally, multiple git accounts will lead to such a situation. For example, your own git account and your git account in the company can be used together at the same time

simple method:
when cloning, bring the account and password and clone them together. The changed account and password will also be added to ~ /.Git credentials
http://username:password @git.coding.net/xxxxxxxx/xxxx.git/

[Solved] error: cannot lock ref ‘refs/remotes/origin/[branch]’

error: cannot lock ref ‘refs/remotes/origin/[branch]’   is *** but     expect ****

#Update the reference first

git update-ref -d refs/remotes/origin/[locked branch name]

#Then synchronize the code git pull

 

Given two parameters, storing <newvalue> in <ref> may dereference the symbol reference. For example, git update-ref HEAD <newvalue>update the current branch head to a new object.

Given three parameters, after verifying that the current value of <ref> matches <oldvalue>, store <newvalue> in <ref>, which may dereference the symbol reference. For example git update-ref refs/heads/master <newvalue> <oldvalue>, only when its current value is <oldvalue>, will the main branch head be updated to <newvalue>. You can specify 40 “0” or an empty string as <oldvalue> to ensure that the reference you create does not exist.

It also allows the “ref” file to become a symbol pointer to another ref file by starting from the four-byte header sequence of “ref:”.

More importantly, it allows updates of ref files to follow these symbol pointers, whether they are symbolic links or these “regular file symbol references”. It only follows true symbolic links when it starts with “refs/” : otherwise it will only try to read them and update them to regular files (ie, it will allow the file system to follow them, but will override such symbolic links to A normal file name elsewhere).

If –no-deref is given, the <ref> itself is overwritten instead of following the result of the symbol pointer.

 

GitLab Page Error: 502 Whoops, GitLab is taking too much time to respond. Try refreshing the page, or going

If you confirm that gitlab has been started and the status is run

Log in to the website and report an error.

The first consideration is configuration,

Gitlab requires more than 4G memory. If not, please check whether the virtual machine or server configuration is enough.

Second, check whether your port is occupied

netstat -lntup

If port 8080 is occupied, you must kill it

You can query the log through gitlab CTL tail to see where the problem is

[Sovled] CentOS nginx 500 error: failed (13: Permission denied)

##

Viewing the nginx error log

vim  /usr/local/nginx/logs/error.log

####

2021/11/15 19:26:59 [crit] 14130#0: *4 stat() “/root/code/dist/index.html” failed (13: Permission denied), client: 192.168.111.1, server: localhost, request: “GET /favicon.ico HTTP/1.1”, host: “192.168.111.3:8001″, referrer: ” http://192.168.111.3:8001/ ”

##

Because I changed the directory where nginx accesses static files, and I used root to modify it
the nginx.conf configuration file should also indicate the user to use:

###

jhsdb jmap –heap –pid 1 Command Error [How to Solve]

1. View the heap usage of the running Java docker service. The command jhsdb jmap — heap — PID 1 reports an error

Main error message:

ERROR: ptrace(PTRACE_ATTACH, ..) failed for 1: Operation not permitted
Error attaching to process: sun.jvm.hotspot.debugger.DebuggerException: Can’t attach to the process: ptrace(PTRACE_ATTACH, ..) failed for 1: Operation not permitted

reason:

Docker has added security features since version 1.10. JDK tools such as jmap rely on Linux’s ptrace_ Attach, and docker since version 1.10, ptrace is disabled in the default seccomp configuration file. The container needs to add corresponding settings to enable the container to support the use of relevant commands.

Solution:

1. Stop docker service systemctl stop docker

2.cd /Var/lib/docker/containers/container ID   Switch to container path

3.vi Hostconfig.json edit the configuration file and change the value of capadd to sys_PTRACE

4.   Restart docker service   systemctl start docker

Modified results:

Git Upload File Error: fatal: could not read from remote repository. [How to Solve]

problem

git push  – An error is reported after the U origin master is executed

fatal: Could not read from remote repository.

Solution

1. Git execution

git remote add origin [email protected]:username/xxx.git

2. Open the .ssh folder

Find the  id_rsa.pub file

3. Open GitHub’s Settings

Select SSH KEYS settings, click the New SSH key button

Open the id_rsa.pub file with Notepad, copy all the content to the Github key, and click the add ssh key button.

others:

If the error is not resolved, try resetting the SSH key

ssh-keygen -t rsa -C "github账号"

1. Open the .shh  folder, the newly generated id_rsa, id_rsa.pub two files and the new Key

2. Open the Settings of github and set the ssh key (repeat the above steps to add new SSH key )