Skip to content

Instantly share code, notes, and snippets.

@oaltman
Last active December 20, 2015 08:09
Show Gist options
  • Save oaltman/6098247 to your computer and use it in GitHub Desktop.
Save oaltman/6098247 to your computer and use it in GitHub Desktop.
Spuštění build-in serveru a prohlížeče z terminálu (na pozadí)
# ~/.bashrc
# Spusti php built-in server a otevre prohlizec
function psrv() {
PORT=8888
ADDRESS='localhost'
BROWSER="chromium-browser"
[[ -n "$1" ]] && PORT=$1
[[ -n "$2" ]] && ADDRESS=$2
[[ -n "$3" ]] && BROWSER=$3
nohup php -S "localhost:$PORT" &
$BROWSER http://$ADDRESS:$PORT
}
# Zastavi vsechny php servery
function ksrv() {
kill -8 `pgrep php` 2>/dev/null
}
# Examples:
psrv
psrv 8800 localhost firefox
psrv 8800 localhost chromium-browser
ksrv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment