A few things that came in handy

  • Apple

I will eventually be creating a series of posts outlining how to create a OS X client based lab-environment. This series will feature outlines on making a consistent user experience, locking down the workstations, generating use logs, and forcing a Novell server login. I have recently been working on the latter, and wanted to share a few tidbits that have many uses beyond the scope decribed above.

Determining the IP address or hostname of an OS X client from the shell

This comes in handy for logging purposes. Lets say you have multiple machines that you want to keep track of in a single log. Hostname an/or IP are a great way to do this. To get a machines IP address(es) try this from the command line:

ifconfig | grep "inet " | grep -v 127.0.0.1 | cut -d -f2

To get the hostname (the piped sed command will remove the .local” suffix) try this from the command line:

hostname | sed 's/.local//'

Mounting an AFP volume from the shell

First you will need to make a folder to use as a mount point. I suggest using the standard location /Volumes/. Let’s say the remote volume is called “Backup”. To make the local mountpoint:

mkdir /Volumes/Backup

Now you will need to mount the remote volume to the local mount point. Let’s assume we want to include the username and password in the command so there is no further user interaction with the GUI. Lets also use an IP address of 192.168.0.1 to identify our remote server.

mount -t afp afp://username:password@192.168.0.1 /Backup /Volumes/Backup

Of course there are ways to make a secure mount without a password too.  See my posting on creating and using ssh keys for more info.

Disabling the Dock and the Finder

This involves messing with the core of OS X, so I suggest you stay away from this unless you are comfortable with something like that.

First of all, OS X likes to keep the Dock and the Finder open at all times. Go ahead and killall Dock and you will see that the Dock just relaunches. However, if the Dock is not in the default location or has a different name, OS X won’t be able to relaunch it. Same goes for the Finder. So if you move those applications from wherever they are (wink wink) into the /Applications folder for example, when your computer starts up you will be running OS X sans Finder and Dock.

Now if you made your computer auto-login to an account that had only a Firefox.app startup item, you will have essentially made an internet kiosk. As you can imagine, the possibilities extend way beyond that. You could always open the Finder or the Dock by calling open /Applications/Finder.app or open /Applications/Dock.app using the shell.

Stay tuned to see how these items can be used in the lab environment!

  1. Mentor

    Popular site :)

    a lot of good info on here, too bad i don’t have a computer.
    i finally found out what the cops are looking for, im not in trouble that means. i thought they were after my pirated movies, NOPE!

    have fun with the blog!

Leave a Reply

Posted in Apple