Last active
December 20, 2015 08:09
-
-
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í)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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