Last active
December 11, 2015 03:09
-
-
Save yanyaoer/4535750 to your computer and use it in GitHub Desktop.
Alfred Extensions: set bandwidth limit,
This file contains hidden or 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
#!/bin/bash | |
# USEAGE: | |
# slowy "remove latest limiter | |
# slowy 20 "set limiter as 20KByte/s for 80 port | |
# another choice (http://slowyapp.com/) | |
if [ {query} ]; then | |
sudo ipfw pipe 1 config bw {query}KByte/s && sudo ipfw add 1 pipe 1 src-port 80 | |
echo 'bandwidth.max is {query}KByte/s for 80 port' | |
else | |
sudo ipfw delete 1 | |
echo 'bandwidth limit removed' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment