Иногда бывает ситуация когда 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
📸 Meet the Ginetta Akula, a bespoke limited-edition supercar derived from a racing machine
💸 The British have started production of the Ginetta Akula supercar. The prototype of the sports car was shown back in 2019, but production has only started now. Only 20 of these cars will be assembled at a price from 275 thousand pounds.
🏎 This is a classic supercar with an atmospheric 6.4-liter V8 with 600 horsepower, “mechanics” and rear-wheel drive. Despite the large motor, the coupe weighs only 1.2 tons and can accelerate to 100 km/h in 2.9 seconds at a top speed of 290 km/h.
@CarsNews
#GinettaAkula#supercar
📸Встречайте Ginetta Akula, лимитированный суперкар, созданный на основе гоночной машины
💸 Британцы начали производство суперкара Ginetta Akula. Прототип спорткара показали ещё в 2019 году, про этом производство началось только сейчас. Всего соберут только 20 таких автомобилей по цене от 275 тысяч фунтов.
🏎 Это классический суперкар с атмосферным 6,4-литровым V8 на 600 сил, «механикой» и задним приводом. Несмотря на крупный мотор, весит купе всего 1,2 тонны и может разогнаться до 100 км/ч за 2,9 секунды при максимальной скорости 290 км/ч.
@avtoNovosti
#GinettaAkula#суперкар
🌟 Exciting News for Supercar Enthusiasts! 🚗💨
The British have officially kicked off production of the stunning Ginetta Akula! 🦈✨
First unveiled in 2019, this masterpiece is limited to just 20 units, starting at £275,000. 💰
Featuring a classic design, the Akula boasts a powerful 6.4L V8 engine with 600 hp, paired with a manual transmission and rear-wheel drive. 🔥 Despite its robust engine, it weighs only 1.2 tons, accelerating from 0 to 100 km/h in just 2.9 seconds! ⚡️🏁 With a top speed of 290 km/h, this beauty is ready to roar!
Are you ready to experience the thrill? 😍
#GinettaAkula#Supercar#LimitedEdition#V8Power#CarEnthusiast#LuxuryCars#SpeedDemon#Auto