Author Archives: Robins

PDF.js load PDF Error: Message: failed to fetch

The meta-buy of pdf.js has been annotated with the following code:
// if (origin !== viewerOrigin && protocol !== 'blob:') {
  //   throw new Error('file origin does not match viewer\'s');
  // }

The main reason is: the HTTPS website loads the PDF resource file address of HTTP, and the PDF resource file address of HTTPS needs to be provided.

[Solved] NPM Error: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed

This error is reported when NPM run build is executed to package Vue project, because the maximum value of node file set is not enough and the file after project packaging is too large.

Solution: install increase memory limit globally

Command line CMD, DOS window running: cnpm install – G increase memory limit,

Enter the project folder and run: increase memory limit

If NPM run build reports an error ‘node — Max old space size = 10240’ after executing increase memory limit after entering the project file, it is neither an internal or external command nor a runnable program ‘

You can create the following JS file contents in the project root directory, execute the file with node, and then run NPM run build to package successfully. This is to replace the public function of the string in the file corresponding to the. Bin file under the node_mosules file.

// Execute this script via node the first time you run the project
const fs = require('fs')
const path = require('path')
const wfPath =  path.resolve(__dirname, './node_modules/.bin')

fs.readdir(wfPath, (err, files)=>{
   if (err) {
    console.log(err);
   } else {
      if(files.length != 0 ) {
        files.forEach((item)=>{
           if(item.split('.')[1] === 'cmd') {
              replaceStr(`${wfPath}/${item}`, /"%_prog%"/, '%_prog%')
           }
        })
     }
   }
 })

// Parameters: [file path, string to be modified, modified string] (public function to replace the string in the corresponding file)
function replaceStr(filePath, sourceRegx, targetSrt) {
  fs.readFile(filePath, (err, data)=>{
     if(err) {
     console.log(err)
     } else {
       let str = data.toString();
      str= str.replace(sourceRegx, targetSrt);
       fs.writeFile(filePath, str, (err)=> { console.log(err) })
     }
  })
}

Git Push Error: error: failed to push some refs… hint: Updates were rejected because the remote…

1. The questions are as follows:

echigh@huangchenggong:/mnt/e/work/workspace/withdraw_validdata_from_file/withdraw$ git push -u origin main
Username for 'https://github.com': echigh
Password for 'https://[email protected]':
To https://github.com/echigh/withdraw_frontbytes_of_file.git
 ! [rejected]        main -> main (fetch first)
error: failed to push some refs to 'https://github.com/echigh/withdraw_frontbytes_of_file.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

2. The reason is that the remote warehouse has been changed and does not match any local commit version

Reference: [status question] why can’t you push it up sometimes… – learn git for yourself

3. Solution:

1) Merge remote changes with git pull before git push

2) Directly use git push – F to forcibly overwrite the remote warehouse. Anyway, I dare not

4. So I did this:

echigh@huangchenggong:/mnt/e/work/workspace/withdraw_validdata_from_file/withdraw$ git pull
remote: Enumerating objects: 22, done.
remote: Counting objects: 100% (22/22), done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 21 (delta 13), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (21/21), 5.03 KiB | 66.00 KiB/s, done.
From https://github.com/echigh/withdraw_frontbytes_of_file
   c6d3d5e..e50b1bc  main       -> origin/main
Merge made by the 'recursive' strategy.
 README.md | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 README.md

Then push:

echigh@huangchenggong:/mnt/e/work/workspace/withdraw_validdata_from_file/withdraw$ git push
Username for 'https://github.com': echigh
Password for 'https://[email protected]':
Enumerating objects: 44, done.
Counting objects: 100% (42/42), done.
Delta compression using up to 8 threads
Compressing objects: 100% (38/38), done.
Writing objects: 100% (38/38), 3.16 MiB | 994.00 KiB/s, done.
Total 38 (delta 19), reused 0 (delta 0)
remote: Resolving deltas: 100% (19/19), completed with 2 local objects.
To https://github.com/echigh/withdraw_frontbytes_of_file.git
   e50b1bc..b7684a5  main -> main

Solution to [SSL: certificate_verify_failed] when you get downloads video

