<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>the bits</title>
	<link>http://www.dreness.com/blog</link>
	<description>dre's technical blog</description>
	<pubDate>Fri, 04 Jul 2008 21:17:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
			<item>
		<title>Applied Kerberos troubleshooting</title>
		<link>http://www.dreness.com/blog/archives/43</link>
		<comments>http://www.dreness.com/blog/archives/43#comments</comments>
		<pubDate>Fri, 04 Jul 2008 21:10:45 +0000</pubDate>
		<dc:creator>dre</dc:creator>
		
		<category><![CDATA[OS X]]></category>

		<category><![CDATA[OS X Server]]></category>

		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/archives/43</guid>
		<description><![CDATA[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&#8217;ve made local copies of the results since the pastebin pages expire in 1 month. Pastebin displays [...]]]></description>
			<content:encoded><![CDATA[<p>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.</p>
<p>pastebin.ca was used to relay larger hunks of textual information; I&#8217;ve made local copies of the results since the pastebin pages expire in 1 month. Pastebin displays line numbers, and those numbers are used here to refer to specific portions of text&#8230; however, pastebin doesn&#8217;t seem to allow users to copy the text including line numbers, so I added those myself (awk &#8216;{print NR &#8220;. &#8220;$0}&#8217; file)</p>
<p>16:44 &lt;@dre^&gt; re the kerberos question: still have to use &#8216;connect to&#8217; to get kerberos<br />
16:44 &lt;@dre^&gt; which is weird, because the browsing method is how you get kerberos for the LKDC realms, heh<br />
16:44 &lt;@dre^&gt; at least for things like screen sharing<br />
16:51 &lt;@dre^&gt; wow, /dev/random is slow<br />
16:51 &lt;@dre^&gt; erps, ww<br />
17:34 -!- ideopathic [n=ideopath@75-56-246-1.lightspeed.brbnca.sbcglobal.net] has joined #afp548<br />
17:39 &lt; SpaceBass&gt; dre^, connect to server doesnt use the ticket either<br />
17:41 &lt; SpaceBass&gt; and for that matter, screen sharing doesnt seem to consistantly use kerberos either<br />
17:41 &lt; SpaceBass&gt; apple really broke things with the whole lkdc implementation<br />
17:44 &lt;@dre^&gt; heh<br />
17:44 &lt;@dre^&gt; if you can&#8217;t get kerberos via connect to, there is some other problem<br />
17:44 &lt;@dre^&gt; lkdc works, kerberos works&#8230; if configured and used properly ;)<br />
17:45 &lt;@dre^&gt; a quick list of things to check regarding kerberized services in general:<br />
17:45 &lt;@dre^&gt; * are the client and the service service configured for the same kerberos realm?<br />
17:45 &lt;@dre^&gt; * does the client have a valid kerberos principal in the kdc? can the client user kinit at all?<br />
17:46 &lt;@dre^&gt; * does the service server have service keytabs in the kdc? if you kadmin &#8211;&gt; listprincs on the kdc, do you see afpserver/hostname@REALM?<br />
17:46 &lt;@dre^&gt; * does the service&#8217;s configuration know what principal name to use? this is in teh afp preferences in the case of afp server<br />
17:48 &lt; SpaceBass&gt; dre^, hard to misconfigure Leopard Server - create the DNS, create the OD domain, join to the domain<br />
17:48 &lt; SpaceBass&gt; there&#8217;s posts all over the apple forums about it&#8230;just though I&#8217;d see if anyone had identified a work around<br />
17:49 &lt;@dre^&gt; have an example post?<br />
17:49 &lt;@dre^&gt; I&#8217;ve used kerberos a ton<br />
17:49 &lt;@dre^&gt; so I know it&#8217;s not always broken all the time<br />
17:49 &lt; SpaceBass&gt; kinit works fine, and I get a ticket at login &#8230; but I cannot use that ticket via the finder for almost anything &#8230; it does work for SSH or mount_afp in the terminal<br />
17:50 &lt;@dre^&gt; right, but pls distinguish between finder browsing vs finder connect to<br />
17:50 &lt; SpaceBass&gt; ever leopard machine that joins the realm creates 3 enteries for each service &#8230; host.fqdn.com host.local and a random serial number for the LKDC /back to my mac stuff<br />
17:51 &lt; SpaceBass&gt; so when you say connect to, do you mean GO menu &#8211;&gt; connect to server?<br />
17:51 &lt;@dre^&gt; yes<br />
17:51 &lt; SpaceBass&gt; and it hasn&#8217;t been broken all the time &#8230; 10.4 worked flawlessly &#8230;<br />
17:51 &lt; SpaceBass&gt; ok an in the connect to menu, what is the uri?  I&#8217;m using afp://host  &#8230; I have also tried host.domain.com and host.local<br />
17:52 &lt;@dre^&gt; ah, .local&#8230;<br />
17:52 &lt; SpaceBass&gt; ok, tried that and I get a box asking for user/pass<br />
17:52 &lt;@dre^&gt; are you using .local in your actual DNS / realm names?<br />
17:52 &lt;@dre^&gt; no. dont  use .local unless you are forced to, heh<br />
17:53 &lt; SpaceBass&gt; no, I have a private domain &#8230;<br />
17:53 &lt;@dre^&gt; and yes, it shoudl be afp://fqdn.goes.here<br />
17:53 &lt;@dre^&gt; also verify that afpserver&#8217;s auth settings are either &#8220;any method&#8221; or &#8220;kerberos&#8221;<br />
17:53 &lt; SpaceBass&gt; ok&#8230;with afp://host.domain.com I get 2 different results &#8230;somtimes it fails right off the bat, others it asks for user/pass<br />
17:54 &lt;@dre^&gt; so then you check the KDC logs to see what&#8217;s going on<br />
17:54 &lt;@dre^&gt; but of course you probably don&#8217;t have access to those&#8230;<br />
17:54 &lt; SpaceBass&gt; dre^, I hand checked each plist last night &#8230; that occured to me late in the game, and I was impressed to see that they all said any and kerb<br />
17:54 &lt;@dre^&gt; which is the crappy part about debugging kerberos<br />
17:54 &lt; SpaceBass&gt; the logs? I&#8217;m the admin<br />
17:54 &lt;@dre^&gt; ok good. check the kdc log<br />
17:56 &lt; SpaceBass&gt; ok&#8230;logs show me requesting a ticket for host.local<br />
17:56 &lt; SpaceBass&gt; but I&#8217;m using fqdn and the afp plist shows the host.fqdn.com as the principal to use<br />
17:57 &lt; SpaceBass&gt; I dont mind manually adding those principals but that seems broken to me<br />
17:57 &lt;@dre^&gt; ok&#8230; what are your existing tickets? klist<br />
17:57 &lt;@dre^&gt; you should not have to add .local principals<br />
17:58 &lt;@dre^&gt; specifically, what&#8217;s the realm associated with your existing tickets (if any)<br />
17:58 &lt; SpaceBass&gt; right now I just have the krbtgt<br />
17:58 &lt;@dre^&gt; but in what realm?<br />
17:58 &lt;@dre^&gt; a .local realm or &#8216;other&#8217;?<br />
17:59 &lt; SpaceBass&gt; NSNET.cc<br />
17:59 &lt;@dre^&gt; ok great<br />
17:59 &lt; SpaceBass&gt; my realm<br />
17:59 &lt; SpaceBass&gt; krbtgt/NSNET.CC@NSNET.CC<br />
17:59 &lt; SpaceBass&gt; what I&#8217;d expect<br />
17:59 &lt; SpaceBass&gt; and if I ssh into a linux server I get host/linux.nsnet.cc@<br />
17:59 &lt;@dre^&gt; so the next step woudl probably be to verify the client-side kerberos configuration. get root and take a walk into /var/db/dslocal/nodes/Default/config<br />
18:00 &lt;@dre^&gt; ok intersting, so the client-side config is probably correct<br />
18:00 &lt;@dre^&gt; is the afp service running on the OD master?<br />
18:00 &lt; SpaceBass&gt; dre^, yes, but I dont really have any shares there&#8230;mostly on leopard workstations<br />
18:01 &lt; SpaceBass&gt; (and a linux box running netatalk, but I don&#8217;t expect anyone to help me troubleshoot that)<br />
18:01 &lt;@dre^&gt; no problem, just getting the lay of the land&#8230; in particular, in that configuration, it&#8217;s very unlikely that your afp service would not have the required keytabs<br />
18:01 &lt; SpaceBass&gt; in &#8230;../config &#8230; didn&#8217;t know about this dir<br />
18:01 &lt;@dre^&gt; yes, that config dir is the authoritative spot for such configurations<br />
18:01 &lt;@dre^&gt;  /L/P/edu.mit.Kerberos is an externalized representation of data found here<br />
18:01 &lt;@dre^&gt; and is really &#8216;for legacy purposes only&#8217;<br />
18:02 &lt; SpaceBass&gt; cool &#8230; I&#8217;m used to /L/P/edu &#8230;<br />
18:02 &lt; SpaceBass&gt; gotcha<br />
18:02 &lt; SpaceBass&gt; good to know<br />
18:02 &lt;@dre^&gt; yes it is. cause sometimes that translation breaks down<br />
18:02 &lt;@dre^&gt; and you need to go see what&#8217;s up<br />
18:02 &lt;@dre^&gt; ok&#8230; so the next thing I would do is&#8230;<br />
18:03 &lt;@dre^&gt; stand by, but I have some awesome debugging steps for you<br />
18:03 &lt; SpaceBass&gt; very apperciative<br />
18:04 &lt;@dre^&gt; ok here goes<br />
18:04 &lt;@dre^&gt; a) open a terminal and execute the following:<br />
18:04 &lt;@dre^&gt;  sudo syslog -c syslog -d<br />
18:04 &lt;@dre^&gt;  sudo syslog -c 0 -d<br />
18:04 &lt;@dre^&gt;  killall NetAuthAgent<br />
18:04 &lt;@dre^&gt;  kdestroy -A<br />
18:04 &lt;@dre^&gt;  syslog -w<br />
18:04 &lt;@dre^&gt; b) start a connection in Finder using &#8216;connect to&#8217;<br />
18:05 &lt;@dre^&gt; once you attempt a connection using the proper fqdn, enter a name / pw if prompted<br />
18:05 &lt;@dre^&gt; then wait 30 seconds for syslog in teh terminal to catch up, then cntrl-c it<br />
18:05 &lt;@dre^&gt; you should find ample / useful debugging info in the terminal (syslog) output<br />
18:05 &lt; SpaceBass&gt; interesting<br />
18:05 &lt; SpaceBass&gt; lots of info<br />
18:05 &lt;@dre^&gt; but I can help make sense of it if you need<br />
18:05 &lt; SpaceBass&gt; getting asked for user/pass for the share<br />
18:06 &lt; SpaceBass&gt; checking the logs now<br />
18:06 &lt;@dre^&gt; Look for KRBCreateSession, and right after that&#8230;<br />
18:06 &lt;@dre^&gt; you should see the results of some realm_for_host calls&#8230;<br />
18:07 &lt; SpaceBass&gt; now the kdestroy removed all tickets &#8230; expected ?<br />
18:07 &lt;@dre^&gt; my guess is that such results are either wrong or missing<br />
18:07 &lt;@dre^&gt; yes, expected<br />
18:07 &lt; SpaceBass&gt; k<br />
18:07 &lt;@dre^&gt; but this process should obtain new tickets<br />
18:07 &lt; SpaceBass&gt; how would it get my password?<br />
18:07 &lt; SpaceBass&gt; I dont have it saved in the keychain<br />
18:08 &lt; SpaceBass&gt; right after the KRBCreateSession line I see:<br />
18:08 &lt; SpaceBass&gt; (and I can&#8217;t cut/paste b/c I&#8217;m using two different machines)<br />
18:09 &lt; SpaceBass&gt; parse_principal &#8230; decomposing afpserver/osx5.nsnet.cc@NSNET.cc    (seems correct)<br />
18:09 &lt;@dre^&gt; ok<br />
18:10 &lt;@dre^&gt; and you probably do have it in your keychain if you got in without authing<br />
18:10 -!- SpaceBass2 [n=SP@96.228.61.195] has joined #afp548<br />
18:10 &lt;@dre^&gt; ok, so that means that afp server is returning the expected principal name<br />
18:10 &lt; SpaceBass2&gt; flood warning<br />
18:10 &lt; SpaceBass2&gt; : [[[ KRBCreateSession () - required parameters okay<br />
18:10 &lt; SpaceBass2&gt; Thu Jul  3 18:02:07 osx1 NetAuthAgent[2861] &lt;Debug&gt;: [[[ parse_principal_name () decomposing afpserver/osx5.nsnet.com@NSNET.COM<br />
18:10 &lt; SpaceBass2&gt; Thu Jul  3 18:02:07 osx1 NetAuthAgent[2861] &lt;Debug&gt;: ]]] parse_principal_name () - 0<br />
18:10 &lt; SpaceBass2&gt; Thu Jul  3 18:02:07 osx1 NetAuthAgent[2861] &lt;Debug&gt;:     KRBCreateSession: processed host name = osx5.nsnet.com<br />
18:10 &lt; SpaceBass2&gt; Thu Jul  3 18:02:07 osx1 NetAuthAgent[2861] &lt;Debug&gt;:     KRBCreateSession: last char of host name = 0&#215;6d<br />
18:11 &lt; SpaceBass2&gt; Thu Jul  3 18:02:07 osx1 NetAuthAgent[2861] &lt;Debug&gt;:     KRBCreateSession: getaddrinfo = success (0)<br />
18:11 &lt; SpaceBass2&gt; Thu Jul  3 18:02:07 osx1 NetAuthAgent[2861] &lt;Debug&gt;:     KRBCreateSession: canonical host name = osx5.nsnet.com<br />
18:11 &lt; SpaceBass2&gt; Thu Jul  3 18:02:07 osx1 NetAuthAgent[2861] &lt;Debug&gt;: [[[ realm_for_host: hostname=osx5.nsnet.com hintrealm=NSNET.COM<br />
18:11 &lt; SpaceBass2&gt; Thu Jul  3 18:02:07 osx1 NetAuthAgent[2861] &lt;Debug&gt;:     realm_for_host: krb5_get_host_realm returned unusable realm!<br />
18:11 &lt; SpaceBass2&gt; Thu Jul  3 18:02:07 osx1 NetAuthAgent[2861] &lt;Debug&gt;: ]]] realm_for_host: failed to determine realm<br />
18:11 &lt;@dre^&gt; ah ha<br />
18:11 &lt; SpaceBass&gt; dre^, I did  NOT get in without authing  &#8230; I got the finder prompt for user/pass<br />
18:11 &lt;@dre^&gt; ok that&#8217;s good<br />
18:11 &lt;@dre^&gt; and expected<br />
18:12 &lt;@dre^&gt; it definitely looks as though the client kerberos config is malformed somehow<br />
18:12 &lt;@dre^&gt; since it thinks NSNET.COM is unusable<br />
18:12 &lt;@dre^&gt; go ahead and kinit and paste in the TGT you get<br />
18:12 &lt;@dre^&gt; or jsut klist if you already have one<br />
18:12 &lt; SpaceBass&gt; ok&#8230;here&#8217;s the thing&#8230;its a brand spanking new Macbook pro &#8230; first thing out of the box&#8230;configured DNS, did updates, jointed to domain using directory utility.app<br />
18:13 &lt;@dre^&gt; is that the client or afp server?<br />
18:13 &lt; SpaceBass2&gt; Kerberos 5 ticket cache: &#8216;API:Initial default ccache&#8217;<br />
18:13 &lt; SpaceBass2&gt; Default principal: ndawson@NSNET.COM<br />
18:13 &lt; SpaceBass2&gt; Valid Starting     Expires            Service Principal<br />
18:13 &lt; SpaceBass2&gt; 07/03/08 18:09:58  07/04/08 04:09:58  krbtgt/NSNET.COM@NSNET.COM<br />
18:13 &lt; SpaceBass2&gt;     renew until 07/10/08 18:09:58<br />
18:13 &lt; SpaceBass&gt; client<br />
18:13 &lt;@dre^&gt; hmm, ok<br />
18:14 &lt;@dre^&gt; could you post or email me your /L/P/edu.mit.Kerberos?<br />
18:14 &lt;@dre^&gt; dre@mac.com<br />
18:14 &lt; SpaceBass&gt; can post - its short<br />
18:15 &lt; SpaceBass&gt; pastebin at least<br />
18:15 &lt;@dre^&gt; sure<br />
18:15 &lt; SpaceBass2&gt; http://pastebin.ca/1061728</p>
<p># WARNING This file is automatically created, if you wish to make changes<br />
# delete the next two lines<br />
# autogenerated from : /LDAPv3/vail.nsnet.com<br />
# generation_id : 97528862<br />
[libdefaults]<br />
default_realm = NSNET.COM<br />
[realms]<br />
NSNET.COM = {<br />
admin_server = vail.local<br />
kdc = vail.local<br />
}<br />
[domain_realm]<br />
.local = NSNET.COM<br />
local = NSNET.COM<br />
[logging]<br />
admin_server = FILE:/var/log/krb5kdc/kadmin.log<br />
kdc = FILE:/var/log/krb5kdc/kdc.log</p>
<p>18:16 &lt; SpaceBass&gt; thats a little different than I&#8217;m used to seeing - but its what apple generates<br />
18:16 &lt;@dre^&gt; loading&#8230;<br />
18:16 &lt;@dre^&gt; (slowly)<br />
18:17 &lt; SpaceBass&gt; again, really appreciate the help<br />
18:17 &lt;@dre^&gt; sure no prob :)<br />
18:18 &lt; SpaceBass2&gt; I am surprised that apple&#8217;s automated processes seem to be broken<br />
18:19 &lt;@dre^&gt; heh, well&#8230; I guess that&#8217;s good. one should ideally expect things to work properly without too much work :)<br />
18:20 &lt; SpaceBass2&gt; exactly<br />
18:21 &lt;@dre^&gt; ok it loaded finally<br />
18:21 &lt;@dre^&gt; oh, lol<br />
18:21 &lt;@dre^&gt; I see the problem :P<br />
18:22 &lt;@dre^&gt; kdc = vail.local<br />
18:22 &lt;@dre^&gt; vail.local should be a fqdn<br />
18:22 &lt; SpaceBass2&gt; in the edu&#8230; ?<br />
18:22 &lt;@dre^&gt; yes absolutely<br />
18:22 &lt; SpaceBass2&gt; see, I thought the same thing, but what is that part about the aliasing?<br />
18:23 &lt;@dre^&gt; theoretically in a perfect world this would be a valid configuration<br />
18:23 &lt; SpaceBass2&gt; :D<br />
18:23 &lt;@dre^&gt; the thing is that Kerberos makes assumptions based on host name / fqdn<br />
18:23 &lt; SpaceBass2&gt; ok &#8230; if I change edu.mit.kerb &#8230;how do I get it to update the files in /var&#8230;/config<br />
18:23 &lt;@dre^&gt; so you need to use the fqdn for the KDC that matches the host name portion of the kerberos principals<br />
18:23 &lt;@dre^&gt; you should not change it<br />
18:23 &lt;@dre^&gt; you should unbind and rebind using a fqdn and see what happens<br />
18:23 &lt; SpaceBass2&gt; ok<br />
18:24 &lt; SpaceBass2&gt; rebind using the fqdn of the server?<br />
18:24 &lt;@dre^&gt; yes<br />
18:24 &lt; SpaceBass2&gt; odd, b/c thats what I did<br />
18:24 &lt;@dre^&gt; unbind / rebind the client<br />
18:24 &lt;@dre^&gt; ok, then don&#8217;t do that<br />
18:24 &lt; SpaceBass2&gt; glad to re-try<br />
18:24 -!- dakine [n=sam@bas3-toronto01-1177779856.dsl.bell.ca] has quit [&#8221;This computer has gone to sleep&#8221;]<br />
18:24 &lt;@dre^&gt; let&#8217;s verify the server configuraiton<br />
18:24 &lt; SpaceBass2&gt; k<br />
18:24 &lt;@dre^&gt; on teh OD master: sudo slapconfig -checkhostname<br />
18:24 &lt;@dre^&gt; er, sorry<br />
18:25 &lt;@dre^&gt; sudo changeip -checkhostname<br />
18:25 &lt; SpaceBass2&gt; yeah , I figured thats what you meant :D &#8230; vail.nsnet.com<br />
18:25 &lt;@dre^&gt; in general, it&#8217;s good to resist the temptation to hand-hack any config files, because doing so may break assumptions that apple makes about the contents of the files, in the cases where the same config files are maintained automatically by apple tools<br />
18:26 &lt; SpaceBass2&gt; dre^, I&#8217;ve learned that the hard way before :)<br />
18:26 &lt;@dre^&gt; so it says &#8220;there&#8217;s nothing to change&#8221; at the end?<br />
18:26 &lt; SpaceBass2&gt; yes<br />
18:26 &lt;@dre^&gt; ok good<br />
18:26 &lt; SpaceBass2&gt; names match, nothing to change<br />
18:27 &lt;@dre^&gt; does the server&#8217;s /L/P/edu.mit.Kerberos look the same?<br />
18:27 &lt;@dre^&gt; it probably will&#8230;<br />
18:27 &lt; SpaceBass2&gt; exactly the same<br />
18:27 &lt; SpaceBass2&gt; (and that damn .local keeps throwing me off too)<br />
18:27 &lt;@dre^&gt; yeah. it should be. that data is all downloaded by the client from the LDAP directory<br />
18:28 &lt;@dre^&gt; (when you bind, a tool called kerberosautoconfig &#8230; well, does that)<br />
18:28 &lt; ideopathic&gt; i&#8217;m following a long trying to learn a little about kerberos.  where is the file located that you uploaded to pastbin?<br />
18:28 &lt; SpaceBass2&gt; and, like I said&#8230;ssh and mount_afp work &#8230;<br />
18:28 &lt; SpaceBass2&gt; ideopathic, /Library/Preferences<br />
18:28 &lt; SpaceBass2&gt; ideopathic, this is a good one to follow :D learning a lot myself<br />
18:28 &lt;@dre^&gt; there is still something wrong if it thinks your kdc is hosted by a .local thing<br />
18:28 &lt;@dre^&gt; you&#8217;re supposed to get a fqdn there, e.g. vail.nsnet.com<br />
18:29 &lt;@dre^&gt; ok, so let&#8217;s check your kdc configuration&#8230;<br />
18:29 &lt;@dre^&gt; on the KDC (OD master): ps auxwww | grep krb<br />
18:29 -!- dakine [n=sam@bas3-toronto01-1177779856.dsl.bell.ca] has joined #afp548<br />
18:29 &lt;@dre^&gt; you shoudl see krb5kdc running and supporting at least one realm<br />
18:29 &lt; SpaceBass2&gt; root        96   0.0  0.2    82512   2480   ??  S    25Jun08   0:15.03 /usr/sbin/krb5kdc -n -r LKDC:SHA1.B3567769537F126486F54B94C5B03C7A439C0F80 -r NSNET.COM -a<br />
18:29 &lt;@dre^&gt; very interesting<br />
18:30 &lt;@dre^&gt; so the KDC thinks it&#8217;s hosting two realms, the LKDC realm and the NSNET.COM realm<br />
18:30 &lt; SpaceBass2&gt; yeah&#8230;theres those damn lkdc entries again<br />
18:30 &lt;@dre^&gt; that&#8217;s fine, don&#8217;t fear the lkdc ;)<br />
18:30 &lt; SpaceBass2&gt; oh but I do :D<br />
18:30 &lt;@dre^&gt; perhaps this will aleviate your concern: http://www.dreness.com/wikimedia/index.php?title=LKDC<br />
18:30 &lt;@dre^&gt; a little write-up I did about the LKDC<br />
18:31 &lt;@dre^&gt; but that is beside the point<br />
18:31 &lt;@dre^&gt; the question is: what broke between the KDC configuration and the population of the KerberosClientConfig record in OD<br />
18:31 &lt;@dre^&gt; open workgroup manager<br />
18:32 &lt;@dre^&gt; actually let&#8217;s just use dscl<br />
18:32 &lt; SpaceBass2&gt; cool - good reading!<br />
18:32 &lt;@dre^&gt; dscl /LDAPv3/127.0.0.1 (on the OD master)<br />
18:32 &lt; SpaceBass2&gt; k<br />
18:32 &lt;@dre^&gt; read /Config/KerberosClient<br />
18:32 &lt; SpaceBass2&gt; I&#8217;ll warn you, my dscl-fu is weak<br />
18:33 &lt;@dre^&gt; this should be similar to what you see in /L/P/edu.mit.kerberos (albeit formated differently)<br />
18:33 &lt;@dre^&gt; true or false?<br />
18:33 &lt; SpaceBass2&gt; checking -its xml &#8230;but close<br />
18:33 &lt;@dre^&gt; mainly looking for vail.local<br />
18:33 &lt; SpaceBass2&gt; yeah<br />
18:34 &lt; SpaceBass2&gt; its there<br />
18:34 &lt;@dre^&gt; ok<br />
18:34 &lt; SpaceBass2&gt; as the KDC for nsnet.com<br />
18:34 &lt; SpaceBass2&gt; nsnet.cc<br />
18:34 &lt;@dre^&gt; this is the data that is downloaded by clients when they bind<br />
18:34 &lt;@dre^&gt; wait<br />
18:34 &lt; SpaceBass2&gt; ah!<br />
18:34 &lt;@dre^&gt; nsnet.cc or nsnet.com!?!<br />
18:34 &lt; SpaceBass2&gt; cc<br />
18:34 &lt; SpaceBass2&gt; sorry<br />
18:34 &lt; SpaceBass2&gt; er..com<br />
18:34 &lt; SpaceBass2&gt; it is com<br />
18:34 &lt;@dre^&gt; hehe<br />
18:34 &lt; SpaceBass2&gt; and .com is correct<br />
18:35 &lt;@dre^&gt; ok<br />
18:35 &lt; SpaceBass2&gt; and if I&#8217;ve been saying .cc its an old habit<br />
18:35 &lt; SpaceBass2&gt; but nsnet.com is a private domain &#8230;in that i do not own it on the interwebs<br />
18:35 &lt;@dre^&gt; &#8230; that is not recommended ;)<br />
18:35 &lt;@dre^&gt; you should use fake TLDs in that case<br />
18:35 &lt; SpaceBass2&gt; yeah, stupid move that I made years ago and wish I could undo<br />
18:36 &lt;@dre^&gt; e.g. nsnet.lan<br />
18:36 &lt; SpaceBass2&gt; but I suspect trying to change the realm now would be pretty challenging<br />
18:36 &lt;@dre^&gt; you can and should un-do it as a reasonably high priority<br />
18:36 &lt;@dre^&gt; it could cause very hard to track down DNS &#8216;problems&#8217;<br />
18:36 &lt;@dre^&gt; but we&#8217;ll talk about that later<br />
18:36 &lt; SpaceBass2&gt; what I&#8217;d really like to do get a public domain and do a dual horizon dns &#8230; would make getting a comercial cert much easier<br />
18:37 &lt; SpaceBass2&gt; but like you said, I can tackel that later<br />
18:37 &lt;@dre^&gt; ok, so<br />
18:37 &lt;@dre^&gt; now let&#8217;s look at /Library/Logs/slapconfig.log<br />
18:37 &lt;@dre^&gt; might wanna slap that on pastebin<br />
18:37 &lt;@dre^&gt; (on the OD master)<br />
18:37 &lt;@dre^&gt; slapconfig.log records information about OD role changes, such as promotion to master<br />
18:38 &lt; SpaceBass2&gt; assume there is nothing sensitive in there<br />
18:38 &lt;@dre^&gt; nothing that you haven&#8217;t already told us :)<br />
18:38 &lt;@dre^&gt; might be an admin account name<br />
18:38  * SpaceBass2 pats his PFsense box<br />
18:38 &lt;@dre^&gt; but certainly no passwords&#8230;<br />
18:39 &lt; SpaceBass2&gt; http://pastebin.ca/1061749</p>
<p><a href="http://dreness.com/bits/tech/applied_kerberos_troubleshooting/paste1" target="_blank">http://dreness.com/bits/tech/applied_kerberos_troubleshooting/paste1</a></p>
<p>18:39 &lt;@dre^&gt; (although before tiger shipped, I did find admin passwords in that log&#8230; heh. fixed before ship though, thankfully&#8230;)<br />
18:39 &lt; SpaceBass2&gt; ouch!<br />
18:39 &lt;@dre^&gt; full disclosure: I work at apple<br />
18:40 &lt;@dre^&gt; loading slow again&#8230;<br />
18:40 &lt; SpaceBass2&gt; yeah? awesome<br />
18:40 &lt; SpaceBass2&gt; full discolsure I&#8217;m a fan boy<br />
18:40 &lt;@dre^&gt; hehe<br />
18:40  * SpaceBass2 has 16 macs &#8230;personally &#8230; this is a home setup by the way<br />
18:41 &lt; SpaceBass2&gt; and my wife is only tolerating  me troubleshooting this right now b/c I&#8217;ve promised that she&#8217;ll be able to mount the media share again<br />
18:41 &lt;@dre^&gt; haha<br />
18:41 &lt;@dre^&gt; ok it&#8217;s loaded, reading<br />
18:42 &lt; SpaceBass2&gt; k<br />
18:42 &lt; SpaceBass2&gt; reading myself as its new to me<br />
18:42 &lt;@dre^&gt; I see you had one false start<br />
18:43 &lt; SpaceBass2&gt; yeah - in fact, the long history is that I did a tiger-leo upgrade and it failed several times &#8230; so I blew it away and re-created the OD from sctatch &#8230;and did indeed have a false start<br />
18:44 &lt;@dre^&gt; hmm, looks like you&#8217;re merging in an OD backup from tiger<br />
18:45 &lt; SpaceBass2&gt;  I did try and pull in a backup - again failed &#8230; you should see where I eventually re-created by hand<br />
18:45 &lt; SpaceBass2&gt; if memory serves &#8230;.<br />
18:45 &lt;@dre^&gt; heh ok, still reading<br />
18:45 &lt; SpaceBass2&gt; I did try and pull in the backup and then create new passwords, but I wasn&#8217;t getting user principals<br />
18:46 &lt;@dre^&gt; upgrades are risky business&#8230;<br />
18:48 &lt;@dre^&gt; ok, so if you look at line 247<br />
18:48 &lt;@dre^&gt; that&#8217;s where it starts creating the wrong service principals<br />
18:48 &lt;@dre^&gt; though there is no obvious indication of why it&#8217;s doing it wrong&#8230; between line 202 and 247 appears normal<br />
18:49 &lt; SpaceBass2&gt; leme look<br />
18:49 &lt; SpaceBass2&gt; the warnings?<br />
18:49 &lt;@dre^&gt; no, the principal name itself<br />
18:49 &lt;@dre^&gt; er, the hostname portion of the service principals<br />
18:49 &lt;@dre^&gt; vail.local<br />
18:50 &lt; SpaceBass2&gt; i see<br />
18:50 &lt;@dre^&gt; intersetingly enough, when you kerberize other hosts, they work<br />
18:50 &lt;@dre^&gt; e.g. telluride<br />
18:50 &lt;@dre^&gt; that explains why ssh to linux is working<br />
18:50 &lt; SpaceBass2&gt; telluride is a linux box - added by hand<br />
18:50 &lt;@dre^&gt; *nod*<br />
18:50 &lt;@dre^&gt; note line 327<br />
18:51 &lt;@dre^&gt; the service principals are being created with the correct server name<br />
18:51 &lt; SpaceBass2&gt; humm I cannot seem to get into kadmin<br />
18:51 &lt;@dre^&gt; try kadmin.local as root<br />
18:51 &lt; SpaceBass2&gt; but what I have observed in the past is that it creates 3 enteries for each OSX host<br />
18:51 &lt;@dre^&gt; yes, that is fixed in 10.5.3<br />
18:51 &lt;@dre^&gt; but only for &#8216;new&#8217; installs :/<br />
18:51 &lt; SpaceBass2&gt; is it?!?!<br />
18:52 &lt;@dre^&gt; it&#8217;s not really a functional problem, more cosmetic<br />
18:52 &lt; SpaceBass2&gt; I&#8217;m on 10.5.2 - been avoiding the upgrade b/c I wasn&#8217;t sure it was safe yet<br />
18:52 &lt;@dre^&gt; well now it&#8217;s 10.5.4, heh<br />
18:52 &lt; SpaceBass2&gt; even for server?<br />
18:52 &lt;@dre^&gt; yes<br />
18:52 &lt; SpaceBass2&gt; on .4 for clients<br />
18:52 &lt; SpaceBass2&gt; cool<br />
18:52 &lt;@dre^&gt; in general, updates ship at the same time for client and server<br />
18:52 &lt; SpaceBass2&gt; I&#8217;ll update tonight if all goes well<br />
18:52 &lt; smultron&gt; i updated<br />
18:53 &lt; smultron&gt; no problems<br />
18:53 &lt;@dre^&gt; well&#8230; if you don&#8217;t have a lot of stuff in your OD master, you should probably demote / promote<br />
18:53 &lt; SpaceBass2&gt; interesting - I only see vail.local in the keytab<br />
18:53 &lt;@dre^&gt; yes, that is a problem :)<br />
18:53 &lt;@dre^&gt; you might be able to slapconfig -kerberize your way to nirvana&#8230; lemme see<br />
18:53 &lt; SpaceBass2&gt; oh yeah it is! can&#8217;t belive I missed that<br />
18:53 &lt;@dre^&gt; I&#8217;ve never really done that, since I always stop at the first sign of weirdness and start over<br />
18:53 &lt; SpaceBass2&gt; I mean, I can add em if need be<br />
18:54 &lt;@dre^&gt; in general, watch slapconfig.log like a hawk whenever you do OD stuff<br />
18:54 &lt; SpaceBass2&gt; but, since osx1.nsnet.com is trying to connect to osx5.nsnet.com  &#8230; does vail.local matter?<br />
18:54 &lt; SpaceBass2&gt; would that break the &#8220;chain&#8221; so to speak?<br />
18:55 &lt;@dre^&gt; well, it matters in the sense that vail&#8217;s services are kerberized using the wrong hostname<br />
18:55 &lt; SpaceBass2&gt; (and hostname on the kdc reports vail.nsnet.com )<br />
18:55 &lt;@dre^&gt; right, it&#8217;s just the self-kerberization that failed for some reason<br />
18:56 &lt;@dre^&gt; ok, couple more things to check&#8230;<br />
18:57 &lt;@dre^&gt; sudo sso_util info -r /LDAPv3/127.0.0.1<br />
18:57 &lt;@dre^&gt; should return NSNET.COM<br />
18:58 &lt; SpaceBass2&gt; &#8217;tis<br />
18:58 &lt; SpaceBass2&gt; nsnet.com<br />
19:00 &lt;@dre^&gt; ok, so there is an sso_util command that can attempt to kerberize services on the OD master<br />
19:00 &lt;@dre^&gt; sso_util configure<br />
19:00 &lt; SpaceBass2&gt; oh&#8230;?<br />
19:00 &lt;@dre^&gt; but this will make changes<br />
19:00 &lt; SpaceBass2&gt; at this point, its not like I cannot rebuild again &#8230; data is on the clients and its all backed up<br />
19:00 &lt;@dre^&gt; so before doing that, let me ask: how much stuff is in the OD master? How long would it take you to demote and promote, and recreate all of the users / kerberized hosts?<br />
19:00 &lt;@dre^&gt; ok<br />
19:00 &lt; SpaceBass2&gt; and rebuilding the OD master isn&#8217;t too hard<br />
19:01 &lt;@dre^&gt; well depends on how much stuff is in it :) the idea is we don&#8217;t want to restore from an archive<br />
19:01 &lt; SpaceBass2&gt; I&#8217;d really prefer not to do that&#8230;at least not tonight &#8230; but its &#8220;do-able&#8221;<br />
19:01 &lt;@dre^&gt; as that will restore potentially bad data<br />
19:01 &lt;@dre^&gt; well doing the sso_util configure shouldn&#8217;t break anything other than kerberized services on the OD master<br />
19:01 &lt; SpaceBass2&gt; guess what I&#8217;m saying is: I&#8217;m ok with risking it<br />
19:01 &lt;@dre^&gt; which means that at works, you have to use standard auth and not kerberos<br />
19:01 &lt;@dre^&gt; s/works/worst/<br />
19:02 &lt; SpaceBass2&gt; I can live with standard for a few days if I have to<br />
19:03 &lt;@dre^&gt; ok so try: sudo sso_util configure -r NSNET.COM -a admin-name all<br />
19:03 &lt;@dre^&gt; where admin-name is your *directory* administraotr<br />
19:03 &lt;@dre^&gt; you will be prompted for a password<br />
19:03 &lt; SpaceBass2&gt; says either us -p or named pipe<br />
19:04 &lt;@dre^&gt; oh, interesting&#8230; must be a difference between versions<br />
19:04 &lt;@dre^&gt; try passing -p with no password<br />
19:04 &lt; SpaceBass2&gt; same error<br />
19:04 &lt;@dre^&gt; blah, then do -p &lt;password&gt;<br />
19:04 &lt;@dre^&gt; which is evil and stupid<br />
19:04 &lt;@dre^&gt; 10.5.4 server allows you to get a secure prompt<br />
19:04 &lt; SpaceBass2&gt; guess I can truncate history later :D<br />
19:04 &lt;@dre^&gt; heh *nod*<br />
19:05 &lt;@dre^&gt; hopefully you will see it creating new service principals&#8230;<br />
19:05 &lt; SpaceBass2&gt; ok&#8230;same error &#8230;so I moved -p right after the -a diradmin<br />
19:05 &lt;@dre^&gt; in the form service/vail.nsnet.com/NSNET.COM<br />
19:05 &lt;@dre^&gt; hmm<br />
19:05 &lt; SpaceBass2&gt; creating service princs<br />
19:05 &lt; SpaceBass2&gt; add_principal: Principal or policy already exists while creating &#8220;ldap/vail.local@NSNET.COM&#8221;.<br />
19:05 &lt;@dre^&gt; bah!<br />
19:06 &lt;@dre^&gt; and you are sure that the &#8216;hostname&#8217; command does not return vail.local?<br />
19:06 &lt; SpaceBass2&gt; 100%<br />
19:06 &lt;@dre^&gt; oh, I guess this could be keying off the KerberosConfig record&#8230;<br />
19:06 &lt;@dre^&gt; maybe we need to re-publish that<br />
19:06 &lt;@dre^&gt; ok let&#8217;s see&#8230;<br />
19:07 &lt; SpaceBass2&gt; and by the way - if I&#8217;m keeping you from something, please say so<br />
19:07 &lt; SpaceBass2&gt; you&#8217;v been more than helpful, to say the least<br />
19:07 &lt;@dre^&gt; well thanks :) I kinda wanna solve this, I&#8217;m sure i&#8217;ll be seeing similar problems from others&#8230;<br />
19:07 &lt;@dre^&gt; (I help scrub incomming server bugs)<br />
19:08 &lt; SpaceBass2&gt; I really appreciate the help!<br />
19:08 &lt; SpaceBass2&gt; gotcha - so this is right up your alley then<br />
19:08 &lt; SpaceBass2&gt; although I suspect you dont see many home users with Server<br />
19:09 &lt;@dre^&gt; well, no&#8230;<br />
19:10 &lt;@dre^&gt; ok, gotta find how the KerberosClient record can be re-created<br />
19:10 &lt;@dre^&gt; cause that&#8217;s where the bad data is coming from<br />
19:10 &lt; SpaceBass2&gt; I&#8217;d show you my server cabinet and rack &#8230;but its a tad shoddy compared to a real server room<br />
19:10 &lt;@dre^&gt; could very well have been left over from the false start(s)<br />
19:12 &lt; SpaceBass2&gt; humm<br />
19:12 &lt;@dre^&gt; ok how about this<br />
19:12 &lt;@dre^&gt; dscl /Search list /Computers<br />
19:13 &lt; SpaceBass2&gt; livingroom.local$<br />
19:13 &lt; SpaceBass2&gt; livingroom.nsnet.com$<br />
19:13 &lt; SpaceBass2&gt; LKDC:SHA1.2F5BAB71984D985DC0BA0D103C85DC067EF0A22E$<br />
19:13 &lt; SpaceBass2&gt; LKDC:SHA1.64604752011301522B118A9CFE83A95560B194E5$<br />
19:13 &lt; SpaceBass2&gt; LKDC:SHA1.AB999D5B63EDDCDC11B360E1EACB9536849844CC$<br />
19:13 &lt; SpaceBass2&gt; LKDC:SHA1.C1E7E428054307B586CD240141B42583DF46FB5A$<br />
19:13 &lt; SpaceBass2&gt; LKDC:SHA1.C2DA7627FD7C4E44EFE720A00FAE2CE2F76BA9A8$<br />
19:13 &lt; SpaceBass2&gt; LKDC:SHA1.DD1F37D568FCC14ACE2F3935554012B235C87A4C$<br />
19:13 &lt; SpaceBass2&gt; LKDC:SHA1.DD362AEF0FD6C7CBA5664D5FD27818058317ED49$<br />
19:13 &lt; SpaceBass2&gt; osx1<br />
19:13 &lt; SpaceBass2&gt; osx1.local$<br />
19:13 &lt; SpaceBass2&gt; osx1.nsnet.com$<br />
19:13 &lt; SpaceBass2&gt; osx10.local$<br />
19:13 &lt; SpaceBass2&gt; osx10.nsnet.com$<br />
19:13 &lt; SpaceBass2&gt; osx5<br />
19:13 &lt; SpaceBass2&gt; osx5.nsnet.com$<br />
19:13 &lt; SpaceBass2&gt; osx7.local$<br />
19:13 &lt; SpaceBass2&gt; osx7.nsnet.com$<br />
19:13 &lt; SpaceBass2&gt; telluride.nsnet.com<br />
19:13 &lt; SpaceBass2&gt; vail.nsnet.com$<br />
19:13 &lt; SpaceBass2&gt; oops&#8230;SORRY<br />
19:13 &lt; SpaceBass2&gt; ment to put that into pastebin<br />
19:13 &lt;@dre^&gt; no worries, butok, vail.nsnet.com is there<br />
19:15 &lt; SpaceBass2&gt; help me understand the $ &#8230; is that some kind of wild card<br />
19:15 &lt;@dre^&gt; used for computer records<br />
19:15 &lt;@dre^&gt; maybe only those with a qualified name<br />
19:15 &lt;@dre^&gt; e.g. foo.tld instead of just foo<br />
19:15 &lt;@dre^&gt; and I think only when they are auto-generated<br />
19:16 &lt;@dre^&gt; which is why teh linux box record doesn&#8217;t have one<br />
19:16 &lt; SpaceBass2&gt; gotcha<br />
19:16 &lt; SpaceBass2&gt; gotcha<br />
19:17 &lt;@dre^&gt; ok hmmm<br />
19:17 &lt; SpaceBass2&gt; I&#8217;ve avoided joining the other machines until I get the issues sussed out<br />
19:18 &lt;@dre^&gt; dscl /Search read &#8220;/Computers/vail.nsnet.com$&#8221;<br />
19:18 &lt;@dre^&gt; sorry<br />
19:18 &lt;@dre^&gt; dscl /Search read &#8220;/Computers/vail.nsnet.com$&#8221; cn<br />
19:19 &lt; SpaceBass2&gt; dsAttrTypeNative:cn: vail.nsnet.com$ vail.nsnet.com<br />
19:19 &lt;@dre^&gt; ok<br />
19:20 &lt;@dre^&gt; kdcsetup is the one who writes the KerberosClient record into LDAP<br />
19:22 &lt;@dre^&gt; but it doesn&#8217;t appear to be able to only re-write KerberosClient without doing everything else<br />
19:22 &lt;@dre^&gt; so fire up WGM<br />
19:22 &lt;@dre^&gt; go into prefs, turn on the inspector<br />
19:22 &lt; SpaceBass2&gt; k<br />
19:22 &lt; dakine&gt; hey guys, quick question<br />
19:23 &lt; dakine&gt; what do you say you do for a living?<br />
19:23 &lt;@dre^&gt; click the bullseye icon (the right-most above the left-hand list view)<br />
19:23 &lt;@dre^&gt; I work at apple as a seed engineer<br />
19:23 &lt; SpaceBass2&gt; &lt;&#8211; healthcare process improvement   :D<br />
19:23 &lt;@dre^&gt; software seeding, that is<br />
19:23 &lt; SpaceBass2&gt; looking for inspector<br />
19:24 &lt;@dre^&gt; second checkbox<br />
19:24 &lt;@dre^&gt; (in the wgm prefs)<br />
19:24 &lt; dakine&gt; lol<br />
19:24 &lt; dakine&gt; ok<br />
19:24 &lt; SpaceBass2&gt; see it now<br />
19:24 &lt;@dre^&gt; dakine: in case that isn&#8217;t clear, I help mediate communications between external customers with bugs and apple software engineers<br />
19:24 &lt; SpaceBass2&gt; ok&#8230;in the bulls eye<br />
19:24 &lt; SpaceBass2&gt; also new to me<br />
19:25 &lt; dakine&gt; ah<br />
19:25 &lt;@dre^&gt; from the pop-up menu, select Config<br />
19:25 &lt; dakine&gt; so you are the middleman<br />
19:25 &lt;@dre^&gt; well I hate that term, heh<br />
19:25 &lt; dakine&gt; cause the software engineers arent people persons<br />
19:25 &lt;@dre^&gt; middleman implies that I&#8217;m good for nothing ;)<br />
19:25 &lt; dakine&gt; lol<br />
19:25 &lt; dakine&gt; listen<br />
19:25 &lt; dakine&gt; nothing gets done without the middle man<br />
19:26 &lt;@dre^&gt; space: then select KerberosClient<br />
19:26 &lt; dakine&gt; its just the problem givers and the problems solvers in communicado<br />
19:26 &lt;@dre^&gt; then select XMLPlist and click Edit below<br />
19:26 &lt; dakine&gt; anyways I am off<br />
19:26 &lt;@dre^&gt; later dakine :)<br />
19:26 &lt; SpaceBass2&gt; im there<br />
19:26 &lt; SpaceBass2&gt; later dakine<br />
19:26 &lt;@dre^&gt; fix the hostnames<br />
19:26 &lt;@dre^&gt; vail.local becomes vail.nsnet.com<br />
19:27 &lt; SpaceBass2&gt; k<br />
19:27 &lt;@dre^&gt; and increment the generation ID by one<br />
19:27 &lt;@dre^&gt; (at the bottom)<br />
19:27 &lt; SpaceBass2&gt; fixed<br />
19:27 &lt;@dre^&gt; the generation ID is how the client tells if its local version of the config is stale<br />
19:28 &lt; SpaceBass2&gt; ah<br />
19:28 &lt; SpaceBass2&gt; that long integer at the btm?<br />
19:28 &lt;@dre^&gt; yes<br />
19:28 &lt; SpaceBass2&gt; k<br />
19:29 &lt;@dre^&gt; click OK to comit the changes<br />
19:29 &lt;@dre^&gt; click Save if it&#8217;s lit up<br />
19:29 &lt; SpaceBass2&gt; k<br />
19:29 &lt;@dre^&gt; go back to the client and run sudo kerberosautoconfig<br />
19:29 &lt;@dre^&gt; (we&#8217;ll do the server next if this works)<br />
19:29 &lt;@dre^&gt; then examine edu.mit.Kerberos on the client<br />
19:30 &lt;@dre^&gt; the kdc and kdc admin server should be reported as vail.nsnet.com<br />
19:30 &lt; SpaceBass2&gt; yep<br />
19:30 &lt; SpaceBass2&gt; it is<br />
19:30 &lt;@dre^&gt; ok great<br />
19:30 &lt;@dre^&gt; same thing on the OD master<br />
19:30 &lt; SpaceBass2&gt; on the master huh?<br />
19:30 &lt; SpaceBass2&gt; k<br />
19:30 &lt;@dre^&gt; aye<br />
19:31 &lt; SpaceBass2&gt; done<br />
19:31 &lt;@dre^&gt; now we want to sso_util configure again, same as before&#8230; lemme double check the usage<br />
19:31 &lt;@dre^&gt; sudo sso_util configure -r NSNET.COM -a whatever -p whatever all<br />
19:32 &lt;@dre^&gt; now you shoudl get correct keytabs<br />
19:32 &lt;@dre^&gt; if so, that *should* be it<br />
19:32 &lt; SpaceBass2&gt; still got warnings about the .local :(<br />
19:33 &lt;@dre^&gt; BAH<br />
19:33 &lt;@dre^&gt; and you did check that it got an updated edu.mit.kerberos, right?<br />
19:33 &lt;@dre^&gt; the od master<br />
19:33 &lt; SpaceBass2&gt; yeah<br />
19:34 &lt; SpaceBass2&gt; its correct<br />
19:34 &lt;@dre^&gt; hmm<br />
19:34 &lt;@dre^&gt; oh, uhm..<br />
19:34 &lt;@dre^&gt; well no, not a stale DS cache if hte on-disk file is correct<br />
19:35 &lt; SpaceBass2&gt; yeah, checking /L/P/edu&#8230;<br />
19:35 -!- Azhi_Dahaka [n=Azhi@unaffiliated/azhidahaka/x-172934] has quit []<br />
19:36 &lt;@dre^&gt; oooo<br />
19:36 &lt;@dre^&gt; I think I know :)<br />
19:37 &lt;@dre^&gt; you might have an &#8216;upgraded&#8217; sso_util<br />
19:37 &lt;@dre^&gt; from tiger<br />
19:37 &lt;@dre^&gt; md5 /usr/sbin/sso_util<br />
19:37 &lt;@dre^&gt; paste results pls<br />
19:37 &lt; SpaceBass2&gt; its a fresh install from leopard<br />
19:37 &lt;@dre^&gt; oh dammit<br />
19:37 &lt; SpaceBass2&gt; its a one liner<br />
19:37 &lt; SpaceBass2&gt; MD5 (/usr/sbin/sso_util) = 32a7a95f3e49502ddb0863583c30410d<br />
19:37 &lt; SpaceBass2&gt; 10.5.3 remember<br />
19:38 &lt;@dre^&gt; ppc?<br />
19:38 &lt; SpaceBass2&gt; yeah &#8230;<br />
19:38 &lt; SpaceBass2&gt; g4<br />
19:38 &lt;@dre^&gt; k, no problem. but that probably explains why its different from mine<br />
19:38 &lt;@dre^&gt; actually..<br />
19:38 &lt;@dre^&gt; file /usr/sbin/sso_util<br />
19:38 &lt;@dre^&gt; paste results<br />
19:38 &lt; SpaceBass2&gt; if I buy an xserver my wife call it quits<br />
19:39 &lt;@dre^&gt; heh, they are big and loud<br />
19:39 &lt; SpaceBass2&gt; http://pastebin.ca/1061784<br />
19:40 &lt; SpaceBass2&gt; can&#8217;t be louder than my 2u linux box :D<br />
19:40 &lt; SpaceBass2&gt; but might be hotter<br />
19:41 &lt;@dre^&gt; just looking for both a ppc and i386 image, that&#8217;s all&#8230;<br />
19:41 &lt;@dre^&gt; not really taht important.<br />
19:41 &lt;@dre^&gt; hmm, there&#8217;s supposed to be an sso_util debug mode&#8230;<br />
19:42 &lt; SpaceBass2&gt; is sso_util unique to OSX?<br />
19:42 &lt;@dre^&gt; here we go<br />
19:42 &lt;@dre^&gt; this is gonna be big-ass<br />
19:43 &lt;@dre^&gt; same sso_util command, but add: -v 7 after configure and before -r<br />
19:43 &lt;@dre^&gt; and pastebin results<br />
19:43 &lt; SpaceBass2&gt; which cmd?<br />
19:43 &lt; SpaceBass2&gt; the confgure ?<br />
19:43 &lt; SpaceBass2&gt; configure ?<br />
19:43 &lt;@dre^&gt; sso_util configure -v 7 &#8230;<br />
19:44 &lt; SpaceBass2&gt; any second Im going to forget and pastebin the admin passwd<br />
19:45 &lt;@dre^&gt; well at least your conscious of that possibility ;)<br />
19:46 &lt; SpaceBass2&gt; http://pastebin.ca/1061791</p>
<p><a href="http://dreness.com/bits/tech/applied_kerberos_troubleshooting/paste2" target="_blank">http://dreness.com/bits/tech/applied_kerberos_troubleshooting/paste2 </a></p>
<p>19:46 &lt;@dre^&gt; I suspect that the GerPrimaryHostName block will contain the error&#8230;<br />
19:47 &lt;@dre^&gt; oh snap, do you have multiple IPs on the od master?<br />
19:47 &lt; SpaceBass2&gt; leme check - I did under tiger server, but didn&#8217;t tink I did any more<br />
19:48 &lt;@dre^&gt; man pastebin.ca needs an upgrade<br />
19:48 &lt;@dre^&gt; still loading&#8230; there it goes<br />
19:48 &lt;@dre^&gt; shit<br />
19:48 &lt; SpaceBass2&gt; I had to do it under tiger b/c I did a DNS move (migrated from Windows Server&#8230;what a mistake that was) &#8230; but thats a long story<br />
19:49 &lt; SpaceBass2&gt; yeah&#8230;still have two IPs<br />
19:50 &lt; SpaceBass2&gt; don&#8217;t need the 2nd anymore since I&#8217;m not doing VPN on the OSX server anymore<br />
19:50 &lt;@dre^&gt; yep foudn the problem<br />
19:50 &lt;@dre^&gt; line 433<br />
19:51 &lt; SpaceBass2&gt; &lt;CFArray 0&#215;10ec80 [0xa07e7174]&gt;{type = immutable, count = 2, values = (<br />
19:51 &lt; SpaceBass2&gt; ?<br />
19:51 &lt;@dre^&gt; heh, no not that specific line<br />
19:51 &lt;@dre^&gt; but that begins a block&#8230;<br />
19:51 &lt;@dre^&gt; 432: GetPrimaryHostName<br />
19:51 &lt;@dre^&gt; then it steps through your network interfaces<br />
19:52 &lt;@dre^&gt; in the two blocks that follow<br />
19:52 &lt;@dre^&gt; for each interface, you see attributes like family, dnsName, name, serviceName, etc<br />
19:52 &lt;@dre^&gt; note that the second one has isPrimaryIPv4Interface<br />
19:52 &lt; SpaceBass2&gt; brb&#8230;.going to change root on several computers<br />
19:52 &lt;@dre^&gt; guess which one that is :)<br />
19:52 &lt;@dre^&gt; good idea<br />
19:53 &lt;@dre^&gt; you *should* be able to solve this by simply setting 10.1.1.5 as your primary address<br />
19:53 &lt;@dre^&gt; which you can do by drag / drop in the network prefpane&#8217;s list of interfaces (under &#8216;change network service order&#8217;, from the gear menu)<br />
19:54 &lt;@dre^&gt; woohoo, we found the problem!<br />
19:54 &lt; SpaceBass2&gt; one sec&#8230;<br />
19:55 &lt;@dre^&gt; do you mind if I post this chat log to my blog?<br />
19:55 &lt; SpaceBass2&gt; and I created a huge one<br />
19:55 &lt;@dre^&gt; yeah, heh. happens to everybody at one time or another&#8230;<br />
19:55 &lt; SpaceBass2&gt; no, please do&#8230;I was going to ask you if I could keep it too<br />
19:55 &lt;@dre^&gt; just be fast about changing and double-check access logs&#8230;<br />
19:56 &lt;@dre^&gt; I&#8217;ve actually typed passwords directly into IRC before, when I thought a certain window had focus but between the time that it had focus and the time I typed the password, something caused a change in window focus&#8230;<br />
19:56 &lt;@dre^&gt; like an errant mouse click, for instance&#8230;<br />
19:56 &lt; SpaceBass2&gt; ok&#8230; ssh closed &#8230;. passwords changed<br />
19:57  * SpaceBass2 wipes brow<br />
19:57 &lt;@dre^&gt; so anyway, do you see what&#8217;s going on line 432?<br />
19:57 &lt;@dre^&gt; &#8220;going on on line 432&#8243;<br />
19:58 &lt;@dre^&gt; &#8220;GetPrimaryHostName&#8221;&#8230; this result will be used to form the server name portion of the kerberos service principal<br />
19:58 &lt; SpaceBass2&gt; leme look<br />
19:59 &lt;@dre^&gt; looking at the two blocks directly following (434 - 439 and 441 - 448), you can see attributes that look like they are related to network interfaces<br />
19:59 &lt;@dre^&gt; like ipAddress, dnsName, family, etc<br />
19:59 &lt; SpaceBass2&gt; ahhhh<br />
19:59 &lt; SpaceBass2&gt; snap!<br />
19:59 &lt;@dre^&gt; so the bonus question is:<br />
19:59 &lt;@dre^&gt; how does the system determine what the primary hostname is?<br />
19:59 &lt; SpaceBass2&gt; of course<br />
19:59 &lt;@dre^&gt; look at the differences in the attributes for each interface<br />
19:59 &lt; SpaceBass2&gt; there&#8217;s no DNS entry for the 2nd interface<br />
20:00 &lt;@dre^&gt; well&#8230; they both have dnsName<br />
20:00 &lt;@dre^&gt; but what attribute is present for one but not the other?<br />
20:00 &lt; SpaceBass2&gt; looking<br />
20:00 &lt;@dre^&gt; ok there&#8217;s two&#8230; userDefinedName, and one other&#8230; the other one is the key :)<br />
20:01 &lt; SpaceBass2&gt; yep&#8230; .nsnet.com vs .local<br />
20:01 &lt; SpaceBass2&gt; binbo<br />
20:01 &lt; SpaceBass2&gt; bingo<br />
20:01 &lt;@dre^&gt; no no<br />
20:01 &lt;@dre^&gt; keep looking<br />
20:01 &lt;@dre^&gt; how does it know which of those to choose?<br />
20:01 &lt; SpaceBass2&gt; en0?<br />
20:01 &lt;@dre^&gt; nope<br />
20:01 &lt;@dre^&gt; which attribute is present for one but not the other?<br />
20:01 &lt; SpaceBass2&gt; ok&#8230;leme keep looking<br />
20:01 &lt;@dre^&gt; besides userDefinedName<br />
20:01 &lt; SpaceBass2&gt; dont tell me<br />
20:02 &lt;@dre^&gt; en0 is not an attribute, it&#8217;s a value<br />
20:02 &lt; SpaceBass2&gt; d&#8217;oh<br />
20:02 &lt; SpaceBass2&gt; isPrimaryIPv4Interface = true<br />
20:02 &lt;@dre^&gt; the attribute that corresponds to en0 is &#8216;name&#8217;, as in the bsd name of the interface<br />
20:02 &lt;@dre^&gt; yep, that&#8217;s the one<br />
20:02 &lt; SpaceBass2&gt; I&#8217;m actually laughing out loud<br />
20:02 &lt;@dre^&gt; so then, how do you set which is the primary interface? :)<br />
20:02 &lt; SpaceBass2&gt; never in a million years<br />
20:02 &lt; SpaceBass2&gt; well now, thats a good question<br />
20:03 &lt;@dre^&gt; there is a very easy GUI answer, also :)<br />
20:03 &lt; SpaceBass2&gt; b/c the one it identifies as primary is actually a copy<br />
20:03 &lt;@dre^&gt; and that&#8217;s perfectly legit<br />
20:03 &lt; SpaceBass2&gt; I&#8217;m guessing you go into network prefs and drag it first<br />
20:03 &lt;@dre^&gt; yep!<br />
20:03 &lt; SpaceBass2&gt; ALRIGHT!<br />
20:03 &lt;@dre^&gt; the top-most active interface is the primary<br />
20:03 &lt;@dre^&gt; you should be able to simply make that change and re-run sso_util<br />
20:04 &lt; SpaceBass2&gt; ok &#8230;what if I just delete it?<br />
20:04 &lt; SpaceBass2&gt; since I dont need it?<br />
20:04 &lt;@dre^&gt; well&#8230; that could be a problem<br />
20:04 &lt; SpaceBass2&gt; ok<br />
20:04 &lt;@dre^&gt; because when you promote to master, the primary hostname / address is encoded in several spots<br />
20:04 &lt;@dre^&gt; but no fear: changeip to the rescue<br />
20:05 &lt;@dre^&gt; so you want to changeip over to .15 / vail.nsnet.com<br />
20:05 &lt;@dre^&gt; see the changeip manpage for examples<br />
20:05 &lt; SpaceBass2&gt; ok,&#8230; the one listed as primary is actually 2nd in the gui<br />
20:05 &lt;@dre^&gt; really?!?<br />
20:05 &lt; SpaceBass2&gt; yeah<br />
20:05 &lt;@dre^&gt; well, which gui<br />
20:05 &lt;@dre^&gt; are you in &#8216;change network service order&#8217;, or the overview?<br />
20:06 &lt;@dre^&gt; sorry, &#8217;set network service order&#8217;, under the gear menu<br />
20:06 &lt; SpaceBass2&gt; http://www.flickr.com/photos/nickdawson/2634507389/</p>
<p><img src="http://www.dreness.com/blog/wp-content/uploads/2008/07/2634507389_b6afcbb829.jpg" alt="2634507389_b6afcbb829.jpg" /></p>
<p>20:06 &lt;@dre^&gt; which is just above the lock<br />
20:06 &lt;@dre^&gt; ya, click the gear icon<br />
20:06 &lt;@dre^&gt; &#8217;set network service order&#8217;<br />
20:06 &lt; SpaceBass2&gt; modem, if1 (.15) firewire if2 (.17)<br />
20:07 &lt; SpaceBass2&gt; .17 is the one set as .local and primary and is not needed<br />
20:07 &lt;@dre^&gt; .17 should appear above .15 in the &#8217;set network service order&#8217; list<br />
20:07 &lt;@dre^&gt; since it is in fact the primary, and that list order is supposed to be what defines the primary<br />
20:08 &lt;@dre^&gt; on the ohter hand<br />
20:08 &lt;@dre^&gt; most of hte system appears to believe that vail.nsnet.com is the primary hostname<br />
20:08 &lt;@dre^&gt; which suggest that somehow, somewhere, the network config got confused<br />
20:08 &lt;@dre^&gt; what I would try is simply dragging .17 to the top, and then dragging .15 to the top<br />
20:09 &lt;@dre^&gt; which should re-set the isPrimaryIPv4Interface to be correct<br />
20:09 &lt; SpaceBass2&gt; back&#8230;had to get power<br />
20:09 &lt; SpaceBass2&gt; http://www.flickr.com/photos/nickdawson/2635335214/</p>
<p><img src="http://www.dreness.com/blog/wp-content/uploads/2008/07/2635335214_1c1a36fc13.jpg" alt="2635335214_1c1a36fc13.jpg" /></p>
<p>20:10 &lt;@dre^&gt; yeah just try dragging &#8216;ethernet&#8217; to the top<br />
20:10 &lt;@dre^&gt; er sorry<br />
20:10 &lt;@dre^&gt; oh wow<br />
20:10 &lt;@dre^&gt; no this is very broken<br />
20:10 &lt;@dre^&gt; lol<br />
20:10 &lt; SpaceBass2&gt; lol!<br />
20:10 &lt;@dre^&gt; both of those interfaces claim to be &#8216;en0&#8242;<br />
20:11 &lt;@dre^&gt; which is theoretically impossible<br />
20:11 &lt; SpaceBass2&gt; well, in linux-speak &#8230; en1 and en1:1<br />
20:11 &lt;@dre^&gt; right, but when you create virtual interfaces in os x, they each get unique bsd names<br />
20:11 &lt; SpaceBass2&gt; in other words 10.1.1.17 is a vitrual IP<br />
20:11 &lt; SpaceBass2&gt; right<br />
20:11 &lt; SpaceBass2&gt; and bsd interface names baffle me :D<br />
20:12 &lt;@dre^&gt; hmm&#8230; actually maybe I&#8217;m wrong about that. ifconfig would show them in teh same physical interface<br />
20:12 &lt;@dre^&gt; os maybe this isn&#8217;t horribly broken as I thought<br />
20:12 &lt;@dre^&gt; but they are definitely ordered wrong, or at least the OS thinks they are<br />
20:12 &lt;@dre^&gt; (you can use ifconfig to read, but should not use it to change settings)<br />
20:12 &lt; SpaceBass2&gt; how detrimental would it be to delete the virtual IP?<br />
20:12 &lt;@dre^&gt; (the os x equivalent is ipconfig)<br />
20:13 &lt;@dre^&gt; probably not very, since your system already thinks it is vail.nsnet.com<br />
20:13 &lt; SpaceBass2&gt; yeah, I know ifconfig :D &#8230;<br />
20:13 &lt;@dre^&gt; except for this one little piece of configuration which is wrong<br />
20:13 &lt;@dre^&gt; but just to be safe, disable it instead of deleting<br />
20:13 &lt; SpaceBass2&gt; ok<br />
20:13 &lt;@dre^&gt; gear &#8211;&gt; make service inactive<br />
20:13 &lt;@dre^&gt; that way you can always turn it on if something assplodes<br />
20:14 &lt; SpaceBass2&gt; is that the same as ifconfig &lt;interface&gt; down ?<br />
20:14 &lt;@dre^&gt; yes, but don&#8217;t do that in os x<br />
20:14 &lt;@dre^&gt; you should only use ifconfig to read settings, not write them<br />
20:14 &lt; SpaceBass2&gt; yeah?<br />
20:14 &lt; SpaceBass2&gt; you mentioned that<br />
20:14 &lt;@dre^&gt; (because ifconfig bypasses the system frameworks that are used by the rest of the OS)<br />
20:15 &lt; SpaceBass2&gt; I always have to remind myself that bash in osx is truly just a shell<br />
20:15 &lt;@dre^&gt; so you could make a change, but hte OS doens&#8217;t know the change was made (only the very low networking layers), and so e.g. network prefs would be totally ignorant of the change<br />
20:15 &lt; SpaceBass2&gt; which is arguably the way it should be<br />
20:15 &lt;@dre^&gt; if you want to make network changes from the cli, use ipconfig or networksetup<br />
20:16 &lt;@dre^&gt; so disable the interface and re-run sso_util<br />
20:16 &lt;@dre^&gt; brb, potty<br />
20:16 &lt; SpaceBass2&gt; jawdrop - ipconfig is a binary in 10.5 &#8230; wow<br />
20:18 &lt; SpaceBass2&gt; ok &#8230; re-ran and same result &#8230;still .local<br />
20:18 &lt; SpaceBass2&gt; but I feel that we are very close :D<br />
20:18 &lt;@dre^&gt; hmm<br />
20:18 &lt;@dre^&gt; let me see that relevant hunk of sso_util configure -v 7 output<br />
20:19 &lt; SpaceBass2&gt; Entry for principal ftp/vail.local@NSNET.COM with kvno 7, encryption type ArcFour with HMAC/md5 added to keytab WRFILE:/etc/krb5.keytab.<br />
20:19 &lt;@dre^&gt; the part where it detects network name<br />
20:19 &lt; SpaceBass2&gt; leme get it<br />
20:19 &lt;@dre^&gt; GetPrimaryHostName<br />
20:20 &lt; SpaceBass2&gt; http://pastebin.ca/1061809</p>
<p><a href="http://dreness.com/bits/tech/applied_kerberos_troubleshooting/paste3"> http://dreness.com/bits/tech/applied_kerberos_troubleshooting/paste3</a></p>
<p>20:21 &lt;@dre^&gt; (loading)<br />
20:24 &lt;@dre^&gt; well tha&#8217;ts bizarre&#8230;<br />
20:24 &lt;@dre^&gt; it still think vail.local is primary<br />
20:26 &lt;@dre^&gt; maybe you will need to delete .17<br />
20:26 &lt;@dre^&gt; it could also be that the settings are horked enough that you cannot change them<br />
20:26 &lt; SpaceBass2&gt; yeah, not ruling that out<br />
20:26 &lt;@dre^&gt; (you did remember to click Apply right?)<br />
20:26 &lt;@dre^&gt; in network prefs&#8230;<br />
20:27 &lt; SpaceBass2&gt; heck, let me delete it and see<br />
20:27 &lt; SpaceBass2&gt; yeah, closed prefs and re-opned even<br />
20:28 &lt; SpaceBass2&gt; BOOM!<br />
20:28 &lt; SpaceBass2&gt; removed it and bingop<br />
20:28 &lt; SpaceBass2&gt; bingo<br />
20:28 &lt; SpaceBass2&gt; xmpp/vail.nsnet.com@NSNET.COM<br />
20:28 &lt;@dre^&gt; woot!<br />
20:28 &lt; SpaceBass2&gt; high-five!<br />
20:28 &lt;@dre^&gt; ^5 :)</p>
<p>Epilogue:  After re-reading this, I realized that his afp server is actually a separate host from his OD master (vail), but the same troubleshooting steps apply&#8230; so in the end, I might not have actually fixed the AFP mounting problem, but we did fix at least *some* problems :)</p>
<p>Finally: if anyone knows how to make WordPress not DELETE AN ENTIRE POST when you paste in a chunk of text that is too big; or, how to adjust this threshold, please tell me. This post took entirely too long to compose, as I had to move text around in increasingly smaller chunks to work around this problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/archives/43/feed</wfw:commentRss>
		</item>
		<item>
		<title>Exploring Leopard&#8217;s Local KDC</title>
		<link>http://www.dreness.com/blog/archives/42</link>
		<comments>http://www.dreness.com/blog/archives/42#comments</comments>
		<pubDate>Tue, 13 May 2008 12:18:32 +0000</pubDate>
		<dc:creator>dre</dc:creator>
		
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/archives/42</guid>
		<description><![CDATA[I recently had an excuse to dig into Leopard&#8217;s local KDC (LKDC), and have created a page on my wiki to hold the results. Some excerpts below:
The Local KDC (LKDC) is a Kerberos implementation that extends &#8220;single sign-on&#8221; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had an excuse to dig into Leopard&#8217;s local KDC (LKDC), and have created <a href="http://www.dreness.com/wikimedia/index.php?title=LKDC" target="_blank">a page on my wiki</a> to hold the results. Some excerpts below:</p>
<p>The Local KDC (LKDC) is a Kerberos implementation that extends &#8220;single sign-on&#8221; capabilities into ad-hoc networks. The LKDC supports the AFP, CIFS, and VNC services included in Mac OS X and Mac OS X Server. At the surface, the LKDC looks pretty much just like a regular Kerberos setup&#8230; you can log into one of the above named services and get Kerberos tickets, use standard tools like klist to manage tickets, use kadmin to administer the KDC, etc, etc.</p>
<p>The crux of the LKDC implementation is the use of a SHA1 hash in place of the server name portion of a kerberos principal, effectively insulating Kerberos from dynamic network conditions. This significant re-definition of a kerberos principal is really cool, but also not standard. The standard kerberos libraries pretty much assume and require that the server name portion of a kerberos principal be just that: a server name (or IP address).</p>
<p>This presents two primary challenges:<br />
* Advertising and discovering LKDC realm information in an ad-hoc, peer to peer context<br />
* Harnessing the authentication process to construct the special kerberos principal and then handing it off to Kerberos</p>
<p>The mechanism used to advertise and discover LKDC information is multicast DNS, as it is very well suited to ad-hoc networks. In other more standard Kerberos deployments, it it not unusual to use DNS to discover Kerberos information in the absence of local configuration (see references at the bottom of the page), but with standard kerberos, the discovery is limited to realm name or KDC name.</p>
<p>The notion of using a unique hash as the sever name portion of the principal name is a new idea, so we cannot rely on standard Kerberos libraries to be able to construct the correct principal name based on the LKDC&#8217;s realm name. Accordingly, the authentication process is brokered for supported service clients, in order to perform the LKDC realm name discovery and then construct a kerberos principal name that is correct for the remote LKDC. Once the correct service principal name is obtained, it is handed off to Kerberos and works normally.</p>
<p>The client-side authentication broker (for supported services!) is called NetAuthAgent, and you&#8217;ll see it get fired up whenever you use vnc, afp, cifs. Think of this as a session manager, of sorts.</p>
<p>Most of the advertisement, discovery, and management functions involving the LKDC are provided by a private framework called KerberosHelper, and a Kerberos framework plugin called LKDCLocate.</p>
<p>Check the <a href="http://www.dreness.com/wikimedia/index.php?title=LKDC" target="_blank">LKDC wiki page</a> for more details.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/archives/42/feed</wfw:commentRss>
		</item>
		<item>
		<title>disksleep</title>
		<link>http://www.dreness.com/blog/archives/40</link>
		<comments>http://www.dreness.com/blog/archives/40#comments</comments>
		<pubDate>Fri, 16 Nov 2007 05:13:40 +0000</pubDate>
		<dc:creator>dre</dc:creator>
		
		<category><![CDATA[OS X]]></category>

		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/archives/40</guid>
		<description><![CDATA[The purpose of this script is to add a bit of granularity and intelligence to the energy saver settings in Mac OS X for disk sleep.
Problem: I want to let my disks sleep, but I HATE having to wait for a spinup while I&#8217;m working.
Solution: Allow the disks to spin down only when I&#8217;m not [...]]]></description>
			<content:encoded><![CDATA[<p>The purpose of this script is to add a bit of granularity and intelligence to the energy saver settings in Mac OS X for disk sleep.</p>
<p>Problem: I want to let my disks sleep, but I HATE having to wait for a spinup while I&#8217;m working.</p>
<p>Solution: Allow the disks to spin down only when I&#8217;m not at the computer, and disable disk sleep while I&#8217;m at the computer. The mechanism for twiddling the disk sleep settings is the pmset tool.</p>
<p>This all works pretty much as described, with one caveat. Disks that are spun down when disk sleep is *disabled* (such as when you come back after an idle period) do not immediately spin up. Once accessed, they spin up and stay spun up until you go idle again. So, using this script, you may occasionally have to wait for a spinup, but never more than once per disk, per session.</p>
<p>Here is the script, and here is a launchd plist for it. <a href="http://dreness.com/bits/tech/disksleep">Here is the script</a>, and <a href="http://dreness.com/bits/tech/com.dreness.disksleep.plist">here is a launchd plist</a> for it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/archives/40/feed</wfw:commentRss>
		</item>
		<item>
		<title>Tiger Server servermgrd library for Python</title>
		<link>http://www.dreness.com/blog/archives/38</link>
		<comments>http://www.dreness.com/blog/archives/38#comments</comments>
		<pubDate>Tue, 12 Jun 2007 04:07:11 +0000</pubDate>
		<dc:creator>dre</dc:creator>
		
		<category><![CDATA[OS X Server]]></category>

		<category><![CDATA[development]]></category>

		<category><![CDATA[scripts]]></category>

		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/archives/38</guid>
		<description><![CDATA[motivation
I finally found a reason to write some Python. Being something of a monitoring and data junkie, I&#8217;ve had a fair amount of experience with snmp, data mining scripts, etc. After writing this post to the server list, I figured I&#8217;d make some templates for snmp that published interesting pieces of data about the server. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>motivation</strong><br />
I finally found a reason to write <a href="http://www.dreness.com/bits/tech/srvrmgrIO/srvrmgrdIO.py">some Python</a>. Being something of a monitoring and data junkie, I&#8217;ve had a fair amount of experience with snmp, data mining scripts, etc. After writing <a href="http://lists.apple.com/archives/macos-x-server/2007/Jun/msg00021.html">this post to the server list</a>, I figured I&#8217;d make some templates for snmp that published interesting pieces of data about the server. A lot of good stuff can be retrieved through servermgrd, the &#8216;Mac OS X Server administrative daemon&#8217;, which is basically a little web service that uses xml plists to do request / response transactions. Usually the only software that talks to servrmgrd is Apple&#8217;s Server Admin utility, but the enterprising sysadmin can strike up his or her own conversations. This post documents my python baby steps, as well as the birth of a tiny python library I wrote for simplifying servermgrd interactions.</p>
<p>If you happen to have a Mac OS X Server handy, point your web browser at https://your.server:311. Accept the ol&#8217; SSL warnings, and then you&#8217;ll be presented with a list of servermgrd modules. Each module has its own html / cgi wrapper which provides a menu of request templates, e.g.</p>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;plist version="0.9"&gt;
&lt;dict&gt;
    &lt;key&gt;command&lt;/key&gt;
    &lt;string&gt;getState&lt;/string&gt;
    &lt;key&gt;variant&lt;/key&gt;
    &lt;string&gt;withDetails&lt;/string&gt;
&lt;/dict&gt;
&lt;/plist&gt;</pre>
<p>Different modules support different commands, some with optional arguments (e.g. variant, timescale). Clicking &#8216;Send Command&#8217; will do just that, and you&#8217;ll see the results as returned by servermgrd. Not surprisingly, the result is also an xml plist.</p>
<p>We&#8217;ll definitely want some sort of plist parsing library to let us grab ahold of this data in a fairly painless way. This was ultimately why I chose Python for the task; because Mac OS X ships with a little Python library called <a href="http://svn.red-bean.com/bob/plistlib/trunk/plistlib.py">plistlib</a>. plistlib is pretty basic; you give it a plist and it will hand over a data structure with all the stuff in it.</p>
<p><strong>Dive in: the python interpreter, arrays, and dicts in like 3 minutes</strong><br />
First let&#8217;s find a plist we can use to test. We&#8217;ll need to convert it to xml format, as many plists are stored on disk in a biniary format these days. Let&#8217;s take our Dock plist and make an xml copy of it at ~/test.plist</p>
<pre>plutil -convert xml1 -o test.plist ~/Library/Preferences/com.apple.dock.plist</pre>
<p>Now let&#8217;s try plistlib through an interactive python session.</p>
<pre>{29} andre@donk [~] % python
Python 2.3.5 (#1, Aug 12 2006, 00:08:11)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import plistlib
&gt;&gt;&gt; pl = plistlib.Plist.fromFile('test.plist')
&gt;&gt;&gt;</pre>
<p>Cool, no errors! (right? ;) Simply say the name of the object to see its contents:</p>
<pre>&gt;&gt;&gt; pl</pre>
<p>Woof, lots of output. Here&#8217;s where it gets fun. This is a dict, which a collection of property / value pairs. let&#8217;s iterate through the items.</p>
<pre>&gt;&gt;&gt; for item in pl : print item
...
wvous-br-corner
orientation
mod-count
tilesize
trash-full
persistent-apps
pinning
wvous-br-modifier
version
launchanim
autohide
persistent-others
checked-for-dashboard</pre>
<p>Those are properties. Properties have values.</p>
<pre>&gt;&gt;&gt; pl['trash-full']
True
&gt;&gt;&gt; pl['launchanim']
False</pre>
<p>Iterate through all the items and display them as key &#8211;&gt; value pairs:</p>
<pre>&gt;&gt;&gt; for item in pl : print item, ' --&gt; ', pl[item]
...</pre>
<p>Let&#8217;s drill down into that persistent-apps item. It appears to be a bunch of nested stuff, all wrapped in a single list (array). Let&#8217;s list the properties of one of the apps; we&#8217;ll pick the first one (list index 0).</p>
<pre>&gt;&gt;&gt; for item in pl['persistent-apps'][0] : print item
...
tile-data
tile-type
GUID</pre>
<p>That&#8217;s a bit more managable. Let&#8217;s examine these.</p>
<pre>&gt;&gt;&gt; pl['persistent-apps'][0]['GUID']
289528741
&gt;&gt;&gt; pl['persistent-apps'][0]['tile-type']
'file-tile'
&gt;&gt;&gt; pl['persistent-apps'][0]['tile-data']
Dict(**{'parent-mod-date': 3264304302L, 'file-label': 'System Preferences', 'file-data': ...</pre>
<p>tile-data has more nested stuff, but now we can easily pick out file-label as the human readable name of the thing. Remember how we got here? Iterate through all the persistent-apps, look into the tile-data dict, then print the value of the file-label property</p>
<pre>&gt;&gt;&gt; for app in pl['persistent-apps'] : print app['tile-data']['file-label']
...
System Preferences
iChat
Mail
iTunes
Safari
Terminal
Quake 4
TextEdit
World of Warcraft
Hex Fiend</pre>
<p>Pretty much everything that comes out of plistlib is either a dict or an array, and there&#8217;s often some nesting, so you sorta have to grope the format a bit to figure out how you want to access the data. Definitely beats the crap out of hand parsing :)</p>
<p><strong>what about servermgrd?</strong><br />
servermgrd can be harnessed either via http or a shell. We&#8217;ll use a shell. In that mode, the request is delivered via standard input, and the result is&#8230; well ya know. output. Let&#8217;s build a request. After playing with the web interface for a while, its obvious that the various requests are formated the same way. The value of the &#8216;command&#8217; property is the most significant part. Some commands have additional parameters, such as &#8216;variant&#8217; or &#8216;timescale&#8217;. Our request-building function shall be called buildXML.</p>
<pre>def buildXML ( command, variant, timescale ) :
  request = """&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;plist version="0.9"&gt;
&lt;dict&gt;
        &lt;key&gt;command&lt;/key&gt;
        &lt;string&gt;"""
  request = request + command
  request = request + '&lt;/string&gt;'
  if timescale != '' :
    request = request + """
        &lt;key&gt;timeScale&lt;/key&gt;
        &lt;integer&gt;"""
    request = request + timescale
    request = request + '&lt;/integer&gt;'
  if variant != '' :
    request = request + """
        &lt;key&gt;variant&lt;/key&gt;
        &lt;string&gt;"""
    request = request + variant
    request = request + '&lt;/string&gt;'
  request = request + """
&lt;/dict&gt;
&lt;/plist&gt;"""
  return request</pre>
<p>buildXML is called like this:</p>
<pre>request = buildXML('getHistory', 'v1+v2', '60')</pre>
<p>Sometimes you need not specify anything more than command. In these cases, supply a null value for any unused parameters using empty single quotes.</p>
<p>Now that we have a request, we can send it to servermgrd by opening a pipe. We&#8217;ll use popen2 so we can grab both STDIN and STDOUT. The filesystem path we use depends on the name of the module we&#8217;re targetting. Here is our sendXML function, which is called with the name of the servermgrd module and the xml request.</p>
<pre>def sendXML ( servermgrdModule, request ) :
  modulePath = '/usr/share/servermgrd/cgi-bin/'+servermgrdModule
  pipeIn, pipeOut = os.popen2(`modulePath`)
  print &gt;&gt;pipeIn, request
  pipeIn.close()
  xmlresult = pipeOut.read(20480)
  pipeOut.close()</pre>
<p>We now have xmlresult, which is a string containing the entire result body from servermgrd. Plistlib is accustomed to parsing plists from files, but we don&#8217;t want to write this data to the filesystem because we don&#8217;t want to keep it. Instead, we&#8217;ll finish this function by creating a file-like object (like a file, but without any of that annoying disk access) which contains the result, using the StringIO library, then hand that file-like object to plistlib. plistlib parses the xml into native data structures (dicts, arrays), and we return the result.</p>
<pre>  xmlFauxFile = StringIO.StringIO(xmlresult)
  return plistlib.Plist.fromFile(xmlFauxFile)</pre>
<p><strong>Examples</strong><br />
I recommend exploring the XML plist you can get from servermgrd through the eyes of the python interpreter using the techniques demonstrated with the Dock example. To get started, simply download the <a href="http://www.dreness.com/bits/tech/srvrmgrIO/srvrmgrdIO.py">servermgrd.py library</a>, then enter the python interpreter as root on a Tiger Server, while your current directory is the same as servermgrd.py&#8217;s directory (or else the import fails).</p>
<pre>{131} root@tiny [~] # python
Python 2.3.5 (#1, Jul 25 2006, 00:38:48)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import srvrmgrdIO
&gt;&gt;&gt; request = srvrmgrdIO.buildXML('getHistory', 'v1', '60')
&gt;&gt;&gt; pl = srvrmgrdIO.sendXML('servermgr_info', request)
&gt;&gt;&gt; pl
Plist(**{'v2Legend': 'NETWORK_THROUGHPUT', 'v5Legend': 'NETWORK_THROUGHPUT_EN0', ...</pre>
<p>Here&#8217;s some quick examples of how this library can be used. There is much more available data than is being shown.</p>
<pre>#!/usr/bin/python
# We require the srvrmgrdIO module to prepare the request and talk to servermgrd
import re
import srvrmgrdIO
import time

print 'network bytes / second over the last 15 minutes:'
request = srvrmgrdIO.buildXML('getHistory', 'v1+v2', '900')
pl = srvrmgrdIO.sendXML('servermgr_info', request)
for s in pl['samplesArray'] :
  print s['v1'], 'at', time.ctime(s['t'])
print ""

# dns - this one's real slow for some reason...
#request = srvrmgrdIO.buildXML('getStatistics', '', '')
#pl = srvrmgrdIO.sendXML('servermgr_dns', request)

#print "DNS: success / fail / recursive / referral / nxdomain"
#print `pl['success']` + ' /',
#`pl['failure']` + ' /',
#`pl['recursion']` + ' /',
#`pl['referral']` + ' /',
#`pl['nxdomain']`
#print ""

# afp connected users
request = srvrmgrdIO.buildXML('getConnectedUsers', '', '')
pl = srvrmgrdIO.sendXML('servermgr_afp', request)
print "AFP Users:"
for u in pl['usersArray'] :
  print u['ipAddress'] + " ==&gt; " + u['name']
print ""

# dirserv
print "Directory Services"
request = srvrmgrdIO.buildXML('getState', 'withDetails', '')
pl = srvrmgrdIO.sendXML('servermgr_dirserv', request)

for s in pl :
  if re.search("stat", s, re.I) : print s," ==&gt; ",`pl[s]`</pre>
<p>When executed on my server:</p>
<pre>{4} root@tiny [~] # ./satest.py
network bytes / second over the last 15 minutes:
38 at Mon Jun 11 19:56:14 2007
35 at Mon Jun 11 19:55:14 2007
35 at Mon Jun 11 19:54:14 2007
35 at Mon Jun 11 19:53:14 2007
38 at Mon Jun 11 19:52:14 2007
35 at Mon Jun 11 19:51:14 2007
43 at Mon Jun 11 19:50:14 2007
43 at Mon Jun 11 19:49:14 2007
33 at Mon Jun 11 19:48:14 2007
38 at Mon Jun 11 19:47:14 2007
40 at Mon Jun 11 19:46:14 2007
36 at Mon Jun 11 19:45:14 2007
35 at Mon Jun 11 19:44:14 2007
26 at Mon Jun 11 19:43:14 2007
36 at Mon Jun 11 19:42:14 2007

AFP Users:
10.0.1.201 ==&gt; andre
10.0.1.6 ==&gt; andre

Directory Services
timState  ==&gt;  'STOPPED'
ldapdState  ==&gt;  'RUNNING'
kdcStatus  ==&gt;  'RUNNING'
lookupdState  ==&gt;  'RUNNING'
passwordServiceState  ==&gt;  'RUNNING'
state  ==&gt;  'RUNNING'
netinfodState  ==&gt;  'RUNNING'
netinfodParentState  ==&gt;  'STOPPED'</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/archives/38/feed</wfw:commentRss>
		</item>
		<item>
		<title>DNS Zone File record generation script</title>
		<link>http://www.dreness.com/blog/archives/37</link>
		<comments>http://www.dreness.com/blog/archives/37#comments</comments>
		<pubDate>Fri, 08 Jun 2007 00:18:13 +0000</pubDate>
		<dc:creator>dre</dc:creator>
		
		<category><![CDATA[OS X Server]]></category>

		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/archives/37</guid>
		<description><![CDATA[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(/\./, [...]]]></description>
			<content:encoded><![CDATA[<p>In wrote the following as part of my response to <a href="http://lists.apple.com/archives/Macos-x-server/2007/Jun/msg00097.html">this</a>.
<pre>#!/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(/\./, $AddressPrefix)));

# For our resulting address and ptr records
my @A, my @PTR = "";

foreach my $n ( eval $range ) {
push @A, "dhcp$n IN A $AddressPrefix.$n";
push @PTR, "$n.$octets.in-addr.arpa. IN PTR dhcp$n.$tld.";
}

print "Forward zone address records:\n";
print "$_\n" for @A;
print "\nReverse zone ptr records:";
print "$_\n" for @PTR;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/archives/37/feed</wfw:commentRss>
		</item>
		<item>
		<title>Eggdrop TCL using Google&#8217;s SOAP API</title>
		<link>http://www.dreness.com/blog/archives/36</link>
		<comments>http://www.dreness.com/blog/archives/36#comments</comments>
		<pubDate>Mon, 28 May 2007 06:04:05 +0000</pubDate>
		<dc:creator>dre</dc:creator>
		
		<category><![CDATA[development]]></category>

		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/archives/36</guid>
		<description><![CDATA[Link to google-soap
I was helping my brother with a script called incith-google used by one of his IRC bots. It acts as a bridge between IRC and google, allowing IRC users to perform queries against google from the comfort of their IRC client. The script performs the search on the IRC user&#8217;s behalf and returns [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.dreness.com/bits/tech/google-soap">Link to google-soap</a></p>
<p>I was helping my brother with a script called <a href="http://www.woota.net/~madwoota/incith-google-current.tar.gz">incith-google</a> used by one of his IRC bots. It acts as a bridge between IRC and google, allowing IRC users to perform queries against google from the comfort of their IRC client. The script performs the search on the IRC user&#8217;s behalf and returns the result back into the IRC channel.</p>
<p>The problem is that it had broken. In investigating, it became readily apparent that it was bound to break, and surely had broken before. This is because the script was making the request to google as if it were a web browser, and receiving html output in return. The IRC client only wants to see a short bit of text, so the script attempts to parse out the juicy bits from the html output. This process of <a href="http://en.wikipedia.org/wiki/Screen_scraping">screen scraping</a> is wobbly at best; any subtle formating or presentation change of the google search results web page can break the script entirely. This happens frequently due to the web&#8217;s inherent tendency to mix content and presentation semantics; the good news is that the w3c is <a href="http://www.w3.org/2001/tag/doc/contentPresentation-26.html">finally catching on to this</a>.</p>
<p>A more robust way to do these types of interactions would be to use a more rigorous and starndardized process for asking questions and getting answers; in a word: <a href="http://en.wikipedia.org/wiki/Api">API</a>. A large part of the value of API is that the semantics of exchanging information and interacting witih other pieces of software are &#8216;locked down&#8217;, in the sense that the API vendor wants you to trust that those semantics will continue to work as designed, for the life of the API. It just so happens that Google has <a href="http://code.google.com/apis/">several APIs</a> for accessing their various services. Because Eggdrop scripting is done solely in TCL, I started there. It didn&#8217;t take long to find <a href="http://members.cox.net/~gerald.lester/WebServicesForTcl.html">Web Services For TCL</a>, which is precisely what I needed.</p>
<p>One downside to the Web Services for Tcl library is that there are a significant number of other (mostly non-standard) Tcl libraries on which it is dependant. Tcl has no package / module / library management system that might ease the process of installing these other libraries, so it took me a bit of time to get it all going (and I mostly know what I&#8217;m doing). The average Eggdrop user learned unix in order to utilize Eggdrop itself, so they are typically not of the sysadmin variety (as it happens, Eggdrop is what initially got me in to Unix, though I&#8217;ve come a bit of a ways since 1995 or so).</p>
<p>A bigger downside is that Google no longer allocates new <a href="http://code.google.com/apis/soapsearch/">SOAP API</a> keys, so if you didn&#8217;t get one prior to Dec 5, 2006, you are s.o.l. I got one for some reason, even though I&#8217;m only really getting around to using it now. heh.</p>
<p>Anyway, after going through all the trouble of getting this library operational, If figured I&#8217;d go ahead and bang out a quick eggdrop interface to Google based on Web Services for Tcl, so <a href="http://www.dreness.com/bits/tech/google-soap">there you have it</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/archives/36/feed</wfw:commentRss>
		</item>
		<item>
		<title>Apple airport base station monitor</title>
		<link>http://www.dreness.com/blog/archives/32</link>
		<comments>http://www.dreness.com/blog/archives/32#comments</comments>
		<pubDate>Sat, 28 Apr 2007 03:33:31 +0000</pubDate>
		<dc:creator>dre</dc:creator>
		
		<category><![CDATA[OS X]]></category>

		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/archives/32</guid>
		<description><![CDATA[Download.

{1} andre@dude [~] % airport -h
Program Options:
      -h           print this help
      -d           output in comma delimited format
         [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://dreness.com/bits/tech/airport">Download</a>.</p>
<pre>
{1} andre@dude [~] % airport -h
Program Options:
      -h           print this help
      -d           output in comma delimited format
                   (base station ID lines are designated by '*')
      -v           verbose mode
                   (stacks up to 3 times)
      --encode     Specify plaintext to retrieve the base64 encoding.
                   This should be used to store the SNMP community name near
                   the top of this script.

Output Field Specification
   Each of these letters represents a piece of available information about a
   wireless device associated to the base station. The order in which the tokens
   are specified is used as the output field order. Do not prefix these tokens
   with "-" or "--".
       n       wirelessPhysAddress
       y       wirelessType
       s       wirelessStrength
       r       wirelessRate
       o       wirelessNoise
       t       wirelessNumTX
       e       wirelessNumRX
       T       wirelessNumTXErrors
       E       wirelessNumRXErrors
       a       wirelessTimeAssociated
       i       wirelessLastRefreshTime

Default output is equivalent to "nysroai".

Examples:
Debug mode with default fields:
airport -v

Comma-delimited mode with field specification:
airport -d nsroteTE</pre>
<p>Sample run (polling two base stations in a wds configuration):</p>
<pre>
{19} andre@donk [~] % airport
10.0.1.3 (dreness) WLAN clients: 2  DHCP clients: 0
  Name or Address     Type   Str    Rate   Noise   Connected    Idle
  boop                wds    -66    54     -91     3 23:58:56   0  0:00:00
  dude                sta    -81    5      -94     3 23:34:03   0  0:20:22
10.0.1.1 (Boop) WLAN clients: 7  DHCP clients: 8
  Name or Address     Type   Str    Rate   Noise   Connected    Idle
  peperoni            sta    -85    5      -98     3  5:05:08   0  0:00:00
  dude                sta    -57    54     -93     3  5:04:49   0  0:00:00
  dreness             wds    -56    54     -88     3  5:05:08   0  0:00:00
  hughe               sta    -50    27     -90     3  5:04:21   0  0:00:00
  pandabank           sta    -72    24     -100    3  5:04:15   0  0:00:17
  00 11 24 ED 4A E5   sta    -63    54     -96     3  5:04:21   0  0:00:00 </pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/archives/32/feed</wfw:commentRss>
		</item>
		<item>
		<title>The opposite of split is cat.</title>
		<link>http://www.dreness.com/blog/archives/29</link>
		<comments>http://www.dreness.com/blog/archives/29#comments</comments>
		<pubDate>Wed, 03 Jan 2007 03:01:29 +0000</pubDate>
		<dc:creator>dre</dc:creator>
		
		<category><![CDATA[OS X]]></category>

		<category><![CDATA[OS X Server]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/archives/29</guid>
		<description><![CDATA[/usr/bin/split and /bin/cat, that is. Why is this useful information? Let&#8217;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 [...]]]></description>
			<content:encoded><![CDATA[<p><code>/usr/bin/split</code> and <code>/bin/cat</code>, that is. Why is this useful information? Let&#8217;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:<br />
<code>[Tue Jan 02 13:07:24 2007] [error] [client x.x.x.42] (75)Value too large for defined data type: access to /some/big/file.omg failed</code></p>
<p>Let&#8217;s also suppose that this file is indeed really big, and you totally don&#8217;t want to go through the pain of segmenting it locally and then uploading it again. If the server and client(s) are unixy, here is your salvation:</p>
<p><code>split -b 500m BigFile BigFileParts_</code></p>
<p>This will segment your file into chunks that are 500 MB in size (though obviously the last one will probably be less). You will end up with files named BigFileParts_aa, BigFileParts_ab, and so on. Now you can download them, presuming 500 MB is beneath the threshold of the policy which blocks big file xfers; adjust accordingly.</p>
<p>Once downloaded, put them back together with cat, appending from the back to the front:<br />
<code>cat BigFileParts_ac >> BigFileParts_ab<br />
cat BigFileParts_ab >> BigFileParts_aa<br />
mv BigFileParts_aa BigFile</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/archives/29/feed</wfw:commentRss>
		</item>
		<item>
		<title>Installing perl modules locally</title>
		<link>http://www.dreness.com/blog/archives/28</link>
		<comments>http://www.dreness.com/blog/archives/28#comments</comments>
		<pubDate>Thu, 07 Dec 2006 02:49:04 +0000</pubDate>
		<dc:creator>dre</dc:creator>
		
		<category><![CDATA[OS X]]></category>

		<category><![CDATA[OS X Server]]></category>

		<category><![CDATA[development]]></category>

		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/archives/28</guid>
		<description><![CDATA[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&#8217;t have admin on the box, or if you simply prefer to keep your custom perl stuff all cinched up in a tidy homedir [...]]]></description>
			<content:encoded><![CDATA[<p>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&#8217;t have admin on the box, or if you simply prefer to keep your custom perl stuff all cinched up in a tidy homedir for ease of administration (or if you have to use custom modules on a machine with no dev tools; you can build them on a dev box and then just scp the entire ~/perl directory to where it&#8217;s needed).</p>
<p><a href="http://search.cpan.org/dist/LocalModInstall/LocalModInstall.pl">LocalModInstall</a> is a script that generates a modified Makefile for a perl module you wish to install, suitable for installing it into your home directory.</p>
<pre>
{42} andre@werk [work/perl-ldap-0.33] % perl ~/bin/LocalModInstall.pl
/usr/bin/perl Makefile.PL PREFIX=/Users/andre/perl \
INSTALLMAN1DIR=/Users/andre/perl/usr/share/man/man1 \
INSTALLMAN3DIR=/Users/andre/perl/usr/share/man/man3
*** ExtUtils::AutoInstall version 0.59
*** Checking for dependencies...
[Core Features]
- Convert::ASN1   ...loaded. (0.19 >= 0.07)
[SASL authentication]
- Authen::SASL    ...loaded. (2.09 >= 2)
- Digest::MD5     ...loaded. (2.33)
[LDAP URLs]
- URI::ldap       ...loaded. (1.11 >= 1.1)
[LDAPS]
- IO::Socket::SSL ...missing. (would need 0.81)
==> Auto-install the 1 optional module(s) from CPAN? [n] n
[Read/Write DSML files]
- XML::SAX::Base  ...loaded. (1.04)
[Read/Write LDIF files]
- MIME::Base64    ...loaded. (3.05)
*** ExtUtils::AutoInstall configuration finished.
Writing Makefile for Net::LDAP

Don't forget to

  use lib
  qw(
      /Users/andre/perl/System/Library/Perl/5.8.6/darwin-thread-multi-2level
      /Users/andre/perl/System/Library/Perl/5.8.6
      /Users/andre/perl/Library/Perl/5.8.6/darwin-thread-multi-2level
      /Users/andre/perl/Library/Perl/5.8.6
  );

in your scripts (prior to any other "use" statements) or to set

  PERL5LIB="/Users/andre/perl/System/Library/Perl/5.8.6/darwin-thread-multi-2level"
  PERL5LIB="$PERL5LIB:/Users/andre/perl/System/Library/Perl/5.8.6"
  PERL5LIB="$PERL5LIB:/Users/andre/perl/Library/Perl/5.8.6/darwin-thread-multi-2level"
  PERL5LIB="$PERL5LIB:/Users/andre/perl/Library/Perl/5.8.6"
  export PERL5LIB

in your shell (or shell configuration file) and to set

  MANPATH="$MANPATH:/Users/andre/perl/usr/share/man/man1"
  MANPATH="$MANPATH:/Users/andre/perl/usr/share/man/man3"
  export MANPATH

in your shell (or shell configuration file).</pre>
<p>You would then &#8216;make&#8217; and &#8216;make install&#8217; like normal.</p>
<p>However, the &#8216;use lib&#8217; suggestion that is supplied does not work in Mac OS X. The goods seem to be installed in ~/perl/lib/perl5/site_perl, which is not included in the suggested paths. Instead, I use:</p>
<pre>use lib  qw(
/path/to/home/perl/lib/perl5/site_perl );</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/archives/28/feed</wfw:commentRss>
		</item>
		<item>
		<title>OpenLDAP and SSL (and Mac OS X Server and you)</title>
		<link>http://www.dreness.com/blog/archives/27</link>
		<comments>http://www.dreness.com/blog/archives/27#comments</comments>
		<pubDate>Tue, 14 Nov 2006 02:15:34 +0000</pubDate>
		<dc:creator>dre</dc:creator>
		
		<category><![CDATA[OS X Server]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/archives/27</guid>
		<description><![CDATA[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&#8217;s pretty easy to make it all work for http or LDAP using the GUI tools.
There is also the command-line &#8217;serveradmin&#8217; tool, which attempts to mirror the [...]]]></description>
			<content:encoded><![CDATA[<p>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&#8217;s pretty easy to make it all work for http or LDAP using the GUI tools.</p>
<p>There is also the command-line &#8217;serveradmin&#8217; tool, which attempts to mirror the functionality of the Server Admin GUI tool. I was preparing procedures to enable SSL for some Open Directory servers, so I was banging through the various alternatives to see which one is best, when I came upon an interesting scenario.</p>
<p>It seems that when using the command-line &#8217;serveradmin&#8217; tool to enable SSL, it would only work sometimes. On a test machine, configured as an OD server, I created a valid self-signed SSL cert, then used &#8217;serveradmin&#8217; to make the appropriate settings, as suggested in the man page. I created a file that contains the settings I want, then load it into serveradmin. I named the file ssl_config, and the contents are:</p>
<pre>dirserv:LDAPSettings:LDAPSSLKeyPath = "/etc/certificates/dirt.apple.com.key"
dirserv:LDAPSettings:LDAPSSLCertificatePath = "/etc/certificates/dirt.apple.com.crt"
dirserv:LDAPSettings:useSSL = yes</pre>
<p>This configuration can then be loaded by executing:</p>
<pre>sudo serveradmin settings < ssl_config</pre>
<p>If it worked, serveradmin will echo the new settings when they are applied. After doing this, servermgr knows that slapd has to be restarted, and does so. In my case, slapd would only sometimes reload successfully. Other times, the slapd startup would fail with the following (which you could see by starting slapd in debug mode; sudo /usr/libexec/slapd -d 99 -f /etc/openldap/slapd.conf)</p>
<pre>TLS: could not use key file `/etc/certificates/dirt.apple.com.key'.
TLS: error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long asn1_lib.c:140
main: TLS init def ctx failed: -1</pre>
<p>&#8230; yet when I would revert the SSL configuration back to default, and use the GUI Server Admin to select the same certificate, it would work! What the crap?!? Furthermore, why did it only fail *sometimes*?</p>
<p>Turns out that the failure cases were all ones in which I had supplied a password for the SSL private key, which creates an encrypted private key file. In order to use this key, the password must be supplied to decrypt it before it can be loaded.</p>
<p>Apple does this for apache using an Apple tool located at /etc/httpd/getsslpassphrase. Based on my admitedly layman&#8217;s understanding of a string dump of this tool, it appears to look for the SSL key password in /etc/httpd/servermgr_web_httpd_config.plist so that apache can use it to unlock the key and start the service.</p>
<p>But we&#8217;re not talking Apache, we&#8217;re talking OpenLDAP. Without configuring any Apache vhosts for SSL, that file doesn&#8217;t contain the private key password, and yet slapd is still able to start successfully.</p>
<p>Digging deeper, if we look at the /etc/openldap/slapd_macosxserver.conf config file after a successful SSL configuration (e.g. using Server Admin), we see:</p>
<pre># This file should NOT be world readable.
# This file is maintained by Server Admin.
...
TLSCertificateFile      /etc/certificates/dirt.apple.com.crt
TLSCertificateKeyFile   /etc/certificates/dirt.apple.com.key
TLSCertificatePassphraseTool    /etc/httpd/getsslpassphrase dirt.apple.com:636 RSA</pre>
<p>How mysterious! Gee, I wonder how that got there.</p>
<p>There are three strange / unwanted behaviors here. First is that the command-line &#8217;serveradmin&#8217; does NOT have functional parity with the GUI Server Admin with respect to enabling SSL for OpenLDAP. The second is that a tool clearly positioned for Apache is being used by OpenLDAP. The third is that I have no idea where the getsslpassphrase looks for the SSL key password other than /etc/httpd/servermgr_web_httpd_config.plist. The getsslpassphrase tool does link against the Security framework, so I suppose it&#8217;s possible that it&#8217;s fishing it out of the System Keychain or something.</p>
<p>[[passage of time]]</p>
<p>Yep. There&#8217;s an item in the System keychain called certificateManager of type &#8216;application password&#8217; with &#8216;Account&#8217; set to the fqdn used in the SSL certificate &#8216;common name&#8217; attribute. Open that keychain entry and hit the &#8217;show password&#8217; checkbox to display the SSL key password.</p>
<p>So then, the magic appears to be supplied by the OpenLDAP configuration directive &#8220;TLSCertificatePassphraseTool&#8221; and by the /etc/httpd/getsslpassphrase tool. Googling, we see that TLSCertificatePassphraseTool exists exactly once on all of the Internets: <a href="http://www.opensource.apple.com/darwinsource/Current/OpenLDAP-69.0.2/OpenLDAP/servers/slapd/config.c"> right here</a>; clearly this is an Apple addition.</p>
<p>So now you should have all the pieces required to enable SSL for OpenLDAP from the command line:</p>
<ul>
<li>Import or create an SSL cert using Server Admin (this could probably also be done with the command line &#8217;security&#8217; tool, but that&#8217;s left as an exercise for the reader)</li>
<li>Add the appropriate configuration to the slapd_macosxserver.conf file as shown above</li>
<li>Add the appropriate configuration using the &#8217;serveradmin&#8217; cli tool as shown above. This should cause slapd to restart using SSL (note that I haven&#8217;t actually gone through each of these steps in this manner&#8230; wait for it&#8230;)</li>
</ul>
<p>I found a much easier way to accomplish all this from the command line:</p>
<pre>sudo slapconfig -setldapconfig -ssl on -sslcert /etc/certificates/dirt.apple.com.crt \\
-sslkey /etc/certificates/dirt.apple.com.key -ssldomain dirt.apple.com</pre>
<p>At this point you&#8217;re probably wishing I had just lead with that instead of dragging you through the mud first. Hey, it builds character :)</p>
<p>Finally I should note that on one of two test servers, the creation of the self-signed cert using Server Admin didn&#8217;t totally work. What&#8217;s supposed to happen is that it creates System keychain entries and then &#8216;exports&#8217; those for use by OpenSSL, which looks for the files in /etc/certificates. The exporting part didn&#8217;t seem to work properly on one server, however after executing
<pre>sudo certadmin export dirt.apple.com</pre>
<p> the required files are published into /etc/certificates, and life is grand.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/archives/27/feed</wfw:commentRss>
		</item>
		<item>
		<title>VLC and wireless networks</title>
		<link>http://www.dreness.com/blog/archives/26</link>
		<comments>http://www.dreness.com/blog/archives/26#comments</comments>
		<pubDate>Fri, 27 Oct 2006 21:11:13 +0000</pubDate>
		<dc:creator>dre</dc:creator>
		
		<category><![CDATA[OS X]]></category>

		<category><![CDATA[media]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/archives/26</guid>
		<description><![CDATA[I typically keep all my digital media on either my desktop at home or my server, but I like to watch it on the laptop while reclining in my papasan chair, or perhaps just kicked back in bed. The problem is that certain files will stutter occasionally during playback, even though the bitrate of the [...]]]></description>
			<content:encoded><![CDATA[<p>I typically keep all my digital media on either my desktop at home or my server, but I like to watch it on the laptop while reclining in my papasan chair, or perhaps just kicked back in bed. The problem is that certain files will stutter occasionally during playback, even though the bitrate of the file is far, far low enough for the wireless network to handle.</p>
<p>The way I&#8217;m getting to the files is via an AFP mount. Thus, VLC is using the &#8216;file&#8217; access module, as opposed to rtsp, http, or some other network-based module. Accordingly, VLC is treating the media file as if it were on a local disk, even though it&#8217;s not. As anybody knows, local disks are typically much faster both in latency and throughput than anything over the network. That&#8217;s probably why the default buffer for the &#8216;file&#8217; access module is 300 ms, whereas the default buffer for http or mms is much higher (1.2 seconds and 5.7 seconds, respectively).</p>
<p>All we need to do to make VLC stop skipping is to increase the buffer time for the &#8216;file&#8217; access module.</p>
<p><a class="imagelink" href="http://www.dreness.com/blog/wp-content/uploads/2006/10/file_access_module_buffer.png" title="VLC's file access module preferences"><img id="image25" src="http://www.dreness.com/blog/wp-content/uploads/2006/10/file_access_module_buffer.thumbnail.png" alt="VLC's file access module preferences" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/archives/26/feed</wfw:commentRss>
		</item>
		<item>
		<title>Ice Weasels?</title>
		<link>http://www.dreness.com/blog/archives/24</link>
		<comments>http://www.dreness.com/blog/archives/24#comments</comments>
		<pubDate>Thu, 12 Oct 2006 22:37:54 +0000</pubDate>
		<dc:creator>dre</dc:creator>
		
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/archives/24</guid>
		<description><![CDATA[14:57 &#60; sky&#62; debian forked firefox? haha
15:00 -!- PowerUser [i=hollandp@nat/apple/x-c57695efe759d747] has quit [&#34;Fly
          the white flag of war!&#34;]
15:21 &#60; dre^&#62; lol, why?
15:24 &#60; johnny-o&#62; the inability to modify the artwork, if you can actually
             [...]]]></description>
			<content:encoded><![CDATA[<pre>14:57 &lt; sky&gt; debian forked firefox? haha
15:00 -!- PowerUser [i=hollandp@nat/apple/x-c57695efe759d747] has quit [&quot;Fly
          the white flag of war!&quot;]
15:21 &lt; dre^&gt; lol, why?
15:24 &lt; johnny-o&gt; the inability to modify the artwork, if you can actually
                  believe that
15:24 &lt; dre^&gt; LOL
15:24 &lt; dre^&gt; I can believe it, actually :)
15:24 &lt; johnny-o&gt; http://www.gnu.org/software/gnuzilla/
15:24 &lt; dre^&gt; hopefully they'll keep their changes limited to art...
15:24 &lt; johnny-o&gt; nope!
15:24 &lt; johnny-o&gt; they already blew that one :)
15:25 &lt; dre^&gt; I will say that IceWeasel is a great name
15:26 &lt; johnny-o&gt; as far as tongue-in-cheek unixy names go, definitely
15:26 &lt; dre^&gt; &quot;Love is a snowmobile racing across the tundra and then suddenly
              it flips over, pinning you underneath. At night, the ice weasels
              come. -- Matt Groening, &quot;Life in Hell&quot;
15:26 &lt; dre^&gt; I suspect that is the real reference
15:26 &lt; dre^&gt; as opposed to a silly pun on firefox ;)
15:27 &lt; johnny-o&gt; i assumed something like fire/ice and fox/weasel
15:28 &lt; dre^&gt; yeah, but that's the obvious one
15:28 &lt; dre^&gt; gotta aim for obscure with the obvious fallback, so there can
              still be an 'in' crowd ;)
15:29 &lt; johnny-o&gt; of course!
15:29 &lt; dre^&gt; plus the metaphor is more fun if you try to map the software
              development process to that groening quote...
15:32 &lt; dre^&gt; where software development is love, the tundra is the open source
              community, firefox is the snowmobile, 'non-free software' causes
              the flip and subsequent pin... now you feel trapped! you can't
              move the snowmobile enough to, say, apply a fancy decal on it...
15:32 &lt; dre^&gt; hence iceweasels
15:33 &lt; johnny-o&gt; i like that much better, actually</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/archives/24/feed</wfw:commentRss>
		</item>
		<item>
		<title>Decrypting afp mount strings</title>
		<link>http://www.dreness.com/blog/archives/23</link>
		<comments>http://www.dreness.com/blog/archives/23#comments</comments>
		<pubDate>Fri, 15 Sep 2006 19:11:47 +0000</pubDate>
		<dc:creator>dre</dc:creator>
		
		<category><![CDATA[OS X]]></category>

		<category><![CDATA[OS X Server]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/archives/23</guid>
		<description><![CDATA[{10} andre@werk [~] % mount &#124; 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&#8217;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: [...]]]></description>
			<content:encoded><![CDATA[<pre>{10} andre@werk [~] % mount | grep /Volumes/andre
afp_006Af01nOUmc001Eic06SdO0-1.2c0000ae on /Volumes/andre (nodev, nosuid, mounted by andre)</pre>
<p>Huh? how helpful is that! How can I tell what server it came from? Yeah, I could netstat, but what if there&#8217;s a bunch of AFP sessions open?</p>
<p><a href="http://developer.apple.com/samplecode/DisplayURL/index.html">DisplayURL</a> to the rescue!</p>
<pre>{12} andre@werk [~] % ~dre/bin/DisplayURL /Volumes/andre
url: "afp://idio.dreness.com/andre"
kCFURLComponentScheme: "afp" including separators: "afp://"
kCFURLComponentNetLocation: "idio.dreness.com" including separators: "://idio.dreness.com"
kCFURLComponentPath: "/andre" including separators: "/andre"
kCFURLComponentResourceSpecifier not found
kCFURLComponentUser not found
kCFURLComponentPassword not found
kCFURLComponentUserInfo not found
kCFURLComponentHost: "idio.dreness.com" including separators: "://idio.dreness.com"
kCFURLComponentPort not found
kCFURLComponentParameterString not found
kCFURLComponentQuery not found
kCFURLComponentFragment not found</pre>
<p>fancy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/archives/23/feed</wfw:commentRss>
		</item>
		<item>
		<title>big mac</title>
		<link>http://www.dreness.com/blog/archives/17</link>
		<comments>http://www.dreness.com/blog/archives/17#comments</comments>
		<pubDate>Tue, 12 Sep 2006 09:37:50 +0000</pubDate>
		<dc:creator>dre</dc:creator>
		
		<category><![CDATA[mac pro]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/archives/17</guid>
		<description><![CDATA[My Mac Pro arrived today. It&#8217;s pretty awesome. The first time I opened the cpu panel (after installing CHUD), I thought it was broken. I had all my normal stuff running (safari, ichat, mail, many terminals, itunes, console, a few others), and I was kinda sitting back in my chair so I didn&#8217;t see anything [...]]]></description>
			<content:encoded><![CDATA[<p>My Mac Pro arrived today. It&#8217;s pretty awesome. The first time I opened the cpu panel (after installing <a href="http://developer.apple.com/tools/download/">CHUD</a>), I thought it was broken. I had all my normal stuff running (safari, ichat, mail, many terminals, itunes, console, a few others), and I was kinda sitting back in my chair so I didn&#8217;t see anything at first&#8230;</p>
<p><center><a class="imagelink" href="http://www.dreness.com/blog/wp-content/uploads/2006/09/about-this-mac-pro.png" title="about-this-mac-pro"><img id="image21" src="http://www.dreness.com/blog/wp-content/uploads/2006/09/about-this-mac-pro.thumbnail.png" alt="about-this-mac-pro" /></a>  <a class="imagelink" href="http://www.dreness.com/blog/wp-content/uploads/2006/09/cpu-panel.jpeg" title="cpu-panel"><img id="image20" src="http://www.dreness.com/blog/wp-content/uploads/2006/09/cpu-panel.thumbnail.jpeg" alt="cpu-panel" /></a></center></p>
<p>Rudimentary &#8220;beat the hell out of QuickTime Player&#8221; testing shows that this machine will play a good number of average video files without breaking a sweat. Next I tried 2, then 4 1080i HD <a href="http://www.apple.com/trailers/">quicktime movie trailers</a>, which played simultaneously without dropping any frames.</p>
<p><center><a class="imagelink" href="http://www.dreness.com/blog/wp-content/uploads/2006/09/mp-qtp-screenshot.jpeg" title="mp-qtp-screenshot"><img id="image19" src="http://www.dreness.com/blog/wp-content/uploads/2006/09/mp-qtp-screenshot.thumbnail.jpeg" alt="mp-qtp-screenshot" /></a> <a class="imagelink" href="http://www.dreness.com/blog/wp-content/uploads/2006/09/1080i-playback.jpeg" title="1080i-quicktime-playback"><img id="image22" src="http://www.dreness.com/blog/wp-content/uploads/2006/09/1080i-playback.thumbnail.jpeg" alt="1080i-quicktime-playback" /></a></center></p>
<p>It was able to sustain it for a good while, QuickTime Player reporting about 300 - 350% cpu usage, but eventually it <a id="p18" href="http://www.dreness.com/blog/wp-content/uploads/2006/09/QuickTime Player_693.sample.txt">wedged</a> and had to be force quiteded(ed). (as an aside, note that I did the same tests when I got my g5 tower, and after I had two or three movies open, it *rebooted itself*; thus began my struggle with that machine to keep it thermally cool; alas). It also performed an xcode 2.4 &#8216;easy&#8217; installation in 3 minutes 11 seconds. Oh, and it runs quake4 very very well :)</p>
<p>Selected stats:</p>
<pre>
      Machine Name: Mac Pro
      Machine Model: MacPro1,1
      Processor Name: Dual-Core Intel Xeon
      Processor Speed: 3 GHz
      Number Of Processors: 2
      Total Number Of Cores: 4
      L2 Cache (per processor): 4 MB
      Memory: 4 GB
      Bus Speed: 1.33 GHz
   ATI Radeon X1900 XT:
      Chipset Model: ATY,RadeonX1900
      Type: Display
      Bus: PCIe
      Slot: Slot-1
      VRAM (Total): 512 MB
      Vendor: ATI (0x1002)
   Intel High Definition Audio:
      Available Devices:
          Line Out:
              Connection: 1/8 inch Jack
          Headphone:
              Connection: 1/8 inch Jack
          Line In:
              Connection: 1/8 inch Jack
          Speaker:
              Connection: Internal
          S/P-DIF Out:
              Connection: Optical
          S/P-DIF In:
              Connection: Optical

{2} andre@xxxx [~] % df -h -t hfs
Filesystem     Size   Used  Avail Capacity  Mounted on
/dev/disk0s2   465G    20G   445G     4%    /
/dev/disk1s3   233G   132G   101G    57%    /Volumes/Bay
/dev/disk2s3   234G   225G   9.0G    96%    /Volumes/idio</pre>
<p>idio and Bay are the two disks from the g5. Slide &#8216;em out of the g5, take off the little rail nub screws that keep the drives in place in the g5 slots, put &#8216;em into two of the three available mac pro drive sleds, done. I&#8217;ll be doing a propper reformat of the disk they shipped me, and migration of data, but not until I can get on a UPS. We&#8217;ve had three power outages in 5 days.
<pre>sudo dscl . create /Users/andre NFSHomeDirectory /Volumes/idio/Users/andre ; sudo reboot</pre>
<p> works just fine for now :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/archives/17/feed</wfw:commentRss>
		</item>
		<item>
		<title>Spotlight indexes on read-only media</title>
		<link>http://www.dreness.com/blog/archives/16</link>
		<comments>http://www.dreness.com/blog/archives/16#comments</comments>
		<pubDate>Fri, 08 Sep 2006 10:12:41 +0000</pubDate>
		<dc:creator>dre</dc:creator>
		
		<category><![CDATA[OS X]]></category>

		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/archives/16</guid>
		<description><![CDATA[Here&#8217;s a way to let spotlight do a full content index of a read only CD. It can even persist across uses :)
#!/bin/sh
# pass in the name of the r/o volume, e.g. DiskWarriorCD
# this is proof of concept only. seriously :)
if [ ! $1 ] ; then echo "supply a volume name" ; exit 1 [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a way to let spotlight do a full content index of a read only CD. It can even persist across uses :)</p>
<pre>#!/bin/sh
# pass in the name of the r/o volume, e.g. DiskWarriorCD
# this is proof of concept only. seriously :)
if [ ! $1 ] ; then echo "supply a volume name" ; exit 1 ; fi
vol=$1
rodevpath=`df | grep "$vol" | awk '{print $1}'`
fspath=`df | grep "$vol" | awk '{print $6}'`
sudo hdiutil unmount $rodevpath
sudo hdiutil mount $rodevpath -shadow "/tmp/$vol.shadow"
sudo mdutil -i on $fspath
sudo mdutil -s $fspath</pre>
<p>I&#8217;m then able to return documents on the CD in my spotlight searches, create new files on the CD (in the shadow file) that are also indexed, etc&#8230;</p>
<pre>{7} andre@idio [~] % rwmount Warrior
"disk2s1s3" unmounted successfully.
/dev/disk3                                              /Volumes/DiskWarriorCD
/Volumes/DiskWarriorCD:
        Indexing enabled for volume.
/Volumes/DiskWarriorCD:
        Status: Indexing Enabled
{8} andre@idio [~] % echo "nice marmot" > /Volumes/DiskWarriorCD/motd.txt
{9} andre@idio [~] % mdfind marmot
/Volumes/DiskWarriorCD/motd.txt
{10} andre@idio [~] % mdfind 'rebuild' -onlyin /Volumes/DiskWarriorCD
/Volumes/DiskWarriorCD/Applications/Utilities/DiskWarrior CD Extras/DiskWarrior
AppleScripts/Rebuild Directory
/Volumes/DiskWarriorCD/Applications/Utilities/DiskWarrior Manual.pdf
/Volumes/DiskWarriorCD/Applications/Utilities/DiskWarrior Read Me.rtf
/Volumes/DiskWarriorCD/Applications/Utilities/Quick Start Manual.rtf
/Volumes/DiskWarriorCD/Applications/Utilities/DiskWarrior CD Extras/DiskWarrior
3 Brochure.pdf
/Volumes/DiskWarriorCD/Applications/Utilities/DiskWarrior CD Extras/DiskWarrior
AppleScripts/DiskWarrior and AppleScripts.rtf
{11} andre@idio [~] % mount
/dev/disk0s3 on / (local, journaled)
devfs on /dev (local)
fdesc on /dev (union)
<volfs> on /.vol
/dev/disk1s3 on /Volumes/Bay (local, journaled)
automount -nsl [180] on /Network (automounted)
automount -fstab [184] on /automount/Servers (automounted)
automount -static [184] on /automount/static (automounted)
/dev/disk3 on /Volumes/DiskWarriorCD (local, nodev, nosuid)</pre>
<p>( physical CD is at disk2 )<br />
( click eject button of DiskWarriorCD in Finder to unmount disk3)</p>
<pre>{13} andre@idio [~] % hdiutil eject /dev/disk2
"disk2" unmounted.
"disk2" ejected.</pre>
<p>(re-insert)</p>
<pre>{15} andre@idio [~] % rwmount Warrior
"disk2s1s3" unmounted successfully.
/dev/disk3                                              /Volumes/DiskWarriorCD
/Volumes/DiskWarriorCD:
        Indexing enabled for volume.
/Volumes/DiskWarriorCD:
        Status: Indexing Enabled
{16} andre@idio [~] % mdfind marmot
/Volumes/DiskWarriorCD/motd.txt</pre>
<p>fun :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/archives/16/feed</wfw:commentRss>
		</item>
		<item>
		<title>macosforge opens the doors</title>
		<link>http://www.dreness.com/blog/archives/14</link>
		<comments>http://www.dreness.com/blog/archives/14#comments</comments>
		<pubDate>Wed, 16 Aug 2006 06:11:16 +0000</pubDate>
		<dc:creator>dre</dc:creator>
		
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/archives/14</guid>
		<description><![CDATA[What with opendarwin closing down shop, this seems like a good time to mention that macosforge has seen some rather remarkable activity today. A pile of previously internal Apple bugs were exposed to the world for all to see (including one of mine). In my opinion, this is a really cool thing. The primary reason [...]]]></description>
			<content:encoded><![CDATA[<p>What with <a href="http://opendarwin.org/en/news/shutdown.html">opendarwin closing down shop</a>, this seems like a good time to mention that macosforge has seen some <a href="http://trac.macosforge.org/projects/collaboration/report/1">rather remarkable activity</a> today. A pile of previously internal Apple bugs were exposed to the world for all to see (including <a href="http://trac.macosforge.org/projects/collaboration/ticket/25">one of mine</a>). In my opinion, this is a really cool thing. The primary reason that Open Darwin failed was due to a lack of transparency between Apple and developers. Accordingly, to see a bunch of internal bugs getting externalized is significant.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/archives/14/feed</wfw:commentRss>
		</item>
		<item>
		<title>My nintendo WFC friend code!</title>
		<link>http://www.dreness.com/blog/archives/13</link>
		<comments>http://www.dreness.com/blog/archives/13#comments</comments>
		<pubDate>Sat, 12 Aug 2006 21:48:12 +0000</pubDate>
		<dc:creator>dre</dc:creator>
		
		<category><![CDATA[games]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/archives/13</guid>
		<description><![CDATA[287839
004114
]]></description>
			<content:encoded><![CDATA[<p>287839<br />
004114</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/archives/13/feed</wfw:commentRss>
		</item>
		<item>
		<title>adduser script for Mac OS X / Mac OS X Server</title>
		<link>http://www.dreness.com/blog/archives/12</link>
		<comments>http://www.dreness.com/blog/archives/12#comments</comments>
		<pubDate>Mon, 10 Jul 2006 06:15:21 +0000</pubDate>
		<dc:creator>dre</dc:creator>
		
		<category><![CDATA[OS X]]></category>

		<category><![CDATA[OS X Server]]></category>

		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/archives/12</guid>
		<description><![CDATA[http://www.dreness.com/bits/tech/adduser.html (syntax colored)
http://www.dreness.com/bits/tech/adduser (raw)
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.dreness.com/bits/tech/adduser.html">http://www.dreness.com/bits/tech/adduser.html</a> (syntax colored)<br />
<a href="http://www.dreness.com/bits/tech/adduser">http://www.dreness.com/bits/tech/adduser</a> (raw)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/archives/12/feed</wfw:commentRss>
		</item>
		<item>
		<title>Apache AddType directives for AAC audio</title>
		<link>http://www.dreness.com/blog/archives/10</link>
		<comments>http://www.dreness.com/blog/archives/10#comments</comments>
		<pubDate>Sun, 04 Jun 2006 06:23:48 +0000</pubDate>
		<dc:creator>dre</dc:creator>
		
		<category><![CDATA[bit bucket]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/archives/10</guid>
		<description><![CDATA[AddType audio/x-m4a m4a
AddType audio/x-m4b m4b
]]></description>
			<content:encoded><![CDATA[<p>AddType audio/x-m4a m4a<br />
AddType audio/x-m4b m4b</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/archives/10/feed</wfw:commentRss>
		</item>
		<item>
		<title>Automated backups of Open Directory databases</title>
		<link>http://www.dreness.com/blog/archives/9</link>
		<comments>http://www.dreness.com/blog/archives/9#comments</comments>
		<pubDate>Thu, 01 Jun 2006 23:19:14 +0000</pubDate>
		<dc:creator>dre</dc:creator>
		
		<category><![CDATA[OS X Server]]></category>

		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/archives/9</guid>
		<description><![CDATA[# 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=&#34;the_foo&#34;

# Feed a [...]]]></description>
			<content:encoded><![CDATA[<pre># 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=&quot;the_foo&quot;

# Feed a heredoc to serveradmin
/usr/sbin/serveradmin command &lt;&lt;EOF
dirserv:backupArchiveParams:archivePassword = $PASS
dirserv:backupArchiveParams:archivePath = $DSTDIR/od_backup_$TODAY
dirserv:command = backupArchive
EOF</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/archives/9/feed</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.783 seconds -->
