<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">

  <title><![CDATA[scie.nti.st]]></title>
  
  <link href="http://scie.nti.st/" />
  <updated>2013-06-13T01:56:09-07:00</updated>
  <id>http://scie.nti.st/</id>
  <author>
    <name><![CDATA[Garry Dolley]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/scientist-home" /><feedburner:info uri="scientist-home" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>34.166906</geo:lat><geo:long>-118.34366</geo:long><feedburner:emailServiceId>scientist-home</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><entry>
    <title type="html"><![CDATA[Using duplicity for full server backup on Ubuntu 12.04]]></title>
    <link href="http://feedproxy.google.com/~r/scientist-home/~3/LrOlrSGFtb0/using-duplicity-for-full-server-backup-on-ubuntu-12-dot-04" />
    <updated>2013-04-13T05:23:00-07:00</updated>
    <id>http://scie.nti.st/2013/4/13/using-duplicity-for-full-server-backup-on-ubuntu-12-dot-04</id>
    <content type="html">&lt;p&gt;&lt;a class="reference external" href="http://duplicity.nongnu.org/"&gt;duplicity&lt;/a&gt; is a great full featured backup tool, providing &amp;quot;encrypted
bandwidth-efficient backups using the rsync algorithm.&amp;quot;  I&amp;#8217;m choosing it for my
backup needs primarily for the follow reasons:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Supports a fleet of backup server types, and even a chroot&amp;#8217;d SFTP server will work&lt;/li&gt;
&lt;li&gt;Works with Linux, FreeBSD, and OpenBSD, out of the box&lt;/li&gt;
&lt;li&gt;Does not require root access on the backup server&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To perform full server backups using duplicity on your Ubuntu 12.04 system,
simply perform the following.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p class="first"&gt;Install duplicity:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
sudo apt-get install duplicity
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Perform backup (using &lt;tt class="docutils literal"&gt;rsync&lt;/tt&gt; method):&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ sudo -H duplicity --no-encryption \
  --exclude /mnt --exclude /tmp --exclude /proc --exclude /sys \
  / rsync://&amp;lt;user&amp;gt;&amp;#64;&amp;lt;host&amp;gt;//&amp;lt;backup-directory&amp;gt;
&lt;/pre&gt;
&lt;p&gt;You&amp;#8217;ll need to replace &lt;tt class="docutils literal"&gt;&amp;lt;user&amp;gt;&lt;/tt&gt;, &lt;tt class="docutils literal"&gt;&amp;lt;host&amp;gt;&lt;/tt&gt; and &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;&amp;lt;backup-directory&amp;gt;&lt;/span&gt;&lt;/tt&gt; with
your backup username, host, and directory, respectively.  See the &amp;quot;Full
Example&amp;quot; below for more info.&lt;/p&gt;
&lt;p&gt;Output should look something like:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
Import of duplicity.backends.sshbackend Failed: No module named paramiko
Import of duplicity.backends.giobackend Failed: No module named gio
Local and Remote metadata are synchronized, no sync needed.
Last full backup date: none
No signatures found, switching to full backup.
&lt;/pre&gt;
&lt;p&gt;If you&amp;#8217;d like your backups to be encrypted, simply remove the
&lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;&amp;#8211;no-encryption&lt;/span&gt;&lt;/tt&gt; option and provide a passphrase when prompted.  You&amp;#8217;ll
need this same passphrase to restore from a backup.  It is a symmetric key.
Keep the key very safe; if you lose it, &lt;strong&gt;your backups will be useless&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Schedule regular backups&lt;/p&gt;
&lt;p&gt;The next step is to set this up in &lt;tt class="docutils literal"&gt;cron&lt;/tt&gt;, so your backups are done
regularly.  The following entries in &lt;tt class="docutils literal"&gt;/etc/crontab&lt;/tt&gt; will perform a full
backup once a week, Sunday at midnight, then incremental backups the other 6
days of the week (also at midnight).  Additionally, we want to clean up
backups that are too old, so we add an additional entry to keep only the
latest two full backups (plus incrementals).&lt;/p&gt;
&lt;pre class="literal-block"&gt;
0 0 * * sun     root    duplicity full --no-encryption --exclude /mnt --exclude /tmp --exclude /proc --exclude /sys / rsync://&amp;lt;user&amp;gt;&amp;#64;&amp;lt;host&amp;gt;//&amp;lt;backup-directory&amp;gt;
0 0 * * 1-6     root    duplicity --no-encryption --exclude /mnt --exclude /tmp --exclude /proc --exclude /sys / rsync://&amp;lt;user&amp;gt;&amp;#64;&amp;lt;host&amp;gt;//&amp;lt;backup-directory&amp;gt;
0 8 * * sun     root    duplicity remove-all-but-n-full 2 --force rsync://&amp;lt;user&amp;gt;&amp;#64;&amp;lt;host&amp;gt;//&amp;lt;backup-directory&amp;gt;
&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="section" id="full-example-for-an-arp-networks-vps"&gt;
&lt;h2&gt;Full Example for an ARP Networks VPS&lt;/h2&gt;
&lt;p&gt;At &lt;a class="reference external" href="http://www.arpnetworks.com"&gt;ARP Networks&lt;/a&gt;, we provide raw backup space to customers for 10 cents per
GB.  The example below will illustrate how to do a full backup of your Ubuntu
or Debian VPS.  Assuming your backup username is &lt;strong&gt;johndoe&lt;/strong&gt;, simply perform
the following steps.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p class="first"&gt;Add &lt;tt class="docutils literal"&gt;root&lt;/tt&gt; SSH public key to backup server&lt;/p&gt;
&lt;p&gt;Create an SSH key for &lt;tt class="docutils literal"&gt;root&lt;/tt&gt; as follows:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
sudo -H ssh-keygen -t rsa -b 2048
&lt;/pre&gt;
&lt;p&gt;Accept the defaults and choose a good passphrase.&lt;/p&gt;
&lt;p&gt;See the &lt;a class="reference external" href="https://portal.arpnetworks.com"&gt;Portal&lt;/a&gt;, click on the &lt;em&gt;Backup Space&lt;/em&gt; service, and then click the link
to submit an SSH key.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Install duplicity:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
sudo apt-get install duplicity
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Perform backup (using &lt;tt class="docutils literal"&gt;rsync&lt;/tt&gt; method):&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ sudo -H duplicity --no-encryption \
  --exclude /mnt --exclude /tmp --exclude /proc --exclude /sys \
  / rsync://johndoe&amp;#64;backup01.cust.arpnetworks.com//home/johndoe
&lt;/pre&gt;
&lt;p&gt;&lt;tt class="docutils literal"&gt;backup01.cust.arpnetworks.com&lt;/tt&gt; is one of our backup servers.  If the
&lt;a class="reference external" href="https://portal.arpnetworks.com"&gt;Portal&lt;/a&gt; lists a different server for you, use that one.&lt;/p&gt;
&lt;p&gt;Additionally, as mentioned above, if you want your backups to be encrypted, remove the
&lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;&amp;#8211;no-encryption&lt;/span&gt;&lt;/tt&gt; option.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Schedule regular backups&lt;/p&gt;
&lt;p&gt;Put the following in your &lt;tt class="docutils literal"&gt;/etc/crontab&lt;/tt&gt;&lt;/p&gt;
&lt;pre class="literal-block"&gt;
0 0 * * sun     root    duplicity full --no-encryption --exclude /mnt --exclude /tmp --exclude /proc --exclude /sys / rsync://johndoe&amp;#64;backup01.cust.arpnetworks.com//home/johndoe
0 0 * * 1-6     root    duplicity --no-encryption --exclude /mnt --exclude /tmp --exclude /proc --exclude /sys / rsync://johndoe&amp;#64;backup01.cust.arpnetworks.com//home/johndoe
0 8 * * sun     root    duplicity remove-all-but-n-full 2 --force rsync://johndoe&amp;#64;backup01.cust.arpnetworks.com//home/johndoe
&lt;/pre&gt;
&lt;p&gt;Note: Please adjust the backup time to your own preference, otherwise many
backups may fire off at the exact same time, slowing down the host.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;#8230;and that&amp;#8217;s all there is to it!&lt;/p&gt;
&lt;/div&gt;

&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=LrOlrSGFtb0:hdlpzglzGB4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=LrOlrSGFtb0:hdlpzglzGB4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=LrOlrSGFtb0:hdlpzglzGB4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=LrOlrSGFtb0:hdlpzglzGB4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=LrOlrSGFtb0:hdlpzglzGB4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=LrOlrSGFtb0:hdlpzglzGB4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=LrOlrSGFtb0:hdlpzglzGB4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=LrOlrSGFtb0:hdlpzglzGB4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
  <feedburner:origLink>http://scie.nti.st/2013/4/13/using-duplicity-for-full-server-backup-on-ubuntu-12-dot-04</feedburner:origLink></entry>
  
  <entry>
    <title type="html"><![CDATA[How to add a new partition on OpenBSD]]></title>
    <link href="http://feedproxy.google.com/~r/scientist-home/~3/txR8YNseQNs/how-to-add-a-new-partition-on-openbsd" />
    <updated>2013-03-05T03:30:00-08:00</updated>
    <id>http://scie.nti.st/2013/3/5/how-to-add-a-new-partition-on-openbsd</id>
    <content type="html">&lt;p&gt;Following the same theme as my &lt;a class="reference external" href="http://scie.nti.st/2013/3/4/how-to-resize-an-openbsd-root-partition/"&gt;last post&lt;/a&gt;, instead of claiming space added to
the end of a volume by &lt;strong&gt;extending&lt;/strong&gt; an existing partition (technically, a
&amp;quot;slice&amp;quot; in OpenBSD), I will show how to &lt;strong&gt;add&lt;/strong&gt; a new partition using this
space.&lt;/p&gt;
&lt;p&gt;I find it convenient to create the new slice as the &amp;quot;d&amp;quot; slice and then put
&lt;tt class="docutils literal"&gt;/home&lt;/tt&gt; onto it.&lt;/p&gt;
&lt;p&gt;So, let&amp;#8217;s get started.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p class="first"&gt;Boot into the system&amp;#8217;s rescue disk:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
&amp;gt; boot bsd.rd
&lt;/pre&gt;
&lt;p&gt;Then select &lt;tt class="docutils literal"&gt;(S)hell&lt;/tt&gt; at the prompt.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Claim extra space&lt;/p&gt;
&lt;p&gt;Re-initialize the MBR, using the entire disk.&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# fdisk -i wd0
Do you wish to write new MBR and partition table? [n] y
Writing MBR at offset 0.
#
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Add a new slice for &lt;tt class="docutils literal"&gt;/home&lt;/tt&gt; (the &amp;quot;d&amp;quot; slice)&lt;/p&gt;
&lt;p&gt;This system has only the root slice and swap.  We will add a new slice, using
all the unused space at the end.  In the following example, I have a 120GB
volume, where 20GB is used by root and swap, and the rest unallocated.&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# disklabel -E wd0
Label editor (enter '?' for help at any prompt)
&amp;gt; p
OpenBSD area: 64-251658225; size: 251658161; free: 209728575
#                size           offset  fstype [fsize bsize  cpg]
  a:         38812976               64  4.2BSD   2048 16384 38128
  b:          3116610         38813040    swap
  c:        251658240                0  unused
&amp;gt; a
partition: [d]
offset: [41929650]
size: [209728575]
FS type: [4.2BSD]
Rounding offset to bsize (32 sectors): 41929664
Rounding size to bsize (32 sectors): 209728544
&amp;gt; p
OpenBSD area: 64-251658225; size: 251658161; free: 31
#                size           offset  fstype [fsize bsize  cpg]
  a:         38812976               64  4.2BSD   2048 16384 38128
  b:          3116610         38813040    swap
  c:        251658240                0  unused
  d:        209728544         41929664  4.2BSD   2048 16384    1
&amp;gt; w
&amp;gt; q
No label changes.
#
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Create a filesystem on the new slice:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# newfs /dev/rwd0d
/dev/rwd0d: 102406.5MB in 209728544 sectors of 512 bytes
506 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
super-block backups (for fsck -b #) at:
 32, 414688, 829344, 1244000, 1658656, 2073312, 2487968, 2902624, 3317280,
 3731936, 4146592, 4561248, 4975904, 5390560, 5805216, 6219872, 6634528,
 7049184, 7463840, 7878496, 8293152, 8707808, 9122464, 9537120, 9951776,
 ...
 [snip]
 ...
 193229728, 193644384, 194059040, 194473696, 194888352, 195303008, 195717664,
 196132320, 196546976, 196961632, 197376288, 197790944, 198205600, 198620256,
 199034912, 199449568, 199864224, 200278880, 200693536, 201108192, 201522848,
 201937504, 202352160, 202766816, 203181472, 203596128, 204010784, 204425440,
 204840096, 205254752, 205669408, 206084064, 206498720, 206913376, 207328032,
 207742688, 208157344, 208572000, 208986656, 209401312,
#
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Migrate &lt;tt class="docutils literal"&gt;/home&lt;/tt&gt;&lt;/p&gt;
&lt;p&gt;Here, we mount the root filesystem (which contains the old &lt;tt class="docutils literal"&gt;/home&lt;/tt&gt;), and
also the new filesystem, and finally migrate the data from old &lt;tt class="docutils literal"&gt;/home&lt;/tt&gt; to
new space.&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# mount /dev/wd0a /mnt
# mount /dev/wd0d /mnt2
# (cd /mnt/home; tar cf - .) | (cd /mnt2; tar xpf -)
# rm -rf /mnt/home
# mkdir /mnt/home
&lt;/pre&gt;
&lt;p&gt;Note, the &lt;tt class="docutils literal"&gt;tar&lt;/tt&gt; command above is a nice platform independent way of copying
everything from one directory to another, preserving everything (permissions,
etc&amp;#8230;).  The &lt;tt class="docutils literal"&gt;cp&lt;/tt&gt; command is different on Linux and the *BSDs, yet
&lt;tt class="docutils literal"&gt;tar&lt;/tt&gt;, used in the above fasion, is identical on Linux, FreeBSD, NetBSD,
and OpenBSD.  I thank Todd Fries of &lt;a class="reference external" href="http://freedaemonconsulting.com"&gt;Free Daemon Consulting&lt;/a&gt; for teaching me
that one.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Mount on boot&lt;/p&gt;
&lt;p&gt;The following command will add the new &lt;tt class="docutils literal"&gt;/home&lt;/tt&gt; to your &lt;tt class="docutils literal"&gt;/etc/fstab&lt;/tt&gt; so it
is automatically mounted upon boot.&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# echo &amp;quot;/dev/wd0d /home ffs rw,softdep 0 1&amp;quot; &amp;gt;&amp;gt; /mnt/etc/fstab
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Clean up:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# umount /mnt*
# reboot
&lt;/pre&gt;
&lt;p&gt;Now enjoy the extra space!&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=txR8YNseQNs:a5MRyGmJBdc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=txR8YNseQNs:a5MRyGmJBdc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=txR8YNseQNs:a5MRyGmJBdc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=txR8YNseQNs:a5MRyGmJBdc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=txR8YNseQNs:a5MRyGmJBdc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=txR8YNseQNs:a5MRyGmJBdc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=txR8YNseQNs:a5MRyGmJBdc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=txR8YNseQNs:a5MRyGmJBdc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
  <feedburner:origLink>http://scie.nti.st/2013/3/5/how-to-add-a-new-partition-on-openbsd</feedburner:origLink></entry>
  
  <entry>
    <title type="html"><![CDATA[How to resize an OpenBSD root partition]]></title>
    <link href="http://feedproxy.google.com/~r/scientist-home/~3/eo3FBdWqwfI/how-to-resize-an-openbsd-root-partition" />
    <updated>2013-03-04T02:58:00-08:00</updated>
    <id>http://scie.nti.st/2013/3/4/how-to-resize-an-openbsd-root-partition</id>
    <content type="html">&lt;p&gt;At &lt;a class="reference external" href="http://www.arpnetworks.com"&gt;ARP Networks&lt;/a&gt;, sometimes we have to resize an &lt;a class="reference external" href="http://www.openbsd.org"&gt;OpenBSD&lt;/a&gt; root partition to
satsify a customer requirement, template requirement, or something else along
those lines.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve sometimes seen customers struggle to do this themselves, so the following
is an example of how I resized a root partition from 5 GB to 9 GB, leaving 1 GB
for swap.  The underlying volume was already expanded from 5 GB to 10 GB, to
give us room to do this.&lt;/p&gt;
&lt;p&gt;So, let&amp;#8217;s get to it.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p class="first"&gt;Boot into the system&amp;#8217;s rescue disk:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
&amp;gt; boot bsd.rd
&lt;/pre&gt;
&lt;p&gt;Then select &lt;tt class="docutils literal"&gt;(S)hell&lt;/tt&gt; at the prompt.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Resize:&lt;/p&gt;
&lt;p&gt;Grab the &lt;tt class="docutils literal"&gt;growfs(8)&lt;/tt&gt; program from the root partition.  This isn&amp;#8217;t included
with the rescue disk, for some reason.&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# mount /dev/wd0a /mnt
# cp /mnt/sbin/growfs .
# umount /mnt
&lt;/pre&gt;
&lt;p&gt;Re-initialize the MBR, using the entire disk.&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# fdisk -i wd0
Do you wish to write new MBR and partition table? [n] y
Writing MBR at offset 0.
#
&lt;/pre&gt;
&lt;p&gt;Change the size of the slices.&lt;/p&gt;
&lt;p&gt;This system has only the root partition and swap.  The idea is to remove the
swap partition, then extend root, and finally put the swap partition back.&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# disklabel -E wd0
# Inside MBR partition 3: type A6 start 63 size 20964762
Treating sectors 63-20964825 as the OpenBSD portion of the disk.
You can use the 'b' command to change this.

Initial label editor (enter '?' for help at any prompt)
&amp;gt; p
OpenBSD area: 63-20964825; size: 20964762; free: 9446220
#                size           offset  fstype [fsize bsize  cpg]
  a:         10490382               63  4.2BSD   2048 16384    1
  b:          1028160         10490445    swap
  c:         20971520                0  unused
&amp;gt; d
partition to delete: [] b
&amp;gt; p
OpenBSD area: 63-20964825; size: 20964762; free: 10474380
#                size           offset  fstype [fsize bsize  cpg]
  a:         10490382               63  4.2BSD   2048 16384    1
  c:         20971520                0  unused
&amp;gt; c
partition to change size: [] a
Partition a is currently 10490382 sectors in size, and can have a maximum
size of 20964762 sectors.
size: [10490382] 9G
Rounding to cylinder: 18876312
&amp;gt; a b
offset: [18876375]
size: [2088450]
FS type: [swap]
&amp;gt; p
OpenBSD area: 63-20964825; size: 20964762; free: 0
#                size           offset  fstype [fsize bsize  cpg]
  a:         18876312               63  4.2BSD   2048 16384    1
  b:          2088450         18876375    swap
  c:         20971520                0  unused
&amp;gt; w
&amp;gt; q
No label changes.
#
&lt;/pre&gt;
&lt;p&gt;Grow the filesystem using &lt;tt class="docutils literal"&gt;growfs(8)&lt;/tt&gt;&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# growfs /dev/wd0a
We strongly recommend you to make a backup before growing the Filesystem

 Did you backup your data (Yes/No) ? Yes
new file systemsize is: 4719078 frags
Warning: 216792 sector(s) cannot be allocated.
growfs: 9111.1MB (18659520 sectors) block size 16384, fragment size 2048
        using 45 cylinder groups of 202.47MB, 12958 blks, 25984 inodes.
super-block backups (for fsck -b #) at:
 10781088, 11195744, 11610400, 12025056, 12439712, 12854368, 13269024, 13683680, 14098336, 14512992, 14927648, 15342304, 15756960, 16171616, 16586272, 17000928, 17415584, 17830240,
 18244896
#
&lt;/pre&gt;
&lt;p&gt;Give it a rinse.&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# fsck /dev/wd0a
** /dev/rwd0a
** Last Mounted on /
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
100205 files, 418854 used, 4172217 free (97 frags, 521515 blocks, 0.0% fragmentation)

MARK FILE SYSTEM CLEAN? [Fyn?] y


***** FILE SYSTEM WAS MODIFIED *****
#
&lt;/pre&gt;
&lt;p&gt;And that&amp;#8217;s pretty much it.  Everything is done within &lt;a class="reference external" href="http://www.openbsd.org"&gt;OpenBSD&lt;/a&gt;&amp;#8217;s rescue disk
kernel &lt;tt class="docutils literal"&gt;bsd.rd&lt;/tt&gt;, no need to have a separate CD-ROM / USB rescue disk
utility.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=eo3FBdWqwfI:Mm6RFd-2PHo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=eo3FBdWqwfI:Mm6RFd-2PHo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=eo3FBdWqwfI:Mm6RFd-2PHo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=eo3FBdWqwfI:Mm6RFd-2PHo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=eo3FBdWqwfI:Mm6RFd-2PHo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=eo3FBdWqwfI:Mm6RFd-2PHo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=eo3FBdWqwfI:Mm6RFd-2PHo:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=eo3FBdWqwfI:Mm6RFd-2PHo:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
  <feedburner:origLink>http://scie.nti.st/2013/3/4/how-to-resize-an-openbsd-root-partition</feedburner:origLink></entry>
  
  <entry>
    <title type="html"><![CDATA[Having a Javascript moment with Ruby, WTF is going on here...]]></title>
    <link href="http://feedproxy.google.com/~r/scientist-home/~3/F0dKCx5R0rE/having-a-javascript-moment-with-ruby-wtf-is-going-on-here" />
    <updated>2013-03-01T18:55:00-08:00</updated>
    <id>http://scie.nti.st/2013/3/1/having-a-javascript-moment-with-ruby-wtf-is-going-on-here</id>
    <content type="html">&lt;p&gt;WTF is going on here?&lt;/p&gt;
&lt;figure class="code"&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class="line-number"&gt;1&lt;/span&gt;
&lt;span class="line-number"&gt;2&lt;/span&gt;
&lt;span class="line-number"&gt;3&lt;/span&gt;
&lt;span class="line-number"&gt;4&lt;/span&gt;
&lt;span class="line-number"&gt;5&lt;/span&gt;
&lt;span class="line-number"&gt;6&lt;/span&gt;
&lt;span class="line-number"&gt;7&lt;/span&gt;
&lt;span class="line-number"&gt;8&lt;/span&gt;
&lt;span class="line-number"&gt;9&lt;/span&gt;
&lt;span class="line-number"&gt;10&lt;/span&gt;
&lt;span class="line-number"&gt;11&lt;/span&gt;
&lt;span class="line-number"&gt;12&lt;/span&gt;
&lt;span class="line-number"&gt;13&lt;/span&gt;
&lt;span class="line-number"&gt;14&lt;/span&gt;
&lt;span class="line-number"&gt;15&lt;/span&gt;
&lt;span class="line-number"&gt;16&lt;/span&gt;
&lt;span class="line-number"&gt;17&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;pre&gt;&lt;code class="irb"&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;(rdb:1) sum&lt;/span&gt;
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;244.4&lt;/span&gt;
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;(rdb:1) amount&lt;/span&gt;
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;244.4&lt;/span&gt;
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;(rdb:1) sum != amount&lt;/span&gt;
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;(rdb:1) sum.to_f&lt;/span&gt;
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;244.4&lt;/span&gt;
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;(rdb:1) amount.to_f&lt;/span&gt;
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;244.4&lt;/span&gt;
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;(rdb:1) sum.to_f != amount.to_f&lt;/span&gt;
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;(rdb:1) sum == amount&lt;/span&gt;
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;false&lt;/span&gt;
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;(rdb:1) sum.to_f == amount.to_f&lt;/span&gt;
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;false&lt;/span&gt;
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;(rdb:1)&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p&gt;First guess is some type conversion problem&amp;#8230;&lt;/p&gt;
&lt;p&gt;Still investigating.&lt;/p&gt;

&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=F0dKCx5R0rE:sgoPhYdJrCY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=F0dKCx5R0rE:sgoPhYdJrCY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=F0dKCx5R0rE:sgoPhYdJrCY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=F0dKCx5R0rE:sgoPhYdJrCY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=F0dKCx5R0rE:sgoPhYdJrCY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=F0dKCx5R0rE:sgoPhYdJrCY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=F0dKCx5R0rE:sgoPhYdJrCY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=F0dKCx5R0rE:sgoPhYdJrCY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
  <feedburner:origLink>http://scie.nti.st/2013/3/1/having-a-javascript-moment-with-ruby-wtf-is-going-on-here</feedburner:origLink></entry>
  
  <entry>
    <title type="html"><![CDATA[Using the quota command within a chroot environment]]></title>
    <link href="http://feedproxy.google.com/~r/scientist-home/~3/srjfQwm3PFI/using-the-quota-command-within-a-chroot-environment" />
    <updated>2013-03-01T03:50:00-08:00</updated>
    <id>http://scie.nti.st/2013/3/1/using-the-quota-command-within-a-chroot-environment</id>
    <content type="html">&lt;p&gt;I was recently using &lt;a class="reference external" href="http://olivier.sessink.nl/jailkit/index.html"&gt;Jailkit&lt;/a&gt; on &lt;a class="reference external" href="http://ubuntu.com"&gt;Ubuntu&lt;/a&gt; to set up a chroot environment for
users of a backup storage server.  I wanted to give the users the ability to
check their quotas with the regular &lt;tt class="docutils literal"&gt;quota&lt;/tt&gt; command.&lt;/p&gt;
&lt;p&gt;I go about telling Jailkit that the chroot directory will need the &lt;tt class="docutils literal"&gt;quota&lt;/tt&gt;
binary.  This should be all that is needed, or so I thought.&lt;/p&gt;
&lt;p&gt;Upon checking a quota as a chroot&amp;#8217;d user, it barfs the following error,&lt;/p&gt;
&lt;figure class="code"&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class="line-number"&gt;1&lt;/span&gt;
&lt;span class="line-number"&gt;2&lt;/span&gt;
&lt;span class="line-number"&gt;3&lt;/span&gt;
&lt;span class="line-number"&gt;4&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;pre&gt;&lt;code class="console"&gt;&lt;span class="line"&gt;&lt;span class="gp"&gt;$&lt;/span&gt; quota
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;quota: Cannot open quotafile /home/aquota.user: Permission denied&lt;/span&gt;
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;quota: Quota file not found or has wrong format.&lt;/span&gt;
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="gp"&gt;$&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p&gt;From what I can tell, this is a very misleading error message.  The permissions
of &lt;tt class="docutils literal"&gt;aquota.user&lt;/tt&gt; are always &lt;tt class="docutils literal"&gt;0600&lt;/tt&gt;, readable / writable only by &lt;tt class="docutils literal"&gt;root&lt;/tt&gt;.
This can&amp;#8217;t be changed, not even as &lt;tt class="docutils literal"&gt;root&lt;/tt&gt;.  Witness.&lt;/p&gt;
&lt;figure class="code"&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class="line-number"&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;pre&gt;&lt;code class="console"&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;-rw------- 1 root root 7168 2013-02-27 22:32 /home/bkusers/home/aquota.user&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p&gt;Using a bit of &lt;tt class="docutils literal"&gt;strace&lt;/tt&gt; and some luck, I find what the &lt;tt class="docutils literal"&gt;quota&lt;/tt&gt; command is
really looking for is &lt;tt class="docutils literal"&gt;/proc/sys/fs/quota&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;It simply does a &lt;tt class="docutils literal"&gt;stat()&lt;/tt&gt; system call on that directory within &lt;tt class="docutils literal"&gt;proc&lt;/tt&gt;, so
if you simply do,&lt;/p&gt;
&lt;figure class="code"&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class="line-number"&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;pre&gt;&lt;code class="console"&gt;&lt;span class="line"&gt;&lt;span class="gp"&gt;$&lt;/span&gt; sudo mkdir -p /home/bkusers/proc/sys/fs/quota
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p&gt;then the &lt;tt class="docutils literal"&gt;quota&lt;/tt&gt; command works like a charm within the chroot environment.&lt;/p&gt;
&lt;figure class="code"&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class="line-number"&gt;1&lt;/span&gt;
&lt;span class="line-number"&gt;2&lt;/span&gt;
&lt;span class="line-number"&gt;3&lt;/span&gt;
&lt;span class="line-number"&gt;4&lt;/span&gt;
&lt;span class="line-number"&gt;5&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;pre&gt;&lt;code class="console"&gt;&lt;span class="line"&gt;&lt;span class="gp"&gt;$&lt;/span&gt; quota -s
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;Disk quotas for user testuser (uid 1007):&lt;/span&gt;
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace&lt;/span&gt;
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="go"&gt;       /dev/md3      16       0   3907M               4       0       0&lt;/span&gt;
&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="gp"&gt;$&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p&gt;My chroot directory in these examples was obviously &lt;tt class="docutils literal"&gt;/home/bkusers&lt;/tt&gt;, modify
accordingly for your needs.&lt;/p&gt;

&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=srjfQwm3PFI:YNofO55jEEo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=srjfQwm3PFI:YNofO55jEEo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=srjfQwm3PFI:YNofO55jEEo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=srjfQwm3PFI:YNofO55jEEo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=srjfQwm3PFI:YNofO55jEEo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=srjfQwm3PFI:YNofO55jEEo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=srjfQwm3PFI:YNofO55jEEo:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=srjfQwm3PFI:YNofO55jEEo:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
  <feedburner:origLink>http://scie.nti.st/2013/3/1/using-the-quota-command-within-a-chroot-environment</feedburner:origLink></entry>
  
  <entry>
    <title type="html"><![CDATA[The 'Yes' men]]></title>
    <link href="http://feedproxy.google.com/~r/scientist-home/~3/lE08xup_qlQ/the-yes-men" />
    <updated>2013-02-17T02:47:00-08:00</updated>
    <id>http://scie.nti.st/2013/2/17/the-yes-men</id>
    <content type="html">&lt;p&gt;Let me turn a corner and cover a non-technical topic here for once&amp;#8230;&lt;/p&gt;

&lt;p&gt;Several years ago, I had a job where I had to ask myself the following question, &amp;#8220;Do I do what I think is right, or do I do what will make my new boss happy?&amp;#8221;&lt;/p&gt;

&lt;p&gt;Now, this was not a moral question, it was simply about how to do some measurements / benchmarking and systems stuff; pretty low key, no big deal.&lt;/p&gt;

&lt;p&gt;I stuck to my guns and at some point shortly after, I didn&amp;#8217;t have that job anymore. ;)&lt;/p&gt;

&lt;p&gt;In my case, there really wasn&amp;#8217;t any big life altering changes to myself or anyone else regardless of which decision I made.  But in some cases, this can really go the wrong way&amp;#8230;&lt;/p&gt;

&lt;p&gt;Let me illustrate by quoting something from my reading last night; the book was Amy Goodman&amp;#8217;s (Host of &lt;a href="http://www.democracynow.org"&gt;Democracy Now!&lt;/a&gt;) &amp;#8221;&lt;a href="http://www.haymarketbooks.org/pb/breaking-the-sound-barrier"&gt;Breaking the Sound Barrier&lt;/a&gt;&amp;#8221;, and within was a quote from Grammy Award-winning soul singer John Legend when he gave the commencement address at the University of Pennsylvania,&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Too often, in business and in government, people are rewarded for having the answer that the person they report to wants them to have: &amp;#8220;Yes, sir.  We can provide mortgages to people who have no down payment and can&amp;#8217;t afford the monthly payments.&amp;#8221;&amp;#8230;  &amp;#8220;Yes, ma&amp;#8217;am.  I can write a legal brief to justify torture.&amp;#8221;&lt;/p&gt;&lt;footer&gt;&lt;strong&gt;John Legend&lt;/strong&gt; &lt;cite&gt;Commencement Address at the University of Pennsylvania 2009&lt;/cite&gt;&lt;/footer&gt;&lt;/blockquote&gt;


&lt;p&gt;Stick to your guns, fuck your boss.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=lE08xup_qlQ:VMgSGhQtIaI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=lE08xup_qlQ:VMgSGhQtIaI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=lE08xup_qlQ:VMgSGhQtIaI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=lE08xup_qlQ:VMgSGhQtIaI:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=lE08xup_qlQ:VMgSGhQtIaI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=lE08xup_qlQ:VMgSGhQtIaI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=lE08xup_qlQ:VMgSGhQtIaI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=lE08xup_qlQ:VMgSGhQtIaI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
  <feedburner:origLink>http://scie.nti.st/2013/2/17/the-yes-men</feedburner:origLink></entry>
  
  <entry>
    <title type="html"><![CDATA[Migrated from Mephisto to Octopress]]></title>
    <link href="http://feedproxy.google.com/~r/scientist-home/~3/ya7-EIxAqZQ/migrated-from-mephisto-to-octopress" />
    <updated>2013-02-12T02:01:00-08:00</updated>
    <id>http://scie.nti.st/2013/2/12/migrated-from-mephisto-to-octopress</id>
    <content type="html">&lt;p&gt;I&amp;#8217;m proud to say I&amp;#8217;ve dusted off this blog and migrated from Mephisto to
Octopress.  Now I can actually post new content (the old Mephisto system
got so dated and went to dependency hell that I was hardly able to do
anything besides keep the static cached files up).&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m going to try to go through all the posts and cleanup / fix any loose
ends.  So far the import went pretty smooth and I&amp;#8217;ve only burned a few
hours (instead of a whole weekend).&lt;/p&gt;

&lt;p&gt;I was unable to successfully import the comments, so those will be gone
forever.  Most were spammy anyway, and any comments posted at least
within the last year or two use Disqus, and those are still around.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;d like to get my usual theme working again, but alas, that is very low
priority right now.  Perhaps a new look is warranted anyway.  However,
at least, I can move away from the default theme.  Gotta read more
docs&amp;#8230;&lt;/p&gt;

&lt;p&gt;Let me know if anything is out of the ordinary.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=ya7-EIxAqZQ:AiVZA3thxig:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=ya7-EIxAqZQ:AiVZA3thxig:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=ya7-EIxAqZQ:AiVZA3thxig:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=ya7-EIxAqZQ:AiVZA3thxig:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=ya7-EIxAqZQ:AiVZA3thxig:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=ya7-EIxAqZQ:AiVZA3thxig:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=ya7-EIxAqZQ:AiVZA3thxig:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=ya7-EIxAqZQ:AiVZA3thxig:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
  <feedburner:origLink>http://scie.nti.st/2013/2/12/migrated-from-mephisto-to-octopress</feedburner:origLink></entry>
  
  <entry>
    <title type="html"><![CDATA[Testing Octopress...]]></title>
    <link href="http://feedproxy.google.com/~r/scientist-home/~3/XnSYIpdTZb0/testing-octopress-dot-dot-dot" />
    <updated>2013-02-12T00:38:00-08:00</updated>
    <id>http://scie.nti.st/2013/2/12/testing-octopress-dot-dot-dot</id>
    <content type="html">&lt;p&gt;Testing 1 2 3&amp;#8230;&lt;/p&gt;

&lt;p&gt;is this thing on?&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=XnSYIpdTZb0:gwhNZqKNOJE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=XnSYIpdTZb0:gwhNZqKNOJE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=XnSYIpdTZb0:gwhNZqKNOJE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=XnSYIpdTZb0:gwhNZqKNOJE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=XnSYIpdTZb0:gwhNZqKNOJE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=XnSYIpdTZb0:gwhNZqKNOJE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=XnSYIpdTZb0:gwhNZqKNOJE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=XnSYIpdTZb0:gwhNZqKNOJE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
  <feedburner:origLink>http://scie.nti.st/2013/2/12/testing-octopress-dot-dot-dot</feedburner:origLink></entry>
  
  <entry>
    <title type="html"><![CDATA[Running OpenBSD 4.5 in KVM on Ubuntu Linux 9.04]]></title>
    <link href="http://feedproxy.google.com/~r/scientist-home/~3/GykF7AFBv2g/running-openbsd-4-5-in-kvm-on-ubuntu-linux-9-04" />
    <updated>2009-10-04T13:16:00-07:00</updated>
    <id>http://scie.nti.st/2009/10/4/running-openbsd-4-5-in-kvm-on-ubuntu-linux-9-04</id>
    <content type="html">&lt;p&gt;Here&amp;#8217;s a quick post on how to get &lt;a href="http://openbsd.org"&gt;OpenBSD&lt;/a&gt; 4.5 working as a &lt;a href="http://www.linux-kvm.org"&gt;KVM&lt;/a&gt; guest on kvm-84, the version that ships with Jaunty.&lt;/p&gt;

&lt;p&gt;Unlike OpenBSD 4.4, which worked out of the box, 4.5 made some changes in their kernel with respect to interrupts that may have exposed bugs in KVM/QEMU.  The workaround is to disable &lt;code&gt;mpbios&lt;/code&gt; within the OpenBSD kernel.  This will affect SMP guests adversely, so it isn&amp;#8217;t for everyone.&lt;/p&gt;

&lt;p&gt;Your kernel is affected by this if you boot and it hangs at:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;span class='line'&gt;setting tty flags&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Credit goes to Todd Fries of &lt;a href="http://freedaemonconsulting.com/"&gt;Free Daemon Consulting, LLC&lt;/a&gt; for figuring this out and passing down the wisdom onto me.&lt;/p&gt;

&lt;p&gt;Note: I&amp;#8217;m using a 64-bit host as well as the 64-bit version of OpenBSD as the guest.&lt;/p&gt;

&lt;h1&gt;Step 1&lt;/h1&gt;

&lt;p&gt;Boot the OpenBSD 4.5 install CD within your blank VM and proceed through the entire install normally.  Then, reboot from the hard disk but &lt;strong&gt;stop at the boot prompt&lt;/strong&gt;&amp;#8230;&lt;/p&gt;

&lt;h1&gt;Step 2&lt;/h1&gt;

&lt;p&gt;At the boot prompt, perform the following:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;span class='line'&gt;boot&gt; bsd -c
&lt;/span&gt;&lt;span class='line'&gt;...
&lt;/span&gt;&lt;span class='line'&gt;UKC&gt; disable mpbios
&lt;/span&gt;&lt;span class='line'&gt; 54 mpbios0 disabled
&lt;/span&gt;&lt;span class='line'&gt;UKC&gt; quit
&lt;/span&gt;&lt;span class='line'&gt;...&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;System will now boot normally.&lt;/p&gt;

&lt;p&gt;This has temporarily disabled &lt;code&gt;mpbios&lt;/code&gt; and will not persist across reboots.  You now have to make this change permanent in the OpenBSD kernel, as illustrated in the next step.&lt;/p&gt;

&lt;h1&gt;Step 3&lt;/h1&gt;

&lt;p&gt;Login to your new system as &lt;code&gt;root&lt;/code&gt; and perform:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;span class='line'&gt;# config -ef /bsd
&lt;/span&gt;&lt;span class='line'&gt;OpenBSD 4.5 (GENERIC) #2052: Sat Feb 28 14:55:24 MST 2009
&lt;/span&gt;&lt;span class='line'&gt;    deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
&lt;/span&gt;&lt;span class='line'&gt;Enter 'help' for information
&lt;/span&gt;&lt;span class='line'&gt;ukc&gt; disable mpbios
&lt;/span&gt;&lt;span class='line'&gt; 54 mpbios0 disabled
&lt;/span&gt;&lt;span class='line'&gt;ukc&gt; quit
&lt;/span&gt;&lt;span class='line'&gt;Saving modified kernel.
&lt;/span&gt;&lt;span class='line'&gt;#&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Now your system will boot up normally from this point onward.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=GykF7AFBv2g:_cL6lTEdpvE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=GykF7AFBv2g:_cL6lTEdpvE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=GykF7AFBv2g:_cL6lTEdpvE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=GykF7AFBv2g:_cL6lTEdpvE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=GykF7AFBv2g:_cL6lTEdpvE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=GykF7AFBv2g:_cL6lTEdpvE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=GykF7AFBv2g:_cL6lTEdpvE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=GykF7AFBv2g:_cL6lTEdpvE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
  <feedburner:origLink>http://scie.nti.st/2009/10/4/running-openbsd-4-5-in-kvm-on-ubuntu-linux-9-04</feedburner:origLink></entry>
  
  <entry>
    <title type="html"><![CDATA[New server]]></title>
    <link href="http://feedproxy.google.com/~r/scientist-home/~3/ewharYJFUIQ/new-server" />
    <updated>2009-10-04T11:01:00-07:00</updated>
    <id>http://scie.nti.st/2009/10/4/new-server</id>
    <content type="html">&lt;p&gt;Moved this blog to a new and faster server.  Maybe now I&amp;#8217;ll start posting again, since the admin section isn&amp;#8217;t slowed to a crawl any more with spam comments. :(&lt;/p&gt;

&lt;p&gt;If anyone notices anything missing, blow up, etc&amp;#8230;  Please leave a comment.  Thanks!&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=ewharYJFUIQ:3Y7swLlhpfs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=ewharYJFUIQ:3Y7swLlhpfs:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=ewharYJFUIQ:3Y7swLlhpfs:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=ewharYJFUIQ:3Y7swLlhpfs:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=ewharYJFUIQ:3Y7swLlhpfs:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=ewharYJFUIQ:3Y7swLlhpfs:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=ewharYJFUIQ:3Y7swLlhpfs:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=ewharYJFUIQ:3Y7swLlhpfs:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
  <feedburner:origLink>http://scie.nti.st/2009/10/4/new-server</feedburner:origLink></entry>
  
  <entry>
    <title type="html"><![CDATA[Prevent Javascript onClick event from bubbling up]]></title>
    <link href="http://feedproxy.google.com/~r/scientist-home/~3/JF1EV8H3b38/prevent-javascript-onclick-event-from-bubbling-up" />
    <updated>2009-04-05T23:53:00-07:00</updated>
    <id>http://scie.nti.st/2009/4/5/prevent-javascript-onclick-event-from-bubbling-up</id>
    <content type="html">&lt;p&gt;I recently was working with some code that had an onClick event handler on the &amp;lt;TR&amp;gt; of each row
of a table.  In one of the columns, a &amp;lt;TD&amp;gt;, there were icons that also had onClick&amp;#8217;s on them.  Something like:&lt;/p&gt;

&lt;figure class='code'&gt; &lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;span class='line-number'&gt;10&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='html'&gt;&lt;span class='line'&gt;&lt;span class="nt"&gt;&amp;lt;table&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;tr&lt;/span&gt; &lt;span class="na"&gt;onClick=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;foo()&amp;#39;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nt"&gt;&amp;lt;td&lt;/span&gt; &lt;span class="na"&gt;onClick=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;bar()&amp;#39;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="c"&gt;&amp;lt;!-- some icons --&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    ...
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nt"&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Now if the icons in the first &amp;lt;TD&amp;gt; were clicked, I wanted &lt;code&gt;bar()&lt;/code&gt; to fire, but not &lt;code&gt;foo()&lt;/code&gt;.  Normal behavior is to execute them both.&lt;/p&gt;

&lt;p&gt;Turned out there is a simple solution for this with jQuery.  Only tested in Firefox, but presumably this works across the board because jQuery is awesome that way.&lt;/p&gt;

&lt;p&gt;Add a class to the &amp;lt;TD&amp;gt; called &lt;code&gt;no-event-bubble-up&lt;/code&gt;:&lt;/p&gt;

&lt;figure class='code'&gt; &lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='html'&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;td&lt;/span&gt; &lt;span class="na"&gt;onClick=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;bar()&amp;#39;&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;no-event-bubble-up&amp;#39;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;And add the following JS to your page:&lt;/p&gt;

&lt;figure class='code'&gt; &lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;text/javascript&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;ready&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;.no-event-bubble-up&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;each&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;click&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;        &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stopPropagation&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;/script&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;That&amp;#8217;s all that is needed and it worked for me.&lt;/p&gt;

&lt;p&gt;Let me know if you find this useful.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=JF1EV8H3b38:GS6Isw2qSdE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=JF1EV8H3b38:GS6Isw2qSdE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=JF1EV8H3b38:GS6Isw2qSdE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=JF1EV8H3b38:GS6Isw2qSdE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=JF1EV8H3b38:GS6Isw2qSdE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=JF1EV8H3b38:GS6Isw2qSdE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=JF1EV8H3b38:GS6Isw2qSdE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=JF1EV8H3b38:GS6Isw2qSdE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
  <feedburner:origLink>http://scie.nti.st/2009/4/5/prevent-javascript-onclick-event-from-bubbling-up</feedburner:origLink></entry>
  
  <entry>
    <title type="html"><![CDATA[A Pledgie for Pledgie]]></title>
    <link href="http://feedproxy.google.com/~r/scientist-home/~3/iDq6AEuzsYE/a-pledgie-for-pledgie" />
    <updated>2008-11-02T00:36:00-07:00</updated>
    <id>http://scie.nti.st/2008/11/2/a-pledgie-for-pledgie</id>
    <content type="html">&lt;p&gt;&lt;a href="http://pledgie.com"&gt;Pledgie&lt;/a&gt; is trying to go to the &lt;a href="http://www.philanthropymidwest.org/index.php"&gt;2008 Philanthropy Midwest Conference&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But we need your help to get there!&lt;/p&gt;

&lt;p&gt;We need to raise $500.00 over the next couple days to reserve a booth.  We learned just yesterday that there was one last exhibitor booth available.&lt;/p&gt;

&lt;p&gt;All the details are in our &lt;a href="http://pledgie.com/campaigns/2005"&gt;Pledgie 4 Plegie&lt;/a&gt; campaign.&lt;/p&gt;

&lt;p&gt;Mark and I thank you for any support you can provide.&lt;/p&gt;

&lt;p&gt;&lt;a href='http://www.pledgie.com/campaigns/2005' style='border:none'&gt;&lt;img style='border:none' alt='Click here to lend your support to: Send Pledgie to the 2008 Philanthropy Midwest Conference! and make a donation at www.pledgie.com !' src='http://www.pledgie.com/campaigns/2005.png?skin_name=chrome' border='0' /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=iDq6AEuzsYE:QLM2DsyYkUM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=iDq6AEuzsYE:QLM2DsyYkUM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=iDq6AEuzsYE:QLM2DsyYkUM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=iDq6AEuzsYE:QLM2DsyYkUM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=iDq6AEuzsYE:QLM2DsyYkUM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=iDq6AEuzsYE:QLM2DsyYkUM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=iDq6AEuzsYE:QLM2DsyYkUM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=iDq6AEuzsYE:QLM2DsyYkUM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
  <feedburner:origLink>http://scie.nti.st/2008/11/2/a-pledgie-for-pledgie</feedburner:origLink></entry>
  
  <entry>
    <title type="html"><![CDATA[Get rxvt-unicode with 256 color support on Ubuntu]]></title>
    <link href="http://feedproxy.google.com/~r/scientist-home/~3/yMhJ3GtG2rg/get-rxvt-unicode-with-256-color-support-on-ubunut" />
    <updated>2008-10-13T05:15:00-07:00</updated>
    <id>http://scie.nti.st/2008/10/13/get-rxvt-unicode-with-256-color-support-on-ubunut</id>
    <content type="html">&lt;p&gt;&lt;a href="http://software.schmorp.de/pkg/rxvt-unicode.html"&gt;rxvt-unicode&lt;/a&gt; (commonly called urxvt) already has 88 color support, and for most things, this is fine.  But I recently just found the &lt;a href="http://www.vim.org/scripts/script.php?script_id=2390"&gt;CSApprox&lt;/a&gt; plugin for vim, which lets you use Gvim themes in console vim.  CSApprox actually does a pretty good job interpolating for 88 colors too, but it is best at 256.&lt;/p&gt;

&lt;p&gt;So here&amp;#8217;s my build log of compiling rxvt-unicode with the 256 color patch on Ubuntu Hardy, and debianizing (packaging) it.&lt;/p&gt;

&lt;figure class='code'&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;span class='line-number'&gt;10&lt;/span&gt;
&lt;span class='line-number'&gt;11&lt;/span&gt;
&lt;span class='line-number'&gt;12&lt;/span&gt;
&lt;span class='line-number'&gt;13&lt;/span&gt;
&lt;span class='line-number'&gt;14&lt;/span&gt;
&lt;span class='line-number'&gt;15&lt;/span&gt;
&lt;span class='line-number'&gt;16&lt;/span&gt;
&lt;span class='line-number'&gt;17&lt;/span&gt;
&lt;span class='line-number'&gt;18&lt;/span&gt;
&lt;span class='line-number'&gt;19&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;span class='line'&gt;# I keep all custom deb's here, use any directory you want
&lt;/span&gt;&lt;span class='line'&gt;cd ~/debian-src
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;# Make a place for rxvt-unicode
&lt;/span&gt;&lt;span class='line'&gt;mkdir rxvt-unicode
&lt;/span&gt;&lt;span class='line'&gt;cd rxvt-unicode/
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;# Get the source
&lt;/span&gt;&lt;span class='line'&gt;apt-get source rxvt-unicode
&lt;/span&gt;&lt;span class='line'&gt;cd rxvt-unicode-8.4/
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;# Apply 256 color patch, it's included with the source
&lt;/span&gt;&lt;span class='line'&gt;patch -p1 &amp;lt; doc/urxvt-8.2-256color.patch
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;# Make sure you have all depdencies to build it
&lt;/span&gt;&lt;span class='line'&gt;sudo apt-get build-dep rxvt-unicode
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;# Build it
&lt;/span&gt;&lt;span class='line'&gt;dpkg-buildpackage -us -uc -rfakeroot&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;This will actually build three separate packages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;rxvt-unicode&lt;/li&gt;
&lt;li&gt;rxvt-unicode-lite&lt;/li&gt;
&lt;li&gt;rxvt-unicode-ml&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;All I care about is rxvt-unicode, but you might want -lite or -ml.  If
someone more adept in Debian package building than I am can tell me how
to just compile one of these versions, that&amp;#8217;d be great. :)&lt;/p&gt;

&lt;p&gt;Moving along:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;span class='line'&gt;# Install it!
&lt;/span&gt;&lt;span class='line'&gt;cd ~/debian-src/rxvt-unicode
&lt;/span&gt;&lt;span class='line'&gt;sudo dpkg -i rxvt-unicode_8.4-1_amd64.deb
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;# As always, your arch may be different.  Replace amd64 with whatever is
&lt;/span&gt;&lt;span class='line'&gt;# appropriate for you.&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Now we need to make terminfo aware that rxvt-unicode supports 256 colors.  The default terminfo entry you&amp;#8217;ll have for rxvt-unicode will say 88, and that won&amp;#8217;t be right for your new version.&lt;/p&gt;

&lt;figure class='code'&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;span class='line-number'&gt;10&lt;/span&gt;
&lt;span class='line-number'&gt;11&lt;/span&gt;
&lt;span class='line-number'&gt;12&lt;/span&gt;
&lt;span class='line-number'&gt;13&lt;/span&gt;
&lt;span class='line-number'&gt;14&lt;/span&gt;
&lt;span class='line-number'&gt;15&lt;/span&gt;
&lt;span class='line-number'&gt;16&lt;/span&gt;
&lt;span class='line-number'&gt;17&lt;/span&gt;
&lt;span class='line-number'&gt;18&lt;/span&gt;
&lt;span class='line-number'&gt;19&lt;/span&gt;
&lt;span class='line-number'&gt;20&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;span class='line'&gt;cd ~
&lt;/span&gt;&lt;span class='line'&gt;infocmp -L rxvt-unicode &gt; rxvt-unicode.terminfo
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;vi rxvt-unicode.terminfo
&lt;/span&gt;&lt;span class='line'&gt;# Change the following from:
&lt;/span&gt;&lt;span class='line'&gt;#
&lt;/span&gt;&lt;span class='line'&gt;#    lines_of_memory#0, max_colors#88, max_pairs#256,
&lt;/span&gt;&lt;span class='line'&gt;#
&lt;/span&gt;&lt;span class='line'&gt;# to:
&lt;/span&gt;&lt;span class='line'&gt;#
&lt;/span&gt;&lt;span class='line'&gt;#    lines_of_memory#0, max_colors#256, max_pairs#32767
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;# Make .terminfo dir if you don't already have it
&lt;/span&gt;&lt;span class='line'&gt;install -d .terminfo
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;# Rebuild terminfo for rxvt-unicode
&lt;/span&gt;&lt;span class='line'&gt;tic -o .terminfo/ rxvt-unicode.terminfo
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;# Cleanup
&lt;/span&gt;&lt;span class='line'&gt;rm rxvt-unicode.terminfo&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;That should do it.&lt;/p&gt;

&lt;p&gt;To test it out, use this &lt;a href="http://scie.nti.st/dist/256colors2.pl"&gt;256colors2.pl&lt;/a&gt; script (it&amp;#8217;s the same one included in the xterm distribution).  Download it, set it executable, open a fresh urxvt terminal, and run:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;span class='line'&gt;$ ./256colors2.pl&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;The output should look like:&lt;/p&gt;

&lt;p&gt;&lt;img src='http://scie.nti.st/images/256colors.png' width='566' height='340'&gt;&lt;/p&gt;

&lt;p&gt;Any program that supports 256 colors that had to fallback to 88 or even 8 colors can now be used in all its glory.&lt;/p&gt;

&lt;p&gt;Does this make your consoling experience better?  Let me know, post a comment.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=yMhJ3GtG2rg:yfXJoYJMFLs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=yMhJ3GtG2rg:yfXJoYJMFLs:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=yMhJ3GtG2rg:yfXJoYJMFLs:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=yMhJ3GtG2rg:yfXJoYJMFLs:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=yMhJ3GtG2rg:yfXJoYJMFLs:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=yMhJ3GtG2rg:yfXJoYJMFLs:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=yMhJ3GtG2rg:yfXJoYJMFLs:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=yMhJ3GtG2rg:yfXJoYJMFLs:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
  <feedburner:origLink>http://scie.nti.st/2008/10/13/get-rxvt-unicode-with-256-color-support-on-ubunut</feedburner:origLink></entry>
  
  <entry>
    <title type="html"><![CDATA[TextMate-like file navigation in Vim]]></title>
    <link href="http://feedproxy.google.com/~r/scientist-home/~3/Wpa7ny4NJfY/textmate-like-file-navigation-in-vim" />
    <updated>2008-10-11T13:05:00-07:00</updated>
    <id>http://scie.nti.st/2008/10/11/textmate-like-file-navigation-in-vim</id>
    <content type="html">&lt;p&gt;I highly recommend the new &lt;a href="http://github.com/jamis/fuzzyfinder_textmate/tree/master"&gt;fuzzyfinder_textmate&lt;/a&gt; Vim plugin.&lt;/p&gt;

&lt;p&gt;In addition, &lt;a href="http://weblog.jamisbuck.org/2008/10/10/coming-home-to-vim"&gt;this post&lt;/a&gt; which debuts the plugin, has a ton of other useful Vim tips and trick.  If you&amp;#8217;re a Vim user, I&amp;#8217;ll bet you&amp;#8217;ll learn something you didn&amp;#8217;t know!&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=Wpa7ny4NJfY:ghhljXDoMgc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=Wpa7ny4NJfY:ghhljXDoMgc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=Wpa7ny4NJfY:ghhljXDoMgc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=Wpa7ny4NJfY:ghhljXDoMgc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=Wpa7ny4NJfY:ghhljXDoMgc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=Wpa7ny4NJfY:ghhljXDoMgc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=Wpa7ny4NJfY:ghhljXDoMgc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=Wpa7ny4NJfY:ghhljXDoMgc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
  <feedburner:origLink>http://scie.nti.st/2008/10/11/textmate-like-file-navigation-in-vim</feedburner:origLink></entry>
  
  <entry>
    <title type="html"><![CDATA[Hardy Xen domU doesn't show login prompt [fix]]]></title>
    <link href="http://feedproxy.google.com/~r/scientist-home/~3/gQq5Bp4csmQ/hardy-xen-domu-doesn-t-show-login-prompt-fix" />
    <updated>2008-10-01T22:35:00-07:00</updated>
    <id>http://scie.nti.st/2008/10/1/hardy-xen-domu-doesn-t-show-login-prompt-fix</id>
    <content type="html">&lt;p&gt;I have a Xen machine running Ubuntu Hardy (8.04.1).  I created a guest that was also Hardy, with xen-tools.  But after booting it up, the login prompt wouldn&amp;#8217;t appear.  It would get as far as:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;span class='line'&gt;...
&lt;/span&gt;&lt;span class='line'&gt; * Starting OpenBSD Secure Shell server sshd                             [ OK ] 
&lt;/span&gt;&lt;span class='line'&gt; * Running local boot scripts (/etc/rc.local)                            [ OK ]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;And then just not show anything.  The VM wasn&amp;#8217;t hung, just the login prompt didin&amp;#8217;t display.&lt;/p&gt;

&lt;p&gt;After googling to no avail, I lucked out with button mashing some options in my &amp;lt;vm&amp;gt;.cfg file.  Adding this to the end of my &amp;lt;vm&amp;gt;.cfg made it work:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;span class='line'&gt;extra = 'xencons=xvc console=xvc0'&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;



&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=gQq5Bp4csmQ:mqmFAZPe7DU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=gQq5Bp4csmQ:mqmFAZPe7DU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=gQq5Bp4csmQ:mqmFAZPe7DU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=gQq5Bp4csmQ:mqmFAZPe7DU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=gQq5Bp4csmQ:mqmFAZPe7DU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=gQq5Bp4csmQ:mqmFAZPe7DU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=gQq5Bp4csmQ:mqmFAZPe7DU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=gQq5Bp4csmQ:mqmFAZPe7DU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
  <feedburner:origLink>http://scie.nti.st/2008/10/1/hardy-xen-domu-doesn-t-show-login-prompt-fix</feedburner:origLink></entry>
  
  <entry>
    <title type="html"><![CDATA[Update: Immutable, with exceptions]]></title>
    <link href="http://feedproxy.google.com/~r/scientist-home/~3/2o0miqBaXds/update-immutable-with-exceptions" />
    <updated>2008-09-21T11:47:00-07:00</updated>
    <id>http://scie.nti.st/2008/9/21/update-immutable-with-exceptions</id>
    <content type="html">&lt;p&gt;This is an update to my previous article: &lt;a href="http://scie.nti.st/2008/9/17/making-methods-immutable-in-ruby"&gt;Making methods immutable in Ruby&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;By popular demand, I&amp;#8217;ve made my &lt;a href="http://github.com/up_the_irons/immutable/tree/master"&gt;Immutable&lt;/a&gt; module raise an exception, by default, if you try to override an immutable method.&lt;/p&gt;

&lt;p&gt;So, the following:&lt;/p&gt;

&lt;figure class='code'&gt; &lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;span class='line-number'&gt;10&lt;/span&gt;
&lt;span class='line-number'&gt;11&lt;/span&gt;
&lt;span class='line-number'&gt;12&lt;/span&gt;
&lt;span class='line-number'&gt;13&lt;/span&gt;
&lt;span class='line-number'&gt;14&lt;/span&gt;
&lt;span class='line-number'&gt;15&lt;/span&gt;
&lt;span class='line-number'&gt;16&lt;/span&gt;
&lt;span class='line-number'&gt;17&lt;/span&gt;
&lt;span class='line-number'&gt;18&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='ruby'&gt;&lt;span class='line'&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;rubygems&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;immutable&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="k"&gt;module&lt;/span&gt; &lt;span class="nn"&gt;Foo&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="kp"&gt;include&lt;/span&gt; &lt;span class="no"&gt;Immutable&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;foo&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="ss"&gt;:foo&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="n"&gt;immutable_method&lt;/span&gt; &lt;span class="ss"&gt;:foo&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="k"&gt;module&lt;/span&gt; &lt;span class="nn"&gt;Foo&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;foo&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="ss"&gt;:baz&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Will raise an error:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;span class='line'&gt;Cannot override the immutable method: foo (Immutable::CannotOverrideMethod)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;



&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=2o0miqBaXds:dbT9OC8gJQg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=2o0miqBaXds:dbT9OC8gJQg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=2o0miqBaXds:dbT9OC8gJQg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=2o0miqBaXds:dbT9OC8gJQg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=2o0miqBaXds:dbT9OC8gJQg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=2o0miqBaXds:dbT9OC8gJQg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=2o0miqBaXds:dbT9OC8gJQg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=2o0miqBaXds:dbT9OC8gJQg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
  <feedburner:origLink>http://scie.nti.st/2008/9/21/update-immutable-with-exceptions</feedburner:origLink></entry>
  
  <entry>
    <title type="html"><![CDATA[Making methods immutable in Ruby (or, Death to Monkey Patching)]]></title>
    <link href="http://feedproxy.google.com/~r/scientist-home/~3/i9b8fD_aA3A/making-methods-immutable-in-ruby" />
    <updated>2008-09-17T12:52:00-07:00</updated>
    <id>http://scie.nti.st/2008/9/17/making-methods-immutable-in-ruby</id>
    <content type="html">&lt;p style="border-bottom: 1px solid grey; padding-bottom: 5px"&gt;
Update (09-21-2008): I have a followup to this article &lt;a href='http://scie.nti.st/2008/9/21/update-immutable-with-exceptions'&gt;here&lt;/a&gt;.
&lt;/p&gt;


&lt;p&gt;You&amp;#8217;ve probably been told that in Ruby classes are always open and any code can come along and redefine your methods in any way it pleases.  Indeed, this is true.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Kinda&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;What&amp;#8217;s not true, despite every reference I&amp;#8217;ve read saying the contrary, is that you can&amp;#8217;t prevent this from happening.&lt;/p&gt;

&lt;p&gt;Ruby provides a &lt;code&gt;method_added()&lt;/code&gt; callback that is invoked every time a method is added &lt;em&gt;or redefined&lt;/em&gt; within a class.  It&amp;#8217;s part of the &lt;code&gt;Module&lt;/code&gt; class, and every &lt;code&gt;Class&lt;/code&gt; is a &lt;code&gt;Module&lt;/code&gt;.  There are also two related callbacks called &lt;code&gt;method_removed()&lt;/code&gt; and &lt;code&gt;method_undefined()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This means you could detect when other code has redefined a method, and do something about it!  How about redefining that method (again) to point back to your original code?  Indeed, this works.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve encapsulated the details of this in a new module I call &lt;code&gt;Immutable&lt;/code&gt;.  It provides one class method called &lt;code&gt;immutable_method()&lt;/code&gt;.  Provide it a list of methods you don&amp;#8217;t want touched and it&amp;#8217;ll make sure they can&amp;#8217;t be redefined.  Hence, &lt;em&gt;immutable&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;It&amp;#8217;s on GitHub: &lt;a href="http://github.com/up_the_irons/immutable/tree/master"&gt;&lt;code&gt;http://github.com/up_the_irons/immutable/tree/master&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s an example:&lt;/p&gt;

&lt;figure class='code'&gt; &lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;span class='line-number'&gt;10&lt;/span&gt;
&lt;span class='line-number'&gt;11&lt;/span&gt;
&lt;span class='line-number'&gt;12&lt;/span&gt;
&lt;span class='line-number'&gt;13&lt;/span&gt;
&lt;span class='line-number'&gt;14&lt;/span&gt;
&lt;span class='line-number'&gt;15&lt;/span&gt;
&lt;span class='line-number'&gt;16&lt;/span&gt;
&lt;span class='line-number'&gt;17&lt;/span&gt;
&lt;span class='line-number'&gt;18&lt;/span&gt;
&lt;span class='line-number'&gt;19&lt;/span&gt;
&lt;span class='line-number'&gt;20&lt;/span&gt;
&lt;span class='line-number'&gt;21&lt;/span&gt;
&lt;span class='line-number'&gt;22&lt;/span&gt;
&lt;span class='line-number'&gt;23&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='ruby'&gt;&lt;span class='line'&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;rubygems&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;immutable&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="k"&gt;module&lt;/span&gt; &lt;span class="nn"&gt;Foo&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="kp"&gt;include&lt;/span&gt; &lt;span class="no"&gt;Immutable&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;foo&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="ss"&gt;:foo&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="n"&gt;immutable_method&lt;/span&gt; &lt;span class="ss"&gt;:foo&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="c1"&gt;# Now re-open Foo and redefine foo()&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="k"&gt;module&lt;/span&gt; &lt;span class="nn"&gt;Foo&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;foo&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="ss"&gt;:baz&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="kp"&gt;include&lt;/span&gt; &lt;span class="no"&gt;Foo&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="n"&gt;foo&lt;/span&gt; &lt;span class="c1"&gt;# =&amp;gt; :foo&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;&lt;code&gt;foo()&lt;/code&gt; returns &lt;code&gt;:foo&lt;/code&gt;, not &lt;code&gt;:baz&lt;/code&gt;, even though we redefined &lt;code&gt;foo()&lt;/code&gt; to return &lt;code&gt;:baz&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If this makes you think of Java&amp;#8217;s &lt;code&gt;final&lt;/code&gt; method modifier, you&amp;#8217;d be almost right in saying &lt;code&gt;immutable_method&lt;/code&gt; is similar.  But there&amp;#8217;s one important difference: with &lt;code&gt;immutable_method&lt;/code&gt; you can still redefine methods in &lt;em&gt;subclasses&lt;/em&gt;.  This makes sense, as one can argue that if you want to reimplement or extend a method, a child class is the only place where you should be doing that anyway.  I tend to agree, call me a purist.&lt;/p&gt;

&lt;p&gt;Why would this be useful to you?  I don&amp;#8217;t know.  But I can tell you what motivated me.&lt;/p&gt;

&lt;p&gt;My motivation for writing something that provides what some may call &amp;#8220;evil&amp;#8221; functionality (heh, and monkey patching &lt;em&gt;isn&amp;#8217;t&lt;/em&gt; evil?) of closed methods/classes came from my trials of trying to improve Rails loading time by reimplementing some ActiveSupport methods in C (Ruby extension).&lt;/p&gt;

&lt;p&gt;I absolutely needed my C versions of certain methods to be present, and not clobbered by ActiveSupport.&lt;/p&gt;

&lt;p&gt;So why didn&amp;#8217;t I just load my extension after ActiveSupport?  Because by then it is too late.  Rails is already loaded, along with slow running methods that get called over 10,000 times during initialization.&lt;/p&gt;

&lt;p&gt;Run the profiler and see for yourself:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;span class='line'&gt;./script/performance/profiler "require 'config/environment'"&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;This is a prelude to my next post, when I present the plugin I&amp;#8217;ve built that takes away over 30% of overhead from Rails loading time.  Stay tuned (or subscribe :)&lt;/p&gt;

&lt;p&gt;But for now, if you want to try &lt;code&gt;Immutable&lt;/code&gt;, clone it from GitHub, or if you have RubyGems 1.2.0 or higher, do this:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;span class='line'&gt;# Requires RubyGems 1.2.0+ (or so I'm told...)
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;gem sources -a http://gems.github.com
&lt;/span&gt;&lt;span class='line'&gt;sudo gem install up_the_irons-immutable&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Then you can run the example above.  You&amp;#8217;re all set.&lt;/p&gt;

&lt;p&gt;See the &lt;a href="http://github.com/up_the_irons/immutable/tree/master/README"&gt;README&lt;/a&gt; for further details.&lt;/p&gt;

&lt;p&gt;Enjoy (or flame me for ruining your monkey patching).&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=i9b8fD_aA3A:FEOdGkv-vVM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=i9b8fD_aA3A:FEOdGkv-vVM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=i9b8fD_aA3A:FEOdGkv-vVM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=i9b8fD_aA3A:FEOdGkv-vVM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=i9b8fD_aA3A:FEOdGkv-vVM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=i9b8fD_aA3A:FEOdGkv-vVM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=i9b8fD_aA3A:FEOdGkv-vVM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=i9b8fD_aA3A:FEOdGkv-vVM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
  <feedburner:origLink>http://scie.nti.st/2008/9/17/making-methods-immutable-in-ruby</feedburner:origLink></entry>
  
  <entry>
    <title type="html"><![CDATA[Nicely formatted JSON on the command line]]></title>
    <link href="http://feedproxy.google.com/~r/scientist-home/~3/GI7fVgFR6YI/nicely-formatted-json-on-command-line" />
    <updated>2008-09-03T01:36:00-07:00</updated>
    <id>http://scie.nti.st/2008/9/3/nicely-formatted-json-on-command-line</id>
    <content type="html">&lt;p&gt;You have a URL that outputs JSON, and you want to quickly see its contents from the shell, but nicely formatted, not the raw output wget spits; just do:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;span class='line'&gt;$ wget foo.com/bar.json -O - --quiet | ruby -rubygems -e \ 
&lt;/span&gt;&lt;span class='line'&gt;  'require "json"; puts JSON.parse($stdin.gets).to_yaml'&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;I broke it up into two lines for easier reading, but you can type it all out in one line, or better yet, turn it into a shell script with a single URL argument.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=GI7fVgFR6YI:WUeZadPHoD0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=GI7fVgFR6YI:WUeZadPHoD0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=GI7fVgFR6YI:WUeZadPHoD0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=GI7fVgFR6YI:WUeZadPHoD0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=GI7fVgFR6YI:WUeZadPHoD0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=GI7fVgFR6YI:WUeZadPHoD0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=GI7fVgFR6YI:WUeZadPHoD0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=GI7fVgFR6YI:WUeZadPHoD0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
  <feedburner:origLink>http://scie.nti.st/2008/9/3/nicely-formatted-json-on-command-line</feedburner:origLink></entry>
  
  <entry>
    <title type="html"><![CDATA[GNU screen with vertical split support]]></title>
    <link href="http://feedproxy.google.com/~r/scientist-home/~3/jaIQ388m430/gnu-screen-with-vertical-split-support" />
    <updated>2008-08-22T00:56:00-07:00</updated>
    <id>http://scie.nti.st/2008/8/22/gnu-screen-with-vertical-split-support</id>
    <content type="html">&lt;p&gt;Just a quick post here.  I recently recompiled screen with vertical split support on Ubuntu 8.04.  Here&amp;#8217;s how you do it:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;span class='line-number'&gt;10&lt;/span&gt;
&lt;span class='line-number'&gt;11&lt;/span&gt;
&lt;span class='line-number'&gt;12&lt;/span&gt;
&lt;span class='line-number'&gt;13&lt;/span&gt;
&lt;span class='line-number'&gt;14&lt;/span&gt;
&lt;span class='line-number'&gt;15&lt;/span&gt;
&lt;span class='line-number'&gt;16&lt;/span&gt;
&lt;span class='line-number'&gt;17&lt;/span&gt;
&lt;span class='line-number'&gt;18&lt;/span&gt;
&lt;span class='line-number'&gt;19&lt;/span&gt;
&lt;span class='line-number'&gt;20&lt;/span&gt;
&lt;span class='line-number'&gt;21&lt;/span&gt;
&lt;span class='line-number'&gt;22&lt;/span&gt;
&lt;span class='line-number'&gt;23&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;span class='line'&gt;# Install dependencies to build screen
&lt;/span&gt;&lt;span class='line'&gt;sudo apt-get build-dep screen
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;# Create an area to hold the source
&lt;/span&gt;&lt;span class='line'&gt;cd ~/debian-src
&lt;/span&gt;&lt;span class='line'&gt;mkdir screen
&lt;/span&gt;&lt;span class='line'&gt;cd screen
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;# Get the source
&lt;/span&gt;&lt;span class='line'&gt;apt-get source screen
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;# Apply vertical split patch
&lt;/span&gt;&lt;span class='line'&gt;cd screen-4.0.3/
&lt;/span&gt;&lt;span class='line'&gt;wget http://vsp4sdl.yuggoth.org/wrp_vertical_split_0.3_4.0.2.diff.bz2
&lt;/span&gt;&lt;span class='line'&gt;bunzip2 wrp_vertical_split_0.3_4.0.2.diff.bz2
&lt;/span&gt;&lt;span class='line'&gt;patch -p1 &amp;lt; wrp_vertical_split_0.3_4.0.2.diff
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;# Build it!
&lt;/span&gt;&lt;span class='line'&gt;dpkg-buildpackage -us -uc -rfakeroot
&lt;/span&gt;&lt;span class='line'&gt;cd ..
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;# Install it!
&lt;/span&gt;&lt;span class='line'&gt;sudo dpkg -i screen_4.0.3-0.4ubuntu2_amd64.deb&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;That&amp;#8217;s it.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=jaIQ388m430:Gx_gZHNn5h0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=jaIQ388m430:Gx_gZHNn5h0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=jaIQ388m430:Gx_gZHNn5h0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=jaIQ388m430:Gx_gZHNn5h0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=jaIQ388m430:Gx_gZHNn5h0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=jaIQ388m430:Gx_gZHNn5h0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=jaIQ388m430:Gx_gZHNn5h0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=jaIQ388m430:Gx_gZHNn5h0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
  <feedburner:origLink>http://scie.nti.st/2008/8/22/gnu-screen-with-vertical-split-support</feedburner:origLink></entry>
  
  <entry>
    <title type="html"><![CDATA[Automatically setting hostname as GNU screen window title]]></title>
    <link href="http://feedproxy.google.com/~r/scientist-home/~3/B36gj-T2eF4/1-minute-post-hostname-as-screen-window-title" />
    <updated>2008-08-19T21:25:00-07:00</updated>
    <id>http://scie.nti.st/2008/8/19/1-minute-post-hostname-as-screen-window-title</id>
    <content type="html">&lt;p&gt;I&amp;#8217;m starting to put this in ~/.bashrc of all my servers now:&lt;/p&gt;

&lt;figure class='code'&gt; &lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='sh'&gt;&lt;span class='line'&gt;&lt;span class="c"&gt;# Set screen window title&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;$TERM&amp;quot;&lt;/span&gt; in
&lt;/span&gt;&lt;span class='line'&gt;screen&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nv"&gt;PROMPT_COMMAND&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;echo -ne &amp;quot;\033k$HOSTNAME\033\\&amp;quot;&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  ;;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="k"&gt;esac&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;When I log into the machine, the &lt;a href="http://www.gnu.org/software/screen/"&gt;screen&lt;/a&gt; window title (which displays on the hard status line, and in turn my &lt;a href="http://software.schmorp.de/pkg/rxvt-unicode.html"&gt;urxvt&lt;/a&gt; window title bar) automatically changes to the hostname of the machine I&amp;#8217;m logged into.  I used to set this manually, but now I don&amp;#8217;t have to, yay!&lt;/p&gt;

&lt;p&gt;If your distro doesn&amp;#8217;t set up your environment so ~/.bashrc is sourced upon login, you&amp;#8217;ll want to put this into ~/.bash_login instead.&lt;/p&gt;

&lt;p&gt;To get this code on a lot of servers at once, save the above snippet to a file called &amp;#8220;prompt-command.sh&amp;#8221; and execute:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;span class='line'&gt;for i in hostname1 hostname2 hostname3; do cat prompt-command.sh | ssh $i 'cat &gt;&gt; ~/.bashrc'; done&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;


&lt;p&gt;Of course, change &amp;#8220;hostname1&amp;#8221;, &amp;#8220;hostname2&amp;#8221;, etc&amp;#8230; to the real hostnames of your machines.&lt;/p&gt;

&lt;p&gt;Cool, huh?&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=B36gj-T2eF4:17r5oo21Q84:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=B36gj-T2eF4:17r5oo21Q84:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=B36gj-T2eF4:17r5oo21Q84:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=B36gj-T2eF4:17r5oo21Q84:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=B36gj-T2eF4:17r5oo21Q84:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=B36gj-T2eF4:17r5oo21Q84:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/scientist-home?a=B36gj-T2eF4:17r5oo21Q84:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/scientist-home?i=B36gj-T2eF4:17r5oo21Q84:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content>
  <feedburner:origLink>http://scie.nti.st/2008/8/19/1-minute-post-hostname-as-screen-window-title</feedburner:origLink></entry>
  
</feed>
