Иногда бывает ситуация когда 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
#Iceland🇮🇸
A special place in Iceland is considered to be the black beach. It was here that such cult movies as "The Lord of the Rings", "Game of Thrones" and "Star Wars" were filmed. The black beach was formed as a result of volcanic activity. This event happened many years ago
#Iceland, Gudlfoss 🇮🇸
Gyudlfoss is a waterfall in Iceland, in the Syudurland region.
The depth of the waterfall to the place of water falling in the valley is about 70 meters. The Güdlfoss itself consists of two steps - 21 meters and 11 meters high, dumped to each other at an angle of 90 °.
It is considered one of the most beautiful places in Iceland and is the most visited tourists.
🌟Breathtaking Views of Iceland!
🟠A mesmerizing landscape where a powerful waterfall meets silent green hills and dramatic clouds on the horizon.
🟠Nature here stuns with its beauty and scale, offering perfect spots for adventure seekers and photography enthusiasts. Feel the grandeur and tranquility of these magnificent landscapes!
#Iceland | @voyage
🗺 Iceland 🇮🇸
Following a recent volcanic eruption, the main highway to the Icelandic town of Grindavík is now impassable, and the surrounding area is covered in lava for several kilometers.
#Iceland | @voyage
Iceland🇮🇸
🟠A canyon located in the Jokuldalur Valley, Iceland.
🟠It is famous for its columnar basalt formations and blue-green water.
#Iceland | @voyage
Iceland🇮🇸
🟠A canyon located in the Jokuldalur Valley, Iceland.
🟠It is famous for its columnar basalt formations and blue-green water.
#Iceland | @voyage
Iceland 🇮🇸
🟠After the eruption of Eldfell volcano on Heimaey Island, a stunning natural wonder emerged — a rock formation shaped like an elephant drinking from the Atlantic.
📏
📏
📏
📏
📏
📏
📏
📏
#Iceland | @voyage
⚡️Hallgrímskirkja – a majestic church in the heart of Reykjavík! ✨🏔️
🟠Inside, it houses a massive pipe organ with 5,275 pipes, standing 15 meters tall and weighing 25 tons – a true musical masterpiece!
📏
📏
📏
📏
📏
📏
📏
📏
#Iceland | @voyage
✨ Hallgrímskirkja — the highest point in Reykjavik.
🟠Imagine a majestic church rising above the city like a guardian of time. Its unique architecture and panoramic views of Reykjavik make it a must-visit place.
📏
📏
📏
📏
📏
📏
📏
📏
#Iceland🇮🇸@voyage