Skip to main content

Secure SSH by Disabling Password Login

· 6 min read
Hung Viet Nguyen
Developing Jest Preview and Vitest Preview

If your SSH port is exposed to the internet and your account password is compromised, an attacker could use it to log in to your server. One way to reduce this risk is to disable password login and require an authorized SSH key instead. Only clients with access to the matching private key can authenticate, so a stolen account password alone is not enough.

Here is how to configure it, check the settings, and test a new connection without locking yourself out.

The server commands below are for Debian. On other systems, the configuration paths, service names, or service-management commands may differ.

Automatically Disable Wi-Fi When Ethernet Is Connected

· 4 min read
Hung Viet Nguyen
Developing Jest Preview and Vitest Preview

I am setting up Home Assistant on an old Dell laptop. Because this machine will run all the time, I have been looking for small ways to reduce its power usage.

One simple improvement is to turn off Wi-Fi whenever Ethernet is connected, then turn Wi-Fi back on when the Ethernet cable is unplugged. Debian 13 uses NetworkManager, so this can be automated with a dispatcher script.

Handy Git Commands Every Developer Should Know

· 4 min read
Hung Viet Nguyen
Developing Jest Preview and Vitest Preview

Git is an essential tool for modern software development. While most developers are familiar with basic commands like git add, git commit, and git push, there are many lesser-known but incredibly useful Git commands that can make your workflow more efficient. This post covers some handy Git commands that might not be part of your daily routine but can be extremely valuable in specific situations:

  • Finding Branches Containing a Specific Commit
  • Finding the Merge Base Between Two Branches
  • Finding Changes Between Commits
  • Stashing Untracked Files
  • Searching Through Commit History
  • Checking Out Pull Requests Locally
  • Recovering Lost Commits

Restore Overridden console.log

· 2 min read
Hung Viet Nguyen
Developing Jest Preview and Vitest Preview

Sometimes during development, you might encounter situations where console.log has been overridden. This commonly happens in production builds where logging is disabled to prevent exposing sensitive information or to improve performance. However, when debugging, you might need to restore the original console.log functionality.