Slides from Cocoa Networking Talk

I have posted the slides from my talk on networking with Cocoa at CocoaConf. For those that attended: thank you! It was great meeting so many new people and having the opportunity to present.

One common suggestion for improvement from attendees was for demos. These are always tricky with networking topics, because you never know how good the Wi-Fi will be at a conference. When I give this talk in the future, I think I will split it into two, build some demos, and bring a second laptop with a cross-over cable.

CocoaConf

CocoaConf is a new developer-focused conference for Mac OS X and iOS being held August 12-13 in Columbus, OH. I am presenting a session on networking with Cocoa. It will cover the various APIs available to Mac OS X and iOS developers from Apple and third-parties, as well as touch on issues unique to using the network on a mobile platform.

Early registration opened today and you can get a conference pass for 50% off.

Apple Isn’t Earning Their 30%

Much has been said over the last 2½ years about the App Store and places where Apple is failing third-party developers. Many things have been fixed, but unfortunately, many more have been neglected or only partially addressed. On January 22, 2011, the App Store surpassed 10 billion downloads. Let’s assume 1% of those are paid and Apple only takes the minimum 29¢ for each one. That’s still $29 million. Apple needs to do a lot more to earn their 30% cut. Read More

Option-Click to Reposition Cursor in Terminal

I found this on SuperUser today and just have to share it.

In Terminal, you can reposition the cursor on a line by option-clicking where you want it to go. Credit where due.

It doesn’t happen every day, but certainly a few times a week: I end up with a monster command, spanning two full 100 character wide lines or more. Inevitably, there’s an error in there in the middle, and I sit waiting, holding down left-arrow to fix it and try again.

Adding “contrib” Extensions to MacPorts PostgreSQL

PostgreSQL is my database of choice. The main reason is that a standard distribution comes with just about everything one could ask for in a free RDBMS, and if what you want isn’t already installed, it’s often in the “contrib” directory. In particular, now that I’m doing a lot of iOS development, and location awareness is a big part of mobile apps, it’s useful to be able to work with coordinates. PostgreSQL does this using the cube data type and earthdistance functions, both in “contrib”. Read More

How to Set Up Internet Sharing on Mac OS X

These days, it’s not uncommon to be faced with the situation of having two or more Wi-Fi devices you might wish to use in a hotel room when the hotel does not provide free in-room Wi-Fi. The hotel doesn’t know that those devices are all yours and in one room, so using them means paying per device, which is crazy.

This explains how to easily set up Internet connection sharing in Mac OS X 10.6 so you can pay once, and piggyback the rest of your devices off that one laptop. These instructions assume that you have a wired Ethernet connection available in the room.

  1. Plug in your laptop to the Ethernet, pay and get it working.
  2. Go to System Preferences -> Network. Take note of the IP address, router and one DNS server.
  3. Ethernet connection settings

  4. There are three IP address ranges reserved for private use: 10.x.x.x, 172.{16-31}.x.x and 192.168.x.x. Looking at the IP address, router and DNS address from the previous step, pick one of those ranges that is unused. You’ll use this for the wireless network you create shortly. For example, the router is in 10.1.x.x and the DNS server is in 172.16.x.x, so I’ll use 192.168.x.x.
  5. You may find it easiest if you’re moving between locations to create a new network location for this Internet sharing configuration. You can do that in the Location drop-down at the top of the System Preferences window.
  6. Still in the Network part of System Preferences, choose AirPort, then click Advanced. Go to the TCP/IP tab.
  7. Pick any IP address in your chosen range, with a matching subnet mask. 10.x.x.x should use 255.0.0.0, 172.16.x.x should use 255.255.0.0, and 192.168.x.x should use 255.255.0.0. Enter the same router address you copied down from the Ethernet configuration. For this post, I’ll use 192.168.1.1.
  8. Wireless connection TCP/IP settings window

  9. Go to the System Preferences -> Sharing. Click the Internet Sharing item, but not the checkbox next to it. This should show “share your connection from” is Ethernet, and “to computers using” has AirPort checked. Click AirPort Options.
  10. Internet Sharing options dialog

  11. Pick a network name. I also recommend turning on 128-bit WEP. It’s not great, but it’s better than nothing. You need to pick a password, which unfortunately must be exactly 13 characters.
  12. Click the checkbox next to Internet Sharing and Start in the scary warning dialog that follows.
  13. From one of your other devices, you can now connect to your new wireless network. You will have to configure its IP address manually, since your Mac is not running a DHCP server to supply it.
  14. Use another, different address for your wireless device, but in the same network as the AirPort you just set up. Since it’s using 192.168.1.1, I’ll use 192.168.1.2. Use the same subnet mask, but use the AirPort’s IP (192.168.1.1) as the router. Use the DNS IP you copied down in step #2.
  15. an example of wireless network settings on an iPhone

That’s it: you should now be able to use the Internet from your wireless device, via your laptop plugged into the Ethernet.