<?xml version="1.0"?>
<!-- name="generator" content="blosxom/2.0" -->
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">
 <channel>
  <title>Brane Dump</title>
  <link>http://www.hezmatt.org/~mpalmer/blog</link>
  <description>The Thoughts of Matt Palmer</description>
  <language>en</language>

  <item>
   <title>Using Virgin Mobile Broadband with wvdial</title>
   <link>http://www.hezmatt.org/~mpalmer/blog/general/using_virgin_mobile_broadband_with_wvdial.html</link>
   <description>&lt;p&gt;
&lt;em&gt;File Under:&lt;/em&gt; Stuff I'm guaranteed to forget if I don't write it down
&lt;/p&gt;
&lt;p&gt;
I just went a bit wild and decided to get myself some mobile broadband love
-- I'm finding that I crave a bit of light 'net when I'm out and about, and
an impending change in circumstances will mean that I'm out and about a lot
more than I am currently.
&lt;/p&gt;
&lt;p&gt;
I have:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Hardware:&lt;/b&gt; Huawei E160e USB dongle, USB ID 12d1:1003&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Provider:&lt;/b&gt; Virgin Mobile Australia &lt;b&gt;Prepaid&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;OS:&lt;/b&gt; Debian GNU/Linux 5.0 with an upgraded 2.6.32 kernel&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
My wvdial.conf stanza looks like:
&lt;/p&gt;
&lt;pre&gt;
[Dialer virgin]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &amp;C1 &amp;D2 +FCLASS=0
Init3 = AT+CGDCONT=1,&quot;IP&quot; &quot;VirginBroadband&quot;
Stupid Mode = 1
ISDN = 0
Phone = *99#
Modem = /dev/ttyUSB0
Modem Type = USB Modem
Username = irrelevant
Dial Command = ATDT
Password = irrelevant
Baud = 460800
&lt;/pre&gt;
&lt;p&gt;
I also had to disable CHAP (by putting &lt;tt&gt;-chap&lt;/tt&gt; in
&lt;tt&gt;/etc/ppp/options&lt;/tt&gt;, although I suspect the same would have worked in
&lt;tt&gt;/etc/ppp/peers/wvdial&lt;/tt&gt;).
&lt;/p&gt;
&lt;p&gt;
After that, a simple &lt;tt&gt;sudo wvdial virgin&lt;/tt&gt; and I was away.
&lt;/p&gt;
&lt;p&gt;
Scarily enough, there was actually some &lt;a
href=&quot;http://virginmobile.custhelp.com/app/answers/detail/a_id/57/~/supported-usb-mobile-broadband-modems&quot;&gt;useful
information&lt;/a&gt; on the Virgin support site regarding the settings, which
helped me confirm that I was on the right track.  I have no doubt that the
universe will find some alternate means of punishing me down the line.
&lt;/p&gt;
</description>
  </item>

  <item>
   <title>Making pbuilder just that little bit faster</title>
   <link>http://www.hezmatt.org/~mpalmer/blog/general/making_pbuilder_faster.html</link>
   <description>&lt;p&gt;
	Give yourself a small, slightly late christmas present, and put a tmpfs on
	&lt;tt&gt;/var/cache/pbuilder/build&lt;/tt&gt;.  It makes a noticable difference,
	especially if you're on a laptop system (like I am) with a disk that's not
	going to win any speed records.
&lt;/p&gt;
</description>
  </item>

  <item>
   <title>When Scientists Get Into The Kitchen...</title>
   <link>http://www.hezmatt.org/~mpalmer/blog/general/when_scientists_get_into_the_kitchen.html</link>
   <description>&lt;p&gt;
	You get a rigorous analysis of the science behind &lt;a
href=&quot;http://www.seriouseats.com/2009/10/the-food-lab-science-of-how-to-cook-perfect-boiled-eggs.html&quot;&gt;boiling
eggs&lt;/a&gt;.  I want one of those thermal circulators for Christmas.
&lt;/p&gt;
</description>
  </item>

  <item>
   <title>Cool Regex Win-of-the-week</title>
   <link>http://www.hezmatt.org/~mpalmer/blog/general/cool_regex_win_of_the_week.html</link>
   <description>&lt;p&gt;
	I just had a need to match a regex where there were two occurances
	of the same string, and it would be really, really nice to make sure that
	both occurances were actually the same (rather than both being different
	strings that just happen to match the same regex).  Just to be funny, I tried
	this:
&lt;/p&gt;
&lt;pre&gt;
  /([a-z0-9\.-]+).*\1/
&lt;/pre&gt;
&lt;p&gt;
	And knock me down with a feather, &lt;b&gt;it worked&lt;/b&gt;!  This is using
	Ruby's regex handling, but I'd be stunned if Perl didn't also handle this
	case.
&lt;/p&gt;
&lt;p&gt;
	The world just got a little bit awesomer today.
