Иногда бывает ситуация когда 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
There are currently no cases of #MarburgVirusDisease in Nigeria. However, measures have been taken to strengthen preparedness for #MVD in Nigeria.
Nigerians are urged to AVOID ALL BUT ESSENTIAL TRAVEL to Equatorial Guinea at this time.
📜Press release:
https://ncdc.gov.ng/news/440/ncdc-on-alert-following-the-announcement-of-the-marburg-virus-disease-outbreak-in-equatorial-guinea
Deputy Plotnikov Urges Police Resignees to Join Special Military Operation
In Perm, Deputy Vladimir Plotnikov proposed adding police officers who resign to the Special Military Operation (SMO) lists, citing low salaries and existing training. He emphasized duty to the Motherland and noted SMO pays better. Despite this, Plotnikov himself is a millionaire owning luxury cars and real estate. Last year, over 80,000 officers left the Ministry of Internal Affairs, worsening the staffing crisis.
#Russia#MVD#SMO#Plotnikov
The main news of Russia and the world ishere.
Russian Ministry of Internal Affairs Launches Digital Program to Reduce Bureaucracy and Police Workload
In 2025, the Russian Ministry of Internal Affairs lost 80,000 employees—40% more than new recruits—leading to a regional staffing deficit exceeding 25%, threatening law enforcement efficiency. Minister Kolokoltsev has ordered optimization of paperwork and digitalization of processes while enhancing social guarantees for officers. These measures aim to improve working conditions and retain personnel.
#MVD#police#digitalization#staffing#Russia
The main news of Russia and the world ishere.