Иногда бывает ситуация когда 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
Oneplus Archive
This project provides official, unmodified OnePlus stock firmware images for supported models, ideal for rooting, flashing custom ROM(s) and more
⚙️ Repo Link: Here
👤 Maintainer: Spike & Team
#oneplus#firmware#boot#otaimage#root
#shell#alpine#alpine_linux#boot#distro#grub#installer#iso#linux#linux_distribution#liveos#netboot#netinst#netinstall#operating_systems#os#reinstall#shell_script#vps#windows
You can use a powerful script to easily reinstall Linux or Windows on your server with just one command. It supports 19 popular Linux versions and all Windows versions from Vista to Windows 11, automatically downloading official ISO files and drivers. It works for switching between Linux and Windows, handles different network setups without manual IP input, and supports BIOS, EFI, and ARM servers. The script is lightweight, safe, and fetches all resources live from official sources. This saves you time and effort in system installation or reinstallation, especially on low-memory or cloud servers. You can also customize passwords, SSH keys, and ports during installation.
https://github.com/bin456789/reinstall