&lt;/p&gt;
</description>
  </item>

  <item>
   <title>Is There Something Wrong With Me...</title>
   <link>http://www.hezmatt.org/~mpalmer/blog/general/is_there_something_wrong_with_me.html</link>
   <description>&lt;p&gt;
	When the first thing I thought of when I saw &lt;a
	href=&quot;http://www.clevercuties.com/shopexd.asp?id=181&quot;&gt;this baby
	outfit&lt;/a&gt; was &quot;What sort of cretin wrote that code?&quot;, rather than
	anything more &quot;paternal&quot;?
&lt;/p&gt;
</description>
  </item>

  <item>
   <title>I want those two day of my life back, Puppet</title>
   <link>http://www.hezmatt.org/~mpalmer/blog/general/i_want_those_two_days_of_my_life_back_puppet.html</link>
   <description>&lt;p&gt;
	Pop Quiz time, everyone (well, the Puppet-using subset of
	&quot;everyone&quot;, anyway).  Where is the dependency loop in the following
	manifest:
&lt;/p&gt;
&lt;pre&gt;
class klass {
   file { ['/tmp/a']: ensure =&gt; present }
}

define def_file() {
   include klass

   file { $name:
      ensure =&gt; present,
      require =&gt; File['/tmp/a']
   }
}

def_file { '/tmp/b': }

def_file { '/tmp/c': require =&gt; File['/tmp/b'] }
&lt;/pre&gt;
&lt;p&gt;
	This seems pretty straightforward: &lt;tt&gt;/tmp/c&lt;/tt&gt; can't be created
	until &lt;tt&gt;/tmp/b&lt;/tt&gt; (via the direct require) and &lt;tt&gt;/tmp/a&lt;/tt&gt;
	(via the define) have been created, while &lt;tt&gt;/tmp/b&lt;/tt&gt; can't be
	created until &lt;tt&gt;/tmp/a&lt;/tt&gt; is created.  You can draw some pretty
	graphs and see that everything looks fine.
