nick.recoil.org

AppleTV & Ubuntu hacking (0)

I’ve finally enabled SSH on my long dormant AppleTV, and am integrating it into my DVB / Rails / Beanstalk / MySQL system for processing data. I’ve used the Patchstick image available from atv4windows. I ended up unpacking and dd’ing the image from the Mac, but the process remains exactly the same. I now have Perian, ssh and a slew of other things enabled, and all I need now is to attempt the hack to get composite output working. I’ve yet to take the plunge and replace my old CRT with an LCD TV.

Incidentally, for anyone looking to figure out the ssh username and password for your freshly enabled ssh daemon, they are both frontrow, and that user has passwordless sudo privileges.

I also had a minor breakthrough with my x86_64 Ubuntu 8.04 machine. I have a Zyxel G-202 Wireless USB stick, to keep the number of trailing wires to a minimum, but I kept getting an error saying:

1
zd1211rw error ioread32(CF_REG1): -110

Which was exceedingly unhelpful. I eventually tried disabling hi-speed USB from the BIOS, and rebooted to find it sprang into life immediately. Great! What was even more strange that when I rebooted and reset the BIOS back to enable USB 2.0, the G-202 kept working. I’m unsure whether this is due to the device not being cold booted, and I’ve yet to see if it stops working after I power the system off, but so far so good, and I don’t need to resort to NDIS.

MacPorts contributions

I’ve been accepted as a committer to MacPorts, initially to look after beanstalkd, but I’ll hopefully extend what I contribute to. I’ve been a consumer of Macports (née Darwinports) for a long while, and use it regularly to create my local development environment on the Mac. As of today, I have 98 ports installed, from ImageMagick to zlib, and I’m happy to be giving back some effort to something I get so much value from.

Stalling Wi-fi uploads on Mac OS X 10.5.2

I was sitting in my local wifi-enabled cafe in London for the first time yesterday, and was struck with a peculiar problem. I could attach to their Wi-fi network properly, and browsing webpages worked fine, but trying to scp a small file to one of the recoil.org servers was stalling at exactly 2064kB.

I had a quick glance around for the problem on Google, and a thread turned up on the Apple message board. These people were discussing the same symptoms as I was having; An scp would start out fine, but stall after a particular amount of data had transfered. Following lots of discussion about tuning net.inet.tcp.delayed_ack, I tried fiddling with all sort of sysctl and ifconfig settings for the best part of an hour, and eventually had success.

I had to drop the MTU of en1 down from 1500 all the way down to 1400 for the problems to go away. The more common settings you might find via Google such as 1492 didn’t resolve the issue. For those of you who might have arrived here looking at similar issues, type the following into a Terminal window:


 sudo ifconfig en1 mtu 1400

I’m not entirely sure what was going on, but Path MTU discovery is turned on by default on the Mac. By blocking ICMP packets on the Wifi network, it may cause issues with the discovery system. If people are more familiar with the networking circumstances here, drop me a comment/email.

Hacking Growl support into SSHKeychain on Mac OS X

After being inspired by Anil, I have also managed to eliminate the incredibly annoying way SSHKeychain creates modal alert boxes which get buried under every other window on your desktop, and prevent you from interacting with it before you dismiss them.

There are two aspects to my hackery. One is to introduce a very simple sleep() call before the application responds to the kIOMessageSystemHasPoweredOn message, which gets posted after a system has awoken from sleep. This stops any SSH tunnels you have defined from being initialised before the system has re-associated with its network properly. This is an issue more frequently encountered with wireless networks, which are slightly slower to respond, and the main reason I started this work. I was sick of hunting for, and clicking away endless boxes informing me that “The tunnel has unexpectedly terminated and could not be restarted.”

I have also managed to hack Growl support in to the application. The new alert panels look like this:

The messages are much less intrusive, and won’t prevent you from restarting any SSH tunnels if you just ignore them, unlike the current NSRunAlertPanel() method.

Incidentally, it’s worth mentioning here that I find SSH tunnels very very useful for being able to send email via SMTP no matter which network you are connected to. I have a permanent tunnel set up from localhost:2525 to the recoil.org servers, and it means I only need one outbound server definition within Mail.app.

Useful Mac OS X applications

My brother recently got a 20” iMac for his work in Cambridge, and asked me for a list of applications that might be of use to him. I thought I’d share this on my blog too:

  • TextMate – Shareware text editor. Absolutely fantastic!
  • Smultron – A less functional TextMate, for those on a budget
  • VLC – An excellent all-round media player
  • MPlayerOSX – Another good media player
  • iTerm – Tabbed terminal application
  • Darwin Ports – An excellent open source package building and management system
  • Omnigraffle – Diagram drawing tool
  • YourSQL – MySQL database GUI interface
  • VoodooPad Lite – Local wiki tool, if you don’t like plain ol’ Stickies
  • Quicksilver – Useful quick-launch utility
  • TestXSLT – If you are working on any XSLT, it allows you to test scripts quickly and easily
  • Native OSX apache PHP module – Useful, although I’m personally erring more towards Ruby these days
  • VirtueDesktops – If you are used to virtual desktops
  • Soap Client & XML-RPC Client – A couple of very nice, free applications for helping with Web Service development
  • LDapper – For querying and developing LDAP databases
  • HandbrakeDVD-to-MPEG4/h.264 ripping
  • Breve.app – Simulation eye candy
  • CSSEdit.appCSS editing made easy
  • Flame – Bonjour service sniffing
  • NewsMac Pro – My RSS reader of choice
  • Colloquy – Convenient IRC/SILC client

Installing fxscintilla on Mac OS X 10.4 Tiger

In trying to install rb-fxruby from Darwinports, I ran up against a problem with the linker when trying to build fxscintilla, which reported:


ld: flag: -undefined dynamic_lookup can't be used with
MACOSX_DEPLOYMENT_TARGET environment variable set to: 10.1
/usr/bin/libtool: internal link edit command failed
make[1]: *** [libfxscintilla.la] Error 1
make: *** [all-recursive] Error 1

and it turns out the solution is to set up your shell environment to include MACOSX\DEPLOYMENT\TARGET set to 10.4, so for all you bash users,


export MACOSX_DEPLOYMENT_TARGET="10.4"

and then the build works like a charm. This is related to the concept of weak linking under Mac OS X, which allows code that was built and linked on 10.4 to still work on 10.3, providing the libraries export the same symbols. There is more in this Apple Tech Note.

Search

Sections

About Nick

I am a freelance technology consultant and developer working in London, with a particular interest in web development and video media.

This site contains my thoughts about technology, the universe and everything. If you would like to get in contact, have a look at the About me page.