Accessing a Network Share with Leopard + Extra

Posted by John
on Sunday, 17 February 2008

Leopard HowTo

First in [Finder], press [command] + K to open the [Connect to Server] box.

Then type your network share's ip address, e.g.

smb://192.168.1.99

Now click [Connect], and you're off.

Belkin Router Problems + Finding the Box

Now recently I got a new ICYBOX IB-N4220-B NAS Enclosure which I now have running as a RAID 1 Array for my own networked WIFI storage, was a bit of a pain with my Belkin router.

Reason being when hooked up there's no real way of testing to see which IP address it's set to on bootup, the supplied CD comes with a tool the find it but that only works on Windows, and didn't work on Vista.

So I hunted around, apparently when it starts up it chooses any IP address in the network starting at 192.168.1.1, and because my Belkin Router had a default setup set to 192.168.2.1 it couldn't find itself.

So setting the Router to 192.168.1.1 meant the NAS drive could then work more happily with the router, picking the next obvious IP down the line, being 192.168.1.2

Finding it's IP then was dead easy, accessed the Router by typing...

http://192.168.1.1

Then logging in, navigating in the menubar, clicking 'DHCP Client List'. From there it listed all the devices currently connected to the Router, one was my MacBook, the other the NAS drive.

So using that I accessed the NAS drive with...

http://192.168.1.2

Logged in and then set it to use a particular IP all the time so I could always find it.

Then used the above commands in Finder to hookup the drive to my MacBook.

Job Done!

Installing SVN via MacPorts

Posted by John
on Wednesday, 23 January 2008

Following on from my previous article concerning using MacPorts to install system software easily on your Mac, in this article I'll guide you thru install Subversion and all it's dependencies under Apple's Leopard O/S.

Update MacPorts

First off you don't have to install MacPorts with Leopard as it comes pre-installed, but you do need to update it.

So in Terminal run...

sudo port -v selfupdate

Perfect that should update the stock 1.5 build to the latest 1.6 release.

SVN Dependencies

Now to installing Subversion's dependencies, without these Subversion will not build. So in Terminal run...

sudo port install sqlite3
sudo port install apr-util
sudo port install neon

Excellent, you should now be ready to install Subversion 1.4.6 from source via MacPorts

Finally Subversion

Just run...

sudo port install subversion

Should install ok leaving you with the latest binary build of Subversion on your Apple machine.

What about a GUI ?

Ok, as most people don't really like using SVN from the command-line, you can download a mac gui interface to it at...

More MacPorts are available at...

Handy Tip

Before I go you can find out the location of a piece of software via the 'which' command.

which svn

Should return the path where it's installed.

Using ZFS with Leopard

Posted by John
on Monday, 21 January 2008

With the inception of Sun OS 11 has come the much hoped 'dream' file system, the Zettabyte File System.

This wonder offers the ability to self-heal files, repair file corruption transparently, resize partitions on-the-fly, hot-swappable, RAID built-in and dynamic encryption. A real swiss army knife for file storage.

It also protected the files of billions when the Joyent service StrongSpace went down (now back up), thankfully data was kept under ZFS so it was all safely protected and restored without loss.

Apple are saying they'll have the ZFS file-system available with a future update (maybe 10.5.2) but if you're not scared of delving into the terminal then try installing it for yourself.

Remember this is all Alpha so not fully finalized but workable to use.

Installing the Binaries

first off, get these from...

once downloaded, go into the Terminal and navigate to the unzipped directory, you should see a 'build' directory in there.

Now to add them to your O/S, run...

sudo cp build/Release/zfs /usr/sbin/zfs
sudo cp build/Release/zpool /usr/sbin/zpool
sudo cp build/Release/libzfs.dylib /usr/lib/libzfs.dylib

Now we need to destroy any existing builds of ZFS on your machine, if existing...

sudo /bin/rm -rf /System/Library/Filesystems/zfs.fs /System/Library/Extensions/zfs.kext
sudo cp -R build/Release/zfs.fs /System/Library/Filesystems/zfs.fs
sudo cp -R build/Release/zfs.kext /System/Library/Extensions/zfs.kext

Great, now navigate to the copied files locations and make sure they have ROOT WHEEL access via...

ls -la [dir / filename]
ls -la zpool

You should see in there a column for 'ROOT WHEEL', if it's the case with all six areas your set.

Reboot and you'll be ready to start.

Building a ZFS Memory Stick

Now for this experiment I'll convert my memory stick over to using the ZFS file system.

So first off, fire up Terminal again and type...

diskutil list

This will list all disks available to the system, so in this case my 8gb stick has it's disk called : /dev/disk1

So I partition it with ZFS doing...

diskutil partitiondisk /dev/disk1 GPTFormat ZFS %noformat% 100%

Then create a simple spool for it..

zpool create stick /dev/disk1s2

...note the previous command will list the disks within this ZFS drive, one of them will be our 8GB partition, hence /dev/disk1s2.

...and stick will be the name of our new ZFS disk drive.

Next up we'll need to upgrade the ZFS spool, as by default the current build will create using version 6 for backwards compatibility of the ZFS structure so we'll upgrade it to 8 doing...

zpool upgrade

Excellent, now before you start dragging and dropping into the new stick drive on your desktop let's set some permissions so you don't have to authorise every file action.

So in the desktop, select the stick drive and press Option+J to see it's disk options.

On the bottom of the popup you'll see 'Permissions', click the padlock icon to unlock these, type in your system password and set the System and Wheel to both have R/W access.

Excellent, now you can drag & drop, delete files from the ZFS disk as if it was a normal disk drive.

Ejecting the ZFS Stick

Before you pull your USB stick out of your computer and cause a panic error, make sure to run this command to eject the drive.

sudo zpool export -f stick

Replace 'stick' with the name of your ZTS spool drive.

Deleting Trash from my Stick

There's bug in the current build so clearing your trash on a ZFS drive isn't exactly easy, so back in Terminal...

cd /volumes/stick

And now find the .Trashes directory with..

ls -la

Now delete the .Trashes directory to clear your trash,

rm -rf .Trashes

Bingo, job done.

Closing Points

Because of how the way our simple ZFS drive is structured, it performs lazy writes much like a usb drive in Windows; the user gets told the file has been commited but really it's waiting around to action.

By forcing a zpool export you are essentially telling the ZFS spool to finish any pending operations and eject the drive safely.

Some time in the future this'll be a much simpler process but for now it's pretty decent having this file system available to keep your files safe.

Looking forward to the final release.

MacHeist is Over!

Posted by John
on Wednesday, 09 January 2008

MacHeist

"Last year's bundle caused a frenzy in the Mac community, selling over 16,000 copies in a week. This year, we're setting our sights a little higher, with a larger bundle, a two week sale, and what we believe to be a stronger collection of apps. Simply put, this is the best Mac software deal in history."

Grab them now,

Need Xcode to Build Mongrel on Leopard

Posted by John
on Friday, 14 December 2007

Quick note, you'll need the latest build of Xcode (which comes with the Apple GCC compiler) to build mongrel server on Leopard.

It being all super 64-bit OS'ey ;-)

Get this from Apple Developer Connections, using your Apple Account.

Note: big download, around 600mb so get a coffee while you wait,

Once installed, run this in Terminal (open a new window with applekey+N),

sudo gem install mongrel

Not forgetting the ever-lovely deprec,

sudo gem install deprec

(which comes with capistrano 1.4.1)

And a of couple updates with...

sudo gem install rails
sudo gem update --system
sudo gem install tzinfo
sudo gem install RedCloth

(p.s. you don't need SSHKeyChain with Leopard, so skip installing that)

Enjoy,