Intercepting iOS Network Traffic

Ever wanted to write a small wrapper for an iOS app that has an undocumented API? Itching to reverse engineer how it communicates with its backend1? You're in luck! 😎 In the past, my friends and I have used this technique to figure out how to programmatically send and receive Snapchats, months after the application's release. This lead to one of the greatest stories we tell today.

To sniff an application's network traffic, we're going to use mitmproxy. It's a powerful man-in-the-middle proxy that allows you to intercept, modify, replay, and save HTTP/S traffic.

Installing mitmproxy and CA certificate

First, let's install mitmproxy (I use pip in this example but there are other install methods in their docs)

$ pip install mitmproxy

Next, we'll need to alter the proxy settings on our iOS device to point to the machine running mitmproxy:

  • Determine your computer's IP on the network

    • System preferences > Network > Advanced > TCP/IP
  • Launch mitmproxy

    • $ mitmproxy
  • Set iOS manual proxy settings

    • Settings > Wi-Fi > [select current network]
  • Install CA certificate on device

    • Open Safari and go to mitm.it, if everything is setup correctly, you should see this screen below. Install the Apple certificate.

Viewing Network Requests

Setup is done! Now the fun begins. You may have noticed the output pouring in from of the mitmproxy command you ran earlier. Those are all of the network requests your device is making! You can navigate through the requests with the arrow keys and press enter on any request to inspect it (once in the inspection mode, use h and l keys to switch tabs). If you need any additional help with possible commands, just type ?.

You're all set! Inspect away and go make that unofficial API wrapper you always wanted 🚀

1 If you find any security issues, do the right thing and let the developers know. It shows character and may even land you an interview with the company 😊

Daily List

Originally posted on Medium. Notes inserted as quotes.

Inspired by Jack Dorsey’s habit of reading a daily list, I decided to create my own Coach.me plan to achieve this goal.

Below is the list I read every morning as I leave my apartment. (I’ve added comments to provide context around a few points.)


  • “How lucky am I to have something that makes saying goodbye so hard.”
  • Do the most important thing first each day.
  • You’re worth it and you can do it.
  • Imagine your desired outcome and work backwards to figure out immediate steps.
  • Meditate on this list.

Meta, but allows you to reevaluate your list every to determine what’s important.

  • Meditate
  • Replace the word problem with opportunity.
  • Everything is worth it.
  • Love is giving someone the power to destroy you and trusting them not to.
  • Take a deep breath, remember your practice, you’ll be fine.
  • Practice mental noting.

More info on this technique

  • Live on.
  • “Pass the coat.”
  • Do small things with great love.
  • “I’m glad you exist.”

The best compliment I’ve ever received.

  • If you’re not failing, you’re not reaching high enough. Stay hungry. Be true. Dream big.
  • Every decision, experience, success, and failure in life has brought me to this moment.
  • The price of discipline is less than the price of regret.
  • “I never saved anything for the swim back.”

Reference

  • Don’t put off until tomorrow, what can be done today. Seriously.
  • Take time to reflect.
  • “Nobody cares about what you didn’t accomplish.”
  • “When you go to work and aren’t a bit nervous that you can’t possibly do your job, find a more challenging one.”

What would your daily list look like? I’d love to hear your thoughts!

Small Moments

Originally posted on Medium. Notes inserted as quotes.

My path to daily journaling

A year ago I started a routine of writing down three positive things that happened every day. It didn’t matter how small they were, as long as I hit a minimum of three. A year and over a 1,000 moments later, I ventured to expanding this habit into a daily journal.


Photos have played a big part in my life. So, the journaling tool needed to allow entries to work seamlessly with images during my trips down memory lane. This is where Day One comes in. The app is dense with features including Markdown support, locations, reminders, tags, and iCloud/Dropbox integration just to name a few.

The next app in your home screen

I also set out with the goal of attaching an image to each day that passed. While this seems hard, I’ve found that screenshots are an easy way accomplish this. Small digital moments make great memories. Examples I’ve found in my journal are random “I love you!” messages from my girlfriend, hilarious conversations on my team’s chat room, or even getting a pull request merged on day 1 of work.

My friend, @octopi, wrote a great post on the value of screenshots

Over the course of six months, I’ve managed to save 830 (~250MB) of these electronic moments that I would’ve otherwise forgotten. To make this even easier, I’ve redirected all my screenshots to a Dropbox folder for automatic backup.

I backup traditional photos via Dropbox and their most recent release, Carousel.

Day One photo stream

I now spend the last 10 minutes of each night writing my heart out and picking an image for the day. Imagine creating a slideshow with these images. You could summarize a year’s worth of memories in under 20 minutes!

(assuming 3 second transitions)

Come to think of it, I’ll make sure to write that down in today’s entry :)

Growing up with Facebook

Originally posted on Medium. Notes inserted as quotes.

and how I’m starting to grow out of it

October 30, 2007, I joined Facebook. I was 15 then, a high school sophomore. At the time, everyone was coming up with goofy statuses, poking each other, and joining funny groups. Every conversation ended with, “add me on Facebook!”

Fast forward to 2013. After multiple updates, feature additions, and interface changes, the service has become infinitely better (timeline, gifts, read-receipts, chat-heads, cover photo, etc). But, network fatigue is a core issue, e.g. seeing posts from a cousin of a friend of a friend who I met at a summer camp that I haven’t seen since. You can unsubscribe and mute certain activity from your feed, but this drives me (and my peers) towards other services.

A vehicle for discovering posts on services that I use in addition to Facebook is an app called Timehop.

Timehop is simple. Every morning is a stroll through memory lane: the app recovers and shares what you did on this exact day in history across Facebook, Twitter, Instagram, Foursquare, Flickr, and your camera roll. With this perspective, you begin to realize which posts are important and which ones were just noise. Personally, what has stuck out are the places I’ve been, thoughts, pictures, and messaging. Below are these moments—one by one:

