2023ๅนด8ๆœˆ24ๆ—ฅ ๆ˜ŸๆœŸๅ››

What I learn today (08/24/2023): Mastering Ports, SSH, and Editor Shortcuts

๐Ÿ” Mastering Ports, SSH, and Editor Shortcuts: A Comprehensive Guide

Opening and Managing Ports

Control over your firewall and ports is crucial for security and application accessibility. Here's how you can open up a new port:

sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
sudo firewall-cmd --reload

To list all open ports, simply use:

firewall-cmd --list-all

Managing Users and SSH

Need to logout a user? Use this:

pkill -u username

SSH port forwarding can be handled with the following:

ssh -L port:127.0.0.1:port -l Account -N RemoteIP

SSH keys

  1. Generate SSH key pair:
  2. ssh-keygen -t rsa
  3. Add the content in id_rsa.pub to the remote server's .ssh/authorized_keys file.

Text Editor Tricks

  • Select all instances of a word: double click the word, then press ⌘ + Ctrl + G (Mac) or Alt + F3 (Windows/Linux).
  • Quick Column View: Press ⌘ (Ctrl on Windows) + Alt + 2 → 4 to open 2, 3, or 5 columns. Use 1 to return to a single column layout.
  • Vertical selection: Use alt + click + drag.

Additional Shortcuts

Bring up login screen: Ctrl+Alt+F1 or Windows + L.

By mastering these commands and shortcuts, you'll find your workflow becomes smoother and more efficient. Whether you're managing a server or editing files, these tips and tricks are essential tools for any tech professional. Happy coding! ๐Ÿš€

ๆฒ’ๆœ‰็•™่จ€: