How to Push to a GitHub Repository in IntelliJ

Image
1. Initialize and Connect the Git Repository # Run in the terminal from the project root git init git remote add origin https://github.com/[user]/[repository].git 2. Configure Git in IntelliJ Select VCS → Enable Version Control Integration . Choose Git and click OK . 3. Connect Your GitHub Account Go to File → Settings (on Windows) or IntelliJ IDEA → Preferences (on macOS). Navigate to Version Control → GitHub . Click Add Account ( + ). Select Log In with Token... and enter your GitHub Personal Access Token. 4. Add and Commit Files Go to VCS → Git → Add (or use the shortcut Ctrl+Alt+A ). Select the files you want to commit. Go to VCS → Commit (or use the shortcut Ctrl+K ). Write a commit message and click Commit . 5. Push Go to VCS → Git → Push (or use the shortcut Ctrl+Shift+K ). Click the Push button. Simpler Method (Using IntelliJ's Built-in Feature) Go to VCS → Share Project on GitHub . Set the repository name to vita-user-...

How to Find and Kill a Process Using a Specific Port on Linux (lsof & netstat)

Introduction

When executing a process, it may fail to start if the port it needs is already occupied by another process. In such cases, you need to find out which process is using that port and either terminate it or modify its configuration.

Using lsof

lsof (List Open Files) is a command in Linux-like systems that displays a list of all open files and the processes that opened them.

Option explanation:

  • -i: Display the listing of files whose Internet address matches the specified address or protocol.

Example: Check if port 22 is in use

lsof -i TCP:22

Output:

COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
sshd    1116 root    5u  IPv4  33907      0t0  TCP *:ssh (LISTEN)
sshd    1116 root    7u  IPv6  33909      0t0  TCP *:ssh (LISTEN)

Using netstat

netstat is a utility that prints network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.

Common options:

  • -l: Display listening sockets
  • -n: Display numerical addresses
  • -p: Display the process ID and name

Example: Check if port 22 is in use

netstat -lnp | grep ':22'

Output:

tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1116/sshd
tcp6       0      0 :::22                   :::*                    LISTEN      1116/sshd

Summary

  • Use lsof -i TCP:PORT or netstat -lnp | grep ':PORT' to find which process is using a specific port.
  • Terminate the process using kill <PID> or reconfigure your application to use a different port.

Comments

Popular posts from this blog

Resolving Key Exchange Failure When Connecting with SecureCRT to OpenSSH

SecureCRT] How to Back Up and Restore SecureCRT Settings on Windows

How to Set Up Vaultwarden (Bitwarden) on Synology NAS (Best Free Alternative to LastPass)