<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>necessary and sufficient</title>
	<atom:link href="http://shortbus.org/bloggin/feed/" rel="self" type="application/rss+xml" />
	<link>http://shortbus.org/bloggin</link>
	<description>internet is so computer</description>
	<lastBuildDate>Tue, 08 Dec 2009 19:44:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>disabling anti-aliased fonts in netbeans on osx</title>
		<link>http://shortbus.org/bloggin/2009/12/08/disabling-anti-aliased-fonts-in-netbeans-on-osx/</link>
		<comments>http://shortbus.org/bloggin/2009/12/08/disabling-anti-aliased-fonts-in-netbeans-on-osx/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 08:56:08 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[shortbus]]></category>

		<guid isPermaLink="false">http://shortbus.org/bloggin/?p=78</guid>
		<description><![CDATA[it&#8217;s harder than you might think, and i haven&#8217;t found a perfect solution, but i&#8217;m pretty close.
in eclipse, likely because of swt&#8217;s use of jni to use os-native forms, you can simply set an application-specific anti-aliasing threshold for the application:
defaults write org.eclipse.eclipse AppleAntiAliasingThreshold 20
and this more or less works (thanks to tim for pointing this [...]]]></description>
			<content:encoded><![CDATA[<p>it&#8217;s harder than you might think, and i haven&#8217;t found a perfect solution, but i&#8217;m pretty close.</p>
<p>in eclipse, likely because of swt&#8217;s use of jni to use os-native forms, you can simply set an application-specific anti-aliasing threshold for the application:</p>
<pre>defaults write org.eclipse.eclipse AppleAntiAliasingThreshold 20</pre>
<p>and this more or less works (thanks to <a href="http://90kts.com/blog/">tim</a> for pointing this out <a href="http://dispatchevent.org/roger/aliased-text-mac-eclipse/">here</a>), but with netbeans, no joy. </p>
<p>our buddy netbeans uses swing, which doesn&#8217;t look at application property plists. since apple rolls their own ui elements for swing/awt on osx (best of my knowledge), we&#8217;re in strange waters, as well. there&#8217;s a hackier way to do this, documented <a href="http://forums.netbeans.org/topic6046.html">here</a> on the netbeans forums for netbeans 6.5, and involves appending the following flags to <code>netbeans_default_options</code> in the <code>netbeans.conf</code> file inside the netbeans application bundle- that&#8217;s <code>.../NetBeans\ 6.7.1.app/Contents/Resources/NetBeans/etc/netbeans.conf</code></p>
<pre>-J-Dswing.aatext=false -Dawt.useSystemAAFontSettings=false</pre>
<p>and this works fine and dandy, if you&#8217;re using the standard &#8220;Monospace&#8221; font.</p>
<p><img src="http://shortbus.org/bloggin/wp-content/uploads/2009/12/netbeans-mono.png" alt="netbeans 3.7.1 using monospace on 10.6" title="netbeans-mono" width="500" height="340" class="size-full wp-image-87" /></p>
<p>However, this fails miserably if you&#8217;re using something else, like <a href="http://www.tobias-jung.de/seekingprofont/">profont</a> or (my pick) <a href="http://www.fsd.it/fonts/pragma.htm">pragmata</a>. in that case, at least if you&#8217;re on 10.6, you get a mess that looks like this:</p>
<p><img src="http://shortbus.org/bloggin/wp-content/uploads/2009/12/netbeans-pragmata-badrender.png" alt="netbeans-pragmata-badrender" title="netbeans-pragmata-badrender" width="500" height="340" class="alignnone size-full wp-image-99" /></p>
<p>note that fonts are being drawn on top of each other. selecting text and moving the cursor around makes for an even bigger mess. </p>
<p>i&#8217;ve noticed that <a href="http://developer.apple.com/mac/library/releasenotes/Java/JavaSnowLeopardRN/ResolvedIssues/ResolvedIssues.html#//apple_ref/doc/uid/TP40007737-CH3-SW49">apple&#8217;s release notes</a> contain a note saying that the <code>swing.aatext</code> system property was ignored in apple&#8217;s first release of java6 on osx, so my guess is that either they didn&#8217;t get it quite right, or that netbeans is getting rendered glyph sizes wrong. my money is on this being an apple screwup, as it works great with the default monospaced font, but this is also me talking out my ass as i haven&#8217;t bothered even looking at how this works in another swing application.</p>
<p>this is the point where i give up and admit that i&#8217;m spending more time than i should on getting my special font working. if anyone else has any clues past this point, i&#8217;m all ears!</p>
]]></content:encoded>
			<wfw:commentRss>http://shortbus.org/bloggin/2009/12/08/disabling-anti-aliased-fonts-in-netbeans-on-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>enable screen sharing remotely in osx</title>
		<link>http://shortbus.org/bloggin/2009/08/26/enable-screen-sharing-remotely-in-osx/</link>
		<comments>http://shortbus.org/bloggin/2009/08/26/enable-screen-sharing-remotely-in-osx/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 05:21:07 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[shortbus]]></category>

		<guid isPermaLink="false">http://shortbus.org/bloggin/?p=68</guid>
		<description><![CDATA[I forget how to do this all the time, so I&#8217;m sticking the command here.
$ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app\
/Contents/Resources/kickstart -activate -configure -access -on -users admin \
-privs -all -restart -agent -menu
will enable screen sharing for all admin users. More specific options are available from the kickstart command&#8217;s -help option.
]]></description>
			<content:encoded><![CDATA[<p>I forget how to do this all the time, so I&#8217;m sticking the command here.</p>
<pre>$ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app\
/Contents/Resources/kickstart -activate -configure -access -on -users admin \
-privs -all -restart -agent -menu</pre>
<p>will enable screen sharing for all admin users. More specific options are available from the kickstart command&#8217;s <code>-help</code> option.</p>
]]></content:encoded>
			<wfw:commentRss>http://shortbus.org/bloggin/2009/08/26/enable-screen-sharing-remotely-in-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>people pooping all over san francisco</title>
		<link>http://shortbus.org/bloggin/2009/08/26/sf-street-pooping/</link>
		<comments>http://shortbus.org/bloggin/2009/08/26/sf-street-pooping/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 04:13:24 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[shortbus]]></category>
		<category><![CDATA[poop]]></category>
		<category><![CDATA[san francisco]]></category>
		<category><![CDATA[street]]></category>

		<guid isPermaLink="false">http://shortbus.org/bloggin/?p=54</guid>
		<description><![CDATA[nyc is gross, but at least its bums have a little class.]]></description>
			<content:encoded><![CDATA[<p>						<div class="flickr-gallery image right"><a href="http://www.flickr.com/photos/telstar/475079863"><img class="flickr small" title="Neighborly Guidelines" alt="Neighborly Guidelines" src="http://farm1.static.flickr.com/202/475079863_a01bac64e6_m.jpg" /></a></div>
					<br />
so <a href="http://www.zedshaw.com/blog/2009-08-17.html">a dude</a> made a post about how he&#8217;s moving to sf from nyc, and mentions how nyc is dirty and sf is relatively clean. for the most part there is nothing here to argue about- nyc smells like fritos and hot garbage in the summer, from what i&#8217;ve experienced. maybe the mask of garbage covers it up, but best i can tell, nyc doesn&#8217;t have nearly as much street pooping as san francisco. flickr provides the examples.<br />
(<b>WARNING</b>- poop below the cut)<br />
<span id="more-54"></span><br />
						<div class="flickr-gallery image none"><a href="http://www.flickr.com/photos/icki/2064645557"><img class="flickr medium" title="Downtown SF" alt="Downtown SF" src="http://farm3.static.flickr.com/2303/2064645557_513b084dab.jpg" /></a></div>
					<br />
						<div class="flickr-gallery image none"><a href="http://www.flickr.com/photos/gordreece/2907059989"><img class="flickr medium" title="It's SF welfare check week." alt="It's SF welfare check week." src="http://farm4.static.flickr.com/3105/2907059989_62a8a8cfcb.jpg" /></a></div>
					<br />
						<div class="flickr-gallery image none"><a href="http://www.flickr.com/photos/dlytle/2786485952"><img class="flickr medium" title="It's exactly what it looks like" alt="It's exactly what it looks like" src="http://farm4.static.flickr.com/3151/2786485952_5a24229db7.jpg" /></a></div>
					<br />
and finally, a whole set from <a href="http://www.flickr.com/photos/silverlake_punk/">this guy</a>, &#8220;the shits of san francisco&#8221;:<br />
				<div id="gallery-26bd20f6" class="flickr-gallery photoset">
													<div class="flickr-thumb">
									<a href="http://flickr.com/photo.gne?id=126779611"><img class="photo" title="Sidewalk.Obstruction" src="http://farm1.static.flickr.com/46/126779611_33bb53d85f_s.jpg" alt="Sidewalk.Obstruction" /></a>
								</div>
															<div class="flickr-thumb">
									<a href="http://flickr.com/photo.gne?id=126779613"><img class="photo" title="Shitzooka" src="http://farm1.static.flickr.com/54/126779613_7532c291eb_s.jpg" alt="Shitzooka" /></a>
								</div>
															<div class="flickr-thumb">
									<a href="http://flickr.com/photo.gne?id=127327926"><img class="photo" title="More street shit" src="http://farm1.static.flickr.com/53/127327926_6cc31ac9f9_s.jpg" alt="More street shit" /></a>
								</div>
															<div class="flickr-thumb">
									<a href="http://flickr.com/photo.gne?id=121640623"><img class="photo" title="shitbag" src="http://farm1.static.flickr.com/34/121640623_012593ad7e_s.jpg" alt="shitbag" /></a>
								</div>
															<div class="flickr-thumb">
									<a href="http://flickr.com/photo.gne?id=127784832"><img class="photo" title="Van Ness Shit" src="http://farm1.static.flickr.com/45/127784832_4e6c6f2f13_s.jpg" alt="Van Ness Shit" /></a>
								</div>
															<div class="flickr-thumb">
									<a href="http://flickr.com/photo.gne?id=128146615"><img class="photo" title="Castro.shit" src="http://farm1.static.flickr.com/50/128146615_26fc176f67_s.jpg" alt="Castro.shit" /></a>
								</div>
															<div class="flickr-thumb">
									<a href="http://flickr.com/photo.gne?id=144932711"><img class="photo" title="shit.yr.pants" src="http://farm1.static.flickr.com/49/144932711_dd50289c94_s.jpg" alt="shit.yr.pants" /></a>
								</div>
												<div class="fg-clear"></div>
				</div>
												<div class="fg-clear"></div>
							<script type="text/javascript">
											jQuery(document).ready(function(){
							jQuery("#gallery-26bd20f6 .flickr-thumb img").flightbox();
						});
										
										//-->
				</script>
			<a<br />
point being: nyc is pretty gross, but at least its bums have a little more class.</p>
]]></content:encoded>
			<wfw:commentRss>http://shortbus.org/bloggin/2009/08/26/sf-street-pooping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>one-window safari</title>
		<link>http://shortbus.org/bloggin/2009/07/13/one-window-safari/</link>
		<comments>http://shortbus.org/bloggin/2009/07/13/one-window-safari/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 17:26:37 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[shortbus]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[tabs]]></category>

		<guid isPermaLink="false">http://shortbus.org/bloggin/?p=48</guid>
		<description><![CDATA[There is a way to force Safari to live with one window only- Apple has, true to form, hidden this functionality away in hidden preferences. Run the following in Terminal:
defaults write com.apple.Safari TargetedClicksCreateTabs -bool true
..and Safari will no longer create new windows unless you ask it to. (via eNik)
]]></description>
			<content:encoded><![CDATA[<p>There is a way to force Safari to live with one window only- Apple has, true to form, hidden this functionality away in hidden preferences. Run the following in Terminal:</p>
<pre>defaults write com.apple.Safari TargetedClicksCreateTabs -bool true</pre>
<p>..and Safari will no longer create new windows unless you ask it to. (via <a href="http://www.enik.ch/2009/06/safari-is-driving-me-nuts/">eNik</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://shortbus.org/bloggin/2009/07/13/one-window-safari/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apple&#8217;s X11 Keymap and virt-manager</title>
		<link>http://shortbus.org/bloggin/2009/06/01/apples-x11-keymap-and-virt-manager/</link>
		<comments>http://shortbus.org/bloggin/2009/06/01/apples-x11-keymap-and-virt-manager/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 17:08:45 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[shortbus]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[virt-manager]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://shortbus.org/bloggin/?p=41</guid>
		<description><![CDATA[Apple&#8217;s default X11 key mapping causes trouble when using virt-manager on the local X server. For reasons unknown to me, Apple maps the option/alt key to Mode_switch, meaning that when virt-manager grabs the cursor, it&#8217;ll never let go, as there&#8217;s no way of sending Ctrl+Alt to it- apparently it works explicitly off of keysyms instead [...]]]></description>
			<content:encoded><![CDATA[<p>Apple&#8217;s default X11 key mapping causes trouble when using virt-manager on the local X server. For reasons unknown to me, Apple maps the option/alt key to <code>Mode_switch</code>, meaning that when virt-manager grabs the cursor, it&#8217;ll never let go, as there&#8217;s no way of sending Ctrl+Alt to it- apparently it works explicitly off of keysyms instead of mod maps. It&#8217;s been long enough since I&#8217;ve dealt with X11 configuration issues that I had to do a little hunting to figure things out, so I figured I&#8217;d throw my solution up here.</p>
<p>On the machine where you&#8217;ll be running your X server (your mac), stick this in <code>~/.Xmodmap</code>-</p>
<pre>clear Mod1
keycode 66 = Alt_L
keycode 69 = Alt_R
add Mod1 = Alt_L
add Mod1 = Alt_R
</pre>
<p>This will make the control keys on your keyboard emit (I think) more sensible events, while keeping Mod1 in the same place. Finally, no more restarting X11 when you want to break free of virt-manager.</p>
]]></content:encoded>
			<wfw:commentRss>http://shortbus.org/bloggin/2009/06/01/apples-x11-keymap-and-virt-manager/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Auto-starting Xen/xVM domains in OpenSolaris</title>
		<link>http://shortbus.org/bloggin/2009/05/19/auto-starting-xenxvm-domains-in-opensolaris/</link>
		<comments>http://shortbus.org/bloggin/2009/05/19/auto-starting-xenxvm-domains-in-opensolaris/#comments</comments>
		<pubDate>Wed, 20 May 2009 04:59:35 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[shortbus]]></category>
		<category><![CDATA[autostart]]></category>
		<category><![CDATA[opensolaris]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[xen]]></category>
		<category><![CDATA[xvm]]></category>

		<guid isPermaLink="false">http://shortbus.org/bloggin/?p=31</guid>
		<description><![CDATA[Normally, when using Red Hat&#8217;s tools (which like everyone else Sun has ripped off wholesale) this is exposed in virt-manager and virsh, but the versions that Sun has brought over from Redhat lag quite a bit behind upstream, so you have to dig in below the convenience tools. Shut down your guest, then use xm [...]]]></description>
			<content:encoded><![CDATA[<p>Normally, when using Red Hat&#8217;s tools (which like everyone else Sun has ripped off wholesale) this is exposed in virt-manager and virsh, but the versions that Sun has brought over from Redhat lag quite a bit behind upstream, so you have to dig in below the convenience tools. Shut down your guest, then use <code>xm list -l</code> to dump the xen config file. There&#8217;s a <code>on_xend_start</code> property in here- change it from <code>ignore</code> to <code>start</code>, then dump it back into xen with <code>xm new -F <guest>.sxp</code>. </p>
<p>All at once:</p>
<pre>pfexec xm list -l <guest> > guest.sxp
sed -i 's/on_xend_start ignore/on_xend_start start/' guest.sxp
pfexec xm new -F guest.sxp</pre>
<p>..and you&#8217;ve got a domain that&#8217;ll auto-start when xend is brought up, which is pretty much what I usually want.</p>
]]></content:encoded>
			<wfw:commentRss>http://shortbus.org/bloggin/2009/05/19/auto-starting-xenxvm-domains-in-opensolaris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>making a manifest for SMF</title>
		<link>http://shortbus.org/bloggin/2008/10/22/making-a-manifest-for-smf/</link>
		<comments>http://shortbus.org/bloggin/2008/10/22/making-a-manifest-for-smf/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 07:33:38 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[shortbus]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[instances]]></category>
		<category><![CDATA[mt-daapd]]></category>
		<category><![CDATA[smf]]></category>
		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://shortbus.org/bloggin/?p=24</guid>
		<description><![CDATA[Sun is an incredibly frustrating company. A number of the new features introduced in Solaris 10 are very excellent, but I find all the Solaris userland a huge shitpile compared to my familiar GNU tools. Furthermore, the documentation for the aforementioned excellent features is pretty lacking at times, meaning a lazy dude like me gets [...]]]></description>
			<content:encoded><![CDATA[<p>Sun is an incredibly frustrating company. A number of the new features introduced in Solaris 10 are very excellent, but I find all the Solaris userland a huge shitpile compared to my familiar GNU tools. Furthermore, the documentation for the aforementioned excellent features is pretty lacking at times, meaning a lazy dude like me gets little use out of them. However, I just finally stumbled into SMF, and I am now a fan.</p>
<p>I wanted to move a few of the programs I run into SMF, one of the aforementioned awesome features.  SMF is Sun&#8217;s replacement init process, which takes a more active approach to services than the traditional &#8220;tell it to start and hope it does.&#8221; It, and all the other new <a href="http://upstart.ubuntu.com/">init</a> <a href="http://developer.apple.com/macosx/launchd.html">replacements</a> borrow a good bit from djb&#8217;s <a href="http://cr.yp.to/daemontools.html">daemontools</a>, which everyone seems to be realizing, ten years later, is actually a good idea.</p>
<p>SMF provides two primary benefits over traditional init script methods, in my mind, the first of which is process supervision. Process supervision means that when your app crashes, you don&#8217;t have to rely on monitoring scripts (or other people) to notice it&#8217;s gone, SMF notices immediately and attempts to restart the process. If it won&#8217;t stay started after a few tries, it&#8217;ll stop and switch the process to maintenance mode, meaning you get to fix it.</p>
<p>The second is its ability to break out instances of an application by essentially subclassing the main &#8220;default&#8221; instance and redefining configuration variables, such as which config file to read, where to keep the database, etc. This means you can, with a few commands, bring up another instance of apache for testing, or maybe a number of mongrels serving different apps, from the generic service definition.</p>
<p>Sun has a <a href="http://www.sun.com/software/solaris/howtoguides/smfmanifesthowto.jsp">pretty good how-to</a> online dealing with postgresql, which is helpful, but leaves out a few chunks. SMF expects you to provide it with start and stop methods, which is helpful if you just want to move a legacy service over to SMF, but some applications are simpler than that and work fine by just running them and sending them a kill signal when they need to go away. In this case, you can just give the command to launch the daemon as the start method, and fill the stop method with <code>:kill</code>. This will instruct SMF to send a kill signal to the process and children executed by the start method.  Incidentially, if the app reloads configuration when sent -HUP, you can fill in <code>:kill -HUP</code> as the refresh method. This isn&#8217;t explicitly spelled out in any documentation I&#8217;ve read, but it&#8217;s used in a few places in the manifests that ship with Solaris.</p>
<p>Below is a manifest I whipped up for mt-daapd, which scans and shares out all of my spiffy tunes so itunes can play &#8216;em.</p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"&gt;
&lt;service_bundle type="manifest" name="mt-daapd"&gt;
    &lt;service name="network/mt-daapd" type="service" version="1"&gt;
        &lt;dependency name="network" grouping="require_all" restart_on="none" type="service"&gt;
            &lt;service_fmri value="svc:/milestone/network:default"/&gt;
        &lt;/dependency&gt;
        &lt;exec_method type="method" name="start" exec="/export/home/pjjw/opt/pkgs/mt-daapd/sbin/mt-daapd -y -c %{mt-daapd/conffile}" timeout_seconds="10" /&gt;
        &lt;exec_method type="method" name="refresh" exec=":kill -HUP" timeout_seconds="10" /&gt;
        &lt;exec_method type="method" name="stop" exec=":kill" timeout_seconds="10" /&gt;
        &lt;instance name="default" enabled="false"&gt;
            &lt;property_group name='config' type='application'&gt;
                &lt;propval name='conffile' type='astring' value='/export/home/pjjw/opt/pkgs/mt-daapd/etc/mt-daapd.conf' /&gt;
            &lt;/property_group&gt;
        &lt;/instance&gt;
        &lt;stability value="Evolving"/&gt;
        &lt;template&gt;
            &lt;common_name&gt;
                &lt;loctext xml:lang="C"&gt;Firefly Media Server&lt;/loctext&gt;
            &lt;/common_name&gt;
            &lt;documentation&gt;
                &lt;doc_link name="Firefly Media Server homepage" uri="http://fireflymediaserver.org"/&gt;
            &lt;/documentation&gt;
        &lt;/template&gt;
    &lt;/service&gt;
&lt;/service_bundle&gt;</pre>
<p>I run two instances of this app- one which shares out the music that i&#8217;ve sorted and tagged properly, and then another one that shares out stuff that&#8217;s just arrived into torrent directories or the like. Ignore the ridiculous location I&#8217;ve installed this app to and note the property group and properties. I&#8217;ve got two config files, one describing one configuration, and another describing the other. I can make the second instance from the first with the following commands:</p>
<pre>
svccfg -s network/mt-daapd add incoming
svccfg -s network/mt-daapd:incoming setprop config/conffile = astring: /export/home/pjjw/opt/pkgs/mt-daapd/etc/incoming.conf
</pre>
<p>..and there it is, a new instance of the server.</p>
<pre>
[00:28:05][pjjw@push:~]$ svcs mt-daapd
STATE          STIME    FMRI
online         Oct_17   svc:/network/mt-daapd:incoming
online         Oct_17   svc:/network/mt-daapd:default
</pre>
<p>I&#8217;d actually just been running this in screen for about 6 months and restarting it when it crashed. This is much nicer now.</p>
]]></content:encoded>
			<wfw:commentRss>http://shortbus.org/bloggin/2008/10/22/making-a-manifest-for-smf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how to un-shoot your foot</title>
		<link>http://shortbus.org/bloggin/2008/09/29/dm-mapper-how-to-un-shoot-your-foot/</link>
		<comments>http://shortbus.org/bloggin/2008/09/29/dm-mapper-how-to-un-shoot-your-foot/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 18:39:15 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[shortbus]]></category>
		<category><![CDATA[dm-mapper]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[san]]></category>
		<category><![CDATA[snapshot]]></category>
		<category><![CDATA[whoops]]></category>

		<guid isPermaLink="false">http://shortbus.org/bloggin/?p=12</guid>
		<description><![CDATA[Recently I shot myself in the foot pretty bad. We have a ~12TB data array that was set up as a raw LVM2 device- no partition table. There were some issues with one of the cluster members, so I went to rescue boot to attempt to correct it. Redhat&#8217;s rescue boot, in the name of [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I shot myself in the foot pretty bad. We have a ~12TB data array that was set up as a raw LVM2 device- no partition table. There were some issues with one of the cluster members, so I went to rescue boot to attempt to correct it. Redhat&#8217;s rescue boot, in the name of spreading democracy, proactively offers to put a partition table on anything that doesn&#8217;t have one already, and I fat-fingered the key that made this happen right over the top of our array. Whoops.</p>
<p>This isn&#8217;t impossible to recover from- the only thing that got overwritten was, for the most part, LVM data, and it so happens that the boundaries of the volumes is more or less known (25% each), so recovery should be possible just by re-writing correct (or near-correct) headers setting the boundaries in the right spot. Problem with this approach is that you get one shot, and it&#8217;s not like we have another 12TB sitting around that we can copy the data to. Here&#8217;s where dm-mapper came in to save my ass.<br />
<span id="more-12"></span></p>
<p>Using dm-mapper&#8217;s snapshot target, you can create a working copy of a large device that you want to test a few smallish changes to- like, for example, rewriting the partition table and fscking.</p>
<p>The snapshot target actually uses two separate device-mapper types, <code>snapshot-origin</code>, which is the device that you want to create the snapshot of, and <code>snapshot</code>, which becomes the device that you&#8217;ll be able to make your ephemeral changes to. The <code>snapshot</code> device requires a <code>snapshot-origin</code> device as well as a device to hold the written changes. For this, it&#8217;s easy to use a file-backed loopback device.</p>
<p>First, we set up the <code>snapshot-origin</code> device:</p>
<pre>DEVSIZE=`sudo /sbin/blockdev --getsize /dev/sdb`
sudo /sbin/dmsetup create rescue-base-real --table \
        "0 $DEVSIZE linear /dev/loop0 0"
sudo /sbin/dmsetup create rescue-base --table \
        "0 $DEVSIZE snapshot-origin "</pre>
<p>Next, we make a file as large as we expect the changes to be and create a loopback device for it:</p>
<pre>dd if=/dev/zero of=/tmp/backing-store bs=1048576 count=1024 # 1GB
# get name of first available loopback
BACKINGDEV=`sudo /sbin/losetup -f`
sudo /sbin/losetup -f /tmp/backing-store</pre>
<p>Now, finally, create the snapshot device:</p>
<pre>sudo /sbin/dmsetup create rescue-snap --table \
        "0 $DEVSIZE snapshot /dev/mapper/rescue-base $BACKINGDEV n 8"</pre>
<p>The last two arguments to the above command instruct dm-mapper that this is a non-persistent device, and to use a chunk size of 8 for copy-on-write operations.</p>
<p>Now you&#8217;ve got yourself a device you can play with that won&#8217;t cause any permanent changes if you guess the extents incorrectly, or if a fsck does the wrong thing. As an example, it took me about three tries to get the extents set up correctly for maximum data recovery. If I&#8217;d been working with the bare device, this wouldn&#8217;t have ended as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://shortbus.org/bloggin/2008/09/29/dm-mapper-how-to-un-shoot-your-foot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>apple&#8217;s dirty little python secret</title>
		<link>http://shortbus.org/bloggin/2008/07/29/apples-dirty-little-python-secret/</link>
		<comments>http://shortbus.org/bloggin/2008/07/29/apples-dirty-little-python-secret/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 20:15:30 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[shortbus]]></category>

		<guid isPermaLink="false">http://shortbus.org/bloggin/?p=11</guid>
		<description><![CDATA[From man python on OS X 10.5 (and probably before):
INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION
       The Python inteterpreter supports editing of the current input line and
       history substitution, similar to facilities found in the Korn shell and
       [...]]]></description>
			<content:encoded><![CDATA[<p>From <code>man python</code> on OS X 10.5 (and probably before):</p>
<pre>INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION
       The Python inteterpreter supports editing of the current input line and
       history substitution, similar to facilities found in the Korn shell and
       the  GNU  Bash shell.  However, rather than being implemented using the
       GNU Readline library, this Python interpreter  uses  the BSD  EditLine
       library editline(3) with a GNU Readline emulation layer.

       The  readline  module  provides the access to the EditLine library, but
       there are a few major differences compared to a traditional implementa-
       tion  using  the  Readline  library.   The command language used in the
       preference files is that of EditLine, as described in editrc(5) and not
       that   used  by  the  Readline  library. This  also  means that  the
       parse_and_bind() routines uses EditLine commands.  And  the preference
       file itself is ~/.editrc instead of ~/.inputrc.

       For  example,  the rlcompleter module, which defines a completion func-
       tion for the  readline  modules,  works correctly  with the  EditLine
       libraries, but needs to be initialized somewhat differently:

              import rlcompleter
              import readline
              readline.parse_and_bind ("bind ^I rl_complete")

       For vi mode, one needs:

              readline.parse_and_bind ("bind -v")</pre>
<p>Well, that explains why Python doesn&#8217;t play nice with my readline stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://shortbus.org/bloggin/2008/07/29/apples-dirty-little-python-secret/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
