Created
April 21, 2015 16:44
-
-
Save Olical/bb7c888748b57f11c6ed to your computer and use it in GitHub Desktop.
Throttle your localhost. (for Linux)
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
#!/usr/bin/env bash | |
if [[ -f /tmp/throttle-check ]]; then | |
echo "Currently throttling at $(cat /tmp/throttle-check). (throttle-off to stop)" | |
else | |
echo "Not currently throttling. (throttle-on to start)" | |
fi |
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
#!/usr/bin/env bash | |
sudo tc qdisc del dev lo root netem delay 500ms && rm /tmp/throttle-check |
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
#!/usr/bin/env bash | |
if [[ -z "$1" ]]; then | |
echo "You must pass a throttle time, 200ms, for example." | |
else | |
sudo tc qdisc add dev lo root netem delay $1 && echo $1 > /tmp/throttle-check | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment