Иногда бывает ситуация когда 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
🇽🇰#Kosovo: Kosovo Police has found yet another cache of weapons, ammunition, and military gear yesterday, after searching the basement of a residential building on Vasilije Ostroški Street in North Mitrovica.
Officers recovered multiple assault rifles, hundreds of rounds of ammunition, magazines, a smoke grenade, body armor, and various pieces of military clothing and equipment. No arrests were made, and an investigation into illegal weapons possession is ongoing.
This comes as, over the past week, several abandoned weapons caches have been discovered in the north, including one containing hundreds of kilograms of explosives and a practice anti-tank mine. It remains unclear whether the stashes are linked to a specific paramilitary group or a criminal organization.
(📸 via @KosovoPolice on FB)
🇽🇰#Kosovo: Kosovo Police have uncovered weapons, ammunition, and explosives in abandoned houses in Zubin Potok, Zvečan, and the North Mitrovica area since the start of this week.
Just in North Mitrovica, authorities seized around 140 kg of explosives, which they say were produced in Serbia.
The latest seizure was yesterday in Mitrovicë Veri, where police, acting on information from citizens, found several illegal weapons, ammunition, and a VPMA-2 (a practice version of the PMA-2 anti-personnel mine).
(📸 via @Kosovo_police on X)
#Kosovo
L’Assemblea della Repubblica del Kosovo ha adottato un progetto di legge finalizzato alla regolamentazione giuridica del diritto alla riproduzione sessuale e della procreazione medicalmente assistita.
@OsservatorioEsteri
#Kosovo🇽🇰
#Parlamentari
🕖Ore 19:00.
Affluenza parziale: 44,29%
N.B.: nel computo mancano i seggi speciali, quelli allestiti all'estero e alcune sezioni allestite nel Paese, che non hanno ancora comunicato i dati.
@TuttoElezioni
#Kosovo#primario Huelga en la mina Trepca https://www.aa.com.tr/en/europe/kosovo-mine-workers-begin-hunger-strike-for-better-working-conditions/3032646
‼️A la chita callando, #España pasa a reconocer la independencia de #Kosovo. Un nuevo giro de 180º de Sánchez alinéandose con #EEUU que impulsa la #guerra
https://www.euractiv.com/section/enlargement-neighbourhood/news/kosovo-says-spain-recognises-its-passports/
#Kosovo#NATO
Il governo del Kosovo ha chiesto agli Stati Uniti una base permanente sul suo territorio ed ha chiesto di entrare nella NATO.
@UltimoraPolitics
#Kosovo
Il Presidente del Kosovo Hashim #Thaçi si è dimesso dopo che è stata confermata l'accusa di crimini di guerra e crimini contro l'umanità dalla Procura dell'Aia.
@NewsDalMondoo