Monday, July 16, 2012

Requests

At Hacker School, there is a week where we all divide into groups, choose an open source project, and make a contribution. Group sizes vary based on interest in a project and you can have subgroups within the groups.  My group chose to contribute to Requests, an easy to use HTTP library in Python.

We submitted a couple of documentation patches and a few code patches:

1) Documenting SSL client certs

2) Documenting Logging

3) Differentiate between two different types of Timeout errors. Before fix, two types were presented as one.

4) Fix infinite loop on wrong Digest Authentication

5) Add needed casts when POSTing data and files

Friday, July 13, 2012

Emoticons!

I didn't know you can express yourself with emoticons on github until I saw this on one of my Pull Requests:

:sparkles::cake::sparkles:

Thanks Kenneth for bringing this to my attention :)

Checkout this sheet for some ideas.

I think my favorite might be the squirrel wearing the Fedora hat :)

Sunday, July 1, 2012

Debugging iOS Network Traffic Remotely

In iOS 5, Apple added a remote virtual interface tool that allows you to capture network traffic received by an iOS device from your computer. This is super helpful when debugging media applications, and you need to see what packets are actually received on the device. Thanks Apple!

For this you will need:
  1. MAC computer (I had Xcode 4.2.1 when I tested this)
  2. USB to iOS device connector
  3. A iOS device (must be iOS 5+)

Instructions are easy!
  1. Plug the iOS device into your MAC.
  2. Launch iTunes, and click on Serial Number once. It will turn into UDID. Command-C to copy
  3. From a terminal, type the following:
%rvictl -s [device's UDID]

Starting device [device's UDID] [SUCCEEDED]

To see a list of all virtual devices, use the command below:
%rvictl -l

Current Active Devices: (Example)

 [1] 0a439a06d606d6a293ead9b44546b7fb86110e70

Now, a virtual interface has been created for your iOS device. To double check this, run 'ifconfig'. You should see a line in the output similar to below:
%ifconfig
rvi0: flags=3005<UP,DEBUG,LINK0,LINK1> mtu 0

You can now launch 'Wireshark' and start capturing on interface rvi0. You should see a capture of all network packets received and sent by that device. The device does not need to be jailbroken.
You can capture your MAC computer's network traffic as well if you'd like. Just launch a second instance of wireshark. You can do so from the command line:
%wireshark -i [interface]

An alternative I found on the internet for capturing network traffic from devices (though I haven't tested this):
  1. Plug your mac into a wired network connection
  2. Enable internet sharing from your wired network connection to your wireless network connection.
  3. Have iOS devices connect to the new network available from sharing.
  4. Point wireshark at your wireless NIC and run captures.