-
-
Save gusgollings/178001 to your computer and use it in GitHub Desktop.
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
# Make port 80 "real life" speeds | |
# You can also use Mongrel ports. | |
function slow_port { | |
# Set the port variable if no port inputted. Defaulted to 80 (for Passenger). | |
if [ -z "$1" ] | |
then port=80 | |
else port=$1 | |
fi | |
# Slow the ports. | |
sudo ipfw pipe 1 config bw 15KByte/s | |
sudo ipfw add 1 pipe 1 src-port $port | |
sudo ipfw add 1 pipe 1 dst-port $port | |
echo "Port $port succesfully slowed." | |
} | |
function unslow_port { | |
sudo ipfw delete 1 | |
echo "Port succesfully un-slowed." | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment