Remote Mac Control

I need to help out my grandmother with her mac occasionally. Now it’s much easier if I can just VNC straight into her machine. Unfortunately, it’s behind a router. But that’s OK. As usual, ssh tunnels to the rescue.

Unfortunately, she’s not really capable of using the command line. So it’s out with the AppleScript!

I wanted a little icon she could click to set up an ssh tunnel. That tunnel should then be torn down when the app closes. This is what I ended up with.

  global pid
  on run
    set sshCmd to "ssh -i ~/.ssh/vnc -R 5900:localhost:5900 -N"
    set pid to (do shell script sshCmd & "</dev/null >/dev/null 2>&1 & echo $!")
    display dialog "Connected to"
  end run
  on quit
    do shell script "kill " & pid
    continue quit
  end quit

There’s a few interesting points about this.

  • You have to redirect stdin/stdout/stderr to /dev/null or do shell script will never return.
  • I didn’t realise, but you capture the output of do shell script by enclosing it in parentheses. Yes, this is basic AppleScript. but it’s all new to me.
  • The on run and on quit handlers let you do Save As... application bundle. So you end up with a clickable application.
    • on quit must call continue quit or you end up with an immortal app…
  • The ssh command itself has a couple of interesting features.
    • -i ~/.ssh/vnc uses a custom key that I set up, instead of having to rely on a password.
    • -R 5900:localhost:5900 forwards port 5900 on back to port 5900 on her computer.
    • -N means “do nothing” instead of firing up some shell on my server.

At some point, I might extend this so that there’s a Window with a connect / disconnect button. But that will involve AppleScript Studio, which I don’t have on this computer.

So now I should be able to help clear up any, errr, “incidents”. Hopefully.


En Fran├žais, s’il-vous plait

I’m in France, visiting my relations. Once upon a time I could speak French fluently. I lived there for a year. Now, my French has detoriated to the point where I can hardly string a sentence together. This is most distressing, but entirely understandable due to lack of practise.

Then, wandering through FNAC on Friday, I saw my salvation: comics! A wall of graphic novels, all in French. I drooled. I picked myself up and started some serious browsing. What better way to practise than enjoying a great story? So I’ve now got a few comics to take back and enjoy, and hopefully by the next time I won’t feel quite so much like a fish out of water.

On another note entirely, I saw a translated version of Alan Moore’s 49’ers for less than the price I paid for the English version. Shocking, I call it!


SkillSwap on Typography

Last Thursday evening, Richard Rutter gave us a talk on Web Typography Sucks. It was a hugely successful event. It turned out that there were nearly 17 of us in the small room. Richard’s talk was essentially a preview of his SXSW talk, so if you can catch it there, I really recommend it.

Richard covered various aspects of what typography applies to the web (hint: it’s not just about fonts), and how we can improve on what we’re doing. He correctly pointed out that if the sun can do it, then so can we.

I was personally really pleased because a lot of the topics that he covered are things that I’ve had to a little bit of at work, but not really clearly got my head around. I now feel ready to go forward and make my next web site far more pleasant to read.

Interestingly, I’ve just noticed this article: Web Design is 95% Typography. How serendipitous.