Archive for the 'OS X Server' Category

get notified!

Posted by dre on September 7th, 2008

Mac OS X makes extensive use of a variety of event notification mechanisms, as described here. One such mechanism is documented in the notify(3) man pages, and it is these types of libnotify notifications that are the focus of this post. Notifications can be posted and observed in a global namespace across all processes (with [...]

Hacking Time Machine

Posted by dre on August 8th, 2008

It’s “hack some shit up” Friday. Everybody ready?
Have a Time Capsule or Mac OS X Server configured to provide network time machine backups? Of course you do! Let’s examine the client / server interaction.
The Time Machine preference pane provides a list of available backup volumes. This list includes local volumes as well as network volumes. [...]

Applied Kerberos troubleshooting

Posted by dre on July 4th, 2008

The following is an IRC transcript taken from #afp548, irc.freenode.net. It chronicles the troubleshooting process of a fairly well-hidden edge case of Kerberos configuration in Mac OS X Server.
pastebin.ca was used to relay larger hunks of textual information; I’ve made local copies of the results since the pastebin pages expire in 1 month. Pastebin displays [...]

Tiger Server servermgrd library for Python

Posted by dre on June 11th, 2007

motivation
I finally found a reason to write some Python. Being something of a monitoring and data junkie, I’ve had a fair amount of experience with snmp, data mining scripts, etc. After writing this post to the server list, I figured I’d make some templates for snmp that published interesting pieces of data about the server. [...]

DNS Zone File record generation script

Posted by dre on June 7th, 2007

In wrote the following as part of my response to this.
#!/usr/bin/perl -w
use strict;

# Place the first three octets here.
my $AddressPrefix = “10.0.1″;

# Define the range of numbers, inclusive.
my $range = “2 .. 10″;

# Your fqdn suffix here, e.g. “foo.com” or “k12.fl.us.gov”
my $tld = “937″;

# Need a backwards representation for PTR records
my $octets = join(”.”, reverse(split(/\./, [...]

The opposite of split is cat.

Posted by dre on January 2nd, 2007

/usr/bin/split and /bin/cat, that is. Why is this useful information? Let’s imagine a wonderful world in which your web host gives you oodles of bandwidth and disk quota, and then one day secretly enacts a policy that disallows access to files over a certain (largish) size. Say, something like:
[Tue Jan 02 13:07:24 2007] [error] [client [...]

Installing perl modules locally

Posted by dre on December 6th, 2006

Dealing with CPAN has always felt a little weird. Today I found a nice shortcut for getting perl modules installed in a home directory, which is really useful for when you don’t have admin on the box, or if you simply prefer to keep your custom perl stuff all cinched up in a tidy homedir [...]

OpenLDAP and SSL (and Mac OS X Server and you)

Posted by dre on November 13th, 2006

Mac OS X Server, as of Tiger, has a spiffy little UI in the Server Admin tool for creating SSL certificate requests, importing certs, or creating self-signed certs. It’s pretty easy to make it all work for http or LDAP using the GUI tools.
There is also the command-line ’serveradmin’ tool, which attempts to mirror the [...]

Decrypting afp mount strings

Posted by dre on September 15th, 2006

{10} andre@werk [~] % mount | grep /Volumes/andre
afp_006Af01nOUmc001Eic06SdO0-1.2c0000ae on /Volumes/andre (nodev, nosuid, mounted by andre)
Huh? how helpful is that! How can I tell what server it came from? Yeah, I could netstat, but what if there’s a bunch of AFP sessions open?
DisplayURL to the rescue!
{12} andre@werk [~] % ~dre/bin/DisplayURL /Volumes/andre
url: “afp://idio.dreness.com/andre”
kCFURLComponentScheme: “afp” including separators: “afp://”
kCFURLComponentNetLocation: [...]

adduser script for Mac OS X / Mac OS X Server

Posted by dre on July 9th, 2006

http://www.dreness.com/bits/tech/adduser.html (syntax colored)
http://www.dreness.com/bits/tech/adduser (raw)
Link Summaryhttp://www.dreness.com/bits/tech/adduser.htmlhttp://www.dreness.com/bits/tech/adduser

Automated backups of Open Directory databases

Posted by dre on June 1st, 2006

# Automated backups of Open Directory databases (ldap / kerberos / password server)
# This needs to run as root and should be mode 700 due to embedded password

# Get current date
TODAY=`/bin/date +’%m-%d-%y_%H:%M:%S’`

# Set destination directory (do not include trailing slash!)
DSTDIR=/path/to/backups

# Set archive password (needed to restore from / unlock the resulting dmg)
PASS="the_foo"

# Feed a [...]

Remote Server Setup get stuck?

Posted by dre on May 31st, 2006

I was using Server Assistant to do a remote setup of Mac OS X Server, and for some reason Server Assistant hung. When I relaunched it, the target server would not allow me to start over or continue the remote setup, claiming that it was already being remotely configured (clearly it didn’t notice that Server [...]

Cacti in Tiger Server

Posted by dre on April 29th, 2006

Install XCode
Install and configure darwinports
Download the newest version from macosforge.
Add the darwinports paths to your shell config file. e.g.
PATH=”/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:$PATH”
Update the ports collection
sudo port -d selfupdate
Install rrdtool from darwinports
Execute the following to install rrdtool and all of its dependencies for you.
sudo port install rrdtool
Local user setup [...]