&lt;/p&gt;
&lt;p&gt;
	However, if you run this manifest, you will find that roughly half
	the time, you will get a failure saying that there's a dependency
	loop (and the other half of the time it'll work fine), like this:
	&quot;&lt;tt&gt;err: Could not apply complete catalog: Found dependency cycles
	in the following relationships&lt;/tt&gt;&quot;.
&lt;/p&gt;
&lt;p&gt;
	So, where is the loop?  It's because the require on the
	&lt;tt&gt;/tmp/c&lt;/tt&gt; resource also applies to the &lt;tt&gt;/tmp/a&lt;/tt&gt;
	resource -- &lt;em&gt;iff the &lt;tt&gt;include klass&lt;/tt&gt; directive is applied
	to the &lt;tt&gt;/tmp/c&lt;/tt&gt; resource&lt;/em&gt;.  So `/tmp/a` then requires
	`/tmp/b`, and `/tmp/b` requires `/tmp/a`, and it's LOOP TIME!
&lt;/p&gt;
&lt;p&gt;
	Whether or not this loop occurs on a particular Puppet run is
	controlled by fickle Lady Fate (because Ruby hashes, which are used
	at some point internally in this process, don't have a well-defined
	or stable order).  As to why the &lt;tt&gt;include&lt;/tt&gt; only applies to
	one of the defines rather than all of them, well, that's related to
	the fact that a class only gets evaluated once, and I think someone
	was having a lazy day when they wrote that part of the system (I
	can't imagine it would be the end of the world if each instance of
	the class was linked to the defined resource in the scope tree).
&lt;/p&gt;
&lt;p&gt;
	Now, when you've only got the above manifest, it's relatively
	straightforward to isolate the problem and fix it -- I had it sorted
	in about an hour.  The two days prior to that were isolating the bug
	from the live manifest, because there are about 20 instances of
	&lt;tt&gt;def_file&lt;/tt&gt; in our live manifest, and so I'd have to run
	Puppet (on average) 20 times to make the problem appear every time I
	had a new hypothesis (and since I didn't know whether the bug was
	client-side or server-side, I had to run it in the real, full-blown
	environment, which slows things down further).  If the
	class-handling stuff had been written &lt;em&gt;properly&lt;/em&gt;, then the
	error would have been constant, rather than intermittent, and I
	would have been asking for a couple of hours credit, not a couple of
	days.
&lt;/p&gt;
&lt;p&gt;
	The fix?  Use virtual resources instead of the class, which does
	$DEITY-only-knows-what to the scope tree.  These have their own
	giant buckets of ugliness, but our options, at this point, are
	unpleasantly limited.
&lt;/p&gt;
&lt;p&gt;
	I really do wonder why I'm not a raging alcoholic sometimes.  The
	reasons not to are strangely hard to recall right at this moment...
&lt;/p&gt;
</description>
  </item>

  <item>
   <title>Oh Firefox...</title>
   <link>http://www.hezmatt.org/~mpalmer/blog/general/oh_firefox.html</link>
   <description>&lt;p&gt;
	What are you doing in that the 1.1GB of resident memory (1357m of
	virtual memory) you have decided to consume in order to display three
	web pages?  All fairly basic pages -- no flash, no excessive Javascript, and I
	haven't even done anything particularly exciting in the browser -- just loaded the
	pages up and
	let them sit for a few days.
&lt;/p&gt;
&lt;p&gt;
	Time to look at Conkeror on the Netbook, I suppose.  I'm unlikely to
	be needing Firebug on there any time soon.
&lt;/p&gt;
</description>
  </item>

  <item>
   <title>Vimoutliner... finally!</title>
   <link>http://www.hezmatt.org/~mpalmer/blog/general/vimoutliner_finally.html</link>
   <description>&lt;p&gt;
	I am, at best, a vim dilettante, preferring joe for most of my day-to-day
	text-editing needs.  However, I do like using vimoutliner for notes, plans,
	todo lists, and calendaring (more on that some other time).
&lt;/p&gt;
&lt;p&gt;
	However, the Debian vimoutliner package (in combination with the awesomely
	undocumented vim-addons mess) is an absolute pain to get going, requiring
	far more swearing and prodding than seems necessary.  Since I don't do it
	often enough, too, I keep forgetting how, and today things came to an
	absolute head when I very nearly flung my netbook across the room as it
	singularly &lt;em&gt;refused&lt;/em&gt; to do my outliner bidding.
&lt;/p&gt;
&lt;p&gt;
	Finally, however, after much swearing (and even installing vimoutliner's
	upstream package to see if it worked -- it did -- and what it was doing
	differently -- just a small, crucial addition to &lt;tt&gt;.vimrc&lt;/tt&gt;), I got
	the magical recipe.  No doubt someone with an acheing need to make sure
	that vim stays as user-hostile as possible will immediately spring into
	action to
	make sure this doesn't work for squeeze, but at least for the life of
	lenny, here's how to get vimoutliner working:
&lt;/p&gt;
&lt;pre&gt;
 # apt-get install vim-vimoutliner vim-addon-manager vim
 $ vim-addons install vimoutliner
 $ echo &quot;filetype plugin indent on&quot; &gt;&gt; ~/.vimrc
&lt;/pre&gt;
&lt;p&gt;
	May it help someone avoid putting their laptop through a wall.
&lt;/p&gt;
</description>
  </item>

  <item>
   <title>Backwards Compatibility FTW</title>
   <link>http://www.hezmatt.org/~mpalmer/blog/general/backwards_compatibility_ftw.html</link>
   <description>&lt;p&gt;
	Over the weekend I updated a small app I wrote for my local bushfire
	brigade from Rails 1.2 to Rails 2.3.  Given it's small size,
	all-encompassing test suite, and general lack	of mission criticality, I
	decided to bite the bullet and just kick up straight to Rails 2.3.2, and
	fix whatever broke.  I was expecting quite a bit of fun and games.
&lt;/p&gt;
&lt;p&gt;
	Well, there was fun, and there were games, but it was all relatively
	painless.  I had to run &lt;tt&gt;rake rails:unpdate&lt;/tt&gt;, add a couple of
	session config lines to my &lt;tt&gt;environment.rb&lt;/tt&gt;, and get rid of a bunch
	of testing plugins that had been superceded by functionality in core
	(which involved me rewriting an awful lot of XPath into CSS selectors -- a
	massive net win, I have to say), but the core code of the application was
	completely unchanged (not a single line changed in the &lt;tt&gt;app&lt;/tt&gt;
	directory).
&lt;/p&gt;
&lt;p&gt;
	Given the number of major releases I leapt, and the fairly haphazard way
	in which I did it, I am quite pleasantly surprised at the outcome.  Kudos
	to all the Rails hackers who made it possible.
&lt;/p&gt;
</description>
  </item>

  <item>
   <title>The Rise and Fall of Wordperfect</title>
   <link>http://www.hezmatt.org/~mpalmer/blog/general/the_rise_and_fall_of_wordperfect.html</link>
   <description>&lt;p&gt;
	It's been sitting in my browser for so long that I've forgotten where I
	got it from, but I've just finished reading &lt;a
	href=&quot;http://www.wordplace.com/ap/index.shtml&quot;&gt;The Rise and Fall of
	Wordperfect Corporation&lt;/a&gt;, written by W. E. &quot;Pete&quot; Peterson, one of the
	very early employees of the company, and one of the top people there for
	many years.
&lt;/p&gt;
&lt;p&gt;
	It's a really interesting book, giving some insights into what it
	was like in the early days of &quot;the microcomputer revolution&quot;, and
	with some solid observations of how to (and how not to) run a
	software company, and manage a very rapidly growing organisation. 
	I'd recommend it to computer historians, software development
	managers, and business owners.
&lt;/p&gt;
</description>
  </item>

  </channel>
</rss>