For security reasons, passwordless login is generally implemented using public-private key pairs. Here, I’ll mark down the configuration method.

  1. Log into the client machine and create a public-private key pair if you don’t already have one.

    The public and private keys are stored in the ~/.ssh directory.

  2. Log into the target server and open the ~/.ssh/authorized_keys file.

    The authorized_keys file records the list of public keys authorized for login.

  3. Copy the public key from the client machine into this file and save it.

  4. Try SSH login to the target machine again, and you’ll find no password is required.

Sometimes, switching the source of npm packages in a project is necessary due to network or security issues. The general practice is to switch the source in npmrc, but after switching and installing packages, you will find that the install still goes through the old source, primarily when a lock file has already been generated.

Here, we analyze the issue of the registry not working.

Version Information

For verification, I am using the following versions:

  • npm v9.5.1

  • node v18.16.1

Read more »

Issue

In projects using redux-logger, redux-logger still exists after packaging in Webpack production mode.

Theoretically, the logger should only be used in the development environment, so it should be removed after packaging. Therefore, with this question in mind, let’s analyze the problem.

Code Details

Read more »

Recently, I used Monaco editor to implement an SQL editor. To improve the user experience, code auto-completion was necessary. After some research, I found a solution, so I’m marking it down here.

Built-in Autocompletion?

YES, Monaco supports some built-in languages by default, such as JavaScript, TypeScript, CSS, JSON, and HTML. You can achieve code autocompletion for languages with built-in support simply by setting the editor language to JavaScript`.

However, for languages like SQL that do not have built-in support, setting the editor language to SQL only enables syntax highlighting.

Read more »

Recently, because of Claude Sonnet and Cursor, I started contacting Claude. After using it for a while, I found that Claude is quite good; at least, I feel it’s on par with ChatGPT at the moment.

Here I’ll mark down some usage tips.

Requirements

  • VPN
    • This is similar to ChatGPT; both require solving network issues.
    • The list of countries supported by Claude can be found here.
    • If the proxy network is not good, account suspension is likely later.
    • You can refer to my proxy solution for those who haven’t solved the VPN issue.
  • Foreign phone number
    • Google Voice is not supported; using a GV number to receive an SMS verification code will result in an immediate error.
    • Getting a foreign SIM card, such as Giffgaff, is impossible if you don’t have one.
    • Using SMS verification code platforms recommended online may result in a higher chance of not receiving the verification code.

Register

Read more »

This article is the author's introduction to the Draw.io user guide, including the advantages, implementation details, and related resources of the Draw.io user guide. These steps can help the author improve the efficiency of using Draw.io.

Read more »

Can environment variables be set when connecting to a server using the Node.js SSH2 client? After investigation, it was found that it is possible. Just marking it here.

Setting Environment Variables

The code is as follows:

1
2
3
4
5
6
7
8
9
10
11
12
this.conn.shell({
env: {
X_LOGIN_IP: '128.1.1.123',
X_ENVIRONMENT_VARIABLE: "desiredvalue"
}, term: 'xterm-256color', // term: 'dumb',
cols: connectOpts.cols, rows: connectOpts.rows,
}, (err, s) => {
if (err) {
console.log('ssh shell error', err);
throw err;
}
})

Limitations

Read more »

Explore methods to monitor and handle network disconnections in web applications, improving user experience and application robustness.

Read more »

Implement large file downloads with StreamSaver.js in JavaScript. Overcome browser limitations and enhance your web applications efficiently.

Read more »

Learn about Wave Terminal: a free, open-source terminal supporting Mac, Linux, and Windows WSL. Discover its features and usage tips in this brief guide.

Read more »
0%