Иногда бывает ситуация когда 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
#HawkerHeritage📢 Originally the Seng Poh Road Market in 1951, Tiong Bahru Market served as a bustling centre for the community. Next time you’re there for a meal, don’t forget to soak up the history & nostalgia!
#OurHawkerCulture#OurHawkerCentres
#HawkerHeritage Fancy A Feast in a Garden 🌴? Since 1971, Newton Food Centre hawker has been serving up Singapore’s culinary diversity with its unique 'garden city' charm. Forward this post to someone who’ll appreciate this picturesque setting!
#OurHawkerCulture#OurHawkerCentres#HawkerHeritage
#HawkerHeritage📜 Tekka Centre: Let’s time-travel back to 1915, where 'Kandang Kerbau' and ‘Tekka’ tell tales of cattle and wild bamboo. What a journey for the senses!
#OurHawkerCulture#OurHawkerCentres
#HawkerHeritage🌟 People’s Park Food Centre: A Culinary Heritage Site 🌟 Starting as a hawker shelter in 1923 and evolving into the largest market by 1940, it's a place where history and cuisine meet. Share this with someone that you’ll like to explore this iconic food haven with!
#OurHawkerCulture#OurHawkerCentres
#HawkerHeritage🍲✨ Experience a rich blend of history and culinary excellence at Singapore's largest hawker centre: Chinatown Complex Market! Established in 1981 for the last of Chinatown’s street hawkers, it's now a vibrant gastronomic haven with around 700 stalls. Share this with your favourite foodies!
#OurHawkerCulture#OurHawkerCentres
#HawkerHeritage Changi Village Hawker Centre: From a military past to a seaside food haunt 🌴#DidYouKnow This dining spot was part of Changi's transformation into a resort? An idyllic memory to savour with your favourite hawker delights!
#OurHawkerCulture#OurHawkerCentres
#HawkerHeritage Architectural elegance meets culinary delight at Old Airport Road Food Centre 🍴🏛️#DidYouKnow that its modern structure was designed in '73 to match the housing estates in the area?
#OurHawkerCulture#OurHawkerCentres
#HawkerHeritage#DidYouKnow Adam Road Food Centre is nine-sided and almost circular? This popular spot is famous for its nasi lemak and a variety of delightful treats! This is your sign to organise that makan trip🍴
#OurHawkerCulture#OurHawkerCentres
❤️#HawkerHeritage❤️#DidYouKnow that Maxwell Food Centre was once a wet market? It was also one of the places where the poor and displaced could find cheap meals after WWII. Today, it’s a treasure trove of local delights!
#OurHawkerCulture#OurHawkerCentres