AirPort ♡ Free IPV6 From TunnelBroker.net

After signing up for a (free) account on tunnelbroker.net and creating a (free) tunnel with my ipv4 address as the endpoint I was able to easily configure my AirPort Extreme. View your tunnel, then click on “Example Configurations” and then “Apple Airport.”

In TCP/IP prefs for my MacBooks Network/AirPort Preferences I have “Configure IPv6” set to “Automatically” Then BOOM “ping6 en.blog.wordpress.com” works just fine.

IPv6 without needing my ISPs support and it didn’t cost me an extra dime. Happy World IPv6 Day

OnLive, Max, Xbox360 controller

Did you know that the OnLive OSX app has its own built in drivers that work out of the box with your wired Xbox360 controllers? I found this to be fantastic, but I had already installed the tattiebogle.net controller driver it works, but it conflicts with OnLives use of the device so I couldn’t use it where I wanted to use it. There were no handy instructions on uninstalling them, so I did it manually. Here’s how: back-up and then delete the /System/Library/Extensions/360Controller.kext and /System/Library/Extensions/Wireless360Controller.kext directories from your mac (you’ll need to be root to do this.) after a reboot the driver is gone and OnLive will recognize it. hope this helps someone.

Linux AFP server going slow?

Recently I found that it was taking appauling amounts of time to transfer files to/from my debian file server setup with netatalks AFP. I upgraded to the latest version to no avail, but this trick helped out quite a lot — http://www.netafp.com/tn003-slow-afp-read-performance-90/

Incidentally I believe, unscientifically, that it also helped my OnLive game latency quite a lot (on OSX)

Howto: Enable regular expression highlighting in LimeChat

in LimeChat.app/Contents/Resources/logrenderer.rb around line 419… WFM. IANAL. YMMV. RTFM. OMGWTF. WTL. GTFO. ETC.

    words.each do |w|
      next if w.empty?
      s = body
      offset = 0
# 
      rex = Regexp.new(w, true)
# 
      while rex =~ s
# 
        begin
# 
          left = $~.begin(0)
          right = $~.end(0)
          pre = $~.pre_match
          post = $~.post_match
          ok = true

          if exact_word_match
            if !pre.empty? && alphabetic?(w.first_char) && alphabetic?(pre.last_char)
              ok = false
            elsif !post.empty? && alphabetic?(w.last_char) && alphabetic?(post.first_char)
              ok = false
            end
          end

          if ok
            keywords < < { :pos => offset+left, :len => right-left }
          end
          s = post
          offset += right
# 
        rescue
          next
        end
# 
      end
    end

Bash Coding Convention ../

We use dirname() a lot in php to make relative paths work from multiple locations like so. The advantages are many:

require dirname( dirname( __FILE__ ) ) . '/required-file.php';
$data = file_get_contents( dirname(__FILE__).'/data/info.dat');

But in bash we often dont do the same thing, we settle for the old standby “../”. Which is a shame because unless your directory structure is set up exactly right, and you have proper permissions, and you run the command from the right spot, it doesnt work as planned. I think part of the reason is that its not obvious how to reliably get a full path to the script from inside itself. Another reason is that ../ is shorter to type and easier to remember. Finally there’s always one time scripts for which this methodology is overkill. But if you’re planning to write a script which other people will (or might) be using, I think it’s good practice to do it right. Googling for things you’d think to search for on this subject does not yeild very informative results, or incomplete (incorrect) methods… so… here’s how to do the above php in bash:

source $(dirname $(dirname $(readlink -f $0)))/required-file.sh 
data=$(cat $(dirname $(readlink -f $0))/data/info.dat)

Hope this helps someone 🙂

As a side note, the OSX readlink binary functions differently. You’ll want to use a package manager to install gnu coreutils, and iether use greadlink, or link greadlink to a higher precedence location on your $PATH (I have /opt/local/bin:/opt/local/sbin: at the beginning of my $PATH)

building sed for osx

I work in linux a lot… not bsd. So the OSX (bsd style) implementation of sed really throws me for a loop when I go text-file-spelunking, whats worse is that my scripts using sed aren’t portable between the two OSs.

A quick googling this morning landed me here: http://wiki.octave.org/wiki.pl?OctaveForMac which gives perfectly good instructions on installing sed. except it didnt work. I grabbed the latest version of sed (4.1.5) and got the error

sed: 1: "install_sh=/Users/apoka ...": command i expects \ followed by text
sed: 1: "install_sh=/Users/apoka ...": command i expects \ followed by text

Ironic, huh? Well taking a guess that at some point sed hadcome to depend on its own functionality to configure itself I jumped back a version… Figuring i replace BSD sed with an out of date GNU sed, and then use the old GNU sed to build the new GNU sed. Which worked great. I Installed first sed-3.0.2, and then 4.1.5 in this manner:

./configure --prefix=/usr/ --with-included-regex --with-included-gettext && make && sudo make install

I’m happy with my -r again…

# date | sed -r s/'[0-9]'/'?'/g
Thu Apr ?? ??:??:?? PDT ????

Well I made the switch to Leopard (First impressions)

First of all I did not “upgrade” I backed up (using iBackup 6.2,) then booted into the installation DVD (restart, hold C for a long time) and then entered the disk utility, formatted my disk, and installed fresh.  After rebooting and finishing my installation, I re-downloaded iBackup, and restored selected applications (and their settings,) My system settings, and my home directory.

The bad:

iBackup does not backup dot folders in the root of a backed up folder! It backed up .svn directories in my svn checkouts, but not (for example) my .ssh or .subversion folders in ~/.  For the vast majority of users this doesnt matter. but for developers and admins (I happen to be both) this is severely annoying.  Lucking I keep a backup of my .bash_profile, and my ssh rsa and dsa keys.  So all is well

The good:

I was extremely happy about a lot of things in leopard!!  First of all my delete button works now instead of entering “~” each time i hit it.  Second subversion was installed by default (yay!)  Third the builtin ssh command now supports public key authentication from ~/.ssh/ keys by default (yay!)

Thats all. My first impressions have been very good. I’m happy with the product, and these minor improvements have really made me smile. They were little annoyances, but annoyances nonetheless that hindered me every day (especially the delete key thing.)  That makes the already enjoyable OSX experience that much more enjoyable.  Haven’t had to use macports for anything yet!

The iPhone… Its not even out yet and everyone is drooling over it

And if they aren’t, they should be!  Ajax has long been the missing link between phones as a mobile computing platform and phones as a simple messaging device.  the fact is that there is a vastly larger poll of people willing to write useful web apps than useful java apps.  I would also argue that it’s easier to write good web apps than java apps of the same magnitude.  So with apples announcement that the iPhone will support web 2.0 standards (read AJAX) what was once a tasty looking new toy has become something more. It’s become a tasty toy with a good enough reason for the cost.   I’d have to pay to break my contract with Sprint, start a contract with Cingular, buy the new iPhone, buy the wife a new phone (shared Sprint plan)…. I’m probably looking at $700-$1000 to make the switch.  And I’m already thinking that its worth it.  I’m going to hold off though… as long as I can stand it.  I want someone to review it, I want to see how the web explosion hits Cingulars networks… I want to see how hard they are to find at first…  Mostly I just want the damn phone really bad… But I’m gonna try to be a good boy and hold off… Maybe