<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>pogma &#187; peter</title>
	<atom:link href="http://pogma.com/author/peter/feed/" rel="self" type="application/rss+xml" />
	<link>http://pogma.com</link>
	<description>Pogma&#039;s blog</description>
	<lastBuildDate>Sat, 05 Mar 2011 18:01:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Lots and lots of xterms</title>
		<link>http://pogma.com/2010/11/14/lots-and-lots-of-xterms/</link>
		<comments>http://pogma.com/2010/11/14/lots-and-lots-of-xterms/#comments</comments>
		<pubDate>Sun, 14 Nov 2010 19:26:25 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://pogma.com/?p=191</guid>
		<description><![CDATA[I use a lot of xterms &#8211; dozens of them, each one runs an ssh session. When I first started working for The Written Word, Inc. I used to start each xterm, manually place it on the screen on the desktop I wanted it on, type &#8216;exec ssh &#60;host&#62;&#8216; in each one, and start/resume a [...]]]></description>
			<content:encoded><![CDATA[<p>I use a lot of xterms &#8211; dozens of them, each one runs an ssh session. When I first started working for <a href="http://thewrittenword.com">The Written Word, Inc.</a> I used to start each xterm, manually place it on the screen on the desktop I wanted it on, type &#8216;<code>exec ssh &lt;host&gt;</code>&#8216; in each one, and start/resume a <a href="http://www.gnu.org/software/screen/">screen</a> session. Whenever the connection dropped, I had to do it all over again. What a pain. So I scripted part of it.</p>
<p>The first thing I scripted was starting all those xterms and running exec ssh in each. If you start an xterm with the <code>-ls</code> argument, it starts a login shell in the terminal. So your login scripts will get run. Using this idea, I edited my login script (<code>~/.bash_profile</code>) and appended:</p>
<pre>
if test -n "${_SSH_HOST}"; then
exec ssh ${_SSH_HOST}
fi
</pre>
<p>Then I wrote a quickie &#8220;<code>commute</code>&#8221; script:</p>
<pre>
#!/bin/bash
: ${_SSH_HOSTS="every host that I wanted to connect to"}
for _SSH_HOST in ${_SSH_HOSTS}; do
export _SSH_HOST
xterm +sb -ls -geometry 79x25 -title $_SSH_HOST &#038;
done
</pre>
<p>This script starts xterms with no scrollbar, running a login shell, 79 columns, 25 rows, and sets the window title to the host that the login script will <code>exec ssh</code> to. The strange geometry for the xterms is so that I can fit 12 terminals per virtual desktop. Using a more standard geometry would only allow 9, with a lot of unused space.</p>
<p>So things were improved, now I only had to manually place each xterm, and start the screen sessions in each one. For a little while I was ok, but then I thought to eliminate the manual screen session starting. Using <a href="http://expect.sourceforge.net/">expect</a> I was able to easily record these actions, and edit the generated script. Now all I had to do in the event of a network timeout, or reboot etc was to manually place all these xterms in the correct location, on the correct desktop.</p>
<p>Of course, I wasn&#8217;t happy with that either, so I changed the <code>-geometry</code> argument to xterm to note the screen location. With each xterm being 479&#215;349 pixels, it was easy to calculate where I wanted the next terminal to go. I had had to put in several &#8220;<code>sleep</code>&#8221; statements in my script previously to allow time for the terminals to actually appear on the screen etc. and some of these had to stay, but now all that was required to do manually was wait for the desktop to fill up with xterms, and click the mouse wheel to move to the next virtual desktop 4 or 5 times. Easy! <img src='http://pogma.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Last week, a switch decided it was time to die, dropping connections a couple of times a day, which meant I had connectivity problems for a couple of days until I discovered that it was the switch that was the problem and not the new router as I had assumed. This meant that I had to do the mouse wheel click to new desktop procedure 4 or 5 times over the course of two days. Doing it once a month or so was an acceptable imposition, but now it was again a pain.</p>
<p>At first, I installed the python bindings for libwnck and attempted to script the xterm window placement, however, I failed to get anything working as quickly as I had expected (would have been easier if I had found <a href="http://git.gnome.org/browse/gnome-python-desktop/tree/examples/wnck_example.py"> wnck_example.py</a>). Another quick google search led me to <a href="http://burtonini.com/blog/computers/devilspie/">devilspie</a>. This seemed perfect. Now, at the beginning of my commute script, I generate a devilspie config file:</p>
<pre>
# Initialize variables
_workspace=2
_col=0
_row=0
# Create new empty config file
:> /home/pogma/pies
# populate config file
for _SSH_HOST in ${_SSH_HOSTS}; do
 echo "(if (matches (window_name) \"${_SSH_HOST}\")\
 (begin (geometry \"479x329+$((480*_row))+$((350*_col))\")\
 (set_workspace ${_workspace})))" >>/home/pogma/pies
 _col=$((_col+1))
 if test ${_col} -gt 2; then
   _col=0
   _row=$((_row+1))
 fi
 if test ${_row} -gt 3; then
   _row=0;
   _workspace=$((_workspace+1))
 fi
done
devilspie /home/pogma/pies >/dev/null 2>&#038;1 &#038;
# We'll kill devilspie later
_pid=$!
...
[snip rest of file to start xterms, start/resume screen sessions etc]
</pre>
<p>The geometry is a little odd because the window height does not include the title bar. Now, I can start my dozens of xterms, ssh to all those hosts, start the screen sessions if necessary, place the xterms properly, all with one script.</p>
]]></content:encoded>
			<wfw:commentRss>http://pogma.com/2010/11/14/lots-and-lots-of-xterms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iBook G3, NetBSD and Linux</title>
		<link>http://pogma.com/2010/10/31/ibook-g3-netbsd-and-linux/</link>
		<comments>http://pogma.com/2010/10/31/ibook-g3-netbsd-and-linux/#comments</comments>
		<pubDate>Mon, 01 Nov 2010 05:35:08 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://pogma.com/?p=160</guid>
		<description><![CDATA[So, I have this old iBook, it has been doing nothing for a couple of years, so I decided to do something with it. not having any machine in the house with a BSD on it, I thought I would install NetBSD on it. The iBook is old. The CD drive doesn&#8217;t work, the airport [...]]]></description>
			<content:encoded><![CDATA[<p>So, I have this old iBook, it has been doing nothing for a couple of years, so I decided to do something with it. not having any machine in the house with a BSD on it, I thought I would install NetBSD on it.</p>
<p>The iBook is old. The CD drive doesn&#8217;t work, the airport card doesn&#8217;t work, but it does have a largish HD and 640MB RAM. Because of the broken CD drive, I figured that I&#8217;d net install whatever I was going to install on it. Yes, I know there are other options, I could have put an install image on a firewire disk, booted into target disk mode, and installed something that way, etc. I guess I really just wanted to try net installing something <img src='http://pogma.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Reading the NetBSD docs that I could find made me think that I would need a TFTP server, NFS server, and to mess with my DHCP settings. So I installed TFTP on my Fedora 13 system, and went to my OpenWRT router and looked at changing the config for dnsmasq.</p>
<p>So I added to my /etc/config/dhcp:<br />
<code><br />
config boot linux<br />
        option filename         'ofwboot.xcf'<br />
        option serveraddress    '10.0.0.11'<br />
        option servername       'tw'<br />
</code><br />
(tw is the hostname of my Fedora system).</p>
<p>Getting the DHCP options was harder, the openwrt docs suggested &#8216;list dhcp_option
<list of options>&#8216;, but that didn&#8217;t work, nor did any of the other things I tried until, after reading the shell scripts in /etc/init.d, I added<br />
<code>option 'dhcp_option' '17,/export/client/root 42,10.0.0.4 66,tw 67,ofwboot.xcf 128,10.0.0.11'</code><br />
This seemed to work, with each space separated option being added to the dnsmasq command line (I was happy for /proc/[pid]/cmdline here &#8211; it made checking very easy).</p>
<p>Booted the iBook to openfirmware and tried to get it to boot the NetBSD installer kernel like this:<br />
<code>boot enet:0,\ofwboot.xcf</code></p>
<p>But that did not work, although the ofwboot.xcf boot loader loaded from TFTP, the netbsd kernel did not load from either TFTP or NFS. Eventually, after much messing about, I discovered that:<br />
<code>boot enet:0,\ofwboot.xcf enet:0,\/netbsd</code><br />
caused the ofwboot.xcf boot loader to load from TFTP and the netbsd kernel to load from NFS (server 10.0.0.11, path /export/client/root, as specified with DHCP).</p>
<p>WooHoo, so I ran the installer, said it should take the whole disk, etc. And installed everything.</p>
<p>It did not boot.</p>
<p>I was sad, and then went to read the INSTALL docs from the NetBSD macppc page. Indeed, it was quite clearly noted that with open firmware version 3.0 or later NetBSD would install an unbootable system if you just chose the installer defaults. The docs that I found on how to do it properly involved using your Mac OS system to partition the disk and so on prior to installing NetBSD. Of course, I had just overwritten the Mac OS system with a non bootable NetBSD. I was now mad. Mad enough to install Linux on what was supposed to be my BSD system.</p>
<p>I first went to install Fedora (because I am used to it), but discovered that Red Hat and powerpc are no longer friends, not that I can blame them for not supporting the architecture, but it meant I had to keep looking. The ubuntu netinstall kernel etc from <a href="http://ports.ubuntu.com/ubuntu-ports/dists/maverick/main/installer-powerpc/current/images/powerpc/netboot/">http://ports.ubuntu.com/ubuntu-ports/dists/maverick/main/installer-powerpc/current/images/powerpc/netboot/</a> did not boot (yaboot loaded, the kernel loaded, but did not run). So I tried debian. It booted (with the boot loader, kernel and other files all loading from TFTP, no need for an NFS server, or another argument for the boot loader. All that was required was<br />
<code>boot enet:0,yaboot</code></p>
<p>The installer did not ask me to set up the network (unlike the NetBSD installer), it got all the settings from DHCP. It seemed strange that both Open Firmware and the Debian installer was capable of getting my network settings from DHCP, but the NetBSD installer was not able to do so.</p>
<p>The Debian installer allowed me to partition my disk, and the resulting install booted. All in all it took me less than an hour to install a working debian system, where it had taken me significantly longer to install a non booting NetBSD. Still I did not give up. When installing debian I added a 2GB HFS+ partition, and left a large amount of free space. And I went to install NetBSD again.</p>
<p>This time, while carefully reading the INSTALL document, I was able to netboot the installer, mount an NFS directory with a pdisk binary, format the partitions I wanted, and eventually install NetBSD and have it boot.</p>
<p>Of course, X11 did not work. Why would it? &#8220;Working&#8221; and &#8220;NetBSD installation&#8221; don&#8217;t seem to be terms that go together. Yes, I was getting madder. However, rebooting the system into debian, installing kde, and running it, showed that X11 wasn&#8217;t all that happy on Linux either. Ok, so maybe that wasn&#8217;t NetBSD&#8217;s fault <img src='http://pogma.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . A little google and a little guessing, led me to the following changes to my NetBSD 5.0.2 xorg.conf:</p>
<p>To the &#8220;Monitor&#8221; section, I added:<br />
<code><br />
        HorizSync     25-51<br />
        VertRefresh   43-60<br />
</code></p>
<p>To the &#8220;Device&#8221; section, I added:<br />
<code><br />
        Option      "UseFBDev" "False"<br />
</code></p>
<p>and to the &#8220;Screen&#8221; section, I removed everything but:<br />
<code><br />
Section "Screen"<br />
        Identifier "Screen0"<br />
        Device     "Card0"<br />
        Monitor    "Monitor0"<br />
        SubSection "Display"<br />
                Viewport   0 0<br />
                Depth     24<br />
                Modes   "1024x768"<br />
        EndSubSection<br />
EndSection<br />
</code></p>
<p>And viola, working NetBSD install with working X11. Finally, happy, I wondered what on earth I was going to use it for. I still don&#8217;t know, but I&#8217;m sure I will think of something. Like maybe letting it sit idle for another couple of years.</p>
]]></content:encoded>
			<wfw:commentRss>http://pogma.com/2010/10/31/ibook-g3-netbsd-and-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>history with timestamps</title>
		<link>http://pogma.com/2009/12/18/history-with-timestamps/</link>
		<comments>http://pogma.com/2009/12/18/history-with-timestamps/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 19:00:28 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[aside]]></category>
		<category><![CDATA[computers]]></category>

		<guid isPermaLink="false">http://pogma.com/?p=154</guid>
		<description><![CDATA[The other day I wanted to know when I had done something in my shell history, I asked on irc, and dre^ answered -> fc -d for zsh Now I find myself looking at fc -l -d even when I don&#8217;t really need timestamps % fc -l -d [snip] 356 14:56 vim sem.c 357 18:09 [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I wanted to know when I had done something in my shell history, I asked on irc, and <a href="http://dreness.com">dre^</a> answered -> fc -d for zsh</p>
<p>Now I find myself looking at fc -l -d even when I don&#8217;t really need timestamps <img src='http://pogma.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
<code>
<pre>
% fc -l -d
[snip]
  356  14:56  vim sem.c
  357  18:09  gmake
  358  18:10  vim buffer.c
</pre>
<p></code></p>
<p>It is possible to get similar behavior with bash:<br />
<code>
<pre>
$ HISTTIMEFORMAT="%T " history 3
 1386  09:36:54 grep -rl afio .
 1387  09:37:55 vim ChangeLog
 1388  12:56:57 HISTTIMEFORMAT="%T " history 3
</pre>
<p></code></p>
<p>Where HISTTIMEFORMAT uses an strftime string.</p>
<p>Yet another useless bit of knowledge!</p>
]]></content:encoded>
			<wfw:commentRss>http://pogma.com/2009/12/18/history-with-timestamps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moved to prgmr.com</title>
		<link>http://pogma.com/2009/12/14/moved-to-prgmr-com/</link>
		<comments>http://pogma.com/2009/12/14/moved-to-prgmr-com/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 03:07:33 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://pogma.com/?p=148</guid>
		<description><![CDATA[For nearly 9 years this site has been hosted at pair.com, and I have had no problems there. Any time I have contacted pair support, I have had excellent response, they host everything on FreeBSD, and have, in the past, made monetary contributions to the FreeBSD project. They seem to be very professional, and uptime [...]]]></description>
			<content:encoded><![CDATA[<p>For nearly 9 years this site has been hosted at <a href="http://pair.com">pair.com</a>, and I have had no problems there. Any time I have contacted pair support, I have had excellent response, they host everything on <a href="http://freebsd.org">FreeBSD</a>, and have, in the past, made monetary contributions to the FreeBSD project. They seem to be very professional, and uptime has been fantastic.</p>
<p>I have become more and more unhappy with their pricing though. I have been using pairs <a href="http://www.pair.com/services/web_hosting/">Advanced</a> account, which provides 1.5GB of disk space and 80GB/month bandwidth, and paying $20/month for it. A few years ago pair introduced a <a href="http://www.pairlite.com/hosting/">pairlite</a> service which would have suited my needs better, but I had already been a customer for years, and moving was harder than doing nothing, so I did nothing <img src='http://pogma.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p> I kept an eye on webhost pricing though, and finally my stinginess exceeded my laziness, and I decided to move. I looked at <a href="http://dreamhost.com">dreamhost</a>, tried a trial, liked it, but wanted more control, so I began to look for a VPS. Eventually I stumbled on  <a href="http://prgmr.com">Prgmr.com</a>. I don&#8217;t care if uptime is a little lower than it has been, it&#8217;s only a blog, a collection of random crap, and email. Prgmr is cheap, dirt cheap. For my same $20, I get a VPS with 22GB of disk space, 1024MB of memory, and 160GB/month bandwidth. Of course, it is no longer managed hosting, it is entirely DIY hosting. And that&#8217;s just fine <img src='http://pogma.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Not everything is moved to prgmr yet, web site is moved, so is DNS, email not yet. Will move that in a few days, and then finally cancel my account with pair.</p>
]]></content:encoded>
			<wfw:commentRss>http://pogma.com/2009/12/14/moved-to-prgmr-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Libtool 2.2.6b released</title>
		<link>http://pogma.com/2009/11/16/libtool-2-2-6b-released/</link>
		<comments>http://pogma.com/2009/11/16/libtool-2-2-6b-released/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 17:15:44 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[computers]]></category>

		<guid isPermaLink="false">http://pogma.com/?p=141</guid>
		<description><![CDATA[I released libtool 2.2.6b today. Yes, I have already taken flak for the stupid version numbering. I apologize. The release has only 2 real patches from 2.2.6, both for libltdl. See the announcement for slightly more detail. Some users may be stuck using an older libltdl for whatever reason, for those users the same changes [...]]]></description>
			<content:encoded><![CDATA[<p>I released libtool 2.2.6b today. Yes, I have already taken flak for the stupid version numbering. I apologize.</p>
<p>The release has only 2 real patches from 2.2.6, both for libltdl. See the <a href="http://lists.gnu.org/archive/html/libtool/2009-11/msg00059.html">announcement</a> for slightly more detail.</p>
<p>Some users may be stuck using an older libltdl for whatever reason, for those users the same changes are provided by <a href="http://git.savannah.gnu.org/cgit/libtool.git/patch/?id=29b48580df75f0c5baa2962548a4c101ec7ed7ec">this</a> untested patch.</p>
<p>[Update 2009-11-21]<br />
The change to libltdl to not search in the current working directory for modules when lt_dlopen() is called without an absolute path breaks at least <a href="http://www.mpg123.de/">mpg123</a>. <a href="http://paste.lisp.org/display/90875">This</a> patch should work around the problem until the mpg123 folks fix it.</p>
<p>[Update 2009-12-02]<br />
This release was to fix the now published <a href="http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2009-3736">CVE-2009-3736</a>. If you have not already updated, doing so soon is advisable.</p>
]]></content:encoded>
			<wfw:commentRss>http://pogma.com/2009/11/16/libtool-2-2-6b-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snow Leopard and offlineimap</title>
		<link>http://pogma.com/2009/09/09/snow-leopard-and-offlineimap/</link>
		<comments>http://pogma.com/2009/09/09/snow-leopard-and-offlineimap/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 13:58:41 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[computers]]></category>

		<guid isPermaLink="false">http://pogma.com/?p=133</guid>
		<description><![CDATA[Yesterday tjcarter was complaining in #fink about offlineimap not working on Snow Leopard, so last night I thought I&#8217;d take a look. Indeed, it doesn&#8217;t work, and the reason is that &#8216;import locale&#8217; is being called on a thread, which loads _locale.so, which requires that the CoreFoundation framework also be loaded. A simple reproducer in [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday tjcarter was complaining in #fink about <a href="http://www.sturmnet.org/blog/2009/09/02/using-offlineimap-on-snow-leopard-the-re">offlineimap not working on Snow Leopard</a>, so last night I thought I&#8217;d take a look.</p>
<p>Indeed, it doesn&#8217;t work, and the reason is that &#8216;import locale&#8217; is being called on a thread, which loads _locale.so, which requires that the CoreFoundation framework also be loaded. A simple reproducer in python is:<br />
<code></p>
<pre>
import os, sys
import threading
class Foo(threading.Thread):
	def __init__(self):
		threading.Thread.__init__(self)
	def run(self):
		import locale

t = Foo()
t.start()
</pre>
<p></code></p>
<p>The CoreFoundation framework must be loaded on the &#8220;main&#8221; thread, its initialization expects that, if it is loaded on some other thread, then it causes the application to exit rather abruptly. You can reproduce the same thing easily in C with:<br />
<code></p>
<pre>
#include &lt;dlfcn.h&gt;
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;pthread.h&gt;

void* do_open(void* unused) {
        void * handle = dlopen("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation", RTLD_GLOBAL);
        if (! handle) fprintf(stderr,"ERROR: %s\n",dlerror());
        pthread_exit(NULL);
}

int main() {
        pthread_t t;
        pthread_attr_t a;
        if (pthread_attr_init(&#038;a)) exit(1);
        if (pthread_create(&#038;t,&#038;a,do_open,NULL)) exit(2);
        pthread_attr_destroy(&#038;a);
        sleep(5);
        return 0;
}
</pre>
<p></code></p>
<p>The failure can be avoided/worked around by ensuring that CoreFoundation is loaded on the main thread. For offlineimap, a simple way to do this is to put &#8216;import locale&#8217; in the main script before init.startup is run. This will load _locale.so and thus CoreFoundation. CoreFoundation will run its initializers, and all will be well.</p>
<p>I am pretty sure that I have seen it documented somewhere that Apple&#8217;s frameworks must be loaded on the main thread, but I don&#8217;t seem to be able to find that documentation this morning (perhaps I just need more coffee?). In any case, loading any libraries that you need at application startup before you go spinning off threads is, in my opinion, a reasonable solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://pogma.com/2009/09/09/snow-leopard-and-offlineimap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Road Trip 2009</title>
		<link>http://pogma.com/2009/09/04/road-trip-2009/</link>
		<comments>http://pogma.com/2009/09/04/road-trip-2009/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 19:47:23 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Road Trip]]></category>

		<guid isPermaLink="false">http://pogma.com/?p=125</guid>
		<description><![CDATA[August 18th. Left home late, drove to the border, and on to Fargo. Bought a disposable phone in case we needed it for emergencies etc. (we didn&#8217;t) and then on to Montana. We had planned to make it all the way to Billings, MT the first day, but due to leaving late etc. instead planned [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://pogma.com/misc/roadtrip.jpg" alt="Google Earth route of roadtrip" width="500" /><br />
August 18th. Left home late, drove to the border, and on to Fargo. Bought a disposable phone in case we needed it for emergencies etc. (we didn&#8217;t) and then on to Montana. We had planned to make it all the way to Billings, MT the first day, but due to leaving late etc. instead planned on staying in Glendive.</p>
<p>Got to Glendive late, and all the hotels were full of road construction workers, so drove on to Miles City. Stayed in Motel 6. It was ok, clean, wifi worked at night, but not in the morning.</p>
<p>August 19th, drove to Pocatello, ID. 531 miles, 9 and a half hours. Drove through the north west corner of Yellowstone park. Lots of roadworks, but it was ok as the scenery was worth looking at.</p>
<p>Stayed at the Best Western Cottontree Inn, very nice room. Internet worked well, good breakfast included.</p>
<p>Next day, drove to Las Vegas. Shannon drove for a hundred miles or so, the only time she drove this trip. The road south from Salt Lake City is extremely boring, nobody bothered going the speed limit, unlike North Dakota, Montana and Idaho, where most drivers seemed to stay at or under it. In fact, Utah, Nevada, California, and Oregon seemed to require speeding.</p>
<p>Arrived at Circus Circus, cheap room, old, internet was $12/day extra (and was incapable, at times, of streaming video from Hulu, or Disney.com). 110F, we walked down the strip a little, too hot. Jessica&#8217;s crocs began to melt.</p>
<p>Next day was hotter, we went to Hoover Dam. The tour inside the dam was nice and cool, but outside was almost unbearable. The afternoon and evening were at the pool, or in the Casino.</p>
<p>Another boring drive across the desert to Anaheim. Stayed at another Best Western for three nights. Disneyland, 2 days. Compromise is sometimes necessary.</p>
<p>August 25th &#8211; drove to Monterey. Tried to stay on the coast highway, but our GPS (&#8220;Nancy the Navigator&#8221;) wanted us on the interstate, so we sometimes strayed. Stayed at the Monterey Surf Inn. Very nice room. Internet was acceptable.</p>
<p>August 26th, went to the Monterey Aquarium, it was fantastic. We were there for 3 hours and still missed stuff.</p>
<p>Drove to Boulder Creek for lunch on highway 9. Two beers, hot dog, and 2 burgers and fries for $15. Don&#8217;t know how much the new brakes for the minivan will be yet.</p>
<p>Stopped in at Apple and said &#8220;Hi&#8221;, then drove to San Francisco. We had planned to stay at the Travelodge, but the bulletproof glass, and the police tape put us off (though $39 for a room was tempting), so we stayed at yet another Best Western instead. The free wifi was barely usable, but the room was again, very nice. No free breakfast.</p>
<p>Next day, bought 3 one-day passes for the Muni, and did a few touristy things, rode the streetcar and the cable car, went to chinatown, took a &#8220;rocket boat&#8221; tour of the bay. We had wanted to visit alcatraz, but the tours were sold out 4 days in advance.</p>
<p>The next day, drove over the Golden Gate bridge, and did the winery thing. Went to Benziger winery and did the tour, tasted some wine, and bought a $40 bottle of Merlot. Then went to Kaz winery, paid $5 and tried 6 wines, bought none. St Francis winery, I did note taste, they thoughtfully provided Jessica with crayons and paper, Shannon tasted everything and bought a $20 bottle of Cabernet Sauvignon. On our way back to the coast we stopped in at Yorkville Cellars and bought a $25 bottle of Malbec.</p>
<p>We drove to Fort Bragg and stayed in the Travelodge. The room was ok, internet was not. One WAP that (speculation) could maybe handle 5 simultaneous clients, and a single residential comcast connection for the entire hotel. Glass beach was interesting the next morning.</p>
<p>Next day continued up the coast to Oregon, and the Pacific Beach resort in Gold Beach. This place also had &#8220;free wifi&#8221; &#8211; as long as you connected to the next door hotel&#8217;s access point. Unsurprisingly that was overloaded. Wandered along the beach, looking at driftwood.</p>
<p>Started heading back the next day. Put &#8220;Coeur D&#8217;Alene&#8221; as the destination into the GPS, and it took us over some interesting mountain pass. Shannon was mad (and scared). We did make it all the way, with few stops, and stayed at the Motel 6 in Coeur D&#8217;Alene. Hotel wifi was $3/24 hours, but was excellent.</p>
<p>Long drive to Glendive next day. Stayed in another Best Western. Good. Nice breakfast, pool. Glendive is a small place, not a lot there.</p>
<p>Next day, to Grand Forks, and the CanadInn, with the water slide park etc. Jessica enjoyed it. Then a little shopping, and home.</p>
<p>A compressed gps log of the trip is <a href="http://pogma.com/misc/roadtrip.gpx.gz">here</a>, if you are so inclined, you can download it, decompress it and load it into google earth.</p>
<p>Photos are<a href="http://pogma.com/gallery/v/roadtrip/">here</a> though we have not uploaded all of them (and I haven&#8217;t bothered GPS tagging them).</p>
<p>In case you&#8217;re wondering what the heck I was using the hotel wifi for everywhere, it was to plan the next days trip. We did not have much of a plan in advance, and had to figure it out as we went. In some cases (Circus Circus), the hotel did not provide kids TV channels, so we used the internet to watch TV. Also, I can&#8217;t go very long without checking my email <img src='http://pogma.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://pogma.com/2009/09/04/road-trip-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>odcctools-20090808</title>
		<link>http://pogma.com/2009/08/08/odcctools-20090808/</link>
		<comments>http://pogma.com/2009/08/08/odcctools-20090808/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 21:28:48 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[computers]]></category>

		<guid isPermaLink="false">http://pogma.com/?p=114</guid>
		<description><![CDATA[I released odcctools today, no changes for the last month or so, so I thought I had better put something out there. http://svn.macosforge.org/repository/odcctools/release/odcctools-20090808.tar.bz2]]></description>
			<content:encoded><![CDATA[<p>I released odcctools today, no changes for the last month or so, so I thought I had better put something out there.</p>
<p><a href="http://svn.macosforge.org/repository/odcctools/release/odcctools-20090808.tar.bz2">http://svn.macosforge.org/repository/odcctools/release/odcctools-20090808.tar.bz2</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pogma.com/2009/08/08/odcctools-20090808/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alignment</title>
		<link>http://pogma.com/2009/04/05/alignment/</link>
		<comments>http://pogma.com/2009/04/05/alignment/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 04:20:17 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://pogma.com/?p=95</guid>
		<description><![CDATA[Due to some recent bus errors, I have been thinking a bit about alignment lately. When the compiler lays out a struct it will generally ensure that the members of the struct are aligned on the required boundaries for the target architecture. For example, given: struct foo { int32_t a; int16_t b; }; A compiler [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Due to some recent bus errors, I have been thinking a bit about alignment lately.</p>
<p style="text-align: justify;">When the compiler lays out a struct it will generally ensure that the members of the struct are aligned on the required boundaries for the target architecture. For example, given:</p>
<p><code>struct foo {<br />
int32_t a;<br />
int16_t b;<br />
};</code><br />
A compiler may lay it out something like this:</p>
<table style="text-align: center; color: black; border: thin solid #000000;" border="0" cellspacing="0" cellpadding="0" width="200" align="center">
<tbody>
<tr>
<td style="background:green; border: thin solid #000000;" width="120">0x??????04</td>
<td style="background:orange; text-align: center;border: thin solid #000000;" rowspan="4">a</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????05</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????06</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????07</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????08</td>
<td style="background:red; text-align: center;border: thin solid #000000;" rowspan="2">b</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????09</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????0A</td>
<td style="background: yellow; text-align: center;border: thin solid #000000;" rowspan="2">pad</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????0B</td>
</tr>
</tbody>
</table>
<p style="text-align: justify;">The entire struct will likely be placed at an address aligned on a 4 byte boundary because the largest struct member is 4 bytes long, and the int16 type will be followed by a 2 byte pad. Why? So that an array of structs will have the &#8216;a&#8217; member for all array elements aligned on a 4 byte boundary. All is good, right?</p>
<p style="text-align: justify;">If we add a char to the struct:</p>
<p><code>struct foo {<br />
int32_t a;<br />
char c;<br />
int16_t b;<br />
};</code></p>
<table style="text-align: center; color: black; border: thin solid #000000;" border="0" cellspacing="0" cellpadding="0" width="200" align="center">
<tbody>
<tr>
<td style="background:green; border: thin solid #000000;" width="120">0x??????04</td>
<td style="background:orange; text-align: center;border: thin solid #000000;" rowspan="4">a</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????05</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????06</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????07</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????08</td>
<td style="background: pink; text-align: center;border: thin solid #000000;">c</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????09</td>
<td style="background: yellow; text-align: center;border: thin solid #000000;">pad</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????0A</td>
<td style="background:red; text-align: center;border: thin solid #000000;" rowspan="2">b</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????0B</td>
</tr>
</tbody>
</table>
<p style="text-align: justify;">Changing our char type to a 64 bit type may result in something like this:</p>
<p><code>struct foo {<br />
int32_t a;<br />
int64_t c;<br />
int16_t b;<br />
};</code></p>
<table style="text-align: center; color: black; border: thin solid #000000;" border="0" cellspacing="0" cellpadding="0" width="200" align="center">
<tbody>
<tr>
<td style="background:green; border: thin solid #000000;" width="120">0x??????00</td>
<td style="background:orange; text-align: center;border: thin solid #000000;" rowspan="4">a</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????01</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????02</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????03</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????04</td>
<td style="background: yellow; text-align: center;border: thin solid #000000;" rowspan="4">pad</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????05</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????06</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????07</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????08</td>
<td style="background: pink; text-align: center;border: thin solid #000000;" rowspan="8">c</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????09</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????0A</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????0B</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????0C</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????0D</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????0E</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????0F</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????10</td>
<td style="background:red; text-align: center;border: thin solid #000000;" rowspan="2">b</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????11</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????12</td>
<td style="background: yellow; text-align: center;border: thin solid #000000;" rowspan="6">pad</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????13</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????14</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????15</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????16</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????17</td>
</tr>
</tbody>
</table>
<p style="text-align: justify;">In this case (for this imaginary compiler) the entire struct is aligned on an 8 byte boundary, with the 8 byte member also aligned on an 8 byte boundary. So we can still create an array of struct foo, and things will be properly aligned. Of course, even though the individual members of the structure are 4, 8 and 2 bytes long, the entire structure with padding is 24 bytes long, so 10 bytes are &#8220;wasted&#8221;, it is best to design structs with this in mind, so that my imaginary compiler does not waste space. In the above case, changing the order of the elements is helpful:</p>
<p><code>struct foo {<br />
int32_t a;<br />
int16_t b;<br />
int64_t c;<br />
};</code></p>
<table style="text-align: center; color: black; border: thin solid #000000;" border="0" cellspacing="0" cellpadding="0" width="200" align="center">
<tbody>
<tr>
<td style="background:green; border: thin solid #000000;" width="120">0x??????00</td>
<td style="background:orange; text-align: center;border: thin solid #000000;" rowspan="4">a</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????01</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????02</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????03</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????04</td>
<td style="background:red; text-align: center;border: thin solid #000000;" rowspan="2">b</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????05</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????06</td>
<td style="background: yellow; text-align: center;border: thin solid #000000;" rowspan="2">pad</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????07</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????08</td>
<td style="background: pink; text-align: center;border: thin solid #000000;" rowspan="8">c</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????09</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????0A</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????0B</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????0C</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????0D</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????0E</td>
</tr>
<tr height="13">
<td style="background:green;border: thin solid #000000;">0x??????0F</td>
</tr>
</tbody>
</table>
<p>Now, on some systems a program will run faster if types are aligned &#8220;properly&#8221;, on others a bus error will occur for misaligned access. Misaligned access will often occur in cases like this:<code><br />
char array[1024];<br />
...<br />
struct foo * bar = (struct foo *)array;<br />
bar-&gt;c = 1;<br />
</code></p>
<p style="text-align: justify;">In the above case, although the array certainly is large enough to hold a foo structure, there is no guarantee that a char will be aligned on an 8 byte boundary, it is a 1 byte type, so there is no need for the compiler to align it. Because of this bar-&gt;c = 1; could cause a bus error. Other  bus errors can occur casting structs of the same size, but with different alignment requirements, etc.</p>
<p style="text-align: justify;">At least firefox works for us on HP-UX now <img src='http://pogma.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="text-align: justify;">Shantonu noted that for gcc, using -Wcast-align will at least warn about this issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://pogma.com/2009/04/05/alignment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac for Linux Geeks</title>
		<link>http://pogma.com/2009/02/04/mac-for-linux-geeks/</link>
		<comments>http://pogma.com/2009/02/04/mac-for-linux-geeks/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 17:14:25 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[computers]]></category>

		<guid isPermaLink="false">http://pogma.com/?p=87</guid>
		<description><![CDATA[I was the Technical Reviewer for the book Mac for Linux Geeks, from Apress, Inc. by Tony Steidler-Dennison. It was my first time to be a Technical Reviewer, it was interesting, but not something I plan on repeating, it simply took up too much time, with not enough pay. Getting paid by the page is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://apress.com/book/view/9781430216506"><img class="alignleft" title="Mac for Linux Geeks" src="http://apress.com/resource/bookcover/9781430216506?size=medium" alt="Cover of the book Mac for Linux Geeks" /></a>I was the Technical Reviewer for the book Mac for Linux Geeks, from Apress, Inc. by Tony  Steidler-Dennison. It was my first time to be a Technical Reviewer, it was interesting, but not something I plan on repeating, it simply took up too much time, with not enough pay. Getting paid by the page is not a good thing.</p>
<p>This is not a book review, I don&#8217;t think that I would be a good reviewer, being biased, as I am. Please find reviews elsewhere &#8211; although a quick look at amazon shows none there yet, unfortunately.</p>
<p>[EDIT June 22nd 2009] Found a review here <a href="http://hants.lug.org.uk/cgi-bin/wiki.pl?BookReviews/MacForLinuxGeeks">http://hants.lug.org.uk/cgi-bin/wiki.pl?BookReviews/MacForLinuxGeeks</a>. It&#8217;s the only one I could find.</p>
]]></content:encoded>
			<wfw:commentRss>http://pogma.com/2009/02/04/mac-for-linux-geeks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

