scatterd-dotfiles/bin
Alejandro Dustet e41338084e
Add helper to list process running in a given port
Why:
----

Whenever we run a command to use a certain port and we get an error that
the port is in use, we have can either:
1. Clear the port so our new process can use it
2. Try and use a new port for the command we just typed

In order to make a decision about it, we need information on what is
running on that port, so we can determine if we want to stop that
process or if it's important enough to keep.

What:
----

Two new commands are added to /bin. One to output
information about the process using a provided port:

``` bash
$ whats-in-port 3000
$ COMMAND   PID   USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
$ ruby    25583   root   11u  IPv4 0xee20607697a79bf7      0t0  TCP *:irdmi (LISTEN)
```

This command uses the [lsof] program to get information of the process
utilising that port.

And another one making use of the previous utility to kill the process
running in that port:

``` bash
$ clear-port 3000
```

[lsof]: https://linux.die.net/man/8/lsof

Co-authored-by: Mike Burns <mburns@thoughtbot.com>
Co-authored-by: Edward Loveall <edward@thoughtbot.com>
2022-04-29 15:18:11 -04:00
..
bundler-search Fix minor spelling error in command code comment 2015-10-21 08:19:17 -04:00
clear-port Add helper to list process running in a given port 2022-04-29 15:18:11 -04:00
git-ca Bring more shell syntax into shellcheck compliance 2015-10-30 12:50:02 -04:00
git-co-pr Move Git aliases to subcommand scripts 2015-04-27 13:47:52 -07:00
git-create-branch Move Git aliases to subcommand scripts 2015-04-27 13:47:52 -07:00
git-ctags Move Git aliases to subcommand scripts 2015-04-27 13:47:52 -07:00
git-current-branch Move Git aliases to subcommand scripts 2015-04-27 13:47:52 -07:00
git-delete-branch Move Git aliases to subcommand scripts 2015-04-27 13:47:52 -07:00
git-merge-branch No primary branch reference is an error 2020-06-17 17:07:23 -04:00
git-rename-branch Move Git aliases to subcommand scripts 2015-04-27 13:47:52 -07:00
git-trust-bin Add bin/git-trust-bin command 2017-08-25 09:28:16 -04:00
git-up Fetch origin and rebase against origin with git-up 2020-06-18 13:53:53 -04:00
replace Use command -v instead of which 2018-12-27 14:01:59 -05:00
tat has-session - only exact matches 2019-08-20 14:37:10 -04:00
whats-in-port Add helper to list process running in a given port 2022-04-29 15:18:11 -04:00