Readline and rlwrap

Posted by Tom on January 10th, 2008 — in Uncategorized

I came across a neat little tool called rlwrap, which essentially wraps the functionality of readline (line editing, history, etc) for any other command line utility. For example, it works well with my GCCalc hack, which I didn’t bother to integrate readline into, but rlwrap gives you the same thing for free:

rlwrap gccalc

It’s useful with [...]

Overriding library functions in Mac OS X, the easy way: DYLD_INSERT_LIBRARIES

Posted by Tom on December 21st, 2007 — in GCC, Internet, Mac, Music, Programming

Back at MacHack 2003 Jonathan Rentzsch talked about how to override functions and inject code in Mac OS X using several neat tricks. He also released a framework called mach_star which has two components: mach_override and mach_inject. These are great, but overkill for some simple cases.

A much easier way of doing library function overrides is [...]

Presenting GCCalc: a horrible abuse of GCC

Posted by Tom on December 14th, 2007 — in C, Command line, GCC, Hacks, Linux, Mac, Programming

Following an interesting discussion on Reddit about first class functions in C, I was inspired to see what I could do with this new-found knowledge. The result is what I affectionately call “GCCalc”, for reasons that will become clear below.

GCCalc is a simple command line calculator, much like the common bc calculator on many Unix [...]

Geolocation possibilities on the iPhone

Posted by Tom on September 10th, 2007 — in GPS, Geolocation, iPhone

Ever since the iPhone was announced, I thought it would be really cool if it had a GPS receiver, or at the very least was able to find your general location via cell phone tower triangulation (technically trilateration). The obvious benefits of such a system would include automatic positioning of Google Maps to your location, [...]

Open new Terminal window in current (or other specified) directory

Posted by Tom on September 7th, 2007 — in Command line, Mac

A lot of times I find myself wanting to open another (Mac OS X) Terminal window in the same directory as my current one. This little shell script, which executes a little AppleScript, makes that trivial:

#!/bin/sh

if [ $# -ne 1 ]; then     PATHDIR=`pwd` else     PATHDIR=$1 fi

osascript -e "tell application \"Terminal\"" -e "do script \"cd $PATHDIR\"" -e "end tell"

Save this [...]

iPhone Accelerometer Fun-ness

Posted by Tom on September 6th, 2007 — in iPhone

If you’re an Apple geek like myself, you might remember back in 1999 when WiFi was a brand new technology, and Phil Schiller demonstrated the new iBook’s Airport feature by jumping off a balcony holding an iBook with an attached accelerometer, which sent the accelerometer data wirelessly to Steve’s demo machine for display (see below).

Well, [...]

Ad-blocking and whyfirefoxisblocked.com

Posted by Tom on August 20th, 2007 — in Internet, Web

Recently it came to the attention of the Digg masses that some slimy SEO guy was advocating web site owners block every Firefox user simply because Firefox allows ad-blocking plugins, and doesn’t provide web site owners with any way to block users of such plugins.

I find this incredibly silly for a number of reasons. The [...]

Mystery solved: iTeaHAL

Posted by Tom on August 17th, 2007 — in Mac

I’ve been getting strange messages in my system and console logs, or when executing certain applications from the command line. Notably iMovie and Skype:

iTeaHAL: Entering… iTeaHAL: Not iTunes, exiting.

And when executing iTunes, I get this:

iTeaHAL: Entering… iTeaHAL: Early startup… itea_hijack_init: result: 0 iTeaHAL: Early startup done. new_AudioDeviceAddIOProc:0×2281b68 link added iTeaHAL: Late startup… {length = 6, capacity = 6, bytes = 0×000a95c4a60e} itea_fx_init: result: 0 itea_menu_init: [...]

Skype outage

Posted by Tom on August 17th, 2007 — in Internet, Security, Skype

Users of the popular VoIP network, Skype, have been experiencing widespread outages for more than a day now. And of course thanks to Murphy’s Law I happened to pick today to try to get my family set up on Skype.

So far I’ve heard three theories as to what is going on.

Skype says the problem is [...]

multiwhich

Posted by Tom on August 15th, 2007 — in Command line, Linux, Mac

The “which” Unix command lists the location of the first matching executable in your PATH. The GNU version of “which” has several extra features including the ability to display all matching executables in your PATH, not just the first. This is useful for finding duplicates, etc. Unfortunately, whatever version of “which” is included in Mac [...]



Warning: include(/home/tlrobinson/tlrobinson.net/_footer-analytics.php) [function.include]: failed to open stream: No such file or directory in /home/tlrobinson/tlrobinson.net/blog/wp-content/themes/clean-look-150/footer.php on line 13

Warning: include() [function.include]: Failed opening '/home/tlrobinson/tlrobinson.net/_footer-analytics.php' for inclusion (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear') in /home/tlrobinson/tlrobinson.net/blog/wp-content/themes/clean-look-150/footer.php on line 13