busy-bee.net buzz buzz buzz goes the honeybee home | blog | links | about me

linux to an imac

2005

June



2004

April

March



2003

November

August

June

March

February

January



2002

December

November

October

September

August

July

June
os version & sed
changing your shell
best X11 windowmanager??
ssh tunnels

May

April





2002-06-12 15:31 / os version & sed  »

To get the version of OS X from the command line, type sw_vers (from mac os x hints). E.g.

 - dave@marnie - Wed 12 Jun 2002 13:56 BST - OSX 10.1.5/darwin5.2.2 -
 - 784/%:~- sw_vers 
ProductName:    Mac OS X
ProductVersion: 10.1.5
BuildVersion:   5S60

To extract from that the string '10.1.5', for use, e.g. in a prompt like the one above:

sw_vers | sed -n '/\([0-9]\.\)/s/.*:  //p'

That's a tab after the colon, and you'll have to type it manually rather than just copy and paste from this page.

2002-06-10 16:41 / changing your shell  »

chsh is another thing that's been farmed off to NetInfo. So, if you want to change your login shell - zsh is included with OS X, but not, I think, with all the bells and whistles that make it so lovely (autocompletion on man pages, perl docs, cvs repositories; colour-themed prompts ...) so it's probably worth downloading it and recompiling - then you need to do something like sudo niutil -createprop / /users/dave shell /bin/zsh. The GUI interface to this didn't work last time I tried :-(. niutil -read / /users/dave will show the list of property / value pairs you can edit.

It's also by messing about with the NetInfo commands that you can set up OS X to run NFS as a server. You'll probably have a /exports NetINfo path already. I can't remember how to do it -- but you don't need the shareware GUI that's kicking about.

2002-06-07 16:26 / ssh tunnels  »

ssh tunnels are yummy. Currently rsyncing both ways the mp3 directories on my nat'd usually-inaccessible-from-the-internet imac at home and firewalled machine at work. I have a gateway (thornhill) at home that I can ssh to - which can also reach the imac (marnie) - so something like this script below (adapted from here) does the trick handsomely:


#!/bin/sh
# licensed under the GNU GPL (http://www.fsf.org/licenses/gpl.html)

final=marnie
gw=thornhill
local_dir=/mnt/w2kdave/
remote_dir=/usr/local/share/mp3/
port=7778

function setup_tunnel() { 
    echo "Password on $gw"; 
    ssh -f -C -L $port:$final:22 $gw sleep 10; 
} 

function sync_marnie() { sync_from; sync_to; }

function sync_from() {  
    echo "Syncing from $final to local";  
    setup_tunnel; 
    echo "Local password"; 
    sudo rsync -vr --size-only -e "ssh -p $port" \
            dave@localhost:$remote_dir $local_dir; 
}

function sync_to()   { 
    echo "Syncing from local to $final"; 
    setup_tunnel; 
    echo "Password on $final"; 
    rsync -vr --size-only -e "ssh -p $port"  \ 
             $local_dir dave@localhost:$remote_dir; 
}


sync_marnie;

2002-06-07 16:51 / best X11 windowmanager??  »

From my brief play last night, oroborosx is by far the best X11 windowmanager to use with OS X. Given that you want your X11 environment to look and feel as much like Aqua as possible.

  mod_perl -- Speed, Power, Scalability