Иногда бывает ситуация когда 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
💻 Join Us for "Way to Become an MLSA"!
Are you interested in becoming a Microsoft Learn Student Ambassador? Curious about how to kickstart your journey in tech?
Join us for an inspiring event featuring Uzbekistan’s youngest and first female Microsoft Student Ambassador. She will share her unique experiences and insights into the MLSA program.⚡
📍Date & Time: November 2, 2:00 pm
⏰Location: C-Space, Yunusabad Branch
This is your opportunity to ask questions, network with peers, and learn how you can become a part of this exciting community. Don’t miss out—mark your calendars!🙃
Register here! Spots are limited.
#Microsoft#MLSA#StudentAmbassadors#Leadership#MicrosoftDevelopersUzbekistan
@mdcuzbekistan
Our Core Team Member, Dilafruz Joraboyeva, Achieved Microsoft Learn Student Ambassador Status!
We are thrilled to share that our very own core team member, Dilafruz Joraboyeva, has achieved a remarkable milestone by becoming the first and youngest female Microsoft Learn Student Ambassador (MLSA) in Uzbekistan. Dilafruz, who has long been an active and dedicated part of our community, now stands as the only MLSA in the country.
In her new role, Dilafruz will be leading the MLSA program across universities in Uzbekistan, bringing Microsoft technologies and opportunities closer to students. Her efforts will help build a vibrant community of learners and innovators, inspiring others to take on leadership roles in tech.
Keep an eye on our official platforms for upcoming events related to the MLSA program, where you can discover how to join this exciting initiative and make an impact at your university.
#Microsoft#MLSA#StudentAmbassadors#UzbekistanTech#MicrosoftDevelopersUzbekistan#Leadership#Innovation
@mdcuzbekistan