port

    Linux - 특정 포트를 사용하는 프로세스 죽이기

    명령어sudo lsof -i :포트번호 | awk 'NR>1 {print $2}' | xargs sudo kill -9# Ex. sudo lsof -i :80 | awk 'NR>1 {print $2}' | xargs sudo kill -9

    Linux - 80 포트 접속 시 8080포트로 바인딩, 규칙 삭제

    명령어# 바인딩 명령어sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080# 규칙 삭제 명령어sudo iptables -t nat -D PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080주의사항80 포트와 8080 포트가 모두 열려있는지 확인 해야한다.

    js - 현재 페이지 url 관련 (location 객체)

    1. 자주 사용하는 location 객체 // Ex) https://test.com:80/newpost?type=post window.location.href // Ex) https: window.location.protocol // Ex) test.com:80 window.location.host // Ex) test.com window.location.hostname // Ex) 80 window.location.port // Ex) newpost window.location.pathname // Ex) ?type=post window.location.search 2. 참고 https://hianna.tistory.com/464