Handy Technical

iPhone 4 and the world

Interesting experience today: every single Apple Store in New Jersey was sold out of the iPhone 4 today. I know because I called them all.

A couple things: One, congrats to Apple. New Jersey today is hardly a representative sample but so-called “antennagate” doesn’t seem to matter in the state. Two, I got to experience first hand with building incredulity over each successive call how much people don’t care about the inherent inferiority of American-sold iPhones. What do I mean?

At first glance the US price appears to be the cheapest, but you’re locked into a 2 year contract with a $350 early termination fee. Much worse, the phone is artificially locked to AT&T’s network. If you want to travel, count your blessings that an unlock was released yesterday but it is of course temporary and will be assuredly be patched by Apple. (Unlocked phones are different from jailbroken phones.

Cool Handy Music Technical

Stream your iTunes from home

Want to listen to your iTunes music at home from work, a coffee shop, etc?

It takes two steps: setup an SSH tunnel and forward zeroconf (‘Bonjour‘) traffic.

If you do it my way everything is already installed on your Mac and, especially nice for you corporate folks, doesn’t require admin privileges.
Windows users, you’re not necessarily SOL but Windows doesn’t ship with what you’ll need.

I use this technique on Snow Leopard, but I think it will work on Tiger and higher.

  • Enable SSH on your home computer.
    System Preferences->Sharing->Remote Logon
  • Enable iTunes Sharing.
    Preferences->Sharing->Share my library on my local network
  • Still from your home computer, browse to (or whatever your router runs on) and enable SSH port forwarding if you haven’t already. This technique definitely won’t work without this step.
  • Protip: Optionally, register your public IP with a free Dynamic DNS service so you only have to remember a single domain name.
  • At your work machine, go to a terminal and use the following two commands:
    dns-sd -P "myTunes" _daap._tcp. local 3689 localhost &
    ssh -N -f homeComputer -L 3689:localhost:3689

    The -N means non-interactive, the -f means go to the background.
    The -L xxx:hostname:xxx enables a tunnel on the iTunes sharing port (3689).
    homeComputer is your router’s public IP address, or the domain name you hopefully setup earlier.

  • To clean up when you’re done, you can run a
    killall ssh dns-sd

Finally, if you’re cool enough to keep your music on a Linux machine, you can also use this technique with Firefly formerly (mt-daapd).

Handy Technical

Reference: screen sharing in Snow Leopard

Posted originally for my personal reference, but since my Mac tips get lots of Google hits hope this is useful to you too.

Screen Sharing on Mac OS X Snow Leopard – very convenient to have built-in*, and I use it to logon to my Ubuntu server when the CLI doesn’t cut the mustard – infrequent, but it happens.

If you’re like me, you occasionally get an unexpected blank or white screen when you connect to your other computer. It turns out the mouse and keyboard pass through just fine but the display is all white. Fix it by getting info on Screen and ticking the ‘Open in 32-bit mode’ box.

* Technical addendum: I would be remiss to sing accolades of the VNC-based Screen Sharing without mentioning Microsoft’s [Citrix] Remote Desktop. It’s significantly faster than VNC due to some sweet implementation differences – to my knowledge when you connect to the Windows host it switches to a special display driver that sends small drawing instructions over the tubes that are subsequently recreated on your client. VNC, while open source and commensurately ubiquitous in Unix/Linux/Mac land, is not so smart and blindly sends a compressed image of the screen. Just sayin guys – Remote Desktop is awesome.

General Technical

Speaking of speed…

I really don’t like waiting, especially when I can avoid it. Therefore, when I got tired of waiting for my computer recently I did something about it.

On SSH and passwords

The average ssh logon time consumes what feels like 3-4 seconds on my 2007-era machines. The delay has worsened since Ubuntu 0910, which now retrieves system information on logon (in its default form, nearly useless to me). I really like the idea of seeing useful info at logon time, but bottlenecking logon – the most common act that happens – for multiple seconds is unacceptable. If you’re like me, just use your own script instead of landscape:

apt-get remove landscape-common

I banged out some bash that runs nearly instantaneously and shows only what I actually care about, and it only took some lines in .profile. simple version:

echo 'df -h' >> ~/.profile

Finally for a really good one that totally pays for itself: think about how many times you type in a password. The net time saved by not having to spend a few seconds typing in your password each time is huge.

echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config

It’s called public key authentication in SSH, and it’s one of the best kept SSH secrets.


Decent speed boost

Just finished optimizing the page load time by recompressing several large JPGs that used to be part of every page that had a sidebar (i.e. most pages on this site).

Load times are down to an average of about .983 sec from about 1.8 sec before. Hooray for more speed.