[SSL: certificate_verify_failed] problem when downloading video using you get and ffmpeg

Since the you get -- debug debugging shows that it is a certificate verification problem, the part ignoring SSL certificate verification is added to the code and implemented in pycharm (non command line)
Modify url = 'website', output_Dir = R 'save path'

import ssl
from you_get import common

# Ignore certificate validation issues
ssl._create_default_https_context = ssl._create_unverified_context

# Call any_download_playlist in you_get.common to download a collection
common.any_download_playlist(url='https://www.bilibili.com/video/BVXXX',stream_id='',info_only=False,
                             output_dir=r'F:\StudyLesson\YouGet',merge=True)

# Call any_download in you_get.common for single set download
common.any_download(url='https://www.bilibili.com/video/BVXXX?p=8',stream_id='',
                    info_only=False,output_dir=r'F:\StudyLesson\YouGet',merge=True)

So far, the video has been downloaded successfully
record.

Linux Install Docker Error: Failed to restart docker.service: Unit docker.service not found.

Exception during Linux Installation of docker: failed to restart docker.service: unit docker.service not found

Linux CentOS version confirmation

1. Linux system centos7 installation docker
install here in centos7. You can use the following command to view the CentOS version

lsb_release -a

Check whether docker list is installed

yum list installed | grep docker

2.2 installing docker

yum -y install docker

-Y means do not ask for installation until the installation is successful. After the installation, check the installation list again

2.3 start docker

systemctl start docker

2.4 viewing docker service status

systemctl status docker
    1. linux centos8 installation docker
    1. installation dependency
yum install -y yum-utils  device-mapper-persistent-data  lvm2
 yum-config-manager  --add-repo   https://download.docker.com/linux/centos/docker-ce.repo
 yum install docker-ce docker-ce-cli containerd.io

Install docker

yum install docker-ce docker-ce-cli

Start docker

systemctl start docker

Startup self startup

Set the docker to start automatically after startup

systemctl enable docker

[Solved] Win10: Failed to connect to github.com port 443 Timed out

First, Ping github.com to test whether it can connect. Then modify the host.

Step 1: open ipaddress.com, query the following two domain names and record their corresponding IP addresses:

1.github.com 
2.github.global.ssl.fastly.net

Step 2: update the host file

140.82.114.3 github.com 
199.232.69.194 github.global.ssl.fastly.net

Step 3: clean up DNS and try again.

ipconfig /flushdns

Springboot integration RabbitMQ times error: Failed to check/redeclare auto-delete queue(s).

Today, when the company server rabbitmq related configuration is changed to local related configuration in the code, an error is reported: failed to check/redeclare auto delete queue (s)

Error reporting reason:

15672 is the port of the web management interface; 5672 is the port accessed by MQ, so changing the port in the configuration file to 5672 is OK;

[Solved] Git Common Error: error: src refspec xxx does not match any/error: failed to push some refs to

Solution:


master-wei@DESKTOP-HDUPJ4Q MINGW64 /g/browser/blog/myblog (main)
$ git push origin master
error: src refspec master does not match any
error: failed to push some refs to 'https://github.com/w13411965905/myblog.git'


master-wei@DESKTOP-HDUPJ4Q MINGW64 /g/browser/blog/myblog (main)
$ git config --global --unset http.proxy

master-wei@DESKTOP-HDUPJ4Q MINGW64 /g/browser/blog/myblog (main)
$ git config --global --unset https.proxy 

master-wei@DESKTOP-HDUPJ4Q MINGW64 /g/browser/blog/myblog (main)
$ git push origin main
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 35.82 MiB | 1.62 MiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0

reason:

The default main branch name of GitHub is main

Therefore, the push command should be git push origin main

Mac IDEA Connect SVN Error: E230001: Server SSL certificate verification failed: certificate issued

CMD opens the run window and executes the following command:
1.svn ls https://xxx

  • XXX is the specific SVN project address (you can try your project address several times)
  • Finally it will display ®eject, accept (t)emporarily or accept §ermanently?
    2.Enter P
    3.and then enter the SVN account name username and password according to the prompt.