Skip to content

Instantly share code, notes, and snippets.

@Olical
Created April 21, 2015 16:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Olical/bb7c888748b57f11c6ed to your computer and use it in GitHub Desktop.
Save Olical/bb7c888748b57f11c6ed to your computer and use it in GitHub Desktop.
Throttle your localhost. (for Linux)
#!/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
#!/usr/bin/env bash
sudo tc qdisc del dev lo root netem delay 500ms && rm /tmp/throttle-check
#!/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