Иногда бывает ситуация когда 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
On comets
This is an image of the comet C/2006 P1, commonly known as McNaught.
Scientists observed its tail modifying attributes of the solar wind, which is impossible by the standard model, which claims that comets are 'dirty snowballs'.
In reality, comets are charged rocks which spend most of their time in the outer regions of the solar system, where they accumulate a negative charge until they start their journey into the center of the solar system.
Their tails are visible electric discharge phenomena.
To recognize the electrical nature of comets, means recognizing the electrical nature of the universe and is key in understanding spirituality.
#astronomy#comets
@EuropeanTribalism
🪐 A comet named 12P/Pons-Brooks, known as a "cryovolcanic comet" for its icy volcanic eruptions, will make a close approach to Earth in 2024. When this comet nears the Sun, its surface cracks and blasts out dust and frozen gases into space, creating dramatic outbursts and a bright, glowing coma—a reminder of how large icy bodies can suddenly liven up and send material toward our planet’s neighborhood. ✨
#comets⚡#hazards⚡#spaceweather⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
🪐 One of the largest comets ever observed, C/2014 UN271 (Bernardinelli-Bernstein), is traveling through our solar system and is estimated to be about 150 kilometers wide—over 1,000 times bigger than a typical comet. Although it won't come close enough to threaten Earth, its sheer size shows that massive objects from the far reaches of the solar system, like the distant Oort Cloud, could pose a significant risk if their paths ever brought them near our planet. ✨
#comets⚡#oortcloud⚡#threats⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels