Jul 2, 2008 Jul 4, 2008 Thursday July 3, 2008
-
Tales From The Command Line: Where Has My Bandwidth Gone? (iftop &Â SurplusMeter)
I believe I can safely say that the primary objective for users running OS X is to connect to the Internet to read mail, check out web sites, chat with friends, download new apps or grab/share multi-media content, etc. With bandwidth caps staring to become all the rage by the mega-providers, knowing how much you are consuming may be critical knowledge to hold back the costs/fees on your monthly bill. This post covers two of three key programs for managing bandwidth: iftop (a command-line utility) and SurplusMeter (a GUI tool). The third utility - lsof (another command-line utility) - will require a dedicated article in-and-of itself. How Much Am I Consuming? SurplusMeter is a small tool from the fine folks over at SkoobySoft with one mission: to show you how much bandwidth you are consuming with the option to enter any known caps to ensure you are not over your limit. You can download SurpluMeter directly from their site. It is a PPC binary compatible down to OS X 10.3.9. For those who want to live life on the wild side, you can grab the source code and compile it yourself. I have built an OS X 10.5 compatible Universal Binary version which you can download via this post. No matter which way you decide to go, it is important to copy the application to your local volume as it runs an agent program - which runs in the background collecting bandwidth data - that will make it difficult to remove mounted volumes if you keep it running. The main view of SurplusMeter is fairly straightforward. You can set which day to start the monthly tracking period on and specify your known bandwidth cap - which can also include upstream usage. Monitoring can be paused if you know you will be moving between networks, the collected data can be reset and you can even choose which interface to monitor via their “English” names vs OS X short device names (e.g. “Ethernet port” vs “en0“). For my example, I did a short sample of bandwidth on my AT&T 3G ExpressCard, hence the PPP modem selection. If there were hiccups during program execution or you know of other bandwidth usage on your connection not emanating from your Mac, you can add bytes to the current data collector. Similarly, you can also remove bytes if you were measuring data on an interface that moved between networks. SurplusMeter is kind enough to store its data in ~/Library/Application Support/SurplusMeter/surplusmeter_data.plist in a very human- and machine-readable format (a well-annoted Apple plist) so you can do what you like with it: In general, it is a great, special purpose utility to have around. What's Going On Here? SurplusMeter tells you that you are using bandwidth, but does not provide any further details. This is where tool number two - iftop - comes into play. You can grab a pre-built package of iftop (”interface top”) from AFP548.com or grab the source and try your hand at building it (you may need to download some support libraries). Users of various “ports” tools should be able to find iftop in one of the repositories. Where the command-line tool top provides a mechanism for determining what processes are consuming precious system resources (in a very similar fashion to the Activity Monitor application), iftop does something similar for network usage on a particular interface. You will need some more technical information to run iftop successfully. First, you will need to know which network interface you want to monitor. To find out which interfaces you have on your system, open Terminal.app and run the command: ifconfig -l My output from that shows: lo0 gif0 stf0 en0 fw0 en1 vmnet8 vmnet1 ppp0 Interface en0 generally is equivalent to “Ethernet” and en1 is usually equivalent to your AirPort card. ppp0 would refer to most modems, including 3G cards. Additional interfaces may be related to a VMware or Parallels install, your local firewall interface or other local types of network devices. With Terminal.app open, run iftop -h to see what the command line options are for the tool: Synopsis: iftop -h | [-npbBP] [-i interface] [-f filter code] [-N net/mask] -h display this message -n don't do hostname lookups -N don't convert port numbers to services -p run in promiscuous mode (show traffic between other hosts on the same network segment) -b don't display a bar graph of traffic -B Display bandwidth in bytes -i interface listen on named interface -f filter code use filter code to select packets to count (default: none, but only IP packets are counted) -F net/mask show traffic flows in/out of network -P show ports as well as hosts -m limit sets the upper limit for the bandwidth scale -c config file specifies an alternative configuration file For this example, the most useful options are “-i” to let us choose which interface to monitor and “-P” to show which ports are in use. The tool requires elevated privileges to work so you have to run the following to start your view: sudo iftop -P -i ppp0 (again, replace “ppp0” with “en0” or “en1” or whatever interface you need to monitor). You should see something similar to the following screen upon successful execution (minus the annotation): The main part of the display lists, for each pair of hosts, the rate at which data has been sent and received over the preceding 2, 10 and 40 second intervals. The direction of data flow is indicated by arrows, . So in this example, where I started iTunes just after kicking off iftop, we can see that: 166.129.237.160 (my local machine) made a series of http (web) requests to Apple servers some of Apple's servers do not resolve from IP addresses to host names the average transfer rate over 40 seconds is between 0.2 kilobytes and 9 kilobytes per second After quitting iTunes and running for a while, then letting it sit “idle” (not actively doing network activity), you can see that the pattern of usage can change dramatically. While iftop can let you see more of what is going on, it cannot tell you which applications or processes are causing the usage. You can infer quite a bit (i.e. http traffic is most likely coming from your browser - but this is not necessarily the case as shown by the last screen), but finding out core details is where lsof can be of real value and will be covered in our next installment. While I have presented a free way to monitor bandwidth usage, Guy Meyer has a set of tools - Net Monitor & Net Monitor Sidekick which do something similar but are not free (the Sidekick program is in beta which is expired so I was not able to test it). If you are using any of these or similar tools to monitor bandwidth utilization, drop a note in the comments to share your insights with TAB readers and keep an eye out for our post on lsof!
-
Found Footage: iPhone 2.0 firmware walkthrough, iTunes 7.7 screenshots
Filed under: iPod Family, Software, Found Footage, iPhone, App Store Gizmodo has posted a video demoing the new iPhone 2.0 (build 5A345) firmware. In the video they mainly show the new features: Fetch New Data option, Parental Controls, new BCC field when you type an e-mail, and the scientific calculator. The AppStore icon was on the home screen, but wouldn't launch because it has not been activated as of yet. In addition to the video walkthrough, Gizmodo also posted 4 screen shots of iTunes 7.7. One of the screenshots reveal a "Look for iPhone & iPod touch Remotes" checkbox in the Advanced > General section of iTunes preferences -- something we had mentioned in an earlier post.Read | Permalink | Email this | Comments
-
Three Weeks with Delicious Library 2
About three weeks ago, I finally upgraded to Delicious Library 2. It is definitely a slick program. The greatest addition for me was the ability to add my gadgets to my library. It just makes sense to be able to add all my electronic gear. You can add items in nine categories: books, movies, music, software, videogames, toys, gadgets, tools, and apparel. Sadly, the software Delicious Library 2 cannot be added via the lookup tool: What I don't like There are two ways to add an item to your library, through the iSight, and through a search box like the one pictured above. It uses Amazon search, and it lets you add just about anything that you can buy on Amazon. I am not sure how Shipley designed the search for Delicious Library 2, but when I tried to add my Nintendo Wii to the library, it brought up every accessory you can buy, but failed to show me the actual Nintendo Wii. I was able to find a couple Wiis with some additional accessories, but that was about it. I don't have the box anymore, so I couldn't just scan it (which is the case with most of my electronic gear). The good news is that I was able to add component cables for my Wii to my library, as well as extra Wii remotes, classic controllers, nunchucks, grip covers, and remote charging stations. There are some frustrations with searching, though. In Delicious Library 1, you could search by ISBN (which was probably because the iSight scanning did not always work). But now, in Delicious Library 2, you can't. It is very frustrating to know the ISBN but not be able to use it to search. It is probably easier to search with keywords, but sometimes the results listed are far too broad and varied for it to be that worthwhile. I wish the option to add was as simple as this: You can also publish your shelves to the web. I published mine to my iWeb site, and it looked pretty good. The only drawback is that it did not include links to Amazon, so if someone were viewing my library, and wanted one of my books, they couldn't just click on the title and get to the book. They would have to copy and paste, or just look the book up. That seems like a big oversight. What I do like Although the release notes for this version say that the algorithm for scanning with iSight is only “slightly improved” it is far better than Delicious Library 1. I scanned the same book in both, and got a much faster scan time for Delicious Library 2. I waved it all over the screen on version 1, but with version 2, I put it right in the guides, and scanned it before it was actually lined up all the way in the guides. That makes for much faster adding of items. I also tried it out with an external USB webcam, and that worked just as well. That made it very easy for taking it to my bookshelves, instead of bringing all my books to my computer. Visually, it rocks. When you add an item, a “container” fills up with colored circles that becomes your item. Your items shatter or go up in flames when you delete them, as shown below. Perhaps the best feature for the kids out there is the ability to export your library (or just selected shelves or items) to a bibliography. In college, I used EndNote for my citation needs, and if this were available, it would have been much easier. EndNote requires you to type in every single thing about your book, and only just recently came out with a very poor online search tool that doesn't get the correct info 95% of the time. Bibliographies are available in the following formats: AMA, Turabian, APA, CBE, Chicago, and MLA. For college students who do a lot of writing, it is definitely worth the $40 or $20 (for an upgrade). In conclusion, Delicious Library 2 is most beneficial in that it provides a record of most things that you own, and it does it in a fun way. It is actually exciting to feel like you are a checker at a store as you scan items into your library. I finally have the itemized list of stuff that I need to show the insurance company if anything ever happens. Everything I buy from now on will go right into the library, so I can have a record of it. This is a good program for those who want to catalog their stuff and have a record on the web (or iPod) that you can get to if you need it later. Delicious Library costs $40 for a new license and $20 for an upgrade from 1.5 at delicious-monster.com
-
Wallpaper Clocks
Filed under: Freeware I was on the hunt today for a clock application and ran across an interesting implementation in Wallpaper Clock. Basically it's a small application that dynamically redraws your Desktop every minute, to keep your time and date, well, up-to-date. The application itself is free, but requires particular artwork files in a variety of designs. Some of these clock files are available in a free, low-quality version, while others are only available to registered users (along with the free ones in higher-quality versions). It is also possible to create your own Wallpaper Clocks with your own images.Wallpaper Clocks is a free download however there is a registration fee for subscription based access to the maker's website with artwork unavailable in the free version. Subscriptions are $8.99 for 3 months, $12.99 for 6 months, $19.99 for one year, and $29.99 for lifetime access.Read | Permalink | Email this | Comments
-
Renew your old iPhone with Flipswap
Filed under: iPod Family, iPhoneYesterday, we asked iPhone owners who intend to upgrade just what they'll do with their 1st generation iPhones. Thousands of you answered, with Ebay drawing the top score.Of course, Ebay will be flooded with iPhones soon, so consider alternatives like Flipswap. They offer cash for iPhones (and other model phones) and even pay for shipping. Once they've gotten your phone, they put it back in use.If you're the environmentally consicous type, you'll appreciate this. Phones that cannot be put back into use are disposed of, piece by piece, in "...the greenest methods available today." Also, in lieu of cash, you can trade in your dead phone for a tree as part of their reLeaf Program. Flipswaps estimates they'll plant up to 25,000 trees this year (they take old iPods, too!). It's free, easy and definitely worth the consideration. [Via Lifehacker]Read | Permalink | Email this | Comments
-
Core Animation tutorial screencasts
Filed under: Developer The Pragmatic Bookshelf has published a series of Core Animation tutorials, that are available for purchase and download. These four screencasts walk you through the process of building Xcode projects and incorporating Core Animation features into them. Each tutorial runs for about a twenty to thirty minutes and includes a live voice over by developer Bill Dudney. They take you step-by-step through the development process for several projects. Don't look for a general overview of Core Animation and the technology behind it in these videos. They take it for granted that you know the vocabulary (such as layers and timing functions) and that you understand what Core Animation should do. The videos help you to move that knowledge into Xcode. These videos are best for the self-reliant programmer who's looking for a little bit of low-cost hand-holding while getting started. Each of the four tutorials cost five dollars and are available in both full-screen and iPod-compatible resolutions.Read | Permalink | Email this | Comments
-
Scribblet: menubar scratchpad
Filed under: Freeware I often find myself in need of a the digital equivalent of a scratch pad: just an open text-field to jot down a phone number, save some text for a blog comment, etc. These are not really things I want to save, so I don't want to open a word processor or even use the snippet manager of my choice (Yojimbo). So Scribblet appeals to me in its focus on one basic task. (I've never been a fan of Stickies.)It's a menubar application that does one simple thing: pop up a small notepad; that's it. It doesn't allow for multiple notes or snippet management. It's simply a scratch pad that pops up with a simple click on the menubar or by hitting a user-definable hotkey. Despite, or rather because of, its simplicity I find it quite handy and it has earned a spot on my menubar. Scribblet is a free download from not salad.Read | Permalink | Email this | Comments
-
Google Talk for the iPhone
Filed under: Internet Tools, iPhoneGoogle has just announced Google Talk for the iPhone (and iPod touch). You won't have to wait for the App Store to use it, since this is a web app designed for the iPhone's browser (remember when Apple wanted us to believe that web apps were just as good as fully native apps? My how times have changed).All you have to do is point your iPhone to www.google.com/talk and soon you'll be chatting away with your Gmail contacts. Since this is a web app, Google Talk for the iPhone only works when it is the active window in Mobile Safari. Close the web broswer, or switch to a different window and you'll show up as unavailable in Google Talk.[via Lifehacker]Read | Permalink | Email this | Comments
-
Regarding ‘Wall-E’ and Kids
Tyler Cowen on Wall-E: Better than better than good. It is, however, not recommended for children. I have no idea why not. My four-and-a-half year-old son loved it. Rapt attention the entire time. That large stretches of the film have no dialog whatsoever does not make it difficult for children to follow. If anything, I’ve found that Jonas is much better at following stories which are told cinematically than those which are told verbally. I’d go so far as to say it’s the best film for small children that Pixar has made since Toy Story 2. The film is so good overall that it makes me wonder whether the Academy will have the balls to nominate it for Best Picture, rather than relegating it to the ridiculous and artificial “Animated” ghetto. ★
-
TripLog/1040
Check out the UI on this upcoming iPhone app from Palm OS developer Stevens Creek Software. This is not a joke. (Via Macworld.) ★