Skip to content

Instantly share code, notes, and snippets.

@yanyaoer
Last active December 11, 2015 03:09
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 yanyaoer/4535750 to your computer and use it in GitHub Desktop.
Save yanyaoer/4535750 to your computer and use it in GitHub Desktop.
Alfred Extensions: set bandwidth limit,
#!/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