Иногда бывает ситуация когда dev-сервер по какой-либо причине не закрылся и висит в процессах, занимая порт.
Это может быть из-за падения IDE или просто сам забыл погасить и закрыл терминал.
Для таких случаев я набросал простую функцию с командой:
kill_on_port() {
port=$(lsof -t -i:$1)
echo "KILL PROCESS:" $port
sudo kill -9 $port
}
alias killonport="kill_on_port $@"
Код поместить в ~/.bashrc и рестартнуть систему.
Если во время старта dev-сервера получаете ошибку что порт уже занят, просто выполните команду, подставив свой порт.
Bash
kill_on_port 8000
Скорее всего бесполезно, если другой процесс назначен на перезапуск вашего dev-сервера в случае падения.
Имя команды можете изменить на любое другое.
#linux
She's a mother, a daughter,
She's brave, courageous,
Is She's feeble ? Helpless ?
No! It's you, your frame of mind,
Still let's her freedom to rescind!
She's not disabled,
Just the scenario made her existence confined,
Even in the century of 21st,
She's still defenseless over the set of your mind!
She never got the freedom, which a boy gets at his age,
So could you please let me know,
How She's guilty at every stage ?
Either She's LAXMI to NIRBHAYA and PRIYANAKA in 2019,
Nothing has changed,
Every single day, every single minute, nd in every single second,
She's molested, burnt and raped!
This act is plaintive enough,
We can't even think of,
Only a question I wanted to ask,
When she'll get rid of!
💯
-Gurpreet Bhatia
#guri#poetry#review#write