Skip to content

Instantly share code, notes, and snippets.

View ryangasparini-wf's full-sized avatar

Ryan Gasparini ryangasparini-wf

  • WebFilings
View GitHub Profile
you can run the command: "nettop -m tcp" in the terminal to show you all the tcp connections such as uploading and downloading. locate the host that is responsible for the bandwidth activity that is maxing out your internet, whether it be uploading or downloading then you can use the tool ipfw (ip firewall) to limit the bandwidth to that host. I'll use my scenario as an example. I was uploading to largedocument.com (discovered the host with nettop) I can run the following two commands to limit the upload speed to largedocument.com to 25Kbits/s by running:
sudo ipfw pipe 1 config bw 25KByte/s
sudo ipfw add 1 pipe 1 dst-ip largedocument.com
this works great! upload to largedocument.com is reduced to 25 kb/s. And then to remove the bandwidth limitation later, just run the command:
sudo ipfw delete 1
@ryangasparini-wf
ryangasparini-wf / viewer_controller.js
Last active December 11, 2015 05:19
Viewer Controller Flow
// get all books
scope.books = Books.getBooks();
// test if route included revision
if (!routeParams.bookRevision) {
// test if route included book key
if (!routeParams.bookKey) {
// take first book from the collection
scope.book = scope.books[0];
// TODO: this is where we would call updatePath for bookKey