Shows ports that are open on your system and gives you the ability to kill their process.(linux only)
output.mp4
Plug "rcarriga/nvim-notify"
Plug "nvim-telescope/telescope.nvim"
Plug "LinArcX/telescope-ports.nvim"
use { 'rcarriga/nvim-notify', branch = "master" }
use { "nvim-telescope/telescope.nvim" }
use { "LinArcX/telescope-ports.nvim" }
require('telescope').load_extension('ports')
:Telescope ports
Key | Description |
---|---|
c-k |
kill current process |
Key | Description |
---|---|
c-k |
kill current process |
:Telescope command_palette
.
telescope-ports.nvim uses sudo
internally, so we need to setup an askpass helper for it.
I use gnome-ssh-askpass but you can use other alternatives like: lxqt-openssh-askpass
Just add this line into your .bashrc
or .zshrc
:
export SUDO_ASKPASS=/usr/bin/gnome-ssh-askpass
You can use this python script to open a specific port:
import socket;
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM);
s.bind(('0.0.0.0', 1013));
s.listen(1);
conn, addr = s.accept();
print('Connected with ' + addr[0] + ':' + str(addr[1]))
If you have any idea to improve this project, please create a pull-request for it. To make changes consistent, i have some rules:
-
Before submit your work, please format it with StyLua.
- Just go to root of the project and call:
stylua .
- Just go to root of the project and call:
-
There should be a one-to-one relation between features and pull requests. Please create separate pull-requests for each feature.
-
Please use snake_case for function names ans local variables
-
If your PR have more than one commit, please squash them into one.
-
Use meaningful name for variables and functions. Don't use abbreviations as far as you can.
- This plugin should work on windows.
- Not all systme use
sudo
. There are other alternatives. There should be a mechanism to distinguish between these alternatives and behave uniformly with all of them.