Tuesday, August 26, 2008

Capture packets on a Mac

Mac OS X 10.5.4

For some reason, Wireshark keeps crashing X11 on my machine, so it isn't an option. If you have the same problem, here is how to capture and decode HTTP traffic from the command line, using tcpdump:

tcpdump -n -i en1 -s 0 -A port 80 and host www.yahoo.com

Options:







-nDon't convert addresses to hostnames
-i en1Interface to listen on. en0 is the wired interface and en1 is the wireless on a MacBook Pro
-s 0Snarf the required length to catch whole packets
-APrint each packet (minus its link level header) in ASCII
<expr>Packet match expression. My example of port 80 and host www.yahoo.com says to only print packets that have a source or destination port of 80 and a source or destination host of www.yahoo.com. There are many other qualifiers, such as portrange, net, src, dst, inbound, outbound, ether, fddi, ip, ip6, arp, tcp, udp. See the manual page for more info.


For more info, at the terminal, type man tcpdump

Wednesday, August 13, 2008

Setting Up Gmail To Work With Blackberry (BIS)

Tested with: Gmail (or Google Apps), Blackberry 8830, Blackberry Internet Service (BIS)

This does not apply to Blackberry Enterprise Server (BES). If your company has given you a Blackberry and it works with Exchange, Lotus Notes, or Groupwise, then you are operating in BES mode. You'll need to make sure your cell company has set up BES and BIS on your Blackberry for this to work.

I've used my Blackberry in many different scenarios: with Lotus Notes (BES), Microsoft Exchange (BES), and now I've moved to Google Apps, which allows me to receive mail for free at my address nospam@heatery.com. This tip walks you through the steps I went through to make sure that all my email shows up on the Blackberry and all replies from the Blackberry show up in Gmail. Also, new messages appear on your Blackberry as soon as they appear in your Google inbox (push email).

Step 1: Blackberry Setup

  1. Sign into your provider's Blackberry site (or create a new account):

    AT&T: http://www.att.blackberry.com

    Alltel: http://www.alltel.blackberry.com

    T-Mobile: http://bis.na.blackberry.com/html?brand=tmobile

    Verizon: http://bis.na.blackberry.com/html?brand=vzw

  2. On the email accounts screen, you'll see your blackberry email address (for example, johndoe@att.blackberry.com). To the right, click Edit
  3. Change "Reply to:" to whatever your Gmail or Google Apps email is. For me, this is johndoe@heatery.com. This causes any mail you send from your Blackberry to look like it came from your Gmail or Google Apps account. If you skip this step, email will appear to have come from johndoe@att.blackberry.com
  4. Change "Your name:" if you want to
  5. Change "Auto BCC:" to your Gmail or Google Apps email address. Your "Reply-to:" and "Auto BCC:" fields should have the same address. Auto BCC causes a copy of any messages you send from your Blackberry to be sent to your Gmail or Google Apps email.
  6. Click Save


Step 2: Gmail Setup

  1. Sign into Gmail
  2. Click Settings (in the top right hand corner of the screen)
  3. Click the Forwarding and POP/IMAP tab
  4. Select "Forward a copy of incoming mail to"
  5. Enter your Blackberry email address (like johndoe@att.blackberry.com)
  6. Make sure the option "keep ____ Mail's copy in the inbox" is selected




Interested in syncing your Google Calendar with your Blackberry?

How about syncing your Google Calendar with iCal on your Apple computer?

You could also sync your Google Calendar with Mozilla Sunbird

Syncing your Blackberry's calendar with your Google Calendar

Tested with: Gmail (or Google Apps), Blackberry 8830

Tired of maintaining two or more calendars? Maybe you only keep your calendar on your Blackberry. If so, this tip will backup your calendar to a Gmail (or Google Apps) account. If you use Outlook 2003 or 2007 on your Windows desktop, you could then install Google Sync for Outlook. With both Google Sync for Outlook and Google Sync for Blackberry installed, you can enter something in your Outlook calendar and it will get pushed to your Blackberry in a few minutes. Changing or adding calendar items on the Blackberry also gets pushed back to Outlook.

If you use a Mac (which I recommend), you'll need to use iCal or Mozilla Sunbird. There may be others that support CalDAV, I just haven't tested them yet.

Installing Google Sync for Blackberry

  1. On your Blackberry's browser, visit m.google.com/sync
  2. Click Install NOW
  3. Click Download. The Blackberry will say "Downloading Google Sync"
  4. Once installation is complete, a dialog box will appear.
  5. Click Run to start Google Sync
  6. Enter your Google email address and password
  7. Click "Sync Now" to start syncing
  8. When the sync is complete, click Dismiss. You should still be in the Google Sync for Mobile program. If not, go into your Blackberry Calendar, press the Menu button, then select "Google Sync"
  9. In the Google Sync program, press the Menu button, then select Options
  10. Here you can change options related to syncing. Don't change "When to Sync" (should always by Automatic). You change change the conflict resolution option. For "Sync Events for next" I recommend 24 weeks.
  11. When done, press the Menu button and select Save


Note that calendar syncing occurs on a schedule (every 10 minutes) and is not a push solution. If you need true push, look into Blackberry Enterprise Server.

Enabling Google CalDAV for Mozilla Sunbird

Tested with: Gmail (or Google Apps), Mac OS X 10.5.4, Mozilla Sunbird 0.8

Google recently enabled CalDAV access to Google Calendars. It works with Sunbird, but the documentation on doing this is hard to find. So here is how to do it, step by step.


  1. Download and install Sunbird on your Mac.
  2. Open Sunbird
  3. Click File, then "Subscribe to Remote Calendar..."
  4. When the "Create a new calendar" dialog box appears, select "On the Network" and click Continue
  5. For Format, select "CalDAV" and for Location, enter "https://www.google.com/calendar/dav/YOUR_GOOGLE_EMAIL/events" (without the quotes)
    For example, assume your Gmail address is johndoe@gmail.com, then your Location would be https://www.google.com/calendar/dav/johndoe@gmail.com/events
    Let's assume you have Google Apps and your email is bill.jones@jonescorp.com, then your Location would be:
    https://www.google.com/calendar/dav/bill.jones@jonescorp.com/events
  6. Click Continue
  7. Next, your are asked to name your calendar. For mine, I just typed my first name. You can choose a color for calendar entries here and choose if your want alarms to go off in Sunbird. Click Continue.
  8. Click Done.



That's it. By default, Sunbird will refresh remote calendars every 30 minutes. If you want to change this, go into the Preferences (Command ,)

Since Google CalDAV syncing is in beta, you should direct all your questions to Google Groups - Calendar Help Dataapi