Иногда бывает ситуация когда 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
🐄🐄 𝘿𝙄𝙂𝙀𝙎𝙏𝙄𝙊𝙉 𝙄𝙉 🐄𝙍𝙐𝙈𝙄𝙉𝘼𝙉𝙏𝙎 🐄🐮
👉All herbivores (plant-eating mammals) are called ruminants.
👉They rechew the cud to break down plant matter and stimulate digestion.
👉The stomach is divided into four chambers- rumen, reticulum, omasum, and abomasum.
🐄🐮 𝙋𝙧𝙤𝙘𝙚𝙨𝙨 𝙊𝙛 𝘿𝙞𝙜𝙚𝙨𝙩𝙞𝙤𝙣 🐄🐮
👉Ruminants quickly swallow the food and store it in the rumen.
👉Once the rumen is filled, food is passed into the second chamber (reticulum).
👉In the reticulum, digestive juices partially digest the food.
👉Partially digested food is called cud.
👉Now when mammals are resting, bring the cud back into the mouth for rechewing.
👉After cud is chewed food is passed to the omasum and the abomasum.
👉Symbiotic bacteria in the caecum brought complete digestion of cellulose.
#digestion
https://t.me/starvetbooks