Thinking about it, Path may have been right in its focus on moments

Foursquare is highly underrated

When it comes to the places you’ve been, Foursquare still does it best. I joined the service in Summer 2012 and have since checked in over 2,500 times.

https://foursquare.com/timemachine for some awesome stats on your account

There is a certain feeling attached to eating at a restaurant where your friend has been that no Yelp review could ever replace. Also, there are two features that are hard to live without: tips and lists. The Foursquare community fosters leaving tips at venues. If you don’t know what to order, a reliable approach is to check the tips and see what other users enjoy (even Steve Wozniak leaves tips). Lists, on the other hand,help users share their local favorites or even tell you which coffee shops have power and wifi.

Crucial acquisition

Instagram wins me over with its simplicity and attention to detail. One of the smartest design decisions is the absence of albums. This forces users to really think about which photos capture moments they care about, creating a feed where liking 10+ photos feels natural. Also, with its photo maps, I occasionally find myself scrolling over Miami to relive precious moments such as Ultra 2013.

Funny how Foursquare used to power all Instagram geo data

The global town square

Twitter’s big three: thoughts, conversations, and real-time. People often have the intention of starting a blog or journal, but it never comes to fruition. Tweets serve as a nice intermediary. By putting thoughts and experiences out there, you’re essentially creating a git commit log for your life. Conversations are also extremely rich on Twitter. Since users are on the same playing field, it’s easy for things like athletes reaching out to fans, musicians running Q&A’s, and airlines addressing customer issues to happen organically. On the other hand, it’s been noted that this open sandbox nature of the service leads to a confusing new user experience. While this may be true, the openness leads to awesome accounts like @MagicRecs, @YourAwayMessage, and @EmergencyKittens. Lastly, and most notably, there are certain moments that just happen first on Twitter. Some examples from my graph include a hacker defacing our University’s homepage, getting on stage with our favorite DJ, and presenting my final intern project.

Messaging powerhouses

VC firms aren’t making a mistake when they invest in the future of messaging. Over the past year, I’ve noticed my friends and I staying in touch through the use of group threads (iMessage for those w/ iOS and FB Messenger for groups with a mix of mobile operating systems). In fact, I use these apps so frequently that receiving an SMS almost feels archaic. Features like read receipts, quick file sharing, and quite frankly, stickers make group threads way more efficient and entertaining. Next, I want to make a quick note on the effect Snapchat has caused on my generation. Sitting in on a talk with Mary Meeker this past summer, while she gave a recap of her 2013 Internet Trends report, I couldn’t help but pause on the following slide.

Snapchat has essentially reduced the amount of time we spend trying to capture a moment, so we can start enjoying them again.


This post isn’t meant to serve as my departure from Facebook. I’ll still have an an account for some time since Facebook events, messaging, and groups are still leaders in the space.

However, much like your hometown, you eventually want to explore more cities. For sharing moments, segmented networks in tandem are better than centralization.

On Forming Habits

Originally posted on Medium. Notes inserted as quotes.

My take on building a better self

Sports involving competing against oneself have always been my fuel. Whether it was running cross country in high school or making the decision to start weight training upon entering university, I love being able to do something today that I wasn’t capable of the day before.

About two years ago, I wanted to formally take this approach with my personal habits. Initially, I used a combination of daily visits to r/GetMotivated and the web app, chains.cc.

The GetMotivated subreddit is a fantastic collection of inspirational posts and is a factor that has remained constant throughout my journey of building a better self.

“People often say that motivation doesn’t last. Well, neither does bathing — that’s why we recommend it daily.”

But, chains.cc actually served as more of a crutch than a boost.

chains.cc allows you to enter various habits and each day that you complete them, you add a day to your chain. The problem lies in its emphasis on forming long chains. Sure, not breaking a long chain is motivation to keep up a habit, but it also serves as a huge downer when you break it. So, instead of focusing on the fact that I was able to get into the gym for 20 days last month, I’m left with a stark reminder that I broke a daily streak I was on. Clearly, this perspective on habits wasn’t going to work in the long term.

That’s when I found Lift (now rebranded as Coach.me). An iOS and web app that takes a more solid approach to habits.

Lift will always be on my home row

Like chains.cc, Lift allows you to add specific habits and track them from day to day. However, in creating a better self, you are not alone. Lift buckets you with other people striving towards the same goals.

So, after checking off a habit, I often get random ‘props’ from people. While this may seem silly, the feedback loop is amazing. It’s like people giving you high fives along the marathon we call life.

Fitocracy is another great example of this prop behavior being used well

Two other key features that set Lift apart are reminders and a focus on milestones. Reminders make perfect sense.

Reminders can be set to day/time granularity

In the morning, I get pushed a reminder to use a standing desk, midday, a reminder to talk to a stranger, and at night, I wrap up with writing three positives things about today. Unlike chains.cc, milestones help alleviate the stress of breaking chains. Instead, you’re rewarded when you hit specific phases in a habit (e.g. tenth checkin or mini streaks).

Out of the habits I’ve started forming with Lift, I’d like to point out one in particular. Writing three positive things about today.

Excellent stats on this habit

40 days into it, this habit has allowed me to have a stream of consciousness like never before. Whether I just feel great after a workout or make an awesome first impression, I constantly look for the gems in life. Imagine looking at this log just a year from now, 1095 things that made your days amazing.


These are a few of the tools I use to build a better self. I’m still learning, tweaking, and testing my approach. But, that’s the beauty of it. Becoming better than you were yesterday is not merely a habit, it’s a way to live life.

Who knows, this may be my first post towards a habit of writing?